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.163 2003/01/26 16:22:50 mirar Exp $ + || $Id: encode.c,v 1.164 2003/02/15 17:33:33 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:20:   #include "operators.h"   #include "builtin_functions.h"   #include "module_support.h"   #include "fsort.h"   #include "threads.h"   #include "stuff.h"   #include "version.h"   #include "bignum.h"   #include "pikecode.h"    - RCSID("$Id: encode.c,v 1.163 2003/01/26 16:22:50 mirar Exp $"); + RCSID("$Id: encode.c,v 1.164 2003/02/15 17:33:33 grubba Exp $");      /* #define ENCODE_DEBUG */      /* Use the old encoding method for programs. */   #define OLD_PIKE_ENCODE_PROGRAM      #ifdef ENCODE_DEBUG   /* Pass a nonzero integer as the third arg to encode_value,    * encode_value_canonic and decode_value to activate this debug. */   #define EDB(N,X) do { debug_malloc_touch(data); if (data->debug>=N) {X;} } while (0)
pike.git/src/encode.c:1614:    struct mapping *decoded;    struct unfinished_prog_link *unfinished_programs;    struct unfinished_obj_link *unfinished_objects;    struct svalue counter;    struct object *codec;    int pickyness;    int pass;    struct pike_string *raw;    struct decode_data *next;   #ifdef PIKE_THREADS -  struct object *thread_id; +  struct thread_state *thread_state;   #endif   #ifdef ENCODE_DEBUG    int debug, depth;   #endif    struct Supporter supporter;   };      static void decode_value2(struct decode_data *data);      static void fallback_codec(void)
pike.git/src/encode.c:3641:    free((char *)tmp);    }       while(data->unfinished_objects)    {    struct unfinished_obj_link *tmp=data->unfinished_objects;    data->unfinished_objects=tmp->next;    free((char *)tmp);    }   #ifdef PIKE_THREADS -  free_object(data->thread_id); +  data->thread_state = NULL;   #endif       free( (char *) data);   }      /* Run pass2 */   int re_decode(struct decode_data *data, int ignored)   {    ONERROR err;    SET_ONERROR(err, free_decode_data, data);
pike.git/src/encode.c:3677:   #endif    )   {    ONERROR err;    struct decode_data *data;       /* Attempt to avoid infinite recursion on circular structures. */    for (data = current_decode; data; data=data->next) {    if (data->raw == tmp && data->codec == codec   #ifdef PIKE_THREADS -  && data->thread_id == Pike_interpreter.thread_id +  && data->thread_state == Pike_interpreter.thread_state   #endif    ) {    struct svalue *res;    struct svalue val = {    T_INT, NUMBER_NUMBER,   #ifdef HAVE_UNION_INIT    {0}, /* Only to avoid warnings. */   #endif /* HAVE_UNION_INIT */    };    val.u.integer = COUNTER_START;
pike.git/src/encode.c:3711:    data->len=tmp->len;    data->ptr=0;    data->codec=codec;    data->pickyness=0;    data->pass=1;    data->unfinished_programs=0;    data->unfinished_objects=0;    data->raw = tmp;    data->next = current_decode;   #ifdef PIKE_THREADS -  data->thread_id = Pike_interpreter.thread_id; +  data->thread_state = Pike_interpreter.thread_state;   #endif   #ifdef ENCODE_DEBUG    data->debug = debug;    data->depth = -2;   #endif       if (tmp->size_shift ||    data->len < 5 ||    GETC() != 182 ||    GETC() != 'k' ||    GETC() != 'e' ||    GETC() != '0')    {    free( (char *) data);    return 0;    }    - #ifdef PIKE_THREADS -  add_ref(Pike_interpreter.thread_id); - #endif -  +     data->decoded=allocate_mapping(128);       current_decode = data;       SET_ONERROR(err, free_decode_data, data);       init_supporter(& data->supporter,    (supporter_callback *) re_decode,    (void *)data);