#ifndef RAWSCANINTERNAL_H
#define RAWSCANINTERNAL_H

#include "RawScanProtected.h"
#include "RawScanError.h"
#ifdef __cplusplus
extern "C" {
#endif

	typedef struct
	{
		int				hasTrailer : 1 ; // hasTrailer no longer used because encoder data always in the scan.
	} RawScan_DataAHeader ;					// Left it in here because we may need the header for other features in the future

	typedef struct
	{
		int				hasTrailer : 1 ; 
	} RawScan_DataBHeader ;
	
	void RawScan_HandleError(RawScan_ReturnCode errorCode);
	NDTS_Boolean CALL_CONV RawScan_GetRawScanDataAHeader(NDTS_RawScan *pRawScan, RawScan_DataAHeader **ppHeader) ;
	NDTS_Boolean CALL_CONV RawScan_GetRawScanDataBHeader(NDTS_RawScan *pRawScan, RawScan_DataBHeader **ppHeader) ;

	NDTS_Boolean CALL_CONV RawScan_GetRawScanAScanBody(NDTS_RawScan *pRawScan, unsigned long aScanIndex, unsigned long bScanIndex, RawScan_MemoryHandle **ppData) ;

	// This function is equivalent to RawScan_GetRawScanAScanHeader(pRawScan, 0, bScanIndex, &pData)
	NDTS_Boolean CALL_CONV RawScan_GetRawScanBScanBody(NDTS_RawScan *pRawScan, unsigned long bScanIndex, RawScan_MemoryHandle **ppData) ;
	NDTS_Boolean CALL_CONV RawScan_GetRawScanBScanTrailer(NDTS_RawScan *pRawScan, unsigned long bScanIndex, RawScan_MemoryHandle **ppData) ;

	NDTS_Boolean CALL_CONV RawScan_GetRawScanGateValuesTrailer(NDTS_RawScan *pRawScan, unsigned long bScanIndex, RawScan_MemoryHandle **ppData) ;

	NDTS_Boolean CALL_CONV RawScan_GetRawScanBScanMemoryBlockList(NDTS_RawScan *pRawScan, unsigned long bScanIndex, RawScan_MemoryHandle **ppData) ;
	NDTS_Boolean CALL_CONV RawScan_GetRawScanGateValuesMemoryBlockList(NDTS_RawScan *pRawScan, unsigned long bScanIndex, RawScan_MemoryHandle **ppList) ;


	// Bytes: The size of an a-scan body.
	unsigned long CALL_CONV RawScan_ReturnRawScanAScanBodySize(NDTS_RawScan *pRawScan, unsigned long aScanIndex) ;
	// Bytes: The size of an a-scan header.
	unsigned long CALL_CONV RawScan_ReturnRawScanAScanHeaderSize(NDTS_RawScan *pRawScan) ;
	// Bytes: The size of a b-scan trailer.
	unsigned long CALL_CONV RawScan_ReturnRawScanBScanTrailerSize(NDTS_RawScan *pRawScan) ;
	// Bytes: The size of a b-scan body.
	unsigned long CALL_CONV RawScan_ReturnRawScanGateValuesBodySize(NDTS_RawScan *pRawScan) ;
	// Bytes: The size of a b-scan trailer.
	unsigned long CALL_CONV RawScan_ReturnRawScanGateValuesTrailerSize(NDTS_RawScan *pRawScan) ;
	// Bytes: The size of an encoder values block in the raw scan. Is 0 if raw scan does not contain encoder values.
	// Is RawScan_NUMBER_OF_ENCODERS * the size of a single encoder value.
	unsigned long CALL_CONV RawScan_ReturnRawScanEncoderValuesSize(NDTS_RawScan *pRawScan) ;
	// Bytes: The size of a CRC value in the raw scan. Is 0 if raw scan does not contain CRC's.
	unsigned long CALL_CONV RawScan_ReturnRawScanCRCSize(NDTS_RawScan *pRawScan) ;


#ifdef __cplusplus
}
#endif


#endif