PULSAR  1.0.0
Parallel Ultra Light Systolic Array Runtime
 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Macros Groups
icl_list.h
Go to the documentation of this file.
1 
12 #ifndef ICL_LIST_H
13 #define ICL_LIST_H
14 
15 #ifdef __cplusplus
16 extern "C" {
17 #endif
18 
19 typedef struct icl_list_s {
20  void *data;
21  struct icl_list_s *flink;
22  struct icl_list_s *blink;
23 } icl_list_t;
24 
27 icl_list_t* icl_list_search(icl_list_t *, void *, int (*)(void*, void*));
28 icl_list_t* icl_list_isort(icl_list_t *head, void *data, int (*)(void*, void*));
36 
37 int icl_list_delete(icl_list_t *, icl_list_t *, void (*)(void *));
38 int icl_list_destroy(icl_list_t *, void (*)(void*));
40 
41 #define icl_list_foreach(list, ptr) \
42  for (ptr = icl_list_first(list); ptr != NULL; ptr = icl_list_next(list, ptr))
43 
44 #ifdef __cplusplus
45 }
46 #endif
47 
48 #endif /* ICL_LIST_H */
icl_list_t * icl_list_search(icl_list_t *head, void *data, int(*compare)(void *, void *))
Finds a data item in the specified linked list.
Definition: icl_list.c:115
icl_list_t * icl_list_prepend(icl_list_t *head, void *data)
Insert a node at the beginning of this list.
Definition: icl_list.c:312
icl_list_t * icl_list_new()
Create new linked list.
Definition: icl_list.c:23
int icl_list_size(icl_list_t *head)
Get the number of items in this linked list.
Definition: icl_list.c:200
void * data
Definition: icl_list.h:20
int icl_list_destroy(icl_list_t *head, void(*free_function)(void *))
Frees the resources associated with this linked list.
Definition: icl_list.c:173
icl_list_t * icl_list_append(icl_list_t *head, void *data)
Insert a node at the end of this list.
Definition: icl_list.c:326
icl_list_t * icl_list_last(icl_list_t *head)
Get the last item in this linked list.
Definition: icl_list.c:237
icl_list_t * icl_list_first(icl_list_t *head)
Get the first item in this linked list.
Definition: icl_list.c:221
icl_list_t * icl_list_prev(icl_list_t *head, icl_list_t *pos)
Get the node preceding the specified node.
Definition: icl_list.c:271
icl_list_t * icl_list_isort(icl_list_t *head, void *data, int(*compare)(void *, void *))
Insert data into a sorted list. Does not support direct comparison of pointers.
Definition: icl_list.c:145
icl_list_t * icl_list_concat(icl_list_t *head1, icl_list_t *head2)
Concatenate two linked lists.
Definition: icl_list.c:290
int icl_list_delete(icl_list_t *head, icl_list_t *pos, void(*free_function)(void *))
Delete the specified node.
Definition: icl_list.c:83
icl_list_t * icl_list_insert(icl_list_t *head, icl_list_t *pos, void *data)
Insert a new node after the specified node.
Definition: icl_list.c:49
struct icl_list_s * blink
Definition: icl_list.h:22
struct icl_list_s * flink
Definition: icl_list.h:21
struct icl_list_s icl_list_t
icl_list_t * icl_list_next(icl_list_t *head, icl_list_t *pos)
Get the node following the specified node.
Definition: icl_list.c:254