1 /* HASHING TABLE */
2 
3 #ifndef __HASH_H
4 #define __HASH_H
5 
6 #include "z80-global"
7 
8 /* return number of used hash table entries */
9 
10 extern unsigned table_entries(void);
11 
12 /* adds item to hash table */
13 
14 extern int add_to_table(char *key, int value, unsigned lineno, bool copy);
15 
16 extern void update_last_added_entry(int value, char *txt, bool unique);
17 
18 /* if 1 then returns next entry in hash table, else 0 and table scanned */
19 
20 extern int  next_table_entry(char **key, int *value, unsigned *lineno);
21 
22 /* tests if label is in table, returns true/false */
23 /* refresh global variable last_ele */
24 
25 extern bool reaccess_label(char *key, unsigned lineno);
26 
27 /* tests if label is in table  returns 1 or 0 */
28 /* stores address of label in *value if it is in table and value!=0 */
29 
30 extern int is_in_table(char *key, unsigned len, int *value, unsigned lineno);
31 
32 extern bool last_label_reusable(void);
33 
34 /* initializes hash table */
35 
36 extern void hash_table_init(void);
37 
38 /* removes hash table from memory */
39 
40 extern void free_hash_table(void);
41 
42 #endif
43