|
|
1.1 root 1: /*++
2:
3: Copyright (c) 1991 Microsoft Corporation
4:
5: Module Name:
6:
7: termios.h
8:
9: Abstract:
10:
11: This module contains the primitive system data types described in section
12: 7.1.2.1 of IEEE P1003.1-1990
13:
14: --*/
15:
16: #ifndef _TERMIOS_
17: #define _TERMIOS_
18:
19: #include <sys/types.h>
20:
1.1.1.2 ! root 21: #ifdef __cplusplus
! 22: extern "C" {
! 23: #endif
! 24:
1.1 root 25: typedef unsigned long cc_t;
26: typedef unsigned long speed_t;
27: typedef unsigned long tcflag_t;
28:
1.1.1.2 ! root 29: #define NCCS 11
1.1 root 30:
31: struct termios {
32: tcflag_t c_iflag; /* input modes */
33: tcflag_t c_oflag; /* output modes */
34: tcflag_t c_cflag; /* control modes */
35: tcflag_t c_lflag; /* local modes */
1.1.1.2 ! root 36: speed_t c_ispeed; /* input speed */
! 37: speed_t c_ospeed; /* output speed */
1.1 root 38: cc_t c_cc[NCCS]; /* control characters */
39: };
40:
41: /*
42: * Input modes, for c_iflag member
43: */
44:
45: #define BRKINT 0x00000001 /* signal interrupt on break */
46: #define ICRNL 0x00000002 /* map CR to NL on input */
47: #define IGNBRK 0x00000004 /* ignore break condition */
48: #define IGNCR 0x00000008 /* ignore CR */
49: #define IGNPAR 0x00000010 /* ignore characters with parity errors */
50: #define INLCR 0x00000020 /* map NL to CR on input */
51: #define INPCK 0x00000040 /* Enable input parity check */
52: #define ISTRIP 0x00000080 /* strip character */
53: #define IXOFF 0x00000100 /* enable start/stop input control */
54: #define IXON 0x00000200 /* enable start/stop output control */
55: #define PARMRK 0x00000400 /* mark parity errors */
56:
57: /*
58: * Output modes, for c_oflag member
59: */
60:
61: #define OPOST 0x00000001 /* perform output processing */
1.1.1.2 ! root 62: #define ONLCR 0x00000002 /* map NL to ASCII CR-NL on output */
! 63: #define ONLRET 0x00000004 /* NL performs ASCII CR function */
! 64: #define OCRNL 0x00000008 /* map ASCII CR to NL on output */
! 65: #define ONOCR 0x00000010 /* No ASCII CR output at column 0. */
1.1 root 66:
67: /*
68: * Control modes, for c_cflag member
69: */
70:
71: #define CLOCAL 0x00000001 /* ignore modem status lines */
72: #define CREAD 0x00000002 /* enable receiver */
73: #define CSIZE 0x000000F0 /* number of bits per byte */
74: #define CS5 0x00000010 /* 5 bits */
75: #define CS6 0x00000020 /* 6 bits */
76: #define CS7 0x00000040 /* 7 bits */
77: #define CS8 0x00000080 /* 8 bits */
78: #define CSTOPB 0x00000100 /* send two stop bits, else one */
79: #define HUPCL 0x00000200 /* hang up on last close */
80: #define PARENB 0x00000400 /* parity enable */
81: #define PARODD 0x00000800 /* odd parity, else even */
82:
83: /*
84: * Local modes, for c_lflag member
85: */
86:
87: #define ECHO 0x00000001 /* enable echo */
88: #define ECHOE 0x00000002 /* echo ERASE as an error-correcting backspace */
89: #define ECHOK 0x00000004 /* echo KILL */
90: #define ECHONL 0x00000008 /* echo '\n' */
91: #define ICANON 0x00000010 /* canonical input (erase and kill processing) */
92: #define IEXTEN 0x00000020 /* enable extended functions */
93: #define ISIG 0x00000040 /* enable signals */
94: #define NOFLSH 0x00000080 /* disable flush after intr, quit, or suspend */
95: #define TOSTOP 0x00000100 /* send SIGTTOU for background output */
96:
97: /*
98: * Indices into c_cc array
99: */
100:
101: #define VEOF 0 /* EOF character */
102: #define VEOL 1 /* EOL character */
103: #define VERASE 2 /* ERASE character */
104: #define VINTR 3 /* INTR character */
105: #define VKILL 4 /* KILL character */
1.1.1.2 ! root 106: #define VMIN 5 /* MIN value */
! 107: #define VQUIT 6 /* QUIT character */
! 108: #define VSUSP 7 /* SUSP character */
! 109: #define VTIME 8 /* TIME value */
! 110: #define VSTART 9 /* START character */
! 111: #define VSTOP 10 /* STOP character */
1.1 root 112:
113: /*
114: * Values for speed_t's
115: */
116:
117: #define B0 0
118: #define B50 1
119: #define B75 2
120: #define B110 3
121: #define B134 4
122: #define B150 5
123: #define B200 6
124: #define B300 7
125: #define B600 8
126: #define B1200 9
127: #define B1800 10
128: #define B2400 11
129: #define B4800 12
130: #define B9600 13
131: #define B19200 14
132: #define B38400 15
133:
134: /*
135: * Optional actions for tcsetattr()
136: */
137: #define TCSANOW 1
138: #define TCSADRAIN 2
139: #define TCSAFLUSH 3
140:
141: /*
142: * Queue selectors for tcflush()
143: */
144:
145: #define TCIFLUSH 0
146: #define TCOFLUSH 1
147: #define TCIOFLUSH 2
148:
149: /*
150: * Actions for tcflow()
151: */
152:
153: #define TCOOFF 0
154: #define TCOON 1
155: #define TCIOFF 2
156: #define TCION 3
157:
158:
159: int _CRTAPI1 tcgetattr(int, struct termios *);
160: int _CRTAPI1 tcsetattr(int, int, const struct termios *);
161: int _CRTAPI1 tcsendbreak(int, int);
162: int _CRTAPI1 tcdrain(int);
163: int _CRTAPI1 tcflush(int, int);
164: int _CRTAPI1 tcflow(int, int);
165:
166: pid_t _CRTAPI1 tcgetpgrp(int);
167: int _CRTAPI1 tcsetpgrp(int, pid_t);
168:
169: speed_t _CRTAPI1 cfgetospeed(const struct termios *);
170: int _CRTAPI1 cfsetospeed(struct termios *, speed_t);
171: speed_t _CRTAPI1 cfgetispeed(const struct termios *);
172: int _CRTAPI1 cfsetispeed(struct termios *, speed_t);
173:
1.1.1.2 ! root 174: #ifdef __cplusplus
! 175: }
! 176: #endif
! 177:
1.1 root 178: #endif /* _TERMIOS_ */
This archive runs on limited infrastructure. Preserving old code on modern bandwidth. Automated agents are requested to crawl responsibly.