]> git.ipfire.org Git - thirdparty/binutils-gdb.git/blame - gdb/terminal.h
Update Copyright year range in all files maintained by GDB.
[thirdparty/binutils-gdb.git] / gdb / terminal.h
CommitLineData
c906108c 1/* Terminal interface definitions for GDB, the GNU Debugger.
ecd75fc8 2 Copyright (C) 1986-2014 Free Software Foundation, Inc.
c906108c 3
c5aa993b 4 This file is part of GDB.
c906108c 5
c5aa993b
JM
6 This program is free software; you can redistribute it and/or modify
7 it under the terms of the GNU General Public License as published by
a9762ec7 8 the Free Software Foundation; either version 3 of the License, or
c5aa993b 9 (at your option) any later version.
c906108c 10
c5aa993b
JM
11 This program is distributed in the hope that it will be useful,
12 but WITHOUT ANY WARRANTY; without even the implied warranty of
13 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 GNU General Public License for more details.
c906108c 15
c5aa993b 16 You should have received a copy of the GNU General Public License
a9762ec7 17 along with this program. If not, see <http://www.gnu.org/licenses/>. */
c906108c
SS
18
19#if !defined (TERMINAL_H)
20#define TERMINAL_H 1
21
22
23/* If we're using autoconf, it will define HAVE_TERMIOS_H,
c378eb4e 24 HAVE_TERMIO_H and HAVE_SGTTY_H for us. One day we can rewrite
c906108c
SS
25 ser-unix.c and inflow.c to inspect those names instead of
26 HAVE_TERMIOS, HAVE_TERMIO and the implicit HAVE_SGTTY (when neither
27 HAVE_TERMIOS or HAVE_TERMIO is set). Until then, make sure that
28 nothing has already defined the one of the names, and do the right
c378eb4e 29 thing. */
c906108c 30
c906108c
SS
31#if !defined (HAVE_TERMIOS) && !defined(HAVE_TERMIO) && !defined(HAVE_SGTTY)
32#if defined(HAVE_TERMIOS_H)
33#define HAVE_TERMIOS
34#else /* ! defined (HAVE_TERMIOS_H) */
35#if defined(HAVE_TERMIO_H)
36#define HAVE_TERMIO
37#else /* ! defined (HAVE_TERMIO_H) */
38#if defined(HAVE_SGTTY_H)
39#define HAVE_SGTTY
40#endif /* ! defined (HAVE_SGTTY_H) */
41#endif /* ! defined (HAVE_TERMIO_H) */
42#endif /* ! defined (HAVE_TERMIOS_H) */
3e43a32a
MS
43#endif /* !defined (HAVE_TERMIOS) && !defined (HAVE_TERMIO) &&
44 !defined (HAVE_SGTTY) */
c906108c
SS
45
46#if defined(HAVE_TERMIOS)
47#include <termios.h>
48#endif
49
53a5351d 50#if !defined(_WIN32) && !defined (HAVE_TERMIOS)
c906108c
SS
51
52/* Define a common set of macros -- BSD based -- and redefine whatever
53 the system offers to make it look like that. FIXME: serial.h and
54 ser-*.c deal with this in a much cleaner fashion; as soon as stuff
55 is converted to use them, can get rid of this crap. */
56
57#ifdef HAVE_TERMIO
58
59#include <termio.h>
60
61#undef TIOCGETP
62#define TIOCGETP TCGETA
63#undef TIOCSETN
64#define TIOCSETN TCSETA
65#undef TIOCSETP
66#define TIOCSETP TCSETAF
67#define TERMINAL struct termio
68
69#else /* sgtty */
70
71#include <fcntl.h>
72#include <sgtty.h>
73#include <sys/ioctl.h>
74#define TERMINAL struct sgttyb
75
76#endif /* sgtty */
77#endif
78
191c4426
PA
79struct inferior;
80
81extern void new_tty_prefork (const char *);
82
a14ed312 83extern void new_tty (void);
c906108c 84
191c4426
PA
85extern void new_tty_postfork (void);
86
87extern void copy_terminal_info (struct inferior *to, struct inferior *from);
88
c906108c
SS
89/* Do we have job control? Can be assumed to always be the same within
90 a given run of GDB. In inflow.c. */
91extern int job_control;
92
a0fe373c 93extern pid_t create_tty_session (void);
83116857 94
c906108c
SS
95/* Set the process group of the caller to its own pid, or do nothing if
96 we lack job control. */
a14ed312 97extern int gdb_setpgid (void);
c906108c 98
0ea3f30e
DJ
99/* Set up a serial structure describing standard input. In inflow.c. */
100extern void initialize_stdin_serial (void);
101
191c4426
PA
102extern int gdb_has_a_terminal (void);
103
104/* Set the process group of the caller to its own pid, or do nothing
105 if we lack job control. */
106extern int gdb_setpgid (void);
107
c5aa993b 108#endif /* !defined (TERMINAL_H) */