Main Page   Namespace List   Class Hierarchy   Alphabetical List   Compound List   File List   Namespace Members   Compound Members   File Members   Related Pages  

qcschema_json.c File Reference

#include "qcschema_json.h"
#include <stdio.h>
#include <string.h>
#include <ctype.h>
#include <math.h>

Go to the source code of this file.

Compounds

struct  json_state

Defines

#define whitespace
#define string_add(b)   do { if (!state.first_pass) string [string_length] = b; ++ string_length; } while (0);
#define line_and_col   state.cur_line, state.cur_col

Typedefs

typedef unsigned int json_uchar

Functions

unsigned char hex_value (json_char c)
int would_overflow (json_int_t value, json_char b)
void * default_alloc (size_t size, int zero, void *user_data)
void default_free (void *ptr, void *user_data)
void * json_alloc (json_state *state, unsigned long size, int zero)
int new_value (json_state *state, json_value **top, json_value **root, json_value **alloc, json_type type)
json_valuejson_parse_ex (json_settings *settings, const json_char *json, size_t length, char *error_buf)
json_valuejson_parse (const json_char *json, size_t length)
void json_value_free_ex (json_settings *settings, json_value *value)
void json_value_free (json_value *value)

Variables

const struct _json_value json_value_none
const json_int_t JSON_INT_MAX
const long flag_next = 1 << 0
const long flag_reproc = 1 << 1
const long flag_need_comma = 1 << 2
const long flag_seek_value = 1 << 3
const long flag_escaped = 1 << 4
const long flag_string = 1 << 5
const long flag_need_colon = 1 << 6
const long flag_done = 1 << 7
const long flag_num_negative = 1 << 8
const long flag_num_zero = 1 << 9
const long flag_num_e = 1 << 10
const long flag_num_e_got_sign = 1 << 11
const long flag_num_e_negative = 1 << 12
const long flag_line_comment = 1 << 13
const long flag_block_comment = 1 << 14
const long flag_num_got_decimal = 1 << 15


Define Documentation

#define line_and_col   state.cur_line, state.cur_col
 

Definition at line 216 of file qcschema_json.c.

Referenced by json_parse_ex.

#define string_add      do { if (!state.first_pass) string [string_length] = b; ++ string_length; } while (0);
 

Definition at line 213 of file qcschema_json.c.

Referenced by json_parse_ex.

#define whitespace
 

Value:

case '\n': ++ state.cur_line;  state.cur_col = 0; \
   case ' ': case '\t': case '\r'

Definition at line 209 of file qcschema_json.c.

Referenced by json_parse_ex, reduce, and trim.


Typedef Documentation

typedef unsigned int json_uchar
 

Definition at line 46 of file qcschema_json.c.

Referenced by json_parse_ex.


Function Documentation

void* default_alloc size_t    size,
int    zero,
void *    user_data
[static]
 

Definition at line 93 of file qcschema_json.c.

Referenced by json_parse_ex.

void default_free void *    ptr,
void *    user_data
[static]
 

Definition at line 98 of file qcschema_json.c.

Referenced by json_parse_ex, and json_value_free.

unsigned char hex_value json_char    c [static]
 

Definition at line 57 of file qcschema_json.c.

References json_char.

Referenced by json_parse_ex.

void* json_alloc json_state   state,
unsigned long    size,
int    zero
[static]
 

Definition at line 103 of file qcschema_json.c.

References json_settings::max_memory, json_settings::mem_alloc, json_state::settings, json_state::ulong_max, json_state::used_memory, and json_settings::user_data.

Referenced by new_value.

json_value* json_parse const json_char *    json,
size_t    length
 

Definition at line 977 of file qcschema_json.c.

References json_char, and json_parse_ex.

json_value* json_parse_ex json_settings   settings,
const json_char *    json,
size_t    length,
char *    error_buf
 

Definition at line 237 of file qcschema_json.c.

References _json_value::_reserved, json_state::cur_col, json_state::cur_line, default_alloc, default_free, json_state::first_pass, flag_block_comment, flag_done, flag_escaped, flag_line_comment, flag_need_colon, flag_need_comma, flag_next, flag_num_e, flag_num_e_got_sign, flag_num_e_negative, flag_num_got_decimal, flag_num_negative, flag_num_zero, flag_reproc, flag_seek_value, flag_string, hex_value, json_array, json_boolean, json_char, json_double, json_enable_comments, json_error_max, json_integer, json_null, json_object, json_string, json_uchar, json_value_free_ex, line_and_col, json_settings::mem_alloc, json_settings::mem_free, new_value, _json_value::parent, json_state::ptr, json_settings::settings, json_state::settings, string_add, _json_value::type, _json_value::u, json_state::uint_max, json_state::ulong_max, json_settings::user_data, whitespace, and would_overflow.

