summaryrefslogtreecommitdiffstats
path: root/makewhatis.c
diff options
context:
space:
mode:
authorKristaps Dzonsons <kristaps@bsd.lv>2011-07-01 12:02:44 +0000
committerKristaps Dzonsons <kristaps@bsd.lv>2011-07-01 12:02:44 +0000
commit78860d6998411b54eb45efb7169550d999084fa8 (patch)
treeba74f53864aee5231e15592d6da59a5d6283e0ff /makewhatis.c
parentb4a71de7462579035b2712698ffec5cb8c09fe16 (diff)
downloadmandoc-78860d6998411b54eb45efb7169550d999084fa8.tar.gz
Added search for `Ev' environment variables in ENVIRONMENT section.
Diffstat (limited to 'makewhatis.c')
-rw-r--r--makewhatis.c16
1 files changed, 15 insertions, 1 deletions
diff --git a/makewhatis.c b/makewhatis.c
index ee962638..8a812179 100644
--- a/makewhatis.c
+++ b/makewhatis.c
@@ -56,6 +56,7 @@
#define TYPE_DESC 0x100
#define TYPE_XREF 0x200
#define TYPE_PATH 0x400
+#define TYPE_ENV 0x800
/* Buffer for storing growable data. */
@@ -86,6 +87,7 @@ static int pman_node(MAN_ARGS);
static void pmdoc_node(MDOC_ARGS);
static void pmdoc_An(MDOC_ARGS);
static void pmdoc_Cd(MDOC_ARGS);
+static void pmdoc_Ev(MDOC_ARGS);
static void pmdoc_Fd(MDOC_ARGS);
static void pmdoc_In(MDOC_ARGS);
static void pmdoc_Fn(MDOC_ARGS);
@@ -122,7 +124,7 @@ static const pmdoc_nf mdocs[MDOC_MAX] = {
NULL, /* Cm */
NULL, /* Dv */
NULL, /* Er */
- NULL, /* Ev */
+ pmdoc_Ev, /* Ev */
NULL, /* Ex */
NULL, /* Fa */
pmdoc_Fd, /* Fd */
@@ -764,6 +766,18 @@ pmdoc_Nd(MDOC_ARGS)
/* ARGSUSED */
static void
+pmdoc_Ev(MDOC_ARGS)
+{
+
+ if (SEC_ENVIRONMENT != n->sec)
+ return;
+
+ buf_appendmdoc(buf, n->child, 0);
+ hash_put(hash, buf, TYPE_ENV);
+}
+
+/* ARGSUSED */
+static void
pmdoc_Pa(MDOC_ARGS)
{