pike.git / lib / master.pike.in

version» Context lines:

pike.git/lib/master.pike.in:2286:   // Marker used for negative caching in module caches.   // FIXME: Won't this cause problems when inheriting "/master"?   protected class ZERO_TYPE {};      protected object Unicode;      //! Module node representing a single directory.   //!   //! @seealso   //! @[joinnode] - class dirnode + class dirnode (string dirname, object|void compilation_handler, +  string|void name)   { -  string name; -  -  string dirname; -  object|void compilation_handler; +     constant is_resolv_dirnode = 1;    // objectp() is intentionally not used on the module object, to    // allow a module to deny its own existence with `!.    mixed module;    mapping(string:mixed) cache=([]);    mapping(string:array(string)) file_paths = ([]);      #ifdef __NT__   #define FIX_CASE(X) lower_case(X)   #else
pike.git/lib/master.pike.in:2343:    {    fname = FIX_CASE(fname);    if (has_suffix(fname, ".pmod")) return 3;    if (has_suffix(fname, ".so")) return 2;    if (has_suffix(fname, ".pike")) return 1;       // FIXME: Warn here?    return 0;    }    -  protected void create(string d, object|void h, void|string name) +  protected void create()    { -  resolv_debug ("dirnode(%O,%O) created with name %O\n", d, h, name); -  dirname=d; -  compilation_handler=h; -  this_program::name = name; +  resolv_debug ("dirnode(%O,%O) created with name %O\n", dirname, +  compilation_handler, name);    fc[dirname]=this; -  array(string) files = sort(master_get_dir(d)||({})); -  if (!sizeof(d)) return; +  array(string) files = sort(master_get_dir(dirname)||({})); +  if (!sizeof(dirname)) 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)); +  dirname, compilation_handler, sizeof(bases));    if (!sizeof(files)) return;       foreach(files; int no; string fname) {    fname = combine_path(dirname, fname);    string base = bases[no];    if (base == "module") {    // We need a module_checker.    module = module_checker();    }    array(string) paths = file_paths[base];
pike.git/lib/master.pike.in:2673:    return as=='O' && (name || sprintf("master()->dirnode(%O:%O)",    dirname, module && module));    }   }      //! Module node holding possibly multiple directories,   //! and optionally falling back to another level.   //!   //! @seealso   //! @[dirnode] - class joinnode + class joinnode (array(object|mapping) joined_modules, +  object|void compilation_handler, +  joinnode|mapping(mixed:int(0..0))|void fallback_module, +  string|void name)   {    constant is_resolv_joinnode = 1;    -  string name; -  -  array(object|mapping) joined_modules; +     mapping(string:mixed) cache=([]);    -  object compilation_handler; -  -  // NOTE: Uses the empty mapping as the default fallback -  // for simplified code. -  joinnode|mapping(mixed:int(0..0)) fallback_module = ([]); -  -  string _sprintf(int as) +  protected string _sprintf(int as)    {    if (as != 'O') return 0;    if (name) {    if (has_value (name, "|"))    return "joinnode(" + name + ")";    else    return name; // Let's be brief.    }    else    return sprintf("master()->joinnode(%O)", joined_modules);    }    -  protected void create(array(object|mapping) _joined_modules, -  object|void _compilation_handler, -  joinnode|void _fallback_module, -  void|string name) +  protected void create()    { -  joined_modules = _joined_modules; -  compilation_handler = _compilation_handler; -  fallback_module = _fallback_module || ([]); +  if( !fallback_module ) +  fallback_module = ([]);    -  if (name) -  this_program::name = name; -  else { +  if (!name) +  {    mapping(string:int(1..1)) names = ([]); -  foreach (_joined_modules, object|mapping m) { +  foreach (joined_modules, object|mapping m) {    if (objectp (m) && stringp (m->name))    names[m->name] = 1;    }    if (sizeof (names)) -  this_program::name = sort (indices (names)) * "|"; +  name = sort (indices (names)) * "|";    }       resolv_debug ("joinnode(%O) created with name %O\n", joined_modules, name);    }       void add_path(string path)    {    path = combine_path(getcwd(), path);    dirnode node = fc[path] ||    (fc[path] = dirnode(path, compilation_handler,