1
0

tty.h 2.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127
  1. /* input modes */
  2. #define BRKINT 0x001
  3. #define ICRNL 0x002
  4. #define IGNBRK 0x004
  5. #define IGNCR 0x008
  6. #define IGNPAR 0x010
  7. #define INLCR 0x020
  8. #define INPCK 0x040
  9. #define ISTRIP 0x080
  10. #define IXOFF 0x100
  11. #define IXON 0x200
  12. #define PARMRK 0x400
  13. /* output modes */
  14. #define OPOST 0000001
  15. #define OLCUC 0000002
  16. #define ONLCR 0000004
  17. #define OCRNL 0000010
  18. #define ONOCR 0000020
  19. #define ONLRET 0000040
  20. #define OFILL 0000100
  21. #define OFDEL 0000200
  22. #define NLDLY 0000400
  23. #define NL0 0
  24. #define NL1 0000400
  25. #define CRDLY 0003000
  26. #define CR0 0
  27. #define CR1 0001000
  28. #define CR2 0002000
  29. #define CR3 0003000
  30. #define TABDLY 0014000
  31. #define TAB0 0
  32. #define TAB1 0004000
  33. #define TAB2 0010000
  34. #define TAB3 0014000
  35. #define BSDLY 0020000
  36. #define BS0 0
  37. #define BS1 0020000
  38. #define VTDLY 0040000
  39. #define VT0 0
  40. #define VT1 0040000
  41. #define FFDLY 0100000
  42. #define FF0 0
  43. #define FF1 0100000
  44. /* control modes */
  45. #define CLOCAL 0x001
  46. #define CREAD 0x002
  47. #define CSIZE 0x01C
  48. #define CS5 0x004
  49. #define CS6 0x008
  50. #define CS7 0x00C
  51. #define CS8 0x010
  52. #define CSTOPB 0x020
  53. #define HUPCL 0x040
  54. #define PARENB 0x080
  55. #define PARODD 0x100
  56. /* local modes */
  57. #define ECHO 0x001
  58. #define ECHOE 0x002
  59. #define ECHOK 0x004
  60. #define ECHONL 0x008
  61. #define ICANON 0x010
  62. #define IEXTEN 0x020
  63. #define ISIG 0x040
  64. #define NOFLSH 0x080
  65. #define TOSTOP 0x100
  66. /* control characters */
  67. #define VEOF 0
  68. #define VEOL 1
  69. #define VERASE 2
  70. #define VINTR 3
  71. #define VKILL 4
  72. #define VMIN 5
  73. #define VQUIT 6
  74. #define VSUSP 7
  75. #define VTIME 8
  76. #define VSTART 9
  77. #define VSTOP 10
  78. #define NCCS 11
  79. /* baud rates */
  80. #define B0 0
  81. #define B50 1
  82. #define B75 2
  83. #define B110 3
  84. #define B134 4
  85. #define B150 5
  86. #define B200 6
  87. #define B300 7
  88. #define B600 8
  89. #define B1200 9
  90. #define B1800 10
  91. #define B2400 11
  92. #define B4800 12
  93. #define B9600 13
  94. #define B19200 14
  95. #define B38400 15
  96. #define CESC '\\'
  97. #define CINTR 0177 /* DEL */
  98. #define CQUIT 034 /* FS, cntl | */
  99. #define CERASE 010 /* BS */
  100. #define CKILL 025 /* cntl u */
  101. #define CEOF 04 /* cntl d */
  102. #define CSTART 021 /* cntl q */
  103. #define CSTOP 023 /* cntl s */
  104. #define CSWTCH 032 /* cntl z */
  105. #define CEOL 000
  106. #define CNSWTCH 0
  107. /* optional actions for tcsetattr */
  108. #define TCSANOW 1
  109. #define TCSADRAIN 2
  110. #define TCSAFLUSH 3
  111. typedef struct Termios Termios;
  112. struct Termios
  113. {
  114. int iflag; /* input modes */
  115. int oflag; /* output modes */
  116. int cflag; /* control modes */
  117. int lflag; /* local modes */
  118. uchar cc[NCCS]; /* control characters */
  119. };