JSON data types. More...
Data Structures | |
struct | json_tok_t |
Parse JSON token. More... | |
struct | json_parse_config_t |
JSON parser configuration. More... | |
Typedefs | |
typedef void * | json_parse_context_t |
Context of JSON parsing. | |
typedef zos_result_t(* | json_parse_reader_t) (void *user, void *data, uint32_t max_length, uint32_t *bytes_read) |
Reader callback. More... | |
typedef zos_result_t(* | json_token_callback_t) (void *user, json_parse_context_t *context, json_tok_t *tok) |
Allocate token callback. More... | |
Enumerations | |
enum | json_type_t { JSON_TYPE_ARRAY, JSON_TYPE_OBJECT, JSON_TYPE_STRING, JSON_TYPE_BOOLEAN, JSON_TYPE_INTEGER, JSON_TYPE_INTEGER64, JSON_TYPE_FLOAT, JSON_TYPE_NULL } |
JSON token type. More... | |
Detailed Description
JSON data types.
Typedef Documentation
typedef zos_result_t(* json_parse_reader_t) (void *user, void *data, uint32_t max_length, uint32_t *bytes_read) |
Reader callback.
This is an optional callback that is called to read more JSON formatted data.
If there is no more data to be read, set bytes_read to 0 which tells the parser to stop calling this callback.
- Parameters
-
user
Optional pointer to user data, passed to json_parse_chunked(), leave NULL if unused data
Buffer to hold read data max_length
Length of given buffer bytes_read
Number of bytes actually read, set to 0 if no more data available
- Returns
- zos_result_t result of api call
typedef zos_result_t(* json_token_callback_t) (void *user, json_parse_context_t *context, json_tok_t *tok) |
Allocate token callback.
This is called before every token is allocated. This callback should return ZOS_SUCCESS if the token should be allocated, ZOS_ABORTED if the token should NOT be allocated, anything else will cause the parser to fail.
- Parameters
-
user
Optional pointer to user data, passed to json_parse_chunked(), leave NULL if unused context
Parser context pointer tok
The token that may be allocated
- Returns
- ZOS_SUCCESS if token should be allocated, ZOS_ABORTED if token should NOT be allocated, anything else is a failure
Enumeration Type Documentation
enum json_type_t |
JSON token type.
See this tutorial for more info.