aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/apropos_db.h
diff options
context:
space:
mode:
authorKristaps Dzonsons <kristaps@bsd.lv>2011-11-18 07:02:19 +0000
committerKristaps Dzonsons <kristaps@bsd.lv>2011-11-18 07:02:19 +0000
commite93722b2d89ae28d2016eb6021d60b235c94e276 (patch)
tree3154e5e169719c2c001b3a63ea2f7583ba820744 /apropos_db.h
parent2617cb73db6943516f35ff5441a785cb870862c5 (diff)
downloadmandoc-e93722b2d89ae28d2016eb6021d60b235c94e276.tar.gz
mandoc-e93722b2d89ae28d2016eb6021d60b235c94e276.tar.zst
mandoc-e93722b2d89ae28d2016eb6021d60b235c94e276.zip
Evaluation with logical subexpressions. This allows support for arbitrary,
nested logical subexpressions with AND (-a) and OR (-o) support.
Diffstat (limited to 'apropos_db.h')
-rw-r--r--apropos_db.h23
1 files changed, 6 insertions, 17 deletions
diff --git a/apropos_db.h b/apropos_db.h
index 95d5001a..9151c959 100644
--- a/apropos_db.h
+++ b/apropos_db.h
@@ -1,4 +1,4 @@
-/* $Id: apropos_db.h,v 1.4 2011/11/14 10:07:06 kristaps Exp $ */
+/* $Id: apropos_db.h,v 1.5 2011/11/18 07:02:19 kristaps Exp $ */
/*
* Copyright (c) 2011 Kristaps Dzonsons <kristaps@bsd.lv>
*
@@ -17,23 +17,13 @@
#ifndef APROPOS_H
#define APROPOS_H
-struct rec {
+struct res {
char *file; /* file in file-system */
char *cat; /* category (3p, 3, etc.) */
char *title; /* title (FOO, etc.) */
char *arch; /* arch (or empty string) */
char *desc; /* description (from Nd) */
unsigned int rec; /* record in index */
- /*
- * By the time the apropos_search() callback is called, these
- * are superfluous.
- * Maintain a binary tree for checking the uniqueness of `rec'
- * when adding elements to the results array.
- * Since the results array is dynamic, use offset in the array
- * instead of a pointer to the structure.
- */
- int lhs;
- int rhs;
};
struct opts {
@@ -45,11 +35,10 @@ __BEGIN_DECLS
struct expr;
-void apropos_search(const struct opts *,
- const struct expr *, void *,
- void (*)(struct rec *, size_t, void *));
-
-struct expr *exprcomp(char *);
+int apropos_search(const struct opts *,
+ const struct expr *, size_t, void *,
+ void (*)(struct res *, size_t, void *));
+struct expr *exprcomp(int, char *[], size_t *);
void exprfree(struct expr *);
__END_DECLS