|
|
1.1 root 1: /* (-lgl
2: * COHERENT Version 4.0
3: * Copyright 1993 by Mark Williams Company.
4: * All rights reserved. May not be copied without permission.
5: *
6: * 91/10/17 - Adapt for 386 COHERENT.
7: *
8: -lgl) */
9: /*
10: * /usr/include/termio.h
11: *
12: * Line discipline support.
13: *
14: * Revised Tue Mar 23 14:23:58 1993 CST
15: */
16: #ifndef __TERMIO_H__
17: #define __TERMIO_H__
18:
19: #if (defined _I386 || defined KERNEL)
20: #define _COH_TERMIO
21: #endif
22:
23: /*
24: * WARNING: termio.h command codes are incompatible with device drivers
25: * shipped with COHERENT 286; sgtty.h command codes are used instead. This
26: * header is for use principally with COHERENT 386. If you are using custom
27: * drivers and line discipline with COHERENT 286 and need termio constants
28: * for these modules, then define _COH_TERMIO before this file is included.
29: */
30: #ifdef _COH_TERMIO
31:
32: /*
33: * Terminal Input/Output Parameters
34: */
35:
36: #define NCC 8
37:
38: struct termio {
39: unsigned short c_iflag; /* input modes */
40: unsigned short c_oflag; /* output modes */
41: unsigned short c_cflag; /* control modes */
42: unsigned short c_lflag; /* local modes */
43: char c_line; /* line discipline */
44: unsigned char c_cc[NCC]; /* control chars */
45: };
46:
47: /*
48: * Basic Terminal Input Control: c_iflag
49: */
50: #define IGNBRK 0x0001 /* Ignore break condition */
51: #define BRKINT 0x0002 /* Signal interrupt on break */
52: #define IGNPAR 0x0004 /* Ignore characters with parity errors */
53: #define PARMRK 0x0008 /* Mark parity errors */
54: #define INPCK 0x0010 /* Enable input parity check */
55: #define ISTRIP 0x0020 /* Strip character */
56: #define INLCR 0x0040 /* Map NL to CR on input */
57: #define IGNCR 0x0080 /* Ignore CR */
58: #define ICRNL 0x0100 /* Map CR to NL on input */
59: #define IUCLC 0x0200 /* Map upper-case to lower-case on input */
60: #define IXON 0x0400 /* Enable start/stop output control */
61: #define IXANY 0x0800 /* Enable any character to restart output */
62: #define IXOFF 0x1000 /* Enable start/stop input control */
63:
64: /*
65: * Basic Terminal Output Control: c_oflag
66: */
67: #define OPOST 0x0001 /* Postprocess output */
68: #define OLCUC 0x0002 /* Map lower case to upper on output */
69: #define ONLCR 0x0004 /* Map NL to CR-NL on output */
70: #define OCRNL 0x0008 /* Map CR to NL on output */
71: #define ONOCR 0x0010 /* No CR output at column 0 */
72: #define ONLRET 0x0020 /* NL performs CR function */
73: #define OFILL 0x0040 /* Use fill characters for delay */
74: #define OFDEL 0x0080 /* Fill is DEL, else NUL */
75: #define NLDLY 0x0100 /* Select new-line delays: */
76: #define NL0 0x0000
77: #define NL1 0x0100
78: #define CRDLY 0x0600 /* Select carriage-return delays: */
79: #define CR0 0x0000
80: #define CR1 0x0200
81: #define CR2 0x0400
82: #define CR3 0x0600
83: #define TABDLY 0x1800 /* Select horizontal-tab delays: */
84: #define TAB0 0x0000
85: #define TAB1 0x0800
86: #define TAB2 0x1000
87: #define TAB3 0x1800
88: #define BSDLY 0x2000 /* Select backspace delays: */
89: #define BS0 0x0000
90: #define BS1 0x2000
91: #define VTDLY 0x4000 /* Select vertical-tab delays: */
92: #define VT0 0x0000
93: #define VT1 0x4000
94: #define FFDLY 0x8000 /* Select form-feed delays: */
95: #define FF0 0x0000
96: #define FF1 0x8000
97:
98: /*
99: * Terminal Hardware Control: c_cflag
100: */
101: #define CBAUD 0x000F /* Baud rate: */
102: #define B0 0 /* Hang up */
103: #define B50 1 /* 50 baud */
104: #define B75 2 /* 75 baud */
105: #define B110 3 /* 110 baud */
106: #define B134 4 /* 134.5 baud */
107: #define B150 5 /* 150 baud */
108: #define B200 6 /* 200 baud */
109: #define B300 7 /* 300 baud */
110: #define B600 8 /* 600 baud */
111: #define B1200 9 /* 1200 baud */
112: #define B1800 10 /* 1800 baud */
113: #define B2400 11 /* 2400 baud */
114: #define B4800 12 /* 4800 baud */
115: #define B9600 13 /* 9600 baud */
116: #define B19200 14 /* 19200 baud */
117: #define B38400 15 /* 38400 baud */
118: #define EXTA 14 /* External A */
119: #define EXTB 15 /* External B */
120: #define CSIZE 0x0030 /* Character size: */
121: #define CS5 0x0000 /* 5 bits */
122: #define CS6 0x0010 /* 6 bits */
123: #define CS7 0x0020 /* 7 bits */
124: #define CS8 0x0030 /* 8 bits */
125: #define CSTOPB 0x0040 /* Send two stop bits, else one */
126: #define CREAD 0x0080 /* Enable receiver */
127: #define PARENB 0x0100 /* Parity enable */
128: #define PARODD 0x0200 /* Odd parity, else even */
129: #define HUPCL 0x0400 /* Hang up on last close */
130: #define CLOCAL 0x0800 /* Local line, else dial-up */
131:
132: /*
133: * Terminal Functions - c_lflag
134: */
135: #define ISIG 0x0001 /* Enable signals */
136: #define ICANON 0x0002 /* Canonical input (erase and kill) */
137: #define XCASE 0x0004 /* Canonical upper/lower presentation */
138: #define ECHO 0x0008 /* Enable echo */
139: #define ECHOE 0x0010 /* Echo erase character as BS-SP-BS */
140: #define ECHOK 0x0020 /* Echo NL after kill character */
141: #define ECHONL 0x0040 /* Echo NL */
142: #define NOFLSH 0x0080 /* Disable flush after interrupt or quit */
143:
144: /*
145: * Offsets into Control Characters
146: */
147: #define VINTR 0
148: #define VQUIT 1
149: #define VERASE 2
150: #define VKILL 3
151: #define VEOF 4
152: #define VEOL 5
153: #define VEOL2 6
154: #define VMIN 4
155: #define VTIME 5
156: #define VSWTCH 6
157:
158: /*
159: * Character Constants
160: */
161: #define CEOF 0x04 /* EOT (ctrl-D) */
162: #define CERASE 0x08 /* BS (backspace) */
163: #define CESC 0x1B /* ESC (escape) */
164: #define CKILL 0x15 /* ACK (ctrl-U) */
165: #define CQUIT 0x1C /* FS (ctrl-\) */
166: #define CSTART 0x11 /* DC1 (ctrl-Q) */
167: #define CSTOP 0x13 /* DC3 (ctrl-S) */
168: #define CSWTCH 0x1A /* EOT (ctrl-Z) */
169:
170: /*
171: * Ioctl Commands - ioctl(fno, com, &termio)
172: */
173:
174: #define TIOC ('T'<<8)
175: #define TCGETA (TIOC|1) /* Get terminal parameters */
176: #define TCSETA (TIOC|2) /* Set terminal parameters */
177: #define TCSETAW (TIOC|3) /* Wait for drain, then set parameters */
178: #define TCSETAF (TIOC|4) /* Wait for drain, flush input, set parms */
179:
180: /*
181: * Ioctl Commands - ioctl(fno, com, arg)
182: */
183: #define TCSBRK (TIOC|5) /* Send 0.25 second break */
184: #define TCXONC (TIOC|6) /* Start/stop control
185: arg=0 -> suspend output
186: arg=1 -> restart suspended output
187: */
188: #define TCFLSH (TIOC|7) /* arg=0 -> flush input queue
189: arg=1 -> flush output queue
190: arg=2 -> flush both input and output queues
191: */
192:
193: #if !(_POSIX_SOURCE)
194:
195: #define TIOCGWINSZ (TIOC | 104)
196: #define TIOCSWINSZ (TIOC | 103)
197:
198: struct winsize {
199: unsigned short ws_row; /* characters per row */
200: unsigned short ws_col; /* characters per column */
201: unsigned short ws_xpixel; /* pixels per row */
202: unsigned short ws_ypixel; /* pixels per column */
203: };
204:
205: #endif
206:
207: #endif _COH_TERMIO
208: #endif __TERMIO_H__
This archive runs on limited infrastructure. Preserving old code on modern bandwidth. Automated agents are requested to crawl responsibly.