pike.git / lib / master.pike.in

version» Context lines:

pike.git/lib/master.pike.in:1:   /* -*- Pike -*-    * -  * $Id: master.pike.in,v 1.175 2001/11/08 14:46:36 grubba Exp $ +  * $Id: master.pike.in,v 1.176 2001/11/09 14:06:49 mast Exp $    *    * Master-file for Pike.    *    * Based on master.pike 1.67.    */      // Some configurable parameters useful for debugging      #pike __REAL_VERSION__   #define PIKE_AUTORELOAD
pike.git/lib/master.pike.in:869:    static mixed ind(string index)    {   #ifdef MODULE_TRACE    werror("%*nDirnode(%O) ind[%O] -> ???\n",sizeof(backtrace()),dirname,index);   #endif    if(module)    {   #ifdef MODULE_TRACE    werror("%*nDirnode(%O) module[%O] -> ???\n",sizeof(backtrace()),dirname,index);   #endif -  object o; +  mixed o;   // _describe(module);    if(!zero_type(o=module[index]))    {   #ifdef MODULE_TRACE    werror("%*nDirnode(%O) module[%O] -> %O\n",sizeof(backtrace()),dirname,index, o);   #endif    return o;    }    }   
pike.git/lib/master.pike.in:924:    {    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\n",sizeof(backtrace()),dirname,index, ret);   #endif -  // The check below is to (hopefully) avoid calling any function -  // in ret (like `! or `==) in case it's an object. -  if(!intp (ret) || ret) return ret; +  if (ret != ZERO_TYPE) return ret;    return UNDEFINED;    }    ret=ind(index);       // Kluge!    if(ret == __placeholder_object) return ret;    -  return cache[index]=ret; +  cache[index] = zero_type(ret) ? ZERO_TYPE : ret; +  return ret;    }       static int _cache_full;    void fill_cache()    {   #ifdef RESOLV_DEBUG    werror(describe_backtrace(({ sprintf("Filling cache in dirnode %O\n",    dirname),    backtrace() })));   #endif /* RESOLV_DEBUG */
pike.git/lib/master.pike.in:980:    "%s\n",    describe_backtrace(err)));    }    }    _cache_full = 1;    }    array(string) _indices()    {    // werror("indices(%O) called\n", dirname);    fill_cache(); -  return indices(filter(cache, lambda(mixed x){ return !intp (x) || x; })); +  return indices(filter(cache, lambda(mixed x) {return cache[x] != ZERO_TYPE;}));    }    array(mixed) _values()    {    // werror("values(%O) called\n", dirname);    fill_cache(); -  return values(cache)-({0}); +  return values(cache) - ({ZERO_TYPE});    }       string _sprintf(int as)    {    return sprintf("master()->dirnode(%O)",dirname);    }      };      static class ZERO_TYPE {};
pike.git/lib/master.pike.in:1081:    if (zero_type(cache[index])) {    `[](index);    }    }    }    _cache_full = 1;    }    array(string) _indices()    {    fill_cache(); -  return indices(cache); +  return indices(filter(cache, lambda(mixed x){ return cache[x] != ZERO_TYPE; }));    }    array(mixed) _values()    {    fill_cache(); -  return values(cache); +  return values(cache) - ({ZERO_TYPE});    }   };      // Variables mustn't be static to allow for replace_master().   // /grubba 1998-04-10   mapping(string:mixed) fc=([]);      object findmodule(string fullname, object|void handler)   {    object o;