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