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 3 * found in the LICENSE file. */ 4 5 #ifndef LIBRARIES_NACL_IO_INCLUDE_SYS_TERMIOS_H_ 6 #define LIBRARIES_NACL_IO_INCLUDE_SYS_TERMIOS_H_ 7 8 #define IGNBRK 0000001 9 #define BRKINT 0000002 10 #define IGNPAR 0000004 11 #define PARMRK 0000010 12 #define INPCK 0000020 13 #define ISTRIP 0000040 14 #define INLCR 0000100 15 #define IGNCR 0000200 16 #define ICRNL 0000400 17 #define IUCLC 0001000 18 #define IXON 0002000 19 #define IXANY 0004000 20 #define IXOFF 0010000 21 #define IMAXBEL 0020000 22 #define IUTF8 0040000 23 24 #define OPOST 000001 25 #define OCRNL 000004 26 #define ONLCR 000010 27 #define ONOCR 000020 28 #define ONLRET 000040 29 #define TAB3 014000 30 31 #define CLOCAL 004000 32 #define CREAD 000200 33 #define PARODD 001000 34 #define CSIZE 000060 35 #define CS5 0 36 #define CS6 020 37 #define CS7 040 38 #define CS8 060 39 #define CSTOPB 000100 40 #define HUPCL 002000 41 #define PARENB 000400 42 #define PAODD 001000 43 44 #define ECHO 0000010 45 #define ECHOE 0000020 46 #define ECHOK 0000040 47 #define ECHONL 0000100 48 #define ICANON 0000002 49 #define IEXTEN 0100000 50 #define ISIG 0000001 51 #define NOFLSH 0000200 52 #define TOSTOP 0000400 53 #define ECHOCTL 0001000 54 #define ECHOPRT 0002000 55 #define ECHOKE 0004000 56 #define FLUSHO 0010000 57 #define PENDIN 0040000 58 59 #define VINTR 0 60 #define VQUIT 1 61 #define VERASE 2 62 #define VKILL 3 63 #define VEOF 4 64 #define VTIME 5 65 #define VMIN 6 66 #define VSWTC 7 67 #define VSTART 8 68 #define VSTOP 9 69 #define VSUSP 10 70 #define VEOL 11 71 #define VREPRINT 12 72 #define VDISCARD 13 73 #define VWERASE 14 74 #define VLNEXT 15 75 #define VEOL2 16 76 77 #define B0 000000 78 #define B50 000001 79 #define B75 000002 80 #define B110 000003 81 #define B134 000004 82 #define B150 000005 83 #define B200 000006 84 #define B300 000007 85 #define B600 000010 86 #define B1200 000011 87 #define B1800 000012 88 #define B2400 000013 89 #define B4800 000014 90 #define B9600 000015 91 #define B19200 000016 92 #define B38400 000017 93 94 #define TCIFLUSH 0 95 #define TCOFLUSH 1 96 #define TCIOFLUSH 2 97 98 #define TCSANOW 0 99 #define TCSADRAIN 1 100 #define TCSAFLUSH 2 101 102 #define TCOOFF 0 103 #define TCOON 1 104 #define TCIOFF 2 105 #define TCION 3 106 107 typedef unsigned char cc_t; 108 typedef unsigned short tcflag_t; 109 typedef char speed_t; 110 111 #define NCCS 32 112 struct termios { 113 tcflag_t c_iflag; 114 tcflag_t c_oflag; 115 tcflag_t c_cflag; 116 tcflag_t c_lflag; 117 char c_line; 118 cc_t c_cc[NCCS]; 119 speed_t c_ispeed; 120 speed_t c_ospeed; 121 }; 122 123 #include <sys/cdefs.h> 124 125 __BEGIN_DECLS 126 127 speed_t cfgetispeed(const struct termios* termios_p); 128 speed_t cfgetospeed(const struct termios* termios_p); 129 int cfsetispeed(struct termios* termios_p, speed_t speed); 130 int cfsetospeed(struct termios* termios_p, speed_t speed); 131 int cfsetspeed(struct termios* termios_p, speed_t speed); 132 133 int tcdrain(int fd); 134 int tcflow(int fd, int action); 135 int tcflush(int fd, int queue_selector); 136 int tcgetattr(int fd, struct termios* termios_p); 137 int tcsendbreak(int fd, int duration); 138 int tcsetattr(int fd, int optional_actions, const struct termios* termios_p); 139 140 __END_DECLS 141 142 #endif /* LIBRARIES_NACL_IO_INCLUDE_SYS_TERMIOS_H_ */ 143