91 if (free_function && pos->
data)
92 (*free_function)(pos->
data);
116 icl_list_t *head,
void *data,
int (*compare)(
void*,
void*))
123 for (node = head->
flink; node != NULL; node = node->
flink) {
126 if ((compare && (*compare)(node->
data, data) == 0))
128 else if (node->
data == data)
151 for (node = head; node != NULL;) {
152 tmpnode = node->
flink;
154 if (free_function != NULL && node->
data != NULL)
155 (*free_function)(node->
data);
178 while ((head=head->
flink))
244 if (pos && pos->
blink != NULL && pos != head &&
263 if (!head1 || !head2 || !head1->
blink || !head2->
flink)
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.
icl_list_t * icl_list_prepend(icl_list_t *head, void *data)
Insert a node at the beginning of this list.
icl_list_t * icl_list_new()
Create new linked list.
int icl_list_size(icl_list_t *head)
Get the number of items in this linked list.
int icl_list_destroy(icl_list_t *head, void(*free_function)(void *))
Frees the resources associated with this linked list.
icl_list_t * icl_list_append(icl_list_t *head, void *data)
Insert a node at the end of this list.
dependency free linked list
icl_list_t * icl_list_last(icl_list_t *head)
Get the last item in this linked list.
icl_list_t * icl_list_first(icl_list_t *head)
Get the first item in this linked list.
icl_list_t * icl_list_prev(icl_list_t *head, icl_list_t *pos)
Get the node preceding the specified node.
icl_list_t * icl_list_concat(icl_list_t *head1, icl_list_t *head2)
Concatenate two linked lists.
int icl_list_delete(icl_list_t *head, icl_list_t *pos, void(*free_function)(void *))
Delete the specified node.
icl_list_t * icl_list_insert(icl_list_t *head, icl_list_t *pos, void *data)
Insert a new node after the specified node.
struct icl_list_s * blink
struct icl_list_s * flink
icl_list_t * icl_list_next(icl_list_t *head, icl_list_t *pos)
Get the node following the specified node.