Branch: Tag:

1998-02-04

1998-02-04 05:17:58 by Per Hedbor <ph@opera.com>

added API function support (For scripting languages)

Rev: server/base_server/configuration.pike:1.91
Rev: server/base_server/module.pike:1.28
Rev: server/base_server/roxen.pike:1.161
Rev: server/base_server/roxenloader.pike:1.54

1: - string cvs_version = "$Id: configuration.pike,v 1.90 1998/01/30 02:59:00 grubba Exp $"; + string cvs_version = "$Id: configuration.pike,v 1.91 1998/02/04 05:17:55 per Exp $";   #include <module.h>   #include <roxen.h>   /* A configuration.. */
352:    return url_module_cache;   }    + mapping api_module_cache = ([]); + array (function) api_functions(object id) + { +  return copy_value(api_module_cache); + } +    array (function) logger_modules(object id)   {    if(!logger_module_cache)
1518:   }      mapping (object:array) open_ports = ([]); -  + int ports_changed = 1;   void start(int num)   {    array port;
1528:       parse_log_formats();    init_log_file(); -  map(indices(open_ports), do_dest); +     -  +  if(ports_changed) +  { +  ports_changed=0;    perror("Opening ports for "+query_name()+"... ");    foreach(query("Ports"), port ) { -  +  int already_open; +  foreach(values(open_ports), array op) +  if(equal(op,port)) { already_open=1;break; } +  if(already_open) continue;    array old = port;    mixed erro;    erro = catch {
1571:    }    perror("\n");    } +  }    if(!num && sizeof(query("Ports")))    {    if(err == sizeof(query("Ports")))
1739: Inside #if defined(MODULE_DEBUG)
  #ifdef MODULE_DEBUG    perror("Initializing ");   #endif -  +     if (module->type & (MODULE_LOCATION | MODULE_EXTENSION |    MODULE_FILE_EXTENSION | MODULE_LOGGER |    MODULE_URL | MODULE_LAST |
1844:    pr = 3;    }    +  api_module_cache |= me->api_functions(); +     if(module->type & MODULE_EXTENSION) {    if (err = catch {    array arr = me->query_extensions();
1972:   {    switch(name)    { +  case "Ports": +  ports_changed=1; +  return 0;    case "MyWorldLocation":    if(strlen(value)<7 || value[-1] != '/' ||    !(sscanf(value,"%*s://%*s/")==2))    return "The URL should follow this format: protocol://computer[:port]/"; -  +  return 0;    }   }