-.\" $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>
.\"
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
-/* $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>
*
#define TYPE_DESC 0x100
#define TYPE_XREF 0x200
#define TYPE_PATH 0x400
+#define TYPE_ENV 0x800
/* Buffer for storing growable data. */
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);
NULL, /* Cm */
NULL, /* Dv */
NULL, /* Er */
- NULL, /* Ev */
+ pmdoc_Ev, /* Ev */
NULL, /* Ex */
NULL, /* Fa */
pmdoc_Fd, /* Fd */
hash_put(hash, buf, TYPE_DESC);
}
+/* 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)