00001
00002
00003
00004
00005 #ifndef DOERROR_H
00006 #define DOERROR_H
00007
00008 #include <stdio.h>
00009
00010
00011 void DO_PUTS(const char *str);
00012
00013
00014 void DO_LOG(const char *str);
00015
00016
00017
00018 void DO_LOG_ERR(int code, const char *str );
00019
00020 #if defined(DO_DEBUG) || defined(__WX_DEBUG__)
00021 #define DO_TRACE(str) DO_LOG(str)
00022 #define DO_TRACE1(str,a1) DO_LOG1(str,a1)
00023 #define DO_TRACE2(str,a1,a2) DO_LOG2(str,a1,a2)
00024 #else
00025 #define DO_TRACE(str)
00026 #define DO_TRACE1(str,a1)
00027 #define DO_TRACE2(str,a1,a2)
00028 #endif
00029
00030
00031 #ifdef _MSC_VER
00032 #define snprintf sprintf_s
00033 #endif
00034
00035
00036 #define DO_MAX_MSG_LEN 256
00037 #define DO_LOG1(str,a1) { \
00038 char lbuf[DO_MAX_MSG_LEN+16]; \
00039 int l = snprintf(lbuf,DO_MAX_MSG_LEN,str,a1); \
00040 if(l>0) DO_LOG(lbuf); \
00041 }
00042 #define DO_LOG_ERR1(code,str,a1) { \
00043 char lbuf[DO_MAX_MSG_LEN+16]; \
00044 int l = snprintf(lbuf,DO_MAX_MSG_LEN,str,a1); \
00045 if(l>0) DO_LOG_ERR(code,lbuf); \
00046 }
00047 #define DO_LOG2(str,a1,a2) { \
00048 char lbuf[DO_MAX_MSG_LEN+16]; \
00049 int l = snprintf(lbuf,DO_MAX_MSG_LEN,str,a1,a2); \
00050 if(l>0) DO_LOG(lbuf); \
00051 }
00052 #define DO_LOG_ERR2(code,str,a1,a2) { \
00053 char lbuf[DO_MAX_MSG_LEN+16]; \
00054 int l = snprintf(lbuf,DO_MAX_MSG_LEN,str,a1,a2); \
00055 if(l>0) DO_LOG_ERR(code,lbuf); \
00056 }
00057
00058
00059
00060
00061 #define DOERR_TOO_SMALL_REQUESTED_OBJECT_SIZE 0x10000 // Too small object_size specified
00062 #define DOERR_UNKNOWN_TYPE 0x10001 // Unrecognized object type
00063 #define DOERR_NO_MEMORY 0x10002 // Failed allocating memory
00064 #define DOERR_FAILED_CONSTRUCTION 0x10003 // Failed object construction
00065 #define DOERR_FAILED_REGISTER_LIB 0x10004
00066 #define DOERR_TYPE_NOT_REGISTERED 0x10005
00067 #define DOERR_NO_FLEX_OBJECT_SIZE 0x10006
00068 #define DOERR_DELETE_ON_WRONG_OBJECT 0x10007
00069 #define DOERR_FAILED_REGISTER_INSTANTIATE 0x10008
00070 #define DOERR_FAILED_DOCONSTRUCT 0x10009
00071 #define DOERR_UNRESOLVED_BASE_TYPE 0x1000A
00072 #define DOERR_EXPECTED_VOBJ 0x1000B
00073 #define DOERR_INCORRECT_TYPE_ID 0x1000C
00074 #define DOERR_NO_DYNOBJ_RUNTIME 0x1000D
00075 #define DOERR_CALLER_MODULE_NOT_FOUND 0x1000E
00076 #define DOERR_FAILED_MERGE_TYPES 0x1000F
00077
00078
00079 #define DOERR_LIB_LOAD_FAILED 0x10200
00080 #define DOERR_LIB_VTABLE_INCOMPATIBLE 0x10201
00081 #define DOERR_LIB_FAILED_INIT 0x10202
00082 #define DOERR_LIB_DATA_SIZE_MISMATCH 0x10203
00083 #define DOERR_LIB_FAILED_DESTROY 0x10204
00084 #define DOERR_LIB_TRACKER 0x10205
00085
00086
00087
00088 #define DOERR_CANT_FIND_TYPE 0x10101
00089 #define DOERR_EMPTY_TYPE_STRING 0x10102
00090 #define DOERR_EXPECTED_ONLY_ONE_BASE 0x10103
00091 #define DOERR_TYPE_USES_SELF_AS_BASE 0x10104
00092 #define DOERR_INAVALID_STRUCT_MAGIC 0x10105
00093 #define DOERR_TYPE_ALREADY_EXISTS 0x10106
00094 #define DOERR_SIDEBASE_NOT_FOUND 0x10107
00095 #define DOERR_SIDEBASE_OFFSET_OUT_OF_RANGE 0x10108
00096 #define DOERR_SIDEBASE_NO_SPACE_IN_MAIN 0x10109
00097
00098
00099 #define DOERR_SIDEBASE_DYNI_GETTYPE_UNSAFE 0x10120
00100
00101
00102 #define DOERR_DYNSHARED_INVALID_DODESTROY 0x10130
00103 #define DOERR_DYNSHARED_DESTROY_ON_NON_ZERO_REF 0x10131
00104
00105
00106 #define DOERR_CLASS_DYNSTR 0x11000
00107 #define DOERR_CLASS_DYNARR 0x11001
00108 #define DOERR_CLASS_DYNOBJHOLDER 0x11002
00109 #define DOERR_CLASS_NAMEDREF 0x11003
00110
00111
00112 #define DOERR_SQUIRREL 0x12000
00113
00114 #endif // DOERROR_H
00115
00116