MessagePack data types. More...

Data Structures

struct gos_msgpack_object_t
struct gos_msgpack_object_str_t
struct gos_msgpack_object_bin_t
struct gos_msgpack_object_dict_t
struct gos_msgpack_object_array_t
struct gos_msgpack_context_t

Typedefs

typedef gos_result_t (* gos_msgpack_writer_t ) (void *user, const void *data, uint32_t length)
typedef gos_result_t (* gos_msgpack_iterator_t ) (const gos_msgpack_object_t *key, const gos_msgpack_object_t *value, void *arg)

Enumerations

enum gos_msgpack_type_t {
MSGPACK_TYPE_NIL ,
MSGPACK_TYPE_BOOL ,
MSGPACK_TYPE_INT8 ,
MSGPACK_TYPE_UINT8 ,
MSGPACK_TYPE_INT16 ,
MSGPACK_TYPE_UINT16 ,
MSGPACK_TYPE_INT32 ,
MSGPACK_TYPE_UINT32 ,
MSGPACK_TYPE_FLOAT ,
MSGPACK_TYPE_INT64 ,
MSGPACK_TYPE_UINT64 ,
MSGPACK_TYPE_DOUBLE ,
MSGPACK_TYPE_STR ,
MSGPACK_TYPE_BIN ,
MSGPACK_TYPE_DICT ,
MSGPACK_TYPE_ARRAY ,
MSGPACK_TYPE_ANY ,
MSGPACK_TYPE_INT ,
MSGPACK_TYPE_UINT
}
enum gos_msgpack_object_flag_t {
MSGPACK_OBJECT_FLAG_NONE = 0,
MSGPACK_OBJECT_FLAG_WAS_ALLOCATED = (1 << 0),
MSGPACK_OBJECT_FLAG_IS_ROOT = (1 << 1),
MSGPACK_OBJECT_FLAG_AUTO_FREE_USER = (1 << 2)
}
enum gos_msgpack_flag_t {
MSGPACK_FLAGS_NONE = 0,
MSGPACK_DESERIALIZE_WITH_PERSISTENT_STRINGS = (1 << 0),
MSGPACK_PACK_16BIT_DICTS = (1 << 1)
}
Deserialization flags. More...

Detailed Description

MessagePack data types.

Typedef Documentation

gos_msgpack_iterator_t

typedef gos_result_t (* gos_msgpack_iterator_t) (const gos_msgpack_object_t *key, const gos_msgpack_object_t *value, void *arg)

Callback for iterating a dictionary or array

This is invoked for each key/value pair of a gos_msgpack_object_dict_t or each entry of a gos_msgpack_object_array_t supplied to gos_msgpack_foreach() .

This callback is invoked in the context of the caller of gos_msgpack_foreach() . If this callback returns:

Parameters
[in] key Dictionary key if iterating a directory, NULL if iterating an array
[in] value Dictionary entry value or array entry
[in] arg Custom argument passed to gos_msgpack_foreach()
Returns
GOS_SUCCESS to keep iterating, else abort iteration and return result to caller

gos_msgpack_writer_t

typedef gos_result_t (* gos_msgpack_writer_t) (void *user, const void *data, uint32_t length)

MessagePacket data writer

When using the msgpack_write_xxx APIs this callback will be invoked to write the 'packed' message data IF the gos_msgpack_context_t is initialized with a writer

Parameters
user Optional user object specified when initializing the gos_msgpack_context_t context
data 'packed' message data to write
length Length of data to write
Returns
Result of writing, see gos_result_t

Enumeration Type Documentation

gos_msgpack_flag_t

Deserialization flags.

Enumerator
MSGPACK_FLAGS_NONE

No flags.

MSGPACK_DESERIALIZE_WITH_PERSISTENT_STRINGS

If specified, strings within the de-serialize objects will persist after the provided buffer is freed If NOT specified, then strings will NOT be valid after the provided buffer is freed

MSGPACK_PACK_16BIT_DICTS

If specified, the dictionary length is always 16bits If NOT specified, the dictionary length is variable based on the provided element count

gos_msgpack_object_flag_t

De-serialized gos_msgpack_object_t flags

Enumerator
MSGPACK_OBJECT_FLAG_NONE

No flags.

MSGPACK_OBJECT_FLAG_WAS_ALLOCATED

The object as allocated from the heap.

MSGPACK_OBJECT_FLAG_IS_ROOT

If the root object in the message.

MSGPACK_OBJECT_FLAG_AUTO_FREE_USER

When the object is freed with gos_msgpack_free_objects() , also free the user context set with gos_msgpack_set_user_context() (if applicable)

gos_msgpack_type_t

MessagePack object data type

Enumerator
MSGPACK_TYPE_NIL

Null value.

MSGPACK_TYPE_BOOL

Boolean.

MSGPACK_TYPE_INT8

Signed, 8bit integer.

MSGPACK_TYPE_UINT8

Unsigned, 8bit integer.

MSGPACK_TYPE_INT16

Signed, 16bit integer.

MSGPACK_TYPE_UINT16

Unsigned, 16bit integer.

MSGPACK_TYPE_INT32

Signed, 32bit integer.

MSGPACK_TYPE_UINT32

Unsigned, 32bit integer.

MSGPACK_TYPE_FLOAT

Single precision, floating point number.

MSGPACK_TYPE_INT64

Signed, 64bit integer.

MSGPACK_TYPE_UINT64

Unisgned, 64but integer.

MSGPACK_TYPE_DOUBLE

Double precision, floating point number.

MSGPACK_TYPE_STR

ASCII string.

MSGPACK_TYPE_BIN

Binary string.

MSGPACK_TYPE_DICT

Dictionary (a.k.a. map)

MSGPACK_TYPE_ARRAY

Array.

MSGPACK_TYPE_ANY

Any data type.

MSGPACK_TYPE_INT

Any signed integer.

MSGPACK_TYPE_UINT

Any unsigned integer.