summaryrefslogtreecommitdiff
path: root/index.c
diff options
context:
space:
mode:
authorSimon Tatham <anakin@pobox.com>2001-12-04 21:33:03 +0000
committerSimon Tatham <anakin@pobox.com>2001-12-04 21:33:03 +0000
commit38181905971fab7106f1f4b90db8da26497158b9 (patch)
tree26e8e64f06ab2f07fb2999acbd5726767a8de64e /index.c
parent5e3a21913b6a47e78d3e4edd4238d028b90827b7 (diff)
downloadhalibut-38181905971fab7106f1f4b90db8da26497158b9.zip
halibut-38181905971fab7106f1f4b90db8da26497158b9.tar.gz
halibut-38181905971fab7106f1f4b90db8da26497158b9.tar.bz2
halibut-38181905971fab7106f1f4b90db8da26497158b9.tar.xz
Indexing in the Help backend now seems to work! Woo!
[originally from svn r1450]
Diffstat (limited to 'index.c')
-rw-r--r--index.c13
1 files changed, 13 insertions, 0 deletions
diff --git a/index.c b/index.c
index 3fb45a1..b5005ac 100644
--- a/index.c
+++ b/index.c
@@ -31,12 +31,25 @@ static int compare_tags(void *av, void *bv) {
return ustricmp(a->name, b->name);
}
+static int compare_to_find_tag(void *av, void *bv) {
+ wchar_t *a = (wchar_t *)av;
+ indextag *b = (indextag *)bv;
+ return ustricmp(a, b->name);
+}
+
static int compare_entries(void *av, void *bv) {
indexentry *a = (indexentry *)av, *b = (indexentry *)bv;
return compare_wordlists(a->text, b->text);
}
/*
+ * Back-end utility: find the indextag with a given name.
+ */
+indextag *index_findtag(indexdata *idx, wchar_t *name) {
+ return find234(idx->tags, name, compare_to_find_tag);
+}
+
+/*
* Add a \IM. `tags' points to a zero-terminated chain of
* zero-terminated strings ("first\0second\0thirdandlast\0\0").
* `text' points to a word list.