17#ifndef ZEPHYR_INCLUDE_SYS_SFLIST_H_
18#define ZEPHYR_INCLUDE_SYS_SFLIST_H_
69#define SYS_SFLIST_FOR_EACH_NODE(__sl, __sn) \
70 Z_GENLIST_FOR_EACH_NODE(sflist, __sl, __sn)
92#define SYS_SFLIST_ITERATE_FROM_NODE(__sl, __sn) \
93 Z_GENLIST_ITERATE_FROM_NODE(sflist, __sl, __sn)
111#define SYS_SFLIST_FOR_EACH_NODE_SAFE(__sl, __sn, __sns) \
112 Z_GENLIST_FOR_EACH_NODE_SAFE(sflist, __sl, __sn, __sns)
122#define SYS_SFLIST_CONTAINER(__ln, __cn, __n) \
123 Z_GENLIST_CONTAINER(__ln, __cn, __n)
132#define SYS_SFLIST_PEEK_HEAD_CONTAINER(__sl, __cn, __n) \
133 Z_GENLIST_PEEK_HEAD_CONTAINER(sflist, __sl, __cn, __n)
142#define SYS_SFLIST_PEEK_TAIL_CONTAINER(__sl, __cn, __n) \
143 Z_GENLIST_PEEK_TAIL_CONTAINER(sflist, __sl, __cn, __n)
151#define SYS_SFLIST_PEEK_NEXT_CONTAINER(__cn, __n) \
152 Z_GENLIST_PEEK_NEXT_CONTAINER(sflist, __cn, __n)
168#define SYS_SFLIST_FOR_EACH_CONTAINER(__sl, __cn, __n) \
169 Z_GENLIST_FOR_EACH_CONTAINER(sflist, __sl, __cn, __n)
186#define SYS_SFLIST_FOR_EACH_CONTAINER_SAFE(__sl, __cn, __cns, __n) \
187 Z_GENLIST_FOR_EACH_CONTAINER_SAFE(sflist, __sl, __cn, __cns, __n)
208#define SYS_SFLIST_STATIC_INIT(ptr_to_list) {NULL, NULL}
209#define SYS_SFLIST_FLAGS_MASK 0x3UL
213 return (
sys_sfnode_t *)(node->next_and_flags & ~SYS_SFLIST_FLAGS_MASK);
218static inline void z_sfnode_next_set(
sys_sfnode_t *parent,
223 parent->next_and_flags = cur_flags | (
unative_t)child;
291 node->next_and_flags =
flags;
307 node->next_and_flags = (
unative_t)(z_sfnode_next_peek(node)) |
flags;
323Z_GENLIST_IS_EMPTY(sflist)
336Z_GENLIST_PEEK_NEXT_NO_CHECK(sflist, sfnode)
347Z_GENLIST_PEEK_NEXT(sflist, sfnode)
360Z_GENLIST_PREPEND(sflist, sfnode)
373Z_GENLIST_APPEND(sflist, sfnode)
389 void *head,
void *tail);
391Z_GENLIST_APPEND_LIST(sflist, sfnode)
405Z_GENLIST_MERGE_LIST(sflist, sfnode)
420Z_GENLIST_INSERT(sflist, sfnode)
434Z_GENLIST_GET_NOT_EMPTY(sflist, sfnode)
447Z_GENLIST_GET(sflist, sfnode)
463Z_GENLIST_REMOVE(sflist, sfnode)
478Z_GENLIST_FIND_AND_REMOVE(sflist, sfnode)
static sys_sfnode_t * sys_sflist_get_not_empty(sys_sflist_t *list)
Fetch and remove the first node of the given list.
Definition: sflist.h:434
static uint8_t sys_sfnode_flags_get(sys_sfnode_t *node)
Fetch flags value for a particular sfnode.
Definition: sflist.h:270
static sys_sfnode_t * sys_sflist_get(sys_sflist_t *list)
Fetch and remove the first node of the given list.
Definition: sflist.h:447
#define SYS_SFLIST_FLAGS_MASK
Definition: sflist.h:209
static sys_sfnode_t * sys_sflist_peek_next(sys_sfnode_t *node)
Peek the next node from current node.
Definition: sflist.h:347
static void sys_sflist_remove(sys_sflist_t *list, sys_sfnode_t *prev_node, sys_sfnode_t *node)
Remove a node.
Definition: sflist.h:463
static void sys_sflist_merge_sflist(sys_sflist_t *list, sys_sflist_t *list_to_append)
merge two sflists, appending the second one to the first
Definition: sflist.h:405
static sys_sfnode_t * sys_sflist_peek_head(sys_sflist_t *list)
Peek the first node from the list.
Definition: sflist.h:243
static void sys_sflist_append(sys_sflist_t *list, sys_sfnode_t *node)
Append a node to the given list.
Definition: sflist.h:373
static void sys_sflist_prepend(sys_sflist_t *list, sys_sfnode_t *node)
Prepend a node to the given list.
Definition: sflist.h:360
static void sys_sfnode_flags_set(sys_sfnode_t *node, uint8_t flags)
Set flags value for an sflist node.
Definition: sflist.h:304
static void sys_sflist_insert(sys_sflist_t *list, sys_sfnode_t *prev, sys_sfnode_t *node)
Insert a node to the given list.
Definition: sflist.h:420
static void sys_sflist_init(sys_sflist_t *list)
Initialize a list.
Definition: sflist.h:202
static sys_sfnode_t * sys_sflist_peek_next_no_check(sys_sfnode_t *node)
Peek the next node from current node, node is not NULL.
Definition: sflist.h:336
static void sys_sflist_append_list(sys_sflist_t *list, void *head, void *tail)
Append a list to the given list.
Definition: sflist.h:391
static sys_sfnode_t * sys_sflist_peek_tail(sys_sflist_t *list)
Peek the last node from the list.
Definition: sflist.h:255
static bool sys_sflist_is_empty(sys_sflist_t *list)
Test if the given list is empty.
Definition: sflist.h:323
static bool sys_sflist_find_and_remove(sys_sflist_t *list, sys_sfnode_t *node)
Find and remove a node from a list.
Definition: sflist.h:478
static void sys_sfnode_init(sys_sfnode_t *node, uint8_t flags)
Initialize an sflist node.
Definition: sflist.h:288
flags
Definition: http_parser.h:131
struct _sfnode sys_sfnode_t
Definition: sflist.h:39
uint32_t unative_t
Definition: sflist.h:32
struct _sflist sys_sflist_t
Definition: sflist.h:46
__UINT32_TYPE__ uint32_t
Definition: stdint.h:60
__UINT64_TYPE__ uint64_t
Definition: stdint.h:61
__UINT8_TYPE__ uint8_t
Definition: stdint.h:58