Lines Matching refs:iterator
154 hash_remove_current(struct hash_table *table, struct hash_iterator *iterator)
156 uint32_t index = iterator->bucket;
159 if (iterator->current == NULL)
166 if (element == iterator->current) {
167 iterator->current = lastElement;
239 hash_open(struct hash_table *table, struct hash_iterator *iterator)
241 if (iterator == NULL) {
242 iterator = (struct hash_iterator *)malloc(sizeof(struct hash_iterator));
243 if (iterator == NULL)
247 hash_rewind(table, iterator);
249 return iterator;
254 hash_close(struct hash_table *table, struct hash_iterator *iterator, bool freeIterator)
257 free(iterator);
262 hash_rewind(struct hash_table *table, struct hash_iterator *iterator)
264 iterator->current = NULL;
265 iterator->bucket = -1;
270 hash_next(struct hash_table *table, struct hash_iterator *iterator)
275 if (iterator->current == NULL) {
277 for (index = (uint32_t)(iterator->bucket + 1); index < table->table_size; index++) {
279 iterator->bucket = index;
280 iterator->current = table->table[index];
285 iterator->current = NEXT(table, iterator->current);
286 if (!iterator->current)
290 return iterator->current;