summaryrefslogtreecommitdiffstatshomepage
diff options
context:
space:
mode:
authorKristaps Dzonsons <kristaps@bsd.lv>2011-05-04 20:43:38 +0000
committerKristaps Dzonsons <kristaps@bsd.lv>2011-05-04 20:43:38 +0000
commit4f6a6ddafb82666c36a50f73c62a3a0ed9e07cc6 (patch)
treef43aadec9906a8e08b07a1343bd6d96440caded3
parentccfcc5247a1dcd27d5b8759547f16bdb451120e3 (diff)
downloadmandoc-4f6a6ddafb82666c36a50f73c62a3a0ed9e07cc6.tar.gz
mandoc-4f6a6ddafb82666c36a50f73c62a3a0ed9e07cc6.tar.zst
mandoc-4f6a6ddafb82666c36a50f73c62a3a0ed9e07cc6.zip
Grok manual architecture in mandoc-db.c.
-rw-r--r--mandoc-db.19
-rw-r--r--mandoc-db.c7
2 files changed, 13 insertions, 3 deletions
diff --git a/mandoc-db.1 b/mandoc-db.1
index 3ab17bc5..33fe6e21 100644
--- a/mandoc-db.1
+++ b/mandoc-db.1
@@ -1,4 +1,4 @@
-.\" $Id: mandoc-db.1,v 1.4 2011/05/03 14:39:27 kristaps Exp $
+.\" $Id: mandoc-db.1,v 1.5 2011/05/04 20:43:38 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: May 3 2011 $
+.Dd $Mdocdate: May 4 2011 $
.Dt MANDOC-DB 1
.Os
.Sh NAME
@@ -69,6 +69,9 @@ a nil-terminated manual section,
.It
a nil-terminated manual title,
.It
+a nil-terminated architecture
+.Pq this is not often available
+.It
and a nil-terminated description.
.El
.Pp
@@ -102,6 +105,8 @@ A variable name as given in the SYNOPSIS section.
A standard as given in the STANDARDS section.
.It Li 0x07
An author as given in the AUTHORS section.
+.It Li 0x08
+A configuration as given in the SYNOPSIS 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 85d5036e..74796459 100644
--- a/mandoc-db.c
+++ b/mandoc-db.c
@@ -1,4 +1,4 @@
-/* $Id: mandoc-db.c,v 1.18 2011/05/04 08:21:17 kristaps Exp $ */
+/* $Id: mandoc-db.c,v 1.19 2011/05/04 20:43:38 kristaps Exp $ */
/*
* Copyright (c) 2011 Kristaps Dzonsons <kristaps@bsd.lv>
*
@@ -228,6 +228,7 @@ main(int argc, char *argv[])
char *fn; /* current file being parsed */
const char *msec, /* manual section */
*mtitle, /* manual title */
+ *arch, /* manual architecture */
*dir; /* result dir (default: cwd) */
char ibuf[MAXPATHLEN], /* index fname */
ibbuf[MAXPATHLEN], /* index backup fname */
@@ -364,6 +365,7 @@ main(int argc, char *argv[])
mtitle = NULL != mdoc ?
mdoc_meta(mdoc)->title :
man_meta(man)->title;
+ arch = NULL != mdoc ? mdoc_meta(mdoc)->arch : NULL;
assert(msec);
assert(mtitle);
@@ -380,6 +382,9 @@ main(int argc, char *argv[])
dbt_appendb(&rval, &rsz, fn, strlen(fn) + 1);
dbt_appendb(&rval, &rsz, msec, strlen(msec) + 1);
dbt_appendb(&rval, &rsz, mtitle, strlen(mtitle) + 1);
+ dbt_appendb(&rval, &rsz, arch ? arch : "",
+ arch ? strlen(arch) + 1 : 1);
+
sv = rval.size;
/* Fix the record number in the btree value. */