From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from localhost (fantadrom.bsd.lv [local]) by fantadrom.bsd.lv (OpenSMTPD) with ESMTPA id 50be3a7c for ; Wed, 1 May 2019 07:52:36 -0500 (EST) Date: Wed, 1 May 2019 07:52:36 -0500 (EST) X-Mailinglist: mandoc-source Reply-To: source@mandoc.bsd.lv MIME-Version: 1.0 From: schwarze@mandoc.bsd.lv To: source@mandoc.bsd.lv Subject: docbook2mdoc: handle inside inside X-Mailer: activitymail 1.26, http://search.cpan.org/dist/activitymail/ Content-Type: text/plain; charset=utf-8 Message-ID: Log Message: ----------- handle inside inside (used for giving full function prototypes inside parameter lists of functions taking function pointer arguments) by enclosing them in parentheses inside the .Fa macro Modified Files: -------------- docbook2mdoc: docbook2mdoc.c node.c node.h statistics.c Revision Data ------------- Index: node.c =================================================================== RCS file: /home/cvs/mdocml/docbook2mdoc/node.c,v retrieving revision 1.27 retrieving revision 1.28 diff -Lnode.c -Lnode.c -u -p -r1.27 -r1.28 --- node.c +++ node.c @@ -62,6 +62,7 @@ static const struct nodeprop properties[ { "firstterm", CLASS_LINE }, { "footnote", CLASS_BLOCK }, { "funcdef", CLASS_BLOCK }, + { "funcparams", CLASS_LINE }, { "funcprototype", CLASS_BLOCK }, { "funcsynopsis", CLASS_TRANS }, { "funcsynopsisinfo", CLASS_LINE }, Index: node.h =================================================================== RCS file: /home/cvs/mdocml/docbook2mdoc/node.h,v retrieving revision 1.36 retrieving revision 1.37 diff -Lnode.h -Lnode.h -u -p -r1.36 -r1.37 --- node.h +++ node.h @@ -70,6 +70,7 @@ enum nodeid { NODE_FIRSTTERM, NODE_FOOTNOTE, NODE_FUNCDEF, + NODE_FUNCPARAMS, NODE_FUNCPROTOTYPE, NODE_FUNCSYNOPSIS, NODE_FUNCSYNOPSISINFO, Index: docbook2mdoc.c =================================================================== RCS file: /home/cvs/mdocml/docbook2mdoc/docbook2mdoc.c,v retrieving revision 1.144 retrieving revision 1.145 diff -Ldocbook2mdoc.c -Ldocbook2mdoc.c -u -p -r1.144 -r1.145 --- docbook2mdoc.c +++ docbook2mdoc.c @@ -345,7 +345,7 @@ pnode_printmath(struct format *f, struct static void pnode_printfuncprototype(struct format *f, struct pnode *n) { - struct pnode *fdef, *ftype, *nc, *nn; + struct pnode *fdef, *fps, *ftype, *nc, *nn; /* * Extract child and ignore child. @@ -399,7 +399,16 @@ pnode_printfuncprototype(struct format * return; while (nc != NULL) { - macro_nodeline(f, "Fa", nc, ARG_SINGLE); + if ((fps = pnode_takefirst(nc, NODE_FUNCPARAMS)) != NULL) { + macro_open(f, "Fa \""); + macro_addnode(f, nc, ARG_QUOTED); + macro_addarg(f, "(", ARG_QUOTED); + macro_addnode(f, fps, ARG_QUOTED); + macro_addarg(f, ")", ARG_QUOTED); + putchar('"'); + macro_close(f); + } else + macro_nodeline(f, "Fa", nc, ARG_SINGLE); pnode_unlink(nc); nc = TAILQ_FIRST(&n->childq); } Index: statistics.c =================================================================== RCS file: /home/cvs/mdocml/docbook2mdoc/statistics.c,v retrieving revision 1.39 retrieving revision 1.40 diff -Lstatistics.c -Lstatistics.c -u -p -r1.39 -r1.40 --- statistics.c +++ statistics.c @@ -438,8 +438,10 @@ main(int argc, char *argv[]) table_add("footnote", "para"); table_add("funcdef", "function"); table_add("funcdef", "TEXT"); + table_add("funcparams", "TEXT"); table_add("funcprototype", "funcdef"); table_add("funcprototype", "paramdef"); + table_add("funcprototype", "void"); table_add("funcsynopsis", "funcprototype"); table_add("funcsynopsis", "funcsynopsisinfo"); table_add("funcsynopsisinfo", "TEXT"); @@ -499,6 +501,7 @@ main(int argc, char *argv[]) table_add("othercredit", "surname"); table_add("othername", "TEXT"); table_add("para", NULL); + table_add("paramdef", "funcparams"); table_add("paramdef", "parameter"); table_add("paramdef", "TEXT"); table_add("parameter", "TEXT"); -- To unsubscribe send an email to source+unsubscribe@mandoc.bsd.lv