9#define VL_MSGPACK_ITER_INVALID VL_HASHTABLE_ITER_INVALID
10#define VL_MSGPACK_EXT_NONE -127
12#define VL_MSGPACK_FOREACH_CHILD(packPtr, parentIter, childIterSymbol) \
13 for(vl_msgpack_iter childIterSymbol = vlMsgPackFirstChild((packPtr), (parentIter)); \
14 childIterSymbol != VL_MSGPACK_ITER_INVALID; \
15 childIterSymbol = vlMsgPackNextSibling((packPtr), (childIterSymbol)))
22typedef enum vl_msgpack_type_{
92typedef struct vl_msgpack_{
375static inline vl_dsidx_t vlMsgPackSampleKeyIndex(
410#define vlMsgPackRoot(packPtr) ((packPtr)->root)
An arena allocator.
Definition vl_arena.h:57
vl_arena_ptr vl_hash_iter
Definition vl_hashtable.h:25
A dynamically-sized hash table.
Definition vl_hashtable.h:45
VL_MEMORY_SIZE_T vl_memsize_t
Definition vl_memory.h:18
VL_MEMORY_T vl_transient
Definition vl_memory.h:85
vl_msgpack_iter vlMsgPackInsert(vl_msgpack *pack, vl_msgpack_type type, vl_msgpack_iter parent, const void *keyPtr, vl_memsize_t keyLen, const void *dataPtr, vl_memsize_t dataLen)
vl_msgpack * vlMsgPackNew()
Allocates and initializes a MessagePack DOM.
Definition vl_msgpack.c:170
vl_msgpack * vlMsgPackClone(vl_msgpack *src, vl_msgpack *dest)
Clones the specified MessagePack DOM to another.
Definition vl_msgpack.c:187
vl_dsidx_t vlMsgPackTotalChildren(vl_msgpack *pack, vl_msgpack_iter iter)
Retrieves the total number of children of a given node.
Definition vl_msgpack.c:202
vl_msgpack_iter vlMsgPackFindChildIndexed(vl_msgpack *pack, vl_msgpack_iter iter, vl_dsidx_t idx)
Finds a child element by index.
Definition vl_msgpack.c:428
vl_msgpack_iter vlMsgPackFindChild(vl_msgpack *pack, vl_msgpack_iter parent, const void *key, vl_memsize_t keyLen)
Finds a child element by key.
Definition vl_msgpack.c:412
vl_msgpack_iter vlMsgPackParent(vl_msgpack *pack, vl_msgpack_iter iter)
Retrieves the parent node of a given node in the MessagePack DOM.
Definition vl_msgpack.c:198
void vlMsgPackClear(vl_msgpack *pack)
Clears the MessagePack DOM, resetting it for reuse.
Definition vl_msgpack.c:181
vl_msgpack_type vlMsgPackType(vl_msgpack *pack, vl_msgpack_iter iter)
Retrieves the type of a given node in the MessagePack DOM.
Definition vl_msgpack.c:234
vl_hashtable nodes
Definition vl_msgpack.h:93
void vlMsgPackInit(vl_msgpack *pack)
Initializes the specified MessagePack DOM.
Definition vl_msgpack.c:156
void vlMsgPackFree(vl_msgpack *pack)
Frees the specified MessagePack DOM.
Definition vl_msgpack.c:164
vl_hash_iter vl_msgpack_iter
Definition vl_msgpack.h:17
vl_msgpack_iter vlMsgPackFirstChild(vl_msgpack *pack, vl_msgpack_iter iter)
Retrieves the first child of a given node.
Definition vl_msgpack.c:214
void vlMsgPackRemove(vl_msgpack *pack, vl_msgpack_iter iter)
Removes an element from the MessagePack DOM.
Definition vl_msgpack.c:344
vl_msgpack_iter vlMsgPackInsertExt(vl_msgpack *pack, vl_msgpack_type type, vl_int8_t subType, vl_msgpack_iter parent, const void *keyPtr, vl_memsize_t keyLen, const void *dataPtr, vl_memsize_t dataLen)
Inserts a new element into the MessagePack DOM with an extended type.
Definition vl_msgpack.c:242
void vlMsgPackDelete(vl_msgpack *pack)
Deletes the specified MessagePack DOM.
Definition vl_msgpack.c:176
vl_msgpack_type
All MessagePack Types.
Definition vl_msgpack.h:22
@ VL_MSGPACK_MAP
MessagePack Map. A collection of node key-value pairs of an arbitrary size.
Definition vl_msgpack.h:63
@ VL_MSGPACK_ARRAY
MessagePack Array. A sequence of dynamically-typed nodes of a well-determined length.
Definition vl_msgpack.h:58
@ VL_MSGPACK_UINT
MessagePack Unsigned Integer. Implemented as vl_ularge_t.
Definition vl_msgpack.h:38
@ VL_MSGPACK_FLOAT64
MessagePack 64-bit Float. Implemented as vl_float64_t.
Definition vl_msgpack.h:46
@ VL_MSGPACK_STRING
MessagePack String. Must have UTF-8 encoding.
Definition vl_msgpack.h:50
@ VL_MSGPACK_BOOL
MessagePack Boolean. Either True (1) or False (0).
Definition vl_msgpack.h:30
@ VL_MSGPACK_EXT
MessagePack Extension Type. Has a type identifier in range of 0...127 and arbitrary data.
Definition vl_msgpack.h:68
@ VL_MSGPACK_FLOAT32
MessagePack 32-bit Float. Implemented as vl_float32_t.
Definition vl_msgpack.h:42
@ VL_MSGPACK_INT
MessagePack Signed Integer. Implemented as vl_ilarge_t.
Definition vl_msgpack.h:34
@ VL_MSGPACK_BINARY
MessagePack Binary. An arbitrary sequence of bytes with a well-defined length.
Definition vl_msgpack.h:54
@ VL_MSGPACK_NIL
MessagePack type equivalent to NIL. Has no data associated with it.
Definition vl_msgpack.h:26
vl_msgpack_iter root
Definition vl_msgpack.h:95
vl_msgpack_iter vlMsgPackPrevSibling(vl_msgpack *pack, vl_msgpack_iter iter)
Retrieves the previous sibling of a given node.
Definition vl_msgpack.c:230
vl_msgpack_iter vlMsgPackNextSibling(vl_msgpack *pack, vl_msgpack_iter iter)
Retrieves the next sibling of a given node.
Definition vl_msgpack.c:226
#define VL_MSGPACK_ITER_INVALID
Definition vl_msgpack.h:9
vl_int8_t vlMsgPackExtType(vl_msgpack *pack, vl_msgpack_iter iter)
Retrieves the extension type of a MessagePack EXT node.
Definition vl_msgpack.c:238
#define VL_MSGPACK_EXT_NONE
Definition vl_msgpack.h:10
const vl_transient * vlMsgPackSampleKey(vl_msgpack *pack, vl_msgpack_iter iter, vl_memsize_t *size)
Retrieves the key associated with an element.
Definition vl_msgpack.c:438
vl_transient * vlMsgPackSampleValue(vl_msgpack *pack, vl_msgpack_iter iter, vl_memsize_t *size)
Retrieves the value associated with an element.
Definition vl_msgpack.c:445
vl_arena values
Definition vl_msgpack.h:94
MessagePack Document Object Model.
Definition vl_msgpack.h:92
VL_BOOL_T vl_bool_t
Definition vl_numtypes.h:128
VL_STRUCTURE_INDEX_T vl_dsidx_t
Index type for data structures.
Definition vl_numtypes.h:13
VL_F32_T vl_float32_t
32-bit floating point number type.
Definition vl_numtypes.h:111
VL_ULARGE_T vl_ularge_t
Largest available unsigned integer type.
Definition vl_numtypes.h:74
VL_ILARGE_T vl_ilarge_t
Largest available signed integer type.
Definition vl_numtypes.h:78