Back to index

glibc  2.9
termios.h
Go to the documentation of this file.
00001 /* termios type and macro definitions.  Linux/SPARC version.
00002    Copyright (C) 1993, 1994, 1995, 1996, 1997, 2000, 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 17
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   };
00039 
00040 /* c_cc characters */
00041 #define VINTR    0
00042 #define VQUIT    1
00043 #define VERASE   2
00044 #define VKILL    3
00045 #define VEOF     4
00046 #define VEOL     5
00047 #define VEOL2    6
00048 #define VSWTC    7
00049 #define VSTART   8
00050 #define VSTOP    9
00051 #define VSUSP    10
00052 #define VDSUSP   11         /* SunOS POSIX nicety I do believe... */
00053 #define VREPRINT 12
00054 #define VDISCARD 13
00055 #define VWERASE  14
00056 #define VLNEXT   15
00057 
00058 /* User apps assume vmin/vtime is shared with eof/eol */
00059 #define VMIN     VEOF
00060 #define VTIME    VEOL
00061 
00062 /* c_iflag bits */
00063 #define IGNBRK       0x00000001
00064 #define BRKINT       0x00000002
00065 #define IGNPAR       0x00000004
00066 #define PARMRK       0x00000008
00067 #define INPCK 0x00000010
00068 #define ISTRIP       0x00000020
00069 #define INLCR 0x00000040
00070 #define IGNCR 0x00000080
00071 #define ICRNL 0x00000100
00072 #define IUCLC 0x00000200
00073 #define IXON  0x00000400
00074 #define IXANY 0x00000800
00075 #define IXOFF 0x00001000
00076 #define IMAXBEL      0x00002000
00077 #define IUTF8 0x00004000
00078 
00079 /* c_oflag bits */
00080 #define OPOST 0x00000001
00081 #define OLCUC 0x00000002
00082 #define ONLCR 0x00000004
00083 #define OCRNL 0x00000008
00084 #define ONOCR 0x00000010
00085 #define ONLRET       0x00000020
00086 #define OFILL 0x00000040
00087 #define OFDEL 0x00000080
00088 #if defined __USE_MISC || defined __USE_XOPEN
00089 # define NLDLY       0x00000100
00090 # define   NL0       0x00000000
00091 # define   NL1       0x00000100
00092 # define CRDLY       0x00000600
00093 # define   CR0       0x00000000
00094 # define   CR1       0x00000200
00095 # define   CR2       0x00000400
00096 # define   CR3       0x00000600
00097 # define TABDLY      0x00001800
00098 # define   TAB0      0x00000000
00099 # define   TAB1      0x00000800
00100 # define   TAB2      0x00001000
00101 # define   TAB3      0x00001800
00102 # define BSDLY       0x00002000
00103 # define   BS0       0x00000000
00104 # define   BS1       0x00002000
00105 #define FFDLY 0x00008000
00106 #define   FF0 0x00000000
00107 #define   FF1 0x00008000
00108 #endif
00109 #define VTDLY 0x00004000
00110 #define   VT0 0x00000000
00111 #define   VT1 0x00004000
00112 #define PAGEOUT 0x00010000  /* SUNOS specific */
00113 #define WRAP    0x00020000  /* SUNOS specific */
00114 
00115 #ifdef __USE_MISC
00116 # define   XTABS     0x00001800
00117 #endif
00118 
00119 /* c_cflag bit meaning */
00120 #ifdef __USE_MISC
00121 # define CBAUD       0x0000100f
00122 #endif
00123 #define  B0   0x00000000    /* hang up */
00124 #define  B50  0x00000001
00125 #define  B75  0x00000002
00126 #define  B110 0x00000003
00127 #define  B134 0x00000004
00128 #define  B150 0x00000005
00129 #define  B200 0x00000006
00130 #define  B300 0x00000007
00131 #define  B600 0x00000008
00132 #define  B1200       0x00000009
00133 #define  B1800       0x0000000a
00134 #define  B2400       0x0000000b
00135 #define  B4800       0x0000000c
00136 #define  B9600       0x0000000d
00137 #define  B19200      0x0000000e
00138 #define  B38400      0x0000000f
00139 #ifdef __USE_MISC
00140 # define EXTA    B19200
00141 # define EXTB    B38400
00142 #endif
00143 #define  CSIZE  0x00000030
00144 #define   CS5 0x00000000
00145 #define   CS6 0x00000010
00146 #define   CS7 0x00000020
00147 #define   CS8 0x00000030
00148 #define CSTOPB       0x00000040
00149 #define CREAD 0x00000080
00150 #define PARENB       0x00000100
00151 #define PARODD       0x00000200
00152 #define HUPCL 0x00000400
00153 #define CLOCAL       0x00000800
00154 #ifdef __USE_MISC
00155 # define CBAUDEX 0x00001000
00156 #endif
00157 #define  B57600  0x00001001
00158 #define  B115200 0x00001002
00159 #define  B230400 0x00001003
00160 #define  B460800 0x00001004
00161 #define  B76800  0x00001005
00162 #define  B153600 0x00001006
00163 #define  B307200 0x00001007
00164 #define  B614400 0x00001008
00165 #define  B921600 0x00001009
00166 #define  B500000 0x0000100a
00167 #define  B576000 0x0000100b
00168 #define B1000000 0x0000100c
00169 #define B1152000 0x0000100d
00170 #define B1500000 0x0000100e
00171 #define B2000000 0x0000100f
00172 #define __MAX_BAUD B2000000
00173 
00174 #ifdef __USE_MISC
00175 # define CIBAUD       0x100f0000   /* input baud rate (not used) */
00176 # define CMSPAR       0x40000000   /* mark or space (stick) parity */
00177 # define CRTSCTS 0x80000000 /* flow control */
00178 #endif
00179 
00180 /* c_lflag bits */
00181 #define ISIG  0x00000001
00182 #define ICANON       0x00000002
00183 #if defined __USE_MISC || defined __USE_XOPEN
00184 # define XCASE       0x00000004
00185 #endif
00186 #define ECHO  0x00000008
00187 #define ECHOE 0x00000010
00188 #define ECHOK 0x00000020
00189 #define ECHONL       0x00000040
00190 #define NOFLSH       0x00000080
00191 #define TOSTOP       0x00000100
00192 #ifdef __USE_MISC
00193 # define ECHOCTL     0x00000200
00194 # define ECHOPRT     0x00000400
00195 # define ECHOKE             0x00000800
00196 # define DEFECHO     0x00001000    /* SUNOS thing, what is it? */
00197 # define FLUSHO             0x00002000
00198 # define PENDIN             0x00004000
00199 #endif
00200 #define IEXTEN       0x00008000
00201 
00202 /* modem lines */
00203 #define TIOCM_LE     0x001
00204 #define TIOCM_DTR    0x002
00205 #define TIOCM_RTS    0x004
00206 #define TIOCM_ST     0x008
00207 #define TIOCM_SR     0x010
00208 #define TIOCM_CTS    0x020
00209 #define TIOCM_CAR    0x040
00210 #define TIOCM_RNG    0x080
00211 #define TIOCM_DSR    0x100
00212 #define TIOCM_CD     TIOCM_CAR
00213 #define TIOCM_RI     TIOCM_RNG
00214 
00215 /* ioctl (fd, TIOCSERGETLSR, &result) where result may be as below */
00216 #define TIOCSER_TEMT    0x01       /* Transmitter physically empty */
00217 
00218 
00219 /* tcflow() and TCXONC use these */
00220 #define       TCOOFF        0
00221 #define       TCOON         1
00222 #define       TCIOFF        2
00223 #define       TCION         3
00224 
00225 /* tcflush() and TCFLSH use these */
00226 #define       TCIFLUSH      0
00227 #define       TCOFLUSH      1
00228 #define       TCIOFLUSH     2
00229 
00230 /* tcsetattr uses these */
00231 #define       TCSANOW              0
00232 #define       TCSADRAIN     1
00233 #define       TCSAFLUSH     2