/*///////////////////////////////////////////////////////////*/
/**/
/*			Management of the Module : AIDebug*/
/**/
/* File Name	: ErrAIDebug.h*/
/* Date			: 03/10/96*/
/* Author		: First_Name Last_Name*/
/**/
/*///////////////////////////////////////////////////////////*/
/**/
/* abbreviation of the module-name. Used in macro is 'AIDebug'*/
/**/
/*///////////////////////////////////////////////////////////*/
 
#ifndef __ERRAIDEBUG_H__
#define __ERRAIDEBUG_H__
 
#ifdef __cplusplus
extern "C" {
#endif /* __cplusplus */
 
#define C_szAIDebugVersion "AIDEBUG V5.0.0" /* The format is XXX Va.b.c with Xxx is the Tag of the module */
#define C_szAIDebugFullName  "My AIDebug module"/* the complete and clear name of the module */
#define C_szAIDebugDate __DATE__ /*The format is "Mmm dd yyyy".You can use __DATE__ but be careful that you have the control of the compilation*/
 
/* For DLLs who are using this module : */ 
#undef CPA_EXPORT
#if defined(CPA_WANTS_IMPORT)
 #define CPA_EXPORT __declspec(dllimport)
#elif defined(CPA_WANTS_EXPORT)
 #define CPA_EXPORT __declspec(dllexport)
#else
 #define CPA_EXPORT
#endif
 
 
#include "ERM.h"
 
#define __FATAL_ERR_AIDEBUG__
#define __WARNING1_ERR_AIDEBUG__
 
/*----------*/
/* Constant	 */
/*----------*/
/* error of the AIDebug Module*/
typedef enum e_uwAIDebugErrNumber_{
	E_uwAIDebugFatalErr,	
#ifdef __FATAL_ERR_AIDEBUG__
/*     -----------------*/
 E_uwAIDebugFatalNotAFatalError,
#endif /*__FATAL_ERR_AIDEBUG__*/
	E_uwAIDebugStartOfWarning,/* important constant, it allows to recognize if an error is fatal or not.*/
#ifdef __WARNING1_ERR_AIDEBUG__
/*     -------------------*/
 E_uwAIDebugWarningInitFailureMem, /* memory error when initialisation */
 E_uwAIDebugWarningDesInitFailureMem,/* memory failure when desinitialisation */
 E_uwAIDebugWarningInvalidParameter,/* one parameter is invalid*/
 E_uwAIDebugWarningNullPointer, /* try to ccess fields of a null pointer */
 
 E_uwAIDebugWarningShouldNotHappen,/* should never happen, but....*/
#endif /*__WARNING1_ERR_AIDEBUG__*/
	E_uwAIDebugErrNumber
} e_uwAIDebugErrNumber;
 
/*------------------*/
/* Global Variables*/
/*------------------*/
#undef __ERRAIDEBUG_EXTERN
#ifndef __DeclareGlobalVariableErrAIDebug_h__
#define __ERRAIDEBUG_EXTERN extern /*external declaration*/
#else /*__DeclareGlobalVariableErrAIDebug_h__*/
#define __ERRAIDEBUG_EXTERN /*replace by nothing : we have to declare*/
#endif /*__DeclareGlobalVariableErrAIDebug_h__*/
 
__ERRAIDEBUG_EXTERN CPA_EXPORT  unsigned char g_ucAIDebugModuleId /*number of identification of the Erm module*/
#if defined(__DeclareGlobalVariableErrAIDebug_h__) && !defined(CPA_WANTS_IMPORT)
= C_ucModuleNotInitialized
#endif /*__DeclareGlobalVariableErrAIDebug_h__&& CPA_WANTS_IMPORT*/
;
 
#ifdef __ERROR_STRINGS__
 
__ERRAIDEBUG_EXTERN CPA_EXPORT  char * g_a_szAIDebugInformationModule []
#if defined(__DeclareGlobalVariableErrAIDebug_h__) && !defined(CPA_WANTS_IMPORT)
= {C_szAIDebugVersion, C_szAIDebugFullName, C_szAIDebugDate}
#endif /*__DeclareGlobalVariableErrAIDebug_h__ &&  CPA_WANTS_IMPORT*/
;
 
__ERRAIDEBUG_EXTERN CPA_EXPORT  struct tdstErrorMsg_ g_a_stAIDebugTabErr [] 	/* Mandatory syntax 'g_a_st'+[Abbreviation of ModuleName]+'TabErr'*/
#if defined(__DeclareGlobalVariableErrAIDebug_h__) && !defined(CPA_WANTS_IMPORT)
={ 
#ifdef __FATAL_ERR_AIDEBUG__   
/*	 -------------*/
	  E_uwAIDebugFatalNotAFatalError, "This is not a valide AI Debug fatal error",
#endif /*__FATAL_ERR_AIDEBUG__*/
#ifdef __WARNING1_ERR_AIDEBUG__
/*	 ----------------*/
  E_uwAIDebugWarningInitFailureMem,"Initialisation failure due to memory problem",
  E_uwAIDebugWarningDesInitFailureMem,"Desinitialisation failure due to memory problem",
  E_uwAIDebugWarningInvalidParameter, "One parameter of the function is invalid",
	E_uwAIDebugWarningNullPointer, "Try to access fields of a null pointer",
 
  E_uwAIDebugWarningShouldNotHappen,"This error should never happen!!!!",
#endif /*__WARNING1_ERR_AIDEBUG__*/
 
	0xFFFF, "\0"/*fin*/
};
#endif /*__DeclareGlobalVariableErrAIDebug_h__ && CPA_WANTS_IMPORT*/
;
 
#endif /*__ERROR_STRINGS__*/
 
 
/*** WARNING THIS IS A PARTICULAR MACRO, FUTUR BUG :( ***/
/*#define M_bTestErrorOtherModule(ModuleName,_ChannelErrorNumber)  \*/
 /* (g_uc## ModuleName ##ModuleId != g_stErmTheLastErrorInfo[_ChannelErrorNumber].ucLastFailedModuleId) */
#define M_bTestErrorOtherModule(ModuleName,_ChannelErrorNumber)  \
	(Erm_M_uwCheckError(ModuleName,ChannelErrorNumber) != C_uwErmNoErr)
 
#ifdef __cplusplus
};
#endif /* __cplusplus */
 
#endif /*__ERRAIDEBUG_H__*/
