This commit was manufactured by cvs2svn to create branch 'XEmacs-21_4'.
[chise/xemacs-chise.git.1] / src / emacs.c
index cb03ac4..b581b51 100644 (file)
@@ -171,7 +171,7 @@ int display_arg;
 /* Type of display specified.  We cannot use a Lisp symbol here because
    Lisp symbols may not initialized at the time that we set this
    variable. */
-CONST char *display_use;
+const char *display_use;
 
 /* If non-zero, then the early error handler will only print the error
    message and exit. */
@@ -256,7 +256,7 @@ fatal_error_signal (int sig)
 # if 0 /* This is evil, rarely useful, and causes grief in some cases. */
       /* Check for Sun-style stack printing via /proc */
       {
-        CONST char *pstack = "/usr/proc/bin/pstack";
+        const char *pstack = "/usr/proc/bin/pstack";
         if (access (pstack, X_OK) == 0)
           {
             char buf[100];
@@ -275,7 +275,7 @@ fatal_error_signal (int sig)
 \f
 
 DOESNT_RETURN
-fatal (CONST char *fmt, ...)
+fatal (const char *fmt, ...)
 {
   va_list args;
   va_start (args, fmt);
@@ -300,7 +300,7 @@ fatal (CONST char *fmt, ...)
    GETTEXT on the format string. */
 
 int
-stderr_out (CONST char *fmt, ...)
+stderr_out (const char *fmt, ...)
 {
   int retval;
   va_list args;
@@ -317,7 +317,7 @@ stderr_out (CONST char *fmt, ...)
    GETTEXT on the format string. */
 
 int
-stdout_out (CONST char *fmt, ...)
+stdout_out (const char *fmt, ...)
 {
   int retval;
   va_list args;
@@ -398,7 +398,7 @@ make_argc_argv (Lisp_Object argv_list, int *argc, char ***argv)
 
   for (i = 0, next = argv_list; i < n; i++, next = XCDR (next))
     {
-      CONST char *temp;
+      const char *temp;
       CHECK_STRING (XCAR (next));
 
       TO_EXTERNAL_FORMAT (LISP_STRING, XCAR (next),
@@ -587,22 +587,6 @@ main_1 (int argc, char **argv, char **envp, int restart)
 
   sort_args (argc, argv);
 
-  /* Map in shared memory, if we are using that.  */
-#ifdef HAVE_SHM
-  if (argmatch (argv, argc, "-nl", "--no-shared-memory", 6, NULL, &skip_args))
-    {
-      map_in_data (0);
-      /* The shared memory was just restored, which clobbered this.  */
-      skip_args = 1;
-    }
-  else
-    {
-      map_in_data (1);
-      /* The shared memory was just restored, which clobbered this.  */
-      skip_args = 0;
-    }
-#endif /* HAVE_SHM */
-
 #if (defined (MSDOS) && defined (EMX)) || defined (WIN32) || defined (_SCO_DS)
   environ = envp;
 #endif
@@ -873,7 +857,7 @@ main_1 (int argc, char **argv, char **envp, int restart)
 
       /* Initialize Qnil, Qt, Qunbound, and the
         obarray.  After this, symbols can be
-        interned.  This depends on init_alloc_once(). */
+        interned.  This depends on init_alloc_once_early(). */
       init_symbols_once_early ();
 
       /* Declare the basic symbols pertaining to errors,
@@ -888,6 +872,7 @@ main_1 (int argc, char **argv, char **envp, int restart)
         The *only* thing that the syms_of_*() functions are allowed to do
         is call one of the following three functions:
 
+        INIT_LRECORD_IMPLEMENTATION()
         defsymbol()
         defsubr() (i.e. DEFSUBR)
         deferror()
@@ -1903,13 +1888,13 @@ main_1 (int argc, char **argv, char **envp, int restart)
 
 struct standard_args
 {
-  CONST char * CONST name;
-  CONST char * CONST longname;
+  const char *name;
+  const char *longname;
   int priority;
   int nargs;
 };
 
-static struct standard_args standard_args[] =
+static const struct standard_args standard_args[] =
 {
   /* Handled by main_1 above: */
   { "-nl", "--no-shared-memory", 100, 0 },
@@ -2143,11 +2128,11 @@ Do not call this.  It will reinitialize your XEmacs.  You'll be sorry.
      (int nargs, Lisp_Object *args))
 {
   int ac;
-  CONST Extbyte *wampum;
+  const Extbyte *wampum;
   int namesize;
   int total_len;
   Lisp_Object orig_invoc_name = Fcar (Vcommand_line_args);
-  CONST Extbyte **wampum_all = alloca_array (CONST Extbyte *, nargs);
+  const Extbyte **wampum_all = alloca_array (const Extbyte *, nargs);
   int *wampum_all_len  = alloca_array (int, nargs);
 
   assert (!gc_in_progress);
@@ -2482,7 +2467,7 @@ shut_down_emacs (int sig, Lisp_Object stuff)
         "\n"
         "  gdb ");
       {
-       CONST char *name;
+       const char *name;
        char *dir = 0;
 
        /* Now try to determine the actual path to the executable,
@@ -2534,45 +2519,6 @@ shut_down_emacs (int sig, Lisp_Object stuff)
 extern char my_edata[];
 #endif
 
-#ifdef HAVE_SHM
-
-DEFUN ("dump-emacs-data", Fdump_emacs_data, 1, 1, 0, /*
-Dump current state of XEmacs into data file FILENAME.
-This function exists on systems that use HAVE_SHM.
-*/
-       (intoname))
-{
-  /* This function can GC */
-  int opurify;
-  struct gcpro gcpro1;
-  GCPRO1 (intoname);
-
-  CHECK_STRING (intoname);
-  intoname = Fexpand_file_name (intoname, Qnil);
-
-  opurify = purify_flag;
-  purify_flag = 0;
-
-  fflush (stderr);
-  fflush (stdout);
-
-  disksave_object_finalization ();
-  release_breathing_space ();
-
-  /* Tell malloc where start of impure now is */
-  /* Also arrange for warnings when nearly out of space.  */
-#ifndef SYSTEM_MALLOC
-  memory_warnings (my_edata, malloc_warning);
-#endif
-  UNGCPRO;
-  map_out_data (XSTRING_DATA (intoname));
-
-  purify_flag = opurify;
-
-  return Qnil;
-}
-
-#else /* not HAVE_SHM */
 extern void disable_free_hook (void);
 
 DEFUN ("dump-emacs", Fdump_emacs, 2, 2, 0, /*
@@ -2688,8 +2634,6 @@ and announce itself normally when it is run.
   return Qnil;
 }
 
-#endif /* not HAVE_SHM */
-
 #endif /* not CANNOT_DUMP */
 \f
 #ifndef SEPCHAR
@@ -2699,15 +2643,15 @@ and announce itself normally when it is run.
 /* Split STRING into a list of substrings.  The substrings are the
    parts of original STRING separated by SEPCHAR.  */
 static Lisp_Object
-split_string_by_emchar_1 (CONST Bufbyte *string, Bytecount size,
+split_string_by_emchar_1 (const Bufbyte *string, Bytecount size,
                          Emchar sepchar)
 {
   Lisp_Object result = Qnil;
-  CONST Bufbyte *end = string + size;
+  const Bufbyte *end = string + size;
 
   while (1)
     {
-      CONST Bufbyte *p = string;
+      const Bufbyte *p = string;
       while (p < end)
        {
          if (charptr_emchar (p) == sepchar)
@@ -2730,7 +2674,7 @@ split_string_by_emchar_1 (CONST Bufbyte *string, Bytecount size,
    converted using Qfile_name), and sepchar is hardcoded to SEPCHAR
    (':' or whatever).  */
 Lisp_Object
-decode_path (CONST char *path)
+decode_path (const char *path)
 {
   Bytecount newlen;
   Bufbyte *newpath;
@@ -2750,9 +2694,9 @@ decode_path (CONST char *path)
 }
 
 Lisp_Object
-decode_env_path (CONST char *evarname, CONST char *default_)
+decode_env_path (const char *evarname, const char *default_)
 {
-  CONST char *path = 0;
+  const char *path = 0;
   if (evarname)
     path = egetenv (evarname);
   if (!path)
@@ -2815,7 +2759,7 @@ Non-nil return value means XEmacs is running without interactive terminal.
 /* This highly dubious kludge ... shut up Jamie, I'm tired of your slagging. */
 
 DOESNT_RETURN
-assert_failed (CONST char *file, int line, CONST char *expr)
+assert_failed (const char *file, int line, const char *expr)
 {
   stderr_out ("Fatal error: assertion failed, file %s, line %d, %s\n",
              file, line, expr);
@@ -2863,11 +2807,7 @@ void
 syms_of_emacs (void)
 {
 #ifndef CANNOT_DUMP
-#ifdef HAVE_SHM
-  DEFSUBR (Fdump_emacs_data);
-#else
   DEFSUBR (Fdump_emacs);
-#endif
 #endif /* !CANNOT_DUMP */
 
   DEFSUBR (Frun_emacs_from_temacs);
@@ -3108,7 +3048,7 @@ following: dot, lockf, flock, locking, mmdf.
     Vmail_lock_methods = Fcons (intern ("locking"), Vmail_lock_methods);
 #endif
   }
-  
+
   DEFVAR_CONST_LISP ("configure-mail-lock-method", &Vconfigure_mail_lock_method /*
 Mail spool locking method suggested by configure.  This is one
 of the symbols in MAIL-LOCK-METHODS.