Lines Matching +full:- +full:a

3 Single-linked List
6 Zephyr provides a :c:type:`sys_slist_t` type for storing simple
7 singly-linked list data (i.e. data where each list element stores a
9 constant-time access to the first (head) and last (tail) elements of
21 The end nodes of a list may be retrieved with
23 return NULL if the list is empty, otherwise a pointer to a
28 usually embedded within a struct which is to be added to the list.
29 The container struct pointer may be retrieved from a list node using
32 :c:type:`sys_snode_t` struct contains only a next pointer, which may be
35 Lists may be modified by adding a single node at the head or tail with
37 have a node added to an interior point with :c:func:`sys_slist_insert`,
38 which inserts a new node after an existing one. Similarly
39 :c:func:`sys_slist_remove` will remove a node given a pointer to its
42 Convenience routines exist for more complicated modifications to a
44 existing one. :c:func:`sys_slist_append_list` will append a bounded
46 :c:func:`sys_slist_find_and_remove` will search a list (in linear time)
47 for a given node and remove it if present.
49 Finally the slist implementation provides a set of "for each" macros
50 that allows for iterating over a list in a natural way without needing
52 will enumerate every node in a list given a local variable to store
54 similarly, but has a more complicated implementation that requires an
57 in a "container" variant (:c:macro:`SYS_SLIST_FOR_EACH_CONTAINER` and
58 :c:macro:`SYS_SLIST_FOR_EACH_CONTAINER_SAFE`) which assigns a local
59 variable of a type that matches the user's container struct and not
61 :c:macro:`SYS_SLIST_ITERATE_FROM_NODE` exists to allow for enumerating a
65 Single-linked List Internals
66 ----------------------------
69 Internally, a :c:type:`sys_slist_t` struct is nothing more than a pair of
70 "head" and "tail" pointer fields. And a :c:type:`sys_snode_t` stores only a
76 :figclass: align-center
80 .. figure:: slist-empty.png
83 :figclass: align-center
91 single-linked list variants using the same basic primitives. The
92 genlist implementor is responsible for a custom implementation of the
93 primitive operations only: an "init" step for each struct, and a "get"
102 ------------
117 Single-linked List API Reference
118 --------------------------------
120 .. doxygengroup:: single-linked-list_apis
123 --------------------------------
125 .. doxygengroup:: flagged-single-linked-list_apis