diff options
Diffstat (limited to 'subversion/libsvn_subr/temp_serializer.c')
-rw-r--r-- | subversion/libsvn_subr/temp_serializer.c | 22 |
1 files changed, 21 insertions, 1 deletions
diff --git a/subversion/libsvn_subr/temp_serializer.c b/subversion/libsvn_subr/temp_serializer.c index 261267a..c6286a6 100644 --- a/subversion/libsvn_subr/temp_serializer.c +++ b/subversion/libsvn_subr/temp_serializer.c @@ -279,6 +279,26 @@ svn_temp_serializer__pop(svn_temp_serializer__context_t *context) context->recycler = old; } +void +svn_temp_serializer__add_leaf(svn_temp_serializer__context_t *context, + const void * const * source_struct, + apr_size_t struct_size) +{ + const void *source = *source_struct; + + /* the serialized structure must be properly aligned */ + if (source) + align_buffer_end(context); + + /* Store the offset at which the struct data that will the appended. + * Write 0 for NULL pointers. */ + store_current_end_pointer(context, source_struct); + + /* finally, actually append the struct contents */ + if (*source_struct) + svn_stringbuf_appendbytes(context->buffer, source, struct_size); +} + /* Serialize a string referenced from the current structure within the * serialization CONTEXT. S must be a reference to the char* pointer in * the original structure so that the correspondence in the serialized @@ -292,7 +312,7 @@ svn_temp_serializer__add_string(svn_temp_serializer__context_t *context, /* Store the offset at which the string data that will the appended. * Write 0 for NULL pointers. Strings don't need special alignment. */ - store_current_end_pointer(context, (const void **)s); + store_current_end_pointer(context, (const void *const *)s); /* append the string data */ if (string) |