FreeBSD/usr.bin/grep/regex/hashtable.c
/*
 * Removes the entry with the specifified key from the hash table
 * tbl. Returns HASH_OK if the entry has been found and removed
 * or HASH_NOTFOUND otherwise.
 */
Removes the entry with the specifified key from the hash table
tbl. Returns HASH_OK if the entry has been found and removed
or HASH_NOTFOUND otherwise.
Removes the entry with the specifified key from the hash table tbl . Returns HASH_OK if the entry has been found and removed or HASH_NOTFOUND otherwise .
int
hashtable_remove(hashtable *tbl, const void *key)
{
  hashtable_entry **entry;
  entry = hashtable_lookup(tbl, key);
  if (entry == NULL)
    {
      DPRINT(("hashtable_remove: entry is not available in the hashtable\n"));
      return (HASH_NOTFOUND);
    }
  free((*entry)->key);
  free((*entry)->value);
  free(*entry);
  *entry = NULL;
  tbl->usage--;
  DPRINT(("hashtable_remove: entry successfully removed\n"));
  return (HASH_OK);
}
int hashtable_remove ( hashtable * tbl , const void * key ) { hashtable_entry * * entry ; entry = hashtable_lookup ( tbl , key ) ; if ( entry == NULL ) { DPRINT ( ( " \n " ) ) ; return ( HASH_NOTFOUND ) ; } free ( ( * entry ) -> key ) ; free ( ( * entry ) -> value ) ; free ( * entry ) ; * entry = NULL ; tbl -> usage -- ; DPRINT ( ( " \n " ) ) ; return ( HASH_OK ) ; }
Removes the entry with the specifified key from the hash table
 tbl.
Removes the entry with the specifified key from the hash table tbl .