HardenedBSD/gnu/usr.bin/cvs/lib/hash.h
Peter Wemm ac4bd338c8 Import CVS-1.6.3-951211.. Basically, this is the cvs-1.6.2 release
plus a couple of minor changes..

Some highlights of the new stuff that was not in the old version:
 - remote access support.. full checkout/commit/log/etc..
 - much improved dead file support..
 - speed improvements
 - better $CVSROOT handling
 - $Name$ support
 - support for a "cvsadmin" group to cut down rampant use of "cvs admin -o"
 - safer setuid/setgid support
 - many bugs fixed.. :-)
 - probably some new ones.. :-(
 - more that I cannot remember offhand..
1995-12-10 22:31:58 +00:00

56 lines
1.3 KiB
C

/* $CVSid: @(#)hash.h 1.23 94/10/07 $ */
/*
* Copyright (c) 1992, Brian Berliner and Jeff Polk
*
* You may distribute under the terms of the GNU General Public License as
* specified in the README file that comes with the CVS 1.4 kit.
*/
/*
* The number of buckets for the hash table contained in each list. This
* should probably be prime.
*/
#define HASHSIZE 151
/*
* Types of nodes
*/
enum ntype
{
UNKNOWN, HEADER, ENTRIES, FILES, LIST, RCSNODE,
RCSVERS, DIRS, UPDATE, LOCK, NDBMNODE
};
typedef enum ntype Ntype;
struct node
{
Ntype type;
struct node *next;
struct node *prev;
struct node *hashnext;
struct node *hashprev;
char *key;
char *data;
void (*delproc) ();
};
typedef struct node Node;
struct list
{
Node *list;
Node *hasharray[HASHSIZE];
struct list *next;
};
typedef struct list List;
List *getlist PROTO((void));
Node *findnode PROTO((List * list, const char *key));
Node *getnode PROTO((void));
int addnode PROTO((List * list, Node * p));
int walklist PROTO((List * list, int (*)(Node *n, void *closure), void *closure));
void dellist PROTO((List ** listp));
void delnode PROTO((Node * p));
void freenode PROTO((Node * p));
void sortlist PROTO((List * list, int (*)(const Node *, const Node *)));