summaryrefslogtreecommitdiff
path: root/comm/error.h
diff options
context:
space:
mode:
authorchatty1993-04-07 11:50:31 +0000
committerchatty1993-04-07 11:50:31 +0000
commitba066c34dde204aa192d03a23a81356374d93731 (patch)
tree39391f6235d2cf8a59a0634ac5ea430cdd21f5d4 /comm/error.h
parent05ab076e1c2a9ca16472f9a6b47b8d22914b3783 (diff)
downloadivy-league-ba066c34dde204aa192d03a23a81356374d93731.zip
ivy-league-ba066c34dde204aa192d03a23a81356374d93731.tar.gz
ivy-league-ba066c34dde204aa192d03a23a81356374d93731.tar.bz2
ivy-league-ba066c34dde204aa192d03a23a81356374d93731.tar.xz
Initial revision
Diffstat (limited to 'comm/error.h')
-rw-r--r--comm/error.h58
1 files changed, 58 insertions, 0 deletions
diff --git a/comm/error.h b/comm/error.h
new file mode 100644
index 0000000..a0d11ef
--- /dev/null
+++ b/comm/error.h
@@ -0,0 +1,58 @@
+/*
+ * The Unix Channel
+ *
+ * by Michel Beaudouin-Lafon
+ *
+ * Copyright 1990-1993
+ * Laboratoire de Recherche en Informatique (LRI)
+ *
+ * Error management
+ *
+ * $Id$
+ * $CurLog$
+ */
+
+#ifndef UchError_H_
+#define UchError_H_
+
+#include "global.h"
+
+#ifdef DOC
+// fake class for global functions
+class UchError {
+};
+#endif
+
+enum errtype {
+ ErrNone = -4, // do nothing
+ ErrLog = -3, // only log to file
+ ErrWarn = -2, // warn and continue
+ ErrAbort = -1, // call abort
+ ErrExit = 0, // exit with code 0
+ ErrUsage = 1, // bad usage
+ ErrFatal = 2 // exit with code != 0
+};
+
+enum errcode {
+ ErrShouldImplement
+};
+
+extern char *ErrorTable [];
+
+typedef errtype (*ErrorHandler) (errtype, const char* who, const char* what, const char* msg);
+typedef void (*CleanUpProc) ();
+
+extern void ProgramName (const char*);
+extern void LogfileName (const char*, bool = FALSE);
+extern void CleanUp (CleanUpProc);
+extern ErrorHandler SetErrorHandler (ErrorHandler);
+
+extern void Error (errtype, const char* who, const char* what);
+extern bool SysError (errtype, const char* who, int exc1 = -1, int exc2 = -1);
+extern char* MakeErrorString (errtype, const char* who, const char* what);
+extern void LogMessage (const char*);
+
+extern int errno;
+
+#endif /* UchError_H_ */
+