/************************************************************************************************
 *  Copyright Dewetron GmbH 2014                                                                *
 *                                                                                              *
 *  Special header for applications that cannot use the load mechanism in dmd_reader_api_load.h *
 ************************************************************************************************/

#ifndef _DEWETRON_DMD_READER_API_SPECIAL_
#define _DEWETRON_DMD_READER_API_SPECIAL_

#ifdef __cplusplus
extern "C" {
#endif

#ifdef __cplusplus
    #define EXTERN    extern
#else
    #define EXTERN    
#endif

#if defined(__x86_64__) || defined(__amd64__) || defined(__LP64) \
 || defined(_M_X64)     || defined(_M_AMD64)  || defined(_WIN64)
    #define BUILD_X64
#elif defined(_M_IX86) || defined(__INTEL__) || defined(__i386__)
    #define BUILD_X86
#else
    #error "Unable to detect architecture"
#endif

#include "dmd_reader_api_interface.h"

DMDReader_ErrorCode DMDREADER_EXPORT DMDReader_GetVersion (DMDReader_uint32* interfaceVersionMajor, DMDReader_uint32* interfaceVersionMinor);
DMDReader_ErrorCode DMDREADER_EXPORT DMDReader_Initialize (DMDReader_uint32 interfaceVersionMajor, DMDReader_uint32 interfaceVersionMinor);
DMDReader_ErrorCode DMDREADER_EXPORT DMDReader_Dispose ();
DMDReader_ErrorCode DMDREADER_EXPORT DMDReader_OpenFile (const char* fullFilename, DMDReader_FileHandle* file);
DMDReader_ErrorCode DMDREADER_EXPORT DMDReader_CloseFile (DMDReader_FileHandle* file);
DMDReader_ErrorCode DMDREADER_EXPORT DMDReader_GetNumChannels (DMDReader_FileHandle file, DMDReader_ChannelType type, DMDReader_uint64* numChannels);
DMDReader_ErrorCode DMDREADER_EXPORT DMDReader_GetChannels (DMDReader_FileHandle file, DMDReader_ChannelType type, DMDReader_uint64 firstChannel, DMDReader_uint64 maxChannels, DMDReader_P_ChannelHandle channelList, DMDReader_uint64* numChannels);
DMDReader_ErrorCode DMDREADER_EXPORT DMDReader_GetSampleType (DMDReader_ChannelHandle channel, DMDReader_SampleType* dataSampleType, DMDReader_SampleType* reducedSampleType);
DMDReader_ErrorCode DMDREADER_EXPORT DMDReader_GetVectorSampleType (DMDReader_ChannelHandle channel, DMDReader_SampleType* dataSampleType, DMDReader_SampleType* reducedSampleType, DMDReader_SampleDimension* maxSampleDimension);
DMDReader_ErrorCode DMDREADER_EXPORT DMDReader_GetChannelInformation (DMDReader_ChannelHandle channel, DMDReader_P_CHANNELINFORMATION info);
DMDReader_ErrorCode DMDREADER_EXPORT DMDReader_GetSamplesWithTS_ScaledValue_Seconds (DMDReader_ChannelHandle channel, DMDReader_SampleIndex firstSample, DMDReader_SampleCount maxSamples, DMDReader_P_SCALEDSAMPLE_TIMESTAMP values, DMDReader_SampleCount* numValidSamples, DMDReader_SampleIndex* nextSample);
DMDReader_ErrorCode DMDREADER_EXPORT DMDReader_GetSamplesAndTS_ScaledValue_Seconds (DMDReader_ChannelHandle channel, DMDReader_SampleIndex firstSample, DMDReader_SampleCount maxSamples,  DMDReader_SAMPLEVALUE_SCALED* samples, DMDReader_TIMESTAMP_SECONDS* timestamps, DMDReader_SampleCount* numValidSamples, DMDReader_SampleIndex* nextSample);
DMDReader_ErrorCode DMDREADER_EXPORT DMDReader_GetSamplesWithTS_ReducedValue_Seconds (DMDReader_ChannelHandle channel, DMDReader_SampleIndex firstSample, DMDReader_SampleCount maxSamples, DMDReader_P_REDUCEDSAMPLE_TIMESTAMP values, DMDReader_SampleCount* numValidSamples, DMDReader_SampleIndex* nextSample);
DMDReader_ErrorCode DMDREADER_EXPORT DMDReader_GetSamplesAndTS_ReducedValue_Seconds (DMDReader_ChannelHandle channel, DMDReader_SampleIndex firstSample, DMDReader_SampleCount maxSamples, DMDReader_SAMPLEVALUE_REDUCED* samples, DMDReader_TIMESTAMP_SECONDS* timestamps, DMDReader_SampleCount* numValidSamples, DMDReader_SampleIndex* nextSample);
DMDReader_ErrorCode DMDREADER_EXPORT DMDReader_GetSamplesWithTS_DigitalValue_Seconds (DMDReader_ChannelHandle channel, DMDReader_SampleIndex firstSample, DMDReader_SampleCount maxSamples, DMDReader_P_DIGITALSAMPLE_TIMESTAMP values, DMDReader_SampleCount* numValidSamples, DMDReader_SampleIndex* nextSample);
DMDReader_ErrorCode DMDREADER_EXPORT DMDReader_GetSamplesAndTS_DigitalValue_Seconds (DMDReader_ChannelHandle channel, DMDReader_SampleIndex firstSample, DMDReader_SampleCount maxSamples, DMDReader_sint32* samples, DMDReader_TIMESTAMP_SECONDS* timestamps, DMDReader_SampleCount* numValidSamples, DMDReader_SampleIndex* nextSample);
DMDReader_ErrorCode DMDREADER_EXPORT DMDReader_GetSamplesAndTS_ScalarVector_Seconds (DMDReader_ChannelHandle channel, DMDReader_SampleIndex firstSample, DMDReader_SampleCount maxSamples, DMDReader_SampleDimension maxSampleDimension, DMDReader_SAMPLEVALUE_SCALED* samples, DMDReader_P_TIMESTAMP_SECONDS timestamps, DMDReader_P_SampleDimension sampleDimensions, DMDReader_SampleCount* numValidSamples, DMDReader_SampleIndex* nextSample);
DMDReader_ErrorCode DMDREADER_EXPORT DMDReader_GetSamplesAndTS_ComplexVector_Seconds (DMDReader_ChannelHandle channel, DMDReader_SampleIndex firstSample, DMDReader_SampleCount maxSamples, DMDReader_SampleDimension maxSampleDimension, DMDReader_SAMPLEVALUE_COMPLEX* samples, DMDReader_P_TIMESTAMP_SECONDS timestamps, DMDReader_P_SampleDimension sampleDimensions, DMDReader_SampleCount* numValidSamples, DMDReader_SampleIndex* nextSample);
DMDReader_ErrorCode DMDREADER_EXPORT DMDReader_GetNumHeaderFields (DMDReader_FileHandle file, DMDReader_uint64* numFields);
DMDReader_ErrorCode DMDREADER_EXPORT DMDReader_GetHeaderFields (DMDReader_FileHandle file, DMDReader_uint64 firstField, DMDReader_uint64 maxFields, DMDReader_P_HEADERFIELD fields, DMDReader_uint64* numFields);
DMDReader_ErrorCode DMDREADER_EXPORT DMDReader_GetHeaderField (DMDReader_FileHandle file, const char* name, DMDReader_STRING* value);
DMDReader_ErrorCode DMDREADER_EXPORT DMDReader_GetMeasurementStartTime (DMDReader_FileHandle file, DMDReader_TIMESTAMP_UTC* utcTime, int utc_flag);
DMDReader_ErrorCode DMDREADER_EXPORT DMDReader_GetNumMarkers (DMDReader_FileHandle file, DMDReader_uint64* numMarkers);
DMDReader_ErrorCode DMDREADER_EXPORT DMDReader_GetMarkers (DMDReader_FileHandle file, DMDReader_uint64 firstMarker, DMDReader_uint64 maxMarkers, DMDReader_P_MARKEREVENT markers, DMDReader_uint64* numMarkers);
DMDReader_ErrorCode DMDREADER_EXPORT DMDReader_GetNumDataSweeps (DMDReader_ChannelHandle channel, DMDReader_uint64* numSweeps);
DMDReader_ErrorCode DMDREADER_EXPORT DMDReader_GetDataSweeps (DMDReader_ChannelHandle channel, DMDReader_uint64 firstSweep, DMDReader_uint64 maxSweeps, DMDReader_P_SWEEP sweeps, DMDReader_uint64* numSweeps);
DMDReader_ErrorCode DMDREADER_EXPORT DMDReader_GetNumReducedSweeps (DMDReader_ChannelHandle channel, DMDReader_uint64* numSweeps);
DMDReader_ErrorCode DMDREADER_EXPORT DMDReader_GetReducedSweeps (DMDReader_ChannelHandle channel, DMDReader_uint64 firstSweep, DMDReader_uint64 maxSweeps, DMDReader_P_SWEEP sweeps, DMDReader_uint64* numSweeps);

#ifdef __cplusplus
}
#endif

#endif //_DEWETRON_DMD_READER_API_SPECIAL_
