summaryrefslogtreecommitdiff
path: root/termios.h
blob: 3199f48f0f69135b12d587ca2b6944341edbc716 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
#ifndef __TERMIOS_H__
#define __TERMIOS_H__

/*
UNG's Not GNU

MIT License

Copyright (c) 2011-2020 Jakob Kaivo <jkk@ung.org>

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
*/

#if defined _XOPEN_SOURCE && !defined _POSIX_C_SOURCE
#	if (_XOPEN_SOURCE >= 700)
#		define _POSIX_C_SOURCE 200809L
#	elif (_XOPEN_SOURCE >= 600)
#		define _POSIX_C_SOURCE 200112L
#	elif (_XOPEN_SOURCE >= 500)
#		define _POSIX_C_SOURCE 199506L
#	else
#		define _POSIX_C_SOURCE 2
#	endif
#endif

#if defined _POSIX_C_SOURCE && !defined _POSIX_SOURCE
#	define _POSIX_SOURCE
#endif

#if	(defined _POSIX_SOURCE)
/* ./src/termios/B0.c */
#define B0                                                                   (0)
/* ./src/termios/B110.c */
#define B110                                                               (0x3)
/* ./src/termios/B1200.c */
#define B1200                                                              (0x9)
/* ./src/termios/B134.c */
#define B134                                                               (0x4)
/* ./src/termios/B150.c */
#define B150                                                               (0x5)
/* ./src/termios/B1800.c */
#define B1800                                                              (0xA)
/* ./src/termios/B19200.c */
#define B19200                                                             (0xE)
/* ./src/termios/B200.c */
#define B200                                                               (0x6)
/* ./src/termios/B2400.c */
#define B2400                                                              (0xB)
/* ./src/termios/B300.c */
#define B300                                                               (0x7)
/* ./src/termios/B38400.c */
#define B38400                                                             (0xF)
/* ./src/termios/B4800.c */
#define B4800                                                              (0xC)
/* ./src/termios/B50.c */
#define B50                                                                (0x1)
/* ./src/termios/B600.c */
#define B600                                                               (0x8)
/* ./src/termios/B75.c */
#define B75                                                                (0x2)
/* ./src/termios/B9600.c */
#define B9600                                                              (0xD)
/* ./src/termios/BRKINT.c */
#define BRKINT                                                            (1<<4)
/* ./src/termios/CLOCAL.c */
#define CLOCAL                                                            (1<<7)
/* ./src/termios/CREAD.c */
#define CREAD                                                             (1<<3)
/* ./src/termios/CS5.c */
#define CS5                                                                (0x0)
/* ./src/termios/CS6.c */
#define CS6                                                                (0x1)
/* ./src/termios/CS7.c */
#define CS7                                                                (0x2)
/* ./src/termios/CS8.c */
#define CS8                                                                (0x3)
/* ./src/termios/CSIZE.c */
#define CSIZE                                                              (0x3)
/* ./src/termios/CSTOPB.c */
#define CSTOPB                                                            (1<<2)
/* ./src/termios/ECHO.c */
#define ECHO                                                              (1<<0)
/* ./src/termios/ECHOE.c */
#define ECHOE                                                             (1<<1)
/* ./src/termios/ECHOK.c */
#define ECHOK                                                             (1<<2)
/* ./src/termios/ECHONL.c */
#define ECHONL                                                            (1<<3)
/* ./src/termios/HUPCL.c */
#define HUPCL                                                             (1<<6)
/* ./src/termios/ICANON.c */
#define ICANON                                                            (1<<4)
/* ./src/termios/ICRNL.c */
#define ICRNL                                                             (1<<5)
/* ./src/termios/IEXTEN.c */
#define IEXTEN                                                            (1<<5)
/* ./src/termios/IGNBRK.c */
#define IGNBRK                                                            (1<<6)
/* ./src/termios/IGNCR.c */
#define IGNCR                                                             (1<<7)
/* ./src/termios/IGNPAR.c */
#define IGNPAR                                                            (1<<8)
/* ./src/termios/INLCR.c */
#define INLCR                                                             (1<<9)
/* ./src/termios/INPCK.c */
#define INPCK                                                            (1<<10)
/* ./src/termios/ISIG.c */
#define ISIG                                                              (1<<6)
/* ./src/termios/ISTRIP.c */
#define ISTRIP                                                           (1<<11)
/* ./src/termios/IXOFF.c */
#define IXOFF                                                            (1<<12)
/* ./src/termios/IXON.c */
#define IXON                                                             (1<<13)
/* ./src/termios/NCCS.c */
#define NCCS                                                                (11)
/* ./src/termios/NOFLSH.c */
#define NOFLSH                                                            (1<<7)
/* ./src/termios/OPOST.c */
#define OPOST                                                             (1<<4)
/* ./src/termios/PARENB.c */
#define PARENB                                                            (1<<4)
/* ./src/termios/PARMRK.c */
#define PARMRK                                                           (1<<14)
/* ./src/termios/PARODD.c */
#define PARODD                                                            (1<<5)
/* ./src/termios/TCIFLUSH.c */
#define TCIFLUSH                                                             (0)
/* ./src/termios/TCIOFF.c */
#define TCIOFF                                                               (0)
/* ./src/termios/TCIOFLUSH.c */
#define TCIOFLUSH                                                            (1)
/* ./src/termios/TCION.c */
#define TCION                                                                (1)
/* ./src/termios/TCOFLUSH.c */
#define TCOFLUSH /* TBD */
/* ./src/termios/TCOOFF.c */
#define TCOOFF                                                               (3)
/* ./src/termios/TCOON.c */
#define TCOON                                                                (4)
/* ./src/termios/TCSADRAIN.c */
#define TCSADRAIN                                                            (1)
/* ./src/termios/TCSAFLUSH.c */
#define TCSAFLUSH                                                            (2)
/* ./src/termios/TCSANOW.c */
#define TCSANOW                                                              (0)
/* ./src/termios/TOSTOP.c */
#define TOSTOP                                                            (1<<8)
/* ./src/termios/VEOF.c */
#define VEOF                                                                 (0)
/* ./src/termios/VEOL.c */
#define VEOL                                                                 (1)
/* ./src/termios/VERASE.c */
#define VERASE                                                               (2)
/* ./src/termios/VINTR.c */
#define VINTR                                                                (3)
/* ./src/termios/VKILL.c */
#define VKILL                                                                (4)
/* ./src/termios/VMIN.c */
#define VMIN                                                                 (5)
/* ./src/termios/VQUIT.c */
#define VQUIT                                                                (6)
/* ./src/termios/VSTART.c */
#define VSTART                                                               (7)
/* ./src/termios/VSTOP.c */
#define VSTOP                                                                (8)
/* ./src/termios/VSUSP.c */
#define VSUSP                                                                (9)
/* ./src/termios/VTIME.c */
#define VTIME                                                               (10)
#endif

