pike.git / lib / master.pike.in

version» Context lines:

pike.git/lib/master.pike.in:1:   /* -*- Pike -*-    * -  * $Id: master.pike.in,v 1.123 2000/07/12 01:19:18 hubbe Exp $ +  * $Id: master.pike.in,v 1.124 2000/08/02 11:06:36 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:17:   #define BT_MAX_STRING_LEN 200   #endif /* !defined(BT_MAX_STRING_LEN) || (BT_MAX_STRING_LEN <= 0) */   constant bt_max_string_len = BT_MAX_STRING_LEN;      // 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;    + #ifndef PIKE_WARNINGS + #define PIKE_WARNINGS 0 + #endif /* PIKE_WARNINGS */ +    /*    * Functions begin here.    */      #ifdef PIKE_FAKEROOT   object o;   string fakeroot(string s)   {    string tmp1=combine_path_with_cwd(s);   #ifdef PIKE_FAKEROOT_OMIT
pike.git/lib/master.pike.in:89:      #define UNDEFINED (([])[0])   #define error(X) throw( ({ (X), backtrace()/*[0..sizeof(backtrace())-2]*/ }) )      string describe_backtrace(array trace);   object low_cast_to_object(string oname, string current_file);      array(string) pike_include_path=({});   array(string) pike_module_path=({});   array(string) pike_program_path=({}); - int want_warnings = 0; + int want_warnings = PIKE_WARNINGS;      #ifdef PIKE_AUTORELOAD      int autoreload_on;   int newest;      #define AUTORELOAD_CHECK_FILE(X) \    if(autoreload_on) if(mixed fnord=master_file_stat(X)) if(fnord[3]>newest) newest=fnord[3];      #define AUTORELOAD_BEGIN() \
pike.git/lib/master.pike.in:207:   }   #else   #define master_file_stat file_stat   #endif      mapping (string:string) environment=([]);         string|mapping(string:string) getenv(string|void s)   { -  if(!s) return environment; +  if(!s) return environment + ([]);    return environment[s];   }    -  + #if 0 + variant mapping(string:string) getenv() + { +  return environment + ([]); + } +  + variant string getenv(string s) + { +  return environment[s]; + } +  + function(:mapping(string:string))|function(string:string) getenv(s) + { +  if(!s) return environment + ([]); +  return environment[s]; + } +  + mapping(string:string) getenv() | + string getenv(string s) + { +  if(!s) return environment + ([]); +  return environment[s]; + } + #endif /* 0 */ +    void putenv(string var, string val)   {    environment[var]=val;   }      string normalize_path( string X )   {   #ifndef __NT__    return X;   #else
pike.git/lib/master.pike.in:1206:   mixed get_inhibit_compile_errors()   {    return inhibit_compile_errors;   }   #endif /* constant(thread_local) */      string trim_file_name(string s)   {    if(getenv("LONG_PIKE_ERRORS")) return s;    if(getenv("SHORT_PIKE_ERRORS")) return BASENAME(s); +  /* getcwd() can fail, but since this is called from handle_error(), +  * we don't want to fail, so we don't care about that. +  */ +  catch {    string cwd=getcwd();    if (sizeof(cwd) && (cwd[-1] != '/')) {    cwd += "/";    }    if(s[..sizeof(cwd)-1]==cwd) return s[sizeof(cwd)..]; -  +  };    return s;   }      /*    * This function is called whenever a compiling error occurs.    * Nothing strange about it.    * Note that previous_object cannot be trusted in ths function, because    * the compiler calls this function.    */   void compile_error(string file,int line,string err)
pike.git/lib/master.pike.in:1671:    else    {    if (tmp) {    if (catch (row = sprintf("%O", tmp)))    row = describe_program(object_program(tmp)) + " with broken _sprintf()";    } else {    row = "Destructed object";    }    }    }) { -  row += sprintf("Error indexing backtrace line %d: %s (%O)!", e, err[0], err[1]); +  row = sprintf("Error indexing backtrace line %d: %s (%O)!", e, err[0], err[1]);    }    ret += row + "\n";    }    }       return ret;   }      // Returns a short description of a backtrace, containing only the   // error message.