pike.git / lib / master.pike.in

version» Context lines:

pike.git/lib/master.pike.in:1: - /* $Id: master.pike.in,v 1.15 1998/04/19 00:08:53 hubbe Exp $ + /* $Id: master.pike.in,v 1.16 1998/04/20 02:34:03 hubbe Exp $    *    * Master-file for Pike.    *    * Based on master.pike 1.67.    */      int is_absolute_path(string p)   {   #ifdef __NT__    p=replace(p,"\\","/");
pike.git/lib/master.pike.in:38:      #define GETCWD_CACHE   #define FILE_STAT_CACHE      #define UNDEFINED (([])[0])   #define error(X) throw( ({ (X), backtrace()[0..sizeof(backtrace())-2] }) )      string describe_backtrace(mixed *trace);   object low_cast_to_object(string oname, string current_file);    - string pike_library_path; +    string *pike_include_path=({});   string *pike_module_path=({});   string *pike_program_path=({});   int want_warnings;      program compile_string(string data, void|string name)   {    return compile(cpp(data,name||"-"));   }   
pike.git/lib/master.pike.in:371:   object cast_to_object(string oname, string current_file)   {    if(object o=low_cast_to_object(oname, current_file))    return o;    error("Cast to object failed\n");   }      class dirnode   {    string dirname; -  object tm; +     mixed module;    mapping cache=([]);    -  void create(string name, object the_master) +  void create(string name)    {    dirname=name; -  tm=the_master; +     -  if(module=tm->findmodule(dirname+"/module")) +  if(module=findmodule(dirname+"/module"))    if(mixed tmp=module->_module_value)    module=tmp;    }       object|program ind(string index)    {    if(module) if(object o=module[index]) return o;       index = dirname+"/"+index; -  if(object o=tm->findmodule(index)) +  if(object o=findmodule(index))    {    if(mixed tmp=o->_module_value) o=tmp;    return o;    }    return (program) index;    }       object|program `[](string index)    {    mixed ret;
pike.git/lib/master.pike.in:426:    mixed *stat;    object o;    if(!zero_type(o=fc[fullname]))    {    return o;    }       if(mixed *stat=master_file_stat(fullname+".pmod"))    {    if(stat[1]==-2) -  return fc[fullname]=dirnode(fullname+".pmod",this_object()); +  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"))    return fc[fullname]=low_cast_to_object(fullname,"/.");   #endif       return fc[fullname]=UNDEFINED;   }    - mixed resolv(string identifier, string|void current_file) + mixed handle_import(string what, string|void current_file)   { -  mixed ret; +     string *tmp,path; -  +     if(current_file)    {    tmp=explode_path(current_file); -  tmp[-1]=identifier; +  tmp[-1]=what;    path=combine_path_with_cwd( tmp*"/"); -  ret=findmodule(path); +     } -  +  return fc[path]=dirnode(path); + }    -  + mixed resolv(string identifier, string|void current_file) + { +  mixed ret; +  string *tmp,path; +     if(!ret)    {    foreach(pike_module_path, path)    {    string file=combine_path(path,identifier);    if(ret=findmodule(file)) break;    } -  -  if(!ret) -  { -  string path=combine_path(pike_library_path+"/modules",identifier); -  ret=findmodule(path); +     } -  } +     -  +     if(ret)    {    if(mixed tmp=ret->_module_value) ret=tmp;    return ret;    }    return UNDEFINED;   }      /* 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
pike.git/lib/master.pike.in:506:    add_constant("write",_static_modules.files()->_stdout->write);       // add path for architecture-shared files    add_include_path("¤share_prefix¤/include");    add_module_path("¤share_prefix¤/modules");       // add path for architecture-dependant files    add_include_path("¤lib_prefix¤/include");    add_module_path("¤lib_prefix¤/modules");    -  add_program_path(getcwd()); -  add_module_path(getcwd()); -  +     q=(getenv("PIKE_INCLUDE_PATH")||"")/":"-({""});    for(i=sizeof(q)-1;i>=0;i--) add_include_path(q[i]);       q=(getenv("PIKE_PROGRAM_PATH")||"")/":"-({""});    for(i=sizeof(q)-1;i>=0;i--) add_program_path(q[i]);       q=(getenv("PIKE_MODULE_PATH")||"")/":"-({""});    for(i=sizeof(q)-1;i>=0;i--) add_module_path(q[i]);      
pike.git/lib/master.pike.in:723:    {    foreach(pike_include_path, path)    {    path=combine_path(path,f);    if(master_file_stat(path))    break;    else    path=0;    }    -  if(!path) -  { -  path=combine_path(pike_library_path+"/include",f); -  if(!master_file_stat(path)) path=0; +     } -  } +     -  if(path) -  { -  /* Handle preload */ -  -  if(path[-1]=='h' && path[-2]=='.' && -  master_file_stat(path[0..sizeof(path)-2]+"pre.pike")) -  { -  cast_to_object(path[0..sizeof(path)-2]+"pre.pike","/"); -  } -  } -  +     return path;   }      string read_include(string f)   {    object o=_static_modules.files()->Fd();    if(o->open(f,"r"))    return o->read();   }