summaryrefslogtreecommitdiffstatshomepage
diff options
context:
space:
mode:
authorKristaps Dzonsons <kristaps@bsd.lv>2011-07-01 09:11:35 +0000
committerKristaps Dzonsons <kristaps@bsd.lv>2011-07-01 09:11:35 +0000
commit732f6893294f47206159fb0c080bb979cd6c09ef (patch)
tree19997ee0a9c1fb3ca80a4966c46f6aae0bba3de9
parent3a893fb581eb6130b6f93f519885edba4a196d5d (diff)
downloadmandoc-732f6893294f47206159fb0c080bb979cd6c09ef.tar.gz
mandoc-732f6893294f47206159fb0c080bb979cd6c09ef.tar.zst
mandoc-732f6893294f47206159fb0c080bb979cd6c09ef.zip
Add path reference (`Pa' in FILES section).
-rw-r--r--makewhatis.16
-rw-r--r--makewhatis.c21
2 files changed, 23 insertions, 4 deletions
diff --git a/makewhatis.1 b/makewhatis.1
index aaa11775..56bd9958 100644
--- a/makewhatis.1
+++ b/makewhatis.1
@@ -1,4 +1,4 @@
-.\" $Id: makewhatis.1,v 1.7 2011/06/25 13:19:25 kristaps Exp $
+.\" $Id: makewhatis.1,v 1.8 2011/07/01 09:11:35 kristaps Exp $
.\"
.\" Copyright (c) 2011 Kristaps Dzonsons <kristaps@bsd.lv>
.\"
@@ -14,7 +14,7 @@
.\" ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
.\" OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
.\"
-.Dd $Mdocdate: June 25 2011 $
+.Dd $Mdocdate: July 1 2011 $
.Dt MAKEWHATIS 1
.Os
.Sh NAME
@@ -118,6 +118,8 @@ Free-form descriptive text as given in the NAME section.
Cross-links between manuals.
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.
.El
.Pp
The last four bytes are a host-ordered record number within the
diff --git a/makewhatis.c b/makewhatis.c
index 574e51a1..0e041e74 100644
--- a/makewhatis.c
+++ b/makewhatis.c
@@ -1,4 +1,4 @@
-/* $Id: makewhatis.c,v 1.11 2011/06/25 13:19:25 kristaps Exp $ */
+/* $Id: makewhatis.c,v 1.12 2011/07/01 09:11:35 kristaps Exp $ */
/*
* Copyright (c) 2011 Kristaps Dzonsons <kristaps@bsd.lv>
*
@@ -55,6 +55,7 @@
#define TYPE_CONFIG 0x80
#define TYPE_DESC 0x100
#define TYPE_XREF 0x200
+#define TYPE_PATH 0x400
/* Buffer for storing growable data. */
@@ -89,6 +90,7 @@ static void pmdoc_Fn(MDOC_ARGS);
static void pmdoc_Fo(MDOC_ARGS);
static void pmdoc_Nd(MDOC_ARGS);
static void pmdoc_Nm(MDOC_ARGS);
+static void pmdoc_Pa(MDOC_ARGS);
static void pmdoc_St(MDOC_ARGS);
static void pmdoc_Vt(MDOC_ARGS);
static void pmdoc_Xr(MDOC_ARGS);
@@ -132,7 +134,7 @@ static const pmdoc_nf mdocs[MDOC_MAX] = {
pmdoc_Nm, /* Nm */
NULL, /* Op */
NULL, /* Ot */
- NULL, /* Pa */
+ pmdoc_Pa, /* Pa */
NULL, /* Rv */
pmdoc_St, /* St */
pmdoc_Vt, /* Va */
@@ -751,6 +753,21 @@ pmdoc_Nd(MDOC_ARGS)
/* ARGSUSED */
static void
+pmdoc_Pa(MDOC_ARGS)
+{
+
+ if (SEC_FILES != n->sec)
+ return;
+
+ for (n = n->child; n; n = n->next)
+ if (MDOC_TEXT == n->type)
+ buf_append(buf, n->string);
+
+ hash_put(hash, buf, TYPE_PATH);
+}
+
+/* ARGSUSED */
+static void
pmdoc_Nm(MDOC_ARGS)
{