3 /* different kinds of things that can appear in the value field
4 of a hash node. Actually, this may be useless now. */
12 struct hashnode *next; /* double links for easy deletion */
13 struct hashnode *prev;
14 struct hashnode **bucket_hdr; /* also, a back pointer to this node's hash
15 * chain is kept, in case the node is the head
16 * of the chain and gets deleted. */
17 enum node_type type; /* type of special token */
18 int length; /* length of token, for quick comparison */
19 char *name; /* the actual name */
20 union hashval value; /* pointer to expansion, or whatever */
23 typedef struct hashnode HASHNODE;
25 /* Some definitions for the hash table. The hash function MUST be
26 computed as shown in hashf () below. That is because the rescan
27 loop computes the hash value `on the fly' for most tokens,
28 in order to avoid the overhead of a lot of procedure calls to
29 the hashf () function. Hashf () only exists for the sake of
30 politeness, for use when speed isn't so important. */
33 #define HASHSTEP(old, c) ((old << 2) + c)
34 #define MAKE_POS(v) (v & 0x7fffffff) /* make number positive */
36 extern int hashf(const char *name, int len, int hashsize);
37 extern HASHNODE *cpp_lookup(const char *name, int len, int hash);
38 extern void delete_macro(HASHNODE * hp);
39 extern HASHNODE *install(const char *name, int len, enum node_type type,
40 int ivalue, char *value, int hash);
41 extern void cpp_hash_cleanup(cpp_reader * pfile);