version 1.78, 2011/01/09 13:16:48 |
version 1.79, 2011/02/10 00:06:30 |
|
|
struct mdoc_node *); |
struct mdoc_node *); |
static int mdoc_ptext(struct mdoc *, int, char *, int); |
static int mdoc_ptext(struct mdoc *, int, char *, int); |
static int mdoc_pmacro(struct mdoc *, int, char *, int); |
static int mdoc_pmacro(struct mdoc *, int, char *, int); |
static int mdoc_span_alloc(struct mdoc *, |
|
const struct tbl_span *); |
|
|
|
|
|
const struct mdoc_node * |
const struct mdoc_node * |
mdoc_node(const struct mdoc *m) |
mdoc_node(const struct mdoc *m) |
{ |
{ |
|
|
int |
int |
mdoc_addspan(struct mdoc *m, const struct tbl_span *sp) |
mdoc_addspan(struct mdoc *m, const struct tbl_span *sp) |
{ |
{ |
|
struct mdoc_node *n; |
|
|
assert( ! (MDOC_HALT & m->flags)); |
assert( ! (MDOC_HALT & m->flags)); |
|
|
/* No text before an initial macro. */ |
/* No text before an initial macro. */ |
|
|
if (SEC_NONE == m->lastnamed) { |
if (SEC_NONE == m->lastnamed) { |
/* FIXME: grab from span. */ |
mdoc_pmsg(m, sp->line, 0, MANDOCERR_NOTEXT); |
mdoc_pmsg(m, 0, 0, MANDOCERR_NOTEXT); |
|
return(1); |
return(1); |
} |
} |
|
|
return(mdoc_span_alloc(m, sp)); |
n = node_alloc(m, sp->line, 0, MDOC_MAX, MDOC_TBL); |
|
n->span = sp; |
|
|
|
if ( ! node_append(m, n)) |
|
return(0); |
|
|
|
m->next = MDOC_NEXT_SIBLING; |
|
return(1); |
} |
} |
|
|
|
|
|
|
m->next = MDOC_NEXT_CHILD; |
m->next = MDOC_NEXT_CHILD; |
return(1); |
return(1); |
} |
} |
|
|
static int |
|
mdoc_span_alloc(struct mdoc *m, const struct tbl_span *sp) |
|
{ |
|
struct mdoc_node *n; |
|
|
|
/* FIXME: grab from tbl_span. */ |
|
n = node_alloc(m, 0, 0, MDOC_MAX, MDOC_TBL); |
|
n->span = sp; |
|
|
|
if ( ! node_append(m, n)) |
|
return(0); |
|
|
|
m->next = MDOC_NEXT_SIBLING; |
|
return(1); |
|
} |
|
|
|
|
|
int |
int |
mdoc_word_alloc(struct mdoc *m, int line, int pos, const char *p) |
mdoc_word_alloc(struct mdoc *m, int line, int pos, const char *p) |