version 1.163, 2017/03/07 20:00:08 |
version 1.168, 2017/06/01 15:25:39 |
Line 75 static void mparse_parse_buffer(struct mparse *, str |
|
Line 75 static void mparse_parse_buffer(struct mparse *, str |
|
|
|
static const enum mandocerr mandoclimits[MANDOCLEVEL_MAX] = { |
static const enum mandocerr mandoclimits[MANDOCLEVEL_MAX] = { |
MANDOCERR_OK, |
MANDOCERR_OK, |
|
MANDOCERR_STYLE, |
MANDOCERR_WARNING, |
MANDOCERR_WARNING, |
MANDOCERR_WARNING, |
|
MANDOCERR_ERROR, |
MANDOCERR_ERROR, |
MANDOCERR_UNSUPP, |
MANDOCERR_UNSUPP, |
MANDOCERR_MAX, |
MANDOCERR_MAX, |
Line 86 static const enum mandocerr mandoclimits[MANDOCLEVEL_M |
|
Line 86 static const enum mandocerr mandoclimits[MANDOCLEVEL_M |
|
static const char * const mandocerrs[MANDOCERR_MAX] = { |
static const char * const mandocerrs[MANDOCERR_MAX] = { |
"ok", |
"ok", |
|
|
|
"generic style suggestion", |
|
|
|
"useless macro", |
|
"consider using OS macro", |
|
"description line ends with a full stop", |
|
|
"generic warning", |
"generic warning", |
|
|
/* related to the prologue */ |
/* related to the prologue */ |
Line 241 static const char * const mandocerrs[MANDOCERR_MAX] = |
|
Line 247 static const char * const mandocerrs[MANDOCERR_MAX] = |
|
|
|
static const char * const mandoclevels[MANDOCLEVEL_MAX] = { |
static const char * const mandoclevels[MANDOCLEVEL_MAX] = { |
"SUCCESS", |
"SUCCESS", |
"RESERVED", |
"STYLE", |
"WARNING", |
"WARNING", |
"ERROR", |
"ERROR", |
"UNSUPP", |
"UNSUPP", |
Line 293 choose_parser(struct mparse *curp) |
|
Line 299 choose_parser(struct mparse *curp) |
|
} |
} |
|
|
if (format == MPARSE_MDOC) { |
if (format == MPARSE_MDOC) { |
mdoc_hash_init(); |
|
curp->man->macroset = MACROSET_MDOC; |
curp->man->macroset = MACROSET_MDOC; |
curp->man->first->tok = TOKEN_NONE; |
if (curp->man->mdocmac == NULL) |
|
curp->man->mdocmac = roffhash_alloc(MDOC_Dd, MDOC_MAX); |
} else { |
} else { |
man_hash_init(); |
|
curp->man->macroset = MACROSET_MAN; |
curp->man->macroset = MACROSET_MAN; |
curp->man->first->tok = TOKEN_NONE; |
if (curp->man->manmac == NULL) |
|
curp->man->manmac = roffhash_alloc(MAN_TH, MAN_MAX); |
} |
} |
|
curp->man->first->tok = TOKEN_NONE; |
} |
} |
|
|
/* |
/* |
Line 818 mparse_alloc(int options, enum mandoclevel wlevel, man |
|
Line 825 mparse_alloc(int options, enum mandoclevel wlevel, man |
|
curp->man = roff_man_alloc( curp->roff, curp, curp->defos, |
curp->man = roff_man_alloc( curp->roff, curp, curp->defos, |
curp->options & MPARSE_QUICK ? 1 : 0); |
curp->options & MPARSE_QUICK ? 1 : 0); |
if (curp->options & MPARSE_MDOC) { |
if (curp->options & MPARSE_MDOC) { |
mdoc_hash_init(); |
|
curp->man->macroset = MACROSET_MDOC; |
curp->man->macroset = MACROSET_MDOC; |
|
if (curp->man->mdocmac == NULL) |
|
curp->man->mdocmac = roffhash_alloc(MDOC_Dd, MDOC_MAX); |
} else if (curp->options & MPARSE_MAN) { |
} else if (curp->options & MPARSE_MAN) { |
man_hash_init(); |
|
curp->man->macroset = MACROSET_MAN; |
curp->man->macroset = MACROSET_MAN; |
|
if (curp->man->manmac == NULL) |
|
curp->man->manmac = roffhash_alloc(MAN_TH, MAN_MAX); |
} |
} |
curp->man->first->tok = TOKEN_NONE; |
curp->man->first->tok = TOKEN_NONE; |
return curp; |
return curp; |
|
|
mparse_free(struct mparse *curp) |
mparse_free(struct mparse *curp) |
{ |
{ |
|
|
|
roffhash_free(curp->man->mdocmac); |
|
roffhash_free(curp->man->manmac); |
roff_man_free(curp->man); |
roff_man_free(curp->man); |
roff_free(curp->roff); |
roff_free(curp->roff); |
if (curp->secondary) |
if (curp->secondary) |