4 /*@constant int CPP_HASHSIZE@*/
5 # define CPP_HASHSIZE 1403
7 /* different kinds of things that can appear in the value field
8 of a hash node. Actually, this may be useless now. */
9 typedef union u_hashvalue {
11 /*@null@*/ /*@owned@*/ char *cpval;
12 /*@owned@*/ DEFINITION *defn;
16 /* double links for easy deletion */
17 /*@only@*/ /*@null@*/ hashNode next;
18 /*@dependent@*/ /*@null@*/ hashNode prev;
21 ** Also, a back pointer to this node's hash
22 ** chain is kept, in case the node is the head
23 ** of the chain and gets deleted.
26 /*@null@*/ /*@dependent@*/ hashNode *bucket_hdr;
28 enum node_type type; /* type of special token */
29 size_t length; /* length of token, for quick comparison */
30 cstring name; /* the actual name */
31 hashValue value; /* pointer to expansion, or whatever */
34 /* Some definitions for the hash table. The hash function MUST be
35 computed as shown in hashf () below. That is because the rescan
36 loop computes the hash value `on the fly' for most tokens,
37 in order to avoid the overhead of a lot of procedure calls to
38 the hashf () function. Hashf () only exists for the sake of
39 politeness, for use when speed isn't so important. */
41 extern void cppReader_deleteMacro (/*@exposed@*/ hashNode p_hp)
42 /*@modifies internalState, p_hp@*/;
44 extern /*@exposed@*/ hashNode cpphash_install (char *, int,
46 /*@only@*/ /*@null@*/ char *, int);
48 extern void cppReader_hashCleanup (void);
49 extern /*@null@*/ /*@exposed@*/ hashNode cpphash_lookup (char *, int, int);
50 extern /*@null@*/ /*@exposed@*/ hashNode cpphash_lookupExpand (char *, int, int,
53 extern int cpphash_hashCode (const char *p_name, size_t p_len, int p_hashsize) /*@*/ ;
54 extern void cppReader_saveHashtab (void);
55 extern void cppReader_restoreHashtab (void);
57 extern /*@exposed@*/ hashNode
58 cpphash_installMacro (char *p_name, size_t p_len,
59 /*@only@*/ struct definition *p_defn, int p_hash);
62 # error "Multiple include"