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.245 2007/07/03 09:52:07 grubba Exp $ + || $Id: encode.c,v 1.246 2007/10/03 11:38:06 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:1143:    p->inherits[d].prog->id););    }       for(d=0;d<p->num_identifiers;d++)    {    adddata(p->identifiers[d].name);    encode_type(p->identifiers[d].type, data);    code_number(p->identifiers[d].identifier_flags,data);    code_number(p->identifiers[d].run_time_type,data);    code_number(p->identifiers[d].opt_flags,data); -  if (!IDENTIFIER_IS_C_FUNCTION(p->identifiers[d].identifier_flags)) { +  if (IDENTIFIER_IS_ALIAS(p->identifiers[d].identifier_flags)) { +  code_number(p->identifiers[d].func.ext_ref.depth,data); +  code_number(p->identifiers[d].func.ext_ref.id,data); +  } else if (!IDENTIFIER_IS_C_FUNCTION(p->identifiers[d].identifier_flags)) {    code_number(p->identifiers[d].func.offset,data);    } else {    Pike_error("Cannot encode functions implemented in C "    "(identifier=\"%S\").\n",    p->identifiers[d].name);    }    }       for(d=0;d<NUM_LFUNS;d++)    code_number(p->lfuns[d], data);
pike.git/src/encode.c:1342:    struct reference *ref = p->identifier_references + d;    struct inherit *inh = INHERIT_FROM_PTR(p, ref);    struct identifier *id = ID_FROM_PTR(p, ref);       /* Skip identifiers that haven't been overloaded. */    if (ref->id_flags & ID_INHERITED) continue;       /* Skip getter/setter variables; they get pulled in    * by their respective functions.    */ -  if (IDENTIFIER_IS_VARIABLE(id->identifier_flags) && +  if (!IDENTIFIER_IS_ALIAS(id->identifier_flags) && +  IDENTIFIER_IS_VARIABLE(id->identifier_flags) &&    (id->run_time_type == PIKE_T_GET_SET))    continue;       EDB(3,    fprintf(stderr,    "%*sencoding identifier ref %d: %4x \"%s\"\n",    data->depth, "", d,    id->identifier_flags,    id->name->str));   
pike.git/src/encode.c:1427:    int i = really_low_find_shared_string_identifier(symbol, p,    SEE_STATIC|SEE_PRIVATE);    if (i >= 0) {    /* Found the symbol. */    gs_flags = PTR_FROM_INT(p, i)->id_flags;    }    free_string(symbol);    }    }    -  switch (id->identifier_flags & IDENTIFIER_TYPE_MASK) { +  if (IDENTIFIER_IS_ALIAS(id->identifier_flags)) { +  Pike_error("Encoding of aliases not supported yet.\n"); +  } else switch (id->identifier_flags & IDENTIFIER_TYPE_MASK) {    case IDENTIFIER_CONSTANT:    EDB(3,    fprintf(stderr, "%*sencode: encoding constant\n",    data->depth, ""));       code_number(ID_ENTRY_CONSTANT, data);    if (gs_flags >= 0) {    code_number(gs_flags, data);    } else {    code_number(ref->id_flags, data);
pike.git/src/encode.c:3244:    SET_ONERROR(err2, restore_type_mark, Pike_compiler->pike_type_mark_stackp);       debug_malloc_touch(p);    for(d=0;d<p->num_identifiers;d++)    {    getdata(p->identifiers[d].name);    decode_type(p->identifiers[d].type,data);    decode_number(p->identifiers[d].identifier_flags,data);    decode_number(p->identifiers[d].run_time_type,data);    decode_number(p->identifiers[d].opt_flags,data); -  if (!IDENTIFIER_IS_C_FUNCTION(p->identifiers[d].identifier_flags)) +  if (IDENTIFIER_IS_ALIAS(p->identifiers[d].identifier_flags)) { +  decode_number(p->identifiers[d].func.ext_ref.depth, data); +  decode_number(p->identifiers[d].func.ext_ref.id, data); +  } else if (!IDENTIFIER_IS_C_FUNCTION(p->identifiers[d].identifier_flags))    {    decode_number(p->identifiers[d].func.offset,data);    } else {    ref_push_program (p);    ref_push_string (p->identifiers[d].name);    decode_error(Pike_sp - 1, Pike_sp - 2,    "Cannot decode function implemented in C: ");    }    }