ucx/map.h

changeset 209
4f02199d8aae
parent 208
262c7be94eba
child 225
a1a068c2c4ef
equal deleted inserted replaced
208:262c7be94eba 209:4f02199d8aae
156 156
157 /** 157 /**
158 * Frees the contents of a hash map. 158 * Frees the contents of a hash map.
159 * 159 *
160 * This is a convenience function that iterates over the map and passes all 160 * This is a convenience function that iterates over the map and passes all
161 * values to the standard library free() function. 161 * values to the specified destructor function (e.g. stdlib free()).
162 * 162 *
163 * You must ensure, that it is valid to pass each value in the map to free(). 163 * You must ensure, that it is valid to pass each value in the map to the same
164 * destructor function.
164 * 165 *
165 * You should free or clear the map afterwards, as the contents will be invalid. 166 * You should free or clear the map afterwards, as the contents will be invalid.
166 * 167 *
167 * @param map for which the contents shall be freed 168 * @param map for which the contents shall be freed
169 * @param destr pointer to the destructor function
168 * @see ucx_map_free() 170 * @see ucx_map_free()
169 * @see ucx_map_clear() 171 * @see ucx_map_clear()
170 */ 172 */
171 void ucx_map_free_content(UcxMap *map); 173 void ucx_map_free_content(UcxMap *map, ucx_destructor destr);
172 174
173 /** 175 /**
174 * Clears a hash map. 176 * Clears a hash map.
175 * 177 *
176 * <b>Note:</b> the contents are <b>not</b> freed, use ucx_map_free_content() 178 * <b>Note:</b> the contents are <b>not</b> freed, use ucx_map_free_content()

mercurial