#undef ATTR_PACKED
#if defined(_MSC_VER)
#pragma pack( push, safe_old_packing, 4 )
#define ATTR_PACKED
...
#endif
#ifdef PASCAL
#define CODE_ATTR __stdcall
#else
#define CODE_ATTR
#endif
typedef IOXS (*CBF_DATA_WRITE) /* write data to IO stack (local ==> remote) */
(UINT32 DevHndl, /*
Handle for device */
DEV_ADDR * pAddr, /* address */
UINT32 BufLen, /* length of input data */
UINT8 * pBuffer, /* Ptr to data buffer to write to */
IOXS Iocs); /* remote status */
typedef IOXS (*CBF_DATA_READ) /* read data from IO stack (remote ==> local) */
(UINT32 DevHndl, /*
Handle for device */
DEV_ADDR * pAddr, /* address */
UINT32 BufLen, /* length of input data */
UINT8 * pBuffer, /* Ptr to data buffer to read from */
IOXS Iops); /* provider status */
/* structure for callback function block */
typedef struct {
UINT32 size; // size of struct = sizeof(CBF_FUNCTIONS)
CBF_DATA_WRITE cbf_data_write;
CBF_DATA_READ cbf_data_read;
} ATTR_PACKED CBF_FUNCTIONS;
UINT32 CODE_ATTR device_open (
UINT16 DeviceId, /* [in] device id */
CBF_FUNCTIONS * pCbf, /* [in] cbf */
UINT32 * pDevHndl); /* [out] device
handle */