summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKristaps Dzonsons <kristaps@bsd.lv>2011-04-28 10:44:02 +0000
committerKristaps Dzonsons <kristaps@bsd.lv>2011-04-28 10:44:02 +0000
commitc8b861b7ce8fa5f991be88f5f1b2476c455fe717 (patch)
tree9650af16a0794a7d78d1278ab67070180e21a5fc
parent13c1e4180c0b62435638915638f5b2c6163527eb (diff)
downloadmandoc-c8b861b7ce8fa5f991be88f5f1b2476c455fe717.tar.gz
Let mandoc-db grok `St' tokens.
-rw-r--r--mandoc-db.12
-rw-r--r--mandoc-db.c22
2 files changed, 22 insertions, 2 deletions
diff --git a/mandoc-db.1 b/mandoc-db.1
index 7b3f3efc..37556f99 100644
--- a/mandoc-db.1
+++ b/mandoc-db.1
@@ -96,6 +96,8 @@ A utility name as given in the SYNOPSIS section.
An include file as given in the SYNOPSIS section.
.It Li 0x05
A variable name as given in the SYNOPSIS section.
+.It Li 0x06
+A standard as given in the STANDARDS 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 c3ad4cc5..1dd9d4f5 100644
--- a/mandoc-db.c
+++ b/mandoc-db.c
@@ -48,7 +48,8 @@ enum type {
MANDOC_FUNCTION,
MANDOC_UTILITY,
MANDOC_INCLUDES,
- MANDOC_VARIABLE
+ MANDOC_VARIABLE,
+ MANDOC_STANDARD
};
#define MAN_ARGS DB *db, \
@@ -82,6 +83,7 @@ static void pmdoc_Fn(MDOC_ARGS);
static void pmdoc_Fo(MDOC_ARGS);
static void pmdoc_Nd(MDOC_ARGS);
static void pmdoc_Nm(MDOC_ARGS);
+static void pmdoc_St(MDOC_ARGS);
static void pmdoc_Vt(MDOC_ARGS);
typedef void (*pmdoc_nf)(MDOC_ARGS);
@@ -126,7 +128,7 @@ static const pmdoc_nf mdocs[MDOC_MAX] = {
NULL, /* Ot */
NULL, /* Pa */
NULL, /* Rv */
- NULL, /* St */
+ pmdoc_St, /* St */
pmdoc_Vt, /* Va */
pmdoc_Vt, /* Vt */
NULL, /* Xr */
@@ -569,6 +571,22 @@ pmdoc_Fn(MDOC_ARGS)
/* ARGSUSED */
static void
+pmdoc_St(MDOC_ARGS)
+{
+ uint32_t fl;
+
+ if (SEC_STANDARDS != n->sec)
+ return;
+ if (NULL == n->child || MDOC_TEXT != n->child->type)
+ return;
+
+ dbt_append(key, ksz, n->child->string);
+ fl = MANDOC_STANDARD;
+ memcpy(val->data, &fl, 4);
+}
+
+/* ARGSUSED */
+static void
pmdoc_Vt(MDOC_ARGS)
{
uint32_t fl;