pike.git / lib / master.pike.in

version» Context lines:

pike.git/lib/master.pike.in:2406:    int index;    foreach(paths; index; string other_fname) {    if (prio_from_filename(other_fname) <= prio) break;    }    file_paths[base] = paths[..index-1] + ({ fname }) + paths[index..];    }    }       class module_checker    { -  int `!() +  protected int `!()    {    resolv_debug ("dirnode(%O)->module_checker()->`!()\n",dirname);       if (mixed err = catch {    // Look up module.    if (module = cache["module"] || low_ind("module", 1)) {    /* This allows for `[] to have side effects first time    * it is called. (Specifically, the Calendar module uses    * this).    */
pike.git/lib/master.pike.in:2438:    // The error will then typically be:    // "Cannot call functions in unfinished objects."       // Pretend not to exist for now...    resolv_debug("dirnode(%O)->module_checker()->`!() => failure, doesn't exist\n",    dirname);    return 1;    }    }    -  mixed `[](string index) +  protected mixed `[](string index)    {    resolv_debug ("dirnode(%O)->module_checker()[%O] => %O\n",    dirname, index, module && module[index]);    return module && module[index];    } -  array(string) _indices() { if(module) return indices(module); } -  array _values() { if(module) return values(module); } +  protected array(string) _indices() { if(module) return indices(module); } +  protected array _values() { if(module) return values(module); }    }       protected mixed low_ind(string index, int(0..1)|void set_module)    {    array(string) paths;       INC_RESOLV_MSG_DEPTH();       if (!(paths = file_paths[index])) {    DEC_RESOLV_MSG_DEPTH();
pike.git/lib/master.pike.in:2573:    resolv_debug ("dirnode(%O)->ind(%O) => not found in module\n",    dirname, index);    }    else    resolv_debug ("dirnode(%O)->ind(%O) => no module\n", dirname, index);       DEC_RESOLV_MSG_DEPTH();    return low_ind(index);    }    -  mixed `[](string index) +  protected mixed `[](string index)    {    mixed ret;   #ifdef MODULE_TRACE    werror("%*nDirnode(%O) cache[%O] ?????\n",    sizeof(backtrace()),dirname,index);   #endif    if(!zero_type(ret=cache[index]))    {   #ifdef MODULE_TRACE    werror("%*nDirnode(%O) cache[%O] => %O%s\n",
pike.git/lib/master.pike.in:2653:    dirname, module, indices(module));    map(indices(module), safe_index);    }       map(indices(file_paths), safe_index);    _cache_full = (object_program(module) != __null_program);    resolv_debug ("dirnode(%O) => Cache %s.\n", dirname,    _cache_full?"full":"partially filled");    }    -  protected array(string) _indices() +  protected protected array(string) _indices()    {    fill_cache();    // Note: Cannot index cache at all here to filter out the    // ZERO_TYPE values since that can change the order in the    // mapping, and _indices() has to return the elements in the same    // order as a nearby _values() call.    return filter (indices (cache), map (values (cache), `!=, ZERO_TYPE));    }    -  protected array(mixed) _values() +  protected protected array(mixed) _values()    {    fill_cache();    return values(cache) - ({ZERO_TYPE});    }       void delete_value (mixed val)    {    if (string name = search (cache, val)) {    m_delete (cache, name);    _cache_full = 0;
pike.git/lib/master.pike.in:2801:    name && !has_value (name, "|") &&    (name == "predef::" ? index : name + "." + index));    }       DEC_RESOLV_MSG_DEPTH();    resolv_debug ("joinnode(%O)->ind(%O) => not found. Trying fallback %O\n",    joined_modules, index, fallback_module);    return fallback_module[index];    }    -  mixed `[](string index) +  protected mixed `[](string index)    {    mixed ret;    if (!zero_type(ret = cache[index])) {    if (ret != ZERO_TYPE) {    return ret;    }    return UNDEFINED;    }    ret = ind(index);   
pike.git/lib/master.pike.in:2848:    `[](index);    }    }    }    foreach(indices(fallback_module), string index) {    `[](index);    }    _cache_full = 1;    }    -  array(string) _indices() +  protected array(string) _indices()    {    fill_cache();    // Note: Cannot index cache at all here to filter out the    // ZERO_TYPE values since that can change the order in the    // mapping, and _indices() has to return the elements in the same    // order as a nearby _values() call.    return filter (indices (cache), map (values (cache), `!=, ZERO_TYPE));    }    -  array(mixed) _values() +  protected array(mixed) _values()    {    fill_cache();    return values(cache) - ({ZERO_TYPE});    }       void delete_value (mixed val)    {    if (string name = search (cache, val))    m_delete (cache, name);    for (int i = 0; i < sizeof (joined_modules); i++) {
pike.git/lib/master.pike.in:2881:    joined_modules = joined_modules[..i - 1] + joined_modules[i + 1..];    i--;    }    else if (objectp (o) && (o->is_resolv_dirnode || o->is_resolv_joinnode))    o->delete_value (val);    else if (string name = mappingp (o) && search (o, val))    m_delete (o, name);    }    }    -  int `== (mixed other) +  protected int `== (mixed other)    {    return objectp (other) && (other->is_resolv_joinnode == 1) &&    equal (mkmultiset (joined_modules), mkmultiset (other->joined_modules));    }       array(object) _encode()    {    return joined_modules;    }   
pike.git/lib/master.pike.in:3459:    //!    string read_include(string f)    {    AUTORELOAD_CHECK_FILE(f);    if (array|object err = catch {    return master_read_file (f);    })    compile_cb_rethrow (err);    }    -  string _sprintf(int t) +  protected string _sprintf(int t)    {    return t=='O' && sprintf("CompatResolver(%O)",ver);    }   }      inherit CompatResolver;      //!   class Pike06Resolver   {
pike.git/lib/master.pike.in:5788:    if(maj==-1) maj = __REAL_MAJOR__;    if(min==-1) min = __REAL_MINOR__;    major = maj;    minor = min;    }      #define CMP(X) ((major - ([object]X)->major) || (minor - ([object]X)->minor))       //! Methods define so that version objects    //! can be compared and ordered. -  int `<(mixed v) { return objectp(v) && CMP(v) < 0; } -  int `>(mixed v) { return objectp(v) && CMP(v) > 0; } -  int `==(mixed v) { return objectp(v) && CMP(v)== 0; } -  int __hash() { return major * 4711 + minor ; } +  protected int `<(mixed v) { return objectp(v) && CMP(v) < 0; } +  protected int `>(mixed v) { return objectp(v) && CMP(v) > 0; } +  protected int `==(mixed v) { return objectp(v) && CMP(v)== 0; } +  protected int __hash() { return major * 4711 + minor ; }    -  string _sprintf(int t) { +  protected string _sprintf(int t) {    switch(t) {    case 's': return sprintf("%d.%d",major,minor);    case 'O': return sprintf("%O(%s)", this_program, this);    }    }       //! The version object can be casted into a string. -  mixed cast(string type) +  protected mixed cast(string type)    {    switch(type)    {    case "string":    return sprintf("%d.%d",major,minor);    }    }   }      //! Version information about the current Pike version.