1 2 /* 3 * Licensed Materials - Property of IBM 4 * 5 * trousers - An open source TCG Software Stack 6 * 7 * (C) Copyright International Business Machines Corp. 2004 8 * 9 */ 10 11 #ifndef LIST_H_ 12 #define LIST_H_ 13 14 /* simple linked list template */ 15 struct _list_t { 16 void *obj; 17 struct _list_t *next; // pointer to next node 18 }; 19 20 typedef struct _list_t node_t; // each link is a list "node" 21 22 typedef struct { 23 node_t *head; // pointer to first node 24 node_t *current; 25 node_t *previous; 26 } list_struct; 27 28 typedef list_struct* list_ptr; 29 typedef list_struct list_t[1]; 30 31 32 list_ptr list_new(); 33 34 void list_add(list_ptr list, void * obj); 35 36 void list_dump(list_ptr list); 37 38 void list_freeall(list_ptr list); 39 40 #endif /*LIST_H_*/ 41