* pod2mdoc: write function prototypes without arguments using .Fn rather
@ 2016-11-03 15:50 schwarze
0 siblings, 0 replies; only message in thread
From: schwarze @ 2016-11-03 15:50 UTC (permalink / raw)
To: source
Log Message:
-----------
write function prototypes without arguments using .Fn rather than .Fo
Modified Files:
--------------
pod2mdoc:
pod2mdoc.c
Revision Data
-------------
Index: pod2mdoc.c
===================================================================
RCS file: /home/cvs/mdocml/pod2mdoc/pod2mdoc.c,v
retrieving revision 1.61
retrieving revision 1.62
diff -Lpod2mdoc.c -Lpod2mdoc.c -u -p -r1.61 -r1.62
--- pod2mdoc.c
+++ pod2mdoc.c
@@ -1243,33 +1243,37 @@ again:
}
putchar('\n');
buf[ifa++] = '\0';
- printf(".Fo %s\n", buf + ifo);
dict_put(buf + ifo, 0, MDOC_Fo);
buf[ifc++] = '\0';
- for (;;) {
- cp = strchr(buf + ifa, ',');
- if (cp != NULL) {
- cp2 = cp;
- *cp++ = '\0';
- } else
- cp2 = strchr(buf + ifa, '\0');
- while (isalnum((unsigned char)cp2[-1]) ||
- '_' == cp2[-1])
- cp2--;
- if ('\0' != *cp2)
- dict_put(cp2, 0, MDOC_Fa);
- register_type(buf + ifa);
- if (strchr(buf + ifa, ' ') == NULL)
- printf(".Fa %s\n", buf + ifa);
- else
- printf(".Fa \"%s\"\n", buf + ifa);
- if (cp == NULL)
- break;
- while (*cp == ' ' || *cp == '\t')
- cp++;
- ifa = cp - buf;
- }
- puts(".Fc");
+ if (strcmp(buf + ifa, "void")) {
+ printf(".Fo %s\n", buf + ifo);
+ for (;;) {
+ cp = strchr(buf + ifa, ',');
+ if (cp != NULL) {
+ cp2 = cp;
+ *cp++ = '\0';
+ } else
+ cp2 = strchr(buf + ifa, '\0');
+ while (isalnum((unsigned char)cp2[-1])
+ || '_' == cp2[-1])
+ cp2--;
+ if ('\0' != *cp2)
+ dict_put(cp2, 0, MDOC_Fa);
+ register_type(buf + ifa);
+ if (strchr(buf + ifa, ' ') == NULL)
+ printf(".Fa %s\n", buf + ifa);
+ else
+ printf(".Fa \"%s\"\n",
+ buf + ifa);
+ if (cp == NULL)
+ break;
+ while (*cp == ' ' || *cp == '\t')
+ cp++;
+ ifa = cp - buf;
+ }
+ puts(".Fc");
+ } else
+ printf(".Fn %s void\n", buf + ifo);
if (buf[ifc] == ';')
ifc++;
if (ifc < inl) {
--
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:[~2016-11-03 15:50 UTC | newest]
Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-11-03 15:50 pod2mdoc: write function prototypes without arguments using .Fn rather 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).