summaryrefslogtreecommitdiffstats
path: root/man.c
diff options
context:
space:
mode:
Diffstat (limited to 'man.c')
-rw-r--r--man.c37
1 files changed, 37 insertions, 0 deletions
diff --git a/man.c b/man.c
index ef28b99f..3eb24a81 100644
--- a/man.c
+++ b/man.c
@@ -434,3 +434,40 @@ man_vwarn(struct man *man, int ln, int pos, const char *fmt, ...)
}
+int
+man_err(struct man *m, int line, int pos,
+ int iserr, enum merr type)
+{
+ const char *p;
+
+ p = NULL;
+ switch (type) {
+ case (WNPRINT):
+ p = "invalid character";
+ break;
+ case (WNMEM):
+ p = "memory exhausted";
+ break;
+ case (WMSEC):
+ p = "invalid manual section";
+ break;
+ case (WDATE):
+ p = "invalid date format";
+ break;
+ case (WLNSCOPE):
+ p = "scope of prior line violated";
+ break;
+ case (WTSPACE):
+ p = "trailing whitespace at end of line";
+ break;
+ case (WTQUOTE):
+ p = "unterminated quotation";
+ break;
+ }
+ assert(p);
+
+ if (iserr)
+ return(man_verr(m, line, pos, p));
+
+ return(man_vwarn(m, line, pos, p));
+}