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.260 2005/09/09 17:47:39 mast Exp $ + // $Id: master.pike.in,v 1.261 2006/12/07 09:42:27 grubba Exp $      #pike __REAL_VERSION__      // Some programs destroys character pairs beginning with the currency   // symbol when running in chinese locale.   #if "ยค/" != "\244/"   #error "master.pike.in is corrupted."   #endif      // --- Some configurable parameters
pike.git/lib/master.pike.in:607:      static program low_findprog(string pname,    string ext,    object|void handler,    void|int mkobj)   {    program ret;    Stat s;    string fname=pname+ext;    +  // werror("low_findprog(%O, %O, X, %d) ==>\n", pname, ext, mkobj); +    #ifdef THREADED    object key;    // FIXME: The catch is needed, since we might be called in    // a context when threads are disabled.    // (compile() disables threads).    mixed err = catch {    key=compilation_mutex->lock(2);    };    if (err) {    werror( "low_findprog: Caught spurious error:\n"
pike.git/lib/master.pike.in:667:    resolv_debug ("low_findprog %s: returning cached (autoreload)\n", fname);    return ret;    }   #endif       switch(ext)    {    case "":    case ".pike":    foreach(query_precompiled_names(fname), string oname) { +  // werror("low_findprog %O: Testing oname %O\n", fname, oname);    if(Stat s2=master_file_stat(fakeroot(oname)))    {    if(s2->isreg && s2->mtime >= s->mtime)    {    mixed err=catch {    AUTORELOAD_CHECK_FILE(oname);    resolv_debug ("low_findprog %s: decoding dumped\n", fname);    INC_RESOLV_MSG_DEPTH();    ret = decode_value(master_read_file(oname),    (handler && handler->get_codec ||
pike.git/lib/master.pike.in:796:    foreach (fc; string name; mixed mod)    if (objectp(mod) && object_program(mod) == p)    fc[name] = no_value;   }      static program findprog(string pname,    string ext,    object|void handler,    void|int mkobj)   { +  mixed res; +  // werror("findprog(%O, %O, ...) ==>\n", pname, ext);    switch(ext)    {    case ".pike":    case ".so": -  return low_findprog(pname,ext,handler, mkobj); +  res = low_findprog(pname,ext,handler, mkobj); +  break;       default:    pname+=ext; -  return +  res =    low_findprog(pname,"", handler, mkobj) ||    low_findprog(pname,".pike", handler, mkobj) ||    low_findprog(pname,".so", handler, mkobj);    } -  +  // werror("findprog(%O, %O, ...) ==> %O\n", pname, ext, res); +  return res;   }      program low_cast_to_program(string pname,    string current_file,    object|void handler,    void|int mkobj)   {    string ext;    string nname;    array(string) tmp=EXPLODE_PATH(pname);
pike.git/lib/master.pike.in:1463:    if(!zero_type(o=fc[fullname]) && o != no_value)    {    if (objectp(o) || programp(o) || o != 0) {    resolv_debug ("findmodule(%O) => found %O (cached)\n", fullname, o);    return o;    }    resolv_debug ("findmodule(%O) => not found (cached)\n", fullname);    return UNDEFINED;    }    +  resolv_debug("findmodule: Stating %O...\n", fakeroot(fullname+".pmod"));    if(Stat stat=master_file_stat(fakeroot(fullname+".pmod")))    {    if(stat->isdir)    {    resolv_debug ("findmodule(%O) => new dirnode\n", fullname);    return fc[fullname] = dirnode(fullname+".pmod", handler);    }    }       INC_RESOLV_MSG_DEPTH();    -  +  resolv_debug("findmodule: Trying (object)%O...\n", fakeroot(fullname+".pmod"));    if(objectp (o = low_cast_to_object(fullname+".pmod", "/.", handler))) {    DEC_RESOLV_MSG_DEPTH();    resolv_debug ("findmodule(%O) => got object %O\n", fullname, o);    return fc[fullname]=o;    }      #if constant(load_module) -  +  resolv_debug("findmodule: Trying %O...\n", fakeroot(fullname+".so"));    if(objectp (o = low_cast_to_object(fullname+".so", "/.", handler))) {    DEC_RESOLV_MSG_DEPTH();    resolv_debug ("findmodule(%O) => got .so object %O\n", fullname, o);    return fc[fullname] = o;    }   #endif    -  +  resolv_debug("findmodule: Trying (program)%O...\n", fullname);    if (programp (o = cast_to_program(fullname, "/.", handler))) {    DEC_RESOLV_MSG_DEPTH();    resolv_debug ("findmodule(%O) => got .pike program %O\n", fullname, o);    return fc[fullname] = o;    }       DEC_RESOLV_MSG_DEPTH();    resolv_debug ("findmodule(%O) => not found\n", fullname);    return fc[fullname] = 0;   }
pike.git/lib/master.pike.in:2529:       void identify_parts (mixed stuff)    {    // Use an array as stack here instead of recursing directly; we    // might be pressed for stack space if the backtrace being    // described is a stack overflow.    array identify_stack = ({stuff});    while (sizeof (identify_stack)) {    stuff = identify_stack[-1];    identify_stack = identify_stack[..sizeof (identify_stack) - 2]; +  if (!intp(ident[stuff])) continue; // Already identified.    if (objectp (stuff) || functionp (stuff) || programp (stuff))    ident[stuff]++;    else if (arrayp (stuff)) {    if (!ident[stuff]++)    identify_stack += stuff;    }    else if (multisetp (stuff)) {    if (!ident[stuff]++)    identify_stack += indices([multiset]stuff);    }