Back to index

glibc  2.9
termios.h
Go to the documentation of this file.
00001 /* termios type and macro definitions.  Linux/MIPS version.
00002    Copyright (C) 1993, 94, 95, 96, 97, 99 Free Software Foundation, Inc.
00003    This file is part of the GNU C Library.
00004 
00005    The GNU C Library is free software; you can redistribute it and/or
00006    modify it under the terms of the GNU Lesser General Public
00007    License as published by the Free Software Foundation; either
00008    version 2.1 of the License, or (at your option) any later version.
00009 
00010    The GNU C Library is distributed in the hope that it will be useful,
00011    but WITHOUT ANY WARRANTY; without even the implied warranty of
00012    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
00013    Lesser General Public License for more details.
00014 
00015    You should have received a copy of the GNU Lesser General Public
00016    License along with the GNU C Library; if not, write to the Free
00017    Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
00018    02111-1307 USA.  */
00019 
00020 #ifndef _TERMIOS_H
00021 # error "Never include <bits/termios.h> directly; use <termios.h> instead."
00022 #endif
00023 
00024 typedef unsigned char       cc_t;
00025 typedef unsigned int speed_t;
00026 typedef unsigned int tcflag_t;
00027 
00028 #define NCCS 32
00029 struct termios
00030   {
00031     tcflag_t c_iflag;              /* input mode flags */
00032     tcflag_t c_oflag;              /* output mode flags */
00033     tcflag_t c_cflag;              /* control mode flags */
00034     tcflag_t c_lflag;              /* local mode flags */
00035     cc_t c_line;            /* line discipline */
00036     cc_t c_cc[NCCS];        /* control characters */
00037   };
00038 
00039 /* c_cc characters */
00040 #define VINTR        0      /* Interrupt character [ISIG].  */
00041 #define VQUIT        1      /* Quit character [ISIG].  */
00042 #define VERASE              2      /* Erase character [ICANON].  */
00043 #define VKILL        3      /* Kill-line character [ICANON].  */
00044 #define VMIN         4      /* Minimum number of bytes read at once [!ICANON].  */
00045 #define VTIME        5      /* Time-out value (tenths of a second) [!ICANON].  */
00046 #define VEOL2        6      /* Second EOL character [ICANON].  */
00047 #define VSWTC        7
00048 #define VSWTCH              VSWTC
00049 #define VSTART              8      /* Start (X-ON) character [IXON, IXOFF].  */
00050 #define VSTOP        9      /* Stop (X-OFF) character [IXON, IXOFF].  */
00051 #define VSUSP        10     /* Suspend character [ISIG].  */
00052                             /* VDSUSP is not supported on Linux. */
00053 /* #define VDSUSP    11     / * Delayed suspend character [ISIG].  */
00054 #define VREPRINT     12     /* Reprint-line character [ICANON].  */
00055 #define VDISCARD     13     /* Discard character [IEXTEN].  */
00056 #define VWERASE             14     /* Word-erase character [ICANON].  */
00057 #define VLNEXT              15     /* Literal-next character [IEXTEN].  */
00058 #define VEOF         16     /* End-of-file character [ICANON].  */
00059 #define VEOL         17     /* End-of-line character [ICANON].  */
00060 
00061 /* c_iflag bits */
00062 #define IGNBRK       0000001              /* Ignore break condition.  */
00063 #define BRKINT       0000002              /* Signal interrupt on break.  */
00064 #define IGNPAR       0000004              /* Ignore characters with parity errors.  */
00065 #define PARMRK       0000010              /* Mark parity and framing errors.  */
00066 #define INPCK 0000020              /* Enable input parity check.  */
00067 #define ISTRIP       0000040              /* Strip 8th bit off characters.  */
00068 #define INLCR 0000100              /* Map NL to CR on input.  */
00069 #define IGNCR 0000200              /* Ignore CR.  */
00070 #define ICRNL 0000400              /* Map CR to NL on input.  */
00071 #define IUCLC 0001000              /* Map upper case to lower case on input.  */
00072 #define IXON  0002000              /* Enable start/stop output control.  */
00073 #define IXANY 0004000              /* Any character will restart after stop.  */
00074 #define IXOFF 0010000              /* Enable start/stop input control.  */
00075 #define IMAXBEL 0020000            /* Ring bell when input queue is full.  */
00076 #define IUTF8 0040000              /* Input is UTF8.  */
00077 
00078 /* c_oflag bits */
00079 #define OPOST 0000001              /* Perform output processing.  */
00080 #define OLCUC 0000002              /* Map lower case to upper case on output.  */
00081 #define ONLCR 0000004              /* Map NL to CR-NL on output.  */
00082 #define OCRNL 0000010
00083 #define ONOCR 0000020
00084 #define ONLRET       0000040
00085 #define OFILL 0000100
00086 #define OFDEL 0000200
00087 #if defined __USE_MISC || defined __USE_XOPEN
00088 # define NLDLY       0000400
00089 # define   NL0       0000000
00090 # define   NL1       0000400
00091 # define CRDLY       0003000
00092 # define   CR0       0000000
00093 # define   CR1       0001000
00094 # define   CR2       0002000
00095 # define   CR3       0003000
00096 # define TABDLY      0014000
00097 # define   TAB0      0000000
00098 # define   TAB1      0004000
00099 # define   TAB2      0010000
00100 # define   TAB3      0014000
00101 # define BSDLY       0020000
00102 # define   BS0       0000000
00103 # define   BS1       0020000
00104 # define FFDLY       0100000
00105 # define   FF0       0000000
00106 # define   FF1       0100000
00107 #endif
00108 
00109 #define VTDLY 0040000
00110 #define   VT0 0000000
00111 #define   VT1 0040000
00112 
00113 #ifdef __USE_MISC
00114 # define XTABS  0014000
00115 #endif
00116 
00117 /* c_cflag bit meaning */
00118 #ifdef __USE_MISC
00119 # define CBAUD       0010017
00120 #endif
00121 #define  B0   0000000              /* hang up */
00122 #define  B50  0000001
00123 #define  B75  0000002
00124 #define  B110 0000003
00125 #define  B134 0000004
00126 #define  B150 0000005
00127 #define  B200 0000006
00128 #define  B300 0000007
00129 #define  B600 0000010
00130 #define  B1200       0000011
00131 #define  B1800       0000012
00132 #define  B2400       0000013
00133 #define  B4800       0000014
00134 #define  B9600       0000015
00135 #define  B19200      0000016
00136 #define  B38400      0000017
00137 #ifdef __USE_MISC
00138 # define EXTA B19200
00139 # define EXTB B38400
00140 #endif
00141 #define CSIZE 0000060              /* Number of bits per byte (mask).  */
00142 #define   CS5 0000000              /* 5 bits per byte.  */
00143 #define   CS6 0000020              /* 6 bits per byte.  */
00144 #define   CS7 0000040              /* 7 bits per byte.  */
00145 #define   CS8 0000060              /* 8 bits per byte.  */
00146 #define CSTOPB       0000100              /* Two stop bits instead of one.  */
00147 #define CREAD 0000200              /* Enable receiver.  */
00148 #define PARENB       0000400              /* Parity enable.  */
00149 #define PARODD       0001000              /* Odd parity instead of even.  */
00150 #define HUPCL 0002000              /* Hang up on last close.  */
00151 #define CLOCAL       0004000              /* Ignore modem status lines.  */
00152 #ifdef __USE_MISC
00153 # define CBAUDEX   0010000
00154 #endif
00155 #define  B57600   0010001
00156 #define  B115200  0010002
00157 #define  B230400  0010003
00158 #define  B460800  0010004
00159 #define  B500000  0010005
00160 #define  B576000  0010006
00161 #define  B921600  0010007
00162 #define  B1000000 0010010
00163 #define  B1152000 0010011
00164 #define  B1500000 0010012
00165 #define  B2000000 0010013
00166 #define  B2500000 0010014
00167 #define  B3000000 0010015
00168 #define  B3500000 0010016
00169 #define  B4000000 0010017
00170 #define __MAX_BAUD B4000000
00171 #ifdef __USE_MISC
00172 # define CIBAUD        002003600000       /* input baud rate (not used) */
00173 # define CRTSCTS  020000000000            /* flow control */
00174 #endif
00175 
00176 /* c_lflag bits */
00177 #define ISIG  0000001              /* Enable signals.  */
00178 #define ICANON       0000002              /* Do erase and kill processing.  */
00179 #if defined __USE_MISC || defined __USE_XOPEN
00180 # define XCASE       0000004
00181 #endif
00182 #define ECHO  0000010              /* Enable echo.  */
00183 #define ECHOE 0000020              /* Visual erase for ERASE.  */
00184 #define ECHOK 0000040              /* Echo NL after KILL.  */
00185 #define ECHONL       0000100              /* Echo NL even if ECHO is off.  */
00186 #define NOFLSH       0000200              /* Disable flush after interrupt.  */
00187 #define IEXTEN       0000400              /* Enable DISCARD and LNEXT.  */
00188 #ifdef __USE_MISC
00189 # define ECHOCTL 0001000    /* Echo control characters as ^X.  */
00190 # define ECHOPRT 0002000    /* Hardcopy visual erase.  */
00191 # define ECHOKE       0004000      /* Visual erase for KILL.  */
00192 # define FLUSHO      0020000
00193 # define PENDIN      0040000              /* Retype pending input (state).  */
00194 #endif
00195 #define TOSTOP       0100000              /* Send SIGTTOU for background output.  */
00196 #define ITOSTOP      TOSTOP
00197 
00198 /* ioctl (fd, TIOCSERGETLSR, &result) where result may be as below */
00199 #define TIOCSER_TEMT    0x01       /* Transmitter physically empty */
00200 
00201 /* tcflow() and TCXONC use these */
00202 #define       TCOOFF        0      /* Suspend output.  */
00203 #define       TCOON         1      /* Restart suspended output.  */
00204 #define       TCIOFF        2      /* Send a STOP character.  */
00205 #define       TCION         3      /* Send a START character.  */
00206 
00207 /* tcflush() and TCFLSH use these */
00208 #define       TCIFLUSH      0      /* Discard data received but not yet read.  */
00209 #define       TCOFLUSH      1      /* Discard data written but not yet sent.  */
00210 #define       TCIOFLUSH     2      /* Discard all pending data.  */
00211 
00212 /* tcsetattr uses these */
00213 #define       TCSANOW              0x540e /* Same as TCSETS; change immediately.  */
00214 #define       TCSADRAIN     0x540f /* Same as TCSETSW; change when pending output is written.  */
00215 #define       TCSAFLUSH     0x5410 /* Same as TCSETSF; flush pending input before changing.  */
00216 
00217 #define _IOT_termios /* Hurd ioctl type field.  */ \
00218   _IOT (_IOTS (cflag_t), 4, _IOTS (cc_t), NCCS, _IOTS (speed_t), 2)