1 /* Terminal interface definitions for GDB, the GNU Debugger.
2 Copyright 1986, 1989, 1991, 1992 Free Software Foundation, Inc.
4 This file is part of GDB.
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
8 the Free Software Foundation; either version 2 of the License, or
9 (at your option) any later version.
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.
16 You should have received a copy of the GNU General Public License
17 along with this program; if not, write to the Free Software
18 Foundation, Inc., 59 Temple Place - Suite 330,
19 Boston, MA 02111-1307, USA. */
21 #if !defined (TERMINAL_H)
25 /* If we're using autoconf, it will define HAVE_TERMIOS_H,
26 HAVE_TERMIO_H and HAVE_SGTTY_H for us. One day we can rewrite
27 ser-unix.c and inflow.c to inspect those names instead of
28 HAVE_TERMIOS, HAVE_TERMIO and the implicit HAVE_SGTTY (when neither
29 HAVE_TERMIOS or HAVE_TERMIO is set). Until then, make sure that
30 nothing has already defined the one of the names, and do the right
33 /* nothing works with go32, and the headers aren't complete */
34 #if !defined (__GO32__)
35 #if !defined (HAVE_TERMIOS) && !defined(HAVE_TERMIO) && !defined(HAVE_SGTTY)
36 #if defined(HAVE_TERMIOS_H)
38 #else /* ! defined (HAVE_TERMIOS_H) */
39 #if defined(HAVE_TERMIO_H)
41 #else /* ! defined (HAVE_TERMIO_H) */
42 #if defined(HAVE_SGTTY_H)
44 #endif /* ! defined (HAVE_SGTTY_H) */
45 #endif /* ! defined (HAVE_TERMIO_H) */
46 #endif /* ! defined (HAVE_TERMIOS_H) */
47 #endif /* !defined (HAVE_TERMIOS) && !defined(HAVE_TERMIO) && !defined(HAVE_SGTTY) */
48 #endif /* ! defined (__GO32__) */
50 #if defined(HAVE_TERMIOS)
54 #if !defined(__GO32__) && !defined(_WIN32) && !defined (HAVE_TERMIOS)
56 /* Define a common set of macros -- BSD based -- and redefine whatever
57 the system offers to make it look like that. FIXME: serial.h and
58 ser-*.c deal with this in a much cleaner fashion; as soon as stuff
59 is converted to use them, can get rid of this crap. */
66 #define TIOCGETP TCGETA
68 #define TIOCSETN TCSETA
70 #define TIOCSETP TCSETAF
71 #define TERMINAL struct termio
77 #include <sys/ioctl.h>
78 #define TERMINAL struct sgttyb
83 extern void new_tty PARAMS ((void));
85 /* Do we have job control? Can be assumed to always be the same within
86 a given run of GDB. In inflow.c. */
87 extern int job_control;
89 /* Set the process group of the caller to its own pid, or do nothing if
90 we lack job control. */
91 extern int gdb_setpgid PARAMS ((void));
93 #endif /* !defined (TERMINAL_H) */