Yihui Xiong / msgpack

Dependents:   msgpack_example

Embed: (wiki syntax)

« Back to documentation index

Streaming deserializer

Streaming deserializer
[MessagePack C]

Functions

bool msgpack_unpacker_init (msgpack_unpacker *mpac, size_t initial_buffer_size)
 Initializes a streaming deserializer.
void msgpack_unpacker_destroy (msgpack_unpacker *mpac)
 Destroys a streaming deserializer initialized by msgpack_unpacker_init(msgpack_unpacker*, size_t).
msgpack_unpacker * msgpack_unpacker_new (size_t initial_buffer_size)
 Creates a streaming deserializer.
void msgpack_unpacker_free (msgpack_unpacker *mpac)
 Frees a streaming deserializer created by msgpack_unpacker_new(size_t).
static bool msgpack_unpacker_reserve_buffer (msgpack_unpacker *mpac, size_t size)
 Reserves free space of the internal buffer.
static char * msgpack_unpacker_buffer (msgpack_unpacker *mpac)
 Gets pointer to the free space of the internal buffer.
static size_t msgpack_unpacker_buffer_capacity (const msgpack_unpacker *mpac)
 Gets size of the free space of the internal buffer.
static void msgpack_unpacker_buffer_consumed (msgpack_unpacker *mpac, size_t size)
 Notifies the deserializer that the internal buffer filled.
bool msgpack_unpacker_next (msgpack_unpacker *mpac, msgpack_unpacked *pac)
 Deserializes one object.
static void msgpack_unpacked_init (msgpack_unpacked *result)
 Initializes a msgpack_unpacked object.
static void msgpack_unpacked_destroy (msgpack_unpacked *result)
 Destroys a streaming deserializer initialized by msgpack_unpacked().
static msgpack_zone * msgpack_unpacked_release_zone (msgpack_unpacked *result)
 Releases the memory zone from msgpack_unpacked object.

Function Documentation

static void msgpack_unpacked_destroy ( msgpack_unpacked *  result ) [static]

Destroys a streaming deserializer initialized by msgpack_unpacked().

Definition at line 235 of file unpack.h.

static void msgpack_unpacked_init ( msgpack_unpacked *  result ) [static]

Initializes a msgpack_unpacked object.

The initialized object must be destroyed by msgpack_unpacked_destroy(msgpack_unpacker*). Use the object with msgpack_unpacker_next(msgpack_unpacker*, msgpack_unpacked*) or msgpack_unpack_next(msgpack_unpacked*, const char*, size_t, size_t*).

Definition at line 230 of file unpack.h.

static msgpack_zone * msgpack_unpacked_release_zone ( msgpack_unpacked *  result ) [static]

Releases the memory zone from msgpack_unpacked object.

The released zone must be freed by msgpack_zone_free(msgpack_zone*).

Definition at line 244 of file unpack.h.

static char * msgpack_unpacker_buffer ( msgpack_unpacker *  mpac ) [static]

Gets pointer to the free space of the internal buffer.

Use this function to fill the internal buffer with msgpack_unpacker_reserve_buffer(msgpack_unpacker*, size_t), msgpack_unpacker_buffer_capacity(const msgpack_unpacker*) and msgpack_unpacker_buffer_consumed(msgpack_unpacker*).

Definition at line 203 of file unpack.h.

static size_t msgpack_unpacker_buffer_capacity ( const msgpack_unpacker *  mpac ) [static]

Gets size of the free space of the internal buffer.

Use this function to fill the internal buffer with msgpack_unpacker_reserve_buffer(msgpack_unpacker*, size_t), msgpack_unpacker_buffer(const msgpack_unpacker*) and msgpack_unpacker_buffer_consumed(msgpack_unpacker*).

Definition at line 208 of file unpack.h.

static void msgpack_unpacker_buffer_consumed ( msgpack_unpacker *  mpac,
size_t  size 
) [static]

Notifies the deserializer that the internal buffer filled.

Use this function to fill the internal buffer with msgpack_unpacker_reserve_buffer(msgpack_unpacker*, size_t), msgpack_unpacker_buffer(msgpack_unpacker*) and msgpack_unpacker_buffer_capacity(const msgpack_unpacker*).

Definition at line 213 of file unpack.h.

void msgpack_unpacker_destroy ( msgpack_unpacker *  mpac )

Destroys a streaming deserializer initialized by msgpack_unpacker_init(msgpack_unpacker*, size_t).

Definition at line 232 of file unpack.c.

void msgpack_unpacker_free ( msgpack_unpacker *  mpac )

Frees a streaming deserializer created by msgpack_unpacker_new(size_t).

Definition at line 255 of file unpack.c.

bool msgpack_unpacker_init ( msgpack_unpacker *  mpac,
size_t  initial_buffer_size 
)

Initializes a streaming deserializer.

The initialized deserializer must be destroyed by msgpack_unpacker_destroy(msgpack_unpacker*).

Definition at line 190 of file unpack.c.

msgpack_unpacker* msgpack_unpacker_new ( size_t  initial_buffer_size )

Creates a streaming deserializer.

The created deserializer must be destroyed by msgpack_unpacker_free(msgpack_unpacker*).

Definition at line 240 of file unpack.c.

bool msgpack_unpacker_next ( msgpack_unpacker *  mpac,
msgpack_unpacked *  pac 
)

Deserializes one object.

Returns true if it successes. Otherwise false is returned.

Parameters:
pacpointer to an initialized msgpack_unpacked object.

Definition at line 384 of file unpack.c.

static bool msgpack_unpacker_reserve_buffer ( msgpack_unpacker *  mpac,
size_t  size 
) [static]

Reserves free space of the internal buffer.

Use this function to fill the internal buffer with msgpack_unpacker_buffer(msgpack_unpacker*), msgpack_unpacker_buffer_capacity(const msgpack_unpacker*) and msgpack_unpacker_buffer_consumed(msgpack_unpacker*).

Definition at line 197 of file unpack.h.