pike.git / lib / master.pike.in

version» Context lines:

pike.git/lib/master.pike.in:1:   // -*- Pike -*-   //   // Master Control Program for Pike.   //   // This file is part of Pike. For copyright information see COPYRIGHT.   // Pike is distributed under GPL, LGPL and MPL. See the file COPYING   // for more information.   // - // $Id: master.pike.in,v 1.378 2005/11/08 20:03:54 grubba Exp $ + // $Id: master.pike.in,v 1.379 2005/11/09 16:26:22 grubba Exp $      #pike __REAL_VERSION__   //#pragma strict_types      // Some programs destroys character pairs beginning with the currency   // symbol when running in chinese locale.   #if "ยค/" != "\244/"   #error "master.pike.in is corrupted."   #endif   
pike.git/lib/master.pike.in:299:    return tmp[-1];   #define BASENAME(X) (EXPLODE_PATH(X)[-1])   #endif   }      #ifdef PIKE_AUTORELOAD      int autoreload_on;   int newest;    - #define AUTORELOAD_CHECK_FILE(X) \ -  if(autoreload_on) if(Stat s=master_file_stat(X)) if(s->mtime>newest) newest=[int]s->mtime; -  +    #define AUTORELOAD_BEGIN() \    int ___newest=newest; \    newest=0    -  + #define AUTORELOAD_CHECK_FILE(X) do { \ +  if(autoreload_on) \ +  if(Stat s=master_file_stat(X)) \ +  if(s->mtime>newest) newest=[int]s->mtime; \ +  } while(0) +    #define AUTORELOAD_FINISH(VAR, CACHE, FILE) \    if(autoreload_on) { \    mixed val = CACHE[FILE]; \ -  if(!zero_type (val) && val != no_value && newest <= load_time[FILE]) { \ +  if(!zero_type (val) && val != no_value && \ +  newest <= load_time[FILE]) { \    VAR = val; \    } \    } \ -  load_time[FILE]=time(); \ +  load_time[FILE] = newest; \    if(___newest > newest) newest=___newest;         mapping(string:int) load_time=([]);   #else      #define AUTORELOAD_CHECK_FILE(X)   #define AUTORELOAD_BEGIN()   #define AUTORELOAD_FINISH(VAR,CACHE,FILE)   
pike.git/lib/master.pike.in:741:    if (err) {    werror( "low_findprog: Caught spurious error:\n"    "%s\n", describe_backtrace(err) );    }   #endif      #ifdef PIKE_MODULE_RELOC    fname = unrelocate_module(fname);   #endif    - #ifdef PIKE_AUTORELOAD -  if(!autoreload_on || load_time[fname]>=time()) - #endif -  { -  if(!zero_type (ret=programs[fname]) && ret != no_value) { -  resolv_debug ("low_findprog %s: returning cached (no autoreload)\n", fname); -  return ret; -  } -  } -  +    #ifdef __NT__    // Ugly kluge to work better with cygwin32 "/X:/" paths.    if(getenv("OSTYPE")=="cygwin32")    {    string tmp=fname[..1];    if((tmp=="//" || tmp=="\\\\") && (fname[3]=='/' || fname[3]=='\\'))    {    if(!master_file_stat(fname))    {    fname=fname[2..2]+":"+fname[3..];    }    }    }   #endif       if( (s=master_file_stat(fakeroot(fname))) && s->isreg )    { -  + #ifdef PIKE_AUTORELOAD +  if(!autoreload_on || load_time[fname] >= s->mtime) + #endif +  { +  if(!zero_type (ret=programs[fname]) && ret != no_value) { +  resolv_debug ("low_findprog %s: returning cached (no autoreload)\n", fname); +  return ret; +  } +  } +     AUTORELOAD_BEGIN();      #ifdef PIKE_AUTORELOAD -  if (load_time[fname] > s->mtime) +  if (load_time[fname] >= s->mtime)    if (!zero_type (ret=programs[fname]) && ret != no_value) {    resolv_debug ("low_findprog %s: returning cached (autoreload)\n", fname);    return ret;    }   #endif       switch(ext)    {    case "":    case ".pike":