• Home
  • History
  • Annotate
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 /*
2  * Copyright (C) 2017 The Android Open Source Project
3  * All rights reserved.
4  *
5  * Redistribution and use in source and binary forms, with or without
6  * modification, are permitted provided that the following conditions
7  * are met:
8  *  * Redistributions of source code must retain the above copyright
9  *    notice, this list of conditions and the following disclaimer.
10  *  * Redistributions in binary form must reproduce the above copyright
11  *    notice, this list of conditions and the following disclaimer in
12  *    the documentation and/or other materials provided with the
13  *    distribution.
14  *
15  * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
16  * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
17  * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
18  * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
19  * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
20  * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
21  * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS
22  * OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED
23  * AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
24  * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
25  * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
26  * SUCH DAMAGE.
27  */
28 
29 #include <termios.h>
30 
31 #include "header_checks.h"
32 
termios_h()33 static void termios_h() {
34   TYPE(cc_t);
35   TYPE(speed_t);
36   TYPE(tcflag_t);
37 
38   TYPE(struct termios);
39   STRUCT_MEMBER(struct termios, tcflag_t, c_iflag);
40   STRUCT_MEMBER(struct termios, tcflag_t, c_oflag);
41   STRUCT_MEMBER(struct termios, tcflag_t, c_cflag);
42   STRUCT_MEMBER(struct termios, tcflag_t, c_lflag);
43   STRUCT_MEMBER_ARRAY(struct termios, cc_t/*[]*/, c_cc);
44 
45 #if !defined(__GLIBC__)  // Our glibc is too old.
46   TYPE(struct winsize);
47   STRUCT_MEMBER(struct winsize, unsigned short, ws_row);
48   STRUCT_MEMBER(struct winsize, unsigned short, ws_col);
49 #endif
50 
51   MACRO(NCCS);
52 
53   MACRO(VEOF);
54   MACRO(VEOL);
55   MACRO(VERASE);
56   MACRO(VINTR);
57   MACRO(VKILL);
58   MACRO(VMIN);
59   MACRO(VQUIT);
60   MACRO(VSTART);
61   MACRO(VSTOP);
62   MACRO(VSUSP);
63   MACRO(VTIME);
64 
65   MACRO(BRKINT);
66   MACRO(ICRNL);
67   MACRO(IGNBRK);
68   MACRO(IGNCR);
69   MACRO(IGNPAR);
70   MACRO(INLCR);
71   MACRO(INPCK);
72   MACRO(ISTRIP);
73   MACRO(IXANY);
74   MACRO(IXOFF);
75   MACRO(IXON);
76   MACRO(PARMRK);
77 
78   MACRO(OPOST);
79   MACRO(ONLCR);
80   MACRO(OCRNL);
81   MACRO(ONOCR);
82   MACRO(ONLRET);
83   MACRO(OFDEL);
84   MACRO(OFILL);
85   MACRO(NLDLY);
86   MACRO(NL0);
87   MACRO(NL1);
88   MACRO(CRDLY);
89   MACRO(CR0);
90   MACRO(CR1);
91   MACRO(CR2);
92   MACRO(CR3);
93   MACRO(TABDLY);
94   MACRO(TAB0);
95   MACRO(TAB1);
96   MACRO(TAB2);
97   MACRO(TAB3);
98   MACRO(BSDLY);
99   MACRO(BS0);
100   MACRO(BS1);
101   MACRO(VTDLY);
102   MACRO(VT0);
103   MACRO(VT1);
104   MACRO(FFDLY);
105   MACRO(FF0);
106   MACRO(FF1);
107 
108   MACRO(B0);
109   MACRO(B50);
110   MACRO(B75);
111   MACRO(B110);
112   MACRO(B134);
113   MACRO(B150);
114   MACRO(B200);
115   MACRO(B300);
116   MACRO(B600);
117   MACRO(B1200);
118   MACRO(B1800);
119   MACRO(B2400);
120   MACRO(B4800);
121   MACRO(B9600);
122   MACRO(B19200);
123   MACRO(B38400);
124 
125   MACRO(CSIZE);
126   MACRO(CS5);
127   MACRO(CS6);
128   MACRO(CS7);
129   MACRO(CS8);
130   MACRO(CSTOPB);
131   MACRO(CREAD);
132   MACRO(PARENB);
133   MACRO(PARODD);
134   MACRO(HUPCL);
135   MACRO(CLOCAL);
136 
137   MACRO(ECHO);
138   MACRO(ECHOE);
139   MACRO(ECHOK);
140   MACRO(ECHONL);
141   MACRO(ICANON);
142   MACRO(IEXTEN);
143   MACRO(ISIG);
144   MACRO(NOFLSH);
145   MACRO(TOSTOP);
146 
147   MACRO(TCSANOW);
148   MACRO(TCSADRAIN);
149   MACRO(TCSAFLUSH);
150 
151   MACRO(TCIFLUSH);
152   MACRO(TCIOFLUSH);
153   MACRO(TCOFLUSH);
154 
155   MACRO(TCIOFF);
156   MACRO(TCION);
157   MACRO(TCOOFF);
158   MACRO(TCOON);
159 
160   TYPE(pid_t);
161 
162   FUNCTION(cfgetispeed, speed_t (*f)(const struct termios*));
163   FUNCTION(cfgetospeed, speed_t (*f)(const struct termios*));
164   FUNCTION(cfsetispeed, int (*f)(struct termios*, speed_t));
165   FUNCTION(cfsetospeed, int (*f)(struct termios*, speed_t));
166   FUNCTION(tcdrain, int (*f)(int));
167   FUNCTION(tcflow, int (*f)(int, int));
168   FUNCTION(tcflush, int (*f)(int, int));
169   FUNCTION(tcgetattr, int (*f)(int, struct termios*));
170   FUNCTION(tcgetsid, pid_t (*f)(int));
171 #if !defined(__GLIBC__)  // Our glibc is too old.
172   FUNCTION(tcgetwinsize, int (*f)(int, struct winsize*));
173 #endif
174   FUNCTION(tcsendbreak, int (*f)(int, int));
175   FUNCTION(tcsetattr, int (*f)(int, int, const struct termios*));
176 #if !defined(__GLIBC__)  // Our glibc is too old.
177   FUNCTION(tcsetwinsize, int (*f)(int, const struct winsize*));
178 #endif
179 }
180