Loading...
Searching...
No Matches
parson.c File Reference
`#include "parson.h"`
`#include <stdarg.h>`
`#include <stdio.h>`
`#include <stdlib.h>`
`#include <string.h>`
`#include <ctype.h>`
`#include <math.h>`
`#include <errno.h>`
Include dependency graph for parson.c:

Go to the source code of this file.

## Macros

#define | PARSON_IMPL_VERSION_MAJOR 1
#define | PARSON_IMPL_VERSION_MINOR 5
#define | PARSON_IMPL_VERSION_PATCH 3
#define | strcpy USE_MEMCPY_INSTEAD_OF_STRCPY
#define | STARTING_CAPACITY 16
#define | MAX_NESTING 2048
#define | PARSON_DEFAULT_FLOAT_FORMAT "%1.17g" /* do not increase precision without incresing NUM_BUF_SIZE */
#define | PARSON_NUM_BUF_SIZE
#define | PARSON_INDENT_STR " "
#define | SIZEOF_TOKEN(a)
#define | SKIP_CHAR(str)
#define | SKIP_WHITESPACES(str)
#define | MAX(a, b)
#define | IS_NUMBER_INVALID(x)
#define | OBJECT_INVALID_IX ((size_t)-1)
#define | IS_CONT(b)
#define | PARSON_TRUE 1
#define | PARSON_FALSE 0
#define | APPEND_STRING(str)
#define | APPEND_INDENT(level)

## Typedefs

typedef int | parson_bool_t
typedef struct json_string | JSON_String
typedef union json_value_value | JSON_Value_Value

## Functions

JSON_Value * | json_parse_file (const char *filename)
JSON_Value * | json_parse_file_with_comments (const char *filename)
JSON_Value * | json_parse_string (const char *string)
JSON_Value * | json_parse_string_with_comments (const char *string)
JSON_Value * | json_object_get_value (const JSON_Object *object, const char *name)
const char * | json_object_get_string (const JSON_Object *object, const char *name)
size_t | json_object_get_string_len (const JSON_Object *object, const char *name)
double | json_object_get_number (const JSON_Object *object, const char *name)
JSON_Object * | json_object_get_object (const JSON_Object *object, const char *name)
JSON_Array * | json_object_get_array (const JSON_Object *object, const char *name)
int | json_object_get_boolean (const JSON_Object *object, const char *name)
JSON_Value * | json_object_dotget_value (const JSON_Object *object, const char *name)
const char * | json_object_dotget_string (const JSON_Object *object, const char *name)
size_t | json_object_dotget_string_len (const JSON_Object *object, const char *name)
double | json_object_dotget_number (const JSON_Object *object, const char *name)
JSON_Object * | json_object_dotget_object (const JSON_Object *object, const char *name)
JSON_Array * | json_object_dotget_array (const JSON_Object *object, const char *name)
int | json_object_dotget_boolean (const JSON_Object *object, const char *name)
size_t | json_object_get_count (const JSON_Object *object)
const char * | json_object_get_name (const JSON_Object *object, size_t index)
JSON_Value * | json_object_get_value_at (const JSON_Object *object, size_t index)
JSON_Value * | json_object_get_wrapping_value (const JSON_Object *object)
int | json_object_has_value (const JSON_Object *object, const char *name)
int | json_object_has_value_of_type (const JSON_Object *object, const char *name, JSON_Value_Type type)
int | json_object_dothas_value (const JSON_Object *object, const char *name)
int | json_object_dothas_value_of_type (const JSON_Object *object, const char *name, JSON_Value_Type type)
JSON_Value * | json_array_get_value (const JSON_Array *array, size_t index)
const char * | json_array_get_string (const JSON_Array *array, size_t index)
size_t | json_array_get_string_len (const JSON_Array *array, size_t index)
double | json_array_get_number (const JSON_Array *array, size_t index)
JSON_Object * | json_array_get_object (const JSON_Array *array, size_t index)
JSON_Array * | json_array_get_array (const JSON_Array *array, size_t index)
int | json_array_get_boolean (const JSON_Array *array, size_t index)
size_t | json_array_get_count (const JSON_Array *array)
JSON_Value * | json_array_get_wrapping_value (const JSON_Array *array)
JSON_Value_Type | json_value_get_type (const JSON_Value *value)
JSON_Object * | json_value_get_object (const JSON_Value *value)
JSON_Array * | json_value_get_array (const JSON_Value *value)
const char * | json_value_get_string (const JSON_Value *value)
size_t | json_value_get_string_len (const JSON_Value *value)
double | json_value_get_number (const JSON_Value *value)
int | json_value_get_boolean (const JSON_Value *value)
JSON_Value * | json_value_get_parent (const JSON_Value *value)
void | json_value_free (JSON_Value *value)
JSON_Value * | json_value_init_object (void)
JSON_Value * | json_value_init_array (void)
JSON_Value * | json_value_init_string (const char *string)
JSON_Value * | json_value_init_string_with_len (const char *string, size_t length)
JSON_Value * | json_value_init_number (double number)
JSON_Value * | json_value_init_boolean (int boolean)
JSON_Value * | json_value_init_null (void)
JSON_Value * | json_value_deep_copy (const JSON_Value *value)
size_t | json_serialization_size (const JSON_Value *value)
JSON_Status | json_serialize_to_buffer (const JSON_Value *value, char *buf, size_t buf_size_in_bytes)
JSON_Status | json_serialize_to_file (const JSON_Value *value, const char *filename)
char * | json_serialize_to_string (const JSON_Value *value)
size_t | json_serialization_size_pretty (const JSON_Value *value)
JSON_Status | json_serialize_to_buffer_pretty (const JSON_Value *value, char *buf, size_t buf_size_in_bytes)
JSON_Status | json_serialize_to_file_pretty (const JSON_Value *value, const char *filename)
char * | json_serialize_to_string_pretty (const JSON_Value *value)
void | json_free_serialized_string (char *string)
JSON_Status | json_array_remove (JSON_Array *array, size_t ix)
JSON_Status | json_array_replace_value (JSON_Array *array, size_t ix, JSON_Value *value)
JSON_Status | json_array_replace_string (JSON_Array *array, size_t i, const char *string)
JSON_Status | json_array_replace_string_with_len (JSON_Array *array, size_t i, const char *string, size_t len)
JSON_Status | json_array_replace_number (JSON_Array *array, size_t i, double number)
JSON_Status | json_array_replace_boolean (JSON_Array *array, size_t i, int boolean)
JSON_Status | json_array_replace_null (JSON_Array *array, size_t i)
JSON_Status | json_array_clear (JSON_Array *array)
JSON_Status | json_array_append_value (JSON_Array *array, JSON_Value *value)
JSON_Status | json_array_append_string (JSON_Array *array, const char *string)
JSON_Status | json_array_append_string_with_len (JSON_Array *array, const char *string, size_t len)
JSON_Status | json_array_append_number (JSON_Array *array, double number)
JSON_Status | json_array_append_boolean (JSON_Array *array, int boolean)
JSON_Status | json_array_append_null (JSON_Array *array)
JSON_Status | json_object_set_value (JSON_Object *object, const char *name, JSON_Value *value)
JSON_Status | json_object_set_string (JSON_Object *object, const char *name, const char *string)
JSON_Status | json_object_set_string_with_len (JSON_Object *object, const char *name, const char *string, size_t len)
JSON_Status | json_object_set_number (JSON_Object *object, const char *name, double number)
JSON_Status | json_object_set_boolean (JSON_Object *object, const char *name, int boolean)
JSON_Status | json_object_set_null (JSON_Object *object, const char *name)
JSON_Status | json_object_dotset_value (JSON_Object *object, const char *name, JSON_Value *value)
JSON_Status | json_object_dotset_string (JSON_Object *object, const char *name, const char *string)
JSON_Status | json_object_dotset_string_with_len (JSON_Object *object, const char *name, const char *string, size_t len)
JSON_Status | json_object_dotset_number (JSON_Object *object, const char *name, double number)
JSON_Status | json_object_dotset_boolean (JSON_Object *object, const char *name, int boolean)
JSON_Status | json_object_dotset_null (JSON_Object *object, const char *name)
JSON_Status | json_object_remove (JSON_Object *object, const char *name)
JSON_Status | json_object_dotremove (JSON_Object *object, const char *name)
JSON_Status | json_object_clear (JSON_Object *object)
JSON_Status | json_validate (const JSON_Value *schema, const JSON_Value *value)
int | json_value_equals (const JSON_Value *a, const JSON_Value *b)
JSON_Value_Type | json_type (const JSON_Value *value)
JSON_Object * | json_object (const JSON_Value *value)
JSON_Array * | json_array (const JSON_Value *value)
const char * | json_string (const JSON_Value *value)
size_t | json_string_len (const JSON_Value *value)
double | json_number (const JSON_Value *value)
int | json_boolean (const JSON_Value *value)
void | json_set_allocation_functions (JSON_Malloc_Function malloc_fun, JSON_Free_Function free_fun)
void | json_set_escape_slashes (int escape_slashes)
void | json_set_float_serialization_format (const char *format)
void | json_set_number_serialization_function (JSON_Number_Serialization_Function func)