#if	(defined _XOPEN_SOURCE)
/* ./src/termios/BS0.c */
#define BS0                                                                  (0)
/* ./src/termios/BS1.c */
#define BS1                                                              (1<<16)
/* ./src/termios/BSDLY.c */
#define BSDLY                                                            (1<<16)
/* ./src/termios/CR0.c */
#define CR0                                                                  (0)
/* ./src/termios/CR1.c */
#define CR1                                                              (1<<12)
/* ./src/termios/CR3.c */
#define CR3                                                    ((1<<12)|(1<<13))
/* ./src/termios/CRDLY.c */
#define CRDLY                                                  ((1<<12)|(1<<13))
/* ./src/termios/FF0.c */
#define FF0                                                                  (0)
/* ./src/termios/FF1.c */
#define FF1                                                              (1<<18)
/* ./src/termios/FFDLY.c */
#define FFDLY                                                            (1<<18)
/* ./src/termios/IUCLC.c */
#define IUCLC                                                            (1<<15)
/* ./src/termios/IXANY.c */
#define IXANY                                                            (1<<16)
/* ./src/termios/NL0.c */
#define NL0                                                                  (0)
/* ./src/termios/NL1.c */
#define NL1                                                              (1<<11)
/* ./src/termios/NLDLY.c */
#define NLDLY                                                            (1<<11)
/* ./src/termios/OCRNL.c */
#define OCRNL                                                             (1<<7)
/* ./src/termios/OFILL.c */
#define OFILL                                                            (1<<10)
/* ./src/termios/OLCUC.c */
#define OLCUC                                                             (1<<5)
/* ./src/termios/ONLCR.c */
#define ONLCR                                                             (1<<6)
/* ./src/termios/ONLRET.c */
#define ONLRET                                                            (1<<9)
/* ./src/termios/ONOCR.c */
#define ONOCR                                                             (1<<8)
/* ./src/termios/TAB0.c */
#define TAB0                                                                 (0)
/* ./src/termios/TAB1.c */
#define TAB1                                                             (1<<14)
/* ./src/termios/TAB2.c */
#define TAB2                                                             (1<<15)
/* ./src/termios/TAB3.c */
#define TAB3                                                   ((1<<14)|(1<<15))
/* ./src/termios/TABDLY.c */
#define TABDLY                                                 ((1<<14)|(1<<15))
/* ./src/termios/VT0.c */
#define VT0                                                                  (0)
/* ./src/termios/VT1.c */
#define VT1                                                              (1<<17)
/* ./src/termios/VTDLY.c */
#define VTDLY                                                            (1<<17)
/* ./src/termios/XCASE.c */
#define XCASE                                                             (1<<9)
#endif

