aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/libraries/edje/src/bin/epp/cpphash.h
diff options
context:
space:
mode:
Diffstat (limited to 'libraries/edje/src/bin/epp/cpphash.h')
-rw-r--r--libraries/edje/src/bin/epp/cpphash.h41
1 files changed, 41 insertions, 0 deletions
diff --git a/libraries/edje/src/bin/epp/cpphash.h b/libraries/edje/src/bin/epp/cpphash.h
new file mode 100644
index 0000000..524a850
--- /dev/null
+++ b/libraries/edje/src/bin/epp/cpphash.h
@@ -0,0 +1,41 @@
1enum node_type;
2
3/* different kinds of things that can appear in the value field
4 of a hash node. Actually, this may be useless now. */
5union hashval {
6 int ival;
7 char *cpval;
8 DEFINITION *defn;
9};
10
11struct hashnode {
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 */
21};
22
23typedef struct hashnode HASHNODE;
24
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. */
31
32#define HASHSIZE 1403
33#define HASHSTEP(old, c) ((old << 2) + c)
34#define MAKE_POS(v) (v & 0x7fffffff) /* make number positive */
35
36extern int hashf(const char *name, int len, int hashsize);
37extern HASHNODE *cpp_lookup(const char *name, int len, int hash);
38extern void delete_macro(HASHNODE * hp);
39extern HASHNODE *install(const char *name, int len, enum node_type type,
40 int ivalue, char *value, int hash);
41extern void cpp_hash_cleanup(cpp_reader * pfile);