## Macro Definition Documentation

## APPEND_INDENT

#define APPEND_INDENT | ( |  | level | ) |

Value:
do { \
int level_i = 0; \
for (level_i = 0; level_i < (level); level_i++) { \
APPEND_STRING(PARSON_INDENT_STR); \
} \
} while (0)
PARSON_INDENT_STR
#define PARSON_INDENT_STR
Definition parson.c:82

Definition at line 1273 of file parson.c.

## APPEND_STRING

#define APPEND_STRING | ( |  | str | ) |

Value:
do { \
written = SIZEOF_TOKEN((str)); \
if (buf != NULL) { \
memcpy(buf, (str), written); \
buf[written] = '\0'; \
buf += written; \
} \
written_total += written; \
} while (0)
NULL
#define NULL
Definition ccmath.h:32
SIZEOF_TOKEN
#define SIZEOF_TOKEN(a)
Definition parson.c:85

Definition at line 1262 of file parson.c.

## IS_CONT

#define IS_CONT | ( |  | b | ) |

Value:
(((unsigned char)(b) & 0xC0) == 0x80) /* is utf-8 continuation byte */
b
double b
Definition driver/set_window.c:5

Definition at line 114 of file parson.c.

## IS_NUMBER_INVALID

#define IS_NUMBER_INVALID | ( |  | x | ) |

Value:
(((x) * 0.0) != 0.0)
x
#define x

Definition at line 99 of file parson.c.

Referenced by json_value_init_number().

## MAX

#define MAX | ( |  | a,
|  |  | b )

Value:
((a) > (b) ? (a) : (b))

Definition at line 91 of file parson.c.

Referenced by Cairo_Line_width(), Cairo_raster(), G_rgb_to_hsv(), kdtree_optimize(), MT_region_data(), quad_get_points(), and SHPOpenLL().

## MAX_NESTING

#define MAX_NESTING 2048

Definition at line 69 of file parson.c.

## OBJECT_INVALID_IX

#define OBJECT_INVALID_IX ((size_t)-1)

Definition at line 102 of file parson.c.

Referenced by json_object_clear().

## PARSON_DEFAULT_FLOAT_FORMAT

#define PARSON_DEFAULT_FLOAT_FORMAT "%1.17g" /* do not increase precision without incresing NUM_BUF_SIZE */

Definition at line 72 of file parson.c.

## PARSON_FALSE

#define PARSON_FALSE 0

Definition at line 120 of file parson.c.

