source@mandoc.bsd.lv
 help / color / mirror / Atom feed
* docbook2mdoc: rudimentary implementation of <systemitem>
@ 2019-04-13 15:55 schwarze
  0 siblings, 0 replies; only message in thread
From: schwarze @ 2019-04-13 15:55 UTC (permalink / raw)
  To: source

Log Message:
-----------
rudimentary implementation of <systemitem>

Modified Files:
--------------
    docbook2mdoc:
        docbook2mdoc.c
        node.c
        node.h
        statistics.c

Revision Data
-------------
Index: node.h
===================================================================
RCS file: /home/cvs/mdocml/docbook2mdoc/node.h,v
retrieving revision 1.22
retrieving revision 1.23
diff -Lnode.h -Lnode.h -u -p -r1.22 -r1.23
--- node.h
+++ node.h
@@ -137,6 +137,7 @@ enum	nodeid {
 	NODE_SPANSPEC,
 	NODE_SUBTITLE,
 	NODE_SYNOPSIS,
+	NODE_SYSTEMITEM,
 	NODE_TABLE,
 	NODE_TBODY,
 	NODE_TERM,
@@ -191,12 +192,15 @@ enum	attrkey {
  */
 enum	attrval {
 	/* Alpha-order... */
+	ATTRVAL_EVENT,
+	ATTRVAL_IPADDRESS,
 	ATTRVAL_MONOSPACED,
 	ATTRVAL_NOREPEAT,
 	ATTRVAL_OPT,
 	ATTRVAL_PLAIN,
 	ATTRVAL_REPEAT,
 	ATTRVAL_REQ,
+	ATTRVAL_SYSTEMNAME,
 	ATTRVAL__MAX
 };
 
Index: node.c
===================================================================
RCS file: /home/cvs/mdocml/docbook2mdoc/node.c,v
retrieving revision 1.12
retrieving revision 1.13
diff -Lnode.c -Lnode.c -u -p -r1.12 -r1.13
--- node.c
+++ node.c
@@ -129,6 +129,7 @@ static	const struct nodeprop properties[
 	{ "spanspec",		CLASS_TRANS },
 	{ "subtitle",		CLASS_TRANS },
 	{ "synopsis",		CLASS_BLOCK },
+	{ "systemitem",		CLASS_LINE },
 	{ "table",		CLASS_TRANS },
 	{ "tbody",		CLASS_TRANS },
 	{ "term",		CLASS_LINE },
@@ -169,12 +170,15 @@ static	const char *const attrkeys[ATTRKE
 };
 
 static	const char *const attrvals[ATTRVAL__MAX] = {
+	"event",
+	"ipaddress",
 	"monospaced",
 	"norepeat",
 	"opt",
 	"plain",
 	"repeat",
-	"req"
+	"req",
+	"systemname"
 };
 
 enum attrkey
Index: docbook2mdoc.c
===================================================================
RCS file: /home/cvs/mdocml/docbook2mdoc/docbook2mdoc.c,v
retrieving revision 1.117
retrieving revision 1.118
diff -Ldocbook2mdoc.c -Ldocbook2mdoc.c -u -p -r1.117 -r1.118
--- docbook2mdoc.c
+++ docbook2mdoc.c
@@ -515,6 +515,22 @@ pnode_printgroup(struct format *f, struc
 }
 
 static void
+pnode_printsystemitem(struct format *f, struct pnode *n)
+{
+	switch (pnode_getattr(n, ATTRKEY_CLASS)) {
+	case ATTRVAL_IPADDRESS:
+		break;
+	case ATTRVAL_SYSTEMNAME:
+		macro_open(f, "Pa");
+		break;
+	case ATTRVAL_EVENT:
+	default:
+		macro_open(f, "Sy");
+		break;
+	}
+}
+
+static void
 pnode_printauthor(struct format *f, struct pnode *n)
 {
 	struct pnode	*nc, *nn;
@@ -1026,6 +1042,9 @@ pnode_print(struct format *f, struct pno
 	case NODE_SCREEN:
 	case NODE_SYNOPSIS:
 		macro_line(f, "Bd -literal");
+		break;
+	case NODE_SYSTEMITEM:
+		pnode_printsystemitem(f, n);
 		break;
 	case NODE_REFENTRYINFO:
 		/* Suppress. */
Index: statistics.c
===================================================================
RCS file: /home/cvs/mdocml/docbook2mdoc/statistics.c,v
retrieving revision 1.21
retrieving revision 1.22
diff -Lstatistics.c -Lstatistics.c -u -p -r1.21 -r1.22
--- statistics.c
+++ statistics.c
@@ -441,6 +441,7 @@ main(int argc, char *argv[])
 		table_add("structfield", "TEXT");
 		table_add("structname", "TEXT");
 		table_add("symbol", "TEXT");
+		table_add("systemitem", "TEXT");
 		table_add("table", "tgroup");
 		table_add("table", "title");
 		table_add("tbody", "row");
--
 To unsubscribe send an email to source+unsubscribe@mandoc.bsd.lv

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

only message in thread, other threads:[~2019-04-13 15:55 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-04-13 15:55 docbook2mdoc: rudimentary implementation of <systemitem> schwarze

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).