xref: /utopia/UTPA2-700.0.x/projects/tools/lint/mips-linux-gnu_include/termios.h (revision 53ee8cc121a030b8d368113ac3e966b4705770ef)
1*53ee8cc1Swenshuai.xi /* Copyright (C) 1991,92,93,94,96,97,98,99, 2003 Free Software Foundation, Inc.
2*53ee8cc1Swenshuai.xi    This file is part of the GNU C Library.
3*53ee8cc1Swenshuai.xi 
4*53ee8cc1Swenshuai.xi    The GNU C Library is free software; you can redistribute it and/or
5*53ee8cc1Swenshuai.xi    modify it under the terms of the GNU Lesser General Public
6*53ee8cc1Swenshuai.xi    License as published by the Free Software Foundation; either
7*53ee8cc1Swenshuai.xi    version 2.1 of the License, or (at your option) any later version.
8*53ee8cc1Swenshuai.xi 
9*53ee8cc1Swenshuai.xi    The GNU C Library is distributed in the hope that it will be useful,
10*53ee8cc1Swenshuai.xi    but WITHOUT ANY WARRANTY; without even the implied warranty of
11*53ee8cc1Swenshuai.xi    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
12*53ee8cc1Swenshuai.xi    Lesser General Public License for more details.
13*53ee8cc1Swenshuai.xi 
14*53ee8cc1Swenshuai.xi    You should have received a copy of the GNU Lesser General Public
15*53ee8cc1Swenshuai.xi    License along with the GNU C Library; if not, write to the Free
16*53ee8cc1Swenshuai.xi    Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
17*53ee8cc1Swenshuai.xi    02111-1307 USA.  */
18*53ee8cc1Swenshuai.xi 
19*53ee8cc1Swenshuai.xi /*
20*53ee8cc1Swenshuai.xi  *	POSIX Standard: 7.1-2 General Terminal Interface	<termios.h>
21*53ee8cc1Swenshuai.xi  */
22*53ee8cc1Swenshuai.xi 
23*53ee8cc1Swenshuai.xi #ifndef	_TERMIOS_H
24*53ee8cc1Swenshuai.xi #define	_TERMIOS_H	1
25*53ee8cc1Swenshuai.xi 
26*53ee8cc1Swenshuai.xi #include <features.h>
27*53ee8cc1Swenshuai.xi #ifdef __USE_UNIX98
28*53ee8cc1Swenshuai.xi /* We need `pid_t'.  */
29*53ee8cc1Swenshuai.xi # include <bits/types.h>
30*53ee8cc1Swenshuai.xi # ifndef __pid_t_defined
31*53ee8cc1Swenshuai.xi typedef __pid_t pid_t;
32*53ee8cc1Swenshuai.xi #  define __pid_t_defined
33*53ee8cc1Swenshuai.xi # endif
34*53ee8cc1Swenshuai.xi #endif
35*53ee8cc1Swenshuai.xi 
36*53ee8cc1Swenshuai.xi __BEGIN_DECLS
37*53ee8cc1Swenshuai.xi 
38*53ee8cc1Swenshuai.xi /* Get the system-dependent definitions of `struct termios', `tcflag_t',
39*53ee8cc1Swenshuai.xi    `cc_t', `speed_t', and all the macros specifying the flag bits.  */
40*53ee8cc1Swenshuai.xi #include <bits/termios.h>
41*53ee8cc1Swenshuai.xi 
42*53ee8cc1Swenshuai.xi #ifdef __USE_BSD
43*53ee8cc1Swenshuai.xi /* Compare a character C to a value VAL from the `c_cc' array in a
44*53ee8cc1Swenshuai.xi    `struct termios'.  If VAL is _POSIX_VDISABLE, no character can match it.  */
45*53ee8cc1Swenshuai.xi # define CCEQ(val, c)	((c) == (val) && (val) != _POSIX_VDISABLE)
46*53ee8cc1Swenshuai.xi #endif
47*53ee8cc1Swenshuai.xi 
48*53ee8cc1Swenshuai.xi /* Return the output baud rate stored in *TERMIOS_P.  */
49*53ee8cc1Swenshuai.xi extern speed_t cfgetospeed (__const struct termios *__termios_p) __THROW;
50*53ee8cc1Swenshuai.xi 
51*53ee8cc1Swenshuai.xi /* Return the input baud rate stored in *TERMIOS_P.  */
52*53ee8cc1Swenshuai.xi extern speed_t cfgetispeed (__const struct termios *__termios_p) __THROW;
53*53ee8cc1Swenshuai.xi 
54*53ee8cc1Swenshuai.xi /* Set the output baud rate stored in *TERMIOS_P to SPEED.  */
55*53ee8cc1Swenshuai.xi extern int cfsetospeed (struct termios *__termios_p, speed_t __speed) __THROW;
56*53ee8cc1Swenshuai.xi 
57*53ee8cc1Swenshuai.xi /* Set the input baud rate stored in *TERMIOS_P to SPEED.  */
58*53ee8cc1Swenshuai.xi extern int cfsetispeed (struct termios *__termios_p, speed_t __speed) __THROW;
59*53ee8cc1Swenshuai.xi 
60*53ee8cc1Swenshuai.xi #ifdef	__USE_BSD
61*53ee8cc1Swenshuai.xi /* Set both the input and output baud rates in *TERMIOS_OP to SPEED.  */
62*53ee8cc1Swenshuai.xi extern int cfsetspeed (struct termios *__termios_p, speed_t __speed) __THROW;
63*53ee8cc1Swenshuai.xi #endif
64*53ee8cc1Swenshuai.xi 
65*53ee8cc1Swenshuai.xi 
66*53ee8cc1Swenshuai.xi /* Put the state of FD into *TERMIOS_P.  */
67*53ee8cc1Swenshuai.xi extern int tcgetattr (int __fd, struct termios *__termios_p) __THROW;
68*53ee8cc1Swenshuai.xi 
69*53ee8cc1Swenshuai.xi /* Set the state of FD to *TERMIOS_P.
70*53ee8cc1Swenshuai.xi    Values for OPTIONAL_ACTIONS (TCSA*) are in <bits/termios.h>.  */
71*53ee8cc1Swenshuai.xi extern int tcsetattr (int __fd, int __optional_actions,
72*53ee8cc1Swenshuai.xi 		      __const struct termios *__termios_p) __THROW;
73*53ee8cc1Swenshuai.xi 
74*53ee8cc1Swenshuai.xi 
75*53ee8cc1Swenshuai.xi #ifdef	__USE_BSD
76*53ee8cc1Swenshuai.xi /* Set *TERMIOS_P to indicate raw mode.  */
77*53ee8cc1Swenshuai.xi extern void cfmakeraw (struct termios *__termios_p) __THROW;
78*53ee8cc1Swenshuai.xi #endif
79*53ee8cc1Swenshuai.xi 
80*53ee8cc1Swenshuai.xi /* Send zero bits on FD.  */
81*53ee8cc1Swenshuai.xi extern int tcsendbreak (int __fd, int __duration) __THROW;
82*53ee8cc1Swenshuai.xi 
83*53ee8cc1Swenshuai.xi /* Wait for pending output to be written on FD.
84*53ee8cc1Swenshuai.xi 
85*53ee8cc1Swenshuai.xi    This function is a cancellation point and therefore not marked with
86*53ee8cc1Swenshuai.xi    __THROW.  */
87*53ee8cc1Swenshuai.xi extern int tcdrain (int __fd);
88*53ee8cc1Swenshuai.xi 
89*53ee8cc1Swenshuai.xi /* Flush pending data on FD.
90*53ee8cc1Swenshuai.xi    Values for QUEUE_SELECTOR (TC{I,O,IO}FLUSH) are in <bits/termios.h>.  */
91*53ee8cc1Swenshuai.xi extern int tcflush (int __fd, int __queue_selector) __THROW;
92*53ee8cc1Swenshuai.xi 
93*53ee8cc1Swenshuai.xi /* Suspend or restart transmission on FD.
94*53ee8cc1Swenshuai.xi    Values for ACTION (TC[IO]{OFF,ON}) are in <bits/termios.h>.  */
95*53ee8cc1Swenshuai.xi extern int tcflow (int __fd, int __action) __THROW;
96*53ee8cc1Swenshuai.xi 
97*53ee8cc1Swenshuai.xi 
98*53ee8cc1Swenshuai.xi #ifdef __USE_UNIX98
99*53ee8cc1Swenshuai.xi /* Get process group ID for session leader for controlling terminal FD.  */
100*53ee8cc1Swenshuai.xi extern __pid_t tcgetsid (int __fd) __THROW;
101*53ee8cc1Swenshuai.xi #endif
102*53ee8cc1Swenshuai.xi 
103*53ee8cc1Swenshuai.xi 
104*53ee8cc1Swenshuai.xi #ifdef __USE_BSD
105*53ee8cc1Swenshuai.xi # include <sys/ttydefaults.h>
106*53ee8cc1Swenshuai.xi #endif
107*53ee8cc1Swenshuai.xi 
108*53ee8cc1Swenshuai.xi __END_DECLS
109*53ee8cc1Swenshuai.xi 
110*53ee8cc1Swenshuai.xi #endif /* termios.h  */
111