gbuf2json()
#
Converts a gbuffer_t *
containing JSON data into a json_t *
object. The function consumes the input buffer and returns a parsed JSON object.
Prototype
json_t *gbuf2json(
gbuffer_t *gbuf, // WARNING gbuf own and data consumed
int verbose // 1 log, 2 log+dump
);
Parameters
Key |
Type |
Description |
---|---|---|
|
|
The input |
|
|
Logging verbosity level: |
Return Value
Returns a json_t *
object if parsing is successful. Returns NULL
if parsing fails.
Notes
The function uses json_load_callback()
to parse the JSON data from the buffer. If parsing fails, an error is logged based on the verbose
level.
Prototype
// Not applicable in JS
Prototype
# Not applicable in Python
Examples
// TODO C examples
// TODO JS examples
# TODO Python examples