*** empty log message ***
[bpt/emacs.git] / src / sysdep.c
index 1483898..7283f7d 100644 (file)
@@ -110,19 +110,6 @@ extern char *sys_errlist[];
 #endif /* not 4.1 */
 #endif /* BSD */
 
-#ifdef AIX
-/* Get files for keyboard remapping */
-#define HFNKEYS 2
-#include <sys/hft.h>
-#include <sys/devinfo.h>
-#endif
-
-/* Get rid of LLITOUT in 4.1, since it is said to stimulate kernel bugs.  */
-#ifdef BSD4_1
-#undef LLITOUT
-#define LLITOUT 0
-#endif /* 4.1 */
-
 #ifdef BROKEN_TIOCGWINSZ
 #undef TIOCGWINSZ
 #endif
@@ -144,34 +131,9 @@ extern char *sys_errlist[];
 #endif /* TIOCGWINSZ */
 #endif /* USG */
 
-#ifdef NEED_BSDTTY
-#include <sys/bsdtty.h>
-#endif 
-
-#if defined (HPUX) && defined (HAVE_PTYS)
-#include <sys/ptyio.h>
-#endif
-  
-#ifdef AIX
-#include <sys/pty.h>
-#include <unistd.h>
-#endif /* AIX */
-
-#ifdef SYSV_PTYS
-#include <sys/tty.h>
-#include <sys/pty.h>
-#endif
-
-/* saka@pfu.fujitsu.co.JP writes:
-   FASYNC defined in this file. But, FASYNC don't working.
-   so no problem, because unrequest_sigio only need. */
-#if defined (pfa)
-#include <sys/file.h>
-#endif
-
 extern int quit_char;
 
-#include "screen.h"
+#include "frame.h"
 #include "window.h"
 #include "termhooks.h"
 #include "termchar.h"
@@ -517,7 +479,7 @@ child_setup_tty (out)
 setpgrp_of_tty (pid)
      int pid;
 {
-  EMACS_SET_TTY_PGRP (input_fd, pid);
+  EMACS_SET_TTY_PGRP (input_fd, &pid);
 }
 
 /* Record a signal code and the handler for it.  */
@@ -639,7 +601,8 @@ save_signal_handlers (saved_handlers)
 {
   while (saved_handlers->code)
     {
-      saved_handlers->handler = signal (saved_handlers->code, SIG_IGN);
+      saved_handlers->handler
+       = (SIGTYPE (*) ()) signal (saved_handlers->code, SIG_IGN);
       saved_handlers++;
     }
 }
@@ -934,7 +897,7 @@ init_sys_modes ()
       EMACS_SET_TTY (input_fd, &tty, 0);
 
       /* This code added to insure that, if flow-control is not to be used,
-        we have an unlocked screen at the start. */
+        we have an unlocked terminal at the start. */
 
 #ifdef TCXONC
       if (!flow_control) ioctl (0, TCXONC, 1);
@@ -1003,10 +966,10 @@ init_sys_modes ()
     }
   else
     {
-      screen_garbaged = 1;
-#ifdef MULTI_SCREEN
-      if (SCREENP (Vterminal_screen))
-       SCREEN_GARBAGED_P (XSCREEN (Vterminal_screen)) = 1;
+      frame_garbaged = 1;
+#ifdef MULTI_FRAME
+      if (FRAMEP (Vterminal_frame))
+       FRAME_GARBAGED_P (XFRAME (Vterminal_frame)) = 1;
 #endif
     }
 
@@ -1028,7 +991,7 @@ tabs_safe_p ()
    Store number of lines into *heightp and width into *widthp.
    If zero or a negative number is stored, the value is not valid.  */
 
