Simple JSON
0.1
A free simple json library for C
|
#include <stdio.h>
#include <string.h>
#include <stdlib.h>
#include "simple_json_list.h"
#include "simple_json_error.h"
Go to the source code of this file.
Functions | |
void | sj_list_delete (SJList *list) |
deletes a list that has been previously allocated More... | |
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_get_nth (SJList *list, unsigned int n) |
get the data stored at the nth element More... | |
SJList * | sj_list_expand (SJList *list) |
void | sj_list_append (SJList *list, void *data) |
add an element to the end of the list More... | |
SJList * | sj_list_prepend (SJList *list, void *data) |
SJList * | sj_list_insert (SJList *list, void *data, unsigned int n) |
instert a new element at the position provided More... | |
SJList * | sj_list_delete_first (SJList *list) |
SJList * | sj_list_delete_last (SJList *list) |
int | sj_list_delete_data (SJList *list, void *data) |
delete the first element in the list pointing to the address of data More... | |
SJList * | sj_list_delete_nth (SJList *list, unsigned int n) |
delete the element at the nth position in the list More... | |
unsigned int | sj_list_get_count (SJList *list) |
get the number of tracked elements in the list More... | |
void | sj_list_foreach (SJList *list, void(*function)(void *data, void *context), void *contextData) |
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.
Definition at line 133 of file simple_json_list.c.
Definition at line 138 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.
Definition at line 60 of file simple_json_list.c.
void sj_list_foreach | ( | SJList * | list, |
void(*)(void *data, void *context) | function, | ||
void * | contextData | ||
) |
Definition at line 198 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.
Definition at line 104 of file simple_json_list.c.