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, 1998, 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_line;                   /* line discipline */
00037     cc_t c_cc[NCCS];        /* control characters */
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 VINTR 0
00046 #define VQUIT 1
00047 #define VERASE 2
00048 #define VKILL 3
00049 #define VEOF 4
00050 #define VTIME 5
00051 #define VMIN 6
00052 #define VSWTC 7
00053 #define VSTART 8
00054 #define VSTOP 9
00055 #define VSUSP 10
00056 #define VEOL 11
00057 #define VREPRINT 12
00058 #define VDISCARD 13
00059 #define VWERASE 14
00060 #define VLNEXT 15
00061 #define VEOL2 16
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 IUCLC 0001000
00074 #define IXON  0002000
00075 #define IXANY 0004000
00076 #define IXOFF 0010000
00077 #define IMAXBEL      0020000
00078 #define IUTF8 0040000
00079 
00080 /* c_oflag bits */
00081 #define OPOST 0000001
00082 #define OLCUC 0000002
00083 #define ONLCR 0000004
00084 #define OCRNL 0000010
00085 #define ONOCR 0000020
00086 #define ONLRET       0000040
00087 #define OFILL 0000100
00088 #define OFDEL 0000200
00089 #if defined __USE_MISC || defined __USE_XOPEN
00090 # define NLDLY       0000400
00091 # define   NL0       0000000
00092 # define   NL1       0000400
00093 # define CRDLY       0003000
00094 # define   CR0       0000000
00095 # define   CR1       0001000
00096 # define   CR2       0002000
00097 # define   CR3       0003000
00098 # define TABDLY      0014000
00099 # define   TAB0      0000000
00100 # define   TAB1      0004000
00101 # define   TAB2      0010000
00102 # define   TAB3      0014000
00103 # define BSDLY       0020000
00104 # define   BS0       0000000
00105 # define   BS1       0020000
00106 # define FFDLY       0100000
00107 # define   FF0       0000000
00108 # define   FF1       0100000
00109 #endif
00110 
00111 #define VTDLY 0040000
00112 #define   VT0 0000000
00113 #define   VT1 0040000
00114 
00115 #ifdef __USE_MISC
00116 # define XTABS       0014000
00117 #endif
00118 
00119 /* c_cflag bit meaning */
00120 #ifdef __USE_MISC
00121 # define CBAUD       0010017
00122 #endif
00123 #define  B0   0000000              /* hang up */
00124 #define  B50  0000001
00125 #define  B75  0000002
00126 #define  B110 0000003
00127 #define  B134 0000004
00128 #define  B150 0000005
00129 #define  B200 0000006
00130 #define  B300 0000007
00131 #define  B600 0000010
00132 #define  B1200       0000011
00133 #define  B1800       0000012
00134 #define  B2400       0000013
00135 #define  B4800       0000014
00136 #define  B9600       0000015
00137 #define  B19200      0000016
00138 #define  B38400      0000017
00139 #ifdef __USE_MISC
00140 # define EXTA B19200
00141 # define EXTB B38400
00142 #endif
00143 #define CSIZE 0000060
00144 #define   CS5 0000000
00145 #define   CS6 0000020
00146 #define   CS7 0000040
00147 #define   CS8 0000060
00148 #define CSTOPB       0000100
00149 #define CREAD 0000200
00150 #define PARENB       0000400
00151 #define PARODD       0001000
00152 #define HUPCL 0002000
00153 #define CLOCAL       0004000
00154 #ifdef __USE_MISC
00155 # define CBAUDEX 0010000
00156 #endif
00157 #define  B57600   0010001
00158 #define  B115200  0010002
00159 #define  B230400  0010003
00160 #define  B460800  0010004
00161 #define  B500000  0010005
00162 #define  B576000  0010006
00163 #define  B921600  0010007
00164 #define  B1000000 0010010
00165 #define  B1152000 0010011
00166 #define  B1500000 0010012
00167 #define  B2000000 0010013
00168 #define  B2500000 0010014
00169 #define  B3000000 0010015
00170 #define  B3500000 0010016
00171 #define  B4000000 0010017
00172 #define __MAX_BAUD B4000000
00173 #ifdef __USE_MISC
00174 # define CIBAUD        002003600000              /* input baud rate (not used) */
00175 # define CMSPAR   010000000000            /* mark or space (stick) parity */
00176 # define CRTSCTS  020000000000            /* flow control */
00177 #endif
00178 
00179 /* c_lflag bits */
00180 #define ISIG  0000001
00181 #define ICANON       0000002
00182 #if defined __USE_MISC || defined __USE_XOPEN
00183 # define XCASE       0000004
00184 #endif
00185 #define ECHO  0000010
00186 #define ECHOE 0000020
00187 #define ECHOK 0000040
00188 #define ECHONL       0000100
00189 #define NOFLSH       0000200
00190 #define TOSTOP       0000400
00191 #ifdef __USE_MISC
00192 # define ECHOCTL 0001000
00193 # define ECHOPRT 0002000
00194 # define ECHOKE       0004000
00195 # define FLUSHO       0010000
00196 # define PENDIN       0040000
00197 #endif
00198 #define IEXTEN       0100000
00199 
00200 /* tcflow() and TCXONC use these */
00201 #define       TCOOFF        0
00202 #define       TCOON         1
00203 #define       TCIOFF        2
00204 #define       TCION         3
00205 
00206 /* tcflush() and TCFLSH use these */
00207 #define       TCIFLUSH      0
00208 #define       TCOFLUSH      1
00209 #define       TCIOFLUSH     2
00210 
00211 /* tcsetattr uses these */
00212 #define       TCSANOW              0
00213 #define       TCSADRAIN     1
00214 #define       TCSAFLUSH     2
00215 
00216 
00217 #define _IOT_termios /* Hurd ioctl type field.  */ \
00218   _IOT (_IOTS (cflag_t), 4, _IOTS (cc_t), NCCS, _IOTS (speed_t), 2)