6 #define TABLE_SIZE 32768 /* size of the hash table (must be power of 2) */
9 struct table_type
{ /* HASH TABLE */
11 struct object_list
**pointer
;
14 extern struct table_type table
[TABLE_SIZE
];
18 unsigned int hash(unsigned int id
);
21 /* adds object to hash table */
22 void add_to_table(struct object_list
*pointer
);
25 /* removes object from table */
26 /* returns pointer to the object */
27 /* if there's not such an object returns null */
28 struct object_list
* remove_from_table(unsigned int id
);
32 /* tests if object is in table */
33 /* returns pointer to the object, if no returns 0 */
34 struct object_list
*find_in_table(unsigned int id
);
37 /* initializes hash table */
38 void hash_table_init(void);
41 /* removes hash table from memory */
42 void free_hash_table(void);