pike.git / lib / master.pike.in

version» Context lines:

pike.git/lib/master.pike.in:1: - /* $Id: master.pike.in,v 1.71 1999/11/23 16:40:01 per Exp $ + /* $Id: master.pike.in,v 1.72 1999/11/26 21:42:47 grubba 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:228:   {    tmp=combine_path_with_cwd(tmp);    pike_program_path-=({tmp});   }         mapping (string:program) programs=(["/master":object_program(this_object())]);      #define capitalize(X) (upper_case((X)[..0])+(X)[1..])    + array(string) query_precompiled_names(string fname) + { +  // Filenames of potential precompiled files in priority order. +  return ({ fname + ".o" }); + } +    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( (s=master_file_stat(fname)) && s[1]>=0 )    {    AUTORELOAD_BEGIN();    switch(ext)    {    case "":    case ".pike": -  if(array s2=master_file_stat(fname+".o")) +  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(fname+".o"); -  return programs[fname]=decode_value(_static_modules.files()->Fd(fname+".o","r")->read(),Codec()); +  AUTORELOAD_CHECK_FILE(oname); +  return programs[fname] = +  decode_value(_static_modules.files()->Fd(oname,"r")->read(), +  Codec());    };    if (handler) { -  handler->compile_warning(fname + ".o", 0, +  handler->compile_warning(oname, 0,    sprintf("Decode failed:\n"    "\t%s", err[0]));    } else { -  compile_warning(fname + ".o", 0, +  compile_warning(oname, 0,    sprintf("Decode failed:\n"    "\t%s", err[0]));    }    } else {    if (handler) { -  handler->compile_warning(fname + ".o", 0, +  handler->compile_warning(oname, 0,    "Compiled file is out of date\n");    } else { -  compile_warning(fname + ".o", 0, "Compiled file is out of date\n"); +  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);
pike.git/lib/master.pike.in:299:    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; -  }else{ +  }    return UNDEFINED;   } - } +       static program findprog(string pname, string ext, object|void handler)   {    switch(ext)    {    case ".pike":    case ".so":    return low_findprog(pname,ext,handler);       default: