63 #ifndef __INCLUDE_QUEUE_H 64 #define __INCLUDE_QUEUE_H 70 #include <sys/types.h> 76 #define sq_init(q) do { (q)->head = NULL; (q)->tail = NULL; } while (0) 77 #define dq_init(q) do { (q)->head = NULL; (q)->tail = NULL; } while (0) 79 #define sq_next(p) ((p)->flink) 80 #define dq_next(p) ((p)->flink) 81 #define dq_prev(p) ((p)->blink) 83 #define sq_empty(q) ((q)->head == NULL) 84 #define dq_empty(q) ((q)->head == NULL) 86 #define sq_peek(q) ((q)->head) 87 #define dq_peek(q) ((q)->head) 133 #define EXTERN extern "C" 136 #define EXTERN extern FAR sq_entry_t * sq_remfirst(FAR sq_queue_t *queue)
removes the first entry from 'queue'
FAR sq_entry_t * sq_remlast(FAR sq_queue_t *queue)
Removes the last entry in a singly-linked queue.
structure for singly-linked queue
structure for header queue
FAR struct dq_entry_s * blink
FAR dq_entry_t * dq_remfirst(FAR dq_queue_t *queue)
removes 'node' from the head of 'queue'
void dq_rem(FAR dq_entry_t *node, FAR dq_queue_t *queue)
removes 'node' from 'queue'
void sq_addafter(FAR sq_entry_t *prev, FAR sq_entry_t *node, FAR sq_queue_t *queue)
adds 'node' after 'prev' in the 'queue.'
FAR struct sq_entry_s * flink
FAR struct dq_entry_s * flink
void sq_addlast(FAR sq_entry_t *node, FAR sq_queue_t *queue)
places the 'node' at the tail of the 'queue'
void sq_rem(FAR sq_entry_t *node, FAR sq_queue_t *queue)
removes a 'node' for 'queue.'
structure for double-linked queue
void dq_addafter(FAR dq_entry_t *prev, FAR dq_entry_t *node, FAR dq_queue_t *queue)
adds 'node' after 'prev' in the 'queue.'
void sq_addfirst(FAR sq_entry_t *node, FAR sq_queue_t *queue)
places the 'node' at the head of the 'queue'
structure for header queue
void dq_addfirst(FAR dq_entry_t *node, FAR dq_queue_t *queue)
adds 'node' at the beginning of 'queue'
FAR sq_entry_t * sq_remafter(FAR sq_entry_t *node, FAR sq_queue_t *queue)
removes the entry following 'node
void dq_addlast(FAR dq_entry_t *node, FAR dq_queue_t *queue)
adds 'node' to the end of 'queue'
FAR dq_entry_t * dq_remlast(FAR dq_queue_t *queue)
removes the last entry from 'queue'
void dq_addbefore(FAR dq_entry_t *next, FAR dq_entry_t *node, FAR dq_queue_t *queue)
adds 'node' before 'next' in 'queue'