URL
https://opencores.org/ocsvn/tinyvliw8/tinyvliw8/trunk
Subversion Repositories tinyvliw8
[/] [tinyvliw8/] [trunk/] [tools/] [asm/] [src/] [list.h] - Rev 5
Go to most recent revision | Compare with Previous | Blame | View Log
#ifndef LIST_H #define LIST_H typedef struct _list_s { struct _list_s *next; struct _list_s *prev; } list_t; #define LIST_INIT(l) {(l)->prev = l; (l)->next = l;} #define LIST_ENTRY(head, type, elem) (type *) (((unsigned long) (head)) - ((unsigned long) &(((type *) 0)->elem))) static inline void list_add(list_t *list, list_t *elem) { elem->prev = list; elem->next = list->next; list->next->prev = elem; list->next = elem; } static inline void list_add_last(list_t *list, list_t *elem) { elem->next = list; elem->prev = list->prev; list->prev->next = elem; list->prev = elem; } #endif
Go to most recent revision | Compare with Previous | Blame | View Log