source@mandoc.bsd.lv
 help / color / mirror / Atom feed
* mdocml: Pick up authors in mandoc-db.
@ 2011-05-03 14:39 kristaps
  0 siblings, 0 replies; only message in thread
From: kristaps @ 2011-05-03 14:39 UTC (permalink / raw)
  To: source

Log Message:
-----------
Pick up authors in mandoc-db.

Modified Files:
--------------
    mdocml:
        mandoc-db.1
        mandoc-db.c

Revision Data
-------------
Index: mandoc-db.1
===================================================================
RCS file: /usr/vhosts/mdocml.bsd.lv/cvs/mdocml/mandoc-db.1,v
retrieving revision 1.3
retrieving revision 1.4
diff -Lmandoc-db.1 -Lmandoc-db.1 -u -p -r1.3 -r1.4
--- mandoc-db.1
+++ mandoc-db.1
@@ -67,6 +67,8 @@ a nil-terminated filename,
 .It
 a nil-terminated manual section,
 .It
+a nil-terminated manual title,
+.It
 and a nil-terminated description.
 .El
 .Pp
@@ -98,6 +100,8 @@ An include file as given in the SYNOPSIS
 A variable name as given in the SYNOPSIS section.
 .It Li 0x06
 A standard as given in the STANDARDS section.
+.It Li 0x07
+An author as given in the AUTHORS section.
 .El
 .Pp
 If a value is encountered outside of this range, the database is
Index: mandoc-db.c
===================================================================
RCS file: /usr/vhosts/mdocml.bsd.lv/cvs/mdocml/mandoc-db.c,v
retrieving revision 1.16
retrieving revision 1.17
diff -Lmandoc-db.c -Lmandoc-db.c -u -p -r1.16 -r1.17
--- mandoc-db.c
+++ mandoc-db.c
@@ -49,7 +49,8 @@ enum	type {
 	MANDOC_UTILITY,
 	MANDOC_INCLUDES,
 	MANDOC_VARIABLE,
-	MANDOC_STANDARD
+	MANDOC_STANDARD,
+	MANDOC_AUTHOR
 };
 
 #define	MAN_ARGS	  DB *db, \
@@ -77,6 +78,7 @@ static	int		  pman_node(MAN_ARGS);
 static	void		  pmdoc(DB *, const char *, DBT *, size_t *, 
 				DBT *, DBT *, size_t *, struct mdoc *);
 static	void		  pmdoc_node(MDOC_ARGS);
+static	void		  pmdoc_An(MDOC_ARGS);
 static	void		  pmdoc_Fd(MDOC_ARGS);
 static	void		  pmdoc_In(MDOC_ARGS);
 static	void		  pmdoc_Fn(MDOC_ARGS);
@@ -106,7 +108,7 @@ static	const pmdoc_nf	  mdocs[MDOC_MAX] 
 	NULL, /* El */
 	NULL, /* It */
 	NULL, /* Ad */ 
-	NULL, /* An */ 
+	pmdoc_An, /* An */ 
 	NULL, /* Ar */
 	NULL, /* Cd */ 
 	NULL, /* Cm */
@@ -524,6 +526,23 @@ dbt_append(DBT *key, size_t *ksz, const 
 		((char *)key->data)[(int)key->size - 1] = ' ';
 
 	dbt_appendb(key, ksz, cp, sz + 1);
+}
+
+/* ARGSUSED */
+static void
+pmdoc_An(MDOC_ARGS)
+{
+	uint32_t	 fl;
+	
+	if (SEC_AUTHORS != n->sec)
+		return;
+
+	for (n = n->child; n; n = n->next)
+		if (MDOC_TEXT == n->type)
+			dbt_append(key, ksz, n->string);
+
+	fl = MANDOC_AUTHOR;
+	memcpy(val->data, &fl, 4);
 }
 
 /* ARGSUSED */
--
 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-05-03 14:39 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2011-05-03 14:39 mdocml: Pick up authors in mandoc-db 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).