aboutsummaryrefslogtreecommitdiffstatshomepage
diff options
context:
space:
mode:
-rw-r--r--mandoc-db.16
-rw-r--r--mandoc-db.c24
2 files changed, 25 insertions, 5 deletions
diff --git a/mandoc-db.1 b/mandoc-db.1
index 5fcc2466..c22817ab 100644
--- a/mandoc-db.1
+++ b/mandoc-db.1
@@ -1,4 +1,4 @@
-.\" $Id: mandoc-db.1,v 1.2 2011/04/11 23:01:44 kristaps Exp $
+.\" $Id: mandoc-db.1,v 1.3 2011/04/28 10:44:02 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 11 2011 $
+.Dd $Mdocdate: April 28 2011 $
.Dt MANDOC-DB 1
.Os
.Sh NAME
@@ -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 d3e28ed4..abc885ba 100644
--- a/mandoc-db.c
+++ b/mandoc-db.c
@@ -1,4 +1,4 @@
-/* $Id: mandoc-db.c,v 1.12 2011/04/12 14:48:42 kristaps Exp $ */
+/* $Id: mandoc-db.c,v 1.13 2011/04/28 10:44:02 kristaps Exp $ */
/*
* Copyright (c) 2011 Kristaps Dzonsons <kristaps@bsd.lv>
*
@@ -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;