Types
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:
- GOS_SUCCESS - then continue to the next key/value pair or entry
- else - abort the iteration and return the given gos_result_t to the caller of gos_msgpack_foreach().
- 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
enum gos_msgpack_flag_t |
Deserialization flags.
◆ 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 |
◆ gos_msgpack_type_t
enum gos_msgpack_type_t |
MessagePack object data type