TeoCCl library  0.1.7
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Pages
linked_list.h
Go to the documentation of this file.
1 
11 #ifndef LINKED_LIST_H
12 #define LINKED_LIST_H
13 
14 #ifdef __cplusplus
15 extern "C" {
16 #endif
17 
18 typedef struct ccl_linked_list ccl_linked_list_t;
19 
20 typedef struct node iter_llist_t;
21 
22 ccl_linked_list_t *cclLinkedListInit(const size_t data_size);
23 int cclLinkedListCount(const ccl_linked_list_t *llist);
24 int cclLinkedListEmpty(const ccl_linked_list_t *llist);
25 
29 
30 int cclLinkedListAddFirst(ccl_linked_list_t *llist, void *const data);
31 int cclLinkedListAddLast(ccl_linked_list_t *llist, void *const data);
32 int cclLinkedListAddAt(ccl_linked_list_t *llist, void *const data, const int idx);
33 
34 int cclLinkedListGetFirst(ccl_linked_list_t *llist, void *const data);
35 int cclLinkedListGetLast(ccl_linked_list_t *llist, void *const data);
36 int cclLinkedListGetAt(ccl_linked_list_t *llist, const int idx, void *const data);
37 
38 int cclLinkedListUpdateFirst(ccl_linked_list_t *llist, void *const data);
39 int cclLinkedListUpdateLast(ccl_linked_list_t *llist, void *const data);
40 int cclLinkedListUpdateAt(ccl_linked_list_t *llist, const int idx, void *const data);
41 
44 int cclLinkedListRemoveAt(ccl_linked_list_t *llist, const int idx);
45 
48 
49 //find function
50 
51 void cclSortLinkedListAdd(ccl_linked_list_t *llist, void *data, int (*cmp)(const void *, const void *));
52 
54 void cclSortLinkedListMerge(ccl_linked_list_t **f_list, ccl_linked_list_t *s_list, int (*cmp)(const void *, const void *));
55 
56 
57 #ifdef __cplusplus
58 }
59 #endif
60 
61 #endif
void cclSortLinkedListMerge(ccl_linked_list_t **f_list, ccl_linked_list_t *s_list, int(*cmp)(const void *, const void *))
Definition: linked_list.c:264
int cclLinkedListCount(const ccl_linked_list_t *llist)
Definition: linked_list.c:62
int cclLinkedListGetAt(ccl_linked_list_t *llist, const int idx, void *const data)
Definition: linked_list.c:167
struct ccl_linked_list ccl_linked_list_t
Definition: linked_list.h:18
int cclLinkedListEmpty(const ccl_linked_list_t *llist)
Definition: linked_list.c:67
void cclLinkedListClear(ccl_linked_list_t *llist)
Definition: linked_list.c:42
int cclLinkedListUpdateFirst(ccl_linked_list_t *llist, void *const data)
Definition: linked_list.c:179
iter_llist_t * cclLinkedListIterNext(iter_llist_t *it)
Definition: linked_list.c:103
int cclLinkedListAddAt(ccl_linked_list_t *llist, void *const data, const int idx)
Definition: linked_list.c:122
void cclSortLinkedListAdd(ccl_linked_list_t *llist, void *data, int(*cmp)(const void *, const void *))
Definition: linked_list.c:237
int cclLinkedListAddLast(ccl_linked_list_t *llist, void *const data)
Definition: linked_list.c:117
void cclLinkedListDestroy(ccl_linked_list_t *llist)
Definition: linked_list.c:56
int cclLinkedListRemoveFirst(ccl_linked_list_t *llist)
Definition: linked_list.c:201
int cclLinkedListAddFirst(ccl_linked_list_t *llist, void *const data)
Definition: linked_list.c:112
int cclLinkedListRemoveLast(ccl_linked_list_t *llist)
Definition: linked_list.c:206
void cclLinkedListConcat(ccl_linked_list_t **f_list, ccl_linked_list_t *s_list)
Definition: linked_list.c:251
int cclLinkedListGetFirst(ccl_linked_list_t *llist, void *const data)
Definition: linked_list.c:157
void * cclLinkedListIterData(iter_llist_t *it)
Definition: linked_list.c:107
int cclLinkedListUpdateAt(ccl_linked_list_t *llist, const int idx, void *const data)
Definition: linked_list.c:189
int cclLinkedListRemoveAt(ccl_linked_list_t *llist, const int idx)
Definition: linked_list.c:211
iter_llist_t * cclLinkedListGetIter(ccl_linked_list_t *llist)
Definition: linked_list.c:98
struct node iter_llist_t
Definition: linked_list.h:20
ccl_linked_list_t * cclLinkedListInit(const size_t data_size)
Definition: linked_list.c:25
int cclLinkedListUpdateLast(ccl_linked_list_t *llist, void *const data)
Definition: linked_list.c:184
int cclLinkedListGetLast(ccl_linked_list_t *llist, void *const data)
Definition: linked_list.c:162