comparison packages/isoinfra/current/include/termios.h @ 115:6ed91473a1cd ecos-sw-2000-08-21

Merge from eCos master repository on 2000-08-21-22:40:54-BST
author jlarmour
date Fri, 25 Aug 2000 17:32:38 +0000
parents
children e0c0827131d1
comparison
equal deleted inserted replaced
114:5ad2b71d525e 115:6ed91473a1cd
1 #ifndef CYGONCE_ISO_TERMIOS_H
2 #define CYGONCE_ISO_TERMIOS_H
3 /* ====================================================================
4 //
5 // termios.h
6 //
7 // POSIX termios
8 //
9 // ====================================================================
10 //####COPYRIGHTBEGIN####
11 //
12 // -------------------------------------------
13 // The contents of this file are subject to the Red Hat eCos Public License
14 // Version 1.1 (the "License"); you may not use this file except in
15 // compliance with the License. You may obtain a copy of the License at
16 // http://www.redhat.com/
17 //
18 // Software distributed under the License is distributed on an "AS IS"
19 // basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the
20 // License for the specific language governing rights and limitations under
21 // the License.
22 //
23 // The Original Code is eCos - Embedded Configurable Operating System,
24 // released September 30, 1998.
25 //
26 // The Initial Developer of the Original Code is Red Hat.
27 // Portions created by Red Hat are
28 // Copyright (C) 1998, 1999, 2000 Red Hat, Inc.
29 // All Rights Reserved.
30 // -------------------------------------------
31 //
32 //####COPYRIGHTEND####
33 // ====================================================================
34 //#####DESCRIPTIONBEGIN####
35 //
36 // Author(s): jlarmour
37 // Contributors:
38 // Date: 2000-07-22
39 // Purpose: POSIX termios support
40 // Description:
41 //
42 //####DESCRIPTIONEND####
43 //
44 // ==================================================================*/
45
46 #include <pkgconf/isoinfra.h>
47
48 #if CYGINT_ISO_TERMIOS
49 # ifdef CYGBLD_ISO_TERMIOS_HEADER
50 # include CYGBLD_ISO_TERMIOS_HEADER
51 # else
52
53 /* TYPES */
54
55 typedef unsigned int tcflag_t; /* terminal flags type */
56 typedef unsigned char cc_t; /* control chars type */
57 typedef unsigned int speed_t; /* baud rate type */
58
59 #define NCCS 16 /* May as well hard-code - ASCII isn't that configurable! */
60
61 struct termios {
62 tcflag_t c_iflag; /* Input mode flags */
63 tcflag_t c_oflag; /* Output mode flags */
64 tcflag_t c_cflag; /* Control mode flags */
65 tcflag_t c_lflag; /* Local mode flags */
66 cc_t c_cc[NCCS]; /* Control characters */
67 speed_t c_ispeed; /* input speed */
68 speed_t c_ospeed; /* output speed */
69 };
70
71 /* CONSTANTS */
72
73 /* Input mode flags */
74
75 #define BRKINT (1<<0)
76 #define ICRNL (1<<1)
77 #define IGNBRK (1<<2)
78 #define IGNCR (1<<3)
79 #define IGNPAR (1<<4)
80 #define INLCR (1<<5)
81 #define INPCK (1<<6)
82 #define ISTRIP (1<<7)
83 #define IXOFF (1<<8)
84 #define IXON (1<<9)
85 #define PARMRK (1<<10)
86
87 /* Output mode flags */
88
89 #define OPOST (1<<0)
90 #define ONLCR (1<<1) /* Note: This isn't POSIX */
91
92 /* Control mode flags */
93
94 #define CLOCAL (1<<0)
95 #define CREAD (1<<1)
96 #define CS5 (0)
97 #define CS6 (1<<2)
98 #define CS7 (1<<3)
99 #define CS8 (CS6|CS7)
100 #define CSIZE (CS8)
101 #define CSTOPB (1<<4)
102 #define HUPCL (1<<5)
103 #define PARENB (1<<6)
104 #define PARODD (1<<7)
105 #ifndef _POSIX_SOURCE_
106 # define CRTSCTS (1<<8)
107 #endif
108
109 /* Local mode flags */
110
111 #define ECHO (1<<0)
112 #define ECHOE (1<<1)
113 #define ECHOK (1<<2)
114 #define ECHONL (1<<3)
115 #define ICANON (1<<4)
116 #define IEXTEN (1<<5)
117 #define ISIG (1<<6)
118 #define NOFLSH (1<<7)
119 #define TOSTOP (1<<8)
120
121 /* Special control characters */
122
123 #define VEOF 0
124 #define VEOL 1
125 #define VERASE 2
126 #define VINTR 3
127 #define VKILL 4
128 #define VMIN 5
129 #define VQUIT 6
130 #define VSUSP 7
131 #define VTIME 8
132 #define VSTART 9
133 #define VSTOP 10
134
135 /* Baud rates */
136 /* There may be tables in the implementation that rely on the
137 * values here, so only append to this table - do not insert values!
138 */
139 #define B0 0
140 #define B50 1
141 #define B75 2
142 #define B110 3
143 #define B134 4
144 #define B150 5
145 #define B200 6
146 #define B300 7
147 #define B600 8
148 #define B1200 9
149 #define B1800 10
150 #define B2400 11
151 #define B3600 12
152 #define B4800 13
153 #define B7200 14
154 #define B9600 15
155 #define B14400 16
156 #define B19200 17
157 #define B38400 18
158 #define B57600 19
159 #define B115200 20
160 #define B230400 21
161 #define B460800 22
162 #define B500000 23
163 #define B576000 24
164 #define B921600 25
165 #define B1000000 26
166 #define B1152000 27
167 #define B1500000 28
168 #define B2000000 29
169 #define B2500000 30
170 #define B3000000 31
171 #define B3500000 32
172 #define B4000000 33
173
174
175 /* Optional actions to tcsetattr() */
176
177 #define TCSANOW 0
178 #define TCSADRAIN 1
179 #define TCSAFLUSH 2
180
181 /* Queue selectors for tcflush() */
182
183 #define TCIFLUSH 0
184 #define TCOFLUSH 1
185 #define TCIOFLUSH 2
186
187 /* Actions for tcflow() */
188
189 #define TCOOFF 0
190 #define TCOON 1
191 #define TCIOFF 2
192 #define TCION 3
193
194
195 /* FUNCTIONS */
196
197 #ifdef __cplusplus
198 extern "C" {
199 #endif
200
201 extern speed_t
202 cfgetospeed( const struct termios *__termios_p );
203
204 extern int
205 cfsetospeed( struct termios *__termios_p, speed_t __speed );
206
207 extern speed_t
208 cfgetispeed( const struct termios *__termios_p );
209
210 extern int
211 cfsetispeed( struct termios *__termios_p, speed_t __speed );
212
213 extern int
214 tcgetattr( int __fildes, struct termios *__termios_p );
215
216 extern int
217 tcsetattr( int __fildes, int __optact, const struct termios *__termios_p );
218
219 extern int
220 tcsendbreak( int __fildes, int __duration );
221
222 extern int
223 tcdrain( int __fildes );
224
225 extern int
226 tcflush( int __fildes, int __queue_sel );
227
228 extern int
229 tcflow( int __fildes, int __action );
230
231 /* tcgetpgrp() and tcsetpgrp() not included in the absence of job control */
232
233 #ifdef __cplusplus
234 } /* extern "C" */
235 #endif
236
237 # endif /* ifndef CYGBLD_ISO_TERMIOS_HEADER */
238 #endif /* if CYGINT_ISO_TERMIOS */
239
240
241 #endif /* ifndef CYGONCE_ISO_TERMIOS_H */
242
243 /* EOF termios.h */