From f490803d13f53f9615e258126f6fe25eabc83c3e Mon Sep 17 00:00:00 2001 From: NotZed Date: Sun, 7 May 2000 03:57:50 +0000 Subject: New function to find out if a file is indexed. 2000-05-06 NotZed * find.c (ibex_contains_name): New function to find out if a file is indexed. svn path=/trunk/; revision=2856 --- libibex/ChangeLog | 5 +++++ libibex/find.c | 16 ++++++++++++++++ libibex/ibex.h | 4 ++++ 3 files changed, 25 insertions(+) diff --git a/libibex/ChangeLog b/libibex/ChangeLog index ceb75a4e51..abd1914e84 100644 --- a/libibex/ChangeLog +++ b/libibex/ChangeLog @@ -1,3 +1,8 @@ +2000-05-06 NotZed + + * find.c (ibex_contains_name): New function to find out if a file + is indexed. + 2000-05-02 Matt Loper * Makefile.am: set G_LOG_DOMAIN. diff --git a/libibex/find.c b/libibex/find.c index e0b5d263c8..1bb58917ac 100644 --- a/libibex/find.c +++ b/libibex/find.c @@ -55,6 +55,22 @@ ibex_find (ibex *ib, char *word) return ret; } +/** + * ibex_contains_name: + * @ib: + * @name: + * + * Returns #TRUE if the ibex @ib has any index entry for + * the key @name. + * + * Return value: + **/ +gboolean +ibex_contains_name(ibex *ib, char *name) +{ + return g_tree_lookup(ib->files, name) != NULL; +} + /** * ibex_find_name: Check if a word occurs in a given file * @ib: an ibex diff --git a/libibex/ibex.h b/libibex/ibex.h index e24508aaf7..646853b120 100644 --- a/libibex/ibex.h +++ b/libibex/ibex.h @@ -87,6 +87,10 @@ GPtrArray *ibex_find (ibex *ib, char *word); */ gboolean ibex_find_name (ibex *ib, char *name, char *word); +/* has a file been indexed? + */ +gboolean ibex_contains_name(ibex *ib, char *name); + /* Return all the files containing all of the words in the given * array. Returned data is like with ibex_find. */ -- cgit v1.2.3