EVE 1.0
Doubly linked circularlist
Collaboration diagram for Doubly linked circularlist:

Data Structures

struct  dlist_t
 

Macros

#define DLIST_INIT(dlist)
 
#define DLIST_INIT_TYPED(dlist)   (struct dlist_t) DLIST_INIT(dlist)
 

Functions

static void dlist_init (struct dlist_t *list)
 
static void dlist_insert (struct dlist_t *list, struct dlist_t *prev, struct dlist_t *next)
 
static struct dlist_tdlist_del (struct dlist_t *list)
 
static void dlist_append (struct dlist_t *list, struct dlist_t *item)
 
static int dlist_is_empty (struct dlist_t *list)
 
static int dlist_is_singular (struct dlist_t *list)
 

Detailed Description

Dummy Headed Doubly Linked Circularlist (DHDLC) primitive.

Macro Definition Documentation

#define DLIST_INIT (   dlist)
Value:
{ \
.prev = &dlist, \
.next = &dlist, \
}

Static initializer for the empty list entry structure

Definition at line 51 of file dlist.h.

#define DLIST_INIT_TYPED (   dlist)    (struct dlist_t) DLIST_INIT(dlist)

Static initializer for the empty list entry structure, typed version

Definition at line 59 of file dlist.h.

Function Documentation

static void dlist_init ( struct dlist_t list)
inlinestatic

Initialize a linked list head

Parameters
listpointer to the linked list head

Definition at line 76 of file dlist.h.

References dlist_t::next, and dlist_t::prev.

Referenced by dlist_del(), and uip_init().

static void dlist_insert ( struct dlist_t list,
struct dlist_t prev,
struct dlist_t next 
)
inlinestatic

Insert a new list entry between two in a list

Parameters
lista new list entry to be inserted
prevleft-hand neighbor of the inserted entry
nextright-hand neighbor of the inserted entry

Definition at line 88 of file dlist.h.

References dlist_t::next, and dlist_t::prev.

Referenced by dlist_append().

static struct dlist_t* dlist_del ( struct dlist_t list)
static

Remove an entry from the list

Parameters
listthe entry to be removed

Definition at line 100 of file dlist.h.

References dlist_init(), dlist_t::next, and dlist_t::prev.

Referenced by ep_alloc_urb().

static void dlist_append ( struct dlist_t list,
struct dlist_t item 
)
inlinestatic

Insert a new list entry to the tail of the list

Parameters
listhead of the list
itemnew entry to be inserted

Definition at line 114 of file dlist.h.

References dlist_insert(), and dlist_t::prev.

Referenced by ep_free_urb(), and ep_schedule_urb().

static int dlist_is_empty ( struct dlist_t list)
inlinestatic

Check if the list is empty

Parameters
listhead of the list
Returns
true if list is empty, false if not

Definition at line 125 of file dlist.h.

References dlist_t::next.

Referenced by dlist_is_singular(), ep_alloc_urb(), ep_is_empty(), mwork_pending(), uwork_pending(), and work_pending().

static int dlist_is_singular ( struct dlist_t list)
inlinestatic

Check if list contains exactly one entry (except list head)

Parameters
listhead of the list
Returns
true if list is singular, false if not

Definition at line 136 of file dlist.h.

References dlist_is_empty(), dlist_t::next, and dlist_t::prev.