source@mandoc.bsd.lv
 help / color / mirror / Atom feed
* mdocml: Add path reference (`Pa' in FILES section).
@ 2011-07-01  9:11 kristaps
  0 siblings, 0 replies; only message in thread
From: kristaps @ 2011-07-01  9:11 UTC (permalink / raw)
  To: source

Log Message:
-----------
Add path reference (`Pa' in FILES section).

Modified Files:
--------------
    mdocml:
        makewhatis.c
        makewhatis.1

Revision Data
-------------
Index: makewhatis.c
===================================================================
RCS file: /usr/vhosts/mdocml.bsd.lv/cvs/mdocml/makewhatis.c,v
retrieving revision 1.11
retrieving revision 1.12
diff -Lmakewhatis.c -Lmakewhatis.c -u -p -r1.11 -r1.12
--- makewhatis.c
+++ 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 */
@@ -747,6 +749,21 @@ pmdoc_Nd(MDOC_ARGS)
 	}
 
 	hash_put(hash, buf, TYPE_DESC);
+}
+
+/* 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 */
Index: makewhatis.1
===================================================================
RCS file: /usr/vhosts/mdocml.bsd.lv/cvs/mdocml/makewhatis.1,v
retrieving revision 1.7
retrieving revision 1.8
diff -Lmakewhatis.1 -Lmakewhatis.1 -u -p -r1.7 -r1.8
--- makewhatis.1
+++ makewhatis.1
@@ -118,6 +118,8 @@ Free-form descriptive text as given in t
 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
--
 To unsubscribe send an email to source+unsubscribe@mdocml.bsd.lv

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2011-07-01  9:11 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2011-07-01  9:11 mdocml: Add path reference (`Pa' in FILES section) kristaps

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).