GRASS 8 Programmer's Manual  8.5.0dev(2025)-9d806b45d8
gjson.h
Go to the documentation of this file.
1 #ifndef GRASS_GJSON_H
2 #define GRASS_GJSON_H
3 
4 #include <stddef.h>
5 
6 /* *************************************************************** */
7 /* ***** WRAPPER FOR PARSON FUNCTIONS USED IN GRASS ************** */
8 /* *************************************************************** */
9 
10 typedef struct G_json_object_t G_JSON_Object;
11 typedef struct G_json_array_t G_JSON_Array;
12 typedef struct G_json_value_t G_JSON_Value;
13 
21  G_JSONBoolean = 6
22 };
23 typedef int G_JSON_Value_Type;
24 
26 typedef int G_JSON_Status;
27 
30 
35  const char *);
37  const char *);
39  const char *);
40 extern const char *G_json_object_get_string(const G_JSON_Object *,
41  const char *);
42 extern double G_json_object_get_number(const G_JSON_Object *, const char *);
43 extern int G_json_object_get_boolean(const G_JSON_Object *, const char *);
46  G_JSON_Value *);
48  const char *);
50  double);
52  int);
53 extern G_JSON_Status G_json_object_set_null(G_JSON_Object *, const char *);
54 
56  const char *);
57 extern const char *G_json_object_dotget_string(G_JSON_Object *, const char *);
59  double);
60 extern double G_json_object_dotget_number(G_JSON_Object *, const char *);
62  const char *name);
63 extern G_JSON_Array *G_json_array(const G_JSON_Value *);
64 extern G_JSON_Value *G_json_array_get_value(const G_JSON_Array *, size_t);
65 extern const char *G_json_array_get_string(const G_JSON_Array *, size_t);
66 extern double G_json_array_get_number(const G_JSON_Array *, size_t);
67 extern int G_json_array_get_boolean(const G_JSON_Array *, size_t);
68 
74 
75 extern void G_json_set_float_serialization_format(const char *format);
77 extern void G_json_free_serialized_string(char *);
78 extern void G_json_value_free(G_JSON_Value *);
79 
80 #endif /* GRASS_GJSON_H */
struct json_value_t G_json_value_t
Definition: gjson.c:23
struct json_object_t G_json_object_t
Definition: gjson.c:21
struct json_array_t G_json_array_t
Definition: gjson.c:22
void G_json_value_free(G_JSON_Value *)
Definition: gjson.c:218
G_JSON_Object * G_json_object(const G_JSON_Value *)
Definition: gjson.c:49
G_JSON_Status G_json_object_dotset_number(G_JSON_Object *, const char *, double)
Definition: gjson.c:134
G_JSON_Status G_json_object_dotset_string(G_JSON_Object *, const char *, const char *)
Definition: gjson.c:123
g_json_result_t
Definition: gjson.h:25
@ G_JSONSuccess
Definition: gjson.h:25
@ G_JSONFailure
Definition: gjson.h:25
G_JSON_Value * G_json_object_get_value(const G_JSON_Object *, const char *)
Definition: gjson.c:68
const char * G_json_object_get_string(const G_JSON_Object *, const char *)
Definition: gjson.c:75
G_JSON_Status G_json_object_set_null(G_JSON_Object *, const char *)
Definition: gjson.c:118
G_JSON_Status G_json_array_append_boolean(G_JSON_Array *, int)
Definition: gjson.c:193
const char * G_json_array_get_string(const G_JSON_Array *, size_t)
Definition: gjson.c:161
int G_json_array_get_boolean(const G_JSON_Array *, size_t)
Definition: gjson.c:171
G_JSON_Status G_json_object_dotset_null(G_JSON_Object *object, const char *name)
Definition: gjson.c:145
const char * G_json_object_dotget_string(G_JSON_Object *, const char *)
Definition: gjson.c:129
double G_json_array_get_number(const G_JSON_Array *, size_t)
Definition: gjson.c:166
struct G_json_array_t G_JSON_Array
Definition: gjson.h:11
char * G_json_serialize_to_string_pretty(const G_JSON_Value *)
Definition: gjson.c:208
G_JSON_Value * G_json_value_init_object(void)
Definition: gjson.c:29
G_JSON_Array * G_json_array(const G_JSON_Value *)
Definition: gjson.c:150
struct G_json_object_t G_JSON_Object
Definition: gjson.h:10
G_JSON_Object * G_json_object_get_object(const G_JSON_Object *, const char *)
Definition: gjson.c:54
G_JSON_Status G_json_object_set_value(G_JSON_Object *, const char *, G_JSON_Value *)
Definition: gjson.c:96
g_json_value_type
Definition: gjson.h:14
@ G_JSONArray
Definition: gjson.h:20
@ G_JSONBoolean
Definition: gjson.h:21
@ G_JSONString
Definition: gjson.h:17
@ G_JSONError
Definition: gjson.h:15
@ G_JSONObject
Definition: gjson.h:19
@ G_JSONNumber
Definition: gjson.h:18
@ G_JSONNull
Definition: gjson.h:16
int G_json_object_get_boolean(const G_JSON_Object *, const char *)
Definition: gjson.c:86
double G_json_object_dotget_number(G_JSON_Object *, const char *)
Definition: gjson.c:140
G_JSON_Value_Type G_json_value_get_type(const G_JSON_Value *value)
Definition: gjson.c:39
struct G_json_value_t G_JSON_Value
Definition: gjson.h:12
G_JSON_Status G_json_object_set_string(G_JSON_Object *, const char *, const char *)
Definition: gjson.c:102
G_JSON_Array * G_json_object_get_array(const G_JSON_Object *, const char *)
Definition: gjson.c:61
G_JSON_Status G_json_array_append_null(G_JSON_Array *)
Definition: gjson.c:198
int G_JSON_Status
Definition: gjson.h:26
G_JSON_Status G_json_array_append_string(G_JSON_Array *, const char *)
Definition: gjson.c:182
int G_JSON_Value_Type
Definition: gjson.h:23
G_JSON_Status G_json_object_set_number(G_JSON_Object *, const char *, double)
Definition: gjson.c:107
double G_json_object_get_number(const G_JSON_Object *, const char *)
Definition: gjson.c:81
G_JSON_Value * G_json_object_get_wrapping_value(const G_JSON_Object *)
Definition: gjson.c:91
G_JSON_Status G_json_object_set_boolean(G_JSON_Object *, const char *, int)
Definition: gjson.c:112
G_JSON_Value * G_json_value_init_array(void)
Definition: gjson.c:34
void G_json_free_serialized_string(char *)
Definition: gjson.c:213
G_JSON_Value * G_json_array_get_value(const G_JSON_Array *, size_t)
Definition: gjson.c:155
G_JSON_Object * G_json_value_get_object(const G_JSON_Value *)
Definition: gjson.c:44
G_JSON_Status G_json_array_append_number(G_JSON_Array *, double)
Definition: gjson.c:188
G_JSON_Status G_json_array_append_value(G_JSON_Array *, G_JSON_Value *)
Definition: gjson.c:176
void G_json_set_float_serialization_format(const char *format)
Definition: gjson.c:203
const char * name
Definition: named_colr.c:6