Back to index

glibc  2.9
termios.h
Go to the documentation of this file.
00001 /* termios type and macro definitions.  Linux version.
00002    Copyright (C) 1993, 1994, 1995, 1996, 1997, 1999, 2003, 2005
00003        Free Software Foundation, Inc.
00004    This file is part of the GNU C Library.
00005 
00006    The GNU C Library is free software; you can redistribute it and/or
00007    modify it under the terms of the GNU Lesser General Public
00008    License as published by the Free Software Foundation; either
00009    version 2.1 of the License, or (at your option) any later version.
00010 
00011    The GNU C Library is distributed in the hope that it will be useful,
00012    but WITHOUT ANY WARRANTY; without even the implied warranty of
00013    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
00014    Lesser General Public License for more details.
00015 
00016    You should have received a copy of the GNU Lesser General Public
00017    License along with the GNU C Library; if not, write to the Free
00018    Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
00019    02111-1307 USA.  */
00020 
00021 #ifndef _TERMIOS_H
00022 # error "Never include <bits/termios.h> directly; use <termios.h> instead."
00023 #endif
00024 
00025 typedef unsigned char       cc_t;
00026 typedef unsigned int speed_t;
00027 typedef unsigned int tcflag_t;
00028 
00029 #define NCCS 32
00030 struct termios
00031   {
00032     tcflag_t c_iflag;              /* input mode flags */
00033     tcflag_t c_oflag;              /* output mode flags */
00034     tcflag_t c_cflag;              /* control mode flags */
00035     tcflag_t c_lflag;              /* local mode flags */
00036     cc_t c_cc[NCCS];        /* control characters */
00037     cc_t c_line;            /* line discipline (== c_cc[33]) */
00038     speed_t c_ispeed;              /* input speed */
00039     speed_t c_ospeed;              /* output speed */
00040 #define _HAVE_STRUCT_TERMIOS_C_ISPEED 1
00041 #define _HAVE_STRUCT_TERMIOS_C_OSPEED 1
00042   };
00043 
00044 /* c_cc characters */
00045 #define VEOF 0
00046 #define VEOL 1
00047 #define VEOL2 2
00048 #define VERASE 3
00049 #define VWERASE 4
00050 #define VKILL 5
00051 #define VREPRINT 6
00052 #define VSWTC 7
00053 #define VINTR 8
00054 #define VQUIT 9
00055 #define VSUSP 10
00056 #define VSTART 12
00057 #define VSTOP 13
00058 #define VLNEXT 14
00059 #define VDISCARD 15
00060 #define VMIN 16
00061 #define VTIME 17
00062 
00063 /* c_iflag bits */
00064 #define IGNBRK       0000001
00065 #define BRKINT       0000002
00066 #define IGNPAR       0000004
00067 #define PARMRK       0000010
00068 #define INPCK 0000020
00069 #define ISTRIP       0000040
00070 #define INLCR 0000100
00071 #define IGNCR 0000200
00072 #define ICRNL 0000400
00073 #define IXON  0001000
00074 #define IXOFF 0002000
00075 #ifdef __USE_BSD
00076   /* POSIX.1 doesn't want these... */
00077 # define IXANY              0004000
00078 # define IUCLC              0010000
00079 # define IMAXBEL     0020000
00080 # define IUTF8              0040000
00081 #endif
00082 
00083 /* c_oflag bits */
00084 #define OPOST 0000001
00085 #define ONLCR 0000002
00086 #define OLCUC 0000004
00087 
00088 #define OCRNL 0000010
00089 #define ONOCR 0000020
00090 #define ONLRET       0000040
00091 
00092 #define OFILL 00000100
00093 #define OFDEL 00000200
00094 #if defined __USE_MISC || defined __USE_XOPEN
00095 # define NLDLY       00001400
00096 # define   NL0       00000000
00097 # define   NL1       00000400
00098 # define   NL2       00001000
00099 # define   NL3       00001400
00100 # define TABDLY      00006000
00101 # define   TAB0      00000000
00102 # define   TAB1      00002000
00103 # define   TAB2      00004000
00104 # define   TAB3      00006000
00105 # define CRDLY       00030000
00106 # define   CR0       00000000
00107 # define   CR1       00010000
00108 # define   CR2       00020000
00109 # define   CR3       00030000
00110 # define FFDLY       00040000
00111 # define   FF0       00000000
00112 # define   FF1       00040000
00113 # define BSDLY       00100000
00114 # define   BS0       00000000
00115 # define   BS1       00100000
00116 #endif
00117 
00118 #define VTDLY 00200000
00119 #define   VT0 00000000
00120 #define   VT1 00200000
00121 
00122 #ifdef __USE_MISC
00123 # define XTABS       01000000 /* Hmm.. Linux/i386 considers this part of TABDLY.. */
00124 #endif
00125 
00126 /* c_cflag bit meaning */
00127 #ifdef __USE_MISC
00128 # define CBAUD       0000037
00129 #endif
00130 #define  B0   0000000              /* hang up */
00131 #define  B50  0000001
00132 #define  B75  0000002
00133 #define  B110 0000003
00134 #define  B134 0000004
00135 #define  B150 0000005
00136 #define  B200 0000006
00137 #define  B300 0000007
00138 #define  B600 0000010
00139 #define  B1200       0000011
00140 #define  B1800       0000012
00141 #define  B2400       0000013
00142 #define  B4800       0000014
00143 #define  B9600       0000015
00144 #define  B19200      0000016
00145 #define  B38400      0000017
00146 #ifdef __USE_MISC
00147 # define EXTA B19200
00148 # define EXTB B38400
00149 # define CBAUDEX 0000000
00150 #endif
00151 #define  B57600   00020
00152 #define  B115200  00021
00153 #define  B230400  00022
00154 #define  B460800  00023
00155 #define  B500000  00024
00156 #define  B576000  00025
00157 #define  B921600  00026
00158 #define  B1000000 00027
00159 #define  B1152000 00030
00160 #define  B1500000 00031
00161 #define  B2000000 00032
00162 #define  B2500000 00033
00163 #define  B3000000 00034
00164 #define  B3500000 00035
00165 #define  B4000000 00036
00166 
00167 #define __MAX_BAUD B4000000
00168 
00169 #define CSIZE 00001400
00170 #define   CS5 00000000
00171 #define   CS6 00000400
00172 #define   CS7 00001000
00173 #define   CS8 00001400
00174 
00175 #define CSTOPB       00002000
00176 #define CREAD 00004000
00177 #define PARENB       00010000
00178 #define PARODD       00020000
00179 #define HUPCL 00040000
00180 
00181 #define CLOCAL       00100000
00182 #ifdef __USE_MISC
00183 # define CMSPAR        010000000000              /* mark or space (stick) parity */
00184 # define CRTSCTS  020000000000            /* flow control */
00185 #endif
00186 
00187 /* c_lflag bits */
00188 #define ISIG  0x00000080
00189 #define ICANON       0x00000100
00190 #if defined __USE_MISC || defined __USE_XOPEN
00191 # define XCASE       0x00004000
00192 #endif
00193 #define ECHO  0x00000008
00194 #define ECHOE 0x00000002
00195 #define ECHOK 0x00000004
00196 #define ECHONL       0x00000010
00197 #define NOFLSH       0x80000000
00198 #define TOSTOP       0x00400000
00199 #ifdef __USE_MISC
00200 # define ECHOCTL     0x00000040
00201 # define ECHOPRT     0x00000020
00202 # define ECHOKE      0x00000001
00203 # define FLUSHO      0x00800000
00204 # define PENDIN      0x20000000
00205 #endif
00206 #define IEXTEN       0x00000400
00207 
00208 /* Values for the ACTION argument to `tcflow'.  */
00209 #define       TCOOFF        0
00210 #define       TCOON         1
00211 #define       TCIOFF        2
00212 #define       TCION         3
00213 
00214 /* Values for the QUEUE_SELECTOR argument to `tcflush'.  */
00215 #define       TCIFLUSH      0
00216 #define       TCOFLUSH      1
00217 #define       TCIOFLUSH     2
00218 
00219 /* Values for the OPTIONAL_ACTIONS argument to `tcsetattr'.  */
00220 #define       TCSANOW              0
00221 #define       TCSADRAIN     1
00222 #define       TCSAFLUSH     2
00223 
00224 
00225 #define _IOT_termios /* Hurd ioctl type field.  */ \
00226   _IOT (_IOTS (cflag_t), 4, _IOTS (cc_t), NCCS, _IOTS (speed_t), 2)