NimBLE-Arduino 2.1.2
|
Single-linked list implementation. More...
Go to the source code of this file.
Macros | |
#define | SYS_SLIST_FOR_EACH_NODE(__sl, __sn) |
Provide the primitive to iterate on a list Note: the loop is unsafe and thus __sn should not be removed. | |
#define | SYS_SLIST_ITERATE_FROM_NODE(__sl, __sn) |
Provide the primitive to iterate on a list, from a node in the list Note: the loop is unsafe and thus __sn should not be removed. | |
#define | SYS_SLIST_FOR_EACH_NODE_SAFE(__sl, __sn, __sns) |
Provide the primitive to safely iterate on a list Note: __sn can be removed, it will not break the loop. | |
#define | SYS_SLIST_FOR_EACH_CONTAINER(__sl, __cn, __n) |
Provide the primitive to iterate on a list under a container Note: the loop is unsafe and thus __cn should not be detached. | |
#define | SYS_SLIST_FOR_EACH_CONTAINER_SAFE(__sl, __cn, __cns, __n) |
Provide the primitive to safely iterate on a list under a container Note: __cn can be detached, it will not break the loop. | |
Single-linked list implementation.
Single-linked list implementation using inline macros/functions. This API is not thread safe, and thus if a list is used across threads, calls to functions must be protected with synchronization primitives.
#define SYS_SLIST_FOR_EACH_CONTAINER | ( | __sl, | |
__cn, | |||
__n | |||
) |
Provide the primitive to iterate on a list under a container Note: the loop is unsafe and thus __cn should not be detached.
User MUST add the loop statement curly braces enclosing its own code:
SYS_SLIST_FOR_EACH_CONTAINER(l, c, n) { <user code> }
__sl | A pointer on a sys_slist_t to iterate on |
__cn | A pointer to peek each entry of the list |
__n | The field name of sys_node_t within the container struct |
#define SYS_SLIST_FOR_EACH_CONTAINER_SAFE | ( | __sl, | |
__cn, | |||
__cns, | |||
__n | |||
) |
Provide the primitive to safely iterate on a list under a container Note: __cn can be detached, it will not break the loop.
User MUST add the loop statement curly braces enclosing its own code:
SYS_SLIST_FOR_EACH_NODE_SAFE(l, c, cn, n) { <user code> }
__sl | A pointer on a sys_slist_t to iterate on |
__cn | A pointer to peek each entry of the list |
__cns | A pointer for the loop to run safely |
__n | The field name of sys_node_t within the container struct |
#define SYS_SLIST_FOR_EACH_NODE | ( | __sl, | |
__sn | |||
) |
Provide the primitive to iterate on a list Note: the loop is unsafe and thus __sn should not be removed.
User MUST add the loop statement curly braces enclosing its own code:
SYS_SLIST_FOR_EACH_NODE(l, n) { <user code> }
This and other SYS_SLIST_*() macros are not thread safe.
__sl | A pointer on a sys_slist_t to iterate on |
__sn | A sys_snode_t pointer to peek each node of the list |
#define SYS_SLIST_FOR_EACH_NODE_SAFE | ( | __sl, | |
__sn, | |||
__sns | |||
) |
Provide the primitive to safely iterate on a list Note: __sn can be removed, it will not break the loop.
User MUST add the loop statement curly braces enclosing its own code:
SYS_SLIST_FOR_EACH_NODE_SAFE(l, n, s) { <user code> }
This and other SYS_SLIST_*() macros are not thread safe.
__sl | A pointer on a sys_slist_t to iterate on |
__sn | A sys_snode_t pointer to peek each node of the list |
__sns | A sys_snode_t pointer for the loop to run safely |
#define SYS_SLIST_ITERATE_FROM_NODE | ( | __sl, | |
__sn | |||
) |
Provide the primitive to iterate on a list, from a node in the list Note: the loop is unsafe and thus __sn should not be removed.
User MUST add the loop statement curly braces enclosing its own code:
SYS_SLIST_ITERATE_FROM_NODE(l, n) { <user code> }
Like SYS_SLIST_FOR_EACH_NODE(), but __dn already contains a node in the list where to start searching for the next entry from. If NULL, it starts from the head.
This and other SYS_SLIST_*() macros are not thread safe.
__sl | A pointer on a sys_slist_t to iterate on |
__sn | A sys_snode_t pointer to peek each node of the list it contains the starting node, or NULL to start from the head |