sgtty.h 3.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119
  1. /* $Id$ */
  2. /*
  3. * (c) copyright 1987 by the Vrije Universiteit, Amsterdam, The Netherlands.
  4. * See the copyright notice in the ACK home directory, in the file "Copyright".
  5. */
  6. /* Data structures for ioctl/stty/gtty, sufficient for ACK libraries */
  7. #ifndef _SGTTY_H
  8. #define _SGTTY_H
  9. struct sgttyb {
  10. char sg_ispeed; /* input speed (not used) */
  11. char sg_ospeed; /* output speed (not used) */
  12. char sg_erase; /* erase character */
  13. char sg_kill; /* kill character */
  14. #if defined(__USG) && !defined(_XENIX)
  15. int sg_flags; /* mode flags */
  16. #else
  17. short sg_flags; /* mode flags */
  18. #endif
  19. };
  20. struct tchars {
  21. char t_intrc; /* SIGINT char */
  22. char t_quitc; /* SIGQUIT char */
  23. char t_startc; /* start output (initially CTRL-Q) */
  24. char t_stopc; /* stop output (initially CTRL-S) */
  25. char t_eofc; /* EOF (initially CTRL-D) */
  26. char t_brkc; /* input delimiter (like nl) */
  27. };
  28. /* Fields in t_flags. */
  29. #define ALLDELAY 0177400
  30. #define BSDELAY 0100000
  31. # define BS0 0000000
  32. # define BS1 0100000
  33. #define VTDELAY 0040000
  34. # define FF0 0000000
  35. # define FF1 0040000
  36. #define CRDELAY 0030000
  37. # define CR0 0000000
  38. # define CR1 0010000
  39. # define CR2 0020000
  40. # define CR3 0030000
  41. #if defined(__USG) && !defined(_XENIX)
  42. #define XTABS 0000002 /* do tab expansion */
  43. #else
  44. #define XTABS 0006000 /* do tab expansion */
  45. #endif
  46. #define TBDELAY 0006000
  47. # define TAB0 0000000
  48. # define TAB1 0002000
  49. # define TAB2 0004000
  50. #define NLDELAY 0001400
  51. # define NL0 0000000
  52. # define NL1 0000400
  53. # define NL2 0001000
  54. # define NL3 0001400
  55. #define ANYP 0000300
  56. #define EVENP 0000200
  57. #define ODDP 0000100
  58. #define RAW 0000040 /* enable raw mode */
  59. #define CRMOD 0000020 /* map lf to cr + lf */
  60. #define ECHO 0000010 /* echo input */
  61. #define LCASE 0000004
  62. #define CBREAK 0000002 /* enable cbreak mode */
  63. #if defined(__BSD4_2) || defined(_XENIX)
  64. #define TANDEM 0000001
  65. #else
  66. #define HUPCL 0000001 /* unused ??? */
  67. #endif
  68. /*#define COOKED 0000000 */ /* neither CBREAK nor RAW */
  69. #ifdef __BDS4_2
  70. #define TIOCGETP (('t'<<8) | 8 | (6 << 16) | 0x40000000)
  71. #define TIOCSETP (('t'<<8) | 9 | (6 << 16) | 0x80000000)
  72. #define TIOCSETN (('t'<<8) | 10 | (6 << 16) | 0x80000000)
  73. #define TIOCEXCL (('t'<<8) | 13 | 0x20000000)
  74. #define TIOCNXCL (('t'<<8) | 14 | 0x20000000)
  75. #define TIOCHPCL (('t'<<8) | 2 | 0x20000000)
  76. #define TIOCGETC (('t'<<8) | 18 | (6 << 16) | 0x40000000)
  77. #define TIOCSETC (('t'<<8) | 17 | (6 << 16) | 0x80000000)
  78. #else
  79. #define TIOCGETP (('t'<<8) | 8)
  80. #define TIOCSETP (('t'<<8) | 9)
  81. #define TIOCSETN (('t'<<8) | 10)
  82. #define TIOCEXCL (('t'<<8) | 13)
  83. #define TIOCNXCL (('t'<<8) | 14)
  84. #define TIOCHPCL (('t'<<8) | 2)
  85. #define TIOCGETC (('t'<<8) | 18)
  86. #define TIOCSETC (('t'<<8) | 17)
  87. #endif
  88. #define B0 0
  89. #define B50 1
  90. #define B75 2
  91. #define B110 3
  92. #define B134 4
  93. #define B150 5
  94. #define B200 6
  95. #define B300 7
  96. #define B600 8
  97. #define B1200 9
  98. #define B1800 10
  99. #define B2400 11
  100. #define B4800 12
  101. #define B9600 13
  102. #define EXTA 14
  103. #define EXTB 15
  104. #endif /* _SGTTY_H */