17#if defined(__LANGUAGE_C_PLUS_PLUS)||defined(__cplusplus)||defined(c_plusplus)
24typedef gsi_u8 GSIDebugLevel;
25#define GSIDebugLevel_HotError (GSIDebugLevel)(1<<0)
26#define GSIDebugLevel_WarmError (GSIDebugLevel)(1<<1)
27#define GSIDebugLevel_Warning (GSIDebugLevel)(1<<2)
28#define GSIDebugLevel_Notice (GSIDebugLevel)(1<<3)
29#define GSIDebugLevel_Comment (GSIDebugLevel)(1<<4)
30#define GSIDebugLevel_RawDump (GSIDebugLevel)(1<<5)
31#define GSIDebugLevel_StackTrace (GSIDebugLevel)(1<<6)
33#define GSIDebugLevel_Count 7
37#define GSIDebugLevel_None (GSIDebugLevel)(0)
38#define GSIDebugLevel_Normal (GSIDebugLevel)(0x07)
39#define GSIDebugLevel_Debug (GSIDebugLevel)(0x0F)
40#define GSIDebugLevel_Verbose (GSIDebugLevel)(0x1F)
41#define GSIDebugLevel_Hardcore (GSIDebugLevel)(0xFF)
57 GSIDebugType_All = GSIDebugType_Count
82 GSIDebugCat_All = GSIDebugCat_Count
85extern char* gGSIDebugCatStrings[GSIDebugCat_Count];
86extern char* gGSIDebugTypeStrings[GSIDebugType_Count];
87extern char* gGSIDebugLevelStrings[GSIDebugLevel_Count];
92#ifndef GSI_COMMON_DEBUG
95 #if !defined(_WIN32) && !defined(__MWERKS__)
97 #define gsDebugFormat(c,t,l,f,...)
98 #define gsDebugVaList(c,t,l,f,v)
99 #define gsDebugBinary(c,t,l,b,n)
100 #define gsSetDebugLevel(c,t,l)
101 #define gsSetDebugFile(f)
102 #define gsOpenDebugFile(f)
103 #define gsGetDebugFile
104 #define gsSetDebugCallback(c)
105 #elif defined(_NITRO)
106 #define gsDebugFormat(...)
107 #define gsDebugVaList(c,t,l,f,v)
108 #define gsDebugBinary(c,t,l,b,n)
109 #define gsSetDebugLevel(c,t,l)
110 #define gsSetDebugFile(f)
111 #define gsOpenDebugFile(f)
112 #define gsGetDebugFile
113 #define gsSetDebugCallback(c)
115 #define gsDebugFormat
116 #define gsDebugVaList
117 #define gsDebugBinary
118 #define gsSetDebugLevel
119 #define gsSetDebugFile
120 #define gsOpenDebugFile
121 #define gsGetDebugFile
122 #define gsSetDebugCallback
130typedef void (*GSIDebugCallback)(GSIDebugCategory,GSIDebugType,GSIDebugLevel,
131 const char*, va_list);
137typedef struct GSIDebugInstance
142 GSIDebugCallback mDebugCallback;
143 gsi_i32 mInitialized;
145#if !defined(GSI_NO_THREADS)
146 GSICriticalSection mDebugCrit;
149 GSIDebugLevel mGSIDebugLevel[GSIDebugCat_Count][GSIDebugType_Count];
156void gsDebugFormat(GSIDebugCategory theCat, GSIDebugType theType,
157 GSIDebugLevel theLevel,
const char* theTokenStr, ...);
159void gsDebugVaList(GSIDebugCategory theCat, GSIDebugType theType,
160 GSIDebugLevel theLevel,
const char* theTokenStr,
163void gsDebugBinary(GSIDebugCategory theCat, GSIDebugType theType,
164 GSIDebugLevel theLevel,
const char* theBuffer, gsi_i32 theLength);
170void gsSetDebugLevel(GSIDebugCategory theCat, GSIDebugType theType,
171 GSIDebugLevel theLevel);
176void gsSetDebugFile(FILE* theFile);
179FILE* gsOpenDebugFile(
const char* theFileName);
182FILE* gsGetDebugFile();
187void gsSetDebugCallback(GSIDebugCallback theCallback);
194#if defined(__LANGUAGE_C_PLUS_PLUS)||defined(__cplusplus)||defined(c_plusplus)