pike.git / src / encode.c

version» Context lines:

pike.git/src/encode.c:18:   #include "pike_error.h"   #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"    - RCSID("$Id: encode.c,v 1.137 2002/02/13 13:35:36 grubba Exp $"); + RCSID("$Id: encode.c,v 1.138 2002/02/13 13:38:44 grubba Exp $");      /* #define ENCODE_DEBUG */      #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)   #else   #define EDB(N,X) do { debug_malloc_touch(data); } while (0)   #endif
pike.git/src/encode.c:1158:    data->depth -= 2;   #endif   }      static void free_encode_data(struct encode_data *data)   {    toss_buffer(& data->buf);    free_mapping(data->encoded);   }    - /*! @decl string encode_value(mixed value, object|void codec) + /*! @decl string encode_value(mixed value, object|void codec, int|void trace)    *!    *! Code a value into a string.    *!    *! This function takes a value, and converts it to a string. This string    *! can then be saved, sent to another Pike process, packed or used in    *! any way you like. When you want your value back you simply send this    *! string to @[decode_value()] and it will return the value you encoded.    *!    *! Almost any value can be coded, mappings, floats, arrays, circular    *! structures etc.
pike.git/src/encode.c:1224:    addstr("\266ke0", 4);    encode_value2(Pike_sp-args, data);    UNSET_ONERROR(tmp);       free_mapping(data->encoded);       pop_n_elems(args);    push_string(low_free_buf(&data->buf));   }    - /*! @decl string encode_value_canonic(mixed value) + /*! @decl string encode_value_canonic(mixed value, object|void codec, @ +  *! int|void trace)    *!    *! Code a value into a string on canonical form.    *!    *! Takes a value and converts it to a string on canonical form, much like    *! @[encode_value()]. The canonical form means that if an identical value is    *! encoded, it will produce exactly the same string again, even if it's    *! done at a later time and/or in another Pike process. The produced    *! string is compatible with @[decode_value()].    *!    *! @note
pike.git/src/encode.c:3036:    (*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));    }   }    - /*! @decl mixed decode_value(string coded_value, object|void codec) + /*! @decl mixed decode_value(string coded_value, object|void codec, @ +  *! int|void trace)    *!    *! Decode a value from a string.    *!    *! This function takes a string created with @[encode_value()] or    *! @[encode_value_canonic()] and converts it back to the value that was    *! coded.    *!    *! If no codec is specified, the current master object will be used as codec.    *!    *! @seealso