root/include/termios.h

/* [previous][next][first][last][top][bottom][index][help] */

INCLUDED FROM


   1 #ifndef _TERMIOS_H
   2 #define _TERMIOS_H
   3 
   4 #include <sys/types.h>
   5 
   6 /* 0x54 is just a magic number to make these relatively uniqe ('T') */
   7 
   8 #define TCGETS          0x5401
   9 #define TCSETS          0x5402
  10 #define TCSETSW         0x5403
  11 #define TCSETSF         0x5404
  12 #define TCGETA          0x5405
  13 #define TCSETA          0x5406
  14 #define TCSETAW         0x5407
  15 #define TCSETAF         0x5408
  16 #define TCSBRK          0x5409
  17 #define TCXONC          0x540A
  18 #define TCFLSH          0x540B
  19 #define TIOCEXCL        0x540C
  20 #define TIOCNXCL        0x540D
  21 #define TIOCSCTTY       0x540E
  22 #define TIOCGPGRP       0x540F
  23 #define TIOCSPGRP       0x5410
  24 #define TIOCOUTQ        0x5411
  25 #define TIOCSTI         0x5412
  26 #define TIOCGWINSZ      0x5413
  27 #define TIOCSWINSZ      0x5414
  28 #define TIOCMGET        0x5415
  29 #define TIOCMBIS        0x5416
  30 #define TIOCMBIC        0x5417
  31 #define TIOCMSET        0x5418
  32 #define TIOCGSOFTCAR    0x5419
  33 #define TIOCSSOFTCAR    0x541A
  34 #define FIONREAD        0x541B
  35 #define TIOCINQ         FIONREAD
  36 #define TIOCLINUX       0x541C
  37 
  38 struct winsize {
  39         unsigned short ws_row;
  40         unsigned short ws_col;
  41         unsigned short ws_xpixel;
  42         unsigned short ws_ypixel;
  43 };
  44 
  45 #define NCC 8
  46 struct termio {
  47         unsigned short c_iflag;         /* input mode flags */
  48         unsigned short c_oflag;         /* output mode flags */
  49         unsigned short c_cflag;         /* control mode flags */
  50         unsigned short c_lflag;         /* local mode flags */
  51         unsigned char c_line;           /* line discipline */
  52         unsigned char c_cc[NCC];        /* control characters */
  53 };
  54 
  55 #define NCCS 17
  56 struct termios {
  57         tcflag_t c_iflag;               /* input mode flags */
  58         tcflag_t c_oflag;               /* output mode flags */
  59         tcflag_t c_cflag;               /* control mode flags */
  60         tcflag_t c_lflag;               /* local mode flags */
  61         cc_t c_line;                    /* line discipline */
  62         cc_t c_cc[NCCS];                /* control characters */
  63 };
  64 
  65 /* c_cc characters */
  66 #define VINTR 0
  67 #define VQUIT 1
  68 #define VERASE 2
  69 #define VKILL 3
  70 #define VEOF 4
  71 #define VTIME 5
  72 #define VMIN 6
  73 #define VSWTC 7
  74 #define VSTART 8
  75 #define VSTOP 9
  76 #define VSUSP 10
  77 #define VEOL 11
  78 #define VREPRINT 12
  79 #define VDISCARD 13
  80 #define VWERASE 14
  81 #define VLNEXT 15
  82 #define VEOL2 16
  83 
  84 /* c_iflag bits */
  85 #define IGNBRK  0000001
  86 #define BRKINT  0000002
  87 #define IGNPAR  0000004
  88 #define PARMRK  0000010
  89 #define INPCK   0000020
  90 #define ISTRIP  0000040
  91 #define INLCR   0000100
  92 #define IGNCR   0000200
  93 #define ICRNL   0000400
  94 #define IUCLC   0001000
  95 #define IXON    0002000
  96 #define IXANY   0004000
  97 #define IXOFF   0010000
  98 #define IMAXBEL 0020000
  99 
 100 /* c_oflag bits */
 101 #define OPOST   0000001
 102 #define OLCUC   0000002
 103 #define ONLCR   0000004
 104 #define OCRNL   0000010
 105 #define ONOCR   0000020
 106 #define ONLRET  0000040
 107 #define OFILL   0000100
 108 #define OFDEL   0000200
 109 #define NLDLY   0000400
 110 #define   NL0   0000000
 111 #define   NL1   0000400
 112 #define CRDLY   0003000
 113 #define   CR0   0000000
 114 #define   CR1   0001000
 115 #define   CR2   0002000
 116 #define   CR3   0003000
 117 #define TABDLY  0014000
 118 #define   TAB0  0000000
 119 #define   TAB1  0004000
 120 #define   TAB2  0010000
 121 #define   TAB3  0014000
 122 #define   XTABS 0014000
 123 #define BSDLY   0020000
 124 #define   BS0   0000000
 125 #define   BS1   0020000
 126 #define VTDLY   0040000
 127 #define   VT0   0000000
 128 #define   VT1   0040000
 129 #define FFDLY   0040000
 130 #define   FF0   0000000
 131 #define   FF1   0040000
 132 
 133 /* c_cflag bit meaning */
 134 #define CBAUD   0000017
 135 #define  B0     0000000         /* hang up */
 136 #define  B50    0000001
 137 #define  B75    0000002
 138 #define  B110   0000003
 139 #define  B134   0000004
 140 #define  B150   0000005
 141 #define  B200   0000006
 142 #define  B300   0000007
 143 #define  B600   0000010
 144 #define  B1200  0000011
 145 #define  B1800  0000012
 146 #define  B2400  0000013
 147 #define  B4800  0000014
 148 #define  B9600  0000015
 149 #define  B19200 0000016
 150 #define  B38400 0000017
 151 #define EXTA B19200
 152 #define EXTB B38400
 153 #define CSIZE   0000060
 154 #define   CS5   0000000
 155 #define   CS6   0000020
 156 #define   CS7   0000040
 157 #define   CS8   0000060
 158 #define CSTOPB  0000100
 159 #define CREAD   0000200
 160 #define PARENB  0000400
 161 #define PARODD  0001000
 162 #define HUPCL   0002000
 163 #define CLOCAL  0004000
 164 #define CIBAUD  03600000                /* input baud rate (not used) */
 165 #define CRTSCTS 020000000000            /* flow control */
 166 
 167 /* c_lflag bits */
 168 #define ISIG    0000001
 169 #define ICANON  0000002
 170 #define XCASE   0000004
 171 #define ECHO    0000010
 172 #define ECHOE   0000020
 173 #define ECHOK   0000040
 174 #define ECHONL  0000100
 175 #define NOFLSH  0000200
 176 #define TOSTOP  0000400
 177 #define ECHOCTL 0001000
 178 #define ECHOPRT 0002000
 179 #define ECHOKE  0004000
 180 #define FLUSHO  0010000
 181 #define PENDIN  0040000
 182 #define IEXTEN  0100000
 183 
 184 /* modem lines */
 185 #define TIOCM_LE        0x001
 186 #define TIOCM_DTR       0x002
 187 #define TIOCM_RTS       0x004
 188 #define TIOCM_ST        0x008
 189 #define TIOCM_SR        0x010
 190 #define TIOCM_CTS       0x020
 191 #define TIOCM_CAR       0x040
 192 #define TIOCM_RNG       0x080
 193 #define TIOCM_DSR       0x100
 194 #define TIOCM_CD        TIOCM_CAR
 195 #define TIOCM_RI        TIOCM_RNG
 196 
 197 /* tcflow() and TCXONC use these */
 198 #define TCOOFF          0
 199 #define TCOON           1
 200 #define TCIOFF          2
 201 #define TCION           3
 202 
 203 /* tcflush() and TCFLSH use these */
 204 #define TCIFLUSH        0
 205 #define TCOFLUSH        1
 206 #define TCIOFLUSH       2
 207 
 208 /* tcsetattr uses these */
 209 #define TCSANOW         0
 210 #define TCSADRAIN       1
 211 #define TCSAFLUSH       2
 212 
 213 extern speed_t cfgetispeed(struct termios *termios_p);
 214 extern speed_t cfgetospeed(struct termios *termios_p);
 215 extern int cfsetispeed(struct termios *termios_p, speed_t speed);
 216 extern int cfsetospeed(struct termios *termios_p, speed_t speed);
 217 extern int tcdrain(int fildes);
 218 extern int tcflow(int fildes, int action);
 219 extern int tcflush(int fildes, int queue_selector);
 220 extern int tcgetattr(int fildes, struct termios *termios_p);
 221 extern int tcsendbreak(int fildes, int duration);
 222 extern int tcsetattr(int fildes, int optional_actions,
 223         struct termios *termios_p);
 224 
 225 #endif

/* [previous][next][first][last][top][bottom][index][help] */