Commit ec3945d4 authored by deuce's avatar deuce
Browse files

More COMIOCALL removal.

parent 59bea9fe
......@@ -38,7 +38,7 @@
#include "comio.h"
#include "genwrap.h" /* msclock */
size_t COMIOCALL comReadBuf(COM_HANDLE handle, char* buf, size_t buflen, const char* terminators, int timeout)
size_t comReadBuf(COM_HANDLE handle, char* buf, size_t buflen, const char* terminators, int timeout)
{
BYTE ch;
size_t len=0;
......@@ -59,7 +59,7 @@ size_t COMIOCALL comReadBuf(COM_HANDLE handle, char* buf, size_t buflen, const c
return len;
}
size_t COMIOCALL comReadLine(COM_HANDLE handle, char* buf, size_t buflen, int timeout)
size_t comReadLine(COM_HANDLE handle, char* buf, size_t buflen, int timeout)
{
size_t len;
......
......@@ -195,7 +195,7 @@ unsigned long macro_to_rate(speed_t speed)
#define macro_to_rate(x) (x)
#endif
char* COMIOCALL comVersion(char* str, size_t len)
char* comVersion(char* str, size_t len)
{
char revision[16];
......@@ -205,7 +205,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;
struct termios t;
......@@ -256,12 +256,12 @@ Fun snippet from the FreeBSD manpage:
return handle;
}
BOOL COMIOCALL comClose(COM_HANDLE handle)
BOOL comClose(COM_HANDLE handle)
{
return (!close(handle));
}
long COMIOCALL comGetBaudRate(COM_HANDLE handle)
long comGetBaudRate(COM_HANDLE handle)
{
struct termios t;
speed_t in;
......@@ -279,7 +279,7 @@ long COMIOCALL comGetBaudRate(COM_HANDLE handle)
return ((long)(in>out?in:out));
}
BOOL COMIOCALL comSetBaudRate(COM_HANDLE handle, unsigned long rate)
BOOL comSetBaudRate(COM_HANDLE handle, unsigned long rate)
{
struct termios t;
......@@ -294,7 +294,7 @@ BOOL COMIOCALL comSetBaudRate(COM_HANDLE handle, unsigned long rate)
return TRUE;
}
int COMIOCALL comGetModemStatus(COM_HANDLE handle)
int comGetModemStatus(COM_HANDLE handle)
{
int status;
......@@ -311,31 +311,31 @@ static BOOL comSetFlags(COM_HANDLE handle, int flags, BOOL set)
return ioctl(handle, cmd, &flags);
}
BOOL COMIOCALL comRaiseDTR(COM_HANDLE handle)
BOOL comRaiseDTR(COM_HANDLE handle)
{
return comSetFlags(handle, TIOCM_DTR, TRUE);
}
BOOL COMIOCALL comLowerDTR(COM_HANDLE handle)
BOOL comLowerDTR(COM_HANDLE handle)
{
return comSetFlags(handle, TIOCM_DTR, FALSE);
}
BOOL COMIOCALL comRaiseRTS(COM_HANDLE handle)
BOOL comRaiseRTS(COM_HANDLE handle)
{
return comSetFlags(handle, TIOCM_RTS, TRUE);
}
BOOL COMIOCALL comLowerRTS(COM_HANDLE handle)
BOOL comLowerRTS(COM_HANDLE handle)
{
return comSetFlags(handle, TIOCM_RTS, FALSE);
}
BOOL COMIOCALL comWriteByte(COM_HANDLE handle, BYTE ch)
BOOL comWriteByte(COM_HANDLE handle, BYTE ch)
{
return(write(handle, &ch, 1)==1);
}
int COMIOCALL comWriteBuf(COM_HANDLE handle, const BYTE* buf, size_t buflen)
int comWriteBuf(COM_HANDLE handle, const BYTE* buf, size_t buflen)
{
return write(handle, buf, buflen);
}
......@@ -343,27 +343,27 @@ int COMIOCALL comWriteBuf(COM_HANDLE handle, const BYTE* buf, size_t buflen)
/*
* TODO: This seem kinda dangerous for short writes...
*/
int COMIOCALL comWriteString(COM_HANDLE handle, const char* str)
int comWriteString(COM_HANDLE handle, const char* str)
{
return comWriteBuf(handle, (BYTE*)str, strlen(str));
}
BOOL COMIOCALL comReadByte(COM_HANDLE handle, BYTE* ch)
BOOL comReadByte(COM_HANDLE handle, BYTE* ch)
{
return(read(handle, ch, 1)==1);
}
BOOL COMIOCALL comPurgeInput(COM_HANDLE handle)
BOOL comPurgeInput(COM_HANDLE handle)
{
return(tcflush(handle, TCIFLUSH)==0);
}
BOOL COMIOCALL comPurgeOutput(COM_HANDLE handle)
BOOL comPurgeOutput(COM_HANDLE handle)
{
return(tcflush(handle, TCOFLUSH)==0);
}
BOOL COMIOCALL comDrainOutput(COM_HANDLE handle)
BOOL comDrainOutput(COM_HANDLE handle)
{
return(tcdrain(handle)==0);
}
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