Loading...
Searching...
No Matches
gjson.h
Go to the documentation of this file.
#ifndef GRASS_GJSON_H
#define GRASS_GJSON_H
#include <stddef.h>
/* *************************************************************** */
/* ***** WRAPPER FOR PARSON FUNCTIONS USED IN GRASS ************** */
/* *************************************************************** */
typedef struct G_json_object_t G_JSON_Object;
typedef struct G_json_array_t G_JSON_Array;
typedef struct G_json_value_t G_JSON_Value;
enum g_json_value_type {
G_JSONError = -1,
G_JSONNull = 1,
G_JSONString = 2,
G_JSONNumber = 3,
G_JSONObject = 4,
G_JSONArray = 5,
G_JSONBoolean = 6
};
typedef int G_JSON_Value_Type;
enum g_json_result_t { G_JSONSuccess = 0, G_JSONFailure = -1 };
typedef int G_JSON_Status;
extern G_JSON_Value *G_json_value_init_object(void);
extern G_JSON_Value *G_json_value_init_array(void);
extern G_JSON_Value_Type G_json_value_get_type(const G_JSON_Value *value);
extern G_JSON_Object *G_json_value_get_object(const G_JSON_Value *);
extern G_JSON_Object *G_json_object(const G_JSON_Value *);
extern G_JSON_Object *G_json_object_get_object(const G_JSON_Object *,
const char *);
extern G_JSON_Array *G_json_object_get_array(const G_JSON_Object *,
const char *);
extern G_JSON_Value *G_json_object_get_value(const G_JSON_Object *,
const char *);
extern const char *G_json_object_get_string(const G_JSON_Object *,
const char *);
extern double G_json_object_get_number(const G_JSON_Object *, const char *);
extern int G_json_object_get_boolean(const G_JSON_Object *, const char *);
extern G_JSON_Value *G_json_object_get_wrapping_value(const G_JSON_Object *);
extern G_JSON_Status G_json_object_set_value(G_JSON_Object *, const char *,
G_JSON_Value *);
extern G_JSON_Status G_json_object_set_string(G_JSON_Object *, const char *,
const char *);
extern G_JSON_Status G_json_object_set_number(G_JSON_Object *, const char *,
double);
extern G_JSON_Status G_json_object_set_boolean(G_JSON_Object *, const char *,
int);
extern G_JSON_Status G_json_object_set_null(G_JSON_Object *, const char *);
extern G_JSON_Status G_json_object_dotset_string(G_JSON_Object *, const char *,
const char *);
extern const char *G_json_object_dotget_string(G_JSON_Object *, const char *);
extern G_JSON_Status G_json_object_dotset_number(G_JSON_Object *, const char *,
double);
extern double G_json_object_dotget_number(G_JSON_Object *, const char *);
extern G_JSON_Status G_json_object_dotset_null(G_JSON_Object *object,
const char *name);
extern G_JSON_Array *G_json_array(const G_JSON_Value *);
extern G_JSON_Value *G_json_array_get_value(const G_JSON_Array *, size_t);
extern const char *G_json_array_get_string(const G_JSON_Array *, size_t);
extern double G_json_array_get_number(const G_JSON_Array *, size_t);
extern int G_json_array_get_boolean(const G_JSON_Array *, size_t);
extern G_JSON_Status G_json_array_append_value(G_JSON_Array *, G_JSON_Value *);
extern G_JSON_Status G_json_array_append_string(G_JSON_Array *, const char *);
extern G_JSON_Status G_json_array_append_number(G_JSON_Array *, double);
extern G_JSON_Status G_json_array_append_boolean(G_JSON_Array *, int);
extern G_JSON_Status G_json_array_append_null(G_JSON_Array *);
extern void G_json_set_float_serialization_format(const char *format);
extern char *G_json_serialize_to_string_pretty(const G_JSON_Value *);
extern char *G_json_serialize_to_string(const G_JSON_Value *);
extern void G_json_free_serialized_string(char *);
extern void G_json_value_free(G_JSON_Value *);
#endif /* GRASS_GJSON_H */
G_json_value_t
struct json_value_t G_json_value_t
Definition gjson.c:34
G_json_object_t
struct json_object_t G_json_object_t
Definition gjson.c:30
G_json_array_t
struct json_array_t G_json_array_t
Definition gjson.c:32
G_json_value_free
void G_json_value_free(G_JSON_Value *)
Definition gjson.c:275
G_json_array
G_JSON_Array * G_json_array(const G_JSON_Value *)
Definition gjson.c:188
G_json_object_dotset_number
G_JSON_Status G_json_object_dotset_number(G_JSON_Object *, const char *, double)
Definition gjson.c:169
G_json_object_dotset_string
G_JSON_Status G_json_object_dotset_string(G_JSON_Object *, const char *, const char *)
Definition gjson.c:156
g_json_result_t
g_json_result_t
Definition gjson.h:25
G_JSONSuccess
@ G_JSONSuccess
Definition gjson.h:25
G_JSONFailure
@ G_JSONFailure
Definition gjson.h:25
G_json_object_get_array
G_JSON_Array * G_json_object_get_array(const G_JSON_Object *, const char *)
Definition gjson.c:79
G_json_array_get_string
const char * G_json_array_get_string(const G_JSON_Array *, size_t)
Definition gjson.c:201
G_json_object_set_null
G_JSON_Status G_json_object_set_null(G_JSON_Object *, const char *)
Definition gjson.c:150
G_json_array_append_boolean
G_JSON_Status G_json_array_append_boolean(G_JSON_Array *, int)
Definition gjson.c:239
G_json_serialize_to_string_pretty
char * G_json_serialize_to_string_pretty(const G_JSON_Value *)
Definition gjson.c:257
G_json_object_get_string
const char * G_json_object_get_string(const G_JSON_Object *, const char *)
Definition gjson.c:95
G_json_array_get_value
G_JSON_Value * G_json_array_get_value(const G_JSON_Array *, size_t)
Definition gjson.c:194
G_json_array_get_boolean
int G_json_array_get_boolean(const G_JSON_Array *, size_t)
Definition gjson.c:213
G_json_object_dotset_null
G_JSON_Status G_json_object_dotset_null(G_JSON_Object *object, const char *name)
Definition gjson.c:182
G_json_object_get_object
G_JSON_Object * G_json_object_get_object(const G_JSON_Object *, const char *)
Definition gjson.c:71
G_json_object_get_wrapping_value
G_JSON_Value * G_json_object_get_wrapping_value(const G_JSON_Object *)
Definition gjson.c:114
G_json_object_dotget_string
const char * G_json_object_dotget_string(G_JSON_Object *, const char *)
Definition gjson.c:163
G_json_array_get_number
double G_json_array_get_number(const G_JSON_Array *, size_t)
Definition gjson.c:207
G_JSON_Array
struct G_json_array_t G_JSON_Array
Definition gjson.h:11
G_JSON_Object
struct G_json_object_t G_JSON_Object
Definition gjson.h:10
G_json_object_get_value
G_JSON_Value * G_json_object_get_value(const G_JSON_Object *, const char *)
Definition gjson.c:87
G_json_object_set_value
G_JSON_Status G_json_object_set_value(G_JSON_Object *, const char *, G_JSON_Value *)
Definition gjson.c:121
g_json_value_type
g_json_value_type
Definition gjson.h:14
G_JSONArray
@ G_JSONArray
Definition gjson.h:20
G_JSONBoolean
@ G_JSONBoolean
Definition gjson.h:21
G_JSONString
@ G_JSONString
Definition gjson.h:17
G_JSONError
@ G_JSONError
Definition gjson.h:15
G_JSONObject
@ G_JSONObject
Definition gjson.h:19
G_JSONNumber
@ G_JSONNumber
Definition gjson.h:18
G_JSONNull
@ G_JSONNull
Definition gjson.h:16
G_json_object_get_boolean
int G_json_object_get_boolean(const G_JSON_Object *, const char *)
Definition gjson.c:108
G_json_object_dotget_number
double G_json_object_dotget_number(G_JSON_Object *, const char *)
Definition gjson.c:176
G_json_value_get_type
G_JSON_Value_Type G_json_value_get_type(const G_JSON_Value *value)
Definition gjson.c:53
G_JSON_Value
struct G_json_value_t G_JSON_Value
Definition gjson.h:12
G_json_value_get_object
G_JSON_Object * G_json_value_get_object(const G_JSON_Value *)
Definition gjson.c:59
G_json_object
G_JSON_Object * G_json_object(const G_JSON_Value *)
Definition gjson.c:65
G_json_object_set_string
G_JSON_Status G_json_object_set_string(G_JSON_Object *, const char *, const char *)
Definition gjson.c:129
G_json_array_append_null
G_JSON_Status G_json_array_append_null(G_JSON_Array *)
Definition gjson.c:245
G_json_value_init_object
G_JSON_Value * G_json_value_init_object(void)
Definition gjson.c:41
G_JSON_Status
int G_JSON_Status
Definition gjson.h:26
G_json_array_append_string
G_JSON_Status G_json_array_append_string(G_JSON_Array *, const char *)
Definition gjson.c:226
G_JSON_Value_Type
int G_JSON_Value_Type
Definition gjson.h:23
G_json_object_set_number
G_JSON_Status G_json_object_set_number(G_JSON_Object *, const char *, double)
Definition gjson.c:136
G_json_object_get_number
double G_json_object_get_number(const G_JSON_Object *, const char *)
Definition gjson.c:102
G_json_object_set_boolean
G_JSON_Status G_json_object_set_boolean(G_JSON_Object *, const char *, int)
Definition gjson.c:143
G_json_value_init_array
G_JSON_Value * G_json_value_init_array(void)
Definition gjson.c:47
G_json_free_serialized_string
void G_json_free_serialized_string(char *)
Definition gjson.c:269
G_json_serialize_to_string
char * G_json_serialize_to_string(const G_JSON_Value *)
Definition gjson.c:263
G_json_array_append_number
G_JSON_Status G_json_array_append_number(G_JSON_Array *, double)
Definition gjson.c:233
G_json_array_append_value
G_JSON_Status G_json_array_append_value(G_JSON_Array *, G_JSON_Value *)
Definition gjson.c:219
G_json_set_float_serialization_format
void G_json_set_float_serialization_format(const char *format)
Definition gjson.c:251
name
const char * name
Definition named_colr.c:6