OLD | NEW |
1 /* Copyright (c) 2013 The Chromium Authors. All rights reserved. | 1 /* Copyright (c) 2013 The Chromium Authors. All rights reserved. |
2 * Use of this source code is governed by a BSD-style license that can be | 2 * Use of this source code is governed by a BSD-style license that can be |
3 * found in the LICENSE file. */ | 3 * found in the LICENSE file. */ |
4 | 4 |
5 #ifndef LIBRARIES_NACL_IO_OSTERMIOS_H | 5 #ifndef LIBRARIES_NACL_IO_OSTERMIOS_H |
6 #define LIBRARIES_NACL_IO_OSTERMIOS_H | 6 #define LIBRARIES_NACL_IO_OSTERMIOS_H |
7 | 7 |
8 #if defined(__native_client__) | 8 #if defined(WIN32) |
9 | |
10 #include <termios.h> | |
11 | |
12 #else | |
13 | 9 |
14 #include "sdk_util/macros.h" | 10 #include "sdk_util/macros.h" |
15 | 11 |
16 typedef unsigned char cc_t; | 12 typedef unsigned char cc_t; |
17 typedef unsigned short tcflag_t; | 13 typedef unsigned short tcflag_t; |
18 typedef char speed_t; | 14 typedef char speed_t; |
19 | 15 |
20 #define NCCS 32 | 16 #define NCCS 32 |
21 struct termios { | 17 struct termios { |
22 tcflag_t c_iflag; | 18 tcflag_t c_iflag; |
23 tcflag_t c_oflag; | 19 tcflag_t c_oflag; |
24 tcflag_t c_cflag; | 20 tcflag_t c_cflag; |
25 tcflag_t c_lflag; | 21 tcflag_t c_lflag; |
26 char c_line; | 22 char c_line; |
27 cc_t c_cc[NCCS]; | 23 cc_t c_cc[NCCS]; |
28 speed_t c_ispeed; | 24 speed_t c_ispeed; |
29 speed_t c_ospeed; | 25 speed_t c_ospeed; |
30 }; | 26 }; |
31 | 27 |
32 | 28 |
33 EXTERN_C_BEGIN | 29 EXTERN_C_BEGIN |
34 | 30 |
35 int tcgetattr(int fd,struct termios *termios_p); | 31 int tcgetattr(int fd,struct termios *termios_p); |
36 int tcsetattr(int fd,int optional_actions,const struct termios *termios_p); | 32 int tcsetattr(int fd,int optional_actions,const struct termios *termios_p); |
37 | 33 |
38 EXTERN_C_END | 34 EXTERN_C_END |
39 | 35 |
| 36 #else |
| 37 |
| 38 #include <termios.h> |
| 39 |
40 #endif | 40 #endif |
41 | 41 |
| 42 |
42 #endif /* LIBRARIES_NACL_IO_OSTERMIOS_H */ | 43 #endif /* LIBRARIES_NACL_IO_OSTERMIOS_H */ |
OLD | NEW |