#ifndef APCI3600MSG_H_
#define APCI3600MSG_H_

#include <errno.h>
#include <string.h>

/* @parm __ret function return call
 * @parm __fcn function or command called
 */
#define STATUS_MSG_VERBOSE(__ret,__fcn) { printf("[CMD_APCI3600_%s: call result was \"%s\" (%d)]\n\n",#__fcn, (__ret == 0 ? "success" : ( __ret > 0 ? msg_##__fcn(__ret) : strerror(errno) ) ),__ret); }

/* @parm __ret function return call
 * @parm __fcn function or command called
 */
#define STATUS_MSG(__ret,__fcn) { if(__ret) printf("[CMD_APCI3600_%s: call result was \"%s\" (%d)]\n\n", #__fcn,( __ret > 0 ? msg_##__fcn(__ret) : strerror(errno)  ) ,__ret); }

/* for a given function, returns error string */
const char* msg_Write32BitPortValue(int nb);
const char* msg_Read32BitPortValue(int nb);
const char* msg_InitAnalogInputModule(int nb);
const char* msg_ReleaseAnalogInputModule(int nb);
const char* msg_StartAnalogInputModuleSingleAcquisition(int nb);
const char* msg_GetAnalogInputModuleCalibrationStatus(int nb);
const char* msg_GetAnalogInputModuleSingleAcquisitionStatus(int nb);
const char* msg_ReadAnalogInputSingleAcquisitionValues(int nb);
const char* msg_GetAnalogInputModuleValues(int nb);
const char* msg_InitAnalogInputModuleCyclicAcquisition(int nb);
const char* msg_StartAnalogInputModuleCyclicAcquisition(int nb);
const char* msg_GetAnalogInputModuleCyclicAcquisitionStatus(int nb);
const char* msg_IncrementAnalogInputCyclicAcquisitionBufferReadPointer(int nb);
const char* msg_StopAnalogInputModuleCyclicAcquisition(int nb);
const char* msg_ReleaseAnalogInputModuleCyclicAcquisition(int nb);
const char* msg_AnalogInput_EnableDisableDigitalInputExternalTrigger(int nb);
const char* msg_AnalogInput_EnableDisableMasterTrigger(int nb);
const char* msg_InitAnalogOutputChannel(int nb);
const char* msg_ReleaseAnalogOutputChannel(int nb);
const char* msg_GetAnalogOutputReadyBitStatus(int nb);
const char* msg_WriteAnalogOutputValue(int nb);
const char* msg_Set1AnalogOutputChannel(int nb);
const char* msg_ReserveAnalogOutputSignalGeneratorComputerBuffer(int nb);
const char* msg_FreeAnalogOutputSignalGeneratorComputerBuffer(int nb);
const char* msg_WriteAnalogOutputSignalGeneratorComputerBufferValues(int nb);
const char* msg_InitAnalogOutputSignalGenerator(int nb);
const char* msg_StartAnalogOutputSignalGenerator(int nb);
const char* msg_GetAnalogOutputSignalGeneratorStatus(int nb);
const char* msg_StopAnalogOutputSignalGenerator(int nb);
const char* msg_ReleaseAnalogOutputSignalGenerator(int nb);
const char* msg_AnalogOutput_EnableDisableDigitalInputExternalTrigger(int nb);
const char* msg_AnalogOutput_EnableDisableMasterTrigger(int nb);
const char* msg_InitChronometerModule(int nb);
const char* msg_ReleaseChronometerModule(int nb);
const char* msg_StartChronometerModuleAcquisition(int nb);
const char* msg_GetChronometerModuleFIFOStatus(int nb);
const char* msg_ReadChronometerModuleValue(int nb);
const char* msg_StopChronometerModuleAcquisition(int nb);
const char* msg_InitChronometerModuleCyclicAcquisition(int nb);
const char* msg_StartChronometerModuleCyclicAcquisition(int nb);
const char* msg_GetChronometerModuleCyclicAcquisitionStatus(int nb);
const char* msg_IncrementChronometerCyclicAcquisitionBufferReadPointer(int nb);
const char* msg_StopChronometerModuleContinuousAcquisition(int nb);
const char* msg_ReleaseChronometerModuleCyclicAcquisition(int nb);
const char* msg_Chronometer_EnableDisableDigitalInputExternalTrigger(int nb);
const char* msg_Chronometer_EnableDisableMasterTrigger(int nb);
const char* msg_Read1DigitalInput(int nb);
const char* msg_Read4DigitalInputs(int nb);
const char* msg_Read8DigitalInputs(int nb);
const char* msg_EnableDisableDigitalOutputMemory(int nb);
const char* msg_Set1DigitalOutputOn(int nb);
const char* msg_Set1DigitalOutputOff(int nb);
const char* msg_Set4DigitalOutputsOn(int nb);
const char* msg_Set4DigitalOutputsOff(int nb);
const char* msg_Set8DigitalOutputsOn(int nb);
const char* msg_Set8DigitalOutputsOff(int nb);
const char* msg_InitDigitalInputExternalTrigger(int nb);
const char* msg_MasterTrigger(int nb);
const char* msg_GetBoardInitialisation(int nb);
const char* msg_InitBoard(int nb);
const char* msg_QueryAnalogInputCyclicAcquisitionBufferSize(int nb);
const char* msg_EventEmpty(int nb);
const char* msg_EventWait(int nb);
const char* msg_GetAnalogInputCyclicAcquisitionBufferReadPointer(int nb);
const char* msg_ResetAcquisitionBuffer(int nb);
const char* msg_QueryAnalogInputCyclicAcquisitionNumberOfData(int nb);
#endif /*APCI3600MSG_H_*/
