
#include <windows.h>
#include <stdio.h>
#include <io.h>
#include "SDKUtilitiesError.h"
#include "NDTSError.h"

typedef struct 
{
	SDKUtilities_ReturnCode	code ;
	char *			codeString ;
} SDKUtilities_Errors ;

SDKUtilities_Errors SDK_UTILITIES_APIErrors[] = 
{
	{SDKUtilities_Extract_OK,													"OK"},
	{SDKUtilities_SignAndMagToTwosComp_MustBe16BitAligned,						"SDKUtilities SignAndMagToTwosComp MustBe16BitAligned"},
	{SDKUtilities_LastError,													"Unknown"}
} ;

const char * CALL_CONV SDKUtilities_GetCodeString(int errorCode)
{
	int i = 0 ;

	while (SDK_UTILITIES_APIErrors[i].code != errorCode && SDK_UTILITIES_APIErrors[i].code != SDKUtilities_LastError)
		i++ ;

	return SDK_UTILITIES_APIErrors[i].codeString ;
}

void SDKUtilities_HandleError(SDKUtilities_ReturnCode errorCode) 
{
	NDTS_HandleError(errorCode);
}