[Spice-devel,1/3] add spice_chunk_get_{data,len}

Submitted by Christophe Fergeau on Aug. 22, 2011, 1:39 p.m.

Details

Message ID 1313995160-11625-2-git-send-email-cfergeau@redhat.com
State New, archived
Headers show

Not browsing as part of any series.

Commit Message

Christophe Fergeau Aug. 22, 2011, 1:39 p.m.
---
 common/mem.c |   11 +++++++++++
 common/mem.h |    2 ++
 2 files changed, 13 insertions(+), 0 deletions(-)

Patch hide | download patch | download mbox

diff --git a/common/mem.c b/common/mem.c
index 7236cf0..cfc3ef1 100644
--- a/common/mem.c
+++ b/common/mem.c
@@ -186,6 +186,17 @@  void *spice_realloc_n(void *mem, size_t n_blocks, size_t n_block_bytes)
     return spice_realloc(mem, n_blocks * n_block_bytes);
 }
 
+
+uint8_t *spice_chunk_get_data(SpiceChunk *chunk)
+{
+    return chunk->data;
+}
+
+uint32_t spice_chunk_get_len(SpiceChunk *chunk)
+{
+    return chunk->len;
+}
+
 SpiceChunks *spice_chunks_new(uint32_t count)
 {
     SpiceChunks *chunks;
diff --git a/common/mem.h b/common/mem.h
index 980ea13..2d423a3 100644
--- a/common/mem.h
+++ b/common/mem.h
@@ -90,6 +90,8 @@  void *spice_malloc_n(size_t n_blocks, size_t n_block_bytes) SPICE_GNUC_MALLOC SP
 void *spice_malloc_n_m(size_t n_blocks, size_t n_block_bytes, size_t extra_size) SPICE_GNUC_MALLOC;
 void *spice_malloc0_n(size_t n_blocks, size_t n_block_bytes) SPICE_GNUC_MALLOC SPICE_GNUC_ALLOC_SIZE2(1,2);
 void *spice_realloc_n(void *mem, size_t n_blocks, size_t n_block_bytes) SPICE_GNUC_WARN_UNUSED_RESULT;
+uint8_t *spice_chunk_get_data(SpiceChunk *chunk);
+uint32_t spice_chunk_get_len(SpiceChunk *chunk);
 SpiceChunks *spice_chunks_new(uint32_t count) SPICE_GNUC_MALLOC;
 SpiceChunks *spice_chunks_new_linear(uint8_t *data, uint32_t len) SPICE_GNUC_MALLOC;
 void spice_chunks_destroy(SpiceChunks *chunks);