00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012 #ifndef ROOT_TError
00013 #define ROOT_TError
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00028
00029 #ifndef ROOT_Rtypes
00030 #include "Rtypes.h"
00031 #endif
00032 #include <stdarg.h>
00033
00034
00035 class TVirtualMutex;
00036
00037 const Int_t kUnset = -1;
00038 const Int_t kPrint = 0;
00039 const Int_t kInfo = 1000;
00040 const Int_t kWarning = 2000;
00041 const Int_t kError = 3000;
00042 const Int_t kBreak = 4000;
00043 const Int_t kSysError = 5000;
00044 const Int_t kFatal = 6000;
00045
00046 R__EXTERN TVirtualMutex *gErrorMutex;
00047
00048 typedef void (*ErrorHandlerFunc_t)(int level, Bool_t abort, const char *location,
00049 const char *msg);
00050
00051 extern "C" void ErrorHandler(int level, const char *location, const char *fmt,
00052 va_list va);
00053
00054 extern void DefaultErrorHandler(int level, Bool_t abort, const char *location,
00055 const char *msg);
00056
00057 extern ErrorHandlerFunc_t SetErrorHandler(ErrorHandlerFunc_t newhandler);
00058 extern ErrorHandlerFunc_t GetErrorHandler();
00059
00060 extern void Info(const char *location, const char *msgfmt, ...)
00061 #if defined(__GNUC__) && !defined(__CINT__)
00062 __attribute__((format(printf, 2, 3)))
00063 #endif
00064 ;
00065 extern void Warning(const char *location, const char *msgfmt, ...)
00066 #if defined(__GNUC__) && !defined(__CINT__)
00067 __attribute__((format(printf, 2, 3)))
00068 #endif
00069 ;
00070 extern void Error(const char *location, const char *msgfmt, ...)
00071 #if defined(__GNUC__) && !defined(__CINT__)
00072 __attribute__((format(printf, 2, 3)))
00073 #endif
00074 ;
00075 extern void Break(const char *location, const char *msgfmt, ...)
00076 #if defined(__GNUC__) && !defined(__CINT__)
00077 __attribute__((format(printf, 2, 3)))
00078 #endif
00079 ;
00080 extern void SysError(const char *location, const char *msgfmt, ...)
00081 #if defined(__GNUC__) && !defined(__CINT__)
00082 __attribute__((format(printf, 2, 3)))
00083 #endif
00084 ;
00085 extern void Fatal(const char *location, const char *msgfmt, ...)
00086 #if defined(__GNUC__) && !defined(__CINT__)
00087 __attribute__((format(printf, 2, 3)))
00088 #endif
00089 ;
00090
00091 extern void AbstractMethod(const char *method);
00092 extern void MayNotUse(const char *method);
00093
00094 R__EXTERN const char *kAssertMsg;
00095 R__EXTERN const char *kCheckMsg;
00096
00097 #define R__ASSERT(e) \
00098 do { \
00099 if (!(e)) ::Fatal("", kAssertMsg, _QUOTE_(e), __LINE__, __FILE__); \
00100 } while (0)
00101 #define R__CHECK(e) \
00102 do { \
00103 if (!(e)) ::Warning("", kCheckMsg, _QUOTE_(e), __LINE__, __FILE__); \
00104 } while (0)
00105
00106 R__EXTERN Int_t gErrorIgnoreLevel;
00107 R__EXTERN Int_t gErrorAbortLevel;
00108 R__EXTERN Bool_t gPrintViaErrorHandler;
00109
00110 #endif