From 195cd8844b7a2e3b19e387f4157bb5c5141f0062 Mon Sep 17 00:00:00 2001 From: NotZed Date: Wed, 12 Apr 2000 15:09:58 +0000 Subject: Debug function to dump the whole index to stdout. 2000-04-12 NotZed * find.c (ibex_dump_all): Debug function to dump the whole index to stdout. * words.c (get_ibex_file): Use g_strdup(), not strdup(). 2000-04-11 NotZed * file.c (write_word): Always write out all words we have (even if its 0 ... the file expects it). No longer check for removed files. (store_word): Check for removed files here, and only add to the ordered tree if we have references left to this word. (ibex_write): First insert into the tree, to determine the wordcount to be saved in the output file, and then write that. (ibex_open): Remove some debug. * words.c (ibex_index_buffer): Always set 'unread', if it is a valid pointer (dont rely on caller to initialise it). svn path=/trunk/; revision=2409 --- libibex/find.c | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) (limited to 'libibex/find.c') diff --git a/libibex/find.c b/libibex/find.c index 91e611401c..e0b5d263c8 100644 --- a/libibex/find.c +++ b/libibex/find.c @@ -160,3 +160,23 @@ ibex_find_all (ibex *ib, GPtrArray *words) g_tree_destroy (work); return ret; } + +static void +ibex_dump_foo(char *key, GPtrArray *refs, void *data) +{ + int i; + + printf("%s: ", key); + for (i=0;ilen;i++) { + ibex_file *ibf = g_ptr_array_index (refs, i); + printf("%c%s", ibf->index==-1?'-':' ', ibf->name); + } + printf("\n"); +} + +/* debug function to dump the tree, in key order */ +void +ibex_dump_all (ibex *ib) +{ + g_hash_table_foreach(ib->words, ibex_dump_foo, 0); +} -- cgit v1.2.3