-static int
-perr(struct mdoc *m, int line, int pos, enum merr type, int iserr)
-{
- char *p;
-
- p = NULL;
-
- switch (type) {
- case (ETOOLONG):
- p = "text argument too long";
- break;
- case (EESCAPE):
- p = "invalid escape sequence";
- break;
- case (EPRINT):
- p = "invalid character";
- break;
- case (ENESTDISP):
- p = "displays may not be nested";
- break;
- case (EBOOL):
- p = "expected boolean value";
- break;
- case (EARGREP):
- p = "argument repeated";
- break;
- case (EMULTIDISP):
- p = "multiple display types specified";
- break;
- case (EMULTILIST):
- p = "multiple list types specified";
- break;
- case (ELISTTYPE):
- p = "missing list type";
- break;
- case (EDISPTYPE):
- p = "missing display type";
- break;
- case (ESECNAME):
- p = "the NAME section must come first";
- break;
- case (ELINE):
- p = "expected line arguments";
- break;
- case (ENOPROLOGUE):
- p = "document has no prologue";
- break;
- case (ENODATA):
- p = "document has no data";
- break;
- case (ECOLMIS):
- p = "column syntax style mismatch";
- break;
- case (EATT):
- p = "expected valid AT&T symbol";
- break;
- case (ENAME):
- p = "default name not yet set";
- break;
- case (ENOWIDTH):
- p = "superfluous width argument";
- break;
- case (EMISSWIDTH):
- p = "missing width argument";
- break;
- case (EWRONGMSEC):
- p = "document section in wrong manual section";
- break;
- case (ESECOOO):
- p = "document section out of conventional order";
- break;
- case (ESECREP):
- p = "document section repeated";
- break;
- case (EBADSTAND):
- p = "unknown standard";
- break;
- case (ENAMESECINC):
- p = "NAME section contents incomplete/badly-ordered";
- break;
- case (ENOMULTILINE):
- p = "suggested no multi-line arguments";
- break;
- case (EMULTILINE):
- p = "suggested multi-line arguments";
- break;
- case (ENOLINE):
- p = "suggested no line arguments";
- break;
- case (EPROLOOO):
- p = "prologue macros out-of-order";
- break;
- case (EPROLREP):
- p = "prologue macros repeated";
- break;
- case (EARGVAL):
- p = "argument value suggested";
- break;
- case (EBADMSEC):
- p = "inappropriate manual section";
- break;
- case (EBADSEC):
- p = "inappropriate document section";
- break;
- }
-
- assert(p);
-
- if (iserr)
- return(mdoc_perr(m, line, pos, p));
-
- return(mdoc_pwarn(m, line, pos, p));
-}
-
-