Welcome to The Fiwix Project
A UNIX-like kernel for the i386 architecture
1 /* 2 * fiwix/include/fiwix/termbits.h 3 * 4 */ 5 6 #ifndef _FIWIX_TERMBITS_H 7 #define _FIWIX_TERMBITS_H 8 9 /* These definitions match those used by the 4.4 BSD kernel. 10 If the operating system has termios system calls or ioctls that 11 correctly implement the POSIX.1 behavior, there should be a 12 system-dependent version of this file that defines `struct termios', 13 `tcflag_t', `cc_t', `speed_t' and the `TC*' constants appropriately. */ 14 15 /* Type of terminal control flag masks. */ 16 typedef unsigned long int tcflag_t; 17 18 /* Type of control characters. */ 19 typedef unsigned char cc_t; 20 21 /* Type of baud rate specifiers. */ 22 typedef long int speed_t; 23 24 /* c_iflag bits */ 25 #define IGNBRK 0000001 /* Ignore break condition */ 26 #define BRKINT 0000002 /* Signal interrupt on break */ 27 #define IGNPAR 0000004 /* Ignore characters with parity errors */ 28 #define PARMRK 0000010 /* Mark parity and framing errors */ 29 #define INPCK 0000020 /* Enable input parity check */ 30 #define ISTRIP 0000040 /* Strip 8th bit off characters */ 31 #define INLCR 0000100 /* Map NL to CR on input */ 32 #define IGNCR 0000200 /* Ignore CR */ 33 #define ICRNL 0000400 /* Map CR to NL on input */ 34 #define IUCLC 0001000 /* Convert to lowercase */ 35 #define IXON 0002000 /* Enable start/stop output control */ 36 #define IXANY 0004000 /* Any character will restart after stop */ 37 #define IXOFF 0010000 /* Enable start/stop input control */ 38 #define IMAXBEL 0020000 /* Ring bell when input queue is full */ 39 40 /* c_oflag bits */ 41 #define OPOST 0000001 /* Perform output processing */ 42 #define OLCUC 0000002 43 #define ONLCR 0000004 /* Map NL to CR-NL on output */ 44 #define OCRNL 0000010 45 #define ONOCR 0000020 46 #define ONLRET 0000040 47 #define OFILL 0000100 48 #define OFDEL 0000200 49 #define NLDLY 0000400 50 #define NL0 0000000 51 #define NL1 0000400 52 #define CRDLY 0003000 53 #define CR0 0000000 54 #define CR1 0001000 55 #define CR2 0002000 56 #define CR3 0003000 57 #define TABDLY 0014000 58 #define TAB0 0000000 59 #define TAB1 0004000 60 #define TAB2 0010000 61 #define TAB3 0014000 62 #define XTABS 0014000 63 #define BSDLY 0020000 64 #define BS0 0000000 65 #define BS1 0020000 66 #define VTDLY 0040000 67 #define VT0 0000000 68 #define VT1 0040000 69 #define FFDLY 0100000 70 #define FF0 0000000 71 #define FF1 0100000 72 73 /* c_cflag bit meaning */ 74 #define CBAUD 0010017 75 #define B0 0000000 /* hang up */ 76 #define B50 0000001 /* 50 baud */ 77 #define B75 0000002 /* 75 baud */ 78 #define B110 0000003 /* 110 baud */ 79 #define B134 0000004 /* 134 baud */ 80 #define B150 0000005 /* 150 baud */ 81 #define B200 0000006 /* 200 baud */ 82 #define B300 0000007 /* 300 baud */ 83 #define B600 0000010 /* 600 baud */ 84 #define B1200 0000011 /* 1200 baud */ 85 #define B1800 0000012 /* 1800 baud */ 86 #define B2400 0000013 /* 2400 baud */ 87 #define B4800 0000014 /* 4800 baud */ 88 #define B9600 0000015 /* 9600 baud */ 89 #define B19200 0000016 /* 19200 baud */ 90 #define B38400 0000017 /* 38400 baud */ 91 #define EXTA B19200 92 #define EXTB B38400 93 #define CSIZE 0000060 /* Number of bits per byte (mask) */ 94 #define CS5 0000000 /* 5 bits per byte */ 95 #define CS6 0000020 /* 6 bits per byte */ 96 #define CS7 0000040 /* 7 bits per byte */ 97 #define CS8 0000060 /* 8 bits per byte */ 98 #define CSTOPB 0000100 /* Two stop bits instead of one */ 99 #define CREAD 0000200 /* Enable receiver */ 100 #define PARENB 0000400 /* Parity enable */ 101 #define PARODD 0001000 /* Odd parity instead of even */ 102 #define HUPCL 0002000 /* Hang up on last close */ 103 #define CLOCAL 0004000 /* Ignore modem status lines */ 104 #define CBAUDEX 0010000 105 #define B57600 0010001 106 #define B115200 0010002 107 #define B230400 0010003 108 #define B460800 0010004 109 #define B500000 0010005 110 #define B576000 0010006 111 #define B921600 0010007 112 #define B1000000 0010010 113 #define B1152000 0010011 114 #define B1500000 0010012 115 #define B2000000 0010013 116 #define B2500000 0010014 117 #define B3000000 0010015 118 #define B3500000 0010016 119 #define B4000000 0010017 120 #define CIBAUD 002003600000 /* input baud rate (not used) */ 121 #define CMSPAR 010000000000 /* mark or space (stick) parity */ 122 #define CRTSCTS 020000000000 /* flow control */ 123 124 /* c_lflag bits */ 125 #define ISIG 0000001 /* Enable signals */ 126 #define ICANON 0000002 /* Do erase and kill processing */ 127 #define XCASE 0000004 128 #define ECHO 0000010 /* Enable echo */ 129 #define ECHOE 0000020 /* Visual erase for ERASE */ 130 #define ECHOK 0000040 /* Echo NL after KILL */ 131 #define ECHONL 0000100 /* Echo NL even if echo is OFF */ 132 #define NOFLSH 0000200 /* Disable flush after interrupt */ 133 #define TOSTOP 0000400 /* Send SIGTTOU for background output */ 134 #define ECHOCTL 0001000 /* Echo control characters as ^X */ 135 #define ECHOPRT 0002000 /* Hardcopy visual erase */ 136 #define ECHOKE 0004000 /* Visual erase for KILL */ 137 #define FLUSHO 0010000 /* Output being flushed (state) */ 138 #define PENDIN 0040000 /* Retype pending input (state) */ 139 #define IEXTEN 0100000 /* Enable DISCARD and LNEXT */ 140 141 /* c_cc characters */ 142 #define VINTR 0 /* Interrupt character [ISIG] */ 143 #define VQUIT 1 /* Quit character [ISIG] */ 144 #define VERASE 2 /* Erase character [ICANON] */ 145 #define VKILL 3 /* Kill-line character [ICANON] */ 146 #define VEOF 4 /* End-of-file character [ICANON] */ 147 #define VTIME 5 /* Time-out value (1/10 secs) [!ICANON] */ 148 #define VMIN 6 /* Minimum # of bytes read at once [!ICANON] */ 149 #define VSWTC 7 150 #define VSTART 8 /* Start (X-ON) character [IXON, IXOFF] */ 151 #define VSTOP 9 /* Stop (X-OFF) character [IXON, IXOFF] */ 152 #define VSUSP 10 /* Suspend character [ISIG] */ 153 #define VEOL 11 /* End-of-line character [ICANON] */ 154 #define VREPRINT 12 /* Reprint-line character [ICANON] */ 155 #define VDISCARD 13 /* Discard character [IEXTEN] */ 156 #define VWERASE 14 /* Word-erase character [ICANON] */ 157 #define VLNEXT 15 /* Literal-next character [IEXTEN] */ 158 #define VEOL2 16 /* Second EOL character [ICANON] */ 159 160 /* Values for the ACTION argument to `tcflow'. */ 161 #define TCOOFF 0 /* Suspend output */ 162 #define TCOON 1 /* Restart suspended output */ 163 #define TCIOFF 2 /* Send a STOP character */ 164 #define TCION 3 /* Send a START character */ 165 166 /* Values for the QUEUE_SELECTOR argument to `tcflush'. */ 167 #define TCIFLUSH 0 /* Discard data received but not yet read */ 168 #define TCOFLUSH 1 /* Discard data written but not yet sent */ 169 #define TCIOFLUSH 2 /* Discard all pending data */ 170 171 /* Values for the OPTIONAL_ACTIONS argument to `tcsetattr'. */ 172 #define TCSANOW 0 /* Change immediately */ 173 #define TCSADRAIN 1 /* Change when pending output is written */ 174 #define TCSAFLUSH 2 /* Flush pending input before changing */ 175 176 #endif /* _FIWIX_TERMBITS_H */