diff options
author | Gerd Hoffmann <kraxel@redhat.com> | 2015-10-30 12:09:57 +0100 |
---|---|---|
committer | Gerd Hoffmann <kraxel@redhat.com> | 2015-11-05 09:08:33 +0100 |
commit | 810082d15c244b8b29470d3bb1c6b11fc9a40c25 (patch) | |
tree | d8ef9bcb6797c108a9479fe08a84d8462ae9d07f /include/qemu/buffer.h | |
parent | 5c10dbb7b577370e86ff459973b06d530c3777cf (diff) | |
download | qemu-810082d15c244b8b29470d3bb1c6b11fc9a40c25.zip qemu-810082d15c244b8b29470d3bb1c6b11fc9a40c25.tar.gz qemu-810082d15c244b8b29470d3bb1c6b11fc9a40c25.tar.bz2 |
buffer: add buffer_init
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
Reviewed-by: Peter Lieven <pl@kamp.de>
Reviewed-by: Daniel P. Berrange <berrange@redhat.com>
Message-id: 1446203414-4013-3-git-send-email-kraxel@redhat.com
Diffstat (limited to 'include/qemu/buffer.h')
-rw-r--r-- | include/qemu/buffer.h | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/include/qemu/buffer.h b/include/qemu/buffer.h index b380cec..0710e16 100644 --- a/include/qemu/buffer.h +++ b/include/qemu/buffer.h @@ -34,12 +34,24 @@ typedef struct Buffer Buffer; */ struct Buffer { + char *name; size_t capacity; size_t offset; uint8_t *buffer; }; /** + * buffer_init: + * @buffer: the buffer object + * @name: buffer name + * + * Optionally attach a name to the buffer, to make it easier + * to identify in debug traces. + */ +void buffer_init(Buffer *buffer, const char *name, ...) + GCC_FMT_ATTR(2, 3); + +/** * buffer_reserve: * @buffer: the buffer object * @len: the minimum required free space |