VSF Documented
Main Page
Related Pages
Topics
Namespaces
Data Structures
Files
File List
Globals
source
shell
sys
linux
include
linux
llist.h
Go to the documentation of this file.
1
#ifndef __VSF_LINUX_LLIST_H__
2
#define __VSF_LINUX_LLIST_H__
3
4
#include "
utilities/vsf_utilities.h
"
5
6
#ifdef __cplusplus
7
extern
"C"
{
8
#endif
9
10
struct
llist_node
{
11
struct
llist_node
*
next
;
12
};
13
14
struct
llist_head
{
15
struct
llist_node
*
first
;
16
};
17
18
#define LLIST_HEAD_INIT(name) { NULL }
19
#define LLIST_HEAD(name) struct llist_head name = LLIST_HEAD_INIT(name)
20
21
static
inline
void
init_llist_head(
struct
llist_head
*list)
22
{
23
list->
first
=
NULL
;
24
}
25
26
#define llist_entry(p, t, m) vsf_container_of(p, t, m)
27
#define llist_for_each(pos, node) \
28
for ((pos) = (node); pos; (pos) = (pos)->next)
29
#define llist_for_each_safe(pos, n, node) \
30
for ((pos) = (node); (pos) && ((n) = (pos)->next, true); (pos) = (n))
31
#define llist_for_each_entry(pos, node, member) \
32
for ((pos) = llist_entry((node), typeof(*(pos)), member); \
33
member_address_is_nonnull(pos, member); \
34
(pos) = llist_entry((pos)->member.next, typeof(*(pos)), member))
35
#define llist_for_each_entry_safe(pos, n, node, member) \
36
for (pos = llist_entry((node), typeof(*pos), member); \
37
member_address_is_nonnull(pos, member) && \
38
(n = llist_entry(pos->member.next, typeof(*n), member), true); \
39
pos = n)
40
41
static
inline
bool
llist_empty(
const
struct
llist_head
*
head
)
42
{
43
return
head
->first ==
NULL
;
44
}
45
46
static
inline
struct
llist_node
* llist_next(
struct
llist_node
*node)
47
{
48
return
node->
next
;
49
}
50
51
#ifdef __cplusplus
52
}
53
#endif
54
55
#endif
NULL
#define NULL
Definition
lvgl.h:26
llist_head
Definition
llist.h:14
llist_head::first
struct llist_node * first
Definition
llist.h:15
llist_node
Definition
llist.h:10
llist_node::next
struct llist_node * next
Definition
llist.h:11
head
uint16_t head
Definition
vsf_queue.h:632
vsf_utilities.h
Generated by
1.9.8