-static unsigned read_longlong(long long *v, const char *data)
-{
- *v = *(long long *)data;
- return sizeof(long long);
-}
-
-static unsigned read_float(float *v, const char *data)
-{
- *v = *(float *)data;
- return sizeof(float);
-}
-
-static unsigned read_double(double *v, const char *data)
-{
- *v = *(double *)data;
- return sizeof(double);
-}
-
-static unsigned read_pointer(void **v, const char *data)
-{
- *v = *(void **)data;
- return sizeof(void *);
-}
-
-static unsigned read_data(const void **v, const char *data)
-{
- int vlen;
- unsigned pos = 0;
- pos += read_int(&vlen, data);
- if(vlen)
- *v = data+pos;
- else
- *v = NULL;
- return pos+vlen;
-}
-
-static unsigned read_string(const unsigned char **v, const char *data)
-{
- return read_data((const void **)v, data);
-}
-
-static unsigned read_string_array(const unsigned char ***v, const char *data)
-{
- int count;
- unsigned pos = 0;
- int i;
- pos += read_int(&count, data);
- *v = (const unsigned char **)tmpalloc(count*sizeof(const unsigned char *));
- for(i=0; i<count; ++i)
- pos += read_string(*v+i, data+pos);
- return pos;