Roxen.git / server / modules / graphics / graphic_text.pike

version» Context lines:

Roxen.git/server/modules/graphics/graphic_text.pike:1: - constant cvs_version="$Id: graphic_text.pike,v 1.143 1998/08/14 12:33:29 neotron Exp $"; + constant cvs_version="$Id: graphic_text.pike,v 1.144 1998/08/18 10:52:43 neotron Exp $";   constant thread_safe=1;      #include <module.h>   #include <stat.h>   inherit "module";   inherit "roxenlib";      #ifndef VAR_MORE   #define VAR_MORE 0   #endif /* VAR_MORE */
Roxen.git/server/modules/graphics/graphic_text.pike:772:    destruct(fd);   }         array(int)|string write_text(int _args, string text, int size, object id)   {    string key = base_key+_args;    array err;    string orig_text = text;    mixed data; -  mapping args = find_cached_args(_args); +  mapping args = find_cached_args(_args) || ([]);    -  if(!args) -  { -  throw( ({ "Internal error in gtext: Got request for non-existant gtext class", backtrace() }) ); -  } +     if(data = cache_lookup(key, text))    {    if(args->nocache) // Remove from cache. Very useful for access counters    cache_remove(key, text);    if(size) return data[1];    return data[0];    } else if(data = get_cache_file( key, text )) {    cache_set(key, text, data);    if(size) return data[1];    return data[0];    }    //werror("Not cached: %O -> %O\n", key, text);    //werror("In cache: %O\n", sort(indices(cache->cache)));       // So. We have to actually draw the thing...       err = catch    {    object img; -  if(!args) +  +  if(!sizeof(args))    {    args=(["fg":"black","bg":"white","notrans":"1"]);    text="Please reload this page";    } -  +     if(!args->verbatim)    {    text = replace(text, nbsp, " ");    text = simplify_text( text );    string res="",nspace="",cspace="";    foreach(text/"\n", string line)    {    cspace="";nspace="";    foreach(line/" ", string word)    {