summaryrefslogtreecommitdiffstats
path: root/mandoc-db.c
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 /mandoc-db.c
parent13c1e4180c0b62435638915638f5b2c6163527eb (diff)
downloadmandoc-c8b861b7ce8fa5f991be88f5f1b2476c455fe717.tar.gz
Let mandoc-db grok `St' tokens.
Diffstat (limited to 'mandoc-db.c')
-rw-r--r--mandoc-db.c22
1 files changed, 20 insertions, 2 deletions
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;