pike.git / lib / master.pike.in

version» Context lines:

pike.git/lib/master.pike.in:1:   /* -*- Pike -*-    * -  * $Id: master.pike.in,v 1.122 2000/06/09 21:46:37 mast Exp $ +  * $Id: master.pike.in,v 1.123 2000/07/12 01:19:18 hubbe 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:21:   // Enables the out of date warning in low_find_prog().   #ifndef OUT_OF_DATE_WARNING   #define OUT_OF_DATE_WARNING 1   #endif /* OUT_OF_DATE_WARNING */   constant out_of_date_warning = OUT_OF_DATE_WARNING;      /*    * Functions begin here.    */    + #ifdef PIKE_FAKEROOT + object o; + string fakeroot(string s) + { +  string tmp1=combine_path_with_cwd(s); + #ifdef PIKE_FAKEROOT_OMIT +  foreach(PIKE_FAKEROOT_OMIT/":", string x) +  if(glob(x,tmp1)) +  return s; + #endif +  return PIKE_FAKEROOT+tmp1; + } + #else + #define fakeroot(X) X + #endif +  +  +    int is_absolute_path(string p)   {   #ifdef __NT__    p=replace(p,"\\","/");    if(sscanf(p,"%[a-zA-Z]:",string s) && sizeof(s)==1)    return 1;   #define IS_ABSOLUTE_PATH is_absolute_path   #else   #define IS_ABSOLUTE_PATH(X) ((X)[0]=='/')   #endif
pike.git/lib/master.pike.in:110:   #define AUTORELOAD_BEGIN()   #define AUTORELOAD_FINISH(VAR,CACHE,FILE)      #endif      program compile_string(string data, void|string name, object|void handler)   {    return compile(cpp(data,name||"-", 0, handler), handler);   }    +    string master_read_file(string file)   {    object o=_static_modules.files()->Fd(); -  if(o->open(file,"r")) +  if(o->open(fakeroot(file),"r"))    return o->read();    return 0;   }      program compile_file(string file, object|void handler)   {    AUTORELOAD_CHECK_FILE(file);    return compile(cpp(master_read_file(file),    file, 1, handler), handler);   }
pike.git/lib/master.pike.in:306:    if((tmp=="//" || tmp=="\\\\") && (fname[3]=='/' || fname[3]=='\\'))    {    if(!master_file_stat(fname))    {    fname=fname[2..2]+":"+fname[3..];    }    }    }   #endif    -  if( (s=master_file_stat(fname)) && s[1]>=0 ) +  if( (s=master_file_stat(fakeroot(fname))) && s[1]>=0 )    {    AUTORELOAD_BEGIN();      #ifdef PIKE_AUTORELOAD    if (load_time[fname] > s[3])    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(array s2=master_file_stat(fakeroot(oname)))    {    if(s2[1]>=0 && s2[3]>=s[3])    {    mixed err=catch {    AUTORELOAD_CHECK_FILE(oname);    return programs[fname] =    decode_value(master_read_file(oname),    Codec());    };    if (handler) {
pike.git/lib/master.pike.in:367:    e[1]=({});    throw(e);    }    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); +  +  ret=load_module(fakeroot(fname));   #endif /* load_module */    }       AUTORELOAD_FINISH(ret,programs,fname);      // werror("3: %O\n",fname);    return programs[fname]=ret;    }    return 0;   }
pike.git/lib/master.pike.in:617:       static mixed ind(string index)    {    if(module)    {    object o;    if(!zero_type(o=module[index])) return o;    }       if( !files ) -  files = get_dir(dirname); +  files = get_dir(fakeroot(dirname));       int ret;    foreach( files, string s )    {    if( search(s, index)!=-1 || search(index,s)!=-1 )    {    ret=1;    break;    }    }
pike.git/lib/master.pike.in:670:    return;    }       if (module) {    foreach(indices(module), string index) {    cache[index] = module[index];    }    }       if( !files ) -  files = get_dir(dirname); +  files = get_dir(fakeroot(dirname));    foreach(files, string fname) {    mixed err = catch {    if (((< ".pike", ".pmod" >)[fname[sizeof(fname)-5..]]) &&    !zero_type(`[](fname[..sizeof(fname)-6]))) {    continue;    } else if ((fname[sizeof(fname)-3..] == ".so") &&    !zero_type(`[](fname[..sizeof(fname)-4]))) {    continue;    }    };
pike.git/lib/master.pike.in:817:      object findmodule(string fullname)   {    array stat;    object o;    if(!zero_type(o=fc[fullname]))    {    return o;    }    -  if(array stat=master_file_stat(fullname+".pmod")) +  if(array stat=master_file_stat(fakeroot(fullname+".pmod")))    {    if(stat[1]==-2)    return fc[fullname]=dirnode(fullname+".pmod");    }       if(o=low_cast_to_object(fullname+".pmod","/."))    return fc[fullname]=o;      #if constant(load_module) -  if(master_file_stat(fullname+".so")) +  if(master_file_stat(fakeroot(fullname+".so")))    return fc[fullname]=low_cast_to_object(fullname,"/.");   #endif       return fc[fullname]=UNDEFINED;   }      mixed handle_import(string what, string|void current_file, object|void handler)   {    array(string) tmp;    string path;
pike.git/lib/master.pike.in:1320:    {    tmp=EXPLODE_PATH(current_file);    tmp[-1]=f;    path=combine_path_with_cwd(tmp*"/");    }    else    {    foreach(pike_include_path, path)    {    path=combine_path(path,f); -  if(master_file_stat(path)) +  if(master_file_stat(fakeroot(path)))    break;    else    path=0;    }       }       return path;   }