termios.h 5.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205
  1. /* termios type and macro definitions. Linux version.
  2. Copyright (C) 1993, 94, 95, 96, 97, 99 Free Software Foundation, Inc.
  3. This file is part of the GNU C Library.
  4. The GNU C Library is free software; you can redistribute it and/or
  5. modify it under the terms of the GNU Lesser General Public
  6. License as published by the Free Software Foundation; either
  7. version 2.1 of the License, or (at your option) any later version.
  8. The GNU C Library is distributed in the hope that it will be useful,
  9. but WITHOUT ANY WARRANTY; without even the implied warranty of
  10. MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
  11. Lesser General Public License for more details.
  12. You should have received a copy of the GNU Lesser General Public
  13. License along with the GNU C Library; if not, write to the Free
  14. Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
  15. 02111-1307 USA. */
  16. #ifndef _TERMIOS_H
  17. # error "Never include <bits/termios.h> directly; use <termios.h> instead."
  18. #endif
  19. typedef unsigned char cc_t;
  20. typedef unsigned int speed_t;
  21. typedef unsigned int tcflag_t;
  22. #define NCCS 32
  23. struct termios
  24. {
  25. tcflag_t c_iflag; /* input mode flags */
  26. tcflag_t c_oflag; /* output mode flags */
  27. tcflag_t c_cflag; /* control mode flags */
  28. tcflag_t c_lflag; /* local mode flags */
  29. cc_t c_cc[NCCS]; /* control characters */
  30. cc_t c_line; /* line discipline (== c_cc[33]) */
  31. speed_t c_ispeed; /* input speed */
  32. speed_t c_ospeed; /* output speed */
  33. };
  34. /* c_cc characters */
  35. #define VEOF 0
  36. #define VEOL 1
  37. #define VEOL2 2
  38. #define VERASE 3
  39. #define VWERASE 4
  40. #define VKILL 5
  41. #define VREPRINT 6
  42. #define VSWTC 7
  43. #define VINTR 8
  44. #define VQUIT 9
  45. #define VSUSP 10
  46. #define VSTART 12
  47. #define VSTOP 13
  48. #define VLNEXT 14
  49. #define VDISCARD 15
  50. #define VMIN 16
  51. #define VTIME 17
  52. /* c_iflag bits */
  53. #define IGNBRK 0000001
  54. #define BRKINT 0000002
  55. #define IGNPAR 0000004
  56. #define PARMRK 0000010
  57. #define INPCK 0000020
  58. #define ISTRIP 0000040
  59. #define INLCR 0000100
  60. #define IGNCR 0000200
  61. #define ICRNL 0000400
  62. #define IXON 0001000
  63. #define IXOFF 0002000
  64. #ifdef __USE_BSD
  65. /* POSIX.1 doesn't want these... */
  66. # define IXANY 0004000
  67. # define IUCLC 0010000
  68. # define IMAXBEL 0020000
  69. #endif
  70. /* c_oflag bits */
  71. #define OPOST 0000001
  72. #define ONLCR 0000002
  73. #define OLCUC 0000004
  74. #define OCRNL 0000010
  75. #define ONOCR 0000020
  76. #define ONLRET 0000040
  77. #define OFILL 00000100
  78. #define OFDEL 00000200
  79. #define NLDLY 00001400
  80. #define NL0 00000000
  81. #define NL1 00000400
  82. #define NL2 00001000
  83. #define NL3 00001400
  84. #define TABDLY 00006000
  85. #define TAB0 00000000
  86. #define TAB1 00002000
  87. #define TAB2 00004000
  88. #define TAB3 00006000
  89. #define CRDLY 00030000
  90. #define CR0 00000000
  91. #define CR1 00010000
  92. #define CR2 00020000
  93. #define CR3 00030000
  94. #define FFDLY 00040000
  95. #define FF0 00000000
  96. #define FF1 00040000
  97. #define BSDLY 00100000
  98. #define BS0 00000000
  99. #define BS1 00100000
  100. #define VTDLY 00200000
  101. #define VT0 00000000
  102. #define VT1 00200000
  103. #define XTABS 01000000 /* Hmm.. Linux/i386 considers this part of TABDLY.. */
  104. /* c_cflag bit meaning */
  105. #define CBAUD 0000037
  106. #define B0 0000000 /* hang up */
  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 B38400 0000017
  122. #define EXTA B19200
  123. #define EXTB B38400
  124. #define CBAUDEX 0000000
  125. #define B57600 00020
  126. #define B115200 00021
  127. #define B230400 00022
  128. #define B460800 00023
  129. #define B500000 00024
  130. #define B576000 00025
  131. #define B921600 00026
  132. #define B1000000 00027
  133. #define B1152000 00030
  134. #define B1500000 00031
  135. #define B2000000 00032
  136. #define B2500000 00033
  137. #define B3000000 00034
  138. #define B3500000 00035
  139. #define B4000000 00036
  140. #define __MAX_BAUD B4000000
  141. #define CSIZE 00001400
  142. #define CS5 00000000
  143. #define CS6 00000400
  144. #define CS7 00001000
  145. #define CS8 00001400
  146. #define CSTOPB 00002000
  147. #define CREAD 00004000
  148. #define PARENB 00010000
  149. #define PARODD 00020000
  150. #define HUPCL 00040000
  151. #define CLOCAL 00100000
  152. #define CRTSCTS 020000000000 /* flow control */
  153. /* c_lflag bits */
  154. #define ISIG 0x00000080
  155. #define ICANON 0x00000100
  156. #define XCASE 0x00004000
  157. #define ECHO 0x00000008
  158. #define ECHOE 0x00000002
  159. #define ECHOK 0x00000004
  160. #define ECHONL 0x00000010
  161. #define NOFLSH 0x80000000
  162. #define TOSTOP 0x00400000
  163. #define ECHOCTL 0x00000040
  164. #define ECHOPRT 0x00000020
  165. #define ECHOKE 0x00000001
  166. #define FLUSHO 0x00800000
  167. #define PENDIN 0x20000000
  168. #define IEXTEN 0x00000400
  169. /* Values for the ACTION argument to `tcflow'. */
  170. #define TCOOFF 0
  171. #define TCOON 1
  172. #define TCIOFF 2
  173. #define TCION 3
  174. /* Values for the QUEUE_SELECTOR argument to `tcflush'. */
  175. #define TCIFLUSH 0
  176. #define TCOFLUSH 1
  177. #define TCIOFLUSH 2
  178. /* Values for the OPTIONAL_ACTIONS argument to `tcsetattr'. */
  179. #define TCSANOW 0
  180. #define TCSADRAIN 1
  181. #define TCSAFLUSH 2
  182. #define _IOT_termios /* Hurd ioctl type field. */ \
  183. _IOT (_IOTS (cflag_t), 4, _IOTS (cc_t), NCCS, _IOTS (speed_t), 2)