]>
Commit | Line | Data |
---|---|---|
bd5635a1 | 1 | /* Terminal interface definitions for GDB, the GNU Debugger. |
686941a9 | 2 | Copyright 1986, 1989, 1991, 1992 Free Software Foundation, Inc. |
bd5635a1 RP |
3 | |
4 | This file is part of GDB. | |
5 | ||
686941a9 | 6 | This program is free software; you can redistribute it and/or modify |
bd5635a1 | 7 | it under the terms of the GNU General Public License as published by |
686941a9 SC |
8 | the Free Software Foundation; either version 2 of the License, or |
9 | (at your option) any later version. | |
bd5635a1 | 10 | |
686941a9 | 11 | This program is distributed in the hope that it will be useful, |
bd5635a1 RP |
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. | |
15 | ||
16 | You should have received a copy of the GNU General Public License | |
686941a9 SC |
17 | along with this program; if not, write to the Free Software |
18 | Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ | |
bd5635a1 | 19 | |
686941a9 SC |
20 | #if !defined (TERMINAL_H) |
21 | #define TERMINAL_H 1 | |
22 | ||
23 | ||
24 | /* If we're using autoconf, it will define HAVE_TERMIOS_H, | |
25 | HAVE_TERMIO_H and HAVE_SGTTY_H for us. One day we can rewrite | |
26 | ser-unix.c and inflow.c to inspect those names instead of | |
27 | HAVE_TERMIOS, HAVE_TERMIO and the implicit HAVE_SGTYY (when neither | |
28 | HAVE_TERMIOS or HAVE_TERMIO is set). Until then, make sure that | |
29 | nothing has already defined the one of the names, and do the right | |
30 | thing. */ | |
31 | ||
32 | /* nothing works with go32, and the headers aren't complete */ | |
33 | #if !defined (__GO32__) | |
34 | #if !defined (HAVE_TERMIOS) && !defined(HAVE_TERMIO) && !defined(HAVE_SGTTY) | |
35 | #if defined(HAVE_TERMIOS_H) | |
36 | #define HAVE_TERMIOS | |
37 | #elif defined(HAVE_TERMIO_H) | |
38 | #define HAVE_TERMIO | |
39 | #elif defined(HAVE_SGTTY) | |
40 | #define HAVE_SGTTY | |
41 | #endif | |
42 | #endif | |
43 | #endif | |
44 | ||
45 | #if defined(HAVE_TERMIOS) | |
46 | #include <termios.h> | |
47 | #endif | |
48 | ||
49 | ||
50 | #if !defined(__GO32__) && !defined(__WIN32__) && !defined (HAVE_TERMIOS) | |
bd5635a1 RP |
51 | |
52 | /* Define a common set of macros -- BSD based -- and redefine whatever | |
686941a9 SC |
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. */ | |
bd5635a1 RP |
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 | ||
686941a9 | 69 | #else /* sgtty */ |
bd5635a1 RP |
70 | |
71 | #include <fcntl.h> | |
72 | #include <sgtty.h> | |
73 | #include <sys/ioctl.h> | |
74 | #define TERMINAL struct sgttyb | |
75 | ||
686941a9 SC |
76 | #endif /* sgtty */ |
77 | #endif | |
78 | ||
79 | extern void new_tty PARAMS ((void)); | |
80 | ||
81 | /* Do we have job control? Can be assumed to always be the same within | |
82 | a given run of GDB. In inflow.c. */ | |
83 | extern int job_control; | |
84 | ||
85 | /* Set the process group of the caller to its own pid, or do nothing if | |
86 | we lack job control. */ | |
87 | extern int gdb_setpgid PARAMS ((void)); | |
bd5635a1 | 88 | |
686941a9 | 89 | #endif /* !defined (TERMINAL_H) */ |