1
0

termios.h 2.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100
  1. //
  2. // Copyright 2026 Aarav Ravindra Kharade
  3. //
  4. // Licensed under the Apache License, Version 2.0 (the "License");
  5. // you may not use this file except in compliance with the License.
  6. // You may obtain a copy of the License at
  7. //
  8. // http://www.apache.org/licenses/LICENSE-2.0
  9. //
  10. // Unless required by applicable law or agreed to in writing, software
  11. // distributed under the License is distributed on an "AS IS" BASIS,
  12. // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  13. // See the License for the specific language governing permissions and
  14. // limitations under the License.
  15. //
  16. /* termios type and macro definitions. Linux version.
  17. Copyright (C) 1993-2026 Free Software Foundation, Inc.
  18. This file is part of the GNU C Library.
  19. The GNU C Library is free software; you can redistribute it and/or
  20. modify it under the terms of the GNU Lesser General Public
  21. License as published by the Free Software Foundation; either
  22. version 2.1 of the License, or (at your option) any later version.
  23. The GNU C Library is distributed in the hope that it will be useful,
  24. but WITHOUT ANY WARRANTY; without even the implied warranty of
  25. MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
  26. Lesser General Public License for more details.
  27. You should have received a copy of the GNU Lesser General Public
  28. License along with the GNU C Library; if not, see
  29. <https://www.gnu.org/licenses/>. */
  30. #ifndef _TERMIOS_H
  31. # error "Never include <bits/termios.h> directly; use <termios.h> instead."
  32. #endif
  33. typedef unsigned char cc_t;
  34. typedef unsigned int speed_t;
  35. typedef unsigned int tcflag_t;
  36. #ifdef _TERMIOS_H
  37. # include <bits/termios-struct.h>
  38. #endif
  39. #include <bits/termios-c_cc.h>
  40. #include <bits/termios-c_iflag.h>
  41. #include <bits/termios-c_oflag.h>
  42. /* c_cflag bit meaning */
  43. #include <bits/termios-c_cflag.h>
  44. #ifdef __USE_MISC
  45. #define __B0 0000000 /* hang up */
  46. #define __B50 0000001
  47. #define __B75 0000002
  48. #define __B110 0000003
  49. #define __B134 0000004
  50. #define __B150 0000005
  51. #define __B200 0000006
  52. #define __B300 0000007
  53. #define __B600 0000010
  54. #define __B1200 0000011
  55. #define __B1800 0000012
  56. #define __B2400 0000013
  57. #define __B4800 0000014
  58. #define __B9600 0000015
  59. #define __B19200 0000016
  60. #define __B38400 0000017
  61. #include <bits/termios-cbaud.h>
  62. # define __EXTA __B19200
  63. # define __EXTB __B38400
  64. # define BOTHER __BOTHER
  65. #endif
  66. #include <bits/termios-c_lflag.h>
  67. #ifdef __USE_MISC
  68. /* ioctl (fd, TIOCSERGETLSR, &result) where result may be as below */
  69. # define TIOCSER_TEMT 0x01 /* Transmitter physically empty */
  70. #endif
  71. /* tcflow() and TCXONC use these */
  72. #define TCOOFF 0
  73. #define TCOON 1
  74. #define TCIOFF 2
  75. #define TCION 3
  76. /* tcflush() and TCFLSH use these */
  77. #define TCIFLUSH 0
  78. #define TCOFLUSH 1
  79. #define TCIOFLUSH 2
  80. #include <bits/termios-tcflow.h>
  81. #include <bits/termios-misc.h>
  82. #include <bits/termios-baud.h>