summaryrefslogtreecommitdiffstats
path: root/common
diff options
context:
space:
mode:
Diffstat (limited to 'common')
-rw-r--r--common/marshaller.c10
-rw-r--r--common/marshaller.h2
2 files changed, 12 insertions, 0 deletions
diff --git a/common/marshaller.c b/common/marshaller.c
index be6198dc..70008a84 100644
--- a/common/marshaller.c
+++ b/common/marshaller.c
@@ -346,6 +346,16 @@ uint8_t *spice_marshaller_add_ref(SpiceMarshaller *m, uint8_t *data, size_t size
return spice_marshaller_add_ref_full(m, data, size, NULL, NULL);
}
+void spice_marshaller_add_ref_chunks(SpiceMarshaller *m, SpiceChunks *chunks)
+{
+ int i;
+
+ for (i = 0; i < chunks->num_chunks; i++) {
+ spice_marshaller_add_ref(m, chunks->chunk[i].data,
+ chunks->chunk[i].len);
+ }
+}
+
SpiceMarshaller *spice_marshaller_get_submarshaller(SpiceMarshaller *m)
{
SpiceMarshallerData *d;
diff --git a/common/marshaller.h b/common/marshaller.h
index 59a190dc..51189341 100644
--- a/common/marshaller.h
+++ b/common/marshaller.h
@@ -20,6 +20,7 @@
#define _H_MARSHALLER
#include <spice/types.h>
+#include <spice/draw.h> /* for SpiceChunk, temporary */
#ifndef WIN32
#include <sys/uio.h>
#endif
@@ -36,6 +37,7 @@ uint8_t *spice_marshaller_add(SpiceMarshaller *m, uint8_t *data, size_t size);
uint8_t *spice_marshaller_add_ref(SpiceMarshaller *m, uint8_t *data, size_t size);
uint8_t *spice_marshaller_add_ref_full(SpiceMarshaller *m, uint8_t *data, size_t size,
spice_marshaller_item_free_func free_data, void *opaque);
+void spice_marshaller_add_ref_chunks(SpiceMarshaller *m, SpiceChunks *chunks);
void spice_marshaller_flush(SpiceMarshaller *m);
void spice_marshaller_set_base(SpiceMarshaller *m, size_t base);
uint8_t *spice_marshaller_linearize(SpiceMarshaller *m, size_t skip,