FreeBSD/usr.bin/grep/regex/hashtable.c
/*
 * Retrieves the value for key from the hash table tbl and places
 * it to the space indicated by the value argument.
 * Returns HASH_OK if the value has been found and retrieved or
 * HASH_NOTFOUND otherwise.
 */
Retrieves the value for key from the hash table tbl and places
it to the space indicated by the value argument.
Returns HASH_OK if the value has been found and retrieved or
HASH_NOTFOUND otherwise.
Retrieves the value for key from the hash table tbl and places it to the space indicated by the value argument . Returns HASH_OK if the value has been found and retrieved or HASH_NOTFOUND otherwise .
int
hashtable_get(hashtable *tbl, const void *key, void *value)
{
  hashtable_entry **entry;
  entry = hashtable_lookup(tbl, key);
  if (entry == NULL)
    {
      DPRINT(("hashtable_get: entry is not available in the hashtable\n"));
      return (HASH_NOTFOUND);
    }
  memcpy(value, (*entry)->value, tbl->value_size);
  DPRINT(("hashtable_get: entry successfully copied into output buffer\n"));
  return (HASH_OK);
}
int hashtable_get ( hashtable * tbl , const void * key , void * value ) { hashtable_entry * * entry ; entry = hashtable_lookup ( tbl , key ) ; if ( entry == NULL ) { DPRINT ( ( " \n " ) ) ; return ( HASH_NOTFOUND ) ; } memcpy ( value , ( * entry ) -> value , tbl -> value_size ) ; DPRINT ( ( " \n " ) ) ; return ( HASH_OK ) ; }
Retrieves the value for key from the hash table tbl and places
 it to the space indicated by the value argument.
Retrieves the value for key from the hash table tbl and places it to the space indicated by the value argument .