#if	(defined _POSIX_SOURCE)
/* ./src/termios/cc_t.c */
#ifndef __TYPE_cc_t_DEFINED__
#define __TYPE_cc_t_DEFINED__
typedef int                                                                cc_t;
#endif

/* ./src/termios/speed_t.c */
#ifndef __TYPE_speed_t_DEFINED__
#define __TYPE_speed_t_DEFINED__
typedef int                                                             speed_t;
#endif

/* ./src/termios/tcflag_t.c */
#ifndef __TYPE_tcflag_t_DEFINED__
#define __TYPE_tcflag_t_DEFINED__
typedef unsigned int                                                   tcflag_t;
#endif

#endif

#if	(defined _POSIX_SOURCE)
/* ./src/termios/struct_termios.c */
#ifndef __TYPE_struct_termios_DEFINED__
#define __TYPE_struct_termios_DEFINED__
struct termios {
	tcflag_t c_iflag;
	tcflag_t c_oflag;
	tcflag_t c_cflag;
	tcflag_t c_lflag;
	cc_t c_cc[NCCS];
};
#endif

#endif

#if	(defined _POSIX_SOURCE)
/* ./src/termios/cfgetispeed.c */
speed_t cfgetispeed(const struct termios *__termios_p);
/* ./src/termios/cfgetospeed.c */
speed_t cfgetospeed(const struct termios *__termios_p);
/* ./src/termios/cfsetispeed.c */
int cfsetispeed(struct termios *__termios_p, speed_t __speed);
/* ./src/termios/cfsetospeed.c */
int cfsetospeed(struct termios *__termios_p, speed_t __speed);
/* ./src/termios/tcdrain.c */
int tcdrain(int __fildes);
/* ./src/termios/tcflow.c */
int tcflow(int __fildes, int __action);
/* ./src/termios/tcflush.c */
int tcflush(int __fildes, int __queue_selector);
/* ./src/termios/tcgetattr.c */
int tcgetattr(int __fildes, struct termios *__termios_p);
/* ./src/termios/tcsendbreak.c */
int tcsendbreak(int __fildes, int __duration);
/* ./src/termios/tcsetattr.c */
int tcsetattr(int __fildes, int __optional_actions, struct termios *__termios_p);
#endif

#if	(defined _POSIX_C_SOURCE && 200809 <= _POSIX_C_SOURCE) || \
	(defined _XOPEN_SOURCE && ((defined _XOPEN_SOURCE_EXTENDED && _XOPEN_SOURCE_EXTENDED == 1) || 500 <= _XOPEN_SOURCE))
/* ./src/termios/tcgetsid.c */
pid_t tcgetsid(int __fildes);
#endif


#endif