Referenced by json_object_set_value(), json_serialization_size(), json_serialize_to_buffer(), and json_value_equals().

## PARSON_IMPL_VERSION_MAJOR

#define PARSON_IMPL_VERSION_MAJOR 1

Definition at line 33 of file parson.c.

## PARSON_IMPL_VERSION_MINOR

#define PARSON_IMPL_VERSION_MINOR 5

Definition at line 34 of file parson.c.

## PARSON_IMPL_VERSION_PATCH

#define PARSON_IMPL_VERSION_PATCH 3

Definition at line 35 of file parson.c.

## PARSON_INDENT_STR

#define PARSON_INDENT_STR " "

Definition at line 82 of file parson.c.

## PARSON_NUM_BUF_SIZE

#define PARSON_NUM_BUF_SIZE

Value:
64 /* double printed with "%1.17g" shouldn't be longer than 25 bytes so \
let's be paranoid and use 64 */

Definition at line 77 of file parson.c.

Referenced by json_serialization_size(), and json_serialization_size_pretty().

## PARSON_TRUE

#define PARSON_TRUE 1

Definition at line 119 of file parson.c.

Referenced by json_object_dotremove(), json_object_remove(), json_serialization_size_pretty(), json_serialize_to_buffer_pretty(), and json_value_equals().

## SIZEOF_TOKEN

#define SIZEOF_TOKEN | ( |  | a | ) |

Value:
(sizeof(a) - 1)

Definition at line 85 of file parson.c.

## SKIP_CHAR

#define SKIP_CHAR | ( |  | str | ) |

Value:
((*str)++)

Definition at line 86 of file parson.c.

## SKIP_WHITESPACES

#define SKIP_WHITESPACES | ( |  | str | ) |

Value:
while (isspace((unsigned char)(**str))) { \
SKIP_CHAR(str); \
}

Definition at line 87 of file parson.c.

## STARTING_CAPACITY

#define STARTING_CAPACITY 16

Definition at line 68 of file parson.c.

## strcpy

#define strcpy USE_MEMCPY_INSTEAD_OF_STRCPY

Definition at line 66 of file parson.c.

Referenced by datetime_error(), DBFCreateLL(), DBFOpenLL(), G__machine_name(), G__temp_element(), G__temp_element_basedir(), G__usage_xml(), G__wps_print_process_description(), G_format_timestamp(), G_get_3dview_defaults(), G_init_locale(), G_join_basename_strings(), G_list(), G_myname(), G_parser(), G_store(), G_unqualified_name(), get_key_data(), GPJ_osr_to_grass(), GS_get_att(), Gs_get_cat_label(), Gs_save_3dview(), gsds_get_name(), gvl_file_get_name(), GVL_get_volname(), GVL_isosurf_get_att(), M_find(), M_get_option_desc(), M_get_options(), M_read_list(), pj_get_kv(), pj_get_string(), recreate_command(), and S_read().

## Typedef Documentation

## JSON_String

typedef struct json_string JSON_String

## JSON_Value_Value

typedef union json_value_value JSON_Value_Value

## parson_bool_t

typedef int parson_bool_t

Definition at line 117 of file parson.c.

## Function Documentation

## json_array()

JSON_Array * json_array | ( | const JSON_Value * | value | ) |

Definition at line 2804 of file parson.c.

References json_value_get_array().

Referenced by G_json_array().

## json_array_append_boolean()

JSON_Status json_array_append_boolean | ( | JSON_Array * | array,
|  | int | boolean )

Definition at line 2378 of file parson.c.

References json_array_append_value(), json_value_free(), json_value_init_boolean(), JSONFailure, JSONSuccess, and NULL.

Referenced by G_json_array_append_boolean().

## json_array_append_null()

JSON_Status json_array_append_null | ( | JSON_Array * | array | ) |

Definition at line 2391 of file parson.c.

References json_array_append_value(), json_value_free(), json_value_init_null(), JSONFailure, JSONSuccess, and NULL.

Referenced by G_json_array_append_null().

## json_array_append_number()

JSON_Status json_array_append_number | ( | JSON_Array * | array,
|  | double | number )

Definition at line 2365 of file parson.c.

References json_array_append_value(), json_value_free(), json_value_init_number(), JSONFailure, JSONSuccess, and NULL.

Referenced by G_json_array_append_number().

## json_array_append_string()

JSON_Status json_array_append_string | ( | JSON_Array * | array,
|  | const char * | string )

Definition at line 2338 of file parson.c.

References json_array_append_value(), json_value_free(), json_value_init_string(), JSONFailure, JSONSuccess, and NULL.

Referenced by G_json_array_append_string().

## json_array_append_string_with_len()

JSON_Status json_array_append_string_with_len | ( | JSON_Array * | array,
|  | const char * | string,
|  | size_t | len )

Definition at line 2351 of file parson.c.

References json_array_append_value(), json_value_free(), json_value_init_string_with_len(), JSONFailure, JSONSuccess, and NULL.

## json_array_append_value()

JSON_Status json_array_append_value | ( | JSON_Array * | array,
|  | JSON_Value * | value )

Definition at line 2330 of file parson.c.

References JSONFailure, and NULL.

Referenced by G_json_array_append_value(), json_array_append_boolean(), json_array_append_null(), json_array_append_number(), json_array_append_string(), and json_array_append_string_with_len().

## json_array_clear()

JSON_Status json_array_clear | ( | JSON_Array * | array | ) |

Definition at line 2317 of file parson.c.

References json_array_get_count(), json_array_get_value(), json_value_free(), JSONFailure, JSONSuccess, and NULL.

## json_array_get_array()

JSON_Array * json_array_get_array | ( | const JSON_Array * | array,
|  | size_t | index )

Definition at line 1793 of file parson.c.

References json_array_get_value(), and json_value_get_array().

## json_array_get_boolean()

