diff options
author | Kristaps Dzonsons <kristaps@bsd.lv> | 2009-06-18 10:53:58 +0000 |
---|---|---|
committer | Kristaps Dzonsons <kristaps@bsd.lv> | 2009-06-18 10:53:58 +0000 |
commit | 28dbd78db68ddebbe43fda7d4abefd2d6257d286 (patch) | |
tree | b62ef5f6c371aced00114a58b7dac6bc1feb4498 /man.c | |
parent | ebc04fb0a062bcf881ac1fbe0706af873a8fcfc8 (diff) | |
download | mandoc-28dbd78db68ddebbe43fda7d4abefd2d6257d286.tar.gz |
Moved all formatted libman warn/error into man.c/libman.h.
Converted all formatted warn/errors into regular syntax.
Diffstat (limited to 'man.c')
-rw-r--r-- | man.c | 37 |
1 files changed, 37 insertions, 0 deletions
@@ -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)); +} |