|
Lite³
A JSON-Compatible Zero-Copy Serialization Format
|
Object / array initialization. More...
Functions | |
| int | lite3_init_obj (unsigned char *buf, size_t *__restrict out_buflen, size_t bufsz) |
| Initialize a Lite³ buffer as an object. | |
| int | lite3_init_arr (unsigned char *buf, size_t *__restrict out_buflen, size_t bufsz) |
| Initialize a Lite³ buffer as an array. | |
Object / array initialization.
The JSON standard requires that the root-level type always be an 'object' or 'array'. This also applies to Lite³.
Before data can be inserted into an empty buffer, it must first be initialized as object or array.
| int lite3_init_arr | ( | unsigned char * | buf, |
| size_t *__restrict | out_buflen, | ||
| size_t | bufsz | ||
| ) |
Initialize a Lite³ buffer as an array.
The number of bytes written to *buf never exceeds bufsz. The available buffer space must be at least LITE3_NODE_SIZE.
| [in] | buf | buffer pointer |
| [out] | out_buflen | buffer used length |
| [in] | bufsz | buffer max size |
| int lite3_init_obj | ( | unsigned char * | buf, |
| size_t *__restrict | out_buflen, | ||
| size_t | bufsz | ||
| ) |
Initialize a Lite³ buffer as an object.
The number of bytes written to *buf never exceeds bufsz. The available buffer space must be at least LITE3_NODE_SIZE.
| [in] | buf | buffer pointer |
| [out] | out_buflen | buffer used length |
| [in] | bufsz | buffer max size |