Commit | Line | Data |
---|---|---|
a04c9535 | 1 | /* systty.h - System-dependent definitions for terminals. |
acaf905b | 2 | Copyright (C) 1993-1994, 2001-2012 Free Software Foundation, Inc. |
d0d6b7c5 JB |
3 | |
4 | This file is part of GNU Emacs. | |
5 | ||
b9b1cc14 | 6 | GNU Emacs is free software: you can redistribute it and/or modify |
d0d6b7c5 | 7 | it under the terms of the GNU General Public License as published by |
b9b1cc14 GM |
8 | the Free Software Foundation, either version 3 of the License, or |
9 | (at your option) any later version. | |
d0d6b7c5 JB |
10 | |
11 | GNU Emacs 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. | |
15 | ||
16 | You should have received a copy of the GNU General Public License | |
b9b1cc14 | 17 | along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. */ |
d0d6b7c5 | 18 | |
d0d6b7c5 | 19 | /* Include the proper files. */ |
a7ebc409 | 20 | #ifndef DOS_NT |
d2d846a3 | 21 | #ifndef NO_TERMIO |
d0d6b7c5 | 22 | #include <termio.h> |
d2d846a3 | 23 | #endif /* not NO_TERMIO */ |
d0d6b7c5 | 24 | #include <termios.h> |
1aaaff21 | 25 | #include <fcntl.h> |
101adcb5 | 26 | #endif /* not DOS_NT */ |
d0d6b7c5 | 27 | |
c3ff76c4 | 28 | #include <sys/ioctl.h> |
c9b67b7b | 29 | |
28823648 | 30 | #ifdef HPUX |
4746118a | 31 | #include <sys/bsdtty.h> |
4746118a JB |
32 | #include <sys/ptyio.h> |
33 | #endif | |
378ac314 | 34 | |
4746118a JB |
35 | #ifdef AIX |
36 | #include <sys/pty.h> | |
4746118a JB |
37 | #endif /* AIX */ |
38 | ||
9825c716 | 39 | #include <unistd.h> |
5ab57b9f | 40 | |
d0d6b7c5 JB |
41 | \f |
42 | /* Special cases - inhibiting the use of certain features. */ | |
43 | ||
d0d6b7c5 JB |
44 | /* Allow m- file to inhibit use of FIONREAD. */ |
45 | #ifdef BROKEN_FIONREAD | |
46 | #undef FIONREAD | |
47 | #undef ASYNC | |
48 | #endif | |
49 | ||
eb8c3be9 | 50 | /* Interrupt input is not used if there is no FIONREAD. */ |
d0d6b7c5 JB |
51 | #ifndef FIONREAD |
52 | #undef SIGIO | |
53 | #endif | |
54 | ||
55 | \f | |
2102829e RS |
56 | /* Try to establish the correct character to disable terminal functions |
57 | in a system-independent manner. Note that USG (at least) define | |
58 | _POSIX_VDISABLE as 0! */ | |
59 | ||
60 | #ifdef _POSIX_VDISABLE | |
61 | #define CDISABLE _POSIX_VDISABLE | |
62 | #else /* not _POSIX_VDISABLE */ | |
63 | #ifdef CDEL | |
d04e8e46 | 64 | #undef CDISABLE |
2102829e RS |
65 | #define CDISABLE CDEL |
66 | #else /* not CDEL */ | |
67 | #define CDISABLE 255 | |
68 | #endif /* not CDEL */ | |
69 | #endif /* not _POSIX_VDISABLE */ | |
70 | \f | |
d0d6b7c5 JB |
71 | /* Get the number of characters queued for output. */ |
72 | ||
73 | /* EMACS_OUTQSIZE(FD, int *SIZE) stores the number of characters | |
74 | queued for output to the terminal FD in *SIZE, if FD is a tty. | |
75 | Returns -1 if there was an error (i.e. FD is not a tty), 0 | |
76 | otherwise. */ | |
77 | #ifdef TIOCOUTQ | |
78 | #define EMACS_OUTQSIZE(fd, size) (ioctl ((fd), TIOCOUTQ, (size))) | |
79 | #endif | |
80 | ||
d0d6b7c5 JB |
81 | \f |
82 | /* Manipulate a terminal's current process group. */ | |
83 | ||
281bbdfb | 84 | /* EMACS_GETPGRP (arg) returns the process group of the process. */ |
727b007c | 85 | |
f7ff70e8 | 86 | #if defined (GETPGRP_VOID) |
727b007c | 87 | # define EMACS_GETPGRP(x) getpgrp() |
27ec92c9 | 88 | #else /* !GETPGRP_VOID */ |
727b007c | 89 | # define EMACS_GETPGRP(x) getpgrp(x) |
f7ff70e8 | 90 | #endif /* !GETPGRP_VOID */ |
d0d6b7c5 JB |
91 | \f |
92 | /* Manipulate a TTY's input/output processing parameters. */ | |
93 | ||
94 | /* struct emacs_tty is a structure used to hold the current tty | |
95 | parameters. If the terminal has several structures describing its | |
96 | state, for example a struct tchars, a struct sgttyb, a struct | |
97 | tchars, a struct ltchars, and a struct pagechars, struct | |
98 | emacs_tty should contain an element for each parameter struct | |
12e610e8 | 99 | that Emacs may change. */ |
d0d6b7c5 JB |
100 | |
101 | ||
d0d6b7c5 | 102 | /* For each tty parameter structure that Emacs might want to save and restore, |
1334b321 JB |
103 | - include an element for it in this structure, and |
104 | - extend the emacs_{get,set}_tty functions in sysdep.c to deal with the | |
105 | new members. */ | |
d0d6b7c5 JB |
106 | |
107 | struct emacs_tty { | |
108 | ||
109 | /* There is always one of the following elements, so there is no need | |
110 | for dummy get and set definitions. */ | |
a7ebc409 | 111 | #ifndef DOS_NT |
d0d6b7c5 | 112 | struct termios main; |
a7ebc409 | 113 | #else /* DOS_NT */ |
8e99c732 | 114 | int main; |
a7ebc409 | 115 | #endif /* DOS_NT */ |
2182d459 RS |
116 | }; |
117 | \f | |
a0977c44 PE |
118 | /* From sysdep.c or w32.c */ |
119 | extern int serial_open (char *); | |
120 | extern void serial_configure (struct Lisp_Process *, Lisp_Object); |