00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018 #ifndef __EX_ERROR_H__
00019 #define __EX_ERROR_H__
00020
00021 #include "EXPR_API.h"
00022 #include <UT/UT_ThreadSpecificValue.h>
00023
00024
00025 #define EV_NOERROR 0
00026 #define EV_ERRSYNTAX 1
00027 #define EV_ERRBRACING 2
00028 #define EV_ERRNOFUNC 3
00029 #define EV_ERRNOOP 4
00030 #define EV_ERRBADTYPE 5
00031 #define EV_ERRBADARGS 6
00032 #define EV_ERRUNKNOWN 7
00033 #define EV_ERRRECURSION 8
00034 #define EV_ERRSTACK 9
00035 #define EV_ERRBADVAR 10
00036 #define EV_NAN 11 // Divide by zero or something like that
00037 #define EV_ERREXTRAJUNK 12 // Extra junk at end of expression
00038 #define EV_ERRUNSAFEFUNC 13 // Unsafe function
00039 #define EV_ERRINLINEFUNC 14 // Error in inline function
00040 #define EV_ERRCUSTOM 15 // Custom error text
00041
00042
00043
00044
00045 namespace EXPR
00046 {
00047 EXPR_API extern UT_ThreadSpecificValue<int> theErrNo;
00048 };
00049
00050
00051 static inline void
00052 ev_SetErrNo(int err, int thread)
00053 {
00054 EXPR::theErrNo.getValueForThread(thread) = err;
00055 }
00056
00057
00058 static inline int
00059 ev_GetErrNo(int thread)
00060 {
00061 return EXPR::theErrNo.getValueForThread(thread);
00062 }
00063
00064
00065 EXPR_API extern const char *ev_GetErrorText(int error_number);
00066
00067 EXPR_API extern void ev_SetCustomErrorMessage(const char *message,
00068 int thread);
00069
00070 #endif // __EX_ERROR_H__