#if !defined(__RND_ERR_H_)
#define __RND_ERR_H_
 
/******************************************/
#if _MSC_VER >= 1000
#pragma once
#endif /* _MSC_VER >= 1000 */
/******************************************/
 
#include "RND_Ver.h"
 
/***************************************/
/**** Error macros (using ACPerror) ****/
/***************************************/
#define M_RNDFatalError(ErrorNum) \
{ \
 if (ErrorNum>E_uwRNDFatalErr&&ErrorNum<E_uwRNDStartOfWarning) \
 { \
  Erm_M_ClearLastError(C_ucErmDefaultChannel);\
  Erm_M_UpdateLastError(RND,C_ucErmDefaultChannel,ErrorNum,C_lErmNoDebugData,C_ucErmOpenInfoWindow,C_ucAllowStopForDebug, NULL);\
 } \
 else \
 { \
  Erm_M_ClearLastError(C_ucErmDefaultChannel);\
  Erm_M_UpdateLastError(RND,C_ucErmDefaultChannel,E_uwRNDFatalErrorNotAFatalError,C_lErmNoDebugData,C_ucErmOpenInfoWindow,C_ucAllowStopForDebug, NULL);\
 } \
}
 
#define M_RNDInformationError(ErrorNum) \
{ \
 if (ErrorNum>E_uwRNDStartOfInformationWarning&&ErrorNum<E_uwRNDErrNumber) \
 { \
  Erm_M_UpdateLastError(RND,C_ucErmDefaultChannel,ErrorNum,C_lErmNoDebugData,C_ucErmNoOpenInfoWindow,C_ucNeverStopForDebug, NULL);\
  Erm_M_ClearLastError(C_ucErmDefaultChannel);\
 } \
 else \
 { \
  M_RNDFatalError(E_uwRNDInformationErrorIsNotAInformationError); \
 } \
}
 
#define M_RNDWarningError(ErrorNum) \
{ \
 if (ErrorNum>E_uwRNDStartOfWarning&&ErrorNum<E_uwRNDStartOfInformationWarning) \
 { \
  Erm_M_UpdateLastError(RND,C_ucErmDefaultChannel,ErrorNum,C_lErmNoDebugData,C_ucErmOpenInfoWindow,C_ucAllowStopForDebug, NULL);\
 } \
 else \
 { \
  M_RNDFatalError(E_uwRNDWarningErrorIsNotAWarningError); \
 } \
}
 
#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_uwRNDErrNumber
{
 E_uwRNDFatalErr,
 #if defined(__FATAL_ERR_INPUT__)
 /**** Error's errors ****/
 E_uwRNDFatalErrorNotAFatalError,
 E_uwRNDInformationErrorIsNotAInformationError,
 E_uwRNDWarningErrorIsNotAWarningError,
 /**** Script's errors ****/
 E_uwRNDScriptBadNumberOfArg,
 /**** Random's errors ****/
 E_uwRNDIncreaseRND_C_MaxIndex,
 E_uwRNDHandleNotAllowed,
 #endif /*__FATAL_ERR_INPUT__*/
 
 E_uwRNDStartOfWarning,
 
 #if defined(__WARNING_ERR_INPUT__)
 #endif /*__WARNING_ERR_INPUT__*/
 
 E_uwRNDStartOfInformationWarning,
 
 #if defined(__INFORMATION_ERR_INPUT__)
 #endif /*__INFORMATION_ERR_INPUT__*/
 
	E_uwRNDErrNumber,
};
 
/*------------------*/
/* Global Variables*/
/*------------------*/
#undef EXTERN
#undef extern
#undef LOCAL
#if !defined(D_RND_Input_VariableDefine)
#define EXTERN extern /*external declaration*/
#define LOCAL /*replace by nothing : we have to declare*/
#else /* D_RND_Input_VariableDefine */
#define EXTERN /*replace by nothing : we have to declare*/
#define LOCAL /*replace by nothing : we have to declare*/
#endif /* D_RND_Input_VariableDefine */
 
EXTERN unsigned char g_ucRNDModuleId /* number of identification of the Game module*/
#if defined(D_RND_Input_VariableDefine)
= C_ucModuleNotInitialized
#endif /* D_RND_Input_VariableDefine */
;
 
#if defined(__ERROR_STRINGS__)
EXTERN CPA_EXPORT char * g_a_szRNDInformationModule []
#if defined(D_RND_Input_VariableDefine) && !defined(CPA_WANTS_IMPORT)
= {C_szRNDVersion, C_szRNDFullName, C_szRNDDate}
#endif /* D_RND_Input_VariableDefine &&  CPA_WANTS_IMPORT */
;
 
EXTERN char * g_szRNDModuleName /* Obliged syntax 'sz'+[Abbreviation of ModuleName]+'ModuleName'*/
#if defined(D_RND_Input_VariableDefine)
= {"Input"}
#endif /* D_RND_Input_VariableDefine */
;
 
EXTERN tdstErrorMsg g_a_stRNDTabErr[] /* Obliged syntax 'a_sz'+[Abbreviation of ModuleName]+'TabErr'*/
#if defined(D_RND_Input_VariableDefine)
=
{
 #if defined(__FATAL_ERR_INPUT__)
 /**** Error's errors ****/
 E_uwRNDFatalErrorNotAFatalError,"M_RNDFatalError : Try to raise a warning or an information",
 E_uwRNDInformationErrorIsNotAInformationError,"M_RNDInformationError : Try to raise a fatal or a warning",
 E_uwRNDWarningErrorIsNotAWarningError,"M_RNDWarningError : Try to raise a fatal or a information",
 /**** Script's errors ****/
 E_uwRNDScriptBadNumberOfArg,"Bad number of argument",
 /**** Random's errors ****/
 E_uwRNDIncreaseRND_C_MaxIndex,"fn_hReserveAnNewHandleIndex : Increase the max number of handle (RND_C_MaxIndex)",
 E_uwRNDHandleNotAllowed,"fn_hReserveAnNewHandleIndex : Increase the max number of handle (RND_C_MaxIndex)",
 #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_RND_Input_VariableDefine */
;
#endif /* __ERROR_STRINGS__ */
 
#undef EXTERN
#undef extern
 
#endif /* !__RND_ERR_H_ */
