mirror of
https://github.com/Motorhead1991/qemu.git
synced 2025-08-08 18:23:57 -06:00
util: pull Buffer code out of VNC module
The Buffer code in the VNC server is useful for the IO channel code, so pull it out into a shared module, QIOBuffer. Signed-off-by: Daniel P. Berrange <berrange@redhat.com>
This commit is contained in:
parent
10817bf09d
commit
88c5f205fa
6 changed files with 191 additions and 58 deletions
16
ui/vnc.h
16
ui/vnc.h
|
@ -34,6 +34,7 @@
|
|||
#include "audio/audio.h"
|
||||
#include "qemu/bitmap.h"
|
||||
#include "crypto/tlssession.h"
|
||||
#include "qemu/buffer.h"
|
||||
#include <zlib.h>
|
||||
#include <stdbool.h>
|
||||
|
||||
|
@ -56,13 +57,6 @@
|
|||
*
|
||||
*****************************************************************************/
|
||||
|
||||
typedef struct Buffer
|
||||
{
|
||||
size_t capacity;
|
||||
size_t offset;
|
||||
uint8_t *buffer;
|
||||
} Buffer;
|
||||
|
||||
typedef struct VncState VncState;
|
||||
typedef struct VncJob VncJob;
|
||||
typedef struct VncRect VncRect;
|
||||
|
@ -535,14 +529,6 @@ ssize_t vnc_client_io_error(VncState *vs, ssize_t ret, int last_errno);
|
|||
void start_client_init(VncState *vs);
|
||||
void start_auth_vnc(VncState *vs);
|
||||
|
||||
/* Buffer management */
|
||||
void buffer_reserve(Buffer *buffer, size_t len);
|
||||
void buffer_reset(Buffer *buffer);
|
||||
void buffer_free(Buffer *buffer);
|
||||
void buffer_append(Buffer *buffer, const void *data, size_t len);
|
||||
void buffer_advance(Buffer *buf, size_t len);
|
||||
uint8_t *buffer_end(Buffer *buffer);
|
||||
|
||||
|
||||
/* Misc helpers */
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue