From d1b1fb48ea9474194b6fdae9714ffd2262b538de Mon Sep 17 00:00:00 2001 From: Kristaps Dzonsons Date: Fri, 1 Jul 2011 12:02:44 +0000 Subject: Added search for `Ev' environment variables in ENVIRONMENT section. --- makewhatis.c | 18 ++++++++++++++++-- 1 file changed, 16 insertions(+), 2 deletions(-) (limited to 'makewhatis.c') 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 * @@ -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 */ @@ -762,6 +764,18 @@ pmdoc_Nd(MDOC_ARGS) 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) -- cgit v1.2.3-56-ge451