Lines Matching refs:item

35  * |handle|---> |index 0|--->|item|--->|item|--->
39 * |index 2|--->|item|--->|item|--->|item|--->
135 HT_ITEM *item;
143 while ((item = ht_findfirst(handle, &iterator)) != 0)
144 (void) ht_remove_item(handle, item->hi_key);
171 * corresponding item in the hash table. The handle and key pointers
174 * Returns the table index location for the item.
218 * Adds an item to a hash table. The hash table is identified by the
220 * item can be null; it is never dereferenced. We don't check for
222 * item added will be to the front of the duplicate list.
226 * If the item is successfully inserted, a pointer to the item object
234 HT_ITEM *item;
253 if ((item = malloc(msize)) == 0)
256 item->hi_key = (char *)item + sizeof (HT_ITEM);
257 (void) memcpy(item->hi_key, key, key_len);
258 item->hi_data = (void *)data;
259 item->hi_flags = 0;
266 item->hi_next = handle->ht_table[h_index].he_head;
267 handle->ht_table[h_index].he_head = item;
273 return (item);
280 * Replace an item in a hash table. The item associated with key is removed
281 * using ht_remove_item and a new item is added using ht_add_item. We rely
298 * Remove an item from a hash table. If there are duplicate keys, then the
344 * Since the key and the item were allocated as
365 * Find an item in a hash table. If there are duplicate keys then the
366 * first item found (which will be the last one added) will be returned.
368 * Returns a pointer to an item. Otherwise returns a null pointer to
405 * an item when it is removed from the table, i.e. free any memory
406 * allocated for that data item.
433 * to free the item data if it was dynamically allocated.
455 * We have a marked item: remove it.
467 * Since the key and the item were allocated as
494 * This function marks an item for deletion, which may be useful when
499 ht_mark_delete(HT_HANDLE *handle, HT_ITEM *item)
501 if (handle && item) {
502 item->hi_flags |= HTIF_MARKED_DELETED;
510 * This function clear an item from marked for deletion list.
513 ht_clear_delete(HT_HANDLE *handle, HT_ITEM *item)
515 if (handle && item) {
516 item->hi_flags &= ~HTIF_MARKED_DELETED;
524 * Returns first item which is not marked as deleted
530 HT_ITEM *item = head;
531 while ((item != 0) && (item->hi_flags & HTIF_MARKED_DELETED))
532 item = item->hi_next;
534 return (item);
541 * The iterator is initialized and the first item in the table (as
550 HT_ITEM *item;
561 item = ht_bucket_search(handle->ht_table[h_index].he_head);
562 if (item != 0) {
564 iterator->hti_item = item;
565 return (item);
575 * Find the next item in the table for the given iterator. Iterators must
576 * be initialized by ht_findfirst, which will also return the first item
577 * in the table. If an item is available, a pointer to it is returned.
591 HT_ITEM *item;
613 * Check for another item in the current bucket.
615 item = ht_bucket_search(iterator->hti_item->hi_next);
616 if (item != 0) {
617 iterator->hti_item = item;
618 return (item);
623 * bucket with something in it and return the head item.
627 item = ht_bucket_search(handle->ht_table[index].he_head);
628 if (item != 0) {
630 iterator->hti_item = item;
631 return (item);