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