/* Non-destructive peek of nth (zero indexed) element of queue.  */
memq_link_t* memq_peek_n(memq_link_t *head, memq_link_t *tail, uint8_t n, void **mem)
/* Non-destructive peek of nth (zero indexed) element of queue.  */
memq_link_t* memq_peek_n(memq_link_t *head, memq_link_t *tail, uint8_t n, void **mem)
{
	do {
		head = memq_peek(head, tail, mem);
		if (head == NULL) {
			return NULL;
		}
		head = head->next;
	} while (n--);
	return head;
}