hashtbl, strtbl: add hash_free_all(), split strtbl_find()
commitbbb39579ec340aba9cda4c7033dd934b620423ea
authorH. Peter Anvin <hpa@zytor.com>
Mon, 24 Apr 2017 07:41:21 +0000 (24 00:41 -0700)
committerH. Peter Anvin <hpa@zytor.com>
Mon, 24 Apr 2017 07:54:51 +0000 (24 00:54 -0700)
tree94a5e00fc63672d2ec15feab825e3c295bfe4111
parentbf0bcef3d4975ab964d573fecbe2a8b2960b8120
hashtbl, strtbl: add hash_free_all(), split strtbl_find()

Add hash_free_all() to factor common code of iterating over all
members of a hash to free them with a single nasm_free().

Split strtbl_find() into strtbl_find() and strtbl_add().  It is very
unlikely that the same call site will want to have both of these
functionalities, and in the end the code for the two functions are
surprisingly different.

Signed-off-by: H. Peter Anvin <hpa@zytor.com>
include/hashtbl.h
nasmlib/hashtbl.c
nasmlib/srcfile.c
output/strtbl.c
output/strtbl.h