Rev 1702 | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed
Rev 1702 | Rev 1780 | ||
---|---|---|---|
Line 53... | Line 53... | ||
53 | * |
53 | * |
54 | * @param key Array of keys needed to compute hash index. All keys must be passed. |
54 | * @param key Array of keys needed to compute hash index. All keys must be passed. |
55 | * |
55 | * |
56 | * @return Index into hash table. |
56 | * @return Index into hash table. |
57 | */ |
57 | */ |
58 | index_t (* hash)(__native key[]); |
58 | index_t (* hash)(unative_t key[]); |
59 | 59 | ||
60 | /** Hash table item comparison function. |
60 | /** Hash table item comparison function. |
61 | * |
61 | * |
62 | * @param key Array of keys that will be compared with item. It is not necessary to pass all keys. |
62 | * @param key Array of keys that will be compared with item. It is not necessary to pass all keys. |
63 | * |
63 | * |
64 | * @return true if the keys match, false otherwise. |
64 | * @return true if the keys match, false otherwise. |
65 | */ |
65 | */ |
66 | bool (*compare)(__native key[], count_t keys, link_t *item); |
66 | bool (*compare)(unative_t key[], count_t keys, link_t *item); |
67 | 67 | ||
68 | /** Hash table item removal callback. |
68 | /** Hash table item removal callback. |
69 | * |
69 | * |
70 | * @param item Item that was removed from the hash table. |
70 | * @param item Item that was removed from the hash table. |
71 | */ |
71 | */ |
Line 73... | Line 73... | ||
73 | }; |
73 | }; |
74 | 74 | ||
75 | #define hash_table_get_instance(item, type, member) list_get_instance((item), type, member) |
75 | #define hash_table_get_instance(item, type, member) list_get_instance((item), type, member) |
76 | 76 | ||
77 | extern void hash_table_create(hash_table_t *h, count_t m, count_t max_keys, hash_table_operations_t *op); |
77 | extern void hash_table_create(hash_table_t *h, count_t m, count_t max_keys, hash_table_operations_t *op); |
78 | extern void hash_table_insert(hash_table_t *h, __native key[], link_t *item); |
78 | extern void hash_table_insert(hash_table_t *h, unative_t key[], link_t *item); |
79 | extern link_t *hash_table_find(hash_table_t *h, __native key[]); |
79 | extern link_t *hash_table_find(hash_table_t *h, unative_t key[]); |
80 | extern void hash_table_remove(hash_table_t *h, __native key[], count_t keys); |
80 | extern void hash_table_remove(hash_table_t *h, unative_t key[], count_t keys); |
81 | 81 | ||
82 | #endif |
82 | #endif |
83 | 83 | ||
84 | /** @} |
84 | /** @} |
85 | */ |
85 | */ |