FreeBSD/contrib/subversion/subversion/libsvn_subr/packed_data.c
/* Read the packed contents from COMBINED, starting at *OFFSET and store
 * it in STREAM.  Update *OFFSET to point to the next stream's data and
 * continue with the sub-streams.
 */
Read the packed contents from COMBINED, starting at *OFFSET and store
it in STREAM.  Update *OFFSET to point to the next stream's data and
continue with the sub-streams.
Read the packed contents from COMBINED starting at * OFFSET and store it in STREAM . Update * OFFSET to point to the next stream ' s data and continue with the sub - streams .
static void
unflatten_int_stream(svn_packed__int_stream_t *stream,
                     svn_stringbuf_t *combined,
                     apr_size_t *offset)
{
  packed_int_private_t *private_data = stream->private_data;
  if (private_data->packed)
    {
      memcpy(private_data->packed->data,
             combined->data + *offset,
             private_data->packed->len);
      private_data->packed->data[private_data->packed->len] = '\0';
      *offset += private_data->packed->len;
    }
  stream = private_data->first_substream;
  while (stream)
    {
      private_data = stream->private_data;
      unflatten_int_stream(stream, combined, offset);
      stream = private_data->is_last ? NULL : private_data->next;
    }
}
static void unflatten_int_stream ( svn_packed__int_stream_t * stream , svn_stringbuf_t * combined , apr_size_t * offset ) { packed_int_private_t * private_data = stream -> private_data ; if ( private_data -> packed ) { memcpy ( private_data -> packed -> data , combined -> data + * offset , private_data -> packed -> len ) ; private_data -> packed -> data [ private_data -> packed -> len ] = ' \0 ' ; * offset += private_data -> packed -> len ; } stream = private_data -> first_substream ; while ( stream ) { private_data = stream -> private_data ; unflatten_int_stream ( stream , combined , offset ) ; stream = private_data -> is_last ? NULL : private_data -> next ; } }
Read the packed contents from COMBINED, starting at *OFFSET and store
 it in STREAM.
Read the packed contents from COMBINED starting at * OFFSET and store it in STREAM .