|
|
1.1 root 1: /* (-lgl
2: * COHERENT Version 3.2
3: * Copyright (c) 1982, 1991 by Mark Williams Company.
4: * All rights reserved. May not be copied without permission.
5: -lgl) */
6: /*
7: * Terminal ioctl.
8: * This is an ibm-pc special case file, many of these ioctls apply
9: * only to the pc console and pc asynchronous ports.
10: */
11:
12: #ifndef SGTTY_H
13: #define SGTTY_H SGTTY_H
14:
15: #include <sys/types.h>
16:
17: /*
18: * Ioctl functions.
19: */
20: #define TIOCSETP 0100 /* Terminal set modes (old stty) */
21: #define TIOCGETP 0101 /* Terminal get modes (old gtty) */
22: #define TIOCSETC 0102 /* Set characters */
23: #define TIOCGETC 0103 /* Get characters */
24: #define TIOCSETN 0104 /* Set modes w/o delay or out flush */
25: #define TIOCEXCL 0105 /* Set exclusive use */
26: #define TIOCNXCL 0106 /* Set non-exclusive use */
27: #define TIOCHPCL 0107 /* Hang up on last close */
28: #define TIOCCHPCL 0111 /* Don't hang up on last close */
29: #define TIOCFLUSH 0110 /* Flush characters in I/O queues */
30: #define TIOCGETTF 0112 /* Get tty flag word */
31: #define TIOCBREAD 0113 /* Blocking read in CBREAK/RAW mode */
32: #define TIOCCBREAD 0114 /* Turn off TIOCBREAD */
33: #define TIOCSHIFT 0115 /* Switch console left-SHIFT & "\" */
34: #define TIOCCSHIFT 0116 /* Normal console left-SHIFT & "\" */
35:
36: #define TIOCQUERY 0120 /* No. of chars waiting for read */
37:
38: #define TIOCGETF 0200 /* Get function keys (dev. dep.) */
39: #define TIOCSETF 0201 /* Set function keys (dev. dep.) */
40: #define TIOCGETKBT 0202 /* Get keyboard table (dev. dep.) */
41: #define TIOCSETKBT 0203 /* Set keyboard table (dev. dep.) */
42:
43: /* misc. functions */
44:
45: #define TIOCSDTR 0301 /* Set DTR */
46: #define TIOCCDTR 0302 /* Clear DTR */
47: #define TIOCSRTS 0303 /* Set RTS */
48: #define TIOCCRTS 0304 /* Clear RTS */
49: #define TIOCSBRK 0305 /* Set BREAK */
50: #define TIOCCBRK 0306 /* Clear BREAK */
51:
52: #define TIOCRSPEED 0320 /* Set "raw" line I/O speed divisor */
53: #define TIOCWORDL 0321 /* Set line word length and stop bits */
54:
55: #define TIOCRMSR 0400 /* Get CTS/DSR/RI/RLSD (MSR) */
56:
57: #define TIOVGETB 0500 /* Read video memory */
58: #define TIOVPUTB 0501 /* Write video memory */
59:
60: /*
61: * Bits for TIOCRMSR.
62: */
63:
64: #define MSRCTS 1 /* Clear to Send */
65: #define MSRDSR 2 /* Data Set Ready */
66: #define MSRRI 4 /* Ring Indicator */
67: #define MSRRLSD 8 /* Received Line Signal Detect */
68:
69: /*
70: * Attribute masks for TIOVPUTB - attributes occupy odd addresses
71: * in video memory.
72: */
73: #define VNORM 0x07 /* Ordinary Video */
74: #define VINTE 0x08 /* Intense video */
75: #define VBLIN 0x80 /* Blinking video */
76: #define VREVE 0x70 /* Reverse video */
77: #define VUNDE 0x01 /* Underline video (mono board) */
78:
79: /*
80: * Compatibility with gtty and stty.
81: */
82: #define stty(u,v) ioctl(u,TIOCSETP,v)
83: #define gtty(u,v) ioctl(u,TIOCGETP,v)
84:
85: /*
86: * Structure for TIOCSETP/TIOCGETP
87: */
88: struct sgttyb {
89: char sg_ispeed; /* Input speed */
90: char sg_ospeed; /* Output speed */
91: char sg_erase; /* Character erase */
92: char sg_kill; /* Line kill character */
93: int sg_flags; /* Flags */
94: };
95:
96: /*
97: * Structure for TIOCSETC/TIOCGETC
98: */
99: struct tchars {
100: char t_intrc; /* Interrupt */
101: char t_quitc; /* Quit */
102: char t_startc; /* Start output */
103: char t_stopc; /* Stop output */
104: char t_eofc; /* End of file */
105: char t_brkc; /* Input delimiter */
106: };
107:
108: /*
109: * Structure for TIOVGETB/TIOVPUTB
110: */
111: struct vidctl {
112: int v_position; /* Position in video memory */
113: int v_count; /* Number of characters to transfer */
114: char *v_buffer; /* Character buffer to read/write */
115: };
116:
117: /*
118: * Overlying structure for ioctl.
119: */
120: union ioctl {
121: struct sgttyb io_sgttyb;
122: struct tchars io_tchars;
123: struct vidctl io_vidctl;
124: };
125:
126: /*
127: * Bits from old stty/gtty modes.
128: */
129: #define EVENP 01 /* Allow even parity */
130: #define ODDP 02 /* Allow odd parity */
131: #define CRMOD 04 /* Map '\r' to '\n' */
132: #define ECHO 010 /* Echo input characters */
133: #define LCASE 020 /* Lowercase mapping on input */
134: #define CBREAK 040 /* Each input character causes wakeup */
135: #define RAWIN 0100 /* 8-bit input raw */
136: #define RAWOUT 0200 /* 8-bit output raw */
137: #define TANDEM 0400 /* flow control protocol */
138: #define XTABS 01000 /* Expand tabs to spaces */
139: #define CRT 02000 /* CRT character erase */
140:
141: /*
142: * Compatibility.
143: */
144: #define RAW (RAWIN|RAWOUT) /* Raw mode */
145:
146: /*
147: * Names for terminal speeds.
148: */
149: #define B0 0 /* Hangup if modem control enabled */
150: #define B50 1 /* 50 bps */
151: #define B75 2 /* 75 bps */
152: #define B110 3 /* 110 bps */
153: #define B134 4 /* 134.5 bps (IBM 2741) */
154: #define B150 5 /* 150 bps */
155: #define B200 6 /* 200 bps */
156: #define B300 7 /* 300 bps */
157: #define B600 8 /* 600 bps */
158: #define B1200 9 /* 1200 bps */
159: #define B1800 10 /* 1800 bps */
160: #define B2000 11 /* 2000 bps */
161: #define B2400 12 /* 2400 bps */
162: #define B3600 13 /* 3600 bps */
163: #define B4800 14 /* 4800 bps */
164: #define B7200 15 /* 7200 bps */
165: #define B9600 16 /* 9600 bps */
166: #define B19200 17 /* 19200 bps */
167: #define EXTA 18 /* External A (DH-11) */
168: #define EXTB 19 /* External B (DH-11) */
169:
170: #endif
This archive runs on limited infrastructure. Preserving old code on modern bandwidth. Automated agents are requested to crawl responsibly.