version 1.90, 2010/06/26 15:22:19 |
version 1.93, 2010/06/29 14:53:14 |
Line 88 struct curparse { |
|
Line 88 struct curparse { |
|
struct man *man; /* man parser */ |
struct man *man; /* man parser */ |
struct mdoc *mdoc; /* mdoc parser */ |
struct mdoc *mdoc; /* mdoc parser */ |
struct roff *roff; /* roff parser (!NULL) */ |
struct roff *roff; /* roff parser (!NULL) */ |
|
struct regset regs; /* roff registers */ |
enum outt outtype; /* which output to use */ |
enum outt outtype; /* which output to use */ |
out_mdoc outmdoc; /* mdoc output ptr */ |
out_mdoc outmdoc; /* mdoc output ptr */ |
out_man outman; /* man output ptr */ |
out_man outman; /* man output ptr */ |
Line 298 man_init(struct curparse *curp) |
|
Line 299 man_init(struct curparse *curp) |
|
if (curp->fflags & FL_NIGN_ESCAPE) |
if (curp->fflags & FL_NIGN_ESCAPE) |
pflags &= ~MAN_IGN_ESCAPE; |
pflags &= ~MAN_IGN_ESCAPE; |
|
|
return(man_alloc(curp, pflags, mmsg)); |
return(man_alloc(&curp->regs, curp, pflags, mmsg)); |
} |
} |
|
|
|
|
Line 306 static struct roff * |
|
Line 307 static struct roff * |
|
roff_init(struct curparse *curp) |
roff_init(struct curparse *curp) |
{ |
{ |
|
|
return(roff_alloc(mmsg, curp)); |
return(roff_alloc(&curp->regs, mmsg, curp)); |
} |
} |
|
|
|
|
Line 326 mdoc_init(struct curparse *curp) |
|
Line 327 mdoc_init(struct curparse *curp) |
|
if (curp->fflags & FL_NIGN_MACRO) |
if (curp->fflags & FL_NIGN_MACRO) |
pflags &= ~MDOC_IGN_MACRO; |
pflags &= ~MDOC_IGN_MACRO; |
|
|
return(mdoc_alloc(curp, pflags, mmsg)); |
return(mdoc_alloc(&curp->regs, curp, pflags, mmsg)); |
} |
} |
|
|
|
|
Line 451 fdesc(struct curparse *curp) |
|
Line 452 fdesc(struct curparse *curp) |
|
struct man *man; |
struct man *man; |
struct mdoc *mdoc; |
struct mdoc *mdoc; |
struct roff *roff; |
struct roff *roff; |
struct regset regs; |
|
|
|
man = NULL; |
man = NULL; |
mdoc = NULL; |
mdoc = NULL; |
roff = NULL; |
roff = NULL; |
|
|
memset(&ln, 0, sizeof(struct buf)); |
memset(&ln, 0, sizeof(struct buf)); |
memset(®s, 0, sizeof(struct regset)); |
|
|
|
/* |
/* |
* Two buffers: ln and buf. buf is the input file and may be |
* Two buffers: ln and buf. buf is the input file and may be |
Line 540 fdesc(struct curparse *curp) |
|
Line 540 fdesc(struct curparse *curp) |
|
|
|
of = 0; |
of = 0; |
do { |
do { |
re = roff_parseln(roff, ®s, lnn_start, |
re = roff_parseln(roff, lnn_start, |
&ln.buf, &ln.sz, of, &of); |
&ln.buf, &ln.sz, of, &of); |
} while (ROFF_RERUN == re); |
} while (ROFF_RERUN == re); |
|
|
Line 599 fdesc(struct curparse *curp) |
|
Line 599 fdesc(struct curparse *curp) |
|
curp->outfree = ascii_free; |
curp->outfree = ascii_free; |
break; |
break; |
case (OUTT_PS): |
case (OUTT_PS): |
curp->outdata = ps_alloc(); |
curp->outdata = ps_alloc(curp->outopts); |
curp->outfree = ps_free; |
curp->outfree = ps_free; |
break; |
break; |
default: |
default: |
Line 637 fdesc(struct curparse *curp) |
|
Line 637 fdesc(struct curparse *curp) |
|
(*curp->outmdoc)(curp->outdata, mdoc); |
(*curp->outmdoc)(curp->outdata, mdoc); |
|
|
cleanup: |
cleanup: |
|
memset(&curp->regs, 0, sizeof(struct regset)); |
if (mdoc) |
if (mdoc) |
mdoc_reset(mdoc); |
mdoc_reset(mdoc); |
if (man) |
if (man) |