[Spice-devel] [PATCH 1/3] add spice_chunk_get_{data,len}
Christophe Fergeau
cfergeau at redhat.com
Sun Aug 21 23:39:18 PDT 2011
---
common/mem.c | 11 +++++++++++
common/mem.h | 2 ++
2 files changed, 13 insertions(+), 0 deletions(-)
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);
--
1.7.6
More information about the Spice-devel
mailing list