1 2008-01-19 John Darrington <john@darrington.wattle.id.au>
3 * settings.c settings.h: Moved static variables into a
4 single struct. Renamed functions to have a settings_ prefix.
6 2008-01-14 John Darrington <john@darrington.wattle.id.au>
8 * data-out.c (output_AHEX): Corrected number of bytes in
9 call to output_hex. Closes bug #22011
11 2008-01-02 John Darrington <john@darrington.wattle.id.au>
13 * variable.c variable.h: Replaced var_get_value_name with
14 var_append_value_name which doesn't use any static data.
15 Thanks to Ben for review.
17 2007-12-07 Ben Pfaff <blp@gnu.org>
21 * casegrouper.c (casegrouper_get_next_group): Cause a casegrouper
22 made from an empty casereader produce a casegrouper with no
23 groups, instead of one with one group that has no cases.
25 * casereader.c (casereader_is_empty): New function.
27 2007-12-06 Ben Pfaff <blp@gnu.org>
31 * sys-file-reader.c (read_display_parameters): Handle variable
32 display parameters record with only 2 data items per variable.
33 Reported by Guido Gay <gay@irer.it>.
35 2007-12-04 Ben Pfaff <blp@gnu.org>
37 * identifier.c (lex_id_match_n): New function.
38 (lex_id_match): Reimplement in terms of lex_id_match_n.
40 2007-11-24 Ben Pfaff <blp@gnu.org>
42 * automake.mk (src_data_libdata_a_SOURCES): Add val-type.h, to fix
45 2007-11-24 Ben Pfaff <blp@gnu.org>
47 Fix warning reported when reading back system files that include
48 very long string variables. Thanks to Guido Gay <gay@irer.it> for
51 * short-names.c (short_names_assign): Fix dumb typo, in which `i'
52 was written where `j' was meant.
54 2007-11-18 Ben Pfaff <blp@gnu.org>
56 Properly write variables that include a range of missing values to
57 system files. Thanks to Guido Gay <gay@irer.it> for reporting
60 * sys-file-writer.c (write_variable): Correctly calculate
61 n_missing_values field when writing variables that include a range
64 2007-11-10 Ben Pfaff <blp@gnu.org>
66 Cleanups and bug fixes devised while writing up documentation.
69 * automake.mk (src_data_libdata_a_SOURCES): Add new files.
71 * dict-class.c: New file.
72 (dict_class_from_id): Move here.
73 (dict_class_to_name): Move here.
75 * dict-class.h: New file.
76 (enum dict_class): Move here. Change from consecutive integers to
77 consecutive bits, to make testing for any of multiple values
78 easier. Add new DC_ALL constant.
80 * dictionary.c (struct dictionary): Change `case_limit' from
82 (dict_get_vars): Make final argument an enum dict_class.
83 (dict_get_vars_mutable): Ditto.
84 (dict_get_case_limit): Change return value to casenumber.
85 (dict_set_case_limit): Change final argument to a casenumber.
86 (dict_unset_split_var): Add assertion. Rephrase slightly.
87 (dict_set_label): Use xstrndup to simplify.
89 * format.c (fmt_step_width): AHEX format also needs 2-byte
91 (fmt_set_style): Simplify assertions.
93 * missing-values.c (mv_add_num_range): Rename mv_add_range.
94 Simplify implementation.
95 (mv_has_value): Simplify implementation.
96 (mv_pop_value): Remove the first value, not the last, to avoid
97 having GET followed by SAVE reverse the order of missing values.
98 (mv_peek_value): Rename mv_get_value. Simplify assertion.
99 (mv_has_range): Simplify implementation.
100 (mv_peek_range): Rename mv_get_range.
101 (can_resize_string): Removed.
102 (mv_is_resizable): Use value_is_resizable.
103 (mv_resize): Use value_resize.
105 * short-names.h (SHORT_NAME_LEN): Move here.
107 * val-type.h: New file, for definitions related to type and width
108 of abstract values. Before, these definitions were mixed among
109 those related to "union value" and those related to variables.
110 (macro SYSMIS): Move here.
111 (macro LOWEST): Move here.
112 (macro HIGHEST): Move here.
113 (macro MAX_STRING); Move here.
114 (enum val_type): New enum with values VAL_NUMERIC and VAL_STRING.
115 Replaces enum var_type that had values VAR_NUMERIC and VAR_STRING.
116 All references updated.
117 (val_type_is_valid): New function. Replaces var_type_is_valid.
118 All references updated.
119 (val_type_from_width): New function. Replaces
120 var_type_from_width. All references updated.
122 * value-labels.c (val_labs_copy): Renamed val_labs_clone. All
124 (val_labs_can_set_width): Use value_is_resizable.
125 (val_labs_add): Simply return false if the value labels set is too
126 wide, instead of having undefined behavior.
127 (val_labs_replace): Ditto.
128 (val_labs_replace): Ditto.
129 (val_labs_first): Set iterator to null if iteration is complete.
130 (val_labs_first_sorted): Ditto.
131 (val_labs_done): Become a no-op if the iterator is null.
133 * value.c (value_is_resizable): New function.
134 (value_resize): New function.
136 * variable.c (var_get_dict_class): New function.
138 * variable.h (macro LONG_NAME_LEN): Rename VAR_NAME_LEN. Update
141 2007-11-08 Ben Pfaff <blp@gnu.org>
143 * data-in.c: Make formatted data parsing locale-independent.
144 (parse_number): Use c_strtod instead of strtod, to avoid
145 locale-specific behavior.
148 2007-11-06 Ben Pfaff <blp@gnu.org>
150 Patch #6256: add support for binary, 360 file formats. Reviewed
153 * data-in.c (struct data_in): Add `encoding' member.
154 (data_in): Add `encoding' parameter, and re-encode the data passed
155 in where appropriate. Update all callers to pass it in.
156 (parse_A): Implement EBCDIC recoding wart described in manual.
157 (parse_AHEX): Implement EBCDIC recoding.
159 * data-out.c (data_out_legacy): New function.
160 (data_out): Make into a wrapper around data_out_legacy.
162 * file-handle-def.c (struct file_handle): New member `encoding'.
163 (fh_create_file): Set encoding.
164 (fh_default_properties): Set default encoding.
165 (fh_get_legacy_encoding): New function.
167 * file-handle-def.h (enum fh_mode): New modes FH_MODE_FIXED
168 (that replaces FH_MODE_BINARY), FH_MODE_VARIABLE,
169 FH_MODE_360_VARIABLE, FH_MODE_360_SPANNED.
170 (struct fh_properties): New member `encoding'.
172 2007-11-05 Ben Pfaff <blp@gnu.org>
174 Patch #6258. Reviewed by John Darrington.
176 * file-handle-def.c (fh_lock): Add comment that TYPE should be
177 marked with N_() in the caller. Added these markings to each
178 caller too. Should make i18n easier.
179 Suggested by Chusslove Illich <caslav.ilic@gmx.net>.
181 2007-11-03 Ben Pfaff <blp@gnu.org>
183 Allow output files to overwrite input files (bug #21280).
185 * file-handle-def.c: Separate locking of files for input and for
186 output, to allow both to take place at once. Also, distinguish a
187 file handle from the identity of the underlying file, because the
188 identity of a file changes over time and the file handle can't
189 represent two different identities.
190 (struct file_handle): Remove `next', `open_cnt', `deleted',
191 `type', `open_mode', `aux', `identity' members. Change `id' from
192 char array to char *. Add `ref_cnt' member.
193 (file_handle_from_ll) New function.
194 (file_handles) Removed.
195 (named_handles) New variable.
196 (fh_init) Initialize named_handles.
197 (fh_done) Remove name from all named_handles.
198 (free_handle) Updated for modified struct file_handle.
199 (unname_handle) New function.
200 (fh_ref) New function.
201 (fh_from_file_name) Removed.
202 (fh_unref) New function.
203 (fh_unname) New function.
204 (fh_from_id) Rewritten.
205 (create_handle) Updated for modified struct file_handle.
206 (fh_inline_file) Increment the handle's ref count.
207 (fh_create_file) Updated for modified struct file_handle.
208 (fh_create_scratch) Ditto.
213 (fh_is_open) Removed.
214 (fh_get_id) Updated for modified struct file_handle.
215 (fh_get_default_handle) Increment the handle's ref count.
216 (fh_set_default_handle) Handle ref counts.
217 (struct fh_lock) New structure.
218 (locks) New static var.
219 (fh_lock) New function.
220 (fh_unlock) New function.
221 (fh_lock_get_aux) New function.
222 (fh_lock_set_aux) New function.
223 (fh_is_locked) New function.
224 (make_key) New function.
225 (free_key) New function.
226 (compare_fh_locks) New function.
227 (hash_fh_lock) New function.
229 * file-handle-def.h (enum fh_access) New enum.
231 * file-name.c: Made file_identity the same in all supported
233 (struct file_identity): New `name' member.
234 (fn_get_identity): For a file that doesn't exist, get the
235 dev/inode of its directory plus its name. If even the directory
236 doesn't exist, just use its name. Merge the Windows
237 implementation into the Unix one.
238 (fn_compare_file_identities): Rewritten. Merge the Windows
239 implementation into the Unix one.
240 (fn_hash_identity): New function.
242 * make-file.c (struct replace_file): New structure.
243 (all_files): New static var.
244 (replace_file_start): New function.
245 (replace_file_commit): New function.
246 (replace_file_abort): New function.
247 (free_replace_file): New function.
248 (unlink_replace_files): New function.
250 * por-file-reader.c (struct pfm_reader): Add `lock' member.
251 (close_reader): Unlock file.
252 (pfm_open_reader): Lock file.
254 * por-file-writer.c (struct pfm_writer): Add fh_lock, replace_file
256 (pfm_open_writer): Lock file and prepare for its replacement.
257 (close_writer): Unlock file.
259 * scratch-handle.h (struct scratch_handle): Add unique_id so that
260 different generations of a scratch file can be distinguished.
262 * scratch-reader.c (scratch_reader_open): Verify that the file is
265 * scratch-writer.c (struct scratch_writer): Add `lock' and `dict',
266 remove scratch_handle member.
267 (scratch_writer_open): Lock handle. Prepare to replace handle
268 data, instead of doing it immediately.
269 (scratch_writer_casewriter_destroy): Replace handle data and
272 * sys-file-reader.c (struct sfm_reader): Add `lock' member.
273 (sfm_open_reader): Lock file.
274 (close_reader): Unlock file.
276 * sys-file-writer.c (struct sfm_writer): Add fh_lock, replace_file
278 (sfm_open_writer): Lock file and prepare for its replacement.
279 (close_writer): Unlock file.
281 2007-11-02 Ben Pfaff <blp@gnu.org>
283 * data-out.c (output_number): Use isfinite (from C99) instead of
284 gsl_isfinite, since we now have universal support for it in
286 (output_infinite): Ditto.
287 [!HAVE_ROUND] (round): Remove definition, since we now have a
288 replacement in gnulib.
290 2007-10-27 John Darrington <john@darrington.wattle.id.au>
292 * dictionary.c: Fixed bug in dict_clone, where the vardict.dict member
293 wasn't initialised correctly. Closes bugs #21330 and 21397
296 2007-10-08 Ben Pfaff <blp@gnu.org>
298 Fix bug #21280. Thanks to John Darrington for review.
300 * file-name.c (create_stream): New function.
302 * por-file-writer.c (pfm_open_writer): Use fh_open to open the
303 file handle before creating the file, to ensure that we don't
304 truncate a file that we're reading. Make code easier to read by
307 * sys-file-write.c (sfm_open_writer): Ditto.
309 2007-10-01 Ben Pfaff <blp@gnu.org>
311 Fix bug #21192. Thanks to John Darrington for review.
313 * casereader.c (casereader_read): Decrement case_cnt before
314 calling the casereader's "read" member function, so that we
315 interact properly with lazy_casereader.
317 * datasheet.c: Add regression test for above bug fix.
318 (clone_datasheet): New function.
319 (lazy_callback): New function.
320 (check_datasheet_casereader): New function.
321 (check_datasheet): Check datasheet contents are reported correctly
322 through an ordinary casereader and a lazy casereader.
323 (clone_model): Use clone_datasheet.
325 2007-09-24 Ben Pfaff <blp@gnu.org>
327 Patch #6210. Reviewed by John Darrington.
328 * settings.c: Drop "long view", which is not needed any longer.
329 (static var long_view): Removed.
330 (force_long_view): Removed.
331 (get_viewwidth): Removed.
332 (init_viewport): Removed long_view reference.
334 2007-09-19 John Darrington <john@darrington.wattle.id.au>
336 * settings.c settings.h: Changed viewport's length and width to be
337 owned by the user interface which uses the data library. This allows
338 better abstraction, and makes dynamically adjustable dimensions easier.
340 2007-09-18 Ben Pfaff <blp@gnu.org>
342 * procedure.c (proc_extract_active_file_data): New function.
344 * lazy-casereader.h: New file.
346 * lazy-casereader.c: New file.
348 * casereader.c (casereader_dynamic_cast): New function.
350 2007-09-14 Ben Pfaff <blp@gnu.org>
352 * dictionary.c (dict_clone): Copy case indexes from cloned
353 dictionary. Fixes bug #21061. Reviewed by John Darrington.
355 2007-09-13 John Darrington <john@darrington.wattle.id.au>
357 * value.c value.h (create_value): New function.
359 2007-09-12 Ben Pfaff <blp@gnu.org>
361 Make it clear that translator casereader and casewriter translate
362 functions are supposed to destroy their input case.
364 * casereader-translator.c (struct casereader_translator): Change
365 input case parameter of translate member function from const
366 struct ccase * to struct ccase *.
367 (casereader_create_translator): Ditto, for translate parameter.
369 * casewriter-translator.c (struct casewriter_translator): Ditto.
370 (casewriter_create_translator): Ditto.
372 2007-08-27 John Darrington <john@darrington.wattle.id.au>
374 * sys-file-reader.c (read_display_parameters): Force display width
375 to 8, if the sys file says 0 (like SPSS does).
377 2007-08-12 Ben Pfaff <blp@gnu.org>
379 * dictionary.c (dict_dump): New function.
381 2007-08-12 Ben Pfaff <blp@gnu.org>
383 Drop dict_compactor in favor of using the new struct case_map.
385 * dictionary.c (struct copy_map): Removed.
386 (struct dict_compactor): Removed.
387 (dict_make_compactor): Removed.
388 (dict_compactor_compact): Removed.
389 (dict_compactor_destroy): Removed.
391 * procedure.c (struct data_set): Change `compactor' member to be a
393 (proc_open): Use case_map_to_compact_dict instead of
395 (proc_casereader_read): Use case_map_execute instead of
396 dict_compactor_compact.
397 (proc_commit): Use case_map_destroy instead of
398 dict_compactor_destroy.
400 * scratch-writer.c (struct scratch_writer): Change `compactor'
401 member to be a struct case_map *.
402 (scratch_writer_open): Use case_map_to_compact_dict instead of
404 (scratch_writer_casewriter_write): Use case_map_execute instead of
405 dict_compactor_compact.
407 2007-08-12 Ben Pfaff <blp@gnu.org>
409 * automake.mk: Add case-map.c, case-map.h.
411 * case-map.c: New file.
413 * case-map.h: New file.
415 2007-08-12 Ben Pfaff <blp@gnu.org>
417 * dictionary.c (dict_compact_values): Don't delete scratch
418 variables as well as compacting case indexes. Update all callers.
419 (dict_get_compacted_value_cnt): Rename dict_count_values and
420 change interface. Update all callers.
421 (dict_get_compacted_value_cnt): Remove.
422 (dict_compacting_would_shrink): Remove.
423 (dict_compacting_would_change): Remove.
424 (dict_make_compactor): Add new parameter. Update all callers.
426 * procedure.c (proc_casereader_read): Use casewriter_get_value_cnt
427 instead of dict_count_values, changing an O(N) operation into
430 2007-08-12 Ben Pfaff <blp@gnu.org>
432 * casereader.c (casereader_read): Don't require cases read by a
433 casereader to be exactly the expected size: as long as they're big
436 2007-08-12 Ben Pfaff <blp@gnu.org>
438 Make casewriters keep track of the number of `union value's in
439 each case. This is useful for two reasons: casewriter_write can
440 then check that the case being written is large enough, and later
441 recipients of the casewriter can determine the size of the case.
443 * casewriter-translator.c (casewriter_create_translator): Add
446 * casewriter.c (struct casewriter): Add value_cnt member.
447 (casewriter_write): Check that the case passed in is big enough.
448 (casewriter_get_value_cnt): New function.
449 (casewriter_create): Add value_cnt parameter.
451 2007-08-09 Ben Pfaff <blp@gnu.org>
453 Fix bug reported by Jason Stover.
454 * settings.c: Move get_termcap_viewport and in particular the
455 #include for <curses.h> to the end of the file. curses.h
456 redefines bool on some systems (e.g. OpenBSD), which causes
457 disagreement between uses of bool before its inclusion and
459 Tested by Jason Stover.
461 2007-07-29 Ben Pfaff <blp@gnu.org>
463 Provisional fix for bug #18692 and bug #20161. Reviewed by John
466 * file-name.c (fn_open): Only pass "r" or "w" to popen as mode
467 argument (never "rb" or "wb") because SUSv3 says that only those
468 modes are defined, and glibc in fact rejects other modes.
470 Open portable files with fn_open so that they can be read from
471 pipes. Fix missing fh_close call to go along with fh_open.
472 Report an error if the file close reports an error.
473 * por-file-reader.c (close_reader): New function.
474 (por_file_casereader_destroy): Use close_reader.
475 (pfm_open_reader): Open file with fn_open.
477 2007-07-28 Ben Pfaff <blp@gnu.org>
479 Make PSPP able to read all the portable files I could find on the
480 web. Thanks to John Darrington for review. Bug #17620.
481 * por-file-reader.c (struct pfm_reader): New member `line_length'.
482 (error): Print file offset in hexadecimal.
483 (warning): New function.
484 (advance): Treat lines less than 80 bytes long as padded to 80
486 (pfm_open_reader): Call read_documents if we find an "E" record.
487 (convert_format): Convert invalid formats to the default format
488 instead of aborting reading the file.
489 (read_variables): Rename duplicate variable names instead of
490 aborting reading the file.
491 (read_value_label): Allow string variables of different widths to
492 be assigned value labels in the same record. Replace duplicate
493 value labels instead of aborting.
494 (read_documents): New function.
496 * por-file-writer.c (pfm_open_writer): Call write_documents if the
497 dictionary has documents.
498 (write_documents): New function.
500 2007-07-25 Ben Pfaff <blp@gnu.org>
502 Fix bugs related to bug #17213.
504 * settings.c: Use HAVE_LIBNCURSES instead of HAVE_LIBTERMCAP,
505 since the former is what config.h has. Include the needed ncurses
507 (static var echo) Rename to `do_echo' because the original name is
508 the same as an ncurses identifier.
509 (get_termcap_viewport) Use error instead of msg.
511 * file-name.c (fn_interp_vars): Fix interpolation of $VARS.
512 (fn_close): Don't close stdin, stdout, stderr.
514 2007-07-26 John Darrington <john@darrington.wattle.id.au>
516 * procedure.c procedure.h: Added callbacks which get invoked whenever
517 a dataset's transformation chain changes.
519 2007-07-24 Ben Pfaff <blp@gnu.org>
522 * sys-file-writer.c (write_variable_display_parameters): Use new
523 var_default_display_width function to choose display width of
524 segments after the first one in a given variable.
525 * variable.c (var_create): Use var_default_display_width to pick
526 new variable's display width.
527 (var_default_display_width): New function.
528 Reviewed by John Darrington.
530 2007-07-24 Ben Pfaff <blp@gnu.org>
533 * por-file-writer.c (write_variables): Write weight variable.
534 Reviewed by John Darrington.
536 2007-07-23 Ben Pfaff <blp@gnu.org>
538 Improvements to system file reader and writer.
540 First, move all detailed knowledge of very long strings into
541 sys-file-private.[ch], so that this nasty stuff can be isolated.
543 * sys-file-private.c (REAL_VLS_CHUNK): New macro.
544 (EFFECTIVE_VLS_CHUNK): New macro.
545 (min_int): New function.
546 (max_int): New function.
547 (sfm_width_to_bytes): Rewrite.
548 (sfm_width_to_octs): New function.
549 (sfm_segment_alloc_width): New function.
550 (sfm_segment_alloc_bytes): New function.
551 (sfm_segment_used_bytes): New function.
552 (sfm_segment_offset): New function.
553 (sfm_segment_effective_offset): New function.
554 (sfm_dictionary_to_sfm_vars): New function.
556 * sys-file-private.h (MIN_VERY_LONG_STRING): Removed.
557 (EFFECTIVE_LONG_STRING_LENGTH): Removed.
558 (struct sfm_var): New structure.
560 Next, improvements to the system file reader.
562 * sys-file-reader.h (struct sfm_read_info): Changed `case_cnt' to
563 type casenumber. Added `version_major', `version_minor',
566 * sys-file-reader.c (struct sfm_reader): Replaced `flt64_cnt' by
567 `oct_cnt'. Rename `vars', `var_cnt' to `sfm_vars', `sfm_var_cnt'.
568 Change `case_cnt' to type casenumber. Removed `has_vls'.
569 (struct sfm_var): Removed.
570 (sfm_open_reader): Don't warn on wrong case size if the file was
571 written by SPSS 13, which tends to get it wrong. Use
572 sfm_dictionary_to_sfm_vars.
573 (read_header): Always output system file info.
574 (read_variable_record): Simplify code for reading missing values.
575 (read_machine_int32_info): Save version numbers from system file
576 into info struct passed as new argument.
577 (read_long_string_map): Restructured to use new sys-file-private
579 (read_value_labels): Use size_overflow_p.
580 (sys_file_casereader_read): Get rid of distinction between fast
581 and slow paths. Use information provided by sys-file-primate's
582 struct sfm_var to simplify code.
583 (skip_whole_strings): New function.
584 (read_int32): Renamed read_int. Changed return value to int.
586 (read_flt64): Renamed read_float. Changed return value to
587 double. Updated all callers.
588 (int32_to_native): Removed. Changed callers to use
590 (flt64_to_double): Removed. Changed callers to use float_convert.
592 Finally, get rid of int32, flt64 terminology and types in system
593 file writer. The former wasn't very useful since a POSIX "int"
594 can hold the whole range of int32 and we generally didn't have a
595 need for it to be exactly-32-bits, just at-least-32-bits. The
596 latter was inconvenient because we had to assume that it could be
597 different from double and thereby convert special values SYSMIS,
598 HIGHEST, LOWEST to and from it in multiple places. Instead, now
599 we just use "int" and "double" in most places, and do conversions,
600 if necessary, very close to where we do I/O. This change meant
601 that the writer code couldn't represent records in the file as C
602 structs any longer, but that's no great loss. The code actually
603 seems to be more readable without them.
605 Simplify the compression buffering code: only buffer as much as
606 necessary, which is no more than eight 8-byte units at any given
609 * sys-file-writer.c (typedef flt64): Removed.
610 (macro second_lowest_flt64): Removed.
611 (struct sysfile_header): Removed.
612 (struct sysfile_variable): Removed.
613 (struct sfm_writer): Removed `needs_translation', `has_vls',
614 `flt64_cnt'. Changed `compress' to type bool and `case_cnt' to
615 type casenumber. Renamed `vars' to `sfm_vars', `var_cnt' to
616 `sfm_var_cnt'. Replaced `buf', `end', `ptr', `x', `y' for
617 compression buffering by `opcodes', `opcode_cnt', `data',
618 `data_cnt'. Renamed `var_cnt_vls' as `segment_cnt'.
619 (sfm_open_writer): Use sfm_dictionary_to_sfm_vars. Use simple
620 data writer functions instead of structures.
621 (calc_oct_idx): New function.
622 (write_header): Use simple data writer functions instead of
624 (write_format_spec): Renamed write_format. New argument.
625 (write_variable_continuation_records): New function.
626 (write_variable): Use simple data writer functions instead of
627 structures. Use write_variable_continuation_records. Write
628 entire very long string instead of requiring caller to understand
630 (write_value_labels): Use simple data writer functions instead of
632 (write_documents): Ditto.
633 (write_variable_display_parameters): Use sys-file-private
634 functions to simplify. Use simple data writer functions instead
636 (write_vls_length_table): Use simple data writer functions instead
638 (write_longvar_table): Ditto.
639 (write_rec_7_34): Break into new functions
640 write_integer_info_record, write_float_info_record. Use simple
641 data writer functions instead of structures.
642 (buf_write): Removed.
643 (append_string_max): Removed.
644 (ensure_buf_space): Removed.
645 (sys_file_casewriter_write): Get rid of the distinction between
646 fast and slow paths, which didn't seem to be too useful. Use new
647 functions write_case_uncompressed, write_case_compressed.
648 (put_instruction): Removed.
649 (put_element): Removed.
650 (write_compressed_data): Removed.
651 (close_writer): Use flush_compressed. Only write case count to
652 system file if it will fit in the field.
653 (write_case_compressed): New function.
654 (write_case_uncompressed): New function.
655 (flush_compressed): New function.
656 (put_cmp_opcode): New function.
657 (put_cmp_number): New function.
658 (write_int): New function.
659 (convert_double_to_output_format): New function.
660 (write_float): New function.
661 (write_value): New function.
662 (write_string): New function.
663 (write_bytes): New function.
664 (write_zeros): New function.
665 (write_spaces): New function.
667 Reviewed by John Darrington.
669 2007-07-22 Ben Pfaff <blp@gnu.org>
671 Don't try to write very long strings to portable files. The
672 format does not support it.
674 * por-file-writer.c (MAX_POR_WIDTH): New macro.
675 (pfm_open_writer): Limit output width to MAX_POR_WIDTH.
676 (write_format): Add arg to take width to resize format to.
677 (write_value): Limit width of value written to MAX_POR_WIDTH.
678 (write_variables): Limit width of variable and its output formats
680 Reviewed by John Darrington.
682 2007-07-22 Ben Pfaff <blp@gnu.org>
684 * sys-file-reader.c (read_variable_to_value_map): Use max_warnings
685 local variable instead of literal 5.
686 Reviewed by John Darrington.
688 2007-07-22 Ben Pfaff <blp@gnu.org>
690 Fix problems with uniqueness of short names in system files with
691 very long string variables. Now a variable may have multiple
694 * automake.mk (src_data_libdata_a_SOURCES): Add new files
695 short-names.c, short-names.h.
697 * dictionary.c (dict_clone): Clone all the short names.
698 (compare_strings): Move into short-names.c.
699 (hash_strings): Ditto.
700 (set_var_short_name_suffix): Ditto.
701 (dict_assign_short_names): Ditto, rename short_names_assign,
702 change to assign all short names.
704 * por-file-writer.c (write_variables): Use short_names_assign
705 instead of dict_assign_short_names.
707 * short-names.c: New file.
709 * short-names.h: New file.
711 * sys-file-private.c (sfm_width_to_segments): New function.
713 * sys-file-reader.c (read_long_var_name_map): Save and restore all
714 the short names, not just the first one.
716 * sys-file-writer.c (cont_var_name): Removed.
717 (sfm_open_writer): Use short_names_assign instead of
718 dict_assign_short_names. Use unique short names assigned by
719 short_names_assign instead of those generated by cont_var_name.
721 * variable.c (struct variable): Remove `short_name' member,
722 replace by `short_names' and `short_name_cnt'.
723 (var_create) Initialize new members.
724 (var_get_short_name_cnt): New function.
725 (var_get_short_name): Now takes an index argument. Changed most
727 (var_set_short_name): Ditto.
728 (var_clear_short_name): Renamed var_clear_short_names, changed to
729 clear all short names.
731 Reviewed by John Darrington.
733 2007-07-22 Ben Pfaff <blp@gnu.org>
735 * variable.c (var_set_width): Use new var_set_width function.
737 * missing-values.c (mv_n_values): Drop assertion, which was not
740 * format.c (fmt_default_for_width): New function.
741 (fmt_resize): New function.
743 Reviewed by John Darrington.
745 2007-07-18 John Darrington <john@darrington.wattle.id.au>
747 * datasheet.c (datasheet_delete_columns): Added assertion to check
748 we're not deleting outside the range of the sheet.
751 * dictionary.c dictionary.h variable.c: Added the ability for string
752 variables to be resized.
754 * vardict.h: Added some prototypes (moved from dictionary.h) as
755 these should only be called by variable.c
758 2007-07-14 John Darrington <john@darrington.wattle.id.au>
760 * sfm-reader.c: Respect case_cnt field in file header.
762 2007-07-01 John Darrington <john@darrington.wattle.id.au>
764 * transformation.c transformation.h (trns_chain_execute): Changed the
765 signature (Patch #6057)
767 2007-06-10 Ben Pfaff <blp@gnu.org>
769 * casereader-filter.c (casereader_filter_destroy): Make sure to
770 write all the remaining excluded cases to the casewriter, if any.
772 * caseinit.c (init_list_destroy): Rewrite.
773 (init_list_clear): Ditto.
775 * casegrouper.c (casegrouper_get_next_group): Always set *reader
776 to null when returning false.
778 2007-06-06 Ben Pfaff <blp@gnu.org>
780 Actually implement the new procedure code and adapt all of its
781 clients to match. Also adapt all of the other case sources and
782 sinks in the tree and their clients to use the
783 casereader/casewriter infrastructure.
785 * automake.mk: Add and remove files.
787 * any-reader.c: Change into a casereader.
788 * por-file-reader.c: Ditto.
789 * scratch-reader.c: Ditto.
790 * sys-file-reader.c: Ditto.
792 * any-writer.c: Change into a casewriter.
793 * por-file-writer.c: Ditto.
794 * scratch-writer.c: Ditto.
795 * sys-file-writer.c: Ditto.
797 * procedure.c: Change to use casereader, casewriter, caseinit, and
798 other new infrastructure.
800 * scratch-handle.c: Adapt to new infrastructure.
802 * case-sink.c: Removed, now dead code.
803 * case-sink.h: Ditto.
804 * case-source.c: Ditto.
805 * case-source.h: Ditto.
806 * casefile-factory.c: Ditto.
807 * casefile-private.h: Ditto.
810 * casefilter.c: Ditto.
811 * casefilter.h: Ditto.
814 * fastfile-factory.c: Ditto.
815 * fastfile-factory.h: Ditto.
816 * storage-stream.c: Ditto.
817 * storage-stream.h: Ditto.
819 2007-06-06 Ben Pfaff <blp@gnu.org>
823 * automake.mk: Add new files.
825 * datasheet.c: New file.
827 * datasheet.h: New file.
829 2007-06-06 Ben Pfaff <blp@gnu.org>
831 Until now, the procedure code has provided a case to the
832 case_source, which has filled in the data values that come from
833 the active file. "Left" data values that don't come from the
834 active file naturally stay the same from case to case, because the
835 procedure code keeps using that same case.
837 One of the compromises that comes with the new procedure code is
838 that the active file allocates and provides its own case, which
839 the procedure code then has to resize to provide room for any
840 other variables that should go in the case and then fill in the
841 values of "left" variables. Then, when we're done with that case,
842 we have to save the values of "left" variables to copy into the
843 next case read from the active file.
845 The caseinit code helps with this.
847 * automake.mk: Add new files.
849 * caseinit.c: New file.
851 * caseinit.h: New file.
853 2007-06-06 Ben Pfaff <blp@gnu.org>
855 * value.h (value_cnt_from_width): New function.
857 * variable.c (var_get_value_cnt): Use new function.
859 2007-06-06 Ben Pfaff <blp@gnu.org>
861 Add casegrouper, to allow cases read from a given casereader to be
862 broken into groups, each of which has its own casereader.
863 Generally cases are grouped based on having equal values for some
866 * automake.mk: Add new files.
868 * casegrouper.c: New file.
870 * casegrouper.h: New file.
872 2007-06-06 Ben Pfaff <blp@gnu.org>
874 Add interface to lexicographical ordering of cases.
876 * automake.mk: Add new files.
878 * case-ordering.c: New file.
880 * case-ordering.h: New file.
882 2007-06-06 Ben Pfaff <blp@gnu.org>
884 Add casereaders and casewriters, the basis of the new data processing
885 implementation. A casereader is a uniform interface to reading cases
886 from a data source; a casewriter is a uniform interface to writing
887 cases to a data sink.
889 * automake.mk: Add new files.
891 * casereader-filter.c: New file.
893 * casereader-provider.h: New file.
895 * casereader-translator.c: New file.
897 * casereader.c: New file.
899 * casereader.h: New file.
901 * casewriter-provider.h: New file.
903 * casewriter-translator.c: New file.
905 * casewriter.c: New file.
907 * casewriter.h: New file.
909 2007-06-06 Ben Pfaff <blp@gnu.org>
911 "casewindow" data structure that extends the deque (from libpspp)
912 of cases with the ability to dump cases to disk if we get too many
915 * automake.mk: Add new files.
917 * casewindow.c: New file.
919 * casewindow.h: New file.
921 2007-06-06 Ben Pfaff <blp@gnu.org>
923 sparse_cases data structure that augments a sparse_array of cases
924 with the ability to dump cases to disk if we get too many cases in
927 * automake.mk: Add new files.
929 * sparse-cases.c: New file.
931 * sparse-cases.h: New file.
933 2007-06-06 Ben Pfaff <blp@gnu.org>
935 Adds a low-level on-disk case array data structure.
937 * automake.mk: Add new files.
939 * case-tmpfile.c: New file.
941 * case-tmpfile.h: New file.
943 2007-06-06 Ben Pfaff <blp@gnu.org>
945 In a couple of places we calculate the maximum number of cases to
946 keep in memory based on the user-defined workspace. Enable
947 centralizing the calculation through a new function.
949 * settings.c (get_workspace_cases): New function.
951 2007-06-06 Ben Pfaff <blp@gnu.org>
953 The casenumber type is defined in transformations.h, but case.h is
954 a more sensible place. Move it.
956 * case.h (CASENUMBER_MAX): New macro.
957 (typedef casenumber): Move here, from transformations.h.
959 2007-06-03 Ben Pfaff <blp@gnu.org>
961 Slightly generalize case_to_values and case_from_values functions.
963 * case.c (case_to_values): Rename case_copy_out, change interface.
964 (case_from_values): Rename case_copy_in, change interface.
966 * fastfile.c (fastfilereader_get_next_case): Update caller.
967 (write_case_to_disk): Ditto.
969 2007-06-02 Ben Pfaff <blp@gnu.org>
971 Clean up after a forgotten part of patch #5829.
973 * casedeque.h: Remove unused file.
975 * automake.mk: Remove casedeque.h from sources.
977 2007-05-10 Jason Stover <jhs@math.gcsu.edu>
979 * category.c: Removed redundant #include
981 2007-05-06 Ben Pfaff <blp@gnu.org>
983 Abstract the documents within a dictionary a little better.
984 Thanks to John Darrington for suggestion, initial version, and
987 * dictionary.c (struct dictionary): Change `documents' member from
988 char * to struct string.
989 (dict_clear): Destroy struct string.
990 (dict_get_documents): Convert struct string to char *.
991 (dict_set_documents): Set struct string. Pad to 80-character
993 (dict_clear_documents): New function.
994 (dict_add_document_line): New function.
995 (dict_get_document_line_cnt): New function.
996 (dict_get_document_line): New function.
998 * dictionary.h (macro DOC_LINE_LENGTH): New macro.
1000 * sys-file-reader.c (read_documents): Use new document functions.
1002 2007-04-19 John Darrington <john@darrington.wattle.id.au>
1004 * sys-file-reader.c: When reading a system file which has no
1005 long name table, automatically create one where the long names
1006 are the lower case versions of the short names.
1008 2007-04-22 Ben Pfaff <blp@gnu.org>
1010 * dictionary.c (dict_set_split_vars): dict_destroy expects that
1011 dict_clear will free most data related to the dictionary.
1012 dict_clear does a decent job, except that dict_set_split_vars on
1013 some systems won't actually free the dict's "split" member.
1014 Instead, it'll allocate a 1-byte region. Fix this.
1016 * value.c (value_copy): New function.
1017 (value_set_missing): Ditto.
1019 2007-04-22 John Darrington <john@darrington.wattle.id.au>
1021 * Deleted existing category.h and moved cat-routines.h into
1022 category.h Encapsulated struct cat_vals better.
1024 2007-04-19 John Darrington <john@darrington.wattle.id.au>
1026 * sys-file-reader.c: When reading a system file which has no
1027 long name table, automatically create one where the long names
1028 are the lower case versions of the short names.
1030 2007-04-16 John Darrington <john@darrington.wattle.id.au>
1032 * sys-file-reader.c: Some versions of Other Software seem to
1033 produce system files with string variables' measure set to
1034 zero. We'll assume these are supposed to be nominal variables.
1036 2007-03-30 Ben Pfaff <blp@gnu.org>
1038 * procedure.c: Adapt to new deque data structure.
1040 Mon Feb 19 10:53:21 2007 John McCabe-Dansted <gmatht@gmail.com>
1041 Ben Pfaff <blp@gnu.org>
1043 * file-name.c: Mingw compatibility fixes.
1044 (fn_search_path): Use ISSLASH instead of comparing against '/'
1046 (fn_dir_name): Use dir_name from gnulib.
1047 (fn_is_absolute): Use IS_ABSOLUTE_FILE_NAME from gnulib.
1048 (fn_get_identity): Use GetFullPathName instead of canonicalize
1049 from gnulib, because the latter does not fully support
1050 Windows-style path names. Use this implementation based on the
1051 detected presence of Windows instead of the absence of Unix, since
1052 the new implementation is Windows-specific.
1053 (fn_compare_file_identities): In Windows implementation, compare
1054 names case-insensitively.
1056 Sun Feb 18 13:28:02 2007 Ben Pfaff <blp@gnu.org>
1058 * make-file.c: Don't include mkstemp.h, because gnulib now causes
1059 <stdlib.h> to have the same effect.
1061 Sun Feb 18 11:20:24 2007 Ben Pfaff <blp@gnu.org>
1063 * por-file-reader.c: Add missing _() around messages.
1065 Sun Feb 11 20:44:13 2007 Ben Pfaff <blp@gnu.org>
1067 * make-file.c: Include "mkstemp.h", without which linking on
1070 Thu Feb 8 14:59:05 2007 Ben Pfaff <blp@gnu.org>
1072 Reduce platform dependence.
1074 * file-name.c (fn_tilde_expand): Removed, and removed calls to it.
1075 Everywhere we using this, we really should have just depended on
1076 the shell to expand tildes.
1077 (fn_search_path): Simplify, given that we don't do tilde expansion
1079 (fn_normalize): Removed. Caller changed to use the canonicalize
1081 (fn_get_cwd): Removed. Only user was fn_normalize.
1082 (fn_is_absolute): Really only test for absolute names.
1083 (fn_is_special): Use pipe files if HAVE_POPEN, not if we're in
1085 (fn_readlink): Removed, as it was only used fn_normalize.
1086 (fn_exists): Assume the stat function is available; gnulib does.
1087 (fn_open): Use pipe files if HAVE_POPEN, not if we're in unix.
1089 Sat Feb 3 21:52:17 2007 Ben Pfaff <blp@gnu.org>
1091 * dictionary.c (dict_create_vector_assert): New function.
1093 Wed Feb 7 21:25:15 2007 Ben Pfaff <blp@gnu.org>
1095 * file-name.c (fn_normalize): Correct name of function
1096 fn_is_special. Thanks to John McCabe-Dansted <gmatht@gmail.com>
1097 for pointing this out.
1099 Thu Feb 1 16:53:37 2007 Ben Pfaff <blp@gnu.org>
1101 We are using a single member in struct file_handle, the "name"
1102 field, for more than one purpose. When it begins with '"', it's a
1103 file name; otherwise, it's a token that can be used to identify
1104 it. When that assertion fires, it's because we searched for the
1105 name case-sensitively as a file name (so that there was no match),
1106 and then we try to insert it case-insensitively as a token, which
1107 fails because duplicates aren't allowed.
1109 Solution: break the two purposes into two separate fields. This
1110 fixes the problem and likely makes the code easier to read too.
1112 Fixes bug #18922. Thanks to John Darrington for bug report and
1115 * file-handle-def.c (struct file_handle): New `id' member.
1116 (fh_from_name): Rename fh_from_id. Update all callers.
1117 (create_handle): New `id' parameter. Update all callers.
1118 (fh_create_file): Ditto.
1119 (fh_get_id): New function.
1121 Mon Jan 15 16:18:10 2007 Ben Pfaff <blp@gnu.org>
1123 * case.c (case_is_null): Change return type to bool.
1125 Mon Jan 15 10:57:28 2007 Ben Pfaff <blp@gnu.org>
1129 * case.c (case_clone) [DEBUGGING]: When debugging, don't use
1130 reference counting to share data. This makes it easy for
1131 valgrind, etc. to find accesses to cases that have been destroyed
1132 but have been kept around by another user's ref-count. This often
1133 happens when the data set is small enough to find in memory; if a
1134 bigger data set that would overflow to disk were used, then data
1135 corruption would occur.
1137 Mon Jan 15 10:55:18 2007 Ben Pfaff <blp@gnu.org>
1141 * case.c (case_unshare): Make it check internally whether the
1142 ref_cnt is greater than 1, so that the callers don't have to.
1143 Update callers not to check.
1145 Mon Jan 15 10:53:01 2007 Ben Pfaff <blp@gnu.org>
1147 Before, I was thinking that I might want to get rid of reference
1148 counting at some point. Now, I'm pretty sure that it's here to
1149 stay. Thus, because we have to store the value_cnt anyway for
1150 reference-counted cases, we might as well expose it to users.
1152 * case.c (case_get_value_cnt): New function.
1153 (case_resize): Drop OLD_CNT argument. Update all callers. Only
1154 resize case if its size actually changed.
1156 * casefile.c (casefile_append_xfer): Use case_get_value_cnt
1157 instead of peeking inside struct case directly.
1158 (casefile_append): Ditto.
1160 Mon Jan 15 10:50:22 2007 Ben Pfaff <blp@gnu.org>
1162 Get rid of the inlines for the case functions, which made the
1163 header file hard to read. (Also, in testing with "-O2 -DNDEBUG",
1164 the inlines didn't speed up "make check" at all, which is not a
1165 perfect benchmark but seems indicative.)
1167 * case.c: Remove #ifdef DEBUGGING...#endif around many function
1168 definitions. Remove some assertions on nonnull pointers that were
1169 redundant with a pointer dereference soon after in the function.
1171 (struct case_data): Move definition here from case.h.
1175 (case_data_wr): Ditto.
1177 Sun Jan 14 21:41:12 2007 Ben Pfaff <blp@gnu.org>
1179 * automake.mk: Add casedeque.h to sources.
1181 * casedeque.h: New file.
1183 * procedure.c: (struct dataset) Change lag_count, lag_head,
1184 lag_queue member into single struct casedeque member. Update all
1185 users to use the casedeque instead.
1188 Sun Jan 14 21:43:12 2007 Ben Pfaff <blp@gnu.org>
1190 * procedure.c: Simplify lagged cases interface. Updated all
1191 clients--well, the only client--to use the simplified interface.
1192 (dataset_n_lag) Removed.
1193 (dataset_set_n_lag) Removed.
1194 (dataset_need_lag) New function.
1196 Tue Jan 9 07:20:05 WST 2007 John Darrington <john@darrington.wattle.id.au>
1198 * dictionary.c procedure.c: More changes to ensure that callbacks occur
1199 whenever appropriate, but only when the dataset/dictionary is in a
1202 Sun Jan 7 08:33:04 WST 2007 John Darrington <john@darrington.wattle.id.au>
1204 * dictionary.c dictionary.h : Added callbacks for change of filter and
1205 split variables. Refactored some code to ensure that callbacks get
1206 invoked when appropriate.
1208 * procedure.c (proc_cancel_temporary_transformations): Make sure that
1209 replace_dict callback occurs when permanent_dict replaces the current
1212 Wed Jan 3 11:02:11 WST 2007 John Darrington <john@darrington.wattle.id.au>
1214 * dictionary.c dictionary.h : Added callback for when the weight
1215 variable of a dictionary changes.
1217 Mon Jan 1 10:36:26 WST 2007 John Darrington <john@darrington.wattle.id.au>
1219 * dictionary.c dictionary.h : Added replace_source and replace_dict
1220 callbacks, and functions to deal with them.
1222 Fri Dec 22 13:56:08 2006 Ben Pfaff <blp@gnu.org>
1224 Simplify missing value handling.
1226 * missing-values.h (enum mv_class): New type.
1227 (enum mv_type): Moved definition into missing-values.c and renamed
1228 each MV_* to MVT_*, to distinguish them from the exposed mv_class
1229 enums. Updated all uses.
1230 (struct missing_values): Changed type of `type' from `enum
1231 mv_type' to `int' because the definition is no longer exposed.
1233 * missing-values.c (mv_is_value_missing): Add new enum mv_class
1234 parameter. Update all callers.
1235 (mv_is_num_missing): Ditto.
1236 (mv_is_str_missing): Ditto.
1237 (mv_is_value_user_missing): Removed. Changed callers to use
1238 mv_is_value_missing.
1239 (mv_is_num_user_missing): Removed. Changed callers to use
1241 (mv_is_str_user_missing): Removed. Changed callers to use
1243 (mv_is_value_system_missing): Removed. Changed callers to use
1244 mv_is_value_missing.
1245 (mv_set_type): Removed. Changed callers to use mv_clear.
1246 (mv_clear): New function.
1248 * variable.c (var_is_value_missing): Add new enum mv_class
1249 parameter. Update all callers.
1250 (var_is_num_missing): Ditto.
1251 (var_is_str_missing): Ditto.
1252 (var_is_value_user_missing): Removed. Changed callers to use
1253 var_is_value_missing.
1254 (var_is_num_user_missing): Removed. Changed callers to use
1256 (var_is_str_user_missing): Removed. Changed callers to use
1258 (var_is_value_system_missing): Removed. Changed callers to use
1259 var_is_value_missing.
1261 * casefilter.c (struct casefilter): Use enum mv_class in place of
1263 (casefilter_variable_missing): Adapt to new member.
1264 (casefilter_create): Change signature to take enum mv_class,
1267 Fri Dec 22 20:08:38 WST 2006 John Darrington <john@darrington.wattle.id.au>
1269 * casefile-factory.h fastfile-factory.c fastfile-factory.h: New files.
1271 * case-sink.c case-sink.h procedure.c procedure.h
1272 storage-stream.c: Now uses the factory.
1274 Sat Dec 16 22:05:18 2006 Ben Pfaff <blp@gnu.org>
1276 Make it possible to pull cases from the active file with a
1277 function call, instead of requiring indirection through a callback
1280 * case-source.h (struct case_source_class): Change ->read function
1281 to return a single case, instead of calling a callback function
1282 for each case. Change ->destroy function to return an error
1285 * case-source.c (free_case_source): Pass along the value returned
1286 by the case_source ->destroy function.
1288 * procedure.c (struct write_case_data): Removed.
1289 (struct dataset): Added some members to track procedure state.
1290 (procedure): Optimize the trivial case at this level.
1291 (internal_procedure): Re-implement in terms of proc_open,
1292 proc_read, proc_close.
1293 (proc_open) New function.
1294 (proc_read) New function.
1295 (proc_close) New function.
1296 (write_case) Moved into proc_read.
1297 (close_active_file) Moved closing of data source into proc_close.
1299 * storage-source.c: Rewrote to conform with modified
1300 case_source_class interface.
1302 * transformations.c (trns_chain_execute): Added argument to allow
1303 starting execution from an arbitrary transformation. Updated
1306 * transformations.h (enum TRNS_NEXT_CASE) Renamed TRNS_END_CASE.
1308 Sat Dec 16 14:09:25 2006 Ben Pfaff <blp@gnu.org>
1310 * sys-file-reader.c (read_display_parameters): Don't assume that
1311 MEASURE_* and ALIGN_* have the same values found in system files.
1313 * sys-file-writer.c (write_variable_display_parameters): Ditto.
1315 * variable.h: Change MEASURE_NOMINAL, MEASURE_ORDINAL,
1316 MEASURE_SCALE to be 0-based instead of 1-based. This also fixes
1317 the value of n_MEASURES, which was off by 1 (at least from my
1320 Sat Dec 16 12:17:34 WST 2006 John Darrington <john@darrington.wattle.id.au>
1322 * dictionary.c dictionary.h vardict.h variable.c: Added optional
1323 callbacks which are invoked when the dictionary or its
1324 variables are changed.
1326 * missing-values.c missing-values.h value-labels.c: Tidied up
1327 consistency checks, and made some of them return false
1328 instead of assert-failing.
1330 Wed Dec 13 19:30:11 2006 Ben Pfaff <blp@gnu.org>
1332 * calendar.c (calendar_days_in_month): New function.
1334 Mon Dec 11 07:53:39 2006 Ben Pfaff <blp@gnu.org>
1336 * value-labels.c (hash_int_val_lab): Only hash as many bytes as
1337 the value label's width.
1339 Sun Dec 10 14:21:29 2006 Ben Pfaff <blp@gnu.org>
1341 * sfm-private.h: Move contents into sys-file-writer.c, which is
1342 the only remaining user. Removed Borland C++-specific directives.
1344 * sys-file-reader.c: Clean up and rewrite entire file. The
1345 rewritten version is simpler and better abstracted, and should be
1346 easier to maintain and extend. It avoids using structures to read
1347 file data, which is prone to padding variations among compilers.
1348 It should also handle non-IEEE 754 system files, although I
1349 haven't been able to find any. It has been tested against many
1350 .sav files obtained from the Web and found to produce the same
1351 results as the earlier version of the code, or in some cases
1352 improved results. It is more tolerant of format variations found
1355 * sys-file-reader.h (struct sfm_read_info): Removed `big_endian'
1356 member, putting an enum integer_format in its place. New member
1357 `float_format'. Changed `compressed' member to type bool.
1359 Sun Dec 10 13:48:53 2006 Ben Pfaff <blp@gnu.org>
1361 * dictionary.c (dict_delete_consecutive_vars): New function.
1363 Sat Dec 9 20:08:25 2006 Ben Pfaff <blp@gnu.org>
1365 * file-name.c (fn_search_path): Remove prefix arg that was unused
1366 by any caller. Updated all callers.
1368 Sat Dec 9 20:04:22 2006 Ben Pfaff <blp@gnu.org>
1370 * format.c (fmt_dollar_template): Use user's decimal point
1371 character. Add assertion.
1373 Sat Dec 9 20:02:25 2006 Ben Pfaff <blp@gnu.org>
1375 * format.c (fmt_dollar_template): New function, based on
1376 dollar_format_template from var-type-dialog.c.
1378 Sat Dec 9 18:05:59 2006 Ben Pfaff <blp@gnu.org>
1380 * data-out.c (output_scientific): Fix bad assumption that "buf" is
1383 Sat Dec 9 17:23:23 2006 Ben Pfaff <blp@gnu.org>
1385 Finish converting struct variable to an opaque type. In this
1386 phase, we add remaining setter and getter functions, convert the
1387 remaining PSPP code to use them, and do a bunch of cleanup. The
1388 resulting changes are pervasive but mostly trivial, and only the
1389 notable changes are logged.
1391 * automake.mk (src_data_libdata_a_SOURCES): Add the new source
1394 * case.c (case_data): Renamed case_data_idx.
1395 (case_num): Renamed case_num_idx.
1396 (case_str): Renamed case_str_idx.
1397 (case_data_rw): Renamed case_data_rw_idx.
1399 * case.h (case_data): New function with old name and an interface
1400 that takes a variable instead of an index, which is easier to
1401 use. Updated all callers to use the new interface, or to use the
1402 new *_idx function (see above).
1405 (case_data_rw): Ditto.
1407 * category.c (cat_stored_values_destroy): Changed interface to
1408 take a struct cat_vals * instead of a struct variable *.
1410 * dictionary.c (dict_clone): Use new vector_clone function.
1411 (dict_clear) Use new var_destroy function.
1412 (add_var) New function.
1413 (dict_create_var) Rewrite in terms of dict_create_var_assert.
1414 (dict_create_var_assert) Rewrite in terms of add_var.
1415 (dict_clone_var) Rewrite in terms of dict_clone_var_assert.
1416 (dict_clone_var_assert) Rewrite in terms of var_clone, add_var.
1417 (dict_lookup_var) Use new var_create, var_destroy functions.
1418 (dict_contains_var) Rewrite in terms of new vardict functionality.
1419 (set_var_dict_index) New function.
1420 (set_var_case_index) New function.
1421 (reindex_vars) New function.
1422 (dict_delete_var) Rewrite in terms of new vardict functionality.
1423 (dict_reorder_var) Ditto.
1424 (dict_reorder_vars) Ditto.
1425 (rename_var) New function.
1426 (dict_rename_var) Use rename_var.
1427 (dict_rename_vars) Use pool to simplify code. Use rename_var.
1428 (dict_get_compacted_idx_to_fv) Rename
1429 dict_get_compacted_dict_index_to_case_index, update callers.
1430 (dict_create_vector) Use new vector_create function.
1431 (dict_clear_vectors) Use new vector_destroy function.
1432 (set_var_short_name_suffix) Move here from variable.c, renamed
1433 from var_set_short_name_suffix, make static, update caller.
1435 * sys-file-private.c: New file.
1436 (sfm_width_to_bytes) Moved here from variable.c, renamed from
1437 width_to_bytes, update callers.
1439 * sys-file-private.h: New file. Later it will supplant
1440 sfm-private.h; for now it supplements it.
1441 (macro MIN_VERY_LONG_STRING) New macro.
1442 (macro EFFECTIVE_LONG_STRING_LENGTH) New macro, from value.h.
1444 * sys-file-reader.c: Use MIN_VERY_LONG_STRING - 1 where
1445 MAX_LONG_STRING was used before.
1447 * sys-file-writer.c: Ditto.
1449 * value-labels.c: Change the paradigm here to be that a null
1450 pointer is OK for a struct val_labs * in most cases; it just
1451 represents an empty set of value labels.
1452 (val_labs_copy) A copy of a null set is a null set.
1453 (val_labs_count) A null set has 0 labels.
1454 (val_labs_replace) Change return type to void. Rewrite for
1456 (val_labs_find) A null set does not contain the value.
1457 (value_to_string) Moved to variable.c, renamed var_get_value_name,
1458 transposed argument order, updated all callers.
1460 * value.c: New file.
1461 (value_dup) Moved here from variable.c.
1462 (compare_values) Ditto.
1465 * value.h: (macro MAX_SHORT_STRING) Rewrote for simplicity.
1466 (macro MAX_LONG_STRING) Removed, because it was only interesting
1467 for system files, not for general code.
1468 (macro MAX_VERY_LONG_STRING) Ditto.
1469 (macro EFFECTIVE_LONG_STRING_LENGTH) Moved to sys-file-private.h.
1470 (macro MAX_ELEMS_PER_VALUE) Removed, as it was unused.
1472 * vardict.h: New file, for an interface between variables and
1475 * variable.c: A lot of functions were moved around, for better
1477 (struct variable) Move definition here, from variable.h.
1478 (var_type_adj) Removed--makes i18n hard.
1479 (var_type_noun) Ditto.
1480 (var_create) New function.
1481 (var_clone) New function.
1482 (var_destroy) New function.
1483 (var_set_name) Assert that variable is not in a dictionary.
1484 (compare_var_names) Rename compare_vars_by_name and fix a couple
1485 of callers who thought the args were strings.
1486 (hash_var_name) Rename hash_var_by_name.
1487 (compare_var_ptr_names) Rename compare_var_ptrs_by_name.
1488 (hash_var_ptr_name) Rename hash_var_ptr_by_name.
1489 (var_is_very_long_string) Removed, because it was only interesting
1490 to system file code.
1491 (var_set_missing_values) Allow the argument to be the wrong width,
1492 as long as we can resize it. Simplify callers who were doing the
1493 resizing themselves.
1494 (var_get_value_labels) New function.
1495 (var_has_value_labels) New function.
1496 (var_set_value_labels) New function.
1497 (alloc_value_labels) New function.
1498 (var_add_value_label) New function.
1499 (var_replace_value_label) New function.
1500 (var_clear_value_labels) New function.
1501 (var_lookup_value_label) New function.
1502 (var_get_value_name) Moved here from variable.c, renamed from
1503 var_get_value_name, transposed argument order, updated all
1505 (var_to_string) Moved here, from variable-label.c.
1506 (var_set_leave) New function.
1507 (var_get_leave) New function.
1508 (var_must_leave) New function.
1509 (var_set_short_name_suffix) Moved to dictionary.c, renamed
1510 set_var_short_name_suffix.
1511 (var_get_dict_index) New function.
1512 (var_get_case_index) New function.
1513 (var_get_obs_vals) New function.
1514 (var_set_obs_vals) New function.
1515 (var_has_obs_vals) New function.
1516 (var_get_vardict) New function.
1517 (var_set_vardict) New function.
1518 (var_has_vardict) New function.
1519 (var_clear_vardict) New function.
1520 (value_dup) Moved to value.c.
1521 (compare_values) Ditto.
1524 * variable.h: (enum NUMERIC) Rename VAR_NUMERIC, update all users.
1525 (enum ALPHA) Rename VAR_STRING, update all users.
1527 * vector.c: New file.
1528 (struct vector) Moved here, from variable.h.
1529 (check_widths) New function.
1530 (vector_create) New function.
1531 (vector_clone) New function.
1532 (vector_destroy) New function.
1533 (vector_get_name) New function.
1534 (vector_get_var) New function.
1535 (vector_get_var_cnt) New function.
1536 (compare_vector_ptrs_by_name) New function.
1538 * vector.h: New file.
1540 Sun Dec 10 11:32:56 WST 2006 John Darrington <john@darrington.wattle.id.au>
1542 * casefilter.c (casefilter_variable_missing): Avoided comparision of
1543 string variables to SYSMIS. Thanks to Ben Pfaff for reporting this
1546 Sat Dec 9 07:18:03 WST 2006 John Darrington <john@darrington.wattle.id.au>
1548 * value-labels.c (destroy_atoms): New function.
1549 * value-labels.c (atom_create): Call destroy_atoms in atexit handler.
1551 Thu Dec 7 17:38:26 2006 Ben Pfaff <blp@gnu.org>
1553 Thanks to Jason Stover for pointing out this problem.
1555 * data-out.c (output_number): Use gsl_finite from GSL, which is
1556 portable, instead of isfinite, which is not.
1559 Thu Dec 7 15:22:38 WST 2006 John Darrington <john@darrington.wattle.id.au>
1561 * variable.c variable.h (value_dup): New function.
1563 Mon Dec 4 22:20:17 2006 Ben Pfaff <blp@gnu.org>
1565 Start converting struct variable to an opaque type. In this
1566 phase, we add a bunch of setter and getter functions and convert
1567 most of the PSPP code to use them. The resulting changes are
1568 pervasive but mostly trivial, and only the notable changes are
1571 * format.c (fmt_equal): New function.
1573 * variable.c (var_type_is_valid): New function.
1574 (measure_is_valid) Moved here, from format.c.
1575 (alignment_is_valid) Moved here, from format.c.
1576 (var_get_name) New function.
1577 (var_set_name) New function.
1578 (width_to_type) New function.
1579 (var_get_type) New function.
1580 (var_get_width) New function.
1581 (var_set_width) New function.
1582 (var_is_numeric) New function.
1583 (var_is_alpha) New function.
1584 (var_is_short_string) New function.
1585 (var_is_long_string) New function.
1586 (var_is_very_long_string) New function.
1587 (var_get_missing_values) New function.
1588 (var_set_missing_values) New function.
1589 (var_clear_missing_values) New function.
1590 (var_has_missing_values) New function.
1591 (var_is_value_missing) New function.
1592 (var_is_num_missing) New function.
1593 (var_is_str_missing) New function.
1594 (var_is_value_user_missing) New function.
1595 (var_is_num_user_missing) New function.
1596 (var_is_str_user_missing) New function.
1597 (var_is_value_system_missing) New function.
1598 (var_get_print_format) New function.
1599 (var_set_print_format) New function.
1600 (var_get_write_format) New function.
1601 (var_set_write_format) New function.
1602 (var_set_both_formats) New function.
1603 (var_get_label) New function.
1604 (var_set_label) New function.
1605 (var_clear_label) New function.
1606 (var_has_label) New function.
1607 (var_get_measure) New function.
1608 (var_set_measure) New function.
1609 (var_get_display_width) New function.
1610 (var_set_display_width) New function.
1611 (var_get_alignment) New function.
1612 (var_set_alignment) New function.
1613 (var_get_value_cnt) New function.
1614 (var_get_leave) New function.
1615 (var_get_short_name) New function.
1617 * variable.h: (struct variable) Removed "type" and "nv" members;
1618 they are now computed from "width" where needed.
1620 Mon Dec 4 21:38:40 2006 Ben Pfaff <blp@gnu.org>
1622 * missing-values.c (mv_resize): Don't write beyond end of the
1623 allocated buffer when resizing a long string.
1625 Sat Dec 2 16:28:32 2006 Ben Pfaff <blp@gnu.org>
1627 Clean up identifier code: don't require identifier enumerations to
1628 be in a particular order; make better use of string library;
1629 expose less of the internals.
1631 * identifier.c: (lex_skip_identifier) Rename lex_id_get_length,
1632 change interface. Updated all callers.
1633 (lex_id_match) Change interface to use struct substring, update
1635 (lex_id_match_len) Removed. Update callers to use lex_id_match.
1636 (global array keywords[]) Make static, change form. Update all
1637 users to use lex_id_name instead.
1638 (lex_is_keyword) New function.
1639 (lex_id_to_token) Change interface to use struct substring, update
1641 (lex_id_name) New function.
1643 * identifier.h: (T_FIRST_KEYWORD) Removed. Changed users to call
1644 lex_is_keyword instead.
1645 (T_LAST_KEYWORD) Removed.
1646 (T_N_KEYWORDS) Removed.
1648 Sat Nov 18 20:46:35 2006 Ben Pfaff <blp@gnu.org>
1650 * format.c: (fmt_date_template) Distinguish characters for which a
1651 space is output and any date delimiter is allowed on input, from
1652 those for which a space is output and only a space is allowed on
1653 input. The former is represented by X, the latter by a space.
1654 Also, drop distinction between h and H, changing the former to the
1657 * data-in.c: Completely rewrite internals to conform to SPSS input
1658 formats as closely as possible.
1659 (data_in) Changed external interface by replacing the structure
1660 that was used as a single argument by a set of arguments. Updated
1662 (data_in_finite_line) Removed. Converted all callers to use plain
1664 (data_in_get_integer_format) New function.
1665 (data_in_set_integer_format) New function.
1666 (data_in_get_float_format) New function.
1667 (data_in_set_float_format) New function.
1669 * data-in.h: (enums DI_IGNORE_ERROR, DI_IMPLIED_DECIMALS) Removed.
1670 (struct data_in) Removed.
1672 * data-out.c: (output_date) Drop each component from the input as
1673 it is output, to allow us to drop the distinction between h (a
1674 count of hours) and H (the hour of day) template characters.
1675 Also, handle new X template character.
1676 (output_scientific) Follow more rational rule on when to drop
1677 fraction introduced between SPSS 13 and 15. Updated test case to
1680 Sat Nov 11 11:41:26 2006 Ben Pfaff <blp@gnu.org>
1682 Fix buffer overflow reported by John Darrington.
1684 * data-out.c (output_bcd_integer): In case of SYSMIS, etc.,
1685 realize that DIGITS is a count of nibbles, not of bytes.
1687 Sat Nov 4 15:59:56 2006 Ben Pfaff <blp@gnu.org>
1689 * calendar.c (calendar_offset_to_gregorian) Also return the
1690 year-of-day. Change callers to new interface.
1692 * data-out.c: Completely rewrite internals to conform to SPSS
1693 output formats as completely as possible.
1694 (data_out) Change interface to put input parameters before output
1695 parameters, for consistency with the style I now prefer. Update
1697 (data_out_get_integer_format) New public function.
1698 (data_out_set_integer_format) New public function.
1699 (data_out_get_float_format) New public function.
1700 (data_out_set_float_format) New public function.
1702 * data-out.h: New file. Move prototype for data_out here, from
1705 * format.c: (fmt_step_width) Use equality comparison instead of
1706 bitwise and, for clarity.
1707 (fmt_is_string) Ditto.
1708 (fmt_input_to_output) Fix categories that are translated to F
1711 Sun Nov 5 08:29:34 WST 2006 John Darrington <john@darrington.wattle.id.au>
1713 * casefilter.c casefilter.h (new files), casefile.c casefile.h
1714 casefile-private.h: Added casefilter to assist commands with missing
1717 Sat Nov 4 11:47:09 2006 Ben Pfaff <blp@gnu.org>
1719 Implement SET ERRORS, SHOW ERRORS. Fixes bug #17609.
1721 * settings.c: (route_errors_to_terminal) New variable.
1722 (route_errors_to_listing) New variable.
1723 (get_error_routing_to_terminal) New function.
1724 (set_error_routing_to_terminal) New function.
1725 (get_error_routing_to_listing) New function.
1726 (set_error_routing_to_listing) New function.
1728 * settings.h: (SET_ROUTE_* enums) Removed, because unused.
1730 Tue Oct 31 19:58:27 2006 Ben Pfaff <blp@gnu.org>
1732 * format.c: Completely rewrite, to achieve better abstraction.
1733 Rewrite all references to formats in other files.
1735 * format.def: Rewrite and reorganize.
1737 * settings.c: Move everything related to custom currency formats
1738 into format.[ch], changing them in form, so as to group related
1739 code and definitions better. Changed all references to use the
1741 (static var decimal) Removed.
1742 (static var grouping) Removed.
1743 (static var cc) Removed.
1744 (get_decimal) Removed.
1745 (set_decimal) Removed.
1746 (get_grouping) Removed.
1747 (set_grouping) Removed.
1751 * settings.h: (macro CC_CNT) Removed.
1752 (macro CC_WIDTH) Removed.
1753 (struct custom_currency) Removed.
1755 Tue Oct 31 19:56:19 2006 Ben Pfaff <blp@gnu.org>
1757 * data-in.c (data_in): Use switch statement instead of table, to
1758 avoid dependence on the order of the FMT_* enums.
1760 Tue Oct 31 19:35:36 2006 Ben Pfaff <blp@gnu.org>
1762 * data-out.c: (num_to_string) Removed, because it was dead code.
1764 Tue Oct 31 18:09:24 2006 Ben Pfaff <blp@gnu.org>
1766 * data-in.c (parse_trailer): Fix error message.
1768 Sat Oct 28 11:56:50 2006 Ben Pfaff <blp@gnu.org>
1770 * format.c (fmt_is_binary): New function.
1772 Thu Oct 19 22:59:56 WST 2006 John Darrington <john@darrington.wattle.id.au>
1774 * procedure.c procedure.h: Encapsulated the static data into a single
1777 Sat Oct 14 16:56:44 2006 Ben Pfaff <blp@gnu.org>
1779 * casefile.c (casereader_read_xfer): Always initialize the case,
1780 even on an error condition.
1782 Wed Sep 27 09:37:49 WST 2006 John Darrington <john@darrington.wattle.id.au>
1784 * procedure.c (case_limit_trns_proc): Fixed buglet which rendered the
1785 entire function useless.
1787 Mon Sep 25 17:11:46 WST 2006 John Darrington <john@darrington.wattle.id.au>
1789 * casefile-private.h casefile.c casefile.h fastfile.c: Created new
1790 casereader method casereader_clone.
1792 * procedure.c pransformations.h: Introduced new type casenum_t
1794 Thu Sep 21 07:00:30 2006 Ben Pfaff <blp@gnu.org>
1796 * variable.c: (width_to_bytes) Rephrase code for clarify.
1798 Sun Jul 16 19:52:03 2006 Ben Pfaff <blp@gnu.org>
1800 * format.c: (fmt_type_from_string) New function.
1801 (fmt_to_string) Include decimals in output if the format has
1802 decimals, even if the format type does not. This way, we can
1803 accurately reproduce incorrect formats in user output.
1804 (check_common_specifier) Make the check for a bad format type an
1805 assertion, so we get bug reports if they show up. Fix message.
1806 Check for decimal places with a format type that doesn't allow
1808 (check_input_specifier) Remove check for FMT_X, which has been
1810 (check_output_specifier) Ditto.
1812 * format.def: Remove FMT_T, FMT_X, FMT_DESCEND, FMT_NEWREC.
1814 * format.h: (macro FMT_TYPE_LEN_MAX) New macro.
1815 (struct fmt_desc) Use FMT_TYPE_LEN_MAX in definition.
1816 (enum fmt_parse_flags) Removed.
1818 Mon Jul 17 18:26:21 WST 2006 John Darrington <john@darrington.wattle.id.au>
1820 * casefile.c casefile.h: Converted to an abstract base class.
1821 * casefile-private.h fastfile.c fastfile.h: New files.
1822 * automake.mk procedure.c scratch-writer.c storage-stream.c
1824 Wed Jul 12 21:02:26 2006 Ben Pfaff <blp@gnu.org>
1826 * procedure.c (internal_procedure): Create sink_case with only as
1827 many values as the compacted dictionary.
1829 Wed Jul 12 21:01:00 2006 Ben Pfaff <blp@gnu.org>
1831 Remove "debugging" code that caused plenty of false positives and
1834 * case.h (struct ccase): [DEBUGGING] Remove `this' member.
1836 * case.c: Remove all references to `this' member.
1838 Thu Jul 6 19:09:53 2006 Ben Pfaff <blp@gnu.org>
1840 Fix link error noted by Jason Stover.
1842 * storage-stream.c: Include <assert.h>.
1844 Tue Jul 4 08:47:35 2006 Ben Pfaff <blp@gnu.org>
1846 Fix bug #15766 (/KEEP subcommand on SAVE doesn't fully support
1847 ALL) and additional underlying system file issues.
1849 Thanks to John Darrington for review.
1851 First problem: var_hash points to variables not owned by the
1852 sys-file-reader, which the caller may free or modify. Use an
1853 array of sfm_vars instead, as done earlier (e.g. CVS version
1856 * sys-file-reader.c (struct sfm_reader): Remove var_hash, svars
1857 members and remove all code that references it. Add vars, var_cnt
1858 members. Remove fix_specials member, which was unused.
1859 (struct sfm_var) Remove name member, which was unused.
1860 (sfm_close_reader) Free vars member instead of var_hash.
1861 (compare_var_shortnames) Removed.
1862 (hash_var_shortname) Removed.
1863 (sfm_open_reader) Fill out vars array.
1864 (compare_var_index) Removed.
1865 (sfm_read_case) Use vars instead of var_hash.
1867 Second problem: we're confused about when we actually have very
1868 long strings, causing us to choose incorrectly between slow path
1869 and fast path in sfm_read_case.
1871 * sys-file-reader.c: (sfm_open_reader) Only mark has_vls if we
1872 have very long strings, not when we have long variable names,
1873 which is an unrelated feature.
1875 Tue Jun 27 12:06:49 2006 Ben Pfaff <blp@gnu.org>
1877 * variable.h: Move var_set and variable parsing declarations to
1878 new header, src/language/lexer/variable-parser.h. Modified lots
1879 of files to include the new header.
1881 Sun Jun 25 22:39:32 2006 Ben Pfaff <blp@gnu.org>
1883 * value-labels.c (value_to_string): When there's no value label,
1884 format the variable according to its print format, instead of
1885 always effectively using A or F format.
1887 Mon Jun 19 18:05:42 WST 2006 John Darrington <john@darrington.wattle.id.au>
1889 * casefile.c (casefile_get_random_reader): Nasty hack to get around
1892 * format.c: Removed tortological assertion.
1894 Fri Jun 9 12:20:09 2006 Ben Pfaff <blp@gnu.org>
1896 Reform string library.
1898 * file-name.c (fn_interp_vars): Change interface to take a
1899 substring as input. Updated all users.
1901 Fri Jun 9 12:11:24 2006 Ben Pfaff <blp@gnu.org>
1903 * format.c (measure_is_valid): Really return false when m >=
1906 Tue Jun 6 18:46:26 2006 Ben Pfaff <blp@gnu.org>
1908 Implement random access to casefiles, for use in GUI.
1910 * casefile.c: (struct casereader) Add `random', `file_ofs',
1911 `buffer_ofs' members.
1912 (casefile_get_random_reader) New function.
1913 (read_open_file) Break part into new function
1914 seek_and_fill_buffer().
1915 (fill_buffer) Update buffer_ofs, file_ofs.
1916 (casereader_seek) New function.
1918 Tue May 30 19:52:33 WST 2006 John Darrington <john@darrington.wattle.id.au>
1920 * settings.c: Added call to i18n{done, init}.
1922 Tue May 9 21:09:17 2006 Ben Pfaff <blp@gnu.org>
1924 * procedure.h: Add WARN_UNUSED_RESULT to procedure function
1927 Tue May 9 21:08:05 2006 Ben Pfaff <blp@gnu.org>
1929 * casefile.c: Convert many uses of `int' to `bool'.
1931 Sat May 6 22:49:43 2006 Ben Pfaff <blp@gnu.org>
1933 * transformations.c (trns_chain_destroy): Destroy chain's trns
1934 member, to fix memory leak.
1936 Sat May 6 22:48:30 2006 Ben Pfaff <blp@gnu.org>
1938 * storage-stream.c (storage_source_decapsulate): Destroy case
1939 source to fix memory leak.
1941 Sat May 6 22:46:47 2006 Ben Pfaff <blp@gnu.org>
1943 * scratch-reader.c (scratch_reader_read_case): Copy into existing
1944 case passed as argument instead of initializing the argument as a
1945 case. Fixes memory leak that showed up in
1946 tests/command/aggregate.sh with scratch files.
1948 Sat May 6 22:45:55 2006 Ben Pfaff <blp@gnu.org>
1950 * procedure.c (proc_done): Destroy default_dict, to fix memory
1953 Sat May 6 22:44:44 2006 Ben Pfaff <blp@gnu.org>
1955 Simplify procedure_with_splits().
1957 * procedure.c (struct split_aux_data): Removed case_count member.
1958 (procedure_with_splits) Don't initialize case_count.
1959 (split_procedure_case_func) Check whether prev_case is null
1960 instead of case_count.
1961 (split_procedure_end_func) Ditto.
1963 Sat May 6 22:42:23 2006 Ben Pfaff <blp@gnu.org>
1965 * case.c (case_move): Do nothing if dst and src are the same
1967 (case_try_create) Merge two similar cases.
1968 (case_copy) Unshare only if data must be actually copied.
1970 Sun May 7 10:04:06 WST 2006 John Darrington <john@darrington.wattle.id.au>
1972 * data-in.c data-out.c dictionary.c sys-file-reader.c
1973 sys-file-writer.c variable.c variable.h: Reworked very long string
1974 support for better encapsulation.
1976 Sat May 6 19:02:00 2006 Ben Pfaff <blp@gnu.org>
1978 * value-labels.c (val_labs_can_set_width): New function.
1979 (val_labs_set_width) Clear labels if increasing width to long
1981 (val_labs_destroy) Remove unneeded test for null.
1983 Sat May 6 16:14:08 2006 Ben Pfaff <blp@gnu.org>
1985 * value-labels.h: Remove unneeded dependency on variable.h.
1987 Sat May 6 15:58:36 2006 Ben Pfaff <blp@gnu.org>
1989 Get rid of `char *c' member in union value, for cleanliness.
1991 * value.h: (union value) Remove `c' member.
1993 Sat May 6 15:36:59 2006 Ben Pfaff <blp@gnu.org>
1995 Make dictionary compacting functions a little more general.
1997 * sys-file-writer.c (sfm_open_writer): Use
1998 dict_compacting_would_change().
1999 (does_dict_need_translation) Removed.
2001 Sat May 6 15:35:42 2006 Ben Pfaff <blp@gnu.org>
2003 Make dictionary compacting functions a little more general.
2005 * dictionary.c (dict_needs_compaction): Rename
2006 dict_compacting_would_shrink(). Update all callers.
2007 (dict_compacting_would_change) New function.
2009 Sat May 6 14:25:49 2006 Ben Pfaff <blp@gnu.org>
2011 * sys-file-writer.c: (does_dict_need_translation) Fix bug:
2012 inverted return value (!).
2014 Sat May 6 13:37:52 2006 Ben Pfaff <blp@gnu.org>
2016 Continue reforming procedure execution.
2018 * procedure.c: Search and replace "vfm" by "proc". Notably:
2019 (static var vfm_source) Rename proc_source. Update all
2021 (static var vfm_sink) Rename proc_sink. Update all references.
2023 Sat May 6 12:38:55 2006 Ben Pfaff <blp@gnu.org>
2025 Continue reforming procedure execution. In this phase, remove
2026 PROCESS IF, which was deprecated anyway and can be easily
2027 simulated with TEMPORARY followed by SELECT IF.
2029 * procedure.c: (open_active_file) Don't call
2030 add_process_if_trns().
2031 (discard_variables) Get rid of redundant call to
2032 proc_cancel_all_transformations().
2033 (add_process_if_trns) Removed.
2034 (process_if_trns_proc) Removed.
2035 (process_if_trns_free) Removed.
2037 Sat May 6 10:58:05 2006 Ben Pfaff <blp@gnu.org>
2039 Continue reforming procedure execution. In this phase, add
2040 `const' to the case passed to procedure()'s callback.
2042 Updated all users of procedure() as well.
2044 * procedure.c: (struct write_case_data) Add "const" to ccase
2045 parameter for case_func member.
2046 (procedure) Add "const" to ccase parameter for proc_func
2048 (multipass_case_func) Make ccase parameter const.
2049 (internal_procedure) Add "const" to ccase parameter for case_func
2051 (split_procedure_case_func) Make ccase parameter const.
2052 (multipass_split_case_func) Make ccase parameter const.
2054 Sat May 6 10:30:33 2006 Ben Pfaff <blp@gnu.org>
2056 Continue reforming procedure execution. In this phase, get rid of
2057 the output code for SPLIT FILE groups in procedure.c, which really
2058 shouldn't be doing any output. Move it into the individual
2059 procedures instead. This also adds some flexibility.
2061 Updated many users of procedure_with_splits() and
2062 multipass_procedure_with_splits() to call
2063 output_split_file_values() and to deal with increased use of
2066 * procedure.c: (struct split_aux_data) Add "const struct ccase *"
2067 parameter to begin_func member.
2068 (procedure_with_splits) Add "const struct ccase *" parameter to
2069 begin_func parameter. Make ccase parameter const in proc_func
2071 (split_procedure_case_func) Don't dump split file group. Pass
2073 (dump_splits) Moved to language/dictionary/split-file.c as
2074 output_split_file_values().
2075 (struct multipass_split_aux_data) Add "const struct ccase *"
2076 parameter to split_func member.
2077 (multipass_procedure_with_splits) Add "const struct ccase *"
2078 parameter to split_func parameter.
2079 (multipass_split_case_func) Save new SPLIT FILE case before
2081 (multipass_split_output) Pass saved SPLIT FILE case to split_func.
2083 Fri May 5 22:48:50 2006 Ben Pfaff <blp@gnu.org>
2085 Continue reforming procedure execution. Change
2086 internal_procedure() so that it calls open_active_file() and
2087 close_active_file(), which isolates most of the actual procedure
2090 * procedure.c: (struct write_case_data) Rename `proc_func' member
2091 to `case_func' and update all references.
2092 (procedure) Rewrite as one-line wrapper around
2093 internal_procedure().
2094 (struct multipass_aux_data) New.
2095 (multipass_callback) Renamed multipass_case_func(). Use struct
2096 multipass_aux_data as auxiliary data.
2097 (multipass_end_func) New function.
2098 (multipass_procedure) Rewrite as wrapper for internal_procedure()
2099 that uses multipass_case_func, multipass_end_func.
2100 (internal_procedure) Add `end_func' argument. Move optimization
2101 of trivial case in here. Move call to open_active_file() and
2102 close_active_file() in here. Now assert that vfm_source is
2104 (procedure_with_splits_callback) Rename
2105 split_procedure_case_func().
2106 (split_procedure_end_func) New function.
2107 (multipass_split_callback) Rename multipass_split_case_func.
2108 (multipass_split_end_func) New function.
2109 (discard_variables) No need to test for nonnull vfm_source.
2111 Fri May 5 21:34:02 2006 Ben Pfaff <blp@gnu.org>
2113 Continue reforming procedure execution. Get rid of unused member.
2115 * procedure.c: (struct write_case_data) Remove `cases_analyzed'
2117 (write_case) Don't increment cases_analyzed.
2119 Thu May 4 21:50:11 2006 Ben Pfaff <blp@gnu.org>
2121 Continue reforming procedure execution. In this phase, move
2122 procedure.c and procedure.h from src to src/data. Update
2123 makefiles and #includes accordingly.
2125 * procedure.c: Moved here from src/.
2127 * procedure.h: Moved here from src/.
2129 Wed May 3 22:42:12 2006 Ben Pfaff <blp@gnu.org>
2131 Continue reforming procedure execution. In this phase, get rid of
2132 many global variables, consolidating procedure execution in
2133 procedure.c. Encapsulate transformations in new "struct
2134 trns_chain". Also, change implementation of N OF CASES, FILTER,
2135 and PROCESS IF from special cases to transformations.
2137 * automake.mk: (src_data_libdata_a_SOURCES) Add transformations.c,
2140 * dictionary.c: (global variable default_dict) Move to
2143 * variable.h: (TRNS_*) Move to transformations.h.
2144 (struct transformation) Move to transformations.c.
2146 Thu May 4 13:47:06 WST 2006 John Darrington <john@darrington.wattle.id.au>
2148 * sys-file-reader.c: Fixed invalid read problems.
2150 Tue May 2 15:57:10 2006 Ben Pfaff <blp@gnu.org>
2152 * storage-stream.c: Add missing function comments.
2154 Tue May 2 15:50:21 2006 Ben Pfaff <blp@gnu.org>
2156 Continue reforming procedure execution. In this phase, add some
2157 new, needed functionality to storage-stream.
2159 * storage-stream.c: (storage_source_decapsulate) New function.
2161 Tue May 2 15:43:36 2006 Ben Pfaff <blp@gnu.org>
2163 * variable.c (width_to_bytes): Declarations must precede
2164 statements for C90 compliance.
2166 Tue May 2 10:42:05 WST 2006 John Darrington <john@darrington.wattle.id.au>
2168 * data-out.c, data-in.c, variable.c, variable.h: New functions
2169 copy_mangle and copy_demangle for reading/writing cases; emulates the
2170 way SPSS deals with strings > 255 bytes.
2172 * sys-file-reader.c sys-file-writer.c: Added support for Record 7,
2173 subtype 14 needed for strings longer than 255 bytes.
2175 * dictionary.c, format.def, value.c : Updated to use MAX_STRING
2176 instead of literal values. Also fixed some constness issues.
2178 * format.h: Constness
2180 * sfm-private.h: Renamed the case_size identifier, since I discovered
2181 that SPSS's respect for this variable is very nominal.
2183 Mon May 1 15:45:42 2006 Ben Pfaff <blp@gnu.org>
2185 Change case limit type from int to size_t.
2187 * dictionary.c: (struct dictionary) Change type of case_limit
2189 (dict_get_case_limit) Change return type.
2190 (dict_set_case_limit) Change parameter type.
2192 Wed Apr 26 20:01:19 2006 Ben Pfaff <blp@gnu.org>
2194 * variable.h: (struct variable) Rename `reinit' member as `leave'
2195 and invert sense. Fix up all references.
2197 Wed Apr 26 19:39:28 2006 Ben Pfaff <blp@gnu.org>
2199 Continue reforming procedure execution. In this phase, break
2200 procedure.c into multiple files.
2202 * automake.mk: (src_data_libdata_a_SOURCES) Add all the new files.
2204 * case-sink.c: New file.
2206 * case-sink.h: New file.
2208 * case-source.c: New file.
2210 * case-source.h: New file.
2212 * storage-stream.c: New file.
2214 * storage-stream.h: New file.
2216 Wed Apr 26 14:55:19 2006 Ben Pfaff <blp@gnu.org>
2218 * variable.h: (struct variable) Remove `init' member and all
2219 references to it from other files. It was initialized in several
2220 places, but nothing really ever used it for anything worthwhile.
2221 Thanks to Jason Stover for pointing out how confusing this
2224 Sun Apr 23 22:04:45 2006 Ben Pfaff <blp@gnu.org>
2226 Continue reforming error message support. In this phase, get rid
2227 of message "titles" and put the message text in `struct error'.
2228 Now `struct error' encapsulates a message more properly.
2230 * casefile.c: (io_error) Use err_msg() instead of err_vmsg().
2231 Format message ourselves.
2233 * data-in.c: (vdls_error) Ditto.
2235 * por-file-reader.c: (error) Ditto.
2237 * sys-file-reader.c: (corrupt_msg) Ditto.
2239 Sun Apr 16 18:49:51 2006 Ben Pfaff <blp@gnu.org>
2241 GNU standards require "file name" instead of "filename" in
2242 documentation. It's nice for our code to follow the convention
2245 * casefile.c: (struct casefile) Rename `filename' member to
2246 `file_name'. Updated all references.
2248 * file-name.c: [!unix] (struct file_identity) Rename
2249 normalized_filename member to normalized_file_name. Updated all
2252 Sun Apr 16 18:35:33 2006 Ben Pfaff <blp@gnu.org>
2254 We don't really support anything but Unix-like environments well,
2255 so we might as well de-obfuscate by writing directory and path
2256 separators explicitly.
2258 * file-name.h: (macro DIR_SEPARATOR) Removed. Changed all usages
2260 (macro PATH_SEPARATOR) Removed. Changed all usages to just ':'.
2261 (macro DIR_SEPARATOR_STRING) Removed. Changed all usages to just
2263 (macro PATH_SEPARATOR_STRING) Removed. Changed all usages to just
2266 Sun Apr 16 18:28:35 2006 Ben Pfaff <blp@gnu.org>
2268 GNU standards require "file name" instead of "filename" in
2269 documentation. It's nice for our code to follow the convention
2272 * filename.c: Rename to file-name.c.
2274 * filename.h: Rename to file-name.h. Update all inclusions.
2275 Update header guards.
2277 * automake.mk: Update file names.
2279 Sun Apr 16 16:42:47 2006 Ben Pfaff <blp@gnu.org>
2281 * filename.c: (fn_dirname) Renamed fn_dir_name(), all references
2283 (fn_basename) Removed (dead code).
2284 (fn_absolute_p) Renamed fn_is_absolute(), all references updated.
2285 (fn_special_p) Renamed fn_is_special(), all references updated.
2286 (fn_exists_p) Renamed fn_exists(), all references updated.
2288 Sun Apr 16 16:33:58 2006 Ben Pfaff <blp@gnu.org>
2290 * filename.c: (fn_tilde_expand) Rewrite for cleaner code.
2291 Also, now it only tilde-expands file names, not paths.
2292 (fn_search_path) Tilde-expand one directory at a time.
2294 Sun Apr 16 16:28:06 2006 Ben Pfaff <blp@gnu.org>
2296 * filename.c: (fn_search_path) rewrite for cleaner code. Also,
2297 get rid of non-Unixlike version of the code, which has probably
2299 (fn_prepend_dir) Removed (dead code).
2301 * filename.h: (macro DIR_SEPARATOR_STRING) New.
2302 (macro PATH_SEPARATOR_STRING) New.
2303 Sun Apr 16 16:05:28 2006 Ben Pfaff <blp@gnu.org>
2305 Continue reforming error message support. In this phase, we get
2306 rid of VM() and the other msg() support for "verbosity", replacing
2307 it by a new function verbose_msg().
2309 * filename.c: (fn_search_path) Use verbose_msg() instead of
2312 Sat Apr 15 19:53:19 2006 Ben Pfaff <blp@gnu.org>
2314 * sfm-private.h: Get rid of #defines after #error, which makes no
2317 Sat Apr 15 19:48:57 2006 Ben Pfaff <blp@gnu.org>
2319 Get rid of our own int32 type in favor of the standard int32_t
2322 * sfm-private.h: (int32 macro) Don't define this anymore. Do
2325 * sys-file-reader.c: Use int32_t instead of int32 throughout.
2327 * sys-file-writer.c: Use int32_t instead of int32 throughout.
2329 Sat Apr 15 19:36:47 2006 Ben Pfaff <blp@gnu.org>
2331 Remove ill-considered file routines that are no longer used.
2333 * filename.c: (fn_open_ext) Removed.
2334 (fn_close_ext) Removed.
2336 * filename.h: (struct file_ext) Removed.
2338 Mon Apr 3 13:22:39 2006 Ben Pfaff <blp@gnu.org>
2340 * variable.c (var_is_valid_name): Move declarations before code
2343 Tue Apr 4 15:28:40 WST 2006 John Darrington <john@darrington.wattle.id.au>
2345 * filename.ch (fn_interp_vars): Fixed small buglet.
2347 Tue Mar 28 13:47:16 WST 2006 John Darrington <john@darrington.wattle.id.au>
2349 * filename.[ch] (fn_interp_vars): Changed the signature and semantics
2350 so as to modify the string inline. Thus makeing it easier to
2351 destroy the results when no longer needed.
2353 2006-03-25 Jason Stover <jhs@math.gcsu.edu>
2355 * category.c (cat_stored_values_destroy): Fixed memory leak.
2357 Fri Mar 24 18:15:41 2006 Ben Pfaff <blp@gnu.org>
2359 Add some missing frees. Thanks to John Darrington for reporting
2362 * any-writer.c (any_writer_close): Free writer.
2364 * any-reader.c (any_reader_close): Free reader.
2366 Mon Mar 20 16:33:53 2006 Ben Pfaff <blp@gnu.org>
2368 * por-file-reader.c: (error) Mark as NO_RETURN.
2370 Sat Mar 11 15:06:07 WST 2006 John Darrington <john@darrington.wattle.id.au>
2372 * settings.c: Changed default value of scompress to true.
2374 Sat Mar 4 13:22:51 2006 Ben Pfaff <blp@gnu.org>
2376 * sfm-private.h: Include variable.h, to get SHORT_NAME_LEN.
2378 * value.h: Remove check on MAX_SHORT_STRING, which I don't think
2381 * variable.h: Move definition of SHORT_NAME_LEN, LONG_NAME_LEN
2382 here from pref.h.orig.
2384 Sat Mar 4 12:50:48 WST 2006 John Darrington <john@darrington.wattle.id.au>
2386 * sys-file-reader.c: Fixed bug reading compressed files.
2388 Thu Mar 2 08:40:33 WST 2006 John Darrington <john@darrington.wattle.id.au>
2390 * Numerous renames. See src/ChangeLog for details.
2392 * Moved files from src directory