termios.h revision 7c478bd95313f5f23a4c958a745db2134aa03244
/*
* CDDL HEADER START
*
* The contents of this file are subject to the terms of the
* Common Development and Distribution License, Version 1.0 only
* (the "License"). You may not use this file except in compliance
* with the License.
*
* You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
* See the License for the specific language governing permissions
* and limitations under the License.
*
* When distributing Covered Code, include this CDDL HEADER in each
* file and include the License file at usr/src/OPENSOLARIS.LICENSE.
* If applicable, add the following below this CDDL HEADER, with the
* fields enclosed by brackets "[]" replaced with your own identifying
* information: Portions Copyright [yyyy] [name of copyright owner]
*
* CDDL HEADER END
*/
/* Copyright (c) 1984, 1986, 1987, 1988, 1989 AT&T */
/* All Rights Reserved */
/*
* Copyright 2004 Sun Microsystems, Inc. All rights reserved.
* Use is subject to license terms.
*/
#ifndef _SYS_TERMIOS_H
#define _SYS_TERMIOS_H
#pragma ident "%Z%%M% %I% %E% SMI"
#include <sys/feature_tests.h>
#if !defined(__XOPEN_OR_POSIX) || defined(__EXTENSIONS__)
#endif /* !defined(__XOPEN_OR_POSIX) || defined(__EXTENSIONS__) */
#ifdef __cplusplus
extern "C" {
#endif
/*
* introduction of the header. The POSIX standard, IEEE Std.
* 1003.1-1988 also required the existence of _POSIX_VDISABLE in
* this header. Subsequent versions of the IEEE Standard as well
* defined in <unistd.h> while still allowing for it's existence
* here. With the introduction of XPG6, _POSIX_VDISABLE can only
* be defined in <unistd.h>.
*/
#if !defined(_XPG6) || defined(__EXTENSIONS__)
#ifndef _POSIX_VDISABLE
#define _POSIX_VDISABLE 0 /* Disable special character functions */
#endif
#endif /* !defined(_XPG6) || defined(__EXTENSIONS__) */
#if !defined(__XOPEN_OR_POSIX) || defined(__EXTENSIONS__)
#define CTRL(c) ((c)&037)
#define IBSHIFT 16
#endif /* !defined(__XOPEN_OR_POSIX) || defined(__EXTENSIONS__) */
#define _NCC 8
#if !defined(__XOPEN_OR_POSIX) || defined(__EXTENSIONS__)
#endif /* !defined(__XOPEN_OR_POSIX) || defined(__EXTENSIONS__) */
/* some defines required by POSIX */
#define NCCS 19
/*
* types defined by POSIX. These are better off in types.h, but
* the standard says that they have to be in termios.h.
*/
typedef unsigned int tcflag_t;
typedef unsigned char cc_t;
typedef unsigned int speed_t;
/*
* Ioctl control packet
*/
struct termios {
};
/*
* POSIX termios functions
* These functions get mapped into ioctls.
*/
#ifndef _KERNEL
#if defined(__STDC__)
extern int tcsendbreak(int, int);
extern int tcdrain(int);
extern int tcflush(int, int);
extern int tcflow(int, int);
#else
extern speed_t cfgetospeed();
extern int cfsetospeed();
extern speed_t cfgetispeed();
extern int cfsetispeed();
extern int tcgetattr();
extern int tcsetattr();
extern int tcsendbreak();
extern int tcdrain();
extern int tcflush();
extern int tcflow();
#endif /* __STDC__ */
#if defined(__STDC__)
#else
#endif /* __STDC__ */
#endif /* !defined(__XOPEN_OR_POSIX) || defined(_XPG4_2) ... */
#endif
/* control characters */
#define VINTR 0
#define VQUIT 1
#define VERASE 2
#define VKILL 3
#define VEOF 4
#define VEOL 5
#if !defined(__XOPEN_OR_POSIX) || defined(__EXTENSIONS__)
#define VEOL2 6
#endif /* !defined(__XOPEN_OR_POSIX) || defined(__EXTENSIONS__) */
#define VMIN 4
#define VTIME 5
#if !defined(__XOPEN_OR_POSIX) || defined(__EXTENSIONS__)
#define VSWTCH 7
#endif /* !defined(__XOPEN_OR_POSIX) || defined(__EXTENSIONS__) */
#define VSTART 8
#define VSTOP 9
#define VSUSP 10
#if !defined(__XOPEN_OR_POSIX) || defined(__EXTENSIONS__)
#define VDSUSP 11
#define VREPRINT 12
#define VDISCARD 13
#define VWERASE 14
#define VLNEXT 15
/* 16 thru 19 reserved for future use */
/*
* control characters form Xenix termio.h
*/
#define CNUL 0
#define CDEL 0177
/* S5 default control chars */
/* CINTR, CERASE and CKILL modified to SunOS traditional values */
#define CESC '\\'
#define CEOT 04
#define CEOL 0
#define CEOL2 0
#define CNSWTCH 0
#endif /* !defined(__XOPEN_OR_POSIX) || defined(__EXTENSIONS__) */
/* input modes */
#define IGNBRK 0000001
#define BRKINT 0000002
#define IGNPAR 0000004
#define PARMRK 0000010
#define INPCK 0000020
#define ISTRIP 0000040
#define INLCR 0000100
#define IGNCR 0000200
#define ICRNL 0000400
#if !defined(_POSIX_C_SOURCE) || \
(defined(_XOPEN_SOURCE) && !defined(_XPG6)) || \
defined(__EXTENSIONS__)
#define IUCLC 0001000
#endif /* !defined(_POSIX_C_SOURCE) || defined(_XOPEN_SOURCE)... */
#define IXON 0002000
#if !defined(_POSIX_C_SOURCE) || defined(_XOPEN_SOURCE) || \
defined(__EXTENSIONS__)
#define IXANY 0004000
#endif /* !defined(_POSIX_C_SOURCE) || defined(_XOPEN_SOURCE)... */
#define IXOFF 0010000
#if !defined(__XOPEN_OR_POSIX) || defined(__EXTENSIONS__)
#define IMAXBEL 0020000
#endif /* !defined(__XOPEN_OR_POSIX) || defined(__EXTENSIONS__) */
/* output modes */
#define OPOST 0000001
#if !defined(_POSIX_C_SOURCE) || defined(_XOPEN_SOURCE) || \
defined(__EXTENSIONS__)
#if !defined(_XPG6) || defined(__EXTENSIONS__)
#define OLCUC 0000002
#endif
#define ONLCR 0000004
#define OCRNL 0000010
#define ONOCR 0000020
#define ONLRET 0000040
#define OFILL 0000100
#define OFDEL 0000200
#define NLDLY 0000400
#define NL0 0
#define NL1 0000400
#define CRDLY 0003000
#define CR0 0
#define CR1 0001000
#define CR2 0002000
#define CR3 0003000
#define TABDLY 0014000
#define TAB0 0
#define TAB1 0004000
#define TAB2 0010000
#define TAB3 0014000
#endif /* !defined(_POSIX_C_SOURCE) || defined(_XOPEN_SOURCE)... */
#if !defined(__XOPEN_OR_POSIX) || defined(__EXTENSIONS__)
#define XTABS 0014000
#endif /* !defined(__XOPEN_OR_POSIX) || defined(__EXTENSIONS__) */
#if !defined(_POSIX_C_SOURCE) || defined(_XOPEN_SOURCE) || \
defined(__EXTENSIONS__)
#define BSDLY 0020000
#define BS0 0
#define BS1 0020000
#define VTDLY 0040000
#define VT0 0
#define VT1 0040000
#define FFDLY 0100000
#define FF0 0
#define FF1 0100000
#endif /* !defined(_POSIX_C_SOURCE) || defined(_XOPEN_SOURCE)... */
#if !defined(__XOPEN_OR_POSIX) || defined(__EXTENSIONS__)
#define PAGEOUT 0200000
#define WRAP 0400000
/* control modes */
#define CBAUD 0000017
#endif /* !defined(__XOPEN_OR_POSIX) || defined(__EXTENSIONS__) */
#define CSIZE 0000060
#define CS5 0
#define CS6 0000020
#define CS7 0000040
#define CS8 0000060
#define CSTOPB 0000100
#define CREAD 0000200
#define PARENB 0000400
#define PARODD 0001000
#define HUPCL 0002000
#define CLOCAL 0004000
#if !defined(__XOPEN_OR_POSIX) || defined(__EXTENSIONS__)
#define RCV1EN 0010000
#define XMT1EN 0020000
#define LOBLK 0040000
#define CRTSXOFF 010000000000
#define CRTSCTS 020000000000
#define CIBAUD 03600000
#define PAREXT 04000000
#define CBAUDEXT 010000000
#define CIBAUDEXT 020000000
/*
* 4.4BSD hardware flow control flags
*/
#define CRTS_IFLOW 010000000000
#define CCTS_OFLOW 020000000000
#endif /* !defined(__XOPEN_OR_POSIX) || defined(__EXTENSIONS__) */
/* line discipline 0 modes */
#define ISIG 0000001
#define ICANON 0000002
#if !defined(_POSIX_C_SOURCE) || \
(defined(_XOPEN_SOURCE) && !defined(_XPG6)) || \
defined(__EXTENSIONS__)
#define XCASE 0000004
#endif /* !defined(_POSIX_C_SOURCE) || defined(_XOPEN_SOURCE)... */
#define ECHO 0000010
#define ECHOE 0000020
#define ECHOK 0000040
#define ECHONL 0000100
#define NOFLSH 0000200
#define TOSTOP 0000400
#if !defined(__XOPEN_OR_POSIX) || defined(__EXTENSIONS__)
#define ECHOCTL 0001000
#define ECHOPRT 0002000
#define ECHOKE 0004000
#define DEFECHO 0010000
#define FLUSHO 0020000
#define PENDIN 0040000
#endif /* !defined(__XOPEN_OR_POSIX) || defined(__EXTENSIONS__) */
#if !defined(__XOPEN_OR_POSIX) || defined(__EXTENSIONS__)
/* Slots reserved for 386/XENIX compatibility - keyboard control */
#ifndef IOCTYPE
#define IOCTYPE 0xff00
#endif
/*
* Softcarrier ioctls
*/
/* termios ioctls */
#endif /* !defined(__XOPEN_OR_POSIX) || defined(__EXTENSIONS__) */
#if !defined(__XOPEN_OR_POSIX) || defined(__EXTENSIONS__)
#endif /* !defined(__XOPEN_OR_POSIX) || defined(__EXTENSIONS__) */
#if !defined(__XOPEN_OR_POSIX) || defined(__EXTENSIONS__)
/*
* NTP PPS ioctls
*/
/* Argument filled in by TIOCGPPSEV */
struct ppsclockev {
};
#if defined(_SYSCALL32)
struct ppsclockev32 {
};
#endif /* _SYSCALL32 */
#endif /* !defined(__XOPEN_OR_POSIX) || defined(__EXTENSIONS__) */
/* termios option flags */
#define TCIFLUSH 0 /* flush data received but not read */
#define TCOOFF 0 /* suspend output */
/* TIOC ioctls for BSD, ptys, job control and modem control */
#if !defined(__XOPEN_OR_POSIX) || defined(__EXTENSIONS__)
#endif /* !defined(__XOPEN_OR_POSIX) || defined(__EXTENSIONS__) */
/* Slots for 386/XENIX compatibility */
/* BSD includes these ioctls in ttold.h */
#ifndef _SYS_TTOLD_H
#if !defined(__XOPEN_OR_POSIX) || defined(__EXTENSIONS__)
/*
* BSD ioctls that are not the same as XENIX are included here.
* BSD pty ioctls like TIOCPKT are not supported in SVR4.
*/
#endif /* !defined(__XOPEN_OR_POSIX) || defined(__EXTENSIONS__) */
#endif /* end _SYS_TTOLD_H */
/* POSIX job control ioctls */
#if !defined(__XOPEN_OR_POSIX) || defined(__EXTENSIONS__)
/* Miscellaneous */
/* Modem control */
/* pseudo-tty */
/* Some more 386 xenix stuff */
/* Slots for 386 compatibility */
/*
* These are retained for 386/XENIX compatibility.
*/
/*
* Returns a non-zero value if there
* are characters in the input queue.
*
* XXX - somebody is confused here. V7 had no such "ioctl", although XENIX may
* have added it; 4BSD had FIONREAD, which returned the number of characters
* waiting, and was supposed to work on all descriptors (i.e., every driver
* should make a stab at implementing it).
*/
#endif /* !defined(__XOPEN_OR_POSIX) || defined(__EXTENSIONS__) */
/*
* Speeds
*/
#define B0 0
#define B50 1
#define B75 2
#define B110 3
#define B134 4
#define B150 5
#define B200 6
#define B300 7
#define B600 8
#define B1200 9
#define B1800 10
#define B2400 11
#define B4800 12
#define B9600 13
#define B19200 14
#define B38400 15
#define B57600 16
#define B76800 17
#define B115200 18
#define B153600 19
#define B230400 20
#define B307200 21
#define B460800 22
#ifndef _SYS_TTOLD_H
#if !defined(__XOPEN_OR_POSIX) || defined(__EXTENSIONS__)
/* Windowing structure to support JWINSIZE/TIOCSWINSZ/TIOCGWINSZ */
struct winsize {
unsigned short ws_row; /* rows, in characters */
unsigned short ws_col; /* columns, in character */
unsigned short ws_xpixel; /* horizontal size, pixels */
unsigned short ws_ypixel; /* vertical size, pixels */
};
#endif /* !defined(__XOPEN_OR_POSIX) || defined(__EXTENSIONS__) */
#endif /* end _SYS_TTOLD_H */
#ifdef __cplusplus
}
#endif
#endif /* _SYS_TERMIOS_H */