/* Interfaces to system-dependent kernel and library entries.
- Copyright (C) 1985, 1986, 1987, 1988, 1993, 1994, 1995, 1999, 2000, 2001,
- 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010
+ Copyright (C) 1985-1988, 1993-1995, 1999-2011
Free Software Foundation, Inc.
This file is part of GNU Emacs.
#ifdef HAVE_LIMITS_H
#include <limits.h>
#endif /* HAVE_LIMITS_H */
-#ifdef HAVE_UNISTD_H
#include <unistd.h>
-#endif
+
+#include <ignore-value.h>
#include "lisp.h"
#include "sysselect.h"
#endif
#include <sys/file.h>
-
-#ifdef HAVE_FCNTL_H
#include <fcntl.h>
-#endif
#include "systty.h"
#include "syswait.h"
#include "dispextern.h"
#include "process.h"
#include "cm.h" /* for reset_sys_modes */
-#ifdef HAVE_TERM_H
-/* Include this last. If it is ncurses header file, it adds a lot of
- defines that interfere with stuff in other headers. Someone responsible
- for ncurses messed up bigtime. See bug#6812. */
-#include <term.h>
-#endif
#ifdef WINDOWSNT
#include <direct.h>
#endif
#endif
-/* LPASS8 is new in 4.3, and makes cbreak mode provide all 8 bits. */
-#ifndef LPASS8
-#define LPASS8 0
-#endif
+/* Declare here, including term.h is problematic on some systems. */
+extern void tputs (const char *, int, int (*)(int));
static const int baud_convert[] =
{
1800, 2400, 4800, 9600, 19200, 38400
};
-int emacs_ospeed;
-
void croak (char *) NO_RETURN;
/* Temporary used by `sigblock' when defined in terms of signprocmask. */
{
if (tty->input) /* Is the device suspended? */
{
- EMACS_GET_TTY (fileno (tty->input), &buf);
- EMACS_SET_TTY (fileno (tty->input), &buf, 0);
+ emacs_get_tty (fileno (tty->input), &buf);
+ emacs_set_tty (fileno (tty->input), &buf, 0);
}
}
}
void
init_baud_rate (int fd)
{
+ int emacs_ospeed;
+
if (noninteractive)
emacs_ospeed = 0;
else
void
flush_pending_output (int channel)
{
-#ifndef DOS_NT
- /* If we try this, we get hit with SIGTTIN, because
- the child's tty belongs to the child's pgrp. */
-#else
-#ifdef TCFLSH
- ioctl (channel, TCFLSH, 1);
-#else
-#ifdef TIOCFLUSH
- int zero = 0;
- /* 3rd arg should be ignored
- but some 4.2 kernels actually want the address of an int
- and nonzero means something different. */
- ioctl (channel, TIOCFLUSH, &zero);
-#endif
-#endif
-#endif
+ /* FIXME: maybe this function should be removed */
}
\f
/* Set up the terminal at the other end of a pseudo-terminal that
#ifndef WINDOWSNT
struct emacs_tty s;
- EMACS_GET_TTY (out, &s);
+ emacs_get_tty (out, &s);
s.main.c_oflag |= OPOST; /* Enable output postprocessing */
s.main.c_oflag &= ~ONLCR; /* Disable map of NL to CR-NL on output */
#ifdef NLDLY
s.main.c_cc[VTIME] = 0;
#endif
- EMACS_SET_TTY (out, &s, 0);
+ emacs_set_tty (out, &s, 0);
#endif /* not WINDOWSNT */
}
#endif /* not MSDOS */
close_process_descs (); /* Close Emacs's pipes/ptys */
-#ifdef SET_EMACS_PRIORITY
- {
- extern EMACS_INT emacs_priority;
-
- if (emacs_priority < 0)
- nice (-emacs_priority);
- }
-#endif
-
#ifdef MSDOS /* Demacs 1.1.2 91/10/20 Manabu Higashida */
{
char *epwd = getenv ("PWD");
write (1, "Can't execute subshell", 22);
#else /* not WINDOWSNT */
execlp (sh, sh, (char *) 0);
- write (1, "Can't execute subshell", 22);
+ ignore_value (write (1, "Can't execute subshell", 22));
_exit (1);
#endif /* not WINDOWSNT */
#endif /* not MSDOS */
if (! tty_out->old_tty)
tty_out->old_tty = (struct emacs_tty *) xmalloc (sizeof (struct emacs_tty));
- EMACS_GET_TTY (fileno (tty_out->input), tty_out->old_tty);
+ emacs_get_tty (fileno (tty_out->input), tty_out->old_tty);
tty = *tty_out->old_tty;
dos_ttraw (tty_out);
#endif
- EMACS_SET_TTY (fileno (tty_out->input), &tty, 0);
+ emacs_set_tty (fileno (tty_out->input), &tty, 0);
/* This code added to insure that, if flow-control is not to be used,
we have an unlocked terminal at the start. */
{
struct emacs_tty etty;
- EMACS_GET_TTY (fd, &etty);
- return EMACS_TTY_TABS_OK (&etty);
+ emacs_get_tty (fd, &etty);
+#ifndef DOS_NT
+#ifdef TABDLY
+ return ((etty.main.c_oflag & TABDLY) != TAB3);
+#else /* not TABDLY */
+ return 1;
+#endif /* not TABDLY */
+#else /* DOS_NT */
+ return 0;
+#endif /* DOS_NT */
}
\f
/* Get terminal size from system.
#endif /* F_SETFL */
if (tty_out->old_tty)
- while (EMACS_SET_TTY (fileno (tty_out->input),
+ while (emacs_set_tty (fileno (tty_out->input),
tty_out->old_tty, 0) < 0 && errno == EINTR)
;
}
#endif /* HAVE_PTYS */
\f
-/* init_system_name sets up the string for the Lisp function
- system-name to return. */
-
-extern Lisp_Object Vsystem_name;
-
#ifdef HAVE_SOCKETS
#include <sys/socket.h>
#include <netdb.h>
}
#endif /* !defined (WINDOWSNT) */
-
-
-/* arch-tag: edb43589-4e09-4544-b325-978b5b121dcf
- (do not change this comment) */