int json_array_get_boolean | ( | const JSON_Array * | array,
|  | size_t | index )

Definition at line 1798 of file parson.c.

References json_array_get_value(), and json_value_get_boolean().

Referenced by G_json_array_get_boolean().

## json_array_get_count()

size_t json_array_get_count | ( | const JSON_Array * | array | ) |

Definition at line 1803 of file parson.c.

Referenced by json_array_clear(), json_array_get_value(), json_array_remove(), json_array_replace_value(), json_validate(), json_value_deep_copy(), and json_value_equals().

## json_array_get_number()

double json_array_get_number | ( | const JSON_Array * | array,
|  | size_t | index )

Definition at line 1783 of file parson.c.

References json_array_get_value(), and json_value_get_number().

Referenced by G_json_array_get_number().

## json_array_get_object()

JSON_Object * json_array_get_object | ( | const JSON_Array * | array,
|  | size_t | index )

Definition at line 1788 of file parson.c.

References json_array_get_value(), and json_value_get_object().

## json_array_get_string()

const char * json_array_get_string | ( | const JSON_Array * | array,
|  | size_t | index )

Definition at line 1773 of file parson.c.

References json_array_get_value(), and json_value_get_string().

Referenced by G_json_array_get_string().

## json_array_get_string_len()

size_t json_array_get_string_len | ( | const JSON_Array * | array,
|  | size_t | index )

Definition at line 1778 of file parson.c.

References json_array_get_value(), and json_value_get_string_len().

## json_array_get_value()

JSON_Value * json_array_get_value | ( | const JSON_Array * | array,
|  | size_t | index )

Definition at line 1765 of file parson.c.

References json_array_get_count(), and NULL.

Referenced by G_json_array_get_value(), json_array_clear(), json_array_get_array(), json_array_get_boolean(), json_array_get_number(), json_array_get_object(), json_array_get_string(), json_array_get_string_len(), json_array_remove(), json_array_replace_value(), json_validate(), json_value_deep_copy(), and json_value_equals().

## json_array_get_wrapping_value()

JSON_Value * json_array_get_wrapping_value | ( | const JSON_Array * | array | ) |

Definition at line 1808 of file parson.c.

References NULL.

Referenced by json_array_replace_value().

## json_array_remove()

JSON_Status json_array_remove | ( | JSON_Array * | array,
|  | size_t | ix )

Definition at line 2222 of file parson.c.

References json_array_get_count(), json_array_get_value(), json_value_free(), JSONFailure, JSONSuccess, and NULL.

## json_array_replace_boolean()

JSON_Status json_array_replace_boolean | ( | JSON_Array * | array,
|  | size_t | i,
|  | int | boolean )

Definition at line 2291 of file parson.c.

References json_array_replace_value(), json_value_free(), json_value_init_boolean(), JSONFailure, JSONSuccess, and NULL.

## json_array_replace_null()

JSON_Status json_array_replace_null | ( | JSON_Array * | array,
|  | size_t | i )

Definition at line 2304 of file parson.c.

References json_array_replace_value(), json_value_free(), json_value_init_null(), JSONFailure, JSONSuccess, and NULL.

## json_array_replace_number()

JSON_Status json_array_replace_number | ( | JSON_Array * | array,
|  | size_t | i,
|  | double | number )

Definition at line 2277 of file parson.c.

References json_array_replace_value(), json_value_free(), json_value_init_number(), JSONFailure, JSONSuccess, and NULL.

## json_array_replace_string()

JSON_Status json_array_replace_string | ( | JSON_Array * | array,
|  | size_t | i,
|  | const char * | string )

Definition at line 2249 of file parson.c.

References json_array_replace_value(), json_value_free(), json_value_init_string(), JSONFailure, JSONSuccess, and NULL.

## json_array_replace_string_with_len()

JSON_Status json_array_replace_string_with_len | ( | JSON_Array * | array,
|  | size_t | i,
|  | const char * | string,
|  | size_t | len )

Definition at line 2263 of file parson.c.

References json_array_replace_value(), json_value_free(), json_value_init_string_with_len(), JSONFailure, JSONSuccess, and NULL.

## json_array_replace_value()

JSON_Status json_array_replace_value | ( | JSON_Array * | array,
|  | size_t | ix,
|  | JSON_Value * | value )

Definition at line 2236 of file parson.c.

References json_array_get_count(), json_array_get_value(), json_array_get_wrapping_value(), json_value_free(), JSONFailure, JSONSuccess, and NULL.

Referenced by json_array_replace_boolean(), json_array_replace_null(), json_array_replace_number(), json_array_replace_string(), and json_array_replace_string_with_len().

## json_boolean()

int json_boolean | ( | const JSON_Value * | value | ) |

Definition at line 2824 of file parson.c.

References json_value_get_boolean().

## json_free_serialized_string()

void json_free_serialized_string | ( | char * | string | ) |

Definition at line 2217 of file parson.c.

Referenced by G_json_free_serialized_string(), json_serialize_to_file(), json_serialize_to_file_pretty(), json_serialize_to_string(), and json_serialize_to_string_pretty().

## json_number()

double json_number | ( | const JSON_Value * | value | ) |

Definition at line 2819 of file parson.c.

References json_value_get_number().

## json_object()

JSON_Object * json_object | ( | const JSON_Value * | value | ) |

Definition at line 2799 of file parson.c.

References json_value_get_object().

Referenced by G_json_object().

## json_object_clear()

JSON_Status json_object_clear | ( | JSON_Object * | object | ) |

Definition at line 2639 of file parson.c.

References json_object_get_count(), json_value_free(), JSONFailure, JSONSuccess, NULL, and OBJECT_INVALID_IX.

## json_object_dotget_array()

JSON_Array * json_object_dotget_array | ( | const JSON_Object * | object,
|  | const char * | name )

Definition at line 1700 of file parson.c.

References json_object_dotget_value(), json_value_get_array(), and name.

