aboutsummaryrefslogtreecommitdiffstatshomepage
diff options
context:
space:
mode:
-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 c7802785..f2bdbb2d 100644
--- a/makewhatis.1
+++ b/makewhatis.1
@@ -1,4 +1,4 @@
-.\" $Id: makewhatis.1,v 1.9 2011/07/01 12:02:44 kristaps Exp $
+.\" $Id: makewhatis.1,v 1.10 2011/07/01 13:46:39 kristaps Exp $
.\"
.\" Copyright (c) 2011 Kristaps Dzonsons <kristaps@bsd.lv>
.\"
@@ -122,6 +122,8 @@ If the link has no section, the period terminates the string.
Path reference as given in the FILES section.
.It Li 0x800
Environment variable as given in the ENVIRONMENT section.
+.It Li 0x1000
+Error codes as given in the ERRORS section.
.El
.Pp
The last four bytes are a host-ordered record number within the
diff --git a/makewhatis.c b/makewhatis.c
index 19cec486..9ed8509d 100644
--- a/makewhatis.c
+++ b/makewhatis.c
@@ -1,4 +1,4 @@
-/* $Id: makewhatis.c,v 1.15 2011/07/01 12:02:44 kristaps Exp $ */
+/* $Id: makewhatis.c,v 1.16 2011/07/01 13:46:39 kristaps Exp $ */
/*
* Copyright (c) 2011 Kristaps Dzonsons <kristaps@bsd.lv>
*
@@ -57,6 +57,7 @@
#define TYPE_XREF 0x200
#define TYPE_PATH 0x400
#define TYPE_ENV 0x800
+#define TYPE_ERR 0x1000
/* Buffer for storing growable data. */
@@ -87,6 +88,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_Er(MDOC_ARGS);
static void pmdoc_Ev(MDOC_ARGS);
static void pmdoc_Fd(MDOC_ARGS);
static void pmdoc_In(MDOC_ARGS);
@@ -123,7 +125,7 @@ static const pmdoc_nf mdocs[MDOC_MAX] = {
pmdoc_Cd, /* Cd */
NULL, /* Cm */
NULL, /* Dv */
- NULL, /* Er */
+ pmdoc_Er, /* Er */
pmdoc_Ev, /* Ev */
NULL, /* Ex */
NULL, /* Fa */
@@ -766,6 +768,18 @@ pmdoc_Nd(MDOC_ARGS)
/* ARGSUSED */
static void
+pmdoc_Er(MDOC_ARGS)
+{
+
+ if (SEC_ERRORS != n->sec)
+ return;
+
+ buf_appendmdoc(buf, n->child, 0);
+ hash_put(hash, buf, TYPE_ERR);
+}
+
+/* ARGSUSED */
+static void
pmdoc_Ev(MDOC_ARGS)
{