summaryrefslogtreecommitdiffstats
path: root/common
diff options
context:
space:
mode:
authorAlexander Larsson <alexl@redhat.com>2010-07-07 22:40:16 +0200
committerAlexander Larsson <alexl@redhat.com>2010-07-07 23:10:51 +0200
commitee26a9a77372b92ee615ae783676cb0ed7172ecd (patch)
tree0e2cfae5107ce40253f7bb60ca326ecdc8a8deba /common
parenta415c557657c2009798d086b229c17ac0d47a978 (diff)
downloadspice-ee26a9a77372b92ee615ae783676cb0ed7172ecd.tar.gz
spice-ee26a9a77372b92ee615ae783676cb0ed7172ecd.tar.xz
spice-ee26a9a77372b92ee615ae783676cb0ed7172ecd.zip
Add spice_marshaller_add_ref_chunks
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,