Fix problems with uniqueness of short names in system files with very
[pspp-builds.git] / src / data / ChangeLog
index 9225fa002c83cf72ab3a8ae92cbd27442611fbf9..516447dbc81306282e0fdd72da9c6fc963000635 100644 (file)
@@ -1,3 +1,46 @@
+2007-07-22  Ben Pfaff  <blp@gnu.org>
+
+       Fix problems with uniqueness of short names in system files with
+       very long string variables.  Now a variable may have multiple
+       short names.
+       
+       * automake.mk (src_data_libdata_a_SOURCES): Add new files
+       short-names.c, short-names.h.
+
+       * dictionary.c (dict_clone): Clone all the short names.
+       (compare_strings): Move into short-names.c.
+       (hash_strings): Ditto.
+       (set_var_short_name_suffix): Ditto.
+       (dict_assign_short_names): Ditto, rename short_names_assign,
+       change to assign all short names.
+       
+       * por-file-writer.c (write_variables): Use short_names_assign
+       instead of dict_assign_short_names.
+
+       * short-names.c: New file.
+
+       * short-names.h: New file.
+
+       * sys-file-private.c (sfm_width_to_segments): New function.
+
+       * sys-file-reader.c (read_long_var_name_map): Save and restore all
+       the short names, not just the first one.
+       
+       * sys-file-writer.c (cont_var_name): Removed.
+       (sfm_open_writer): Use short_names_assign instead of
+       dict_assign_short_names.  Use unique short names assigned by
+       short_names_assign instead of those generated by cont_var_name.
+
+       * variable.c (struct variable): Remove `short_name' member,
+       replace by `short_names' and `short_name_cnt'.
+       (var_create) Initialize new members.
+       (var_get_short_name_cnt): New function.
+       (var_get_short_name): Now takes an index argument.  Changed most
+       callers to pass 0.
+       (var_set_short_name): Ditto.
+       (var_clear_short_name): Renamed var_clear_short_names, changed to
+       clear all short names.
+       
 2007-07-22  Ben Pfaff  <blp@gnu.org>
 
        * variable.c (var_set_width): Use new var_set_width function.