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