summaryrefslogtreecommitdiffstatshomepage
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
parentcab6609efc2349c35b5726dd5a11139fcfff735d (diff)
downloadmandoc-d2f7b6220888999ed5a65f57c3573e8f59fa3590.tar.gz
mandoc-d2f7b6220888999ed5a65f57c3573e8f59fa3590.tar.zst
mandoc-d2f7b6220888999ed5a65f57c3573e8f59fa3590.zip
Pick up authors in mandoc-db.
-rw-r--r--mandoc-db.18
-rw-r--r--mandoc-db.c25
2 files changed, 28 insertions, 5 deletions
diff --git a/mandoc-db.1 b/mandoc-db.1
index c22817ab..3ab17bc5 100644
--- a/mandoc-db.1
+++ b/mandoc-db.1
@@ -1,4 +1,4 @@
-.\" $Id: mandoc-db.1,v 1.3 2011/04/28 10:44:02 kristaps Exp $
+.\" $Id: mandoc-db.1,v 1.4 2011/05/03 14:39:27 kristaps Exp $
.\"
.\" Copyright (c) 2011 Kristaps Dzonsons <kristaps@bsd.lv>
.\"
@@ -14,7 +14,7 @@
.\" ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
.\" OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
.\"
-.Dd $Mdocdate: April 28 2011 $
+.Dd $Mdocdate: May 3 2011 $
.Dt MANDOC-DB 1
.Os
.Sh NAME
@@ -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 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;