Lines Matching full:head

9  * FIFO-style "memory queue" permitting enqueue at tail and dequeue from head.
14 * is given by head == tail.
29 * where H is the pointer to Head link-element (oldest element).
47 * @param head[out] Head of queue. Will be updated
51 memq_link_t *memq_init(memq_link_t *link, memq_link_t **head, memq_link_t **tail) in memq_init() argument
53 /* Head and tail pointer to the initial link - forms an empty queue */ in memq_init()
54 *head = *tail = link; in memq_init()
62 * @param head[in,out] Head of queue. Will be updated
64 * @return Head of queue before invalidation; NULL if queue was empty
66 memq_link_t *memq_deinit(memq_link_t **head, memq_link_t **tail) in memq_deinit() argument
70 /* If head and tail are not equal, then queue is not empty */ in memq_deinit()
71 if (*head != *tail) { in memq_deinit()
75 old_head = *head; in memq_deinit()
76 *head = *tail = NULL; in memq_deinit()
110 * @brief Non-destructive peek of head of queue.
112 * @param head[in] Pointer to head link-element of queue
114 * @param mem[out] The memory pointed to by head-element
115 * @return head or NULL if queue is empty
117 memq_link_t *memq_peek(memq_link_t *head, memq_link_t *tail, void **mem) in memq_peek() argument
119 /* If head and tail are equal, then queue empty */ in memq_peek()
120 if (head == tail) { in memq_peek()
124 /* Extract the head link-element's memory */ in memq_peek()
126 *mem = head->mem; in memq_peek()
129 return head; /* queue was not empty */ in memq_peek()
135 * @param head[in] Pointer to head link-element of queue
138 * @param mem[out] The memory pointed to by head-element
139 * @return head or NULL if queue is empty
141 memq_link_t *memq_peek_n(memq_link_t *head, memq_link_t *tail, uint8_t n, in memq_peek_n() argument
146 /* Use memq peek to get the current head and its mem */ in memq_peek_n()
147 head = memq_peek(head, tail, mem); in memq_peek_n()
148 if (head == NULL) { in memq_peek_n()
153 head = head->next; in memq_peek_n()
156 return head; /* queue was not empty */ in memq_peek_n()
160 * @brief Remove and returns the head of queue.
161 * @details Dequeue is destructive so head will change to new head
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
166 * @return head or NULL if queue is empty
168 memq_link_t *memq_dequeue(memq_link_t *tail, memq_link_t **head, void **mem) in memq_dequeue() argument
172 /* Use memq peek to get the old head and its mem */ in memq_dequeue()
173 old_head = memq_peek(*head, tail, mem); in memq_dequeue()
178 /* Update the head-pointer to point to the new head element */ in memq_dequeue()
179 *head = old_head->next; in memq_dequeue()