hash.h revision 16793
1290650Shselasky/*
2290650Shselasky * Copyright (c) 1995, 1996
3290650Shselasky *	Bill Paul <wpaul@ctr.columbia.edu>.  All rights reserved.
4290650Shselasky *
5290650Shselasky * Redistribution and use in source and binary forms, with or without
6290650Shselasky * modification, are permitted provided that the following conditions
7290650Shselasky * are met:
8290650Shselasky * 1. Redistributions of source code must retain the above copyright
9290650Shselasky *    notice, this list of conditions and the following disclaimer.
10290650Shselasky * 2. Redistributions in binary form must reproduce the above copyright
11290650Shselasky *    notice, this list of conditions and the following disclaimer in the
12290650Shselasky *    documentation and/or other materials provided with the distribution.
13290650Shselasky * 3. All advertising materials mentioning features or use of this software
14290650Shselasky *    must display the following acknowledgement:
15290650Shselasky *	This product includes software developed by Bill Paul.
16290650Shselasky * 4. Neither the name of the author nor the names of any co-contributors
17290650Shselasky *    may be used to endorse or promote products derived from this software
18290650Shselasky *    without specific prior written permission.
19290650Shselasky *
20290650Shselasky * THIS SOFTWARE IS PROVIDED BY Bill Paul AND CONTRIBUTORS ``AS IS'' AND
21290650Shselasky * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
22290650Shselasky * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
23290650Shselasky * ARE DISCLAIMED.  IN NO EVENT SHALL Bill Paul OR CONTRIBUTORS BE LIABLE
24290650Shselasky * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
25290650Shselasky * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
26290650Shselasky * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
27290650Shselasky * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
28290650Shselasky * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
29290650Shselasky * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
30290650Shselasky * SUCH DAMAGE.
31290650Shselasky *
32290650Shselasky *	$Id: hash.h,v 1.1.1.1 1996/06/25 20:26:38 wpaul Exp $
33290650Shselasky */
34290650Shselasky
35290650Shselasky/* Groupid entry hung off a member_entry node. */
36290650Shselaskystruct grouplist {
37290650Shselasky	gid_t groupid;
38290650Shselasky	struct grouplist *next;
39290650Shselasky};
40290650Shselasky
41290650Shselasky/* Entry in the cooked member list hash table. */
42290650Shselaskystruct member_entry {
43290650Shselasky	char *key; /* username */
44290650Shselasky	struct grouplist *groups;
45290650Shselasky	struct member_entry *next;
46290650Shselasky};
47290650Shselasky
48290650Shselasky/* Table size (chosen arbitrarily). Not too big, not too small. */
49290650Shselasky#define TABLESIZE 1024
50290650Shselasky#define HASH_MASK 0x000003FF
51290650Shselasky
52290650Shselaskyextern void mstore __P(( struct member_entry ** , char *, int, int ));
53290650Shselaskyextern struct grouplist *lookup __P(( struct member_entry **, char * ));
54290650Shselasky
55290650Shselasky