-static int
-perr(struct mdoc *m, int line, int pos, enum merr type)
-{
- 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;
- }
- assert(p);
- return(mdoc_perr(m, line, pos, p));
-}
-
-
-static int
-pwarn(struct mdoc *m, int line, int pos, enum mwarn type)
-{
- char *p;
- enum mdoc_warn c;
-
- c = WARN_SYNTAX;
- p = NULL;
- switch (type) {
- case (WBADMSEC):
- p = "inappropriate manual section";
- c = WARN_COMPAT;
- break;
- case (WBADSEC):
- p = "inappropriate document section";
- c = WARN_COMPAT;
- break;
- case (WARGVAL):
- p = "argument value suggested";
- c = WARN_COMPAT;
- break;
- case (WPROLREP):
- p = "prologue macros repeated";
- c = WARN_COMPAT;
- break;
- case (WPROLOOO):
- p = "prologue macros out-of-order";
- c = WARN_COMPAT;
- break;
- case (WDEPCOL):
- p = "deprecated column argument syntax";
- c = WARN_COMPAT;
- break;
- case (WNOWIDTH):
- p = "superfluous width argument";
- break;
- case (WMISSWIDTH):
- p = "missing width argument";
- break;
- case (WPRINT):
- p = "invalid character";
- break;
- case (WESCAPE):
- p = "invalid escape sequence";
- break;
- case (WDEPESC):
- p = "deprecated special-character escape";
- break;
- case (WNOLINE):
- p = "suggested no line arguments";
- break;
- case (WLINE):
- p = "suggested line arguments";
- break;
- case (WMULTILINE):
- p = "suggested multi-line arguments";
- break;
- case (WNOMULTILINE):
- p = "suggested no multi-line arguments";
- break;
- case (WWRONGMSEC):
- p = "document section in wrong manual section";
- c = WARN_COMPAT;
- break;
- case (WSECOOO):
- p = "document section out of conventional order";
- break;
- case (WSECREP):
- p = "document section repeated";
- break;
- case (WBADSTAND):
- p = "unknown standard";
- break;
- case (WNAMESECINC):
- p = "NAME section contents incomplete/badly-ordered";
- break;
- }
- assert(p);
- return(mdoc_pwarn(m, line, pos, c, p));
-}
-
-