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.334 2004/02/27 13:08:23 nilsson Exp $ + // $Id: master.pike.in,v 1.335 2004/03/05 13:42:56 nilsson 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      // --- Some configurable parameters      #define PIKE_AUTORELOAD
pike.git/lib/master.pike.in:3453:       ret += frames * "";    }       return ret;   }      //! @appears describe_error   //!   //! Return the error message from an error object or array (typically - //! caught by a @[catch]). + //! caught by a @[catch]). The type of the error is checked, hence + //! @[err] is declared as @expr{mixed@} and not @expr{object|array@}.   //!   //! If an error message couldn't be obtained, a fallback message   //! describing the failure is returned. No errors due to incorrectness   //! in @[err] are thrown.   //!   //! @seealso   //! @[describe_backtrace()], @[get_backtrace]   //! - string describe_error (object|array err) + string describe_error (mixed /* object|array */ err)   {    mixed msg;       // Note: Partial code duplication in describe_backtrace and get_backtrace.       if (objectp(err) && ([object]err)->is_generic_error) {    object err_obj = [object] err;    if (mixed err = catch {       if (functionp (err_obj->message))
pike.git/lib/master.pike.in:3879:    return UNDEFINED;    }       else {    if (objectp (parent_object[0])) parent = parent_object[0];    if (parent["_module_value"] == what && objects_reverse_lookup (parent)) {    ENC_MSG (" found as _module_value of parent module\n");    ENC_RETURN (parent_name);    }    else { -  string|array id = function_name (what); +  string|array id = function_name ([program]what);    if (stringp (id) && parent[id] == what) {    ENC_MSG (" found function name in parent: %O\n", id);    id = ({id});    }    else    id = find_index (parent, what, module_object);    if (equal (id, ({"_module_value"})))    ENC_RETURN (parent_name);    else    ENC_RETURN ((arrayp (parent_name) ? parent_name : ({parent_name})) + id);
pike.git/lib/master.pike.in:3968:    if (mkobj)    DEC_RETURN (objectp (objects[p]) ? objects[p] : (objects[p]=__null_program()));    }    DEC_RETURN (0);    }       static mixed thingof (string|array what)    {    mixed res;    array sublist; -  if (arrayp (what)) sublist = what, what = sublist[0]; +  if (arrayp (what)) sublist = [array]what, what = [array|string]sublist[0];       switch (what[0]) {    case 'c':    if (zero_type (res = all_constants()[what[1..]]))    error ("Cannot find global constant %O.\n", what[1..]);    break;    case 's':    if (zero_type (res = _static_modules[what[1..]]))    error ("Cannot find %O in _static_modules.\n", what[1..]);    break;    case 'r': -  if (zero_type (res = resolv (what[1..]))) +  if (zero_type (res = resolv ([string]what[1..])))    error ("Cannot resolve %O.\n", what[1..]);    break;    case 'p': -  if (!(res = low_cast_to_program (what[1..], fname, this))) +  if (!(res = low_cast_to_program ([string]what[1..], fname, this)))    error ("Cannot find program for %O.\n", what[1..]);    break;    case 'o': -  if (!objectp (res = low_cast_to_object (what[1..], fname, this))) +  if (!objectp(res = low_cast_to_object([string]what[1..], fname, this)))    error ("Cannot find object for %O.\n", what[1..]);    break;    case 'f': -  if (!objectp (res = findmodule (what[1..], this))) +  if (!objectp (res = findmodule ([string]what[1..], this)))    error ("Cannot find module for %O.\n", what[1..]);    break;    }       DEC_MSG (" got %O\n", res);       if (sublist) {    mixed subres = res;    for (int i = 1; i < sizeof (sublist); i++) {    mixed op = sublist[i];    if (stringp (op)) {    if (!programp (subres) && !objectp (subres) && !mappingp (subres))    error ("Cannot subindex %O%{[%O]%} since it's a %t.\n",    res, sublist[1..i-1], subres); -  if (zero_type (subres = subres[op])) +  if (zero_type (subres = ([mapping]subres)[op]))    error ("Cannot find %O in %O%{[%O]%}.\n",    op, res, sublist[1..i-1]);    DEC_MSG (" indexed with %O: %O\n", op, subres);    }    else switch (op) {    case 'm': -  if (objectp (subres) && subres->is_resolv_joinnode) { +  if (objectp (subres) && ([object]subres)->is_resolv_joinnode) {    dirnode found; -  foreach (subres->joined_modules, object|mapping part) +  foreach (([object(joinnode)]subres)->joined_modules, +  object|mapping part)    if (objectp (part) && part->is_resolv_dirnode && part->module) {    if (found)    error ("There are ambiguous module objects in %O.\n",    subres);    else -  found = part; +  found = [object(dirnode)]part;    }    if (found) subres = found;    }    -  if (objectp (subres) && subres->is_resolv_dirnode) { -  if (subres->module) { -  subres = subres->module; +  if (objectp (subres) && ([object]subres)->is_resolv_dirnode) { +  if (([object]subres)->module) { +  subres = ([object]subres)->module;    DEC_MSG (" got dirnode module %O\n", subres);    }    else    error ("Cannot find module object in dirnode %O.\n", subres);    }    else    error ("Cannot get module object in thing that isn't "    "a dirnode or unambiguous joinnode: %O\n", subres);    break;   
pike.git/lib/master.pike.in:4097:    void decode_object(object o, mixed data)    {    DEC_MSG ("decode_object (object(%O), %O)\n", object_program (o), data);    if(!o->_decode)    error ("Cannot decode object(%O) without _decode function.\n",    object_program (o));    ([function(mixed:void)]o->_decode)(data);    }   }    - mapping(string:Codec) codecs = set_weak_flag(([]),1); - Codec get_codec(string|void fname, int|void mkobj) + mapping(string:Decoder) codecs = set_weak_flag(([]),1); + Decoder get_codec(string|void fname, int|void mkobj)   {    string key = fname + "\0" + mkobj;    if (codecs[key]) return codecs[key];    return codecs[key] = Decoder(fname, mkobj);   }      class Codec   //! @[Encoder] and @[Decoder] rolled into one. This is for mainly   //! compatibility; there's typically no use combining encoding and   //! decoding into the same object.