Lines Matching refs:item

32  * |handle|---> |index 0|--->|item|--->|item|--->
36 * |index 2|--->|item|--->|item|--->|item|--->
131 HT_ITEM *item;
139 while ((item = ht_findfirst(handle, &iterator)) != 0)
140 (void) ht_remove_item(handle, item->hi_key);
167 * corresponding item in the hash table. The handle and key pointers
170 * Returns the table index location for the item.
214 * Adds an item to a hash table. The hash table is identified by the
216 * item can be null; it is never dereferenced. We don't check for
218 * item added will be to the front of the duplicate list.
222 * If the item is successfully inserted, a pointer to the item object
230 HT_ITEM *item;
249 if ((item = malloc(msize)) == 0)
252 item->hi_key = (char *)item + sizeof (HT_ITEM);
253 (void) memcpy(item->hi_key, key, key_len);
254 item->hi_data = (void *)data;
255 item->hi_flags = 0;
262 item->hi_next = handle->ht_table[h_index].he_head;
263 handle->ht_table[h_index].he_head = item;
269 return (item);
276 * Replace an item in a hash table. The item associated with key is removed
277 * using ht_remove_item and a new item is added using ht_add_item. We rely
294 * Remove an item from a hash table. If there are duplicate keys, then the
340 * Since the key and the item were allocated as
361 * Find an item in a hash table. If there are duplicate keys then the
362 * first item found (which will be the last one added) will be returned.
364 * Returns a pointer to an item. Otherwise returns a null pointer to
401 * an item when it is removed from the table, i.e. free any memory
402 * allocated for that data item.
429 * to free the item data if it was dynamically allocated.
451 * We have a marked item: remove it.
463 * Since the key and the item were allocated as
490 * This function marks an item for deletion, which may be useful when
495 ht_mark_delete(HT_HANDLE *handle, HT_ITEM *item)
497 if (handle && item) {
498 item->hi_flags |= HTIF_MARKED_DELETED;
506 * This function clear an item from marked for deletion list.
509 ht_clear_delete(HT_HANDLE *handle, HT_ITEM *item)
511 if (handle && item) {
512 item->hi_flags &= ~HTIF_MARKED_DELETED;
520 * Returns first item which is not marked as deleted
526 HT_ITEM *item = head;
527 while ((item != 0) && (item->hi_flags & HTIF_MARKED_DELETED))
528 item = item->hi_next;
530 return (item);
537 * The iterator is initialized and the first item in the table (as
546 HT_ITEM *item;
557 item = ht_bucket_search(handle->ht_table[h_index].he_head);
558 if (item != 0) {
560 iterator->hti_item = item;
561 return (item);
571 * Find the next item in the table for the given iterator. Iterators must
572 * be initialized by ht_findfirst, which will also return the first item
573 * in the table. If an item is available, a pointer to it is returned.
587 HT_ITEM *item;
609 * Check for another item in the current bucket.
611 item = ht_bucket_search(iterator->hti_item->hi_next);
612 if (item != 0) {
613 iterator->hti_item = item;
614 return (item);
619 * bucket with something in it and return the head item.
623 item = ht_bucket_search(handle->ht_table[index].he_head);
624 if (item != 0) {
626 iterator->hti_item = item;
627 return (item);