home *** CD-ROM | disk | FTP | other *** search
/ Piper's Pit BBS/FTP: ibm 0010 - 0019 / ibm0010-0019 / ibm0010.tar / ibm0010 / UNIX3862.ZIP / U386-06.ZIP / U386-6.TD0 / usr / include / sys / termio.h < prev    next >
Encoding:
C/C++ Source or Header  |  1988-06-26  |  6.1 KB  |  264 lines

  1. /*    Copyright (c) 1984, 1986, 1987, 1988 AT&T    */
  2. /*      All Rights Reserved      */
  3.  
  4. /*    THIS IS UNPUBLISHED PROPRIETARY SOURCE CODE OF AT&T    */
  5. /*    The copyright notice above does not evidence any       */
  6. /*    actual or intended publication of such source code.    */
  7.  
  8. /*    Copyright (c) 1987, 1988 Microsoft Corporation    */
  9. /*      All Rights Reserved    */
  10.  
  11. /*    This Module contains Proprietary Information of Microsoft  */
  12. /*    Corporation and should be treated as Confidential.       */
  13.  
  14. #ident    "@(#)head.sys:termio.h    1.5.1.5"
  15.  
  16. #define    NCC    8
  17.  
  18. /* control characters */
  19. #define    VINTR    0
  20. #define    VQUIT    1
  21. #define    VERASE    2
  22. #define    VKILL    3
  23. #define    VEOF    4
  24. #define    VEOL    5
  25. #define    VEOL2    6
  26. #define    VMIN    4
  27. #define    VTIME    5
  28. #define    VSWTCH    7
  29.  
  30.  
  31.  
  32. /*
  33.  * control characters adopted
  34.  * form Xenix termio.h
  35.  */
  36. #define    VCEOF    NCC        /* RESERVED true EOF char (V7 compatability) */
  37. #define    VCEOL    (NCC + 1)    /* RESERVED true EOL char */
  38.  
  39.  
  40. #define    CNUL    0
  41. #define    CDEL    0377
  42.  
  43. /* default control chars */
  44. #define    CESC    '\\'
  45. #define    CINTR    0177    /* DEL */
  46. #define    CQUIT    034    /* FS, cntl | */
  47. #define    CERASE    '#'
  48. #define    CKILL    '@'
  49. #define    CEOF    04    /* cntl d */
  50. #define    CSTART    021    /* cntl q */
  51. #define    CSTOP    023    /* cntl s */
  52. #define    CSWTCH    032    /* cntl z */
  53. #define    CNSWTCH    0
  54.  
  55.  
  56. /* input modes */
  57. #define    IGNBRK    0000001
  58. #define    BRKINT    0000002
  59. #define    IGNPAR    0000004
  60. #define    PARMRK    0000010
  61. #define    INPCK    0000020
  62. #define    ISTRIP    0000040
  63. #define    INLCR    0000100
  64. #define    IGNCR    0000200
  65. #define    ICRNL    0000400
  66. #define    IUCLC    0001000
  67. #define    IXON    0002000
  68. #define    IXANY    0004000
  69. #define    IXOFF    0010000
  70. #define DOSMODE    0100000
  71.  
  72. /* output modes */
  73. #define    OPOST    0000001
  74. #define    OLCUC    0000002
  75. #define    ONLCR    0000004
  76. #define    OCRNL    0000010
  77. #define    ONOCR    0000020
  78. #define    ONLRET    0000040
  79. #define    OFILL    0000100
  80. #define    OFDEL    0000200
  81. #define    NLDLY    0000400
  82. #define    NL0    0
  83. #define    NL1    0000400
  84. #define    CRDLY    0003000
  85. #define    CR0    0
  86. #define    CR1    0001000
  87. #define    CR2    0002000
  88. #define    CR3    0003000
  89. #define    TABDLY    0014000
  90. #define    TAB0    0
  91. #define    TAB1    0004000
  92. #define    TAB2    0010000
  93. #define    TAB3    0014000
  94. #define    BSDLY    0020000
  95. #define    BS0    0
  96. #define    BS1    0020000
  97. #define    VTDLY    0040000
  98. #define    VT0    0
  99. #define    VT1    0040000
  100. #define    FFDLY    0100000
  101. #define    FF0    0
  102. #define    FF1    0100000
  103.  
  104. /* control modes */
  105. #define    CBAUD    0000017
  106. #define    B0    0
  107. #define    B50    0000001
  108. #define    B75    0000002
  109. #define    B110    0000003
  110. #define    B134    0000004
  111. #define    B150    0000005
  112. #define    B200    0000006
  113. #define    B300    0000007
  114. #define    B600    0000010
  115. #define    B1200    0000011
  116. #define    B1800    0000012
  117. #define    B2400    0000013
  118. #define    B4800    0000014
  119. #define    B9600    0000015
  120. #define    B19200    0000016
  121. #define EXTA    0000016
  122. #define    B38400    0000017
  123. #define EXTB    0000017
  124. #define    CSIZE    0000060
  125. #define    CS5    0
  126. #define    CS6    0000020
  127. #define    CS7    0000040
  128. #define    CS8    0000060
  129. #define    CSTOPB    0000100
  130. #define    CREAD    0000200
  131. #define    PARENB    0000400
  132. #define    PARODD    0001000
  133. #define    HUPCL    0002000
  134. #define    CLOCAL    0004000
  135. #define RCV1EN    0010000
  136. #define    XMT1EN    0020000
  137. #define    LOBLK    0040000
  138. #define    XCLUDE    0100000        /* *V7* exclusive use coming fron XENIX */
  139.  
  140. /* line discipline 0 modes */
  141. #define    ISIG    0000001
  142. #define    ICANON    0000002
  143. #define    XCASE    0000004
  144. #define    ECHO    0000010
  145. #define    ECHOE    0000020
  146. #define    ECHOK    0000040
  147. #define    ECHONL    0000100
  148. #define    NOFLSH    0000200
  149.  
  150. #ifndef u3b15
  151. #define    SSPEED    7    /* default speed: 300 baud */
  152. #else
  153. #define SSPEED    9    /* default speed: 1200 baud */
  154. #endif
  155.  
  156. /*
  157.  * Ioctl control packet
  158.  */
  159. struct termio {
  160.     unsigned short    c_iflag;    /* input modes */
  161.     unsigned short    c_oflag;    /* output modes */
  162.     unsigned short    c_cflag;    /* control modes */
  163.     unsigned short    c_lflag;    /* line discipline modes */
  164.     char    c_line;        /* line discipline */
  165.     unsigned char    c_cc[NCC];    /* control chars */
  166. };
  167. #define    IOCTYPE    0xff00
  168.  
  169. #define    TIOC    ('T'<<8)
  170. #define    TCGETA    (TIOC|1)
  171. #define    TCSETA    (TIOC|2)
  172. #define    TCSETAW    (TIOC|3)
  173. #define    TCSETAF    (TIOC|4)
  174. #define    TCSBRK    (TIOC|5)
  175. #define    TCXONC    (TIOC|6)
  176. #define    TCFLSH    (TIOC|7)
  177. #ifdef u3b15
  178. #define TTYTYPE (TIOC|8)
  179. #endif
  180.  
  181. #define TIOCGWINSZ    (TIOC|104)
  182. #define TIOCSWINSZ    (TIOC|103)
  183.  
  184. #define    TCDSET    (TIOC|32)
  185. #define    RTS_TOG    (TIOC|33)    /* 386 - "RTS" toggle define 8A1 protocol */
  186.  
  187. #define    LDIOC    ('D'<<8)
  188. #define    LDOPEN    (LDIOC|0)
  189. #define    LDCLOSE    (LDIOC|1)
  190. #define    LDCHG    (LDIOC|2)
  191. #define    LDGETT    (LDIOC|8)
  192. #define    LDSETT    (LDIOC|9)
  193.  
  194. /*
  195.  * Merged product XENIX ioctl extensions.
  196.  */
  197. #define    tIOC    ('t'<<8)
  198. #define TIOCGETD        (tIOC|0)                /* V7 */
  199. #define TIOCSETD        (tIOC|1)                /* V7 */
  200. #define TIOCHPCL        (tIOC|2)                /* V7 */
  201. #define TIOCSETN        (tIOC|10)               /* V7 */
  202. #define TIOCEXCL        (tIOC|13)               /* V7 */
  203. #define TIOCNXCL        (tIOC|14)               /* V7 */
  204. #define TIOCFLUSH       (tIOC|16)               /* V7 */
  205. #define TIOCSETC        (tIOC|17)               /* V7 */
  206. #define TIOCGETC        (tIOC|18)               /* V7 */
  207.  
  208. /*
  209.  * These are retained for backward compatibility.
  210.  */
  211. #define    DIOC    ('d'<<8)
  212. #define DIOCGETP        (DIOC|8)                /* V7 */
  213. #define DIOCSETP        (DIOC|9)                /* V7 */
  214.  
  215. /*
  216.  * Returns a non-zero value if there
  217.  * are characters in the input queue.
  218.  */
  219. #define FIORDCHK        (('f'<<8)|3)            /* V7 */
  220.  
  221. /*
  222.  * Terminal types
  223.  */
  224. #define    TERM_NONE    0    /* tty */
  225. #define    TERM_TEC    1    /* TEC Scope */
  226. #define    TERM_V61    2    /* DEC VT61 */
  227. #define    TERM_V10    3    /* DEC VT100 */
  228. #define    TERM_TEX    4    /* Tektronix 4023 */
  229. #define    TERM_D40    5    /* TTY Mod 40/1 */
  230. #define    TERM_H45    6    /* Hewlitt-Packard 45 */
  231. #define    TERM_D42    7    /* TTY Mod 40/2B */
  232.  
  233. /*
  234.  * Terminal flags
  235.  */
  236. #define TM_NONE        0000    /* use default flags */
  237. #define TM_SNL        0001    /* special newline flag */
  238. #define TM_ANL        0002    /* auto newline on column 80 */
  239. #define TM_LCF        0004    /* last col of last row special */
  240. #define TM_CECHO    0010    /* echo terminal cursor control */
  241. #define TM_CINVIS    0020    /* do not send esc seq to user */
  242. #define TM_SET        0200    /* must be on to set/res flags */
  243.  
  244. /*
  245.  * structure of ioctl arg for LDGETT and LDSETT
  246.  */
  247. struct    termcb    {
  248.     char    st_flgs;    /* term flags */
  249.     char    st_termt;    /* term type */
  250.     char    st_crow;    /* gtty only - current row */
  251.     char    st_ccol;    /* gtty only - current col */
  252.     char    st_vrow;    /* variable row */
  253.     char    st_lrow;    /* last row */
  254. };
  255.  
  256. /*
  257.  * structure of ioctl arg for AIOCSETSS (defined is asy.h)
  258.  */
  259.  
  260. struct    termss {
  261.     char    ss_start;     /* output start char */
  262.     char     ss_stop;    /* output stop char */
  263. };
  264.