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.352 2004/07/04 12:38:49 mast Exp $ + // $Id: master.pike.in,v 1.353 2004/07/04 14:30:09 mast 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:778:    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 || -  get_codec)(fname, mkobj)); +  get_codec)(fname, mkobj, handler));    DEC_RESOLV_MSG_DEPTH();    resolv_debug ("low_findprog %s: dump decode ok\n", fname);    return programs[fname] = ret;       };    DEC_RESOLV_MSG_DEPTH();    resolv_debug ("low_findprog %s: dump decode failed\n", fname);    programs[fname] = no_value;    call_compile_warning (handler, oname,    "Decode failed: " + describe_error(err));
pike.git/lib/master.pike.in:4063:    if (!rev_static_modules[p]) {    // Some people inherit modules...    rev_static_modules[p] = "s" + name;    }    }    }   #endif    }   }    - class Decoder (void|string fname, void|int mkobj) + class Decoder (void|string fname, void|int mkobj, void|object handler)   //! @appears Pike.Decoder   //!   //! Codec for use with @[decode_value]. This is the decoder   //! corresponding to @[Encoder]. See that one for more details.   {    static int unregistered = 1;       object __register_new_program(program p)    {    DEC_MSG ("__register_new_program (%O)\n", p);
pike.git/lib/master.pike.in:4101:    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 ([string]what[1..]))) +  if (zero_type (res = resolv ([string]what[1..], fname, handler)))    error ("Cannot resolve %O.\n", what[1..]);    break;    case 'p': -  if (!(res = low_cast_to_program ([string]what[1..], fname, this))) +  if (!(res = low_cast_to_program ([string]what[1..], fname, handler)))    error ("Cannot find program for %O.\n", what[1..]);    break;    case 'o': -  if (!objectp(res = low_cast_to_object([string]what[1..], fname, this))) +  if (!objectp(res = low_cast_to_object([string]what[1..], fname, handler)))    error ("Cannot find object for %O.\n", what[1..]);    break;    case 'f': -  if (!objectp (res = findmodule ([string]what[1..], this))) +  if (!objectp (res = findmodule ([string]what[1..], handler)))    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];
pike.git/lib/master.pike.in:4220:    {    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:Decoder) codecs = set_weak_flag(([]),1); - Decoder get_codec(string|void fname, int|void mkobj) + Decoder get_codec(string|void fname, int|void mkobj, void|object handler)   { -  +  if (handler) +  // Maybe cache these too? Not done right now since explicit +  // handlers are fairly rare. Note that caching easily could +  // introduce a cyclic ref through Decoder.handler. +  return Decoder (fname, mkobj, handler);    string key = fname + "\0" + mkobj;    if (codecs[key]) return codecs[key];    return codecs[key] = Decoder(fname, mkobj);   }      class Codec   //! @appears Pike.Codec   //!   //! @[Encoder] and @[Decoder] rolled into one. This is for mainly   //! compatibility; there's typically no use combining encoding and