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.417 2008/05/12 13:54:14 grubba Exp $ + // $Id: master.pike.in,v 1.418 2008/05/14 18:02:38 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:601:   //! @note   //! Special cases: The current master program is available under the   //! name @expr{"/master"@}, and the program containing the @[main]   //! function under @expr{"/main"@}.   mapping(string:program|NoValue) programs=(["/master":this_program]);   mapping(program:object) documentation = ([]);   mapping(program:string) source_cache;      mapping (program:object|NoValue) objects=([    this_program : this, -  object_program(_static_modules): _static_modules +  object_program(_static_modules): _static_modules,   ]);      mapping(string:object|NoValue) fc=([]);      // Note: It's assumed that the mappings above never decrease in size   // 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);
pike.git/lib/master.pike.in:3598:    else    return ""; // efun       if (mod) {    catch {    string res = sprintf("%O", mod);    if (res != "object" && res != "")    return (objectp (objects[parent_fun]) && programs["/master"] != parent_fun?    res+".":res+"->");    }; +  string res = search(all_constants(), mod); +  if (res) return res;    }    if (!object_program(parent_fun)) {    // We might be a top-level entity.    if (string path = programs_reverse_lookup (parent_fun))    return program_path_to_name(path, "", ".", "()->");    }    // Begin by describing our parent.    array(object) parent_obj = ({ 0 });    string res = describe_module(function_object(parent_fun)||    function_program(parent_fun)||
pike.git/lib/master.pike.in:3655:    // We're really out of luck here...    return res + (describe_program(parent_fun)||"unknown_program") + "()->";   }      //!   string describe_object(object o)   {    string s;    if(zero_type (o)) return 0; // Destructed.    -  if (o == _static_modules) return "_static_modules"; +  // Handled by the search of all_constants() below. +  // if (o == _static_modules) return "_static_modules";       program|function(mixed...:void|object) parent_fun = object_program(o);       /* Constant object? */    catch {    object|program parent_obj =    (function_object(parent_fun) || function_program(parent_fun));       if (objectp (parent_obj) || parent_obj) {    /* Check if we have a constant object. */
pike.git/lib/master.pike.in:3677:    if (objectp (tmp)) parent_obj = tmp;       /* Try finding ourselves in parent_obj. */    int i = search(values(parent_obj), o);    if (i >= 0) {    s = [string]indices(parent_obj)[i];    return describe_module(parent_obj) + s;    }    }    }; +  if ((s = search(all_constants(), o))) return s;    // When running with RESOLV_DEBUG this function may    // get called before objects has been initialized.    if(objects && objectp (objects[parent_fun]))    if ((s = programs_reverse_lookup (parent_fun)) &&    (s=program_path_to_name(s, "", "", "()")))    return s;    /* Try identifying the program. */    if(( s=describe_program(parent_fun) ))    return s+"()";   
pike.git/lib/master.pike.in:3714:    if(object|program tmp=(function_object(p) || function_program(p))) {    if(s = function_name(p))    {    return describe_module(tmp) + s;    }    }       if(s=Builtin.program_defined(p))    return BASENAME(s);    -  return 0; +  return search(all_constants(), p);   }      //!   string describe_function (function f)   {    if (!f) return 0;       string name;    -  +  if (name = search(all_constants(), f)) return name; +     if(string s = programs_reverse_lookup (f))    {    if(has_suffix(s, ".pmod"))    name = BASENAME(s[..<5]);    else    name = trim_file_name(s);    }    else    if (catch (name = function_name (f))) name = "function";