aboutsummaryrefslogtreecommitdiffstats
path: root/libibex/dumpindex.c
diff options
context:
space:
mode:
authornobody <nobody@localhost>2001-05-19 20:49:14 +0800
committernobody <nobody@localhost>2001-05-19 20:49:14 +0800
commit88afa58a5b1f01cbefd89795c4dab371fb31f9c3 (patch)
tree8ef1ebf263e35adadb85e8450c2559f6d9edc16b /libibex/dumpindex.c
parent0b11ddccb9aa109b28f69fefb790453b558a096c (diff)
downloadgsoc2013-evolution-GAL_0_8.tar
gsoc2013-evolution-GAL_0_8.tar.gz
gsoc2013-evolution-GAL_0_8.tar.bz2
gsoc2013-evolution-GAL_0_8.tar.lz
gsoc2013-evolution-GAL_0_8.tar.xz
gsoc2013-evolution-GAL_0_8.tar.zst
gsoc2013-evolution-GAL_0_8.zip
This commit was manufactured by cvs2svn to create tag 'GAL_0_8'.GAL_0_8
svn path=/tags/GAL_0_8/; revision=9892
Diffstat (limited to 'libibex/dumpindex.c')
-rw-r--r--libibex/dumpindex.c63
1 files changed, 0 insertions, 63 deletions
diff --git a/libibex/dumpindex.c b/libibex/dumpindex.c
deleted file mode 100644
index 410a7083d6..0000000000
--- a/libibex/dumpindex.c
+++ /dev/null
@@ -1,63 +0,0 @@
-/*
- 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);
-
-static void
-index_iterate(struct _IBEXIndex *index)
-{
- struct _IBEXCursor *idc;
- int len;
- char *key;
- int total = 0, totallen = 0;
-
- idc = index->klass->get_cursor(index);
- key = idc->klass->next_key(idc, &len);
- while (len) {
- total++;
- totallen += len;
- printf("%s\n", key);
- g_free(key);
- key = idc->klass->next_key(idc, &len);
- }
- g_free(key);
-
- idc->klass->close(idc);
-
- printf("Iterate Totals: %d items, total bytes %d\n", total, totallen);
-}
-
-int main(int argc, char **argv)
-{
- ibex *ib;
-
-#ifdef ENABLE_THREADS
- g_thread_init(0);
-#endif
-
- 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);
-
- index_iterate(ib->words->wordindex);
- index_iterate(ib->words->nameindex);
-
- ibex_close(ib);
-
- return 0;
-}