termios.h 2.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384
  1. /* termios type and macro definitions. Linux version.
  2. Copyright (C) 1993-2026 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. #ifdef _TERMIOS_H
  22. # include <bits/termios-struct.h>
  23. #endif
  24. #include <bits/termios-c_cc.h>
  25. #include <bits/termios-c_iflag.h>
  26. #include <bits/termios-c_oflag.h>
  27. /* c_cflag bit meaning */
  28. #include <bits/termios-c_cflag.h>
  29. #ifdef __USE_MISC
  30. #define __B0 0000000 /* hang up */
  31. #define __B50 0000001
  32. #define __B75 0000002
  33. #define __B110 0000003
  34. #define __B134 0000004
  35. #define __B150 0000005
  36. #define __B200 0000006
  37. #define __B300 0000007
  38. #define __B600 0000010
  39. #define __B1200 0000011
  40. #define __B1800 0000012
  41. #define __B2400 0000013
  42. #define __B4800 0000014
  43. #define __B9600 0000015
  44. #define __B19200 0000016
  45. #define __B38400 0000017
  46. #include <bits/termios-cbaud.h>
  47. # define __EXTA __B19200
  48. # define __EXTB __B38400
  49. # define BOTHER __BOTHER
  50. #endif
  51. #include <bits/termios-c_lflag.h>
  52. #ifdef __USE_MISC
  53. /* ioctl (fd, TIOCSERGETLSR, &result) where result may be as below */
  54. # define TIOCSER_TEMT 0x01 /* Transmitter physically empty */
  55. #endif
  56. /* tcflow() and TCXONC use these */
  57. #define TCOOFF 0
  58. #define TCOON 1
  59. #define TCIOFF 2
  60. #define TCION 3
  61. /* tcflush() and TCFLSH use these */
  62. #define TCIFLUSH 0
  63. #define TCOFLUSH 1
  64. #define TCIOFLUSH 2
  65. #include <bits/termios-tcflow.h>
  66. #include <bits/termios-misc.h>
  67. #include <bits/termios-baud.h>