1/* 2 * Copyright (c) 1992, Brian Berliner and Jeff Polk 3 * 4 * You may distribute under the terms of the GNU General Public License as 5 * specified in the README file that comes with the CVS source distribution. 6 */ 7 8/* 9 * The number of buckets for the hash table contained in each list. This 10 * should probably be prime. 11 */ 12#define HASHSIZE 151 13 14/* 15 * Types of nodes 16 */ 17enum ntype 18{ 19 NT_UNKNOWN, HEADER, ENTRIES, FILES, LIST, RCSNODE, 20 RCSVERS, DIRS, UPDATE, LOCK, NDBMNODE, FILEATTR, 21 VARIABLE, RCSFIELD, RCSCMPFLD 22}; 23typedef enum ntype Ntype; 24 25struct node 26{ 27 Ntype type; 28 struct node *next; 29 struct node *prev; 30 struct node *hashnext; 31 struct node *hashprev; 32 char *key; 33 char *data; 34 void (*delproc) (); 35}; 36typedef struct node Node; 37 38struct list 39{ 40 Node *list; 41 Node *hasharray[HASHSIZE]; 42 struct list *next; 43}; 44typedef struct list List; 45 46List *getlist PROTO((void)); 47Node *findnode PROTO((List * list, const char *key)); 48Node *findnode_fn PROTO((List * list, const char *key)); 49Node *getnode PROTO((void)); 50int insert_before PROTO((List * list, Node * marker, Node * p)); 51int addnode PROTO((List * list, Node * p)); 52int addnode_at_front PROTO((List * list, Node * p)); 53int walklist PROTO((List * list, int (*)(Node *n, void *closure), void *closure)); 54int list_isempty PROTO ((List *list)); 55void dellist PROTO((List ** listp)); 56void delnode PROTO((Node * p)); 57void freenode PROTO((Node * p)); 58void sortlist PROTO((List * list, int (*)(const Node *, const Node *))); 59int fsortcmp PROTO((const Node * p, const Node * q)); 60