Branch: Tag:

1996-11-11

1996-11-11 23:31:54 by Per Hedbor <ph@opera.com>

Ny version... HATA CVS ibland

Rev: .cvsignore:1.1.1.1
Rev: BUGS:1.1.1.1
Rev: CHANGES:1.1.1.1
Rev: COPYING:1.1.1.1
Rev: INSTALLING:1.1.1.1
Rev: Makefile.in:1.1.1.1
Rev: README:1.1.1.1
Rev: TODO:1.1.1.1
Rev: configure.in:1.1.1.1
Rev: extern/.cvsignore:1.1.1.1
Rev: extern/Makefile.in:1.1.1.1
Rev: extern/README:1.1.1.1
Rev: extern/cgi.c:1.1.1.1
Rev: extern/configure.in:1.1.1.1
Rev: extern/fast_cgi/LICENSE.TERMS:1.1.1.1
Rev: extern/fast_cgi/Makefile.in:1.1.1.1
Rev: extern/fast_cgi/README:1.1.1.1
Rev: extern/fast_cgi/acconfig.h:1.1.1.1
Rev: extern/fast_cgi/cgi-fcgi/Makefile.in:1.1.1.1
Rev: extern/fast_cgi/cgi-fcgi/cgi-fcgi.c:1.1.1.1
Rev: extern/fast_cgi/configure.in:1.1.1.1
Rev: extern/fast_cgi/include/fastcgi.h:1.1.1.1
Rev: extern/fast_cgi/include/fcgi_stdio.h:1.1.1.1
Rev: extern/fast_cgi/include/fcgiapp.h:1.1.1.1
Rev: extern/fast_cgi/include/fcgiappmisc.h:1.1.1.1
Rev: extern/fast_cgi/include/fcgimisc.h:1.1.1.1
Rev: extern/fast_cgi/libfcgi/Makefile.in:1.1.1.1
Rev: extern/fast_cgi/libfcgi/fcgi_stdio.c:1.1.1.1
Rev: extern/fast_cgi/libfcgi/fcgiapp.c:1.1.1.1
Rev: extern/fast_cgi/libfcgi/strerror.c:1.1.1.1
Rev: extern/roxen_hostname.c:1.1.1.1
Rev: extern/shuffle.c:1.1.1.1
Rev: extern/ssl.c:1.1.1.1
Rev: install-sh:1.1.1.1
Rev: mkdir:1.1.1.1
Rev: pike/.cvsignore:1.1.1.1
Rev: pike/Makefile.in:1.1.1.1
Rev: pike/README:1.1.1.1
Rev: pike/ROXEN_PIKE_BASE:1.1.1.1
Rev: pike/configure.in:1.1.1.1
Rev: server/base_server/cache.pike:1.1.1.1
Rev: server/base_server/config/builders.pike:1.1.1.1
Rev: server/base_server/config/describers.pike:1.1.1.1
Rev: server/base_server/config/low_describers.pike:1.1.1.1
Rev: server/base_server/config/savers.pike:1.1.1.1
Rev: server/base_server/configuration.pike:1.1.1.1
Rev: server/base_server/db.pike:1.1.1.1
Rev: server/base_server/disk_cache.pike:1.1.1.1
Rev: server/base_server/dummy_hosts.pike:1.1.1.1
Rev: server/base_server/hosts.pike:1.1.1.1
Rev: server/base_server/html.pike:1.1.1.1
Rev: server/base_server/http.pike:1.1.1.1
Rev: server/base_server/language.pike:1.1.1.1
Rev: server/base_server/lock.pike:1.1.1.1
Rev: server/base_server/mainconfig.pike:1.1.1.1
Rev: server/base_server/module.pike:1.1.1.1
Rev: server/base_server/module_support.pike:1.1.1.1
Rev: server/base_server/newdecode.pike:1.1.1.1
Rev: server/base_server/persistent.pike:1.1.1.1
Rev: server/base_server/proxyauth.pike:1.1.1.1
Rev: server/base_server/read_config.pike:1.1.1.1
Rev: server/base_server/roxen.pike:1.1.1.1
Rev: server/base_server/roxenlib.pike:1.1.1.1
Rev: server/base_server/roxenloader.pike:1.1.1.1
Rev: server/base_server/socket.pike:1.1.1.1
Rev: server/base_server/spinnerlib.pike:1.1.1.1
Rev: server/base_server/struct/ftp_gateway_request.pike:1.1.1.1
Rev: server/base_server/struct/node.pike:1.1.1.1
Rev: server/bin/.cvsignore:1.1.1.1
Rev: server/bin/garbagecollector.pike:1.1.1.1
Rev: server/bin/install.pike:1.1.1.1
Rev: server/configvar:1.1.1.1
Rev: server/etc/config.html:1.1.1.1
Rev: server/etc/extensions:1.1.1.1
Rev: server/etc/include/array.h:1.1.1.1
Rev: server/etc/include/array.pre.pike:1.1.1.1
Rev: server/etc/include/config.h:1.1.1.1
Rev: server/etc/include/confignode.h:1.1.1.1
Rev: server/etc/include/fifo.h:1.1.1.1
Rev: server/etc/include/fifo.pre.pike:1.1.1.1
Rev: server/etc/include/getopt.h:1.1.1.1
Rev: server/etc/include/getopt.pre.pike:1.1.1.1
Rev: server/etc/include/module.h:1.1.1.1
Rev: server/etc/include/process.h:1.1.1.1
Rev: server/etc/include/process.pre.pike:1.1.1.1
Rev: server/etc/include/roxen.h:1.1.1.1
Rev: server/etc/include/simulate.h:1.1.1.1
Rev: server/etc/include/simulate.pre.pike:1.1.1.1
Rev: server/etc/include/stat.h:1.1.1.1
Rev: server/etc/include/stdio.h:1.1.1.1
Rev: server/etc/include/stdio.pre.pike:1.1.1.1
Rev: server/etc/include/string.h:1.1.1.1
Rev: server/etc/include/string.pre.pike:1.1.1.1
Rev: server/etc/include/syslog.h:1.1.1.1
Rev: server/etc/include/variables.h:1.1.1.1
Rev: server/etc/newconfig.html:1.1.1.1
Rev: server/etc/restart.html:1.1.1.1
Rev: server/etc/roxen_master.pike:1.1.1.1
Rev: server/etc/shutdown.html:1.1.1.1
Rev: server/etc/supports:1.1.1.1
Rev: server/etc/welcome.html:1.1.1.1
Rev: server/install:1.1.1.1
Rev: server/languages/catala.pike:1.1.1.1
Rev: server/languages/dutch.pike:1.1.1.1
Rev: server/languages/english.pike:1.1.1.1
Rev: server/languages/finnish.pike:1.1.1.1
Rev: server/languages/french.pike:1.1.1.1
Rev: server/languages/german.pike:1.1.1.1
Rev: server/languages/japanese.pike:1.1.1.1
Rev: server/languages/norwegian.pike:1.1.1.1
Rev: server/languages/spanish.pike:1.1.1.1
Rev: server/languages/swedish.pike:1.1.1.1
Rev: server/mkdir:1.1.1.1
Rev: server/modules/cgi.pike:1.1.1.1
Rev: server/modules/client_logger.pike:1.1.1.1
Rev: server/modules/connect.pike:1.1.1.1
Rev: server/modules/contenttypes.pike:1.1.1.1
Rev: server/modules/directories.pike:1.1.1.1
Rev: server/modules/fastdir.pike:1.1.1.1
Rev: server/modules/fcgi.pike:1.1.1.1
Rev: server/modules/filesystem.pike:1.1.1.1
Rev: server/modules/ftpgateway.pike:1.1.1.1
Rev: server/modules/gopher.pike:1.1.1.1
Rev: server/modules/header.pike:1.1.1.1
Rev: server/modules/home_logger.pike:1.1.1.1
Rev: server/modules/hostredirect.pike:1.1.1.1
Rev: server/modules/htaccess.pike:1.1.1.1
Rev: server/modules/htmlparse.pike:1.1.1.1
Rev: server/modules/indexfiles.pike:1.1.1.1
Rev: server/modules/indirect_href.pike:1.1.1.1
Rev: server/modules/ismap.pike:1.1.1.1
Rev: server/modules/language.pike:1.1.1.1
Rev: server/modules/lpcscript.pike:1.1.1.1
Rev: server/modules/lpctag.pike:1.1.1.1
Rev: server/modules/nologging.pike:1.1.1.1
Rev: server/modules/proxy.pike:1.1.1.1
Rev: server/modules/redirect.pike:1.1.1.1
Rev: server/modules/relay.pike:1.1.1.1
Rev: server/modules/secure_fs.pike:1.1.1.1
Rev: server/modules/tablist.pike:1.1.1.1
Rev: server/modules/userdb.pike:1.1.1.1
Rev: server/modules/userfs.pike:1.1.1.1
Rev: server/modules/variable.pike:1.1.1.1
Rev: server/modules/wais.pike:1.1.1.1
Rev: server/more_modules/bofh.pike:1.1.1.1
Rev: server/more_modules/clock.pike:1.1.1.1
Rev: server/more_modules/configure.pike:1.1.1.1
Rev: server/more_modules/lysator.pike:1.1.1.1
Rev: server/more_modules/tablify.pike:1.1.1.1
Rev: server/protocols/ftp.pike:1.1.1.1
Rev: server/protocols/gopher.pike:1.1.1.1
Rev: server/protocols/http.pike:1.1.1.1
Rev: server/protocols/ssl.pike:1.1.1.1
Rev: server/roxen-images/back.gif:1.1.1.1
Rev: server/roxen-images/background.jpg:1.1.1.1
Rev: server/roxen-images/changed.gif:1.1.1.1
Rev: server/roxen-images/delconf.gif:1.1.1.1
Rev: server/roxen-images/delmod.gif:1.1.1.1
Rev: server/roxen-images/delmodcop.gif:1.1.1.1
Rev: server/roxen-images/dir/binary.gif:1.1.1.1
Rev: server/roxen-images/dir/image.gif:1.1.1.1
Rev: server/roxen-images/dir/menu.gif:1.1.1.1
Rev: server/roxen-images/dir/sound.gif:1.1.1.1
Rev: server/roxen-images/dir/text.gif:1.1.1.1
Rev: server/roxen-images/dir/unknown.gif:1.1.1.1
Rev: server/roxen-images/fold.gif:1.1.1.1
Rev: server/roxen-images/fold2.gif:1.1.1.1
Rev: server/roxen-images/foldall.gif:1.1.1.1
Rev: server/roxen-images/infovav.gif:1.1.1.1
Rev: server/roxen-images/left.gif:1.1.1.1
Rev: server/roxen-images/newconf.gif:1.1.1.1
Rev: server/roxen-images/newmod.gif:1.1.1.1
Rev: server/roxen-images/off.gif:1.1.1.1
Rev: server/roxen-images/on.gif:1.1.1.1
Rev: server/roxen-images/power.gif:1.1.1.1
Rev: server/roxen-images/power_anim.gif:1.1.1.1
Rev: server/roxen-images/refresh.gif:1.1.1.1
Rev: server/roxen-images/restart.gif:1.1.1.1
Rev: server/roxen-images/right.gif:1.1.1.1
Rev: server/roxen-images/roxen.gif:1.1.1.1
Rev: server/roxen-images/save.gif:1.1.1.1
Rev: server/roxen-images/shutdown.gif:1.1.1.1
Rev: server/roxen-images/tablists/1.gif:1.1.1.1
Rev: server/roxen-images/tablists/10.gif:1.1.1.1
Rev: server/roxen-images/tablists/11.gif:1.1.1.1
Rev: server/roxen-images/tablists/12.gif:1.1.1.1
Rev: server/roxen-images/tablists/13.gif:1.1.1.1
Rev: server/roxen-images/tablists/14.gif:1.1.1.1
Rev: server/roxen-images/tablists/15.gif:1.1.1.1
Rev: server/roxen-images/tablists/16.gif:1.1.1.1
Rev: server/roxen-images/tablists/2.gif:1.1.1.1
Rev: server/roxen-images/tablists/3.gif:1.1.1.1
Rev: server/roxen-images/tablists/4.gif:1.1.1.1
Rev: server/roxen-images/tablists/5.gif:1.1.1.1
Rev: server/roxen-images/tablists/6.gif:1.1.1.1
Rev: server/roxen-images/tablists/7.gif:1.1.1.1
Rev: server/roxen-images/tablists/8.gif:1.1.1.1
Rev: server/roxen-images/tablists/9.gif:1.1.1.1
Rev: server/roxen-images/top.gif:1.1.1.1
Rev: server/roxen-images/unfold.gif:1.1.1.1
Rev: server/roxen-images/unfold2.gif:1.1.1.1
Rev: server/roxen-images/unmod.gif:1.1.1.1
Rev: server/roxen-images/up.gif:1.1.1.1
Rev: server/roxen-images/zap.gif:1.1.1.1
Rev: server/start:1.1.1.1
Rev: server/unfinishedmodules/deepthought.pike:1.1.1.1
Rev: server/unfinishedmodules/extended_logger.pike:1.1.1.1
Rev: server/unfinishedmodules/fastcgi.pike:1.1.1.1
Rev: server/unfinishedmodules/hedbor.pike:1.1.1.1
Rev: server/unfinishedmodules/httpc.lpc.gz:1.1.1.1
Rev: server/unfinishedmodules/javascript.pike:1.1.1.1
Rev: server/unfinishedmodules/mirror.lpc.gz:1.1.1.1
Rev: server/unfinishedmodules/mountserver.pike:1.1.1.1
Rev: server/unfinishedmodules/tree.pike:1.1.1.1
Rev: server/unfinishedmodules/whois++.pike:1.1.1.1
Rev: tools/Makefile:1.1.1.1
Rev: tools/accessed.lpc:1.1.1.1
Rev: tools/backlog-bumper:1.1.1.1
Rev: tools/htpasswd.c:1.1.1.1
Rev: tools/init.d_roxen:1.1.1.1
Rev: tools/xdumpfont/Makefile:1.1.1.1
Rev: tools/xdumpfont/README:1.1.1.1
Rev: tools/xdumpfont/banner.c:1.1.1.1
Rev: tools/xdumpfont/fontdemo.c:1.1.1.1
Rev: tools/xdumpfont/makefonts.lpc:1.1.1.1
Rev: tools/xdumpfont/readfont.c:1.1.1.1
Rev: tools/xdumpfont/readfont.h:1.1.1.1
Rev: tools/xdumpfont/xdumpfont.c:1.1.1.1

