4 * This is the header file for a general list linked package.
6 * Copyright 1990,1991 by the Massachusetts Institute of Technology
7 * For distribution and copying rights, see the file "mit-copyright.h"
10 #ifndef __LINKED_LIST_H__
11 #define __LINKED_LIST_H__
13 #if !defined(lint) && !defined(SABER)
14 static char *rcsid_linked_list_h = "$Id$";
15 #endif /* lint || SABER */
20 typedef struct _ll_node {
21 struct _ll_node *prev;
22 struct _ll_node *next;
32 typedef enum {ll_head, ll_tail} ll_end;
33 typedef enum {ll_s_add, ll_s_check} ll_s_action;
37 * ll_add_data just assigns the data field of node to be d.
38 * If this were c++, this would be an inline function and d
39 * would be a void *, but we'll take what we can get...
41 #define ll_add_data(n,d) (((n)->data)=(char*)(d))
45 void ll_init(linked_list *list);
46 ll_node *ll_add_node(linked_list *list, ll_end which_end);
47 int ll_delete_node(linked_list *list, ll_node *node);
48 int ll_string(linked_list *, ll_s_action, char *);
53 ll_node *ll_add_node();
59 #endif /* __LINKED_LIST_H__ */