pike.git / src / encode.c

version» Context lines:

pike.git/src/encode.c:1:   /*   || 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: encode.c,v 1.290 2009/08/17 13:55:06 grubba Exp $ + || $Id: encode.c,v 1.291 2009/08/18 13:57:16 grubba Exp $   */      #include "global.h"   #include "stralloc.h"   #include "pike_macros.h"   #include "object.h"   #include "constants.h"   #include "interpret.h"   #include "svalue.h"   #include "mapping.h"
pike.git/src/encode.c:5213:    (*l) -= t; (*v) += t;    APPLY_MASTER("programof", 1);    return;       default:    Pike_error("Format error: Unknown type tag %ld:%ld\n",    PTRDIFF_T_TO_LONG(i), PTRDIFF_T_TO_LONG(t));    }   }    + /* Defined in builtin.cmod. */ + extern struct program *MasterCodec_program; +    /*! @decl mixed decode_value(string coded_value, void|Codec codec)    *!    *! Decode a value from the string @[coded_value].    *!    *! This function takes a string created with @[encode_value()] or    *! @[encode_value_canonic()] and converts it back to the value that was    *! coded.    *!    *! If @[codec] is specified, it's used as the codec for the decode.    *! If no codec is specified, the current master object will be used.
pike.git/src/encode.c:5269:    Pike_error("decode_value: "    "The codec may not be a subtyped object yet.\n");    }    codec = Pike_sp[1-args].u.object;    break;    }    /* Fall through. */    case 1:    codec = get_master();    if (!codec) { -  /* Use a dummy if there's no master around yet, to avoid checks. */ -  push_object (clone_object (null_program, 0)); +  /* The codec used for decoding the master program. */ +  push_object (clone_object (MasterCodec_program, 0));    args++;    codec = Pike_sp[-1].u.object;    }    }       if(!my_decode(s, codec   #ifdef ENCODE_DEBUG    , debug   #endif    ))    {    char *v=s->str;    ptrdiff_t l=s->len;    rec_restore_value(&v, &l);    }    assign_svalue(Pike_sp-args-1, Pike_sp-1);    pop_n_elems(args);   }