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.160 1998/11/22 17:03:18 per Exp $"; + constant cvs_version="$Id: graphic_text.pike,v 1.161 1998/12/30 00:13:47 js 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:734:   #define simplify_text( from ) replace(from,replace_from,replace_to)      #define CACHE_SIZE 2048      #define FNAME(a,b) (query("cache_dir")+sprintf("%x",hash(reverse(a[6..])))+sprintf("%x",hash(b))+sprintf("%x",hash(reverse(b-" ")))+sprintf("%x",hash(b[12..])))      array get_cache_file(string a, string b)   {    object fd = open(FNAME(a,b), "r");    if(!fd) return 0; +  catch {    array r = decode_value(fd->read());    if(r[0]==a && r[1]==b) return r[2]; -  +  };   }      void store_cache_file(string a, string b, array data)   {    object fd = open(FNAME(a,b), "wct");   #if constant(chmod)    // FIXME: Should this error be propagated?    catch { chmod( FNAME(a,b), 0666 ); };   #endif    if(!fd) return;