## json_object_dotget_boolean()

int json_object_dotget_boolean | ( | const JSON_Object * | object,
|  | const char * | name )

Definition at line 1706 of file parson.c.

References json_object_dotget_value(), json_value_get_boolean(), and name.

## json_object_dotget_number()

double json_object_dotget_number | ( | const JSON_Object * | object,
|  | const char * | name )

Definition at line 1689 of file parson.c.

References json_object_dotget_value(), json_value_get_number(), and name.

Referenced by G_json_object_dotget_number().

## json_object_dotget_object()

JSON_Object * json_object_dotget_object | ( | const JSON_Object * | object,
|  | const char * | name )

Definition at line 1694 of file parson.c.

References json_object_dotget_value(), json_value_get_object(), and name.

## json_object_dotget_string()

const char * json_object_dotget_string | ( | const JSON_Object * | object,
|  | const char * | name )

Definition at line 1677 of file parson.c.

References json_object_dotget_value(), json_value_get_string(), and name.

Referenced by G_json_object_dotget_string().

## json_object_dotget_string_len()

size_t json_object_dotget_string_len | ( | const JSON_Object * | object,
|  | const char * | name )

Definition at line 1683 of file parson.c.

References json_object_dotget_value(), json_value_get_string_len(), and name.

## json_object_dotget_value()

JSON_Value * json_object_dotget_value | ( | const JSON_Object * | object,
|  | const char * | name )

Definition at line 1665 of file parson.c.

References json_object_dotget_value(), json_object_get_value(), json_value_get_object(), and name.

Referenced by json_object_dotget_array(), json_object_dotget_boolean(), json_object_dotget_number(), json_object_dotget_object(), json_object_dotget_string(), json_object_dotget_string_len(), json_object_dotget_value(), json_object_dothas_value(), and json_object_dothas_value_of_type().

## json_object_dothas_value()

int json_object_dothas_value | ( | const JSON_Object * | object,
|  | const char * | name )

Definition at line 1752 of file parson.c.

References json_object_dotget_value(), name, and NULL.

## json_object_dothas_value_of_type()

int json_object_dothas_value_of_type | ( | const JSON_Object * | object,
|  | const char * | name,
|  | JSON_Value_Type | type )

Definition at line 1757 of file parson.c.

References json_object_dotget_value(), json_value_get_type(), name, and NULL.

## json_object_dotremove()

JSON_Status json_object_dotremove | ( | JSON_Object * | object,
|  | const char * | name )

Definition at line 2634 of file parson.c.

References name, and PARSON_TRUE.

## json_object_dotset_boolean()

JSON_Status json_object_dotset_boolean | ( | JSON_Object * | object,
|  | const char * | name,
|  | int | boolean )

Definition at line 2602 of file parson.c.

References json_object_dotset_value(), json_value_free(), json_value_init_boolean(), JSONFailure, JSONSuccess, name, and NULL.

## json_object_dotset_null()

JSON_Status json_object_dotset_null | ( | JSON_Object * | object,
|  | const char * | name )

Definition at line 2616 of file parson.c.

References json_object_dotset_value(), json_value_free(), json_value_init_null(), JSONFailure, JSONSuccess, name, and NULL.

Referenced by G_json_object_dotset_null().

## json_object_dotset_number()

JSON_Status json_object_dotset_number | ( | JSON_Object * | object,
|  | const char * | name,
|  | double | number )

Definition at line 2588 of file parson.c.

References json_object_dotset_value(), json_value_free(), json_value_init_number(), JSONFailure, JSONSuccess, name, and NULL.

Referenced by G_json_object_dotset_number().

## json_object_dotset_string()

JSON_Status json_object_dotset_string | ( | JSON_Object * | object,
|  | const char * | name,
|  | const char * | string )

Definition at line 2559 of file parson.c.

References json_object_dotset_value(), json_value_free(), json_value_init_string(), JSONFailure, JSONSuccess, name, and NULL.

Referenced by G_json_object_dotset_string().

## json_object_dotset_string_with_len()

JSON_Status json_object_dotset_string_with_len | ( | JSON_Object * | object,
|  | const char * | name,
|  | const char * | string,
|  | size_t | len )

Definition at line 2573 of file parson.c.

References json_object_dotset_value(), json_value_free(), json_value_init_string_with_len(), JSONFailure, JSONSuccess, name, and NULL.

## json_object_dotset_value()

JSON_Status json_object_dotset_value | ( | JSON_Object * | object,
|  | const char * | name,
|  | JSON_Value * | value )

Definition at line 2505 of file parson.c.

References json_object_dotset_value(), json_object_set_value(), json_value_free(), json_value_get_object(), json_value_get_type(), json_value_init_object(), JSONFailure, JSONObject, JSONSuccess, name, and NULL.

Referenced by json_object_dotset_boolean(), json_object_dotset_null(), json_object_dotset_number(), json_object_dotset_string(), json_object_dotset_string_with_len(), and json_object_dotset_value().

## json_object_get_array()

JSON_Array * json_object_get_array | ( | const JSON_Object * | object,
|  | const char * | name )

Definition at line 1655 of file parson.c.

References json_object_get_value(), json_value_get_array(), and name.

Referenced by G_json_object_get_array().

## json_object_get_boolean()

int json_object_get_boolean | ( | const JSON_Object * | object,
|  | const char * | name )

Definition at line 1660 of file parson.c.

References json_object_get_value(), json_value_get_boolean(), and name.

Referenced by G_json_object_get_boolean().

## json_object_get_count()

size_t json_object_get_count | ( | const JSON_Object * | object | ) |

Definition at line 1711 of file parson.c.

Referenced by json_object_clear(), json_object_get_name(), json_object_get_value_at(), json_validate(), json_value_deep_copy(), and json_value_equals().

## json_object_get_name()

const char * json_object_get_name | ( | const JSON_Object * | object,
|  | size_t | index )

