예제 #1
0
파일: mdoc.c 프로젝트: mr-justin/freebsd
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;
}
예제 #2
0
파일: man.c 프로젝트: 2015520/SequoiaDB
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);
}
예제 #3
0
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);
}
예제 #4
0
파일: mdoc.c 프로젝트: mr-justin/freebsd
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;
}