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.131 1998/07/04 03:19:51 peter Exp $"; + constant cvs_version="$Id: graphic_text.pike,v 1.132 1998/07/04 21:57:38 per 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:968:    restore_cached_args();    return Array.map(indices(cached_args), lambda(mixed m){return (string)m;});    }    return ({"Example"});   }         mapping find_file(string f, object rid)   {    int id; -  if(rid->method != "GET") return 0; -  sscanf(f,"%d/%s", id, f); + #if constant(Gz) +  object g; + #endif    -  if( query("gif") ) //Remove .gif +  if((rid->method != "GET") +  || (sscanf(f,"%d/%s", id, f) != 2)) +  return 0; +  +  if( query("gif") && f[strlen(f)-4..]==".gif") // Remove .gif    f = f[..strlen(f)-5];    -  if (sizeof(f)) { -  object g; -  if (f[0] == '$') { // Illegal in BASE64 +  if(!sizeof(f)) // No string to write. +  return 0; +  +  if (f[0] == '$') // Illegal in BASE64    f = f[1..]; -  } else if (sizeof(indices(g=Gz))) { + #if constant(Gz) +  else if (sizeof(indices(g=Gz)))    catch(f = g->inflate()->inflate(MIME.decode_base64(f))); -  } else if (sizeof(f)) { + #endif +  else    catch(f = MIME.decode_base64(f)); -  } -  } +     -  +  // Generate the image.    return http_string_answer(write_text(id,f,0,rid), "image/gif");   }   mapping url_cache = ([]);   string quote(string in)   {    string option;    if(option = url_cache[in]) return option;    object g;    if (sizeof(indices(g=Gz))) {    option=MIME.encode_base64(g->deflate()->deflate(in));