Definition at line 1716 of file parson.c.

References json_object_get_count(), and NULL.

Referenced by json_validate(), json_value_deep_copy(), and json_value_equals().

## json_object_get_number()

double json_object_get_number | ( | const JSON_Object * | object,
|  | const char * | name )

Definition at line 1645 of file parson.c.

References json_object_get_value(), json_value_get_number(), and name.

Referenced by G_json_object_get_number().

## json_object_get_object()

JSON_Object * json_object_get_object | ( | const JSON_Object * | object,
|  | const char * | name )

Definition at line 1650 of file parson.c.

References json_object_get_value(), json_value_get_object(), and name.

Referenced by G_json_object_get_object().

## json_object_get_string()

const char * json_object_get_string | ( | const JSON_Object * | object,
|  | const char * | name )

Definition at line 1635 of file parson.c.

References json_object_get_value(), json_value_get_string(), and name.

Referenced by G_json_object_get_string().

## json_object_get_string_len()

size_t json_object_get_string_len | ( | const JSON_Object * | object,
|  | const char * | name )

Definition at line 1640 of file parson.c.

References json_object_get_value(), json_value_get_string_len(), and name.

## json_object_get_value()

JSON_Value * json_object_get_value | ( | const JSON_Object * | object,
|  | const char * | name )

Definition at line 1627 of file parson.c.

References name, and NULL.

Referenced by G_json_object_get_value(), json_object_dotget_value(), json_object_get_array(), json_object_get_boolean(), json_object_get_number(), json_object_get_object(), json_object_get_string(), json_object_get_string_len(), json_object_has_value(), json_object_has_value_of_type(), json_validate(), json_value_deep_copy(), and json_value_equals().

## json_object_get_value_at()

JSON_Value * json_object_get_value_at | ( | const JSON_Object * | object,
|  | size_t | index )

Definition at line 1724 of file parson.c.

References json_object_get_count(), and NULL.

## json_object_get_wrapping_value()

JSON_Value * json_object_get_wrapping_value | ( | const JSON_Object * | object | ) |

Definition at line 1732 of file parson.c.

References NULL.

Referenced by G_json_object_get_wrapping_value(), and json_object_set_value().

## json_object_has_value()

int json_object_has_value | ( | const JSON_Object * | object,
|  | const char * | name )

Definition at line 1740 of file parson.c.

References json_object_get_value(), name, and NULL.

## json_object_has_value_of_type()

int json_object_has_value_of_type | ( | const JSON_Object * | object,
|  | const char * | name,
|  | JSON_Value_Type | type )

Definition at line 1745 of file parson.c.

References json_object_get_value(), json_value_get_type(), name, and NULL.

## json_object_remove()

JSON_Status json_object_remove | ( | JSON_Object * | object,
|  | const char * | name )

Definition at line 2629 of file parson.c.

References name, and PARSON_TRUE.

## json_object_set_boolean()

JSON_Status json_object_set_boolean | ( | JSON_Object * | object,
|  | const char * | name,
|  | int | boolean )

Definition at line 2484 of file parson.c.

References json_object_set_value(), json_value_free(), json_value_init_boolean(), JSONSuccess, and name.

Referenced by G_json_object_set_boolean().

## json_object_set_null()

JSON_Status json_object_set_null | ( | JSON_Object * | object,
|  | const char * | name )

Definition at line 2495 of file parson.c.

References json_object_set_value(), json_value_free(), json_value_init_null(), JSONSuccess, and name.

Referenced by G_json_object_set_null().

## json_object_set_number()

JSON_Status json_object_set_number | ( | JSON_Object * | object,
|  | const char * | name,
|  | double | number )

Definition at line 2473 of file parson.c.

References json_object_set_value(), json_value_free(), json_value_init_number(), JSONSuccess, and name.

Referenced by G_json_object_set_number().

## json_object_set_string()

JSON_Status json_object_set_string | ( | JSON_Object * | object,
|  | const char * | name,
|  | const char * | string )

Definition at line 2450 of file parson.c.

References json_object_set_value(), json_value_free(), json_value_init_string(), JSONSuccess, and name.

Referenced by G_json_object_set_string().

## json_object_set_string_with_len()

JSON_Status json_object_set_string_with_len | ( | JSON_Object * | object,
|  | const char * | name,
|  | const char * | string,
|  | size_t | len )

Definition at line 2461 of file parson.c.

References json_object_set_value(), json_value_free(), json_value_init_string_with_len(), JSONSuccess, and name.

## json_object_set_value()

JSON_Status json_object_set_value | ( | JSON_Object * | object,
|  | const char * | name,
|  | JSON_Value * | value )

Definition at line 2404 of file parson.c.

References json_object_get_wrapping_value(), json_value_free(), JSONFailure, JSONSuccess, name, NULL, and PARSON_FALSE.

Referenced by G_json_object_set_value(), json_object_dotset_value(), json_object_set_boolean(), json_object_set_null(), json_object_set_number(), json_object_set_string(), and json_object_set_string_with_len().

## json_parse_file()

JSON_Value * json_parse_file | ( | const char * | filename | ) |

Definition at line 1574 of file parson.c.

References json_parse_string(), and NULL.

## json_parse_file_with_comments()

JSON_Value * json_parse_file_with_comments | ( | const char * | filename | ) |

Definition at line 1586 of file parson.c.

References json_parse_string_with_comments(), and NULL.

## json_parse_string()

JSON_Value * json_parse_string | ( | const char * | string | ) |

Definition at line 1598 of file parson.c.

References NULL.

Referenced by json_parse_file().

## json_parse_string_with_comments()

JSON_Value * json_parse_string_with_comments | ( | const char * | string | ) |

Definition at line 1609 of file parson.c.

References NULL.

Referenced by json_parse_file_with_comments().

## json_serialization_size()

