dynwind fixes
[bpt/emacs.git] / src / dosfns.c
index 11d2258..c517a0e 100644 (file)
@@ -1,6 +1,7 @@
 /* MS-DOS specific Lisp utilities.  Coded by Manabu Higashida, 1991.
    Major changes May-July 1993 Morten Welinder (only 10% original code left)
-   Copyright (C) 1991, 1993, 1996-1998, 2001-2012 Free Software Foundation, Inc.
+   Copyright (C) 1991, 1993, 1996-1998, 2001-2014 Free Software
+   Foundation, Inc.
 
 This file is part of GNU Emacs.
 
@@ -23,8 +24,14 @@ along with GNU Emacs.  If not, see <http://www.gnu.org/licenses/>.  */
 /* The entire file is within this conditional */
 
 #include <stdio.h>
+/* gettime and settime in dos.h clash with their namesakes from
+   gnulib, so we move out of our way the prototypes in dos.h.  */
+#define gettime dos_h_gettime_
+#define settime dos_h_settime_
 #include <dos.h>
-#include <setjmp.h>
+#undef gettime
+#undef settime
+
 #include "lisp.h"
 #include "character.h"
 #include "buffer.h"
@@ -395,7 +402,7 @@ msdos_stdcolor_idx (const char *name)
 {
   int i;
 
-  for (i = 0; i < sizeof (vga_colors) / sizeof (vga_colors[0]); i++)
+  for (i = 0; i < ARRAYELTS (vga_colors); i++)
     if (xstrcasecmp (name, vga_colors[i]) == 0)
       return i;
 
@@ -415,7 +422,7 @@ msdos_stdcolor_name (int idx)
     return build_string (unspecified_fg);
   else if (idx == FACE_TTY_DEFAULT_BG_COLOR)
     return build_string (unspecified_bg);
-  else if (idx >= 0 && idx < sizeof (vga_colors) / sizeof (vga_colors[0]))
+  else if (idx >= 0 && idx < ARRAYELTS (vga_colors))
     return build_string (vga_colors[idx]);
   else
     return Qunspecified;       /* meaning the default */
@@ -465,18 +472,18 @@ x_set_title (struct frame *f, Lisp_Object name)
   if (EQ (name, f->title))
     return;
 
-  update_mode_lines = 1;
+  update_mode_lines = 13;
 
-  f->title = name;
+  fset_title (f, name);
 
   if (NILP (name))
     name = f->name;
 
   if (FRAME_MSDOS_P (f))
     {
-      BLOCK_INPUT;
+      block_input ();
       w95_set_virtual_machine_title (SDATA (name));
-      UNBLOCK_INPUT;
+      unblock_input ();
     }
 }
 #endif /* !HAVE_X_WINDOWS */
@@ -540,7 +547,6 @@ system_process_attributes (Lisp_Object pid)
       int i;
       Lisp_Object cmd_str, decoded_cmd, tem;
       double pmem;
-      EXFUN (Fget_internal_run_time, 0);
 #ifndef SYSTEM_MALLOC
       extern unsigned long ret_lim_data ();
 #endif
@@ -557,7 +563,7 @@ system_process_attributes (Lisp_Object pid)
        attrs = Fcons (Fcons (Qgroup, build_string (gr->gr_name)), attrs);
       strcpy (cmd, basename (__crt0_argv[0]));
       /* Command name is encoded in locale-coding-system; decode it.  */
-      cmd_str = make_unibyte_string (cmd, strlen (cmd));
+      cmd_str = build_unibyte_string (cmd);
       decoded_cmd = code_convert_string_norecord (cmd_str,
                                                  Vlocale_coding_system, 0);
       attrs = Fcons (Fcons (Qcomm, decoded_cmd), attrs);
@@ -625,7 +631,7 @@ system_process_attributes (Lisp_Object pid)
        q[-1] = '\0';
 
       /* Command line is encoded in locale-coding-system; decode it.  */
-      cmd_str = make_unibyte_string (cmdline, strlen (cmdline));
+      cmd_str = build_unibyte_string (cmdline);
       decoded_cmd = code_convert_string_norecord (cmd_str,
                                                  Vlocale_coding_system, 0);
       xfree (cmdline);
@@ -668,18 +674,7 @@ dos_cleanup (void)
 void
 syms_of_dosfns (void)
 {
-  defsubr (&Sint86);
-  defsubr (&Sdos_memget);
-  defsubr (&Sdos_memput);
-  defsubr (&Smsdos_mouse_init);
-  defsubr (&Smsdos_mouse_enable);
-  defsubr (&Smsdos_set_keyboard);
-  defsubr (&Sinsert_startup_screen);
-  defsubr (&Smsdos_mouse_disable);
-  defsubr (&Sfile_system_info);
-#ifndef HAVE_X_WINDOWS
-  defsubr (&Smsdos_mouse_p);
-#endif
+#include "dosfns.x"
 
   DEFVAR_INT ("dos-country-code", dos_country_code,
              doc: /* The country code returned by Dos when Emacs was started.
@@ -764,4 +759,3 @@ If zero, the decimal point key returns the country code specific value.  */);
   dos_decimal_point = 0;
 }
 #endif /* MSDOS */
-