Rev 2479 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed
Rev 2479 | Rev 2526 | ||
---|---|---|---|
Line 53... | Line 53... | ||
53 | 53 | ||
54 | /** Set of operations for hash table. */ |
54 | /** Set of operations for hash table. */ |
55 | struct hash_table_operations { |
55 | struct hash_table_operations { |
56 | /** Hash function. |
56 | /** Hash function. |
57 | * |
57 | * |
58 | * @param key Array of keys needed to compute hash index. All keys must be passed. |
58 | * @param key Array of keys needed to compute hash index. All keys |
- | 59 | * must be passed. |
|
59 | * |
60 | * |
60 | * @return Index into hash table. |
61 | * @return Index into hash table. |
61 | */ |
62 | */ |
62 | hash_index_t (* hash)(unsigned long key[]); |
63 | hash_index_t (* hash)(unsigned long key[]); |
63 | 64 | ||
64 | /** Hash table item comparison function. |
65 | /** Hash table item comparison function. |
65 | * |
66 | * |
66 | * @param key Array of keys that will be compared with item. It is not necessary to pass all keys. |
67 | * @param key Array of keys that will be compared with item. It is |
- | 68 | * not necessary to pass all keys. |
|
67 | * |
69 | * |
68 | * @return true if the keys match, false otherwise. |
70 | * @return true if the keys match, false otherwise. |
69 | */ |
71 | */ |
70 | int (*compare)(unsigned long key[], hash_count_t keys, link_t *item); |
72 | int (*compare)(unsigned long key[], hash_count_t keys, link_t *item); |
71 | 73 | ||
72 | /** Hash table item removal callback. |
74 | /** Hash table item removal callback. |
73 | * |
75 | * |
74 | * @param item Item that was removed from the hash table. |
76 | * @param item Item that was removed from the hash table. |
75 | */ |
77 | */ |
76 | void (*remove_callback)(link_t *item); |
78 | void (*remove_callback)(link_t *item); |
77 | }; |
79 | }; |
78 | 80 | ||
79 | #define hash_table_get_instance(item, type, member) list_get_instance((item), type, member) |
81 | #define hash_table_get_instance(item, type, member) list_get_instance((item), type, member) |