aboutsummaryrefslogtreecommitdiffstatshomepage
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
commitd1b1fb48ea9474194b6fdae9714ffd2262b538de (patch)
tree1018d01fdbd2349d4949cf6a485263bddff2f0a9
parentf3d43c21c08b7c31c8cdfed1d0233f8fe7fd0839 (diff)
downloadmandoc-d1b1fb48ea9474194b6fdae9714ffd2262b538de.tar.gz
mandoc-d1b1fb48ea9474194b6fdae9714ffd2262b538de.tar.zst
mandoc-d1b1fb48ea9474194b6fdae9714ffd2262b538de.zip
Added search for `Ev' environment variables in ENVIRONMENT section.
-rw-r--r--makewhatis.14
-rw-r--r--makewhatis.c18
2 files changed, 19 insertions, 3 deletions
diff --git a/makewhatis.1 b/makewhatis.1
index 56bd9958..c7802785 100644
--- a/makewhatis.1
+++ b/makewhatis.1
@@ -1,4 +1,4 @@
-.\" $Id: makewhatis.1,v 1.8 2011/07/01 09:11:35 kristaps Exp $
+.\" $Id: makewhatis.1,v 1.9 2011/07/01 12:02:44 kristaps Exp $
.\"
.\" Copyright (c) 2011 Kristaps Dzonsons <kristaps@bsd.lv>
.\"
@@ -120,6 +120,8 @@ Listed as the link name, then a period, then the link section.
If the link has no section, the period terminates the string.
.It Li 0x400
Path reference as given in the FILES section.
+.It Li 0x800
+Environment variable as given in the ENVIRONMENT section.
.El
.Pp
The last four bytes are a host-ordered record number within the
diff --git a/makewhatis.c b/makewhatis.c
index 7ceeaa9a..19cec486 100644
--- a/makewhatis.c
+++ b/makewhatis.c
@@ -1,4 +1,4 @@
-/* $Id: makewhatis.c,v 1.14 2011/07/01 10:46:32 kristaps Exp $ */
+/* $Id: makewhatis.c,v 1.15 2011/07/01 12:02:44 kristaps Exp $ */
/*
* Copyright (c) 2011 Kristaps Dzonsons <kristaps@bsd.lv>
*
@@ -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)
{