Simple JSON  0.1
A free simple json library for C
simple_json_list.h
Go to the documentation of this file.
1 #ifndef __SIMPLE_JSON_LIST_H__
2 #define __SIMPLE_JSON_LIST_H__
3 
7 typedef struct
8 {
9  void *data;
11 
16 typedef struct
17 {
19  unsigned int size;
20  unsigned int count;
21 }SJList;
22 
28 
34 SJList *sj_list_new_size(unsigned int count);
35 
40 void sj_list_delete(SJList *list);
41 
48 void *sj_list_get_nth(SJList *list,unsigned int n);
49 
55 void sj_list_append(SJList *list,void *data);
56 
63 SJList *sj_list_insert(SJList *list,void *data,unsigned int n);
64 
71 SJList *sj_list_delete_nth(SJList *list,unsigned int n);
72 
80 int sj_list_delete_data(SJList *list,void *data);
81 
87 unsigned int sj_list_get_count(SJList *list);
88 
89 #endif
SJList * sj_list_insert(SJList *list, void *data, unsigned int n)
instert a new element at the position provided
unsigned int sj_list_get_count(SJList *list)
get the number of tracked elements in the list
simple datatype abstracting the data held.
void sj_list_append(SJList *list, void *data)
add an element to the end of the list
void * sj_list_get_nth(SJList *list, unsigned int n)
get the data stored at the nth element
SJListElementData * elements
SJList * sj_list_delete_nth(SJList *list, unsigned int n)
delete the element at the nth position in the list
int sj_list_delete_data(SJList *list, void *data)
delete the first element in the list pointing to the address of data
void sj_list_delete(SJList *list)
deletes a list that has been previously allocated
SJList * sj_list_new()
create a new list
this is a simple list structure intended to hold an arbitrary number of elements list will automatica...
unsigned int size
SJList * sj_list_new_size(unsigned int count)
allocate a new empty list of size 'count'
unsigned int count