Loading...
Searching...
No Matches
parson.h
Go to the documentation of this file.
/*
SPDX-License-Identifier: MIT
Parson 1.5.3 (https://github.com/kgabis/parson)
Copyright (c) 2012 - 2023 Krzysztof Gabis
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE.
*/
#ifndef parson_parson_h
#define parson_parson_h
#ifdef __cplusplus
extern "C" {
#endif
#if 0
} /* unconfuse xcode */
#endif
#define PARSON_VERSION_MAJOR 1
#define PARSON_VERSION_MINOR 5
#define PARSON_VERSION_PATCH 3
#define PARSON_VERSION_STRING "1.5.3"
#include <stddef.h> /* size_t */
/* Types and enums */
typedef struct json_object_t JSON_Object;
typedef struct json_array_t JSON_Array;
typedef struct json_value_t JSON_Value;
enum json_value_type {
JSONError = -1,
JSONNull = 1,
JSONString = 2,
JSONNumber = 3,
JSONObject = 4,
JSONArray = 5,
JSONBoolean = 6
};
typedef int JSON_Value_Type;
enum json_result_t { JSONSuccess = 0, JSONFailure = -1 };
typedef int JSON_Status;
typedef void *(*JSON_Malloc_Function)(size_t);
typedef void (*JSON_Free_Function)(void *);
/* A function used for serializing numbers (see
json_set_number_serialization_function). If 'buf' is null then it should
return number of bytes that would've been written (but not more than
PARSON_NUM_BUF_SIZE).
*/
typedef int (*JSON_Number_Serialization_Function)(double num, char *buf);
/* Call only once, before calling any other function from parson API. If not
called, malloc and free from stdlib will be used for all allocations */
void json_set_allocation_functions(JSON_Malloc_Function malloc_fun,
JSON_Free_Function free_fun);
/* Sets if slashes should be escaped or not when serializing JSON. By default
slashes are escaped. This function sets a global setting and is not thread
safe. */
void json_set_escape_slashes(int escape_slashes);
/* Sets float format used for serialization of numbers.
Make sure it can't serialize to a string longer than PARSON_NUM_BUF_SIZE.
If format is null then the default format is used. */
void json_set_float_serialization_format(const char *format);
/* Sets a function that will be used for serialization of numbers.
If function is null then the default serialization function is used. */
void json_set_number_serialization_function(
JSON_Number_Serialization_Function fun);
/* Parses first JSON value in a file, returns NULL in case of error */
JSON_Value *json_parse_file(const char *filename);
/* Parses first JSON value in a file and ignores comments (/ * * / and //),
returns NULL in case of error */
JSON_Value *json_parse_file_with_comments(const char *filename);
/* Parses first JSON value in a string, returns NULL in case of error */
JSON_Value *json_parse_string(const char *string);
/* Parses first JSON value in a string and ignores comments (/ * * / and //),
returns NULL in case of error */
JSON_Value *json_parse_string_with_comments(const char *string);
/* Serialization */
size_t json_serialization_size(const JSON_Value *value); /* returns 0 on fail */
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);
/* Pretty serialization */
size_t
json_serialization_size_pretty(const JSON_Value *value); /* returns 0 on fail */
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); /* frees string from json_serialize_to_string and
json_serialize_to_string_pretty */
/* Comparing */
int json_value_equals(const JSON_Value *a, const JSON_Value *b);
/* Validation
This is *NOT* JSON Schema. It validates json by checking if object have
identically named fields with matching types. For example schema {"name":"",
"age":0} will validate
{"name":"Joe", "age":25} and {"name":"Joe", "age":25, "gender":"m"},
but not {"name":"Joe"} or {"name":"Joe", "age":"Cucumber"}.
In case of arrays, only first value in schema is checked against all values
in tested array. Empty objects ({}) validate all objects, empty arrays ([])
validate all arrays, null validates values of every type.
*/
JSON_Status json_validate(const JSON_Value *schema, const JSON_Value *value);
/*
* JSON Object
*/
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); /* doesn't account for last null character */
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);
double json_object_get_number(const JSON_Object *object,
const char *name); /* returns 0 on fail */
int json_object_get_boolean(const JSON_Object *object,
const char *name); /* returns -1 on fail */
/* dotget functions enable addressing values with dot notation in nested
objects, just like in structs or c++/java/c# objects (e.g.
objectA.objectB.value). Because valid names in JSON can contain dots, some
values may be inaccessible this way. */
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); /* doesn't account for last null character */
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);
double json_object_dotget_number(const JSON_Object *object,
const char *name); /* returns 0 on fail */
int json_object_dotget_boolean(const JSON_Object *object,
const char *name); /* returns -1 on fail */
/* Functions to get available names */
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);
/* Functions to check if object has a value with a specific name. Returned value
* is 1 if object has a value and 0 if it doesn't. dothas functions behave
* exactly like dotget functions. */
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);
/* Creates new name-value pair or frees and replaces old value with a new one.
* json_object_set_value does not copy passed value so it shouldn't be freed
* afterwards. */
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); /* length shouldn't include last null character */
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);
/* Works like dotget functions, but creates whole hierarchy if necessary.
* json_object_dotset_value does not copy passed value so it shouldn't be freed
* afterwards. */
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); /* length shouldn't include last null character */
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);
/* Frees and removes name-value pair */
JSON_Status json_object_remove(JSON_Object *object, const char *name);
/* Works like dotget function, but removes name-value pair only on exact match.
*/
JSON_Status json_object_dotremove(JSON_Object *object, const char *key);
/* Removes all name-value pairs in object */
JSON_Status json_object_clear(JSON_Object *object);
/*
*JSON Array
*/
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); /* doesn't account for last null character */
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);
double json_array_get_number(const JSON_Array *array,
size_t index); /* returns 0 on fail */
int json_array_get_boolean(const JSON_Array *array,
size_t index); /* returns -1 on fail */
size_t json_array_get_count(const JSON_Array *array);
JSON_Value *json_array_get_wrapping_value(const JSON_Array *array);
/* Frees and removes value at given index, does nothing and returns JSONFailure
* if index doesn't exist. Order of values in array may change during execution.
*/
JSON_Status json_array_remove(JSON_Array *array, size_t i);
/* Frees and removes from array value at given index and replaces it with given
* one. Does nothing and returns JSONFailure if index doesn't exist.
* json_array_replace_value does not copy passed value so it shouldn't be freed
* afterwards. */
JSON_Status json_array_replace_value(JSON_Array *array, size_t i,
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); /* length shouldn't include last null character */
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);
/* Frees and removes all values from array */
JSON_Status json_array_clear(JSON_Array *array);
/* Appends new value at the end of array.
* json_array_append_value does not copy passed value so it shouldn't be freed
* afterwards. */
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); /* length shouldn't include last null character */
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 Value
*/
JSON_Value *json_value_init_object(void);
JSON_Value *json_value_init_array(void);
JSON_Value *
json_value_init_string(const char *string); /* copies passed string */
JSON_Value *json_value_init_string_with_len(
const char *string,
size_t length); /* copies passed string, length shouldn't include last null
character */
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);
void json_value_free(JSON_Value *value);
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); /* doesn't account for last null character */
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);
/* Same as above, but shorter */
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); /* doesn't account for last null character */
double json_number(const JSON_Value *value);
int json_boolean(const JSON_Value *value);
#ifdef __cplusplus
}
#endif
#endif
b
double b
Definition driver/set_window.c:5
name
const char * name
Definition named_colr.c:6
json_object_dotset_string
JSON_Status json_object_dotset_string(JSON_Object *object, const char *name, const char *string)
Definition parson.c:2559
json_object_get_string_len
size_t json_object_get_string_len(const JSON_Object *object, const char *name)
Definition parson.c:1640
json_array_replace_null
JSON_Status json_array_replace_null(JSON_Array *array, size_t i)
Definition parson.c:2304
json_value_get_string
const char * json_value_get_string(const JSON_Value *value)
Definition parson.c:1839
json_string
const char * json_string(const JSON_Value *value)
Definition parson.c:2809
json_object_get_boolean
int json_object_get_boolean(const JSON_Object *object, const char *name)
Definition parson.c:1660
json_value_get_string_len
size_t json_value_get_string_len(const JSON_Value *value)
Definition parson.c:1845
json_string_len
size_t json_string_len(const JSON_Value *value)
Definition parson.c:2814
json_object_dotset_boolean
JSON_Status json_object_dotset_boolean(JSON_Object *object, const char *name, int boolean)
Definition parson.c:2602
json_array_append_null
JSON_Status json_array_append_null(JSON_Array *array)
Definition parson.c:2391
json_array_replace_boolean
JSON_Status json_array_replace_boolean(JSON_Array *array, size_t i, int boolean)
Definition parson.c:2291
json_object_remove
JSON_Status json_object_remove(JSON_Object *object, const char *name)
Definition parson.c:2629
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 parson.c:2157
json_serialization_size_pretty
size_t json_serialization_size_pretty(const JSON_Value *value)
Definition parson.c:2148
json_value_type
json_value_type
Definition parson.h:49
JSONError
@ JSONError
Definition parson.h:50
JSONObject
@ JSONObject
Definition parson.h:54
JSONNull
@ JSONNull
Definition parson.h:51
JSONNumber
@ JSONNumber
Definition parson.h:53
JSONBoolean
@ JSONBoolean
Definition parson.h:56
JSONString
@ JSONString
Definition parson.h:52
JSONArray
@ JSONArray
Definition parson.h:55
json_array_get_value
JSON_Value * json_array_get_value(const JSON_Array *array, size_t index)
Definition parson.c:1765
json_array_get_string
const char * json_array_get_string(const JSON_Array *array, size_t index)
Definition parson.c:1773
json_array_append_boolean
JSON_Status json_array_append_boolean(JSON_Array *array, int boolean)
Definition parson.c:2378
json_type
JSON_Value_Type json_type(const JSON_Value *value)
Definition parson.c:2794
json_object_dotget_boolean
int json_object_dotget_boolean(const JSON_Object *object, const char *name)
Definition parson.c:1706
json_object_get_name
const char * json_object_get_name(const JSON_Object *object, size_t index)
Definition parson.c:1716
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 parson.c:2263
json_value_get_array
JSON_Array * json_value_get_array(const JSON_Value *value)
Definition parson.c:1828
json_object_dotget_string
const char * json_object_dotget_string(const JSON_Object *object, const char *name)
Definition parson.c:1677
json_object_dotset_null
JSON_Status json_object_dotset_null(JSON_Object *object, const char *name)
Definition parson.c:2616
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 parson.c:2461
json_object_set_number
JSON_Status json_object_set_number(JSON_Object *object, const char *name, double number)
Definition parson.c:2473
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 parson.c:1745
json_object_get_object
JSON_Object * json_object_get_object(const JSON_Object *object, const char *name)
Definition parson.c:1650
json_set_float_serialization_format
void json_set_float_serialization_format(const char *format)
Definition parson.c:2841
json_array_get_count
size_t json_array_get_count(const JSON_Array *array)
Definition parson.c:1803
json_array_get_number
double json_array_get_number(const JSON_Array *array, size_t index)
Definition parson.c:1783
json_result_t
json_result_t
Definition parson.h:60
JSONSuccess
@ JSONSuccess
Definition parson.h:60
JSONFailure
@ JSONFailure
Definition parson.h:60
json_array_replace_number
JSON_Status json_array_replace_number(JSON_Array *array, size_t i, double number)
Definition parson.c:2277
json_object_dotget_value
JSON_Value * json_object_dotget_value(const JSON_Object *object, const char *name)
Definition parson.c:1665
JSON_Value_Type
int JSON_Value_Type
Definition parson.h:58
json_array_clear
JSON_Status json_array_clear(JSON_Array *array)
Definition parson.c:2317
JSON_Number_Serialization_Function
int(* JSON_Number_Serialization_Function)(double num, char *buf)
Definition parson.h:71
json_object_set_string
JSON_Status json_object_set_string(JSON_Object *object, const char *name, const char *string)
Definition parson.c:2450
json_object_set_boolean
JSON_Status json_object_set_boolean(JSON_Object *object, const char *name, int boolean)
Definition parson.c:2484
json_free_serialized_string
void json_free_serialized_string(char *string)
Definition parson.c:2217
json_value_equals
int json_value_equals(const JSON_Value *a, const JSON_Value *b)
Definition parson.c:2727
json_validate
JSON_Status json_validate(const JSON_Value *schema, const JSON_Value *value)
Definition parson.c:2659
json_array_remove
JSON_Status json_array_remove(JSON_Array *array, size_t i)
Definition parson.c:2222
json_serialize_to_file
JSON_Status json_serialize_to_file(const JSON_Value *value, const char *filename)
Definition parson.c:2104
json_array_append_string_with_len
JSON_Status json_array_append_string_with_len(JSON_Array *array, const char *string, size_t len)
Definition parson.c:2351
json_object_dotget_array
JSON_Array * json_object_dotget_array(const JSON_Object *object, const char *name)
Definition parson.c:1700
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 parson.c:1757
json_set_escape_slashes
void json_set_escape_slashes(int escape_slashes)
Definition parson.c:2836
json_object_dotset_value
JSON_Status json_object_dotset_value(JSON_Object *object, const char *name, JSON_Value *value)
Definition parson.c:2505
JSON_Array
struct json_array_t JSON_Array
Definition parson.h:46
json_value_init_array
JSON_Value * json_value_init_array(void)
Definition parson.c:1901
json_object_get_count
size_t json_object_get_count(const JSON_Object *object)
Definition parson.c:1711
json_object_get_wrapping_value
JSON_Value * json_object_get_wrapping_value(const JSON_Object *object)
Definition parson.c:1732
json_array_get_object
JSON_Object * json_array_get_object(const JSON_Array *array, size_t index)
Definition parson.c:1788
json_boolean
int json_boolean(const JSON_Value *value)
Definition parson.c:2824
json_number
double json_number(const JSON_Value *value)
Definition parson.c:2819
json_object_dotget_object
JSON_Object * json_object_dotget_object(const JSON_Object *object, const char *name)
Definition parson.c:1694
json_object_get_value_at
JSON_Value * json_object_get_value_at(const JSON_Object *object, size_t index)
Definition parson.c:1724
JSON_Status
int JSON_Status
Definition parson.h:61
json_parse_string
JSON_Value * json_parse_string(const char *string)
Definition parson.c:1598
json_array_append_value
JSON_Status json_array_append_value(JSON_Array *array, JSON_Value *value)
Definition parson.c:2330
json_object_dothas_value
int json_object_dothas_value(const JSON_Object *object, const char *name)
Definition parson.c:1752
json_value_init_number
JSON_Value * json_value_init_number(double number)
Definition parson.c:1946
json_array
JSON_Array * json_array(const JSON_Value *value)
Definition parson.c:2804
json_object_get_array
JSON_Array * json_object_get_array(const JSON_Object *object, const char *name)
Definition parson.c:1655
json_set_number_serialization_function
void json_set_number_serialization_function(JSON_Number_Serialization_Function fun)
Definition parson.c:2854
json_object_has_value
int json_object_has_value(const JSON_Object *object, const char *name)
Definition parson.c:1740
json_value_get_boolean
int json_value_get_boolean(const JSON_Value *value)
Definition parson.c:1856
json_value_deep_copy
JSON_Value * json_value_deep_copy(const JSON_Value *value)
Definition parson.c:1985
json_parse_string_with_comments
JSON_Value * json_parse_string_with_comments(const char *string)
Definition parson.c:1609
JSON_Value
struct json_value_t JSON_Value
Definition parson.h:47
json_object_get_value
JSON_Value * json_object_get_value(const JSON_Object *object, const char *name)
Definition parson.c:1627
json_object_clear
JSON_Status json_object_clear(JSON_Object *object)
Definition parson.c:2639
json_object_get_string
const char * json_object_get_string(const JSON_Object *object, const char *name)
Definition parson.c:1635
json_array_get_boolean
int json_array_get_boolean(const JSON_Array *array, size_t index)
Definition parson.c:1798
json_serialize_to_string
char * json_serialize_to_string(const JSON_Value *value)
Definition parson.c:2128
json_object_set_value
JSON_Status json_object_set_value(JSON_Object *object, const char *name, JSON_Value *value)
Definition parson.c:2404
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 parson.c:2573
json_value_init_null
JSON_Value * json_value_init_null(void)
Definition parson.c:1974
JSON_Free_Function
void(* JSON_Free_Function)(void *)
Definition parson.h:64
JSON_Object
struct json_object_t JSON_Object
Definition parson.h:45
json_array_get_wrapping_value
JSON_Value * json_array_get_wrapping_value(const JSON_Array *array)
Definition parson.c:1808
json_array_get_string_len
size_t json_array_get_string_len(const JSON_Array *array, size_t index)
Definition parson.c:1778
json_value_free
void json_value_free(JSON_Value *value)
Definition parson.c:1867
json_object_set_null
JSON_Status json_object_set_null(JSON_Object *object, const char *name)
Definition parson.c:2495
json_serialize_to_file_pretty
JSON_Status json_serialize_to_file_pretty(const JSON_Value *value, const char *filename)
Definition parson.c:2172
json_parse_file
JSON_Value * json_parse_file(const char *filename)
Definition parson.c:1574
json_serialization_size
size_t json_serialization_size(const JSON_Value *value)
Definition parson.c:2080
JSON_Malloc_Function
void *(* JSON_Malloc_Function)(size_t)
Definition parson.h:63
json_array_append_string
JSON_Status json_array_append_string(JSON_Array *array, const char *string)
Definition parson.c:2338
json_array_get_array
JSON_Array * json_array_get_array(const JSON_Array *array, size_t index)
Definition parson.c:1793
json_value_init_string_with_len
JSON_Value * json_value_init_string_with_len(const char *string, size_t length)
Definition parson.c:1925
json_object_dotget_string_len
size_t json_object_dotget_string_len(const JSON_Object *object, const char *name)
Definition parson.c:1683
json_value_init_boolean
JSON_Value * json_value_init_boolean(int boolean)
Definition parson.c:1962
json_value_get_number
double json_value_get_number(const JSON_Value *value)
Definition parson.c:1851
json_object_get_number
double json_object_get_number(const JSON_Object *object, const char *name)
Definition parson.c:1645
json_object_dotget_number
double json_object_dotget_number(const JSON_Object *object, const char *name)
Definition parson.c:1689
json_value_get_type
JSON_Value_Type json_value_get_type(const JSON_Value *value)
Definition parson.c:1817
json_array_replace_value
JSON_Status json_array_replace_value(JSON_Array *array, size_t i, JSON_Value *value)
Definition parson.c:2236
json_value_get_object
JSON_Object * json_value_get_object(const JSON_Value *value)
Definition parson.c:1822
json_object
JSON_Object * json_object(const JSON_Value *value)
Definition parson.c:2799
json_value_init_object
JSON_Value * json_value_init_object(void)
Definition parson.c:1885
json_serialize_to_string_pretty
char * json_serialize_to_string_pretty(const JSON_Value *value)
Definition parson.c:2196
json_value_init_string
JSON_Value * json_value_init_string(const char *string)
Definition parson.c:1917
json_object_dotset_number
JSON_Status json_object_dotset_number(JSON_Object *object, const char *name, double number)
Definition parson.c:2588
json_object_dotremove
JSON_Status json_object_dotremove(JSON_Object *object, const char *key)
Definition parson.c:2634
json_set_allocation_functions
void json_set_allocation_functions(JSON_Malloc_Function malloc_fun, JSON_Free_Function free_fun)
Definition parson.c:2829
json_parse_file_with_comments
JSON_Value * json_parse_file_with_comments(const char *filename)
Definition parson.c:1586
json_array_append_number
JSON_Status json_array_append_number(JSON_Array *array, double number)
Definition parson.c:2365
json_array_replace_string
JSON_Status json_array_replace_string(JSON_Array *array, size_t i, const char *string)
Definition parson.c:2249
json_value_get_parent
JSON_Value * json_value_get_parent(const JSON_Value *value)
Definition parson.c:1862
json_serialize_to_buffer
JSON_Status json_serialize_to_buffer(const JSON_Value *value, char *buf, size_t buf_size_in_bytes)
Definition parson.c:2089