Lines Matching refs:iterator
132 HT_ITERATOR iterator;
139 while ((item = ht_findfirst(handle, &iterator)) != 0)
537 * The iterator is initialized and the first item in the table (as
539 * number is stored in the iterator to determine whether or not the
544 ht_findfirst(HT_HANDLE *handle, HT_ITERATOR *iterator)
549 if (handle == 0 || iterator == 0 || handle->ht_total_items == 0)
552 (void) memset(iterator, 0, sizeof (HT_ITERATOR));
553 iterator->hti_handle = handle;
554 iterator->hti_sequence = handle->ht_sequence;
559 iterator->hti_index = h_index;
560 iterator->hti_item = item;
571 * Find the next item in the table for the given iterator. Iterators must
576 * - an invalid iterator (i.e. ht_findfirst has not been called)
584 ht_findnext(HT_ITERATOR *iterator)
591 if (iterator == 0 || iterator->hti_handle == 0 ||
592 iterator->hti_sequence == 0) {
593 /* Invalid iterator */
597 handle = iterator->hti_handle;
599 if (iterator->hti_item == 0 ||
600 iterator->hti_sequence != handle->ht_sequence) {
611 item = ht_bucket_search(iterator->hti_item->hi_next);
613 iterator->hti_item = item;
622 for (index = iterator->hti_index + 1; index < total; ++index) {
625 iterator->hti_index = index;
626 iterator->hti_item = item;
631 iterator->hti_index = 0;
632 iterator->hti_item = 0;
633 iterator->hti_sequence = 0;