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.226 2004/12/18 22:05:45 grubba Exp $ + || $Id: encode.c,v 1.227 2004/12/20 13:14:49 mast 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:920:    /* FIXME: Ought to have special treatment of trampolines. */    if (data->canonic)    Pike_error("Canonical encoding of functions not supported.\n");    check_stack(1);    push_svalue(val);    apply(data->codec,"nameof", 1);    if(Pike_sp[-1].type == T_INT && Pike_sp[-1].subtype==NUMBER_UNDEFINED)    {    if(val->subtype != FUNCTION_BUILTIN)    { -  if(find_shared_string_identifier(ID_FROM_INT(val->u.object->prog, val->subtype)->name, -  val->u.object->prog)==val->subtype) +  if(really_low_find_shared_string_identifier( +  ID_FROM_INT(val->u.object->prog, val->subtype)->name, +  val->u.object->prog, +  SEE_STATIC|SEE_PRIVATE)==val->subtype)    {    /* We have to remove ourself from the cache for now */    struct svalue tmp = entry_id;    map_delete(data->encoded, val);       code_entry(TAG_FUNCTION, 1, data);    push_svalue(val);    Pike_sp[-1].type = T_OBJECT;    Pike_sp[-1].subtype = 0;    encode_value2(Pike_sp-1, data, 0);    ref_push_string(ID_FROM_INT(val->u.object->prog, val->subtype)->name);    encode_value2(Pike_sp-1, data, 0);    pop_n_elems(3);       /* Put value back in cache */    mapping_insert(data->encoded, val, &tmp);    goto encode_done;    } -  +  else { +  /* FIXME: Encode the object, the inherit and the name. */ +  Pike_error("Cannot encode overloaded functions (yet).\n");    } -  +  }    Pike_error("Cannot encode builtin functions.\n");    }       code_entry(TAG_FUNCTION, 0, data);    encode_value2(Pike_sp-1, data, 0);    pop_stack();    break;          case T_PROGRAM:
pike.git/src/encode.c:2706:    "Failed to decode function object. Got: ");       decode_value2(data);    if(Pike_sp[-1].type != T_STRING && data->pickyness)    decode_error(NULL, Pike_sp - 1,    "Failed to decode function identifier. Got: ");       if (Pike_sp[-2].type == T_OBJECT &&    Pike_sp[-1].type == T_STRING &&    (p = Pike_sp[-2].u.object->prog)) { -  int f = find_shared_string_identifier(Pike_sp[-1].u.string, -  p->inherits[Pike_sp[-2].subtype].prog); +  int f = really_low_find_shared_string_identifier( +  Pike_sp[-1].u.string, +  p->inherits[Pike_sp[-2].subtype].prog, +  SEE_STATIC|SEE_PRIVATE);    if (f >= 0) {    struct svalue func;    low_object_index_no_free(&func, Pike_sp[-2].u.object, f);   #ifdef PIKE_SECURITY    /* FIXME: Check access to the function. */   #endif    pop_n_elems(2);    *Pike_sp++ = func;    dmalloc_touch_svalue(Pike_sp-1);    break;