summaryrefslogtreecommitdiffstats
path: root/mandoc.h
diff options
context:
space:
mode:
authorIngo Schwarze <schwarze@openbsd.org>2019-07-10 19:39:01 +0000
committerIngo Schwarze <schwarze@openbsd.org>2019-07-10 19:39:01 +0000
commit508b98ccbdcc989c0a185288f3b8f4b756310216 (patch)
tree272c9200d61fcd567a8346cfc8012905c7ae7294 /mandoc.h
parent8eec6a4a82b09af170dc9777684bfbb3d7806a42 (diff)
downloadmandoc-508b98ccbdcc989c0a185288f3b8f4b756310216.tar.gz
Some time ago, i simplified mandoc_msg() such that it can be used
everywhere and not only in the parsers. For more uniform messages, use it at more places instead of err(3), in particular in the main program. While here, integrate a few trivial functions called at exactly one place into the main option parser, and let a few more functions use the normal convention of returning 0 for success and -1 for error.
Diffstat (limited to 'mandoc.h')
-rw-r--r--mandoc.h32
1 files changed, 30 insertions, 2 deletions
diff --git a/mandoc.h b/mandoc.h
index a9d460eb..12385ec9 100644
--- a/mandoc.h
+++ b/mandoc.h
@@ -1,7 +1,7 @@
/* $Id$ */
/*
* Copyright (c) 2010, 2011, 2014 Kristaps Dzonsons <kristaps@bsd.lv>
- * Copyright (c) 2012-2018 Ingo Schwarze <schwarze@openbsd.org>
+ * Copyright (c) 2012-2019 Ingo Schwarze <schwarze@openbsd.org>
*
* Permission to use, copy, modify, and distribute this software for any
* purpose with or without fee is hereby granted, provided that the above
@@ -193,7 +193,6 @@ enum mandocerr {
MANDOCERR_TBLDATA_BLK, /* data block open at end of tbl: macro */
/* related to document structure and macros */
- MANDOCERR_FILE, /* cannot open file */
MANDOCERR_PROLOG_REP, /* duplicate prologue macro: macro */
MANDOCERR_DT_LATE, /* skipping late title macro: Dt args */
MANDOCERR_ROFFLOOP, /* input stack limit exceeded, infinite loop? */
@@ -242,6 +241,35 @@ enum mandocerr {
MANDOCERR_TBLLAYOUT_MOD, /* unsupported tbl layout modifier: m */
MANDOCERR_TBLMACRO, /* ignoring macro in table: macro */
+ MANDOCERR_BADARG, /* ===== start of bad invocations ===== */
+
+ MANDOCERR_BADARG_BAD, /* bad argument */
+ MANDOCERR_BADARG_DUPE, /* duplicate argument */
+ MANDOCERR_BADVAL, /* does not take a value */
+ MANDOCERR_BADVAL_MISS, /* missing argument value */
+ MANDOCERR_BADVAL_BAD, /* bad argument value */
+ MANDOCERR_BADVAL_DUPE, /* duplicate argument value */
+ MANDOCERR_TAG, /* no such tag */
+
+ MANDOCERR_SYSERR, /* ===== start of system errors ===== */
+
+ MANDOCERR_DUP,
+ MANDOCERR_EXEC,
+ MANDOCERR_FDOPEN,
+ MANDOCERR_FFLUSH,
+ MANDOCERR_FORK,
+ MANDOCERR_FSTAT,
+ MANDOCERR_GETLINE,
+ MANDOCERR_GLOB,
+ MANDOCERR_GZCLOSE,
+ MANDOCERR_GZDOPEN,
+ MANDOCERR_MKSTEMP,
+ MANDOCERR_OPEN,
+ MANDOCERR_PLEDGE,
+ MANDOCERR_READ,
+ MANDOCERR_WAIT,
+ MANDOCERR_WRITE,
+
MANDOCERR_MAX
};