void json_value_free json_value   value
 

Definition at line 1033 of file qcschema_json.c.

References default_free, json_value_free_ex, and json_settings::mem_free.

void json_value_free_ex json_settings   settings,
json_value   value
 

Definition at line 983 of file qcschema_json.c.

References json_array, json_object, json_string, json_settings::mem_free, _json_value::parent, _json_value::type, _json_value::u, and json_settings::user_data.

int new_value json_state   state,
json_value **    top,
json_value **    root,
json_value **    alloc,
json_type    type
[static]
 

Definition at line 117 of file qcschema_json.c.

References _json_value::_reserved, json_state::cur_col, json_state::cur_line, json_state::first_pass, json_alloc, json_array, json_char, json_object, json_string, json_type, _json_value::parent, json_state::settings, _json_value::type, _json_value::u, and json_settings::value_extra.

Referenced by json_parse_ex.

int would_overflow json_int_t    value,
json_char    b
[static]
 

Definition at line 73 of file qcschema_json.c.

References json_char, JSON_INT_MAX, and json_int_t.

Referenced by json_parse_ex.


Variable Documentation

const long flag_block_comment = 1 << 14 [static]
 

Definition at line 234 of file qcschema_json.c.

Referenced by json_parse_ex.

const long flag_done = 1 << 7 [static]
 

Definition at line 227 of file qcschema_json.c.

Referenced by json_parse_ex.

const long flag_escaped = 1 << 4 [static]
 

Definition at line 224 of file qcschema_json.c.

Referenced by json_parse_ex.

const long flag_line_comment = 1 << 13 [static]
 

Definition at line 233 of file qcschema_json.c.

Referenced by json_parse_ex.

const long flag_need_colon = 1 << 6 [static]
 

Definition at line 226 of file qcschema_json.c.

Referenced by json_parse_ex.

const long flag_need_comma = 1 << 2 [static]
 

Definition at line 222 of file qcschema_json.c.

Referenced by json_parse_ex.

const long flag_next = 1 << 0 [static]
 

Definition at line 220 of file qcschema_json.c.

Referenced by json_parse_ex.

const long flag_num_e = 1 << 10 [static]
 

Definition at line 230 of file qcschema_json.c.

Referenced by json_parse_ex.

const long flag_num_e_got_sign = 1 << 11 [static]
 

Definition at line 231 of file qcschema_json.c.

Referenced by json_parse_ex.

const long flag_num_e_negative = 1 << 12 [static]
 

Definition at line 232 of file qcschema_json.c.

Referenced by json_parse_ex.

const long flag_num_got_decimal = 1 << 15 [static]
 

Definition at line 235 of file qcschema_json.c.

Referenced by json_parse_ex.

const long flag_num_negative = 1 << 8 [static]
 

Definition at line 228 of file qcschema_json.c.

Referenced by json_parse_ex.

const long flag_num_zero = 1 << 9 [static]
 

Definition at line 229 of file qcschema_json.c.

Referenced by json_parse_ex.

const long flag_reproc = 1 << 1 [static]
 

Definition at line 221 of file qcschema_json.c.

Referenced by json_parse_ex.

const long flag_seek_value = 1 << 3 [static]
 

Definition at line 223 of file qcschema_json.c.

Referenced by json_parse_ex.

const long flag_string = 1 << 5 [static]
 

Definition at line 225 of file qcschema_json.c.

Referenced by json_parse_ex.

const json_int_t JSON_INT_MAX [static]
 

Initial value:

 sizeof(json_int_t) == 1
                                       ? INT8_MAX
                                       : (sizeof(json_int_t) == 2
                                         ? INT16_MAX
                                         : (sizeof(json_int_t) == 4
                                           ? INT32_MAX
                                           : INT64_MAX))

Definition at line 49 of file qcschema_json.c.

Referenced by would_overflow.

const struct _json_value json_value_none
 

Definition at line 39 of file qcschema_json.c.


Generated on Tue Dec 3 03:10:21 2024 for VMD Plugins (current) by doxygen1.2.14 written by Dimitri van Heesch, © 1997-2002