1
# These lines were mostly generated by h2py.py (see demo/scripts)
2
# from <sys/ioctl.h>, <sys/termio.h> and <termios.h> on Irix 4.0.2
3
# with some manual changes to cope with imperfections in h2py.py.
4
# The applicability on other systems is not clear; especially non-SYSV
5
# systems may have a totally different set of ioctls.
21
IOC_INOUT = (IOC_IN|IOC_OUT)
25
def sizeof(t): import struct; return struct.calcsize(t)
26
def _IO(x,y): return (IOC_VOID|((x)<<8)|y)
27
def _IOR(x,y,t): return (IOC_OUT|((sizeof(t)&IOCPARM_MASK)<<16)|((x)<<8)|y)
28
def _IOW(x,y,t): return (IOC_IN|((sizeof(t)&IOCPARM_MASK)<<16)|((x)<<8)|y)
29
# this should be _IORW, but stdio got there first
30
def _IOWR(x,y,t): return (IOC_INOUT|((sizeof(t)&IOCPARM_MASK)<<16)|((x)<<8)|y)
31
FIONREAD = _IOR(ord('f'), 127, int)
32
FIONBIO = _IOW(ord('f'), 126, int)
33
FIOASYNC = _IOW(ord('f'), 125, int)
34
FIOSETOWN = _IOW(ord('f'), 124, int)
35
FIOGETOWN = _IOR(ord('f'), 123, int)
39
NCCS = (NCC+NCC_PAD+NCC_EXT)
50
VLNEXT = (NCC+NCC_PAD+0)
51
VWERASE = (NCC+NCC_PAD+1)
52
VRPRNT = (NCC+NCC_PAD+2)
53
VFLUSHO = (NCC+NCC_PAD+3)
54
VSTOP = (NCC+NCC_PAD+4)
55
VSTART = (NCC+NCC_PAD+5)
62
def CTRL(c): return ord(c) & 0x0f
177
TIOCFLUSH = (TIOC|12)
182
TIOCPKT_FLUSHREAD = 0x01
183
TIOCPKT_FLUSHWRITE = 0x02
184
TIOCPKT_NOSTOP = 0x10
185
TIOCPKT_DOSTOP = 0x20
186
TIOCNOTTY = (TIOC|113)
188
TIOCSPGRP = _IOW(ord('t'), 118, int)
189
TIOCGPGRP = _IOR(ord('t'), 119, int)
190
TIOCCONS = _IOW(ord('t'), 120, int)
191
struct_winsize = 'hhhh'
192
TIOCGWINSZ = _IOR(ord('t'), 104, struct_winsize)
193
TIOCSWINSZ = _IOW(ord('t'), 103, struct_winsize)
194
TFIOC = (ord('F')<<8)
195
oFIONREAD = (TFIOC|127)
196
LDIOC = (ord('D')<<8)