home *** CD-ROM | disk | FTP | other *** search
/ Jason Aller Floppy Collection / 202.img / SCO386N2.TD0 / usr / include / sys / termio.h < prev    next >
Encoding:
C/C++ Source or Header  |  1988-05-18  |  5.6 KB  |  250 lines

  1. /*
  2.  *    @(#) termio.h 2.2 88/05/18 
  3.  *
  4.  *    Copyright (C) The Santa Cruz Operation, 1984, 1985, 1986, 1987, 1988.
  5.  *    Copyright (C) Microsoft Corporation, 1984, 1985, 1986, 1987, 1988.
  6.  *    This Module contains Proprietary Information of
  7.  *    The Santa Cruz Operation, Microsoft Corporation
  8.  *    and AT&T, and should be treated as Confidential.
  9.  */
  10.  
  11. /*
  12.  * THIS FILE CONTAINS CODE WHICH IS DESIGNED TO BE
  13.  * PORTABLE BETWEEN DIFFERENT MACHINE ARCHITECTURES
  14.  * AND CONFIGURATIONS. IT SHOULD NOT REQUIRE ANY
  15.  * MODIFICATIONS WHEN ADAPTING XENIX TO NEW HARDWARE.
  16.  */
  17.  
  18. #define    IOCTYPE    0xff00
  19.  
  20. #define    TIOC    ('T'<<8)
  21. #define    TCGETA    (TIOC|1)
  22. #define    TCSETA    (TIOC|2)
  23. #define    TCSETAW    (TIOC|3)
  24. #define    TCSETAF    (TIOC|4)
  25. #define    TCSBRK    (TIOC|5)
  26. #define    TCXONC    (TIOC|6)
  27. #define    TCFLSH    (TIOC|7)
  28.  
  29. #define    TCDSET    (TIOC|32)
  30.  
  31. #include "machdep.h"
  32.  
  33. #define    LDIOC    ('D'<<8)
  34. #define    LDOPEN    (LDIOC|0)
  35. #define    LDCLOSE    (LDIOC|1)
  36. #define    LDCHG    (LDIOC|2)
  37. #define    LDGETT    (LDIOC|8)
  38. #define    LDSETT    (LDIOC|9)
  39.  
  40. #define    tIOC    ('t'<<8)
  41. #define TIOCGETD        (tIOC|0)                /* V7 */
  42. #define TIOCSETD        (tIOC|1)                /* V7 */
  43. #define TIOCHPCL        (tIOC|2)                /* V7 */
  44. #define TIOCGETP        (tIOC|8)
  45. #define TIOCSETP        (tIOC|9)
  46. #define TIOCSETN        (tIOC|10)               /* V7 */
  47. #define TIOCEXCL        (tIOC|13)               /* V7 */
  48. #define TIOCNXCL        (tIOC|14)               /* V7 */
  49. #define TIOCFLUSH       (tIOC|16)               /* V7 */
  50. #define TIOCSETC        (tIOC|17)               /* V7 */
  51. #define TIOCGETC        (tIOC|18)               /* V7 */
  52.  
  53. #define    LIOC    ('l'<<8)
  54. #define    LIOCGETP    (LIOC|1)
  55. #define    LIOCSETP    (LIOC|2)
  56. #define    LIOCGETS    (LIOC|5)
  57. #define    LIOCSETS    (LIOC|6)
  58.  
  59. #define    DIOC    ('d'<<8)
  60. #define    DIOCGETC    (DIOC|1)
  61. #define    DIOCGETB    (DIOC|2)
  62. #define    DIOCSETE    (DIOC|3)
  63. #define DIOCGETP        (DIOC|8)                /* V7 */
  64. #define DIOCSETP        (DIOC|9)                /* V7 */
  65.  
  66. #define    VPM    ('V'<<8)
  67. #define    VPMCMD    (VPM|8)
  68. #define    VPMERRS    (VPM|9)
  69. #define    VPMRPT    (VPM|10)
  70. #define    VPMTRCO    (VPM|16)
  71.  
  72. #define FIOCLEX         (('f'<<8)|1)            /* V7 */
  73. #define FIONCLEX        (('f'<<8)|2)            /* V7 */
  74. #define FIORDCHK        (('f'<<8)|3)            /* V7 */
  75.  
  76. #define    NCC    8
  77.  
  78. /* control characters */
  79. #define    VINTR    0
  80. #define    VQUIT    1
  81. #define    VERASE    2
  82. #define    VKILL    3
  83. #define    VEOF    4
  84. #define    VEOL    5
  85. #define    VEOL2    6
  86. #define    VMIN    4
  87. #define    VTIME    5
  88. #define    VSWTCH    7
  89. #define    VCEOF    NCC        /* RESERVED true EOF char (V7 compatability) */
  90. #define    VCEOL    (NCC + 1)    /* RESERVED true EOL char */
  91.  
  92. #define    CNUL    0
  93. #define    CDEL    0377
  94. /* default control chars */
  95. #define    CESC    '\\'
  96. #define    CINTR    0177    /* DEL */
  97. #define    CQUIT    034    /* FS, cntl | */
  98. #define CERASE  '\010'  /* backsp */
  99. #define CKILL   '\025'  /* cntl u */
  100. #define    CEOF    04    /* cntl d */
  101. #define    CSTART    021    /* cntl q */
  102. #define    CSTOP    023    /* cntl s */
  103. #define    CSWTCH    032    /* cntl z */
  104. #define    CNSWTCH    0
  105.  
  106.  
  107. /* input modes */
  108. #define    IGNBRK    0000001
  109. #define    BRKINT    0000002
  110. #define    IGNPAR    0000004
  111. #define    PARMRK    0000010
  112. #define    INPCK    0000020
  113. #define    ISTRIP    0000040
  114. #define    INLCR    0000100
  115. #define    IGNCR    0000200
  116. #define    ICRNL    0000400
  117. #define    IUCLC    0001000
  118. #define    IXON    0002000
  119. #define    IXANY    0004000
  120. #define    IXOFF    0010000
  121. #ifdef VPIX
  122. #define DOSMODE 0100000
  123. #endif /* VPIX */
  124.  
  125.  
  126. /* output modes */
  127. #define    OPOST    0000001
  128. #define    OLCUC    0000002
  129. #define    ONLCR    0000004
  130. #define    OCRNL    0000010
  131. #define    ONOCR    0000020
  132. #define    ONLRET    0000040
  133. #define    OFILL    0000100
  134. #define    OFDEL    0000200
  135. #define    NLDLY    0000400
  136. #define    NL0    0
  137. #define    NL1    0000400
  138. #define    CRDLY    0003000
  139. #define    CR0    0
  140. #define    CR1    0001000
  141. #define    CR2    0002000
  142. #define    CR3    0003000
  143. #define    TABDLY    0014000
  144. #define    TAB0    0
  145. #define    TAB1    0004000
  146. #define    TAB2    0010000
  147. #define    TAB3    0014000
  148. #define    BSDLY    0020000
  149. #define    BS0    0
  150. #define    BS1    0020000
  151. #define    VTDLY    0040000
  152. #define    VT0    0
  153. #define    VT1    0040000
  154. #define    FFDLY    0100000
  155. #define    FF0    0
  156. #define    FF1    0100000
  157.  
  158. /* control modes */
  159. #define    CBAUD    0000017
  160. #define    B0    0
  161. #define    B50    0000001
  162. #define    B75    0000002
  163. #define    B110    0000003
  164. #define    B134    0000004
  165. #define    B150    0000005
  166. #define    B200    0000006
  167. #define    B300    0000007
  168. #define    B600    0000010
  169. #define    B1200    0000011
  170. #define    B1800    0000012
  171. #define    B2400    0000013
  172. #define    B4800    0000014
  173. #define    B9600    0000015
  174. #define    EXTA    0000016
  175. #define    B19200    0000016
  176. #define    EXTB    0000017
  177. #define    B38400    0000017
  178. #define    CSIZE    0000060
  179. #define    CS5    0
  180. #define    CS6    0000020
  181. #define    CS7    0000040
  182. #define    CS8    0000060
  183. #define    CSTOPB    0000100
  184. #define    CREAD    0000200
  185. #define    PARENB    0000400
  186. #define    PARODD    0001000
  187. #define    HUPCL    0002000
  188. #define    CLOCAL    0004000
  189. #define    LOBLK    0010000
  190. #define    CTSFLOW    0020000
  191. #define    RTSFLOW    0040000
  192.  
  193. /* line discipline 0 modes */
  194. #define    ISIG    0000001
  195. #define    ICANON    0000002
  196. #define    XCASE    0000004
  197. #define    ECHO    0000010
  198. #define    ECHOE    0000020
  199. #define    ECHOK    0000040
  200. #define    ECHONL    0000100
  201. #define    NOFLSH    0000200
  202. #define    XCLUDE    0100000        /* *V7* exclusive use */
  203.  
  204. #define SSPEED  13              /* default speed: 7=300, 13=9600 baud */
  205.  
  206. #ifdef M_I386
  207. #pragma    pack(2)
  208. #endif
  209.  
  210. /*
  211.  * Ioctl control packet
  212.  */
  213. struct termio {
  214.     unsigned short    c_iflag;    /* input modes */
  215.     unsigned short    c_oflag;    /* output modes */
  216.     unsigned short    c_cflag;    /* control modes */
  217.     unsigned short    c_lflag;    /* line discipline modes */
  218.     char        c_line;        /* line discipline */
  219.     unsigned char    c_cc[NCC];    /* control chars */
  220. };
  221.  
  222. /*
  223.  * structure of ioctl arg for LDGETT and LDSETT
  224.  */
  225. struct    termcb    {
  226.     char    st_flgs;    /* term flags */
  227.     char    st_termt;    /* term type */
  228.     char    st_crow;    /* gtty only - current row */
  229.     char    st_ccol;    /* gtty only - current col */
  230.     char    st_vrow;    /* variable row */
  231.     char    st_lrow;    /* last row */
  232. };
  233.  
  234. #ifdef VPIX
  235.  
  236. /*
  237.  * structure of ioctl arg for AIOCSETSS
  238.  */
  239.  
  240. struct    termss    {
  241.     char    ss_start;    /* output start char */
  242.     char    ss_stop;    /* output stop char */
  243. };
  244.  
  245. #endif
  246.  
  247. #ifdef M_I386
  248. #pragma    pack()
  249. #endif
  250.