termios.h 3.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166
  1. struct termios {
  2. tcflag_t c_iflag;
  3. tcflag_t c_oflag;
  4. tcflag_t c_cflag;
  5. tcflag_t c_lflag;
  6. cc_t c_line;
  7. cc_t c_cc[NCCS];
  8. speed_t __c_ispeed;
  9. speed_t __c_ospeed;
  10. };
  11. #define VINTR 0
  12. #define VQUIT 1
  13. #define VERASE 2
  14. #define VKILL 3
  15. #define VEOF 4
  16. #define VTIME 5
  17. #define VMIN 6
  18. #define VSWTC 7
  19. #define VSTART 8
  20. #define VSTOP 9
  21. #define VSUSP 10
  22. #define VEOL 11
  23. #define VREPRINT 12
  24. #define VDISCARD 13
  25. #define VWERASE 14
  26. #define VLNEXT 15
  27. #define VEOL2 16
  28. #define IGNBRK 0000001
  29. #define BRKINT 0000002
  30. #define IGNPAR 0000004
  31. #define PARMRK 0000010
  32. #define INPCK 0000020
  33. #define ISTRIP 0000040
  34. #define INLCR 0000100
  35. #define IGNCR 0000200
  36. #define ICRNL 0000400
  37. #define IUCLC 0001000
  38. #define IXON 0002000
  39. #define IXANY 0004000
  40. #define IXOFF 0010000
  41. #define IMAXBEL 0020000
  42. #define IUTF8 0040000
  43. #define OPOST 0000001
  44. #define OLCUC 0000002
  45. #define ONLCR 0000004
  46. #define OCRNL 0000010
  47. #define ONOCR 0000020
  48. #define ONLRET 0000040
  49. #define OFILL 0000100
  50. #define OFDEL 0000200
  51. #if defined(_GNU_SOURCE) || defined(_BSD_SOURCE) || defined(_XOPEN_SOURCE)
  52. #define NLDLY 0000400
  53. #define NL0 0000000
  54. #define NL1 0000400
  55. #define CRDLY 0003000
  56. #define CR0 0000000
  57. #define CR1 0001000
  58. #define CR2 0002000
  59. #define CR3 0003000
  60. #define TABDLY 0014000
  61. #define TAB0 0000000
  62. #define TAB1 0004000
  63. #define TAB2 0010000
  64. #define TAB3 0014000
  65. #define BSDLY 0020000
  66. #define BS0 0000000
  67. #define BS1 0020000
  68. #define FFDLY 0100000
  69. #define FF0 0000000
  70. #define FF1 0100000
  71. #endif
  72. #define VTDLY 0040000
  73. #define VT0 0000000
  74. #define VT1 0040000
  75. #define B0 0000000
  76. #define B50 0000001
  77. #define B75 0000002
  78. #define B110 0000003
  79. #define B134 0000004
  80. #define B150 0000005
  81. #define B200 0000006
  82. #define B300 0000007
  83. #define B600 0000010
  84. #define B1200 0000011
  85. #define B1800 0000012
  86. #define B2400 0000013
  87. #define B4800 0000014
  88. #define B9600 0000015
  89. #define B19200 0000016
  90. #define B38400 0000017
  91. #define B57600 0010001
  92. #define B115200 0010002
  93. #define B230400 0010003
  94. #define B460800 0010004
  95. #define B500000 0010005
  96. #define B576000 0010006
  97. #define B921600 0010007
  98. #define B1000000 0010010
  99. #define B1152000 0010011
  100. #define B1500000 0010012
  101. #define B2000000 0010013
  102. #define B2500000 0010014
  103. #define B3000000 0010015
  104. #define B3500000 0010016
  105. #define B4000000 0010017
  106. #define CSIZE 0000060
  107. #define CS5 0000000
  108. #define CS6 0000020
  109. #define CS7 0000040
  110. #define CS8 0000060
  111. #define CSTOPB 0000100
  112. #define CREAD 0000200
  113. #define PARENB 0000400
  114. #define PARODD 0001000
  115. #define HUPCL 0002000
  116. #define CLOCAL 0004000
  117. #define ISIG 0000001
  118. #define ICANON 0000002
  119. #define ECHO 0000010
  120. #define ECHOE 0000020
  121. #define ECHOK 0000040
  122. #define ECHONL 0000100
  123. #define NOFLSH 0000200
  124. #define TOSTOP 0000400
  125. #define IEXTEN 0100000
  126. #define TCOOFF 0
  127. #define TCOON 1
  128. #define TCIOFF 2
  129. #define TCION 3
  130. #define TCIFLUSH 0
  131. #define TCOFLUSH 1
  132. #define TCIOFLUSH 2
  133. #define TCSANOW 0
  134. #define TCSADRAIN 1
  135. #define TCSAFLUSH 2
  136. #if defined(_GNU_SOURCE) || defined(_BSD_SOURCE)
  137. #define EXTA 0000016
  138. #define EXTB 0000017
  139. #define CBAUD 0010017
  140. #define CBAUDEX 0010000
  141. #define CIBAUD 002003600000
  142. #define CMSPAR 010000000000
  143. #define CRTSCTS 020000000000
  144. #define XCASE 0000004
  145. #define ECHOCTL 0001000
  146. #define ECHOPRT 0002000
  147. #define ECHOKE 0004000
  148. #define FLUSHO 0010000
  149. #define PENDIN 0040000
  150. #define EXTPROC 0200000
  151. #define XTABS 0014000
  152. #endif