int man_block_alloc(struct man *man, int line, int pos, enum mant tok) { struct man_node *p; p = man_node_alloc(man, line, pos, MAN_BLOCK, tok); if ( ! man_node_append(man, p)) return(0); man->next = MAN_NEXT_CHILD; return(1); }
int man_body_alloc(struct man *m, int line, int pos, enum mant tok) { struct man_node *p; p = man_node_alloc(m, line, pos, MAN_BODY, tok); if ( ! man_node_append(m, p)) return(0); m->next = MAN_NEXT_CHILD; return(1); }
int man_word_alloc(struct man *man, int line, int pos, const char *word) { struct man_node *n; n = man_node_alloc(man, line, pos, MAN_TEXT, MAN_MAX); n->string = roff_strdup(man->roff, word); if ( ! man_node_append(man, n)) return(0); man->next = MAN_NEXT_SIBLING; return(1); }
int man_addspan(struct man *man, const struct tbl_span *sp) { struct man_node *n; n = man_node_alloc(man, sp->line, 0, MAN_TBL, MAN_MAX); n->span = sp; if ( ! man_node_append(man, n)) return(0); man->next = MAN_NEXT_SIBLING; return(man_descope(man, sp->line, 0)); }
int man_addeqn(struct man *man, const struct eqn *ep) { struct man_node *n; n = man_node_alloc(man, ep->ln, ep->pos, MAN_EQN, MAN_MAX); n->eqn = ep; if ( ! man_node_append(man, n)) return(0); man->next = MAN_NEXT_SIBLING; return(man_descope(man, ep->ln, ep->pos)); }
int man_addspan(struct man *m, const struct tbl_span *sp) { struct man_node *n; assert( ! (MAN_HALT & m->flags)); n = man_node_alloc(m, sp->line, 0, MAN_TBL, MAN_MAX); n->span = sp; if ( ! man_node_append(m, n)) return(0); m->next = MAN_NEXT_SIBLING; return(man_descope(m, sp->line, 0)); }
int man_addeqn(struct man *m, const struct eqn *ep) { struct man_node *n; assert( ! (MAN_HALT & m->flags)); n = man_node_alloc(m, ep->ln, ep->pos, MAN_EQN, MAN_MAX); n->eqn = ep; if ( ! man_node_append(m, n)) return(0); m->next = MAN_NEXT_SIBLING; return(man_descope(m, ep->ln, ep->pos)); }