/********************************************************************** * file: h/termio.h * part#: * internal sequence#: * * ************************************************************* * * " c Copyright Hewlett-Packard Company, 1984.* All * * * rights are reserved. Copying or other reproduction * * * of this program except for archival purposes is * * * prohibited without the prior written consent of * * * Hewlett-Packard Company." * * ************************************************************* * * Pisces Q-DOS project * Fred Taft * ------------------------------------------------------- * initial 4-83 fdt * * Added minor device bit definitions. 8/22/84 fdt * *********************************************************************/ /* Minor device bits */ #define CCITT_MODE 0x0001 #define SIMPLE_MODE 0x0002 #define DEV_TTY 0x0010 #define DEV_CUL 0x0020 #define DEV_TTYD 0x0040 #define NCC 8 /* Number of settable control characters */ /* Indices into control character array */ #define VINTR 0 #define VQUIT 1 #define VERASE 2 #define VKILL 3 #define VEOF 4 #define VEOL 5 #define VMIN 4 #define VTIME 5 /* Fill characters */ #define CNUL 0 /* Ascii null character */ #define CDEL 0377 /* Ascii del character */ /* Default control chars */ #define CESC '\\' /* Escape character */ #define CINTR 0177 /* DEL */ #define CQUIT 034 /* cntl | */ #define CERASE '#' /* # */ #define CKILL '@' /* @ */ #define CEOF 04 /* cntl d */ #define CSTART 021 /* cntl q */ #define CSTOP 023 /* cntl s */ /* input modes */ #define IGNBRK 0000001 /* Ignore received break */ #define BRKINT 0000002 /* Signal interrupt on received break */ #define IGNPAR 0000004 /* Ignore characters with parity errors */ #define PARMRK 0000010 /* Mark characters with parity errors */ #define INPCK 0000020 /* Enable input parity checking */ #define ISTRIP 0000040 /* Strip chracters down to 7 bits */ #define INLCR 0000100 /* Map NL to CR on input */ #define IGNCR 0000200 /* Ignore CR */ #define ICRNL 0000400 /* Map CR to NL on input */ #define IUCLC 0001000 /* Map upper-case to lower-case on input */ #define IXON 0002000 /* Enable start/stop output control */ #define IXANY 0004000 /* Enable any character to restart output */ #define IXOFF 0010000 /* Enable start/stop input control */ #define IENQAK 0020000 /* output modes */ #define OPOST 0000001 /* Enable postprocessing of output */ #define OLCUC 0000002 /* Map lower-case to upper-case on output */ #define ONLCR 0000004 /* Map NL to CR-NL on output */ #define OCRNL 0000010 /* Map CR to NL on output */ #define ONOCR 0000020 /* No CR output at column 0 */ #define ONLRET 0000040 /* NL performs CR function */ #define OFILL 0000100 /* Use fill characters for delays */ #define OFDEL 0000200 /* Fill character is DEL, else NUL */ #define NLDLY 0000400 /* Select new-line delays */ #define NL0 0 #define NL1 0000400 #define CRDLY 0003000 /* Select carriage-return delays */ #define CR0 0 #define CR1 0001000 #define CR2 0002000 #define CR3 0003000 #define TABDLY 0014000 /* Select horizontal-tab delays */ #define TAB0 0 #define TAB1 0004000 #define TAB2 0010000 #define TAB3 0014000 #define BSDLY 0020000 /* Select backspace delays */ #define BS0 0 #define BS1 0020000 #define VTDLY 0040000 /* Select vertical-tab delays */ #define VT0 0 #define VT1 0040000 #define FFDLY 0100000 /* Select form-feed delays */ #define FF0 0 #define FF1 0100000 /* control modes */ #define CBAUD 0000037 #define B0 0 /* hangup */ #define B50 0000001 /* 50 baud */ #define B75 0000002 /* 75 baud */ #define B110 0000003 /* 110 baud */ #define B134 0000004 /* 134.5 baud */ #define B150 0000005 /* 150 baud */ #define B200 0000006 /* 200 baud */ #define B300 0000007 /* 300 baud */ #define B600 0000010 /* 600 baud */ #define B900 0000011 /* 900 baud */ #define B1200 0000012 /* 1200 baud */ #define B1800 0000013 /* 1800 baud */ #define B2400 0000014 /* 2400 baud */ #define B3600 0000015 /* 3600 baud */ #define B4800 0000016 /* 4800 baud */ #define B7200 0000017 /* 7200 baud */ #define B9600 0000020 /* 9600 baud */ #define B19200 0000021 /* 19200 baud */ #define B38400 0000022 /* 38400 baud */ #define EXTA 0000036 /* External baud rate A */ #define EXTB 0000037 /* External baud rate B */ #define CSIZE 0000140 #define CS5 0 /* Use 5 data bits */ #define CS6 0000040 /* Use 6 data bits */ #define CS7 0000100 /* Use 7 data bits */ #define CS8 0000140 /* Use 8 data bits */ #define CSTOPB 0000200 /* Send two stop bits, else one */ #define CREAD 0000400 /* Enable receiver */ #define PARENB 0001000 /* Enable parity */ #define PARODD 0002000 /* Odd parity, else even */ #define HUPCL 0004000 /* Hangup on last close */ #define CLOCAL 0010000 /* Local line, else dial-up */ /* line discipline 0 modes */ #define ISIG 0000001 /* Enable signals */ #define ICANON 0000002 /* Enable canonical input (cooked mode) */ #define XCASE 0000004 /* Canonical upper/lower case presentation */ #define ECHO 0000010 /* Enable echo */ #define ECHOE 0000020 /* Echo erase character as BS-SP-BS */ #define ECHOK 0000040 /* Echo NL after kill character */ #define ECHONL 0000100 /* Echo NL */ #define NOFLSH 0000200 /* Disable flush after interrupt or quit */ #define SSPEED 7 /* default speed: 300 baud */ /* * Ioctl control packet */ struct termio { unsigned short c_iflag; /* input modes */ unsigned short c_oflag; /* output modes */ unsigned short c_cflag; /* control modes */ unsigned short c_lflag; /* line discipline modes */ char c_line; /* line discipline */ unsigned char c_cc[NCC]; /* control chars */ }; #define IOCTYPE 0xff00 #define TIOC ('T'<<8) #define TCGETA (TIOC|1) #define TCSETA (TIOC|2) #define TCSETAW (TIOC|3) #define TCSETAF (TIOC|4) #define TCSBRK (TIOC|5) #define TCXONC (TIOC|6) #define TCFLSH (TIOC|7) #define MCGETA (TIOC|8) #define MCSETA (TIOC|9) #define MCSETAW (TIOC|10) #define MCSETAF (TIOC|11) #define MCGETT (TIOC|12) #define MCSETT (TIOC|13) #define TCDSET (TIOC|32) #define LDIOC ('D'<<8) #define LDOPEN (LDIOC|0) #define LDCLOSE (LDIOC|1)