aboutsummaryrefslogtreecommitdiffstats
path: root/libibex/find.c
diff options
context:
space:
mode:
authorNotZed <NotZed@HelixCode.com>2000-04-12 23:09:58 +0800
committerMichael Zucci <zucchi@src.gnome.org>2000-04-12 23:09:58 +0800
commit195cd8844b7a2e3b19e387f4157bb5c5141f0062 (patch)
tree7003aa5ece07860765e5149dfed7fae6d8d9c075 /libibex/find.c
parent73b0317b1fabbb29ae06841c4692a79b80436262 (diff)
downloadgsoc2013-evolution-195cd8844b7a2e3b19e387f4157bb5c5141f0062.tar
gsoc2013-evolution-195cd8844b7a2e3b19e387f4157bb5c5141f0062.tar.gz
gsoc2013-evolution-195cd8844b7a2e3b19e387f4157bb5c5141f0062.tar.bz2
gsoc2013-evolution-195cd8844b7a2e3b19e387f4157bb5c5141f0062.tar.lz
gsoc2013-evolution-195cd8844b7a2e3b19e387f4157bb5c5141f0062.tar.xz
gsoc2013-evolution-195cd8844b7a2e3b19e387f4157bb5c5141f0062.tar.zst
gsoc2013-evolution-195cd8844b7a2e3b19e387f4157bb5c5141f0062.zip
Debug function to dump the whole index to stdout.
2000-04-12 NotZed <NotZed@HelixCode.com> * 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 <NotZed@HelixCode.com> * 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
Diffstat (limited to 'libibex/find.c')
-rw-r--r--libibex/find.c20
1 files changed, 20 insertions, 0 deletions
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;i<refs->len;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);
+}