* lisp/erc/erc-backend.el: Fix last bug number.
[emacs.git] / src / systty.h
blobb7f36c6c25908df3da1d6502937d36d292685cf3
1 /* systty.h - System-dependent definitions for terminals.
2 Copyright (C) 1993-1994, 2001-2012 Free Software Foundation, Inc.
4 This file is part of GNU Emacs.
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.
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.
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/>. */
19 /* Include the proper files. */
21 #ifndef DOS_NT
22 #include <termios.h>
23 #include <fcntl.h>
24 #endif /* not DOS_NT */
26 #include <sys/ioctl.h>
28 #ifdef HPUX
29 #include <sys/bsdtty.h>
30 #include <sys/ptyio.h>
31 #endif
33 #ifdef AIX
34 #include <sys/pty.h>
35 #endif /* AIX */
37 #include <unistd.h>
40 /* Try to establish the correct character to disable terminal functions
41 in a system-independent manner. Note that USG (at least) define
42 _POSIX_VDISABLE as 0! */
44 #ifdef _POSIX_VDISABLE
45 #define CDISABLE _POSIX_VDISABLE
46 #else /* not _POSIX_VDISABLE */
47 #ifdef CDEL
48 #undef CDISABLE
49 #define CDISABLE CDEL
50 #else /* not CDEL */
51 #define CDISABLE 255
52 #endif /* not CDEL */
53 #endif /* not _POSIX_VDISABLE */
55 /* Get the number of characters queued for output. */
57 /* EMACS_OUTQSIZE(FD, int *SIZE) stores the number of characters
58 queued for output to the terminal FD in *SIZE, if FD is a tty.
59 Returns -1 if there was an error (i.e. FD is not a tty), 0
60 otherwise. */
61 #ifdef TIOCOUTQ
62 #define EMACS_OUTQSIZE(fd, size) (ioctl ((fd), TIOCOUTQ, (size)))
63 #endif
66 /* Manipulate a terminal's current process group. */
68 /* EMACS_GETPGRP (arg) returns the process group of the process. */
70 #if defined (GETPGRP_VOID)
71 # define EMACS_GETPGRP(x) getpgrp()
72 #else /* !GETPGRP_VOID */
73 # define EMACS_GETPGRP(x) getpgrp(x)
74 #endif /* !GETPGRP_VOID */
76 /* Manipulate a TTY's input/output processing parameters. */
78 /* struct emacs_tty is a structure used to hold the current tty
79 parameters. If the terminal has several structures describing its
80 state, for example a struct tchars, a struct sgttyb, a struct
81 tchars, a struct ltchars, and a struct pagechars, struct
82 emacs_tty should contain an element for each parameter struct
83 that Emacs may change. */
86 /* For each tty parameter structure that Emacs might want to save and restore,
87 - include an element for it in this structure, and
88 - extend the emacs_{get,set}_tty functions in sysdep.c to deal with the
89 new members. */
91 struct emacs_tty {
93 /* There is always one of the following elements, so there is no need
94 for dummy get and set definitions. */
95 #ifndef DOS_NT
96 struct termios main;
97 #else /* DOS_NT */
98 int main;
99 #endif /* DOS_NT */
102 /* From sysdep.c or w32.c */
103 extern int serial_open (char *);
104 extern void serial_configure (struct Lisp_Process *, Lisp_Object);