diff options
author | Kristaps Dzonsons <kristaps@bsd.lv> | 2011-04-28 10:44:02 +0000 |
---|---|---|
committer | Kristaps Dzonsons <kristaps@bsd.lv> | 2011-04-28 10:44:02 +0000 |
commit | 8686868cc9a1d5c5f474b8cdbd718b152b4d6188 (patch) | |
tree | 83314987a5bda0c4d51edfd839f07d783697592a /mandoc-db.c | |
parent | c34ffa6e23ff98f676ad6e130a07a8543a268f2e (diff) | |
download | mandoc-8686868cc9a1d5c5f474b8cdbd718b152b4d6188.tar.gz mandoc-8686868cc9a1d5c5f474b8cdbd718b152b4d6188.tar.zst mandoc-8686868cc9a1d5c5f474b8cdbd718b152b4d6188.zip |
Let mandoc-db grok `St' tokens.
Diffstat (limited to 'mandoc-db.c')
-rw-r--r-- | mandoc-db.c | 24 |
1 files changed, 21 insertions, 3 deletions
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; |