version 1.4, 2011/01/01 13:37:40 |
version 1.7, 2011/01/01 22:27:08 |
|
|
#include <ctype.h> |
#include <ctype.h> |
#include <stdlib.h> |
#include <stdlib.h> |
#include <string.h> |
#include <string.h> |
|
#include <time.h> |
|
|
#include "mandoc.h" |
#include "mandoc.h" |
#include "libmandoc.h" |
#include "libmandoc.h" |
Line 51 data(struct tbl *tbl, struct tbl_span *dp, |
|
Line 52 data(struct tbl *tbl, struct tbl_span *dp, |
|
dat = mandoc_calloc(1, sizeof(struct tbl_dat)); |
dat = mandoc_calloc(1, sizeof(struct tbl_dat)); |
dat->layout = cp; |
dat->layout = cp; |
|
|
|
if (NULL == dat->layout) |
|
TBL_MSG(tbl, MANDOCERR_TBLEXTRADAT, ln, *pos); |
|
|
if (dp->last) { |
if (dp->last) { |
dp->last->next = dat; |
dp->last->next = dat; |
dp->last = dat; |
dp->last = dat; |
Line 68 data(struct tbl *tbl, struct tbl_span *dp, |
|
Line 72 data(struct tbl *tbl, struct tbl_span *dp, |
|
if (p[*pos]) |
if (p[*pos]) |
(*pos)++; |
(*pos)++; |
|
|
/* XXX: do the strcmps, then malloc(). */ |
|
|
|
if ( ! strcmp(dat->string, "_")) |
if ( ! strcmp(dat->string, "_")) |
dat->flags |= TBL_DATA_HORIZ; |
dat->pos = TBL_DATA_HORIZ; |
else if ( ! strcmp(dat->string, "=")) |
else if ( ! strcmp(dat->string, "=")) |
dat->flags |= TBL_DATA_DHORIZ; |
dat->pos = TBL_DATA_DHORIZ; |
else if ( ! strcmp(dat->string, "\\_")) |
else if ( ! strcmp(dat->string, "\\_")) |
dat->flags |= TBL_DATA_NHORIZ; |
dat->pos = TBL_DATA_NHORIZ; |
else if ( ! strcmp(dat->string, "\\=")) |
else if ( ! strcmp(dat->string, "\\=")) |
dat->flags |= TBL_DATA_NDHORIZ; |
dat->pos = TBL_DATA_NDHORIZ; |
|
else |
|
dat->pos = TBL_DATA_DATA; |
} |
} |
|
|
int |
int |
Line 119 tbl_data(struct tbl *tbl, int ln, const char *p) |
|
Line 123 tbl_data(struct tbl *tbl, int ln, const char *p) |
|
tbl->last_span = tbl->first_span = dp; |
tbl->last_span = tbl->first_span = dp; |
|
|
if ( ! strcmp(p, "_")) { |
if ( ! strcmp(p, "_")) { |
dp->flags |= TBL_SPAN_HORIZ; |
dp->pos = TBL_SPAN_HORIZ; |
return(1); |
return(1); |
} else if ( ! strcmp(p, "=")) { |
} else if ( ! strcmp(p, "=")) { |
dp->flags |= TBL_SPAN_DHORIZ; |
dp->pos = TBL_SPAN_DHORIZ; |
return(1); |
return(1); |
} |
} |
|
|
|
dp->pos = TBL_SPAN_DATA; |
|
|
while ('\0' != p[pos]) |
while ('\0' != p[pos]) |
data(tbl, dp, ln, p, &pos); |
data(tbl, dp, ln, p, &pos); |