Rev 206 | Rev 259 | Go to most recent revision | Show entire file | Regard whitespace | Details | Blame | Last modification | View Log | RSS feed
Rev 206 | Rev 237 | ||
---|---|---|---|
Line 24... | Line 24... | ||
24 | #include "symtab.h" |
24 | #include "symtab.h" |
25 | 25 | ||
26 | unsigned long djb2(const char *str); |
26 | unsigned long djb2(const char *str); |
27 | 27 | ||
28 | /* following constant (need not) be prime. for a list of prime numbers, |
28 | /* following constant (need not) be prime. for a list of prime numbers, |
29 | see http://www.utm.edu/research/primes/lists/small/1000.txt */ |
29 | see https://primes.utm.edu/lists/small/1000.txt */ |
30 | #define TABLE_SIZE 128 // if you're anticipating many symbols, increase this value! |
30 | #define TABLE_SIZE 128 // if you're anticipating many symbols, increase this value! |
31 | #define HASH(s) (djb2(s) % TABLE_SIZE) |
31 | #define HASH(s) (djb2(s) % TABLE_SIZE) |
32 | 32 | ||
33 | struct sym_rec *hash_table[TABLE_SIZE]; |
33 | struct sym_rec *hash_table[TABLE_SIZE]; |
34 | extern struct sym_rec predefs[]; |
34 | extern struct sym_rec predefs[]; |