XEmacs 21.2.24 "Hecate".
[chise/xemacs-chise.git.1] / src / systty.h
index bceec58..a2c5b36 100644 (file)
@@ -53,6 +53,10 @@ Boston, MA 02111-1307, USA.  */
 \f
 /* Include the proper files.  */
 
+#ifdef HAVE_UNISTD_H
+#include <unistd.h>
+#endif
+
 /* XEmacs: TERMIOS is mo' better than TERMIO so we use it if it's
    there.  Since TERMIO is backward-compatibility stuff if both it
    and TERMIOS exist, it's more likely to be broken. */
@@ -193,10 +197,6 @@ Boston, MA 02111-1307, USA.  */
 #undef TIOCSWINSZ
 #endif
 
-#ifdef BROKEN_O_NONBLOCK /* XEmacs addition */
-# undef O_NONBLOCK
-#endif /* BROKEN_O_NONBLOCK */
-
 /* On TERMIOS systems, the tcmumbleattr calls take care of these
    parameters, and it's a bad idea to use them (on AIX, it makes the
    tty hang for a long time).  */
@@ -214,19 +214,16 @@ Boston, MA 02111-1307, USA.  */
 /* ----------------------------------------------------- */
 
 /* 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
-#undef CDISABLE
-#define CDISABLE CDEL
-#else /* not CDEL */
-#define CDISABLE 255
-#endif /* not CDEL */
-#endif /* not _POSIX_VDISABLE */
+   in a system-independent manner.
+   We use the POSIX standard way to do this, and emulate on other systems. */
+
+#ifndef _POSIX_VDISABLE
+# if defined CDEL
+#  define _POSIX_VDISABLE CDEL
+# else
+#  define _POSIX_VDISABLE 255
+# endif
+#endif /* ! _POSIX_VDISABLE */
 
 \f
 /* ----------------------------------------------------- */
@@ -340,6 +337,8 @@ Boston, MA 02111-1307, USA.  */
    No big loss -- it just means that ^Z won't work right
    if we're run from sh. */
 #  define EMACS_SET_PROCESS_GROUP(pg)
+#elif defined(__MINGW32__)
+#  define EMACS_SEPARATE_PROCESS_GROUP() 
 #else
 /* Under NeXTstep, a process group of 0 is not the same as specifying
    your own process ID, so we go ahead and specify it explicitly. */
@@ -359,11 +358,11 @@ Boston, MA 02111-1307, USA.  */
    emacs_tty should contain an element for each parameter struct
    that Emacs may change.
 
-   EMACS_GET_TTY (int FD, struct emacs_tty *P) stores the parameters
+   emacs_get_tty (int FD, struct emacs_tty *P) stores the parameters
    of the tty on FD in *P.  Return zero if all's well, or -1 if we ran
    into an error we couldn't deal with.
 
-   EMACS_SET_TTY (int FD, struct emacs_tty *P, int flushp)
+   emacs_set_tty (int FD, struct emacs_tty *P, int flushp)
    sets the parameters of the tty on FD according to the contents of
    *P.  If flushp is non-zero, we discard queued input to be
    written before making the change.
@@ -410,15 +409,9 @@ struct emacs_tty {
 #endif /* HAVE_TCHARS */
 #endif /* HAVE_TERMIOS */
 };
-\f
-/* Define EMACS_GET_TTY and EMACS_SET_TTY,
-   the macros for reading and setting parts of `struct emacs_tty'.
-
-   These got pretty unmanageable (huge macros are hard to debug), and
-   finally needed some code which couldn't be done as part of an
-   expression, so we moved them out to their own functions in sysdep.c.  */
-#define EMACS_GET_TTY(fd, p)        emacs_get_tty (fd, p)
-#define EMACS_SET_TTY(fd, p, waitp) emacs_set_tty (fd, p, waitp)
+
+int emacs_get_tty (int fd, struct emacs_tty *settings);
+int emacs_set_tty (int fd, struct emacs_tty *settings, int flushp);
 
 \f
 /* --------------------------------------------------------- */