size_t json_serialization_size | ( | const JSON_Value * | value | ) |

Definition at line 2080 of file parson.c.

References NULL, PARSON_FALSE, and PARSON_NUM_BUF_SIZE.

Referenced by json_serialize_to_buffer(), and json_serialize_to_string().

## json_serialization_size_pretty()

size_t json_serialization_size_pretty | ( | const JSON_Value * | value | ) |

Definition at line 2148 of file parson.c.

References NULL, PARSON_NUM_BUF_SIZE, and PARSON_TRUE.

Referenced by json_serialize_to_buffer_pretty(), and json_serialize_to_string_pretty().

## json_serialize_to_buffer()

JSON_Status json_serialize_to_buffer | ( | const JSON_Value * | value,
|  | char * | buf,
|  | size_t | buf_size_in_bytes )

Definition at line 2089 of file parson.c.

References json_serialization_size(), JSONFailure, JSONSuccess, NULL, and PARSON_FALSE.

Referenced by json_serialize_to_string().

## json_serialize_to_buffer_pretty()

JSON_Status json_serialize_to_buffer_pretty | ( | const JSON_Value * | value,
|  | char * | buf,
|  | size_t | buf_size_in_bytes )

Definition at line 2157 of file parson.c.

References json_serialization_size_pretty(), JSONFailure, JSONSuccess, NULL, and PARSON_TRUE.

Referenced by json_serialize_to_string_pretty().

## json_serialize_to_file()

JSON_Status json_serialize_to_file | ( | const JSON_Value * | value,
|  | const char * | filename )

Definition at line 2104 of file parson.c.

References json_free_serialized_string(), json_serialize_to_string(), JSONFailure, JSONSuccess, and NULL.

## json_serialize_to_file_pretty()

JSON_Status json_serialize_to_file_pretty | ( | const JSON_Value * | value,
|  | const char * | filename )

Definition at line 2172 of file parson.c.

References json_free_serialized_string(), json_serialize_to_string_pretty(), JSONFailure, JSONSuccess, and NULL.

## json_serialize_to_string()

char * json_serialize_to_string | ( | const JSON_Value * | value | ) |

Definition at line 2128 of file parson.c.

References json_free_serialized_string(), json_serialization_size(), json_serialize_to_buffer(), JSONFailure, JSONSuccess, and NULL.

Referenced by G_json_serialize_to_string(), and json_serialize_to_file().

## json_serialize_to_string_pretty()

char * json_serialize_to_string_pretty | ( | const JSON_Value * | value | ) |

Definition at line 2196 of file parson.c.

References json_free_serialized_string(), json_serialization_size_pretty(), json_serialize_to_buffer_pretty(), JSONFailure, JSONSuccess, and NULL.

Referenced by G_json_serialize_to_string_pretty(), and json_serialize_to_file_pretty().

## json_set_allocation_functions()

void json_set_allocation_functions | ( | JSON_Malloc_Function | malloc_fun,
|  | JSON_Free_Function | free_fun )

Definition at line 2829 of file parson.c.

## json_set_escape_slashes()

void json_set_escape_slashes | ( | int | escape_slashes | ) |

Definition at line 2836 of file parson.c.

## json_set_float_serialization_format()

void json_set_float_serialization_format | ( | const char * | format | ) |

Definition at line 2841 of file parson.c.

References NULL.

Referenced by G_json_set_float_serialization_format().

## json_set_number_serialization_function()

void json_set_number_serialization_function | ( | JSON_Number_Serialization_Function | func | ) |

Definition at line 2854 of file parson.c.

## json_string()

const char * json_string | ( | const JSON_Value * | value | ) |

Definition at line 2809 of file parson.c.

References json_value_get_string().

## json_string_len()

size_t json_string_len | ( | const JSON_Value * | value | ) |

Definition at line 2814 of file parson.c.

References json_value_get_string_len().

## json_type()

JSON_Value_Type json_type | ( | const JSON_Value * | value | ) |

Definition at line 2794 of file parson.c.

References json_value_get_type().

## json_validate()

JSON_Status json_validate | ( | const JSON_Value * | schema,
|  | const JSON_Value * | value )

Definition at line 2659 of file parson.c.

References count, json_array_get_count(), json_array_get_value(), json_object_get_count(), json_object_get_name(), json_object_get_value(), json_validate(), json_value_get_array(), json_value_get_object(), json_value_get_type(), JSONArray, JSONBoolean, JSONError, JSONFailure, JSONNull, JSONNumber, JSONObject, JSONString, JSONSuccess, and NULL.

Referenced by json_validate().

## json_value_deep_copy()

JSON_Value * json_value_deep_copy | ( | const JSON_Value * | value | ) |

Definition at line 1985 of file parson.c.

References json_array_get_count(), json_array_get_value(), json_object_get_count(), json_object_get_name(), json_object_get_value(), json_value_deep_copy(), json_value_free(), json_value_get_array(), json_value_get_boolean(), json_value_get_number(), json_value_get_object(), json_value_get_type(), json_value_init_array(), json_value_init_boolean(), json_value_init_null(), json_value_init_number(), json_value_init_object(), JSONArray, JSONBoolean, JSONError, JSONFailure, JSONNull, JSONNumber, JSONObject, JSONString, JSONSuccess, and NULL.

Referenced by json_value_deep_copy().

## json_value_equals()

int json_value_equals | ( | const JSON_Value * | a,
|  | const JSON_Value * | b )

Definition at line 2727 of file parson.c.

References b, json_array_get_count(), json_array_get_value(), json_object_get_count(), json_object_get_name(), json_object_get_value(), json_value_equals(), json_value_get_array(), json_value_get_boolean(), json_value_get_number(), json_value_get_object(), json_value_get_type(), JSONArray, JSONBoolean, JSONError, JSONNull, JSONNumber, JSONObject, JSONString, NULL, PARSON_FALSE, and PARSON_TRUE.

