summaryrefslogtreecommitdiffstats
path: root/mandoc.h
diff options
context:
space:
mode:
authorIngo Schwarze <schwarze@openbsd.org>2010-06-30 20:32:15 +0000
committerIngo Schwarze <schwarze@openbsd.org>2010-06-30 20:32:15 +0000
commit29b34f0893cc1c3b889a1ebd5475c51e9c39893f (patch)
tree9cf94b4277f7d3169b09094fa5963966e133ef1b /mandoc.h
parentede8bcaa90143c5c1db99caeef3eb5c8fafb3ea4 (diff)
downloadmandoc-29b34f0893cc1c3b889a1ebd5475c51e9c39893f.tar.gz
improve error reporting:
* avoid error exit code after mere warnings * add ERROR: and FATAL: to messages when appropriate * sort the code in mmsg() to make it easier on the eye * make the mandocerrs[] list easier to maintain * update a few comments in mandoc.h ok kristaps@
Diffstat (limited to 'mandoc.h')
-rw-r--r--mandoc.h16
1 files changed, 10 insertions, 6 deletions
diff --git a/mandoc.h b/mandoc.h
index 74fc3a27..69a30622 100644
--- a/mandoc.h
+++ b/mandoc.h
@@ -25,6 +25,9 @@ __BEGIN_DECLS
enum mandocerr {
MANDOCERR_OK,
+
+ MANDOCERR_WARNING, /* ===== end of warnings ===== */
+
MANDOCERR_UPPERCASE, /* text should be uppercase */
MANDOCERR_SECOOO, /* sections out of conventional order */
MANDOCERR_SECREP, /* section name repeats */
@@ -38,14 +41,15 @@ enum mandocerr {
MANDOCERR_NOWIDTHARG, /* argument requires the width argument */
/* FIXME: merge with MANDOCERR_IGNARGV. */
MANDOCERR_WIDTHARG, /* superfluous width argument */
- MANDOCERR_IGNARGV, /* macro ignoring argv */
+ MANDOCERR_IGNARGV, /* ignoring argument */
MANDOCERR_BADDATE, /* bad date argument */
MANDOCERR_BADWIDTH, /* bad width argument */
MANDOCERR_BADMSEC, /* unknown manual section */
MANDOCERR_SECMSEC, /* section not in conventional manual section */
MANDOCERR_EOLNSPACE, /* end of line whitespace */
MANDOCERR_SCOPEEXIT, /* scope open on exit */
-#define MANDOCERR_WARNING MANDOCERR_SCOPEEXIT
+
+ MANDOCERR_ERROR, /* ===== end of errors ===== */
MANDOCERR_NAMESECFIRST, /* NAME section must come first */
MANDOCERR_BADBOOL, /* bad Boolean value */
@@ -79,7 +83,8 @@ enum mandocerr {
MANDOCERR_DISPTYPE, /* missing display type */
MANDOCERR_ARGSLOST, /* line argument(s) will be lost */
MANDOCERR_BODYLOST, /* body argument(s) will be lost */
-#define MANDOCERR_ERROR MANDOCERR_BODYLOST
+
+ MANDOCERR_FATAL, /* ===== end of fatal errors ===== */
MANDOCERR_COLUMNS, /* column syntax is inconsistent */
/* FIXME: this should be a MANDOCERR_ERROR */
@@ -87,7 +92,7 @@ enum mandocerr {
/* FIXME: this should be a MANDOCERR_ERROR */
MANDOCERR_NESTEDDISP, /* displays may not be nested */
MANDOCERR_BADDISP, /* unsupported display type */
- MANDOCERR_SYNTNOSCOPE, /* request scope close w/none open */
+ MANDOCERR_SYNTNOSCOPE, /* no scope to rewind: syntax violated */
MANDOCERR_SYNTSCOPE, /* scope broken, syntax violated */
MANDOCERR_SYNTLINESCOPE, /* line scope broken, syntax violated */
MANDOCERR_SYNTARGVCOUNT, /* argument count wrong, violates syntax */
@@ -95,9 +100,8 @@ enum mandocerr {
MANDOCERR_SYNTARGCOUNT, /* argument count wrong, violates syntax */
MANDOCERR_NODOCBODY, /* no document body */
MANDOCERR_NODOCPROLOG, /* no document prologue */
- MANDOCERR_UTSNAME, /* utsname() system call failed */
+ MANDOCERR_UTSNAME, /* utsname system call failed */
MANDOCERR_MEM, /* memory exhausted */
-#define MANDOCERR_FATAL MANDOCERR_MEM
MANDOCERR_MAX
};