(insert-char-attributes): Support `ideographic-variants' property.
[chise/xemacs-chise.git] / src / dumper.c
index c9a74a8..93083da 100644 (file)
@@ -168,7 +168,6 @@ typedef struct
 static pdump_entry_list pdump_object_table[256];
 static pdump_entry_list pdump_opaque_data_list;
 static pdump_struct_list pdump_struct_table;
-static pdump_entry_list_elmt *pdump_qnil;
 
 static int pdump_alert_undump_object[256];
 
@@ -357,7 +356,6 @@ pdump_register_sub (const void *data, const struct lrecord_description *desc, in
        case XD_INT:
        case XD_LONG:
        case XD_BYTECOUNT:
-       case XD_LO_RESET_NIL:
        case XD_INT_RESET:
        case XD_LO_LINK:
          break;
@@ -542,16 +540,6 @@ pdump_dump_data (pdump_entry_list_elmt *elmt, const struct lrecord_description *
                case XD_LONG:
                case XD_BYTECOUNT:
                  break;
-               case XD_LO_RESET_NIL:
-                 {
-                   EMACS_INT num = desc[pos].data1;
-                   int j;
-                   if (XD_IS_INDIRECT (num))
-                     num = pdump_get_indirect_count (num, desc, elmt->obj);
-                   for (j=0; j<num; j++)
-                     ((EMACS_INT *)rdata)[j] = pdump_qnil->save_offset;
-                   break;
-                 }
                case XD_INT_RESET:
                  {
                    EMACS_INT val = desc[pos].data1;
@@ -668,12 +656,11 @@ pdump_reloc_one (void *data, EMACS_INT delta, const struct lrecord_description *
 
            if (POINTER_TYPE_P (XTYPE (*pobj))
                && ! EQ (*pobj, Qnull_pointer))
-             XSETOBJ (*pobj, XTYPE (*pobj), (char *) XPNTR (*pobj) + delta);
+             XSETOBJ (*pobj, (char *) XPNTR (*pobj) + delta);
 
            break;
          }
        case XD_LISP_OBJECT_ARRAY:
-       case XD_LO_RESET_NIL:
          {
            EMACS_INT num = desc[pos].data1;
            int j;
@@ -686,7 +673,7 @@ pdump_reloc_one (void *data, EMACS_INT delta, const struct lrecord_description *
 
                if (POINTER_TYPE_P (XTYPE (*pobj))
                    && ! EQ (*pobj, Qnull_pointer))
-                 XSETOBJ (*pobj, XTYPE (*pobj), (char *) XPNTR (*pobj) + delta);
+                 XSETOBJ (*pobj, (char *) XPNTR (*pobj) + delta);
              }
            break;
          }
@@ -905,6 +892,8 @@ pdump (void)
   int none;
   dump_header hd;
 
+  flush_all_buffer_local_cache ();
+
   /* These appear in a DEFVAR_LISP, which does a staticpro() */
   t_console = Vterminal_console;
   t_frame   = Vterminal_frame;
@@ -962,7 +951,6 @@ pdump (void)
   max_size = 0;
 
   pdump_scan_by_alignment (pdump_allocate_offset);
-  pdump_qnil = pdump_get_entry (XRECORD_LHEADER (Qnil));
 
   pdump_buf = xmalloc (max_size);
   /* Avoid use of the `open' macro.  We want the real function. */
@@ -1023,7 +1011,7 @@ static int pdump_load_finish (void)
     {
       Lisp_Object obj = PDUMP_READ (p, Lisp_Object);
       if (POINTER_TYPE_P (XTYPE (obj)))
-       XSETOBJ (obj, XTYPE (obj), (char *) XPNTR (obj) + delta);
+       XSETOBJ (obj, (char *) XPNTR (obj) + delta);
       *staticvec[i] = obj;
     }
 
@@ -1081,7 +1069,7 @@ static int pdump_load_finish (void)
       Lisp_Object  obj = PDUMP_READ (p, Lisp_Object);
 
       if (POINTER_TYPE_P (XTYPE (obj)))
