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