version 1.12, 2009/06/16 19:45:51 |
version 1.16, 2009/06/17 14:14:51 |
Line 51 static int concat(struct mdoc *, const struct mdoc_n |
|
Line 51 static int concat(struct mdoc *, const struct mdoc_n |
|
|
|
static int post_ar(POST_ARGS); |
static int post_ar(POST_ARGS); |
static int post_bl(POST_ARGS); |
static int post_bl(POST_ARGS); |
|
static int post_bl_head(POST_ARGS); |
static int post_bl_width(POST_ARGS); |
static int post_bl_width(POST_ARGS); |
static int post_bl_tagwidth(POST_ARGS); |
static int post_bl_tagwidth(POST_ARGS); |
static int post_dd(POST_ARGS); |
static int post_dd(POST_ARGS); |
Line 515 post_os(POST_ARGS) |
|
Line 516 post_os(POST_ARGS) |
|
|
|
if (NULL == (m->meta.os = strdup(buf))) |
if (NULL == (m->meta.os = strdup(buf))) |
return(verr(m, EMALLOC)); |
return(verr(m, EMALLOC)); |
m->lastnamed = m->lastsec = SEC_BODY; |
|
|
|
|
m->flags |= MDOC_PBODY; |
return(post_prol(m)); |
return(post_prol(m)); |
} |
} |
|
|
Line 634 post_bl_width(struct mdoc *m) |
|
Line 635 post_bl_width(struct mdoc *m) |
|
|
|
|
|
static int |
static int |
|
post_bl_head(POST_ARGS) |
|
{ |
|
int i, c; |
|
struct mdoc_node *n, *nn, *nnp; |
|
|
|
if (NULL == m->last->child) |
|
return(1); |
|
|
|
n = m->last->parent; |
|
assert(n->args); |
|
|
|
for (c = 0; c < (int)n->args->argc; c++) |
|
if (MDOC_Column == n->args->argv[c].arg) |
|
break; |
|
|
|
/* Only process -column. */ |
|
|
|
if (c == (int)n->args->argc) |
|
return(1); |
|
|
|
assert(0 == n->args->argv[c].sz); |
|
|
|
/* |
|
* Accomodate for new-style groff column syntax. Shuffle the |
|
* child nodes, all of which must be TEXT, as arguments for the |
|
* column field. Then, delete the head children. |
|
*/ |
|
|
|
for (i = 0, nn = m->last->child; nn; nn = nn->next, i++) |
|
/* Count children. */; |
|
|
|
n->args->argv[c].sz = (size_t)i; |
|
n->args->argv[c].value = malloc((size_t)i * sizeof(char *)); |
|
|
|
for (i = 0, nn = m->last->child; nn; i++) { |
|
n->args->argv[c].value[i] = nn->string; |
|
nn->string = NULL; |
|
nnp = nn; |
|
nn = nn->next; |
|
mdoc_node_free(nnp); |
|
} |
|
|
|
m->last->child = NULL; |
|
return(1); |
|
} |
|
|
|
|
|
static int |
post_bl(POST_ARGS) |
post_bl(POST_ARGS) |
{ |
{ |
int i, r, len; |
int i, r, len; |
|
|
|
if (MDOC_HEAD == m->last->type) |
|
return(post_bl_head(m)); |
if (MDOC_BLOCK != m->last->type) |
if (MDOC_BLOCK != m->last->type) |
return(1); |
return(1); |
|
|
|
|
pre_dl(PRE_ARGS) |
pre_dl(PRE_ARGS) |
{ |
{ |
|
|
if (MDOC_BODY != n->type) |
if (MDOC_BODY == n->type) |
return(1); |
m->flags |= MDOC_LITERAL; |
m->flags |= MDOC_LITERAL; |
|
return(1); |
return(1); |
} |
} |
|
|