aboutsummaryrefslogtreecommitdiff
path: root/src/include
diff options
context:
space:
mode:
authorjthorn <jthorn@f88db872-0e4f-0410-b76b-b9085cfa78c5>2002-09-29 23:06:09 +0000
committerjthorn <jthorn@f88db872-0e4f-0410-b76b-b9085cfa78c5>2002-09-29 23:06:09 +0000
commit9efa1bc892636e943768ddbcb2da62da1ab2101e (patch)
tree2fa264d2e5c68d87de2b43a337ba772c4d1132d9 /src/include
parent9b1661fa6b260c89738e4be936b525fff4ee86aa (diff)
update prototype & comments for error_exit()
git-svn-id: http://svn.einsteintoolkit.org/cactus/EinsteinAnalysis/AHFinderDirect/trunk@782 f88db872-0e4f-0410-b76b-b9085cfa78c5
Diffstat (limited to 'src/include')
-rw-r--r--src/include/stdc.h32
1 files changed, 13 insertions, 19 deletions
diff --git a/src/include/stdc.h b/src/include/stdc.h
index a46b6f7..972a870 100644
--- a/src/include/stdc.h
+++ b/src/include/stdc.h
@@ -59,17 +59,16 @@ namespace jtutil
#endif
/*
- * All my error handling is done with my error_exit() routine. It
- * prints an error message to stderr, then does an exit() or abort().
- * It does *not* return to its caller. It's declared to return an
- * int , however, so it may be easily used in conditional expressions
- * like
+ * Low-level code in this thorn is done with error_exit() . In this
+ * this thorn it's a wrapper around CCTK_VWarn(msg_level, ...) . It's
+ * declared to return int so it may be easily used in conditional
+ * expressions like
* foo = bar_ok ? baz(bar) : error_exit(...);
*/
#ifdef __cplusplus
extern "C"
#endif
-int error_exit(int exit_code, const char *format, ...)
+int error_exit(int msg_level, const char *format, ...)
#ifdef __GNUC__
__attribute__ ((noreturn))
__attribute__ ((format(printf,2,3)))
@@ -77,21 +76,16 @@ int error_exit(int exit_code, const char *format, ...)
;
/*
- * error_exit() uses the following exit() codes:
- * OK_EXIT ==> everything's under control
+ * error_exit() uses the following msg_level codes:
* ERROR_EXIT ==> something bad has happened
- * PANIC_EXIT ==> diasaster ==> force (eg) core dump, stack trace
+ * (eg inconsistent user input)
+ * PANIC_EXIT ==> diasaster (eg internal consistency check failed)
+ * ==> we'd like to force (eg) a core dump or stack trace
+ * (but at present this isn't implemented; we just
+ * do a CCTK_VWarn() just like for ERROR_EXIT)
*/
-
-#ifdef VMS
-#define OK_EXIT 1
-#define ERROR_EXIT 3
-#define PANIC_EXIT (-1)
-#else
-#define OK_EXIT 0
-#define ERROR_EXIT 1
-#define PANIC_EXIT (-1)
-#endif
+#define ERROR_EXIT (-1)
+#define PANIC_EXIT (-2)
#ifdef __cplusplus
} /* namespace jtutil */