Lines Matching full:element
10 * Element's payload is a pointer to arbitrary memory.
12 * Implemented as a singly-linked list, with always one-more element.
13 * The linked list must always contain at least one link-element, as emptiness
15 * For a queue to be valid, it must be initialized with an initial link-element.
17 * Invariant: The tail element's mem pointer is DontCare.
20 * link-element, but the link-element before it!
29 * where H is the pointer to Head link-element (oldest element).
30 * where T is the pointer to Tail link-element (newest element).
31 * where I[] means the initial link-element, whose mem pointer is DontCare.
32 * where A[b] means the A'th link-element, whose mem pointer is b.
46 * @param link[in] Initial link-element. Not associated with any mem
49 * @return Initial link-element
84 * NOTE: The memory will not be associated with the link-element, but
85 * rather the second-to-last link-element.
87 * @param link[in] Element to be appended. Becomes new tail
94 /* Let the old tail element point to the new tail element */ in memq_enqueue()
97 /* Let the old tail element point the new memory */ in memq_enqueue()
100 /* Update the tail-pointer to point to the new tail element. in memq_enqueue()
101 * The new tail-element is not expected to point to anything sensible in memq_enqueue()
112 * @param head[in] Pointer to head link-element of queue
113 * @param tail[in] Pointer to tail link-element of queue
114 * @param mem[out] The memory pointed to by head-element
124 /* Extract the head link-element's memory */ in memq_peek()
133 * @brief Non-destructive peek of nth (zero indexed) element of queue.
135 * @param head[in] Pointer to head link-element of queue
136 * @param tail[in] Pointer to tail link-element of queue
137 * @param n[in] Nth element of queue to peek into
138 * @param mem[out] The memory pointed to by head-element
144 /* Traverse to Nth element, zero indexed */ in memq_peek_n()
149 return NULL; /* Nth element is empty */ in memq_peek_n()
152 /* Progress to next element */ in memq_peek_n()
163 * @param tail[in] Pointer to tail link-element of queue
164 * @param head[in,out] Pointer to head link-element of queue. Will be updated
165 * @param mem[out] The memory pointed to by head-element
178 /* Update the head-pointer to point to the new head element */ in memq_dequeue()