ruttyio.h 2.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116
  1. /*
  2. * teletype-related ioctls
  3. */
  4. struct sgttyb {
  5. char sg_ispeed; /* no longer set/returned by kernel */
  6. char sg_ospeed; /* no longer set/returned by kernel */
  7. char sg_erase; /* erase character */
  8. char sg_kill; /* kill character */
  9. unsigned char sg_flags[2]; /* mode flags, low byte first */
  10. };
  11. /*
  12. * Structure for setting and getting tty device parammeters.
  13. */
  14. struct ttydevb {
  15. char ispeed; /* input speed */
  16. char ospeed; /* output speed */
  17. unsigned char flags[2]; /* mode flags, low byte first */
  18. };
  19. /*
  20. * List of special characters
  21. */
  22. struct tchars {
  23. char t_intrc; /* interrupt */
  24. char t_quitc; /* quit */
  25. char t_startc; /* start output */
  26. char t_stopc; /* stop output */
  27. char t_eofc; /* end-of-file */
  28. char t_brkc; /* input delimiter (like nl) */
  29. };
  30. /*
  31. * modes in sg_flags
  32. */
  33. #define TANDEM 01
  34. #define CBREAK 02
  35. #define LCASE 04
  36. #define ECHO 010
  37. #define CRMOD 020
  38. #define RAW 040
  39. /* 0300: former parity bits */
  40. #define NLDELAY 001400
  41. #define TBDELAY 006000
  42. #define XTABS 06000
  43. #define CRDELAY 030000
  44. #define VTDELAY 040000
  45. #define BSDELAY 0100000
  46. #define ALLDELAY 0177400
  47. /*
  48. * Delay algorithms
  49. */
  50. #define CR0 0
  51. #define CR1 010000
  52. #define CR2 020000
  53. #define CR3 030000
  54. #define NL0 0
  55. #define NL1 000400
  56. #define NL2 001000
  57. #define NL3 001400
  58. #define TAB0 0
  59. #define TAB1 002000
  60. #define TAB2 004000
  61. #define FF0 0
  62. #define FF1 040000
  63. #define BS0 0
  64. #define BS1 0100000
  65. /*
  66. * Speeds
  67. */
  68. #define B0 0
  69. #define B50 1
  70. #define B75 2
  71. #define B110 3
  72. #define B134 4
  73. #define B150 5
  74. #define B200 6
  75. #define B300 7
  76. #define B600 8
  77. #define B1200 9
  78. #define B1800 10
  79. #define B2400 11
  80. #define B4800 12
  81. #define B9600 13
  82. #define EXTA 14
  83. #define EXTB 15
  84. /*
  85. * device flags
  86. */
  87. #define F8BIT 040 /* eight-bit path */
  88. #define ODDP 0100
  89. #define EVENP 0200
  90. #define ANYP 0300
  91. /*
  92. * tty ioctl commands
  93. */
  94. #define TIOCHPCL (('t'<<8)|2)
  95. #define TIOCGETP (('t'<<8)|8)
  96. #define TIOCSETP (('t'<<8)|9)
  97. #define TIOCSETN (('t'<<8)|10)
  98. #define TIOCEXCL (('t'<<8)|13)
  99. #define TIOCNXCL (('t'<<8)|14)
  100. #define TIOCFLUSH (('t'<<8)|16)
  101. #define TIOCSETC (('t'<<8)|17)
  102. #define TIOCGETC (('t'<<8)|18)
  103. #define TIOCSBRK (('t'<<8)|19)
  104. #define TIOCGDEV (('t'<<8)|23) /* get device parameters */
  105. #define TIOCSDEV (('t'<<8)|24) /* set device parameters */
  106. #define TIOCSPGRP (('t'<<8)|118) /* set pgrp of tty */
  107. #define TIOCGPGRP (('t'<<8)|119) /* get pgrp of tty */