version 1.6, 2010/12/29 14:38:14 |
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 85 tbl_read(struct tbl *tbl, int ln, const char *p, int o |
|
Line 102 tbl_read(struct tbl *tbl, int ln, const char *p, int o |
|
return(tbl_option(tbl, ln, p) ? ROFF_IGN : ROFF_ERR); |
return(tbl_option(tbl, ln, p) ? ROFF_IGN : ROFF_ERR); |
case (TBL_PART_LAYOUT): |
case (TBL_PART_LAYOUT): |
return(tbl_layout(tbl, ln, p) ? ROFF_IGN : ROFF_ERR); |
return(tbl_layout(tbl, ln, p) ? ROFF_IGN : ROFF_ERR); |
default: |
case (TBL_PART_DATA): |
break; |
break; |
} |
} |
|
|
return(ROFF_CONT); |
/* |
|
* FIXME: allow the original string to slip through for the time |
|
* being. |
|
*/ |
|
return(tbl_data(tbl, ln, p) ? ROFF_CONT : ROFF_ERR); |
} |
} |
|
|
struct tbl * |
struct tbl * |
Line 118 tbl_reset(struct tbl *tbl) |
|
Line 139 tbl_reset(struct tbl *tbl) |
|
|
|
tbl_clear(tbl); |
tbl_clear(tbl); |
tbl_init(tbl); |
tbl_init(tbl); |
|
} |
|
|
|
void |
|
tbl_restart(struct tbl *tbl) |
|
{ |
|
|
|
tbl->part = TBL_PART_LAYOUT; |
} |
} |
|
|