summaryrefslogtreecommitdiffstats
path: root/Lib/plat-freebsd3/TERMIOS.py
blob: b0e3d280173774333b48e1e7a947500199cad1c6 (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
# Generated by h2py from /usr/include/termios.h
VEOF = 0
VEOL = 1
VEOL2 = 2
VERASE = 3
VWERASE = 4
VKILL = 5
VREPRINT = 6
VINTR = 8
VQUIT = 9
VSUSP = 10
VDSUSP = 11
VSTART = 12
VSTOP = 13
VLNEXT = 14
VDISCARD = 15
VMIN = 16
VTIME = 17
VSTATUS = 18
NCCS = 20
_POSIX_VDISABLE = 0xff
IGNBRK = 0x00000001
BRKINT = 0x00000002
IGNPAR = 0x00000004
PARMRK = 0x00000008
INPCK = 0x00000010
ISTRIP = 0x00000020
INLCR = 0x00000040
IGNCR = 0x00000080
ICRNL = 0x00000100
IXON = 0x00000200
IXOFF = 0x00000400
IXANY = 0x00000800
IMAXBEL = 0x00002000
OPOST = 0x00000001
ONLCR = 0x00000002
OXTABS = 0x00000004
ONOEOT = 0x00000008
CIGNORE = 0x00000001
CSIZE = 0x00000300
CS5 = 0x00000000
CS6 = 0x00000100
CS7 = 0x00000200
CS8 = 0x00000300
CSTOPB = 0x00000400
CREAD = 0x00000800
PARENB = 0x00001000
PARODD = 0x00002000
HUPCL = 0x00004000
CLOCAL = 0x00008000
CCTS_OFLOW = 0x00010000
CRTS_IFLOW = 0x00020000
CDTR_IFLOW = 0x00040000
CDSR_OFLOW = 0x00080000
CCAR_OFLOW = 0x00100000
MDMBUF = 0x00100000
ECHOKE = 0x00000001
ECHOE = 0x00000002
ECHOK = 0x00000004
ECHO = 0x00000008
ECHONL = 0x00000010
ECHOPRT = 0x00000020
ECHOCTL = 0x00000040
ISIG = 0x00000080
ICANON = 0x00000100
ALTWERASE = 0x00000200
IEXTEN = 0x00000400
EXTPROC = 0x00000800
TOSTOP = 0x00400000
FLUSHO = 0x00800000
NOKERNINFO = 0x02000000
PENDIN = 0x20000000
NOFLSH = 0x80000000
TCSANOW = 0
TCSADRAIN = 1
TCSAFLUSH = 2
TCSASOFT = 0x10
B0 = 0
B50 = 50
B75 = 75
B110 = 110
B134 = 134
B150 = 150
B200 = 200
B300 = 300
B600 = 600
B1200 = 1200
B1800 = 1800
B2400 = 2400
B4800 = 4800
B9600 = 9600
B19200 = 19200
B38400 = 38400
B7200 = 7200
B14400 = 14400
B28800 = 28800
B57600 = 57600
B76800 = 76800
B115200 = 115200
B230400 = 230400
EXTA = 19200
EXTB = 38400
TCIFLUSH = 1
TCOFLUSH = 2
TCIOFLUSH = 3
TCOOFF = 1
TCOON = 2
TCIOFF = 3
TCION = 4

# Included from sys/cdefs.h
def __P(protos): return protos		 

def __STRING(x): return #x		 

def __XSTRING(x): return __STRING(x)	 

def __P(protos): return ()		 

def __STRING(x): return "x"

def __RCSID(s): return __IDSTRING(rcsid,s)

def __RCSID_SOURCE(s): return __IDSTRING(rcsid_source,s)

def __COPYRIGHT(s): return __IDSTRING(copyright,s)


# Included from sys/ttycom.h

# Included from sys/ioccom.h
IOCPARM_MASK = 0x1fff
def IOCPARM_LEN(x): return (((x) >> 16) & IOCPARM_MASK)

def IOCBASECMD(x): return ((x) & ~(IOCPARM_MASK << 16))

def IOCGROUP(x): return (((x) >> 8) & 0xff)

IOC_VOID = 0x20000000
IOC_OUT = 0x40000000
IOC_IN = 0x80000000
IOC_INOUT = (IOC_IN|IOC_OUT)
IOC_DIRMASK = 0xe0000000
TIOCM_LE = 0001
TIOCM_DTR = 0002
TIOCM_RTS = 0004
TIOCM_ST = 0010
TIOCM_SR = 0020
TIOCM_CTS = 0040
TIOCM_CAR = 0100
TIOCM_CD = TIOCM_CAR
TIOCM_RNG = 0200
TIOCM_RI = TIOCM_RNG
TIOCM_DSR = 0400
TIOCPKT_DATA = 0x00
TIOCPKT_FLUSHREAD = 0x01
TIOCPKT_FLUSHWRITE = 0x02
TIOCPKT_STOP = 0x04
TIOCPKT_START = 0x08
TIOCPKT_NOSTOP = 0x10
TIOCPKT_DOSTOP = 0x20
TIOCPKT_IOCTL = 0x40
def UIOCCMD(n): return _IO(ord('u'), n)	 

TTYDISC = 0
TABLDISC = 3
SLIPDISC = 4
PPPDISC = 5

# Included from sys/ttydefaults.h
TTYDEF_IFLAG = (BRKINT	| ICRNL	| IMAXBEL | IXON | IXANY)
TTYDEF_OFLAG = (OPOST | ONLCR)
TTYDEF_LFLAG = (ECHO | ICANON | ISIG | IEXTEN | ECHOE|ECHOKE|ECHOCTL)
TTYDEF_CFLAG = (CREAD | CS8 | HUPCL)
TTYDEF_SPEED = (B9600)
def CTRL(x): return (x&037)

CEOF = CTRL(ord('d'))
CEOL = 0xff
CERASE = 0177
CINTR = CTRL(ord('c'))
CSTATUS = CTRL(ord('t'))
CKILL = CTRL(ord('u'))
CMIN = 1
CQUIT = 034
CSUSP = CTRL(ord('z'))
CTIME = 0
CDSUSP = CTRL(ord('y'))
CSTART = CTRL(ord('q'))
CSTOP = CTRL(ord('s'))
CLNEXT = CTRL(ord('v'))
CDISCARD = CTRL(ord('o'))
CWERASE = CTRL(ord('w'))
CREPRINT = CTRL(ord('r'))
CEOT = CEOF
CBRK = CEOL
CRPRNT = CREPRINT
CFLUSH = CDISCARD