aboutsummaryrefslogtreecommitdiffstats
path: root/libibex/dumpindex.c
diff options
context:
space:
mode:
authorNot Zed <NotZed@HelixCode.com>2000-10-24 10:33:08 +0800
committerMichael Zucci <zucchi@src.gnome.org>2000-10-24 10:33:08 +0800
commit04780422995146b73e64c37ad79f42516c77d52e (patch)
tree12663cb6be8533f50e7820563f1b705f2c5f6231 /libibex/dumpindex.c
parentbdb308067c223640c2c14ebd92205e0ae1d20326 (diff)
downloadgsoc2013-evolution-04780422995146b73e64c37ad79f42516c77d52e.tar
gsoc2013-evolution-04780422995146b73e64c37ad79f42516c77d52e.tar.gz
gsoc2013-evolution-04780422995146b73e64c37ad79f42516c77d52e.tar.bz2
gsoc2013-evolution-04780422995146b73e64c37ad79f42516c77d52e.tar.lz
gsoc2013-evolution-04780422995146b73e64c37ad79f42516c77d52e.tar.xz
gsoc2013-evolution-04780422995146b73e64c37ad79f42516c77d52e.tar.zst
gsoc2013-evolution-04780422995146b73e64c37ad79f42516c77d52e.zip
Dumps the contents of indexs.
2000-10-24 Not Zed <NotZed@HelixCode.com> * 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
Diffstat (limited to 'libibex/dumpindex.c')
-rw-r--r--libibex/dumpindex.c32
1 files changed, 32 insertions, 0 deletions
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 <stdio.h>
+#include <stdlib.h>
+
+#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;
+}