buffer: add buffer_move_empty

Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
Reviewed-by: Peter Lieven <pl@kamp.de>
Reviewed-by: Daniel Berrange <berrange@redhat.com>
Message-id: 1446203414-4013-4-git-send-email-kraxel@redhat.com
This commit is contained in:
Gerd Hoffmann 2015-10-30 12:09:58 +01:00
parent 810082d15c
commit 4d1eb5fdb1
2 changed files with 24 additions and 0 deletions

View file

@ -127,4 +127,14 @@ uint8_t *buffer_end(Buffer *buffer);
*/
gboolean buffer_empty(Buffer *buffer);
/**
* buffer_move_empty:
* @to: destination buffer object
* @from: source buffer object
*
* Moves buffer, without copying data. 'to' buffer must be empty.
* 'from' buffer is empty and zero-sized on return.
*/
void buffer_move_empty(Buffer *to, Buffer *from);
#endif /* QEMU_BUFFER_H__ */