Hideaki Tai / msgpack-embedded

Dependents:   hello_message_pack

Embed: (wiki syntax)

« Back to documentation index

Streaming deserializer

Streaming deserializer
[MessagePack C]

Functions

MSGPACK_DLLEXPORT bool msgpack_unpacker_init (msgpack_unpacker *mpac, size_t initial_buffer_size)
 Initializes a streaming deserializer.
MSGPACK_DLLEXPORT void msgpack_unpacker_destroy (msgpack_unpacker *mpac)
 Destroys a streaming deserializer initialized by msgpack_unpacker_init(msgpack_unpacker*, size_t).
MSGPACK_DLLEXPORT
msgpack_unpacker * 
msgpack_unpacker_new (size_t initial_buffer_size)
 Creates a streaming deserializer.
MSGPACK_DLLEXPORT 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.
MSGPACK_DLLEXPORT
msgpack_unpack_return 
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 245 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 240 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 254 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 213 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 218 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 223 of file unpack.h.

MSGPACK_DLLEXPORT void msgpack_unpacker_destroy ( msgpack_unpacker *  mpac )

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

Definition at line 347 of file unpack.c.

MSGPACK_DLLEXPORT void msgpack_unpacker_free ( msgpack_unpacker *  mpac )

Frees a streaming deserializer created by msgpack_unpacker_new(size_t).

Definition at line 369 of file unpack.c.

MSGPACK_DLLEXPORT 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 301 of file unpack.c.

MSGPACK_DLLEXPORT 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 354 of file unpack.c.

MSGPACK_DLLEXPORT msgpack_unpack_return 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 513 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 207 of file unpack.h.