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.282 2008/06/28 18:35:58 mast Exp $ + || $Id: encode.c,v 1.283 2008/06/29 12:50:03 nilsson 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:952:    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(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) +  SEE_PROTECTED|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);
pike.git/src/encode.c:1442:    struct pike_string *symbol = NULL;    if (index_shared_string(id->name, id->name->len-1) != '=') {    /* Getter callback. */    symbol = string_slice(id->name, 3, id->name->len - 3);    } else if (id->name->len > 4) {    /* Setter callback. */    symbol = string_slice(id->name, 3, id->name->len - 4);    }    if (symbol) {    int i = really_low_find_shared_string_identifier(symbol, p, -  SEE_STATIC|SEE_PRIVATE); +  SEE_PROTECTED|SEE_PRIVATE);    if (i >= 0) {    /* Found the symbol. */    gs_flags = PTR_FROM_INT(p, i)->id_flags;    }    free_string(symbol);    }    } else if (id->name && (id->name->len>1) &&    (index_shared_string(id->name, 0) == '`') &&    ((((unsigned)index_shared_string(id->name, 1)) >=    256) ||
pike.git/src/encode.c:1465:    struct pike_string *symbol = NULL;    if (index_shared_string(id->name, id->name->len-1) != '=') {    /* Getter callback. */    symbol = string_slice(id->name, 1, id->name->len - 1);    } else if (id->name->len > 2) {    /* Setter callback. */    symbol = string_slice(id->name, 1, id->name->len - 2);    }    if (symbol) {    int i = really_low_find_shared_string_identifier(symbol, p, -  SEE_STATIC|SEE_PRIVATE); +  SEE_PROTECTED|SEE_PRIVATE);    if (i >= 0) {    /* Found the symbol. */    gs_flags = PTR_FROM_INT(p, i)->id_flags;    }    free_string(symbol);    }    }       if (IDENTIFIER_IS_ALIAS(id->identifier_flags)) {    if ((!id->func.ext_ref.depth) &&
pike.git/src/encode.c:3034:    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 = really_low_find_shared_string_identifier(    Pike_sp[-1].u.string,    p->inherits[Pike_sp[-2].subtype].prog, -  SEE_STATIC|SEE_PRIVATE); +  SEE_PROTECTED|SEE_PRIVATE);    debug_malloc_touch(p);    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    debug_malloc_touch(p);    pop_n_elems(2);    *Pike_sp++ = func;