16 #ifndef _DRVIVER_MANAGER_LIST_H_ 17 #define _DRVIVER_MANAGER_LIST_H_ 31 #define LIST_INITIALIZER(type, field) {NULL, NULL, offsetof(type, field)} 34 #define LIST_HEAD(list, type) ((type *)(list)->head) 37 #define LIST_TAIL(list, type) ((type *)(list)->tail) 40 #define LIST_FIELD(list, entry) (*(void **)((char *)(entry) + (list)->ofs)) 43 #define LIST_NEXT(list, entry, type) ((type *)(LIST_FIELD(list, entry))) 46 #define LIST_FOR_EACH(list, entry, type) \ 47 for (entry = LIST_HEAD(list, type); \ 49 entry = LIST_NEXT(list, entry, type)) void drvmgr_list_empty(struct drvmgr_list *list)
Clear list.
Definition: drvmgr_list.c:22
void drvmgr_list_add_tail(struct drvmgr_list *list, void *entry)
Add entry to end of list.
Definition: drvmgr_list.c:35
void * tail
Last entry in queue.
Definition: drvmgr_list.h:27
void drvmgr_list_remove(struct drvmgr_list *list, void *entry)
Remove entry from anywhere in list.
Definition: drvmgr_list.c:52
void drvmgr_list_init(struct drvmgr_list *list, int offset)
Initialize a list during runtime.
Definition: drvmgr_list.c:16
int ofs
Offset into head and tail to find next field.
Definition: drvmgr_list.h:28
void drvmgr_list_remove_head(struct drvmgr_list *list)
Remove entry from front of list.
Definition: drvmgr_list.c:45
void drvmgr_list_add_head(struct drvmgr_list *list, void *entry)
Add entry to front of list.
Definition: drvmgr_list.c:27
void * head
First entry in queue.
Definition: drvmgr_list.h:26
Definition: nfs_prot.h:234
List description, Singly link list with head and tail pointers.
Definition: drvmgr_list.h:25