summaryrefslogtreecommitdiffstats
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
commitc6a92b0f2edb58bd80173e5a0e1039832bf104fd (patch)
tree722fa6986c4ec6adbc673d3bab45cf07d50783af /apropos_db.h
parent608c3b4f807222334e608d25042ce5cd40c2fe4b (diff)
downloadmandoc-c6a92b0f2edb58bd80173e5a0e1039832bf104fd.tar.gz
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.h21
1 files changed, 5 insertions, 16 deletions
diff --git a/apropos_db.h b/apropos_db.h
index cc6e41d9..95ac1567 100644
--- a/apropos_db.h
+++ b/apropos_db.h
@@ -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