00001 /* LLIST.H */ 00002 00003 #ifndef _LLIST_H_ 00004 #define _LLIST_H_ 00005 00006 typedef struct { 00007 void *data; 00008 int len; 00009 int key; 00010 void *next; 00011 } list; 00012 00013 00014 list *mklist(void); 00015 /* 00016 * this function creates a linked list with a key to each node 00017 */ 00018 00019 void linsert(list *l, void *data, int len, int key); 00020 /* 00021 * this function inserts an element at the end of a linked list 00022 */ 00023 00024 void *lfind(list *l, int key, int *len); 00025 /* 00026 * this function returns a pointer to the data associated with the given key 00027 */ 00028 00029 void *lremove(list *l, int key, int *len); 00030 /* 00031 * this function does the same as lfind() but removes the node 00032 */ 00033 00034 #endif