version 1.80, 2010/05/31 23:40:25 |
version 1.86, 2010/06/08 13:22:37 |
|
|
OUTT_TREE, |
OUTT_TREE, |
OUTT_HTML, |
OUTT_HTML, |
OUTT_XHTML, |
OUTT_XHTML, |
OUTT_LINT |
OUTT_LINT, |
|
OUTT_PS |
}; |
}; |
|
|
struct curparse { |
struct curparse { |
Line 97 struct curparse { |
|
Line 98 struct curparse { |
|
static const char * const mandocerrs[MANDOCERR_MAX] = { |
static const char * const mandocerrs[MANDOCERR_MAX] = { |
"ok", |
"ok", |
"text should be uppercase", |
"text should be uppercase", |
"sections out of conentional order", |
"sections out of conventional order", |
"section name repeats", |
"section name repeats", |
"out of order prologue", |
"out of order prologue", |
"repeated prologue entry", |
"repeated prologue entry", |
Line 110 static const char * const mandocerrs[MANDOCERR_MAX] = |
|
Line 111 static const char * const mandocerrs[MANDOCERR_MAX] = |
|
"superfluous width argument", |
"superfluous width argument", |
"bad date argument", |
"bad date argument", |
"bad width argument", |
"bad width argument", |
"unknown manual sction", |
"unknown manual section", |
"section not in conventional manual section", |
"section not in conventional manual section", |
"end of line whitespace", |
"end of line whitespace", |
"scope open on exit", |
"scope open on exit", |
Line 141 static const char * const mandocerrs[MANDOCERR_MAX] = |
|
Line 142 static const char * const mandocerrs[MANDOCERR_MAX] = |
|
"macro requires body argument(s)", |
"macro requires body argument(s)", |
"macro requires argument(s)", |
"macro requires argument(s)", |
"no title in document", |
"no title in document", |
|
"missing list type", |
"line argument(s) will be lost", |
"line argument(s) will be lost", |
"body argument(s) will be lost", |
"body argument(s) will be lost", |
"column syntax is inconsistent", |
"column syntax is inconsistent", |
"missing font type", |
"missing font type", |
"missing display type", |
"missing display type", |
"missing list type", |
|
"displays may not be nested", |
"displays may not be nested", |
"no scope to rewind: syntax violated", |
"no scope to rewind: syntax violated", |
"scope broken, syntax violated", |
"scope broken, syntax violated", |
Line 395 read_whole_file(struct curparse *curp, struct buf *fb, |
|
Line 396 read_whole_file(struct curparse *curp, struct buf *fb, |
|
*with_mmap = 1; |
*with_mmap = 1; |
fb->sz = (size_t)st.st_size; |
fb->sz = (size_t)st.st_size; |
fb->buf = mmap(NULL, fb->sz, PROT_READ, |
fb->buf = mmap(NULL, fb->sz, PROT_READ, |
MAP_FILE, curp->fd, 0); |
MAP_FILE|MAP_SHARED, curp->fd, 0); |
if (fb->buf != MAP_FAILED) |
if (fb->buf != MAP_FAILED) |
return(1); |
return(1); |
} |
} |
Line 584 fdesc(struct curparse *curp) |
|
Line 585 fdesc(struct curparse *curp) |
|
switch (curp->outtype) { |
switch (curp->outtype) { |
case (OUTT_XHTML): |
case (OUTT_XHTML): |
curp->outdata = xhtml_alloc(curp->outopts); |
curp->outdata = xhtml_alloc(curp->outopts); |
curp->outman = html_man; |
|
curp->outmdoc = html_mdoc; |
|
curp->outfree = html_free; |
|
break; |
break; |
case (OUTT_HTML): |
case (OUTT_HTML): |
curp->outdata = html_alloc(curp->outopts); |
curp->outdata = html_alloc(curp->outopts); |
|
break; |
|
case (OUTT_ASCII): |
|
curp->outdata = ascii_alloc(curp->outopts); |
|
curp->outfree = ascii_free; |
|
break; |
|
case (OUTT_PS): |
|
curp->outdata = ps_alloc(); |
|
curp->outfree = ps_free; |
|
break; |
|
default: |
|
break; |
|
} |
|
|
|
switch (curp->outtype) { |
|
case (OUTT_HTML): |
|
/* FALLTHROUGH */ |
|
case (OUTT_XHTML): |
curp->outman = html_man; |
curp->outman = html_man; |
curp->outmdoc = html_mdoc; |
curp->outmdoc = html_mdoc; |
curp->outfree = html_free; |
curp->outfree = html_free; |
Line 598 fdesc(struct curparse *curp) |
|
Line 613 fdesc(struct curparse *curp) |
|
curp->outman = tree_man; |
curp->outman = tree_man; |
curp->outmdoc = tree_mdoc; |
curp->outmdoc = tree_mdoc; |
break; |
break; |
case (OUTT_LINT): |
case (OUTT_ASCII): |
break; |
/* FALLTHROUGH */ |
default: |
case (OUTT_PS): |
curp->outdata = ascii_alloc(80); |
|
curp->outman = terminal_man; |
curp->outman = terminal_man; |
curp->outmdoc = terminal_mdoc; |
curp->outmdoc = terminal_mdoc; |
curp->outfree = terminal_free; |
|
break; |
break; |
|
default: |
|
break; |
} |
} |
} |
} |
|
|
Line 729 toptions(struct curparse *curp, char *arg) |
|
Line 744 toptions(struct curparse *curp, char *arg) |
|
curp->outtype = OUTT_HTML; |
curp->outtype = OUTT_HTML; |
else if (0 == strcmp(arg, "xhtml")) |
else if (0 == strcmp(arg, "xhtml")) |
curp->outtype = OUTT_XHTML; |
curp->outtype = OUTT_XHTML; |
|
else if (0 == strcmp(arg, "ps")) |
|
curp->outtype = OUTT_PS; |
else { |
else { |
fprintf(stderr, "%s: Bad argument\n", arg); |
fprintf(stderr, "%s: Bad argument\n", arg); |
return(0); |
return(0); |