1 // Licensed under the Apache License, Version 2.0
2 // <LICENSE-APACHE or http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
3 // <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your option.
4 // All files in the project carrying such notice may not be copied, modified, or distributed
5 // except according to those terms.
6 use ctypes::c_char;
7 use shared::minwindef::{BOOL, DWORD, LPDWORD};
8 use um::minwinbase::LPOVERLAPPED;
9 use um::winbase::{LPCOMMCONFIG, LPCOMMPROP, LPCOMMTIMEOUTS, LPCOMSTAT, LPDCB};
10 use um::winnt::HANDLE;
11 extern "system" {
ClearCommBreak( hFile: HANDLE, ) -> BOOL12     pub fn ClearCommBreak(
13         hFile: HANDLE,
14     ) -> BOOL;
ClearCommError( hFile: HANDLE, lpErrors: LPDWORD, lpStat: LPCOMSTAT, ) -> BOOL15     pub fn ClearCommError(
16         hFile: HANDLE,
17         lpErrors: LPDWORD,
18         lpStat: LPCOMSTAT,
19     ) -> BOOL;
SetupComm( hFile: HANDLE, dwInQueue: DWORD, dwOutQueue: DWORD, ) -> BOOL20     pub fn SetupComm(
21         hFile: HANDLE,
22         dwInQueue: DWORD,
23         dwOutQueue: DWORD,
24     ) -> BOOL;
EscapeCommFunction( hFile: HANDLE, dwFunc: DWORD, ) -> BOOL25     pub fn EscapeCommFunction(
26         hFile: HANDLE,
27         dwFunc: DWORD,
28     ) -> BOOL;
GetCommConfig( hCommDev: HANDLE, lpCC: LPCOMMCONFIG, lpdwSize: LPDWORD, ) -> BOOL29     pub fn GetCommConfig(
30         hCommDev: HANDLE,
31         lpCC: LPCOMMCONFIG,
32         lpdwSize: LPDWORD,
33     ) -> BOOL;
GetCommMask( hFile: HANDLE, lpEvtMask: LPDWORD, ) -> BOOL34     pub fn GetCommMask(
35         hFile: HANDLE,
36         lpEvtMask: LPDWORD,
37     ) -> BOOL;
GetCommModemStatus( hFile: HANDLE, lpModemStat: LPDWORD, ) -> BOOL38     pub fn GetCommModemStatus(
39         hFile: HANDLE,
40         lpModemStat: LPDWORD,
41     ) -> BOOL;
GetCommProperties( hFile: HANDLE, lpCommProp: LPCOMMPROP, ) -> BOOL42     pub fn GetCommProperties(
43         hFile: HANDLE,
44         lpCommProp: LPCOMMPROP,
45     ) -> BOOL;
GetCommState( hFile: HANDLE, lpDCB: LPDCB, ) -> BOOL46     pub fn GetCommState(
47         hFile: HANDLE,
48         lpDCB: LPDCB,
49     ) -> BOOL;
GetCommTimeouts( hFile: HANDLE, lpCommTimeouts: LPCOMMTIMEOUTS, ) -> BOOL50     pub fn GetCommTimeouts(
51         hFile: HANDLE,
52         lpCommTimeouts: LPCOMMTIMEOUTS,
53     ) -> BOOL;
PurgeComm( hFile: HANDLE, dwFlags: DWORD, ) -> BOOL54     pub fn PurgeComm(
55         hFile: HANDLE,
56         dwFlags: DWORD,
57     ) -> BOOL;
SetCommBreak( hFile: HANDLE, ) -> BOOL58     pub fn SetCommBreak(
59         hFile: HANDLE,
60     ) -> BOOL;
SetCommConfig( hCommDev: HANDLE, lpCC: LPCOMMCONFIG, dwSize: DWORD, ) -> BOOL61     pub fn SetCommConfig(
62         hCommDev: HANDLE,
63         lpCC: LPCOMMCONFIG,
64         dwSize: DWORD,
65     ) -> BOOL;
SetCommMask( hFile: HANDLE, dwEvtMask: DWORD, ) -> BOOL66     pub fn SetCommMask(
67         hFile: HANDLE,
68         dwEvtMask: DWORD,
69     ) -> BOOL;
SetCommState( hFile: HANDLE, lpDCB: LPDCB, ) -> BOOL70     pub fn SetCommState(
71         hFile: HANDLE,
72         lpDCB: LPDCB,
73     ) -> BOOL;
SetCommTimeouts( hFile: HANDLE, lpCommTimeouts: LPCOMMTIMEOUTS, ) -> BOOL74     pub fn SetCommTimeouts(
75         hFile: HANDLE,
76         lpCommTimeouts: LPCOMMTIMEOUTS,
77     ) -> BOOL;
TransmitCommChar( hFile: HANDLE, cChar: c_char, ) -> BOOL78     pub fn TransmitCommChar(
79         hFile: HANDLE,
80         cChar: c_char,
81     ) -> BOOL;
WaitCommEvent( hFile: HANDLE, lpEvtMask: LPDWORD, lpOverlapped: LPOVERLAPPED, ) -> BOOL82     pub fn WaitCommEvent(
83         hFile: HANDLE,
84         lpEvtMask: LPDWORD,
85         lpOverlapped: LPOVERLAPPED,
86     ) -> BOOL;
87 }
88