* docbook2mdoc: zap trailing whitespace; verified with diff -b; patch from
@ 2015-03-19 10:05 schwarze
0 siblings, 0 replies; only message in thread
From: schwarze @ 2015-03-19 10:05 UTC (permalink / raw)
To: source
Log Message:
-----------
zap trailing whitespace; verified with diff -b;
patch from Svyatoslav Mishyn <juef at openmailbox dot org>
Modified Files:
--------------
docbook2mdoc:
Makefile
docbook2mdoc.c
extern.h
index.xml
rules.c
Revision Data
-------------
Index: Makefile
===================================================================
RCS file: /home/cvs/mdocml/docbook2mdoc/Makefile,v
retrieving revision 1.15
retrieving revision 1.16
diff -LMakefile -LMakefile -u -p -r1.15 -r1.16
--- Makefile
+++ Makefile
@@ -1,5 +1,5 @@
VERSION = 0.0.9
-CFLAGS += -g -W -Wall -Wstrict-prototypes -Wno-unused-parameter -Wwrite-strings
+CFLAGS += -g -W -Wall -Wstrict-prototypes -Wno-unused-parameter -Wwrite-strings
WWWPREFIX = /usr/vhosts/mdocml.bsd.lv/www/htdocs/docbook2mdoc
PREFIX = /usr/local
Index: extern.h
===================================================================
RCS file: /home/cvs/mdocml/docbook2mdoc/extern.h,v
retrieving revision 1.24
retrieving revision 1.25
diff -Lextern.h -Lextern.h -u -p -r1.24 -r1.25
--- extern.h
+++ extern.h
@@ -40,7 +40,7 @@ enum nodeid {
NODE_LINK,
NODE_LISTITEM,
NODE_LITERAL,
- NODE_MANVOLNUM,
+ NODE_MANVOLNUM,
NODE_MML_MATH,
NODE_MML_MFENCED,
NODE_MML_MFRAC,
@@ -50,8 +50,8 @@ enum nodeid {
NODE_MML_MROW,
NODE_MML_MSUB,
NODE_MML_MSUP,
- NODE_MODIFIER,
- NODE_NOTE,
+ NODE_MODIFIER,
+ NODE_NOTE,
NODE_OPTION,
NODE_ORDEREDLIST,
NODE_PARA,
@@ -85,8 +85,8 @@ enum nodeid {
NODE_SYNOPSIS,
NODE_TABLE,
NODE_TBODY,
- NODE_TERM,
- NODE_TEXT,
+ NODE_TERM,
+ NODE_TEXT,
NODE_TFOOT,
NODE_TGROUP,
NODE_THEAD,
Index: docbook2mdoc.c
===================================================================
RCS file: /home/cvs/mdocml/docbook2mdoc/docbook2mdoc.c,v
retrieving revision 1.43
retrieving revision 1.44
diff -Ldocbook2mdoc.c -Ldocbook2mdoc.c -u -p -r1.43 -r1.44
--- docbook2mdoc.c
+++ docbook2mdoc.c
@@ -91,102 +91,102 @@ static const char *attrvals[ATTRVAL__MAX
};
static const struct node nodes[NODE__MAX] = {
- { NULL, 0 },
- { "acronym", 0 },
- { "anchor", NODE_IGNTEXT },
- { "application", 0 },
- { "arg", 0 },
- { "caution", NODE_IGNTEXT },
- { "citerefentry", NODE_IGNTEXT },
- { "cmdsynopsis", NODE_IGNTEXT },
- { "code", 0 },
+ { NULL, 0 },
+ { "acronym", 0 },
+ { "anchor", NODE_IGNTEXT },
+ { "application", 0 },
+ { "arg", 0 },
+ { "caution", NODE_IGNTEXT },
+ { "citerefentry", NODE_IGNTEXT },
+ { "cmdsynopsis", NODE_IGNTEXT },
+ { "code", 0 },
{ "colspec", NODE_IGNTEXT },
- { "command", 0 },
- { "constant", 0 },
- { "copyright", NODE_IGNTEXT },
- { "date", 0 },
+ { "command", 0 },
+ { "constant", 0 },
+ { "copyright", NODE_IGNTEXT },
+ { "date", 0 },
{ "emphasis", 0 },
{ "entry", 0 },
{ "envar", 0 },
{ "fieldsynopsis", NODE_IGNTEXT },
{ "filename", 0 },
{ "funcdef", 0 },
- { "funcprototype", NODE_IGNTEXT },
- { "funcsynopsis", NODE_IGNTEXT },
- { "funcsynopsisinfo", 0 },
- { "function", 0 },
- { "group", NODE_IGNTEXT },
+ { "funcprototype", NODE_IGNTEXT },
+ { "funcsynopsis", NODE_IGNTEXT },
+ { "funcsynopsisinfo", 0 },
+ { "function", 0 },
+ { "group", NODE_IGNTEXT },
{ "holder", NODE_IGNTEXT },
{ "info", NODE_IGNTEXT },
- { "informalequation", NODE_IGNTEXT },
- { "informaltable", NODE_IGNTEXT },
- { "inlineequation", NODE_IGNTEXT },
- { "itemizedlist", NODE_IGNTEXT },
- { "link", 0 },
- { "listitem", NODE_IGNTEXT },
- { "literal", 0 },
- { "manvolnum", 0 },
- { "mml:math", NODE_IGNTEXT },
- { "mml:mfenced", 0 },
- { "mml:mfrac", 0 },
- { "mml:mi", 0 },
- { "mml:mn", 0 },
- { "mml:mo", 0 },
- { "mml:mrow", 0 },
- { "mml:msub", 0 },
- { "mml:msup", 0 },
- { "modifier", 0 },
- { "note", NODE_IGNTEXT },
- { "option", 0 },
- { "orderedlist", NODE_IGNTEXT },
- { "para", 0 },
+ { "informalequation", NODE_IGNTEXT },
+ { "informaltable", NODE_IGNTEXT },
+ { "inlineequation", NODE_IGNTEXT },
+ { "itemizedlist", NODE_IGNTEXT },
+ { "link", 0 },
+ { "listitem", NODE_IGNTEXT },
+ { "literal", 0 },
+ { "manvolnum", 0 },
+ { "mml:math", NODE_IGNTEXT },
+ { "mml:mfenced", 0 },
+ { "mml:mfrac", 0 },
+ { "mml:mi", 0 },
+ { "mml:mn", 0 },
+ { "mml:mo", 0 },
+ { "mml:mrow", 0 },
+ { "mml:msub", 0 },
+ { "mml:msup", 0 },
+ { "modifier", 0 },
+ { "note", NODE_IGNTEXT },
+ { "option", 0 },
+ { "orderedlist", NODE_IGNTEXT },
+ { "para", 0 },
{ "paramdef", 0 },
- { "parameter", 0 },
- { "programlisting", 0 },
- { "prompt", 0 },
- { "quote", 0 },
- { "refclass", NODE_IGNTEXT },
- { "refdescriptor", NODE_IGNTEXT },
- { "refentry", NODE_IGNTEXT },
- { "refentryinfo", NODE_IGNTEXT },
- { "refentrytitle", 0 },
- { "refmeta", NODE_IGNTEXT },
- { "refmetainfo", NODE_IGNTEXT },
- { "refmiscinfo", NODE_IGNTEXT },
- { "refname", 0 },
- { "refnamediv", NODE_IGNTEXT },
- { "refpurpose", 0 },
- { "refsect1", NODE_IGNTEXT },
- { "refsect2", NODE_IGNTEXT },
- { "refsect3", NODE_IGNTEXT },
- { "refsection", NODE_IGNTEXT },
- { "refsynopsisdiv", NODE_IGNTEXT },
- { "replaceable", 0 },
- { "row", NODE_IGNTEXT },
- { "sbr", NODE_IGNTEXT },
- { "screen", NODE_IGNTEXT },
- { "sgmltag", 0 },
- { "structname", 0 },
- { "synopsis", 0 },
- { "table", NODE_IGNTEXT },
- { "tbody", NODE_IGNTEXT },
- { "term", 0 },
- { NULL, 0 },
- { "tfoot", NODE_IGNTEXT },
- { "tgroup", NODE_IGNTEXT },
- { "thead", NODE_IGNTEXT },
- { "tip", NODE_IGNTEXT },
- { "title", 0 },
- { "trademark", 0 },
- { "type", 0 },
- { "ulink", 0 },
- { "userinput", 0 },
- { "variablelist", NODE_IGNTEXT },
- { "varlistentry", NODE_IGNTEXT },
- { "varname", 0 },
- { "warning", NODE_IGNTEXT },
- { "wordasword", 0 },
- { "year", NODE_IGNTEXT },
+ { "parameter", 0 },
+ { "programlisting", 0 },
+ { "prompt", 0 },
+ { "quote", 0 },
+ { "refclass", NODE_IGNTEXT },
+ { "refdescriptor", NODE_IGNTEXT },
+ { "refentry", NODE_IGNTEXT },
+ { "refentryinfo", NODE_IGNTEXT },
+ { "refentrytitle", 0 },
+ { "refmeta", NODE_IGNTEXT },
+ { "refmetainfo", NODE_IGNTEXT },
+ { "refmiscinfo", NODE_IGNTEXT },
+ { "refname", 0 },
+ { "refnamediv", NODE_IGNTEXT },
+ { "refpurpose", 0 },
+ { "refsect1", NODE_IGNTEXT },
+ { "refsect2", NODE_IGNTEXT },
+ { "refsect3", NODE_IGNTEXT },
+ { "refsection", NODE_IGNTEXT },
+ { "refsynopsisdiv", NODE_IGNTEXT },
+ { "replaceable", 0 },
+ { "row", NODE_IGNTEXT },
+ { "sbr", NODE_IGNTEXT },
+ { "screen", NODE_IGNTEXT },
+ { "sgmltag", 0 },
+ { "structname", 0 },
+ { "synopsis", 0 },
+ { "table", NODE_IGNTEXT },
+ { "tbody", NODE_IGNTEXT },
+ { "term", 0 },
+ { NULL, 0 },
+ { "tfoot", NODE_IGNTEXT },
+ { "tgroup", NODE_IGNTEXT },
+ { "thead", NODE_IGNTEXT },
+ { "tip", NODE_IGNTEXT },
+ { "title", 0 },
+ { "trademark", 0 },
+ { "type", 0 },
+ { "ulink", 0 },
+ { "userinput", 0 },
+ { "variablelist", NODE_IGNTEXT },
+ { "varlistentry", NODE_IGNTEXT },
+ { "varname", 0 },
+ { "warning", NODE_IGNTEXT },
+ { "wordasword", 0 },
+ { "year", NODE_IGNTEXT },
};
static int warn = 0;
@@ -248,7 +248,7 @@ xml_char(void *arg, const XML_Char *p, i
/* Append to current buffer. */
assert(sz >= 0);
- ps->cur->b = realloc(ps->cur->b,
+ ps->cur->b = realloc(ps->cur->b,
ps->cur->bsz + (size_t)sz);
if (NULL == ps->cur->b) {
perror(NULL);
@@ -316,7 +316,7 @@ xml_elem_start(void *arg, const XML_Char
if (NODE__MAX == node && NODE_ROOT == ps->node) {
return;
} else if (NODE__MAX == node) {
- fprintf(stderr, "%s:%zu:%zu: unknown node \"%s\"\n",
+ fprintf(stderr, "%s:%zu:%zu: unknown node \"%s\"\n",
ps->fname, XML_GetCurrentLineNumber(ps->xml),
XML_GetCurrentColumnNumber(ps->xml), name);
ps->stop = 1;
@@ -370,21 +370,21 @@ xml_elem_start(void *arg, const XML_Char
if (0 == strcmp(*att, attrkeys[key]))
break;
if (ATTRKEY__MAX == key) {
- if (warn)
+ if (warn)
fprintf(stderr, "%s:%zu:%zu: warning: "
- "unknown attribute \"%s\"\n",
- ps->fname,
+ "unknown attribute \"%s\"\n",
+ ps->fname,
XML_GetCurrentLineNumber(ps->xml),
- XML_GetCurrentColumnNumber(ps->xml),
+ XML_GetCurrentColumnNumber(ps->xml),
*att);
continue;
} else if ( ! isattrkey(node, key)) {
if (warn)
fprintf(stderr, "%s:%zu:%zu: warning: "
- "bad attribute \"%s\"\n",
- ps->fname,
+ "bad attribute \"%s\"\n",
+ ps->fname,
XML_GetCurrentLineNumber(ps->xml),
- XML_GetCurrentColumnNumber(ps->xml),
+ XML_GetCurrentColumnNumber(ps->xml),
*att);
continue;
}
@@ -394,10 +394,10 @@ xml_elem_start(void *arg, const XML_Char
if (ATTRVAL__MAX != val && ! isattrval(key, val)) {
if (warn)
fprintf(stderr, "%s:%zu:%zu: warning: "
- "bad attribute value \"%s\"\n",
- ps->fname,
+ "bad attribute value \"%s\"\n",
+ ps->fname,
XML_GetCurrentLineNumber(ps->xml),
- XML_GetCurrentColumnNumber(ps->xml),
+ XML_GetCurrentColumnNumber(ps->xml),
*(att + 1));
continue;
}
@@ -541,7 +541,7 @@ bufappend_r(struct parse *p, struct pnod
bufappend_r(p, pp);
}
-/*
+/*
* Recursively search and return the first instance of "node".
*/
static struct pnode *
@@ -589,12 +589,12 @@ pnode_printmacrolinetext(struct parse *p
/* Escape us if we look like a macro. */
if ((cp == p->b || ' ' == *(cp - 1)) &&
isupper((int)*cp) &&
- '\0' != *(cp + 1) &&
+ '\0' != *(cp + 1) &&
islower((int)*(cp + 1)) &&
- ('\0' == *(cp + 2) ||
+ ('\0' == *(cp + 2) ||
' ' == *(cp + 2) ||
(islower((int)*(cp + 2)) &&
- ('\0' == *(cp + 3) ||
+ ('\0' == *(cp + 3) ||
' ' == *(cp + 3)))))
fputs("\\&", stdout);
if (MACROLINE_UPPER & fl)
@@ -657,7 +657,7 @@ static void
pnode_printmclosepunct(struct parse *p, struct pnode *pn, int sv)
{
/* We wouldn't have done anything anyway. */
- if ( ! (sv && ! p->newln))
+ if ( ! (sv && ! p->newln))
return;
/* No next node or it's not text. */
@@ -667,7 +667,7 @@ pnode_printmclosepunct(struct parse *p,
} else if (NODE_TEXT != pn->node) {
pnode_printmclose(p, sv);
return;
- }
+ }
/* Only do this for the comma/period. */
if (pn->bsz > 0 &&
@@ -677,7 +677,7 @@ pnode_printmclosepunct(struct parse *p,
putchar(pn->b[0]);
pn->b++;
pn->bsz--;
- }
+ }
putchar('\n');
p->newln = 1;
@@ -691,7 +691,7 @@ pnode_printrefsynopsisdiv(struct parse *
{
struct pnode *pp;
- TAILQ_FOREACH(pp, &pn->childq, child)
+ TAILQ_FOREACH(pp, &pn->childq, child)
if (NODE_TITLE == pp->node) {
pnode_unlink(pp);
return;
@@ -742,7 +742,7 @@ pnode_printrefsect(struct parse *p, stru
p->newln = 0;
if (NULL != pp) {
- pnode_printmacrolinetext(p, pp,
+ pnode_printmacrolinetext(p, pp,
NODE_REFSECT1 == pn->node ?
MACROLINE_UPPER : 0);
pnode_printmclose(p, 1);
@@ -944,7 +944,7 @@ pnode_printfuncprototype(struct parse *p
assert(p->newln);
TAILQ_FOREACH(fdef, &pn->childq, child)
- if (NODE_FUNCDEF == fdef->node)
+ if (NODE_FUNCDEF == fdef->node)
break;
if (NULL != fdef)
@@ -952,7 +952,7 @@ pnode_printfuncprototype(struct parse *p
else
puts(".Fo UNKNOWN");
- TAILQ_FOREACH(pp, &pn->childq, child)
+ TAILQ_FOREACH(pp, &pn->childq, child)
if (NODE_PARAMDEF == pp->node)
pnode_printparamdef(p, pp);
@@ -960,7 +960,7 @@ pnode_printfuncprototype(struct parse *p
p->newln = 1;
}
-/*
+/*
* The <arg> element is more complicated than it should be because text
* nodes are treated like ".Ar foo", but non-text nodes need to be
* re-sent into the printer (i.e., without the preceding ".Ar").
@@ -976,10 +976,10 @@ pnode_printarg(struct parse *p, struct p
isop = 1;
isrep = 0;
- TAILQ_FOREACH(ap, &pn->attrq, child)
+ TAILQ_FOREACH(ap, &pn->attrq, child)
if (ATTRKEY_CHOICE == ap->key &&
(ATTRVAL_PLAIN == ap->val ||
- ATTRVAL_REQ == ap->val))
+ ATTRVAL_REQ == ap->val))
isop = 0;
else if (ATTRKEY_REP == ap->key &&
(ATTRVAL_REPEAT == ap->val))
@@ -994,9 +994,9 @@ pnode_printarg(struct parse *p, struct p
if (NODE_TEXT == pp->node) {
pnode_printmopen(p);
fputs("Ar", stdout);
- }
+ }
pnode_print(p, pp);
- if (NODE_TEXT == pp->node && isrep)
+ if (NODE_TEXT == pp->node && isrep)
fputs("...", stdout);
}
}
@@ -1009,7 +1009,7 @@ pnode_printgroup(struct parse *p, struct
int isop, sv;
isop = 1;
- TAILQ_FOREACH(ap, &pn->attrq, child)
+ TAILQ_FOREACH(ap, &pn->attrq, child)
if (ATTRKEY_CHOICE == ap->key &&
(ATTRVAL_PLAIN == ap->val ||
ATTRVAL_REQ == ap->val)) {
@@ -1017,14 +1017,14 @@ pnode_printgroup(struct parse *p, struct
break;
}
- /*
+ /*
* Make sure we're on a macro line.
* This will prevent pnode_print() for putting us on a
* subsequent line.
*/
sv = p->newln;
pnode_printmopen(p);
- if (isop)
+ if (isop)
fputs("Op", stdout);
else if (sv)
fputs("No", stdout);
@@ -1329,8 +1329,8 @@ pnode_print(struct parse *p, struct pnod
break;
case (NODE_PARA):
assert(p->newln);
- if (NULL != pn->parent &&
- NODE_LISTITEM == pn->parent->node)
+ if (NULL != pn->parent &&
+ NODE_LISTITEM == pn->parent->node)
break;
puts(".Pp");
break;
@@ -1436,7 +1436,7 @@ pnode_print(struct parse *p, struct pnod
/*
* Output all characters, squeezing out whitespace
- * between newlines.
+ * between newlines.
* XXX: all whitespace, including tabs (?).
* Remember to escape control characters and escapes.
*/
@@ -1553,10 +1553,10 @@ pnode_print(struct parse *p, struct pnod
* <refname> macros in sequence, then print out a
* trailing comma before the newline.
*/
- if (NULL != pn->parent &&
+ if (NULL != pn->parent &&
NODE_REFNAMEDIV == pn->parent->node &&
NULL != TAILQ_NEXT(pn, child) &&
- NODE_REFNAME == TAILQ_NEXT(pn, child)->node)
+ NODE_REFNAME == TAILQ_NEXT(pn, child)->node)
fputs(" ,", stdout);
pnode_printmclose(p, sv);
break;
@@ -1577,7 +1577,7 @@ pnode_print(struct parse *p, struct pnod
* Invoke the parser context with each buffer fill.
*/
static int
-readfile(XML_Parser xp, int fd,
+readfile(XML_Parser xp, int fd,
char *b, size_t bsz, const char *fn)
{
struct parse p;
@@ -1598,12 +1598,12 @@ readfile(XML_Parser xp, int fd,
if (0 == (rc = XML_Parse(xp, b, ssz, 0 == ssz)))
fprintf(stderr, "%s:%zu:%zu: %s\n", fn,
XML_GetCurrentLineNumber(xp),
- XML_GetCurrentColumnNumber(xp),
+ XML_GetCurrentColumnNumber(xp),
XML_ErrorString
(XML_GetErrorCode(xp)));
else if ( ! p.stop && ssz > 0)
continue;
- /*
+ /*
* Exit when we've read all or errors have occured
* during the parse sequence.
*/
@@ -1660,7 +1660,7 @@ main(int argc, char *argv[])
fname = argv[0];
/* Read from stdin or a file. */
- fd = 0 == strcmp(fname, "-") ?
+ fd = 0 == strcmp(fname, "-") ?
STDIN_FILENO : open(fname, O_RDONLY, 0);
/*
Index: rules.c
===================================================================
RCS file: /home/cvs/mdocml/docbook2mdoc/rules.c,v
retrieving revision 1.24
retrieving revision 1.25
diff -Lrules.c -Lrules.c -u -p -r1.24 -r1.25
--- rules.c
+++ rules.c
@@ -579,7 +579,7 @@ isparent(enum nodeid node, enum nodeid p
case (NODE_CONSTANT):
case (NODE_EMPHASIS):
case (NODE_ENTRY):
- case (NODE_ENVAR):
+ case (NODE_ENVAR):
case (NODE_FILENAME):
case (NODE_FUNCDEF):
case (NODE_FUNCSYNOPSISINFO):
@@ -967,7 +967,7 @@ isparent(enum nodeid node, enum nodeid p
case (NODE_CONSTANT):
case (NODE_EMPHASIS):
case (NODE_ENTRY):
- case (NODE_ENVAR):
+ case (NODE_ENVAR):
case (NODE_FILENAME):
case (NODE_FUNCDEF):
case (NODE_FUNCSYNOPSISINFO):
Index: index.xml
===================================================================
RCS file: /home/cvs/mdocml/docbook2mdoc/index.xml,v
retrieving revision 1.10
retrieving revision 1.11
diff -Lindex.xml -Lindex.xml -u -p -r1.10 -r1.11
--- index.xml
+++ index.xml
@@ -2,7 +2,7 @@
<html>
<head>
<meta name="viewport" content="initial-scale=1.0, user-scalable=no" />
- <meta charset='utf-8' />
+ <meta charset='utf-8' />
<title>docbook2mdoc | Convert DocBook refentry to mdoc</title>
<style>
html, body { margin: 0; padding: 0; }
--
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:[~2015-03-19 10:05 UTC | newest]
Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-03-19 10:05 docbook2mdoc: zap trailing whitespace; verified with diff -b; patch from 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).