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.286 2003/06/02 19:18:56 mast Exp $ + // $Id: master.pike.in,v 1.287 2003/06/05 01:07:16 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:669:    foreach(query_precompiled_names(fname), string oname) {    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->Decoder || -  Decoder)(fname, mkobj)); +  (handler && handler->get_codec || +  get_codec)(fname, mkobj));    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;    if (handler && handler->compile_warning) {    handler->compile_warning(oname, 0,
pike.git/lib/master.pike.in:3447:    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) + { +  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.   {    inherit Encoder;    inherit Decoder;       void create (void|mixed encoded)    //! The optional argument is the thing to encode; it's passed on to