diff options
author | David Walter Seikel | 2012-01-04 18:41:13 +1000 |
---|---|---|
committer | David Walter Seikel | 2012-01-04 18:41:13 +1000 |
commit | dd7595a3475407a7fa96a97393bae8c5220e8762 (patch) | |
tree | e341e911d7eb911a51684a7412ef7f7c7605d28e /libraries/edje/src/bin/epp/cpphash.h | |
parent | Add the skeleton. (diff) | |
download | SledjHamr-dd7595a3475407a7fa96a97393bae8c5220e8762.zip SledjHamr-dd7595a3475407a7fa96a97393bae8c5220e8762.tar.gz SledjHamr-dd7595a3475407a7fa96a97393bae8c5220e8762.tar.bz2 SledjHamr-dd7595a3475407a7fa96a97393bae8c5220e8762.tar.xz |
Add the base Enlightenment Foundation Libraries - eina, eet, evas, ecore, embryo, and edje.
Note that embryo wont be used, but I'm not sure yet if you can build edje without it.
Diffstat (limited to '')
-rw-r--r-- | libraries/edje/src/bin/epp/cpphash.h | 41 |
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 @@ | |||
1 | enum 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. */ | ||
5 | union hashval { | ||
6 | int ival; | ||
7 | char *cpval; | ||
8 | DEFINITION *defn; | ||
9 | }; | ||
10 | |||
11 | struct 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 | |||
23 | typedef 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 | |||
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); | ||