pike.git / lib / master.pike.in

version» Context lines:

pike.git/lib/master.pike.in:1911:    string|void name)   {    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=([]);       // Maps a base name like "Bar" to an ordered array of file paths,    // e.g. ({ "/lib/Foo.pmod/Bar.pmod", "/lib/Foo.pmod/Bar.so" }). -  mapping(string:array(string)) file_paths = ([]); +  protected mapping(string:array(string)) file_paths = ([]);      #ifdef __NT__   #define FIX_CASE(X) lower_case(X)   #else   #define FIX_CASE(X) (X)   #endif /* __NT__ */       protected string base_from_filename(string fname)    {    string low_name = FIX_CASE(fname);
pike.git/lib/master.pike.in:2174:    return low_ind(index);    }       protected mixed `[]=(string index, mixed value)    {    if(module && has_index(module, index))    return module[index]=value,cache[index]=value;    error("No such variable (%s) in object.\n", index);    }    +  protected mixed `->=(string index, mixed value) +  { +  return `[]=(index, value); +  } +     protected mixed `[](string index)    {    mixed ret;   #ifdef MODULE_TRACE    werror("%*nDirnode(%O) cache[%O] ?????\n",    sizeof(backtrace()),dirname,index);   #endif    if(!undefinedp(ret=cache[index]))    {   #ifdef MODULE_TRACE
pike.git/lib/master.pike.in:2211:    werror("%*nDirnode(%O) PLACE_HOLDER.\n",    sizeof(backtrace()),dirname);   #endif    return ret;    }       cache[index] = undefinedp(ret) ? ZERO_TYPE : ret;    return ret;    }    -  mixed safe_index(string index) +  protected mixed `->(string index)    { -  +  if( (< "is_resolv_dirnode", "module", "cache" >)[index] ) +  return ::`->(index); +  return `[](index); +  } +  +  protected mixed safe_index(string index) +  {    mixed err;    resolv_debug ("dirnode(%O): %O...\n", dirname, index);    if (err = catch { return `[](index); }) {    call_compile_warning (compilation_handler,    dirname+"."+fname,    "Compilation failed: " +    call_describe_error(err));    }    return UNDEFINED;    }       protected int(0..1) _cache_full; -  void fill_cache() +  protected void fill_cache()    {    if (_cache_full) {    return;    }       resolv_debug ("dirnode(%O) => Filling cache...\n", dirname);       // NOTE: We rely on side effects in `[]() and safe_index()    // to fill the cache.   
pike.git/lib/master.pike.in:2410:    }       protected mixed `[]=(string index, mixed value)    {    foreach(joined_modules, object|mapping o)    if(has_index(o, index))    return o[index]=value,cache[index]=value;    error("No such variable (%s) in object.\n", index);    }    +  protected mixed `->=(string index, mixed value) +  { +  return `[]=(index, value); +  } +     protected mixed `[](string index)    {    mixed ret;    if (!undefinedp(ret = cache[index])) {    if (ret != ZERO_TYPE) {    return ret;    }    return UNDEFINED;    }    ret = ind(index);
pike.git/lib/master.pike.in:2433:    if(ret == predef::__placeholder_object) return ret;       if (undefinedp(ret)) {    cache[index] = ZERO_TYPE;    } else {    cache[index] = ret;    }    return ret;    }    +  protected mixed `->(string index) +  { +  if( (< "is_resolv_joinnode", "cache", "add_path", "rem_path", +  "delete_value", "_encode", "_decode" >)[index] ) +  return ::`->(index); +  return `[](index); +  } +     protected int _cache_full;    -  void fill_cache() +  protected void fill_cache()    { - #if 0 -  werror(call_describe_backtrace(({ "Filling cache in joinnode\n", -  backtrace() }))); - #endif +     if (_cache_full) {    return;    }    foreach(joined_modules, object|mapping|program o) {    foreach(indices(o), string index) {    if (!has_index(cache, index)) {    `[](index);    }    }    }