Lines Matching +full:- +full:a
4 * SPDX-License-Identifier: Apache-2.0
9 * @defgroup flagged-single-linked-list_apis Flagged Single-linked list
12 * @brief Flagged single-linked list implementation.
14 * Similar to @ref single-linked-list_apis with the added ability to define
18 * Flagged single-linked list implementation using inline macros/functions.
19 * This API is not thread safe, and thus if a list is used across threads,
43 /** Flagged single-linked list node structure. */
53 /** Flagged single-linked list structure. */
57 * @brief Provide the primitive to iterate on a list
68 * @param __sl A pointer on a sys_sflist_t to iterate on
69 * @param __sn A sys_sfnode_t pointer to peek each node of the list
75 * @brief Provide the primitive to iterate on a list, from a node in the list
84 * Like SYS_SFLIST_FOR_EACH_NODE(), but __dn already contains a node in the list
90 * @param __sl A pointer on a sys_sflist_t to iterate on
91 * @param __sn A sys_sfnode_t pointer to peek each node of the list
98 * @brief Provide the primitive to safely iterate on a list
109 * @param __sl A pointer on a sys_sflist_t to iterate on
110 * @param __sn A sys_sfnode_t pointer to peek each node of the list
111 * @param __sns A sys_sfnode_t pointer for the loop to run safely
117 * @brief Provide the primitive to resolve the container of a list node
120 * @param __ln A pointer on a sys_sfnode_t to get its container
130 * @param __sl A pointer on a sys_sflist_t to peek
140 * @param __sl A pointer on a sys_sflist_t to peek
157 * @brief Provide the primitive to iterate on a list under a container
166 * @param __sl A pointer on a sys_sflist_t to iterate on
167 * @param __cn A pointer to peek each entry of the list
174 * @brief Provide the primitive to safely iterate on a list under a container
183 * @param __sl A pointer on a sys_sflist_t to iterate on
184 * @param __cn A pointer to peek each entry of the list
185 * @param __cns A pointer for the loop to run safely
200 * @brief Initialize a list
202 * @param list A pointer on the list to initialize
206 list->head = NULL; in sys_sflist_init()
207 list->tail = NULL; in sys_sflist_init()
211 * @brief Statically initialize a flagged single-linked list
212 * @param ptr_to_list A pointer on the list to initialize
217 #define SYS_SFLIST_FLAGS_MASK ((uintptr_t)(__alignof__(sys_sfnode_t) - 1))
223 return (sys_sfnode_t *)(node->next_and_flags & ~SYS_SFLIST_FLAGS_MASK); in z_sfnode_next_peek()
233 parent->next_and_flags = cur_flags | (uintptr_t)child; in z_sfnode_next_set()
238 list->head = node; in z_sflist_head_set()
243 list->tail = node; in z_sflist_tail_set()
249 * @param list A point on the list to peek the first node from
251 * @return A pointer on the first node of the list (or NULL if none)
255 return list->head; in sys_sflist_peek_head()
261 * @param list A point on the list to peek the last node from
263 * @return A pointer on the last node of the list (or NULL if none)
267 return list->tail; in sys_sflist_peek_tail()
275 * @brief Fetch flags value for a particular sfnode
277 * @param node A pointer to the node to fetch flags from
278 * @return The value of flags, which will be between 0 and 3 on 32-bit
279 * architectures, or between 0 and 7 on 64-bit architectures
283 return node->next_and_flags & SYS_SFLIST_FLAGS_MASK; in sys_sfnode_flags_get()
289 * Set an initial flags value for this slist node, which can be a value between
290 * 0 and 3 on 32-bit architectures, or between 0 and 7 on 64-bit architectures.
291 * These flags will persist even if the node is moved around within a list,
292 * removed, or transplanted to a different slist.
295 * only be used on a node that hasn't been added to any list.
297 * @param node A pointer to the node to set the flags on
303 node->next_and_flags = flags; in sys_sfnode_init()
309 * Set a flags value for this slist node, which can be a value between
310 * 0 and 3 on 32-bit architectures, or between 0 and 7 on 64-bit architectures.
311 * These flags will persist even if the node is moved around within a list,
312 * removed, or transplanted to a different slist.
314 * @param node A pointer to the node to set the flags on
320 node->next_and_flags = (uintptr_t)(z_sfnode_next_peek(node)) | flags; in sys_sfnode_flags_set()
330 * @param list A pointer on the list to test
332 * @return a boolean, true if it's empty, false otherwise
343 * @param node A pointer on the node where to peek the next node
345 * @return a pointer on the next node (or NULL if none)
354 * @param node A pointer on the node where to peek the next node
356 * @return a pointer on the next node (or NULL if none)
363 * @brief Prepend a node to the given list
367 * @param list A pointer on the list to affect
368 * @param node A pointer on the node to prepend
376 * @brief Append a node to the given list
380 * @param list A pointer on the list to affect
381 * @param node A pointer on the node to append
389 * @brief Append a list to the given list
391 * Append a singly-linked, NULL-terminated list consisting of nodes containing
392 * the pointer to the next node as the first element of a node, to @a list.
397 * @param list A pointer on the list to affect
398 * @param head A pointer to the first element of the list to append
399 * @param tail A pointer to the last element of the list to append
412 * @param list A pointer on the list to affect
413 * @param list_to_append A pointer to the list to append.
421 * @brief Insert a node to the given list
425 * @param list A pointer on the list to affect
426 * @param prev A pointer on the previous node
427 * @param node A pointer on the node to insert
438 * List must be known to be non-empty.
441 * @param list A pointer on the list to affect
443 * @return A pointer to the first node of the list
454 * @param list A pointer on the list to affect
456 * @return A pointer to the first node of the list (or NULL if empty)
463 * @brief Remove a node
467 * @param list A pointer on the list to affect
468 * @param prev_node A pointer on the previous node
470 * @param node A pointer on the node to remove
479 * @brief Find and remove a node from a list
483 * @param list A pointer on the list to affect
484 * @param node A pointer on the node to remove from the list
496 * @param list A pointer on the list