ChibiOS  21.6.0
chlists.h File Reference

Lists and Queues header. More...

Go to the source code of this file.

Data Structures

struct  ch_list
 Structure representing a generic single link list header and element. More...
 
struct  ch_queue
 Structure representing a generic bidirectional linked list header and element. More...
 
struct  ch_priority_queue
 Structure representing a generic priority-ordered bidirectional linked list header and element. More...
 
struct  ch_delta_list
 Delta list element and header structure. More...
 

Macros

#define __CH_QUEUE_DATA(name)   {(ch_queue_t *)&name, (ch_queue_t *)&name}
 Data part of a static queue object initializer. More...
 
#define CH_QUEUE_DECL(name)   ch_queue_t name = __CH_QUEUE_DATA(name)
 Static queue object initializer. More...
 

Typedefs

typedef struct ch_list ch_list_t
 Type of a generic single link list header and element. More...
 
typedef struct ch_queue ch_queue_t
 Type of a generic bidirectional linked list header and element. More...
 
typedef struct ch_priority_queue ch_priority_queue_t
 Type of a generic priority-ordered bidirectional linked list header and element. More...
 
typedef struct ch_delta_list ch_delta_list_t
 Type of a generic bidirectional linked delta list header and element. More...
 

Functions

static void ch_list_init (ch_list_t *lp)
 List initialization. More...
 
static bool ch_list_isempty (ch_list_t *lp)
 Evaluates to true if the specified list is empty. More...
 
static bool ch_list_notempty (ch_list_t *lp)
 Evaluates to true if the specified list is not empty. More...
 
static void ch_list_link (ch_list_t *lp, ch_list_t *p)
 Pushes an element on top of a stack list. More...
 
static ch_list_tch_list_unlink (ch_list_t *lp)
 Pops an element from the top of a stack list and returns it. More...
 
static void ch_queue_init (ch_queue_t *qp)
 Queue initialization. More...
 
static bool ch_queue_isempty (const ch_queue_t *qp)
 Evaluates to true if the specified queue is empty. More...
 
static bool ch_queue_notempty (const ch_queue_t *qp)
 Evaluates to true if the specified queue is not empty. More...
 
static void ch_queue_insert (ch_queue_t *qp, ch_queue_t *p)
 Inserts an element into a queue. More...
 
static ch_queue_tch_queue_fifo_remove (ch_queue_t *qp)
 Removes the first-out element from a queue and returns it. More...
 
static ch_queue_tch_queue_lifo_remove (ch_queue_t *qp)
 Removes the last-out element from a queue and returns it. More...
 
static ch_queue_tch_queue_dequeue (ch_queue_t *p)
 Removes an element from a queue and returns it. More...
 
static void ch_pqueue_init (ch_priority_queue_t *pqp)
 Priority queue initialization. More...
 
static ch_priority_queue_tch_pqueue_remove_highest (ch_priority_queue_t *pqp)
 Removes the highest priority element from a priority queue and returns it. More...
 
static ch_priority_queue_tch_pqueue_insert_behind (ch_priority_queue_t *pqp, ch_priority_queue_t *p)
 Inserts an element in the priority queue placing it behind its peers. More...
 
static ch_priority_queue_tch_pqueue_insert_ahead (ch_priority_queue_t *pqp, ch_priority_queue_t *p)
 Inserts an element in the priority queue placing it ahead of its peers. More...
 
static void ch_dlist_init (ch_delta_list_t *dlhp)
 Delta list initialization. More...
 
static bool ch_dlist_isempty (ch_delta_list_t *dlhp)
 Evaluates to true if the specified delta list is empty. More...
 
static bool ch_dlist_notempty (ch_delta_list_t *dlhp)
 Evaluates to true if the specified queue is not empty. More...
 
static bool ch_dlist_islast (ch_delta_list_t *dlhp, ch_delta_list_t *dlp)
 Last element in the delta list check. More...
 
static bool ch_dlist_isfirst (ch_delta_list_t *dlhp, ch_delta_list_t *dlp)
 Fist element in the delta list check. More...
 
static void ch_dlist_insert_after (ch_delta_list_t *dlhp, ch_delta_list_t *dlp, sysinterval_t delta)
 Inserts an element after another header element. More...
 
static void ch_dlist_insert_before (ch_delta_list_t *dlhp, ch_delta_list_t *dlp, sysinterval_t delta)
 Inserts an element before another header element. More...
 
static void ch_dlist_insert (ch_delta_list_t *dlhp, ch_delta_list_t *dlep, sysinterval_t delta)
 Inserts an element in a delta list. More...
 
static ch_delta_list_tch_dlist_remove_first (ch_delta_list_t *dlhp)
 Dequeues an element from the delta list. More...
 
static ch_delta_list_tch_dlist_dequeue (ch_delta_list_t *dlp)
 Dequeues an element from the delta list. More...
 

Detailed Description

Lists and Queues header.

Definition in file chlists.h.