Simple JSON for C
/home/jakob/git/jakgra/simple_json_for_c/s_json.h
Go to the documentation of this file.
1 #ifndef s_json_h__
2 #define s_json_h__
3 
4 #include <stddef.h>
5 
14 typedef enum {
15  S_JSON_OK = 0,
24 } s_json_err_t;
25 
29 typedef struct s_json s_json_t;
30 
47 s_json_t *s_json_init(const char *json_string, size_t json_string_len,
48  s_json_err_t *rc);
49 
66 int s_json_int(s_json_t *json, const char *json_path, int root_object_index,
67  s_json_err_t *rc);
68 
72 long s_json_long(s_json_t *json, const char *json_path, int root_object_index,
73  s_json_err_t *rc);
74 
78 double s_json_double(s_json_t *json, const char *json_path,
79  int root_object_index, s_json_err_t *rc);
80 
84 float s_json_float(s_json_t *json, const char *json_path, int root_object_index,
85  s_json_err_t *rc);
86 
91 int s_json_boolean(s_json_t *json, const char *json_path, int root_object_index,
92  s_json_err_t *rc);
93 
100 char *s_json_string(s_json_t *json, const char *json_path,
101  int root_object_index, s_json_err_t *rc);
102 
119 void s_json_string_raw(const char **string_raw, size_t *string_raw_length,
120  s_json_t *json, const char *json_path,
121  int root_object_index, s_json_err_t *rc);
122 
131 int s_json_object(s_json_t *json, const char *json_path, int root_object_index,
132  s_json_err_t *rc);
133 
138 void s_json_cleanup(s_json_t *json);
139 
140 #endif
void s_json_string_raw(const char **string_raw, size_t *string_raw_length, s_json_t *json, const char *json_path, int root_object_index, s_json_err_t *rc)
Definition: s_json.h:15
int s_json_int(s_json_t *json, const char *json_path, int root_object_index, s_json_err_t *rc)
Definition: s_json.h:16
int s_json_object(s_json_t *json, const char *json_path, int root_object_index, s_json_err_t *rc)
Definition: s_json.h:21
s_json_t * s_json_init(const char *json_string, size_t json_string_len, s_json_err_t *rc)
void s_json_cleanup(s_json_t *json)
struct s_json s_json_t
Definition: s_json.h:29
s_json_err_t
Definition: s_json.h:14
long s_json_long(s_json_t *json, const char *json_path, int root_object_index, s_json_err_t *rc)
Definition: s_json.h:22
Definition: s_json.h:18
double s_json_double(s_json_t *json, const char *json_path, int root_object_index, s_json_err_t *rc)
char * s_json_string(s_json_t *json, const char *json_path, int root_object_index, s_json_err_t *rc)
float s_json_float(s_json_t *json, const char *json_path, int root_object_index, s_json_err_t *rc)
Definition: s_json.h:19
Definition: s_json.h:20
int s_json_boolean(s_json_t *json, const char *json_path, int root_object_index, s_json_err_t *rc)