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 5f50771f; for ; Fri, 13 Feb 2015 07:41:24 -0500 (EST) Date: Fri, 13 Feb 2015 07:41:24 -0500 (EST) Message-Id: <3667354462673124002.enqueue@fantadrom.bsd.lv> X-Mailinglist: mdocml-source Reply-To: source@mdocml.bsd.lv MIME-Version: 1.0 From: schwarze@mdocml.bsd.lv To: source@mdocml.bsd.lv Subject: pod2mdoc: use .Fa to mark up function arguments mentioned in the X-Mailer: activitymail 1.26, http://search.cpan.org/dist/activitymail/ Content-Type: text/plain; charset=utf-8 Log Message: ----------- use .Fa to mark up function arguments mentioned in the SYNOPSIS Modified Files: -------------- pod2mdoc: dict.h pod2mdoc.c Revision Data ------------- Index: dict.h =================================================================== RCS file: /home/cvs/mdocml/pod2mdoc/dict.h,v retrieving revision 1.1 retrieving revision 1.2 diff -Ldict.h -Ldict.h -u -p -r1.1 -r1.2 --- dict.h +++ dict.h @@ -16,7 +16,8 @@ */ enum mdoc_type { - MDOC_Fo = 0, + MDOC_Fa = 0, + MDOC_Fo, MDOC_MAX }; Index: pod2mdoc.c =================================================================== RCS file: /home/cvs/mdocml/pod2mdoc/pod2mdoc.c,v retrieving revision 1.37 retrieving revision 1.38 diff -Lpod2mdoc.c -Lpod2mdoc.c -u -p -r1.37 -r1.38 --- pod2mdoc.c +++ pod2mdoc.c @@ -615,8 +615,16 @@ formatcode(struct state *st, const char } if (0 == strncmp(buf + *start, "NULL", 4) && ('=' == buf[*start + 4] || - '>' == buf[*start + 4])) + '>' == buf[*start + 4])) { printf("Dv "); + break; + } + i = 0; + while (isalnum((unsigned char)buf[*start + i]) || + '_' == buf[*start + i]) + i++; + if (i && MDOC_Fa == dict_get(buf + *start, i)) + printf("Fa "); else printf("Sy "); break; @@ -1014,7 +1022,7 @@ static void verbatim(struct state *st, char *buf, size_t start, size_t end) { size_t i, ift, ifo, ifa, ifc, inl; - char *cp; + char *cp, *cp2; int nopen; if ( ! st->parsing || st->paused || start == end) @@ -1114,8 +1122,16 @@ again: buf[ifc++] = '\0'; for (;;) { cp = strchr(buf + ifa, ','); - if (cp != NULL) + 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, MDOC_Fa); printf(".Fa \"%s\"\n", buf + ifa); if (cp == NULL) break; -- To unsubscribe send an email to source+unsubscribe@mdocml.bsd.lv