termios.h: Put some non-standard fields in a private struct.
[AROS.git] / compiler / clib / include / termios.h
blobc346420b7b36850fdc7bd754990ae2e5aafde16b
1 #ifndef _TERMIOS_H
2 #define _TERMIOS_H 1
4 /*
5 * Copyright © 1995-2012, The AROS Development Team. All rights reserved.
6 * $Id$
8 * POSIX.1-2008 header file <termios.h>
9 */
11 /* FIXME: Are these OK ? */
12 typedef unsigned char cc_t;
13 typedef unsigned int speed_t;
14 typedef unsigned int tcflag_t;
16 #define NCCS 32
17 struct termios {
18 tcflag_t c_iflag; /* input mode flags */
19 tcflag_t c_oflag; /* output mode flags */
20 tcflag_t c_cflag; /* control mode flags */
21 tcflag_t c_lflag; /* local mode flags */
22 cc_t c_cc[NCCS]; /* control characters */
23 char internal[64]; /* Private */
26 /* c_cc characters */
27 #define VINTR 0
28 #define VQUIT 1
29 #define VERASE 2
30 #define VKILL 3
31 #define VEOF 4
32 #define VTIME 5
33 #define VMIN 6
34 #define VSWTC 7
35 #define VSTART 8
36 #define VSTOP 9
37 #define VSUSP 10
38 #define VEOL 11
39 #define VREPRINT 12
40 #define VDISCARD 13
41 #define VWERASE 14
42 #define VLNEXT 15
43 #define VEOL2 16
45 /* c_iflag bits */
46 #define IGNBRK 0000001
47 #define BRKINT 0000002
48 #define IGNPAR 0000004
49 #define PARMRK 0000010
50 #define INPCK 0000020
51 #define ISTRIP 0000040
52 #define INLCR 0000100
53 #define IGNCR 0000200
54 #define ICRNL 0000400
55 #define IUCLC 0001000
56 #define IXON 0002000
57 #define IXANY 0004000
58 #define IXOFF 0010000
59 #define IMAXBEL 0020000
60 #define IUTF8 0040000
62 /* c_oflag bits */
63 #define OPOST 0000001
64 #define OLCUC 0000002
65 #define ONLCR 0000004
66 #define OCRNL 0000010
67 #define ONOCR 0000020
68 #define ONLRET 0000040
69 #define OFILL 0000100
70 #define OFDEL 0000200
72 /* c_cflag bit meaning */
73 #define B0 0000000 /* hang up */
74 #define B50 0000001
75 #define B75 0000002
76 #define B110 0000003
77 #define B134 0000004
78 #define B150 0000005
79 #define B200 0000006
80 #define B300 0000007
81 #define B600 0000010
82 #define B1200 0000011
83 #define B1800 0000012
84 #define B2400 0000013
85 #define B4800 0000014
86 #define B9600 0000015
87 #define B19200 0000016
88 #define B38400 0000017
89 #define CSIZE 0000060
90 #define CS5 0000000
91 #define CS6 0000020
92 #define CS7 0000040
93 #define CS8 0000060
94 #define CSTOPB 0000100
95 #define CREAD 0000200
96 #define PARENB 0000400
97 #define PARODD 0001000
98 #define HUPCL 0002000
99 #define CLOCAL 0004000
100 #define B57600 0010001
101 #define B115200 0010002
103 /* c_lflag bits */
104 #define ISIG 0000001
105 #define ICANON 0000002
106 #define ECHO 0000010
107 #define ECHOE 0000020
108 #define ECHOK 0000040
109 #define ECHONL 0000100
110 #define NOFLSH 0000200
111 #define TOSTOP 0000400
112 #define IEXTEN 0100000
114 /* tcflow() and TCXONC use these */
115 #define TCOOFF 0
116 #define TCOON 1
117 #define TCIOFF 2
118 #define TCION 3
120 /* tcflush() and TCFLSH use these */
121 #define TCIFLUSH 0
122 #define TCOFLUSH 1
123 #define TCIOFLUSH 2
125 /* tcsetattr uses these */
126 #define TCSANOW 0
127 #define TCSADRAIN 1
128 #define TCSAFLUSH 2
130 extern int tcgetattr(int __fd, struct termios *__termios_p);
131 extern int tcsetattr(int __fd, int __optional_actions,
132 const struct termios *__termios_p);
134 extern speed_t cfgetispeed(const struct termios *__termios_p);
135 extern speed_t cfgetospeed(const struct termios *__termios_p);
137 extern int cfsetispeed(struct termios *__termios_p, speed_t __speed);
138 extern int cfsetospeed(struct termios *__termios_p, speed_t __speed);
140 #endif