From: schwarze@mdocml.bsd.lv
To: source@mdocml.bsd.lv
Subject: pod2mdoc: write function prototypes without arguments using .Fn rather
Date: Thu, 3 Nov 2016 10:50:58 -0500 (EST) [thread overview]
Message-ID: <10649129277601201920.enqueue@fantadrom.bsd.lv> (raw)
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
reply other threads:[~2016-11-03 15:50 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=10649129277601201920.enqueue@fantadrom.bsd.lv \
--to=schwarze@mdocml.bsd.lv \
--cc=source@mdocml.bsd.lv \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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).