• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 // Copyright (C) 2017 The Android Open Source Project
2 // SPDX-License-Identifier: BSD-2-Clause
3 
4 #include <termios.h>
5 
6 #include "header_checks.h"
7 
termios_h()8 static void termios_h() {
9   TYPE(cc_t);
10   TYPE(speed_t);
11   TYPE(tcflag_t);
12 
13   TYPE(struct termios);
14   STRUCT_MEMBER(struct termios, tcflag_t, c_iflag);
15   STRUCT_MEMBER(struct termios, tcflag_t, c_oflag);
16   STRUCT_MEMBER(struct termios, tcflag_t, c_cflag);
17   STRUCT_MEMBER(struct termios, tcflag_t, c_lflag);
18   STRUCT_MEMBER_ARRAY(struct termios, cc_t/*[]*/, c_cc);
19 
20 #if !defined(__GLIBC__)  // Our glibc is too old.
21   TYPE(struct winsize);
22   STRUCT_MEMBER(struct winsize, unsigned short, ws_row);
23   STRUCT_MEMBER(struct winsize, unsigned short, ws_col);
24 #endif
25 
26   MACRO(NCCS);
27 
28   MACRO(VEOF);
29   MACRO(VEOL);
30   MACRO(VERASE);
31   MACRO(VINTR);
32   MACRO(VKILL);
33   MACRO(VMIN);
34   MACRO(VQUIT);
35   MACRO(VSTART);
36   MACRO(VSTOP);
37   MACRO(VSUSP);
38   MACRO(VTIME);
39 
40   MACRO(BRKINT);
41   MACRO(ICRNL);
42   MACRO(IGNBRK);
43   MACRO(IGNCR);
44   MACRO(IGNPAR);
45   MACRO(INLCR);
46   MACRO(INPCK);
47   MACRO(ISTRIP);
48   MACRO(IXANY);
49   MACRO(IXOFF);
50   MACRO(IXON);
51   MACRO(PARMRK);
52 
53   MACRO(OPOST);
54   MACRO(ONLCR);
55   MACRO(OCRNL);
56   MACRO(ONOCR);
57   MACRO(ONLRET);
58   MACRO(OFDEL);
59   MACRO(OFILL);
60   MACRO(NLDLY);
61   MACRO(NL0);
62   MACRO(NL1);
63   MACRO(CRDLY);
64   MACRO(CR0);
65   MACRO(CR1);
66   MACRO(CR2);
67   MACRO(CR3);
68   MACRO(TABDLY);
69   MACRO(TAB0);
70   MACRO(TAB1);
71   MACRO(TAB2);
72   MACRO(TAB3);
73   MACRO(BSDLY);
74   MACRO(BS0);
75   MACRO(BS1);
76   MACRO(VTDLY);
77   MACRO(VT0);
78   MACRO(VT1);
79   MACRO(FFDLY);
80   MACRO(FF0);
81   MACRO(FF1);
82 
83   MACRO(B0);
84   MACRO(B50);
85   MACRO(B75);
86   MACRO(B110);
87   MACRO(B134);
88   MACRO(B150);
89   MACRO(B200);
90   MACRO(B300);
91   MACRO(B600);
92   MACRO(B1200);
93   MACRO(B1800);
94   MACRO(B2400);
95   MACRO(B4800);
96   MACRO(B9600);
97   MACRO(B19200);
98   MACRO(B38400);
99 
100   MACRO(CSIZE);
101   MACRO(CS5);
102   MACRO(CS6);
103   MACRO(CS7);
104   MACRO(CS8);
105   MACRO(CSTOPB);
106   MACRO(CREAD);
107   MACRO(PARENB);
108   MACRO(PARODD);
109   MACRO(HUPCL);
110   MACRO(CLOCAL);
111 
112   MACRO(ECHO);
113   MACRO(ECHOE);
114   MACRO(ECHOK);
115   MACRO(ECHONL);
116   MACRO(ICANON);
117   MACRO(IEXTEN);
118   MACRO(ISIG);
119   MACRO(NOFLSH);
120   MACRO(TOSTOP);
121 
122   MACRO(TCSANOW);
123   MACRO(TCSADRAIN);
124   MACRO(TCSAFLUSH);
125 
126   MACRO(TCIFLUSH);
127   MACRO(TCIOFLUSH);
128   MACRO(TCOFLUSH);
129 
130   MACRO(TCIOFF);
131   MACRO(TCION);
132   MACRO(TCOOFF);
133   MACRO(TCOON);
134 
135   TYPE(pid_t);
136 
137   FUNCTION(cfgetispeed, speed_t (*f)(const struct termios*));
138   FUNCTION(cfgetospeed, speed_t (*f)(const struct termios*));
139   FUNCTION(cfsetispeed, int (*f)(struct termios*, speed_t));
140   FUNCTION(cfsetospeed, int (*f)(struct termios*, speed_t));
141   FUNCTION(tcdrain, int (*f)(int));
142   FUNCTION(tcflow, int (*f)(int, int));
143   FUNCTION(tcflush, int (*f)(int, int));
144   FUNCTION(tcgetattr, int (*f)(int, struct termios*));
145   FUNCTION(tcgetsid, pid_t (*f)(int));
146 #if !defined(__GLIBC__)  // Our glibc is too old.
147   FUNCTION(tcgetwinsize, int (*f)(int, struct winsize*));
148 #endif
149   FUNCTION(tcsendbreak, int (*f)(int, int));
150   FUNCTION(tcsetattr, int (*f)(int, int, const struct termios*));
151 #if !defined(__GLIBC__)  // Our glibc is too old.
152   FUNCTION(tcsetwinsize, int (*f)(int, const struct winsize*));
153 #endif
154 }
155