|
Lite³
A JSON-Compatible Zero-Copy Serialization Format
|
Custom types of the Lite³ library. More...
Data Structures | |
| struct | lite3_val |
| Struct representing a value inside a Lite³ buffer. More... | |
| struct | lite3_bytes |
| Struct holding a reference to a bytes value inside a Lite³ buffer. More... | |
| struct | lite3_str |
| Struct holding a reference to a string inside a Lite³ buffer. More... | |
| struct | lite3_iter |
| Struct containing iterator state. More... | |
| struct | lite3_ctx |
| Lite³ context struct. More... | |
Macros | |
| #define | LITE3_BYTES(buf, val) |
| Generational pointer / safe access wrapper. | |
| #define | LITE3_STR(buf, val) |
| Generational pointer / safe access wrapper. | |
Typedefs | |
| typedef struct lite3_ctx | lite3_ctx |
| Lite³ context struct. | |
Enumerations | |
| enum | lite3_type { LITE3_TYPE_NULL , LITE3_TYPE_BOOL , LITE3_TYPE_I64 , LITE3_TYPE_F64 , LITE3_TYPE_BYTES , LITE3_TYPE_STRING , LITE3_TYPE_OBJECT , LITE3_TYPE_ARRAY , LITE3_TYPE_INVALID , LITE3_TYPE_COUNT } |
enum containing all Lite³ types More... | |
Custom types of the Lite³ library.
| #define LITE3_BYTES | ( | buf, | |
| val | |||
| ) |
Generational pointer / safe access wrapper.
Every Lite³ buffer stores a generation count which is incremented on every mutation. lite3_bytes accessed through the LITE3_BYTES() macro will return a direct pointer if lite3_bytes.gen matches the generation count of the buffer. Othewise, it returns NULL.
When a Lite³ structure is modified via set() or delete(), pointed to data could be moved or deleted; therefore it is no longer safe to dereference previously obtained pointers. This macro prevents dangerous situations with dangling pointers.
Example usage:
| [in] | buf | the Lite³ buffer to which lite3_bytes is pointing |
| [in] | val | the lite3_bytes struct (passed by value, not by reference) |
| #define LITE3_STR | ( | buf, | |
| val | |||
| ) |
Generational pointer / safe access wrapper.
Every Lite³ buffer stores a generation count which is incremented on every mutation. lite3_str accessed through the LITE3_STR() macro will return a direct pointer if lite3_str.gen matches the generation count of the buffer. Othewise, it returns NULL.
When a Lite³ structure is modified via set() or delete(), pointed to data could be moved or deleted; therefore it is no longer safe to dereference previously obtained pointers. This macro prevents dangerous situations with dangling pointers.
Example usage:
Lite³ context struct.
See Context API.
| enum lite3_type |
enum containing all Lite³ types
Lite³ prefixes all values with a 1-byte type tag, similar to tagged unions.