1 /* Begin include file termio.h */
  2 /* @(#)termio.h     6.2 */
  3 
  4 /* MODIFICATIONS */
  5 /* TIOC changed to 0 from T<<8 by Doug Howe for Multics */
  6 
  7 
  8 #define   NCC       8
  9 
 10 /* control characters */
 11 #define   VINTR     0
 12 #define   VQUIT     1
 13 #define   VERASE    2
 14 #define   VKILL     3
 15 #define   VEOF      4
 16 #define   VEOL      5
 17 #define   VEOL2     6
 18 #define   VMIN      4
 19 #define   VTIME     5
 20 #define   VSWTCH    7
 21 
 22 #define   CNUL      0
 23 #define   CDEL      0377
 24 /* default control chars */
 25 #define   CESC      '\\'
 26 #define   CINTR     0177      /* DEL */
 27 #define   CQUIT     034       /* FS, cntl | */
 28 #define   CERASE    '#'
 29 #define   CKILL     '@'
 30 #define   CEOF      04        /* cntl d */
 31 #define   CSTART    021       /* cntl q */
 32 #define   CSTOP     023       /* cntl s */
 33 #define   CSWTCH    032       /* cntl z */
 34 #define   CNSWTCH   0
 35 
 36 
 37 /* input modes */
 38 #define   IGNBRK    0000001
 39 #define   BRKINT    0000002
 40 #define   IGNPAR    0000004
 41 #define   PARMRK    0000010
 42 #define   INPCK     0000020
 43 #define   ISTRIP    0000040
 44 #define   INLCR     0000100
 45 #define   IGNCR     0000200
 46 #define   ICRNL     0000400
 47 #define   IUCLC     0001000
 48 #define   IXON      0002000
 49 #define   IXANY     0004000
 50 #define   IXOFF     0010000
 51 
 52 /* output modes */
 53 #define   OPOST     0000001
 54 #define   OLCUC     0000002
 55 #define   ONLCR     0000004
 56 #define   OCRNL     0000010
 57 #define   ONOCR     0000020
 58 #define   ONLRET    0000040
 59 #define   OFILL     0000100
 60 #define   OFDEL     0000200
 61 #define   NLDLY     0000400
 62 #define   NL0       0
 63 #define   NL1       0000400
 64 #define   CRDLY     0003000
 65 #define   CR0       0
 66 #define   CR1       0001000
 67 #define   CR2       0002000
 68 #define   CR3       0003000
 69 #define   TABDLY    0014000
 70 #define   TAB0      0
 71 #define   TAB1      0004000
 72 #define   TAB2      0010000
 73 #define   TAB3      0014000
 74 #define   BSDLY     0020000
 75 #define   BS0       0
 76 #define   BS1       0020000
 77 #define   VTDLY     0040000
 78 #define   VT0       0
 79 #define   VT1       0040000
 80 #define   FFDLY     0100000
 81 #define   FF0       0
 82 #define   FF1       0100000
 83 
 84 /* control modes */
 85 #define   CBAUD     0000017
 86 #define   B0        0
 87 #define   B50       0000001
 88 #define   B75       0000002
 89 #define   B110      0000003
 90 #define   B134      0000004
 91 #define   B150      0000005
 92 #define   B200      0000006
 93 #define   B300      0000007
 94 #define   B600      0000010
 95 #define   B1200     0000011
 96 #define   B1800     0000012
 97 #define   B2400     0000013
 98 #define   B4800     0000014
 99 #define   B9600     0000015
100 #define   EXTA      0000016
101 #define   EXTB      0000017
102 #define   CSIZE     0000060
103 #define   CS5       0
104 #define   CS6       0000020
105 #define   CS7       0000040
106 #define   CS8       0000060
107 #define   CSTOPB    0000100
108 #define   CREAD     0000200
109 #define   PARENB    0000400
110 #define   PARODD    0001000
111 #define   HUPCL     0002000
112 #define   CLOCAL    0004000
113 #define   LOBLK     0010000
114 
115 /* line discipline 0 modes */
116 #define   ISIG      0000001
117 #define   ICANON    0000002
118 #define   XCASE     0000004
119 #define   ECHO      0000010
120 #define   ECHOE     0000020
121 #define   ECHOK     0000040
122 #define   ECHONL    0000100
123 #define   NOFLSH    0000200
124 
125 #define   MULTICS_MODES 0000400
126 
127 #define   SSPEED    7         /* default speed: 300 baud */
128 
129 /*
130  * Ioctl control packet
131  */
132 struct termio {
133           int       c_iflag;  /* input modes */
134           int       c_oflag;  /* output modes */
135           int       c_cflag;  /* control modes */
136           int       c_lflag;  /* line discipline modes */
137           char      c_line;             /* line discipline */
138           unsigned char       c_cc[NCC];          /* control chars */
139 };
140 #define   IOCTYPE   0xff00
141 
142 #define   TIOC      0
143 #define   TCGETA    (TIOC|1)
144 #define   TCSETA    (TIOC|2)
145 #define   TCSETAW   (TIOC|3)
146 #define   TCSETAF   (TIOC|4)
147 #define   TCSBRK    (TIOC|5)
148 #define   TCXONC    (TIOC|6)
149 #define   TCFLSH    (TIOC|7)
150 #define   TCDSET    (TIOC|32)
151 
152 #define   FIONREAD  (TIOC|64)
153 
154 
155 #define   LDIOC     ('D'<<8)
156 #define   LDOPEN    (LDIOC|0)
157 #define   LDCLOSE   (LDIOC|1)
158 #define   LDCHG     (LDIOC|2)
159 #define   LDGETT    (LDIOC|8)
160 #define   LDSETT    (LDIOC|9)
161 
162 /*
163  * Terminal types
164  */
165 #define   TERM_NONE 0         /* tty */
166 #define   TERM_TEC  1         /* TEC Scope */
167 #define   TERM_V61  2         /* DEC VT61 */
168 #define   TERM_V10  3         /* DEC VT100 */
169 #define   TERM_TEX  4         /* Tektronix 4023 */
170 #define   TERM_D40  5         /* TTY Mod 40/1 */
171 #define   TERM_H45  6         /* Hewlitt-Packard 45 */
172 #define   TERM_D42  7         /* TTY Mod 40/2B */
173 
174 /*
175  * Terminal flags
176  */
177 #define TM_NONE               0000      /* use default flags */
178 #define TM_SNL                0001      /* special newline flag */
179 #define TM_ANL                0002      /* auto newline on column 80 */
180 #define TM_LCF                0004      /* last col of last row special */
181 #define TM_CECHO    0010      /* echo terminal cursor control */
182 #define TM_CINVIS   0020      /* do not send esc seq to user */
183 #define TM_SET                0200      /* must be on to set/res flags */
184 
185 /*
186  * structure of ioctl arg for LDGETT and LDSETT
187  */
188 struct    termcb    {
189           char      st_flgs;  /* term flags */
190           char      st_termt; /* term type */
191           char      st_crow;  /* gtty only - current row */
192           char      st_ccol;  /* gtty only - current col */
193           char      st_vrow;  /* variable row */
194           char      st_lrow;  /* last row */
195 };
196 
197 /* End include file termio.h */