pike.git / lib / master.pike.in

version» Context lines:

pike.git/lib/master.pike.in:1:   // -*- Pike -*-   //   // Master Control Program for Pike.   //   // This file is part of Pike. For copyright information see COPYRIGHT.   // Pike is distributed under GPL, LGPL and MPL. See the file COPYING   // for more information.   // - // $Id: master.pike.in,v 1.404 2007/10/02 16:52:25 grubba Exp $ + // $Id: master.pike.in,v 1.405 2007/11/15 16:26:47 mast Exp $      #pike __REAL_VERSION__   //#pragma strict_types      // Some programs destroys character pairs beginning with the currency   // symbol when running in chinese locale.   #if "ยค/" != "\244/"   #error "master.pike.in is corrupted."   #endif   
pike.git/lib/master.pike.in:1399:   // Marker used for negative caching in module caches.   // FIXME: Won't this cause problems when inheriting "/master"?   static class ZERO_TYPE {};      #if 0   object dirnode(string dirname, object|void compilation_handler)   {    resolv_debug("Creating dirnode(%O, %O)...\n", d, h);       fc[dirname]=this; -  if(has_suffix(FIX_CASE(dirname),".pmod")) { -  fc[dirname[..<5]]=this; -  } +        array(string) files = sort(master_get_dir(d)||({}));    if (!sizeof(d)) return ZERO_TYPE();       array(string) bases = map(files, base_from_filename);    files = filter(files, bases);    bases = filter(bases, bases);    resolv_debug("dirnode(%O,%O) got %d files.\n",    d, h, sizeof(bases));    if (!sizeof(files)) return ZERO_TYPE();
pike.git/lib/master.pike.in:1532:    // FIXME: Warn here?    return 0;    }       static void create(string d, object|void h)    {    resolv_debug ("dirnode(%O,%O) created\n",d,h);    dirname=d;    compilation_handler=h;    fc[dirname]=this; -  if(has_suffix(FIX_CASE(dirname),".pmod")) { -  fc[dirname[..<5]]=this; -  } +     array(string) files = sort(master_get_dir(d)||({}));    if (!sizeof(d)) return;    array(string) bases = map(files, base_from_filename);    files = filter(files, bases);    bases = filter(bases, bases);    resolv_debug("dirnode(%O,%O) got %d files.\n",    d, h, sizeof(bases));    if (!sizeof(files)) return;       foreach(files; int no; string fname) {
pike.git/lib/master.pike.in:2067:    string tmp = path[21..];    foreach(pike_module_path, string prefix) {    node->add_path(sizeof(tmp)? combine_path(prefix, tmp) : prefix);    }    } else   #endif /* PIKE_MODULE_RELOC */    node->add_path(path);    return node;   }    - // Probably not used anymore. +    program|object findmodule(string fullname, object|void handler)   {    program|object o;       resolv_debug ("findmodule(%O)\n", fullname);    if(!zero_type(o=fc[fullname]) && o != no_value)    {    if (objectp(o) || programp(o) || o != 0) {    resolv_debug ("findmodule(%O) => found %O (cached)\n", fullname, o);    return o;    }    resolv_debug ("findmodule(%O) => not found (cached)\n", fullname);    return UNDEFINED;    }    -  if(Stat stat=master_file_stat(fakeroot(fullname+".pmod"))) +  if(Stat stat=master_file_stat(fakeroot(fullname)))    {    if(stat->isdir)    {    resolv_debug ("findmodule(%O) => new dirnode\n", fullname); -  return fc[fullname] = dirnode(fullname+".pmod", handler); +  return fc[fullname] = dirnode(fullname, handler);    } -  + #if constant (load_module) +  else if (has_suffix (fullname, ".so")) { +  o = fc[fullname] = low_cast_to_object(fullname, "/.", handler); +  DEC_RESOLV_MSG_DEPTH(); +  resolv_debug ("findmodule(%O) => got .so object %O\n", fullname, o); +  return o;    } -  + #endif +  }       INC_RESOLV_MSG_DEPTH();    -  if(objectp (o = low_cast_to_object(fullname+".pmod", "/.", handler))) { +  if(objectp (o = low_cast_to_object(fullname, "/.", handler))) {    DEC_RESOLV_MSG_DEPTH();    resolv_debug ("findmodule(%O) => got object %O\n", fullname, o);    return fc[fullname]=o;    }    - #if constant(load_module) -  if(master_file_stat(fakeroot(fullname+".so"))) { -  o = fc[fullname] = low_cast_to_object(fullname, "/.", handler); -  DEC_RESOLV_MSG_DEPTH(); -  resolv_debug ("findmodule(%O) => got .so object %O\n", fullname, o); -  return o; -  } - #endif -  +     if (programp (o = low_cast_to_program(fullname, "/.", handler))) {    DEC_RESOLV_MSG_DEPTH();    resolv_debug ("findmodule(%O) => got .pike program %O\n", fullname, o);    return fc[fullname] = o;    }       DEC_RESOLV_MSG_DEPTH();    resolv_debug ("findmodule(%O) => not found\n", fullname);    return fc[fullname] = 0;   }