- /* Write dictionary. */
- if (!pfm_write_dictionary (handle, dict))
+ Does not retain any reference to D, and clears the aux members
+ set up by start_case_map().
+
+ Returns the new case map, or a null pointer if no mapping is
+ required (that is, no data has changed position). */
+static struct case_map *
+finish_case_map (struct dictionary *d)
+{
+ struct case_map *map;
+ size_t var_cnt = dict_get_var_cnt (d);
+ size_t i;
+ int identity_map;
+
+ map = xmalloc (sizeof *map);
+ map->value_cnt = dict_get_next_value_idx (d);
+ map->map = xmalloc (sizeof *map->map * map->value_cnt);
+ for (i = 0; i < map->value_cnt; i++)
+ map->map[i] = -1;
+
+ identity_map = 1;
+ for (i = 0; i < var_cnt; i++)