pike.git
/
lib
/
master.pike.in
version
»
Context lines:
10
20
40
80
file
none
3
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.
349
2004/06/
13
17:01:
54
grubba
Exp $
+
// $Id: master.pike.in,v 1.
350
2004/06/
17
16
:01:
40
mast
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:575:
mapping(string:program|NoValue) programs=(["/master":this_program]); mapping (program:object|NoValue) objects=([ this_program : this, object_program(_static_modules): _static_modules ]); mapping(string:object|NoValue) fc=([]); // Note: It's assumed that the mappings above never decrease in size
-
//
except
in
*_
reverse
_lookup()
. no_value
is
used for entries that
-
//
should be considered removed.
+
//
unless
the
reverse
mappings above also are updated
. no_value
should
+
//
otherwise be
used for entries that should be considered removed.
constant no_value = (<>); constant NoValue = typeof (no_value); // The reverse mapping for objects isn't only for speed; search() // doesn't work reliably there since it calls `==. static mapping(program:string) rev_programs = ([]); static mapping(object:program) rev_objects = ([]); static mapping(mixed:string) rev_fc = ([]);
pike.git/lib/master.pike.in:873:
return 0; } // // 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=
rev_programs[p] ||
search(programs,p)) {
resolv_debug("unregister %s\n", fname);
-
+
if (m_delete (rev_programs, p))
+
m_delete (programs, fname);
+
else
programs[fname] = no_value;
-
+
fname = dirname (fname); object n; if ( fname!="" && objectp (n = fc[fname]) ) if (n->is_resolv_dirnode || n->is_resolv_joinnode) n->delete_value (p); }
-
if (objectp (objects
[p]
)) objects[p] = no_value;
+
+
object o = objects[p];
+
if (objectp (
o)) {
+
if (m_delete (rev_
objects
, o
))
+
m_delete (
objects
, p);
+
else
+
objects
[p] = no_value;
+
}
+
foreach (fc; string name; mixed mod) if (objectp(mod) && object_program(mod) == p)
-
+
if (m_delete (rev_fc, mod))
+
m_delete (fc, name);
+
else
fc[name] = no_value; } static program findprog(string pname, string ext, object|void handler, void|int mkobj) { switch(ext) {