GRASS GIS 8 Programmer's Manual  8.5.0dev(2025)-fbabf32052
gjson.h
Go to the documentation of this file.
1 #ifndef GRASS_GJSON_H
2 #define GRASS_GJSON_H
3 
4 #include "parson.h"
5 
6 /* *************************************************************** */
7 /* ***** WRAPPER FOR PARSON FUNCTIONS USED IN GRASS ************** */
8 /* *************************************************************** */
9 
12 
14 extern JSON_Object *G_json_object(const JSON_Value *);
15 extern JSON_Object *G_json_object_get_object(const JSON_Object *, const char *);
16 extern JSON_Array *G_json_object_get_array(const JSON_Object *, const char *);
17 extern JSON_Value *G_json_object_get_value(const JSON_Object *, const char *);
18 extern const char *G_json_object_get_string(const JSON_Object *, const char *);
19 extern double G_json_object_get_number(const JSON_Object *, const char *);
20 extern int G_json_object_get_boolean(const JSON_Object *, const char *);
22 
23 extern JSON_Status G_json_object_set_value(JSON_Object *, const char *,
24  JSON_Value *);
25 extern JSON_Status G_json_object_set_string(JSON_Object *, const char *,
26  const char *);
27 extern JSON_Status G_json_object_set_number(JSON_Object *, const char *,
28  double);
29 extern JSON_Status G_json_object_set_boolean(JSON_Object *, const char *, int);
30 extern JSON_Status G_json_object_set_null(JSON_Object *, const char *);
31 
32 extern JSON_Array *G_json_array(const JSON_Value *);
33 extern JSON_Value *G_json_array_get_value(const JSON_Array *, size_t);
34 extern const char *G_json_array_get_string(const JSON_Array *, size_t);
35 extern double G_json_array_get_number(const JSON_Array *, size_t);
36 extern int G_json_array_get_boolean(const JSON_Array *, size_t);
37 
39 extern JSON_Status G_json_array_append_string(JSON_Array *, const char *);
43 
44 extern char *G_json_serialize_to_string_pretty(const JSON_Value *);
45 extern void G_json_free_serialized_string(char *);
46 extern void G_json_value_free(JSON_Value *);
47 
48 #endif /* GRASS_GJSON_H */
JSON_Value * G_json_array_get_value(const JSON_Array *, size_t)
Definition: gjson.c:101
JSON_Array * G_json_array(const JSON_Value *)
Definition: gjson.c:97
void G_json_value_free(JSON_Value *)
Definition: gjson.c:152
JSON_Value * G_json_object_get_value(const JSON_Object *, const char *)
Definition: gjson.c:52
int G_json_array_get_boolean(const JSON_Array *, size_t)
Definition: gjson.c:113
JSON_Array * G_json_object_get_array(const JSON_Object *, const char *)
Definition: gjson.c:48
JSON_Status G_json_object_set_null(JSON_Object *, const char *)
Definition: gjson.c:93
const char * G_json_object_get_string(const JSON_Object *, const char *)
Definition: gjson.c:56
JSON_Status G_json_object_set_string(JSON_Object *, const char *, const char *)
Definition: gjson.c:78
JSON_Status G_json_array_append_string(JSON_Array *, const char *)
Definition: gjson.c:123
JSON_Status G_json_array_append_boolean(JSON_Array *, int)
Definition: gjson.c:133
char * G_json_serialize_to_string_pretty(const JSON_Value *)
Definition: gjson.c:143
JSON_Value * G_json_object_get_wrapping_value(const JSON_Object *)
Definition: gjson.c:69
const char * G_json_array_get_string(const JSON_Array *, size_t)
Definition: gjson.c:105
JSON_Status G_json_array_append_value(JSON_Array *, JSON_Value *)
Definition: gjson.c:118
JSON_Status G_json_array_append_null(JSON_Array *)
Definition: gjson.c:138
JSON_Status G_json_object_set_value(JSON_Object *, const char *, JSON_Value *)
Definition: gjson.c:73
JSON_Status G_json_array_append_number(JSON_Array *, double)
Definition: gjson.c:128
JSON_Status G_json_object_set_boolean(JSON_Object *, const char *, int)
Definition: gjson.c:88
JSON_Value * G_json_value_init_object(void)
Definition: gjson.c:24
JSON_Object * G_json_value_get_object(const JSON_Value *)
Definition: gjson.c:34
JSON_Object * G_json_object_get_object(const JSON_Object *, const char *)
Definition: gjson.c:43
JSON_Value * G_json_value_init_array(void)
Definition: gjson.c:29
int G_json_object_get_boolean(const JSON_Object *, const char *)
Definition: gjson.c:65
void G_json_free_serialized_string(char *)
Definition: gjson.c:148
JSON_Status G_json_object_set_number(JSON_Object *, const char *, double)
Definition: gjson.c:83
double G_json_object_get_number(const JSON_Object *, const char *)
Definition: gjson.c:61
JSON_Object * G_json_object(const JSON_Value *)
Definition: gjson.c:39
double G_json_array_get_number(const JSON_Array *, size_t)
Definition: gjson.c:109
struct json_array_t JSON_Array
Definition: parson.h:46
int JSON_Status
Definition: parson.h:61
struct json_value_t JSON_Value
Definition: parson.h:47
struct json_object_t JSON_Object
Definition: parson.h:45