44 sj_set_error(
"failed to allocate data for new data pair in object");
74 if (!json)
return NULL;
76 if (!
object)
return NULL;
78 for (i = 0; i < count; i++)
91 if (!
object)
return NULL;
106 for (i = 0; i < count; i++)
122 for (i = 0; i < count; i++)
138 if (!value)
return NULL;
151 for (i = 0; i < count; i++)
void sj_string_concat(SJString *string1, SJString *string2)
append the contents of string2 to string1
SJString * sj_value_to_json_string(SJson *json)
convert the json value into a json string
this is the abstract container structure for all json data This structure may be an object...
SJson * sj_new()
allocate a new empty json object
void sj_list_append(SJList *list, void *data)
add an element to the end of the list
SJson * sj_object_get_value(SJson *object, char *key)
get the json value from an object given a key
void sj_object_insert(SJson *object, char *key, SJson *value)
insert data into a json object
char * sj_string_get_text(SJString *string)
get the text back from the string
SJson * sj_object_new()
allocate a new empty json object
char * sj_object_get_value_as_string(SJson *object, char *key)
void sj_pair_free(SJPair *pair)
void * sj_list_get_nth(SJList *list, unsigned int n)
get the data stored at the nth element
SJson * sj_object_copy(SJson *json)
an object is a list of key/value pairs
SJList * sj_list_new()
create a new list
SJPair * sj_pair_new(char *key, SJson *value)
void sj_set_error(char *er)
used internally to se the error message
a basic structure that keeps track of a string and its length Automatically grows to accomodate longe...
void sj_object_free(SJson *object)
free a previously allocated json object
SJString * sj_object_to_json_string(SJson *object)
get the json object back as a formatted json string
void sj_list_delete(SJList *list)
deletes a list that has been previously allocated
void sj_string_free(SJString *string)
free an SJString
SJson * sj_copy(SJson *json)
make a duplicate of a json structure.
int sj_object_check(SJson *json)
void sj_free(SJson *json)
frees a previously loaded json struct
int sj_string_cmp(SJString *string, char *s)
performs a strcmp on the string with the provided character array
unsigned int sj_list_get_count(SJList *list)
get the number of tracked elements in the list
void sj_string_append(SJString *string, char *buffer)
append the contents of buffer to the string
SJString * sj_string_new_text(char *s)
make a new string with the characters from array s