void mdoc_word_alloc(struct mdoc *mdoc, int line, int pos, const char *p) { struct mdoc_node *n; n = node_alloc(mdoc, line, pos, MDOC_MAX, MDOC_TEXT); n->string = roff_strdup(mdoc->roff, p); node_append(mdoc, n); mdoc->next = MDOC_NEXT_SIBLING; }
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 mdoc_word_alloc(struct mdoc *m, int line, int pos, const char *p) { struct mdoc_node *n; n = node_alloc(m, line, pos, MDOC_MAX, MDOC_TEXT); n->string = roff_strdup(m->roff, p); if ( ! node_append(m, n)) return(0); m->next = MDOC_NEXT_SIBLING; return(1); }
void mdoc_word_append(struct mdoc *mdoc, const char *p) { struct mdoc_node *n; char *addstr, *newstr; n = mdoc->last; addstr = roff_strdup(mdoc->roff, p); mandoc_asprintf(&newstr, "%s %s", n->string, addstr); free(addstr); free(n->string); n->string = newstr; mdoc->next = MDOC_NEXT_SIBLING; }