summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKristaps Dzonsons <kristaps@bsd.lv>2011-05-03 14:39:27 +0000
committerKristaps Dzonsons <kristaps@bsd.lv>2011-05-03 14:39:27 +0000
commit2cc2a2bf7cfd3d582debaf7e6fc96baedc26efda (patch)
tree11434d153469d3f6972a41e115a4ec0073f7349b
parent928c38849630f8de177f6784d1c75e6953029385 (diff)
downloadmandoc-2cc2a2bf7cfd3d582debaf7e6fc96baedc26efda.tar.gz
Pick up authors in mandoc-db.
-rw-r--r--mandoc-db.14
-rw-r--r--mandoc-db.c23
2 files changed, 25 insertions, 2 deletions
diff --git a/mandoc-db.1 b/mandoc-db.1
index 37556f99..d20d05ad 100644
--- a/mandoc-db.1
+++ b/mandoc-db.1
@@ -67,6 +67,8 @@ a nil-terminated filename,
.It
a nil-terminated manual section,
.It
+a nil-terminated manual title,
+.It
and a nil-terminated description.
.El
.Pp
@@ -98,6 +100,8 @@ An include file as given in the SYNOPSIS section.
A variable name as given in the SYNOPSIS section.
.It Li 0x06
A standard as given in the STANDARDS section.
+.It Li 0x07
+An author as given in the AUTHORS section.
.El
.Pp
If a value is encountered outside of this range, the database is
diff --git a/mandoc-db.c b/mandoc-db.c
index bba35a4d..34c9a913 100644
--- a/mandoc-db.c
+++ b/mandoc-db.c
@@ -49,7 +49,8 @@ enum type {
MANDOC_UTILITY,
MANDOC_INCLUDES,
MANDOC_VARIABLE,
- MANDOC_STANDARD
+ MANDOC_STANDARD,
+ MANDOC_AUTHOR
};
#define MAN_ARGS DB *db, \
@@ -77,6 +78,7 @@ static int pman_node(MAN_ARGS);
static void pmdoc(DB *, const char *, DBT *, size_t *,
DBT *, DBT *, size_t *, struct mdoc *);
static void pmdoc_node(MDOC_ARGS);
+static void pmdoc_An(MDOC_ARGS);
static void pmdoc_Fd(MDOC_ARGS);
static void pmdoc_In(MDOC_ARGS);
static void pmdoc_Fn(MDOC_ARGS);
@@ -106,7 +108,7 @@ static const pmdoc_nf mdocs[MDOC_MAX] = {
NULL, /* El */
NULL, /* It */
NULL, /* Ad */
- NULL, /* An */
+ pmdoc_An, /* An */
NULL, /* Ar */
NULL, /* Cd */
NULL, /* Cm */
@@ -528,6 +530,23 @@ dbt_append(DBT *key, size_t *ksz, const char *cp)
/* ARGSUSED */
static void
+pmdoc_An(MDOC_ARGS)
+{
+ uint32_t fl;
+
+ if (SEC_AUTHORS != n->sec)
+ return;
+
+ for (n = n->child; n; n = n->next)
+ if (MDOC_TEXT == n->type)
+ dbt_append(key, ksz, n->string);
+
+ fl = MANDOC_AUTHOR;
+ memcpy(val->data, &fl, 4);
+}
+
+/* ARGSUSED */
+static void
pmdoc_Fd(MDOC_ARGS)
{
uint32_t fl;