(HAVE_TERMIO, SIGNALS_VIA_CHARACTERS): Defined.
[bpt/emacs.git] / src / systty.h
index 910810d..7e5efa0 100644 (file)
@@ -1,4 +1,4 @@
-/* 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.
@@ -17,6 +17,9 @@ You should have received a copy of the GNU General Public License
 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
@@ -26,10 +29,52 @@ the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA.  */
 #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 */
 
@@ -107,6 +152,20 @@ the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA.  */
 #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
@@ -169,6 +228,7 @@ the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA.  */
 
 /* 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
 
@@ -196,7 +256,6 @@ the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA.  */
    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 
@@ -210,7 +269,7 @@ struct emacs_tty {
 
 /* 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
@@ -223,10 +282,17 @@ struct emacs_tty {
 #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
 
@@ -246,12 +312,12 @@ struct emacs_tty {
 
 /* 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
 
@@ -264,7 +330,6 @@ struct emacs_tty {
 #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)                  \
@@ -275,8 +340,6 @@ struct emacs_tty {
 #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)
@@ -288,9 +351,7 @@ struct emacs_tty {
 #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)    \
@@ -301,7 +362,8 @@ struct emacs_tty {
   (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