Commit 756a8b29 authored by vasil's avatar vasil

branches/zip: Add a hash_table_clear() function to drop all elements that

have been added to it.

Approved by:	Marko
parent e7d302e7
......@@ -178,6 +178,15 @@ hash_get_nth_cell(
/* out: pointer to cell */
hash_table_t* table, /* in: hash table */
ulint n); /* in: cell index */
/*****************************************************************
Clears a hash table so that all the cells become empty again. */
UNIV_INLINE
void
hash_table_clear(
/*=============*/
hash_table_t* table); /* in/out: hash table */
/*****************************************************************
Returns the number of cells in a hash table. */
UNIV_INLINE
......
......@@ -23,6 +23,18 @@ hash_get_nth_cell(
return(table->array + n);
}
/*****************************************************************
Clears a hash table so that all the cells become empty again. */
UNIV_INLINE
void
hash_table_clear(
/*=============*/
hash_table_t* table) /* in/out: hash table */
{
memset(table->array, 0x0,
table->n_cells * sizeof(*table->array));
}
/*****************************************************************
Returns the number of cells in a hash table. */
UNIV_INLINE
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment