#if !defined(__IPT_ERR_H_)
#define __IPT_ERR_H_
 
/******************************************/
#if _MSC_VER >= 1000
#pragma once
#endif /* _MSC_VER >= 1000 */
/******************************************/
 
#include "IPT_Ver.h"
 
/***************************************/
/**** Error macros (using ACPerror) ****/
/***************************************/
#define M_IPTFatalError(ErrorNum) \
{ \
 if (ErrorNum>E_uwIPTFatalErr&&ErrorNum<E_uwIPTStartOfWarning) \
 { \
  Erm_M_ClearLastError(C_ucErmDefaultChannel);\
  Erm_M_UpdateLastError(IPT,C_ucErmDefaultChannel,ErrorNum,C_lErmNoDebugData,C_ucErmOpenInfoWindow,C_ucAllowStopForDebug, NULL);\
 } \
 else \
 { \
  Erm_M_ClearLastError(C_ucErmDefaultChannel);\
  Erm_M_UpdateLastError(IPT,C_ucErmDefaultChannel,E_uwIPTFatalErrorNotAFatalError,C_lErmNoDebugData,C_ucErmOpenInfoWindow,C_ucAllowStopForDebug, NULL);\
 } \
}
 
#define M_IPTInformationError(ErrorNum) \
{ \
 if (ErrorNum>E_uwIPTStartOfInformationWarning&&ErrorNum<E_uwIPTErrNumber) \
 { \
  Erm_M_UpdateLastError(IPT,C_ucErmDefaultChannel,ErrorNum,C_lErmNoDebugData,C_ucErmNoOpenInfoWindow,C_ucNeverStopForDebug, NULL);\
  Erm_M_ClearLastError(C_ucErmDefaultChannel);\
 } \
 else \
 { \
  M_IPTFatalError(E_uwIPTInformationErrorIsNotAInformationError); \
 } \
}
 
#define M_IPTWarningError(ErrorNum) \
{ \
 if (ErrorNum>E_uwIPTStartOfWarning&&ErrorNum<E_uwIPTStartOfInformationWarning) \
 { \
  Erm_M_UpdateLastError(IPT,C_ucErmDefaultChannel,ErrorNum,C_lErmNoDebugData,C_ucErmOpenInfoWindow,C_ucAllowStopForDebug, NULL);\
 } \
 else \
 { \
  M_IPTFatalError(E_uwIPTWarningErrorIsNotAWarningError); \
 } \
}
 
#define __FATAL_ERR_INPUT__
#define __INFORMATION_ERR_INPUT__ /**** Treat as a level 1 warning ****/
#define __WARNING_ERR_INPUT__     /**** Treat as a level 2 warning ****/
 
enum e_uwIPTErrNumber
{
 E_uwIPTFatalErr,
 #if defined(__FATAL_ERR_INPUT__)
 /**** Error's errors ****/
 E_uwIPTFatalErrorNotAFatalError,
 E_uwIPTInformationErrorIsNotAInformationError,
 E_uwIPTWarningErrorIsNotAWarningError,
 /**** Memory's errors ****/
 E_uwIPT_AllocNewKeyAction,
 E_uwIPT_AllocNewKeyWord,
 /**** Script's errors ****/
 E_uwIPT_NewKeyActionAlreadyExist,
 E_uwIPT_UnknownKeyValue,
 E_uwIPT_UnknownActionValue,
 E_uwIPT_AlreadyActivateAsAJoystick,
 E_uwIPT_AlreadyActivateAsAPad,
 E_uwIPT_TooMuchKeyDefine,
 E_uwIPT_NoMemory,
 /**** Analyse errors ****/
 E_uwIPT_UnknownActionAnalysis,
 E_uwIPTMemoryPlace,
 #endif /*__FATAL_ERR_INPUT__*/
 
 E_uwIPTStartOfWarning,
 
 #if defined(__WARNING_ERR_INPUT__)
 #endif /*__WARNING_ERR_INPUT__*/
 
 E_uwIPTStartOfInformationWarning,
 
 #if defined(__INFORMATION_ERR_INPUT__)
 #endif /*__INFORMATION_ERR_INPUT__*/
 
	E_uwIPTErrNumber,
};
 
/*------------------*/
/* Global Variables*/
/*------------------*/
#undef EXTERN
#undef extern
#undef LOCAL
#if !defined(D_IPT_Input_VariableDefine)
#define EXTERN extern /*external declaration*/
#define LOCAL /*replace by nothing : we have to declare*/
#else /* D_IPT_Input_VariableDefine */
#define EXTERN /*replace by nothing : we have to declare*/
#define LOCAL /*replace by nothing : we have to declare*/
#endif /* D_IPT_Input_VariableDefine */
 
EXTERN unsigned char g_ucIPTModuleId /* number of identification of the Game module*/
#if defined(D_IPT_Input_VariableDefine)
= C_ucModuleNotInitialized
#endif /* D_IPT_Input_VariableDefine */
;
 
#if defined(__ERROR_STRINGS__)
 
EXTERN CPA_EXPORT char * g_a_szIPTInformationModule []
#if defined(D_IPT_Input_VariableDefine) && !defined(CPA_WANTS_IMPORT)
= {C_szIPTVersion, C_szIPTFullName, C_szIPTDate}
#endif /* D_IPT_Input_VariableDefine &&  CPA_WANTS_IMPORT */
;
 
EXTERN char * g_szIPTModuleName /* Obliged syntax 'sz'+[Abbreviation of ModuleName]+'ModuleName'*/
#if defined(D_IPT_Input_VariableDefine)
= {"Input"}
#endif /* D_IPT_Input_VariableDefine */
;
 
EXTERN tdstErrorMsg g_a_stIPTTabErr[] /* Obliged syntax 'a_sz'+[Abbreviation of ModuleName]+'TabErr'*/
#if defined(D_IPT_Input_VariableDefine)
=
{
 #if defined(__FATAL_ERR_INPUT__)
 /**** Error's errors ****/
 E_uwIPTFatalErrorNotAFatalError,"M_IPTFatalError : Try to raise a warning or an information",
 E_uwIPTInformationErrorIsNotAInformationError,"M_IPTInformationError : Try to raise a fatal or a warning",
 E_uwIPTWarningErrorIsNotAWarningError,"M_IPTWarningError : Try to raise a fatal or a information",
 /**** Memory's errors ****/
 E_uwIPT_AllocNewKeyAction,"IPT_fn_eAddKeyScriptCallBack : Can not alloc",
 E_uwIPT_AllocNewKeyWord,"IPT_fn_hAllocKeyWord : Can not alloc keyword",
 /**** Script's errors ****/
 E_uwIPT_NewKeyActionAlreadyExist,"IPT_fn_eAddKeyScriptCallBack : Key action already exist",
 E_uwIPT_UnknownKeyValue,"Unknown key string",
 E_uwIPT_UnknownActionValue,"IPT_fn_eAddKeyActionScriptCallBack : Unknown action",
 E_uwIPT_AlreadyActivateAsAJoystick,"IPT_fn_eActivateDeviceScriptCallBack : Device already activate as a joystick",
 E_uwIPT_AlreadyActivateAsAPad,"IPT_fn_eActivateDeviceScriptCallBack : Device already activate as a pad",
 E_uwIPT_TooMuchKeyDefine,"IPT_fn_eKeyDefineScriptCallBack : Too much key define",
 E_uwIPT_NoMemory,"Not enought memory",
 E_uwIPTMemoryPlace,"IPT_fn_p_vAlloc : Not enought space",
 /**** Analyse errors ****/
 E_uwIPT_UnknownActionAnalysis,"IPT_fn_bIsKeyWordValid : Bad keyword",
 #endif /*__FATAL_ERR_INPUT__*/
 
 #ifdef __WARNING_ERR_INPUT__
 #endif /*__WARNING_ERR_INPUT__*/
 
 #ifdef __INFORMATION_ERR_INPUT__
 #endif /*__INFORMATION_ERR_INPUT__*/
 
	0xffff,"\0"/*fin*/
}
#endif /* D_IPT_Input_VariableDefine */
;
#endif /* __ERROR_STRINGS__ */
 
#undef EXTERN
#undef extern
 
#endif /* !__IPT_ERR_H_ */
