]> code.delx.au - gnu-emacs/blob - src/systty.h
a29c4933d7ba17a96f6d2f5e86baf4ff42e2c1f3
[gnu-emacs] / src / systty.h
1 /* systty.h - System-dependent definitions for terminals.
2 Copyright (C) 1993-1994, 2001-2014 Free Software Foundation, Inc.
3
4 This file is part of GNU Emacs.
5
6 GNU Emacs 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 3 of the License, or
9 (at your option) any later version.
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
17 along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. */
18
19 /* Include the proper files. */
20
21 #ifndef DOS_NT
22 #include <termios.h>
23 #include <fcntl.h>
24 #endif /* not DOS_NT */
25
26 #include <stdbool.h>
27 #include <sys/ioctl.h>
28
29 #ifdef HPUX
30 #include <sys/bsdtty.h>
31 #include <sys/ptyio.h>
32 #endif
33
34 #ifdef AIX
35 #include <sys/pty.h>
36 #endif /* AIX */
37
38 #include <unistd.h>
39
40 \f
41 /* Try to establish the correct character to disable terminal functions
42 in a system-independent manner. Note that USG (at least) define
43 _POSIX_VDISABLE as 0! */
44
45 #ifdef _POSIX_VDISABLE
46 #define CDISABLE _POSIX_VDISABLE
47 #else /* not _POSIX_VDISABLE */
48 #ifdef CDEL
49 #undef CDISABLE
50 #define CDISABLE CDEL
51 #else /* not CDEL */
52 #define CDISABLE 255
53 #endif /* not CDEL */
54 #endif /* not _POSIX_VDISABLE */
55 \f
56 /* Manipulate a TTY's input/output processing parameters. */
57
58 /* struct emacs_tty is a structure used to hold the current tty
59 parameters. If the terminal has several structures describing its
60 state, for example a struct tchars, a struct sgttyb, a struct
61 tchars, a struct ltchars, and a struct pagechars, struct
62 emacs_tty should contain an element for each parameter struct
63 that Emacs may change. */
64
65
66 /* For each tty parameter structure that Emacs might want to save and restore,
67 - include an element for it in this structure, and
68 - extend the emacs_{get,set}_tty functions in sysdep.c to deal with the
69 new members. */
70
71 struct emacs_tty {
72
73 /* There is always one of the following elements, so there is no need
74 for dummy get and set definitions. */
75 #ifndef DOS_NT
76 struct termios main;
77 #else /* DOS_NT */
78 unsigned main;
79 #endif /* DOS_NT */
80 };
81 \f
82 /* From sysdep.c or w32.c */
83 extern int emacs_get_tty (int, struct emacs_tty *) EXTERNALLY_VISIBLE;
84 extern int emacs_set_tty (int, struct emacs_tty *, bool) EXTERNALLY_VISIBLE;
85 extern void suppress_echo_on_tty (int);
86 extern int serial_open (Lisp_Object);
87 extern void serial_configure (struct Lisp_Process *, Lisp_Object);