version 1.112, 2010/12/29 14:53:31 |
version 1.114, 2010/12/31 18:19:43 |
|
|
struct regset *regs; /* read/writable registers */ |
struct regset *regs; /* read/writable registers */ |
struct roffstr *first_string; /* user-defined strings & macros */ |
struct roffstr *first_string; /* user-defined strings & macros */ |
const char *current_string; /* value of last called user macro */ |
const char *current_string; /* value of last called user macro */ |
struct tbl *tbl; |
struct tbl *first_tbl; /* first table parsed */ |
|
struct tbl *last_tbl; /* last table parsed */ |
|
struct tbl *tbl; /* current table being parsed */ |
}; |
}; |
|
|
struct roffnode { |
struct roffnode { |
Line 299 roffnode_push(struct roff *r, enum rofft tok, const ch |
|
Line 301 roffnode_push(struct roff *r, enum rofft tok, const ch |
|
static void |
static void |
roff_free1(struct roff *r) |
roff_free1(struct roff *r) |
{ |
{ |
|
struct tbl *t; |
|
|
if (r->tbl) { |
while (r->first_tbl) { |
tbl_free(r->tbl); |
t = r->first_tbl; |
r->tbl = NULL; |
r->first_tbl = t->next; |
|
tbl_free(t); |
} |
} |
|
|
|
r->first_tbl = r->last_tbl = r->tbl = NULL; |
|
|
while (r->last) |
while (r->last) |
roffnode_pop(r); |
roffnode_pop(r); |
|
|
Line 1117 roff_TE(ROFF_ARGS) |
|
Line 1123 roff_TE(ROFF_ARGS) |
|
|
|
if (NULL == r->tbl) |
if (NULL == r->tbl) |
(*r->msg)(MANDOCERR_NOSCOPE, r->data, ln, ppos, NULL); |
(*r->msg)(MANDOCERR_NOSCOPE, r->data, ln, ppos, NULL); |
else |
|
tbl_free(r->tbl); |
|
|
|
r->tbl = NULL; |
r->tbl = NULL; |
return(ROFF_IGN); |
return(ROFF_IGN); |
Line 1141 roff_T_(ROFF_ARGS) |
|
Line 1145 roff_T_(ROFF_ARGS) |
|
static enum rofferr |
static enum rofferr |
roff_TS(ROFF_ARGS) |
roff_TS(ROFF_ARGS) |
{ |
{ |
|
struct tbl *t; |
|
|
if (r->tbl) { |
if (r->tbl) |
(*r->msg)(MANDOCERR_SCOPEBROKEN, r->data, ln, ppos, NULL); |
(*r->msg)(MANDOCERR_SCOPEBROKEN, r->data, ln, ppos, NULL); |
tbl_reset(r->tbl); |
|
} else |
|
r->tbl = tbl_alloc(r->data, r->msg); |
|
|
|
|
t = tbl_alloc(r->data, r->msg); |
|
|
|
if (r->last_tbl) |
|
r->last_tbl->next = t; |
|
else |
|
r->first_tbl = r->last_tbl = t; |
|
|
|
r->tbl = r->last_tbl = t; |
return(ROFF_IGN); |
return(ROFF_IGN); |
} |
} |
|
|
Line 1364 roff_freestr(struct roff *r) |
|
Line 1374 roff_freestr(struct roff *r) |
|
} |
} |
|
|
r->first_string = NULL; |
r->first_string = NULL; |
|
} |
|
|
|
const struct tbl_span * |
|
roff_span(const struct roff *r) |
|
{ |
|
|
|
return(r->tbl ? tbl_span(r->tbl) : NULL); |
} |
} |