source@mandoc.bsd.lv
 help / color / mirror / Atom feed
* mdocml: Let mandoc-db grok `St' tokens.
@ 2011-04-28 10:44 kristaps
  0 siblings, 0 replies; only message in thread
From: kristaps @ 2011-04-28 10:44 UTC (permalink / raw)
  To: source

Log Message:
-----------
Let mandoc-db grok `St' tokens.

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

Revision Data
-------------
Index: mandoc-db.1
===================================================================
RCS file: /usr/vhosts/mdocml.bsd.lv/cvs/mdocml/mandoc-db.1,v
retrieving revision 1.2
retrieving revision 1.3
diff -Lmandoc-db.1 -Lmandoc-db.1 -u -p -r1.2 -r1.3
--- mandoc-db.1
+++ mandoc-db.1
@@ -96,6 +96,8 @@ A utility name as given in the SYNOPSIS 
 An include file as given in the SYNOPSIS section.
 .It Li 0x05
 A variable name as given in the SYNOPSIS section.
+.It Li 0x06
+A standard as given in the STANDARDS 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.12
retrieving revision 1.13
diff -Lmandoc-db.c -Lmandoc-db.c -u -p -r1.12 -r1.13
--- mandoc-db.c
+++ mandoc-db.c
@@ -48,7 +48,8 @@ enum	type {
 	MANDOC_FUNCTION,
 	MANDOC_UTILITY,
 	MANDOC_INCLUDES,
-	MANDOC_VARIABLE
+	MANDOC_VARIABLE,
+	MANDOC_STANDARD
 };
 
 #define	MAN_ARGS	  DB *db, \
@@ -82,6 +83,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_St(MDOC_ARGS);
 static	void		  pmdoc_Vt(MDOC_ARGS);
 
 typedef	void		(*pmdoc_nf)(MDOC_ARGS);
@@ -126,7 +128,7 @@ static	const pmdoc_nf	  mdocs[MDOC_MAX] 
 	NULL, /* Ot */
 	NULL, /* Pa */
 	NULL, /* Rv */
-	NULL, /* St */ 
+	pmdoc_St, /* St */ 
 	pmdoc_Vt, /* Va */
 	pmdoc_Vt, /* Vt */ 
 	NULL, /* Xr */ 
@@ -564,6 +566,22 @@ pmdoc_Fn(MDOC_ARGS)
 
 	dbt_append(key, ksz, cp);
 	fl = MANDOC_FUNCTION;
+	memcpy(val->data, &fl, 4);
+}
+
+/* ARGSUSED */
+static void
+pmdoc_St(MDOC_ARGS)
+{
+	uint32_t	 fl;
+	
+	if (SEC_STANDARDS != n->sec)
+		return;
+	if (NULL == n->child || MDOC_TEXT != n->child->type)
+		return;
+
+	dbt_append(key, ksz, n->child->string);
+	fl = MANDOC_STANDARD;
 	memcpy(val->data, &fl, 4);
 }
 
--
 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-04-28 10:44 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2011-04-28 10:44 mdocml: Let mandoc-db grok `St' tokens 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).