Simple JSON  0.1
A free simple json library for C
simple_json_value.h
Go to the documentation of this file.
1 #ifndef __SIMPLE_JSON_VALUE_H__
2 #define __SIMPLE_JSON_VALUE_H__
3 
4 #include "simple_json_list.h"
5 #include "simple_json_string.h"
6 
7 typedef enum
8 {
14 
19 typedef struct SJson_S
20 {
22  union
23  {
26  }v;
27  SJString *(*get_string)(struct SJson_S *json);
28  void (*json_free)(struct SJson_S *json);
29  struct SJson_S *(*copy)(struct SJson_S *json);
30 }SJson;
31 
36 SJson *sj_new();
37 
38 /*forward declaration, documented in simple_json.h*/
39 void sj_free(SJson *sjs);
40 
48 
55 
62 
63 #endif
SJString * sj_string_to_json_string(SJson *string)
get the contents of the string back formatted and escaped for json
this is the abstract container structure for all json data This structure may be an object...
SJValueTypes
struct SJson_S SJson
this is the abstract container structure for all json data This structure may be an object...
SJValueTypes sjtype
SJson * sj_new()
allocate a new empty json object
Definition: simple_json.c:96
void(* json_free)(struct SJson_S *json)
this is a simple list structure intended to hold an arbitrary number of elements list will automatica...
union SJson_S::@0 v
SJson * sj_string_to_value(SJString *string)
make a jason value object out of a string
a basic structure that keeps track of a string and its length Automatically grows to accomodate longe...
SJList * array
SJString * string
void sj_free(SJson *sjs)
frees a previously loaded json struct
Definition: simple_json.c:116
SJString * sj_value_to_json_string(SJson *json)
convert the json value into a json string
Definition: simple_json.c:156