-       XSETOBJ (obj, XTYPE (obj), (char *) XPNTR (obj) + delta);
+       XSETOBJ (obj, (char *) XPNTR (obj) + delta);
 
       *var = obj;
     }
@@ -1103,9 +1091,6 @@ static int pdump_load_finish (void)
          p += sizeof (Lisp_Object) * rt.count;
     }
 
-  /* Put back noninteractive1 to its real value */
-  noninteractive1 = noninteractive;
-
   return 1;
 }
 
@@ -1121,11 +1106,11 @@ static void pdump_file_unmap(void)
 static int pdump_file_get(const char *path)
 {
 
-  pdump_hFile = CreateFile (path, 
+  pdump_hFile = CreateFile (path,
                            GENERIC_READ + GENERIC_WRITE,  /* Required for copy on write */
                            0,                      /* Not shared */
                            NULL,                   /* Not inheritable */
-                           OPEN_EXISTING, 
+                           OPEN_EXISTING,
                            FILE_ATTRIBUTE_NORMAL,
                            NULL);                  /* No template file */
   if (pdump_hFile == INVALID_HANDLE_VALUE)
@@ -1241,9 +1226,9 @@ static int pdump_file_get(const char *path)
   pdump_mallocadr = xmalloc(pdump_length+255);
   pdump_free = pdump_file_free;
   pdump_start = (char *)((255 + (unsigned long)pdump_mallocadr) & ~255);
-  read (pdump_fd, pdump_start, pdump_length);
+  read (fd, pdump_start, pdump_length);
 
-  close (pdump_fd);
+  close (fd);
   return 1;
 }
 #endif /* !WIN32_NATIVE */
@@ -1263,7 +1248,7 @@ static int pdump_file_try(char *exe_path)
            return 1;
          pdump_free();
        }
-      
+
       sprintf (w, "-%08x.dmp", dump_id);
       if (pdump_file_get (exe_path))
        {
@@ -1271,7 +1256,7 @@ static int pdump_file_try(char *exe_path)
            return 1;
          pdump_free();
        }
-      
+
       sprintf (w, ".dmp");
       if (pdump_file_get (exe_path))
        {
@@ -1279,10 +1264,10 @@ static int pdump_file_try(char *exe_path)
            return 1;
          pdump_free();
        }
-      
+
       do
        w--;
-      while (w>exe_path && !IS_DIRECTORY_SEP (*w) && (*w != '-') && (*w != '.'));      
+      while (w>exe_path && !IS_DIRECTORY_SEP (*w) && (*w != '-') && (*w != '.'));
     }
   while (w>exe_path && !IS_DIRECTORY_SEP (*w));
   return 0;
@@ -1292,7 +1277,7 @@ int pdump_load(const char *argv0)
 {
   char exe_path[PATH_MAX];
 #ifdef WIN32_NATIVE
-  GetModuleFileName (NULL, exe_path, PATH_MAX);  
+  GetModuleFileName (NULL, exe_path, PATH_MAX);
 #else /* !WIN32_NATIVE */
   char *w;
   const char *dir, *p;
@@ -1306,7 +1291,7 @@ int pdump_load(const char *argv0)
 
   p = dir + strlen(dir);
   while (p != dir && !IS_ANY_SEP (p[-1])) p--;
-  
+
   if (p != dir)
     {
       /* invocation-name includes a directory component -- presumably it
@@ -1337,12 +1322,12 @@ int pdump_load(const char *argv0)
              *w++ = '/';
            }
          strcpy(w, name);
-         
+
          /* ### #$%$#^$^@%$^#%@$ ! */
 #ifdef access
 #undef access
 #endif
-         
+
          if (!access (exe_path, X_OK))
            break;
          if (!*p)
@@ -1351,7 +1336,7 @@ int pdump_load(const char *argv0)
              sprintf (exe_path, "./%s", name);
              break;
            }
-         path = p+1;       
+         path = p+1;
        }
     }
 #endif /* WIN32_NATIVE */