das2C
das core C utilities (v3)
Data Structures | Enumerations | Functions
json.h File Reference

Sheredom's json.h parser with global symbol name changes. More...

#include <das2/defs.h>
Include dependency graph for json.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Data Structures

struct  das_json_str
 A JSON string value. More...
 
struct  das_json_str_ex
 A JSON string value (extended) More...
 
struct  das_json_num
 A JSON number value. More...
 
struct  das_json_dict_el
 An element of a JSON dictionary. More...
 
struct  das_json_dict
 a JSON dictionary payload More...
 
struct  das_json_ary_el
 an element of a JSON array More...
 
struct  das_json_ary
 a JSON array value More...
 
struct  DasJdo
 JSON Dom Element. More...
 
struct  das_json_val_ex
 a JSON value (extended) More...
 
struct  das_json_parse_result_s
 error report from json_parse_ex() More...
 

Enumerations

enum  das_json_type_e
 The various types JSON values can be. More...
 
enum  das_json_parse_flags_e {
}
 Flag useed by dasj_parse() and dasj_parse_ex() to alter parsing behavior. More...
 
enum  das_jparse_error_e {
  das_jparse_error_none = 0 , das_jparse_error_expected_comma_or_closing_bracket , das_jparse_error_expected_colon , das_jparse_error_expected_opening_quote ,
  das_jparse_error_invalid_string_escape_sequence , das_jparse_error_invalid_number_format , das_jparse_error_invalid_value , das_jparse_error_premature_end_of_buffer ,
  das_jparse_error_invalid_string , das_jparse_error_allocator_failed , das_jparse_error_unexpected_trailing_characters , das_jparse_error_unknown
}
 JSON parsing error codes. More...
 

Functions

DAS_API const char * json_parse_error_info (const struct das_json_parse_result_s *pRes, char *sTmp, size_t uLen)
 Provide error string describing a parsing error result.
 
DAS_API DasJdodas_json_parse_ex (const void *src, size_t src_size, size_t flags_bitset, void *(*alloc_func_ptr)(void *, size_t), void *user_data, struct das_json_parse_result_s *result)
 Parse a JSON text file, returning a pointer to the root of the JSON structure. More...
 
DAS_API DasJdodas_json_parse (const void *src, size_t src_size)
 Parse a JSON text file with default options and without detailed error reporting. More...
 
DAS_API const das_json_dict_elDasJdo_dictFirst (const DasJdo *pThis)
 Get the first dictionary element from a JSON dictionary.
 
DAS_API const das_json_ary_elDasJdo_aryFirst (const DasJdo *pThis)
 Get the first array element from a JSON array.
 
DAS_API const char * DasJdo_string (const DasJdo *pThis)
 Get a string value from a JSON DOM element. More...
 
DAS_API void * DasJdo_writePretty (const DasJdo *pThis, const char *indent, const char *newline, size_t *out_size)
 Write out a pretty JSON utf-8 string. More...
 

Detailed Description

Sheredom's json.h parser with global symbol name changes.

The upstream version of this file can be found on GitHub at https://github.com/sheredom/json.h