source: branches/libc-0.6/src/emx/include/sys/termios.h

Last change on this file was 3809, checked in by bird, 11 years ago

0.6: s/const/const/g - just use the (now) standard 'const' everywhere in emx and kLIBC code. Avoid changing external code too much. fixes #279.

  • Property cvs2svn:cvs-rev set to 1.3
  • Property svn:eol-style set to native
  • Property svn:executable set to *
  • Property svn:keywords set to Author Date Id Revision
File size: 3.7 KB
Line 
1/* $Id: termios.h 3809 2014-02-16 20:20:59Z bird $ */
2/** @file
3 * EMX.
4 */
5
6#ifndef _SYS_TERMIOS_H_
7#define _SYS_TERMIOS_H_
8
9#include <sys/cdefs.h>
10
11
12/* tcsetattr() */
13
14#define TCSANOW 0
15#define TCSADRAIN 1
16#define TCSAFLUSH 2
17
18/* tcflush() */
19
20#define TCIFLUSH 0
21#define TCOFLUSH 1
22#define TCIOFLUSH 2
23
24/* tcflow() */
25
26#define TCOOFF 0
27#define TCOON 1
28#define TCIOFF 2
29#define TCION 3
30
31/* c_cc indexes */
32
33#if !defined (VINTR) /* Symbols common to termio.h and termios.h */
34#define VINTR 0
35#define VQUIT 1
36#define VERASE 2
37#define VKILL 3
38#define VEOF 4
39#define VEOL 5
40#define VMIN 6
41#define VTIME 7
42#endif
43#define VSUSP 8
44#define VSTOP 9
45#define VSTART 10
46
47#define NCCS 11 /* Number of the above */
48
49/* c_iflag, emx ignores most of the following bits */
50
51#if !defined (IGNBRK) /* Symbols common to termio.h and termios.h */
52#define IGNBRK 0x0001
53#define BRKINT 0x0002
54#define IGNPAR 0x0004
55#define PARMRK 0x0008
56#define INPCK 0x0010
57#define ISTRIP 0x0020
58#define INLCR 0x0040
59#define IGNCR 0x0080
60#define ICRNL 0x0100
61#define IXON 0x0400
62#define IXOFF 0x1000
63#if !defined (_POSIX_SOURCE)
64#define IUCLC 0x0200 /* Extension */
65#define IXANY 0x0800 /* Extension */
66#define IDELETE 0x8000 /* Extension (emx) */
67#endif
68#endif
69
70/* c_oflag, emx ignores all of the following bits */
71
72#if !defined (OPOST) /* Symbols common to termio.h and termios.h */
73#define OPOST 0x0001
74#endif
75
76/* c_cflag, emx ignores all of the following bits */
77
78#if !defined (B0) /* Symbols common to termio.h and termios.h */
79#define B0 0x0000
80#define B50 0x0001
81#define B75 0x0002
82#define B110 0x0003
83#define B134 0x0004
84#define B150 0x0005
85#define B200 0x0006
86#define B300 0x0007
87#define B600 0x0008
88#define B1200 0x0009
89#define B1800 0x000a
90#define B2400 0x000b
91#define B4800 0x000c
92#define B9600 0x000d
93#define B19200 0x000e
94#define B38400 0x000f
95#define CSIZE 0x0030 /* Mask */
96#define CS5 0x0000
97#define CS6 0x0010
98#define CS7 0x0020
99#define CS8 0x0030
100#define CSTOPB 0x0040
101#define CREAD 0x0080
102#define PARENB 0x0100
103#define PARODD 0x0200
104#define HUPCL 0x0400
105#define CLOCAL 0x0800
106#if !defined (_POSIX_SOURCE)
107#define LOBLK 0x1000 /* Extension */
108#endif
109#endif
110
111/* c_lflag, emx ignores some of the following bits */
112
113#if !defined (ISIG) /* Symbols common to termio.h and termios.h */
114#define ISIG 0x0001
115#define ICANON 0x0002
116#define ECHO 0x0008
117#define ECHOE 0x0010
118#define ECHOK 0x0020
119#define ECHONL 0x0040
120#define NOFLSH 0x0080
121#if !defined (_POSIX_SOURCE)
122#define XCASE 0x0004 /* Extension */
123#endif
124#endif
125#define IEXTEN 0x0100
126#define TOSTOP 0x0200
127
128
129typedef unsigned char cc_t;
130typedef unsigned int tcflag_t;
131typedef unsigned int speed_t;
132
133struct termios
134{
135 tcflag_t c_iflag;
136 tcflag_t c_oflag;
137 tcflag_t c_cflag;
138 tcflag_t c_lflag;
139 cc_t c_cc[NCCS];
140 int c_reserved[4];
141};
142
143__BEGIN_DECLS
144speed_t cfgetispeed (const struct termios *);
145speed_t cfgetospeed (const struct termios *);
146int cfsetispeed (struct termios *, speed_t);
147int cfsetospeed (struct termios *, speed_t);
148int tcdrain (int);
149int tcflow (int, int);
150int tcflush (int, int);
151int tcgetattr (int, struct termios *);
152int tcsendbreak (int, int);
153int tcsetattr (int, int, const struct termios *);
154
155#ifndef _POSIX_SOURCE
156int cfsetspeed (struct termios *, speed_t);
157#endif /* !_POSIX_SOURCE */
158__END_DECLS
159
160#endif /* not _SYS_TERMIOS_H_ */
Note: See TracBrowser for help on using the repository browser.