PULSAR  0.1
Parallel Unified Linear Algebra with Systolic Arrays
 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Macros
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*));
35 
36 int icl_list_delete(icl_list_t *, icl_list_t *, void (*)(void *));
37 int icl_list_destroy(icl_list_t *, void (*)(void*));
39 
40 #define icl_list_foreach(list, ptr) \
41  for (ptr = icl_list_first(list); ptr != NULL; ptr = icl_list_next(list, ptr))
42 
43 #ifdef __cplusplus
44 }
45 #endif
46 
47 #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:283
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:171
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:144
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:297
icl_list_t * icl_list_last(icl_list_t *head)
Get the last item in this linked list.
Definition: icl_list.c:208
icl_list_t * icl_list_first(icl_list_t *head)
Get the first item in this linked list.
Definition: icl_list.c:192
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:242
icl_list_t * icl_list_concat(icl_list_t *head1, icl_list_t *head2)
Concatenate two linked lists.
Definition: icl_list.c:261
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:225