-get_screen_size (widthp, heightp)
+get_frame_size (widthp, heightp)
      int *widthp, *heightp;
 {
 
@@ -1081,7 +1044,7 @@ get_screen_size (widthp, heightp)
 
 \f
 /* Prepare the terminal for exiting Emacs; move the cursor to the
-   bottom of the screen, turn off interrupt-driven I/O, etc.  */
+   bottom of the frame, turn off interrupt-driven I/O, etc.  */
 reset_sys_modes ()
 {
   if (noninteractive)
@@ -1093,10 +1056,10 @@ reset_sys_modes ()
     return;
   if (read_socket_hook || !EQ (Vwindow_system, Qnil))
     return;
-  cursor_to (SCREEN_HEIGHT (selected_screen) - 1, 0);
-  clear_end_of_line (SCREEN_WIDTH (selected_screen));
+  cursor_to (FRAME_HEIGHT (selected_frame) - 1, 0);
+  clear_end_of_line (FRAME_WIDTH (selected_frame));
   /* clear_end_of_line may move the cursor */
-  cursor_to (SCREEN_HEIGHT (selected_screen) - 1, 0);
+  cursor_to (FRAME_HEIGHT (selected_frame) - 1, 0);
 #ifdef IBMR2AIX
   {
     /* HFT devices normally use ^J as a LF/CR.  We forced it to 
@@ -1237,7 +1200,7 @@ kbd_input_ast ()
 {
   register int c = -1;
   int old_errno = errno;
-  extern int *input_available_clear_word;
+  extern EMACS_TIME *input_available_clear_time;
 
   if (waiting_for_ast)
     SYS$SETEF (input_ef);
@@ -1270,12 +1233,12 @@ kbd_input_ast ()
       struct input_event e;
       e.kind = ascii_keystroke;
       XSET (buf[i].code, Lisp_Int, cbuf[i]);
-      e.screen = selected_screen;
+      e.frame = selected_frame;
       kbd_buffer_store_event (&e);
     }
 
-  if (input_available_clear_word)
-    *input_available_clear_word = 0;
+  if (input_available_clear_time)
+    EMACS_SET_SECS_USECS (*input_available_clear_time, 0, 0);
   errno = old_errno;
 }
 
@@ -1766,7 +1729,7 @@ read_input_waiting ()
 
   /* Scan the chars for C-g and store them in kbd_buffer.  */
   e.kind = ascii_keystroke;
-  e.screen = selected_screen;
+  e.frame = selected_frame;
   for (i = 0; i < nread; i++)
     {
       XSET (e.code, Lisp_Int, buf[i]);
@@ -1907,11 +1870,24 @@ sys_signal (int signal_number, signal_handler_t action)
   sigemptyset (&new_action.sa_mask);
   new_action.sa_handler = action;
   new_action.sa_flags = NULL;
-  new_action (signal_number, &new_action, &old_action);
+  sigaction (signal_number, &new_action, &old_action);
   return (old_action.sa_handler);
 #endif /* DGUX */
 }
 
+#ifndef __GNUC__
+/* If we're compiling with GCC, we don't need this function, since it
+   can be written as a macro.  */
+sigset_t
+sys_sigmask (int sig)
+{
+  sigset_t mask;
+  sigemptyset (&mask);
+  sigaddset (&mask, sig);
+  return mask;
+}
+#endif
+
 int
 sys_sigpause (sigset_t new_mask)
 {
@@ -2348,6 +2324,8 @@ getwd (pathname)
  *     that files be of same type (regular->regular, dir->dir, etc).
  */
 
+#ifndef HAVE_RENAME
+
 rename (from, to)
      char *from;
      char *to;
@@ -2362,9 +2340,11 @@ rename (from, to)
   return (-1);
 }
 
+#endif
+
 /* Set priority value to PRIO.  */
 
-void
+int
 setpriority (which, who, prio)
      int which, who, prio;
 {
@@ -3901,7 +3881,7 @@ rename_sans_version (from,to)
   stat = sys$dassgn (chan);
   if (!stat)
     lib$signal (stat);
-  strcpy (vms_file_written, to_esn); /* We will write this to the screen*/
+  strcpy (vms_file_written, to_esn); /* We will write this to the terminal*/
   return 0;
 }