-
Committer:
Colin Watson
-
Date:
2019-12-27 23:58:17 UTC
-
Revision ID:
git-v1:2c61068e903fc65c114bb7633abae58d382cec80
Replace kvhash with gl_map/gl_omap
A list was a clumsy implementation of this; a map is more appropriate.
* bootstrap.conf (gnulib_modules): Add hash-map, hash-pjw-bare,
rbtree-omap, stdbool, xmap, and xomap; remove rbtreehash-list.
* src/glcontainers.c: New file.
* src/glcontainers.h (string_equals, string_hash, plain_free,
new_string_map, new_string_omap, map_contains, omap_contains): Add
prototypes.
(GL_OMAP_FOREACH_START, GL_OMAP_FOREACH_END): New macros.
* src/format.c (binfmt_new): Take a map rather than a list.
(kvhash_dispose_binfmt): Remove.
* src/format.h (binfmt_new): Update prototype.
(kvhash_dispose_binfmt): Remove prototype.
* src/update-binfmts.c (formats): Declare as a map rather than a list.
(get_import, load_format, act_enable, act_disable, act_install,
act_remove, act_import, act_unimport, act_display, main): Update to the
map API.
(act_import, act_unimport): Free import before returning.
* src/kvhash.c, src/kvhash.h: Remove.
* src/Makefile.am (COMMON): Add glcontainers.c; remove kvhash.c and
kvhash.h.