termios.h 2.1 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576
  1. /* termios type and macro definitions. Linux version.
  2. Copyright (C) 1993-2021 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, see
  14. <https://www.gnu.org/licenses/>. */
  15. #ifndef _TERMIOS_H
  16. # error "Never include <bits/termios.h> directly; use <termios.h> instead."
  17. #endif
  18. typedef unsigned char cc_t;
  19. typedef unsigned int speed_t;
  20. typedef unsigned int tcflag_t;
  21. #include <bits/termios-struct.h>
  22. #include <bits/termios-c_cc.h>
  23. #include <bits/termios-c_iflag.h>
  24. #include <bits/termios-c_oflag.h>
  25. /* c_cflag bit meaning */
  26. #define B0 0000000 /* hang up */
  27. #define B50 0000001
  28. #define B75 0000002
  29. #define B110 0000003
  30. #define B134 0000004
  31. #define B150 0000005
  32. #define B200 0000006
  33. #define B300 0000007
  34. #define B600 0000010
  35. #define B1200 0000011
  36. #define B1800 0000012
  37. #define B2400 0000013
  38. #define B4800 0000014
  39. #define B9600 0000015
  40. #define B19200 0000016
  41. #define B38400 0000017
  42. #ifdef __USE_MISC
  43. # define EXTA B19200
  44. # define EXTB B38400
  45. #endif
  46. #include <bits/termios-baud.h>
  47. #include <bits/termios-c_cflag.h>
  48. #include <bits/termios-c_lflag.h>
  49. #ifdef __USE_MISC
  50. /* ioctl (fd, TIOCSERGETLSR, &result) where result may be as below */
  51. # define TIOCSER_TEMT 0x01 /* Transmitter physically empty */
  52. #endif
  53. /* tcflow() and TCXONC use these */
  54. #define TCOOFF 0
  55. #define TCOON 1
  56. #define TCIOFF 2
  57. #define TCION 3
  58. /* tcflush() and TCFLSH use these */
  59. #define TCIFLUSH 0
  60. #define TCOFLUSH 1
  61. #define TCIOFLUSH 2
  62. #include <bits/termios-tcflow.h>
  63. #include <bits/termios-misc.h>