00001 #ifndef __WINDOWS_TYPES__ 00002 #define __WINDOWS_TYPES__ 00003 00004 #define WINAPI 00005 00006 #define MAX_NUM_DEVICES 50 00007 #include <sys/time.h> 00008 00009 typedef unsigned int DWORD; 00010 typedef unsigned int ULONG; 00011 typedef unsigned short USHORT; 00012 typedef unsigned short SHORT; 00013 typedef unsigned char UCHAR; 00014 typedef unsigned short WORD; 00015 typedef unsigned char BYTE; 00016 typedef BYTE *LPBYTE; 00017 typedef unsigned int BOOL; 00018 typedef unsigned char BOOLEAN; 00019 typedef unsigned char CHAR; 00020 typedef BOOL *LPBOOL; 00021 typedef UCHAR *PUCHAR; 00022 typedef const char *LPCSTR; 00023 typedef char *PCHAR; 00024 typedef void *PVOID; 00025 typedef void *HANDLE; 00026 typedef unsigned int LONG; 00027 typedef int INT; 00028 typedef unsigned int UINT; 00029 typedef char *LPSTR; 00030 typedef char *LPTSTR; 00031 typedef const char *LPCTSTR; 00032 typedef DWORD *LPDWORD; 00033 typedef WORD *LPWORD; 00034 typedef ULONG *PULONG; 00035 typedef LONG *LPLONG; 00036 typedef PVOID LPVOID; 00037 typedef void VOID; 00038 typedef unsigned long long int ULONGLONG; 00039 00040 typedef struct _OVERLAPPED { 00041 DWORD Internal; 00042 DWORD InternalHigh; 00043 DWORD Offset; 00044 DWORD OffsetHigh; 00045 HANDLE hEvent; 00046 } OVERLAPPED, *LPOVERLAPPED; 00047 00048 typedef struct _SECURITY_ATTRIBUTES { 00049 DWORD nLength; 00050 LPVOID lpSecurityDescriptor; 00051 BOOL bInheritHandle; 00052 } SECURITY_ATTRIBUTES , *LPSECURITY_ATTRIBUTES; 00053 00054 typedef struct timeval SYSTEMTIME; 00055 typedef struct timeval FILETIME; 00056 #ifndef TRUE 00057 #define TRUE 1 00058 #endif 00059 #ifndef FALSE 00060 #define FALSE 0 00061 #endif 00062 00063 // 00064 // Modem Status Flags 00065 // 00066 #define MS_CTS_ON ((DWORD)0x0010) 00067 #define MS_DSR_ON ((DWORD)0x0020) 00068 #define MS_RING_ON ((DWORD)0x0040) 00069 #define MS_RLSD_ON ((DWORD)0x0080) 00070 00071 // 00072 // Error Flags 00073 // 00074 #define CE_RXOVER 0x0001 // Receive Queue overflow 00075 #define CE_OVERRUN 0x0002 // Receive Overrun Error 00076 #define CE_RXPARITY 0x0004 // Receive Parity Error 00077 #define CE_FRAME 0x0008 // Receive Framing error 00078 #define CE_BREAK 0x0010 // Break Detected 00079 #define CE_TXFULL 0x0100 // TX Queue is full 00080 #define CE_PTO 0x0200 // LPTx Timeout 00081 #define CE_IOE 0x0400 // LPTx I/O Error 00082 #define CE_DNS 0x0800 // LPTx Device not selected 00083 #define CE_OOP 0x1000 // LPTx Out-Of-Paper 00084 #define CE_MODE 0x8000 // Requested mode unsupported 00085 00086 // 00087 // Events 00088 // 00089 #define EV_RXCHAR 0x0001 // Any Character received 00090 #define EV_RXFLAG 0x0002 // Received certain character 00091 #define EV_TXEMPTY 0x0004 // Transmit Queue Empty 00092 #define EV_CTS 0x0008 // CTS changed state 00093 #define EV_DSR 0x0010 // DSR changed state 00094 #define EV_RLSD 0x0020 // RLSD changed state 00095 #define EV_BREAK 0x0040 // BREAK received 00096 #define EV_ERR 0x0080 // Line status error occurred 00097 #define EV_RING 0x0100 // Ring signal detected 00098 #define EV_PERR 0x0200 // Printer error occured 00099 #define EV_RX80FULL 0x0400 // Receive buffer is 80 percent full 00100 #define EV_EVENT1 0x0800 // Provider specific event 1 00101 #define EV_EVENT2 0x1000 // Provider specific event 2 00102 00103 // 00104 // Escape Functions 00105 // 00106 #define SETXOFF 1 // Simulate XOFF received 00107 #define SETXON 2 // Simulate XON received 00108 #define SETRTS 3 // Set RTS high 00109 #define CLRRTS 4 // Set RTS low 00110 #define SETDTR 5 // Set DTR high 00111 #define CLRDTR 6 // Set DTR low 00112 #define RESETDEV 7 // Reset device if possible 00113 #define SETBREAK 8 // Set the device break line. 00114 #define CLRBREAK 9 // Clear the device break line. 00115 00116 // 00117 // PURGE function flags. 00118 // 00119 #define PURGE_TXABORT 0x0001 // Kill the pending/current writes to the comm port. 00120 #define PURGE_RXABORT 0x0002 // Kill the pending/current reads to the comm port. 00121 #define PURGE_TXCLEAR 0x0004 // Kill the transmit queue if there. 00122 #define PURGE_RXCLEAR 0x0008 // Kill the typeahead buffer if there. 00123 00124 #ifndef INVALID_HANDLE_VALUE 00125 #define INVALID_HANDLE_VALUE 0xFFFFFFFF 00126 #endif 00127 00128 #endif