version 1.30, 2014/04/02 12:12:41 |
version 1.32, 2014/04/30 09:04:40 |
Line 96 static const struct node nodes[NODE__MAX] = { |
|
Line 96 static const struct node nodes[NODE__MAX] = { |
|
{ "cmdsynopsis", NODE_IGNTEXT }, |
{ "cmdsynopsis", NODE_IGNTEXT }, |
{ "code", 0 }, |
{ "code", 0 }, |
{ "command", 0 }, |
{ "command", 0 }, |
|
{ "constant", 0 }, |
|
{ "copyright", NODE_IGNTEXT }, |
{ "date", 0 }, |
{ "date", 0 }, |
{ "emphasis", 0 }, |
{ "emphasis", 0 }, |
{ "entry", 0 }, |
{ "entry", 0 }, |
Line 106 static const struct node nodes[NODE__MAX] = { |
|
Line 108 static const struct node nodes[NODE__MAX] = { |
|
{ "funcsynopsis", NODE_IGNTEXT }, |
{ "funcsynopsis", NODE_IGNTEXT }, |
{ "funcsynopsisinfo", 0 }, |
{ "funcsynopsisinfo", 0 }, |
{ "function", 0 }, |
{ "function", 0 }, |
{ "itemizedlist", NODE_IGNTEXT }, |
|
{ "group", NODE_IGNTEXT }, |
{ "group", NODE_IGNTEXT }, |
|
{ "holder", NODE_IGNTEXT }, |
|
{ "info", NODE_IGNTEXT }, |
|
{ "itemizedlist", NODE_IGNTEXT }, |
{ "link", 0 }, |
{ "link", 0 }, |
{ "listitem", NODE_IGNTEXT }, |
{ "listitem", NODE_IGNTEXT }, |
{ "literal", 0 }, |
{ "literal", 0 }, |
Line 159 static const struct node nodes[NODE__MAX] = { |
|
Line 163 static const struct node nodes[NODE__MAX] = { |
|
{ "varname", 0 }, |
{ "varname", 0 }, |
{ "warning", NODE_IGNTEXT }, |
{ "warning", NODE_IGNTEXT }, |
{ "wordasword", 0 }, |
{ "wordasword", 0 }, |
|
{ "year", NODE_IGNTEXT }, |
}; |
}; |
|
|
static void |
static void |
Line 335 xml_elem_start(void *arg, const XML_Char *name, const |
|
Line 340 xml_elem_start(void *arg, const XML_Char *name, const |
|
if (0 == strcmp(*att, attrkeys[key])) |
if (0 == strcmp(*att, attrkeys[key])) |
break; |
break; |
if (ATTRKEY__MAX == key) { |
if (ATTRKEY__MAX == key) { |
fprintf(stderr, "%s:%zu:%zu: unknown " |
fprintf(stderr, "%s:%zu:%zu: warning: " |
"attribute \"%s\"\n", ps->fname, |
"unknown attribute \"%s\"\n", |
|
ps->fname, |
XML_GetCurrentLineNumber(ps->xml), |
XML_GetCurrentLineNumber(ps->xml), |
XML_GetCurrentColumnNumber(ps->xml), |
XML_GetCurrentColumnNumber(ps->xml), |
*att); |
*att); |
continue; |
continue; |
} else if ( ! isattrkey(node, key)) { |
} else if ( ! isattrkey(node, key)) { |
fprintf(stderr, "%s:%zu:%zu: bad " |
fprintf(stderr, "%s:%zu:%zu: warning: " |
"attribute \"%s\"\n", ps->fname, |
"bad attribute \"%s\"\n", |
|
ps->fname, |
XML_GetCurrentLineNumber(ps->xml), |
XML_GetCurrentLineNumber(ps->xml), |
XML_GetCurrentColumnNumber(ps->xml), |
XML_GetCurrentColumnNumber(ps->xml), |
*att); |
*att); |
Line 353 xml_elem_start(void *arg, const XML_Char *name, const |
|
Line 360 xml_elem_start(void *arg, const XML_Char *name, const |
|
if (0 == strcmp(*(att + 1), attrvals[val])) |
if (0 == strcmp(*(att + 1), attrvals[val])) |
break; |
break; |
if (ATTRVAL__MAX != val && ! isattrval(key, val)) { |
if (ATTRVAL__MAX != val && ! isattrval(key, val)) { |
fprintf(stderr, "%s:%zu:%zu: bad " |
fprintf(stderr, "%s:%zu:%zu: warning: " |
"value \"%s\"\n", ps->fname, |
"bad attribute value \"%s\"\n", |
|
ps->fname, |
XML_GetCurrentLineNumber(ps->xml), |
XML_GetCurrentLineNumber(ps->xml), |
XML_GetCurrentColumnNumber(ps->xml), |
XML_GetCurrentColumnNumber(ps->xml), |
*(att + 1)); |
*(att + 1)); |
Line 518 pnode_findfirst(struct pnode *pn, enum nodeid node) |
|
Line 526 pnode_findfirst(struct pnode *pn, enum nodeid node) |
|
|
|
#define MACROLINE_NORM 0 |
#define MACROLINE_NORM 0 |
#define MACROLINE_UPPER 1 |
#define MACROLINE_UPPER 1 |
|
#define MACROLINE_NOWS 2 |
/* |
/* |
* Recursively print text presumably on a macro line. |
* Recursively print text presumably on a macro line. |
* Convert all whitespace to regular spaces. |
* Convert all whitespace to regular spaces. |
Line 527 pnode_printmacrolinetext(struct parse *p, struct pnode |
|
Line 536 pnode_printmacrolinetext(struct parse *p, struct pnode |
|
{ |
{ |
char *cp; |
char *cp; |
|
|
if (0 == p->newln) |
if (0 == p->newln && ! (MACROLINE_NOWS & fl)) |
putchar(' '); |
putchar(' '); |
|
|
bufclear(p); |
bufclear(p); |
Line 781 pnode_printparamdef(struct parse *p, struct pnode *pn) |
|
Line 790 pnode_printparamdef(struct parse *p, struct pnode *pn) |
|
fputs(".Fa \"", stdout); |
fputs(".Fa \"", stdout); |
p->newln = 0; |
p->newln = 0; |
if (NULL != ptype) { |
if (NULL != ptype) { |
pnode_printmacrolinepart(p, ptype); |
pnode_printmacrolinetext(p, ptype, MACROLINE_NOWS); |
putchar(' '); |
putchar(' '); |
} |
} |
|
|
Line 1146 pnode_print(struct parse *p, struct pnode *pn) |
|
Line 1155 pnode_print(struct parse *p, struct pnode *pn) |
|
/* Suppress non-text children... */ |
/* Suppress non-text children... */ |
pnode_printmopen(p); |
pnode_printmopen(p); |
fputs("Fa \"", stdout); |
fputs("Fa \"", stdout); |
pnode_printmacrolinepart(p, pn); |
pnode_printmacrolinetext(p, pn, MACROLINE_NOWS); |
puts("\""); |
fputs("\"", stdout); |
pnode_unlinksub(pn); |
pnode_unlinksub(pn); |
break; |
break; |
case (NODE_QUOTE): |
case (NODE_QUOTE): |