b80d60c2a9164f2020a6471d3b99136f11153fa1
[pspp-builds.git] / src / data / ChangeLog
1 2007-06-06  Ben Pfaff  <blp@gnu.org>
2
3         Add datasheet code.
4
5         * automake.mk: Add new files.
6
7         * datasheet.c: New file.
8
9         * datasheet.h: New file.
10
11 2007-06-06  Ben Pfaff  <blp@gnu.org>
12
13         Until now, the procedure code has provided a case to the
14         case_source, which has filled in the data values that come from
15         the active file.  "Left" data values that don't come from the
16         active file naturally stay the same from case to case, because the
17         procedure code keeps using that same case.
18
19         One of the compromises that comes with the new procedure code is
20         that the active file allocates and provides its own case, which
21         the procedure code then has to resize to provide room for any
22         other variables that should go in the case and then fill in the
23         values of "left" variables.  Then, when we're done with that case,
24         we have to save the values of "left" variables to copy into the
25         next case read from the active file.
26
27         The caseinit code helps with this.
28
29         * automake.mk: Add new files.
30
31         * caseinit.c: New file. 
32
33         * caseinit.h: New file. 
34
35 2007-06-06  Ben Pfaff  <blp@gnu.org>
36
37         * value.h (value_cnt_from_width): New function.
38
39         * variable.c (var_get_value_cnt): Use new function.
40
41 2007-06-06  Ben Pfaff  <blp@gnu.org>
42
43         Add casegrouper, to allow cases read from a given casereader to be
44         broken into groups, each of which has its own casereader.
45         Generally cases are grouped based on having equal values for some
46         set of variables.
47
48         * automake.mk: Add new files.
49
50         * casegrouper.c: New file.
51
52         * casegrouper.h: New file.
53
54 2007-06-06  Ben Pfaff  <blp@gnu.org>
55
56         Add interface to lexicographical ordering of cases.
57
58         * automake.mk: Add new files.
59
60         * case-ordering.c: New file.
61
62         * case-ordering.h: New file.
63
64 2007-06-06  Ben Pfaff  <blp@gnu.org>
65
66         Add casereaders and casewriters, the basis of the new data processing
67         implementation.  A casereader is a uniform interface to reading cases
68         from a data source; a casewriter is a uniform interface to writing
69         cases to a data sink.
70
71         * automake.mk: Add new files.
72         
73         * casereader-filter.c: New file.
74         
75         * casereader-provider.h: New file.
76
77         * casereader-translator.c: New file.
78         
79         * casereader.c: New file.
80         
81         * casereader.h: New file.
82         
83         * casewriter-provider.h: New file.
84         
85         * casewriter-translator.c: New file.
86         
87         * casewriter.c: New file.
88         
89         * casewriter.h: New file.
90
91 2007-06-06  Ben Pfaff  <blp@gnu.org>
92
93         "casewindow" data structure that extends the deque (from libpspp)
94         of cases with the ability to dump cases to disk if we get too many
95         of them in memory.
96
97         * automake.mk: Add new files.
98
99         * casewindow.c: New file.
100
101         * casewindow.h: New file.
102
103 2007-06-06  Ben Pfaff  <blp@gnu.org>
104
105         sparse_cases data structure that augments a sparse_array of cases
106         with the ability to dump cases to disk if we get too many cases in
107         memory.
108
109         * automake.mk: Add new files.
110
111         * sparse-cases.c: New file.
112
113         * sparse-cases.h: New file.
114
115 2007-06-06  Ben Pfaff  <blp@gnu.org>
116
117         Adds a low-level on-disk case array data structure.
118         
119         * automake.mk: Add new files.
120
121         * case-tmpfile.c: New file.
122
123         * case-tmpfile.h: New file.
124
125 2007-06-06  Ben Pfaff  <blp@gnu.org>
126
127         In a couple of places we calculate the maximum number of cases to
128         keep in memory based on the user-defined workspace.  Enable
129         centralizing the calculation through a new function.
130         
131         * settings.c (get_workspace_cases): New function.
132
133 2007-06-06  Ben Pfaff  <blp@gnu.org>
134
135         The casenumber type is defined in transformations.h, but case.h is
136         a more sensible place.  Move it.
137
138         * case.h (CASENUMBER_MAX): New macro.
139         (typedef casenumber): Move here, from transformations.h.
140
141 2007-06-03  Ben Pfaff  <blp@gnu.org>
142
143         Slightly generalize case_to_values and case_from_values functions.
144
145         * case.c (case_to_values): Rename case_copy_out, change interface.
146         (case_from_values): Rename case_copy_in, change interface.
147
148         * fastfile.c (fastfilereader_get_next_case): Update caller.
149         (write_case_to_disk): Ditto.
150
151 2007-06-02  Ben Pfaff  <blp@gnu.org>
152
153         Clean up after a forgotten part of patch #5829.
154         
155         * casedeque.h: Remove unused file.
156
157         * automake.mk: Remove casedeque.h from sources.
158
159 2007-05-10  Jason Stover  <jhs@math.gcsu.edu>
160
161         * category.c: Removed redundant #include
162
163 2007-05-06  Ben Pfaff  <blp@gnu.org>
164
165         Abstract the documents within a dictionary a little better.
166         Thanks to John Darrington for suggestion, initial version, and
167         review.  Patch #5917.
168
169         * dictionary.c (struct dictionary): Change `documents' member from
170         char * to struct string.
171         (dict_clear): Destroy struct string.
172         (dict_get_documents): Convert struct string to char *.
173         (dict_set_documents): Set struct string.  Pad to 80-character
174         multiple.
175         (dict_clear_documents): New function.
176         (dict_add_document_line): New function.
177         (dict_get_document_line_cnt): New function.
178         (dict_get_document_line): New function.
179
180         * dictionary.h (macro DOC_LINE_LENGTH): New macro.
181
182         * sys-file-reader.c (read_documents): Use new document functions.
183
184 2007-04-19 John Darrington <john@darrington.wattle.id.au>
185
186         * sys-file-reader.c: When reading a system file which has no 
187         long name table, automatically create one where the long names 
188         are the lower case versions of the short names.
189         
190 2007-04-22  Ben Pfaff  <blp@gnu.org>
191
192         * dictionary.c (dict_set_split_vars): dict_destroy expects that
193         dict_clear will free most data related to the dictionary.
194         dict_clear does a decent job, except that dict_set_split_vars on
195         some systems won't actually free the dict's "split" member.
196         Instead, it'll allocate a 1-byte region.  Fix this.
197
198         * value.c (value_copy): New function.
199         (value_set_missing): Ditto.
200
201 2007-04-22 John Darrington <john@darrington.wattle.id.au>
202
203         * Deleted existing category.h and moved cat-routines.h into 
204         category.h  Encapsulated struct cat_vals better.
205
206 2007-04-19 John Darrington <john@darrington.wattle.id.au>
207
208         * sys-file-reader.c: When reading a system file which has no 
209         long name table, automatically create one where the long names 
210         are the lower case versions of the short names.
211         
212 2007-04-16 John Darrington <john@darrington.wattle.id.au>
213
214         * sys-file-reader.c: Some versions of Other Software seem to 
215         produce system files with string  variables' measure set to 
216         zero.  We'll assume these are supposed to be nominal variables.
217
218 2007-03-30  Ben Pfaff  <blp@gnu.org>
219
220         * procedure.c: Adapt to new deque data structure.
221
222 Mon Feb 19 10:53:21 2007  John McCabe-Dansted <gmatht@gmail.com>
223                           Ben Pfaff <blp@gnu.org>
224
225         * file-name.c: Mingw compatibility fixes.
226         (fn_search_path): Use ISSLASH instead of comparing against '/'
227         directly.
228         (fn_dir_name): Use dir_name from gnulib.
229         (fn_is_absolute): Use IS_ABSOLUTE_FILE_NAME from gnulib.
230         (fn_get_identity): Use GetFullPathName instead of canonicalize
231         from gnulib, because the latter does not fully support
232         Windows-style path names.  Use this implementation based on the
233         detected presence of Windows instead of the absence of Unix, since
234         the new implementation is Windows-specific.
235         (fn_compare_file_identities): In Windows implementation, compare
236         names case-insensitively.
237
238 Sun Feb 18 13:28:02 2007  Ben Pfaff  <blp@gnu.org>
239
240         * make-file.c: Don't include mkstemp.h, because gnulib now causes
241         <stdlib.h> to have the same effect.
242
243 Sun Feb 18 11:20:24 2007  Ben Pfaff  <blp@gnu.org>
244
245         * por-file-reader.c: Add missing _() around messages.
246
247 Sun Feb 11 20:44:13 2007  Ben Pfaff  <blp@gnu.org>
248
249         * make-file.c: Include "mkstemp.h", without which linking on
250         mingw32 fails.
251
252 Thu Feb  8 14:59:05 2007  Ben Pfaff  <blp@gnu.org>
253  
254         Reduce platform dependence.
255  
256         * file-name.c (fn_tilde_expand): Removed, and removed calls to it.
257         Everywhere we using this, we really should have just depended on
258         the shell to expand tildes.
259         (fn_search_path): Simplify, given that we don't do tilde expansion
260         any longer.
261         (fn_normalize): Removed.  Caller changed to use the canonicalize
262         module from gnulib.
263         (fn_get_cwd): Removed.  Only user was fn_normalize.
264         (fn_is_absolute): Really only test for absolute names.
265         (fn_is_special): Use pipe files if HAVE_POPEN, not if we're in
266         unix.
267         (fn_readlink): Removed, as it was only used fn_normalize.
268         (fn_exists): Assume the stat function is available; gnulib does.
269         (fn_open): Use pipe files if HAVE_POPEN, not if we're in unix.
270  
271 Sat Feb  3 21:52:17 2007  Ben Pfaff  <blp@gnu.org>
272
273         * dictionary.c (dict_create_vector_assert): New function.
274
275 Wed Feb  7 21:25:15 2007  Ben Pfaff  <blp@gnu.org>
276
277         * file-name.c (fn_normalize): Correct name of function
278         fn_is_special.  Thanks to John McCabe-Dansted <gmatht@gmail.com>
279         for pointing this out.
280
281 Thu Feb  1 16:53:37 2007  Ben Pfaff  <blp@gnu.org>
282
283         We are using a single member in struct file_handle, the "name"
284         field, for more than one purpose.  When it begins with '"', it's a
285         file name; otherwise, it's a token that can be used to identify
286         it.  When that assertion fires, it's because we searched for the
287         name case-sensitively as a file name (so that there was no match),
288         and then we try to insert it case-insensitively as a token, which
289         fails because duplicates aren't allowed.
290
291         Solution: break the two purposes into two separate fields.  This
292         fixes the problem and likely makes the code easier to read too.
293
294         Fixes bug #18922.  Thanks to John Darrington for bug report and
295         review.
296
297         * file-handle-def.c (struct file_handle): New `id' member.
298         (fh_from_name): Rename fh_from_id.  Update all callers.
299         (create_handle): New `id' parameter.  Update all callers.
300         (fh_create_file): Ditto.
301         (fh_get_id): New function.
302
303 Mon Jan 15 16:18:10 2007  Ben Pfaff  <blp@gnu.org>
304
305         * case.c (case_is_null): Change return type to bool.
306
307 Mon Jan 15 10:57:28 2007  Ben Pfaff  <blp@gnu.org>
308
309         Add debugging code.
310         
311         * case.c (case_clone) [DEBUGGING]: When debugging, don't use
312         reference counting to share data.  This makes it easy for
313         valgrind, etc. to find accesses to cases that have been destroyed
314         but have been kept around by another user's ref-count.  This often
315         happens when the data set is small enough to find in memory; if a
316         bigger data set that would overflow to disk were used, then data
317         corruption would occur.
318
319 Mon Jan 15 10:55:18 2007  Ben Pfaff  <blp@gnu.org>
320
321         Simplify code.
322
323         * case.c (case_unshare): Make it check internally whether the
324         ref_cnt is greater than 1, so that the callers don't have to.
325         Update callers not to check.
326
327 Mon Jan 15 10:53:01 2007  Ben Pfaff  <blp@gnu.org>
328
329         Before, I was thinking that I might want to get rid of reference
330         counting at some point.  Now, I'm pretty sure that it's here to
331         stay.  Thus, because we have to store the value_cnt anyway for
332         reference-counted cases, we might as well expose it to users.
333
334         * case.c (case_get_value_cnt): New function.
335         (case_resize): Drop OLD_CNT argument.  Update all callers.  Only
336         resize case if its size actually changed.
337
338         * casefile.c (casefile_append_xfer): Use case_get_value_cnt
339         instead of peeking inside struct case directly.
340         (casefile_append): Ditto.
341
342 Mon Jan 15 10:50:22 2007  Ben Pfaff  <blp@gnu.org>
343
344         Get rid of the inlines for the case functions, which made the
345         header file hard to read.  (Also, in testing with "-O2 -DNDEBUG",
346         the inlines didn't speed up "make check" at all, which is not a
347         perfect benchmark but seems indicative.)
348         
349         * case.c: Remove #ifdef DEBUGGING...#endif around many function
350         definitions.  Remove some assertions on nonnull pointers that were
351         redundant with a pointer dereference soon after in the function.
352         Also:
353         (struct case_data): Move definition here from case.h.
354         (case_data): Ditto.
355         (case_num): Ditto.
356         (case_str): Ditto.
357         (case_data_wr): Ditto.
358         
359 Sun Jan 14 21:41:12 2007  Ben Pfaff  <blp@gnu.org>
360
361         * automake.mk: Add casedeque.h to sources.
362         
363         * casedeque.h: New file.
364
365         * procedure.c: (struct dataset) Change lag_count, lag_head,
366         lag_queue member into single struct casedeque member.  Update all
367         users to use the casedeque instead.
368         (lag_case) Removed.
369
370 Sun Jan 14 21:43:12 2007  Ben Pfaff  <blp@gnu.org>
371
372         * procedure.c: Simplify lagged cases interface.  Updated all
373         clients--well, the only client--to use the simplified interface.
374         (dataset_n_lag) Removed.
375         (dataset_set_n_lag) Removed.
376         (dataset_need_lag) New function.
377
378 Tue Jan  9 07:20:05 WST 2007 John Darrington <john@darrington.wattle.id.au>
379
380         * dictionary.c procedure.c: More changes to ensure that callbacks occur
381         whenever appropriate, but only when the dataset/dictionary is in a 
382         consistent state.
383
384 Sun Jan  7 08:33:04 WST 2007 John Darrington <john@darrington.wattle.id.au>
385
386         * dictionary.c dictionary.h : Added callbacks for change of filter and 
387         split variables.  Refactored some code to ensure that callbacks get
388         invoked when appropriate.
389
390         * procedure.c (proc_cancel_temporary_transformations): Make sure that 
391         replace_dict callback occurs when permanent_dict replaces the current
392         dictionary.
393
394 Wed Jan  3 11:02:11 WST 2007 John Darrington <john@darrington.wattle.id.au>
395
396         * dictionary.c dictionary.h : Added callback for when the weight 
397         variable of a dictionary changes.
398
399 Mon Jan  1 10:36:26 WST 2007 John Darrington <john@darrington.wattle.id.au>
400
401         * dictionary.c dictionary.h : Added replace_source and replace_dict
402         callbacks, and functions to deal with them.
403
404 Fri Dec 22 13:56:08 2006  Ben Pfaff  <blp@gnu.org>
405
406         Simplify missing value handling.
407
408         * missing-values.h (enum mv_class): New type.
409         (enum mv_type): Moved definition into missing-values.c and renamed
410         each MV_* to MVT_*, to distinguish them from the exposed mv_class
411         enums.  Updated all uses.
412         (struct missing_values): Changed type of `type' from `enum
413         mv_type' to `int' because the definition is no longer exposed.
414         
415         * missing-values.c (mv_is_value_missing): Add new enum mv_class
416         parameter.  Update all callers.
417         (mv_is_num_missing): Ditto.
418         (mv_is_str_missing): Ditto.
419         (mv_is_value_user_missing): Removed.  Changed callers to use
420         mv_is_value_missing.
421         (mv_is_num_user_missing): Removed.  Changed callers to use
422         mv_is_num_missing.
423         (mv_is_str_user_missing): Removed.  Changed callers to use
424         mv_is_str_missing.
425         (mv_is_value_system_missing): Removed.  Changed callers to use
426         mv_is_value_missing.
427         (mv_set_type): Removed.  Changed callers to use mv_clear.
428         (mv_clear): New function.
429         
430         * variable.c (var_is_value_missing): Add new enum mv_class
431         parameter.  Update all callers.
432         (var_is_num_missing): Ditto.
433         (var_is_str_missing): Ditto.
434         (var_is_value_user_missing): Removed.  Changed callers to use
435         var_is_value_missing.
436         (var_is_num_user_missing): Removed.  Changed callers to use
437         var_is_num_missing.
438         (var_is_str_user_missing): Removed.  Changed callers to use
439         var_is_str_missing.
440         (var_is_value_system_missing): Removed.  Changed callers to use
441         var_is_value_missing.
442         
443         * casefilter.c (struct casefilter): Use enum mv_class in place of
444         bool.
445         (casefilter_variable_missing): Adapt to new member.
446         (casefilter_create): Change signature to take enum mv_class,
447         update callers.
448
449 Fri Dec 22 20:08:38 WST 2006 John Darrington <john@darrington.wattle.id.au>
450
451         * casefile-factory.h fastfile-factory.c fastfile-factory.h: New files.
452
453         * case-sink.c case-sink.h procedure.c procedure.h 
454           storage-stream.c: Now uses the factory.
455         
456 Sat Dec 16 22:05:18 2006  Ben Pfaff  <blp@gnu.org>
457
458         Make it possible to pull cases from the active file with a
459         function call, instead of requiring indirection through a callback
460         function.
461
462         * case-source.h (struct case_source_class): Change ->read function
463         to return a single case, instead of calling a callback function
464         for each case.  Change ->destroy function to return an error
465         status.
466
467         * case-source.c (free_case_source): Pass along the value returned
468         by the case_source ->destroy function.
469
470         * procedure.c (struct write_case_data): Removed.
471         (struct dataset): Added some members to track procedure state.
472         (procedure): Optimize the trivial case at this level.
473         (internal_procedure): Re-implement in terms of proc_open,
474         proc_read, proc_close.
475         (proc_open) New function.
476         (proc_read) New function.
477         (proc_close) New function.
478         (write_case) Moved into proc_read.
479         (close_active_file) Moved closing of data source into proc_close.
480
481         * storage-source.c: Rewrote to conform with modified
482         case_source_class interface.
483
484         * transformations.c (trns_chain_execute): Added argument to allow
485         starting execution from an arbitrary transformation.  Updated
486         callers.
487
488         * transformations.h (enum TRNS_NEXT_CASE) Renamed TRNS_END_CASE.
489
490 Sat Dec 16 14:09:25 2006  Ben Pfaff  <blp@gnu.org>
491
492         * sys-file-reader.c (read_display_parameters): Don't assume that
493         MEASURE_* and ALIGN_* have the same values found in system files.
494
495         * sys-file-writer.c (write_variable_display_parameters): Ditto.
496
497         * variable.h: Change MEASURE_NOMINAL, MEASURE_ORDINAL,
498         MEASURE_SCALE to be 0-based instead of 1-based.  This also fixes
499         the value of n_MEASURES, which was off by 1 (at least from my
500         point of view).
501
502 Sat Dec 16 12:17:34 WST 2006 John Darrington <john@darrington.wattle.id.au>
503
504         * dictionary.c dictionary.h vardict.h variable.c: Added optional
505                 callbacks which are invoked when the dictionary or its 
506                 variables are changed.  
507         
508         * missing-values.c missing-values.h value-labels.c: Tidied up
509                 consistency checks, and made some of them return false 
510                 instead of assert-failing. 
511
512 Wed Dec 13 19:30:11 2006  Ben Pfaff  <blp@gnu.org>
513
514         * calendar.c (calendar_days_in_month): New function.
515
516 Mon Dec 11 07:53:39 2006  Ben Pfaff  <blp@gnu.org>
517
518         * value-labels.c (hash_int_val_lab): Only hash as many bytes as
519         the value label's width.
520
521 Sun Dec 10 14:21:29 2006  Ben Pfaff  <blp@gnu.org>
522
523         * sfm-private.h: Move contents into sys-file-writer.c, which is
524         the only remaining user.  Removed Borland C++-specific directives.
525         
526         * sys-file-reader.c: Clean up and rewrite entire file.  The
527         rewritten version is simpler and better abstracted, and should be
528         easier to maintain and extend.  It avoids using structures to read
529         file data, which is prone to padding variations among compilers.
530         It should also handle non-IEEE 754 system files, although I
531         haven't been able to find any.  It has been tested against many
532         .sav files obtained from the Web and found to produce the same
533         results as the earlier version of the code, or in some cases
534         improved results.  It is more tolerant of format variations found
535         in the wild.
536
537         * sys-file-reader.h (struct sfm_read_info): Removed `big_endian'
538         member, putting an enum integer_format in its place.  New member
539         `float_format'.  Changed `compressed' member to type bool.
540
541 Sun Dec 10 13:48:53 2006  Ben Pfaff  <blp@gnu.org>
542
543         * dictionary.c (dict_delete_consecutive_vars): New function.
544
545 Sat Dec  9 20:08:25 2006  Ben Pfaff  <blp@gnu.org>
546
547         * file-name.c (fn_search_path): Remove prefix arg that was unused
548         by any caller.  Updated all callers.
549
550 Sat Dec  9 20:04:22 2006  Ben Pfaff  <blp@gnu.org>
551
552         * format.c (fmt_dollar_template): Use user's decimal point
553         character.  Add assertion.
554
555 Sat Dec  9 20:02:25 2006  Ben Pfaff  <blp@gnu.org>
556
557         * format.c (fmt_dollar_template): New function, based on
558         dollar_format_template from var-type-dialog.c.
559
560 Sat Dec  9 18:05:59 2006  Ben Pfaff  <blp@gnu.org>
561
562         * data-out.c (output_scientific): Fix bad assumption that "buf" is
563         null-terminated.
564         
565 Sat Dec  9 17:23:23 2006  Ben Pfaff  <blp@gnu.org>
566
567         Finish converting struct variable to an opaque type.  In this
568         phase, we add remaining setter and getter functions, convert the
569         remaining PSPP code to use them, and do a bunch of cleanup.  The
570         resulting changes are pervasive but mostly trivial, and only the
571         notable changes are logged.
572         
573         * automake.mk (src_data_libdata_a_SOURCES): Add the new source
574         files.
575         
576         * case.c (case_data): Renamed case_data_idx.
577         (case_num): Renamed case_num_idx.
578         (case_str): Renamed case_str_idx.
579         (case_data_rw): Renamed case_data_rw_idx.
580
581         * case.h (case_data): New function with old name and an interface
582         that takes a variable instead of an index, which is easier to
583         use.  Updated all callers to use the new interface, or to use the
584         new *_idx function (see above).
585         (case_num): Ditto.
586         (case_str): Ditto.
587         (case_data_rw): Ditto.
588         
589         * category.c (cat_stored_values_destroy): Changed interface to
590         take a struct cat_vals * instead of a struct variable *.
591
592         * dictionary.c (dict_clone): Use new vector_clone function.     
593         (dict_clear) Use new var_destroy function.
594         (add_var) New function.
595         (dict_create_var) Rewrite in terms of dict_create_var_assert.
596         (dict_create_var_assert) Rewrite in terms of add_var.
597         (dict_clone_var) Rewrite in terms of dict_clone_var_assert.
598         (dict_clone_var_assert) Rewrite in terms of var_clone, add_var.
599         (dict_lookup_var) Use new var_create, var_destroy functions.
600         (dict_contains_var) Rewrite in terms of new vardict functionality.
601         (set_var_dict_index) New function.
602         (set_var_case_index) New function.
603         (reindex_vars) New function.
604         (dict_delete_var) Rewrite in terms of new vardict functionality.
605         (dict_reorder_var) Ditto.
606         (dict_reorder_vars) Ditto.
607         (rename_var) New function.
608         (dict_rename_var) Use rename_var.
609         (dict_rename_vars) Use pool to simplify code.  Use rename_var.
610         (dict_get_compacted_idx_to_fv) Rename
611         dict_get_compacted_dict_index_to_case_index, update callers.
612         (dict_create_vector) Use new vector_create function.
613         (dict_clear_vectors) Use new vector_destroy function.
614         (set_var_short_name_suffix) Move here from variable.c, renamed
615         from var_set_short_name_suffix, make static, update caller.
616
617         * sys-file-private.c: New file.  
618         (sfm_width_to_bytes) Moved here from variable.c, renamed from
619         width_to_bytes, update callers.
620
621         * sys-file-private.h: New file.  Later it will supplant
622         sfm-private.h; for now it supplements it.
623         (macro MIN_VERY_LONG_STRING) New macro.
624         (macro EFFECTIVE_LONG_STRING_LENGTH) New macro, from value.h.
625
626         * sys-file-reader.c: Use MIN_VERY_LONG_STRING - 1 where
627         MAX_LONG_STRING was used before.
628
629         * sys-file-writer.c: Ditto.
630
631         * value-labels.c: Change the paradigm here to be that a null
632         pointer is OK for a struct val_labs * in most cases; it just
633         represents an empty set of value labels.
634         (val_labs_copy) A copy of a null set is a null set.
635         (val_labs_count) A null set has 0 labels.
636         (val_labs_replace) Change return type to void.  Rewrite for
637         simplicity.
638         (val_labs_find) A null set does not contain the value.
639         (value_to_string) Moved to variable.c, renamed var_get_value_name,
640         transposed argument order, updated all callers.
641
642         * value.c: New file.
643         (value_dup) Moved here from variable.c.
644         (compare_values) Ditto.
645         (hash_value) Ditto.
646
647         * value.h: (macro MAX_SHORT_STRING) Rewrote for simplicity.
648         (macro MAX_LONG_STRING) Removed, because it was only interesting
649         for system files, not for general code.
650         (macro MAX_VERY_LONG_STRING) Ditto.
651         (macro EFFECTIVE_LONG_STRING_LENGTH) Moved to sys-file-private.h.
652         (macro MAX_ELEMS_PER_VALUE) Removed, as it was unused.
653
654         * vardict.h: New file, for an interface between variables and
655         their dictionaries.
656
657         * variable.c: A lot of functions were moved around, for better
658         organization.
659         (struct variable) Move definition here, from variable.h.
660         (var_type_adj) Removed--makes i18n hard.
661         (var_type_noun) Ditto.
662         (var_create) New function.
663         (var_clone) New function.
664         (var_destroy) New function.
665         (var_set_name) Assert that variable is not in a dictionary.
666         (compare_var_names) Rename compare_vars_by_name and fix a couple
667         of callers who thought the args were strings.
668         (hash_var_name) Rename hash_var_by_name.
669         (compare_var_ptr_names) Rename compare_var_ptrs_by_name.
670         (hash_var_ptr_name) Rename hash_var_ptr_by_name.
671         (var_is_very_long_string) Removed, because it was only interesting
672         to system file code.
673         (var_set_missing_values) Allow the argument to be the wrong width,
674         as long as we can resize it.  Simplify callers who were doing the
675         resizing themselves.
676         (var_get_value_labels) New function.
677         (var_has_value_labels) New function.
678         (var_set_value_labels) New function.
679         (alloc_value_labels) New function.
680         (var_add_value_label) New function.
681         (var_replace_value_label) New function.
682         (var_clear_value_labels) New function.
683         (var_lookup_value_label) New function.
684         (var_get_value_name) Moved here from variable.c, renamed from
685         var_get_value_name, transposed argument order, updated all
686         callers.
687         (var_to_string) Moved here, from variable-label.c.
688         (var_set_leave) New function.
689         (var_get_leave) New function.
690         (var_must_leave) New function.
691         (var_set_short_name_suffix) Moved to dictionary.c, renamed
692         set_var_short_name_suffix.
693         (var_get_dict_index) New function.
694         (var_get_case_index) New function.
695         (var_get_obs_vals) New function.
696         (var_set_obs_vals) New function.
697         (var_has_obs_vals) New function.
698         (var_get_vardict) New function.
699         (var_set_vardict) New function.
700         (var_has_vardict) New function.
701         (var_clear_vardict) New function.
702         (value_dup) Moved to value.c.
703         (compare_values) Ditto.
704         (hash_value) Ditto.
705
706         * variable.h: (enum NUMERIC) Rename VAR_NUMERIC, update all users.
707         (enum ALPHA) Rename VAR_STRING, update all users.
708
709         * vector.c: New file.
710         (struct vector) Moved here, from variable.h.
711         (check_widths) New function.
712         (vector_create) New function.
713         (vector_clone) New function.
714         (vector_destroy) New function.
715         (vector_get_name) New function.
716         (vector_get_var) New function.
717         (vector_get_var_cnt) New function.
718         (compare_vector_ptrs_by_name) New function.
719
720         * vector.h: New file.
721
722 Sun Dec 10 11:32:56 WST 2006 John Darrington <john@darrington.wattle.id.au>
723
724         * casefilter.c (casefilter_variable_missing): Avoided comparision of
725         string variables to SYSMIS.  Thanks to Ben Pfaff for reporting this
726         problem.
727
728 Sat Dec  9 07:18:03 WST 2006 John Darrington <john@darrington.wattle.id.au>
729
730         * value-labels.c (destroy_atoms): New function.
731         * value-labels.c (atom_create): Call destroy_atoms in atexit handler.
732
733 Thu Dec  7 17:38:26 2006  Ben Pfaff  <blp@gnu.org>
734
735         Thanks to Jason Stover for pointing out this problem.
736         
737         * data-out.c (output_number): Use gsl_finite from GSL, which is
738         portable, instead of isfinite, which is not.
739         (power256) Ditto.
740
741 Thu Dec  7 15:22:38 WST 2006 John Darrington <john@darrington.wattle.id.au>
742
743         * variable.c variable.h (value_dup): New function.
744
745 Mon Dec  4 22:20:17 2006  Ben Pfaff  <blp@gnu.org>
746
747         Start converting struct variable to an opaque type.  In this
748         phase, we add a bunch of setter and getter functions and convert
749         most of the PSPP code to use them.  The resulting changes are
750         pervasive but mostly trivial, and only the notable changes are
751         logged.
752         
753         * format.c (fmt_equal): New function.
754         
755         * variable.c (var_type_is_valid): New function.
756         (measure_is_valid) Moved here, from format.c.
757         (alignment_is_valid) Moved here, from format.c.
758         (var_get_name) New function.
759         (var_set_name) New function.
760         (width_to_type) New function.
761         (var_get_type) New function.
762         (var_get_width) New function.
763         (var_set_width) New function.
764         (var_is_numeric) New function.
765         (var_is_alpha) New function.
766         (var_is_short_string) New function.
767         (var_is_long_string) New function.
768         (var_is_very_long_string) New function.
769         (var_get_missing_values) New function.
770         (var_set_missing_values) New function.
771         (var_clear_missing_values) New function.
772         (var_has_missing_values) New function.
773         (var_is_value_missing) New function.
774         (var_is_num_missing) New function.
775         (var_is_str_missing) New function.
776         (var_is_value_user_missing) New function.
777         (var_is_num_user_missing) New function.
778         (var_is_str_user_missing) New function.
779         (var_is_value_system_missing) New function.
780         (var_get_print_format) New function.
781         (var_set_print_format) New function.
782         (var_get_write_format) New function.
783         (var_set_write_format) New function.
784         (var_set_both_formats) New function.
785         (var_get_label) New function.
786         (var_set_label) New function.
787         (var_clear_label) New function.
788         (var_has_label) New function.
789         (var_get_measure) New function.
790         (var_set_measure) New function.
791         (var_get_display_width) New function.
792         (var_set_display_width) New function.
793         (var_get_alignment) New function.
794         (var_set_alignment) New function.
795         (var_get_value_cnt) New function.
796         (var_get_leave) New function.
797         (var_get_short_name) New function.
798
799         * variable.h: (struct variable) Removed "type" and "nv" members;
800         they are now computed from "width" where needed.
801
802 Mon Dec  4 21:38:40 2006  Ben Pfaff  <blp@gnu.org>
803
804         * missing-values.c (mv_resize): Don't write beyond end of the
805         allocated buffer when resizing a long string.
806
807 Sat Dec  2 16:28:32 2006  Ben Pfaff  <blp@gnu.org>
808
809         Clean up identifier code: don't require identifier enumerations to
810         be in a particular order; make better use of string library;
811         expose less of the internals.
812                 
813         * identifier.c: (lex_skip_identifier) Rename lex_id_get_length,
814         change interface.  Updated all callers.
815         (lex_id_match) Change interface to use struct substring, update
816         all callers.
817         (lex_id_match_len) Removed.  Update callers to use lex_id_match.
818         (global array keywords[]) Make static, change form.  Update all
819         users to use lex_id_name instead.
820         (lex_is_keyword) New function.
821         (lex_id_to_token) Change interface to use struct substring, update
822         all callers.
823         (lex_id_name) New function.
824
825         * identifier.h: (T_FIRST_KEYWORD) Removed.  Changed users to call
826         lex_is_keyword instead.
827         (T_LAST_KEYWORD) Removed.
828         (T_N_KEYWORDS) Removed.
829         
830 Sat Nov 18 20:46:35 2006  Ben Pfaff  <blp@gnu.org>
831
832         * format.c: (fmt_date_template) Distinguish characters for which a
833         space is output and any date delimiter is allowed on input, from
834         those for which a space is output and only a space is allowed on
835         input.  The former is represented by X, the latter by a space.
836         Also, drop distinction between h and H, changing the former to the
837         latter.
838
839         * data-in.c: Completely rewrite internals to conform to SPSS input
840         formats as closely as possible.
841         (data_in) Changed external interface by replacing the structure
842         that was used as a single argument by a set of arguments.  Updated
843         all callers.
844         (data_in_finite_line) Removed.  Converted all callers to use plain
845         data_in.
846         (data_in_get_integer_format) New function.
847         (data_in_set_integer_format) New function.
848         (data_in_get_float_format) New function.
849         (data_in_set_float_format) New function.
850
851         * data-in.h: (enums DI_IGNORE_ERROR, DI_IMPLIED_DECIMALS) Removed.
852         (struct data_in) Removed.
853
854         * data-out.c: (output_date) Drop each component from the input as
855         it is output, to allow us to drop the distinction between h (a
856         count of hours) and H (the hour of day) template characters.
857         Also, handle new X template character.
858         (output_scientific) Follow more rational rule on when to drop
859         fraction introduced between SPSS 13 and 15.  Updated test case to
860         match new behavior.
861
862 Sat Nov 11 11:41:26 2006  Ben Pfaff  <blp@gnu.org>
863
864         Fix buffer overflow reported by John Darrington.
865
866         * data-out.c (output_bcd_integer): In case of SYSMIS, etc.,
867         realize that DIGITS is a count of nibbles, not of bytes.
868
869 Sat Nov  4 15:59:56 2006  Ben Pfaff  <blp@gnu.org>
870
871         * calendar.c (calendar_offset_to_gregorian) Also return the
872         year-of-day.  Change callers to new interface.
873
874         * data-out.c: Completely rewrite internals to conform to SPSS
875         output formats as completely as possible.
876         (data_out) Change interface to put input parameters before output
877         parameters, for consistency with the style I now prefer.  Update
878         all callers.
879         (data_out_get_integer_format) New public function.
880         (data_out_set_integer_format) New public function.
881         (data_out_get_float_format) New public function.
882         (data_out_set_float_format) New public function.
883
884         * data-out.h: New file.  Move prototype for data_out here, from
885         format.h.
886
887         * format.c: (fmt_step_width) Use equality comparison instead of
888         bitwise and, for clarity.
889         (fmt_is_string) Ditto.
890         (fmt_input_to_output) Fix categories that are translated to F
891         format.
892
893 Sun Nov  5 08:29:34 WST 2006 John Darrington <john@darrington.wattle.id.au>
894
895         * casefilter.c casefilter.h (new files), casefile.c casefile.h 
896         casefile-private.h: Added casefilter to assist commands with missing 
897         values.
898
899 Sat Nov  4 11:47:09 2006  Ben Pfaff  <blp@gnu.org>
900
901         Implement SET ERRORS, SHOW ERRORS.  Fixes bug #17609.
902         
903         * settings.c: (route_errors_to_terminal) New variable.
904         (route_errors_to_listing) New variable. 
905         (get_error_routing_to_terminal) New function.
906         (set_error_routing_to_terminal) New function.
907         (get_error_routing_to_listing) New function.
908         (set_error_routing_to_listing) New function.
909
910         * settings.h: (SET_ROUTE_* enums) Removed, because unused.
911
912 Tue Oct 31 19:58:27 2006  Ben Pfaff  <blp@gnu.org>
913
914         * format.c: Completely rewrite, to achieve better abstraction.
915         Rewrite all references to formats in other files.
916         
917         * format.def: Rewrite and reorganize.
918
919         * settings.c: Move everything related to custom currency formats
920         into format.[ch], changing them in form, so as to group related
921         code and definitions better.  Changed all references to use the
922         new functions.
923         (static var decimal) Removed.
924         (static var grouping) Removed.
925         (static var cc) Removed.
926         (get_decimal) Removed.
927         (set_decimal) Removed.
928         (get_grouping) Removed.
929         (set_grouping) Removed.
930         (get_cc) Removed.
931         (set_cc) Removed.
932
933         * settings.h: (macro CC_CNT) Removed.
934         (macro CC_WIDTH) Removed.
935         (struct custom_currency) Removed.
936
937 Tue Oct 31 19:56:19 2006  Ben Pfaff  <blp@gnu.org>
938
939         * data-in.c (data_in): Use switch statement instead of table, to
940         avoid dependence on the order of the FMT_* enums.
941
942 Tue Oct 31 19:35:36 2006  Ben Pfaff  <blp@gnu.org>
943
944         * data-out.c: (num_to_string) Removed, because it was dead code.
945
946 Tue Oct 31 18:09:24 2006  Ben Pfaff  <blp@gnu.org>
947
948         * data-in.c (parse_trailer): Fix error message.
949
950 Sat Oct 28 11:56:50 2006  Ben Pfaff  <blp@gnu.org>
951
952         * format.c (fmt_is_binary): New function.
953
954 Thu Oct 19 22:59:56 WST 2006 John Darrington <john@darrington.wattle.id.au>
955
956         * procedure.c procedure.h: Encapsulated the static data into a single
957         struct.  
958
959 Sat Oct 14 16:56:44 2006  Ben Pfaff  <blp@gnu.org>
960
961         * casefile.c (casereader_read_xfer): Always initialize the case,
962         even on an error condition.
963
964 Wed Sep 27 09:37:49 WST 2006 John Darrington <john@darrington.wattle.id.au>
965
966         * procedure.c (case_limit_trns_proc): Fixed buglet which rendered the 
967         entire function useless.
968
969 Mon Sep 25 17:11:46 WST 2006 John Darrington <john@darrington.wattle.id.au>
970
971         * casefile-private.h casefile.c casefile.h fastfile.c: Created new
972         casereader method casereader_clone.   
973         
974         * procedure.c pransformations.h: Introduced new type casenum_t
975
976 Thu Sep 21 07:00:30 2006  Ben Pfaff  <blp@gnu.org>
977
978         * variable.c: (width_to_bytes) Rephrase code for clarify.
979
980 Sun Jul 16 19:52:03 2006  Ben Pfaff  <blp@gnu.org>
981
982         * format.c: (fmt_type_from_string) New function.
983         (fmt_to_string) Include decimals in output if the format has
984         decimals, even if the format type does not.  This way, we can
985         accurately reproduce incorrect formats in user output.
986         (check_common_specifier) Make the check for a bad format type an
987         assertion, so we get bug reports if they show up.  Fix message.
988         Check for decimal places with a format type that doesn't allow
989         them.
990         (check_input_specifier) Remove check for FMT_X, which has been
991         deleted.
992         (check_output_specifier) Ditto. 
993
994         * format.def: Remove FMT_T, FMT_X, FMT_DESCEND, FMT_NEWREC.
995
996         * format.h: (macro FMT_TYPE_LEN_MAX) New macro.
997         (struct fmt_desc) Use FMT_TYPE_LEN_MAX in definition.
998         (enum fmt_parse_flags) Removed.
999
1000 Mon Jul 17 18:26:21 WST 2006 John Darrington <john@darrington.wattle.id.au>
1001
1002         * casefile.c casefile.h: Converted to  an abstract base class.
1003         * casefile-private.h fastfile.c fastfile.h: New files.
1004         * automake.mk procedure.c scratch-writer.c storage-stream.c
1005
1006 Wed Jul 12 21:02:26 2006  Ben Pfaff  <blp@gnu.org>
1007
1008         * procedure.c (internal_procedure): Create sink_case with only as
1009         many values as the compacted dictionary.
1010
1011 Wed Jul 12 21:01:00 2006  Ben Pfaff  <blp@gnu.org>
1012
1013         Remove "debugging" code that caused plenty of false positives and
1014         no true positives.
1015         
1016         * case.h (struct ccase): [DEBUGGING] Remove `this' member.
1017
1018         * case.c: Remove all references to `this' member.
1019
1020 Thu Jul  6 19:09:53 2006  Ben Pfaff  <blp@gnu.org>
1021
1022         Fix link error noted by Jason Stover.
1023         
1024         * storage-stream.c: Include <assert.h>.
1025
1026 Tue Jul  4 08:47:35 2006  Ben Pfaff  <blp@gnu.org>
1027
1028         Fix bug #15766 (/KEEP subcommand on SAVE doesn't fully support
1029         ALL) and additional underlying system file issues.
1030
1031         Thanks to John Darrington for review.
1032
1033         First problem: var_hash points to variables not owned by the
1034         sys-file-reader, which the caller may free or modify.  Use an
1035         array of sfm_vars instead, as done earlier (e.g. CVS version
1036         1.12).
1037         
1038         * sys-file-reader.c (struct sfm_reader): Remove var_hash, svars
1039         members and remove all code that references it.  Add vars, var_cnt
1040         members.  Remove fix_specials member, which was unused.
1041         (struct sfm_var) Remove name member, which was unused.
1042         (sfm_close_reader) Free vars member instead of var_hash.
1043         (compare_var_shortnames) Removed.
1044         (hash_var_shortname) Removed.
1045         (sfm_open_reader) Fill out vars array.
1046         (compare_var_index) Removed.
1047         (sfm_read_case) Use vars instead of var_hash.
1048         
1049         Second problem: we're confused about when we actually have very
1050         long strings, causing us to choose incorrectly between slow path
1051         and fast path in sfm_read_case.
1052
1053         * sys-file-reader.c: (sfm_open_reader) Only mark has_vls if we
1054         have very long strings, not when we have long variable names,
1055         which is an unrelated feature.
1056
1057 Tue Jun 27 12:06:49 2006  Ben Pfaff  <blp@gnu.org>
1058
1059         * variable.h: Move var_set and variable parsing declarations to
1060         new header, src/language/lexer/variable-parser.h.  Modified lots
1061         of files to include the new header.
1062
1063 Sun Jun 25 22:39:32 2006  Ben Pfaff  <blp@gnu.org>
1064
1065         * value-labels.c (value_to_string): When there's no value label,
1066         format the variable according to its print format, instead of
1067         always effectively using A or F format.
1068
1069 Mon Jun 19 18:05:42 WST 2006 John Darrington <john@darrington.wattle.id.au>
1070
1071         * casefile.c (casefile_get_random_reader): Nasty hack to get around 
1072         the mode assertion.
1073
1074         * format.c: Removed tortological assertion.
1075
1076 Fri Jun  9 12:20:09 2006  Ben Pfaff  <blp@gnu.org>
1077
1078         Reform string library.
1079         
1080         * file-name.c (fn_interp_vars): Change interface to take a
1081         substring as input.  Updated all users.
1082         
1083 Fri Jun  9 12:11:24 2006  Ben Pfaff  <blp@gnu.org>
1084
1085         * format.c (measure_is_valid): Really return false when m >=
1086         n_MEASURES.
1087
1088 Tue Jun  6 18:46:26 2006  Ben Pfaff  <blp@gnu.org>
1089
1090         Implement random access to casefiles, for use in GUI.
1091         
1092         * casefile.c: (struct casereader) Add `random', `file_ofs',
1093         `buffer_ofs' members.
1094         (casefile_get_random_reader) New function.
1095         (read_open_file) Break part into new function
1096         seek_and_fill_buffer().
1097         (fill_buffer) Update buffer_ofs, file_ofs.
1098         (casereader_seek) New function.
1099
1100 Tue May 30 19:52:33 WST 2006 John Darrington <john@darrington.wattle.id.au>
1101
1102         * settings.c: Added call to i18n{done, init}.
1103
1104 Tue May  9 21:09:17 2006  Ben Pfaff  <blp@gnu.org>
1105
1106         * procedure.h: Add WARN_UNUSED_RESULT to procedure function
1107         prototypes.
1108
1109 Tue May  9 21:08:05 2006  Ben Pfaff  <blp@gnu.org>
1110
1111         * casefile.c: Convert many uses of `int' to `bool'.
1112
1113 Sat May  6 22:49:43 2006  Ben Pfaff  <blp@gnu.org>
1114
1115         * transformations.c (trns_chain_destroy): Destroy chain's trns
1116         member, to fix memory leak.
1117
1118 Sat May  6 22:48:30 2006  Ben Pfaff  <blp@gnu.org>
1119
1120         * storage-stream.c (storage_source_decapsulate): Destroy case
1121         source to fix memory leak.
1122
1123 Sat May  6 22:46:47 2006  Ben Pfaff  <blp@gnu.org>
1124
1125         * scratch-reader.c (scratch_reader_read_case): Copy into existing
1126         case passed as argument instead of initializing the argument as a
1127         case.  Fixes memory leak that showed up in
1128         tests/command/aggregate.sh with scratch files.
1129
1130 Sat May  6 22:45:55 2006  Ben Pfaff  <blp@gnu.org>
1131
1132         * procedure.c (proc_done): Destroy default_dict, to fix memory
1133         leak.
1134
1135 Sat May  6 22:44:44 2006  Ben Pfaff  <blp@gnu.org>
1136
1137         Simplify procedure_with_splits().
1138         
1139         * procedure.c (struct split_aux_data): Removed case_count member.
1140         (procedure_with_splits) Don't initialize case_count.
1141         (split_procedure_case_func) Check whether prev_case is null
1142         instead of case_count.
1143         (split_procedure_end_func) Ditto.
1144
1145 Sat May  6 22:42:23 2006  Ben Pfaff  <blp@gnu.org>
1146
1147         * case.c (case_move): Do nothing if dst and src are the same
1148         object.
1149         (case_try_create) Merge two similar cases.
1150         (case_copy) Unshare only if data must be actually copied.
1151
1152 Sun May  7 10:04:06 WST 2006 John Darrington <john@darrington.wattle.id.au>
1153
1154         * data-in.c data-out.c dictionary.c sys-file-reader.c
1155         sys-file-writer.c variable.c variable.h:  Reworked very long string
1156         support for better encapsulation.
1157
1158 Sat May  6 19:02:00 2006  Ben Pfaff  <blp@gnu.org>
1159
1160         * value-labels.c (val_labs_can_set_width): New function.
1161         (val_labs_set_width) Clear labels if increasing width to long
1162         string.
1163         (val_labs_destroy) Remove unneeded test for null.
1164         
1165 Sat May  6 16:14:08 2006  Ben Pfaff  <blp@gnu.org>
1166
1167         * value-labels.h: Remove unneeded dependency on variable.h.
1168
1169 Sat May  6 15:58:36 2006  Ben Pfaff  <blp@gnu.org>
1170
1171         Get rid of `char *c' member in union value, for cleanliness.
1172         
1173         * value.h: (union value) Remove `c' member.
1174
1175 Sat May  6 15:36:59 2006  Ben Pfaff  <blp@gnu.org>
1176
1177         Make dictionary compacting functions a little more general.
1178         
1179         * sys-file-writer.c (sfm_open_writer): Use
1180         dict_compacting_would_change().
1181         (does_dict_need_translation) Removed.
1182
1183 Sat May  6 15:35:42 2006  Ben Pfaff  <blp@gnu.org>
1184
1185         Make dictionary compacting functions a little more general.
1186         
1187         * dictionary.c (dict_needs_compaction): Rename
1188         dict_compacting_would_shrink().  Update all callers.
1189         (dict_compacting_would_change) New function.
1190         
1191 Sat May  6 14:25:49 2006  Ben Pfaff  <blp@gnu.org>
1192
1193         * sys-file-writer.c: (does_dict_need_translation) Fix bug:
1194         inverted return value (!).
1195
1196 Sat May  6 13:37:52 2006  Ben Pfaff  <blp@gnu.org>
1197
1198         Continue reforming procedure execution.  
1199
1200         * procedure.c: Search and replace "vfm" by "proc".  Notably:
1201         (static var vfm_source) Rename proc_source.  Update all
1202         references.
1203         (static var vfm_sink) Rename proc_sink.  Update all references.
1204         
1205 Sat May  6 12:38:55 2006  Ben Pfaff  <blp@gnu.org>
1206
1207         Continue reforming procedure execution.  In this phase, remove
1208         PROCESS IF, which was deprecated anyway and can be easily
1209         simulated with TEMPORARY followed by SELECT IF.
1210
1211         * procedure.c: (open_active_file) Don't call
1212         add_process_if_trns().
1213         (discard_variables) Get rid of redundant call to
1214         proc_cancel_all_transformations().
1215         (add_process_if_trns) Removed.
1216         (process_if_trns_proc) Removed.
1217         (process_if_trns_free) Removed.
1218
1219 Sat May  6 10:58:05 2006  Ben Pfaff  <blp@gnu.org>
1220
1221         Continue reforming procedure execution.  In this phase, add
1222         `const' to the case passed to procedure()'s callback.
1223
1224         Updated all users of procedure() as well.
1225         
1226         * procedure.c: (struct write_case_data) Add "const" to ccase
1227         parameter for case_func member.
1228         (procedure) Add "const" to ccase parameter for proc_func
1229         parameter.
1230         (multipass_case_func) Make ccase parameter const.
1231         (internal_procedure) Add "const" to ccase parameter for case_func
1232         parameter.
1233         (split_procedure_case_func) Make ccase parameter const.
1234         (multipass_split_case_func) Make ccase parameter const.
1235         
1236 Sat May  6 10:30:33 2006  Ben Pfaff  <blp@gnu.org>
1237
1238         Continue reforming procedure execution.  In this phase, get rid of
1239         the output code for SPLIT FILE groups in procedure.c, which really
1240         shouldn't be doing any output.  Move it into the individual
1241         procedures instead.  This also adds some flexibility.
1242
1243         Updated many users of procedure_with_splits() and
1244         multipass_procedure_with_splits() to call
1245         output_split_file_values() and to deal with increased use of
1246         const.
1247
1248         * procedure.c: (struct split_aux_data) Add "const struct ccase *"
1249         parameter to begin_func member.
1250         (procedure_with_splits) Add "const struct ccase *" parameter to
1251         begin_func parameter.  Make ccase parameter const in proc_func
1252         parameter.
1253         (split_procedure_case_func) Don't dump split file group.  Pass
1254         case to begin_func.
1255         (dump_splits) Moved to language/dictionary/split-file.c as
1256         output_split_file_values().
1257         (struct multipass_split_aux_data) Add "const struct ccase *"
1258         parameter to split_func member.
1259         (multipass_procedure_with_splits) Add "const struct ccase *"
1260         parameter to split_func parameter.
1261         (multipass_split_case_func) Save new SPLIT FILE case before
1262         outputting case.
1263         (multipass_split_output) Pass saved SPLIT FILE case to split_func.
1264         
1265 Fri May  5 22:48:50 2006  Ben Pfaff  <blp@gnu.org>
1266
1267         Continue reforming procedure execution.  Change
1268         internal_procedure() so that it calls open_active_file() and
1269         close_active_file(), which isolates most of the actual procedure
1270         functionality.
1271
1272         * procedure.c: (struct write_case_data) Rename `proc_func' member
1273         to `case_func' and update all references.
1274         (procedure) Rewrite as one-line wrapper around
1275         internal_procedure().
1276         (struct multipass_aux_data) New.
1277         (multipass_callback) Renamed multipass_case_func().  Use struct
1278         multipass_aux_data as auxiliary data.
1279         (multipass_end_func) New function.
1280         (multipass_procedure) Rewrite as wrapper for internal_procedure()
1281         that uses multipass_case_func, multipass_end_func.
1282         (internal_procedure) Add `end_func' argument.  Move optimization
1283         of trivial case in here.  Move call to open_active_file() and
1284         close_active_file() in here.  Now assert that vfm_source is
1285         non-null.
1286         (procedure_with_splits_callback) Rename
1287         split_procedure_case_func().
1288         (split_procedure_end_func) New function.
1289         (multipass_split_callback) Rename multipass_split_case_func.
1290         (multipass_split_end_func) New function.
1291         (discard_variables) No need to test for nonnull vfm_source.
1292
1293 Fri May  5 21:34:02 2006  Ben Pfaff  <blp@gnu.org>
1294
1295         Continue reforming procedure execution.  Get rid of unused member.
1296
1297         * procedure.c: (struct write_case_data) Remove `cases_analyzed'
1298         member.
1299         (write_case) Don't increment cases_analyzed.
1300
1301 Thu May  4 21:50:11 2006  Ben Pfaff  <blp@gnu.org>
1302
1303         Continue reforming procedure execution.  In this phase, move
1304         procedure.c and procedure.h from src to src/data.  Update
1305         makefiles and #includes accordingly.
1306
1307         * procedure.c: Moved here from src/.
1308
1309         * procedure.h: Moved here from src/.
1310
1311 Wed May  3 22:42:12 2006  Ben Pfaff  <blp@gnu.org>
1312
1313         Continue reforming procedure execution.  In this phase, get rid of
1314         many global variables, consolidating procedure execution in
1315         procedure.c.  Encapsulate transformations in new "struct
1316         trns_chain".  Also, change implementation of N OF CASES, FILTER,
1317         and PROCESS IF from special cases to transformations.
1318          
1319         * automake.mk: (src_data_libdata_a_SOURCES) Add transformations.c,
1320         transformations.h.
1321
1322         * dictionary.c: (global variable default_dict) Move to
1323         src/procedure.c.
1324
1325         * variable.h: (TRNS_*) Move to transformations.h.
1326         (struct transformation) Move to transformations.c.
1327
1328 Thu May  4 13:47:06 WST 2006 John Darrington <john@darrington.wattle.id.au>
1329
1330         * sys-file-reader.c: Fixed invalid read problems.
1331
1332 Tue May  2 15:57:10 2006  Ben Pfaff  <blp@gnu.org>
1333
1334         * storage-stream.c: Add missing function comments.
1335
1336 Tue May  2 15:50:21 2006  Ben Pfaff  <blp@gnu.org>
1337
1338         Continue reforming procedure execution.  In this phase, add some
1339         new, needed functionality to storage-stream.
1340
1341         * storage-stream.c: (storage_source_decapsulate) New function.
1342
1343 Tue May  2 15:43:36 2006  Ben Pfaff  <blp@gnu.org>
1344
1345         * variable.c (width_to_bytes): Declarations must precede
1346         statements for C90 compliance.
1347
1348 Tue May  2 10:42:05 WST 2006 John Darrington <john@darrington.wattle.id.au>
1349
1350         * data-out.c, data-in.c, variable.c, variable.h: New functions 
1351         copy_mangle and copy_demangle for reading/writing cases; emulates the 
1352         way SPSS deals with strings > 255 bytes.
1353
1354         * sys-file-reader.c sys-file-writer.c: Added support for Record 7, 
1355         subtype 14 needed for strings longer than 255 bytes.
1356
1357         * dictionary.c, format.def, value.c : Updated to use MAX_STRING 
1358         instead of literal values. Also fixed some constness issues.
1359
1360         * format.h: Constness
1361
1362         * sfm-private.h: Renamed the case_size identifier, since I discovered 
1363         that SPSS's respect for this variable is very nominal.
1364
1365 Mon May  1 15:45:42 2006  Ben Pfaff  <blp@gnu.org>
1366
1367         Change case limit type from int to size_t.
1368
1369         * dictionary.c: (struct dictionary) Change type of case_limit
1370         member.
1371         (dict_get_case_limit) Change return type.
1372         (dict_set_case_limit) Change parameter type.
1373
1374 Wed Apr 26 20:01:19 2006  Ben Pfaff  <blp@gnu.org>
1375
1376         * variable.h: (struct variable) Rename `reinit' member as `leave'
1377         and invert sense.  Fix up all references.
1378
1379 Wed Apr 26 19:39:28 2006  Ben Pfaff  <blp@gnu.org>
1380
1381         Continue reforming procedure execution.  In this phase, break
1382         procedure.c into multiple files.
1383         
1384         * automake.mk: (src_data_libdata_a_SOURCES) Add all the new files.
1385
1386         * case-sink.c: New file.
1387
1388         * case-sink.h: New file.
1389         
1390         * case-source.c: New file.
1391
1392         * case-source.h: New file.
1393         
1394         * storage-stream.c: New file.
1395
1396         * storage-stream.h: New file.
1397
1398 Wed Apr 26 14:55:19 2006  Ben Pfaff  <blp@gnu.org>
1399
1400         * variable.h: (struct variable) Remove `init' member and all
1401         references to it from other files.  It was initialized in several
1402         places, but nothing really ever used it for anything worthwhile.
1403         Thanks to Jason Stover for pointing out how confusing this
1404         member is.
1405
1406 Sun Apr 23 22:04:45 2006  Ben Pfaff  <blp@gnu.org>
1407
1408         Continue reforming error message support.  In this phase, get rid
1409         of message "titles" and put the message text in `struct error'.
1410         Now `struct error' encapsulates a message more properly.
1411         
1412         * casefile.c: (io_error) Use err_msg() instead of err_vmsg().
1413         Format message ourselves.
1414
1415         * data-in.c: (vdls_error) Ditto.
1416
1417         * por-file-reader.c: (error) Ditto.
1418
1419         * sys-file-reader.c: (corrupt_msg) Ditto.
1420
1421 Sun Apr 16 18:49:51 2006  Ben Pfaff  <blp@gnu.org>
1422
1423         GNU standards require "file name" instead of "filename" in
1424         documentation.  It's nice for our code to follow the convention
1425         too.
1426         
1427         * casefile.c: (struct casefile) Rename `filename' member to
1428         `file_name'.  Updated all references.
1429
1430         * file-name.c: [!unix] (struct file_identity) Rename
1431         normalized_filename member to normalized_file_name.  Updated all
1432         references.
1433
1434 Sun Apr 16 18:35:33 2006  Ben Pfaff  <blp@gnu.org>
1435
1436         We don't really support anything but Unix-like environments well,
1437         so we might as well de-obfuscate by writing directory and path
1438         separators explicitly.
1439
1440         * file-name.h: (macro DIR_SEPARATOR) Removed.  Changed all usages
1441         to just '/'.
1442         (macro PATH_SEPARATOR) Removed.  Changed all usages to just ':'.
1443         (macro DIR_SEPARATOR_STRING) Removed.  Changed all usages to just
1444         "/".
1445         (macro PATH_SEPARATOR_STRING) Removed.  Changed all usages to just
1446         ":"
1447
1448 Sun Apr 16 18:28:35 2006  Ben Pfaff  <blp@gnu.org>
1449
1450         GNU standards require "file name" instead of "filename" in
1451         documentation.  It's nice for our code to follow the convention
1452         too.
1453         
1454         * filename.c: Rename to file-name.c.
1455
1456         * filename.h: Rename to file-name.h.  Update all inclusions.
1457         Update header guards.
1458
1459         * automake.mk: Update file names.
1460
1461 Sun Apr 16 16:42:47 2006  Ben Pfaff  <blp@gnu.org>
1462
1463         * filename.c: (fn_dirname) Renamed fn_dir_name(), all references
1464         updated.
1465         (fn_basename) Removed (dead code).
1466         (fn_absolute_p) Renamed fn_is_absolute(), all references updated.
1467         (fn_special_p) Renamed fn_is_special(), all references updated.
1468         (fn_exists_p) Renamed fn_exists(), all references updated.
1469
1470 Sun Apr 16 16:33:58 2006  Ben Pfaff  <blp@gnu.org>
1471
1472         * filename.c: (fn_tilde_expand) Rewrite for cleaner code.  
1473         Also, now it only tilde-expands file names, not paths.
1474         (fn_search_path) Tilde-expand one directory at a time.
1475
1476 Sun Apr 16 16:28:06 2006  Ben Pfaff  <blp@gnu.org>
1477
1478         * filename.c: (fn_search_path) rewrite for cleaner code.  Also,
1479         get rid of non-Unixlike version of the code, which has probably
1480         never been tested.
1481         (fn_prepend_dir) Removed (dead code).
1482
1483         * filename.h: (macro DIR_SEPARATOR_STRING) New.
1484         (macro PATH_SEPARATOR_STRING) New.
1485 Sun Apr 16 16:05:28 2006  Ben Pfaff  <blp@gnu.org>
1486
1487         Continue reforming error message support.  In this phase, we get
1488         rid of VM() and the other msg() support for "verbosity", replacing
1489         it by a new function verbose_msg().
1490
1491         * filename.c: (fn_search_path) Use verbose_msg() instead of
1492         msg(VM(), ...).  
1493
1494 Sat Apr 15 19:53:19 2006  Ben Pfaff  <blp@gnu.org>
1495
1496         * sfm-private.h: Get rid of #defines after #error, which makes no
1497         sense.
1498
1499 Sat Apr 15 19:48:57 2006  Ben Pfaff  <blp@gnu.org>
1500
1501         Get rid of our own int32 type in favor of the standard int32_t
1502         type.
1503         
1504         * sfm-private.h: (int32 macro) Don't define this anymore.  Do
1505         include <stdint.h>.
1506
1507         * sys-file-reader.c: Use int32_t instead of int32 throughout.
1508         
1509         * sys-file-writer.c: Use int32_t instead of int32 throughout.
1510
1511 Sat Apr 15 19:36:47 2006  Ben Pfaff  <blp@gnu.org>
1512
1513         Remove ill-considered file routines that are no longer used.
1514         
1515         * filename.c: (fn_open_ext) Removed.
1516         (fn_close_ext) Removed.
1517
1518         * filename.h: (struct file_ext) Removed.
1519
1520 Mon Apr  3 13:22:39 2006  Ben Pfaff  <blp@gnu.org>
1521
1522         * variable.c (var_is_valid_name): Move declarations before code
1523         for C90 compliance.
1524
1525 Tue Apr  4 15:28:40 WST 2006 John Darrington <john@darrington.wattle.id.au>
1526
1527         * filename.ch (fn_interp_vars): Fixed small buglet.
1528
1529 Tue Mar 28 13:47:16 WST 2006 John Darrington <john@darrington.wattle.id.au>
1530         
1531         * filename.[ch] (fn_interp_vars): Changed the signature and semantics
1532         so as to modify the string inline.   Thus makeing it easier to
1533         destroy the results when no longer needed.
1534         
1535 2006-03-25  Jason Stover  <jhs@math.gcsu.edu>
1536
1537         * category.c (cat_stored_values_destroy): Fixed memory leak.
1538
1539 Fri Mar 24 18:15:41 2006  Ben Pfaff  <blp@gnu.org>
1540
1541         Add some missing frees.  Thanks to John Darrington for reporting
1542         these.
1543
1544         * any-writer.c (any_writer_close): Free writer.
1545
1546         * any-reader.c (any_reader_close): Free reader.
1547
1548 Mon Mar 20 16:33:53 2006  Ben Pfaff  <blp@gnu.org>
1549
1550         * por-file-reader.c: (error) Mark as NO_RETURN.
1551
1552 Sat Mar 11 15:06:07 WST 2006 John Darrington <john@darrington.wattle.id.au>
1553
1554         * settings.c: Changed default value of scompress to true.
1555
1556 Sat Mar  4 13:22:51 2006  Ben Pfaff  <blp@gnu.org>
1557
1558         * sfm-private.h: Include variable.h, to get SHORT_NAME_LEN.
1559
1560         * value.h: Remove check on MAX_SHORT_STRING, which I don't think
1561         really applies.
1562
1563         * variable.h: Move definition of SHORT_NAME_LEN, LONG_NAME_LEN
1564         here from pref.h.orig.
1565
1566 Sat Mar  4 12:50:48 WST 2006 John Darrington <john@darrington.wattle.id.au>
1567
1568         * sys-file-reader.c: Fixed bug reading compressed files.
1569
1570 Thu Mar  2 08:40:33 WST 2006 John Darrington <john@darrington.wattle.id.au>
1571
1572         * Numerous renames.  See src/ChangeLog for details.
1573         
1574         * Moved files from src directory