1: + #include <module.h> + object this = this_object();    -  + mapping (string:mixed *) variables=([]); +  + object my_configuration() + { +  object conf; +  foreach(roxen->configurations, conf) +  if(conf->otomod[this]) +  return conf; +  return 0; + } +  + string module_creator; + string module_url; +  + void set_module_creator(string c) + { +  module_creator = c; + } +  + void set_module_url(string to) + { +  module_url = to; + } +  + int killvar(string var) + { +  if(!variables[var]) +  error("Killing undefined variable.\n"); +  m_delete(variables, var); +  return 1; + } +  + void free_some_sockets_please(){} +  + void start(void|int num) {} + string status() {} +  + string info() + { +  return this->register_module()[2]; + } +  + // Define a variable, with more than a little error checking... + varargs int defvar(string var, mixed value, string name, int type, +  string doc_str, mixed misc, int|function not_in_config) + { +  if(!strlen(var)) +  error("No name for variable!\n"); +  +  if(var[0]=='_' && previous_object() != roxen) +  error("Variable names beginning with '_' are reserved for" +  " internal usage.\n"); +  +  if (!stringp(name)) +  name = var; +  +  if (!stringp(doc_str)) +  doc_str = "No documentation"; +  +  switch (type & VAR_TYPE_MASK) +  { +  case TYPE_TEXT_FIELD: +  case TYPE_FILE: +  case TYPE_STRING: +  case TYPE_LOCATION: +  if(value && !stringp(value)) +  error("Passing illegal value to string type variable.\n"); +  break; +  +  case TYPE_FLOAT: +  if(!floatp(value)) +  error("Passing illegal value (not float) to floating point " +  "decimal number variable.\n"); +  break; +  case TYPE_INT: +  if(!intp(value)) +  error("Passing illegal value (not int) to integer number variable.\n"); +  break; +  +  case TYPE_MODULE_LIST: +  value = ({}); +  break; +  +  case TYPE_MODULE: +  /* No default possible */ +  value = 0; +  break; +  +  case TYPE_DIR_LIST: +  int i; +  if(!arrayp(value)) +  error("Illegal type to TYPE_DIR_LIST, must be array.\n"); +  for(i=0; i<sizeof(value); i++) +  if(strlen(value[i])) +  { +  if(value[i][-1] != '/') +  value[i] += "/"; +  } else { +  value[i]="./"; +  } +  break; +  +  case TYPE_DIR: +  if(value && !stringp(value)) +  error("Passing illegal value (not string) to directory variable.\n"); +  +  if(value && strlen(value) && ((string)value)[-1] != '/') +  value+="/"; +  break; +  +  case TYPE_INT_LIST: +  case TYPE_STRING_LIST: +  if(!misc && value && !arrayp(value)) +  error("Passing illegal misc (not array) to multiple choice variable.\n"); +  if(misc && !arrayp(misc)) +  error("Passing illegal misc (not array) to multiple choice variable.\n"); +  if(misc && search(misc, value)==-1) +  error("Passing value passed not present in the misc array.\n"); +  break; +  +  case TYPE_FLAG: +  value=!!value; +  break; +  +  case TYPE_ERROR: +  break; +  +  case TYPE_COLOR: +  if (!intp(value)) +  error("Passing illegal value (not int) to color variable.\n"); +  break; +  +  default: +  error("Illegal type ("+type+") in defvar.\n"); +  } +  +  variables[var]=allocate( VAR_SIZE ); +  if(!variables[var]) +  error("Out of memory in defvar.\n"); +  variables[var][ VAR_VALUE ]=value; +  variables[var][ VAR_TYPE ]=type&VAR_TYPE_MASK; +  variables[var][ VAR_DOC_STR ]=doc_str; +  variables[var][ VAR_NAME ]=name; +  if((type&~VAR_TYPE_MASK) & VAR_EXPERT) +  variables[var][ VAR_CONFIGURABLE ] = VAR_EXPERT; +  else +  if(intp(not_in_config)) +  variables[var][ VAR_CONFIGURABLE ]= !not_in_config; +  else if(functionp(not_in_config)) +  variables[var][ VAR_CONFIGURABLE ]= not_in_config; +  variables[var][ VAR_MISC ]=misc; +  variables[var][ VAR_SHORTNAME ]= var; + } +  +  + // Convenience function, define an invissible variable, this variable + // will be saved, but it won't be vissible in the configuration interface. + int definvisvar(string name, int value, int type, array|void misc) + { +  return defvar(name, value, "", type, "", misc, 1); + } +  + string check_variable( string s, mixed value ) + { +  // Check if `value' is O.K. to store in the variable `s'. If so, +  // return 0, otherwise return a string, describing the error. +  +  return 0; + } +  + varargs mixed query(string var, int ok) + { +  if(var) +  if(variables[var]) +  return variables[var][VAR_VALUE]; +  else if(!ok) +  error("Querying undefined variable.\n"); +  +  return variables; + } +  + void set_module_list(string var, string what, object to) + { +  int p; +  p = search(variables[var][VAR_VALUE], what); +  if(p == -1) +  { + #ifdef MODULE_DEBUG +  perror("The variable '"+var+"': '"+what+"' found by hook.\n"); +  perror("Not found in variable!\n"); + #endif +  } else +  variables[var][VAR_VALUE][p]=to; + } +  + void set(string var, mixed value) + { +  if(!variables[var]) +  error( "Setting undefined variable.\n" ); +  else +  if(variables[var][VAR_TYPE] == TYPE_MODULE && stringp(value)) +  roxen->register_module_load_hook( value, set, var ); +  else if(variables[var][VAR_TYPE] == TYPE_MODULE_LIST) +  { +  variables[var][VAR_VALUE]=value; +  if(arrayp(value)) +  foreach(value, value) +  if(stringp(value)) +  roxen->register_module_load_hook(value,set_module_list,var,value); +  } +  else +  variables[var][VAR_VALUE]=value; + } +  + int setvars( mapping (string:mixed) vars ) + { +  string v; +  int err; +  +  foreach( indices( vars ), v ) +  if(variables[v]) +  set( v, vars[v] ); +  return !err; + } +  +  + string comment() + { +  return ""; + } +  + /* +  * Parse and return a parsed version of the security levels for this module +  * +  */ +  + array query_seclevels() + { +  string sl, sec; +  array patterns=({ }); +  +  if(catch(query("_seclevels"))) +  return patterns; +  +  foreach(replace(query("_seclevels"),({" ","\t","\\\n"}),({"","",""}))/"\n",sl) +  { +  if(!strlen(sl) || sl[0]=='#') +  continue; +  string type, value; +  if(sscanf(sl, "%s=%s", type, value)==2) +  { +  value = replace(value, ({ "?", ".", "*" }), ({ ".", "\.", ".*" })); +  switch(type) +  { +  case "allowip": +  patterns += ({ ({ MOD_ALLOW, new(Regexp, value)->match, }) }); +  break; +  +  case "denyip": +  patterns += ({ ({ MOD_DENY, new(Regexp,value)->match, }) }); +  break; +  +  case "allowuser": +  value = replace("("+(value/",")*")|("+")","(any)","(.*)"); +  patterns += ({ ({ MOD_USER, new(Regexp, value)->match, }) }); +  break; +  } +  } +  } +  return patterns; + } +  +  + mixed stat_file(string f, object id){} + mixed find_dir(string f, object id){} + mixed real_file(string f, object id){} +    Newline at end of file added.