Roxen.git / server / base_server / configuration.pike

version» Context lines:

Roxen.git/server/base_server/configuration.pike:1:   // A vitual server's main configuration   // Copyright © 1996 - 2000, Roxen IS.    - constant cvs_version = "$Id: configuration.pike,v 1.368 2000/09/13 11:36:04 lange Exp $"; + constant cvs_version = "$Id: configuration.pike,v 1.369 2000/09/13 14:09:35 jonasw Exp $";   constant is_configuration = 1;   #include <module.h>   #include <module_constants.h>   #include <roxen.h>   #include <request_trace.h>      inherit "basic_defvar";      mapping enabled_modules = ([]);   mapping(string:array(int)) error_log=([]);
Roxen.git/server/base_server/configuration.pike:760:   {    invalidate_cache();    foreach(indices(otomod), RoxenModule m)    if (m && m->clear_memory_caches)    if (mixed err = catch( m->clear_memory_caches() ))    report_error("clear_memory_caches() "+    LOC_M(40, "failed for module %O:\n%s\n"),    otomod[m], describe_backtrace(err));   }    - string draw_saturation_bar(int hue,int brightness, int where) + // Returns tuple < image, mime-type > + array(string) draw_saturation_bar(int hue,int brightness, int where)   {    Image.Image bar=Image.Image(30,256);       for(int i=0;i<128;i++)    {    int j = i*2;    bar->line(0,j,29,j,@hsv_to_rgb(hue,255-j,brightness));    bar->line(0,j+1,29,j+1,@hsv_to_rgb(hue,255-j,brightness));    }       where = 255-where;    bar->line(0,where,29,where, 255,255,255);    -  return Image.GIF.encode(bar); + #if constant(Image.GIF) && constant(Image.GIF.encode) +  return ({ Image.GIF.encode(bar), "image/gif" }); + #else +  return ({ Image.JPEG.encode(bar), "image/jpeg" }); + #endif   }         // Inspired by the internal-gopher-... thingie, this is the images   // from the administration interface. :-)   private mapping internal_roxen_image(string from)   {    sscanf(from, "%s.gif", from);    sscanf(from, "%s.jpg", from);    sscanf(from, "%s.xcf", from);    sscanf(from, "%s.png", from);       // Automatically generated colorbar. Used by wizard code...    int hue,bright,w; -  if(sscanf(from, "%*s:%d,%d,%d", hue, bright,w)==4) -  return Roxen.http_string_answer(draw_saturation_bar(hue,bright,w),"image/gif"); +  if(sscanf(from, "%*s:%d,%d,%d", hue, bright,w)==4) { +  array bar = draw_saturation_bar(hue, bright, w); +  return Roxen.http_string_answer(bar[0], bar[1]); +  }       Stdio.File f;       if(f = lopen("roxen-images/"+from+".gif", "r"))    return (["file":f, "type":"image/gif", "stat":f->stat()]);    if(f = lopen("roxen-images/"+from+".jpg", "r"))    return (["file":f, "type":"image/jpeg", "stat":f->stat()]);    if(f = lopen("roxen-images/"+from+".png", "r"))    return (["file":f, "type":"image/png", "stat":f->stat()]);    if(f = lopen("roxen-images/"+from+".xcf", "r"))