pike.git / lib / master.pike.in

version» Context lines:

pike.git/lib/master.pike.in:1:   /* -*- Pike -*-    * -  * $Id: master.pike.in,v 1.87 1999/12/27 20:28:45 mast Exp $ +  * $Id: master.pike.in,v 1.88 1999/12/28 02:34:19 mast Exp $    *    * Master-file for Pike.    *    * Based on master.pike 1.67.    */      // Some configurable parameters useful for debugging      #define PIKE_AUTORELOAD   
pike.git/lib/master.pike.in:253:   static program low_findprog(string pname, string ext, object|void handler)   {    program ret;    array s;    string fname=pname+ext;      #ifdef PIKE_AUTORELOAD    if(!autoreload_on || load_time[fname]>=time())   #endif    { -  if(ret=programs[fname]) return ret; +  if(!zero_type (ret=programs[fname])) return ret;    }       if( (s=master_file_stat(fname)) && s[1]>=0 )    {    AUTORELOAD_BEGIN();    -  + #ifdef PIKE_AUTORELOAD    if (load_time[fname] > s[3]) -  if (ret=programs[fname]) return ret; +  if (!zero_type (ret=programs[fname])) return ret; + #endif       switch(ext)    {    case "":    case ".pike":    foreach(query_precompiled_names(fname), string oname) {    if(array s2=master_file_stat(oname))    {    if(s2[1]>=0 && s2[3]>=s[3])    {
pike.git/lib/master.pike.in:301:    } else {    compile_warning(oname, 0, "Compiled file is out of date\n");    }    }    }    }          if ( mixed e=catch { ret=compile_file(fname); } )    { -  if(arrayp(e) && -  sizeof(e)==2 && -  arrayp(e[1]) && -  sizeof(e[1]) == sizeof(backtrace())) -  e[1]=({}); -  throw(e); +  if(arrayp(e) && sizeof(e) && stringp (e[0])) +  if (handler) handler->compile_error(fname, 0, e[0]); +  else compile_error(fname, 0, e[0]);    }    break;   #if constant(load_module)    case ".so":    if (fname == "") {    werror(sprintf("low_find_prog(\"%s\", \"%s\") => load_module(\"\")\n"    "%s\n", pname, ext, describe_backtrace(backtrace())));    }    ret=load_module(fname);   #endif /* load_module */    }       AUTORELOAD_FINISH(ret,programs,fname);       return programs[fname]=ret;    } -  return UNDEFINED; +  return 0;   }      static program findprog(string pname, string ext, object|void handler)   {    switch(ext)    {    case ".pike":    case ".so":    return low_findprog(pname,ext,handler);   
pike.git/lib/master.pike.in:637:    fill_cache();    return indices(filter(cache, lambda(mixed x){ return x!=0; }));    }    array(mixed) _values()    {    fill_cache();    return values(cache)-({0});    }   };    + static class ZERO_TYPE {}; +    class joinnode   { -  class ZERO_TYPE {}; +     array(object|mapping) joined_modules;    mapping cache=([]);       void create(array(object|mapping) _joined_modules)    {    joined_modules = _joined_modules;    }       static object|mapping ind(string index)    {
pike.git/lib/master.pike.in:806:    return(tmp[0]);    }    return joinnode(tmp);    }    return UNDEFINED;   }      mapping resolv_cache = set_weak_flag( ([]), 1 );   mixed resolv(string identifier, string|void current_file)   { -  if( resolv_cache[identifier+current_file] ) -  return resolv_cache[identifier+current_file]; +  mixed ret; +  if( !zero_type (ret = resolv_cache[identifier+current_file]) ) +  return ret == ZERO_TYPE ? UNDEFINED : resolv_cache[identifier+current_file];    array(string) tmp=identifier/"."; -  mixed ret=resolv_base(tmp[0]); +  ret=resolv_base(tmp[0]);    foreach(tmp[1..],string index) ret=ret[index]; -  return resolv_cache[identifier+current_file]=ret; +  resolv_cache[identifier+current_file] = zero_type (ret) ? ZERO_TYPE : ret; +  return ret;   }      // These are useful if you want to start other Pike processes   // with the same options as this one was started with.   string _pike_file_name;   string _master_file_name;      /* This function is called when all the driver is done with all setup    * of modules, efuns, tables etc. etc. and is ready to start executing    * _real_ programs. It receives the arguments not meant for the driver