From 04780422995146b73e64c37ad79f42516c77d52e Mon Sep 17 00:00:00 2001 From: Not Zed Date: Tue, 24 Oct 2000 02:33:08 +0000 Subject: Dumps the contents of indexs. 2000-10-24 Not Zed * dumpindex.c: Dumps the contents of indexs. * hash.c (ibex_hash_dump_rec): Also print the word count. * wordindex.c (unindex_name): Cross-check the cache as well. svn path=/trunk/; revision=6139 --- libibex/dumpindex.c | 32 ++++++++++++++++++++++++++++++++ 1 file changed, 32 insertions(+) create mode 100644 libibex/dumpindex.c (limited to 'libibex/dumpindex.c') diff --git a/libibex/dumpindex.c b/libibex/dumpindex.c new file mode 100644 index 0000000000..92f4b08845 --- /dev/null +++ b/libibex/dumpindex.c @@ -0,0 +1,32 @@ +/* + Dump the hash tables from an ibex file. + */ + +#include +#include + +#include "ibex_internal.h" + +extern void ibex_hash_dump(struct _IBEXIndex *index); + +int main(int argc, char **argv) +{ + ibex *ib; + + if (argc != 2) { + printf("Usage: %s ibexfile\n", argv[0]); + return 1; + } + ib = ibex_open(argv[1], O_RDONLY, 0); + if (ib == NULL) { + perror("Opening ibex file\n"); + return 1; + } + + ibex_hash_dump(ib->words->wordindex); + ibex_hash_dump(ib->words->nameindex); + + ibex_close(ib); + + return 0; +} -- cgit v1.2.3