pike.git / lib / master.pike.in

version» Context lines:

pike.git/lib/master.pike.in:1:   /* -*- Pike -*-    * -  * $Id: master.pike.in,v 1.105 2000/03/23 20:09:41 mast Exp $ +  * $Id: master.pike.in,v 1.106 2000/03/25 21:25:31 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: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")) +  return o->read(); +  return 0; + } +    program compile_file(string file, object|void handler)   {    AUTORELOAD_CHECK_FILE(file); -  return compile(cpp(_static_modules.files()->Fd(file,"r")->read(), +  return compile(cpp(master_read_file(file),    file, 1, handler), handler);   }         #ifdef GETCWD_CACHE   string current_path;   int cd(string s)   {    current_path=0;    return predef::cd(s);
pike.git/lib/master.pike.in:307:    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])    {    mixed err=catch {    AUTORELOAD_CHECK_FILE(oname);    return programs[fname] = -  decode_value(_static_modules.files()->Fd(oname,"r")->read(), +  decode_value(master_read_file(oname),    Codec());    };    if (handler) {    handler->compile_warning(oname, 0,    sprintf("Decode failed:\n"    "\t%s", err[0]));    } else {    compile_warning(oname, 0,    sprintf("Decode failed:\n"    "\t%s", err[0]));
pike.git/lib/master.pike.in:554:   }      /* This function is called when the drivers wants to cast a string    * to an object because of an implict or explicit cast. This function    * may also receive more arguments in the future.    */   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"); +  error(sprintf("Cast '%s' to object failed%s.\n",file, +  current_file?sprintf("for '%s'",current_file),""));   }      class dirnode   {    string dirname;    mixed module;    mapping cache=([]);    array files;       void create(string name)
pike.git/lib/master.pike.in:1026:    " " + "\n"    "Master file : " + (_master_file_name || __FILE__) + "\n");    exit(0);       case "execute":    random_seed(time() + (getpid() * 0x11111111));    compile_string("#include <simulate.h>\nmixed create(){"+opts[1]+";}")();    exit(0);       case "preprocess": -  _static_modules.files()->_stdout->write(cpp(_static_modules.files()->Fd(opts[1],"r")->read(),opts[1])); +  _static_modules.files()->_stdout->write(cpp(master_read_file(opts[1]), +  opts[1]));    exit(0);    }    }       argv = tmp->get_args(argv,1);    }       random_seed(time() + (getpid() * 0x11111111));       if(sizeof(argv)==1)
pike.git/lib/master.pike.in:1255:    }       }       return path;   }      string read_include(string f)   {    AUTORELOAD_CHECK_FILE(f) -  object o=_static_modules.files()->Fd(); -  if(o->open(f,"r")) -  return o->read(); +  return master_read_file(f);   }      int clipped=0;   int canclip=0;      // FIXME   string stupid_describe(mixed m, int maxlen)   {    string typ;    if (catch (typ=sprintf("%t",m)))