Simple JSON  0.1
A free simple json library for C
simple_json_value.h File Reference
Include dependency graph for simple_json_value.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

struct  SJson_S
 this is the abstract container structure for all json data This structure may be an object, array, string, null, boolean value, integer or float More...
 

Typedefs

typedef struct SJson_S SJson
 this is the abstract container structure for all json data This structure may be an object, array, string, null, boolean value, integer or float More...
 

Enumerations

enum  SJValueTypes { SJVT_NULL, SJVT_Object, SJVT_Array, SJVT_String }
 

Functions

SJsonsj_new ()
 allocate a new empty json object More...
 
void sj_free (SJson *sjs)
 frees a previously loaded json struct More...
 
SJsonsj_string_to_value (SJString *string)
 make a jason value object out of a string More...
 
SJStringsj_string_to_json_string (SJson *string)
 get the contents of the string back formatted and escaped for json More...
 
SJStringsj_value_to_json_string (SJson *json)
 convert the json value into a json string More...
 

Typedef Documentation

typedef struct SJson_S SJson

this is the abstract container structure for all json data This structure may be an object, array, string, null, boolean value, integer or float

Enumeration Type Documentation

Enumerator
SJVT_NULL 
SJVT_Object 
SJVT_Array 
SJVT_String 

Definition at line 7 of file simple_json_value.h.

Function Documentation

void sj_free ( SJson sjs)

frees a previously loaded json struct

Definition at line 116 of file simple_json.c.

SJson* sj_new ( )

allocate a new empty json object

Returns
NULL on error or a new json object

Definition at line 96 of file simple_json.c.

SJString* sj_string_to_json_string ( SJson string)

get the contents of the string back formatted and escaped for json

Parameters
stringthe json string to conver
Returns
NULL on error or the converted string

Definition at line 236 of file simple_json_string.c.

SJson* sj_string_to_value ( SJString string)

make a jason value object out of a string

Parameters
stringthe string to convert
Note
the original string is put into the SJson object and is no longer owned by you do not free it!
Returns
NULL on error or the newly allocated and set SJson object

Definition at line 170 of file simple_json_string.c.

SJString* sj_value_to_json_string ( SJson json)

convert the json value into a json string

Parameters
jsonthe value to convert
Returns
NULL on error or the json string

Definition at line 156 of file simple_json.c.