Add the DragonFly cvs id and perform general cleanups on cvs/rcs/sccs ids. Most
[games.git] / gnu / usr.bin / as / hash.h
1 /* hash.h - for hash.c
2    Copyright (C) 1987, 1992 Free Software Foundation, Inc.
3
4    This file is part of GAS, the GNU Assembler.
5
6    GAS is free software; you can redistribute it and/or modify
7    it under the terms of the GNU General Public License as published by
8    the Free Software Foundation; either version 2, or (at your option)
9    any later version.
10
11    GAS is distributed in the hope that it will be useful,
12    but WITHOUT ANY WARRANTY; without even the implied warranty of
13    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
14    GNU General Public License for more details.
15
16    You should have received a copy of the GNU General Public License
17    along with GAS; see the file COPYING.  If not, write to
18    the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA.  */
19 /*
20  * $FreeBSD: src/gnu/usr.bin/as/hash.h,v 1.6 1999/08/27 23:34:17 peter Exp $
21  * $DragonFly: src/gnu/usr.bin/as/Attic/hash.h,v 1.2 2003/06/17 04:25:44 dillon Exp $
22  */
23
24
25 #ifndef hashH
26 #define hashH
27
28 struct hash_entry
29 {
30         char *hash_string;      /* points to where the symbol string is */
31         /* NULL means slot is not used */
32         /* DELETED means slot was deleted */
33         char *hash_value;       /* user's datum, associated with symbol */
34 };
35
36
37 #define HASH_STATLENGTH (6)
38 struct hash_control
39 {
40         struct hash_entry *hash_where; /* address of hash table */
41         int hash_sizelog; /* Log of ( hash_mask + 1 ) */
42         int hash_mask; /* masks a hash into index into table */
43         int hash_full; /* when hash_stat[STAT_USED] exceeds this, */
44         /* grow table */
45         struct hash_entry * hash_wall; /* point just after last (usable) entry */
46         /* here we have some statistics */
47         int hash_stat[HASH_STATLENGTH]; /* lies & statistics */
48         /* we need STAT_USED & STAT_SIZE */
49 };
50
51  /* fixme: prototype. */
52
53 /* returns */
54 struct hash_control *hash_new(); /* [control block] */
55 void hash_die();
56 void hash_say();
57 char *hash_delete(); /* previous value */
58 char *hash_relpace(); /* previous value */
59 char *hash_insert(); /* error string */
60 char *hash_apply(); /* 0 means OK */
61 char *hash_find(); /* value */
62 char *hash_jam(); /* error text (internal) */
63
64 #endif /* #ifdef hashH */
65
66 /* end of hash.h */