Commit 59bea9fe authored by rswindell's avatar rswindell
Browse files

Remove COMIOCALL (not needed).

parent 39f89400
......@@ -43,11 +43,6 @@
#define COM_ERROR -1
#ifdef _WIN32
#ifdef __BORLANDC__
#define COMIOCALL
#else
#define COMIOCALL
#endif
#if defined(COMIO_IMPORTS) || defined(COMIO_EXPORTS)
#if defined(COMIO_IMPORTS)
#define COMIOEXPORT __declspec( dllimport )
......@@ -58,7 +53,6 @@
#define COMIOEXPORT
#endif
#else
#define COMIOCALL
#define COMIOEXPORT
#endif
......@@ -112,28 +106,28 @@
extern "C" {
#endif
COMIOEXPORT char* COMIOCALL comVersion(char* str, size_t len);
COMIOEXPORT COM_HANDLE COMIOCALL comOpen(const char* device);
COMIOEXPORT BOOL COMIOCALL comClose(COM_HANDLE);
COMIOEXPORT long COMIOCALL comGetBaudRate(COM_HANDLE);
COMIOEXPORT BOOL COMIOCALL comSetBaudRate(COM_HANDLE, ulong rate);
COMIOEXPORT BOOL COMIOCALL comGetTxFlowControl(COM_HANDLE);
COMIOEXPORT BOOL COMIOCALL comSetTxFlowControl(COM_HANDLE, BOOL enable);
COMIOEXPORT int COMIOCALL comGetModemStatus(COM_HANDLE);
COMIOEXPORT int COMIOCALL comRaiseDTR(COM_HANDLE);
COMIOEXPORT int COMIOCALL comLowerDTR(COM_HANDLE);
COMIOEXPORT int COMIOCALL comRaiseRTS(COM_HANDLE);
COMIOEXPORT int COMIOCALL comLowerRTS(COM_HANDLE);
COMIOEXPORT BOOL COMIOCALL comWriteByte(COM_HANDLE, BYTE);
COMIOEXPORT int COMIOCALL comWriteBuf(COM_HANDLE, const BYTE*, size_t buflen);
COMIOEXPORT int COMIOCALL comWriteString(COM_HANDLE, const char*);
COMIOEXPORT BOOL COMIOCALL comReadByte(COM_HANDLE, BYTE*);
COMIOEXPORT size_t COMIOCALL comReadBuf(COM_HANDLE, char* buf, size_t buflen
,const char* terminators, int timeout /* in milliseconds */);
COMIOEXPORT size_t COMIOCALL comReadLine(COM_HANDLE, char* buf, size_t buflen
,int timeout /* in milliseconds */);
COMIOEXPORT BOOL COMIOCALL comPurgeInput(COM_HANDLE);
COMIOEXPORT BOOL COMIOCALL comPurgeOutput(COM_HANDLE);
COMIOEXPORT char* comVersion(char* str, size_t len);
COMIOEXPORT COM_HANDLE comOpen(const char* device);
COMIOEXPORT BOOL comClose(COM_HANDLE);
COMIOEXPORT long comGetBaudRate(COM_HANDLE);
COMIOEXPORT BOOL comSetBaudRate(COM_HANDLE, ulong rate);
COMIOEXPORT BOOL comGetTxFlowControl(COM_HANDLE);
COMIOEXPORT BOOL comSetTxFlowControl(COM_HANDLE, BOOL enable);
COMIOEXPORT int comGetModemStatus(COM_HANDLE);
COMIOEXPORT int comRaiseDTR(COM_HANDLE);
COMIOEXPORT int comLowerDTR(COM_HANDLE);
COMIOEXPORT int comRaiseRTS(COM_HANDLE);
COMIOEXPORT int comLowerRTS(COM_HANDLE);
COMIOEXPORT BOOL comWriteByte(COM_HANDLE, BYTE);
COMIOEXPORT int comWriteBuf(COM_HANDLE, const BYTE*, size_t buflen);
COMIOEXPORT int comWriteString(COM_HANDLE, const char*);
COMIOEXPORT BOOL comReadByte(COM_HANDLE, BYTE*);
COMIOEXPORT size_t comReadBuf(COM_HANDLE, char* buf, size_t buflen
,const char* terminators, int timeout /* in milliseconds */);
COMIOEXPORT size_t comReadLine(COM_HANDLE, char* buf, size_t buflen
,int timeout /* in milliseconds */);
COMIOEXPORT BOOL comPurgeInput(COM_HANDLE);
COMIOEXPORT BOOL comPurgeOutput(COM_HANDLE);
#if defined(__cplusplus)
}
......
......@@ -38,7 +38,7 @@
#include "comio.h"
#include "genwrap.h"
char* COMIOCALL comVersion(char* str, size_t len)
char* comVersion(char* str, size_t len)
{
char revision[16];
......@@ -48,7 +48,7 @@ char* COMIOCALL comVersion(char* str, size_t len)
return str;
}
COM_HANDLE COMIOCALL comOpen(const char* device)
COM_HANDLE comOpen(const char* device)
{
COM_HANDLE handle;
COMMTIMEOUTS timeouts;
......@@ -85,12 +85,12 @@ COM_HANDLE COMIOCALL comOpen(const char* device)
return handle;
}
BOOL COMIOCALL comClose(COM_HANDLE handle)
BOOL comClose(COM_HANDLE handle)
{
return CloseHandle(handle);
}
long COMIOCALL comGetBaudRate(COM_HANDLE handle)
long comGetBaudRate(COM_HANDLE handle)
{
DCB dcb;
......@@ -100,7 +100,7 @@ long COMIOCALL comGetBaudRate(COM_HANDLE handle)
return dcb.BaudRate;
}
BOOL COMIOCALL comSetBaudRate(COM_HANDLE handle, unsigned long rate)
BOOL comSetBaudRate(COM_HANDLE handle, unsigned long rate)
{
DCB dcb;
......@@ -112,7 +112,7 @@ BOOL COMIOCALL comSetBaudRate(COM_HANDLE handle, unsigned long rate)
return SetCommState(handle, &dcb);
}
BOOL COMIOCALL comGetTxFlowControl(COM_HANDLE handle)
BOOL comGetTxFlowControl(COM_HANDLE handle)
{
DCB dcb;
......@@ -122,7 +122,7 @@ BOOL COMIOCALL comGetTxFlowControl(COM_HANDLE handle)
return dcb.fOutxCtsFlow;
}
BOOL COMIOCALL comSetTxFlowControl(COM_HANDLE handle, BOOL enable)
BOOL comSetTxFlowControl(COM_HANDLE handle, BOOL enable)
{
DCB dcb;
......@@ -134,7 +134,7 @@ BOOL COMIOCALL comSetTxFlowControl(COM_HANDLE handle, BOOL enable)
return SetCommState(handle, &dcb);
}
int COMIOCALL comGetModemStatus(COM_HANDLE handle)
int comGetModemStatus(COM_HANDLE handle)
{
DWORD status=0;
......@@ -144,34 +144,34 @@ int COMIOCALL comGetModemStatus(COM_HANDLE handle)
return COM_ERROR;
}
BOOL COMIOCALL comRaiseDTR(COM_HANDLE handle)
BOOL comRaiseDTR(COM_HANDLE handle)
{
return EscapeCommFunction(handle, SETDTR);
}
BOOL COMIOCALL comLowerDTR(COM_HANDLE handle)
BOOL comLowerDTR(COM_HANDLE handle)
{
return EscapeCommFunction(handle, CLRDTR);
}
BOOL COMIOCALL comRaiseRTS(COM_HANDLE handle)
BOOL comRaiseRTS(COM_HANDLE handle)
{
return EscapeCommFunction(handle, SETRTS);
}
BOOL COMIOCALL comLowerRTS(COM_HANDLE handle)
BOOL comLowerRTS(COM_HANDLE handle)
{
return EscapeCommFunction(handle, CLRRTS);
}
BOOL COMIOCALL comWriteByte(COM_HANDLE handle, BYTE ch)
BOOL comWriteByte(COM_HANDLE handle, BYTE ch)
{
DWORD wr=0;
return WriteFile(handle, &ch, sizeof(ch), &wr, NULL) && wr==sizeof(BYTE);
}
int COMIOCALL comWriteBuf(COM_HANDLE handle, const BYTE* buf, size_t buflen)
int comWriteBuf(COM_HANDLE handle, const BYTE* buf, size_t buflen)
{
DWORD wr=0;
......@@ -181,24 +181,24 @@ int COMIOCALL comWriteBuf(COM_HANDLE handle, const BYTE* buf, size_t buflen)
return wr;
}
int COMIOCALL comWriteString(COM_HANDLE handle, const char* str)
int comWriteString(COM_HANDLE handle, const char* str)
{
return comWriteBuf(handle, str, strlen(str));
}
BOOL COMIOCALL comReadByte(COM_HANDLE handle, BYTE* ch)
BOOL comReadByte(COM_HANDLE handle, BYTE* ch)
{
DWORD rd;
return ReadFile(handle, ch, sizeof(BYTE), &rd, NULL) && rd==sizeof(BYTE);
}
BOOL COMIOCALL comPurgeInput(COM_HANDLE handle)
BOOL comPurgeInput(COM_HANDLE handle)
{
return PurgeComm(handle, PURGE_RXCLEAR);
}
BOOL COMIOCALL comPurgeOutput(COM_HANDLE handle)
BOOL comPurgeOutput(COM_HANDLE handle)
{
return PurgeComm(handle, PURGE_TXCLEAR);
}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment