summaryrefslogtreecommitdiff
path: root/subversion/libsvn_subr/temp_serializer.c
diff options
context:
space:
mode:
authorLorry Tar Creator <lorry-tar-importer@lorry>2017-08-05 16:22:51 +0000
committerLorry Tar Creator <lorry-tar-importer@lorry>2017-08-05 16:22:51 +0000
commitcf46733632c7279a9fd0fe6ce26f9185a4ae82a9 (patch)
treeda27775a2161723ef342e91af41a8b51fedef405 /subversion/libsvn_subr/temp_serializer.c
parentbb0ef45f7c46b0ae221b26265ef98a768c33f820 (diff)
downloadsubversion-tarball-master.tar.gz
Diffstat (limited to 'subversion/libsvn_subr/temp_serializer.c')
-rw-r--r--subversion/libsvn_subr/temp_serializer.c22
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)