Пример #1
0
/*
 * Free up volatile resources (see mdoc_free1()) then re-initialises the
 * data with mdoc_alloc1().  After invocation, parse data has been reset
 * and the parser is ready for re-invocation on a new tree; however,
 * cross-parse non-volatile data is kept intact.
 */
void
mdoc_reset(struct mdoc *mdoc)
{

    mdoc_free1(mdoc);
    mdoc_alloc1(mdoc);
}
Пример #2
0
/*
 * Allocate volatile and non-volatile parse resources.  
 */
struct mdoc *
mdoc_alloc(struct roff *roff, struct mparse *parse)
{
	struct mdoc	*p;

	p = mandoc_calloc(1, sizeof(struct mdoc));

	p->parse = parse;
	p->roff = roff;

	mdoc_hash_init();
	mdoc_alloc1(p);
	return(p);
}
Пример #3
0
/*
 * Allocate volatile and non-volatile parse resources.
 */
struct mdoc *
mdoc_alloc(struct regset *regs, void *data, mandocmsg msg)
{
    struct mdoc	*p;

    p = mandoc_calloc(1, sizeof(struct mdoc));

    p->msg = msg;
    p->data = data;
    p->regs = regs;

    mdoc_hash_init();
    mdoc_alloc1(p);
    return(p);
}
Пример #4
0
/*
 * Allocate volatile and non-volatile parse resources.
 */
struct mdoc *
mdoc_alloc(struct roff *roff, struct mparse *parse,
	const char *defos, int quick)
{
	struct mdoc	*p;

	p = mandoc_calloc(1, sizeof(struct mdoc));

	p->parse = parse;
	p->defos = defos;
	p->quick = quick;
	p->roff = roff;

	mdoc_hash_init();
	mdoc_alloc1(p);
	return(p);
}