summaryrefslogtreecommitdiffstats
path: root/makewhatis.c
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
commitfb0a0a6a9870963d8a1d7ce701873b574cba096b (patch)
tree0e9324b640d1337af500b95a7db45577943a347a /makewhatis.c
parentc7a2c1d16c7c6f95725b84acc58284816228f325 (diff)
downloadmandoc-fb0a0a6a9870963d8a1d7ce701873b574cba096b.tar.gz
Add path reference (`Pa' in FILES section).
Diffstat (limited to 'makewhatis.c')
-rw-r--r--makewhatis.c19
1 files changed, 18 insertions, 1 deletions
diff --git a/makewhatis.c b/makewhatis.c
index b51a61c4..6119493f 100644
--- a/makewhatis.c
+++ b/makewhatis.c
@@ -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)
{