Referenced by json_value_equals().

## json_value_free()

void json_value_free | ( | JSON_Value * | value | ) |

Definition at line 1867 of file parson.c.

References json_value_get_type(), JSONArray, JSONObject, and JSONString.

Referenced by G_json_value_free(), json_array_append_boolean(), json_array_append_null(), json_array_append_number(), json_array_append_string(), json_array_append_string_with_len(), json_array_clear(), json_array_remove(), json_array_replace_boolean(), json_array_replace_null(), json_array_replace_number(), json_array_replace_string(), json_array_replace_string_with_len(), json_array_replace_value(), json_object_clear(), json_object_dotset_boolean(), json_object_dotset_null(), json_object_dotset_number(), json_object_dotset_string(), json_object_dotset_string_with_len(), json_object_dotset_value(), json_object_set_boolean(), json_object_set_null(), json_object_set_number(), json_object_set_string(), json_object_set_string_with_len(), json_object_set_value(), and json_value_deep_copy().

## json_value_get_array()

JSON_Array * json_value_get_array | ( | const JSON_Value * | value | ) |

Definition at line 1828 of file parson.c.

References json_value_get_type(), JSONArray, and NULL.

Referenced by json_array(), json_array_get_array(), json_object_dotget_array(), json_object_get_array(), json_validate(), json_value_deep_copy(), and json_value_equals().

## json_value_get_boolean()

int json_value_get_boolean | ( | const JSON_Value * | value | ) |

Definition at line 1856 of file parson.c.

References json_value_get_type(), and JSONBoolean.

Referenced by json_array_get_boolean(), json_boolean(), json_object_dotget_boolean(), json_object_get_boolean(), json_value_deep_copy(), and json_value_equals().

## json_value_get_number()

double json_value_get_number | ( | const JSON_Value * | value | ) |

Definition at line 1851 of file parson.c.

References json_value_get_type(), and JSONNumber.

Referenced by json_array_get_number(), json_number(), json_object_dotget_number(), json_object_get_number(), json_value_deep_copy(), and json_value_equals().

## json_value_get_object()

JSON_Object * json_value_get_object | ( | const JSON_Value * | value | ) |

Definition at line 1822 of file parson.c.

References json_value_get_type(), JSONObject, and NULL.

Referenced by G_json_value_get_object(), json_array_get_object(), json_object(), json_object_dotget_object(), json_object_dotget_value(), json_object_dotset_value(), json_object_get_object(), json_validate(), json_value_deep_copy(), and json_value_equals().

## json_value_get_parent()

JSON_Value * json_value_get_parent | ( | const JSON_Value * | value | ) |

Definition at line 1862 of file parson.c.

References NULL.

## json_value_get_string()

const char * json_value_get_string | ( | const JSON_Value * | value | ) |

Definition at line 1839 of file parson.c.

References NULL.

Referenced by json_array_get_string(), json_object_dotget_string(), json_object_get_string(), and json_string().

## json_value_get_string_len()

size_t json_value_get_string_len | ( | const JSON_Value * | value | ) |

Definition at line 1845 of file parson.c.

Referenced by json_array_get_string_len(), json_object_dotget_string_len(), json_object_get_string_len(), and json_string_len().

## json_value_get_type()

JSON_Value_Type json_value_get_type | ( | const JSON_Value * | value | ) |

Definition at line 1817 of file parson.c.

References JSONError.

Referenced by G_json_value_get_type(), json_object_dothas_value_of_type(), json_object_dotset_value(), json_object_has_value_of_type(), json_type(), json_validate(), json_value_deep_copy(), json_value_equals(), json_value_free(), json_value_get_array(), json_value_get_boolean(), json_value_get_number(), and json_value_get_object().

## json_value_init_array()

JSON_Value * json_value_init_array | ( | void |  | ) |

Definition at line 1901 of file parson.c.

References JSONArray, and NULL.

Referenced by G_json_value_init_array(), and json_value_deep_copy().

## json_value_init_boolean()

JSON_Value * json_value_init_boolean | ( | int | boolean | ) |

Definition at line 1962 of file parson.c.

References JSONBoolean, and NULL.

Referenced by json_array_append_boolean(), json_array_replace_boolean(), json_object_dotset_boolean(), json_object_set_boolean(), and json_value_deep_copy().

## json_value_init_null()

JSON_Value * json_value_init_null | ( | void |  | ) |

Definition at line 1974 of file parson.c.

References JSONNull, and NULL.

Referenced by json_array_append_null(), json_array_replace_null(), json_object_dotset_null(), json_object_set_null(), and json_value_deep_copy().

## json_value_init_number()

JSON_Value * json_value_init_number | ( | double | number | ) |

Definition at line 1946 of file parson.c.

References IS_NUMBER_INVALID, JSONNumber, and NULL.

Referenced by json_array_append_number(), json_array_replace_number(), json_object_dotset_number(), json_object_set_number(), and json_value_deep_copy().

## json_value_init_object()

JSON_Value * json_value_init_object | ( | void |  | ) |

Definition at line 1885 of file parson.c.

References JSONObject, and NULL.

Referenced by G_json_value_init_object(), json_object_dotset_value(), and json_value_deep_copy().

## json_value_init_string()

JSON_Value * json_value_init_string | ( | const char * | string | ) |

Definition at line 1917 of file parson.c.

References json_value_init_string_with_len(), and NULL.

Referenced by json_array_append_string(), json_array_replace_string(), json_object_dotset_string(), and json_object_set_string().

## json_value_init_string_with_len()

JSON_Value * json_value_init_string_with_len | ( | const char * | string,
|  | size_t | length )

Definition at line 1925 of file parson.c.

References NULL.

Referenced by json_array_append_string_with_len(), json_array_replace_string_with_len(), json_object_dotset_string_with_len(), json_object_set_string_with_len(), and json_value_init_string().