systty.h 2.4 KB
Newer Older
Jim Blandy's avatar
Jim Blandy committed
1
/* systty.h - System-dependent definitions for terminals.
2
   Copyright (C) 1993-1994, 2001-2012  Free Software Foundation, Inc.
Jim Blandy's avatar
Jim Blandy committed
3 4 5

This file is part of GNU Emacs.

6
GNU Emacs is free software: you can redistribute it and/or modify
Jim Blandy's avatar
Jim Blandy committed
7
it under the terms of the GNU General Public License as published by
8 9
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
Jim Blandy's avatar
Jim Blandy committed
10 11 12 13 14 15 16

GNU Emacs is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
GNU General Public License for more details.

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/>.  */
Jim Blandy's avatar
Jim Blandy committed
18 19

/* Include the proper files.  */
Paul Eggert's avatar
Paul Eggert committed
20

Dan Nicolaescu's avatar
Dan Nicolaescu committed
21
#ifndef DOS_NT
Jim Blandy's avatar
Jim Blandy committed
22
#include <termios.h>
23
#include <fcntl.h>
Richard M. Stallman's avatar
Richard M. Stallman committed
24
#endif /* not DOS_NT */
Jim Blandy's avatar
Jim Blandy committed
25

26
#include <sys/ioctl.h>
27

28
#ifdef HPUX
Jim Blandy's avatar
Jim Blandy committed
29 30 31
#include <sys/bsdtty.h>
#include <sys/ptyio.h>
#endif
32

Jim Blandy's avatar
Jim Blandy committed
33 34 35 36
#ifdef AIX
#include <sys/pty.h>
#endif /* AIX */

37
#include <unistd.h>
38

Richard M. Stallman's avatar
Richard M. Stallman committed
39 40 41 42 43 44 45 46 47

/* Try to establish the correct character to disable terminal functions
   in a system-independent manner.  Note that USG (at least) define
   _POSIX_VDISABLE as 0!  */

#ifdef _POSIX_VDISABLE
#define CDISABLE _POSIX_VDISABLE
#else /* not _POSIX_VDISABLE */
#ifdef CDEL
48
#undef CDISABLE
Richard M. Stallman's avatar
Richard M. Stallman committed
49 50 51 52 53
#define CDISABLE CDEL
#else /* not CDEL */
#define CDISABLE 255
#endif /* not CDEL */
#endif /* not _POSIX_VDISABLE */
Jim Blandy's avatar
Jim Blandy committed
54 55 56 57 58 59 60 61

/* Manipulate a TTY's input/output processing parameters.  */

/* struct emacs_tty is a structure used to hold the current tty
   parameters.  If the terminal has several structures describing its
   state, for example a struct tchars, a struct sgttyb, a struct
   tchars, a struct ltchars, and a struct pagechars, struct
   emacs_tty should contain an element for each parameter struct
Dan Nicolaescu's avatar
Dan Nicolaescu committed
62
   that Emacs may change.  */
Jim Blandy's avatar
Jim Blandy committed
63 64 65


/* For each tty parameter structure that Emacs might want to save and restore,
66 67 68
   - include an element for it in this structure, and
   - extend the emacs_{get,set}_tty functions in sysdep.c to deal with the
     new members.  */
Jim Blandy's avatar
Jim Blandy committed
69 70 71 72 73

struct emacs_tty {

/* There is always one of the following elements, so there is no need
   for dummy get and set definitions.  */
Dan Nicolaescu's avatar
Dan Nicolaescu committed
74
#ifndef DOS_NT
Jim Blandy's avatar
Jim Blandy committed
75
  struct termios main;
Dan Nicolaescu's avatar
Dan Nicolaescu committed
76
#else /* DOS_NT */
77
  int main;
Dan Nicolaescu's avatar
Dan Nicolaescu committed
78
#endif /* DOS_NT */
79 80
};

81 82 83
/* From sysdep.c or w32.c  */
extern int serial_open (char *);
extern void serial_configure (struct Lisp_Process *, Lisp_Object);