-/* systerm.h - System-dependent definitions for terminals.
+/* systty.h - System-dependent definitions for terminals.
Copyright (C) 1992 Free Software Foundation, Inc.
This file is part of GNU Emacs.
along with GNU Emacs; see the file COPYING. If not, write to
the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. */
+#ifdef HAVE_TERMIOS
+#define HAVE_TCATTR
+#endif
\f
/* Include the proper files. */
#ifdef HAVE_TERMIO
#ifdef HAVE_TERMIOS
#include <termio.h>
#include <termios.h>
+#include <fcntl.h>
#else /* neither HAVE_TERMIO nor HAVE_TERMIOS */
#ifndef VMS
#include <sgtty.h>
-#endif /* not VMS */
+#else /* VMS */
+#include <descrip.h>
+static struct iosb
+{
+ short status;
+ short offset;
+ short termlen;
+ short term;
+} input_iosb;
+
+extern int waiting_for_ast;
+extern int stop_input;
+#if 0 /* VAX C doeasn't understand initializing declarations */
+extern int input_ef = 0;
+extern int timer_ef = 0;
+extern int process_ef = 0;
+#else
+extern int input_ef;
+extern int timer_ef;
+extern int process_ef;
+#endif
+extern int input_eflist;
+extern int timer_eflist;
+
+static $DESCRIPTOR (input_dsc, "TT");
+static int terminator_mask[2] = { 0, 0 };
+
+static struct sensemode {
+ short status;
+ unsigned char xmit_baud;
+ unsigned char rcv_baud;
+ unsigned char crfill;
+ unsigned char lffill;
+ unsigned char parity;
+ unsigned char unused;
+ char class;
+ char type;
+ short scr_wid;
+ unsigned long tt_char : 24, scr_len : 8;
+ unsigned long tt2_char;
+} sensemode_iosb;
+#endif /* VMS */
#endif /* not HAVE_TERMIOS */
#endif /* not HAVE_TERMIO */
#endif
\f
+/* 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
+#define CDISABLE CDEL
+#else /* not CDEL */
+#define CDISABLE 255
+#endif /* not CDEL */
+#endif /* not _POSIX_VDISABLE */
+\f
/* Get the number of characters queued for output. */
/* EMACS_OUTQSIZE(FD, int *SIZE) stores the number of characters
/* Just ignore this for now and hope for the best */
#define EMACS_GET_TTY_PGRP(fd, pgid) 0
+#define EMACS_SET_TTY_PGRP(fd, pgif) 0
#endif
advantage to using tabs over spaces. */
-
/* For each tty parameter structure that Emacs might want to save and restore,
- include an element for it in this structure,
- define a pair of numbered macros to get and set it and return
/* There is always one of the following elements, so there is no need
for dummy get and set definitions. */
-#ifdef HAVE_TERMIOS
+#ifdef HAVE_TCATTR
struct termios main;
#else
#ifdef HAVE_TERMIO
#endif
#endif
#endif
-
-#ifdef HAVE_TERMIOS
-#define HAVE_TCATTR
+#ifdef TIOCGLTC
+ struct ltchars ltchars;
#endif
+#ifdef TIOCGETC
+ struct tchars tchars;
+ int lmode;
+#endif
+};
+\f
+/* Define EMACS_GET_TTY and EMACS_SET_TTY,
+ the macros for reading and setting parts of `struct emacs_tty'. */
#ifdef HAVE_TCATTR
/* These definitions will really only work in sysdep.c, because of their
use of input_iosb. I don't know enough about VMS QIO to fix this. */
-#define EMACS_GET_TTY_1(fd, p) \
- SYS$QIOW (0, (fd), IO$_SENSEMODE, (p), 0, 0, \
- &(p)->main.class, 12, 0, 0, 0, 0);
-#define EMACS_SET_TTY_1(fd, p, waitp) \
- SYS$QIOW (0, (fd), IO$_SETMODE, &input_iosb, 0, 0, \
- &(p)->main.class, 12, 0, 0, 0, 0);
+#define EMACS_GET_TTY_1(fd, p) \
+ (1 & SYS$QIOW (0, (fd), IO$_SENSEMODE, (p), 0, 0, \
+ &(p)->main.class, 12, 0, 0, 0, 0))
+#define EMACS_SET_TTY_1(fd, p, waitp) \
+ (1 & SYS$QIOW (0, (fd), IO$_SETMODE, &input_iosb, 0, 0, \
+ &(p)->main.class, 12, 0, 0, 0, 0))
#else
#endif
#ifdef TIOCGLTC
- struct ltchars ltchars;
#define EMACS_GET_TTY_2(fd, p) \
(ioctl ((fd), TIOCGLTC, &(p)->ltchars) != -1)
#define EMACS_SET_TTY_2(fd, p, waitp) \
#endif /* TIOCGLTC */
#ifdef TIOCGETC
- struct tchars tchars;
- int lmode;
#define EMACS_GET_TTY_3(fd, p) \
(ioctl ((fd), TIOCGETC, &(p)->tchars) != -1 \
&& ioctl ((fd), TIOCLGET, &(p)->lmode) != -1)
#define EMACS_SET_TTY_3(fd, p, waitp) 1
#endif /* TIOCGLTC */
-};
-
-/* Define these to be a concatenation of all the EMACS_{GET,SET}_TTY
+/* Define these to be a concatenation of all the EMACS_{GET,SET}_TTY_n
macros. */
#define EMACS_GET_TTY(fd, tc) \
(EMACS_GET_TTY_1 (fd, tc) \
(EMACS_SET_TTY_1 (fd, tc, waitp) \
&& EMACS_SET_TTY_2 (fd, tc, waitp) \
&& EMACS_SET_TTY_3 (fd, tc, waitp))
-
+\f
+/* Define EMACS_TTY_TABS_OK. */
#ifdef HAVE_TERMIOS