-
- return(1);
-}
-
-
-static struct mdoc_node *
-node_alloc(struct mdoc *m, int line, int pos,
- enum mdoct tok, enum mdoc_type type)
-{
- struct mdoc_node *p;
-
- p = mandoc_calloc(1, sizeof(struct mdoc_node));
- p->sec = m->lastsec;
- p->line = line;
- p->pos = pos;
- p->tok = tok;
- p->type = type;
- if (MDOC_NEWLINE & m->flags)
- p->flags |= MDOC_LINE;
- m->flags &= ~MDOC_NEWLINE;
- return(p);
-}
-
-
-int
-mdoc_tail_alloc(struct mdoc *m, int line, int pos, enum mdoct tok)
-{
- struct mdoc_node *p;
-
- p = node_alloc(m, line, pos, tok, MDOC_TAIL);
- if ( ! node_append(m, p))
- return(0);
- m->next = MDOC_NEXT_CHILD;
- return(1);
-}
-
-
-int
-mdoc_head_alloc(struct mdoc *m, int line, int pos, enum mdoct tok)
-{
- struct mdoc_node *p;
-
- assert(m->first);
- assert(m->last);
-
- p = node_alloc(m, line, pos, tok, MDOC_HEAD);
- if ( ! node_append(m, p))
- return(0);
- m->next = MDOC_NEXT_CHILD;
- return(1);
-}
-
-
-int
-mdoc_body_alloc(struct mdoc *m, int line, int pos, enum mdoct tok)
-{
- struct mdoc_node *p;
-
- p = node_alloc(m, line, pos, tok, MDOC_BODY);
- if ( ! node_append(m, p))
- return(0);
- m->next = MDOC_NEXT_CHILD;
- return(1);
-}
-
-
-int
-mdoc_block_alloc(struct mdoc *m, int line, int pos,
- enum mdoct tok, struct mdoc_arg *args)
-{
- struct mdoc_node *p;
-
- p = node_alloc(m, line, pos, tok, MDOC_BLOCK);
- p->args = args;
- if (p->args)
- (args->refcnt)++;
- if ( ! node_append(m, p))
- return(0);
- m->next = MDOC_NEXT_CHILD;
- return(1);