Lines Matching +defs:val +defs:callback
87 * mod_hash_insert(hash, key, val):
91 * mod_hash_insert_reserve(hash, key, val, handle):
104 * mod_hash_remove(hash, key, *val):
106 * stored key, and returning the value in val.
108 * mod_hash_replace(hash, key, val)
117 * mod_hash_find(hash, key, val):
120 * mod_hash_find_cb(hash, key, val, found_callback)
122 * If a value is found, call specified callback passing key and val to it.
123 * The callback is called with the hash lock held.
127 * mod_hash_walk(hash, callback(key, elem, arg), arg)
128 * walks all the elements in the hashtable and invokes the callback
130 * is locked for readers so the callback function should not attempt
131 * to do any updates to the hashable. the callback function should
157 #define MH_VAL_DESTROY(hash, val) ((hash->mh_vdtor)(val))
185 mod_hash_null_valdtor(mod_hash_val_t val)
236 mod_hash_strval_dtor(mod_hash_val_t val)
238 char *c = (char *)val;
536 * insert 'val' into the hash table, using 'key' as its key. If 'key' is
537 * already a key in the hash, an error will be returned, and the key-val
546 mod_hash_val_t val, mod_hash_hndl_t handle)
569 entry->mhe_val = val;
579 mod_hash_insert(mod_hash_t *hash, mod_hash_key_t key, mod_hash_val_t val)
595 res = i_mod_hash_insert_nosync(hash, key, val, (mod_hash_hndl_t)0);
603 mod_hash_val_t val, mod_hash_hndl_t handle)
618 res = i_mod_hash_insert_nosync(hash, key, val, handle);
671 mod_hash_val_t *val)
699 *val = e->mhe_val;
707 mod_hash_remove(mod_hash_t *hash, mod_hash_key_t key, mod_hash_val_t *val)
712 res = i_mod_hash_remove_nosync(hash, key, val);
725 mod_hash_replace(mod_hash_t *hash, mod_hash_key_t key, mod_hash_val_t val)
738 res = i_mod_hash_insert_nosync(hash, key, val, (mod_hash_hndl_t)0);
752 mod_hash_val_t val;
757 if ((rv = i_mod_hash_remove_nosync(hash, key, &val)) == 0) {
761 MH_VAL_DESTROY(hash, val);
775 mod_hash_val_t *val)
784 *val = e->mhe_val;
794 mod_hash_find(mod_hash_t *hash, mod_hash_key_t key, mod_hash_val_t *val)
799 res = i_mod_hash_find_nosync(hash, key, val);
806 mod_hash_find_cb(mod_hash_t *hash, mod_hash_key_t key, mod_hash_val_t *val,
812 res = i_mod_hash_find_nosync(hash, key, val);
814 find_cb(key, *val);
822 mod_hash_find_cb_rval(mod_hash_t *hash, mod_hash_key_t key, mod_hash_val_t *val,
828 res = i_mod_hash_find_nosync(hash, key, val);
830 *cb_rval = find_cb(key, *val);
839 uint_t (*callback)(mod_hash_key_t, mod_hash_val_t *, void *), void *arg)
850 res = callback(e->mhe_key, e->mhe_val, arg);
858 * Walks all the elements in the hashtable and invokes the callback
860 * is locked for readers so the callback function should not attempt
861 * to do any updates to the hashable. The callback function should
867 uint_t (*callback)(mod_hash_key_t, mod_hash_val_t *, void *), void *arg)
870 i_mod_hash_walk_nosync(hash, callback, arg);