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.225 2002/11/23 17:07:51 marcus Exp $ + // $Id: master.pike.in,v 1.226 2002/11/23 18:40:05 marcus 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:2334:    break;    }    }    }       return ret;    }   }       - static string get_clean_program_path ( program p, string suff1, string suff2 ) + static string get_clean_program_path ( program p, string pref1, +  string suff1, string suff2 )   {    array(string) sort_paths_by_length(array(string) paths)    {    sort(map(paths, sizeof), paths);    return reverse(paths);    };    string path = search(programs, p);    if (path) { -  if (path == "/master") return "master()"+suff2; +  if (path == "/master") return "master"+suff2;    foreach(sort_paths_by_length(map(pike_module_path - ({""}),    lambda(string s) {    if (s[-1] == '/') return s;    return s+"/";    })),    string prefix) {    if (has_prefix(path, prefix)) {    path = path[sizeof(prefix)..];    break;    }    }    path = trim_file_name(path);    string modname = replace(path, ".pmod/", ".");    if(search(modname, "/")<0) path=modname; -  if (has_suffix(path, ".pmod/module.pmod")) { -  return path[..sizeof(path)-18]+suff1; +  if (has_suffix(path, ".module.pmod")) { +  return pref1+path[..sizeof(path)-13]+suff1;    }    if (has_suffix(path, ".pmod")) { -  return path[..sizeof(path)-6]+suff1; +  return pref1+path[..sizeof(path)-6]+suff1;    }    if (has_suffix(path, ".so")) { -  return path[..sizeof(path)-4]+suff1; +  return pref1+path[..sizeof(path)-4]+suff1;    }    if (has_suffix(path, ".pike")) {    return path[..sizeof(path)-6]+suff2;    }    return path + suff2;    }    return 0;   }      
pike.git/lib/master.pike.in:2407:    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 (mod) {    catch {    string res = sprintf("%O", mod);    if (res != "object" && res != "") -  return (objects[parent_fun]? res+".":res+"->"); +  return (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, ".", "()->"); +  string path = get_clean_program_path(parent_fun, "", ".", "()->");    if(path) return path;    }    // Begin by describing our parent.    array(object) parent_obj = ({ 0 });    string res = describe_module(function_object(parent_fun)||    object_program(parent_fun),    parent_obj);    // werror("So far: %O parent_obj:%O\n", res, parent_obj);    object|program parent = parent_obj[0] || object_program(parent_fun);    if (mod && parent) {
pike.git/lib/master.pike.in:2492:    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(s=get_clean_program_path(parent_fun, "", "", "()")) +  return s;    /* Try identifying the program. */    if(( s=describe_program(parent_fun) )) -  return (objects[parent_fun]? s : s+"()"); +  return s+"()";       return 0;   }      //!   string describe_program(program p)   {    string s;    if(!p) return 0;    -  if(s=get_clean_program_path(p, "", "")) +  if(s=get_clean_program_path(p, "program(", ")", ""))    return s;       if(mixed tmp=function_object(p))    {    return describe_module(tmp) + function_name(p);    }       if(s=_static_modules.Builtin()->program_defined(p))    return EXPLODE_PATH(s)[-1];