Lely core libraries 2.3.4
dllist.c
Go to the documentation of this file.
1
24#include "util.h"
25#define LELY_UTIL_DLLIST_INLINE extern inline
26#include <lely/util/dllist.h>
27
28#include <assert.h>
29
30int
31dllist_contains(const struct dllist *list, const struct dlnode *node)
32{
33 assert(list);
34
35 if (!node)
36 return 0;
37
38 dllist_foreach (list, node_) {
39 if (node_ == node)
40 return 1;
41 }
42
43 return 0;
44}
int dllist_contains(const struct dllist *list, const struct dlnode *node)
Checks if a node is part of a doubly-linked list.
Definition dllist.c:31
This header file is part of the utilities library; it contains the doubly-linked list declarations.
#define dllist_foreach(list, node)
Iterates in order over each node in a doubly-linked list.
Definition dllist.h:232
This is the internal header file of the utilities library.
A doubly-linked list.
Definition dllist.h:54
A node in a doubly-linked list.
Definition dllist.h:40