Lines Matching refs:table
18 * Description: generic hash table implementation
31 const struct hashtable *table),
61 int hashtable_hash(const struct hashtable *table, const void *data)
63 return table->hash(data, table);
67 hashtable_find(const struct hashtable *table, const void *data, int id)
72 list_for_each(e, &table->members[id]) {
74 if (table->compare(n, data)) {
82 int hashtable_add(struct hashtable *table, struct hashtable_node *n, int id)
84 /* hash table is full */
85 if (table->count >= table->limit) {
89 list_add(&n->head, &table->members[id]);
90 table->count++;
94 void hashtable_del(struct hashtable *table, struct hashtable_node *n)
97 table->count--;
100 int hashtable_flush(struct hashtable *table)
106 for (i=0; i < table->hashsize; i++) {
107 list_for_each_safe(e, tmp, &table->members[i]) {
116 hashtable_iterate_limit(struct hashtable *table, void *data,
124 for (i=from; i < table->hashsize && i < from+steps; i++) {
125 list_for_each_safe(e, tmp, &table->members[i]) {
134 int hashtable_iterate(struct hashtable *table, void *data,
137 return hashtable_iterate_limit(table, data, 0, UINT_MAX, iterate);
140 unsigned int hashtable_counter(const struct hashtable *table)
142 return table->count;