#ifndef RQTERROR_H
#define RQTERROR_H

#ifdef __cplusplus
extern "C" {
#endif

#include "RQConstants.h"

// In the RQT_ReturnCode types we use the following convention:
// low 8 bits = specific error value from this function
// next 8 bits = function returning error
// next 8 bits = SDK number
// top 8 bits reserved, currently always zero
// SDK values are:
// 0 = RQ
// 1 = pulser/receiver
// 2 = HLSDK 
// 3 = RQT - threading dll
// 4 = RQ3D - three D dll

	typedef enum
	{
		RQT_OK															= 0x00030000,
		RQT_OutOfMemory,												// Errors that may be returned from any function
		RQT_NonFatalError,								
		RQT_FatalError,									
		RQT_ThreadHasShutdown,							
		RQT_NoDataAvailable,								

		RQT_Initialise_AlreadyInititialised								= 0x00030101,
		RQT_Initialise_FailedToCreatePLXInterrupt,		

		RQT_SetThreadState_InvalidState									= 0x00030201,
		RQT_SetThreadState_MustNotBeCalledInsideRQLock,	
		RQT_SetThreadState_TimeoutWaitingForThread,		
		RQT_SetThreadState_ThreadFailedToAcknowledgeNewState,

		RQT_ThreadMain_ReleaseSemaphoreReturnedError					= 0x00030301,

		RQT_BankSwapAndUpdate_TimeOutWaitingForBankSwap					= 0x00030401,

		RQT_GetRawScan_NoDataAvailableOrBuffered						= 0x00030501,

		RQT_LastError
	} RQT_ReturnCode ;


// Must go after RQT_ReturnCode has been defined
// Other files in the *.dll should not include NDTSErrorInternal.h directly
//#include "NDTSErrorInternal.h"

RQ_API RQT_ReturnCode  RQT_GetLastError();
RQ_API unsigned long RQT_ReturnNumberOfErrorLogLines();
RQ_API NDTS_Boolean RQT_GetErrorLogLine(unsigned long lineNumber, char *pMessageBuffer, unsigned long numberOfBytesInMessageBuffer);
RQ_API NDTS_Boolean RQT_ClearErrorLog() ;

RQ_API const char * CALL_CONV RQT_GetCodeString(int errorCode);

#ifdef __cplusplus
}
#endif

#endif
