Veritable Lasagna
An Allocator & Data Structure Library for C.
|
Go to the source code of this file.
Data Structures | |
struct | vl_msgpack_encoder |
MessagePack Format Encoder State. More... | |
struct | vl_msgpack_io_token |
A MessagePack Token. More... | |
struct | vl_msgpack_decoder |
A MessagePack decoder. More... | |
union | vl_msgpack_io_token.__unnamed5__ |
struct | vl_msgpack_io_token.__unnamed5__.array |
struct | vl_msgpack_io_token.__unnamed5__.map |
struct | vl_msgpack_io_token.__unnamed5__.integer |
struct | vl_msgpack_io_token.__unnamed5__.uinteger |
struct | vl_msgpack_io_token.__unnamed5__.float32 |
struct | vl_msgpack_io_token.__unnamed5__.float64 |
struct | vl_msgpack_io_token.__unnamed5__.boolean |
struct | vl_msgpack_io_token.__unnamed5__.string |
struct | vl_msgpack_io_token.__unnamed5__.binary |
struct | vl_msgpack_io_token.__unnamed5__.ext |
Functions | |
void | vlMsgPackIOEncoderInit (vl_msgpack_encoder *enc) |
Initializes the specified MessagePack encoder. | |
void | vlMsgPackIOEncoderFree (vl_msgpack_encoder *enc) |
Frees the specified MessagePack encoder. | |
vl_msgpack_encoder * | vlMsgPackIOEncoderNew () |
Allocates and initializes a MessagePack encoder. | |
void | vlMsgPackIOEncoderDelete (vl_msgpack_encoder *enc) |
Deletes the specified MessagePack encoder. | |
void | vlMsgPackIOEncoderClear (vl_msgpack_encoder *enc) |
Clears the state of the MessagePack encoder. | |
void | vlMsgPackIOEncodeMapBegin (vl_msgpack_encoder *enc) |
Begins encoding a map in the MessagePack stream. | |
void | vlMsgPackIOEncodeMapEnd (vl_msgpack_encoder *enc) |
Ends encoding a map in the MessagePack stream. | |
void | vlMsgPackIOEncodeArrayBegin (vl_msgpack_encoder *enc) |
Begins encoding an array in the MessagePack stream. | |
void | vlMsgPackIOEncodeArrayEnd (vl_msgpack_encoder *enc) |
Ends encoding an array in the MessagePack stream. | |
void | vlMsgPackIOEncodeBool (vl_msgpack_encoder *enc, vl_bool_t value) |
Encodes a boolean value into the MessagePack stream. | |
void | vlMsgPackIOEncodeStringLen (vl_msgpack_encoder *enc, const char *value, vl_uint32_t len) |
Encodes a string's length into the MessagePack stream. | |
void | vlMsgPackIOEncodeFloat32 (vl_msgpack_encoder *enc, vl_float32_t value) |
Encodes a 32-bit floating point value into the MessagePack stream. | |
void | vlMsgPackIOEncodeFloat64 (vl_msgpack_encoder *enc, vl_float64_t value) |
Encodes a 64-bit floating point value into the MessagePack stream. | |
void | vlMsgPackIOEncodeBinary (vl_msgpack_encoder *enc, const void *value, vl_uint32_t len) |
Encodes a binary value into the MessagePack stream. | |
void | vlMsgPackIOEncodeExt (vl_msgpack_encoder *enc, vl_int8_t type, const void *value, vl_uint32_t len) |
Encodes an extension type value into the MessagePack stream. | |
void | vlMsgPackIOEncodeInt (vl_msgpack_encoder *enc, vl_ilarge_t value) |
Encodes a signed integer value into the MessagePack stream. | |
void | vlMsgPackIOEncodeUInt (vl_msgpack_encoder *enc, vl_ularge_t value) |
Encodes an unsigned integer value into the MessagePack stream. | |
void | vlMsgPackIOEncodeNil (vl_msgpack_encoder *enc) |
Encodes a nil value into the MessagePack stream. | |
void | vlMsgPackIOEncodeFromDOM (vl_msgpack_encoder *encoder, vl_msgpack *src, vl_msgpack_iter curIter) |
Encodes from a MessagePack DOM. | |
void | vlMsgPackIODecoderStart (vl_msgpack_decoder *dec, const void *srcMem, vl_memsize_t srcLen) |
Starts the MessagePack decoding process. | |
vl_bool_t | vlMsgPackIODecoderNext (vl_msgpack_decoder *decoder, vl_msgpack_io_token *tkPtr) |
Extracts the next token from the MessagePack stream. | |
vl_msgpack_iter | vlMsgPackIODecodeToDOM (vl_msgpack_decoder *decoder, vl_msgpack *dest, vl_msgpack_iter parent, const void *key, vl_memsize_t keyLen) |
Decodes MessagePack data into a DOM. | |
struct vl_msgpack_encoder |
MessagePack Format Encoder State.
This structure holds state for the encoding of information in the MessagePack format. The encoder is completely compliant with the MessagePack spec.
All functions used to encode have signatures among vlMsgPackIOEncode*. The encoding API is loosely modeled on OpenGL 1.x immediate mode.
This encoder attempts to generates the smallest possible (smallest size) result in all cases.
Data Fields | ||
---|---|---|
vl_buffer | buffer | |
vl_msgpack_io_error | error | |
vl_dsidx_t | errorDepth | |
vl_msgpack_type | errorType | |
vl_stack | stateStack |
struct vl_msgpack_io_token |
A MessagePack Token.
Represents a single decoded value from a stream of encoded MessagePack values.
Data Fields | ||
---|---|---|
union vl_msgpack_io_token.__unnamed5__ | __unnamed__ | |
vl_msgpack_type | type |
struct vl_msgpack_decoder |
A MessagePack decoder.
The only job of the decoder is to produce a stream of decoded tokens from an arbitrary input buffer.
Data Fields | ||
---|---|---|
vl_msgpack_io_error | error | |
vl_dsoffs_t | errorOffset | |
vl_msgpack_type | errorType | |
vl_memsize_t | srcLen | |
const vl_uint8_t * | srcMem | |
vl_dsoffs_t | srcOffset |
union vl_msgpack_io_token.__unnamed5__ |
Data Fields | ||
---|---|---|
struct vl_msgpack_io_token.__unnamed5__.array | array | |
struct vl_msgpack_io_token.__unnamed5__.binary | binary | |
struct vl_msgpack_io_token.__unnamed5__.boolean | boolean | |
struct vl_msgpack_io_token.__unnamed5__.ext | ext | |
struct vl_msgpack_io_token.__unnamed5__.float32 | float32 | |
struct vl_msgpack_io_token.__unnamed5__.float64 | float64 | |
struct vl_msgpack_io_token.__unnamed5__.integer | integer | |
struct vl_msgpack_io_token.__unnamed5__.map | map | |
struct vl_msgpack_io_token.__unnamed5__.string | string | |
struct vl_msgpack_io_token.__unnamed5__.uinteger | uinteger |
struct vl_msgpack_io_token.__unnamed5__.array |
struct vl_msgpack_io_token.__unnamed5__.map |
Data Fields | ||
---|---|---|
vl_dsidx_t | keyValuePairs |
struct vl_msgpack_io_token.__unnamed5__.integer |
struct vl_msgpack_io_token.__unnamed5__.uinteger |
struct vl_msgpack_io_token.__unnamed5__.float32 |
struct vl_msgpack_io_token.__unnamed5__.float64 |
struct vl_msgpack_io_token.__unnamed5__.boolean |
struct vl_msgpack_io_token.__unnamed5__.string |
struct vl_msgpack_io_token.__unnamed5__.binary |
struct vl_msgpack_io_token.__unnamed5__.ext |
enum vl_msgpack_io_error |
vl_bool_t vlMsgPackIODecoderNext | ( | vl_msgpack_decoder * | decoder, |
vl_msgpack_io_token * | tkPtr ) |
Extracts the next token from the MessagePack stream.
This function decodes the next token from the MessagePack data. It returns true
if a token was successfully extracted, or false
if there are no more tokens or the decoding process encounters an error.
decoder | Pointer to the MessagePack decoder. |
tkPtr | Pointer to the token structure where the extracted token will be stored. |
true
if a token was successfully decoded, false
otherwise. void vlMsgPackIODecoderStart | ( | vl_msgpack_decoder * | dec, |
const void * | srcMem, | ||
vl_memsize_t | srcLen ) |
Starts the MessagePack decoding process.
This function initializes the MessagePack decoder with the given source memory and length. It prepares the decoder for further operations, such as token extraction or decoding to a DOM.
dec | Pointer to the MessagePack decoder to initialize. |
srcMem | Pointer to the source memory containing the MessagePack data to decode. |
srcLen | Length of the source memory to decode. |
vl_msgpack_iter vlMsgPackIODecodeToDOM | ( | vl_msgpack_decoder * | decoder, |
vl_msgpack * | dest, | ||
vl_msgpack_iter | parent, | ||
const void * | key, | ||
vl_memsize_t | keyLen ) |
Decodes MessagePack data into a DOM.
This function decodes MessagePack data and inserts it into the specified DOM at the given parent node. The decoded data is inserted using the provided key.
decoder | Pointer to the MessagePack decoder. |
dest | Pointer to the MessagePack DOM to populate. |
parent | The parent node in the DOM where the decoded data will be inserted. |
key | Pointer to the UTF-8 string key, or pointer to integer index. |
keyLen | Length of the key. |
void vlMsgPackIOEncodeArrayBegin | ( | vl_msgpack_encoder * | enc | ) |
Begins encoding an array in the MessagePack stream.
This function serializes the beginning of an array (list of values) into the MessagePack format. It should be followed by calls to encode individual values before the array is closed with vlMsgPackIOEncodeArrayEnd.
enc | Pointer to the encoder context. |
void vlMsgPackIOEncodeArrayEnd | ( | vl_msgpack_encoder * | enc | ) |
Ends encoding an array in the MessagePack stream.
This function serializes the end of an array (list of values) into the MessagePack format. It follows vlMsgPackIOEncodeArrayBegin and should be called once all elements of the array have been encoded.
This resolves the smallest possible encoding for the array.
enc | Pointer to the encoder context. |
void vlMsgPackIOEncodeBinary | ( | vl_msgpack_encoder * | enc, |
const void * | value, | ||
vl_uint32_t | len ) |
Encodes a binary value into the MessagePack stream.
This function serializes a binary data value into the MessagePack format and appends it to the encoder's buffer. The length of the binary data must be provided.
enc | Pointer to the encoder context. |
value | Pointer to the binary data to encode. |
len | The length of the binary data to encode. |
void vlMsgPackIOEncodeBool | ( | vl_msgpack_encoder * | enc, |
vl_bool_t | value ) |
Encodes a boolean value into the MessagePack stream.
This function serializes a boolean value (true or false) into the MessagePack format and appends it to the encoder's buffer.
enc | Pointer to the encoder context. |
value | The boolean value to encode. |
void vlMsgPackIOEncodeExt | ( | vl_msgpack_encoder * | enc, |
vl_int8_t | type, | ||
const void * | value, | ||
vl_uint32_t | len ) |
Encodes an extension type value into the MessagePack stream.
This function serializes an extension type (custom format) into the MessagePack format and appends it to the encoder's buffer. The extension type identifier and the associated value are serialized.
enc | Pointer to the encoder context. |
type | The extension type identifier. |
value | Pointer to the extension data to encode. |
len | The length of the extension data. |
void vlMsgPackIOEncodeFloat32 | ( | vl_msgpack_encoder * | enc, |
vl_float32_t | value ) |
Encodes a 32-bit floating point value into the MessagePack stream.
This function serializes a 32-bit floating point value into the MessagePack format and appends it to the encoder's buffer.
enc | Pointer to the encoder context. |
value | The 32-bit floating point value to encode. |
void vlMsgPackIOEncodeFloat64 | ( | vl_msgpack_encoder * | enc, |
vl_float64_t | value ) |
Encodes a 64-bit floating point value into the MessagePack stream.
This function serializes a 64-bit floating point value into the MessagePack format and appends it to the encoder's buffer.
enc | Pointer to the encoder context. |
value | The 64-bit floating point value to encode. |
void vlMsgPackIOEncodeFromDOM | ( | vl_msgpack_encoder * | encoder, |
vl_msgpack * | src, | ||
vl_msgpack_iter | curIter ) |
Encodes from a MessagePack DOM.
enc | Pointer to the encoder context. |
src | Pointer to the source MessagePack DOM. |
curIter | iterator to fully encode. |
void vlMsgPackIOEncodeInt | ( | vl_msgpack_encoder * | enc, |
vl_ilarge_t | value ) |
Encodes a signed integer value into the MessagePack stream.
This function serializes a signed integer value into the MessagePack format and appends it to the encoder's buffer.
enc | Pointer to the encoder context. |
value | The signed integer value to encode. |
void vlMsgPackIOEncodeMapBegin | ( | vl_msgpack_encoder * | enc | ) |
Begins encoding a map in the MessagePack stream.
This function serializes the beginning of a map (key-value pair container) into the MessagePack format. It should be followed by calls to encode individual keys and values before the map is closed with vlMsgPackIOEncodeMapEnd.
enc | Pointer to the encoder context. |
void vlMsgPackIOEncodeMapEnd | ( | vl_msgpack_encoder * | enc | ) |
Ends encoding a map in the MessagePack stream.
This function serializes the end of a map (key-value pair container) into the MessagePack format. It follows vlMsgPackIOEncodeMapBegin and should be called once all key-value pairs for the map have been encoded.
This resolves the smallest possible encoding for the map.
enc | Pointer to the encoder context. |
void vlMsgPackIOEncodeNil | ( | vl_msgpack_encoder * | enc | ) |
Encodes a nil value into the MessagePack stream.
This function serializes a nil
value (similar to null
) into the MessagePack format and appends it to the encoder's buffer.
enc | Pointer to the encoder context. |
void vlMsgPackIOEncoderClear | ( | vl_msgpack_encoder * | enc | ) |
Clears the state of the MessagePack encoder.
This function resets the encoder to its initial state.
enc | Pointer to the encoder context. |
void vlMsgPackIOEncoderDelete | ( | vl_msgpack_encoder * | enc | ) |
Deletes the specified MessagePack encoder.
This function deletes the given MessagePack encoder, freeing all associated resources. It must be called after the encoder has been created with vlMsgPackIOEncoderNew. The function deallocates the entire encoder structure.
enc | Pointer to the MessagePack encoder to delete. |
void vlMsgPackIOEncoderFree | ( | vl_msgpack_encoder * | enc | ) |
Frees the specified MessagePack encoder.
This function frees the resources allocated for the given MessagePack encoder. It must be called after the encoder has been initialized with vlMsgPackIOEncoderInit. This function does not deallocate the encoder structure.
enc | Pointer to the MessagePack encoder to free. |
void vlMsgPackIOEncoderInit | ( | vl_msgpack_encoder * | enc | ) |
Initializes the specified MessagePack encoder.
This function initializes the given MessagePack encoder, preparing it for further encoding operations. It must be called before encoding data into MessagePack format.
enc | Pointer to the MessagePack encoder to initialize. |
vl_msgpack_encoder * vlMsgPackIOEncoderNew | ( | ) |
Allocates and initializes a MessagePack encoder.
This function allocates memory for a new MessagePack encoder and initializes it. The returned pointer must be freed using vlMsgPackIOEncoderDelete.
void vlMsgPackIOEncodeStringLen | ( | vl_msgpack_encoder * | enc, |
const char * | value, | ||
vl_uint32_t | len ) |
Encodes a string's length into the MessagePack stream.
This function serializes the length of a string value into the MessagePack format. It is often used in combination with the string value itself for encoding large strings efficiently.
enc | Pointer to the encoder context. |
value | Pointer to the string to encode. |
len | The length of the string to encode. |
void vlMsgPackIOEncodeUInt | ( | vl_msgpack_encoder * | enc, |
vl_ularge_t | value ) |
Encodes an unsigned integer value into the MessagePack stream.
This function serializes an unsigned integer value into the MessagePack format and appends it to the encoder's buffer.
enc | Pointer to the encoder context. |
value | The unsigned integer value to encode. |