• Home
  • 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   MACRO(NCCS);
46 
47   MACRO(VEOF);
48   MACRO(VEOL);
49   MACRO(VERASE);
50   MACRO(VINTR);
51   MACRO(VKILL);
52   MACRO(VMIN);
53   MACRO(VQUIT);
54   MACRO(VSTART);
55   MACRO(VSTOP);
56   MACRO(VSUSP);
57   MACRO(VTIME);
58 
59   MACRO(BRKINT);
60   MACRO(ICRNL);
61   MACRO(IGNBRK);
62   MACRO(IGNCR);
63   MACRO(IGNPAR);
64   MACRO(INLCR);
65   MACRO(INPCK);
66   MACRO(ISTRIP);
67   MACRO(IXANY);
68   MACRO(IXOFF);
69   MACRO(IXON);
70   MACRO(PARMRK);
71 
72   MACRO(OPOST);
73   MACRO(ONLCR);
74   MACRO(OCRNL);
75   MACRO(ONOCR);
76   MACRO(ONLRET);
77   MACRO(OFDEL);
78   MACRO(OFILL);
79   MACRO(NLDLY);
80   MACRO(NL0);
81   MACRO(NL1);
82   MACRO(CRDLY);
83   MACRO(CR0);
84   MACRO(CR1);
85   MACRO(CR2);
86   MACRO(CR3);
87   MACRO(TABDLY);
88   MACRO(TAB0);
89   MACRO(TAB1);
90   MACRO(TAB2);
91   MACRO(TAB3);
92   MACRO(BSDLY);
93   MACRO(BS0);
94   MACRO(BS1);
95   MACRO(VTDLY);
96   MACRO(VT0);
97   MACRO(VT1);
98   MACRO(FFDLY);
99   MACRO(FF0);
100   MACRO(FF1);
101 
102   MACRO(B0);
103   MACRO(B50);
104   MACRO(B75);
105   MACRO(B110);
106   MACRO(B134);
107   MACRO(B150);
108   MACRO(B200);
109   MACRO(B300);
110   MACRO(B600);
111   MACRO(B1200);
112   MACRO(B1800);
113   MACRO(B2400);
114   MACRO(B4800);
115   MACRO(B9600);
116   MACRO(B19200);
117   MACRO(B38400);
118 
119   MACRO(CSIZE);
120   MACRO(CS5);
121   MACRO(CS6);
122   MACRO(CS7);
123   MACRO(CS8);
124   MACRO(CSTOPB);
125   MACRO(CREAD);
126   MACRO(PARENB);
127   MACRO(PARODD);
128   MACRO(HUPCL);
129   MACRO(CLOCAL);
130 
131   MACRO(ECHO);
132   MACRO(ECHOE);
133   MACRO(ECHOK);
134   MACRO(ECHONL);
135   MACRO(ICANON);
136   MACRO(IEXTEN);
137   MACRO(ISIG);
138   MACRO(NOFLSH);
139   MACRO(TOSTOP);
140 
141   MACRO(TCSANOW);
142   MACRO(TCSADRAIN);
143   MACRO(TCSAFLUSH);
144 
145   MACRO(TCIFLUSH);
146   MACRO(TCIOFLUSH);
147   MACRO(TCOFLUSH);
148 
149   MACRO(TCIOFF);
150   MACRO(TCION);
151   MACRO(TCOOFF);
152   MACRO(TCOON);
153 
154   TYPE(pid_t);
155 
156   FUNCTION(cfgetispeed, speed_t (*f)(const struct termios*));
157   FUNCTION(cfgetospeed, speed_t (*f)(const struct termios*));
158   FUNCTION(cfsetispeed, int (*f)(struct termios*, speed_t));
159   FUNCTION(cfsetospeed, int (*f)(struct termios*, speed_t));
160   FUNCTION(tcdrain, int (*f)(int));
161   FUNCTION(tcflow, int (*f)(int, int));
162   FUNCTION(tcflush, int (*f)(int, int));
163   FUNCTION(tcgetattr, int (*f)(int, struct termios*));
164   FUNCTION(tcgetsid, pid_t (*f)(int));
165   FUNCTION(tcsendbreak, int (*f)(int, int));
166   FUNCTION(tcsetattr, int (*f)(int, int, const struct termios*));
167 }
168