libdas2
das2 core C utilities
 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
Data Structures | Enumerations | Functions
json.h File Reference

Sheredom's json.h parser with global symbol name changes. 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

#include <stddef.h>

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 { ,
  das_jparse_flags_allow_trailing_comma = 0x1, das_jparse_flags_allow_unquoted_keys = 0x2, das_jparse_flags_allow_global_object = 0x4, das_jparse_flags_allow_equals_in_object = 0x8,
  das_jparse_flags_allow_no_commas = 0x10, das_jparse_flags_allow_c_style_comments = 0x20 , das_jparse_flags_allow_location_information = 0x80, das_jparse_flags_allow_single_quoted_strings = 0x100,
  das_jparse_flags_allow_hexadecimal_numbers = 0x200, das_jparse_flags_allow_leading_plus_sign = 0x400, das_jparse_flags_allow_leading_or_trailing_decimal_point = 0x800, das_jparse_flags_allow_inf_and_nan = 0x1000,
  das_jparse_flags_allow_multi_line_strings = 0x2000, das_jparse_flags_allow_simplified_json, das_jparse_flags_allow_json5
}
 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

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.
 
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...
 
DasJdodas_json_parse (const void *src, size_t src_size)
 Parse a JSON text file with default options and without detailed error reporting. More...
 
const das_json_dict_elDasJdo_dictFirst (const DasJdo *pThis)
 Get the first dictionary element from a JSON dictionary.
 
const das_json_ary_elDasJdo_aryFirst (const DasJdo *pThis)
 Get the first array element from a JSON array.
 
const char * DasJdo_string (const DasJdo *pThis)
 Get a string value from a JSON DOM element. More...
 
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...