Veritable Lasagna
An Allocator & Data Structure Library for C.
|
Data Structures | |
struct | vl_msgpack_element |
union | vl_msgpack_element.payload |
struct | vl_msgpack_element.payload.mapBranch |
struct | vl_msgpack_element.payload.arrayBranch |
struct | vl_msgpack_element.payload.leaf |
Functions | |
vl_hash | vl_HashMsgPackKey (const void *data, vl_memsize_t size) |
void | vl_MsgPackFreeChildren (vl_msgpack *pack, vl_msgpack_iter iter) |
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_element * | vl_MsgPackInitNode (vl_msgpack *pack, vl_msgpack_iter nodeIter, vl_msgpack_type type, vl_int8_t extType, vl_msgpack_iter parent, const void *dataPtr, vl_memsize_t dataLen) |
void | vlMsgPackInit (vl_msgpack *pack) |
Initializes the specified MessagePack DOM. | |
void | vlMsgPackFree (vl_msgpack *pack) |
Frees the specified MessagePack DOM. | |
vl_msgpack * | vlMsgPackNew () |
Allocates and initializes a MessagePack DOM. | |
void | vlMsgPackDelete (vl_msgpack *pack) |
Deletes the specified MessagePack DOM. | |
void | vlMsgPackClear (vl_msgpack *pack) |
Clears the MessagePack DOM, resetting it for reuse. | |
vl_msgpack * | vlMsgPackClone (vl_msgpack *src, vl_msgpack *dest) |
Clones the specified MessagePack DOM to another. | |
vl_msgpack_iter | vlMsgPackParent (vl_msgpack *pack, vl_msgpack_iter iter) |
Retrieves the parent node of a given node in the MessagePack DOM. | |
vl_dsidx_t | vlMsgPackTotalChildren (vl_msgpack *pack, vl_msgpack_iter iter) |
Retrieves the total number of children of a given node. | |
vl_msgpack_iter | vlMsgPackFirstChild (vl_msgpack *pack, vl_msgpack_iter iter) |
Retrieves the first child of a given node. | |
vl_msgpack_iter | vlMsgPackNextSibling (vl_msgpack *pack, vl_msgpack_iter iter) |
Retrieves the next sibling of a given node. | |
vl_msgpack_iter | vlMsgPackPrevSibling (vl_msgpack *pack, vl_msgpack_iter iter) |
Retrieves the previous sibling of a given node. | |
vl_msgpack_type | vlMsgPackType (vl_msgpack *pack, vl_msgpack_iter iter) |
Retrieves the type of a given node in the MessagePack DOM. | |
vl_int8_t | vlMsgPackExtType (vl_msgpack *pack, vl_msgpack_iter iter) |
Retrieves the extension type of a MessagePack EXT node. | |
vl_msgpack_iter | vlMsgPackInsertExt (vl_msgpack *pack, vl_msgpack_type type, vl_int8_t extType, 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. | |
void | vlMsgPackRemove (vl_msgpack *pack, vl_msgpack_iter iter) |
Removes an element from the MessagePack DOM. | |
vl_msgpack_iter | vlMsgPackFindChild (vl_msgpack *pack, vl_msgpack_iter parent, const void *keyPtr, vl_memsize_t keyLen) |
Finds a child element by key. | |
vl_msgpack_iter | vlMsgPackFindChildIndexed (vl_msgpack *pack, vl_msgpack_iter parent, vl_dsidx_t index) |
Finds a child element by index. | |
const vl_transient * | vlMsgPackSampleKey (vl_msgpack *pack, vl_msgpack_iter iter, vl_memsize_t *size) |
Retrieves the key associated with an element. | |
vl_transient * | vlMsgPackSampleValue (vl_msgpack *pack, vl_msgpack_iter iter, vl_memsize_t *size) |
Retrieves the value associated with an element. | |
struct vl_msgpack_element |
Data Fields | ||
---|---|---|
vl_int8_t | extType | |
vl_msgpack_iter | nextSibling | |
vl_msgpack_iter | parent | |
union vl_msgpack_element.payload | payload | |
vl_msgpack_iter | prevSibling | |
vl_msgpack_type | type |
union vl_msgpack_element.payload |
Data Fields | ||
---|---|---|
struct vl_msgpack_element.payload.arrayBranch | arrayBranch | |
struct vl_msgpack_element.payload.leaf | leaf | |
struct vl_msgpack_element.payload.mapBranch | mapBranch |
struct vl_msgpack_element.payload.mapBranch |
Data Fields | ||
---|---|---|
vl_msgpack_iter | firstChild | |
vl_msgpack_iter | lastChild | |
vl_dsidx_t | totalChildren |
struct vl_msgpack_element.payload.arrayBranch |
Data Fields | ||
---|---|---|
vl_arena_ptr | array | |
vl_dsidx_t | arrayLength |
struct vl_msgpack_element.payload.leaf |
vl_hash vl_HashMsgPackKey | ( | const void * | data, |
vl_memsize_t | size ) |
void vl_MsgPackFreeChildren | ( | vl_msgpack * | pack, |
vl_msgpack_iter | iter ) |
vl_msgpack_element * vl_MsgPackInitNode | ( | vl_msgpack * | pack, |
vl_msgpack_iter | nodeIter, | ||
vl_msgpack_type | type, | ||
vl_int8_t | extType, | ||
vl_msgpack_iter | parent, | ||
const void * | dataPtr, | ||
vl_memsize_t | dataLen ) |
void vlMsgPackClear | ( | vl_msgpack * | pack | ) |
Clears the MessagePack DOM, resetting it for reuse.
This function resets the MessagePack DOM instance without deallocating memory. Previously allocated memory remains available for reuse, improving performance when repeatedly decoding into the same structure.
pack | The MessagePack DOM instance to clear. |
vl_msgpack * vlMsgPackClone | ( | vl_msgpack * | src, |
vl_msgpack * | dest ) |
Clones the specified MessagePack DOM to another.
Clones the entirety of the src MessagePack to the dest MessagePack.
The 'src' DOM must be non-null and initialized. The 'dest' DOM may be null, but if it is not null it must be initialized.
If the 'dest' table pointer is null, a new DOM is created via vlMsgPackNew.
src | source DOM pointer |
dest | destination DOM pointer |
void vlMsgPackDelete | ( | vl_msgpack * | pack | ) |
Deletes the specified MessagePack DOM.
The specified MessagePack must have been initialized via vlMsgPackNew before calling this function.
pack | pointer to DOM |
vl_int8_t vlMsgPackExtType | ( | vl_msgpack * | pack, |
vl_msgpack_iter | iter ) |
Retrieves the extension type of a MessagePack EXT node.
pack | The MessagePack DOM instance. |
iter | The iterator pointing to the current node. |
vl_msgpack_iter vlMsgPackFindChild | ( | vl_msgpack * | pack, |
vl_msgpack_iter | parent, | ||
const void * | key, | ||
vl_memsize_t | keyLen ) |
Finds a child element by key.
This function searches for a child under the given parent node with a matching key.
pack | The MessagePack DOM instance. |
parent | The parent node to search in. |
key | Pointer to the key data. |
keyLen | Length of the key. |
vl_msgpack_iter vlMsgPackFindChildIndexed | ( | vl_msgpack * | pack, |
vl_msgpack_iter | iter, | ||
vl_dsidx_t | idx ) |
Finds a child element by index.
This function retrieves the indexed child from a parent container. The parent must be an array.
pack | The MessagePack DOM instance. |
iter | The parent node. |
idx | The zero-based index of the child. |
vl_msgpack_iter vlMsgPackFirstChild | ( | vl_msgpack * | pack, |
vl_msgpack_iter | iter ) |
Retrieves the first child of a given node.
pack | The MessagePack DOM instance. |
iter | The iterator pointing to the current node. |
void vlMsgPackFree | ( | vl_msgpack * | pack | ) |
Frees the specified MessagePack DOM.
The specified MessagePack must have been initialized via vlMsgPackInit before calling this function.
pack | pointer to DOM |
void vlMsgPackInit | ( | vl_msgpack * | pack | ) |
Initializes the specified MessagePack DOM.
pack | pointer to DOM |
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_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.
This function inserts an element of the specified MessagePack type and optional extended type under a given parent node. The key and value are copied into the internal storage, allowing external memory to be safely freed after insertion.
pack | The MessagePack DOM instance. |
type | The type of the inserted element. |
subType | The extended type (used for MessagePack ext types). |
parent | The parent node where the element is inserted. |
keyPtr | Pointer to the key data. |
keyLen | Length of the key. |
dataPtr | Pointer to the value data. |
dataLen | Length of the value. |
vl_msgpack * vlMsgPackNew | ( | ) |
Allocates and initializes a MessagePack DOM.
The returned pointer is to be deleted via vlMsgPackDelete.
vl_msgpack_iter vlMsgPackNextSibling | ( | vl_msgpack * | pack, |
vl_msgpack_iter | iter ) |
Retrieves the next sibling of a given node.
pack | The MessagePack DOM instance. |
iter | The iterator pointing to the current node. |
vl_msgpack_iter vlMsgPackParent | ( | vl_msgpack * | pack, |
vl_msgpack_iter | iter ) |
Retrieves the parent node of a given node in the MessagePack DOM.
pack | The MessagePack DOM instance. |
iter | The iterator pointing to the current node. |
vl_msgpack_iter vlMsgPackPrevSibling | ( | vl_msgpack * | pack, |
vl_msgpack_iter | iter ) |
Retrieves the previous sibling of a given node.
pack | The MessagePack DOM instance. |
iter | The iterator pointing to the current node. |
void vlMsgPackRemove | ( | vl_msgpack * | pack, |
vl_msgpack_iter | iter ) |
Removes an element from the MessagePack DOM.
This function removes the specified element and all its children from the DOM. Memory may be reused depending on the allocator's behavior.
pack | The MessagePack DOM instance. |
iter | Iterator pointing to the element to be removed. |
const vl_transient * vlMsgPackSampleKey | ( | vl_msgpack * | pack, |
vl_msgpack_iter | iter, | ||
vl_memsize_t * | size ) |
Retrieves the key associated with an element.
This function returns a pointer to the key data of the given element. The key may move if modifications occur in the DOM, so users should not store this pointer for long-term access.
pack | The MessagePack DOM instance. |
iter | The element iterator. |
size | Pointer to receive the key size (optional, can be NULL). |
vl_transient * vlMsgPackSampleValue | ( | vl_msgpack * | pack, |
vl_msgpack_iter | iter, | ||
vl_memsize_t * | size ) |
Retrieves the value associated with an element.
This function returns a pointer to the value data of the given element. The value may move if modifications occur in the DOM, so users should not store this pointer for long-term access.
pack | The MessagePack DOM instance. |
iter | The element iterator. |
size | Pointer to receive the value size (optional, can be NULL). |
vl_dsidx_t vlMsgPackTotalChildren | ( | vl_msgpack * | pack, |
vl_msgpack_iter | iter ) |
Retrieves the total number of children of a given node.
pack | The MessagePack DOM instance. |
iter | The iterator pointing to the current node. |
vl_msgpack_type vlMsgPackType | ( | vl_msgpack * | pack, |
vl_msgpack_iter | iter ) |
Retrieves the type of a given node in the MessagePack DOM.
pack | The MessagePack DOM instance. |
iter | The iterator pointing to the current node. |