pike.git / lib / master.pike.in

version» Context lines:

pike.git/lib/master.pike.in:1:   /* -*- Pike -*-    * -  * $Id: master.pike.in,v 1.191 2002/02/14 15:23:32 grubba Exp $ +  * $Id: master.pike.in,v 1.192 2002/03/01 02:01:59 mast Exp $    *    * Master-file for Pike.    *    * Based on master.pike 1.67.    */      // Some configurable parameters useful for debugging      #pike __REAL_VERSION__   #define PIKE_AUTORELOAD
pike.git/lib/master.pike.in:545:       AUTORELOAD_FINISH(ret,programs,fname);      // werror("3: %O (%O)\n",fname, ret);    return programs[fname]=ret;    }    return 0;   }      // - // This function is called by the compiler - // when a delayed compilation error occurs + // This function is called by the compiler when a delayed compilation + // error occurs in the given program. It should remove all references + // to the program so that it can be freed.   //   void unregister(program p)   { -  if(string fname=search(programs,p)) +  if(string fname=search(programs,p)) {    m_delete(programs, fname); -  +  // FIXME: The following assumes that programs are always stored +  // with '/' as path separators, even on NT. Haven't checked if +  // that always is the case. +  fname = dirname (fname); +  if (object n = fname != "" && fc[fname]) +  if (n->is_resolv_dirnode || n->is_resolv_joinnode) +  n->delete_value (p); +  }    if (zero_type(objects[p]) != 1)    m_delete(objects, p);    foreach (fc; string name; mixed mod)    if (objectp(mod) && object_program(mod) == p)    m_delete(fc, name);   }      static program findprog(string pname,    string ext,    object|void handler,
pike.git/lib/master.pike.in:1007:    fill_cache();    return indices(filter(cache, lambda(mixed x) {return cache[x] != ZERO_TYPE;}));    }    array(mixed) _values()    {    // werror("values(%O) called\n", dirname);    fill_cache();    return values(cache) - ({ZERO_TYPE});    }    +  void delete_value (mixed val) +  { +  if (string name = search (cache, val)) +  m_delete (cache, name); +  } +     string _sprintf(int as)    {    return sprintf("master()->dirnode(%O)",dirname);    }      };      static class ZERO_TYPE {};      class joinnode
pike.git/lib/master.pike.in:1106:    array(string) _indices()    {    fill_cache();    return indices(filter(cache, lambda(mixed x){ return cache[x] != ZERO_TYPE; }));    }    array(mixed) _values()    {    fill_cache();    return values(cache) - ({ZERO_TYPE});    } +  +  void delete_value (mixed val) +  { +  if (string name = search (cache, val)) +  m_delete (cache, name); +  for (int i = 0; i < sizeof (joined_modules); i++) { +  object|mapping|program o = joined_modules[i]; +  if (o == val) { +  joined_modules = joined_modules[..i - 1] + joined_modules[i + 1..]; +  i--; +  } +  else if (objectp (o) && (o->is_resolv_dirnode || o->is_resolv_joinnode)) +  o->delete_value (val); +  else if (string name = mappingp (o) && search (o, val)) +  m_delete (o, name); +  } +  }   };      // Variables mustn't be static to allow for replace_master().   // /grubba 1998-04-10   mapping(string:mixed) fc=([]);      object findmodule(string fullname, object|void handler)   {    object o;   #ifdef MODULE_TRACE