|
Simple JSON
0.1
A free simple json library for C
|

Go to the source code of this file.
Classes | |
| struct | SJListElementData |
| simple datatype abstracting the data held. More... | |
| struct | SJList |
| this is a simple list structure intended to hold an arbitrary number of elements list will automatically grow as space is needed to accomodate more elements More... | |
Functions | |
| SJList * | sj_list_new () |
| create a new list More... | |
| SJList * | sj_list_new_size (unsigned int count) |
| allocate a new empty list of size 'count' More... | |
| void | sj_list_delete (SJList *list) |
| deletes a list that has been previously allocated More... | |
| void * | sj_list_get_nth (SJList *list, unsigned int n) |
| get the data stored at the nth element More... | |
| void | sj_list_append (SJList *list, void *data) |
| add an element to the end of the list More... | |
| SJList * | sj_list_insert (SJList *list, void *data, unsigned int n) |
| instert a new element at the position provided More... | |
| SJList * | sj_list_delete_nth (SJList *list, unsigned int n) |
| delete the element at the nth position in the list More... | |
| int | sj_list_delete_data (SJList *list, void *data) |
| delete the first element in the list pointing to the address of data More... | |
| unsigned int | sj_list_get_count (SJList *list) |
| get the number of tracked elements in the list More... | |
| void sj_list_append | ( | SJList * | list, |
| void * | data | ||
| ) |
add an element to the end of the list
| list | the list to add to |
| data | the data to assign to the new element |
Definition at line 83 of file simple_json_list.c.
| void sj_list_delete | ( | SJList * | list | ) |
deletes a list that has been previously allocated
| list | the list to delete; |
Definition at line 7 of file simple_json_list.c.
| int sj_list_delete_data | ( | SJList * | list, |
| void * | data | ||
| ) |
delete the first element in the list pointing to the address of data
| list | the list to delete the element from |
| data | used to match against which element to delete |
Definition at line 148 of file simple_json_list.c.
delete the element at the nth position in the list
| list | the list to delete out of |
| n | the element to delete. This is no-op if the nth element is beyond the scope of the list (event is logged) |
Definition at line 170 of file simple_json_list.c.
| unsigned int sj_list_get_count | ( | SJList * | list | ) |
get the number of tracked elements in the list
| list | the list the check |
Definition at line 192 of file simple_json_list.c.
| void* sj_list_get_nth | ( | SJList * | list, |
| unsigned int | n | ||
| ) |
get the data stored at the nth element
| list | the list to pull data from |
| n | which element to look out |
Definition at line 49 of file simple_json_list.c.
instert a new element at the position provided
| list | the list to insert into |
| data | the data to assin to the new element |
Definition at line 109 of file simple_json_list.c.
| SJList* sj_list_new | ( | ) |
create a new list
Definition at line 17 of file simple_json_list.c.
| SJList* sj_list_new_size | ( | unsigned int | count | ) |
allocate a new empty list of size 'count'
| count | how many elements you wish to support in this list. |
Definition at line 22 of file simple_json_list.c.