+static void dict_copy_page(Dict dict, char *to_p, char *from_p, int *map)
+{
+ int i, slen, no = 0;
+ short *from_indxp, *to_indxp;
+ char *from_info, *to_info;
+
+ from_indxp = (short*) ((char*) from_p+DICT_bsize(from_p));
+ to_indxp = (short*) ((char*) to_p+DICT_bsize(to_p));
+ to_info = (char*) to_p + DICT_infoffset;
+ for (i = DICT_nodir (from_p); --i >= 0; )
+ {
+ if (*--from_indxp > 0) /* tail string here! */
+ {
+ /* string (Dict_char *) DICT_EOS terminated */
+ /* unsigned char length of information */
+ /* char * information */
+
+ from_info = (char*) from_p + *from_indxp;
+ *--to_indxp = to_info - to_p;
+ slen = (dict_strlen((Dict_char*) from_info)+1)*sizeof(Dict_char);
+ memcpy (to_info, from_info, slen);
+ from_info += slen;
+ to_info += slen;
+ }
+ else
+ {
+ Dict_ptr subptr;
+ Dict_char subchar;
+ /* Dict_ptr subptr */
+ /* Dict_char sub char */
+ /* unsigned char length of information */
+ /* char * information */
+
+ *--to_indxp = -(to_info - to_p);
+ from_info = (char*) from_p - *from_indxp;
+
+ memcpy (&subptr, from_info, sizeof(subptr));
+ subptr = map[subptr];
+ from_info += sizeof(Dict_ptr);
+ memcpy (&subchar, from_info, sizeof(subchar));
+ from_info += sizeof(Dict_char);
+
+ memcpy (to_info, &subptr, sizeof(Dict_ptr));
+ to_info += sizeof(Dict_ptr);
+ memcpy (to_info, &subchar, sizeof(Dict_char));
+ to_info += sizeof(Dict_char);
+ }
+ assert (to_info < (char*) to_indxp);
+ slen = *from_info+1;
+ memcpy (to_info, from_info, slen);
+ to_info += slen;
+ ++no;
+ }
+ DICT_size(to_p) = to_info - to_p;
+ DICT_type(to_p) = 0;
+ DICT_nodir(to_p) = no;
+}
+
+int dict_copy_compact (BFiles bfs, const char *from_name, const char *to_name)