Lines Matching refs:bucket

57     struct hash_entry *bucket;  member
176 struct hash_entry const *bucket; in hash_get_max_bucket_length() local
179 for (bucket = table->bucket; bucket < table->bucket_limit; bucket++) in hash_get_max_bucket_length()
181 if (bucket->data) in hash_get_max_bucket_length()
183 struct hash_entry const *cursor = bucket; in hash_get_max_bucket_length()
203 struct hash_entry const *bucket; in hash_table_ok() local
207 for (bucket = table->bucket; bucket < table->bucket_limit; bucket++) in hash_table_ok()
209 if (bucket->data) in hash_table_ok()
211 struct hash_entry const *cursor = bucket; in hash_table_ok()
254 return table->bucket + n; in safe_hasher()
263 struct hash_entry const *bucket = safe_hasher (table, entry); in hash_lookup() local
266 if (bucket->data == NULL) in hash_lookup()
269 for (cursor = bucket; cursor; cursor = cursor->next) in hash_lookup()
290 struct hash_entry const *bucket; in hash_get_first() local
295 for (bucket = table->bucket; ; bucket++) in hash_get_first()
296 if (! (bucket < table->bucket_limit)) in hash_get_first()
298 else if (bucket->data) in hash_get_first()
299 return bucket->data; in hash_get_first()
309 struct hash_entry const *bucket = safe_hasher (table, entry); in hash_get_next() local
313 cursor = bucket; in hash_get_next()
323 while (++bucket < table->bucket_limit) in hash_get_next()
324 if (bucket->data) in hash_get_next()
325 return bucket->data; in hash_get_next()
340 struct hash_entry const *bucket; in hash_get_entries() local
343 for (bucket = table->bucket; bucket < table->bucket_limit; bucket++) in hash_get_entries()
345 if (bucket->data) in hash_get_entries()
347 for (cursor = bucket; cursor; cursor = cursor->next) in hash_get_entries()
372 struct hash_entry const *bucket; in hash_do_for_each() local
375 for (bucket = table->bucket; bucket < table->bucket_limit; bucket++) in hash_do_for_each()
377 if (bucket->data) in hash_do_for_each()
379 for (cursor = bucket; cursor; cursor = cursor->next) in hash_do_for_each()
626 table->bucket = calloc (table->n_buckets, sizeof *table->bucket); in hash_initialize()
627 if (table->bucket == NULL) in hash_initialize()
629 table->bucket_limit = table->bucket + table->n_buckets; in hash_initialize()
655 struct hash_entry *bucket; in hash_clear() local
657 for (bucket = table->bucket; bucket < table->bucket_limit; bucket++) in hash_clear()
659 if (bucket->data) in hash_clear()
665 for (cursor = bucket->next; cursor; cursor = next) in hash_clear()
680 table->data_freer (bucket->data); in hash_clear()
681 bucket->data = NULL; in hash_clear()
682 bucket->next = NULL; in hash_clear()
698 struct hash_entry *bucket; in hash_free() local
705 for (bucket = table->bucket; bucket < table->bucket_limit; bucket++) in hash_free()
707 if (bucket->data) in hash_free()
709 for (cursor = bucket; cursor; cursor = cursor->next) in hash_free()
722 for (bucket = table->bucket; bucket < table->bucket_limit; bucket++) in hash_free()
724 for (cursor = bucket->next; cursor; cursor = next) in hash_free()
741 free (table->bucket); in hash_free()
793 struct hash_entry *bucket = safe_hasher (table, entry); in hash_find_entry() local
796 *bucket_head = bucket; in hash_find_entry()
799 if (bucket->data == NULL) in hash_find_entry()
803 if (entry == bucket->data || table->comparator (entry, bucket->data)) in hash_find_entry()
805 void *data = bucket->data; in hash_find_entry()
809 if (bucket->next) in hash_find_entry()
811 struct hash_entry *next = bucket->next; in hash_find_entry()
815 *bucket = *next; in hash_find_entry()
820 bucket->data = NULL; in hash_find_entry()
828 for (cursor = bucket; cursor->next; cursor = cursor->next) in hash_find_entry()
862 struct hash_entry *bucket; in transfer_entries() local
865 for (bucket = src->bucket; bucket < src->bucket_limit; bucket++) in transfer_entries()
866 if (bucket->data) in transfer_entries()
877 for (cursor = bucket->next; cursor; cursor = next) in transfer_entries()
903 data = bucket->data; in transfer_entries()
904 bucket->next = NULL; in transfer_entries()
928 bucket->data = NULL; in transfer_entries()
954 new_table->bucket = calloc (new_size, sizeof *new_table->bucket); in hash_rehash()
955 if (new_table->bucket == NULL) in hash_rehash()
958 new_table->bucket_limit = new_table->bucket + new_size; in hash_rehash()
989 free (table->bucket); in hash_rehash()
990 table->bucket = new_table->bucket; in hash_rehash()
1017 free (new_table->bucket); in hash_rehash()
1042 struct hash_entry *bucket; in hash_insert_if_absent() local
1051 if ((data = hash_find_entry (table, entry, &bucket, false)) != NULL) in hash_insert_if_absent()
1087 if (hash_find_entry (table, entry, &bucket, false) != NULL) in hash_insert_if_absent()
1094 if (bucket->data) in hash_insert_if_absent()
1104 new_entry->next = bucket->next; in hash_insert_if_absent()
1105 bucket->next = new_entry; in hash_insert_if_absent()
1112 bucket->data = (void *) entry; in hash_insert_if_absent()
1151 struct hash_entry *bucket; in hash_delete() local
1153 data = hash_find_entry (table, entry, &bucket, true); in hash_delete()
1158 if (!bucket->data) in hash_delete()
1214 struct hash_entry *bucket = (struct hash_entry *) table->bucket; in hash_print() local
1216 for ( ; bucket < table->bucket_limit; bucket++) in hash_print()
1220 if (bucket) in hash_print()
1221 printf ("%lu:\n", (unsigned long int) (bucket - table->bucket)); in hash_print()
1223 for (cursor = bucket; cursor; cursor = cursor->next) in hash_print()