add tcgetwinsize and tcsetwinsize functions, move struct winsize
[musl] / include / termios.h
1 #ifndef _TERMIOS_H
2 #define _TERMIOS_H
3
4 #ifdef __cplusplus
5 extern "C" {
6 #endif
7
8 #include <features.h>
9
10 #define __NEED_pid_t
11
12 #include <bits/alltypes.h>
13
14 typedef unsigned char cc_t;
15 typedef unsigned int speed_t;
16 typedef unsigned int tcflag_t;
17
18 struct winsize {
19         unsigned short ws_row;
20         unsigned short ws_col;
21         unsigned short ws_xpixel;
22         unsigned short ws_ypixel;
23 };
24
25 #define NCCS 32
26
27 #include <bits/termios.h>
28
29 speed_t cfgetospeed (const struct termios *);
30 speed_t cfgetispeed (const struct termios *);
31 int cfsetospeed (struct termios *, speed_t);
32 int cfsetispeed (struct termios *, speed_t);
33
34 int tcgetattr (int, struct termios *);
35 int tcsetattr (int, int, const struct termios *);
36
37 int tcgetwinsize (int, struct winsize *);
38 int tcsetwinsize (int, const struct winsize *);
39
40 int tcsendbreak (int, int);
41 int tcdrain (int);
42 int tcflush (int, int);
43 int tcflow (int, int);
44
45 pid_t tcgetsid (int);
46
47 #if defined(_GNU_SOURCE) || defined(_BSD_SOURCE)
48 void cfmakeraw(struct termios *);
49 int cfsetspeed(struct termios *, speed_t);
50 #endif
51
52 #ifdef __cplusplus
53 }
54 #endif
55
56 #endif