Subversion Repositories Kolibri OS

Rev

Details | Last modification | View Log | RSS feed

Rev Author Line No. Line
4973 right-hear 1
/* Copyright (C) 1996 DJ Delorie, see COPYING.DJ for details */
2
/* Copyright (C) 1995 DJ Delorie, see COPYING.DJ for details */
3
#ifndef __dj_include_sys_termios_h_
4
#define __dj_include_sys_termios_h_
5
 
6
#ifdef __cplusplus
7
extern "C" {
8
#endif
9
 
10
#ifndef __dj_ENFORCE_ANSI_FREESTANDING
11
 
12
#ifndef __STRICT_ANSI__
13
 
14
#define B0	0x00000000
15
#define B50	0x00000001
16
#define B75	0x00000002
17
#define B110	0x00000003
18
#define B134	0x00000004
19
#define B150	0x00000005
20
#define B200	0x00000006
21
#define B300	0x00000007
22
#define B600	0x00000008
23
#define B1200	0x00000009
24
#define B1800	0x0000000a
25
#define B2400	0x0000000b
26
#define B4800	0x0000000c
27
#define B9600	0x0000000d
28
#define B19200	0x0000000e
29
#define B38400	0x0000000f
30
 
31
#define BRKINT	0x00000100
32
#define ICRNL	0x00000200
33
#define IGNBRK	0x00000400
34
#define IGNCR	0x00000800
35
#define IGNPAR	0x00001000
36
#define INLCR	0x00002000
37
#define INPCK	0x00004000
38
#define ISTRIP	0x00008000
39
#define IXOFF	0x00010000
40
#define IXON	0x00020000
41
#define PARMRK	0x00040000
42
 
43
#define OPOST	0x00000100
44
 
45
#define CLOCAL	0x00000100
46
#define CREAD	0x00000200
47
#define CS5	0x00000000
48
#define CS6	0x00000400
49
#define CS7	0x00000800
50
#define CS8	0x00000c00
51
#define CSIZE	0x00000c00
52
#define CSTOPB	0x00001000
53
#define HUPCL	0x00002000
54
#define PARENB	0x00004000
55
#define PARODD	0x00008000
56
 
57
#define ECHO	0x00000100
58
#define ECHOE	0x00000200
59
#define ECHOK	0x00000400
60
#define ECHONL	0x00000800
61
#define ICANON	0x00001000
62
#define IEXTEN	0x00002000
63
#define ISIG	0x00004000
64
#define NOFLSH	0x00008000
65
#define TOSTOP	0x00010000
66
 
67
#define TCIFLUSH	1
68
#define TCOFLUSH	2
69
#define TCIOFLUSH	3
70
#define TCOOFF		1
71
#define TCOON		2
72
#define TCIOFF		3
73
#define TCION		4
74
 
75
#define TCSADRAIN	1
76
#define TCSAFLUSH	2
77
#define TCSANOW		3
78
 
79
#define VEOF	1
80
#define VEOL	2
81
#define VERASE	3
82
#define VINTR	4
83
#define VKILL	5
84
#define VMIN	6
85
#define VQUIT	7
86
#define VSTART	8
87
#define VSTOP	9
88
#define VSUSP	10
89
#define VTIME	11
90
#define NCCS	12
91
 
92
typedef unsigned cc_t;
93
typedef unsigned speed_t;
94
typedef unsigned tcflag_t;
95
 
96
struct termios {
97
  cc_t		c_cc[NCCS];
98
  tcflag_t	c_cflag;
99
  tcflag_t	c_iflag;
100
  tcflag_t	c_lflag;
101
  tcflag_t	c_oflag;
102
  speed_t	c_ispeed;
103
  speed_t	c_ospeed;
104
};
105
 
106
speed_t	cfgetispeed(const struct termios *_termios_p);
107
speed_t	cfgetospeed(const struct termios *_termios_p);
108
int	cfsetispeed(struct termios *_termios_p, speed_t _speed);
109
int	cfsetospeed(struct termios *_termios_p, speed_t _speed);
110
int	tcdrain(int _fildes);
111
int	tcflow(int _fildes, int _action);
112
int	tcflush(int _fildes, int _queue_selector);
113
int	tcgetattr(int _fildes, struct termios *_termios_p);
114
int	tcsendbreak(int _fildes, int _duration);
115
int	tcsetattr(int _fildes, int _optional_actions, const struct termios *_termios_p);
116
 
117
#ifndef _POSIX_SOURCE
118
 
119
/* Input flags */
120
#define IMAXBEL	0x01000000	/* ring bell on input queue full */
121
 
122
/* Local flags */
123
#define ECHOKE	0x01000000	/* visual erase for line kill */
124
#define ECHOCTL	0x02000000	/* echo control chars as ^x */
125
 
126
/* Output flags */
127
#define ONLCR	0x00000200	/* map NL to CRNL */
128
#define OCRNL	0x00000400	/* map CR to NL */
129
#define ONOEOT	0x00000800	/* discard EOT's (^D) on output */
130
 
131
/* for compatibility */
132
void	cfmakeraw(struct termios *_termios_p);
133
int	cfsetspeed(struct termios *_termios_p, speed_t _speed);
134
 
135
#endif /* !_POSIX_SOURCE */
136
#endif /* !__STRICT_ANSI__ */
137
#endif /* !__dj_ENFORCE_ANSI_FREESTANDING */
138
 
139
#ifndef __dj_ENFORCE_FUNCTION_CALLS
140
#endif /* !__dj_ENFORCE_FUNCTION_CALLS */
141
 
142
#ifdef __cplusplus
143
}
144
#endif
145
 
146
#endif /* !__dj_include_sys_termios_h_ */