version 1.101, 2009/08/19 11:58:32 |
version 1.104, 2009/08/22 08:56:16 |
Line 459 mdoc_tail_alloc(struct mdoc *m, int line, int pos, int |
|
Line 459 mdoc_tail_alloc(struct mdoc *m, int line, int pos, int |
|
p = node_alloc(m, line, pos, tok, MDOC_TAIL); |
p = node_alloc(m, line, pos, tok, MDOC_TAIL); |
if (NULL == p) |
if (NULL == p) |
return(0); |
return(0); |
return(node_append(m, p)); |
if ( ! node_append(m, p)) |
|
return(0); |
|
m->next = MDOC_NEXT_CHILD; |
|
return(1); |
} |
} |
|
|
|
|
Line 474 mdoc_head_alloc(struct mdoc *m, int line, int pos, int |
|
Line 477 mdoc_head_alloc(struct mdoc *m, int line, int pos, int |
|
p = node_alloc(m, line, pos, tok, MDOC_HEAD); |
p = node_alloc(m, line, pos, tok, MDOC_HEAD); |
if (NULL == p) |
if (NULL == p) |
return(0); |
return(0); |
return(node_append(m, p)); |
if ( ! node_append(m, p)) |
|
return(0); |
|
m->next = MDOC_NEXT_CHILD; |
|
return(1); |
} |
} |
|
|
|
|
Line 486 mdoc_body_alloc(struct mdoc *m, int line, int pos, int |
|
Line 492 mdoc_body_alloc(struct mdoc *m, int line, int pos, int |
|
p = node_alloc(m, line, pos, tok, MDOC_BODY); |
p = node_alloc(m, line, pos, tok, MDOC_BODY); |
if (NULL == p) |
if (NULL == p) |
return(0); |
return(0); |
return(node_append(m, p)); |
if ( ! node_append(m, p)) |
|
return(0); |
|
m->next = MDOC_NEXT_CHILD; |
|
return(1); |
} |
} |
|
|
|
|
Line 502 mdoc_block_alloc(struct mdoc *m, int line, int pos, |
|
Line 511 mdoc_block_alloc(struct mdoc *m, int line, int pos, |
|
p->args = args; |
p->args = args; |
if (p->args) |
if (p->args) |
(args->refcnt)++; |
(args->refcnt)++; |
return(node_append(m, p)); |
if ( ! node_append(m, p)) |
|
return(0); |
|
m->next = MDOC_NEXT_CHILD; |
|
return(1); |
} |
} |
|
|
|
|
Line 518 mdoc_elem_alloc(struct mdoc *m, int line, int pos, |
|
Line 530 mdoc_elem_alloc(struct mdoc *m, int line, int pos, |
|
p->args = args; |
p->args = args; |
if (p->args) |
if (p->args) |
(args->refcnt)++; |
(args->refcnt)++; |
return(node_append(m, p)); |
if ( ! node_append(m, p)) |
|
return(0); |
|
m->next = MDOC_NEXT_CHILD; |
|
return(1); |
} |
} |
|
|
|
|
Line 667 macrowarn(struct mdoc *m, int ln, const char *buf) |
|
Line 682 macrowarn(struct mdoc *m, int ln, const char *buf) |
|
int |
int |
parsemacro(struct mdoc *m, int ln, char *buf) |
parsemacro(struct mdoc *m, int ln, char *buf) |
{ |
{ |
int i, j, c, ppos; |
int i, j, c; |
char mac[5]; |
char mac[5]; |
|
|
/* Empty lines are ignored. */ |
/* Empty lines are ignored. */ |
Line 687 parsemacro(struct mdoc *m, int ln, char *buf) |
|
Line 702 parsemacro(struct mdoc *m, int ln, char *buf) |
|
return(1); |
return(1); |
} |
} |
|
|
ppos = i; |
|
|
|
/* Copy the first word into a nil-terminated buffer. */ |
/* Copy the first word into a nil-terminated buffer. */ |
|
|
for (j = 0; j < 4; j++, i++) { |
for (j = 0; j < 4; j++, i++) { |
Line 696 parsemacro(struct mdoc *m, int ln, char *buf) |
|
Line 709 parsemacro(struct mdoc *m, int ln, char *buf) |
|
break; |
break; |
else if (' ' == buf[i]) |
else if (' ' == buf[i]) |
break; |
break; |
|
|
|
/* Check for invalid characters. */ |
|
|
|
if (isgraph((u_char)buf[i])) |
|
continue; |
|
return(mdoc_perr(m, ln, i, EPRINT)); |
} |
} |
|
|
mac[j] = 0; |
mac[j] = 0; |
Line 721 parsemacro(struct mdoc *m, int ln, char *buf) |
|
Line 740 parsemacro(struct mdoc *m, int ln, char *buf) |
|
* Begin recursive parse sequence. Since we're at the start of |
* Begin recursive parse sequence. Since we're at the start of |
* the line, we don't need to do callable/parseable checks. |
* the line, we don't need to do callable/parseable checks. |
*/ |
*/ |
if ( ! mdoc_macro(m, c, ln, ppos, &i, buf)) |
if ( ! mdoc_macro(m, c, ln, 1, &i, buf)) |
goto err; |
goto err; |
|
|
return(1); |
return(1); |