1139825Simp/*-
21541Srgrimes * Copyright (c) 1988, 1989, 1993, 1994
31541Srgrimes *	The Regents of the University of California.  All rights reserved.
41541Srgrimes *
51541Srgrimes * Redistribution and use in source and binary forms, with or without
61541Srgrimes * modification, are permitted provided that the following conditions
71541Srgrimes * are met:
81541Srgrimes * 1. Redistributions of source code must retain the above copyright
91541Srgrimes *    notice, this list of conditions and the following disclaimer.
101541Srgrimes * 2. Redistributions in binary form must reproduce the above copyright
111541Srgrimes *    notice, this list of conditions and the following disclaimer in the
121541Srgrimes *    documentation and/or other materials provided with the distribution.
13203964Simp * 3. Neither the name of the University nor the names of its contributors
141541Srgrimes *    may be used to endorse or promote products derived from this software
151541Srgrimes *    without specific prior written permission.
161541Srgrimes *
171541Srgrimes * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
181541Srgrimes * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
191541Srgrimes * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
201541Srgrimes * ARE DISCLAIMED.  IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
211541Srgrimes * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
221541Srgrimes * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
231541Srgrimes * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
241541Srgrimes * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
251541Srgrimes * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
261541Srgrimes * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
271541Srgrimes * SUCH DAMAGE.
281541Srgrimes *
291541Srgrimes *	@(#)termios.h	8.3 (Berkeley) 3/28/94
3050477Speter * $FreeBSD$
311541Srgrimes */
321541Srgrimes
33199898Sed#ifndef _TERMIOS_H_
34199898Sed#define	_TERMIOS_H_
351541Srgrimes
36199898Sed#include <sys/cdefs.h>
37199898Sed#include <sys/_termios.h>
38178295Sdavidxu#include <sys/_types.h>
39199898Sed
40178295Sdavidxu#ifndef _PID_T_DECLARED
41178295Sdavidxutypedef	__pid_t		pid_t;
42178295Sdavidxu#define	_PID_T_DECLARED
43178295Sdavidxu#endif
44178295Sdavidxu
451541Srgrimes#ifndef _POSIX_SOURCE
46181905Sed#define	OXTABS		TAB3
47181905Sed#define	MDMBUF		CCAR_OFLOW
48199898Sed#endif
491541Srgrimes
501541Srgrimes#ifndef _POSIX_SOURCE
51185233Sdwmalone#define	CCEQ(val, c)	((c) == (val) && (val) != _POSIX_VDISABLE)
52181905Sed#endif
53181905Sed
54180561Sed/*
55180561Sed * Commands passed to tcsetattr() for setting the termios structure.
56180561Sed */
57180561Sed#define	TCSANOW		0		/* make change immediate */
58180561Sed#define	TCSADRAIN	1		/* drain output, then change */
59180561Sed#define	TCSAFLUSH	2		/* drain output, flush input */
60180561Sed#ifndef _POSIX_SOURCE
61182817Sed#define	TCSASOFT	0x10		/* flag - don't alter h.w. state */
62180561Sed#endif
63180561Sed
641541Srgrimes#define	TCIFLUSH	1
651541Srgrimes#define	TCOFLUSH	2
66182817Sed#define	TCIOFLUSH	3
671541Srgrimes#define	TCOOFF		1
681541Srgrimes#define	TCOON		2
69182817Sed#define	TCIOFF		3
70182817Sed#define	TCION		4
711541Srgrimes
721541Srgrimes__BEGIN_DECLS
7392719Salfredspeed_t	cfgetispeed(const struct termios *);
7492719Salfredspeed_t	cfgetospeed(const struct termios *);
7592719Salfredint	cfsetispeed(struct termios *, speed_t);
7692719Salfredint	cfsetospeed(struct termios *, speed_t);
7792719Salfredint	tcgetattr(int, struct termios *);
7892719Salfredint	tcsetattr(int, int, const struct termios *);
7992719Salfredint	tcdrain(int);
8092719Salfredint	tcflow(int, int);
8192719Salfredint	tcflush(int, int);
8292719Salfredint	tcsendbreak(int, int);
831541Srgrimes
84178295Sdavidxu#if __POSIX_VISIBLE >= 200112 || __BSD_VISIBLE
85178295Sdavidxupid_t	tcgetsid(int);
86178295Sdavidxu#endif
87191882Sed#if __BSD_VISIBLE
88191882Sedint	tcsetsid(int, pid_t);
89178295Sdavidxu
9092719Salfredvoid	cfmakeraw(struct termios *);
91214680Sedvoid	cfmakesane(struct termios *);
9292719Salfredint	cfsetspeed(struct termios *, speed_t);
93189813Sdas#endif
941541Srgrimes__END_DECLS
951541Srgrimes
96199898Sed#endif /* !_TERMIOS_H_ */
971541Srgrimes
981541Srgrimes#ifndef _POSIX_SOURCE
991541Srgrimes#include <sys/ttycom.h>
1001541Srgrimes#include <sys/ttydefaults.h>
1011541Srgrimes#endif
102