Go to the documentation of this file.
18 #ifndef ERRORHANDLE_H_
19 #define ERRORHANDLE_H_
112 # ifndef DEBUG_CHAR_OUTPUT
113 # define DEBUG_CHAR_OUTPUT(character) do {putchar (character);} while(0)
117 # ifndef DEBUG_OUTPUT
118 # define DEBUG_OUTPUT(msg) do {printf msg;} while(0)
121 # ifndef EXIP_DEBUG_LEVEL
122 # define EXIP_DEBUG_LEVEL INFO
125 # define DEBUG_MSG(level, module, msg) do { if (level >= EXIP_DEBUG_LEVEL && module == ON) { DEBUG_OUTPUT(msg); } } while(0)
127 # define DEBUG_MSG(level, module, msg)
197 # define GET_ERR_STRING(indx) errorCodeStrings[indx]
199 # define GET_ERR_STRING(indx) ""
202 # define TRY(func) do { tmp_err_code = func;\
203 if (tmp_err_code != EXIP_OK) { \
204 DEBUG_MSG(ERROR, EXIP_DEBUG, ("\n>Error %s:%d at %s, line %d", GET_ERR_STRING(tmp_err_code), tmp_err_code, __FILE__, __LINE__)); \
205 return tmp_err_code; } } while(0)
207 # define TRY_CATCH(func, cblock) do { tmp_err_code = func;\
208 if (tmp_err_code != EXIP_OK) { \
209 DEBUG_MSG(ERROR, EXIP_DEBUG, ("\n>Error %s:%d at %s, line %d", GET_ERR_STRING(tmp_err_code), tmp_err_code, __FILE__, __LINE__)); \
211 return tmp_err_code; } } while(0)