summaryrefslogtreecommitdiffstatshomepage
path: root/mandoc-db.c
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
commitd2f7b6220888999ed5a65f57c3573e8f59fa3590 (patch)
tree520d8edb6c643663c9c32b2759eb580e539fbe28 /mandoc-db.c
parentcab6609efc2349c35b5726dd5a11139fcfff735d (diff)
downloadmandoc-d2f7b6220888999ed5a65f57c3573e8f59fa3590.tar.gz
mandoc-d2f7b6220888999ed5a65f57c3573e8f59fa3590.tar.zst
mandoc-d2f7b6220888999ed5a65f57c3573e8f59fa3590.zip
Pick up authors in mandoc-db.
Diffstat (limited to 'mandoc-db.c')
-rw-r--r--mandoc-db.c25
1 files changed, 22 insertions, 3 deletions
diff --git a/mandoc-db.c b/mandoc-db.c
index 1086a3fb..0f8e56fd 100644
--- a/mandoc-db.c
+++ b/mandoc-db.c
@@ -1,4 +1,4 @@
-/* $Id: mandoc-db.c,v 1.16 2011/05/03 10:08:09 kristaps Exp $ */
+/* $Id: mandoc-db.c,v 1.17 2011/05/03 14:39:27 kristaps Exp $ */
/*
* Copyright (c) 2011 Kristaps Dzonsons <kristaps@bsd.lv>
*
@@ -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;