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.229 2002/11/26 12:56:01 grubba Exp $ + // $Id: master.pike.in,v 1.230 2002/11/28 02:12:25 mast 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:860:   mapping (program:object) objects=([object_program(this_object()):this_object()]);      object low_cast_to_object(string oname, string current_file,    object|void current_handler)   {    program p;    object o;       p = low_cast_to_program(oname, current_file, current_handler, 1);    if(!p) return 0; -  if(!(o=objects[p])) o=objects[p]=p(); +  if(zero_type (o=objects[p])) o=objects[p]=p();    return o;   }      //! This function is called when the drivers wants to cast a string   //! to an object because of an implict or explicit cast. This function   //! may also receive more arguments in the future.   object cast_to_object(string oname, string current_file)   {    if(object o=low_cast_to_object(oname, current_file))    return o;
pike.git/lib/master.pike.in:2401:   //! currently either @tt{"."@} or @tt{"->"@}.   string describe_module(object|program mod, array(object)|void ret_obj)   {    if (!mod) return "";    program parent_fun;    if (objectp(mod)) {    parent_fun = object_program(mod);    if (ret_obj) ret_obj[0] = mod;    } else {    parent_fun = mod; -  if ((mod = objects[parent_fun]) && ret_obj) ret_obj[0] = mod; +  if (!zero_type (mod = objects[parent_fun]) && ret_obj) ret_obj[0] = mod;    }    if (mod) {    catch {    string res = sprintf("%O", mod);    if (res != "object" && res != "") -  return (objects[parent_fun] && programs["/master"] != parent_fun? +  return (!zero_type (objects[parent_fun]) && programs["/master"] != parent_fun?    res+".":res+"->");    };    }    if (!object_program(parent_fun)) {    // We might be a top-level entity.    string path = get_clean_program_path(parent_fun, "", ".", "()->");    if(path) return path;    }    // Begin by describing our parent.    array(object) parent_obj = ({ 0 });
pike.git/lib/master.pike.in:2474:       function parent_fun = object_program(o);       /* Constant object? */    catch {    object|program parent_obj = function_object(parent_fun);       if (parent_obj) {    /* Check if we have a constant object. */    object tmp = objects[parent_obj]; -  if (tmp) parent_obj = tmp; +  if (!zero_type (tmp)) parent_obj = tmp;       /* Try finding ourselves in parent_obj. */    int i;    if (objectp(o)) {    i = search(values(parent_obj), o);    } else {    i = search(map(values(parent_obj),    lambda(mixed x) {    if (objectp(x)) return object_program(x);    return 0;    }), o);    }    if (i >= 0) {    s = indices(parent_obj)[i];    return describe_module(parent_obj) + s;    }    }    }; -  if(objects[parent_fun]) +  if(!zero_type (objects[parent_fun]))    if(s=get_clean_program_path(parent_fun, "", "", "()"))    return s;    /* Try identifying the program. */    if(( s=describe_program(parent_fun) ))    return s+"()";       return 0;   }      //!
pike.git/lib/master.pike.in:2774:   {    program prog_to_mkobj;       object __register_new_program(program p)    {    if(fname)    {    programs[fname]=prog_to_mkobj=p;    fname=0;    if (mkobj) -  return objects[p] || (objects[p]=__null_program()); +  return zero_type (objects[p]) ? (objects[p]=__null_program()) : objects[p];    }    return 0;    }       mapping f=all_constants();       string nameof(mixed x)    {    if(mixed tmp=search(f,x))    return "efun:"+tmp;