Exemple #1
0
struct mparse *
mparse_alloc(int options, enum mandoclevel wlevel, mandocmsg mmsg,
    const char *defos)
{
	struct mparse	*curp;

	curp = mandoc_calloc(1, sizeof(struct mparse));

	curp->options = options;
	curp->wlevel = wlevel;
	curp->mmsg = mmsg;
	curp->defos = defos;

	curp->roff = roff_alloc(curp, options);
	curp->man = roff_man_alloc( curp->roff, curp, curp->defos,
		curp->options & MPARSE_QUICK ? 1 : 0);
	if (curp->options & MPARSE_MDOC) {
		mdoc_hash_init();
		curp->man->macroset = MACROSET_MDOC;
	} else if (curp->options & MPARSE_MAN) {
		man_hash_init();
		curp->man->macroset = MACROSET_MAN;
	}
	curp->man->first->tok = TOKEN_NONE;
	return curp;
}
Exemple #2
0
struct mparse *
mparse_alloc(int options, enum mandoclevel wlevel,
		mandocmsg mmsg, const char *defos)
{
	struct mparse	*curp;

	assert(wlevel <= MANDOCLEVEL_FATAL);

	curp = mandoc_calloc(1, sizeof(struct mparse));

	curp->options = options;
	curp->wlevel = wlevel;
	curp->mmsg = mmsg;
	curp->defos = defos;

	curp->roff = roff_alloc(curp, options);
	if (curp->options & MPARSE_MDOC)
		curp->pmdoc = mdoc_alloc(
		    curp->roff, curp, curp->defos,
		    curp->options & MPARSE_QUICK ? 1 : 0);
	if (curp->options & MPARSE_MAN)
		curp->pman = man_alloc(curp->roff, curp,
		    curp->options & MPARSE_QUICK ? 1 : 0);

	return(curp);
}
Exemple #3
0
struct mparse *
mparse_alloc(enum mparset inttype, enum mandoclevel wlevel, mandocmsg mmsg, void *arg)
{
	struct mparse	*curp;

	assert(wlevel <= MANDOCLEVEL_FATAL);

	curp = mandoc_calloc(1, sizeof(struct mparse));

	curp->wlevel = wlevel;
	curp->mmsg = mmsg;
	curp->arg = arg;
	curp->inttype = inttype;

	curp->roff = roff_alloc(curp);
	return(curp);
}