Added abstract factory to create casefiles. Updated procedures to use
[pspp-builds.git] / src / data / ChangeLog
1 Fri Dec 22 20:08:38 WST 2006 John Darrington <john@darrington.wattle.id.au>
2
3         * casefile-factory.h fastfile-factory.c fastfile-factory.h: New files.
4
5         * case-sink.c case-sink.h procedure.c procedure.h 
6           storage-stream.c: Now uses the factory.
7         
8 Sat Dec 16 22:05:18 2006  Ben Pfaff  <blp@gnu.org>
9
10         Make it possible to pull cases from the active file with a
11         function call, instead of requiring indirection through a callback
12         function.
13
14         * case-source.h (struct case_source_class): Change ->read function
15         to return a single case, instead of calling a callback function
16         for each case.  Change ->destroy function to return an error
17         status.
18
19         * case-source.c (free_case_source): Pass along the value returned
20         by the case_source ->destroy function.
21
22         * procedure.c (struct write_case_data): Removed.
23         (struct dataset): Added some members to track procedure state.
24         (procedure): Optimize the trivial case at this level.
25         (internal_procedure): Re-implement in terms of proc_open,
26         proc_read, proc_close.
27         (proc_open) New function.
28         (proc_read) New function.
29         (proc_close) New function.
30         (write_case) Moved into proc_read.
31         (close_active_file) Moved closing of data source into proc_close.
32
33         * storage-source.c: Rewrote to conform with modified
34         case_source_class interface.
35
36         * transformations.c (trns_chain_execute): Added argument to allow
37         starting execution from an arbitrary transformation.  Updated
38         callers.
39
40         * transformations.h (enum TRNS_NEXT_CASE) Renamed TRNS_END_CASE.
41
42 Sat Dec 16 14:09:25 2006  Ben Pfaff  <blp@gnu.org>
43
44         * sys-file-reader.c (read_display_parameters): Don't assume that
45         MEASURE_* and ALIGN_* have the same values found in system files.
46
47         * sys-file-writer.c (write_variable_display_parameters): Ditto.
48
49         * variable.h: Change MEASURE_NOMINAL, MEASURE_ORDINAL,
50         MEASURE_SCALE to be 0-based instead of 1-based.  This also fixes
51         the value of n_MEASURES, which was off by 1 (at least from my
52         point of view).
53
54 Sat Dec 16 12:17:34 WST 2006 John Darrington <john@darrington.wattle.id.au>
55
56         * dictionary.c dictionary.h vardict.h variable.c: Added optional
57                 callbacks which are invoked when the dictionary or its 
58                 variables are changed.  
59         
60         * missing-values.c missing-values.h value-labels.c: Tidied up
61                 consistency checks, and made some of them return false 
62                 instead of assert-failing. 
63
64 Wed Dec 13 19:30:11 2006  Ben Pfaff  <blp@gnu.org>
65
66         * calendar.c (calendar_days_in_month): New function.
67
68 Mon Dec 11 07:53:39 2006  Ben Pfaff  <blp@gnu.org>
69
70         * value-labels.c (hash_int_val_lab): Only hash as many bytes as
71         the value label's width.
72
73 Sun Dec 10 14:21:29 2006  Ben Pfaff  <blp@gnu.org>
74
75         * sfm-private.h: Move contents into sys-file-writer.c, which is
76         the only remaining user.  Removed Borland C++-specific directives.
77         
78         * sys-file-reader.c: Clean up and rewrite entire file.  The
79         rewritten version is simpler and better abstracted, and should be
80         easier to maintain and extend.  It avoids using structures to read
81         file data, which is prone to padding variations among compilers.
82         It should also handle non-IEEE 754 system files, although I
83         haven't been able to find any.  It has been tested against many
84         .sav files obtained from the Web and found to produce the same
85         results as the earlier version of the code, or in some cases
86         improved results.  It is more tolerant of format variations found
87         in the wild.
88
89         * sys-file-reader.h (struct sfm_read_info): Removed `big_endian'
90         member, putting an enum integer_format in its place.  New member
91         `float_format'.  Changed `compressed' member to type bool.
92
93 Sun Dec 10 13:48:53 2006  Ben Pfaff  <blp@gnu.org>
94
95         * dictionary.c (dict_delete_consecutive_vars): New function.
96
97 Sat Dec  9 20:08:25 2006  Ben Pfaff  <blp@gnu.org>
98
99         * file-name.c (fn_search_path): Remove prefix arg that was unused
100         by any caller.  Updated all callers.
101
102 Sat Dec  9 20:04:22 2006  Ben Pfaff  <blp@gnu.org>
103
104         * format.c (fmt_dollar_template): Use user's decimal point
105         character.  Add assertion.
106
107 Sat Dec  9 20:02:25 2006  Ben Pfaff  <blp@gnu.org>
108
109         * format.c (fmt_dollar_template): New function, based on
110         dollar_format_template from var-type-dialog.c.
111
112 Sat Dec  9 18:05:59 2006  Ben Pfaff  <blp@gnu.org>
113
114         * data-out.c (output_scientific): Fix bad assumption that "buf" is
115         null-terminated.
116         
117 Sat Dec  9 17:23:23 2006  Ben Pfaff  <blp@gnu.org>
118
119         Finish converting struct variable to an opaque type.  In this
120         phase, we add remaining setter and getter functions, convert the
121         remaining PSPP code to use them, and do a bunch of cleanup.  The
122         resulting changes are pervasive but mostly trivial, and only the
123         notable changes are logged.
124         
125         * automake.mk (src_data_libdata_a_SOURCES): Add the new source
126         files.
127         
128         * case.c (case_data): Renamed case_data_idx.
129         (case_num): Renamed case_num_idx.
130         (case_str): Renamed case_str_idx.
131         (case_data_rw): Renamed case_data_rw_idx.
132
133         * case.h (case_data): New function with old name and an interface
134         that takes a variable instead of an index, which is easier to
135         use.  Updated all callers to use the new interface, or to use the
136         new *_idx function (see above).
137         (case_num): Ditto.
138         (case_str): Ditto.
139         (case_data_rw): Ditto.
140         
141         * category.c (cat_stored_values_destroy): Changed interface to
142         take a struct cat_vals * instead of a struct variable *.
143
144         * dictionary.c (dict_clone): Use new vector_clone function.     
145         (dict_clear) Use new var_destroy function.
146         (add_var) New function.
147         (dict_create_var) Rewrite in terms of dict_create_var_assert.
148         (dict_create_var_assert) Rewrite in terms of add_var.
149         (dict_clone_var) Rewrite in terms of dict_clone_var_assert.
150         (dict_clone_var_assert) Rewrite in terms of var_clone, add_var.
151         (dict_lookup_var) Use new var_create, var_destroy functions.
152         (dict_contains_var) Rewrite in terms of new vardict functionality.
153         (set_var_dict_index) New function.
154         (set_var_case_index) New function.
155         (reindex_vars) New function.
156         (dict_delete_var) Rewrite in terms of new vardict functionality.
157         (dict_reorder_var) Ditto.
158         (dict_reorder_vars) Ditto.
159         (rename_var) New function.
160         (dict_rename_var) Use rename_var.
161         (dict_rename_vars) Use pool to simplify code.  Use rename_var.
162         (dict_get_compacted_idx_to_fv) Rename
163         dict_get_compacted_dict_index_to_case_index, update callers.
164         (dict_create_vector) Use new vector_create function.
165         (dict_clear_vectors) Use new vector_destroy function.
166         (set_var_short_name_suffix) Move here from variable.c, renamed
167         from var_set_short_name_suffix, make static, update caller.
168
169         * sys-file-private.c: New file.  
170         (sfm_width_to_bytes) Moved here from variable.c, renamed from
171         width_to_bytes, update callers.
172
173         * sys-file-private.h: New file.  Later it will supplant
174         sfm-private.h; for now it supplements it.
175         (macro MIN_VERY_LONG_STRING) New macro.
176         (macro EFFECTIVE_LONG_STRING_LENGTH) New macro, from value.h.
177
178         * sys-file-reader.c: Use MIN_VERY_LONG_STRING - 1 where
179         MAX_LONG_STRING was used before.
180
181         * sys-file-writer.c: Ditto.
182
183         * value-labels.c: Change the paradigm here to be that a null
184         pointer is OK for a struct val_labs * in most cases; it just
185         represents an empty set of value labels.
186         (val_labs_copy) A copy of a null set is a null set.
187         (val_labs_count) A null set has 0 labels.
188         (val_labs_replace) Change return type to void.  Rewrite for
189         simplicity.
190         (val_labs_find) A null set does not contain the value.
191         (value_to_string) Moved to variable.c, renamed var_get_value_name,
192         transposed argument order, updated all callers.
193
194         * value.c: New file.
195         (value_dup) Moved here from variable.c.
196         (compare_values) Ditto.
197         (hash_value) Ditto.
198
199         * value.h: (macro MAX_SHORT_STRING) Rewrote for simplicity.
200         (macro MAX_LONG_STRING) Removed, because it was only interesting
201         for system files, not for general code.
202         (macro MAX_VERY_LONG_STRING) Ditto.
203         (macro EFFECTIVE_LONG_STRING_LENGTH) Moved to sys-file-private.h.
204         (macro MAX_ELEMS_PER_VALUE) Removed, as it was unused.
205
206         * vardict.h: New file, for an interface between variables and
207         their dictionaries.
208
209         * variable.c: A lot of functions were moved around, for better
210         organization.
211         (struct variable) Move definition here, from variable.h.
212         (var_type_adj) Removed--makes i18n hard.
213         (var_type_noun) Ditto.
214         (var_create) New function.
215         (var_clone) New function.
216         (var_destroy) New function.
217         (var_set_name) Assert that variable is not in a dictionary.
218         (compare_var_names) Rename compare_vars_by_name and fix a couple
219         of callers who thought the args were strings.
220         (hash_var_name) Rename hash_var_by_name.
221         (compare_var_ptr_names) Rename compare_var_ptrs_by_name.
222         (hash_var_ptr_name) Rename hash_var_ptr_by_name.
223         (var_is_very_long_string) Removed, because it was only interesting
224         to system file code.
225         (var_set_missing_values) Allow the argument to be the wrong width,
226         as long as we can resize it.  Simplify callers who were doing the
227         resizing themselves.
228         (var_get_value_labels) New function.
229         (var_has_value_labels) New function.
230         (var_set_value_labels) New function.
231         (alloc_value_labels) New function.
232         (var_add_value_label) New function.
233         (var_replace_value_label) New function.
234         (var_clear_value_labels) New function.
235         (var_lookup_value_label) New function.
236         (var_get_value_name) Moved here from variable.c, renamed from
237         var_get_value_name, transposed argument order, updated all
238         callers.
239         (var_to_string) Moved here, from variable-label.c.
240         (var_set_leave) New function.
241         (var_get_leave) New function.
242         (var_must_leave) New function.
243         (var_set_short_name_suffix) Moved to dictionary.c, renamed
244         set_var_short_name_suffix.
245         (var_get_dict_index) New function.
246         (var_get_case_index) New function.
247         (var_get_obs_vals) New function.
248         (var_set_obs_vals) New function.
249         (var_has_obs_vals) New function.
250         (var_get_vardict) New function.
251         (var_set_vardict) New function.
252         (var_has_vardict) New function.
253         (var_clear_vardict) New function.
254         (value_dup) Moved to value.c.
255         (compare_values) Ditto.
256         (hash_value) Ditto.
257
258         * variable.h: (enum NUMERIC) Rename VAR_NUMERIC, update all users.
259         (enum ALPHA) Rename VAR_STRING, update all users.
260
261         * vector.c: New file.
262         (struct vector) Moved here, from variable.h.
263         (check_widths) New function.
264         (vector_create) New function.
265         (vector_clone) New function.
266         (vector_destroy) New function.
267         (vector_get_name) New function.
268         (vector_get_var) New function.
269         (vector_get_var_cnt) New function.
270         (compare_vector_ptrs_by_name) New function.
271
272         * vector.h: New file.
273
274 Sun Dec 10 11:32:56 WST 2006 John Darrington <john@darrington.wattle.id.au>
275
276         * casefilter.c (casefilter_variable_missing): Avoided comparision of
277         string variables to SYSMIS.  Thanks to Ben Pfaff for reporting this
278         problem.
279
280 Sat Dec  9 07:18:03 WST 2006 John Darrington <john@darrington.wattle.id.au>
281
282         * value-labels.c (destroy_atoms): New function.
283         * value-labels.c (atom_create): Call destroy_atoms in atexit handler.
284
285 Thu Dec  7 17:38:26 2006  Ben Pfaff  <blp@gnu.org>
286
287         Thanks to Jason Stover for pointing out this problem.
288         
289         * data-out.c (output_number): Use gsl_finite from GSL, which is
290         portable, instead of isfinite, which is not.
291         (power256) Ditto.
292
293 Thu Dec  7 15:22:38 WST 2006 John Darrington <john@darrington.wattle.id.au>
294
295         * variable.c variable.h (value_dup): New function.
296
297 Mon Dec  4 22:20:17 2006  Ben Pfaff  <blp@gnu.org>
298
299         Start converting struct variable to an opaque type.  In this
300         phase, we add a bunch of setter and getter functions and convert
301         most of the PSPP code to use them.  The resulting changes are
302         pervasive but mostly trivial, and only the notable changes are
303         logged.
304         
305         * format.c (fmt_equal): New function.
306         
307         * variable.c (var_type_is_valid): New function.
308         (measure_is_valid) Moved here, from format.c.
309         (alignment_is_valid) Moved here, from format.c.
310         (var_get_name) New function.
311         (var_set_name) New function.
312         (width_to_type) New function.
313         (var_get_type) New function.
314         (var_get_width) New function.
315         (var_set_width) New function.
316         (var_is_numeric) New function.
317         (var_is_alpha) New function.
318         (var_is_short_string) New function.
319         (var_is_long_string) New function.
320         (var_is_very_long_string) New function.
321         (var_get_missing_values) New function.
322         (var_set_missing_values) New function.
323         (var_clear_missing_values) New function.
324         (var_has_missing_values) New function.
325         (var_is_value_missing) New function.
326         (var_is_num_missing) New function.
327         (var_is_str_missing) New function.
328         (var_is_value_user_missing) New function.
329         (var_is_num_user_missing) New function.
330         (var_is_str_user_missing) New function.
331         (var_is_value_system_missing) New function.
332         (var_get_print_format) New function.
333         (var_set_print_format) New function.
334         (var_get_write_format) New function.
335         (var_set_write_format) New function.
336         (var_set_both_formats) New function.
337         (var_get_label) New function.
338         (var_set_label) New function.
339         (var_clear_label) New function.
340         (var_has_label) New function.
341         (var_get_measure) New function.
342         (var_set_measure) New function.
343         (var_get_display_width) New function.
344         (var_set_display_width) New function.
345         (var_get_alignment) New function.
346         (var_set_alignment) New function.
347         (var_get_value_cnt) New function.
348         (var_get_leave) New function.
349         (var_get_short_name) New function.
350
351         * variable.h: (struct variable) Removed "type" and "nv" members;
352         they are now computed from "width" where needed.
353
354 Mon Dec  4 21:38:40 2006  Ben Pfaff  <blp@gnu.org>
355
356         * missing-values.c (mv_resize): Don't write beyond end of the
357         allocated buffer when resizing a long string.
358
359 Sat Dec  2 16:28:32 2006  Ben Pfaff  <blp@gnu.org>
360
361         Clean up identifier code: don't require identifier enumerations to
362         be in a particular order; make better use of string library;
363         expose less of the internals.
364                 
365         * identifier.c: (lex_skip_identifier) Rename lex_id_get_length,
366         change interface.  Updated all callers.
367         (lex_id_match) Change interface to use struct substring, update
368         all callers.
369         (lex_id_match_len) Removed.  Update callers to use lex_id_match.
370         (global array keywords[]) Make static, change form.  Update all
371         users to use lex_id_name instead.
372         (lex_is_keyword) New function.
373         (lex_id_to_token) Change interface to use struct substring, update
374         all callers.
375         (lex_id_name) New function.
376
377         * identifier.h: (T_FIRST_KEYWORD) Removed.  Changed users to call
378         lex_is_keyword instead.
379         (T_LAST_KEYWORD) Removed.
380         (T_N_KEYWORDS) Removed.
381         
382 Sat Nov 18 20:46:35 2006  Ben Pfaff  <blp@gnu.org>
383
384         * format.c: (fmt_date_template) Distinguish characters for which a
385         space is output and any date delimiter is allowed on input, from
386         those for which a space is output and only a space is allowed on
387         input.  The former is represented by X, the latter by a space.
388         Also, drop distinction between h and H, changing the former to the
389         latter.
390
391         * data-in.c: Completely rewrite internals to conform to SPSS input
392         formats as closely as possible.
393         (data_in) Changed external interface by replacing the structure
394         that was used as a single argument by a set of arguments.  Updated
395         all callers.
396         (data_in_finite_line) Removed.  Converted all callers to use plain
397         data_in.
398         (data_in_get_integer_format) New function.
399         (data_in_set_integer_format) New function.
400         (data_in_get_float_format) New function.
401         (data_in_set_float_format) New function.
402
403         * data-in.h: (enums DI_IGNORE_ERROR, DI_IMPLIED_DECIMALS) Removed.
404         (struct data_in) Removed.
405
406         * data-out.c: (output_date) Drop each component from the input as
407         it is output, to allow us to drop the distinction between h (a
408         count of hours) and H (the hour of day) template characters.
409         Also, handle new X template character.
410         (output_scientific) Follow more rational rule on when to drop
411         fraction introduced between SPSS 13 and 15.  Updated test case to
412         match new behavior.
413
414 Sat Nov 11 11:41:26 2006  Ben Pfaff  <blp@gnu.org>
415
416         Fix buffer overflow reported by John Darrington.
417
418         * data-out.c (output_bcd_integer): In case of SYSMIS, etc.,
419         realize that DIGITS is a count of nibbles, not of bytes.
420
421 Sat Nov  4 15:59:56 2006  Ben Pfaff  <blp@gnu.org>
422
423         * calendar.c (calendar_offset_to_gregorian) Also return the
424         year-of-day.  Change callers to new interface.
425
426         * data-out.c: Completely rewrite internals to conform to SPSS
427         output formats as completely as possible.
428         (data_out) Change interface to put input parameters before output
429         parameters, for consistency with the style I now prefer.  Update
430         all callers.
431         (data_out_get_integer_format) New public function.
432         (data_out_set_integer_format) New public function.
433         (data_out_get_float_format) New public function.
434         (data_out_set_float_format) New public function.
435
436         * data-out.h: New file.  Move prototype for data_out here, from
437         format.h.
438
439         * format.c: (fmt_step_width) Use equality comparison instead of
440         bitwise and, for clarity.
441         (fmt_is_string) Ditto.
442         (fmt_input_to_output) Fix categories that are translated to F
443         format.
444
445 Sun Nov  5 08:29:34 WST 2006 John Darrington <john@darrington.wattle.id.au>
446
447         * casefilter.c casefilter.h (new files), casefile.c casefile.h 
448         casefile-private.h: Added casefilter to assist commands with missing 
449         values.
450
451 Sat Nov  4 11:47:09 2006  Ben Pfaff  <blp@gnu.org>
452
453         Implement SET ERRORS, SHOW ERRORS.  Fixes bug #17609.
454         
455         * settings.c: (route_errors_to_terminal) New variable.
456         (route_errors_to_listing) New variable. 
457         (get_error_routing_to_terminal) New function.
458         (set_error_routing_to_terminal) New function.
459         (get_error_routing_to_listing) New function.
460         (set_error_routing_to_listing) New function.
461
462         * settings.h: (SET_ROUTE_* enums) Removed, because unused.
463
464 Tue Oct 31 19:58:27 2006  Ben Pfaff  <blp@gnu.org>
465
466         * format.c: Completely rewrite, to achieve better abstraction.
467         Rewrite all references to formats in other files.
468         
469         * format.def: Rewrite and reorganize.
470
471         * settings.c: Move everything related to custom currency formats
472         into format.[ch], changing them in form, so as to group related
473         code and definitions better.  Changed all references to use the
474         new functions.
475         (static var decimal) Removed.
476         (static var grouping) Removed.
477         (static var cc) Removed.
478         (get_decimal) Removed.
479         (set_decimal) Removed.
480         (get_grouping) Removed.
481         (set_grouping) Removed.
482         (get_cc) Removed.
483         (set_cc) Removed.
484
485         * settings.h: (macro CC_CNT) Removed.
486         (macro CC_WIDTH) Removed.
487         (struct custom_currency) Removed.
488
489 Tue Oct 31 19:56:19 2006  Ben Pfaff  <blp@gnu.org>
490
491         * data-in.c (data_in): Use switch statement instead of table, to
492         avoid dependence on the order of the FMT_* enums.
493
494 Tue Oct 31 19:35:36 2006  Ben Pfaff  <blp@gnu.org>
495
496         * data-out.c: (num_to_string) Removed, because it was dead code.
497
498 Tue Oct 31 18:09:24 2006  Ben Pfaff  <blp@gnu.org>
499
500         * data-in.c (parse_trailer): Fix error message.
501
502 Sat Oct 28 11:56:50 2006  Ben Pfaff  <blp@gnu.org>
503
504         * format.c (fmt_is_binary): New function.
505
506 Thu Oct 19 22:59:56 WST 2006 John Darrington <john@darrington.wattle.id.au>
507
508         * procedure.c procedure.h: Encapsulated the static data into a single
509         struct.  
510
511 Sat Oct 14 16:56:44 2006  Ben Pfaff  <blp@gnu.org>
512
513         * casefile.c (casereader_read_xfer): Always initialize the case,
514         even on an error condition.
515
516 Wed Sep 27 09:37:49 WST 2006 John Darrington <john@darrington.wattle.id.au>
517
518         * procedure.c (case_limit_trns_proc): Fixed buglet which rendered the 
519         entire function useless.
520
521 Mon Sep 25 17:11:46 WST 2006 John Darrington <john@darrington.wattle.id.au>
522
523         * casefile-private.h casefile.c casefile.h fastfile.c: Created new
524         casereader method casereader_clone.   
525         
526         * procedure.c pransformations.h: Introduced new type casenum_t
527
528 Thu Sep 21 07:00:30 2006  Ben Pfaff  <blp@gnu.org>
529
530         * variable.c: (width_to_bytes) Rephrase code for clarify.
531
532 Sun Jul 16 19:52:03 2006  Ben Pfaff  <blp@gnu.org>
533
534         * format.c: (fmt_type_from_string) New function.
535         (fmt_to_string) Include decimals in output if the format has
536         decimals, even if the format type does not.  This way, we can
537         accurately reproduce incorrect formats in user output.
538         (check_common_specifier) Make the check for a bad format type an
539         assertion, so we get bug reports if they show up.  Fix message.
540         Check for decimal places with a format type that doesn't allow
541         them.
542         (check_input_specifier) Remove check for FMT_X, which has been
543         deleted.
544         (check_output_specifier) Ditto. 
545
546         * format.def: Remove FMT_T, FMT_X, FMT_DESCEND, FMT_NEWREC.
547
548         * format.h: (macro FMT_TYPE_LEN_MAX) New macro.
549         (struct fmt_desc) Use FMT_TYPE_LEN_MAX in definition.
550         (enum fmt_parse_flags) Removed.
551
552 Mon Jul 17 18:26:21 WST 2006 John Darrington <john@darrington.wattle.id.au>
553
554         * casefile.c casefile.h: Converted to  an abstract base class.
555         * casefile-private.h fastfile.c fastfile.h: New files.
556         * automake.mk procedure.c scratch-writer.c storage-stream.c
557
558 Wed Jul 12 21:02:26 2006  Ben Pfaff  <blp@gnu.org>
559
560         * procedure.c (internal_procedure): Create sink_case with only as
561         many values as the compacted dictionary.
562
563 Wed Jul 12 21:01:00 2006  Ben Pfaff  <blp@gnu.org>
564
565         Remove "debugging" code that caused plenty of false positives and
566         no true positives.
567         
568         * case.h (struct ccase): [DEBUGGING] Remove `this' member.
569
570         * case.c: Remove all references to `this' member.
571
572 Thu Jul  6 19:09:53 2006  Ben Pfaff  <blp@gnu.org>
573
574         Fix link error noted by Jason Stover.
575         
576         * storage-stream.c: Include <assert.h>.
577
578 Tue Jul  4 08:47:35 2006  Ben Pfaff  <blp@gnu.org>
579
580         Fix bug #15766 (/KEEP subcommand on SAVE doesn't fully support
581         ALL) and additional underlying system file issues.
582
583         Thanks to John Darrington for review.
584
585         First problem: var_hash points to variables not owned by the
586         sys-file-reader, which the caller may free or modify.  Use an
587         array of sfm_vars instead, as done earlier (e.g. CVS version
588         1.12).
589         
590         * sys-file-reader.c (struct sfm_reader): Remove var_hash, svars
591         members and remove all code that references it.  Add vars, var_cnt
592         members.  Remove fix_specials member, which was unused.
593         (struct sfm_var) Remove name member, which was unused.
594         (sfm_close_reader) Free vars member instead of var_hash.
595         (compare_var_shortnames) Removed.
596         (hash_var_shortname) Removed.
597         (sfm_open_reader) Fill out vars array.
598         (compare_var_index) Removed.
599         (sfm_read_case) Use vars instead of var_hash.
600         
601         Second problem: we're confused about when we actually have very
602         long strings, causing us to choose incorrectly between slow path
603         and fast path in sfm_read_case.
604
605         * sys-file-reader.c: (sfm_open_reader) Only mark has_vls if we
606         have very long strings, not when we have long variable names,
607         which is an unrelated feature.
608
609 Tue Jun 27 12:06:49 2006  Ben Pfaff  <blp@gnu.org>
610
611         * variable.h: Move var_set and variable parsing declarations to
612         new header, src/language/lexer/variable-parser.h.  Modified lots
613         of files to include the new header.
614
615 Sun Jun 25 22:39:32 2006  Ben Pfaff  <blp@gnu.org>
616
617         * value-labels.c (value_to_string): When there's no value label,
618         format the variable according to its print format, instead of
619         always effectively using A or F format.
620
621 Mon Jun 19 18:05:42 WST 2006 John Darrington <john@darrington.wattle.id.au>
622
623         * casefile.c (casefile_get_random_reader): Nasty hack to get around 
624         the mode assertion.
625
626         * format.c: Removed tortological assertion.
627
628 Fri Jun  9 12:20:09 2006  Ben Pfaff  <blp@gnu.org>
629
630         Reform string library.
631         
632         * file-name.c (fn_interp_vars): Change interface to take a
633         substring as input.  Updated all users.
634         
635 Fri Jun  9 12:11:24 2006  Ben Pfaff  <blp@gnu.org>
636
637         * format.c (measure_is_valid): Really return false when m >=
638         n_MEASURES.
639
640 Tue Jun  6 18:46:26 2006  Ben Pfaff  <blp@gnu.org>
641
642         Implement random access to casefiles, for use in GUI.
643         
644         * casefile.c: (struct casereader) Add `random', `file_ofs',
645         `buffer_ofs' members.
646         (casefile_get_random_reader) New function.
647         (read_open_file) Break part into new function
648         seek_and_fill_buffer().
649         (fill_buffer) Update buffer_ofs, file_ofs.
650         (casereader_seek) New function.
651
652 Tue May 30 19:52:33 WST 2006 John Darrington <john@darrington.wattle.id.au>
653
654         * settings.c: Added call to i18n{done, init}.
655
656 Tue May  9 21:09:17 2006  Ben Pfaff  <blp@gnu.org>
657
658         * procedure.h: Add WARN_UNUSED_RESULT to procedure function
659         prototypes.
660
661 Tue May  9 21:08:05 2006  Ben Pfaff  <blp@gnu.org>
662
663         * casefile.c: Convert many uses of `int' to `bool'.
664
665 Sat May  6 22:49:43 2006  Ben Pfaff  <blp@gnu.org>
666
667         * transformations.c (trns_chain_destroy): Destroy chain's trns
668         member, to fix memory leak.
669
670 Sat May  6 22:48:30 2006  Ben Pfaff  <blp@gnu.org>
671
672         * storage-stream.c (storage_source_decapsulate): Destroy case
673         source to fix memory leak.
674
675 Sat May  6 22:46:47 2006  Ben Pfaff  <blp@gnu.org>
676
677         * scratch-reader.c (scratch_reader_read_case): Copy into existing
678         case passed as argument instead of initializing the argument as a
679         case.  Fixes memory leak that showed up in
680         tests/command/aggregate.sh with scratch files.
681
682 Sat May  6 22:45:55 2006  Ben Pfaff  <blp@gnu.org>
683
684         * procedure.c (proc_done): Destroy default_dict, to fix memory
685         leak.
686
687 Sat May  6 22:44:44 2006  Ben Pfaff  <blp@gnu.org>
688
689         Simplify procedure_with_splits().
690         
691         * procedure.c (struct split_aux_data): Removed case_count member.
692         (procedure_with_splits) Don't initialize case_count.
693         (split_procedure_case_func) Check whether prev_case is null
694         instead of case_count.
695         (split_procedure_end_func) Ditto.
696
697 Sat May  6 22:42:23 2006  Ben Pfaff  <blp@gnu.org>
698
699         * case.c (case_move): Do nothing if dst and src are the same
700         object.
701         (case_try_create) Merge two similar cases.
702         (case_copy) Unshare only if data must be actually copied.
703
704 Sun May  7 10:04:06 WST 2006 John Darrington <john@darrington.wattle.id.au>
705
706         * data-in.c data-out.c dictionary.c sys-file-reader.c
707         sys-file-writer.c variable.c variable.h:  Reworked very long string
708         support for better encapsulation.
709
710 Sat May  6 19:02:00 2006  Ben Pfaff  <blp@gnu.org>
711
712         * value-labels.c (val_labs_can_set_width): New function.
713         (val_labs_set_width) Clear labels if increasing width to long
714         string.
715         (val_labs_destroy) Remove unneeded test for null.
716         
717 Sat May  6 16:14:08 2006  Ben Pfaff  <blp@gnu.org>
718
719         * value-labels.h: Remove unneeded dependency on variable.h.
720
721 Sat May  6 15:58:36 2006  Ben Pfaff  <blp@gnu.org>
722
723         Get rid of `char *c' member in union value, for cleanliness.
724         
725         * value.h: (union value) Remove `c' member.
726
727 Sat May  6 15:36:59 2006  Ben Pfaff  <blp@gnu.org>
728
729         Make dictionary compacting functions a little more general.
730         
731         * sys-file-writer.c (sfm_open_writer): Use
732         dict_compacting_would_change().
733         (does_dict_need_translation) Removed.
734
735 Sat May  6 15:35:42 2006  Ben Pfaff  <blp@gnu.org>
736
737         Make dictionary compacting functions a little more general.
738         
739         * dictionary.c (dict_needs_compaction): Rename
740         dict_compacting_would_shrink().  Update all callers.
741         (dict_compacting_would_change) New function.
742         
743 Sat May  6 14:25:49 2006  Ben Pfaff  <blp@gnu.org>
744
745         * sys-file-writer.c: (does_dict_need_translation) Fix bug:
746         inverted return value (!).
747
748 Sat May  6 13:37:52 2006  Ben Pfaff  <blp@gnu.org>
749
750         Continue reforming procedure execution.  
751
752         * procedure.c: Search and replace "vfm" by "proc".  Notably:
753         (static var vfm_source) Rename proc_source.  Update all
754         references.
755         (static var vfm_sink) Rename proc_sink.  Update all references.
756         
757 Sat May  6 12:38:55 2006  Ben Pfaff  <blp@gnu.org>
758
759         Continue reforming procedure execution.  In this phase, remove
760         PROCESS IF, which was deprecated anyway and can be easily
761         simulated with TEMPORARY followed by SELECT IF.
762
763         * procedure.c: (open_active_file) Don't call
764         add_process_if_trns().
765         (discard_variables) Get rid of redundant call to
766         proc_cancel_all_transformations().
767         (add_process_if_trns) Removed.
768         (process_if_trns_proc) Removed.
769         (process_if_trns_free) Removed.
770
771 Sat May  6 10:58:05 2006  Ben Pfaff  <blp@gnu.org>
772
773         Continue reforming procedure execution.  In this phase, add
774         `const' to the case passed to procedure()'s callback.
775
776         Updated all users of procedure() as well.
777         
778         * procedure.c: (struct write_case_data) Add "const" to ccase
779         parameter for case_func member.
780         (procedure) Add "const" to ccase parameter for proc_func
781         parameter.
782         (multipass_case_func) Make ccase parameter const.
783         (internal_procedure) Add "const" to ccase parameter for case_func
784         parameter.
785         (split_procedure_case_func) Make ccase parameter const.
786         (multipass_split_case_func) Make ccase parameter const.
787         
788 Sat May  6 10:30:33 2006  Ben Pfaff  <blp@gnu.org>
789
790         Continue reforming procedure execution.  In this phase, get rid of
791         the output code for SPLIT FILE groups in procedure.c, which really
792         shouldn't be doing any output.  Move it into the individual
793         procedures instead.  This also adds some flexibility.
794
795         Updated many users of procedure_with_splits() and
796         multipass_procedure_with_splits() to call
797         output_split_file_values() and to deal with increased use of
798         const.
799
800         * procedure.c: (struct split_aux_data) Add "const struct ccase *"
801         parameter to begin_func member.
802         (procedure_with_splits) Add "const struct ccase *" parameter to
803         begin_func parameter.  Make ccase parameter const in proc_func
804         parameter.
805         (split_procedure_case_func) Don't dump split file group.  Pass
806         case to begin_func.
807         (dump_splits) Moved to language/dictionary/split-file.c as
808         output_split_file_values().
809         (struct multipass_split_aux_data) Add "const struct ccase *"
810         parameter to split_func member.
811         (multipass_procedure_with_splits) Add "const struct ccase *"
812         parameter to split_func parameter.
813         (multipass_split_case_func) Save new SPLIT FILE case before
814         outputting case.
815         (multipass_split_output) Pass saved SPLIT FILE case to split_func.
816         
817 Fri May  5 22:48:50 2006  Ben Pfaff  <blp@gnu.org>
818
819         Continue reforming procedure execution.  Change
820         internal_procedure() so that it calls open_active_file() and
821         close_active_file(), which isolates most of the actual procedure
822         functionality.
823
824         * procedure.c: (struct write_case_data) Rename `proc_func' member
825         to `case_func' and update all references.
826         (procedure) Rewrite as one-line wrapper around
827         internal_procedure().
828         (struct multipass_aux_data) New.
829         (multipass_callback) Renamed multipass_case_func().  Use struct
830         multipass_aux_data as auxiliary data.
831         (multipass_end_func) New function.
832         (multipass_procedure) Rewrite as wrapper for internal_procedure()
833         that uses multipass_case_func, multipass_end_func.
834         (internal_procedure) Add `end_func' argument.  Move optimization
835         of trivial case in here.  Move call to open_active_file() and
836         close_active_file() in here.  Now assert that vfm_source is
837         non-null.
838         (procedure_with_splits_callback) Rename
839         split_procedure_case_func().
840         (split_procedure_end_func) New function.
841         (multipass_split_callback) Rename multipass_split_case_func.
842         (multipass_split_end_func) New function.
843         (discard_variables) No need to test for nonnull vfm_source.
844
845 Fri May  5 21:34:02 2006  Ben Pfaff  <blp@gnu.org>
846
847         Continue reforming procedure execution.  Get rid of unused member.
848
849         * procedure.c: (struct write_case_data) Remove `cases_analyzed'
850         member.
851         (write_case) Don't increment cases_analyzed.
852
853 Thu May  4 21:50:11 2006  Ben Pfaff  <blp@gnu.org>
854
855         Continue reforming procedure execution.  In this phase, move
856         procedure.c and procedure.h from src to src/data.  Update
857         makefiles and #includes accordingly.
858
859         * procedure.c: Moved here from src/.
860
861         * procedure.h: Moved here from src/.
862
863 Wed May  3 22:42:12 2006  Ben Pfaff  <blp@gnu.org>
864
865         Continue reforming procedure execution.  In this phase, get rid of
866         many global variables, consolidating procedure execution in
867         procedure.c.  Encapsulate transformations in new "struct
868         trns_chain".  Also, change implementation of N OF CASES, FILTER,
869         and PROCESS IF from special cases to transformations.
870          
871         * automake.mk: (src_data_libdata_a_SOURCES) Add transformations.c,
872         transformations.h.
873
874         * dictionary.c: (global variable default_dict) Move to
875         src/procedure.c.
876
877         * variable.h: (TRNS_*) Move to transformations.h.
878         (struct transformation) Move to transformations.c.
879
880 Thu May  4 13:47:06 WST 2006 John Darrington <john@darrington.wattle.id.au>
881
882         * sys-file-reader.c: Fixed invalid read problems.
883
884 Tue May  2 15:57:10 2006  Ben Pfaff  <blp@gnu.org>
885
886         * storage-stream.c: Add missing function comments.
887
888 Tue May  2 15:50:21 2006  Ben Pfaff  <blp@gnu.org>
889
890         Continue reforming procedure execution.  In this phase, add some
891         new, needed functionality to storage-stream.
892
893         * storage-stream.c: (storage_source_decapsulate) New function.
894
895 Tue May  2 15:43:36 2006  Ben Pfaff  <blp@gnu.org>
896
897         * variable.c (width_to_bytes): Declarations must precede
898         statements for C90 compliance.
899
900 Tue May  2 10:42:05 WST 2006 John Darrington <john@darrington.wattle.id.au>
901
902         * data-out.c, data-in.c, variable.c, variable.h: New functions 
903         copy_mangle and copy_demangle for reading/writing cases; emulates the 
904         way SPSS deals with strings > 255 bytes.
905
906         * sys-file-reader.c sys-file-writer.c: Added support for Record 7, 
907         subtype 14 needed for strings longer than 255 bytes.
908
909         * dictionary.c, format.def, value.c : Updated to use MAX_STRING 
910         instead of literal values. Also fixed some constness issues.
911
912         * format.h: Constness
913
914         * sfm-private.h: Renamed the case_size identifier, since I discovered 
915         that SPSS's respect for this variable is very nominal.
916
917 Mon May  1 15:45:42 2006  Ben Pfaff  <blp@gnu.org>
918
919         Change case limit type from int to size_t.
920
921         * dictionary.c: (struct dictionary) Change type of case_limit
922         member.
923         (dict_get_case_limit) Change return type.
924         (dict_set_case_limit) Change parameter type.
925
926 Wed Apr 26 20:01:19 2006  Ben Pfaff  <blp@gnu.org>
927
928         * variable.h: (struct variable) Rename `reinit' member as `leave'
929         and invert sense.  Fix up all references.
930
931 Wed Apr 26 19:39:28 2006  Ben Pfaff  <blp@gnu.org>
932
933         Continue reforming procedure execution.  In this phase, break
934         procedure.c into multiple files.
935         
936         * automake.mk: (src_data_libdata_a_SOURCES) Add all the new files.
937
938         * case-sink.c: New file.
939
940         * case-sink.h: New file.
941         
942         * case-source.c: New file.
943
944         * case-source.h: New file.
945         
946         * storage-stream.c: New file.
947
948         * storage-stream.h: New file.
949
950 Wed Apr 26 14:55:19 2006  Ben Pfaff  <blp@gnu.org>
951
952         * variable.h: (struct variable) Remove `init' member and all
953         references to it from other files.  It was initialized in several
954         places, but nothing really ever used it for anything worthwhile.
955         Thanks to Jason Stover for pointing out how confusing this
956         member is.
957
958 Sun Apr 23 22:04:45 2006  Ben Pfaff  <blp@gnu.org>
959
960         Continue reforming error message support.  In this phase, get rid
961         of message "titles" and put the message text in `struct error'.
962         Now `struct error' encapsulates a message more properly.
963         
964         * casefile.c: (io_error) Use err_msg() instead of err_vmsg().
965         Format message ourselves.
966
967         * data-in.c: (vdls_error) Ditto.
968
969         * por-file-reader.c: (error) Ditto.
970
971         * sys-file-reader.c: (corrupt_msg) Ditto.
972
973 Sun Apr 16 18:49:51 2006  Ben Pfaff  <blp@gnu.org>
974
975         GNU standards require "file name" instead of "filename" in
976         documentation.  It's nice for our code to follow the convention
977         too.
978         
979         * casefile.c: (struct casefile) Rename `filename' member to
980         `file_name'.  Updated all references.
981
982         * file-name.c: [!unix] (struct file_identity) Rename
983         normalized_filename member to normalized_file_name.  Updated all
984         references.
985
986 Sun Apr 16 18:35:33 2006  Ben Pfaff  <blp@gnu.org>
987
988         We don't really support anything but Unix-like environments well,
989         so we might as well de-obfuscate by writing directory and path
990         separators explicitly.
991
992         * file-name.h: (macro DIR_SEPARATOR) Removed.  Changed all usages
993         to just '/'.
994         (macro PATH_SEPARATOR) Removed.  Changed all usages to just ':'.
995         (macro DIR_SEPARATOR_STRING) Removed.  Changed all usages to just
996         "/".
997         (macro PATH_SEPARATOR_STRING) Removed.  Changed all usages to just
998         ":"
999
1000 Sun Apr 16 18:28:35 2006  Ben Pfaff  <blp@gnu.org>
1001
1002         GNU standards require "file name" instead of "filename" in
1003         documentation.  It's nice for our code to follow the convention
1004         too.
1005         
1006         * filename.c: Rename to file-name.c.
1007
1008         * filename.h: Rename to file-name.h.  Update all inclusions.
1009         Update header guards.
1010
1011         * automake.mk: Update file names.
1012
1013 Sun Apr 16 16:42:47 2006  Ben Pfaff  <blp@gnu.org>
1014
1015         * filename.c: (fn_dirname) Renamed fn_dir_name(), all references
1016         updated.
1017         (fn_basename) Removed (dead code).
1018         (fn_absolute_p) Renamed fn_is_absolute(), all references updated.
1019         (fn_special_p) Renamed fn_is_special(), all references updated.
1020         (fn_exists_p) Renamed fn_exists(), all references updated.
1021
1022 Sun Apr 16 16:33:58 2006  Ben Pfaff  <blp@gnu.org>
1023
1024         * filename.c: (fn_tilde_expand) Rewrite for cleaner code.  
1025         Also, now it only tilde-expands file names, not paths.
1026         (fn_search_path) Tilde-expand one directory at a time.
1027
1028 Sun Apr 16 16:28:06 2006  Ben Pfaff  <blp@gnu.org>
1029
1030         * filename.c: (fn_search_path) rewrite for cleaner code.  Also,
1031         get rid of non-Unixlike version of the code, which has probably
1032         never been tested.
1033         (fn_prepend_dir) Removed (dead code).
1034
1035         * filename.h: (macro DIR_SEPARATOR_STRING) New.
1036         (macro PATH_SEPARATOR_STRING) New.
1037 Sun Apr 16 16:05:28 2006  Ben Pfaff  <blp@gnu.org>
1038
1039         Continue reforming error message support.  In this phase, we get
1040         rid of VM() and the other msg() support for "verbosity", replacing
1041         it by a new function verbose_msg().
1042
1043         * filename.c: (fn_search_path) Use verbose_msg() instead of
1044         msg(VM(), ...).  
1045
1046 Sat Apr 15 19:53:19 2006  Ben Pfaff  <blp@gnu.org>
1047
1048         * sfm-private.h: Get rid of #defines after #error, which makes no
1049         sense.
1050
1051 Sat Apr 15 19:48:57 2006  Ben Pfaff  <blp@gnu.org>
1052
1053         Get rid of our own int32 type in favor of the standard int32_t
1054         type.
1055         
1056         * sfm-private.h: (int32 macro) Don't define this anymore.  Do
1057         include <stdint.h>.
1058
1059         * sys-file-reader.c: Use int32_t instead of int32 throughout.
1060         
1061         * sys-file-writer.c: Use int32_t instead of int32 throughout.
1062
1063 Sat Apr 15 19:36:47 2006  Ben Pfaff  <blp@gnu.org>
1064
1065         Remove ill-considered file routines that are no longer used.
1066         
1067         * filename.c: (fn_open_ext) Removed.
1068         (fn_close_ext) Removed.
1069
1070         * filename.h: (struct file_ext) Removed.
1071
1072 Mon Apr  3 13:22:39 2006  Ben Pfaff  <blp@gnu.org>
1073
1074         * variable.c (var_is_valid_name): Move declarations before code
1075         for C90 compliance.
1076
1077 Tue Apr  4 15:28:40 WST 2006 John Darrington <john@darrington.wattle.id.au>
1078
1079         * filename.ch (fn_interp_vars): Fixed small buglet.
1080
1081 Tue Mar 28 13:47:16 WST 2006 John Darrington <john@darrington.wattle.id.au>
1082         
1083         * filename.[ch] (fn_interp_vars): Changed the signature and semantics
1084         so as to modify the string inline.   Thus makeing it easier to
1085         destroy the results when no longer needed.
1086         
1087 2006-03-25  Jason Stover  <jhs@math.gcsu.edu>
1088
1089         * category.c (cat_stored_values_destroy): Fixed memory leak.
1090
1091 Fri Mar 24 18:15:41 2006  Ben Pfaff  <blp@gnu.org>
1092
1093         Add some missing frees.  Thanks to John Darrington for reporting
1094         these.
1095
1096         * any-writer.c (any_writer_close): Free writer.
1097
1098         * any-reader.c (any_reader_close): Free reader.
1099
1100 Mon Mar 20 16:33:53 2006  Ben Pfaff  <blp@gnu.org>
1101
1102         * por-file-reader.c: (error) Mark as NO_RETURN.
1103
1104 Sat Mar 11 15:06:07 WST 2006 John Darrington <john@darrington.wattle.id.au>
1105
1106         * settings.c: Changed default value of scompress to true.
1107
1108 Sat Mar  4 13:22:51 2006  Ben Pfaff  <blp@gnu.org>
1109
1110         * sfm-private.h: Include variable.h, to get SHORT_NAME_LEN.
1111
1112         * value.h: Remove check on MAX_SHORT_STRING, which I don't think
1113         really applies.
1114
1115         * variable.h: Move definition of SHORT_NAME_LEN, LONG_NAME_LEN
1116         here from pref.h.orig.
1117
1118 Sat Mar  4 12:50:48 WST 2006 John Darrington <john@darrington.wattle.id.au>
1119
1120         * sys-file-reader.c: Fixed bug reading compressed files.
1121
1122 Thu Mar  2 08:40:33 WST 2006 John Darrington <john@darrington.wattle.id.au>
1123
1124         * Numerous renames.  See src/ChangeLog for details.
1125         
1126         * Moved files from src directory