.\" Copyright (c) 2001-2003 The Open Group, All Rights Reserved .TH "" P 2003 "IEEE/The Open Group" "POSIX Programmer's Manual" .\" .SH NAME termios.h \- define values for termios .SH SYNOPSIS .LP \fB#include \fP .SH DESCRIPTION .LP The \fI\fP header contains the definitions used by the terminal I/O interfaces (see \fIGeneral Terminal Interface\fP for the structures and names defined). .SS The termios Structure .LP The following data types shall be defined through \fBtypedef\fP: .TP 7 \fBcc_t\fP Used for terminal special characters. .TP 7 \fBspeed_t\fP Used for terminal baud rates. .TP 7 \fBtcflag_t\fP Used for terminal modes. .sp .LP The above types shall be all unsigned integer types. .LP The implementation shall support one or more programming environments in which the widths of \fBcc_t\fP, \fBspeed_t\fP, and \fBtcflag_t\fP are no greater than the width of type \fBlong\fP. The names of these programming environments can be obtained using the \fIconfstr\fP() function or the \fIgetconf\fP utility. .LP The \fBtermios\fP structure shall be defined, and shall include at least the following members: .sp .RS .nf \fBtcflag_t c_iflag \fP Input modes. \fB tcflag_t c_oflag \fP Output modes. \fB tcflag_t c_cflag \fP Control modes. \fB tcflag_t c_lflag \fP Local modes. \fB cc_t c_cc[NCCS] \fP Control characters. \fB \fP .fi .RE .LP A definition shall be provided for: .TP 7 NCCS Size of the array \fIc_cc\fP for control characters. .sp .LP The following subscript names for the array \fIc_cc\fP shall be defined: .TS C center;c s l. \fBSubscript Usage\fP \ .T& l l l. \fBCanonical Mode\fP \fBNon-Canonical Mode\fP \fBDescription\fP VEOF \ EOF character. VEOL \ EOL character. VERASE \ ERASE character. VINTR VINTR INTR character. VKILL \ KILL character. \ VMIN MIN value. VQUIT VQUIT QUIT character. VSTART VSTART START character. VSTOP VSTOP STOP character. VSUSP VSUSP SUSP character. \ VTIME TIME value. .TE .LP The subscript values shall be unique, except that the VMIN and VTIME subscripts may have the same values as the VEOF and VEOL subscripts, respectively. .LP The following flags shall be provided. .SS Input Modes .LP The \fIc_iflag\fP field describes the basic terminal input control: .TP 7 BRKINT Signal interrupt on break. .TP 7 ICRNL Map CR to NL on input. .TP 7 IGNBRK Ignore break condition. .TP 7 IGNCR Ignore CR. .TP 7 IGNPAR Ignore characters with parity errors. .TP 7 INLCR Map NL to CR on input. .TP 7 INPCK Enable input parity check. .TP 7 ISTRIP Strip character. .TP 7 IXANY Enable any character to restart output. .TP 7 IXOFF Enable start/stop input control. .TP 7 IXON Enable start/stop output control. .TP 7 PARMRK Mark parity errors. .sp .SS Output Modes .LP The \fIc_oflag\fP field specifies the system treatment of output: .TP 7 OPOST Post-process output. .TP 7 ONLCR Map NL to CR-NL on output. .TP 7 OCRNL Map CR to NL on output. .TP 7 ONOCR No CR output at column 0. .TP 7 ONLRET NL performs CR function. .TP 7 OFILL Use fill characters for delay. .TP 7 NLDLY Select newline delays: .TP 7 NL0 .RS Newline type 0. .RE .TP 7 NL1 .RS Newline type 1. .RE .sp .TP 7 CRDLY Select carriage-return delays: .TP 7 CR0 .RS Carriage-return delay type 0. .RE .TP 7 CR1 .RS Carriage-return delay type 1. .RE .TP 7 CR2 .RS Carriage-return delay type 2. .RE .TP 7 CR3 .RS Carriage-return delay type 3. .RE .sp .TP 7 TABDLY Select horizontal-tab delays: .TP 7 TAB0 .RS Horizontal-tab delay type 0. .RE .TP 7 TAB1 .RS Horizontal-tab delay type 1. .RE .TP 7 TAB2 .RS Horizontal-tab delay type 2. .RE .TP 7 TAB3 .RS Expand tabs to spaces. .RE .sp .TP 7 BSDLY Select backspace delays: .TP 7 BS0 .RS Backspace-delay type 0. .RE .TP 7 BS1 .RS Backspace-delay type 1. .RE .sp .TP 7 VTDLY Select vertical-tab delays: .TP 7 VT0 .RS Vertical-tab delay type 0. .RE .TP 7 VT1 .RS Vertical-tab delay type 1. .RE .sp .TP 7 FFDLY Select form-feed delays: .TP 7 FF0 .RS Form-feed delay type 0. .RE .TP 7 FF1 .RS Form-feed delay type 1. .RE .sp .sp .SS Baud Rate Selection .LP The input and output baud rates are stored in the \fBtermios\fP structure. These are the valid values for objects of type \fBspeed_t\fP. The following values shall be defined, but not all baud rates need be supported by the underlying hardware. .TP 7 B0 Hang up .TP 7 B50 50 baud .TP 7 B75 75 baud .TP 7 B110 110 baud .TP 7 B134 134.5 baud .TP 7 B150 150 baud .TP 7 B200 200 baud .TP 7 B300 300 baud .TP 7 B600 600 baud .TP 7 B1200 1200 baud .TP 7 B1800 1800 baud .TP 7 B2400 2400 baud .TP 7 B4800 4800 baud .TP 7 B9600 9600 baud .TP 7 B19200 19200 baud .TP 7 B38400 38400 baud .sp .SS Control Modes .LP The \fIc_cflag\fP field describes the hardware control of the terminal; not all values specified are required to be supported by the underlying hardware: .TP 7 CSIZE Character size: .TP 7 CS5 .RS 5 bits .RE .TP 7 CS6 .RS 6 bits .RE .TP 7 CS7 .RS 7 bits .RE .TP 7 CS8 .RS 8 bits .RE .sp .TP 7 CSTOPB Send two stop bits, else one. .TP 7 CREAD Enable receiver. .TP 7 PARENB Parity enable. .TP 7 PARODD Odd parity, else even. .TP 7 HUPCL Hang up on last close. .TP 7 CLOCAL Ignore modem status lines. .sp .LP The implementation shall support the functionality associated with the symbols CS7, CS8, CSTOPB, PARODD, and PARENB. .SS Local Modes .LP The \fIc_lflag\fP field of the argument structure is used to control various terminal functions: .TP 7 ECHO Enable echo. .TP 7 ECHOE Echo erase character as error-correcting backspace. .TP 7 ECHOK Echo KILL. .TP 7 ECHONL Echo NL. .TP 7 ICANON Canonical input (erase and kill processing). .TP 7 IEXTEN Enable extended input character processing. .TP 7 ISIG Enable signals. .TP 7 NOFLSH Disable flush after interrupt or quit. .TP 7 TOSTOP Send SIGTTOU for background output. .sp .SS Attribute Selection .LP The following symbolic constants for use with \fItcsetattr\fP() are defined: .TP 7 TCSANOW Change attributes immediately. .TP 7 TCSADRAIN Change attributes when output has drained. .TP 7 TCSAFLUSH Change attributes when output has drained; also flush pending input. .sp .SS Line Control .LP The following symbolic constants for use with \fItcflush\fP() shall be defined: .TP 7 TCIFLUSH Flush pending input. .TP 7 TCIOFLUSH Flush both pending input and untransmitted output. .TP 7 TCOFLUSH Flush untransmitted output. .sp .LP The following symbolic constants for use with \fItcflow\fP() shall be defined: .TP 7 TCIOFF Transmit a STOP character, intended to suspend input data. .TP 7 TCION Transmit a START character, intended to restart input data. .TP 7 TCOOFF Suspend output. .TP 7 TCOON Restart output. .sp .LP The following shall be declared as functions and may also be defined as macros. Function prototypes shall be provided. .sp .RS .nf \fBspeed_t cfgetispeed(const struct termios *); speed_t cfgetospeed(const struct termios *); int cfsetispeed(struct termios *, speed_t); int cfsetospeed(struct termios *, speed_t); int tcdrain(int); int tcflow(int, int); int tcflush(int, int); int tcgetattr(int, struct termios *); pid_t tcgetsid(int); int tcsendbreak(int, int); int tcsetattr(int, int, const struct termios *); \fP .fi .RE .LP \fIThe following sections are informative.\fP .SH APPLICATION USAGE .LP The following names are reserved for XSI-conformant systems to use as an extension to the above; therefore strictly conforming applications shall not use them: .TS C center; l l l. CBAUD EXTB VDSUSP DEFECHO FLUSHO VLNEXT ECHOCTL LOBLK VREPRINT ECHOKE PENDIN VSTATUS ECHOPRT SWTCH VWERASE EXTA VDISCARD \ .TE .SH RATIONALE .LP None. .SH FUTURE DIRECTIONS .LP None. .SH SEE ALSO .LP The System Interfaces volume of IEEE\ Std\ 1003.1-2001, \fIcfgetispeed\fP(), \fIcfgetospeed\fP(), \fIcfsetispeed\fP(), \fIcfsetospeed\fP(), \fIconfstr\fP(), \fItcdrain\fP(), \fItcflow\fP(), \fItcflush\fP(), \fItcgetattr\fP(), \fItcgetsid\fP(), \fItcsendbreak\fP(), \fItcsetattr\fP(), the Shell and Utilities volume of IEEE\ Std\ 1003.1-2001, \fIgetconf\fP, \fIGeneral Terminal Interface\fP .SH COPYRIGHT Portions of this text are reprinted and reproduced in electronic form from IEEE Std 1003.1, 2003 Edition, Standard for Information Technology -- Portable Operating System Interface (POSIX), The Open Group Base Specifications Issue 6, Copyright (C) 2001-2003 by the Institute of Electrical and Electronics Engineers, Inc and The Open Group. In the event of any discrepancy between this version and the original IEEE and The Open Group Standard, the original IEEE and The Open Group Standard is the referee document. The original Standard can be obtained online at http://www.opengroup.org/unix/online.html .