version 1.8, 2010/12/29 16:44:23 |
version 1.9, 2010/12/30 09:34:07 |
Line 33 tbl_clear(struct tbl *tbl) |
|
Line 33 tbl_clear(struct tbl *tbl) |
|
{ |
{ |
struct tbl_row *rp; |
struct tbl_row *rp; |
struct tbl_cell *cp; |
struct tbl_cell *cp; |
|
struct tbl_span *sp; |
|
struct tbl_dat *dp; |
|
|
while (tbl->first) { |
while (tbl->first_row) { |
rp = tbl->first; |
rp = tbl->first_row; |
tbl->first = rp->next; |
tbl->first_row = rp->next; |
while (rp->first) { |
while (rp->first) { |
cp = rp->first; |
cp = rp->first; |
rp->first = cp->next; |
rp->first = cp->next; |
Line 45 tbl_clear(struct tbl *tbl) |
|
Line 47 tbl_clear(struct tbl *tbl) |
|
free(rp); |
free(rp); |
} |
} |
|
|
tbl->last = NULL; |
tbl->last_row = NULL; |
|
|
|
while (tbl->first_span) { |
|
sp = tbl->first_span; |
|
tbl->first_span = sp->next; |
|
while (sp->first) { |
|
dp = sp->first; |
|
sp->first = dp->next; |
|
if (dp->string) |
|
free(dp->string); |
|
free(dp); |
|
} |
|
free(sp); |
|
} |
|
|
|
tbl->last_span = NULL; |
} |
} |
|
|
static void |
static void |
Line 63 tbl_read(struct tbl *tbl, int ln, const char *p, int o |
|
Line 80 tbl_read(struct tbl *tbl, int ln, const char *p, int o |
|
{ |
{ |
int len; |
int len; |
const char *cp; |
const char *cp; |
struct tbl_dat *dp; |
|
struct tbl_span *sp; |
|
|
|
cp = &p[offs]; |
cp = &p[offs]; |
len = (int)strlen(cp); |
len = (int)strlen(cp); |
Line 91 tbl_read(struct tbl *tbl, int ln, const char *p, int o |
|
Line 106 tbl_read(struct tbl *tbl, int ln, const char *p, int o |
|
break; |
break; |
} |
} |
|
|
/* XXX: throw away data for now. */ |
/* |
if (NULL != (sp = tbl_data(tbl, ln, p))) { |
* FIXME: allow the original string to slip through for the time |
while (NULL != (dp = sp->first)) { |
* being. |
sp->first = sp->first->next; |
*/ |
if (dp->string) |
return(tbl_data(tbl, ln, p) ? ROFF_CONT : ROFF_ERR); |
free(dp->string); |
|
free(dp); |
|
} |
|
free(sp); |
|
} |
|
|
|
return(ROFF_CONT); |
|
} |
} |
|
|
struct tbl * |
struct tbl * |
|
|
tbl_restart(struct tbl *tbl) |
tbl_restart(struct tbl *tbl) |
{ |
{ |
|
|
tbl_clear(tbl); |
|
tbl->part = TBL_PART_LAYOUT; |
tbl->part = TBL_PART_LAYOUT; |
} |
} |
|
|