Lines Matching full:queue
9 * FIFO-style "memory queue" permitting enqueue at tail and dequeue from head.
15 * For a queue to be valid, it must be initialized with an initial link-element.
44 * @brief Initialize a memory queue to be empty and valid.
47 * @param head[out] Head of queue. Will be updated
48 * @param tail[out] Tail of queue. Will be updated
53 /* Head and tail pointer to the initial link - forms an empty queue */ in memq_init()
60 * @brief De-initialize a memory queue to be empty and invalid.
62 * @param head[in,out] Head of queue. Will be updated
63 * @param tail[in,out] Tail of queue. Will be updated
64 * @return Head of queue before invalidation; NULL if queue was empty
70 /* If head and tail are not equal, then queue is not empty */ in memq_deinit()
82 * @brief Enqueue at the tail of the queue
89 * @param tail[in,out] Tail of queue. Will be updated to point to link
110 * @brief Non-destructive peek of head of queue.
112 * @param head[in] Pointer to head link-element of queue
113 * @param tail[in] Pointer to tail link-element of queue
115 * @return head or NULL if queue is empty
119 /* If head and tail are equal, then queue empty */ in memq_peek()
129 return head; /* queue was not empty */ 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
139 * @return head or NULL if queue is empty
156 return head; /* queue was not empty */ in memq_peek_n()
160 * @brief Remove and returns the head of queue.
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
166 * @return head or NULL if queue is empty
175 return NULL; /* queue is empty */ in memq_dequeue()