From cd9df589eacaf47a085119fdb91e41a01eab9bb0 Mon Sep 17 00:00:00 2001 From: NotZed Date: Thu, 17 Feb 2000 01:25:49 +0000 Subject: Finds if a word is indexed under a given name. 2000-02-16 NotZed * find.[ch] (ibex_find_name): Finds if a word is indexed under a given name. svn path=/trunk/; revision=1812 --- libibex/find.c | 22 +++++++++++++++++++++- 1 file changed, 21 insertions(+), 1 deletion(-) (limited to 'libibex/find.c') diff --git a/libibex/find.c b/libibex/find.c index 0937331a83..5b45c57787 100644 --- a/libibex/find.c +++ b/libibex/find.c @@ -25,7 +25,27 @@ ibex_find(ibex *ib, char *word) g_ptr_array_add(ret, ibf->name); } } - return ret; + return ret; +} + +gboolean +ibex_find_name(ibex *ib, char *name, char *word) +{ + GPtrArray *refs; + ibex_file *ibf; + int i; + + refs = g_hash_table_lookup(ib->words, word); + if (refs) + { + for (i = 0; i < refs->len; i++) + { + ibf = g_ptr_array_index(refs, i); + if (!strcmp(ibf->name, name)) + return TRUE; + } + } + return FALSE; } static gint -- cgit