23#define VL_MSGPACK_ITER_INVALID VL_HASHTABLE_ITER_INVALID
24#define VL_MSGPACK_EXT_NONE -127
26#define VL_MSGPACK_FOREACH_CHILD(packPtr, parentIter, childIterSymbol) \
27 for (vl_msgpack_iter childIterSymbol = vlMsgPackFirstChild((packPtr), (parentIter)); \
28 childIterSymbol != VL_MSGPACK_ITER_INVALID; \
29 childIterSymbol = vlMsgPackNextSibling((packPtr), (childIterSymbol)))
36typedef enum vl_msgpack_type_
114typedef struct vl_msgpack_
316 const void* dataPtr, vl_memsize_t dataLen);
334 const void* keyPtr, vl_memsize_t keyLen,
const void* dataPtr,
335 vl_memsize_t dataLen)
365 vl_memsize_t keyLen);
452#define vlMsgPackRoot(packPtr) ((packPtr)->root)
767 vl_memsize_t valLen,
const char* key)
An arena allocator for efficient memory management.
Definition vl_arena.h:84
vl_arena_ptr vl_hash_iter
Definition vl_hashtable.h:40
A dynamically-sized hash table with variable-sized keys and values.
Definition vl_hashtable.h:79
VL_MEMORY_T vl_transient
Definition vl_memory.h:118
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_API vl_msgpack * vlMsgPackClone(vl_msgpack *src, vl_msgpack *dest)
Clones the specified MessagePack DOM to another.
Definition vl_msgpack.c:313
VL_API 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:378
VL_API vl_msgpack_iter vlMsgPackNextSibling(vl_msgpack *pack, vl_msgpack_iter iter)
Retrieves the next sibling of a given node.
Definition vl_msgpack.c:358
vl_hashtable nodes
Definition vl_msgpack.h:116
VL_API vl_msgpack * vlMsgPackNew(void)
Allocates and initializes a MessagePack DOM.
Definition vl_msgpack.c:292
VL_API void vlMsgPackClear(vl_msgpack *pack)
Clears the MessagePack DOM, resetting it for reuse.
Definition vl_msgpack.c:305
vl_hash_iter vl_msgpack_iter
Definition vl_msgpack.h:31
VL_API 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:330
VL_API void vlMsgPackDelete(vl_msgpack *pack)
Deletes the specified MessagePack DOM.
Definition vl_msgpack.c:299
VL_API void vlMsgPackFree(vl_msgpack *pack)
Frees the specified MessagePack DOM.
Definition vl_msgpack.c:285
VL_API 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:606
VL_API vl_int8_t vlMsgPackExtType(vl_msgpack *pack, vl_msgpack_iter iter)
Retrieves the extension type of a MessagePack EXT node.
Definition vl_msgpack.c:373
VL_API vl_msgpack_iter vlMsgPackFirstChild(vl_msgpack *pack, vl_msgpack_iter iter)
Retrieves the first child of a given node.
Definition vl_msgpack.c:344
VL_API void vlMsgPackRemove(vl_msgpack *pack, vl_msgpack_iter iter)
Removes an element from the MessagePack DOM.
Definition vl_msgpack.c:500
VL_API 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:574
vl_msgpack_type
All MessagePack Types.
Definition vl_msgpack.h:37
@ VL_MSGPACK_MAP
MessagePack Map. A collection of node key-value pairs of an arbitrary size.
Definition vl_msgpack.h:81
@ VL_MSGPACK_ARRAY
MessagePack Array. A sequence of dynamically-typed nodes of a well-determined length.
Definition vl_msgpack.h:75
@ VL_MSGPACK_UINT
MessagePack Unsigned Integer. Implemented as vl_ularge_t.
Definition vl_msgpack.h:53
@ VL_MSGPACK_FLOAT64
MessagePack 64-bit Float. Implemented as vl_float64_t.
Definition vl_msgpack.h:61
@ VL_MSGPACK_STRING
MessagePack String. Must have UTF-8 encoding.
Definition vl_msgpack.h:65
@ VL_MSGPACK_BOOL
MessagePack Boolean. Either True (1) or False (0).
Definition vl_msgpack.h:45
@ VL_MSGPACK_EXT
MessagePack Extension Type. Has a type identifier in range of 0...127 and arbitrary data.
Definition vl_msgpack.h:87
@ VL_MSGPACK_FLOAT32
MessagePack 32-bit Float. Implemented as vl_float32_t.
Definition vl_msgpack.h:57
@ VL_MSGPACK_INT
MessagePack Signed Integer. Implemented as vl_ilarge_t.
Definition vl_msgpack.h:49
@ VL_MSGPACK_BINARY
MessagePack Binary. An arbitrary sequence of bytes with a well-defined length.
Definition vl_msgpack.h:70
@ VL_MSGPACK_NIL
MessagePack type equivalent to NIL. Has no data associated with it.
Definition vl_msgpack.h:41
VL_API 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:368
vl_msgpack_iter root
Definition vl_msgpack.h:118
VL_API 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:325
VL_API vl_msgpack_iter vlMsgPackPrevSibling(vl_msgpack *pack, vl_msgpack_iter iter)
Retrieves the previous sibling of a given node.
Definition vl_msgpack.c:363
VL_API void vlMsgPackInit(vl_msgpack *pack)
Initializes the specified MessagePack DOM.
Definition vl_msgpack.c:275
VL_API 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:614
#define VL_MSGPACK_ITER_INVALID
Definition vl_msgpack.h:23
#define VL_MSGPACK_EXT_NONE
Definition vl_msgpack.h:24
VL_API 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:595
vl_arena values
Definition vl_msgpack.h:117
MessagePack Document Object Model.
Definition vl_msgpack.h:115
VL_BOOL_T vl_bool_t
Definition vl_numtypes.h:191
VL_STRUCTURE_INDEX_T vl_dsidx_t
Index type for data structures.
Definition vl_numtypes.h:75
VL_F32_T vl_float32_t
32-bit floating point number type.
Definition vl_numtypes.h:173
VL_ULARGE_T vl_ularge_t
Largest available unsigned integer type.
Definition vl_numtypes.h:136
VL_ILARGE_T vl_ilarge_t
Largest available signed integer type.
Definition vl_numtypes.h:140