version 1.8, 2009/06/18 23:51:12 |
version 1.9, 2009/06/19 07:20:19 |
|
|
|
|
bzero(&mdoc->meta, sizeof(struct mdoc_meta)); |
bzero(&mdoc->meta, sizeof(struct mdoc_meta)); |
mdoc->flags = 0; |
mdoc->flags = 0; |
mdoc->lastnamed = mdoc->lastsec = 0; |
mdoc->lastnamed = mdoc->lastsec = SEC_NONE; |
mdoc->last = calloc(1, sizeof(struct mdoc_node)); |
mdoc->last = calloc(1, sizeof(struct mdoc_node)); |
if (NULL == mdoc->last) |
if (NULL == mdoc->last) |
return(0); |
return(0); |
|
|
int ln, int pp, int *pos, char *buf) |
int ln, int pp, int *pos, char *buf) |
{ |
{ |
|
|
/* FIXME - these should happen during validation. */ |
|
|
|
if (MDOC_PROLOGUE & mdoc_macros[tok].flags && |
if (MDOC_PROLOGUE & mdoc_macros[tok].flags && |
SEC_PROLOGUE != m->lastnamed) |
MDOC_PBODY & m->flags) |
return(perr(m, ln, pp, EPROLBODY)); |
return(perr(m, ln, pp, EPROLBODY)); |
|
|
if ( ! (MDOC_PROLOGUE & mdoc_macros[tok].flags) && |
if ( ! (MDOC_PROLOGUE & mdoc_macros[tok].flags) && |
SEC_PROLOGUE == m->lastnamed) |
! (MDOC_PBODY & m->flags)) |
return(perr(m, ln, pp, EBODYPROL)); |
return(perr(m, ln, pp, EBODYPROL)); |
|
|
if (1 != pp && ! (MDOC_CALLABLE & mdoc_macros[tok].flags)) |
if (1 != pp && ! (MDOC_CALLABLE & mdoc_macros[tok].flags)) |
|
|
parsetext(struct mdoc *m, int line, char *buf) |
parsetext(struct mdoc *m, int line, char *buf) |
{ |
{ |
|
|
if (SEC_PROLOGUE == m->lastnamed) |
if (SEC_NONE == m->lastnamed) |
return(perr(m, line, 0, ETEXTPROL)); |
return(perr(m, line, 0, ETEXTPROL)); |
|
|
if (0 == buf[0] && ! (MDOC_LITERAL & m->flags)) |
if (0 == buf[0] && ! (MDOC_LITERAL & m->flags)) |