2007-11-03 John Darrington * gnumeric-reader.c gnumeric-reader.h: New files. Thu May 4 21:47:48 2006 Ben Pfaff Continue reforming procedure execution. In this phase, move procedure.c and procedure.h from src to src/data. Update makefiles and #includes accordingly. * automake.mk: Remove special rule for src/procedure.o. * procedure.c: Moved to src/data. * procedure.h: Moved to src/data. Wed May 3 22:24:34 2006 Ben Pfaff Continue reforming procedure execution. In this phase, get rid of many global variables, consolidating procedure execution in procedure.c. Encapsulate transformations in new "struct trns_chain". Also, change implementation of N OF CASES, FILTER, and PROCESS IF from special cases to transformations. * procedure.c: (global var vfm_source) Make static. Changed external references to use in_input_program(), proc_set_source(), or proc_capture_output() instead. (global var vfm_sink) Make static. Changed external references to use proc_set_sink() instead. (global var default_dict) Move here from data/dictionary.c. (static var permanent_trns_chain) New var. (static var temp_dict) Renamed permanent_dict, updated references. (static var temporary_trns_chain) New var. (static var cur_trns_chain) New var. (static var in_procedure) Removed. (global var t_trns) Removed. (global var n_trns) Removed. (global var m_trns) Removed. (global var f_trns) Removed. (procedure) Even if there's "nothing to do" we need to clear PROCESS IF, N OF CASES, vector state. (This should be abstracted.) (multipass_callback) New function. (multipass_procedure) New function. (open_active_file) Add N OF CASES, FILTER, PROCESS IF transformations. Finalize transformations. No need to call ctl_stack_clear() anymore because finalizers will do that. (write_case) Simplify and rewrite. (execute_transformations) Removed. (filter_case) Removed. (close_active_file) Use proc_cancel_temporary_transformations(). No need to clear PROCESS IF, N OF CASES here anymore because helpers do that. (multipass_procedure_with_splits) Keep track of success. (multipass_split_callback) Ditto. (multipass_split_output) Ditto. (discard_variables) No need to call ctl_stack_clear() anymore because finalizers will do that. (proc_capture_transformations) New function. (add_transformation) Rewrite in terms of trns_chain_append(). (add_transformation_with_finalizer) New function. (next_transformation) Rewrite in terms of trns_chain_next(). (proc_in_temporary_transformations) New function. (proc_start_temporary_transformations) New function. (proc_make_temporary_transformations_permanent) New function. (proc_cancel_temporary_transformations) New function. (cancel_transformations) Rename proc_cancel_all_transformations(), rewrite in terms of trns_chain_destroy(). (proc_init) New function. (proc_done) New function. (proc_set_sink) New function. (proc_set_source) New function. (proc_has_source) New function. (proc_capture_output) New function. (add_case_limit_trns) New function. (case_limit_trns_proc) New function. (case_limit_trns_free) New function. (add_filter_trns) New function. (filter_trns_proc) New function. (add_process_if_trns) New function. (process_if_trns_proc) New function. (process_if_trns_free) New function. Wed Apr 26 20:00:00 2006 Ben Pfaff * procedure.c (create_trns_case): Fix inverted decision on whether numeric values should be initialized to 0 or SYSMIS. Wed Apr 26 19:48:52 2006 Ben Pfaff Continue reforming procedure execution. In this phase, assert that add_transformation() is not called during procedure execution. Thanks to John Darrington for the suggestion. * procedure.c: (static var in_procedure) New var. (internal_procedure) Get rid of recursive_call local var and logic. (open_active_file) Set in_procedure and make sure it wasn't already set. (close_active_file) Reset in_procedure and make sure it was already set. (add_transformation) Make sure we're not in a procedure. Wed Apr 26 19:33:52 2006 Ben Pfaff Continue reforming procedure execution. In this phase, break procedure.c into multiple files. * procedure.c (vfm_last_invocation): Rename time_of_last_procedure(). Update all references. (struct storage_stream_info) Move to data/storage-stream.c. (storage_sink_open) Ditto. (destroy_storage_stream_info) Ditto. (storage_sink_write) Ditto. (storage_sink_destroy) Ditto. (storage_sink_make_source) Ditto. (var storage_sink_class) Ditto. (storage_source_count) Ditto. (storage_source_read) Ditto. (storage_source_destroy) Ditto. (storage_source_class) Ditto. (storage_source_get_casefile) Ditto. (storage_source_create) Ditto. (null_sink_class) Move to data/case-sink.c. (create_case_source) Move to data/case-source.c. (free_case_source) Ditto. (case_source_is_class) Ditto. (create_case_sink) Move to data/case-sink.c. (free_case_sink) Ditto. * procedure.h: (struct case_source) Move to data/case-source.h. (struct case_source_class) Ditto. (struct case_sink) Move to data/case-sink.h. (struct case_sink_class) Ditto. Thu Apr 27 09:28:25 WST 2006 John Darrington * automake.mk: Removed explicit dependencies for message.o, since that module no longer exists. Wed Apr 26 15:29:45 2006 Ben Pfaff Start reforming procedure execution. In this phase, get rid of function prototypes for never-defined functions. * procedure.h: Get rid of function prototypes for never-defined functions. Wed Apr 26 12:58:46 2006 Ben Pfaff Improve the way we handle the various parsing "states". Until now we've hard-coded the state transitions in the command definition file, but that's error-prone and, worse, it's redundant--we can figure out what state we're in anyhow. We can cleanly handle INPUT PROGRAM and FILE TYPE with a nested command-processing loop. * procedure.c (case_source_is_complex): Removed. (discard_variables) No need to set pgm_state anymore. Tue Apr 25 11:06:49 2006 Ben Pfaff Finish reforming error message support. In this phase, move message.c into libpspp. * message.c: Move to libpspp. Tue Apr 25 10:47:37 2006 Ben Pfaff Continue reforming error message support. In this phase, drop actual message printing from core code, substituting a callback, and add the callback to each UI. Also, move verbose_msg() into its own module. * message.c: (var err_error_count) Renamed error_count and moved to ui/terminal/msg-ui.c. (var err_warning_count) Renamed warning_count and moved to ui/terminal/msg-ui.c. (err_check_count) Renamed check_msg_count() and moved to ui/terminal/msg-ui.c. (dump_message) Rewrote to take stream instead of function pointer and moved to ui/terminal/msg-ui.c. (msg_emit) Moved its guts to ui/terminal/msg-ui.c as handle_msg() and rewrote to just pass message to callback. (var err_verbosity) Renamed "verbosity" and moved to libpspp/verbose-msg.c. (verbose_msg) Moved to libpspp/verbose-msg.c. (var err_already_flagged) Removed. (puts_stdout) Removed. (var msg_handler) New static variable. (msg_init) New function. (msg_get_command_name) New function. Mon Apr 24 17:40:08 2006 Ben Pfaff Continue reforming error message support. In this phase, rename all the message functions and types to start with "msg", except for the ones that will be moving to other modules anyway. All references to the identifiers below were updated likewise. * message.c: (err_done) Renamed msg_done(). (err_push_file_locator) Renamed msg_push_msg_locator(). (err_pop_file_locator) Renamed msg_pop_msg_locator(). (err_location) Renamed msg_location(). (err_set_command_name) Renamed msg_set_command_name(). Mon Apr 24 14:11:33 2006 Ben Pfaff * message.c: Use exit.h from gnulib instead of checking for and defining EXIT_SUCCESS and EXIT_FAILURE by hand. Sun Apr 23 22:00:23 2006 Ben Pfaff Continue reforming error message support. In this phase, get rid of message "titles" and put the message text in `struct error'. Now `struct error' encapsulates a message more properly. * message.c: (tmsg) Removed. (msg) Use err_msg() instead of err_vmsg(). Format message ourselves. (err_vmsg) Renamed err_msg(). Changed interface, dropping message and va_list args which are now in the error struct. Sun Apr 23 20:35:28 2006 Ben Pfaff Continue reforming error message support. * message.c: Use linebreak module from gnulib instead of home-brew line breaking. (puts_stdout) Rewrote. (dump_message) Rewrote. Changed interface and updated all callers. (compulsory_break) Removed. (char_is_break) Removed. (break_before) Removed. (break_after) Removed. (macro BREAK_LONG_WORD) Removed. Sun Apr 16 20:41:10 2006 Ben Pfaff Continue reforming error message support. In this phase, we divide the classification of messages along "category" and "severity" axes. * message.c: (err_vmsg) Rewrite to deal with categories and severities in a straightforward manner instead of mixing them into classes. [0] (puts_stderr) Removed (dead code). (msg) Changed first argument from `int' to `enum msg_class'. (tmsg) Ditto. Sun Apr 16 18:53:12 2006 Ben Pfaff GNU standards require "file name" instead of "filename" in documentation. It's nice for our code to follow the convention too. Basically did search and replace in the whole source tree. Major changes in function names or struct member names have their own change log entries. Sun Apr 16 15:58:56 2006 Ben Pfaff Continue reforming error message support. In this phase, we get rid of VM() and the other msg() support for "verbosity", replacing it by a new function verbose_msg(). * message.c: (verbose_msg) New function. (err_vmsg) Remove support for verbosity levels. Sun Apr 16 11:46:51 2006 Ben Pfaff Start reforming error message support. In this phase, we get rid of "installation errors" and change all uses of msg() in the output drivers to uses of error() or error_at_line(). * message.c: (err_vmsg) Get rid of IE, IS support. Sat Mar 11 14:17:47 WST 2006 John Darrington * automake.mk: Changed the pattern specific AM_CPPFLAGS to two target specific ones. Eventually there will be none at all. * automake.mk: Moved the pspp binary to ui/terminal Sat Mar 4 12:59:08 2006 Ben Pfaff * In many source files, #include "compiler.h" to get GCC attribute definitions. Sat Mar 4 12:28:09 2006 Ben Pfaff * In many source files, replace INT_DIGITS by INT_STRLEN_BOUND(int) and include intprops.h. John Darrington: * Replaced '_' with '-' in most filenames. * Renamed files as follows: vfm.[ch] to procedure.[ch] error.[ch] to message.[ch] getl.[ch] to line-buffer.[ch] mkfile.[ch] to make-file.[ch] pfm-write.h to por-file-writer.h pfm-write.c to por-file-writer.c sfmP.h to sfm-private.h lex-def.c to identifier.c lex-def.h to identifier.h sfm-read.c to sys-file-reader.c sfm-read.h to sys-file-reader.h sfm-write.h to sys-file-writer.h sfm-write.c to sys-file-writer.c chart.[ch] to chart-geometry.[ch] val.h to value.h var.h to variable.h vars-atr.c to variable.c ctl-stack.c to control-stack.c ctl-stack.h to control-stack.h dfm-read.c to data-reader.c dfm-write.c to data-writer.c dfm-write.h to data-writer.h dfm-read.h to data-reader.h apply-dict.c to apply-dictionary.c mis-val.c to missing-values.c sysfile-info.c to sys-file-info.c modify-vars.c to modifiy-variables.c rename-vars.c to rename-variables.c val-labs.c to value-labels.c var-display.c to variable-display.c var-labs.c to variable-label.c format-prs.c to format-parser.c range-prs.c to range-parser.c range-prs.h to range-parser.h subclist.c to subcommand-list.c subclist.h to subcommand-list.h vars-prs.c to variable-parser.c descript.c to descriptives.c sort-prs.c to sort-criteria.c/sort-cases.c sort-prs.h to sort-criteria.h sel-if.c to select-if.c algorithm.c to array.c algorithm.h to array.h bitvector.h to bit-vector.h som.c to manager.c som.h to manager.h tab.h to table.h tab.c to table.c readln.c to read-line.c readln.h to read-line.h cmdline.c to command-line.c cmdline.h to command-line.h Sat Feb 11 22:35:20 2006 Ben Pfaff General clean-ups and minor bug fixes. * filename.h: Move DIR_SEPARATOR, PATH_SEPARATOR here from pref.h.orig. * lex-def.h: (macro CHAR_IS_ID1) Removed. All references changed to lex_is_id1(). (macro CHAR_IS_IDN) Removed. All references changed to lex_is_idn(). * lex-def.c: (lex_is_id1) New function. (lex_is_idn) New function. (lex_skip_identifier) New function. (lex_id_match_len) Return bool instead of int. (lex_id_match) Ditto. * command.c: (parse_command_name) Convert parsed words to uppercase to make error messages easier to read. (cmd_host) Fix return value. * dfm-read.c: (read_inline_record) Use tokens to check for BEGIN DATA, not specialized lexical analysis. * print.c: (print_space_trns_proc) Count of lines should be `int', otherwise we might never finish. (print_space_trns_free) Close writer. * lexer.c: (enum string_type) New enum. (lex_get) Remove essentially unused local variable `cp'. Use enum string_type values. Use parse_id(). (parse_id) New function. (lex_look_ahead) Recognize octal strings too. (strip_comments) New function. (lex_get_line) Rewrite. (lex_preprocess_line) Removed. (convert_numeric_string_to_char_string) Use enum string_type. (parse_string) Ditto. * autorecode.c: (recode) Clone correct number of bytes based on source string width. Sat Feb 11 22:34:38 2006 Ben Pfaff Reduce dependencies on getl, and of getl. * data-in.c: (vdls_error) Don't output different message depending on whether we're interactive. * getl.h: (struct getl_line_list) Removed. (struct getl_script) Removed. (GETL_PRPT_*) Removed. (GETL_MODE_*) Removed. (GETL_PROMPT_FIRST, GETL_PROMPT_LATER, GETL_PROMPT_DATA, GETL_PROMPT_CNT) New enums. * settings.c: (static var prompt) Removed. (static var cprompt) Removed. (static var dprompt) Removed. (settings_done) Don't initialize prompt, cprompt, dprompt. (get_prompt) Removed. (set_prompt) Removed. (get_dprompt) Removed. (set_dprompt) Removed. (get_cprompt) Removed. (set_cprompt) Removed. * pfm-read.c: (corrupt_msg) Don't show filename and line number, to get rid of getl_location(). * sfm-read.c: (corrupt_msg) Ditto. * getl.c: (struct getl_source) New. (static var cur_source) New. (static var last_source) New. (static var DO_REPEAT_level) Removed. (global var getl_head) Removed. (global var getl_tail) Removed. (getl_initialize) Call init_prompts(). (getl_add_file) Removed. (getl_include) Removed. (getl_add_DO_REPEAT_file) Removed. (getl_handle_line_buffer) Removed. (getl_close_file) Removed. (getl_close_all) Removed. (getl_is_separate) Removed. (getl_set_separate) Removed. (getl_reading_script) Removed. (append_source) New function. (include_source) New function. (create_source) New function. (create_syntax_file_source) New function. (create_filter_source) New function. (create_function_source) New function. (create_interactive_source) New function. (getl_append_syntax_file) New function. (getl_include_syntax_file) New function. (getl_include_filter) New function. (getl_include_function) New function. (getl_append_interactive) New function. (getl_abort_noninteractive) New function. (getl_is_interactive) New function. (close_source) New function. (getl_location) Use new `cur_source' var. (getl_uninitialize) Use close_source(). Call uninit_prompts(). (read_syntax_file) New function. (read_line_from_source) New function. (do_read_line) New function. (getl_read_line) Rewrite. (static var prompts) New. (static var current_style) New. (init_prompts) New function. (uninit_prompts) New function. (getl_get_prompt) New function. (getl_set_prompt) New function. (getl_set_prompt_style) New function. (get_prompt) New function. * command.c: Merge the EXIT (aka Q, aka QUIT) and FINISH commands, and make EXIT undocumented. EXIT was a PSPP extension that never really entirely made sense. (cmd_exit) Removed. (cmd_finish) Return CMD_EOF unconditionally. (cmd_clear_transformations) Drop requirement of interactivity. * command.def: Merge the EXIT (aka Q, aka QUIT) and FINISH commands. * repeat.c: Major changes to match getl revision. (struct line_list) New struct. (enum repeat_entry_type) New. (struct repeat_entry) Made `type' an enum repeat_entry_type. (struct repeat_block) New. (static var repeat_tab) Removed. (static var count) Removed. (static var line_buf_head) Removed. (static var line_buf_tail) Removed. (cmd_do_repeat) Rewritten. (clean_up) Removed. (append_record) Removed. (recognize_keyword) New function. (internal_cmd_do_repeat) Removed. (parse_specification) New function. (skip_indentor) New function. (recognize_do_repeat) New function. (recognize_end_repeat) New function. (parse_lines) New function. (create_vars) New function. (parse_ids) Use enum repeat_entry_type. (parse_strings) Ditto. (find_DO_REPEAT_substitution) Renamed find_substitution(), rewrote. (perform_DO_REPEAT_substitutions) Renamed do_repeat_filter(), rewrote. (do_repeat_read) New function. (do_repeat_close) New function. * data-list.c: Don't need to keep track of eof from getl anymore, because getl can tell us now. (struct data_list_pgm) Removed `eof' member. (cmd_data_list) Don't assign to `eof'. (get_data_list_read_func) Renamed read_from_data_list(), changed interface. (read_from_data_list_fixed) Changed interface. (read_from_data_list_free) Changed interface. (read_from_data_list_list) Changed interface. (data_list_trns_proc) Rewrote based on dfm_eof() and dfm_reader_error(). (data_list_source_read) Check for dfm reader errors. * dfm-read.c: (enum dfm_reader_flags) Removed DFM_EOF in favor of new `eof_cnt' member in struct dfm_reader. (struct dfm_reader) New `eof_cnt' member. (dfm_close_reader) Check `eof_cnt', not DFM_EOF. (dfm_open_reader) Initialize `eof_cnt'. (read_inline_record) Set prompt style with getl_set_prompt_style(). (read_record) Rewrite. (cmd_begin_data) Set prompt style with getl_set_prompt_style(). * include.c: (cmd_include) Use getl_include_syntax_file(). * set.q: (cmd_set) Use getl_set_prompt(). * html.c: (postopen) Remove "source-file" expansion variable, to avoid use of getl_location(). * postscript.c: (postopen) Remove "source-file" expansion variable, to avoid use of getl_location(). * cmdline.c: (parse_command_line) Drop -c command line option, because it wasn't very useful. -i command line option now calls getl_append_interactive(). Use new getl function interfaces. Drop support for clearing dictionary between syntax files and thus the "+" command line syntax. (static var pre_syntax_message) Remove description of now-gone -c option. Remove "+" command line syntax. * main.c: (main) Only call handle_error() if the return value is an error. (execute_command) Use getl_set_prompt_style(). Drop support for clearing dictionary between syntax files. (handle_error) Handle CMD_CASCADING_FAILURE. Don't call err_break(). * readln.c: Drop lots of #ifdefs. Now that the Autoconf tests are pickier, we can just use HAVE_READLINE. (static var welcomed) Move into welcome(). (welcome) Make `welcomed' a local static var. Check for and read history file here. (global var getl_mode) Removed. (global var getl_interactive) Removed. (global var getl_prompt) Removed. (getl_read_line) removed. (readln_read) New function. (read_console) Removed. Sat Feb 11 22:16:21 2006 Ben Pfaff Try to reduce some of the nastier dependencies on the error module, and at the same time make PSPP nicer to deal with, by getting rid of fatal errors. All the existing calls to msg (FE, ...) or err_cond_fail() or err_failure() have been replaced by propagating an error upward to the command-dispatch layer. Unfortunately this propagation took a fair bit of extra mechanism, because now a lot of functions can fail that couldn't before. New command return value CMD_CASCADING_FAILURE which indicates to the command processor that syntax file processing should be abandoned. Many commands were modified to return CMD_CASCADING_FAILURE. When this modification was trivial it isn't mentioned in detail below. Transformation procedures (trns_proc_func) and free functions (trns_free_func) now have a `bool' return type, which is normally true, but false when an I/O or other serious error occurs. All transformation functions were modified to have this return type. When this modification was trivial it isn't mentioned in detail below. * pspp-error.h: (FE) Removed this error class. * error.c: (err_failure) Removed. (err_cond_fail) Removed. (err_break) Removed (it was unused). (err_check_count) Don't cause a fatal error--instead, stop reading the syntax file. (err_vmsg) Don't have FE anymore, so no need to call terminate(). * any-reader.c: (any_reader_error) New function. * any-writer.c: (any_writer_write) Propagate scratch_writer_write_case()'s new return value. (any_writer_error) New function. (any_writer_close) Propagate underlying function's new return value. * casefile.c: Add an "error state" to a casefile. A casefile that encounters an I/O error enters the error state, and afterward reading and writing cases fails. (struct casefile) Add `ok' member. (casefile_create) Set `ok' to true. (casefile_destroy) Use io_error(). (casefile_error) New function. (casefile_sleep) Now returns bool to indicate success. (casefile_append) Ditto. (casefile_append_xfer) Ditto. (casefile_to_disk) Ditto. (write_case_to_disk) Don't do anything in error state. (flush_buffer) Don't do anything in error state. Use io_error(). (reader_open_file) Ditto. (fill_buffer) Ditto. (casereader_read) Don't do anything in error state. Handle errors. (casereader_read_xfer_assert) Removed, because now an I/O error can occur even if the caller knows a case exists. (io_error) New function. * mkfile.c: (make_temp_file) Make failure non-fatal. (make_unique_file_stream) Ditto. * pfm-read.c: Add an error state. (struct pfm_reader) Add `ok' member to indicate error state. (error) Set `ok' to false. (pfm_open_reader) Set `ok' to true. Make failure non-fatal. (pfm_read_case) Don't do anything in error state. (pfm_read_error) New function. * pfm-write.c: Postpone most error checking in favor of checking ferror() afterward. (pfm_open_writer) Make failure non-fatal. Check for write error after writing header. (buf_write) Don't do anything if error has occurred. Postpone error checking. Change return type to void. (write_float) Postpone error checking. Change return type to void. (write_int) Ditto. (write_string) Ditto. (write_header) Ditto. (write_version_data) Ditto. (write_format) Ditto. (write_value) Ditto. (write_variables) Ditto. (write_value_labels) Ditto. (pfm_write_case) Don't do anything if error has occurred. (pfm_write_error) New function. (pfm_close_writer) Change return type to bool. Return false if an I/O error occurred. * scratch-reader.c: (scratch_reader_error) New function. * scratch-writer.c: (scratch_writer_write_case) Change return type to bool. Propagate casefile error return. (scratch_writer_error) New function. (scratch_writer_close) Change return type to bool. Propagate casefile error return. * sfm-read.c: Add an error state. (struct sfm_reader) Add `ok' member. (sfm_open_reader) Initialize `ok'. Make errors non-fatal. (buf_read) Set `ok' to false on error. (buffer_input) Do nothing in error state. Set `ok' to false on error. (read_compressed_data) Set `ok' false on error. (sfm_read_case) Return false in error state. (fread_ok) Set `ok' false on error. (sfm_read_error) New function. * sfm-write.c: Postpone most error checking in favor of checking ferror() afterward. (sfm_open_writer) Make failure non-fatal. Check for write error after writing header. (write_header) Postpone error checking. Change return type to void. (write_variable) Ditto. (write_value_labels) Ditto. (write_documents) Ditto. (write_variable_display_parameters) Ditto. (write_longvar_table) Ditto. (write_rec_7_34) Ditto. (buf_write) Ditto. (ensure_buf_space) Ditto. (sfm_write_case) Do nothing if write error has occurred. (sfm_write_error) New function. (pfm_close_writer) Change return type to bool. Return false if an I/O error occurred. * var.h: Introduced a new return value for trns_proc_func that means "a serious error has occurred, so abort the procedure entirely". Because the hard-coded values of -1, -2, etc. were becoming even a worse idea now, also introduced some macros for them: TRNS_CONTINUE, TRNS_DROP_CASE, TRNS_ERROR, TRNS_NEXT_CASE, TRNS_END_FILE. Also replaced all references to the hard-coded values by uses of the macros. * command.h: New command return value CMD_CASCADING_FAILURE which indicates to the command processor that syntax file processing should be abandoned. * dfm-read.c: (dfm_open_reader) Make failure non-fatal. (dfm_reader_error) New function. (read_inline_record) Make unexpected end of file nonfatal. (read_file_record) Make read error nonfatal. (dfm_eof) Make second unexpected end of file nonfatal. (cmd_begin_data) Make errors nonfatal. * dfm-write.c: (dfm_open_writer) Make failure non-fatal. (dfm_write_error) New function. (dfm_put_record) Do nothing in error state. Now return error state. (dfm_close_reader) Now return `bool' indicating error state. * file-type.c: (file_type_source_read) Now return `bool' indicating error state. * get.c: (case_reader_source_read) Now return `bool' indicating write error. (case_writer_destroy) Ditto. (case_writer_write_case) Ditto. (struct mtf_proc) New member `ok' indicating error state. (cmd_match_files) Initialize and deal with `ok'. (mtf_processing_finish) Now return `bool' indicating I/O error. (mtf_free_file) Renamed mtf_close_file(). Now return `bool' indicating I/O error. (mtf_free) Now return `bool' indicating I/O error. (mtf_delete_file_in_place) Ditto. (mtf_read_nonactive_records) Ditto. (mtf_processing) Ditto. * inpt-pgm.c: (input_program_source_read) Now return `bool' indicating I/O error. Handle new TRNS_ERROR transformation return value. * matrix-data.c: Introduce error state. (cmd_matrix_data) Check error return values. (read_matrices_without_rowtype) Now return `bool' indicating I/O error. (matrix_data_read_without_rowtype) Ditto. (dump_cell_content) Ditto. (nr_output_data) Ditto. (read_matrices_with_rowtype) Ditto. (matrix_data_read_with_rowtype) Ditto. (wr_output_data) Ditto. * lexer.c: (lex_init) Make unexpected eof non-fatal. (lex_get) Ditto. (lex_look_ahead) Ditto. (unexpected_eof) Removed. (convert_numeric_string_to_char_string) Make unexpected eof non-fatal. (parse_string) Ditto. * flip.c: Make I/O errors non-fatal. (struct flip_pgm) Add `pool', `output_buf' members. (cmd_flip) Create and use pool. Propagate errors. (destroy_flip_pgm) Rewrite, using pool. (struct flip_sink_info) Removed. (flip_sink_create) Use pool. Make errors non-fatal. (flip_sink_write) Make errors non-fatal. (flip_file) Make errors non-fatal. Make `bool' return type to indicate failure. (flip_sink_destroy) Remove. (static var flip_sink_class) Use NULL as destroy func, not flip_sink_destroy(). * sort.c: Make I/O errors non-fatal. Propagate errors. (sort_active_file_in_place) Propagate errors. (sort_active_file_to_casefile) Ditto. (do_internal_sort) Ditto. (do_external_sort) Ditto. (write_runs) Ditto. (destroy_initial_run_state) Propagate errors via new `bool' return type. (merge) Propagate errors. (merge_once) Ditto. * output.c: [GLOBAL_DEBUGGING] Remove reentrancy detection, because it used msg (FE, ...) and wasn't very useful. * main.c: (handle_error) Handle CMD_CASCADING_FAILURE. * vfm.c: (struct write_case_data) Change `proc_func' return type to bool. (procedure) Add `bool' return type to indicate I/O error. Propagate errors. (internal_procedure) Ditto. (write_case) Ditto. (execute_transformations) If a transformation returns TRNS_ERROR, propagate the error. (close_active_file) Add `bool' return type to indicate I/O error. Propagate errors. (cancel_transformations) Add `bool' return type to indicate I/O error. Propagate errors. (struct split_aux_data) Change `proc_func' return type to bool. (procedure_with_splits) Change `proc_func' return type to bool. Add `bool' return type to indicate I/O error. (multipass_procedure_with_splits) Change `split_func' return type to bool. Add `bool' return type to indicate I/O error. (multipass_split_callback) Add `bool' return type to indicate I/O error. Propagate errors. * vfm.h: (struct case_source_class) Change `read' return type from void to bool to allow reporting I/O errors. Updated all implementations to do so. (struct case_sink_class) Change `write' return type from void to bool to allow reporting I/O errors. Updated all implementations to do so. Sun Feb 12 18:12:56 2006 Ben Pfaff * pool.c: Useful new functions. (pool_tmpfile) New function. (pool_attach_file) New function. (pool_detach_file) New function. (pool_fopen) Reimplement in terms of pool_attach_file(). (pool_fclose) Reimplement in terms of pool_detach_file(). Fix double-free. * str.c: Useful new functions. (ds_swap) New function. (ds_rtrim_spaces) New function. (ds_chomp) New function. (ds_is_empty) New function. (ds_first) New function. (ds_last) New function. Sat Feb 11 21:51:21 2006 Ben Pfaff Get rid of finished, start_interactive globals. * command.c: (cmd_exit) Instead of setting `finished', return CMD_EOF. (cmd_finish) Ditto. * command.h: New enum CMD_EOF. * main.c: (global var finished) Removed. (global var start_interactive) Removed. (main) Execute commands until CMD_EOF is the return value. If parse_command_line() returns false, don't execute any commands at all. * cmdline.c: (parse_command_line) If the command line indicates we shouldn't execute syntax files, return false instead of terminating. (usage) Don't terminate. Sat Feb 11 21:48:31 2006 Ben Pfaff Get rid of cur_proc global. Replace by functions in err and tab modules, which were the users. * error.c: (static var command_name) New static var. (err_vmsg) Use command_name. (err_set_command_name) New function. * tab.c: (static var command_name) New static var. (tabi_title) Use command_name. (tab_set_command_name) New function. * command.c: (global var cur_proc) Removed. (cmd_parse) Call err_set_command_name(), tab_set_command_name() around executing command to set and clear command name. Sat Feb 11 21:44:50 2006 Ben Pfaff Get rid of glob.c, glob.h. * Makefile.am: (pspp_SOURCES) Remove glob.c, glob.h. * dictionary.c: Move default_dict definition here. * glob.c: Removed. (global var FILTER_before_TEMPORARY) Variable removed. All references deleted. The info in this var was redundant with temp_dict, so they were changed to use temp_dict where needed. * glob.h: Removed. * start-date.c: New file. Moved get_start_date() here. * start-date.h: New file. Fri Feb 3 20:34:52 2006 Ben Pfaff * font.h: (struct font_set) Removed, because unused. Sat Jan 28 17:45:36 2006 Ben Pfaff Cleaner (faster?) way to compact cases. * dictionary.c: (dict_compact_case) Removed. (dict_needs_compaction) New function. (struct copy_map) New structure. (struct dict_compactor) New structure. (dict_make_compactor) New function. (dict_compactor_compact) New function. (dict_compactor_destroy) New function. Sat Jan 28 17:24:22 2006 Ben Pfaff Cleanups. * data-list.c: Make data_list_source_class static. (dump_fixed_table) Use fh_get_name() to describe source of data. (dump_free_table) Ditto. (cmd_repeating_data) Eliminate special cases for inline file. * dictionary.c: (dict_contains_var) Change return value from int to bool. (dict_rename_vars) Ditto. (dict_create_vector) Ditto. Sat Jan 28 17:20:50 2006 Ben Pfaff Add scratch file handles. Now a file handle can refer to a disk file, to an in-memory structure, or to the "inline" file, instead of just to a disk file. The introduction of new categories means that special cases for the inline file in a few places could be eliminated, but it also means that code that assumed that a handle refers to a file has to check for that. Also, now file handles can be freed, so code now must be sure not to access a handle after closing it (with fh_close()). * Makefile.am: Add any-reader.c, any-reader.h, any-writer.c, any-writer.h, scratch-handle.c, scratch-handle.h, scratch-reader.c, scratch-reader.h, scratch-writer.c, scratch-writer.h to pspp_SOURCES. * any-reader.c: New file. * any-reader.h: New file. * any-writer.c: New file. * any-writer.h: New file. * scratch-handle.c: New file. * scratch-handle.h: New file. * scratch-reader.c: New file. * scratch-reader.h: New file. * scratch-writer.c: New file. * scratch-writer.h: New file. * aggregate.c: Use an any_writer instead of an sfm_writer, to add flexibility. * apply-dict.c: Use an any_reader instead of an sfm_reader, to add flexibility. * command.def: Add CLOSE FILE HANDLE command. * dfm-reader.c: Now fewer special cases for inline file. (static var inline_open_cnt) Removed. (static var inline_file) Removed. (dfm_close_reader) Eliminate a special case for inline file. Reorganize to avoid access-after-free. (dfm_open_reader) Eliminate a special case for inline file. (read_inline_record) Use bool instead of int. No need to increment line number. (read_file_record) Use bool instead of int. (read_record) Check whether file handle is inline file, instead of for null pointer. (dfm_eof) Ditto. (dfm_expand_tabs) Ditto. (dfm_push) Ditto. (dfm_pop) Ditto. (cmd_begin_data) Fix inaccurate check for whether the inline file is in use--now we can tell by checking whether the inline file's open count is positive. * file-handle-def.c: (struct file_handle) Reorder members. Add `deleted' member. Add `referent' member. Add `sh' member. (static var default_handle) New variable. (static var inline_file) New variable. (fh_init) Initialize inline file. (free_handle) New function. (fh_done) Rewrite. (fh_from_name) Don't return deleted handles. (fh_from_filename) Ditto. (fh_create) Removed. (create_handle) New function. (fh_create_file) New function. (fh_create_scratch) New function. (fh_inline_file) New function. (fh_free) Rewrite. (fh_open) Now requires a referent type mask and verifies it. All references updated. (fh_close) If open_cnt goes to 0 on a deleted handle, free it. (fh_is_open) New function. (fh_get_referent) New function. (fh_get_filename) Limit to handles that refer to files. (fh_get_mode) Ditto. (fh_get_record_width) Limit to handles that refer to files or the inline file. (fh_get_tab_width) Ditto. (fh_get_scratch_handle) New function. (fh_set_scratch_handle) New function. (fh_get_default_handle) New function. (fh_set_default_handle) New function. * file-handle.h: (enum fh_referent) New type. (enum fh_mode) Rename MODE_TEXT to FH_MODE_TEXT, MODE_BINARY to FH_MODE_BINARY, and update all usages. * file-handle.q: Add "scratch" as a possible mode. (cmd_file_handle) Mention CLOSE FILE HANDLE in error message. Use lex_end_of_command(), lex_sbc_missing(). Support creating scratch handles. (cmd_close_file_handle) New function. (referent_name) New function. (fh_parse) Now takes a referent type mask to specify handles that can be accepted. Updated all references. * filename.c: (fn_extension) New function. * get.c: Use any_reader and any_writer and thereby merge code that has been duplicated for each kind of file. Also, we had something here called `any_writer' before, so its name had to be changed to `case_writer'. (enum operation) Removed, because unused. (struct get_pgm) Removed. (get_pgm_free) Removed. (get_source_destroy) Removed. (get_source_read) Removed. (global var get_source_class) Removed. (static var case_reader_source_class) Removed. (enum reader_command) New enum. (struct case_reader_pgm) New struct. (parse_read_command) New function. (case_reader_pgm_free) New function. (case_reader_source_destroy) New function. (case_Reader_source_Read) New function. (cmd_get) Rewrote as a call to parse_read_command(). (cmd_import) Ditto. (struct any_writer) Rename to case_writer. Drop `writer_type', `writer' members in favor of an `any_writer' member named `writer'. (any_writer_destroy) Rename case_writer_destroy. Use any_writer_close(). (parse_write_command) Allow scratch files. Use any_writer. (any_writer_write_case) Rename case_writer_write_case(). Use any_writer_write(). ` (struct mtf_file) Use any_reader. (cmd_match_files) Allow scratch files. Use any_reader. (mtf_free_file) Use any_reader_close(). (mtf_read_nonactive_records) Use any_reader_read(). (mtf_processing) Use any_reader_read(). (struct import_pgm) Removed. (import_pgm_free) Removed. (import_source_destroy) Removed. (import_source_read) Removed. (global var import_source_class) Removed. * glob.c: (global var default_handle) Removed. Replaced all references by fh_get_default_handle() or fh_set_default_handle(). * pfm-read.c: (static var portable_to_local) Moved from inside read_header() to top level. (pfm_detect) New function. * pfm-write.c: (pfm_write_case) Make case argument const. Reorganize to avoid access-after-free. * print.c: (dump_table) Use fh_get_name() to describe source of data. * sfm-read.c: (sfm_close_reader) Reorganize to avoid access-after-free. (sfm_detect) New function. * str.c: (str_lowercase) New function. * vfm.c: Use new compaction interface. (static var compaction_necessary) Removed. (static var compactor) New variable. (open_active_file) Initialize compactor. (write_case) Use compactor. (close_active_file) Free compactor. Wed Jan 11 19:28:39 2006 Ben Pfaff Clean up file handle code in preparation to add scratch file handles. * file-handle-def.c: Lots of formatting cleanup. Added function comments. (struct file_handle) Renamed `length' member to `record_width'. All references updated. (fh_init) New function. Moved here from file-handle.q. (fh_done) New function. Moved here from file-handle.q and rewrote. (get_handle_with_name) Renamed fh_from_name(). (get_handle_for_filename) Renamed fh_from_filename(). (create_file_handle) Renamed fh_create(). Changed to take a `struct fh_properties' instead of discrete values. Updated all references. (create_file_handle_with_defaults) Removed. Updated all references to use fh_create() with fh_default_properties(). (fh_default_properties) New function. (destroy_file_handle) Removed. The code is now in fh_done(). (handle_get_name) Renamed fh_get_name(). (handle_get_filename) Renamed fh_get_filename(). (handle_get_record_width) Renamed fh_get_record_width(). (handle_get_tab_width) Renamed fh_get_tab_width(). * file-handle-def.h: Formatting, comment fixes. (enum file_handle_mode) Renamed struct fh_mode. (struct fh_properties) New structure. (fh_init) Move prototype here from file-handle.h. (fh_done) Ditto. (fh_close) Ditto. * file-handle.q: (static var handle_list) Removed. (fh_parse) Don't add handle to handle_list, because file-handle-def.c has its own list. (fh_init) Moved to file-handle-def.c. (fh_done) Ditto. Sun Jan 9 01:09 Jason Stover * regression.q: (run_regression) Moved coefficient initialization to the linreg library. Altered other functions accordingly. Sat Jan 7 13:30:54 WST 2006 John Darrington * command.c data-in.c main.c: Fixed bug which crept in when separating getl from readline. * vars-atr.c value-labels.h: Fixed constness of val_labs_count. Fri Dec 23 20:59:01 WST 2005 John Darrington * getl.c error.c: Separated file_loc functionality from error.c Mon Dec 19 14:01:56 WST 2005 John Darrington * format.c: Additional error checking. * getl.[ch]: Separated into getl.c and readln.c * settings.[ch]: Made CC_CNT public Fri Dec 16 09:11:48 WST 2005 John Darrington * examine.q: Fixed buglet when cleaning up at end of procedure. Tue Dec 13 22:34:42 2005 Ben Pfaff Move global initialization and cleanup code into main.c. Remove vestigial log infrastructure. Minor related cleanups. * command.c: (shell) When execl() fails, use _exit(), not err_hcf(). * error.c: (err_hcf) Move into main.c, rename terminate(). All callers updated. (err_done) New function with just the error.c-specific code for err_hcf(). Called by terminate(). * glob.c: Removed all Borland C, DJGPP cruft. (init_glob) Merged into main(). (done_glob) Merged into terminate(). (get_date) Removed. (get_start_date) New function. All users of curdate updated to call this function instead. * lexer.c: (lex_init) Moved initialization of tokstr here, from init_glob(). (lex_done) Moved destruction of tokstr here, from done_glob(). * main.c: (global var pgmname) Removed. Changed all references to program_name, which is defined by gnulib. (global var curdate) Removed. (main) Moved init_glob() code here. Merged parse_script() in here. (parse_script) Removed. (terminate) Moved err_hcf() here from error.c and renamed terminate(). Merged done_glob() code in here. Call err_done(). All callers updated. (i18n_init) New function. (fpu_init) New function. * output.c: (outp_init) Make void. (init_default_drivers) New function. (outp_read_devices) If no drivers are initialized successfully, call init_default_drivers() to initialize a default driver. (outp_done) Make void. (static var prog) Make const. (parse_options) Make parameter const. (colon_tokenize) Make return value const. (configure_driver) Change prototype to take a broken-down driver configuration instead of a line of text. (configure_driver_line) New function that does what configure_driver() did before. * q2c.c: (global var pgmname) Rename program_name. * settings.c: (settings_init) Renamed from init_settings(). (settings_done) Renamed from done_settings(). * vfm.c: (global var last_vfm_invocation) Make static. (vfm_last_invocation) New function. All references to last_vfm_invocation update to call this. (procedure) Call update_last_vfm_invocation(). (internal_procedure) Ditto. (update_last_vfm_invocation) New function. Sat Dec 10 23:30:19 2005 Ben Pfaff Separate random numbers from other settings because of GSL dependency. * Makefile.am: Add random.c, random.h to sources. * glob.c: (init_glob) Call random_init(). (done_glob) Call random_done(). * settings.c: (static var rng) Move to random.c. (done_settings) Move freeing of RNG to random_done(). (get_rng) Move to random.c (set_rng) Ditto. * random.c: New file. * random.h: New file. Sat Dec 10 18:13:36 2005 Ben Pfaff Separate settings and the SET command, for modularity. * Makefile.am: Add settings.c to sources. * glob.c: (global variable test_mode) Removed. * set.q: Remove all the set_* variables. Remove a lot of obsolete SPSS/PC+ settings. Remove the aux_*() routines. Moved the get_*() functions into settings.c. Rewrite the settings code and functions to call the new set_*() functions. Rewrite custom currency parsing. Write new by-hand cmd_show(). * esttings.c: New file. Moved the get_*() functions here from set.q. Created new set_*() functions to correspond with them. Regularized the names and types of some functions and updated their callers. Added static, file-scope variables to support the settings. * q2c.c: Remove "aux" support, which was only needed by set.q. Sun Nov 27 06:43:46 WST 2005 John Darrington * data-out.c format.h: Added return value to data_out function. * value-labels.c: Fixed bug in val_labs_remove. Sat Nov 5 18:37:26 2005 Ben Pfaff * Makefile.am: Remove devind.c, devind.h from list of source files. * devind.c: Removed. * devind.h: Removed. * list.q: Removed "support" for devind. * output.c: Don't add devind class. Sat Nov 5 18:21:00 2005 Ben Pfaff * var.h: (struct variable) Make `init', `reinit' bool values. Rearrange fields. Fri Nov 4 19:43:01 2005 Ben Pfaff * recode.c: Rewrote whole file, as clean-up. Fri Nov 4 19:37:50 2005 Ben Pfaff * pool.c: Don't make alignment exception for x86. (pool_alloc) Return null for 0-size blocks. (pool_alloc_unaligned) New function. (pool_strndup) Removed. Changed callers to use pool_clone_unaligned(). (pool_clone_unaligned) New function. (pool_strdup) Use pool_clone_unaligned(). * var.h: (enum var_type) Give the NUMERIC, ALPHA enum this name. (struct variable) Use `enum var_type' for `type'. * vars-atr.c: (var_type_adj) New function. (var_type_noun) New function. * vars-prs: (parse_mixed_vars) Fix freeing code. (parse_mixed_vars_pool) New function. Wed Nov 2 21:24:48 2005 Ben Pfaff * file-handle-def.c: Needed another #include, to avoid missing prototype warning. * file-handle.q: (cmd_file_handle) Declarations must precede statements. Free parse data on success as well as on failure, to avoid memory leak. * get.c: (parse_write_command) Destroy dict on success, to avoid memory leak. * data-list.c: (cmd_repeating_data) Fix usage of saw_occurs, saw_length, saw_continued, saw_id, which were boolean but incorrectly treated as bitmaps as result of a previous half-finished cleanup. * weight.c: (struct weight_trns) Unused, so removed. * Makefile.am: Add range-prs.h to sources. Wed Nov 2 21:24:15 2005 Ben Pfaff DO IF, LOOP cleanup. * Makefile.am: Add ctl-stack.c, ctl-stack.h to source files. Reformat source file list to list one file per file, so that patches for future changes will be easier to read. * ctl-stack.c, ctl-stack.h: New files. * do-if.c: Rewrote whole file. * do-ifP.h: Removed. * loop.c: Rewrote whole file. * glob.c: (global var ctl_stack) Move into ctl-stack.c. * temporary.c: (cmd_temporary) Use ctl_stack_is_empty(). * vfm.c: (open_active_file) Use ctl_stack_clear(). Wed Nov 2 21:18:13 2005 Ben Pfaff New pool functions. * pool.c: (pool_create_at_offset) New function. (pool_add_subpool) New function. * pool.h: (pool_create_container) New macro. * expressions/parse.c: (expr_parse_pool) New function. * autorecode.c: (recode) Use pool_create_container(). * count.c: (cmd_count) Ditto. Wed Nov 2 19:59:32 2005 Ben Pfaff Clean up transformations, by getting rid of `struct trns_header', replacing it by `struct transformation' that has a void * `private' member. Updated all uses of transformations to match, which was a lot of code. Only major related changes listed below. * compute.c: (cmd_if) Use get_proc_func(). (cmd_compute) Use get_proc_func(). (get_proc_func) New function. * glob.c: (global var m_trns) Change type to size_t. (global var n_trns) Ditto. (global var f_trns) Ditto. (global var t_trns) Change type to struct transformation *. * var.h: (struct trns_header) Removed. (struct transformation) New. (typedef trns_proc_func) Takes a void * instead of a struct trns_header *. (typedef trns_free_func) Ditto. * vfm.c: (execute_transformations) Takes an array of transformations instead of trns_headers. (add_transformation) Change prototype from (trns_header *) to (trns_proc_func *, trns_free_func *, void *). (next_transformation) New function. Sat Oct 29 16:25:36 2005 Ben Pfaff * count.c: Major cleanups. Rename practically everything. Rewrite much of the code. Use pools for memory management. Use the new parse_num_range(). * mis-val.c: (cmd_missing_values) Use the new parse_num_range(). (parse_number) Removed. * missing-values.c: (mv_add_num_range) Don't add out-of-order ranges, e.g. where low > high. * pool.c: (pool_2nrealloc) New function. * range-prs.c: New file. (parse_num_range) New function. (parse_number) New function. Fri Oct 28 22:47:48 2005 Ben Pfaff Fix up potential overflows in size calculations by replacing instances of pool_alloc(p, x * sizeof *y) by pool_malloc(p, x, sizeof *y) everywhere I could find them. Similarly by pool_malloc(), pool_realloc(). (Order is important: pool_alloc(p, sizeof *y, x) will divide by 0 if x is 0.) * pool.c: (pool_nalloc) New function. (pool_nmalloc) New function. (pool_nrealloc) New function. Thu Oct 27 11:16:53 WST 2005 John Darrington Separated the definition of a file handle object from the stuff pertaining to the FILE HANDLE command. * file-handle-def.[ch]: New files. * dfm-read.c file-handle.h file-handle.q Tue Oct 25 21:56:23 2005 Ben Pfaff Fix up potential overflows in size calculations by replacing instances of xmalloc(x * sizeof *y) by xnmalloc(x, sizeof *y) everywhere I could find them. Similarly by xrealloc(), malloc(). (Order is important: xnmalloc(sizeof *y, x) will divide by 0 if x is 0.) * alloc.c: (nmalloc) New function. (out_of_memory) Removed. Replaced references by xalloc_die(). * sort.c: (allocate_cases) Fix segfault if memory allocation fails. * subclist.c: (subc_list_double_create) Use xnmalloc() instead of malloc(). (subc_list_double_push) Use xnrealloc() instead of realloc(). Wed Oct 26 08:43:51 WST 2005 John Darrington Dictionary abstraction part #2 * algorithm.c format.c str.c sysfile-info.c val.h var.h vars-atr.c: Removed unnecessary #include directives Mon Oct 24 21:35:08 2005 Ben Pfaff * groff-font.c (font_msg): Use err_vmsg() instead of incorrectly trying to pass a va_list to tmsg(). Thanks to Jason Stover for reporting this bug. Mon Oct 24 21:24:15 2005 Ben Pfaff Work to get rid of GCC 4.0 warnings, part 2. In many files, change `unsigned char' to `char'. This often requires adding casts to functions. * data-in.c: (parse_A) Use buf_copy_rpad(). * str.c: (str_copy_buf_trunc) New function. * value-labels.c: (value_to_string) Fix mistaken use of strncpy(), by rewriting. Mon Oct 24 13:42:32 WST 2005 John Darrington Moved some definitions to make it easier to abstract a dictionary from the rest of PSPP. * format-prs.c lex-def.[ch]: New files. * Makefile.am lexer.[ch] dictionary.c vars-atr.c vfm.c algorithm.c format.c: Moved some functions between modules. Sun Oct 23 19:28:08 2005 Ben Pfaff Work to get rid of GCC 4.0 warnings, part 1. In many files, change count parameters to parse_variables(), etc. from `int' to `size_t'. Also change related variables and struct members. Also change messages as needed (e.g. %d to %u with cast to unsigned). Also change arithmetic as necessary (e.g. n >= m - 1 to n + 1 >= m). * crosstabs.q: (crs_custom_tables) Check for size_t overflow in multiplication. * q2c.c: (dump_declarations) Generate code for size_t instead of int. Thu Oct 20 18:18:40 2005 Ben Pfaff * output.c: (outp_read_devices) Fix message. Sat Sep 17 11:13:13 2005 Ben Pfaff * matrix-data.c: (cmd_matrix_data) Change type of variable whose address is passed to dict_get_vars() from size_t to int to match John's change below. * modify-vars.c: (validate_var_modification) Ditto. Mon Sep 12 19:26:06 WST 2005 John Darrington * dictionary.[ch] Changed cnt from size_t* to int* since that's what it's called as, and on x86_64 machines they're different sizes. * str.c: (ds_vprintf) Copied va_list args so they can be re-used Sun Aug 21 00:12:24 2005 Ben Pfaff * lexer.c: (lex_sbc_only_once) New function. (lex_sbc_missing) New function. Sun Aug 21 00:00:47 2005 Ben Pfaff * case.h: (case_str) Make it return `unsigned char'. Sat Aug 20 23:56:14 2005 Ben Pfaff Revamp SAVE, XSAVE, EXPORT. Add (or at least parse) all the subcommands that we didn't support. Fix bug 13911. Fix bug reported by Adam Pierson (COMPRESSED and other subcommands didn't work on SAVE). Refactor all related code. * command.def: Add XEXPORT command. * dictionary.c: (dict_delete_scratch_vars) New function. * get.c: (cmd_get) Fix parsing. (struct save_trns) Removed. (cmd_save_internal) Removed. (cmd_save) Removed. (do_write_case) Removed. (save_write_case_func) Removed. (save_trns_proc) Removed. (save_trns_free) Removed. (trim_dictionary) Removed. (struct export_proc) Removed. (cmd_export) Rewrote. (export_write_case_func) Removed. (export_proc_free) Removed. (enum writer_type) New enum. (enum command_type) New enum. (struct any_writer) New struct. (any_writer_destroy) New function. (parse_write_command) New function. (any_writer_write_case) New function. (parse_output_proc) New function. (output_proc) New function. (cmd_save) Rewrote. (cmd_xsave) Rewrote. (struct output_trns) New struct. (parse_output_trns) New function. (output_trns_proc) New function. (output_trns_free) New function. (cmd_xsave) Rewrote. (cmd_xexport) New function. (parse_dict_trim) New function. (struct mtf_proc) Change `by_cnt' member type to `int'. (cmd_import) Rewrote. * pfm-write.c: (struct pfm_writer) Add `digits' member. (pfm_writer_default_options) New function. (pfm_open_writer) Add `opts' argument and handle options. (write_float) Write only as many digits as `digits' member says. (format_trig_double) Limit base-10 precision to LDBL_DIG. * pfm-write.h: (enum pfm_type) Moved here from pfm-read.h. (struct pfm_write_options) New struct. * sfm-write.c: (sfm_writer_default_options) New function. (sfm_open_writer) Remove `compress', `omit_long_names' args. Add `opts' argument. Implement options. * sfm-write.h: (struct sfm_write_options) New struct. * expressions/helpers.c: (copy_string) Make `old' arg `unsigned char *' instead of `char *'. Sat Aug 6 21:29:15 2005 Ben Pfaff * factor_stats.c: Needed included earlier. * percentiles.c: Needed to include . * val.h: Don't include "config.h". Sat Aug 6 21:26:27 2005 Ben Pfaff Clean up treatment of missing values by moving all the code into one place. All references to the missing value function were updated, but only major changes are detailed below. * Makefile.am: Add missing-values.c, missing-values.h to sources. * apply-dict.c: (cmd_apply_dictionary) Use mv_resize(). * dictionary.c: (dict_create_var) Initialize `miss' member with mv_init(). (dict_clone_var) Copy `miss' member with mv_copy(). * get.c: (mtf_merge_dictionary) Use mv_copy(). * missing-values.c: New file. * missing-values.h: New file. * mis-val.c: Rewrite. New version implements updated semantics. * pfm-read.c: (read_variables) Rewrite missing value handling. * pfm-write.c: (write_variables) Rewrite missing value handling. * sfm-read.c: (read_variables) Rewrite missing value handling. * sfm-write.c: (write_variable) Rewrite missing value handling. * sfmP.h: Include "magic.h" to get definition of second_lowest_value. * sysfile-info.c: (describe_variable) Rewrite missing value handling. * val.h: Include "magic.h" to get definition of second_lowest_value. * var.h: Include "missing-values.h". Drop MISSING_* enums. (struct variable) Remove `miss_type', `missing'. Add `miss'. * vars-atr.c: (is_num_user_missing) Removed--use mv_is_num_user_missing(). (is_str_user_missing) Removed--use mv_is_str_user_missing(). (is_system_missing) Removed--use mv_is_value_system_missing(). (is_missing) Removed--use mv_is_value_missing(). (is_user_missing) Removed--use mv_is_value_user_missing(). Sun Jul 31 14:09:57 2005 Ben Pfaff Adopt use of gnulib for portability. * Make.build: Add $(top_srcdir)/gl and $(top_builddir)/gl to include path. * Makefile.am: Remove bool.h, stat.h and change getline.[ch] to getl.[ch] in pspp_SOURCES. Remove libmisc, add libgl in pspp_LDADD. * In many source files, added an explicit inclusion of gettext.h and definition of _ macro. These are no longer in pref.h because it interfered with definitions in a few gnulib source files. * In many source files, changed #include "bool.h" to #include , which is provided by gnulib. * alloc.c: Removed functions defined in gnulib: (xmalloc) Removed. (xcalloc) Removed. (xrealloc) Removed. (xstrdup) Removed. (out_of_memory) Redefined as wrapper for xalloc_die(). * alloc.h: Replace prototypes by #include "xalloc.h". * casefile.c: Use full_read() and full_write() from gnulib instead of our home-grown versions. (full_read) Removed. (full_write) Removed. * getline.c: Renamed getl.c. * getline.h: Renamed getl.h, updated all references. * filename.c: (fn_readlink) Change to wrapper around xreadlink() from gnulib. * glob.c: Just #include instead of the crazy rigmarole here before. (init_glob) Call set_program_name() to initial gnulib progname module. * html.c: (postopen) Use getlogin_r(), gethostname() from gnulib. * permissions.c: Use "stat-macros.h" from gnulib. * postscript.c: Just #include instead of the crazy rigmarole here before. * q2c.c: (main) Make generated code #include "gettext.h". * str.h: Get rid of most explicit declarations of standard functions, in favor of including gnulib header files. * expressions/evaluate.c: Ditto. * expressions/operations.h.pl: Make generated code #include , not "bool.h". Sat Jul 30 23:13:17 2005 Ben Pfaff * expressions/parse.c: (validate_function_args) Fix two msg() bugs found by -Wformat. Sat Jul 30 23:10:01 2005 Ben Pfaff * expressions/evaluate.c: (expr_debug_print_postfix) Don't pass null pointer to printf for %.*s. Sat Jul 30 23:05:33 2005 Ben Pfaff * vars-atr.c: (var_is_valid_name) Fix three msg() bugs found by -Wformat. Sat Jul 30 22:58:33 2005 Ben Pfaff * rank.q: (parse_rank_function) Fix msg() bug found by -Wformat. Sat Jul 30 22:56:12 2005 Ben Pfaff * postscript.c: (postopen) Cast `char' to `unsigned char' before passing to isspace(). Sat Jul 30 22:52:09 2005 Ben Pfaff * pfm-read.c: (read_variables) Fix msg() bug found by -Wformat. Sat Jul 30 22:50:57 2005 Ben Pfaff * histogram.c: Include . Sat Jul 30 22:48:50 2005 Ben Pfaff * get.c: (cmd_match_files) Fix msg() bug found by -Wformat. Sat Jul 30 22:46:10 2005 Ben Pfaff * format.c: (check_common_specifier) Fix msg() bug found by -Wformat. (check_output_specifier) Ditto. Sat Jul 30 22:43:57 2005 Ben Pfaff * file-handle.q: (cmd_file_handle) Fix msg() bug found by -Wformat. Sat Jul 30 22:41:44 2005 Ben Pfaff * data-in.c: (parse_Z) [WORDS_BIGENDIAN] Don't declare buf[], to avoid "unused variable" warning. Sat Jul 30 22:38:46 2005 Ben Pfaff * command.c: (find_word) Cast `char' to `unsigned char' before passing to isspace(). Sat Jul 30 22:36:29 2005 Ben Pfaff * case.c: (case_compare) Implement as delegating to case_compare_2dict(). Sat Jul 30 22:34:18 2005 Ben Pfaff * algorithm.c: Inclusion of is unneeded. Sat Jul 30 22:01:32 2005 Ben Pfaff * Make.build: Don't append -ansi to AM_CFLAGS for GCC. Using -ansi changes the behavior of header files significantly. It causes __STRICT_ANSI__ to be defined, and some headers interpret that as cause to e.g. not use `long long' or __attribute__. The former example is bad when off_t is supposed to be `long long', and the latter prevents -Wformat from working. Sun Jul 24 20:26:59 2005 Ben Pfaff Get rid of dependency on libgmp by writing our own routine for floating-point base conversion. * pfm-write.c: (write_float) Rewrote. (write_int) Rewrote. (pow30_nonnegative) New function. (pow30) New function. (trig_to_char) New function. (format_trig_digits) New function. (recurse_format_trig_int) New function. (format_trig_int) New function. (should_round_up) New function. (try_round_up) New function. (format_trig_double) New function. Sun Jul 24 18:49:20 2005 Ben Pfaff * data-in.c: (parse_numeric) Allow "1+23" even for F format, for compatibility. Sun Jul 24 18:47:37 2005 Ben Pfaff * pfm-read.c: (read_version_data) Read and ignore author field. Wed Jul 6 20:44:27 2005 Ben Pfaff * get.c: (mtf_processing) Don't assume that mtf_compare_BY_values() always returns -1, 0, or 1. Actually, it returns a negative, zero, or positive result. Fixes MATCH FILES bug on Mac OS X reported by "Marshall DeBerry" . Mon Jul 4 18:01:15 2005 Ben Pfaff * flip.c: [HAVE_SYS_TYPES_H] Really include . The preprocessor test for sys/types.h was accidentally inverted. This was bug 12789. Sun Jul 3 22:47:39 2005 Ben Pfaff * get.c: (cmd_match_files) Fix memory leak on `by' and on `vfm_source'. * getline.c: [HAVE_LIBREADLINE] (read_console) Fix memory leak on `line'. * vfm.c: (close_active_file) Remove unnecessary test. Sun Jul 3 21:45:32 2005 Ben Pfaff Fix NDEBUG compile errors. * hash.h: Needed explicit #include . * linked-list.c: (ll_next) First arg is UNUSED when NDEBUG is defined. Sun Jun 12 23:44:38 2005 Ben Pfaff Implement embedding for PostScript driver. Fixes bug 12970. * ascii.c: Fix compiler warnings. * html.c: Ditto. * chart.h: Add `file' member. * output.h: (struct outp_class) initialise_chart, finalise_chart should take outp_driver *, not outp_class *. Update all references. * plot-chart.c: (chart_create) Fix segfault when there are no output drivers at all. (chart_submit) Call d->class->finalise_chart. * postscript.c: (ps_open_page) Set cp_y to 0. (ps_submit) New function. (ps_chart_initialise) Implement. (ps_chart_finalise) Implement. (static var postscript_class) Add ps_submit. (static var epsf_class) Add ps_submit. Sun Jun 12 14:54:40 2005 Ben Pfaff Did some more work on bug 12859 and then realized that a *good* solution would require some fundamental restructuring. For now, I'm marking REPEATING DATA unimplemented, and then we can revisit it post-0.4.0. * command.def: Make REPEATING DATA unimplemented. * data-list.c: (cmd_repeating_data) Assume inline file is 80 characters wide. (realize_value) Revert previous changes; no longer needed. Updated all callers. * error.c: (err_hcf) Set nfile_loc, mfile_loc to 0 after freeing file_loc, to avoid bad references later. * str.c: Fix typo. Tue Jun 7 00:14:09 2005 Ben Pfaff Make some code tolerant of reentry. Should not be needed if other code is correct but it is good to be generally tolerant. * error.c: (err_hcf) Set file_loc to null after free(). * output.c: (outp_done) Similar changes. * str.c: (ds_destroy) Ditto. Tue Jun 7 00:10:20 2005 Ben Pfaff Continue work on bug 12859, plus some code cleanup. * data-list.c: (cmd_repeating_data) Replace `seen' bitmap by boolean variables. Don't try to compute starts_end, cont_end for inline file. Calculate length only after parsing variable specifications. Add proper transformation to list. (realize_value) If the rpd_num_or_var has no value, return new DEFAULT_MEMBER argument (for use with inline file). (repeating_data_trns_proc) Pass default values. * dfm-read.c: (dfm_close_reader) Only skip data if *not* still open, and only if we actually started reading data. Sun Jun 5 18:39:36 2005 Ben Pfaff Fix bug 11894. * output.c: (outp_read_devices) Fix message. Fri May 27 12:34:43 WST 2005 John Darrington * sort-prs.[ch] (newfiles), aggregate.c, sort.[ch]: Separated the guts of the sort algorithm from the parser for the SORT command. * rank.q: Added the parser for the RANK command. Thu May 26 12:29:21 2005 Ben Pfaff Fix bug 13192. * sort.c: (sort_parse_criteria) Only set *saw_direction if saw_direction is non-null. Thanks to John Darrington for reporting this bug. Tue May 24 21:52:55 2005 Ben Pfaff * get.c: (mtf_processing) Handle case of a lookup table as the active file. Thanks to John Darrington for reporting this bug. Wed May 25 10:27:02 WST 2005 John Darrington * alloc.c alloc.h: (xcalloc) changed signature to imitate the POSIX calloc function. * crosstabs.q get.c vars-prs.c: Updated calls to xcalloc to reflect new signature. * sfm-read.c: Now much more robust in the face of badly formed system files. Mon May 23 11:57:31 WST 2005 John Darrington *sfm-read.c: Fixed some bugs regarding long string continuation records, which the previous fix uncovered. Sat May 21 12:48:34 WST 2005 John Darrington * sfm-read.c, sfmP.h: Allow reading of system files when the case_size value in the header is -1. Also changed some Errors to Warnings when reading system files. Tue May 17 21:00:57 2005 Ben Pfaff * data-list.c: (data_list_trns_free) Don't free the argument because cancel_transformations() will do that itself. (data_list_source_destroy) Destroy the argument to data_list_trns_free(), because it no longer does so itself. Tue May 17 18:29:35 2005 Ben Pfaff * data-out.c: (format_and_round) Don't output leading `-' if value rounds to zero. Tue May 17 00:06:43 2005 Ben Pfaff Fix bug 11119. * som.c: (output_encodings) If some cell in the table won't fit with the horizontal or vertical headers, cancel those headers. * som.h: (struct som_table_class) Add fits_width, fits_length, set_headers members. * tab.c: (tabi_fits_width) New function. (tabi_fits_length) New function. (tabi_set_headers) New function. (global var tab_table_class) Add the new functions as appropriate members. Mon May 16 22:34:06 2005 Ben Pfaff Fix rest of bug 13054. * format.def: Fix EDATE, SDATE, ADATE, JDATE, QYR, MOYR, WKYR, DATETIME, TIME system/portable file values. Mon May 16 22:31:15 2005 Ben Pfaff * data-list.c: (parse_free) Use make_input_format(). * data-out.c: (num_to_string) Use make_output_format(). * dictionary.c: (dict_create_var) Ditto. * format.c: (global var f8_2) New var. (make_input_format) New function. (make_output_format) New function. * get.c: (cmd_match_files) Use make_output_format(). * list.q: (cmd_list) Ditto. * matrix-data.c: Ditto. * sfm-read.c: (parse_format_spec) Check output specifier thoroughly. * tab.c: (tab_float) Use make_output_format(). Sun May 15 23:38:10 2005 Ben Pfaff Fix more of bug 13054. * format.def: FMT_A should allow 255-character output. FMT_AHEX should allow 510-character input and output. * data-out.c: (num_to_string) Get rid of NEW_STYLE option. (convert_E) Handle non-finite values. (try_F) Rewrite. (format_and_round) New function. (convert_infinite) New function used by try_F() and convert_E(). Sun May 15 23:36:55 2005 Ben Pfaff Regularize string and buffer function names so that they make some kind of sense. * str.c: (mm_reverse) Rename buf_reverse(). Update all references. (mm_find_reverse) Rename buf_find_reverse(). Update all references. (mm_case_compare) Rename buf_compare_case(). Update all references. (st_compare_pad) Rename buf_compare_rpad(). Update all references. (str_compare_rpad) New function. (st_bare_pad_copy) Rename buf_copy_str_rpad(). Update all references. (buf_copy_str_lpad) New function. (st_bare_pad_len_copy) Rename buf_copy_rpad(). Update all references. (st_pad_copy) Rename str_copy_rpad(). Update all references. (st_trim_copy) Rename str_copy_trunc(). Update all references. (st_uppercase) Renamed str_uppercase(). Update all references. Sat May 14 08:22:26 WST 2005 John Darrington * dfm-read.c: Fixed polarity of test in dfm-close-reader. Closes Bug #13082 Tue May 10 20:08:18 2005 Ben Pfaff * data-in.c: (data_in) Add assertion to check input specifier. * data-out.c: (data_out) Add assertion to check output specifier. Tue May 10 19:56:35 2005 Ben Pfaff Start to fix bug 13054. * format.c: (check_input_specifier) Improve error message. (check_input_specifier) Check F, COMMA, and DOLLAR formats for valid decimal places. (check_output_specifier) Ditto (but different criteria). (convert_fmt_ItoO) Assert valid input and output specifiers. Also, if input specifier has *any* decimal places, make the output specifier 1 place wider. Mon May 9 07:14:29 WST 2005 John Darrington * sysfile-info.c: Fixed bug [# 13024 ] Sun May 8 13:52:12 2005 Ben Pfaff "Fix" bug 13021 by disabling FILE TYPE. Eventually, we should actually implement it. * command.c: (FILE_TYPE_okay) Always return 1. * command.def: Change FILE TYPE, END FILE TYPE into UNIMPL. * file-type.c: Add prototypes to get rid of warnings. Sun May 8 08:08:07 WST 2005 John Darrington * barchart.c box-whisker.c cartesian.c piechart.c plot-hist.c: Fixed more ISO/IEC 9899:1990 conformance issues. Wed May 4 23:54:02 2005 Ben Pfaff Fix bug 12948. See also new test in tests/bugs/match-file-scratch.sh. * get.c: (mtf_merge_dictionary) Don't compact dictionary because that deletes scratch variables that someone else might be using, and because we can't reassign our sources' value indexes. Instead, simply don't copy scratch variables into the master dictionary. * dictionary.c: (dict_compact_values) Delete variables from the dictionary passed in, not from default_dict (!). Tue May 3 22:25:17 2005 Ben Pfaff Improve hash.c comments, error-checking. * hash.c: (struct hsh_table) [NDEBUG] Add hash_ordered member. (hsh_create) size == 0 should *not* return NULL! Set hash_ordered. (hsh_clear) Set hash_ordered. (locate_matching_entry) Check hash_ordered. (hsh_rehash) Rename rehash(). Add assertion. Set hash_ordered. (hsh_data) Set hash_ordered. Add const-ness to return value and update all callers. (hsh_sort) Ditto. Wed May 4 08:50:11 WST 2005 John Darrington * casefile.c: Removed unnecessary #include Tue May 3 19:14:48 WST 2005 John Darrington * copyleft.c: Updated copyright date. * Makefile.am: Removed erroneous explicit "-lplot" * examine.q oneway.q: Made these files conform to ISO/IEC 9899:1990 Tue May 3 16:20:31 WST 2005 John Darrington * command.c command.def: Added description string for unimplemented commands. * oneway.q: Sorted the hash tables before shipping out the results. Closes bug [#12931]. Mon May 2 23:45:01 2005 Ben Pfaff Code improvements. * data-list.c: (parse_fixed) Use lex_end_of_command(). (parse_free) Ditto. (cmd_repeating_data) Set cont_end.num in right situations. (parse_repeating_data) Remove redundant test. Mon May 2 23:37:19 2005 Ben Pfaff Partial fix for bug 12859. * data-list.c: (cmd_data_list) Add transformation properly in vfm_source == NULL case. Mon May 2 23:27:28 2005 Ben Pfaff * lexer.c: (lex_error) Improve error messages. Mon May 2 22:28:17 2005 Ben Pfaff * get.c: (cmd_match_files) Check token type before trying to match tokid. Fixes bug 12923. Mon May 2 22:16:51 2005 Ben Pfaff * flip.c: [HAVE_SYS_TYPES_H] Include . Fixes bug 12789. Mon May 2 22:02:52 2005 Ben Pfaff * expressions/generate.pl: (get_token) Make use of /g backward-compatible with Perl 5.6.1. Sun May 1 23:00:19 2005 Ben Pfaff * var-display.c: (cmd_variable_alignment) Fix memory leak. (cmd_variable_level) Ditto. Sun May 1 22:49:04 2005 Ben Pfaff Hash table had buggy deletion function. The fix required changing other functions to do probing in the required order. * hash.c: (locate_matching_entry) Rewrite and change interface. (hsh_rehash) Rewrite to use locate_matching_entry(). (hsh_probe) Ditto. (hsh_find) Ditto. (hsh_delete) Ditto. Also, fix stupid bugs. Sun May 1 22:24:58 2005 Ben Pfaff * dictionary.c: (dict_clone) Properly copy vectors. Sun May 1 22:07:58 2005 Ben Pfaff New implementation of long variable names. Each variable has a "normal" name, which may be up to 64 bytes long and which is used for all normal operations. Variables may have a "short" name, which is limited to 8 bytes and used only for system and portable file input and output. Make tokid case-preserving. Update most uses of tokid to treat it case-insensitively. Update many commands to deal with long variable names. * autorecode.c: (cmd_autorecode) Use strcasecmp() instead of strcmp(). * command.c: (cmd_parse) Ditto. (match_strings) Use toupper() before comparing characters. (conflicting_3char_prefixes) Use mm_case_compare() instead of memcmp(). (cmd_match_words) Ditto. * compute.c: (lvalue_parse) Use st_trim_copy() instead of strncpy(). * count.c: (struct cnt_var_info) Change n[] to fit long var name. Use st_trim_copy() instead of strcpy(). * data-in.c: (parse_enum) Use mm_case_compare() instead of memcmp(). * data-list.c: (struct dls_var_spec) Change name[] to fit long var name. (parse_free) Use st_trim_copy() instead of strcpy(). * descript.c: (struct dsc_var) Change z_name[] to fit long var name. (try_name) Use strcasecmp() instead of strcmp(). (generate_z_varname) Use st_trim_copy() instead of strcpy(). (descriptives_compare_dsc_vars) Use strcasecmp() instead of strcmp(). * dictionary.c: (struct dictionary) Removed `long_name_tab' member. (compare_long_names) Removed. (hash_long_name) Removed. (dict_create) Don't initialize `long_name_tab' member. (dict_clone) Copy short names into new dictionary. (dict_clear) Don't clear `long_name_tab' member. (dict_get_varname_block) Removed. (dict_add_longvar_entry) Removed. (free_nte) Removed. (dict_destroy) Don't destroy `long_name_tab' member. (dict_create_var_from_short) Removed. (dict_create_var_x) Removed. (dict_create_var) Get rid of longname handling. Clear short name. (dict_clone_var) Get rid of longname parameter and longname handling. (dict_lookup_var) Get rid of longname handling. (dict_reorder_var) New function. (dict_rename_var) Clear short name. (dict_rename_vars) Get rid of longname handling. Clear short names. (dict_create_vector) Support long vector names. (dict_lookup_vector) Use strcasecmp() instead of strcmp(). (quasi_base27) Removed. (make_short_name) Removed. (compare_strings) New function. (hash_string) New function. (dict_assign_short_names) New function. * file-handle.q: (get_handle_with_name) Use strcasecmp() instead of strcmp(). (get_handle_for_filename) Support long handle names. * file-type.c: (struct col_spec) Make `name' fit long var names. (cmd_file_type) Use strcasecmp() instead of strcmp(). * flip.c: (make_new_var) Rewrite. (flip_sink_write) Use st_trim_copy() instead of strncpy(). * format.c: (parse_format_specifier_name) Use mm_case_compare() instead of memcmp(). * get.c: (cmd_save_internal) Rephrase. (rename_variables) Drop test for identical variable name. (struct mtf_proc) Change `first', `last' to fit long var name. * hash.c: (hsh_hash_case_string) New function for case-insensitive string hashing. * lexer.c: (restore_token) Use st_trim_copy() instead of strncpy(). (lex_get) Don't uppercase string when copying into tokid. (lex_put_back_id) Use st_trim_copy() instead of strncpy(). * list.q: (determine_layout) Consider length of variable names in choosing vertical layout. * matrix-data.c: (cmd_matrix_data) Use strcasecmp() instead of strcmp(). (string_to_content_type) Ditto. * modify-vars.c: (compare_variables_given_ordering) Ditto. (struct var_renaming) Change `new_name' to fit long var name. (compare_var_renaming_by_new_name) Use strcasecmp() instead of strcmp(). * pfm-read.c: (read_variables) Disallow system variables in system files. (write_variables) Call dict_assign_short_names() and use short_name[] members. * repeat.c: (internal_cmd_do_repeat) Use strcasecmp() instead of strcmp(). * sfm-read.c: (sfm_open_reader) Rewrite code for long variable map. Reorder variables into same order as long variable map. (read_variables) Set short name. * sfm-write.c: (sfm_open_writer) Call dict_assign_short_names(). (write_variable) Use st_bare_pad_copy(). (write_longvar_table) Rewrite. * str.c: (mm_case_compare) New function. * sysfile-info.c: (compare_vectors_by_name) Use strcasecmp() instead of strcmp(). * t-test.q: (tts_custom_groups) Remove redundant test. (tts_custom_pairs) Ditto. * var.h: (struct variable) Change `name' to fit long var names. Remove `longname'. Add `short_name' member. Reorder some variables. (struct name_table_entry) Removed. (struct vector) Change `name' to fit long vector names. * vars-atr.c: (var_is_valid_name) Allow long var names. (compare_var_names) Use strcasecmp() instead of strcmp(). (compare_var_ptr_names) Ditto. (hash_var_name) Use hsh_hash_case_string(). (hash_var_ptr_name) Ditto. (var_set_short_name) New function. (var_clear_short_name) New function. (var_set_short_name_suffix) New function. * vars-prs.c: (parse_DATA_LIST_vars) Support long names. Use strcasecmp() instead of strcmp(). (struct array_var_set) Removed `longname_tab'. (array_var_set_lookup_var_idx) Drop longname_tab support. (array_var_set_destroy) Don't destroy `longname_tab'. (var_set_create_from_array) Don't create `longname_tab'. * vector.c: (cmd_vector) Use strcasecmp() instead of strcmp(). Support long names. * expressions/parse.c: (word_matches) Use mm_case_compare() instead of memcmp(). (compare_strings) New function. (lookup_function) Use compare_strings() instead of strcmp(). Sun May 1 22:07:43 2005 Ben Pfaff * algorithm.c: (move_element) New function. Sun May 1 22:05:35 2005 Ben Pfaff * aggregate.c: (parse_aggregate_functions) Always initialize destvar. Sun May 1 22:03:47 2005 Ben Pfaff * aggregate.c: (cmd_aggregate) Use dict_clone_var_assert(). * dictionary.c: (dict_clone) Ditto. (dict_clone_var_assert) New function. * get.c: (mtf_merge_dictionary) Use dict_clone_var_assert(). Sun May 1 15:05:54 WST 2005 John Darrington * error.c: Added a string for the compiler version to the request_bug_report_and_abort function. * groff_font.c, font.c: Removed manpage(1) style references from comments, because RMS frowns upon them. Thu Apr 28 18:52:06 2005 Ben Pfaff * expressions/parse.c: Improve previous fix for bug 12858 (LAG). Fri Apr 29 09:28:00 WST 2005 John Darrington * expressions/parse.c: Added handler for OP_LAG_Vn and OP_LAG_Vs. Fixed bug [#12858] . Wed Apr 27 12:42:34 WST 2005 John Darrington * loop.c recode.c repeat.c: Fixed a couple of instances of SHORT_NAME_LEN which should be LONG_NAME_LEN Wed Apr 27 07:43:50 WST 2005 John Darrington * command.def echo.c: Added the ECHO command. Mon Apr 25 22:55:59 2005 Ben Pfaff Finish fixing MATCH FILES (bug 11677). * get.c: (trim_dictionary) Rewrite in terms of drop_variables(), keep_variables(), rename_variables(). (drop_variables) New function. (keep_variables) New function. (struct mtf_file) Rename `in' to `in_name'. Add `in_var'. (cmd_match_files) Deal with in_var. Use drop_variables(), keep_variables(). When IN is specified, require BY. Set master variables after master dictionary is complete. Add IN variables after master dictionary is complete. (mtf_free_file) Free `in_name'. (mtf_delete_file_in_place) Set in_var value to 0. (mtf_read_nonactive_records) Rephrase. (mtf_processing) Support IN. Rephrase. Fix bugs. (mtf_merge_dictionary) Don't set master variables; we do that later now. (get_master) Don't insist that there's a master variable. Mon Apr 25 22:55:22 2005 Ben Pfaff Kluge to make some variable renaming sort of work. Needs real fix. * dictionary.c: (dict_rename_var) Call dict_add_longvar_entry(). Mon Apr 25 22:52:28 2005 Ben Pfaff Add functions for comparing sets of variables between cases. Use the functions. * case.c: (case_compare) New function. (case_compare_2dict) New function. * aggregate.c: (struct agr_proc) Remove `prev_break' member. Add `break_case'. (cmd_aggregate) Nullify break_case. Don't call initialize_aggregate_info(). (agr_destroy) Destroy break_case. (aggregate_single_case) Rewrite. Use case_compare(). (dump_aggregate_info) Copy from break_case into output. (initialize_aggregate_info) Copy break_case from input. * get.c: (mtf_compare_BY_values) Use case_compare_2dict(). * vfm.c: (equal_splits) Use case_compare(). Sat Apr 23 17:01:04 WST 2005 John Darrington * dictionary.c vars-prs.c sfm-write.c: Fixed some memory leaks Sun Apr 17 23:08:15 2005 Ben Pfaff Start work on fixing MATCH FILES. * get.c: (enum operation) Remove OP_MATCH. (trim_dictionary) Change return value to bool. Don't support OP_MATCH. (struct mtf_file) Remove `first', `last' members. (struct mtf_proc) Add `first', `last' members. Change mtf_case from `struct ccase *' to `struct ccase'. Remove `by' member. (cmd_match_files) Essentially rewrite. (mtf_free) Don't free `by' member. Destroy `mtf_case' member. (mtf_read_nonactive_records) mtf_ parameter is not unused. (mtf_processing) Ditto. Also rephrase some code. (mtf_merge_dictionary) Rewrite for easy comprehension. Sun Apr 17 23:06:00 2005 Ben Pfaff * matrix-data.c: (wr_output_data) [DEBUGGING] Fix compilation error. * q2c.c: (dump_token) [DEBUGGING] Fix compilation error. Thu Apr 14 2005 John Darrington * var-display.c: New file. * format.h var.h sfm-read.c sfm-write.c dictionary.c : Added display_width, measure and alignment parameters to variables. * aggregate.c command.def compute.c count.c data-list.c descript.c dictionary.c dictionary.h expr-prs.c file-type.c flip.c get.c lexer.c lexer.h loop.c modify-vars.c pfm-read.c recode.c repeat.c sfm-read.c sfm-write.c sfm-write.h sfmP.h val-labs.c val.h var.h vars-prs.c vector.c : - Replaced literal constants representing maximum variable name length with macro definitions. - Added support for long variable names. - Changed lexer such that it no longer makes tokens upper case, but relies upon case insensitive behaviour of commands. Mon Apr 4 22:27:34 2005 Ben Pfaff * aggregate.c: (parse_aggregate_functions) If dict_create_var() fails, don't dereference the resulting null pointer (bug 12427). Also, fix double free error. Sat Mar 19 23:06:02 2005 Ben Pfaff * aggregate.c: (parse_aggregate_functions) Fix N_NO_VARS format. (accumulate_aggregate_info) Set int1 to 1 for SUM. (dump_aggregate_info) Only make SUM non-missing if there was at least one variate. Sat Mar 19 14:48:19 2005 Ben Pfaff * aggregate.c: (dump_aggregate_info) Properly test whether the destination variable is numeric, when making the result system-missing for columnwise missing values. Mon Mar 14 21:52:34 2005 Ben Pfaff * misc.h: Remove GCC specializations. Mon Mar 14 21:07:23 2005 Ben Pfaff Make sort stable (bug 12313). * sort.c: Don't need to include some headers anymore. (static var min_buffers) New variable. (static var max_buffers) New variable. (static var allow_internal_sort) New variable. (cmd_sort_cases) Add test mode. (sort_execute) Rephrase. (do_internal_sort) Don't try internal sorting if allow_internal_sort is set. (struct external_sort) Renamed `initial_runs' to `runs' and updated all references. (macro MIN_BUFFER_TOTAL_SIZE_RECS) Removed. (macro MIN_BUFFER_SIZE_BYTES) Removed. (macro MIN_BUFFER_SIZE_RECS) Removed. (compare_initial_runs) Removed. (struct record_run) Add member `idx'. (write_initial_runs) Pass increasing values to process_case() as index. (process_case) Add `idx' parameter and use it to initialize new `idx' member. (allocate_cases) Limit allocated buffers to max_buffers. (compare_record_run) Use new `idx' member for last resort comparison, for stability. (end_run) Call casefile_sleep() on irs->casefile, to prevent running out of file descriptors. (struct merge_state) Removed. (merge) Don't need to allocate cases. Always use MAX_MERGE_ORDER unless we have fewer runs left. Always merge consecutive runs, for stability. Return the final run. (mod) Removed. (choose_merge) New function. (merge_once) Rewritten. Mon Mar 14 21:05:42 2005 Ben Pfaff * cmdline.c: (static var testing_mode) Move into parse_command_line(). Mon Mar 14 21:05:13 2005 Ben Pfaff * algorithm.c: (remove_range) New function. (remove_element) New function. * dictionary.c: (dict_delete_var) Use remove_element(). * flip.c: (cmd_flip) Ditto. Sun Mar 13 22:52:05 2005 Ben Pfaff * file-handle.q: (struct file_handle) `open_mode' should not be const. Sun Mar 13 22:40:54 2005 Ben Pfaff First phase of making SORT CASES stable (bug 12313). * sort.c: (struct indexed_case) New structure. (do_internal_sort) Rewrite to make internal sorting stable. (compare_case_dblptrs) Removed. (compare_indexed_cases) New function. Sun Mar 13 22:38:40 2005 Ben Pfaff Clean-ups. * casefile.c: (casereader_read_xfer_assert) New function. * dictionary.c: (dict_compact_case) New function. * flip.c: (struct flip_pgm) New member idx_to_fv. (cmd_flip) Initialize idx_to_fv member. (destroy_flip_pgm) Free idx_to_fv member. (flip_sink_write) Use struct flip_pgm member instead of case_sink member. (flip_sink_write) Ditto. * vfm.c: (write_case) Use dict_compact_case() instead of compact_case(). (compact_case) Removed. (storage_source_create) Removed `dict' parameter. All references updated. * vfm.h: (struct case_source) Removed `value_cnt' member. All references removed. (struct case_sink) Removed `dict', `idx_to_fv' members. All references removed. Sun Mar 13 22:35:55 2005 Ben Pfaff More AGGREGATE fixes. * aggregate.c: (accumulate_aggregate_info) Implement NMISS and NUMISS for strings. Fix FOUT, POUT, FGT, FLT, FIN, FOUT for strings. (initialize_aggregate_info) Fix initialization for MIN, MAX for strings. Sat Mar 12 23:26:21 2005 Ben Pfaff Start work on testing and debugging AGGREGATE. * aggregate.c: (cmd_aggregate) Use discrete bool variables instead of a bit-map. Require proper subcommand ordering. Make OUTFILE subcommand mandatory. (parse_aggregate_functions) Check that PIN, POUT, FIN, FOUT functions' arguments are in the correct order and swap them if not. (accumulate_aggregate_info) Make SUM include weights. Add various string functions. (dump_aggregate_info) Add various string functions. (initialize_aggregate_info) Initialize int1 for MIN, MAX. * sort.c: (sort_parse_criteria) Add parameter for returning whether any directions were specified. All callers updated. Sun Mar 13 14:54:27 WST 2005 John Darrington * t-test.q: Fixed erroneous logic in compare_group_binary. Sat Mar 12 13:29:21 2005 Ben Pfaff * split-file.c: (cmd_split_file) Ignore LAYERED and SEPARATE keywords (bug 11628). Sat Mar 12 13:17:12 2005 Ben Pfaff * vfm.c: (procedure_with_splits) Fix bug 11492: end_func() must be called *before* close_active_file(). Sat Mar 12 12:20:57 2005 Ben Pfaff * file-handle.q: (struct file_handle) Change open_mode from character pointer to 3-char array, for safety. Updated all references. Sat Mar 12 12:15:49 2005 Ben Pfaff Thanks to Ben Kujala for reporting these bugs. * pfm-read.c: (read_header) Improve error message for many cases in which the input is not actually a portable file. * file-handle.q: (fh_open) When we give an error message, actually return NULL. Fri Mar 11 11:50:30 2005 Ben Pfaff * format.c: (check_common_specifier) New function for checks common to check_input_specifier() and check_output_specifier(). (check_input_specifier) Use check_common_specifier(). (check_output_specifier) Use check_common_specifier(). (check_string_specifier) Removed. (check_specifier_type) New function. (check_specifier_width) New function. (get_format_var_width) Fix bug. * formats.c: (internal_cmd_formats) Only accept numeric variables. * lexer.c: (check_id) Rename lex_id_to_token(), make public, update all references. Make case-insensitive. * pfm-read.c: Essentially rewrite the whole file. Now much cleaner. * print.c: (check_string_width) New function. (fixed_parse_compatible) Use check_string_width(), check_specifier_type(). (dump_fmt_list) Ditto. * str.c: (st_trim_copy) New function. (st_uppercase) New function. * vars-atr.c: (var_is_valid_name) New function. * expressions/parse.c: (type_coercion_core) Use check_specifier_type(). Fri Mar 11 11:31:24 2005 Ben Pfaff * expressions/evaluate.c: (cmd_debug_evaluate) Fix memory leaks. * expressions/parse.c: (no_match) Ditto. Wed Mar 9 09:54:27 2005 Ben Pfaff * Makefile.am: (pspp_LDADD) Add libgsl-extras.a. * expressions/helpers.c: (struct func_params) Removed. (generalized_idf) Removed. (cdf_beta) Removed. (idf_beta) Removed. (idf_fdist) Use gslextras_cdf_beta_Pinv() instead of idf_beta(). * expressions/operations.def: Implement IDF.BETA, CDF.BINOM, CDF.GEOM, CDF.HYPER, CDF.NEGBIN, CDF.POISSON using gsl-extras. Implement SIG.F, which I had overlooked previously. Tue Mar 8 12:47:53 WST 2005 John Darrington * command.c command.def glob.[ch] cmdline.c: Made DEBUG cmds available only in testing mode. Sun Mar 6 23:25:40 2005 Ben Pfaff * data-in.c: Use `bool' throughout, where relevant. Sun Mar 6 19:52:22 2005 Ben Pfaff DATA LIST with free-field formats should not have implied decimal places (bug 12035). Also clean up data-in.c a bit. * data-in.h: (enum) Add DI_IMPLIED_DECIMALS. * data-in.c: (apply_implied_decimals) New function. (parse_numeric) Don't adjust exponent if DI_IMPLIED_DECIMALS not set. Also, get rid of gotos. (parse_Z) Use apply_implied_decimals() if the field doesn't contain a decimal point. (parse_N) Use apply_implied_decimals(). (parse_IB) Ditto. (parse_PIB) Ditto. (parse_P) Ditto. (parse_PK) Ditto. (to_roman) Removed. (parse_enum) New function. (macro CHAR_IS_ROMAN) Removed. (macro ROMAN_VALUE) Removed. (parse_month) Use parse_enum(). (parse_weekday) Use parse_enum(). (parse_DATETIME) Use long for weekday. * data-list.c: (read_from_data_list_fixed) Use DI_IMPLIED_DECIMALS. Sun Mar 6 17:07:20 2005 Ben Pfaff When the lexer sees something like `-5' in the input, it has to decide whether it's a negative numeric constant token or a '-' token followed by a positive numeric constant token. It always decides on the former, and then the parser can call lex_negative_to_dash() if it wants the latter. However, this doesn't work for the case of `-0', because negative zero is (portably) indistinguishable from positive zero. So now we divide T_NUM into two tokens, T_POS_NUM and T_NEG_NUM, to make the distinction clear. This requires a little bit of extra effort, because there were several references to T_NUM in the code base. * lexer.c: (lex_get) Use T_NEG_NUM and T_POS_NUM to distinguish positive and negative numeric constants. (lex_double_p) Renamed lex_is_number(). Changed return type to bool. Updated all relevant references to T_NUM to instead use this function. (lex_double) Renamed lex_number(). All references updated. (lex_integer_p) Renamed lex_is_integer(). Changed return type to bool. All references updated. (lex_token_representation) Understand T_NEG_NUM and T_POS_NUM. (lex_negative_to_dash) Ditto. (dump_token) Ditto. * lexer.h: (enum) Add T_POS_NUM, T_NEG_NUM. Remove T_NUM. Sun Mar 6 22:09:20 2005 Ben Pfaff * expressions/operations.def: (NUMBER) Use DI_IMPLIED_DECIMALS. Sun Mar 6 19:33:24 2005 Ben Pfaff * expressions/operations.def: (VEC_ELEM_NUM) Treat user-missing values as system-missing. * expressions/parse.c: (parse_vector_element) Fix order of arguments in call to expr_allocate_binary(). Sun Mar 6 17:51:05 2005 Ben Pfaff * expressions/optimize.c: (optimize_tree) Fix optimization bug for x**2. * expressions/parse.c: (type_coercion_core) Set *node to NULL on failure, as indicated by function comment. (parse_binary_operators) Always return NULL on type_coercion() failure. Should have been doing this anyway, but bug in type_coercion_core() filtered through. (parse_add) Fix typo in user message. (parse_primary) Understand T_NEG_NUM and T_POS_NUM. Sun Mar 6 10:47:13 2005 Ben Pfaff * expressions/operations.def: Add VALUE function. * expressions/parse.c: (parse_function) Need an unary composite node for variables in A TO B, not a variable node. Use allocate_unary_variable(). (parse_primary) Use allocate_unary_variable(). (allocate_unary_variable) New function. Thu Mar 3 23:53:32 2005 Ben Pfaff * expressions/PSPP_expressions.pm: Renamed it back to generate.pl but fixed the real problem that was preventing the build from a separate directory. I liked it my way better ;-) Thu Mar 3 23:17:51 2005 Ben Pfaff * expressions/parse.c: (expr_parse) Fix parameter type. Thanks to John Darrington for reporting this bug. Thu Mar 3 22:10:25 WST 2005 John Darrington * expressions/Makefile.am expressions/evaluate.h.pl expressions/evaluate.inc.pl expressions/operations.h.pl expressions/optimize.inc.pl expressions/parse.inc.p: Renamed generate.pl to PSPP_expressions.pm and adjusted *.pl to suit. Fixed everything so that it can be built from an arbitrary directory. Thu Mar 3 22:08:35 WST 2005 John Darrington * Makefile.am : Fixed up CLEANFILES target. Mon Feb 28 23:49:56 2005 Ben Pfaff * str.h: Changed `struct len_string' to `struct fixed_string', a more accurate name. Updated all references. Mon Feb 28 23:35:30 2005 Ben Pfaff Redo calendar support. Should now be bug-for-bug compatible. * calendar.c: New file. * calendar.h: New file. * data-in.c: Use new calendar functions. (parse_sign) Change sense of return value. (calendar_error) New function. (ymd_to_ofs) New function. (ymd_to_date) New function. (parse_DATE) Use new function. (parse_ADATE) Ditto. (parse_EDATE) Ditto. (parse_SDATE) Ditto. (parse_JDATE) Ditto. (parse_QYR) Ditto. (parse_MOYR) Ditto. (parse_WKYR) Ditto. (parse_TIME) Ditto. (parse_DTIME) Ditto. (parse_DATETIME) Ditto. * data-out.c: (convert_date) Use new calendar functions. * error.c: (err_vmsg) Changed interface to be more sensible. Updated all callers. (dump_message) Don't double new-lines (why did we do this anyway?). Mon Feb 28 23:30:25 2005 Ben Pfaff * sfmP.h: (macro flt64) Moved here from pref.h.orig. (macro FLT64_MAX) Moved here from pref.h.orig. Mon Feb 28 23:28:01 2005 Ben Pfaff * set.q: Support SET EPOCH. (static var set_epoch) New var. (aux_stc_custom_epoch) New function. (stc_custom_epoch) New function. (get_epoch) New function. (stc_custom_pager) [USE_INTERNAL_PAGER] Fix bug. * format.c: Make it possible just to check whether a specifier is valid without emitting an error message. (parse_format_specifier_name) Change interface, update all callers. (check_input_specifier) Ditto. (check_output_specifier) Ditto. (parse_format_specifier) Ditto. Mon Feb 28 23:24:08 2005 Ben Pfaff * command.def: Add DEBUG POOL. * pool.c: (pool_destroy) Fix bug in deleting this pool from its parent. (pool_clear) Properly account for size of pool gizmo. (pool_realloc) Ditto. (pool_clone) New function. * pool.h: Mark our allocation functions MALLOC_LIKE. Mon Feb 28 23:21:26 2005 Ben Pfaff * Makefile.am: Move many definitions into new top-level Make.build. Add expressions to SUBDIRS. Add calendar.c, calendar.h. Remove expr-evl.c, expr-opt.c expr-prs.c, expr.h, exprP.h, expr.def. * case.c: (case_resize) New function. (case_swap) New function. * casefile.c: Include mkfile.h. Fri Feb 25 21:11:35 WST 2005 John Darrington * sfm-read.c: Fixed a buglet which caused a crash when trying to read a non-existent file. Sun Feb 13 16:11:13 2005 Ben Pfaff Fix bug 11955. * aggregate.c: (parse_aggregate_functions) Code cleanup. Important part: get rid of spurious copying of function->format to destvar->print and destvar->write. Fri Feb 11 00:08:36 2005 Ben Pfaff Fix bug 11916, which was confusing a variable's `index' member with the variable's position in a var_set. Although these are usually the same, they are not for array `var_set's. Took advantage of this bug as an opportunity to clean up and rewrite parse_var_set_vars(). * vars-prs.c: (parse_vs_variable_idx) New function. (parse_vs_variable) Reimplement in terms of parse_vs_variable_idx(). (parse_var_idx_class) New function. (add_variable) New function. (add_variables) New function. (parse_var_set_vars) Rewritten. (struct var_set) Change `lookup_var' member that returns a variable into `lookup_var_idx' member that returns an int. Updated the var set implementations in obvious corresponding ways. Used compare_var_ptr_names(), hash_var_ptr_name() just added. Fri Feb 11 00:06:03 2005 Ben Pfaff Use our global variable compare & hash functions and give them better names. Add similar functions for dealing with double pointers to variables. * vars-atr.c: (compare_variables) Renamed compare_var_names(). (hash_variable) Renamed hash_var_name(). (compare_var_ptr_names) New function. (hash_var_ptr_name) New function. * t-test.q: (cmd_t_test) Use global compare_var_names(), hash_var_name(). (compare_var_name) Removed. (hash_var_name) Removed. Fri Feb 11 00:04:39 2005 Ben Pfaff Fix dictionary bug. * dictionary.c: (compare_variable_dblptrs) Rename compare_var_ptrs() and fix it to properly dereference the double pointers. Mon Feb 7 09:58:15 WST 2005 John Darrington crosstabs.q examine.q oneway.q q2c.c: Added a q2c feature to declare subcommands as mandatory. Closed bug #11843 Sat Feb 5 20:35:10 WST 2005 John Darrington * getline.c command.[ch] command.def: Added (very rudimentary) support for line completion when in interactive mode. Partially addresses bug #11693 Mon Jan 31 09:52:51 WST 2005 John Darrington * examine.q factor_stats.c oneway.q output.c pfm-read.c: Fixed some problems revealed by valgrind. Wed Jan 26 11:44:11 WST 2005 John Darrington * set.q: Affixed a fix to the previous fix such that we'll be OK now whether or not PAGER is set. Wed Jan 26 09:25:54 WST 2005 John Darrington * set.q: Copied the string produced by getenv("PAGER") thus avoiding "invalid free" errors. Hopefully fixes bug #11722 * compute.c expr-prs.c: Check that lvalues are populated before attempting to destroy them. Closes bug #11676 Tue Jan 25 21:01:43 WST 2005 John Darrington * aggregate.c: Initialised the complete agr_proc structure. Closes bug #11675 Sun Jan 23 23:02:21 2005 Ben Pfaff * print.c: (print_trns_free) Close the dfm writer if there is one, fixing a memory leak. Mon Jan 24 12:24:36 WST 2005 John Darrington * glob.c oneway.q q2c.c t-test.q vfm.c: Still *more* memory leaks fixed. Fri Jan 21 19:54:14 WST 2005 John Darrington * linked-list.[ch] Added * examine.q file-handle.[hq] font.h glob.c groff-font.c postscript.c set.q: Yet more memory leaks Tue Jan 18 23:12:40 WST 2005 John Darrington * t-test.q examine.q : More memory leaks fixed. Tue Jan 18 19:26:59 WST 2005 John Darrington * examine.q factor_stats.[ch] get.c pfm-read.c: Plugged numerous memory leaks. Mon Jan 10 14:43:45 WST 2005 John Darrington * ascii.c cartesian.c casefile.c chart.h devind.c examine.q frequencies.q html.c output.h piechart.c plot-chart.c plot-hist.c Integrated the chart rendering into the output stream (currently only works for html). Removed gratuitous use of ifndef NO_CHARTS, and replaced with dummy-chart.c for compiling without charts. * mkfile.[ch] Created. * som.[ch] tab.[ch]: Changed name of som_table to som_entity Added type element so we can tell if it's a chart or a table. * chart.h examine.q piechart.c plot-chart.c plot-hist.c: changed the API of charts to be more like that of tables. Thu Jan 13 21:00:02 WST 2005 John Darrington * casefile.c main.c: Moved the SIGINT handler from casefile.c to main.c. Removed the handler for SIGQUIT. Mon Jan 10 14:43:45 WST 2005 John Darrington * casefile.c: Added a signal handler to delete temp files on SIGINT and SIGQUIT * permissions.c Inhibited the PERMISSIONS command when SAFER is on. * command.def Added a lot more unimplemented commands. * copyleft.[ch] cmdline.c Moved legal information to copyleft.c Sat Jan 8 23:58:34 2005 Ben Pfaff * sort.c: (compare_initial_runs) Needed additional level of dereferencing. (merge_once) Fix plenty of stupid mistakes. Sat Jan 8 23:55:27 2005 Ben Pfaff * casefile.c: (casefile_sleep) Need to flush_buffer() after calling casefile_to_disk() or we will lose the last block in the file if the casefile started out as disk-based. (casefile_get_reader) Initialize reader->destructive to 0. (cmd_debug_casefile) Add new test pattern. (test_casefile) Define new test pattern to make sure casefile_sleep() works properly. Fri Jan 7 08:00:05 WST 2005 John Darrington * Makefile.am chart.[ch] histogram.[ch] piechart.c (Modified); plot-hist.c plot-chart.c (Added) Reorganised these files in an attempt to seperate the creation and processing of charts from their actuall renedering. * examine.q frequencies.q generated charts conditional upon the NO_CHARTS macro. Thu Jan 6 18:48:58 WST 2005 John Darrington * main.c Added a signal handler for SIGFPE * sort.c Somewhat more robust fix to the previous entry. Wed Jan 5 21:23:31 2005 Ben Pfaff * sort.c: (merge) Fix assertion for proper Huffman merge pattern: 0 == 1 modulo 1. See Knuth 5.4.9 (vol. 3, 2nd ed., pp. 361). Thanks to John Darrington for reporting the bug. Wed Jan 5 22:42:26 WST 2005 John Darrington * case.h Fixed bug # 11307 Wed Jan 5 08:30:48 WST 2005 John Darrington * val-labs.c Fixed bug which caused a crash if VALUE LABELS had a trailing slash. Mon Jan 3 17:44:37 2005 Ben Pfaff * pfm-read.c: (read_variables) Remove direct manipulation of v->aux, which is no longer needed. Fixes bug 11483. Sat Jan 1 19:01:16 WST 2005 John Darrington * data-list.c Fixed a bug in parsing delimiters. * group.c vars-atr.c Fixed buglet in hash/compare functions for alpha values. * percentiles.c Properly handled calculation of Tukey hinges where the number of data is small. * oneway.q Used the generic value_to_string function for independent variable instead of trying to do it ourselves. * box-whisker.c Fixed a buglet which caused a crash if the number of data was zero Fri Dec 31 16:47:45 WST 2004 John Darrington * examine.q box-whisker.c chart.h Implemented boxplots in EXAMINE * percentiles.c Fixed some bugs when calculating percentiles when there's a small number of cases. Wed Dec 29 08:18:08 WST 2004 John Darrington * percentiles.[ch] Added. Calculates percentiles and Tukey hinges * examine.q factor_stats.[ch] Added calculation of percentiles Fri Dec 24 15:09:11 WST 2004 John Darrington * t-test.q Fixed bug #11227 Made t-test work when the independent variable is alpha Sat Dec 11 11:43:45 WST 2004 John Darrington * factor_stats.c Fixed calculation of trimmed mean under various special conditions. Sat Dec 4 17:14:45 WST 2004 John Darrington * histogram.c chart.[ch] factor_stats.c frequencies.q Added code to calculate sensible histogram ranges and limits. Thu Dec 2 13:37:43 WST 2004 John Darrington * chart.h Updated to reflect many API changes. * cartesian.c chart.c Moved the definitions of chart_write_{xy}scale from cartesian.c and into chart.c * factorstats.[ch] Added the histogram calculations * casefile.c Removed an unused variable. * frequencies.q examine.q histogram.c Reworked the API for histograms. * piechart.c Revised the API for piecharts. * var.h Moved the definitions of freq_tab and freq out of var.h and into frequencies.q where they belong. Tue Nov 30 21:10:20 2004 Ben Pfaff * flip.c: (flip_file) Check for off_t separately from fseeko(), using AC_TYPE_OFF_T. Tue Nov 30 08:47:41 2004 Ben Pfaff * flip.c: (flip_file) If fseeko() is not available, use long int for off_t. Thanks to "Marshall DeBerry" for reporting the problem. Mon Nov 29 12:20:59 WST 2004 John Darrington * examine.q factor_stats.[ch] Changed stderr to se_mean to avoid conflict with stdio. Sun Nov 21 10:32:41 WST 2004 John Darrington * var-labs.c (var_to_string) Now returns null if the variable is null * value-labels.c (value_to_string) Made it return null if either the value or the variable is null. * hash.c (hsh_clear) Fixed a buglet. * examine.q factor_stats.[ch] Largely rewrote, because I'd started with the wrong model. * casefile.[ch] Added a function to return the casereader.case_idx member * examine.q Implemented the extreme values results. John Darrington * settings.h set.c glob.[ch] frequencies.q q2c.c error.c lexer.[ch] output.[ch] getline.c Plugged some memory leaks Mon Nov 15 23:47:40 2004 Ben Pfaff Adopt GSL random number generators, paving the way for providing the complete suite of random number generators on expressions. * Makefile.am: Remove random.c, random.h. * random.c: Removed. * random.h: Removed. * algorithm.c: (algo_default_random) Use GSL functions. * casefile.c: (test_casefile) Use GSL RNG functions. * expr-evl.c: (expr_evaluate) Use GSL RNG functions for OP_NORMAL, OP_UNIFORM. * sample.c: (cmd_sample) Use GSL RNG functions. (sample_trns_proc) Ditto. * set.q: (static var set_seed) Removed. (static var seed_flag) Removed. (static var rng) New variable. (aux_stc_custom_seed) No seed value anymore, don't print anything. (stc_custom_seed) Use new seed functions. (seed_is_set) Removed. (get_rng) New function that composes the entire external interface. (set_rng) New function. (random_seed) New function. Mon Nov 15 22:08:25 2004 Ben Pfaff * expr-evl.c: (expr_evaluate) Fix XDATE.JDAY formula. Thanks to John Darrington for reporting this bug. Tue Nov 16 13:19:18 WST 2004 John Darrington * permissions.c command.def Added the PERMISSIONS command Mon Nov 15 01:33:32 2004 Ben Pfaff * q2c.c: (dump_header) Don't try to emit #includes at very top of output file because that will precede #include , which is bad. (main) Add needed headers to /* (header) */ code. Mon Nov 15 01:21:36 2004 Ben Pfaff Instead of making system or portable file readers responsible for dropping and reordering variables, make them read full cases and let the caller take care of any changes. * get.c: New "case map" structure to handle this. Use for GET, IMPORT, MATCH FILES. Essentially rewrite the whole file. * pfm-read.c: (pfm_read_case) Read into provided case. Signature changed appropriately. * sfm-read.c: (sfm_read_case) Ditto. Mon Nov 15 00:47:45 2004 Ben Pfaff Decided that case_serialize() and case_unserialize() were too abstract. Also we need a couple more functions to avoid excessive copying for data in/out fast paths. * case.c: (case_serial_size) Removed. (case_serialize) Rename case_to_values() and make its argument explicitly an array of union values. (case_unserialize) Rename case_from_values() and make its argument explicitly an array of union values. (case_data_all) New function. (case_data_all_rw) New function. * casefile.c: (struct casefile) Change buffer from array of unsigned char to array of union value for better accuracy. Redefine buffer_used and buffer_size in terms of values, not bytes. Remove case_size because it is now redundant with value_cnt. Fix up all references to these members. Mon Nov 15 00:45:46 2004 Ben Pfaff * barchart.c: (struct subcat) Make `label' member const to silence GCC warning with -Wwrite-strings. * cartesian.c: (struct dataset) Ditto. * case.c: Don't re-define NDEBUG if already defined. Add lots of comments. * str.c: Fix includes. * crosstabs.q: Fix includes. * examine.q: Fix includes. Fix GCC warning about unused variables. * frequencies.q: (stat macro) Removed and replaced where used by its expansion. * list.q: Fix includes. * oneway.q: Fix includes. * piechart.c: Fix includes. Only define M_PI if not already defined. * sfm-read.c: (bswap) New function. (bswap_int32) Write in terms of bswap. (bswap_flt64) Ditto. * str.c: (ds_data) Add external definition here, needed because str.h has only an `extern inline' version. * value-labels.c: Fix includes. Mon Nov 15 00:40:55 2004 Ben Pfaff Instead of providing a system or portable file writer with a raw case in the format needed for output, provide it with a regular case. The writer takes care of any needed translation. * aggregate.c: Adopt new scheme for AGGREGATE. (struct agr_proc) sfm_agr_case member removed. (write_case_to_sfm) Removed because the new interface is easier to use. * get.c: Adopt new scheme for SAVE, XSAVE, EXPORT. * pfm-write.c: Implement new scheme. * sfm-write.c: Ditto. Mon Nov 15 00:32:24 2004 Ben Pfaff Instead of treating `struct file_handle' as a class to subclass into data files, system files, and portable files, instead use it as a helper that coordinates access. Now it is opaque, too. This means that most references to a struct file_handle are now changed into references to one of struct dfm_reader, struct dfm_writer, struct sfm_reader, struct sfm_writer, struct pfm_reader, or struct pfm_writer, according to what's being read or written. Most related changes are only worth summarizing briefly. * dictionary.c: (dict_clear) Destroy aux data in deleted variables. (dict_clear_aux) New function. (dict_create_var) Initialize aux, aux_dtor. (dict_delete_var) Destroy aux data in deleted variable. * file-handle.h: (struct fh_ext_class) Removed. (struct file_handle) Removed. (fh_init_files) Removed. * file-handle.q: Changed references to a handle's `private' member to direct references. (struct private_file_handle) Renamed file_handle. Add next, open_cnt, type, open_mode, aux members. (struct file_handle_list) Removed. (extern var inline_file) Removed. (static var file_handles) Changed from file_handle_list * to file_handle *. (create_file_handle) Initialize new members. (fh_close_handle) Removed. (mode_name) New function. (fh_open) New function. (fh_close) New function. (fh_parse_file_handle) Renamed fh_parse(). * glob.c: (init_glob) Remove fh_init_files() call. * aggregate.c: use sfm_writer. (create_sysfile) Removed because the new interface is simpler. * apply-dict.c: Use sfm_reader. * data-list.c: Use dfm_reader. * file-type.c: Use dfm_reader. * get.c: Use sfm_reader, sfm_writer, pfm_reader, pfm_writer. * inpt-pgm.c: Use dfm_reader. * print.c: Use dfm_writer. * sysfile-info: Use sfm_reader. * dfm-read.c: Adopt new file handle infrastructure. * dfm-write.c: Ditto. * pfm-read.c: Ditto. * pfm-write.c: Ditto. * sfm-read.c: Ditto. * sfm-write.c: Ditto. Mon Nov 15 00:31:44 2004 Ben Pfaff Break dictionary functions into separate header file. * dictionary.h: New file. * var.h: Moved dict_*() functions to dictionary.h. Mon Nov 15 00:30:33 2004 Ben Pfaff Get rid of procedure-specific union in struct variable, using instead a void * pointer and a destructor function. Most related changes are only worth brief summaries. * crosstabs.q: Fix includes. Use new struct var_range in lieu of old p.crs member in struct variable. * frequencies.q: Fix includes. Use new struct var_freqs in lieu of old p.frq member in struct variable. * histogram.c: (draw_histogram) Takes new freq_tab arg because it's no longer possible to grab this from var->p.frq. * piechart.c: (draw_piechart) Ditto. * group.c: (group_proc_get) New function. * levene.c: Use group_proc_get() in lieu of old p.grp_data member in struct variable. * oneway.q: Ditto. * t-test.q: Ditto. * main.c: (execute_command) Clear aux data in default_dict after each command. (It's debatable whether this should be done.) * matrix-data.c: Use new struct mxd_var in lieu of old p.mxd member in struct variable. * means.q: Get rid of integer mode, which is not included in recent SPSS and was the only code that wanted per-variable private data. * var.h: (struct crosstab_proc) Removed. (struct frequencies_proc) Removed. (struct list_proc) Removed. (struct get_proc) Removed. (struct means_proc) Removed. (struct matrix_data_proc) Removed. (struct match_files_proc) Removed. (lots of enums) Removed. (struct variable) Removed members `p', `get'. Add member `aux_dtor'. * vars-atr.c: (var_attach_aux) New function. (var_detach_aux) New function. (var_clear_aux) New function. (var_dtor_free) New function. (discard_variables) Use NULL instead of inline_file. Fri Nov 12 10:07:11 WST 2004 John Darrington * value-labs.c Fixed the implmentation of value_to_string, so that it properly handles alpha values. * oneway.q Changed instances where labels were being probed manually, to use the canonical {var,value}_to_string functions Thu Nov 11 21:01:31 WST 2004 John Darrington * examine.q cartesian.c chart.[ch] Added normal and detrended normal plots. Changed the API of the cartesian plot to be a much lower level thing. Sun Nov 7 17:25:04 WST 2004 John Darrington * examine.q Added some of the parametric calculations * factor_stats.[ch] Created Sat Nov 6 21:24:31 WST 2004 John Darrington * examine.q Changed the definition of factors to be a composite, and dealt with the consequences. Sat Nov 6 20:40:38 WST 2004 John Darrington * examine.q Fixed problem where examine wasn't dealing properly with splits Sat Nov 6 14:49:47 WST 2004 John Darrington * oneway.q Fixed problem where oneway wasn't dealing properly with splits Thu Nov 4 11:09:01 WST 2004 John Darrington * q2c.c examine.q Fixed a bug (feature?) whereby arrays in the command which had settings didn't get the appropriate code generated. * val.h value-labels.[ch] var-labs.c Added v*to_string functions to convert variables/values to strings. * examine.q Added framework for the EXAMINE command. Mon Nov 1 12:46:17 WST 2004 John Darrington * q2c.c frequencies.q set.q t-test.q Fixed the q2c parsing of DBL subcommand types. Changed frequencies.q to use it rather then the custom parser. Dealt with the consequences. Added a test for NTILES subcommand of frequencies. Sat Oct 30 09:16:29 WST 2004 John Darrington * oneway.q Fixed up the behaviour when given missing values * levene.c oneway.q Fixed a buglet with the levene statistic and incorporated the levene test into the oneway command. * group.h t-test.q Moved the CMP_EQ and CMP_LE symbols out of global scope, since they're only relevant to T-TEST Fri Oct 29 17:39:03 WST 2004 John Darrington * group.c group.h group_proc.h levene.c oneway.q t-test.q Made the t-test more consistent with the way it handles groups. That is, it now uses a hash instead of an array of 2. Also, made the levene.c file independent of the implementation of the t-test. So now levene should be fine for both t-test and anova. * Added an oneway.q file for one way anova Wed Jun 2 22:08:02 2004 Ben Pfaff * descript.c: (cmd_descriptives) Remove harmless but bogus test in STATISTICS parsing. Mon May 31 20:45:24 2004 Ben Pfaff Fix memory leaks. * data-list.c: (cmd_data_list) Free dls->delims on lossage. (data_list_trns_free) Free dls->delims. * t-test.q: (tts_custom_pairs) Free vars. (ssbox_one_sample_init) Fix tab_vline() argument. (ssbox_independent_samples_init) Ditto. (trbox_paired_init) Ditto. (trbox_one_sample_init) Ditto. Mon May 31 17:19:27 2004 Ben Pfaff Generalize casefiles to the extent that we can use them for sorting and other kinds of data transformations. Change cases to be copy-on-write to improve memory efficiency in common cases. Every access to a member of a `struct ccase' was changed to be a call to a case_*() function, especially case_data(), case_num(), case_str(), or case_data_rw(). Many instances of a local variable named "case_num" were changed to "case_idx" as a consequence. Many `struct ccase *' were changed to actual `struct ccase' because of copying semantics of cases. In several places there was a choice between updating debug code to work with the new ADTs or just deleting it because it was useless; I chose to delete it. * Makefile.am: (pspp_SOURCES) Add case.c, case.h. * case.c: New file. * case.h: New file. * aggregate.c: (struct agr_proc) Change type of `sort' to sort_criteria *. Add `break_vars', `break_var_cnt' members. Rename `vars' to `agr_vars', all references updated. Change `agr_case' to type `struct ccase'. (cmd_aggregate) Deal with new members. Use case_create(), sort_active_file_in_place(), sort_active_file_to_casefile(). (agr_destroy) Deal with new members. (aggregate_single_case) Ditto. (dump_aggregate_info) Ditto. (initialize_aggregate_info) Ditto. (agr_to_active_file) Ditto. (presorted_agr_to_sysfile) Ditto. (sort_agr_to_sysfile) Removed. * alloc.c: (out_of_memory) Make non-static. * alloc.h: Prototype out_of_memory(). * casefile.c: Switched from a linked list in-memory representation to a two-level array-style representation. The linked list was appropriate when we could stick a header onto cases, but that's no longer the case. Also, the two-level array will allow for random in-memory access in case that's ever wanted. Also added the concept of a `destructive casereader', one that destroys cases in the underlying casefile as they are read out. (macro CASES_PER_BLOCK) New macro. (struct casefile) New members `value_cnt', `case_list_size', `case_acct_size', `being_destroyed', `cases'. Removed `head', `tail'. (struct casereader) Removed `cur'. Added `destructive', `c'. (global var casefiles) Made static. (static var case_bytes) New var. (casefile_create) Takes a value count, not a case size in bytes, to conform to the case interface. All callers updated. Deal with new and removed members. (casefile_destroy) Deal with new and removed members. (casefile_sleep) New function. (casefile_get_case_size) Removed. (casefile_get_value_cnt) New function. (casefile_append) Rewritten to deal with new and removed members. (casefile_append_xfer) New function. (write_case_to_disk) Use case_serialize(). (call_posix_fadvise) Removed because posix_fadvise64 segfaults. Couldn't figure out why. (casefile_to_disk) Don't call call_posix_fadvise. Rewritten to deal with new and removed members. (merge) Removed. (merge_sort) Removed. (casefile_sort) Removed. (casefile_get_reader) Deal with new and removed members. (casefile_get_destructive_reader) New function. (reader_open_file) Make code more readable. Create case for reader. (casereader_get_casefile) New function. (casereader_read) Deal with new and removed members. Now returns a copy of the case, so that the caller is responsible for destroying the returned case. (casereader_read_xfer) New function. (casereader_destroy) Destroy reader's case. (test_casefile) Second arg is now a value count, all callers updated. Now tests destructive readers too. (get_random_case) Deal with new case ADT. (write_random_case) Ditto. (read_and_verify_random_case) Ditto. * crosstabs.q: Remove debug code. * descript.q: (calc_descriptives) Deal with new case, casefile ADTs. * dfm.c: (cmd_begin_data) There's no storage_source_class anymore. * do-if.c: Remove unneeded header inclusion. * expr-prs.c: Remove debug code. * exprP.h: Remove debug code. * flip.c: (flip_file) Use fseeko() if available. * formats.c: Remove debug code. * get.c: Remove debug code. (struct mtf_file) Change `input' from `union value *' to `struct ccase', all references updated. * levene.c: (levene) Deal with new case, casefile ADTs. * list.q: Remove debug code. * loop.c: Remove debug code. * matrix-data.c: Remove debug code. * means.q: Remove debug code. * mis-val.c: Remove debug code. * pfm-read.c: Remove debug code. (pfm_read_code) Change second arg from `union value *' to `struct ccase *', all references updated. * recode.c: (string_to_long) Make first arg const. (convert_to_double) Ditto. * repeat.c: Remove debug code. * sample.c: Remove debug code. * sfm-read.c: Remove debug code. (sfm_read_case) Change second arg from `union value *' to `struct ccase *'. * sort.c: Redone in terms of casefiles. (enum sort_direction) Moved here from sort.h. (struct sort_criterion) New structure. (struct sort_criteria) New structure. (cmd_sort_cases) Rewritten. (prepare_to_sort_active_file) New function. (sort_active_file_in_place) New function. (sort_active_file_to_casefile) New function. (parse_sort) Renamed sort_parse_criteria(), rewritten & interface changed, all callers updated. (destroy_sort_cases_pgm) Renamed sort_destroy_criteria(), rewritten & interface changed, all callers updated. (sort_cases) Renamed sort_execute(), rewritten & interface changed, all callers updated. (struct internal_sort) Removed. (do_internal_sort) Rewritten, interface changed. (destroy_internal_sort) Removed. (compare_case_dblptrs) Use sort_criteria instead of sort_case_pgm. (struct initial_run) Removed; an initial run is now just a casefile. (compare_initial_runs) Rewritten. (struct external_sort) Changed almost completely. (do_external_sort) Rewritten, interface changed. (destroy_external_sort) Rewritten. [HAVE_MKDTEMP] (make_temp_dir) Removed. [!HAVE_MKDTEMP] (do_mkdir) Removed. [!HAVE_MKDTEMP] (make_temp_dir) Removed. (init_external_sort) Removed. (simulate_error) Removed. (rmdir_temp_dir) Removed. (get_temp_file_name) Removed. (open_temp_file) Removed. (close_temp_file) Removed. (remove_temp_file) Removed. (write_temp_file) Removed. (read_temp_file) Removed. (struct record_run) Change `record' from `struct case_lit *' to `struct ccase'. (struct initial_run_state) Remove `idx_to_fv', `free_list', `file_idx', `output_file'. Add `run', casefile'. Change `last_output' from `struct case_list *' to `struct ccase'. (write_initial_runs) Change interface, rewrite. (sort_sink_write) Renamed process_case(), changed interfaced, rewrote. (destroy_initial_run_state) Rewritten. (allocate_cases) Rewritten. (compare_record) Interface changed, rewritten. (start_run) Rewritten. (end_run) Rewritten. (output_record) Rewritten. (grab_case) Removed. (release_case) Removed. (struct merge_case) Change `cases' from double pointer to single pointer. (merge) Deal with new case and casefile ADTs. (struct run) Removed. (merge_once) Rewritten, interface changed. (fill_run_buffer) Removed. (sort_sink_make_source) Removed. (sort_sink_class) Removed. (struct sort_source_aux) Removed. (sort_source_read_helper) Removed. (sort_source_read) Removed. (read_sort_output) Removed. (read_internal_sort_output) Removed. (read_external_sort_output) Removed. (sort_source_destroy) Removed. (sort_source_class) Removed. * sort.h: (struct sort_cases_pgm) Removed. (enum sort_direction) Moved to sort.c. * t-test.q: (calculate) Deal with new case, casefile ADTs. * tab.c: Remove debug code. * var-labs.c: Remove debug code. * var.h: (struct ccase) Removed. (struct case_list) Removed. * vars-atr.c: (discard_variables) Use free_case_source(). * vars-prs.c: (parse_vs_variable) Make arg const. (parse_dict_variable) Ditto. (parse_variables) Make struct dictionary * arg const. (parse_var_set_vars) Make struct var_set * arg const. (struct var_set) Add const to some of the function pointers' args. (var_set_get_cnt) Make arg const. (var_set_get_var) Make first arg const. (var_set_lookup_var) Make first arg const. (dict_var_set_get_cnt) Make arg const. (dict_var_set_get_var) Make first arg const. (dict_var_set_lookup_var) Make first arg const. (var_set_create_from_dict) Make arg const. Add cast to aux assignment. (struct array_var_set) Add const to var member. (array_var_set_get_cnt) Make arg const. (array_var_set_get_var) Make first arg const. (array_var_set_lookup_var) Make first arg const. (var_set_create_from_array) Make first arg const. Insert cast. * vfm.c: (struct write_case_data) Change trns_case, sink_case members from `struct ccase *' to `struct ccase'. (static var lag_queue) Change from double to single pointer. (procedure) Optimize trivial case. (internal_procedure) Deal with changed case, case_source ADTs. (create_trns_case) Changed interface, rewrote. (open_active_interface) Initialize modified lag queue. (write_case) Deal with changed case ADT. (lag_case) Deal with modified lag queue. (close_active_file) Destroy modified lag queue. Deal with changed case_source, case_sink ADTs. (destroy_storage_stream_info) Make null arg into no-op. (storage_sink_make_source) Set aux in created source. (storage_source_read) Deal with changed case, casefile ADTs. (storage_source_create) New function. (lagged_case) Rewrite. (free_case_source) New function. (free_case_sink) Rewrite. (struct split_aux_data) Changed prev_case from `struct ccase *' to `struct ccase'. (procedure_with_splits) Deal with changed prev_case. (procedure_with_splits_callback) Ditto. (multipass_split_aux_data) Changed prev_case from `struct ccase *' to `struct ccase'. (multipass_procedure_with_splits) Deal with changed prev_case. (multipass_split_callback) Ditto. Mon May 31 17:19:06 2004 Ben Pfaff The workspace idea didn't work out. * Makefile.am: (pspp_SOURCES) Remove workspace.c, workspace.h. * workspace.c: Removed. * workspace.h: Removed. Sun May 30 18:35:19 2004 Ben Pfaff Fully implement arbitrary delimiters on DATA LIST, extending the half implementation that was already there. * data-list.c: (struct data_list_pgm) Remove `delim', add `delims', `delim_cnt'. (cmd_data_list) Initialize new members. Parse delimiters and clean up code a bit. (cut_field) Extract fields with arbitrary delimiters. Also, fix handling of leading commas. (read_from_data_list_fixed) Expand tabs. Adapt to new DFM interfaces. (read_from_data_list_free) Adapt to new DFM interfaces. (read_from_data_list_list) Ditto. (repeating_data_trns_proc) Ditto. * dfm.c: Split up reader and writer into separate code, because they do different things. Use struct string instead of explicit allocation code, for clarity. (enum dfm_reader_flags) New enum. (struct dfm_fhuser_ext) Removed. (struct dfm_reader_ext) New. (get_reader) New function, used by just about all the reader functions. (dfm_close) Removed. (close_reader) New function. (dfm_open_for_reading) Rewrite initialization of dfm_fhuser_ext. (dfm_open_for_writing) Ditto. (macro force_line_buffer_expansion) Removed. (count_tabs) Removed. (tabs_to_spaces) Removed. (read_record) Deal with new dfm_reader_ext. Use struct string functions. Don't convert tabs to spaces. (dfm_eof) New function. (dfm_get_record) Changed interface, rewrote. (dfm_expand_tabs) New function. (dfm_fwd_record) Renamed dfm_forward_record(), updated to new dfm_reader_ext, rewritten. (dfm_bkwd_record) Renamed dfm_reread_record(), updated to new dfm_reader_ext, rewritten. (dfm_set_record) Removed in favor of dfm_forward_columns(). (dfm_forward_columns) New function. (dfm_get_cur_col) Renamed dfm_column_start, updated to new dfm_reader_ext, rewritten. (static var dfm_r_class) Use close_reader for the destructor. (struct dfm_writer_ext) New. (dfm_put_record) Updated to new dfm_writer_ext, rewritten. Uses bounce buffer now instead of local allocation. (close_writer) New function. (static var dfm_writer_ext) Use close_writer for destructor. (cmd_begin_data) Adapt to new dfm_reader_ext. * file-handle.q: Add support for per-file tab width. (struct private_file_handle) Add tab_width member. (q2c specifications) Add tabwidth subcommand. (cmd_file_handle) Put parsed tab width into private_file_handle. (create_file_handle) Set default tab width. (handle_get_tab_width) New function. * file-type.c: (file_type_source_read) Adapt to new DFM interface. * inpt-pgm.c: (reread_trns_proc) Ditto. * matrix-data.c: (context) Ditto. (another_token) Ditto. (mget_token) Ditto. (force_eol) Ditto. Sun May 30 18:33:59 2004 Ben Pfaff * casefile.c: (casefile_destroy) Fix memory leak by freeing cf->filename. (casereader_destroy) Don't close file descriptor -1. * recode.c: (cmd_recode) Fix memory leak. * set.q: (q2c specifications) Fix typo in user message. * str.c: (st_bare_pad_len_copy) Change memcpy to memmove to avoid undefined behavior for overlapping arguments. Sun May 30 18:31:48 2004 Ben Pfaff * casefile.c: valgrind doesn't implement posix_fadvise() yet, so don't call it when we're running under valgrind. (call_posix_fadvise) New function. (casefile_to_disk) Use call_posix_fadvise(). (reader_open_file) Ditto. Sun May 30 18:20:12 2004 Ben Pfaff Update our string ADTs, struct string and struct len_string. Get rid of pool support, which was largely unused. Rename lots of functions to have more obvious or consistent names. * ascii.c: Get rid of ascii_pool. It was only used for string allocations. (ascii_open_global) Don't create ascii_pool. (ascii_close_driver) Don't destroy ascii_pool. (ascii_postopen_driver) Don't use pool. (ascii_close_driver) Destroy strings manually. * str.c: (ds_create) Remove pool argument, all references updated. (ds_init) Ditto. (ds_replace) Remove pool support, make more efficient when we don't need to reallocate. (ds_destroy) Remove pool support. (ds_rpad) New function. (ds_size) Renamed ds_capacity(), all references updated. (ds_value) Renamed ds_c_str(), all references updated. (ds_concat) Renamed ds_puts(), all references updated. (ds_concat_buffer) Renamed ds_concat(), all references updated. (ds_putchar) Renamed ds_putc(), all references updated. (ds_getline) Renamed ds_gets(), all references updated. (ls_create) Remove pool argument, all references updated. (ls_create_buffer) Ditto. (ls_destroy) Removed pool support. (ls_value) Renamed ls_c_str(), all references updated. * str.h: (ls_length) [__GNUC__] Add inline version. (ls_c_str) [__GNUC__] Add inline version. (ls_end) [__GNUC__] Add inline version. (struct string) Remove pool member. Rename `size' to `capacity', all references updated. * tab.c: (text_format) Instead of using pool argument to ls_create_buffer(), call pool_register() on allocated data. Mon Apr 26 22:40:07 2004 Ben Pfaff We're abusing the current ASCII driver by telling it to allocate a 9999-line, 9999-character page in the tests. This causes some systems to curl up and die because it allocates 20 MB of contiguous RAM. This change alleviates at least part of the problem. It is mostly a stop-gap until the new output system is ready. * ascii.c: (struct line) New structure. (struct ascii_driver_ext) Remove `page', `page_size', `line_len', `line_len_size', `n_output' members. Add `lines', `lines_cap'. (ascii_preopen_driver) Initialize new members, not old ones. (ascii_close_driver) Destroy new members, not old ones. (ascii_open_page) Allocate new members, not old ones. (expand_line) Allocate room in line. (draw_line) Use new members. (ascii_line_horz) Ditto. (ascii_line_vert) Ditto. (ascii_line_intersection) Ditto. (text_draw) Ditto. (output_lines) Ditto. (ascii_close_page) Ditto. Sun Apr 25 23:40:15 2004 Ben Pfaff * matrix.c: Dead code. Removed. * matrix.h: Dead code. Removed. Fri Apr 16 23:59:51 2004 Ben Pfaff Contrary to what I'd always understood, there is an efficient algorithm for deletion from a hash table populated via linear probing. This change implements it. * hash.c: (hsh_rehash) Probe in increasing order. (hsh_probe) Ditto. (locate_matching_entry) Ditto. (hsh_delete) Use Knuth's Algorithm 6.4R for deletion. Tue Apr 13 19:24:15 2004 Ben Pfaff * moments.c (calc_moments): Adjust calculation of kurtosis to avoid subtracting huge numbers from huge numbers, on Michael Kiefte's advice. Sun Apr 11 14:22:12 2004 Ben Pfaff Rework moments routines for improved numerical stability based on Michael Kiefte's advice. Any bugs or remaining numerical problems are still mine though. There is now a struct moments1 for use with one-pass moments. It uses a provisional means algorithm as an attempt to improve accuracy of higher moments. The older struct moments now only handles two-pass moments. * aggregate.c: Use moments1 instead moments. * descript.c: Revert previous change, which is no longer needed due to the moments revision. * moments.c: (calc_moments) New function for calculating variance, skewness, kurtosis. (moments_pass_one) Only accumulate weights bigger than zero. (moments_calculate) Allow calculating the mean on pass one, others require pass two. Implement in terms of calc_moments(). (struct moments1) New structure. (init_moments1) New function. (moments1_clear) Ditto. (moments1_create) Ditto. (moments1_add) Ditto. (moments1_calculate) Ditto. (moments1_destroy) Ditto. (cmd_debug_moments) Deal with `struct moments' or `struct moments1' as requested by user. Sun Apr 11 14:21:55 2004 Ben Pfaff * Makefile.am (pspp_SOURCES): Remove debug.c. * debug.c: Removed. It was empty anyway. Fri Apr 9 20:04:49 2004 Ben Pfaff * descript.c (calc_descriptives): Fix assert failure when only MOMENT_MEAN is needed. 2004-04-09 Michael Kiefte * descript.c: fixed problem with parsing in match_statistic() causing "DESCRIPTIVE STAT=MEAN." to barf. "MEAN" is now default if "SORT" given without specification. Fixed infinite loop with "DESCRIPT GIBBERISH=ALL." Parsing is generally less forgiving of syntax errors: better to have it do nothing and type it in again then to not know what it actually did instead. z-score transformation now checks score for user-missing values and checks std_dev for SYSMIS. 2004-04-06 Michael Kiefte * aggregate.c, crosstabs.q, descript.c, dictionary.c, frequencies.q, levene.c, t-test.q, var.h: Changed dict_get_case_weight() to accept an additional int * flag to complain about system-missing, user-missing, zero, or negative weights and updated existing functions to pass int * to dict_get_case_weight(). 2004-04-05 jmd * main.c: Fixed configuration problems with gsl * t-test.q: Fixed some problems encountered when compiling under Cygwin 2004-04-03 blp * lexer.c, ChangeLog: Fix infinite loop on comment at end of file, add test. 2004-04-03 jmd * settings.h, var.h, ChangeLog, Makefile.am, cmdline.c, command.c, command.h, error.h, filename.c, frequencies.q, lexer.h, main.c, q2c.c, set.q: Fixed the calculation of percentiles and added --syntax and --algorithm options Sat Apr 3 11:43:37 2004 Ben Pfaff * lexer.c: (lex_skip_comment) Handle end-of-file correctly (I hope). Sat Apr 3 15:00:18 WST 2004 John Darrington * frequencies.q: Fixed the calculation of percentiles * Makefile.am: Added the --ansi flag and dealt with the consequences. Added some entries to PSPP_sources so that make distcheck would pass * cmdline.c: Added the --syntax and --algorithm options * q2c.c: Added an implicit /ALGORITHM subcommand to everything. Fri Apr 2 11:25:22 WAST 2004 John Darrington * t-test.q, levene.c, levene.h Converted t-test (incl levene) to use the new multipass_split_... mechanism. Wed Mar 31 22:36:22 2004 Ben Pfaff * frequencies.q: (calc_stats) Use moments data structure and calc_seskew(), calc_sekurt() functions. * set.q main.c settings.h Added support for --syntax and --algorithm options Tue Mar 30 22:04:19 2004 Ben Pfaff * vfm.c: Had to get last call to multipass_split_output() inside open_active_file()/close_active_file() pairing, so introduce new function. (internal_procedure) Move procedure() code here, except for calls to open_active_file() and close_active_file(). (procedure) Wrap open_active_file() and close_active_file() around internal_procedure(). (multipass_procedure_with_splits) Wrap open_active_file() and close_active_file() around internal_procedure(). Tue Mar 30 22:01:57 2004 Ben Pfaff * descript.c: (cmd_descriptives) Free `vars' to avoid memory leak. Mon Mar 29 16:26:40 2004 Ben Pfaff * debug.c: Removed. Moved cmd_debug_evaluate() into expr-evl.c. * expr-evl.c: (cmd_debug_evaluate) Moved here from debug.c. Mon Mar 29 16:03:08 2004 Ben Pfaff * algorithm.c: By default turn off some of the more expensive assertions. (expensive_assert) New macro which expands to assert if EXTRA_CHECKS is defined, to nothing otherwise. (unique) Use expensive_assert(). (binary_search) Ditto. (push_heap) Ditto. (pop_heap) Ditto. (make_heap) Ditto. (sort_heap) Ditto. * command.c: (conflicting_3char_prefixes) Words that are the same don't cause conflicts when they are abbreviated to the first three letters. * expr-evl.c: (CONCAT_func) Fix memory leak by incrementing struct nonterm_node's n earlier. (generic_str_func) Ditto. Mon Mar 29 15:32:17 2004 Ben Pfaff Add support for multipass procedures. Rewrite DESCRIPTIVES to test multipass support, take advantage of new moments calculation, and to not be such crappy code. Get rid of q2c processing for DESCRIPTIVES. * vfm.c: (struct multipass_split_aux_data) New structure. (multipass_procedure_with_splits) New function. (multipass_split_callback) New function. (multipass_split_output) New function. * descript.q: Removed. * descript.c: New file. * var.h: Removed descriptives enums. (struct descriptives_proc) Removed. (struct variable) Removed p.dsc. * Makefile.am: (q_sources_c) Remove descript.c. (q_sources_q) Removed descript.q. Mon Mar 29 15:31:55 2004 Ben Pfaff New manager for keeping track of used workspace. * workspace.c: New file. * workspace.h: New file. * Makefile.am: (pspp_SOURCES) Add workspace.c, workspace.h. * sort.c: (do_internal_sort) Use workspace_malloc(). (destroy_internal_sort) Use workspace_free(). Mon Mar 29 15:31:08 2004 Ben Pfaff New `struct casefile' for managing sets of cases. * casefile.c: New file. * casefile.h: New file. * command.def: Add DEBUG CASEFILE command. * Makefile.am: (pspp_SOURCES) Add casefile.c, casefile.h. * sort.c: (sort_cases) Move logic for sending storage file to disk into do_external_sort(). (struct internal_sort) Use an array of ccase pointers instead of a case_list. (do_internal_sort) Rewrite to handle casefiles. (compare_case_list) Removed. (compare_cases) New function. (compare_case_dblptrs) New function. (read_internal_sort_output) Deal with new struct internal_sort. * vfm.c: (static var workspace_overflow) Removed. (struct storage_stream_info) Removed all the members. Added struct casefile * member. (storage_sink_open) Use casefile. (open_storage_file) Removed. (write_storage_file) Removed. (storage_to_disk) Removed. (destroy_storage_stream_info) Use casefile. (storage_sink_write) Use casefile. (storage_sink_make_source) Use casefile. (storage_source_count) Use casefile. (storage_source_read) Use casefile. (storage_source_on_disk) Removed. (storage_source_get_cases) Removed. (storage_source_set_cases) Removed. (storage_source_get_casefile) New function. Mon Mar 29 15:30:09 2004 Ben Pfaff New `struct moments' for calculating moments. * stats.c: Removed. * stats.h: Removed. * moments.c: New file. * moments.h: New file. * command.def: Add DEBUG MOMENTS command. * Makefile.am: (pspp_SOURCES) Add moments.c, moments.h. Remove stats.c, stats.h. * aggregate.c: Modify AGGREGATE to use the new moments calculation, even if not in such a great way. (struct agr_var) Add `moments' member. (parse_aggregate_functions) Set `moments' member to null. (agr_destroy) Destroy `moments' member. (accumulate_aggregate_info) Use `moments' for standard deviation. (dump_aggregate_info) Ditto. (initialize_aggregate_info) Create or clear `moments'. * misc.h: Add pow2(), pow3(), pow4() functions in place of sqr(), cube(), pow4() that were in stats.h. All references updated. * crosstabs.q: stats.h had chi-square significance functions. Use GSL instead. (display_chisq) Use gsl_cdf_chisq_Q() instead of chisq_sig(). * expr-evl.c: (expr_evaluate) Use moments_of_values() for OP_CFVAR, OP_MEAN, OP_SD, OP_VARIANCE. Fri Mar 26 14:21:23 2004 Ben Pfaff * dictionary.c: (dict_compact_values) Compacted values need to start off from 0. Fri Mar 26 00:54:57 2004 Ben Pfaff * var-labs.c: (cmd_variable_labels) For compatibility, don't allow `/' at start. Check return value of parse_variables() for error return. Fri Mar 26 00:19:27 2004 Ben Pfaff Revamp expressions: make the code a little nicer, and fix bugs found in testing. * expr-evl.c: (expr_evaluate) Make expression argument const. Support OP_ADD, OP_SUB, OP_MUL, OP_DIV instead of OP_PLUS, OP_MUL. OP_POW is missing for arg 2 <= 0. OP_LOG is natural log, not base-10 log. Fix OP_ANY, OP_ANY_STRING, OP_RANGE, OP_RANGE_STRING off-by-ones. Add OP_MAX_STRING, OP_MIN_STRING. Fix OP_TIME_HMS, OP_DATE_WKYR boundary conditions. Add OP_CTIME_DAYS, OP_CTIME_HOURS, OP_CTIME_MINUTES, OP_CTIME_DAYS, OP_CTIME_SECONDS. Support OP_INDEX_2, OP_INDEX_3, OP_RINDEX_2, OP_RINDEX_3 instead of OP_INDEX, OP_INDEX_OPT, OP_RINDEX, OP_RINDEX_OPT. Merge OP_LPAD_OPT into OP_LPAD, OP_RPAD_OPT into OP_RPAD, OP_LTRIM_OPT into OP_LTRIM, OP_RTRIM_OPT into OP_RTRIM, OP_NUMBER_OPT into OP_NUMBER. Fix OP_RTRIM fragility. Support OP_SUBSTR_2, OP_SUBSTR_3 instead of OP_SUBSTR, OP_SUBSTR_OPT. Remove OP_INV. Simplify OP_SYSMIS. Remove OP_STR_MIS. * expr-opt.c: (optimize_expression) Rewrite. (macro n0) Removed. (macro n1) Removed. (macro n2) Removed. (macro s0) Removed. (macro s0l) Removed. (macro s1) Removed. (macro s1l) Removed. (macro s2) Removed. (macro s2l) Removed. (macro s) Removed. (macro sl) Removed. (eq_num_con) New function. (optimize_tree) New function. (macro rnc) Removed. (macro frnc) Removed. (str_search) Add const to string params. (str_rsearch) Ditto. (evaluate_tree_no_missing) Renamed from evaluate_tree. Add num[], str[], str_len[] locals to substitute for most of removed macros. Support OP_ADD, OP_SUB, OP_MUL, OP_DIV instead of OP_PLUS, OP_MUL. Removed support for missing values because we're never called with missing values. Use set_number() or set_number_errno() instead of rnc or frnc. Removed any stuff that caused trouble in testing. We can re-add it later if it really slows anything. Fix some random problems. (evaluate_tree_with_missing) Not yet supported. To be added later if it's important. (repl_num_con) Removed. (collapse_node) New function. (force_repl_num_con) Removed. (set_number) New function. (set_number_errno) New function. (repl_str_con) Removed. (set_string) New function. (yrmoda) Tighten boundary conditions. Adopt 2030 cut-off for 2-digit years. (dump_node) No special case for OP_AND, OP_OR. * expr-prs.c: (expr_prs) Honor EXPR_NO_OPTIMIZE bit. Rewrite. (expr_get_type) New function. (type_check) Rewrite. (type_coercion) New function. (struct operator) New structure. (match_operator New function. (parse_binary_operators) New function. (parse_inverting_unary_operator) New function. (parse_or) Rewritten. (parse_and) Rewritten. (parse_not) Rewritten. (parse_rel) Rewritten. (parse_add) Rewritten. (parse_mul) Rewritten. (parse_neg) Rewritten. (parse_exp) Rewritten. (parse_sysvar) Add $TRUE, $FALSE system variables. Get $LENGTH, $WIDTH from get_viewlength(), get_viewwidth(). (parse_primary) Use allocate_var_node(), allocate_num_con(), allocate_str_con(). (struct function) Remove desc, change `func' prototype. (unary_func) Remove special cases. (MISSING_func) Reduce to unary_func() that just returns a boolean. (SYSMIS_func) Handle SYSMIS((x)) like SYSMIS(x). (VALUE_func) Use allocate_var_node(). (nary_num_func) Allow MIN and MAX for strings. Use allocate_var_node(). Properly clean up. Fix return type. (generic_str_func) Use local table instead of removed `desc' member. Mostly rewrite. (get_num_args) Revise error message. (parse_function) Return EXPR_ERROR, not 0 on error. (macro op) Removed. (macro varies) Removed. (ops[]) Use expr.def. (free_node) Do nothing if node is null. (allocate_num_con) New function. (allocate_str_con) New function. (allocate_var_node) New function. (allocate_binary_nonterminal) New function. (append_nonterminal_arg) Removed. (static var func_tab[]) Revised. (expr_debug_print_postfix) Make parameter const. Use printf() instead of debug_printf(). * expr.def: New file. * expr.h: Change PXP_* to EXPR_*, all references updated. Also use named enum instead of unnamed, all references updated. Add EXPR_ANY, EXPR_NO_OPTIMIZE. * exprP.h: Remove EX_*. Add DEFINE_OPERATOR. Use expr.def instead of defining OP_* directly. (macro IS_TERMINAL) New macro. (macro IS_NONTERMINAL) New macro. (enum OP_NO_FLAGS) New. Fri Mar 26 00:18:01 2004 Ben Pfaff * error.c: (err_assert_fail) msg variable needs to be non-const. Fri Mar 26 00:17:24 2004 Ben Pfaff * debug.c: (cmd_debug_evaluate) Rewrite. Fri Mar 26 00:15:13 2004 Ben Pfaff Fix some CROSSTABS bit rot stupidity. * crosstabs.q: Reorder the CELLS subcommands for compatibility. (internal_cmd_crosstabs) Initializes cells[] correctly. (float_M_suffix) Rename format_cell_entry(), change prototype, rewrite. (display_crosstabulation) Fix cell formatting. Fri Mar 26 00:14:09 2004 Ben Pfaff Make lex_rest_of_line(), lex_entire_end() not discard lines. Have to call lex_discard_line() to do that. * command.c: (run_command) Call lex_discard_line() after lex_rest_of_line(). * lexer.c: (lex_entire_end) Change behavior. (lex_rest_of_line) Change behavior. Return const char *. (lex_discard_line) Don't clear getl_buf, don't emit message. * main.c: (handle_error) Emit message here. * repeat.c: (internal_cmd_do_repeat) Use lex_discard_line() instead of lex_entire_line(). * str.c: (mm_find_reverse) Make length params size_t. Rewrite. * title.c: (get_title) Call lex_discard_line() after lex_rest_of_line(). (cmd_file_label) Ditto. (cmd_document) Deal with const char * return value. Fri Mar 26 00:10:16 2004 Ben Pfaff Removed REMARK command. * command.c: (extract_prefix) Removed. (output_line) Removed. (cmd_remark) Removed. * command.def: Remove REMARK. Fri Mar 26 00:08:38 2004 Ben Pfaff Added abort() after lots of assert(0) invocations to avoid some compiler warnings. We really need a NOT_REACHED macro. Tue Mar 23 08:00:42 WAST 2004 John Darrington * sort.c: Added missing call to temp_file_close. Changed error messages to warnings. * set.q: Improved setting of set_view{length,width} to be more tolerant of buggy OSes. Sun Mar 21 10:11:14 WST 2004 John Darrington * val-labs.c: Fixed a bug where PSPP would crash, if VALUE LABELS was used with incorrect syntax. * error.c, error.h et al: Overridden definition of assert for a custom one. * test-q.c: Fixed a buglet where it would crash if no /VARIABLES subcommand was given when it ought to have been. Sat Mar 20 22:19:08 2004 Ben Pfaff * tab.c: (tab_vline) Fix assertions to respect row_ofs and col_ofs. (tab_hline) Ditto. (tab_box) Ditto. (tab_joint_text) Ditto. Sat Mar 20 17:57:23 2004 Ben Pfaff * levene.c: Add #include. * set.q: (set_viewport) Add `int' argument to make its prototype correct for signal(). Sat Mar 20 15:35:17 2004 Ben Pfaff * expr-evl.c: (expr_evaluate) Assert that `c' is nonzero before using it. Sat Mar 20 15:18:16 2004 Ben Pfaff Changed DFM from open-at-first-access to explicit-open. Before, calling dfm_get_record() or dfm_put_record() would automatically open the file. Now, you have to call dfm_open_for_reading() or dfm_open_for_writing() explicitly. This makes it possible to check permissions, file existence, etc. earlier. Also made struct file_handle more opaque, and clean up in general. * data-list.c: (cmd_data_list) Open handle for reading. * dfm.c: (struct dfm_fhuser_ext) Add `where', `saw_begin_data' members. (open_file_r) Renamed dfm_open_for_reading(), rewrote. (open_file_w) Renamed dfm_open_for_writing(), rewrote. (open_inline_file) Removed. (read_record) For inline_file, if we haven't seen BEGIN DATA, read it. Deal with line_number in extension record instead of file handle. (dfm_get_record) Rewrote. (dfm_put_record) Rewrote. (dfm_push) Assert file is open and one of ours. Deal with line_number in extension record instead of file handle. (dfm_pop) Assert file is open and one of ours. Deal with line_number in extension record instead of file handle. (cmd_begin_data) Use dfm_open_for_reading(). Mark that we saw BEGIN DATA. * file-handle.h: (enum constants RH_RF_*) Removed. (enum constants FH_MD_*) Removed. (struct file_handle) Removed `name', `norm_fn', `fn', `where', `recform', `lrecl', `mode' members. Public references to `recform' changed to use handle_get_mode(), references to `lrecl' changed to use handle_get_record_width(). Added `private' member. (enum file_handle_mode) New. * file-handle.q: (struct private_file_handle) New structure. (struct file_handle_list) New structure. (static var files) New. (static var file_handles) Removed. (init_file_handle) Removed. (create_file_handle) Removed. (get_handle_with_name) New function. (get_handle_for_filename) New function. (cmd_file_handle) Rewritten. (hash_file_handle) Removed. (cmp_file_handle) Removed. (fh_init_files) Rewritten. (fh_parse_file_handle) Rewritten. Allows identifiers as filenames. (fh_get_handle_by_name) Renamed handle_get_name(), all references updated. Rewritten. (fh_get_handle_by_filename) Renamed handle_get_filename(), all references updated. Rewritten. (fh_record_width) Renamed handle_get_record_width(), all references updated. Rewritten. (handle_get_mode) New function. * file-type.c: (cmd_file_type) Open handle for reading. * filename.c: [unix] (struct file_identity) New structure. [unix] (fn_get_identity) New function. [unix] (fn_free_identity) New function. [unix] (fn_compare_file_identities) New function. [!unix] (struct file_identity) New structure. [!unix] (fn_get_identity) New function. [!unix] (fn_free_identity) New function. [!unix] (fn_compare_file_identities) New function. * lexer.c: (static var put) Renamed put_token, all references updated. (static var put_tokstr) New. (static var put_tokval) New. (lex_init) Initialize put_tokstr(). (restore_token) New function. (save_token) New function. (lex_get) Use restore_token(). (lex_put_back) Use save_token(). (lex_put_back_id) New function. (lex_put_forward) Removed. (lex_preprocess_line) Set put_token instead of using lex_put_forward(). (lex_negative_to_dash) Use save_token(), set put_token directly. (dump_token) Use stderr instead of stdout. * main.c: (main) Remove call to cmd_init(). * matrix-data.c: (cmd_matrix_data) Open file for reading. * pfm-read.c: Use handle_get_filename() instead of trying to use h->fn directly, all over. * pfm-write.c: Ditto. * print.c: (internal_cmd_print) Open handle for writing. (dump_table) Use handle_get_filename(). (print_trns_proc) Use handle_get_mode(). (cmd_print_space) Use fh_parse_file_handle(). Open handle for writing. [0] (debug_print) Removed. * sfm-read.c: Use handle_get_filename() instead of trying to use h->fn directly, all over. * sfm-write.c: Ditto. Sat Mar 20 14:35:48 2004 Ben Pfaff Fix memory leaks. * autorecode.c: (arc_free) Free arc->src_values. * error.c: (msg) Free buf. * val-labs.c: (do_value_labels) Always free vars. * vfm.c: (close_active_file) If sink has no make_source then call its destroy function. Sat Mar 20 14:00:24 2004 Ben Pfaff Fixed cmd_parse() so that it always skips past a full command name. A few special commands for which this would be bad get special treatment. This lets us drop code for skipping past the end of a command name in most cmd_*() functions. It's not worth listing all the commands affected. * command.c: (struct command) Remove `cmd' member, replace by `name' member, all references updated. Remove `word', `next', `skip_entire_name' members. (macro DEFCMD) Deal with revised `struct command'. (macro UNIMPL) Ditto. (macro SPCCMD) New macro for commands whose last word shouldn't be skipped. (static array cmd_table[]) Make const, rename `commands', remove sentinel element. (macro COMMAND_CNT) New macro. (split_words) Removed. (cmd_init) Removed. (FILE_TYPE_okay) Make parameter const. (cmd_parse) Improve error messages. (match_strings) New function. (next_word) New function. (enum command_match) New enum. (conflicting_3char_prefixes) New function. (conflicting_3char_prefix_command) New function. (cmd_match_words) New function. (count_matching_commands) New function. (get_command_name) New function. (free_words) New function. (unknown_command_error) New function. (figure_out_command) Renamed parse_command_name(), rewritten. * command.def: Removed @ command. Marked BEGIN DATA, DOCUMENT, FILE LABEL, REMARK, SUBTITLE, TITLE as special. Renamed EVALUATE to DEBUG EVALUATE. Added N alias for N OF CASES, SORT alias for SORT CASES. * command.h: (macro SPCCMD) New. * include.c: (cmd_include_at) Removed. (cmd_include) Allow identifier to be used as filename. * inpt-pgm.c: (cmd_reread) Use fh_parse_file_handle(). * t-test.q: (cmd_t_test) Command name is now parsed for us. Sat Mar 20 13:56:00 2004 Ben Pfaff Start work on better test framework. * Makefile.am: (pspp_sources) Add debug.c. * debug.c: New file. * compute.c: (cmd_evaluate) Moved to debug.c, renamed cmd_debug_evaluate(). * expr-prs.c: (expr_parse) Remove PXP_DUMP support. * expr.h: (enum constant PXP_DUMP) Removed. Sat Mar 20 00:05:42 WST 2004 John Darrington * set.q: Implemented the SHOW command, and synced it to the existing SET cmd. Added a handler for SIGWINCH so that viewlength and viewwidth follow changes as the window size is changed. Added fallback to set viewlength and viewwidth from LINES and COLUMS environment variables if other methods are not available. glob.c: Removed a lot of global variables from glob.c and encapsulated them in set.q random.c: Tidied up the way the random seed is set. str.c: Added a ds_vprintf function. error.c: Extended dump_message so that messages are always broken at '\n' characters. Thu Mar 18 11:07:14 2004 Ben Pfaff * pfm-write.c: (bufwrite) Write out the correct element for string variables. From Andreas Streichardt . Mon Mar 15 20:48:03 2004 Ben Pfaff Get rid of static and global (!) vars in matrix-data.c. * matrix-data.c: (static var nr_data) Removed. (static var nr_factor_values) Removed. (static var max_cell_index) Removed. (static var split_values) Removed. (struct nr_aux_data) New structure. (read_matrices_without_rowtype) Use a local struct nr_aux_data in place of static vars, pass to create_case_source() and procedure() as aux data. (nr_read_data_lines) Use struct nr_aux_data * parameter instead of struct matrix_data_pgm *. (nr_read_splits) Ditto. (nr_read_factors) Ditto. (nr_output_data) Ditto. (static var wr_content) Removed. (global var wr_data) Removed. (global var wr_current) Removed. (struct wr_aux_data) New structure. (read_matrices_with_rowtype) Use a local struct wr_aux_data in place of static vars, pass to create_case_source() and procedure() as aux data. (matrix_data_read_with_rowtype) Use struct wr_aux_data * parameter instead of matrix_data_pgm *. (wr_read_splits) Ditto. (wr_output_data) Ditto. (wr_read_rowtype) Ditto. (wr_read_factors) Ditto. (wr_read_indeps) Ditto. Mon Mar 15 20:07:29 2004 Ben Pfaff Get rid of static vars in autorecode.c. * autorecode.c: (struct autorecode_trns) Rename `arc' to `specs', `n_arc' to `spec_cnt'. All references updated. (static var v_src) Removed. (static var v_dest) Removed. (static var h_trns) Removed. (static var nv_src) Removed. (static var descend) Removed. (static var print) Removed. (enum direction) New enum. (struct autorecode_pgm) New structure. (cmd_autorecode) Use struct autorecode_pgm instead of static vars. Move n_dest local var into struct autorecode_pgm for ease of clean-up. Use arc_free(). (arc_free) New function. (recode) Modify to take struct autorecode_pgm * parameter instead of using statics. Let the caller clean up. (autorecode_proc_func) Use struct autorecode_pgm * auxiliary data instead of statics. Rearrange code a little. Mon Mar 15 00:25:02 2004 Ben Pfaff Get rid of static, global vars in recode.c. Remove debug code. * recode.c: (static var head) Removed. (global var v) Removed. (global var nv) Removed. (cmd_recode) New local variables head, v, nv. Initialize and free v. Don't call debug_print(). [DEBUGGING] (dump_dest) Removed. [DEBUGGING] (debug_print) Removed. Mon Mar 15 00:14:49 2004 Ben Pfaff Get rid of static vars in expr-opt.c. * expr-opt.c: (static var e) Removed. (static var nop) Removed. (static var mop) Removed. (static var ndbl) Removed. (static var mdbl) Removed. (static var nstr) Removed. (static var mstr) Removed. (static var nvars) Removed. (static var mvars) Removed. (struct expr_dump_state) New structure. (dump_expression) Use new struct expr_dump_state instead of static vars and pass to functions we call. (dump_node) Use struct expr_dump_state * parameter. (emit) Ditto. (emit_num_con) Ditto. (emit_str_con) Ditto. (emit_var) Ditto. Mon Mar 15 00:03:51 2004 Ben Pfaff Get rid of static var in COUNT. * count.c: (static var head) Move into cmd_count(). (cmd_count) [DEBUGGING] Don't call debug_print. [DEBUGGING] (debug_print) Removed. Sun Mar 14 23:56:09 2004 Ben Pfaff Get rid of static vars in VALUE LABELS, ADD VALUE LABELS. * val-labs.c: (static var v) Removed. (static var nv) Removed. [DEBUGGING] (debug_print) Removed. (verify_val_labs) Add struct variable **, int parameters. (get_label) Ditto. Improve error messages, streamline. (erase_labels) New function for erasing value labels, taking over part of verify_val_labs()'s function. (init) Removed. (done) Removed. (cmd_value_labels) No need to call init() or done() anymore. (cmd_add_value_labels) Ditto. (do_value_labels) Add vars, var_cnt local variables. Clean up after them internally. Call erase_labels() if we should. Don't call debug_print(). Sun Mar 14 23:33:53 2004 Ben Pfaff Get rid of static vars in MATCH FILES. * get.c: (static var mtf_head) Removed. (static var mtf_tail) Removed. (static var mtf_by) Removed. (static var mtf_n_by) Removed. (static var mtf_master) Removed. (static var mtf_seq_num) Removed. (static var mtf_seq_nums) Removed. (static var mtf_sink) Removed. (static var mtf_case) Removed. (struct mtf_proc) New structure. (cmd_match_files) Use struct mtf_proc instead of static vars. (mtf_processing_finish) Ditto. (mtf_free) Ditto. (mtf_delete_file_in_place) Ditto. (mtf_read_nonactive_records) Ditto. (mtf_compare_BY_values) Ditto. (mtf_processing) Ditto. (mtf_merge_dictionary) Ditto. Sun Mar 14 22:48:12 2004 Ben Pfaff * command.def: Add CASESTOVARS, VARSTOCASES unimplemented commands. * dictionary.c: (dict_rename_var) Add assertion. (dict_contains_var) Check by index instead of name. Sun Mar 14 22:01:02 2004 Ben Pfaff Get rid of compaction_necessary, compaction_nval, compaction_case. Redo VFM interface. Replace disk_sink and memory_sink by storage_sink, disk_source and memory_source by storage_source. * vfm.h: (struct case_sink) Add `dict', `idx_to_fv', `value_cnt' members. * vfm.c: (struct write_case_data) Remove `begin_func', `end_func', `func_aux' members. Add `aux', `trns_case', `sink_case', `cases_written', `cases_analyzed' members. (global var compaction_necessary) Make static. (global var compaction_nval) Removed. (global var compaction_case) Removed. (static var case_count) Removed. (struct procedure_aux_data) Removed. (struct split_aux_data) Removed. (procedure) Remove begin_func, end_func parameters. Rewrite. (static var not_canceled) Removed. (process_active_file) Removed. (process_active_file_write_case) Removed. (process_active_file_output_case) Removed. (prepare_for_writing) Moved into open_active_file(). (arrange_compaction) Ditto. (setup_lag) Ditto. (open_active_file) Rewrote. (write_case) New function. [DEBUGGING] (index_to_varname) Removed. (execute_transformations) New function. (exclude_this_case) Renamed filter_case(), changed interface. (clear_case) Added struct ccase * parameter to interface. (close_active_file) Added struct write_case_data * parameter, rewrote. (disk_sink_create) Removed. (disk_sink_destroy) Removed. (disk_sink_make_source) Removed. (disk_sink_write) Removed. (disk_source_count) Removed. (disk_source_destroy) Removed. (disk_source_read) Removed. (global var disk_sink_class) Removed. (global var disk_source_class) Removed. (global var memory_sink_class) Removed. (global var memory_source_class) Removed. (memory_sink_create) Removed. (memory_sink_destroy) Removed. (memory_sink_make_source) Removed. (memory_sink_write) Removed. (memory_source_count) Removed. (memory_source_destroy) Removed. (memory_source_get_cases) Removed. (memory_source_read) Removed. (memory_source_set_cases) Removed. (struct disk_stream_info) Removed. (struct memory_sink_info) Removed. (struct memory_source_info) Removed. (write_active_file_to_disk) Removed. (destroy_storage_stream_info) New function. (global var null_sink_class) New var. (global var storage_sink_class) New var. (global var storage_source_class) New var. (open_storage_file) New function. (storage_sink_destroy) New function. (storage_sink_make_source) New function. (storage_sink_open) New function. (storage_sink_write) New function. (storage_source_count) New function. (storage_source_destroy) New function. (storage_source_get_cases) New function. (storage_source_on_disk) New function. (storage_source_read) New function. (storage_source_set_cases) New function. (storage_source_to_disk) New function. (storage_to_disk) New function. (struct storage_stream_info) New structure. (write_storage_file) New function. (procedure_write_case) Removed. (create_case_source) Add `struct dictionary *' parameter, all references updated. (create_case_sink) Ditto. (free_case_sink) New function. (struct split_aux_data) New structure. (procedure_with_splits) New function implementing what procedure() used to. (SPLIT_FILE_proc_func) Removed. (procedure_with_splits_callback) New function. (equal_splits) New function. * aggregate.c: Pass around a struct instead of using statics. (static var outfile) Remove. (enum type) Give it tag `missing_treatment'. (static var missing) Remove. (static var sort) Remove. (static var agr_first) Remove. (static var agr_next) Remove. (static var case_count) Remove. (static var prev_case) Remove. (static var buf64_1xx) Remove. (static var buf_1xx) Remove. (struct agr_proc) New structure incorporating the above. (cmd_aggregate) Use new struct. Clean up error handling using agr_destroy(). Completely rewrite actual implementation of aggregation. (create_sysfile) Add struct agr_proc * parameter, modify accordingly. (parse_aggregate_functions) Ditto. (free_aggregate_functions) Ditto. Rename agr_destroy(). (aggregate_single_case) Add struct agr_proc * parameter, modify accordingly. (accumulate_aggregate_info) Ditto. (dump_aggregate_info) Ditto. (initialize_aggregate_info) Ditto. (agr_00x_trns_proc) Removed. (agr_00x_end_func) Removed. (agr_10x_trns_proc) Removed. (agr_10x_trns_free) Removed. (agr_10x_end_func) Removed. (agr_11x_read) Removed. (agr_11x_finish) Removed. [DEBUGGING] (debug_print) Removed. (write_case_to_sfm) Add struct agr_proc * parameter, modify accordingly. (agr_to_active_file) New function. (presorted_agr_to_sysfile) New function. (sort_agr_to_sysfile) New function. * autorecode.c: (cmd_autorecode) Use procedure_with_splits(). * crosstabs.q: (internal_cmd_crosstabs) Ditto. * descript.q: (cmd_descriptives) Ditto. * dfm.c: (cmd_begin_data) Check for storage_source_class. Adapt to new procedure() interface. * command.c: (cmd_execute) Adapt to new procedure() interface. * dictionary.c: (dict_compact_values) Also delete scratch variables. (dict_get_compacted_value_cnt) New function. (dict_get_compacted_idx_to_fv) New function. * flip.c: (cmd_flip) Warn about and cancel TEMPORARY. (cmd_flip) Adapt to new procedure() interface. (flip_sink_write) Use sink->idx_to_fv. * frequencies.q: (internal_cmd_frequencies) Use procedure_with_splits(). * get.c: (cmd_save_internal) Adapt to new procedure() interface. (static var mtf_sink) New static var. (static var mtf_case) New static var. (cmd_match_files) Warn about and cancel TEMPORARY. Redo the way we actually implement the matching. (mtf_delete_file_in_place) Use mtf_case. (mtf_processing) Use mtf_case and mtf_sink. (cmd_export) Adapt to new procedure() interface. * levene.c: (levene) Use procedure_with_splits(). * list.q: (cmd_list) Use procedure_with_splits(). * matrix-data.c: (read_matrices_without_rowtype) Adapt to new procedure() interface. (read_matrices_with_rowtype) Ditto. * modify-vars.c; (cmd_modify_vars) Warn about and cancel TEMPORARY. Adapt to new procedure() interface. * rename-vars.c: Warn about and cancel TEMPORARY. * sort.c: (cmd_sort_cases) Warn about TEMPORARY. (sort_cases) Use dict_get_compacted_value_cnt() instead of compaction_nval. Adapt to new procedure() interface. Use storage_source_to_disk(). (do_internal_sort) Don't try to dump the cases to memory. (compare_case_lists) Pass null idx_to_fv. (struct initial_run_state) Add `idx_to_fv' member. Remove `case_size' member. (write_initial_runs) Don't initialize irs->case_size. Adapt to new procedure() interface. Reset irs->idx_to_fv after calling procedure(). (sort_sink_write) Set irs->idx_to_fv. Use case_size from struct sort_cases_pgm. Pass irs, not struct sort_cases_pgm to push_heap(). (destroy_initial_run_state) Don't dereference irs after freeing it. (allocate_cases) Don't calculate case_size locally. (compare_record) Add idx_to_fv parameter. (compare_record_run) Change parameter from struct sort_cases_pgm * to struct initial_run_state *. Pass irs->idx_to_fv to compare_record(). (compare_record_run) Third parameter now a struct initial_run_state *. (output_record) No need for out_case anymore. Pass irs, not struct sort_cases_pgm to pop_heap(). Use case_size from struct sort_cases_pgm. (merge) Use case_size from struct sort_cases_pgm. (merge_once) Use case_size from struct sort_cases_pgm. Pass null pointer to compare_record() as idx_to_fv. (global var sort_sink_class) Make static. * t-test.q: (cmd_t_test) Use procedure_with_splits(). * temporary.c: Remove debugging crap. Sat Mar 13 14:19:52 WST 2004 John Darrington * t-test.q, levene.c: Fixed up the handling of MISSING values int the T-TEST Fri Mar 12 16:23:35 WST 2004 John Darrington * t-test.q, levene.c: Added support for T-TEST /GROUP where only one value is given. Wed Mar 10 23:25:13 2004 Ben Pfaff Change explicit variable name checks into use of dict_class_from_id(). * dictionary.c: (dict_create_var) Change explicit variable name check into use of dict_class_from_id(). * get.c: (trim_dictionary) Ditto. * sel-if.c: (cmd_filter) Ditto. * sysfile-info.c: (cmd_display) Ditto. * vars-prs.c: (parse_DATA_LIST_vars) Ditto. * vfm.c: (arrange_compaction) Ditto. * weight.c: (cmd_weight) Ditto. Wed Mar 10 21:16:34 2004 Ben Pfaff * temporary.c: (cmd_temporary) When TEMPORARY was the first transformation following the input program, if any, for some reason we special-cased f_trns. That's just wrong. It should always be set to n_trns. Tue Mar 9 23:44:40 2004 Ben Pfaff * format.c: (parse_format_specifier_name) Fix brown-bag bug introduced in last check-in. Tue Mar 9 23:10:41 2004 Ben Pfaff * format.c: (global array translate_fmt[]) Removed. (translate_fmt) New function as replacement. (parse_format_specifier_name) Rewrite. * pfm-read.c: (convert_format) Use translate_fmt() instead of translate_fmt[]. * sfm-read.c: (parse_format_spec) Ditto. * postscript.c: (text) Fix handling of fonts with missing ligatures. * sort.c: (struct external_sort) Add temp_name member. (destroy_external_sort) Free temp_dir, temp_name members. (init_external_sort) Allocate temp_name. (get_temp_file_name) Change prototype. (open_temp_file) Deal with change to get_temp_file_name(). (close_temp_file) Ditto. (remove_temp_file) Ditto. (write_temp_file) Ditto. (read_temp_file) Ditto. (sort_sink_destroy) Removed. (sort_sink_class) Change destroy member to null. Tue Mar 9 22:36:34 2004 Ben Pfaff Eliminate temp_case. * aggregate.c: (cmd_aggregate) No need to save/restore temp_case anymore. Use agr_11x_finish(). (aggregate_single_case) Make first param const. (accumulate_aggregate_info) Ditto. (agr_00x_end_func) Use compaction_case, not temp_case. (agr_11x_func) Break into agr_11x_read(), agr_11x_finish(). * data-list.c: (struct data_list_pgm) Add `case_size' member. (cmd_data_list) Initialize case_size. (read_from_data_list_fixed) Add struct ccase * param, use instead of temp_case. (read_from_data_list_free) Ditto. (read_from_data_list_list) Ditto. (read_one_case) Rename data_list_trns_proc(), all references updated. Add argument in calling above functions. Use c argument instead of temp_case. (destroy_dls) Rename data_list_trns_free(), all references updated. * expr-evl.c: (expr_evaluate) Make second parameter const. * file-type.c: (struct file_type_pgm) Add `case_size' member. (cmd_end_file_type) Initialize `case_size'. (file_type_source_read) Add struct ccase * parameter. Use instead of temp_case. * flip.c: Rewritten. * get.c: (struct get_pgm) New structure to keep track of case_size. (cmd_get) Initialize case_size. (cmd_import) Ditto. (get_source) Deal with struct get_pgm. (get_source_read) Add struct ccase * parameter, use instead of temp_case. (import_source_read) Ditto. * get.c: Use a null pointer instead of temp_case to represent the "current case" in a struct mtf_file's input member. (mtf_processing_finish) Pass null to mtf_processing(), not temp_case. (mtf_read_nonactive_records) Don't set iter->input to temp_case. (mtf_compare_BY_values) Add extra arg, use instead of null input members. (mtf_processing) Use c parameter instead of temp_case. Pass compaction_case to process_active_file_output_case(). * glob.c: (global variable temp_case) Removed. * inpt-pgm.c: (struct input_program_pgm) Add `case_size' member. (cmd_input_program) Initialize case_size. Set vfm_source->value_cnt. (init_case) Add struct ccase * parameter, use instead of temp_case. (clear_case) Ditto. (input_program_source_read) Ditto. * matrix-data.c: (matrix_data_read_without_rowtype) Ditto. (dump_cell_content) Ditto. (nr_output_data) Ditto. (read_matrices_without_rowtype) Ditto. (matrix_data_read_with_rowtype) Ditto. (wr_read_splits) Ditto. (wr_output_data) Ditto. * sort.h: (struct sort_cases_pgm) New member `case_size'. * sort.c: (sort_cases) Initialize scp->case_size. (struct external_sort) Remove `case_size' member. (write_initial_runs) Only call vfm_sink->class_destroy if non-null. (struct sort_source_aux) New structure. (sort_source_read_helper) New function. (sort_source_read) Use sort_source_read_helper(). (read_sort_output) Change interface to be more reasonable. (read_internal_sort_output) Ditto. (read_external_sort_output) Ditto. * vars-prs.c: (dict_class_to_name) Pass return value through gettext. * vfm.c: (struct procedure_aux_data) Add `trns_case' member. (procedure) Initialize trns_case. (procedure) Pass trns_case to vfm_source->class->read(). Free trns_case. (process_active_file) Start using struct procedure_aux_data. (process_active_file_write_case) Pass trns_case to transformations, lag_case(), clear_case(). (process_active_file_output_case) Add struct ccase * parameter. (create_trns_case) New function. (make_temp_case) Removed. (vector_initialization) Removed. (close_active_file) Only call make_source if non-null, otherwise set vfm_source to null pointer. Don't free temp_case. (disk_source_read) Add struct ccase * parameter, use instead of temp_case. (memory_source_read) Ditto. (lag_case) Add const struct ccase * member. (procedure_write_case) Use trns_case instead of temp_case. (clear_case) Add struct ccase * member, use instead of temp_case. (exclude_this_case) Ditto. (create_case_source) Add struct dictionary * parameter, use to initialize source->value_cnt. * vfm.h: (struct case_source) Add `value_cnt' member. (struct case_source_class) Add struct ccase * parameter to `read' member function pointer. (struct case_sink_class) Make struct ccase * parameter const in `write' member function pointer. Wed Mar 3 20:44:37 2004 Ben Pfaff Fix a lot of "possibly uninitialized variable" warnings. Some of them are even real bugs. A few of them make me wonder how the code ever worked. * aggregate.c: (parse_aggregate_functions) Initialize `function. * ascii.c: (output_lines) Add default case to switch. * crosstabs.q: Remove static variable `expected' and all references to it. (display_crosstabulation) Always calculate expected value. (calc_chisq) Ditto. (output_pivot_table) Initialize `cmp'. (display_crosstabulation) New variable `last_row', which is initialized. * data-in.c: (parse_numeric) Always initialize sign. How did this work at all?! * data-list.c: (repeating_data_trns_proc) Always initialize code. Always set info.ofs. (How did this work?!) * expr-opt.c: (optimize_tree) Always initialize `m'. (evaluate_tree) Always initialize `c'. (How did this work?) * frequencies.q: (frq_custom_variables) Always initialize min, max. (frq_custom_grouped) Always initialize `dl'. * groff-font.c: (groff_read_font) Always initialize char_set. * matrix-data.c: (nr_output_data) Initialize `split'. (wr_read_splits) Remove shadowing split_cnt declaration. (wr_output_data) Initialize `split'. * output.c: (tokener) Skip add character on syntax error. * pool.c: (pool_strndup) Always set `copy'. (How did this work?!) * postscript.c: (read_ps_encodings) Use line.string instead of uninitialized `bp'. (write_text) Add default case to switch. (text) Always initialize multiple variables. Fix bug with ligatures. * print.c: (fixed_parse_fortran) Initialize head. (alloc_line) Add default case to switch. * recode.c: (parse_dest_spec) Handle case where nothing matches. (recode_trns_proc) Move variable declaration inward. Add default case to switch. * sfm-read.c: (read_header) Initialize skip_amt. * sysfile-info.c: (display_variables) Always initialize pc. * vars-prs.c: Initialized `included'. Wed Mar 3 09:30:09 2004 Ben Pfaff * main.c: (main) sigaction()'s sa_flags member was uninitialized. Just use signal() instead. Wed Mar 3 09:26:30 2004 Ben Pfaff Get rid of vfm_sink_info and vfm_source_info. * aggregate.c: (agr_00x_end_func) Don't increment sfm_sink_info.ncases. * sort.c: (do_internal_sort) Get case count from vfm_source->class->count(). (struct external_sort) Add `case_size' member. (do_external_sort) Initialize case_size. (struct initial_run_state) Add `case_size' member. (write_initial_runs) Initialize case_size. (sort_sink_write) Use case_size. (read_external_sort_output) Use case_size. Get case_cnt from initial_runs. * vfm.c: (struct write_case_data) Add underscores to existing arg names, all references updated. Renamed `aux' as `func_aux', all references updated. Added new `aux' member. (global var vfm_source_info) Removed. (global var vfm_sink_info) Removed. (struct procedure_aux_data) New. (struct split_aux_data) New. (procedure) Use `aux' fields for procedure_aux_data, split_aux_data. (process_active_file_write_case) Pass case_count + 1 to transformation procedures, exclude_this_case(). (process_active_file_output_case) Don't increment vfm_sink_info.ncases. (prepare_for_writing) Don't initialize vfm_sink_info. Don't try to send data to disk early. (make_temp_case) Don't use vfm_sink_info.case_size. (close_active_file) Don't initialize vfm_source_info. (struct disk_stream_info) New, to allow for case_cnt and case_size fields. (disk_sink_create) Initialize and/or update disk_stream_info. (disk_sink_write) Ditto. (disk_sink_destroy) Ditto. (disk_sink_make_source) Ditto. (disk_source_read) Ditto. (disk_source_destroy) Ditto. (global var disk_source_class) Add disk_source_count(). (disk_source_count) New function. (struct memory_sink_info) Add `case_cnt', `case_size' members. (struct memory_source_info) Ditto. (memory_sink_create) Deal with case_cnt, case_size. (memory_sink_write) Ditto. (memory_sink_make_source) Ditto. (memory_source_read) Ditto. (memory_source_count) New function. (memory_source_class) Add memory_source_count(). (procedure_write_case) Don't use vfm_sink_info.ncases. Do use proc_aux->cases_written, and pass it to transformation procedures and exclude_this_case (). (exclude_this_case) Add case_num parameter. Pass it to expr_evaluate(). (SPLIT_FILE_procfunc) Use split_aux->prev_case instead of static variable. * vfm.h: (struct case_source_class) Add `count' member. * vfmP.h: (struct stream_info) Removed. (global variable vfm_source_info) Removed. (global variable vfm_sink_info) Removed. Tue Mar 2 23:38:17 2004 Ben Pfaff * var.h: (typedef trns_proc_func) New typedef. (trns_free_func) New typedef. (struct trns_header) Change `proc' to type trns_proc_func, `free' to type trns_free_func. This only changes the actual type of trns_proc_func, adding a `case_num' parameter. Updated all implementations to use the typedefs instead. * compute.c: (compute_num) Pass case_num to expr_evaluate(). (compute_num_vec) Ditto. (compute_str) Ditto. (compute_str_vec) Ditto. * do-if.c: (do_if_trns_proc) Ditto. * expr-evl.c: (expr_evaluate) Add new case_num parameter, use for OP_CASENUM. * inpt-pgm.c: (input_program_source_read) Maintain case count, pass to transformation functions. (reread_trns_proc) Pass case_num arg to expr_evaluate(). * loop.c: (loop_1_trns_proc) Ditto. (loop_2_trns_proc) Ditto. (loop_3_trns_proc) Ditto. * print.c: (print_space_trns_proc) Ditto. * sel-if.c: (select_if_proc) Ditto. Tue Mar 2 11:36:52 2004 Ben Pfaff * frequencies.q: (cleanup_freq_tab) Avoid memory leak by destroying hash table. * glob.c: (read_active_file) Variable not referenced, removed. (cancel_input_pgm) Ditto. * levene.c: Add #include needed to call free(). * aggregate.c: (parse_aggregate_functions) Make `function' variable const. Tue Mar 2 11:30:56 2004 Ben Pfaff Start working to eliminate VFM dependence on static variables. * command.c: (cmd_parse) Use case_source_is_class(). * data-list.c: Rewrite to eliminate use of static variables. * dfm.c: (cmd_begin_data) Use case_source_is_class(). * file-handle.q: (fh_handle_name) Make parameter const. * file-type.c: Rewrite to eliminate use of static variables. * flip.c: Rewrite to eliminate use of static variables. * format.c: (get_format_var_width) New function. * get.c: Eliminate use of static variables. * inpt-pgm.c: Eliminate use of static variables. * matrix-data.c: Eliminate use of static variables. * set.q: (set_max_workspace) New variable. (cmd_set) Use SET WORKSPACE to modify set_max_workspace. * var.h: (struct case_list) Move here from vfmP.h. * vars-atr.c: (discard_variables) Handle new vfm_source type. * vfm.c: (vfm_source) Change type from struct case_stream to struct case_source. (vfm_sink) Change type from struct case_stream to struct case_sink. (static var paging) Rename workspace_overflow, all references updated. (procedure) Use new class structures. (process_active_file) Ditto. (process_active_file_write_case) Ditto. (prepare_for_writing) Use set_max_workspace. Use new class structures. (close_active_file) Use new class structures. Free old sink. (global var disk_source_file) Removed. (global var disk_sink_file) Removed. (disk_stream_init) Removed. (disk_stream_read) Removed. (disk_stream_write) Removed. (disk_stream_mode) Removed. (disk_stream_destroy_source) Removed. (disk_stream_destroy_sink) Removed. (global var vfm_disk_stream) Removed. (disk_sink_create) New function. (disk_sink_write) New function. (disk_sink_destroy) New function. (disk_sink_make_source) New function. (disk_sink_class) New static var. (disk_source_read) New function. (disk_source_destroy) New function. (global var vfm_source_class) New var. (global var memory_source_cases) Removed. (global var memory_sink_cases) Removed. (global var memory_sink_max_cases) Removed. (struct memory_sink_info) New struct. (memory_stream_init) Removed. (memory_stream_read) Removed. (memory_stream_write) Removed. (memory_stream_mode) Removed. (memory_stream_destroy_source) Removed. (memory_stream_destroy_sink) Removed. (global var vfm_memory_stream) Removed. (page_to_disk) Renamed write_active_file_to_disk(). (memory_sink_create) New function. (memory_sink_write) New function. (memory_sink_destroy) New function. (memory_sink_make_source) New function. (memory_sink_class) New static var. (memory_source_read) New function. (memory_source_destroy) New function. (memory_source_get_cases) New function. (memory_source_set_cases) New function. (global var vfm_source_class) New var. (procedure_write_case) Use new class structures. (create_case_source) New function. (case_source_is_complex) New function. (case_source_is_class) New function. (create_case_sink) New function. * vfm.h: (global variable reinit_sysmis) Not used, removed. (global variable reinit_blanks) Not used, removed. (global variable init_zero) Not used, removed. (global variable init_blanks) Not used, removed. (struct case_source) New struct. (struct case_source_class) New struct. (struct case_sink) New struct. (struct case_sink_class) New struct. (struct case_stream) Removed. * vfmP.h: (struct case_list) Moved to var.h. Tue Mar 2 11:28:30 2004 Ben Pfaff * algorithm.c: (count_equal) New function. (count_if) New function. (unique) Add assertions. (partition) Add assertions. (is_partitioned) New function. (copy_if) Add assertions. (remove_equal) Add assertions. (lexicographical_compare) Rename lexicographical_compare_3way. (sort) Add assertions. Rephrase some code. (is_sorted) New function. Sun Feb 29 23:24:57 2004 Ben Pfaff Rewrite SORT CASES. * sort.c: Completely rewrite. * sort.h: Expose interface via struct sort_cases_pgm, not via global variables. * aggregate.c: (sort) New static var. (cmd_aggregate) Use sort. (create_sysfile) Ditto. (aggregate_single_case) Ditto. (dump_aggregate_info) Ditto. (agr_00x_end_func) Ditto. (debug_print) Ditto. * var.h: (enum SRT_ASCEND) Removed. (enum SRT_DESCEND) Removed. (struct sort_cases_proc) Removed. (struct variable) Remove p.srt member. Sun Feb 29 23:22:45 2004 Ben Pfaff Get rid of the old, crappy heap structure and replace it by a new, shiny, C++ STL-like heap structure. * Makefile.am: (pspp_SOURCES) Remove heap.c, heap.h. * algorithm.c: (push_heap) New function. (heapify) Ditto. (pop_heap) Ditto. (make_heap) Ditto. (sort_heap) Ditto. (is_heap) Ditto. * heap.c: Removed. * heap.h: Removed. Sun Feb 29 23:21:53 2004 Ben Pfaff Increase warning level. * Makefile.am: (AM_CFLAGS) Remove -Wnouninitialized. Sat Feb 21 17:38:58 WST 2004 John Darrington * main.c: Added a signal handler for SIGSEGV requesting a bug report. Fri Feb 20 23:22:14 2004 Ben Pfaff * dictionary.c: (dict_create_var) Fix root cause of bug worked around by previous change log entry. * compute.c: (lvalue_finalize) Remove workaround from previous change log entry. Fri Feb 20 14:37:41 WAST 2004 John Darrington * compute.c: Fixed a bug where the Format was not getting set for computed variables (thus causing a crash when SAVEing). * Added a test to stop this bug ever coming back Wed Feb 18 22:21:35 2004 Ben Pfaff Got rid of approx.h. In general, replaced all references to approx_eq() by ==, approx_lt() by <, etc. Other types of changes noted below. * Makefile.am: (pspp_SOURCES) Removed approx.h. * data-out.c: (try_F) Replaced test for approx_eq(number, 0.0) by test for mag < EPSILON. * misc.h: Add definition of EPSILON. Wed Feb 18 21:32:44 2004 Ben Pfaff * vfm.c: (procedure) Add check to prevent recursive call. Wed Feb 18 21:48:54 WST 2004 John Darrington * Moved the declarations relating to values to their own header file (val.h) * Added levene.c and levene.h * vars-atr.c: Changed the signature of compare_values to take const * arguments. * t-test.q: Changed the structure of struct t_test_proc variables now contain their own group statistics information. Eventually, t_test_proc might get renamed, because it'd be applicable to other commands too. Mon Feb 16 23:15:51 2004 Ben Pfaff * data-out.c: Clean up. Changed interface of convert_*() to take either a `double' or a `const char *' instead of a `const union value *'. Update all implementations of those interfaces. (data_out) Use switch statements instead of a table. (convert_AHEX) Rewrite. * format.h: Update comment. Mon Feb 16 22:14:36 2004 Ben Pfaff * q2c.c: (dump_header) Add an Emacs header line to output files that makes generated .c files read-only by default, to make it difficult to accidentally change generated files. Mon Feb 16 22:12:07 2004 Ben Pfaff * frequencies.q: (compare_freq_numeric_a) Compare by frequency, not bogus a->v.c <=> b->v.c pointer compare. (compare_freq_alpha_a) Ditto. (compare_freq_numeric_d) Ditto. (compare_freq_alpha_d) Ditto. Mon Feb 16 22:00:53 2004 Ben Pfaff Changed data_out() to store string data directly into a `union value''s s member, not indirectly into c. * crosstabs.q: (output_pivot_table) Use format_short() instead of data_out(). (table_value_missing) Ditto. (float_M_suffix) Ditto. (format_short) New function. * data-in.h: (data_in_finite_line) Remove inline definition. * data-list.c: (destroy_dls_var_spec) New function. (destroy_dls) Rewrite in terms of destroy_dls_var_spec(). (data_list_source_destroy_source) Avoid cast. (struct repeating_data_trns) New field `id_value'. Update comments. (cmd_repeating_data) Initialize id_value. Use new repeating_data_trns_free() for freeing REPEATING DATA transformations. (rpd_parse_record) Rewrite support for record ID to be less bogus. (repeating_data_trns_free) New function. * data-out.c: (data_out) Change return type to `void' by replacing error returns by writing a message into the output buffer. (convert_A) Read from v->s instead of v->c. (convert_AHEX) Ditto. * expr-evl.c: Update comment. (expr_evaluate) Add assertion in OP_STRING case. * format.h: (macro MAX_FORMATTED_LEN) New macro. * list.q: (list_cases) Update for new data_out() semantics. * print.c: (print_trns_proc) Ditto. * tab.c: (tab_value) Ditto. (tab_float) Avoid stupid cast. * var.h: Update comments. (macro MAX_STRING) New macro. (macro MAX_ELEMS_PER_VALUE) New macro. * vars-atr.c: (compare_values) New function. * vfm.c: (dump_splits) Update for new data_out() semantics. Mon Feb 16 21:45:47 2004 Ben Pfaff * crosstabs.q: (struct table_entry) Rename v[] to values[]. All references updated. (struct crosstab) Rename v[] to vars[]. All references updated. (hash_table_entry) Replace the hash algorithm and fix a bug at the same time, which caused the hash value to depend only on a single value, not all of the variables' values. Mon Feb 16 12:49:53 2004 Ben Pfaff Clean up struct dictionary's value_cnt usage. * dictionary.c: Add a function comment to each function. (struct dictionary) Rename value_cnt to next_value_idx, which more accurately reflects its meaning. All references updated. (dict_rename_vars) Add assertion. (dict_get_value_cnt) Rename dict_get_next_value_idx(). All references updated. (dict_get_case_size) New function. * aggregate.c: (create_sysfile) Use dict_get_case_size(). * get.c: (mtf_read_nonactive_records) Ditto. * sort.c: (allocate_cases) Ditto. (write_initial_runs) Ditto. (merge) Ditto. (merge_once) Ditto. * vfm.c: (prepare_for_writing) Ditto. (setup_lag) Ditto. (lag_case) Ditto. Mon Feb 16 00:17:55 2004 Ben Pfaff Make vfm.c slightly less grotesque. * vfm.c: (filter_var) Removed. (filter_index) Removed. (FILTERED macro) Removed. (exclude_this_case) New function. (process_active_file_write_case) Use exclude_this_case() instead of FILTERED and inline tests. (procedure_write_case) Ditto. (setup_filter) Removed. (open_active_file) Don't call setup_filter(). (close_active_file) Call dict_get_filter() instead of checking filter_var. Mon Feb 16 00:01:53 2004 Ben Pfaff * var.h: (struct variable) Update comments. Sun Feb 15 23:14:59 2004 Ben Pfaff New functions dict_create_var_assert(), dict_lookup_var_assert(). Converted several dict_*_var()/assert pairs into a single dict_*_var_assert(). * dictionary.c: (dict_create_var_assert) New function. (dict_lookup_var_assert) New function. Sun Feb 15 23:06:08 2004 Ben Pfaff Got rid of "struct long_vec", envector(), devector(), etc. Added two members `init', `reinit' to struct variable as a substitute. * Makefile.am: (pspp_SOURCES) Removed cases.c, cases.h. * cases.c: Removed. * cases.h: Removed. * aggregate.c: (parse_aggregate_functions) destvar doesn't need init. * autorecode.c: (cmd_autorecode) destvars don't need init. * compute.c: (lvalue_finalize) Set reinit. * data-list.c: (fixed_parse_compatible) Don't need init usually. (dump_fmt_list) Ditto. (parse_free) Ditto. * descript.q: (run_z_pass) Don't need init for z-scores. * dictionary.c: (dict_create_var) Initialize `init', `reinit' members. (dict_clone_var) Copy `reinit' member, initialize `init' member. * glob.c: (init_glob) Remove vec_init() calls. * inpt-pgm.c: (cmd_end_input_program) Use `reinit', not `left'. * loop.c: (internal_cmd_loop) Don't need to call envector(). * numeric.c: (cmd_numeric) Ditto. (cmd_string) Ditto. (cmd_leave) Ditto. Set `init', `reinit' members. * recode.c: (cmd_recode) Don't need to call envector(). * repeat.c: (internal_cmd_do_repeat) Ditto. * var.h: (struct variable) Remove `left'. Add `init', `reinit'. (force_create_variable) Removed prototype. (force_dup_variable) Ditto. * vector.c: (cmd_vector) Don't need to call envector(). * vfm.c: (reinit_sysmis) Removed. (reinit_blanks) Removed. (init_zero) Removed. (init_blanks) Removed. (process_active_file_write_case) No need to deal with vectors. Call clear_temp_case(). (vector_initialization) Rewrite to use `init', `reinit'. (close_active_file) No need to call vec_clear(). (procedure_write_case) Call clear_temp_case(). (clear_temp_case) New function. Sun Feb 15 20:50:36 2004 Ben Pfaff * pfm-write.c: (bufwrite) Get rid of nasty cast that also invoked undefined behavior. Thu Feb 12 23:35:15 2004 Ben Pfaff Add auxiliary argument to procedure() interface. Associated small clean-ups of vfm interface. * Updated every caller of procedure() and process_active_file() to reflect modified interface. Simple, ordinary changes not listed otherwise below. * Updated every function that implements struct case_stream's `read' function to take a write_case_func and a write_case_data. Also updated every caller of write_case() to instead call them through these arguments. In some cases this meant that the extra args had to be threaded through a couple of extra levels. This wasn't difficult or interesting so the details won't be given. * data-list.c: (struct repeating_data_trns) Add members `write_case', `wc_data' as kluge. (read_one_set_of_repetitions) Rename repeating_data_trns_proc and make non-static. (repeating_data_set_write_case) New function. * data-list.h: New file to declare repeating_data_trns_proc() and repeating_data_set_write_case(). * inpt-pgm.c: (input_program_source_read) Call repeating_data_set_write_case() for all the REPEATING DATA transformations, so that they know where to send their cases. It's a big kluge. Also kluge in END CASE. (end_case_trns_proc) Never called anymore, but we still need it, so just assert(0). * sort.c: (read_sort_output) Update to match struct case_stream `read' member. * vfm.c: (struct write_case_data) New structure. (proc_func) Removed. (virt_proc_func) Removed. (begin_func) Removed. (virt_begin_func) Removed. (end_func) Removed. (write_case) Removed. (procedure) Added an auxiliary parameter to each function pointer argument's prototype. Added an auxiliary data parameter. Rewrote. (process_active_file) Ditto. (process_active_file_write_case) Pass aux data along. (close_active_file) Ditto. (procedure_write_case) Ditto. (SPLIT_FILE_procfunc) Ditto. * vfm.h: (typedef write_case_data) New. (typedef write_case_func) New. (struct case_stream) Add parameters to `read' member prototype. Thu Feb 12 19:24:53 WST 2004 John Darrington * t-test.q: Added calculations for independent samples. (But no Levene test yet!) * Makefile.am: Moved q_sources_c into own variable Wed Feb 11 23:56:51 2004 Ben Pfaff Miscellaneous cleanups. * Change unused to UNUSED in many source files to reflect modified pref.h. Change use of __WIN32__, __MSDOS, __DJGPP__, __CYGWIN32__, __unix__, and unix not to assume that they're defined to a nonzero value. Change use of __attribute__ to use NO_RETURN or PRINTF_FORMAT instead. * alloc.h: Move definitions for local_alloc(), local_free() here from ../pref.h.orig and simplify. * expr-evl.c: Instead of working differently based on PAGED_STACK, use a pool allocator unconditionally. (CHECK_STRING_SPACE) Removed. (ALLOC_STRING_SPACE) Removed. (expr_evaluate) Use e->pool instead of CHECK_STRING_SPACE and ALLOC_STRING_SPACE. * expr-opt.c: (dump_expression) Allocate string pool. * expr-prs.c: (expr_free) Free string pool. * pool.c: (pool_destroy) This pool must be removed from its parent's list of gizmos, not from its own. Use free_all_gizmos(). (pool_clear) New function. (free_all_gizmos) New function. (pool_alloc) Use space in empty block after this one if any. (pool_release) Only empty out blocks, don't actually free() them. * print.c: Get rid of PAGED_STACK special case by always dynamically allocating line buffers. (struct print_trns) Always include the `line' member. (internal_cmd_print) Always initialize the `line' member. (alloc_line) Always allocate memory for `line'. (print_trns_proc) Always initialize buf from `line' member. (print_trns_free) Always free `line' memory. * sort.c: (allocate_file_handles) Special-case MS-DOS for mkdir() call. Wed Feb 11 20:33:18 2004 Ben Pfaff * flip.c: Fixed crash from FLIP when a numeric variable is specified on NEWNAMES and a large value is used, and a couple of other minor bugs besides. (struct varname) Make name a 9-character fixed-size array instead of a 1-character variable size array. (make_new_var) Allow digits in variable names. (flip_stream_write) Limit numeric values to 8 characters and format system missing and very large and small values more appropriately. Thu Feb 5 13:19:06 WAST 2004 John Darrington * command.c: Fixed test on command return status for the correct value, which had been causing a crash under certain invalid input. Wed Feb 4 15:34:11 WST 2004 John Darrington * t-test.q: Added calculations for the one sample variant of the T-TEST Tue Feb 3 20:09:54 2004 Ben Pfaff * tab.c: (render_strip) Fix bug that sometimes caused joined text in joined cells to be rendered outside box boundaries. Tue Feb 3 18:56:45 WST 2004 John Darrington * random.c (rng_create): Fixed seeding so that it gets reseeded after SET seed=xx has been called. Mon Jan 19 14:08:09 2004 Ben Pfaff * random.c (rng_get_double): Fix always-returning-zero bug in my preferred way, and at the same time make sure rounding doesn't bite us. Thu Jan 1 23:16:41 2004 Ben Pfaff * html.c: (change_attributes) Dead code, removed. (escape_string) Eliminate code to call change_attributes() that never actually called it. (output_tab_table) Get rid of dependence on tab_hit and struct tab_joined_cell's hit member, which are abominations. * tab.c: (tab_output_text) Don't call d->class->text_set_font_by_name if it's a null pointer. (macro UNROLL_LOOP) Eliminate. (macro UNROLL_3_LOOPS) Eliminate. (tabi_render) Rewrite not to use the above macros. Thu Jan 1 23:09:07 2004 Ben Pfaff Start working on a new output driver system, one that doesn't suck so much, by adding a "device-independent" output driver. The idea is to write out only a single output stream, then use separate processes to translate them into whatever formats we want. This is similar to how "groff" works with its various output drivers (grops, grotty, grodvi, ...). * Makefile.am: (pspp_SOURCES) Add devind.c, devind.h. * list.q: (write_all_headers) Stub out devind class. (clean_up) Ditto. (determine_layout) Ditto. (list_cases) Ditto. * output.c: (outp_init) Add devind class. * devind.c: New file. * devind.h: New file. Thu Jan 1 23:08:14 2004 Ben Pfaff * frequencies.q: (hash_value_alpha) Fixed up the previous change to use the proper string length. Wed Dec 31 16:27:33 WAST 2003 John Darrington * Fixed bug where FREQ would crash on alpha values Tue Dec 30 22:42:57 2003 Ben Pfaff * Removed bletcherous alloca() workarounds for AIX from top of many files. AIX can use the alternative alloca() implementation instead. Tue Dec 30 22:35:16 2003 Ben Pfaff * ascii.c: (ascii_option) Fix implementation of headers option. Tue Dec 30 22:32:53 2003 Ben Pfaff * ascii.c: Add a "squeeze" option to the ASCII driver to squeeze multiple blank lines into one. (struct ascii_driver_ext) Add squeeze_blank_lines option. (ascii_preopen_driver) Initialize squeeze_blank_lines. (static var option_tab) Add squeeze entry. (ascii_option) Set squeeze_blank_lines. (output_lines) Implement squeezing blank lines. Wed Dec 31 07:19:46 WST 2003 John Darrington * Removed redundant code from output.h Sat Dec 27 22:17:52 2003 Ben Pfaff Dictionary classes: each variable is "ordinary", "system", or "scratch". * var.h: (enum dict_class) New enum. * vars-prs.c: (dict_class_from_id) New function. (dict_class_to_name) New function. Sat Dec 27 22:16:06 2003 Ben Pfaff * var.h: (struct freq_tab_set) Removed (not used). Sat Dec 27 22:15:21 2003 Ben Pfaff * value-labels.c: (val_labs_destroy) vls needs to be freed too. Sat Dec 27 22:10:49 2003 Ben Pfaff * stats.c: (hypercube) Rename pow4(). All references updated. Sat Dec 27 22:05:49 2003 Ben Pfaff * rename-vars.c: (cmd_rename_variables) Rewritten. (compare_name) Removed. Sat Dec 27 22:03:51 2003 Ben Pfaff var_set feature, and code taking advantage of it. * crosstabs.q: (static var var_dict) Removed. (static var variables) New variable. (static var variables_cnt) New variable. (cmd_crosstabs) Free variables instead of var_dict. (internal_cmd_crosstabs) Initialize and use variables, variables_cnt instead of var_dict. (free_var_dict) Removed. (crs_custom_tables) Use var_set instead of a copied dictionary. (crs_custom_variables) Set up variables, variables_cnt instead of var_dict. [DEBUGGING] (debug_print) Ditto. * means.q: (mns_custom_tables) Use var_set instead of a copied dictionary. * vars-prs.c: (parse_vs_variable) New function. (parse_dict_variable) Rewritten. (parse_variable) Rewritten. (parse_variables) Renamed parse_var_set_vars(), rewritten. (parse_variables) New function in terms of parse_var_set_vars(). Now requires its first argument to be non-null. All references that passed a null pointer updated to pass default_dict instead. (macro id_dict) Removed. (parse_DATA_LIST_vars) Add assertions. (parse_mixed_vars) Ditto. (struct var_set) New structure. (var_set_get_cnt) New function. (var_set_get_var) New function. (var_set_lookup_var) New function. (var_set_destroy) New function. (dict_var_set_get_cnt) New function. (dict_var_set_get_var) New function. (dict_var_set_lookup_var) New function. (dict_var_set_destroy) New function. (var_set_create_from_dict) New function. (struct array_var_set) New structure. (array_var_set_get_cnt) New function. (array_var_set_get_var) New function. (array_var_set_lookup_var) New function. (array_var_set_destroy) New function. (var_set_create_from_array) New function. * q2c.c: (dump_parser) Use parse_variables(default_dict, ...) instead of parse_variables(NULL, ...) in output code. Sat Dec 27 21:38:53 2003 Ben Pfaff Change inp_init from a 2-bit vector to an ordinary array. Initialize it all in cmd_end_input_program() instead of in create_variable(). * inpt-pgm.c: (enum value_init_type) New enum. (global var inp_init) Change to `enum value_init_type *', make static. (inp_init_size) Removed. (inp_nval) Change to `size_t', make static. (cmd_input_program) Don't initialize inp_init or inp_init_size. (cmd_end_input_program) Initialize inp_init, inp_nval. (init_case) Rewrite. (clear_case) Rewrite. * inpt-pgm.h: Removed. Sat Dec 27 21:36:38 2003 Ben Pfaff * hash.c: (hsh_hash_bytes) Use Fowler-Noll-Vo hash instead of Colin Plumb hash. It is simpler and should better resist collisions. (hsh_hash_string) Ditto. Sat Dec 27 21:34:57 2003 Ben Pfaff * get.c: (export_write_case_func) Remove debug printing code. Sat Dec 27 21:11:09 2003 Ben Pfaff * get.c: (cmd_save_internal) Rename parameter. Use &t->h instead of cast. (save_write_case_func) Use &trns->h instead of cast. (cmd_export) Use &t->h instead of cast. Sat Dec 27 20:57:42 2003 Ben Pfaff Moved vectors into the dictionary. * var.h: (struct vector) Moved here from vector.h. `index' member renamed `idx', `v' renamed `var', `nv' renamed `cnt'. All references updated. * vector.h: Removed. * vector.c: (global var vec) Removed. (global var nvec) Removed. (cmd_vector) Rewritten. (find_vector) Removed. * dictionary.c: (dict_create_vector) New function. (dict_get_vector) New function, replaces reading global vec[] array. (dict_get_vector_cnt) New function, replaces reading global nvec variable. (dict_lookup_vector) New function, replaces find_vector(). (dict_clear_vectors) New function. Sat Dec 27 20:54:01 2003 Ben Pfaff Start to move away from `struct variable' p `union' member to void * aux member. * var.h: (struct variable) Add `aux' member. Sat Dec 27 20:36:25 2003 Ben Pfaff Get rid of struct variable `foo' member. * frequencies.q: (internal_cmd_frequencies) Use p.frq.used instead of foo. (frq_custom_variables) Ditto. (frq_custom_grouped) Ditto. * get.c: (struct save_trns) Change `var' member from `int *' to `struct variable **'. (cmd_save_internal) Use aux instead of foo. (save_trns_proc) Use revised `var' member. (static var mtf_seq_no) Renamed mtf_seq_num. (static var mtf_seq_nums) New static var. (cmd_match_files) Initialize mtf_seq_nums. (mtf_free) Free mtf_seq_nums. (mtf_processing) Use mtf_seq_nums instead of foo. (mtf_merge_dictionary) No need to initialize mv->foo. (cmd_export) Use aux instead of foo. Use revised `var' member. (mns_custom_tables) Don't use foo to check for duplicates, that's what PV_NO_DUPLICATE is for. * var.h: (struct variable) Remove `foo' member. (struct frequencies_proc) New member. Sat Dec 27 19:46:13 2003 Ben Pfaff Clean up COMPUTE and IF. * compute.c: More or less rewrite the darn thing. (struct compute_trns) Rename and reorder and add and delete members. (cmd_compute) Rewrite. (compute_num) Make conditional on test expression. Now used for both COMPUTE and IF. (compute_num_vec) Ditto. (compute_str) Ditto. (compute_str_vec) Ditto. (cmd_if) Rewrite. (if_num) Removed. (if_num_vec) Removed. (if_str) Removed. (if_str_vec) Removed. (parse_target_expression) Renamed parse_rvalue_expression(), rewritten. (new_trns) Renamed compute_trns_create(), rewritten. (delete_trns) Removed. (free_trns) Renamed compute_trns_free(), rewritten. (struct lvalue) New structure. (parse_var_or_vec) Renamed lvalue_parse(), rewritten. (lvalue_get_type) New function. (lvalue_is_vector) New function. (lvalue_finalize) New function. (lvalue_destroy) New function. Sat Dec 27 19:44:14 2003 Ben Pfaff * command.def: Disallow MODIFY VARS in input mode, so that variables can't get dropped and confuse cmd_end_input_program()'s attempt to fill inp_init[]. * modify-vars.c: (static var forward_positional_ordering) New variable. (struct var_modification) Entirely changed. (rearrange_dict) Interface changed, rewritten. (cmd_modify_vars) Deal with modified struct var_modification, much rewritten. (struct var_renaming) New structure. (compare_var_renaming_by_new_name) New function. (validate_var_modification) New function. * var.h: (struct modify_vars_proc) Removed. (struct variable) Removed member p.mfv. Sat Dec 27 19:40:26 2003 Ben Pfaff Make EVALUATE a valid command whether we're debugging or not, so that `make check' can succeed regardless of whether debugging is turned on. * command.def: [GLOBAL_DEBUGGING] Drop the #if. * compute.c: [GLOBAL_DEBUGGING] (cmd_evaluate) Drop the #if. Sat Dec 27 19:34:40 2003 Ben Pfaff * apply-dict.c: (cmd_apply_dictionary) Replace a ghastly switch statement by a simple if test. * dfm.c: (dfm_get_record) Add assertion. Sat Dec 27 17:51:26 2003 Ben Pfaff For each file x.c, move #include "x.h" to the very top of the include list, to catch x.h failing to include the proper headers. Sat Dec 27 17:50:19 2003 Ben Pfaff * algorithm.c: (find) New function. (remove_equal) New function. (set_difference) New function. (adjacent_find_equal) New function. [TEST_UNIQUE] Removed test case. (copy_if) Find end test. Sat Dec 27 17:42:45 2003 Ben Pfaff * dictionary.c: (dict_get_case_weight) New convenience function. * aggregate.c: (accumulate_aggregate_info) Use dict_get_case_weight(). * frequencies.q: (calc_general) Ditto. (calc_integer) Ditto. (calc) Ditto. * t-test.q: (groups_calc) Ditto. (z_calc) Ditto. Sat Dec 27 17:29:45 2003 Ben Pfaff * glob.c: (global var default_dict) Change from `struct dictionary' to `struct dictionary *'. All references changed. (init_glob) Initialize default_dict with dict_create(). Sat Dec 27 17:06:06 2003 Ben Pfaff struct dictionary now made opaque. All related functions: * get.c: (rename_variables) Removed. (dict_delete_run) Removed. * temporary.c: (copy_variable) Removed. (new_dictionary) Removed. (save_dictionary) Removed. (restore_dictionary) Removed. (free_dictionary) Removed. * vars-atr.c: (clear_default_dict) Removed. (find_variable) Removed. (find_dict_variable) Removed. (create_variable) Removed. (delete_variable) Removed. (common_init_stuff) Removed. (init_variable) Removed. Updating of inp_init moved into cmd_end_input_program(). (replace_variable) Removed. (rename_variable) Removed. (clear_variable) Removed. (dup_variable) Removed. * vars-prs.c: (is_varname) Removed. (is_dict_varname) Removed. (fill_all_vars) Removed. * vector.c: (find_vector) Removed. * weight.c: (stop_weighting) Removed. * dictionary.c: New file. (dict_create) New, replaces new_dictionary(). (dict_clone) New, replaces save_dictionary() and restore_dictionary(). (dict_clear) New, replaces clear_default_dict(). (dict_destroy) New, replaces free_dictionary(). (dict_get_var_cnt) New function, replaces references to dict->nvar. (dict_get_var) New function, replaces references to dict->var[i]. (dict_get_vars) New function, replaces fill_all_vars(). (dict_create_var) New, replaces create_variable(). Interface drops `type' parameter, using a zero `width' to designate numeric. (dict_clone_var) New, replaces dup_variable(). (dict_rename_var) New, replaces rename_variable(). (dict_lookup_var) New, replaces find_variable(), find_dict_variable(), is_varname(). (dict_contains_var) New function. (compare_variable_dblptrs) New function. (dict_delete_var) New function, replaces clear_variable(). (dict_delete_vars) New function, replaces dict_delete_run(). (dict_reorder_vars) New function. (dict_rename_vars) New function, replaces rename_variables(). (dict_get_weight) New function, replaces reading dict->weight_var. (dict_set_weight) New function, replaces writing dict->weight_var or calling stop_weight(dict). (dict_get_filter) New function, replaces reading dict->filter_var. (dict_set_filter) New function, replaces writing dict->filter_var. (dict_get_case_limit) New function, replaces reading dict->N. (dict_set_case_limit) New function, replaces writing dict->N. (dict_get_value_cnt) New function, replaces reading dict->nval. (dict_compact_values) New function, replaces a loop that was replicated in several places. (dict_get_split_vars) New function, replaces reading dict->splits. (dict_get_split_cnt) New function, replaces reading dict->n_splits. (dict_set_split_vars) New function, replaces writing dict->splits. (dict_get_label) New function, replaces reading dict->label. (dict_set_label) New function, replaces writing dict->label. (dict_get_documents) New function, replaces reading dict->documents. (dict_set_documents) New function, replaces writing dict->documents. All references to above functions updated. * aggregate.c: (cmd_aggregate) Copy file label and documents from old dictionary to new by hand, because dict_create() can't do it itself. Use dict_set_documents(), dict_set_split_vars(). * temporary.c: (cancel_temporary) Also set temp_dict to NULL after calling dict_destroy(). * data-list.c: (dls_var_spec) Remove `type' member, replace by `width'. (fixed_parse_compatible) Some slightly nontrivial changes for dict_create_var(). (dump_fmt_list) Ditto. (parse_free) Ditto. * file-type.c: (create_col_var) Ditto. * get.c: (cmd_get) Use dict_compact_values() instead of a loop. (trim_dictionary) Use dict_delete_vars(), dict_reorder_vars(). (rename_variables) Use dict_rename_vars(). (mtf_merge_dictionary) Use dict_get_documents(), dict_set_documents(), dict_compact_values(). * pfm-read.c: (read_variables) Deal with changes to weighting. * q2c.c: (dump_parser) Use dict_lookup_var() instead of is_varname() in output code. * sfm-read.c: (read_header) Use dict_create(), dict_set_label(), other dictionary functions. * title.c: (add_document_line) Use dict_get_documents(), dict_set_documents(). * vars-atr.c: (discard_variables) Use dict_clear(default_dict), reset default_handle by hand. dict_clear() will clear vectors so there's no need for that by hand. * vfm.c: (close_active_file) Move call to finish_compaction() earlier, so that we can do the compaction as a single step using dict_compact_values(). Use dict_clear_vectors(). (finish_compaction) Use dict_delete_var(), dict_compact_values(). Some functions don't have replacements: * vars-atr.c: (force_create_variable) Removed. All references updated to dict_create_var() followed by an assertion. (force_dup_variable) Removed. All references updated to dict_clone_var() followed by an assertion. * weight.c: (update_weighting) Removed. No longer necessary, so all references removed. Sat Dec 27 16:43:01 2003 Ben Pfaff Clean up AGGREGATE. * aggregate.c: Eliminate separation of weighted and unweighted case. It made the code too obscure and I doubt it was actually faster. Instead, all code uses the "weighted" code, because that's a generalization of the "unweighted" code. (FWEIGHT) Removed. (FOPTIONS) Ditto. (parse_aggregate_functions) No need to set FWEIGHT. (accumulate_aggregate_info) Get rid of FWEIGHT cases. (dump_aggregate_info) Ditto. (initialize_aggregate_info) No need for special plain_function that gets rid of FWEIGHT option. * aggregate.c: Get rid of approximations. (accumulate_aggregate_info) Don't use approx_gt(), approx_lt(), approx_in_range(). (aggregate_single_case) Don't use approx_ne(). Sat Dec 27 16:19:36 2003 Ben Pfaff * ascii.c (ascii_line_width): Dead code, removed. * postscript.c (ps_line_width): Ditto. * q2c.c (xrealloc): Ditto. * count.c (internal_cmd_count): Ditto. * means.q (validate_dependent_endpoint): Ditto. * set.q: (cmd_gset) Ditto. * weight.c: [0] (weight_trns_proc) Ditto. Sat Dec 27 16:18:16 2003 Ben Pfaff Make the code -Wmissing-prototypes clean. * Makefile.am (version.c): Add #include "version.h". * ascii.c: (ascii_open_global) Make static. (ascii_close_page) Ditto. (ascii_font_sizes) Ditto. (ascii_postopen_driver) Ditto. (ascii_close_driver) Ditto. (ascii_option) Ditto. (ascii_open_page) Ditto. (ascii_line_horz) Ditto. (ascii_line_vert) Ditto. (ascii_line_intersection) Ditto. (ascii_box) Ditto. (ascii_polyline_begin) Ditto. (ascii_polyline_point) Ditto. (ascii_polyline_end) Ditto. (ascii_text_set_font_by_name) Ditto. (ascii_text_set_font_by_position) Ditto. (ascii_text_set_font_by_family) Ditto. (ascii_text_get_font_name) Ditto. (ascii_text_get_font_family) Ditto. (ascii_text_set_size) Ditto. (ascii_text_get_size) Ditto. (ascii_text_metrics) Ditto. (ascii_text_draw) Ditto. (ascii_close_page) Ditto. * cmdline.h: New header for parse_command_line(). Used where needed. * command.c: Move prototypes for cmd_*() functions to command.h. * command.h: Prototypes for cmd_*() functions moved here from command.c. * crosstabs.q: (gamma_int) Ditto. * file-handle.h: Add fh_init_files() prototype. * getline.c: (welcome) Ditto. * glob.h: New header for init_glob(). Used where appropriate. * hash.c: (comparison_helper) Ditto. * html.c: (html_open_global) Ditto. (html_close_global) Ditto. (html_preopen_driver) Ditto. (html_postopen_driver) Ditto. (html_close_driver) Ditto. (html_option) Ditto. (html_open_page) Ditto. (html_close_page) Ditto. (html_submit) Ditto. * inpt-pgm.c: (input_program_source_read) Ditto. * output.c: (find_defn_value) Ditto. (destroy_list) Ditto. * pfm-read.c: (read_int) Ditto. * postscript.c: (ps_open_global) Ditto. (ps_close_global) Ditto. (ps_font_sizes) Ditto. (ps_preopen_driver) Ditto. (ps_postopen_driver) Ditto. (ps_close_driver) Ditto. (ps_option) Ditto. (ps_open_page) Ditto. (ps_close_page) Ditto. (ps_line_horz) Ditto. (ps_line_vert) Ditto. (ps_line_intersection) Ditto. (ps_box) Ditto. (ps_polyline_begin) Ditto. (ps_polyline_point) Ditto. (ps_polyline_end) Ditto. (ps_text_set_font_by_name) Ditto. (ps_text_set_font_by_position) Ditto. (ps_text_set_font_family) Ditto. (ps_text_get_font_name) Ditto. (ps_text_get_font_family) Ditto. (ps_text_set_size) Ditto. (ps_text_get_size) Ditto. (ps_text_metrics) Ditto. (ps_text_draw) Ditto. * q2c.c: (finish_up) Ditto. (xmalloc) Ditto. (xstrdup) Ditto. (get_buffer) Ditto. (st_lower) Ditto. (st_upper) Ditto. (skip_ws) Ditto. (get_line) Ditto. (add_symbol) Ditto. (find_symbol) Ditto. (lex_get) Ditto. (force_id) Ditto. (force_string) Ditto. (match_id) Ditto. (match_token) Ditto. (skip_token) Ditto. (parse) Ditto. (parse_setting) Ditto. (parse_specifier) Ditto. (parse_specifiers) Ditto. (parse_subcommand) Ditto. (dump_specifier_vars) Ditto. (is_keyword) Ditto. (make_identifier) Ditto. (dump_declarations) Ditto. (dump_specifier_init) Ditto. (dump_vars_init) Ditto. (make_match) Ditto. (dump_specifier_parse) Ditto. (dump_subcommand) Ditto. (dump_parser) Ditto. (dump_header) Ditto. (dump_free) Ditto. (recognize_directive) Ditto. * recode.c: (string_to_long) Ditto. * repeat.c: (find_DO_REPEAT_substitution) Ditto. * repeat.h: New header for perform_DO_REPEAT_substitutions, used where appropriate. * sort.c: (sort_stream_read) Ditto. (sort_stream_mode) Ditto. Fri Dec 19 23:35:04 2003 Ben Pfaff * algorithm.c (binary_search): Fix comparison. Fri Dec 19 23:27:45 2003 Ben Pfaff * algorithm.c: (binary_search) Fix assertion. Fri Dec 19 21:31:48 2003 Ben Pfaff * sysfile-info.c: (compare_vectors_by_name) Rewrite. Fri Dec 19 21:30:24 2003 Ben Pfaff * sort.c: (compare_case_lists) Rewrite. Fri Dec 19 16:44:22 2003 Ben Pfaff * quicksort.c: Removed (not used). * quicksort.h: Removed (not used). * sort.c: Removed blp_quicksort() prototype. Fri Dec 19 16:42:13 2003 Ben Pfaff * postscript.c: (int_2_compare) Rewrite. (compare_line) Rewrite. Fri Dec 19 16:38:35 2003 Ben Pfaff * matrix-data.c (compare_factors) Use lexicographical_compare() algorithm. (compare_doubles) New function. * algorithm.c: (lexicographical_compare) New algorithm. Fri Dec 19 16:23:45 2003 Ben Pfaff * matrix-data.c (compare_variables_by_mxd_vartype): Rewrite. Fri Dec 19 15:54:45 2003 Ben Pfaff * expr-prs.c: (cmp_func) Removed. (parse_function) Use binary_search() algorithm. (compare_functions) New function. (init_func_tab) Use sort() algorithm. * algorithm.c: (binary_search) New algorithm. Fri Dec 19 15:50:45 2003 Ben Pfaff * descript.q: (display) Use sort() algorithm instead of qsort(). (compare_func) Removed. (descriptives_compare_variables) New function. Fri Dec 19 15:08:38 2003 Ben Pfaff Get rid of AVL trees. Hashes are more appropriate for everything PSPP does. * Makefile.am: (pspp_SOURCES) Remove avl.c, avl.h. * avl.c: Removed. * avl.h: Removed. Fri Dec 19 14:33:31 2003 Ben Pfaff Much code can be clarified by using C++ STL-like algorithms. Not all uses of these algorithms are listed below, only the ones where the change to an algorithm was the only change of interest. * Makefile.am: (pspp_SOURCES) Add algorithm.c, algorithm.h. * algorithm.c: New file. * algorithm.h: New file. * modify-vars.c: (static var forward) Removed. (static var positional) Removed. (compare_variables) Removed. (struct ordering) New. (cmd_modify_vars) Use sort() algorithm. (compare_variables_given_ordering) New function. (rearrange_dict) Use sort() algorithm. * sysfile-info.c: (cmd_display) Use sort() algorithm. (cmp_var_by_name) Removed. Fri Dec 19 14:26:17 2003 Ben Pfaff Make file handles use a hash table. * file-handle.q: (files) Change to hash table, make static. (cmd_file_handle) Use hash table functions. (fh_get_handle_by_filename) Ditto. (fh_get_handle_by_name) Ditto. (hash_file_handle) New function. (cmp_file_handle) Rewrite. (fh_init_files) Use hash table functions. Fri Dec 19 14:24:38 2003 Ben Pfaff Clean up FREQUENCIES. * Makefile.am: (pspp_SOURCES) Remove frequencies.g. * frequencies.q: Remove a lot of old #if'd out code at the end. (internal_cmd_frequencies) Use calc() instead of calc_no_weight() or calc_weight(). Initialize percentile_values. (calc) New function based on calc_weight() from frequencies.g. (precalc) Use hash functions. (static var comparison_func) Removed. (static var comparison_param) Removed. (comparison_helper) Removed. (get_freq_comparator) New function. (not_missing) New function. (add_freq) Removed. (postprocess_freq_tab) Use hash table functions, algorithms, get_freq_comparator(). Rewrite. (cleanup_freq_tab) Rephrase. (add_percentile) Clean up spacing. (hash_value_numeric) New function. (hash_value_alpha) New function. (compare_value_numeric_a) Rewrite. (compare_value_alpha_a) Rewrite. (compare_value_numeric_d) Rewrite. (compare_value_alpha_d) Rewrite. (compare_freq_numeric_a) Rewrite. (compare_freq_alpha_a) Rewrite. (compare_freq_numeric_d) Rewrite. (compare_freq_alpha_d) Rewrite. (calc_stats) Clean up mode, percentiles, max. (dump_statistics) Clean up spacing. * frequencies.g: Removed. * var.h: (struct freq_tab) Change `data' to hash table. Fri Dec 19 14:15:46 2003 Ben Pfaff * file-handle.h: Remove declaration of global variable `files', which wasn't used anywhere. * postscript.c: (add_encoding) Remove superfluous cast. (line) Ditto. * sfm-read.c: [linux] (bswap_int32) Drop ntohl() non-portable version. * temporary.c: [0] (display_tree) Removed. Fri Dec 19 14:13:04 2003 Ben Pfaff Implement a new random number generator based on the alleged RC4 algorithm. * expr-evl.c: (expr_evaluate) Use rng_get_double_normal() instead of rand_normal(). * random.c: [!HAVE_GOOD_RANDOM] (real_rand) Removed. [!HAVE_GOOD_RANDOM] (real_srand) Removed. (macro k) Removed. (static var V[]) Removed. (static var Y) Removed. (static var X2) Removed. (setup_randomize) Removed. (shuffle) Removed. (rand_uniform) Removed. (rand_normal) Removed. (struct rng) New structure. (rng_create) New function. (rng_destroy) New function. (swap_byte) New static function. (rng_seed) New function. (rng_get_bytes) New function. (rng_get_int) New function. (rng_get_unsigned) New function. (rng_get_double) New function. (rng_get_double_normal) New function. (pspp_rng) New function. * random.h: Sync up to random.c. * sample.c: (struct sample_trns) Make `frac' unsigned and a fraction of UINT_MAX, not 65536. (cmd_sample) Use rng_get_unsigned(), rng_get_double(), UINT_MAX fraction. * vfm.c: (open_active_file) No need to call setup_randomize() any longer. Fri Dec 19 12:05:56 2003 Ben Pfaff Change dictionary name indexes to use hash tables instead of AVL trees. * crosstabs.q: (free_var_dict) Use hash tables. (crs_custom_tables) Ditto. (calc_general) Ditto. (compare_table_entry) Rewrite. (enum_var_values) Reorder parameters. All references updated. Rewrite. * get.c: (rename_variable) Use hash tables. (mtf_merge_dictionary) Ditto. * glob.c: (init_glob) Use hash tables. (cmp_variable) Removed. * means.q: (mns_custom_tables) Use hash tables. * modify-vars.c: (rearrange_dict) Use hash tables. * rename-vars.c: (cmd_rename_variables) Use hash tables. * sfm-read.c: (read_header) Use hash tables. (read_variables) Ditto. * temporary.c: (new_dictionary) Use hash tables. (save_dictionary) Ditto. (restore_dictionary) Ditto. * var.h: (struct dictionary) Change AVL tree `var_by_name' into hash table `name_tab'. * vars-atr.c: [DEBUGGING] (dump_one_var_node) Removed. [DEBUGGING] (dump_var_tree) Removed. (find_variable) Use hash tables. (find_dict_variable) Ditto. (common_init_stuff) Ditto. (rename_variable) Ditto. (clear_variable) Ditto. Also, remove debug code. (dup_variable) Use hash tables. * vars-prs.c: (fill_all_vars) Use hash tables. (is_dict_varname) Ditto. (parse_dict_variable) Ditto. Fri Dec 19 11:46:23 2003 Ben Pfaff Change value labels to use hash tables instead of AVL trees, and change value labels into an ADT. * Makefile.am: (pspp_SOURCES) Add value-labels.c, value-labels.h. * value-labels.c: New file. * value-labels.h: New file. * apply-dict.c: (cmd_apply_dictionary) Use value label ADT. Get rid of a stupid use of goto. * autorecode.c: (compare_alpha_value) Rewrite. (hash_alpha_value) Ditto. (compare_numeric_value) Rewrite. (hash_numeric_value) Ditto. * frequencies.q: (dump_full) Use value label ADT. * pfm-read.c: (read_value_label) Use value label ADT. * pfm-write.c: (write_value_labels) Use value label ADT. * sfm-read.c: (read_variables) Use value label ADT. (read_value_labels) Rewrite. * sfm-write.c: (write_value_labels) Rewrite. * sysfile-info.c: (cmd_sysfile_info) Use value label ADT. (display_variables) Ditto. (describe_variable) Ditto. * t-test.q: (print_t_groups) Use value label ADT. * temporary.c: (copy_variable) Use value label ADT. (free_dictionary) Ditto. * val-labs.c: (verify_val_labs) Use value label ADT. (get_label) Ditto. (debug_print) Ditto. (val_lab_cmp) Removed. (inc_ref_count) Removed. (copy_value_labels) Removed. * var.h: (struct value_label) Removed. (struct variable) Change AVL tree `val_lab' into hash table `val_labs'. * vars-atr.c: (init_variable) Use value label ADT. (clear_variable) Ditto. (free_value_label) Removed. (free_val_lab) Removed. (get_val_lab) Removed. (compare_variables) New function. (hash_variable) New function. * vfm.c: (dump_splits) Use value label ADT. Fri Dec 19 11:18:11 2003 Ben Pfaff Add to the hash table interface. * hash.c: (hsh_hash_bytes) Add assertion. (hsh_hash_string) Ditto. (hsh_clear) Ditto. (hsh_rehash) Ditto. (hsh_probe) Ditto. (hsh_create) Ditto. Also make minimum `size'. (hsh_destroy) Rephrase. (sort_nulls_last) Removed. (not_null) New function. (hsh_data) Ditto. (comparison_helper) Ditto. (hsh_sort) Rewritten. (hsh_data_copy) New function. (hsh_sort_copy) Ditto. (hsh_insert) Ditto. (hsh_replace) Ditto. (hsh_hash_double) Ditto. (hsh_delete) Fix stupid bug. Thu Dec 18 12:27:03 WAST 2003 John Darrington * added a calculation of the mode to FREQUENCIES Wed Dec 17 12:53:01 WAST 2003 John Darrington * moved (un)defs of DEBUGGING to config.h Mon Dec 15 21:35:59 2003 Ben Pfaff * groff-font.c: (add_kern) Fix indentation. (add_kern) Use & instead of % to take power-of-2 modulus. (font_get_kern_adjust) Likewise. Fri Dec 12 23:54:37 2003 Ben Pfaff * autorecode.c: (recode) Replace stupid use of memcpy() by memberwise copy. (hash_alpha_value) Use hsh_hash_bytes(). Get rid of nasty casts. (hash_numeric_value) Ditto. (autorecode_proc_func) pool_strdup() was wrong here because the source string was not null-terminated. Use new pool_strndup() instead. * crosstabs.q: (enum_var_values) Remove superfluous and bizarre use of hsh_iterator_init(). * data-in.c: (parse_N) Initialize i->v->f. * flip.c: (cmd_flip) Use memmove(), not memcpy(), to copy overlapping arrays. * groff-font.c: Use power-of-2 hash table sizes, not prime. (groff_read_font) Don't call hsh_next_prime(). Don't call fclose(NULL). (static var hash) Remove `size_p', `max_used' members. (font_char_name_to_index) Don't call hsh_next_prime(). Use hsh_hash_string() instead of hashpjw(), & instead of %. (default_font) Don't call hsh_next_prime(). * pool.c: (pool_strndup) New function. (pool_strdup) Reimplement in terms of pool_strndup. * postscript.c: (hash_font_entry) Use hsh_hash_string(). Get rid of nasty casts. (hash_ps_encoding) Use hsh_hash_string(). (hash_ps_combo) Use hsh_hash_string(), hsh_hash_int(). (hash_filename2font) Use hsh_hash_string(). * som.c: Add #include . * tab.c: (tab_destroy) Don't set t->container after freeing `t' (by destroying its pool). Fri Dec 12 23:18:59 2003 Ben Pfaff Miscellaneous hash table code cleanup: * hash.h: (struct hsh_table) Moved into hash.c. (hsh_count) Ditto, and transformed into function. (hsh_compare_func) New typedef, used for defining otherwise-long function types here and in hash.c (hsh_hash_func) Ditto. (hsh_free_func) Ditto. * hash.c: (struct hsh_table) Renamed `n' to `used', `m' to `size', `table' to `entries'. Removed `mp'. All references updated. (hsh_clear) Don't shrink entries array; if the hash was this big once, it probably will be again. (hsh_rehash) Made static. (force_hsh_insert) Renamed hsh_force_insert. (force_hsh_find) Renamed hsh_force_find. Made hash table sizes powers of 2, because that's fine with any reasonable hash function and because taking a power-of-2 modulus is faster than any other: (hsh_prime_tab) Removed; (hsh_next_prime) Ditto. (next_power_of_2) New function. (hsh_create) Use next_power_of_2. (hsh_rehash) Use & instead of %. Cleaned up hsh_sort: (internal_comparison_fn) Removed. (sort_nulls_last) New function. (hsh_sort) Removed second parameter, switched to using the new quicksort() function from quicksort.h to avoid using nasty need for static variables with qsort(). All references updated. Changed the hash functions offered, because there are better hash functions than the ones we had, and cleaned up the names to boot: * hash.c: (hashpjw_d) Removed. (hashpjw) Ditto. (hsh_hash_bytes) New function. (hsh_hash_string) New function. (hsh_hash_int) New function. Improved the hash table iteration interface: * hash.h: (hsh_iterator_init) Removed. (struct hsh_iterator) Removed `init' member, change `next' to size_t. * hash.c: (hsh_foreach) Removed. All references updated to use hsh_first/hsh_next instead. (hsh_first) New function. Notably, unlike hsh_foreach() it does not treat a null pointer as an empty hash table. (hsh_next) New function. Made deletion possible, though slow: * hash.c: (locate_matching_entry) New function. (hsh_find) Use locate_matching_entry(). (hsh_delete) New function also using locate_matching_entry(). (hsh_force_delete) New function. Fri Dec 12 23:16:10 2003 Ben Pfaff * quicksort.c: New file implementing a sort routine with a interface better than qsort() because it passes a user-provided parameter to the sort routine. * Makefile.am: Add quicksort.c, quicksort.h. Fri Dec 12 13:31:58 2003 Ben Pfaff * All source files: Get rid of nasty special cases for Checker, which is pretty obsolete now. Thu Dec 11 21:38:24 WST 2003 John Darrington * Fixed a bug apparent when using the FREQUENCIES command with the html driver. The html driver was incorrectly trying to display empty cells. Sun Jan 2 21:40:13 2000 Ben Pfaff * Makefile.am: Reorganized. Put locale dir in version.c instead of passing it to each compile command. Only put local gmp libs in LD_ADD if not installed on system. Remove `boast' target. * All source files: struct and union typedefs eliminated. `sizeof type' replaced by `sizeof object' where practical. Moved `unused' qualifiers from start to end of declarations for gcc 2.7.2 compatibility. Change `while (1)' to `for (;;)'. Made assertions on pointers strictly compliant. Removed _ prefixes on some function parameter names. * alloc.c: New source file, containing these external linkage functions removed from common.c: xmalloc, xcalloc, xrealloc, xstrdup. * arena.c: Removed. * arena.h: Removed. * ascii.c: Migrated from arenas to pools. (struct ascii_driver_ext) ops[], box[], fonts[] changed from c_string to len_string. All references changed. (ascii_option) Signature changed to comply to new output.c interface. (count_fancy_chars) Removed. (delineate) Removed support for rich text. (ascii_text_metrics) Ditto. (text_draw) Ditto. (output_shorts) Change `box', `off', `on' from c_string to len_string. Change `remaining' from int to size_t. (ascii_close_page) Make page numbering less haphazard. * autorecode.c: Migrate from arenas to pools. * avl.c: Migrate from arenas to pools. Synch from libavl 1.4.0. * bitvector.h: New file containing these macros from misc.h: SET_BIT, CLEAR_BIT, SET_BIT_TO, TEST_BIT, BIT_INDEX. * command.c: (struct command) cmd1, cmd2, cmd3 members changed to word[3]. ncmd removed. (var empty_string) Removed. (var cmd_table) Declaration updated. (var cmdtab) Removed. (cmp_command) Removed. (split_words) Rewritten to use strtok_r(). (init_cmd_parser) Renamed cmd_init(). Rewritten. (find_command) Removed. (FILE_TYPE_okay) Rewritten. (cmd_parse) Rewritten. Semantics of the return value of command handlers has changed: they must now return one of the new CMD_* enumerals, rather than a magic value. This meant that all commands had to be modified, and they were. (figure_out_command) New function. * command.def: Add CORRELATIONS, PEARSON CORRELATIONS. Add #defines for INIT, INPU, etc. * command.h: New CMD_* enum series. (cur_proc) Make const char *, not char *. (cmd_init) Prototype. (cmd_parse) Ditto. * common.c: Removed. * common.h: Removed. * correlations.q: New file. * crosstabs.q: Migrate from arenas to pools. Migrate to new-style q2c. (custom_tables) Renamed crs_custom_tables(). (custom_variables) Renamed crs_custom_variables(). (calc_integer) Add in some `const' qualifiers. (table_value_missing) Change from a_string to len_string. (float_M_suffix) Change from a_string to len_string. * data-in.c: Rewritten. All references to parse_string_as_format() changed to data_in(). * data-in.h: New file. * data-list.c: Change DLS_* from #define's to enums. Move from rpd_msg() to tmsg(). (RPD_ERR) New #define. (do_reading) Change dfm_push_cust() to dfm_push(), pop_cust() to dfm_pop(). (read_from_data_list_fixed) Change from old parse_string_as_format() to new data_in(). (read_from_data_list_free) Ditto. (read_from_data_list_list) Ditto. (cmd_repeating_data) Modify approach to checking for end of command. (rpd_msg) Removed. (rpd_parse_record) Change from old parse_string_as_format() to new data_in(). Change from old convert_format_to_string() to new data_out(). (read_one_set_of_repetitions) Change dfm_push_cust() to dfm_push(), pop_cust() to dfm_pop(). * data-out.c: Rewritten. All references to convert_format_to_string() changed to data_out(). * descript.q: Migrate to new q2c. (cmd_descriptives) Removed. (internal_cmd_descriptives) Renamed cmd_descriptives (). (custom_variables) Renamed dsc_custom_variables(). * dfm.c: (struct dfm_fhuser_ext) `ln' removed. All references removed. (open_file_r) Initialize h->where.line_number. Migrate to new struct string. (open_file_w) Initialize h->where.line_number. (read_record) Change from ext->ln to h->where.line_number. Migrate to struct string. (dfm_put_record) Rephrased. (dfm_push_cust) Renamed dfm_push(), rewritten. (dfm_pop) New function. * error.c: All references updated. (glob var error_count) Renamed err_err_count. (glob var warning_count) Renamed err_warning_count. (glob var error_already_flagged) Renamed err_already_flagged. (glob var verbosity) Renamed err_verbosity. (glob var cust_fn) Removed. (glob var cust_ln) Removed. (static var file_loc) New. (static var nfile_loc) New. (static var mfile_loc) New. (tmsg) New function. (push_cust) Removed. (pop_cust) Removed. (msg) Rewritten. (static var terminating) Removed. (failure) Renamed err_failure(). (hcf) Renamed err_hcf(). (err_push_file_locator) New function. (err_pop_file_locator) New function. (err_location) New function. (check_error_count) Renamed err_check_count(). (vmsg) Renamed err_vmsg(). Interface changed. (verbose_msg) Removed. (err_cond_fail) New function. (error_break) Renamed err_break(). * error.h: All references updated. (enum MSG_CLASS_COUNT) Renamed ERR_CLASS_COUNT. (enum ERR_CLASS_MASK, ERR_VERBOSITY_SHIFT, ERR_VERBOSITY_MASK) New. (struct file_locator) New. (struct error) New. (macro verbose_msg) Removed. (macro cond_fail) Removed. * expr-opt.c: (evaluate_tree) sizeof(char) == 1. * expr-prs.c: Reorganized. All references updated. (exprtypename) Renamed expr_type_name(). (typename) Renamed type_name(). (free_expression) Renamed expr_free(). (parse_expression) Renamed expr_parse(). Uses new type_check() function. (init_functab) Renamed init_func_tab(). (type_check) New function. (parse_or) Rewritten to use new allocate_nonterminal() and append_nonterminal_arg() functions. (parse_and) Ditto. (parse_not) Ditto. (parse_rel) Ditto. Also simplified logic. (parse_add) Ditto. (parse_mul) Ditto. (parse_neg) Ditto. (parse_exp) Ditto. (SYSMIS_func) Ditto. (VALUE_func) Rephrased. (CONCAT_func) Fix memory leak by replacing free by free_node on lossage. (generic_str_func) Ditto. (parse_function) Ditto. Also rephrasings. Uses bsearch() to find function. (allocate_nonterminal) New function. (append_nonterminal_arg) New function. (static func_tab[]) Now at file level. (cmp_func) Moved. (init_func_tab) Moved. Now just uses qsort() to sort func_tab[]. * expr.h: (enum series OP_*) Moved to exprP.h. (OP_* defines) Ditto. (struct op_desc) Ditto. (global ops[]) Ditto. (struct num_con_node) Ditto. (struct str_con_node) Ditto. (struct var_node) Ditto. (struct lag_node) Ditto. (struct casenum_node) Ditto. (struct nonterm_node) Ditto. (union any_node) Members renamed. (struct sys_node) Removed. (struct val_node) Removed. (operator typedef) Removed. (typedef exprtype) Removed. (enum series EX_*) Moved to exprP.h. (struct expression) Ditto. Also renamed a lot of the members. (PXP_* defines) Changed to enums. (free_node prototype) Moved to exprP.h. * file-handle.h: (struct file_handle) New member `where'. * file-handle.q: Migrated to new q2c format. (prepend_current_directory) Removed (dead code). (cmd_file_handle) Incorporated all of internal_cmd_file_handle(). (fh_get_handle_by_filename) Removed dead code. Set new `where' member. * file-type.c: (file_type_source_read) References to parse_string_as_format() changed to data_in(). dfm_push_cust()/pop_cust() changed to dfm_push()/dfm_pop(). * filename.c: All references updated. (init_filename) Renamed fn_init(). (expand_line) Removed. (macro EXPAND_LINE) Removed. (interp_vars) Renamed fn_interp_vars(). Now uses st_*() instead of custom functions. (gnu_getcwd) Renamed fn_get_cwd(), rewritten. (tilde_expand) Renamed fn_tilde_expand(), uses ds_*(). (normalize_filename) Renamed fn_normalize(). (search_path) Renamed fn_search_path(), rewritten. (prepend_dir) Renamed fn_prepend_dir(). (blp_getenv) Renamed fn_getenv(). (blp_dirname) Renamed fn_dirname(). (fn_basename) New function, not used. (absolute_filename_p) Renamed fn_absolute_p(). (is_special_filename) Renamed fn_special_p(). (file_exists) Renamed fn_exists_p(). (readlink_malloc) Renamed fn_readlink(). (getenv_default) Renamed fn_getenv_default(). (open_file) Renamed fn_open(). (close_file) Renamed fn_close(). (open_file_ext) Renamed fn_open_ext(). (close_file_ext) Renamed fn_close_ext(). * font.h: Migrate from arenas to pools. * format.c: (parse_format_specifier_name) Deal with ds_* strings. * frequencies.g: Migrate from arenas to pools. * frequencies.q: Migrate to new q2c version. Migrate from arenas to pools. * getline.c: All references updated. (global getl_buf) Changed from char * to struct string. (static getl_include_path) Ditto. (global getl_buf_len) Removed. (global getl_buf_size) Removed. (getl_include_path) Deal with new getl_buf, getl_include_path. (getl_uninitialize) New function. (getl_get_current_directory) Rewritten. (getl_clear_include_path) Rewritten. (getl_add_include_dir) Rewritten. (getl_add_file) Assertion fixed. (getl_add_virtual_file) Change initial value of `remaining_loops' from 2 to 1. (welcome) Rewritten. (handle_line_buffer) Make static. Change logic to make getl_add_virtual_file() change sensible. Use ds_*() strings. (getl_read_line) Use ds_*() strings. Implement SET ECHO. (getl_close_file) Moved. (getl_location) New function. * getline.h: All references updated. (macro curln) Removed. (macro curfn) Removed. (macro am_interactive) Renamed getl_am_interactive. (macro am_reading_script) Renamed getl_reading_script. * glob.c: (global fmt_parse_ignore_error) Removed. (init_glob) Use locale_dir not LOCALEDIR. Use feholdexcept() on systems that support it (C99). Turn off SET ECHO by default. No necessary julcal initialization anymore. * groff-font.c: Migrate from arenas to pools. (groff_read_font) Use err_push_file_locator(). (groff_read_DESC) Ditto. (font_msg) Use tmsg(). * hash.c: (hsh_sort) Fix debug code. [GLOBAL_DEBUGGING] Include stdio.h. * hash.h: (macro force_hsh_insert) Rephrase. * heap.c: Rewritten. * heap.h: Rewritten. * html.c: (html_option) Change from outp_value to struct string. (postopen) Change from curfn to getl_location(). (escape_string) Remove rich-text code. Signature changed. (output_tab_table) Switch from a_string to struct len_string. Remove rich text support. * lexer.c: All references updated. Largely rewritten. Major changes listed below. Removed tagged quote support. Adapted to struct string tokstr. (global tokstr) Changed to struct string. (global tokstr_size) Removed. (global tokstr_len) Removed. (global tokid) New. (global tokint) Removed. (global toklongstr) Removed. (C* defines) Removed. (static tbl[]) Removed. (static id[]) Removed. (static une[]) Removed. (discard_line) Renamed lex_discard_line(). (get_entire_line) Renamed lex_entire_line(). (get_rest_of_line) Renamed lex_rest_of_line(). (get_dotted_rest_of_line) Merged into lex_rest_of_line(). (make_hexit) Removed. (syntax_error) Renamed lex_error(). Return value removed. (get_token_representation) Renamed lex_token_representation(). (putback) Renamed lex_put_back(). (putfwd) Renamed lex_put_forward(). (convert_negative_to_dash) Renamed lex_negative_to_dash(). (set_prog) Renamed lex_set_prog(). (init_lex) Renamed lex_init(). (reset_eof) Renamed lex_reset_eof(). (lookahead) Renamed lex_look_ahead(). (check_id) Rewritten. (yylex) Renamed lex_get(), rewritten. (lex_end_of_command) New function. Many commands were rephrased using this. (lex_integer_p) New function. Replaces compare of tokint against NOT_LONG. (lex_integer) New function. Replaces tokint. (match_tok) Renamed lex_match(). (match_id) Renamed lex_match_id(). (match_int) Renamed lex_match_int(). (force_match_id) Renamed lex_force_match_id(), added return value. (force_match) Renamed lex_force_match(), added return value. (force_string) Renamed lex_force_string(), added return value. (force_int) Renamed lex_force_int(), added return value. (lex_id_match_len) New function. (id_match) Renamed lex_id_match(), rewritten. (get_line) Renamed lex_get_line(). (preprocess_line) Renamed lex_preprocess_line(). (tokname) Renamed lex_token_name(). (bin_value_func) Removed. (oct_value_func) Removed. (hex_value_func) Removed. (unexpected_eof) New function. (convert_numeric_string_to_char_string) New function. (parse_string) Rewritten, signature changed. (add_tokstr_char) Removed. (add_tokstr_unsigned) Removed. (add_tokstr_string) Removed. (parse_tagged_quote) Removed. (skip_comment) Renamed lex_skip_comment(). * lexer.h: All references updated. (macro is_id1) Renamed CHAR_IS_ID1. (macro is_idn) Renamed CHAR_IS_IDN. (token names ID, NUM, STRING, STOP, ... WITH, EXP) Renamed with prefix T_: T_ID, T_NUM, T_STRING, T_STOP, ... T_WITH, T_EXP. (macro get_token) Removed. (macro id_match) Removed. (macro force_match_id) Removed. (macro force_match) Removed. (macro force_string) Removed. (macro force_int) Removed. (macro force_num) Removed. (macro force_id) Removed. * lexerP.h: Removed. * list.q: Migrated to new q2c format. (write_line) Deal with struct len_string. (write_varname) Ditto. (write_fallback_headers) Ditto. * magic.c: New file, incorporating the following global variables previously in other files: endian, second_lowest_value. And both of those are conditional on #define's. * magic.h: New file, incorporating the following global variable declarations: endian, second_lowest_value, and the following macro declarations: NOT_DOUBLE, NOT_LONG, NOT_INT. * main.c: Added declarations of pgmname, finished, curdate, start_interactive. (main) Call new parse_script() function. (parse_script) New function. (execute_command) New function. (dump_token) Removed. (handle_error) New function. * matrix.c: New file. * matrix.h: New file. * matrix-data.c: Migrated from arenas to pools. (mget_token) Change from parse_string_as_format() to data_in(). * means.q: Migrate to new q2c. (custom_tables) Renamed mns_custom_tables(). (custom_crossbreak) Renamed mns_custom_crossbreak(). (custom_variables) Renamed mns_custom_variables(). * mis-val.c: (static var width) Changed from `int' to `size_t'. (parse_varnames) Prototype. (parse_numeric) Rephrasings. (parse_alpha) Adapt to new struct string tokstr. * misc.c: (intlog10) Rewritten. (spacing) Removed. (ansi_rand) Renamed real_rand(), moved into random.c. (ansi_srand) Renamed real_srand(), moved into random.c. (setup_randomize) Moved to random.c. (rand_uniform) Ditto. (rand_normal) Ditto. (rand_simple) Ditto. (get_config_line) Removed. (reverse) Removed (dead code). * misc.h: (macro SET_BIT) Moved to bitvector.h. (macro CLEAR_BIT) Ditto. (macro TEST_BIT) Ditto. (macro SET_BIT_TO) Ditto. (macro BIT_INDEX) Ditto. * output.c: (outp_read_devices) Move to err_push_file_locator() from push_cust(). Use struct string. (expand_op_tokstr) Removed. (static var op_tokstr) Changed to struct string. (static var op_tokstr_size) Removed. (tokener) Rephrasings. Use struct string. (parse_options) Use struct string. (destroy_driver) Fix assertion. (outp_get_paper_size) Move to err_push_file_locator(). [0] Removed dead code. (outp_string_width) Move to len_string. * output.h: Comment fixes. (TAG_* enum series) Removed. (struct outp_value) Removed. (enum OUTP_T_FANCY) Removed. (struct outp_text) `s' changed from a_string to len_string. (struct outp_class) `option' change arg 3 from outp_value to struct string. * pfm-read.c: (corrupt_msg) Rewritten. * pfm-write.c: (bufwrite) Fix assertion. * pool.c: New file, reference version. * pool.h: New file, reference version. * postscript.c: (ps_font_sizes) Fix assertion. (ps_option) Change arg 3 from outp_value to struct string. Adapt to struct string. (macro output_line) Removed. (macro add_string) Removed. (output_encodings) Adapted to struct string. Moved to err_push_file_locator(). (find_encoding_file) Fix assertion. (read_ps_encodings) Move to err_push_file_locator(). (postopen) Use getl_location() instead of curfn. (out_text_plain) Move to len_string. (text) Ditto. Remove rich text support. * print.c: (cmd_print) Remove now-unneeded resource cleanup code. (cmd_print_eject) Ditto. (cmd_write) Ditto. (internal_cmd_print) Now cleans up after itself. Uses fh_parse_file_handle() now. (cmd_print_space) Use PXP_NUMERIC to type-check. * q2c.c: Overhauled. Removed _("") i18n support. All references updated. All output functions updated to handle structures rather than local or static variables. Adapt to new PSPP lex_*() functions. (macro _) Removed. (macro N_) Removed. (macro MAX_N_SBC) Removed. (global bare) Removed. (enum STRING) Renamed T_STRING. (enum ID) Renamed T_ID. (get_buffer) Buffer size increased. (strlower) Renamed st_lower(), rephrased. (strupper) Renamed st_upper(), rephrased. (skip_ws) New function. (get_line) Don't special-case any types of lines (like those beginning with ! or $, for instance). (get_token) Renamed lex_get(). Rephrased. (static var `prefix') New. (parse) New function. (parse_setting) Minor rephrasing. (dump_specifier_vars) Ditto. (make_identifier) Put null terminator on identifier, duh. (dump_vars) Renamed dump_declarations(). Never indent. Never static. Output changed entirely. (dump_specifier_init) Rephrase. (dump_vars_init) No index variable needed. Other modifications. (dump_parser) Don't parse command name. Do dump functions instead of just code fragments. (dump_free) Dump function instead of code fragment. (recognize_directive) New function. (main) Use recognize_directive(). Don't rely on magic $ line beginning: instead, parse comments. Update list of headers. * random.c: New file, containing the following functions: real_rand(), real_srand(), setup_randomize, shuffle, rand_uniform, rand_normal, rand_simple. * random.h: New file. * recode.c: (cmd_recode) Merge internal_cmd_recode() into this function. `max_src_width', `max_dst_width' changed to size_t. (internal_cmd_recode) Removed. (parse_dest_spec) Merge similar cases. (parse_src_spec) Add assertion. * repeat.c: (recognize_keyword) New function. (internal_cmd_do_repeat) Parse and handle PRINT keyword on END REPEAT. Improve recognition of END REPEAT (use recognize_keyword()). Move from curfn to getl_location(). Use struct string. (perform_DO_REPEAT_substitutions) Adapt to struct string. * set.q: Adapt to new q2c. (cmd_set) Range-check some values better. (custom_blanks) Renamed stc_custom_blanks(). (custom_length) Renamed stc_custom_length(). (custom_results) Renamed stc_custom_results(). (custom_seed) Renamed stc_custom_seed(). (custom_width) Renamed stc_custom_width(). (custom_format) Renamed stc_custom_format(). (custom_journal) Renamed stc_custom_journal(). (custom_color) Renamed stc_custom_color(). (custom_listing) Renamed stc_custom_listing(). (custom_disk) Renamed stc_custom_disk(). (custom_log) Renamed stc_custom_log(). (custom_rcolor) Renamed stc_custom_rcolor(). (custom_viewlength) Renamed stc_custom_viewlength(). (custom_workdev) Renamed stc_custom_workdev(). * settings.h: Not necessary to include format.h any longer. * sfm-read.h: (macro bswap_int32) Moved here from sfmP.h. (corrupt_msg) Rewritten. * sort.c: Adapt to rewritten heap ADT. * str.c: (aa_strcpy) Removed. (ab_strcpy) Removed. (ac_strcpy) Removed. (ba_strcpy) Removed. (bb_strcpy) Removed. (ca_strcpy) Removed. (aa_strdup) Removed. (aa_strdupcpy) Removed. (ba_strdup) Removed. (sa_strdup) Removed. (memrev) Renamed mm_reverse(). (memrmem) Renamed mm_find_reverse(). (cmp_str) Renamed st_compare_pad(). (strmaxcpy) Removed. (strbarepadcpy) Renamed st_bare_pad_copy(), signature changed. (strbarepadlencpy) Renamed st_bare_pad_len_copy(), signature changed. (strpadcpy) Renamed st_pad_copy(), signature changed. (blpstrset) Removed. (ds_create) New function. (ds_init) New function. (ds_replace) New function. (ds_destroy) New function. (ds_clear) New function. (ds_extend) New function. (ds_shrink) New function. (ds_truncate) New function. (ds_length) New function. (ds_size) New function. (ds_value) New function. (ds_end) New function. (ds_concat) New function. (ds_concat_buffer) New function. (ds_printf) New function. (ds_putchar) New function. (ds_getline) New function. (ds_get_config_line) New function derived from the old misc.c:get_config_line(). (ls_create) New function. (ls_create_buffer) New function. (ls_init) New function. (ls_shallow_copy) New function. (ls_destroy) New function. (ls_null) New function. (ls_null_p) New function. (ls_empty_p) New function. (ls_length) New function. (ls_value) New function. (ls_end) New function. * str.h: Reformatted. (struct a_string) Removed. (struct b_string) Removed. (struct c_string) Removed. (struct len_string) New. (struct string) New. (macro as_streq) Removed. (macro bs_streq) Removed. (macro cs_streq) Removed. (macro sa_streq) Removed. (macro sb_streq) Removed. [__GNUC__] (inline function ds_putchar) New function. [__GNUC__] (inline function ds_length) New function. [__GNUC__] (inline function ds_value) New function. [__GNUC__] (inline function ds_end) New function. * sysfile-info.c: (cmd_sysfile_info) Rephrased. (display_vectors) Fix missing i18n. * t-test.q: Migrate to new q2c. * tab.c: Migrate from arenas to pools. (tab_create) Use struct len_string. (tab_realloc) Ditto. (text_format) Ditto. (tab_joint_text) Ditto. (tab_natural_width) Remove rich text support. (tab_natural_height) Ditto. (tab_output_text) Handle TAT_FIX. (tab_raw) Change arg from a_string to len_string. (tabi_driver) Fix assertion. Use struct len_string. (render_strip) Use struct len_string. Remove rich text support. Add `const' qualifiers. * tab.h: (enum TAB_RICH) Remove. (enums TAB_COL_NONE, TAB_COL_DONE) New. Where appropriate, SOM_COL_* updated to read TAB_COL_*. (struct tab_table) Change arena to pool. Change a_string to len_string. * temporary.c: (restore_dictionary) Rewrite Checker code. * var.h: (macros MAX_SHORT_STRING, MIN_LONG_STRING, SYSMIS, LOWEST, HIGHEST) Moved here from common.h. (typedef any_trns) Removed. All references changed to `struct trns_header'. * vars-atr.c: (force_create_variable) Fix assertion. (force_dup_variable) Fix assertion. Thu Jun 3 18:40:42 1999 Ben Pfaff Using alphanumeric variables in functions under AGGREGATE segfaulted. Fixed. Thanks to Dr. Dirk Melcher for reporting this bug. * aggregate.c: (parse_aggregate_functions) When setting the FSTRING bit, also allocate memory for the `string' member of agr_next. (free_aggregate_functions) Free iter->string. Don't use the non-function bits when indexing the array of functions. [DEBUGGING] (debug_print) Don't use the non-function bits when indexing the array of functions. Sun May 30 00:00:54 1999 Ben Pfaff Under certain circumstances, the final case would be omitted from the results of an AGGREGATE operation. Fixed. Thanks to Dr. Dirk Melcher for reporting this bug. * aggregate.c (agr_00x_end_func): Increment number of cases in sink before writing case. For streams that keep track of how many cases there are based on this value, this means that the last case will be read in on the next stream read. Sat May 29 22:03:31 1999 Ben Pfaff Undefined behavior was invoked by referencing a freed pointer. * vfm.c (memory_stream_write): Free pointer *after* checking for non-null status. Sat May 29 22:02:22 1999 Ben Pfaff A wrong record size was displayed when paging the active file to disk. * vfm.c: (memory_stream_write) Fix off-by-one error. Sat May 29 21:50:26 1999 Ben Pfaff Not having enough temporary space for sorting caused a core dump. Fixed. * sort.c: (allocate_cases) Initialize i. Sat May 29 21:40:54 1999 Ben Pfaff Syntax errors in function descriptions on AGGREGATE caused core dumps. Fixed. * aggregate.c (cmd_aggregate): Don't free agr_dict after calling free_aggregate_functions(), since that function already frees agr_dict. Sat May 29 21:06:10 1999 Ben Pfaff A null pointer was dereferenced, causing a core dump, when PERCENTILES was specified on FREQUENCIES. This fixes the problem, but PSPP still doesn't calculate percentiles. Thanks to Regnor Jernsletten for reporting this problem. * arena.c: (arena_malloc) If the arena hasn't been initialized already, initialize it. Sat May 29 20:47:29 1999 Ben Pfaff * Makefile.cygwin: New file supplied by Hankin for compilation with Cygnus Windows B20. Not used by other systems. Sat May 29 20:36:04 1999 Ben Pfaff SORT always sorted in ascending order. Fixed. Thanks to Dr. Dirk Melcher for reporting this bug. * sort.c: (compare_case_lists) Reverse sense of comparison if sorting in descending order. (compare_record) Ditto. Tue Mar 9 13:18:54 1999 Ben Pfaff SPLIT FILE with a string variable caused a core dump. Fixed. * vfm.c: If the variable is a string then make a temporary value struct pointing to it. The underlying problem is a lot bigger than this (see TODO) but this is a stopgap for the simple case at least. Tue Mar 9 13:15:53 1999 Ben Pfaff Nested INCLUDEs didn't work. Fixed. * getline.c: (getl_include) Set first_line to NULL in allocated structure. Tue Mar 9 13:13:46 1999 Ben Pfaff The MATCH FILES procedure set the values of variables not present to 0. It should have been SYSMIS. This is now fixed. * get.c: (mtf_delete_file_in_place) Replace 0.0 by SYSMIS. Tue Mar 9 12:52:23 1999 Ben Pfaff The REMARK command was too aggressive about skipping lines. It didn't like being the last command in a file. * command.c: (cmd_remark) Call get_entire_line() instead of get_line(). Tue Mar 9 12:48:05 1999 Ben Pfaff Comment parsing wasn't consistent with the rest of the code in its idea of where one command ends and another starts. This meant that sometimes commands would be mysteriously ignored. Thanks to Dr. Dirk Melcher for reporting this bug. * command.c: (parse_cmd) Hand off comment parsing to new function skip_comment() in lexer.c. * lexer.c: (skip_comment) New function. Wed Jan 20 20:22:07 1999 Ben Pfaff The TABLE subcommand on MATCH FILES worked only erratically at best. This fixes it. Thanks to Dr. Dirk Melcher for reporting this bug. * get.c: (mtf_compare_BY_values) When comparing string values, a difference of 1 is still a difference :-) (mtf_processing) Inverted TABLE reading logic fixed. Also don't advance TABLE files automatically when matched. Comment fixes. Tue Jan 19 22:32:31 1999 Ben Pfaff VARIABLE LABELS rejected a slash before the first variable specification, contradicting the documentation. Thanks to Walter M. Gray for reporting this bug. * var-labs.c: (cmd_variable_labels) Ignore a leading slash in command specification. Tue Jan 19 22:29:54 1999 Ben Pfaff Because of an incorrect optimization in memory allocation, CROSSTABS sometimes segfaulted when asked to output multiple tables. Thanks to Walter M. Gray for reporting this bug. * crosstabs.q: (postcalc) New variables maxcols, maxcells, which are passed to output_pivot_table() for its use. (output_pivot_table) Instead of assuming the number of columns is constant, keep track with maxcols. In general mode, use maxcells to determine whether more matrix cells need to be allocated. Tue Jan 19 22:27:46 1999 Ben Pfaff CROSSTABS didn't display value labels for column and row variables. Thanks to Walter M. Gray for reporting this bug. * crosstabs.q: (table_value_missing) If the specified value has a value label for this variable, then show it instead of the raw value. (display_dimensions) Delegate display of value_labels to table_value_missing. Mon Jan 18 20:04:06 1999 Ben Pfaff WRITE didn't write line ends. Fixed. Thanks to Dr. Dirk Melcher for reporting this bug. * print.c: (print_trns_proc) Write (CR/)LF if PRINT is used _or_ if the file isn't declared as binary. Mon Jan 18 19:56:45 1999 Ben Pfaff MATCH FILES corrupted memory and dumped core on some syntax errors. Fixed. * get.c: (cmd_match_files) Set file->handle to NULL before jumping to lossage. (mtf_free_file) Don't free a null dictionary. Mon Jan 18 19:27:57 1999 Ben Pfaff MATCH FILES should set numeric values not available to the system-missing value, not to 0. Thanks to Dr. Dirk Melcher for reporting this bug. * get.c: (mtf_processing) Set unused records to system-missing, not 0. Mon Jan 18 15:06:46 1999 Ben Pfaff KEEP didn't work properly on the SAVE procedure. Fixed. Thanks to Ralf Geschke for reporting this bug. * temporary.c: (save_dictionary) Initialize var_by_name AVL tree in newly created dictionary, and add each copied variable to the tree. Mon Jan 18 15:04:48 1999 Ben Pfaff Memory leak fix. * get.c: (trim_dictionary) Free variable list for KEEP after finishing with it. Mon Jan 18 12:57:36 1999 Ben Pfaff Some systems didn't like the way open_file was coded. Thanks to Hankin for pointing this out. * filename.c: (open_file) Don't try to store stdin, stdout, stderr as part of an array, because that doesn't always work. Mon Jan 18 12:53:27 1999 Ben Pfaff The SAVE procedure didn't save long string variables properly. Fixed by this patch. Thanks to Hankin for this patch. * sfm-write.c: (write_variable) Fix off-by-one error in writing out variable pad records. Tue Jan 5 14:29:27 1999 Ben Pfaff Previously, if PRINT SPACE were given a negative argument, it would report an error, then spin in an (almost) infinite loop. This fixes that behavior. * print.c: (print_space_trns_proc) After reporting a negative argument, set number of lines to print to 1. Tue Jan 5 13:59:55 1999 Ben Pfaff SPSS 8.0 outputs some new record types in its system files, and it allows longer value labels. Accept these system files. * sfm-read.c: (sfm_read_dictionary) Ignore record type 7 subtype 11 emitted by SPSS 8.0. Tue Jan 5 13:55:50 1999 Ben Pfaff The LIST procedure was too conservative in allocating space for buffers, which caused a bug that only showed up with very long output variables. Thanks to Hankin for this bug report. * list.q: (determine_layout) Allocate 1022 bytes instead of 256. Tue Jan 5 13:34:34 1999 Ben Pfaff Typo meant string format specifiers weren't checked properly. I think that Hankin sent me this report, but I'm willing to be corrected on this point. * format.c: (check_string_specifier) Fix obvious typo. Tue Jan 5 12:50:42 1999 Ben Pfaff Using $CASENUM in an expression didn't work. Here's a fix. Thanks to Dirk Melcher for reporting this bug. * expr-evl.c: (evaluate_expression) Add OP_CASENUM case. * expr-opt.c: (dump_node) OP_CASENUM is acceptable. Tue Jan 5 12:47:48 1999 Ben Pfaff The changes in 0.2.1 to fix DATA LIST FREE parsing broke some other behavior, *sigh*. This patch hopefully fixes that. This time I've actually tested it. Thanks to Hankin for reporting this bug. * data-list.c: (read_from_data_list_free, read_from_data_list_list) Call parse_string_as_format() directly without mucking around with the field width. Tue Jan 5 12:31:19 1999 Ben Pfaff Occasionally, you may encounter a script that wants to be interpreted in interactive mode. Make -i emulate this behavior to allow such scripts to be executed with PSPP. Thanks to Hankin for reporting this behavior. * cmdline.c: (pre_syntax_message[]) Update -i description. * lexer.c: (preprocess_line) When getl_interactive is 2 (i.e., when -i is given on the command line) don't treat unindented lines as starting a new command. Tue Jan 5 12:30:10 1999 Ben Pfaff In conjunction with egcs 1.1.1, Checker emits some bogus warnings, mostly caused by local initialized aggregates. After egcs is fixed upstream these can be removed, but for now they're not a big deal. * ascii.c: (ascii_postopen_driver) Checker chokes on local initialized arrays. Avoid this. * sfm-write.c: (sfm_write_dictionary) Don't use a local initialized struct. Tue Jan 5 12:07:24 1999 Ben Pfaff egcs 1.1.1 has some new warnings relative to gcc 2.8.1, which the following changes avoid. Currently I compile sources with egcs 1.1.1 and gcc 2.7.2.3 before sending them out. * apply-dict.c: (apply_dict) Use new avl_traverser_init() macro. * ascii.c: (option_tab[]) Initialize all struct members. * avl.h: (avl_traverser_init) New macro. * command.c: (DEFCMD, UNIMPL macros, cmd_table[]) Initialize all struct members. * crosstabs.q: (enum_var_values) Use new hsh_iterator_init() macro. * hash.c: Comment fix. * hash.h: (hsh_iterator_init) New macro. * html.c: (option_tab[]) Initialize all struct members. * pfm-write.c: (write_value_labels) Use new avl_traverser_init() macro. * postscript.c: (option_tab[]) Initialize all struct members. (output_encodings, preclose, dump_lines) Use new hsh_iterator_init() macro. * sfm-write.c: (write_value_labels) Use new avl_traverser_init() macro. * sysfile-info.c: (describe_variable) Use new avl_traverser_init() macro. Thu Nov 19 12:32:45 1998 Ben Pfaff * data-in.c: Examined each of the parsing functions to make sure that they wouldn't dump core if they were passed a string of the wrong length, since now the DATA LIST FREE/LIST routines don't check for field width before passing it to the data parser. (parse_RBHEX, parse_AHEX) Reject odd length input. (parse_string_as_format) Reject input that's too short or too long. * data-list.c: Before, the DATA LIST FREE/LIST routines would pad a field to its entire declared output width then pass it to the data-in parsing routines. This contradicted the documented behavior. This is fixed in these changes. Thanks to Mark H. Wood . In addition, this fixes a few more details of free-format parsing that differed from SPSS. (cut_field) Commas and spaces are treated identically. Returns the proper column instead of a fixed 1 value. (parse_field) Removed. (read_from_data_list_free, read_from_data_list_list) Call parse_string_as_format directly instead of parse_field. * heap.c: (heap_delete) Stylistic fixes. Sun Aug 9 11:12:13 1998 Ben Pfaff * loop.c: (loop_2_trns_proc) Formatting fix. * sel-if.c: (cmd_filter) Set FILTER_before_TEMPORARY. * var.h: (glob var FILTER_before_TEMPORARY) New global var. * vfm.c: (macro FILTERED) New. (static var filter_var) New. (process_active_file_write_case) Use FILTERED. (setup_filter) Set filter_var. (close_active_file) Delete the filter if not FILTER_before_TEMPORARY. (procedure_write_case) Use FILTERED. Sat Aug 8 00:20:14 1998 Ben Pfaff * crosstabs.q: Changed /PIVOT={ON,OFF} to /FORMAT={PIVOT,NOPIVOT}. * data-in.c: (parse_day_count) Message fix. (parse_month) Style fix. * data-list.c: (struct data_list_pgm) New member eof. (cmd_data_list) Init eof to 0. (do_reading) Implement the /END subcommand and read-past-eof checking. * do-if.c: Include stdio.h when debugging. (cmd_else_if) Make sure the command is .-terminated. * glob.c: (init_glob) Capitalize the command prompt. * inpt-pgm.c: (end_case_trns_proc) Debugging message. (end_file_trns_proc) Debugging message. * loop.c: (internal_cmd_loop) Make it work when there's no loop index! (loop_2_trns_proc) Enable MXLOOPS (why was this disabled?) * main.c: (dump_token) Make kwtab[] const. * set.q: Spelling, comment fixes. * sysfile-info.c: (cmd_display) DISPLAY VECTORS not DISPLAY VECTOR. * vars-prs.c: (fill_all_vars) Style fix. * vfm.c: (index_to_varname) Return const. Tue Aug 4 23:49:23 1998 Ben Pfaff * Changes in many source files for partial -ansi -pedantic and no-debugging compliance: Remove trailing common in enum declarations; add `unused' attributes; insert some appropriate casts. * cmdline.c: (parse_command_line) Add new --testing-mode flag. * command.c: (shell) Make static. (run_command) Make static. * data-list.c: (dump_fixed_table) Remove use of local_strdup(). * dfm.c: (cmd_begin_data) I18n fix. * error.c: (verbose_msg) Define if __STRICT_ANSI__. * error.h: (macro verbose_msg) Define if __STRICT_ANSI__. * expr-opt.c: (evaluate_tree) Don't initialize local arrays if __STRICT_ANSI__. * file-handle.q: Don't prepend the source file directory name to the data file name. (Ongoing issue.) (prepend_current_directory) Comment out. (internal_cmd_file_handle) Don't call prepend_current_directory(). (fh_get_handle_by_filename) Ditto. * filename.c: Append zero byte to readlink() return value. * getline.c: (getl_read_line) I18n fix. * lexer.h: Don't use gcc features if __STRICT_ANSI__. * misc.h: Don't use gcc features if __STRICT_ANSI__. * pfm-write.c: (bufwrite) Don't try to increment a void * pointer directly. * postscript.c: (output_encodings) Don't use local_strdup(). (postopen) Ditto. * print.c: Don't use gcc features if __STRICT_ANSI__. * q2c.c: (dump_vars) Don't put a , at the end of the last enum. * recode.c: (parse_src_spec) Fully brace nested if's. * set.q: (global var set_testing_mode) New var. Wed Jul 29 22:01:44 1998 Ben Pfaff * ascii.c: Add some more `unused' attributes that only come into play when NDEBUG is defined. (ascii_close_page) Set s_len when reallocating s. * crosstabs.q: (delete_missing) New function. (output_pivot_table) Call delete_missing() if /MISSING=REPORT. (make_summary_table) Create summary table reallocable. * postscript.c: Add more `unused' attributes as above. * tab.c: (tab_create) [GLOBAL_DEBUGGING] Set reallocable member. (tab_realloc) [GLOBAL_DEBUGGING] Assert that table is reallocable. * tab.h: (struct tab_table) [GLOBAL_DEBUGGING] New `reallocable' member. * var.h: (macro force_dup_variable) [!GLOBAL_DEBUGGING] Remove gratuitous space between parameter definition. * vars-atr.c: Changed some assert(0)'s to abort()'s to prevent complaints about running off the end of functions with NDEBUG enabled. Sun Jul 5 00:17:25 1998 Ben Pfaff * Several source files: Removed some PORTME notes when reflection revealed that ANSI forbids that sort of breakage. Also, added lots of `unused' qualifiers here and there. * aggregate.c: (accumulate_aggregate_info) Remove local var weighting that turned out not to be used. * avl.c: Update to version 1.1.0. Add unused specifier. (avl_destroy) Initialize ab to 0. Comment fixes. Cast return value to void *. (avl_probe) Replace some instances of 1 with +1 where appropriate. (avl_find) Cast return value to void *. (avl_delete) q doesn't need to be initialized at the beginning of the function. Replace some instances of 1 with +1. (force_avl_delete) Renamed avl_force_delete, all references changed. (compare_ints) `param' marked unused. (print_int) `param' marked unused. (recurse_tree) Replace some instances of 1 with +1. * avl.h: Update to version 1.1.0. Only declares avl function types if not already declared. (AVL_MAX_HEIGHT) Only define if not already defined. (struct avl_node) New unused member char pad[2]. [GLOBAL_DEBUGGING] Change conditionalization to NDEBUG instead. (force_avl_insert) Renamed avl_force_insert. (force_avl_delete) Renamed avl_force_delete. * crosstabs.q: (struct table_entry) Put `freq' into a union with new member `data'. (struct crosstab) Add new member `ofs'. (glob var int_tab) Removed. (custom_tables) In integer mode, assign v[i] properly through the indirect var_dict. (custom_variables) Now p.crs.max == max + 1. [DEBUGGING] (debug_print) p.crs.min and p.crs.max are now ints. (precalc) Implement integer mode. (calc_integer) Implement integer mode. (compare_table_entry) Remove unused local variable `comparing'. (make_summary_table) Implement integer mode. (macro ns_rows) Implemented as static variable now. (several variables) Made static, from global. (output_pivot_table) Use table_value_missing() for column heads. Remove several unused local variables. Implement integer mode table summing. Count up ns_rows. (crosstabs_dim) Make columns wider when /MISSING=REPORT requested. (find_pivot_extent) Moved into find_pivot_extent_general; now just calls that function or find_pivot_extent_integer. (find_pivot_extent_integer) New function. (enum_var_values) Implemented for integer mode. (table_value_missing) New function. (display_dimensions) Call table_value_missing() for heads. (float_M_suffix) New function. (display_crosstabulation) Call table_value_missing() for row heads. Handle missing values in /MISSING=REPORT mode. (calc_fisher) Remove unused var N. (calc_r) Remove unused var fact. * data-list.c: (dump_fixed_table) Fix table dimensioning. (read_one_set_of_repetitions) Remove unused vars var_spec, column. * data-out.c: (insert_commas) Remove unused var cp. (convert_CCx) Remove unused vars save_set_decimal, save_set_grouping. * descript.q: (dump_z_table) Fix table dimensioning. (pre_calc) Remove unused var j. (display) Remove unused vars title, s. Fix table dimensioning. * expr-evl.c: Comment fixes. * frequencies.q: (full_dim) New function. (dump_full) Fix table dimensioning. (condensed_dim) New function. (dump_condensed) Fix table dimensioning. * get.c: (cmd_match_files) Remove unused var n_val. Remove unused label winnage. * html.c: (html_close_drive) Remove unused var i. (postopen) Remove unused vars title, curfn_len, cp. (preclose) Remove unused vars this, x. * lexer.c: Comment fixes. * matrix-data.c: (cmd_matrix_data) Remove unused var index. * means.q: (custom_tables) Remove unused var m_dim. * mis-val.c: Format fix. * modify-vars.c: (cmd_modify_vars) Remove unused var new_dict. * output.c: (outp_get_paper_size) Remove unused var cp. * pfm-read.c: (read_float) Remove unused var save, unused label underflow. (read_variables) Remove unused vars cp, j. (read_value_label) Remove unused var j. * pfm-write.c: (bufwrite) Remove unused var i. * postscript.c: (ps_postopen_drive) Remove unused vars dev_info, fn. (output_encodings) Remove unused vars char_cp, n_output. (read_ps_encodings) Remove unused var ep. (postopen) Remove unused var title. (preclose) Remove unused var fp. (ps_open_page) Remove unused vars true, false, orientation, mirror_horz, mirror_vert, width, length. (ps_text_metrics) Remove unused var x. * q2c.c: (find_symbol) Remove unused var y. (parse_setting) Remove unused parameter sbc, all references changed. (dump_parser) Remove unused var cp. (dump_free) Remove unused var i. * set.q: (static vars args, n) Removed. (internal_cmd_gset) Removed. * sfm-read.c: (sfm_read_dictionary) Removed unused var i. (read_machine_flt64_info) Removed unused var file_endian. (read_documents) Removed unused var i. (read_compressed_data) Removed unused parameter dict, all references changed. * sfm-write.c: (bufwrite) Removed unused var i. (sfm_write_case) Removed unused var i. * sort.c: (merge_once) Remove unused var t. (write_separate) #if 0 out as dead code. * split-file.c: (cmd_split_file) Remove unused var i. * sysfile-info.c: (sysfile_info_dim) New function. (cmd_sysfile_info) Fix table dimensioning. (variables_dim) New function. (display_variables) Fix table dimensioning. (describe_variable) Remove unused var prev_r. * t-test.q: (z_postcalc) Removed. (pairs_calc) Remove unused var bad_weight. (postcalc) Remove unused vars dfn, dfd. * tab.c: (tab_create) Set t->dim to NULL. (tab_dim) Make sure t->dim is NULL first. (tab_natural_width) Remove parameter `clamp'. (tab_value) Remove duplicate assertion for table. (tab_raw) New function. (nowrap_dim) New function. (wrap_dim) New function. (tab_output_text) Fix table dimensioning. * tab.h: (tab_raw) New macro. * val-labs.c: (get_label) Remove unused var type. (copy_value_labels) Remove unused var trav. * var.h: (struct crosstab_proc) Completely changed. * vars-prs.c: (parse_dict_variable) Remove unused var v. * vfm.c: (open_active_file) Remove unused vars i, lp. * weight.c: (weight_trns_proc) #if 0 out as dead code. Tue Jun 2 23:37:21 1998 Ben Pfaff * Makefile.am: Add apply-dict.c, flip.c. * apply-dict.c: New file. * command.c: (struct command) Make cmd[] larger for CLEAR TRANSFORMATIONS command name. (parse_cmd) Make sure we're in a valid state before using it as an index. Discard variables and reset state on invalid transitions. (cmd_clear_transformations) New function. * command.def: Add APPLY DICTIONARY, CLEAR TRANSFORMATIONS, FLIP. Add unimplemented PRESERVE, RESTORE. * file-handle.h: Include stddef.h. * flip.c: New file. * pfm-read.c: (parse_value) Pad value label values with spaces, not nulls. * sfm-read.c: (struct sfm_fhuser_ext) Add reference count. (sfm_close) Decrement reference count, make sure it's zero. (sfm_maybe_close) New function. (sfm_read_dictionary) Handle reference counts. * vars-atr.c: (clear_default_dict) New function. (discard_variables) Use clear_default_dict(). Sun May 31 00:58:05 1998 Ben Pfaff * Makefile.am: Add pfm-write.c. (LDADD) Add the libgmp2 libraries. * command.def: Define EXPORT. * get.c: (cmd_export) New function. (export_write_case_func) New function. * pfm-read.c: (static spss2ascii[]) Make it const. * pfm-write.c: New file. * sfm-write.c: Formatting, comment fixes. * var.h: Comment fix. Fri May 29 21:44:12 1998 Ben Pfaff * Makefile.am: Add pfm.h, pfm-read.c. * command.def: IMPORT is now implemented. * format.c: (glob var translate_fmt[]) New var. * get.c: (enum GTSV_NONE) Renamed GTSV_OPT_NONE. (cmd_import) New function. (import_source_read) New function. (glob var import_source) New var. * pfm-read.c: New file. * pfm.h: New file. * sfm-read.c: (parse_format_spec) Local variable translate_fmt[] moved in format.c. (dump_dictionary) Disabled printing a couple of items. Mon May 25 12:42:37 1998 Ben Pfaff * crosstabs.q: (postcalc) Call make_summary_table(). (make_summary_table) New function. (insert_summary) New function. (display_dimensions) Remove some unnecessary arguments, all references changed. (output_pivot_table) Fix lots of problems with the risk table setup. (submit) Don't display an empty table. (display_risk) Fix order of arguments to calc_risk(). * glob.c: Always include assert.h and stdlib.h. * output.h: (enum OUTP_T_JUST_FULL) Removed, all references removed. * tab.c: (tab_create) Cosmetic changes. * tab.h: (enum TAB_JUSTIFY) Removed, all references removed. Sun May 24 22:39:23 1998 Ben Pfaff * tab.def: Removed. * crosstabs.q: (output_pivot_table) Headers drawing and submission code simplified, moved into new function submit(). (submit) New function. (crosstabs_dim) New function. (display_directional) Substitute variable names for %s where appropriate. (somers_d_v[], somers_d_ase[], somers_d_t[]) New static vars. (calc_symmetric) Initialize parameters only if non-NULL. Calculate Somers' d. (calc_directional) Calculate Somers' d (or copy it, really). Calculate eta. * output.c: (outp_string_width) New function. * postscript.c: (postopen) Calculate font widths based on the width of the zero '0' character, not the width of the space character. Set paper-width and paper-length based on points, not device units. (ps_open_page) Fix page setup string for landscape mode. * som.h: (struct som_dimension) Removed. (struct som_table_class) height, width members take int * not som_dimesion * now. * tab.c: Many functions now have added parameter validation. (tab_height, tab_width) These functions were removed and merged into a single function tab_resize(), and all references changed. (tab_dim) Rewritten since the interface changed; reduced from hundreds of lines to two. All callers were changed. Currently most of them just use tab_natural_dimensions as their callback and await detailed translation of functionality. (tab_natural_width) New function. (tab_natural_height) New function. (tab_natural_dimensions) New function. This is a callback function, not something that you'd want to call directly. (tab_nat_dim) Removed. (tabi_table) Allocates t->w and t->h. (tabi_driver) Inlined sum_columns()'s functionality. Calls the dimensions callback. (evaluate_dimensions) Removed. (sum_columns) Removed. * tab.h: (enum TAL_1THIN) Removed. (enum series t_*) Removed. (struct tab_table) Members trh, trv changed to unsigned char * from int *. Member dim changed to a function pointer from a unsigned char *. Member max_stack_height removed. New members hr_tot, vr_tot. (macros tab_l, tab_r, tab_t, tab_b) New. Sat May 23 23:22:13 1998 Ben Pfaff * ascii.c: (delineate) Assign last_space_nchars before skipping spaces, to fix right justification. * crosstabs.q: (static vars risk, direct) New vars. (static var pearson_r) Removed. (glob var chisq_fisher) Made static. (static vars row_tot[], col_tot[]) Don't include grand total anymore. (static var grand_total) Renamed W, all references changed. (output_pivot_table) Only make `table' if num_cells != 0. Make risk and directional tables. Deal with grand total no longer part of col_tot[]. Free rows and cols after we're done with them. (display_risk) New function. (display_directional) New function. (clac_r) Rewritten so that it stores all its results into its arguments, so it can be used for Spearman's correlation too. (calc_symmetric) Added a t[] argument, all references changed. Calculates ASEs for tau-b, tau-c, gamma. Calculates Spearman's r, Pearson's r, Cohen's kappa. (calc_risk) New function. (calc_directional) New function. * som.c: (som_submit) Improved debugging code. * stats.c: (hypercube) New function. (cube) New function. (sqr) New function. (normal_sig) Went back to old implementation, which actually worked. * stats.h: (macros square, cube, hypercube) Removed. The equivalent functions in stats.c are inlined here; all references to square changed to sqr. Fri May 22 00:03:41 1998 Ben Pfaff * crosstabs.q: (N_SYMMETRIC) New define. (postcalc) Disable debug printing. (static vars chisq_fisher, pearson_r) New. (output_pivot_table) Add support for symmetric measures. Add chi-square output of exact sigs. (display_chisq) Rewritten. (display_symmetric) New function. (gamma_int) New function. (Pr) New function. (swap) New function. (calc_fisher) New function. (calc_chisq) Check boundary conditions better. Calculate Yates, Fisher, Mantel-Haenszel tests. (calc_r) New function. (calc_symmetric) New function. * stats.c: (normal_sig) Rewritten with new algorithm. Renamed from calc_normal. (chisq_sig) Better boundary conditions. Renamed from calc_significance. * tab.h: (struct tab_table) New member cf. * tab.c: (tab_create) Set cf. (tab_width) New function. (tab_realloc) Handle cf. (tab_vline) Handle cf. (tab_hline) Handle cf. (tab_box) Handle cf. (tab_value) Handle cf. (tab_float) Handle cf. (tab_text) Handle cf. (tab_joint_text) Handle cf. (tab_offset) Handle cf. (tab_next_row) Handle cf. (evaluate_dimensions) Handle cf. (render_strip) Handle cf. Wed May 20 00:03:59 1998 Ben Pfaff * crosstabs.q: (postcalc) New vars row_tot, col_tot, pass them to output_pivot_table(). (output_pivot_table) Moved lots of local variables outside and made them static. Add beginnings of chi-square statistic support. Now column and row totals aren't in the main matrix. Always zero out any leftover rows & columns after we're done with the table entries. Move all output stuff into display_dimensions(), display_crosstabs(), display_chisq(). (display_dimensions) New function. (display_crosstabulation) New function. (display_chisq) New function. (calc_chisq) Implemented Pearson and likelihood-ratio chisquares. * frequencies.q: (dump_full, dump_condensed) Remove tab_null() references, simplify logic. * postscript.c: Remove scale, translate-x, translate-y, mirror-horz, mirror-vert, rotate-180 options. (struct ps_driver_ext) Remove scale, translate_x, translate_y. All references deleted. (macro YT) New macro. (array option_tab[]) Removed options. (ps_option) Removed options. (ps_open_page) Write page setup explicitly to output file, without using now-deleted BP function. (macro dump_line) Use YT(). (macro dump_thick_line) Use YT(). (draw_headers) Use YT(). (switch_font) Reorder arguments to SF function. (write_text) Use YT(). * sfm-read.c: (sfm_read_case) Don't attempt to read variables that have get.fv == -1. * sysfile-info.c: (describe_variables) Don't use tab_nulls(). * tab.c: (tab_create) Initialize t->ct to zeros. Remove null-debugging code. (tab_realloc) Remove null-debugging code. Initialize new regions of t->ct to zeros. (tab_vline) Support offsets. (tab_hline) Support offsets. (tab_box) Support offsets. (tab_null) Removed. (tab_nulls) Removed. (tab_row) Removed. (tab_col) Removed. (evaluate_dimensions) Remove null-debugging code. Understand TAB_EMPTY attribute. Assert that text.s.s is always non-NULL if TAB_EMPTY not present. * tab.h: New cell attribute TAB_EMPTY. (macros tab_nr, tab_nc, tab_row, tab_col) New. * vars-atr.c: (init_variable) Set get.fv to -1 so that GET doesn't try to read them from system files. * vfm.c: (dump_splits) Don't call tab_null(). Sat May 16 19:36:55 1998 Ben Pfaff * crosstabs.q: (struct crosstab) Added `missing' member. (custom_tables) Init missing. (calc_general) Handle missing values. (calc_chisq) New function. (output_pivot_table) Start work on chi-square output. Update for new tab offset support functions. Shorten statistic names. * Several files: add in more `const's to placate gcc's warnings. * tab.h: (struct tab_table) Add col_ofs, row_ofs members. Comment fixes. * tab.c: (tab_height, tab_realloc, tab_vline, tab_hline, tab_box, tab_null, tab_nulls, tab_value, tab_float, tab_text, tab_joint_text) Add col_ofs and row_ofs support. (tab_offset) New function. (tab_next_row) New function. (tab_row) New function. (tab_col) New function. (tabi_table) Add col_ofs and row_ofs support. * vars-atr.c: (is_system_missing) New function. Tue May 12 16:14:30 1998 Ben Pfaff * crosstabs.q: Expanded subcommand names RESID --> RESIDUAL, etc. (static var no_cells) Removed. (static var num_cells) New. (static var expected) New. (static var cells[]) New. (internal_cmd_crosstabs) Deal with new variables. (postcalc) Removed most of the meat and put it in new function output_pivot_table(). (output_pivot_table) Calculates and outputs an entire pivot table. * postscript.c: (postopen) Fix problems with free()ing addresses not obtained from malloc(). * som.c: (som_submit) Add assertion. * sysfile-info.c: (describe_variable) Use new tab_nulls() function. * tab.c: (static var tab_names[]) New. (tab_realloc) -1 for nc or nr indicates no change. (tab_nulls) New function. (tab_dim) Use tab_names[]. (tabi_cumulate) Don't include bottom or right headers. Furrfu. (evaluate_dimensions) Don't terminate on uninited cells, just put an X in them and emit a notice. Use tab_names[]. * tab.h: Move bits into tab.def. * tab.def: New. Don't try to declare tab_table_class because then som.h has to be included. Thu May 7 22:55:04 1998 Ben Pfaff * command.def: New file, contains all the command definitions previously included bodily in command.c. * format.def: New file, contains all of the format definitions previously split across format.h, format.c, and sfm-write.c. * lexer.h: Renamed from tokens.h in order to match corresponding .c file name. * lexerP.h: Moved some rarely used functions exported by lexer.c into here. * Makefile.am: Commemorate renamed files. (EXTRA_DIST) Add command.def, format.def. * command.c: [0] (walk_cmdtable_func) Removed. * crosstabs.q: (postcalc) Made it work and print out matrices proving it. (enum_column_values) Renamed enum_var_values, generalized for any variable. * format.h: (struct fmt_desc) New member `spss'. * q2c.c: (main) Generated code includes lexer.h instead of tokens.h. * sfm-write.c: (write_format_spec) Use new spss member of fmt_spec instead of an independent translation table. Tue May 5 13:19:03 1998 Ben Pfaff * Lots of source files: Added const to declarations. * aggregate.c: (parse_aggregate_function) Rename inner i to j. * arena.c: (arena_clear) Set prev pointer to null when done. * ascii.c: (ascii_option) Rename index as indx. * avl.c: This is now a separate library called libavl. (xmalloc) Make static. (avl_probe) Step A7 can use the cache instead of an explicit compare. (avl_delete) Don't maintain a q pointer because it's always available in the pointer stack. Comment fix. * avl.h: This is now a separate library called libavl. * command.c: (cmd_table[]) Remove spurious trailing "". * common.h: Only include random() fix if this system needs it. * crosstabs.q: Include alloca headers. (n_sorted_tab) New global var. (postcalc) Mostly rewritten. (find_pivot_extent) Rewritten. (enum_column_values) Rewritten. * data-out.c: (convert_F) Rename inner n as n_spaces. * error.c: (dump_message) Don't have an outer var i. * file-handle.q: (static var f) Removed. All references removed. (internal_cmd_file_handle) Uses a local variable instead of f. * get.c: (trim_dictionary) Change scope of i, i1, i2. (cmd_match_files) Don't strcpy tokstr into sbc (why was this ever done?) * getline.h: Declare getl_history as extern. Reported by palme@uni-wuppertal.de (Hubert Palme). * postscript.c: (postopen) Some large mods for constness. * recode.c: Remove spurious copyrights since PSPP is owned by FSF anyway. Fri Apr 24 12:52:47 1998 Ben Pfaff * Makefile.am: Rename BUILT_SOURCES to q_sources, all references changed. Add avl.c, avl.h to pspp_SOURCES. Remove avllib from LDADD. * avl.c, avl.h: New files. These form a clean-room reimplementation of avllib. Iterative algorithms are used in place of recursive ones, so there is no resemblance in the code. * Lots of headers: Don't include other headers by default. * Lots of source files: Explicitly include all needed headers. * arena.c: (arena_clear) New function. * crosstabs.q: (ROW_VAR, COL_VAR) New enums. (static var ar) Removed. (staitc vars ar_tc, ar_col) New. (cmd_crosstabs) Destroy the arenas. (internal_cmd_crosstabs) Create the arenas. (precalc) Don't need a free function for the hash. (calc_general) Make sure to zero out the trailer on the key data before inserting. (print_table_entries) Updated. (postcalc) Worked on actually implementing. (find_pivot_extent) New function. (compare_value) New function. (enum_column_values) New function. * data-in.c: (parse_month) Make local array `static const'. * data-out.c: (convert_date) Make local array `static const'. (convert_WKDAY) Same. (convert_MONTH) Same. * frequencies.q: (postprocess_freq_tab) avl_walk_inorder() has been renamed to avl_walk(). * hash.c: Rewritten more efficiently. * hash.h: Add attribute const to hsh_next_prime declaration. * lexer.c: (id_match) Make arguments const. * postscript.c: (ps_postopen_driver) Make default fonts the Helvetica family. * q2c.c: (main) Generated code needs stdlib.h. * sfm-write.c: (write_value_labels) An avl_traverser needs to be initialized to 0 now, not to NULL. All other references to avl_traverser were updated in the same way. * tokens.h: Macro version of id_match updated to use const properly. * val-labs.c: (inc_ref_count) New function. (copy_value_labels) Simply through use of new avl_copy() function. Wed Apr 15 13:01:58 1998 Ben Pfaff * crosstabs.q: Probably doesn't compile. New PIVOT subcommand. (postcalc) Worked on this. * postscript.c: (OPO_DOUBLE_LINE) New enum. (struct ps_driver_ext) New line_width_thick member. (ps_preopen_drive) Init line_width_thick. (option_tab[]) Add line-* options. (ps_option) Parse line-* options. (postopen) Add line_width_thick support. Strip leading spaces on prologue output lines. (ps_open_page) Include line_width_thick in output. (macro dump_thick_line) New. (dump_fancy_line) Support thick lines as well as double lines. Tue Apr 14 00:50:08 1998 Ben Pfaff * Makefile.am: Add crosstabs.c to BUILT_SOURCES. Add crosstabs.q to pspp_SOURCES. Add crosstabs.q to EXTRA_DIST. * Many source files: Rename `options' to `pv_opts' as appropriate. * command.c: (static var cmd_table[]) Add CROSSTABS command. * common.c: (xcalloc) New function. * crosstabs.q: New file. Not finished yet, though. * data-list.c: Comment fix. * error.c: Remove some old Checker cruft. * frequencies.q: (dump_full) Cumulate valid percent instead of regular percent. * getline.c: Comment fix. * hash.c: Comment fixes. * hash.h: (struct hsh_table) Make hash functions return unsigned instead of int to avoid problems with taking the modulo of negative return values. All references changed. * misc.c: (intlog10) Make its table static const instead of auto. * sfm-read.c: (read_header) Make `prefix' static const instead of auto. * var.h: (union value) Add member `hash'. (struct variable) Rename prv_index as `foo'--all references changed. Reorder. (typedef pv_opts) Removed. All references changed. * vars-prs.c: (parse_variables) Message fixes. Mon Mar 9 15:35:08 1998 Ben Pfaff * get.c: (cmd_match_files) Don't reverse the order of FILEs as they are being inserted. Don't check for BY variables of different types. Discard variables if the active file isn't included in the merge. (mtf_processing) Essentially rewritten. (mtf_merge_dictionary) Check for master/slave variables of different types/widths. * vfm.c: (static var not_canceled) New var. (process_active_file) Don't call vfm_source->read() if there's no vfm-source. Initialize not_canceled. (process_active_file_write_case) Honor and update not_canceled. (prepare_for_writing) Rollback changes from yesterday, they were wrong. (close_active_file) Don't destroy vfm_source unless it exists. Mon Mar 9 00:56:16 1998 Ben Pfaff * Lots of source files: Added { } around nested if/else constructs to avoid new gcc 2.8 warnings. * data-in.c: (parse_Z) Declare `int' type explicitly. (convert_Z) Ditto. * get.c: (struct mtf_file) Add prev, next_min, by, input members. (cmd_match_files) Initialize mtf_by_values. Manage by, input, prev members. Put TABLEs at the end of the chain and FILEs at the beginning. Don't allow the active file in STATE_INIT. Use proper `seen' value for the active file. Fill out the by members and make sure they're of consistent type. Do the actual merge operation. (mtf_processing_finish) New function. (var_type_description) New function. (mtf_free_file) New function. (mtf_free) Rewritten. (mtf_delete_file_in_place) New function. (mtf_read_nonactive_records) New function. (mtf_compare_BY_values) New function. (static var mtf_seq_no) New var. (mtf_processing) New function. (mtf_merge_dictionary) Assign nval members for the system file dictionary. Assign fv values for its variables. Point each slave variable to the corresponding master variable. * hash.c: Include str.h. * mis-val.c: (copy_missing_values) src arg is const. * misc.c: (spacing) Make `max' var explicitly int. * sfm-read.c: (dump_dictionary) Message reformatting. (sfm_read_case) Add assertion. * sort.c: Esthetic fixes. * var.h: (struct match_files_proc) New struct. (struct variable) Add private data match_files_proc. * vars-atr.c: (delete_variable) Implement. Add argument for the dictionary that owning the variable. (dup_variable) Add assertion. * vfm.c: Comment fixes, hopefully the comments are correct now. (process_active_file) New function. (process_active_file_write_case) New function. (process_active_file_output_case) New function. (prepare_for_writing) Use temp_dict->nval for vfm_info, not default_dict.nval. (write_case) Renamed procedure_write_case(). Now write_case is a pointer to a function. Style fixes. 1998-03-05 Ben Pfaff * Makefile.am: (q2c) Link with libmisc. (version.c) Define default_config_path, include_path, groff_font_path. * ascii.c: (ascii_postopen_driver) When the default newline string is requested, open file in text mode. Suggested by palme@uni-wuppertal.de (Hubert Palme). (static vars line_buf, line_p) Change from char * to unsigned char *. (ascii_close_page) char * to unsigned char *. * cmdline.c: (parse_command_line) Implement -r option by prepending ~/.pspp/rc to the list of files to process. * command.c: (cmd_remark) Reset getl_prompt to the standard prompt before pulling in a final line. (null_func, null_int_func) Removed (dead code). * descript.q: (display) Calculate width of variable name column properly. Calculate number of valid cases properly. Reported by palme@uni-wuppertal.de (Hubert Palme). * filename.c: (init_filename) Use default_config_path instead of now obsolete CONFIG_PATH. * getline.c: (getl_initialize) Use include_path instead of now obsolete INCLUDE_PATH. (getl_add_file) New argument `where'. All references changed. * groff.c: (find_font_file) Use groff_font_path instead of now obsolete GROFF_FONT_PATH. * postscript.c: (find_ps_file) Use groff_font_path instead of now obsolete GROFF_FONT_PATH. Copy through temporary variable to avoid problems with constness. * str.h: (macro cs_streq) New macro. * version.h: (glob var default_config_path, include_path, groff_font_path) New vars. 1998-02-23 Ben Pfaff * Many source files: Change verbose_msg() priority levels and messages. * aggregate.c: Include debug-print.h. * cmdline.c: (parse_command_line) Add --safer/-s and --command/-c options. (static var pre_syntax_message) Document --safer/-s and --command/-c. * command.c: (cmd_erase, cmd_host) Disable if set_safer is set. * dfm.c: (open_inline_file) [__CHECKER__] Zero out ext->file, because it's not used but it's still copied. (open_file_r) Remove gratuitous debug message. * filename.c: (safety_violation) New function. (open_file) Remove gratuitous debug messages. Don't allow pipe files if set_safer is set. * get.c: Turn off debugging. * getline.c: (getl_add_virtual_file) New function. (getl_read_line) Add verbose_msg() call for opening new syntax file. (getl_perform_delayed_reset) Add a return value describing whether any action was taken. Call reset_eof(). * getline.h: Comment fix. * groff-font.c: (groff_read_font) Use `goto next_iteration' in place of incorrect `continue'. Use strtok_r() instead of strtok(). Always check strtok_r() return value. (groff_read_DESC) Use strtok_r() instead of strtok(). * lexer.c: (reset_eof) New function. * main.c: (parse) Get a token after performing a delayed reset action; allow empty syntax files. * postscript.c: (output_encodings) Use strtok_r() instead of strtok(). * q2c.c: (dump_parser) Use strtok_r() instead of strtok(). * set.q: Comment fixes. (glob var set_safer) New var. (internal_cmd_set) Support SAFER. * str.h: [!HAVE_STRTOK_R] Declare strtok_r() prototype. * temporary.c: (free_dictionary) Set d->splits to NULL after freeing. * vars-atr.c: (clear_variable) Decrement dict->n_splits if variable deleted, not if it *isn't* deleted. 1998-02-16 Ben Pfaff * command.c: (array cmd_table[]) Add MATCH FILES. * common.c: Comment fixes. * data-list.c, dfm.c, error.c, filename.c, list.q, matrix-data.c, modify-vars.c, postscript.c, sfm-read.c, sfm-write.c, tab.c: Include alloca.h. Problem reported by palme@uni-wuppertal.de (Hubert Palme). * expr-opt.c: Include str.h. Problem reported by palme@uni-wuppertal.de (Hubert Palme). * get.c: (cmd_get) [DEBUGGING] Update v->p.get to v->get. (static var mtf_by) Change from char ** to variable **. (static var mtf_master) New var. (mtf_merge_dictionary) New function. (cmd_match_files) Init mtf_master. Parse mtf_by according to new var type. Reorder tests properly. Initialize file->dict. Detect TABLE= without BY=. Read file dictionaries and merge them. Give subcommand name with IN, LAST, FIRST error messages. Create IN, LAST, FIRST variables. Comment fixes. (mtf_free) Don't free default_dict. Free mtf_master. * getline.c: Define getl_mode. Change getl_buf_size to size_t from int. (handle_line_buffer) Cast int to size_t in comparison to avoid warning. * getline.h: Declare getl_mode extern. * groff-font.c: (groff_read_font) Type-fix calls to getline. (groff_read_DESC) Make line_size a size_t. (match_tok) Parenthesize name to avoid macro expansion. * mis-val.c: (copy_missing_values) New function. * postscript.c: (postopen) Make buf_size a size_t. * sfm-read.c: (dump_dictionary) Make global from static. Print variable info in parts for easier debugging with Checker. * temporary.c: (copy_variable) Use copy_value_labels(). (new_dictionary) New arg: whether to copy file label, documents. * val-labs.c: (copy_value_labels) New function. * var.h: (enums MISSING_*) Add MISSING_COUNT. * vars-atr.c: [GLOBAL_DEBUGGING] (force_dup_variable) New function. (dup_variable) Set prv_index, get.fv, get.nv. Fri Feb 13 15:38:36 1998 Ben Pfaff * Makefile.am: (pspp_SOURCE) Add htmlP.h. * Many source files: For ANSI-compliance, add empty statement after label. Reported by palme@uni-wuppertal.de (Hubert Palme) and Micah Altman . * data-in.c: (parse_numeric) Some header files break on -DBL_MIN_10_EXP because they get a --; add () for safety. Reported by palme@uni-wuppertal.de (Hubert Palme). * dfm.c: Idea by Dr Eberhard W Lisse . (struct dfm_fhuser_ext) Change `file' from FILE * to file_ext. (dfm_close) Use close_file_ext. (open_inline_file) Set file.file to NULL, not file. (open_file_r, open_file_w) Initialize file.file; fill in file_ext struct and use open_file_ext(). (read_record) Use file.file. * file-handle.q: (prepend_current_directory) Pass through special filenames. * filename.c: Only include unistd.h if HAVE_UNISTD_H. (normalize_filename) Pass through special filenames. (open_file, close_file) Accept pipe| and |pipe syntaxes as equivalent. (dirname) Rename blp_dirname() because of name conflict on some OS. All references changed. Reported by palme@uni-wuppertal.de (Hubert Palme). (is_special_filename) New function. * get.c: (GTSV_OPT*) Add GTSV_OPT_MATCH_FILES. (trim_dictionary) Conditionalize some of the options on whether GTSV_OPT_MATCH_FILES is in *options. (rename_variables) Don't allow variables to be renamed as scratch variables. (MTF_*) New enum series. (struct mtf_file) New struct. (static vars mtf_head, mtf_tail, mtf_by, mtf_n_by, mtf_free) New vars. (cmd_match_files, mtf_free) New functions. * lexer.c: (match_int) Needed parentheses around name to escape macro expansion. Reported by Micah Altman . * print.c: Needed to include alloca.h. Reported by Micah Altman . * recode.c: (convert_to_double) Parenthesize -DBL_MIN_10_EXP to -(DBL_MIN_10_EXP). Reported by palme@uni-wuppertal.de (Hubert Palme). * str.h: Include stdarg.h. Reported by palme@uni-wuppertal.de (Hubert Palme) and Micah Altman . Thu Feb 5 00:18:21 1998 Ben Pfaff * html.c: (struct html_driver_ext) Move into htmlP.h. (html_preopen_driver) Initialize cp_x, cp_y. (html_submit) Implement as call to output_tab_table(). (change_attributes) New function. (escape_string) New function. (output_tab_table) New function. * list.q: (write_all_headers) Add code for writing headers for the html driver. (clean_up) Write out the html close-table tag. (determine_layout) Ignore html driver. (list_cases) Write html data. * som.c: (som_submit) Move more of the code into output_table(). * tab.c: (static var hit) Make a global var and rename tab_hit. (static var tab_table_class) Make a global var. * htmlP.h: New file. Tue Feb 3 16:12:18 1998 Ben Pfaff * dump-sysfile.c: Removed. * html.c: (preclose) Change comment in emitted code. * matrix-data.c: Debugging off by default. Comment fixes. (static var container) New var. (cmd_matrix_data) Create and destroy container. Initialize is_per_factor[] to 0s. Move code into new function string_to_content_type(). Require split values to be present in the data when ROWTYPE_ is explicit. Call specific function, not general read_matrices(). (string_to_content_type) New function. (context) Exclude all whitespace, not just spaces. (mget_token) A dot is a number. Add assertion. (static var data) Renamed nr_data. (static var factor_values) Renamed nr_factor_values. (read_matrices) Renamed read_matrices_without_rowtype(). Handle only specific case. Close data_file before exit. (fill_matrix) New function. (read_data_lines) Renamed nr_read_data_lines(). Remove debug printing. Style fixes. Message fixes. Move code into fill_matrix(). (read_matrices_without_rowtype) Rename matrix_data_read_without_rowtype(). Fix off-by-one error on loops. Allocate nr_data[] memory from arena. (read_matrices_with_rowtype) Removed. (read_splits) Renamed nr_read_splits(). Style fixes. (read_factors) Renamed nr_read_factors(). (dump_cell_content) Comment fixes. Arguments changed. Change debug printing. All references changed. (output_data) Renamed nr_output_data(). (static var wr_content) New var. (struct factor_data) New struct. (static var wr_data) New var. (static var wr_current) New var. (matrix_data_source_destroy_source) Removed. (read_matrices_with_rowtype) New function. (matrix_data_read_with_rowtype) New function. (wr_read_splits) New function. (compare_factors) New function. (wr_output_data) New function. (wr_read_rowtype) New function. (wr_read_factors) New function. (wr_read_indeps) New function. (glob var matrix_data_source) Make destroy_source member NULL as well. Fri Jan 23 00:09:08 1998 Ben Pfaff * lexer.c: (syntax_error) Give better error message when at end of file. * matrix-data.c: (var content_names[]) Fix PROX spelling. Change N_SCALAR to output as plain N. (mdump_token) Change output format. (context) Fix message output interaction with spaces in input. (another_token) New function. (force_eol) Improved error message. (static var max_cell_index) New var. (read_matrices) Init `cells'. factor_values is now per-cell. Init max_cell_index. (read_data_lines) Replace `compare' local with new `compare' arg. Debugging messages changed. Only read factors if per_factor. Propagate error return from read_factors(), force_eol(). Copy N_SCALAR values across the N vector. (read_matrices_without_rowtype) Don't init `cells'. Don't need to check parentheses manually since we now have is_per_factor[]. Call read_data_lines() with new args. Check for end of data after looping, using another_token(). (read_factors) Arguments changed. Use max_cell_index to determine whether to read or compare factors. Message fixes. (dump_cell_content) New function. (output_data) Completely rewritten because content types were supported to be nested inside factor values, not vice versa. Thu Jan 22 00:26:38 1998 Ben Pfaff * lexer.c: (syntax_error) Support formatted varargs messages. * matrix-data.c: Turn debugging on by default. (static content_type[]) New array. (static content_names[]) New array. (static rowtype_, varname_) New vars. (static is_per_factor[]) New array. (static split_values) Moved declaration. (static n_continuous, first_continuous) New var. (cmd_matrix_data) Don't init split_values. Assign ROWTYPE_ to rowtype_. Simplify SPLIT code. Init is_per_factor[]. Assign VARNAME_ to varname_. Initialize first_continuous, n_continuous. Check for continuous variables. [DEBUGGING] (debug_print) Remove content_names[]. (mdump_token) New macro. (mget_token_dump) New function. (mdump_token) New function. (context) New function. (mget_token) Fix messages. (static var data, split_values, factor_values) New vars. (read_matrices) Manage split_values, factor_values. (read_data_lines) New function. (read_matrices_without_rowtype) Implemented. (read_splits) Message fixes. Uses `just_read'. (read_factors) New function. (output_data) New function. (matrix_data_source_destroy_source) Close the file handle. (glob var matrix_source) Change name from "DATA LIST" to "MATRIX DATA". * str.c: (strpadcmp) Removed. * vfm.c: (dump_splits) Initialize i; fix test for end of splits. Sun Jan 18 00:30:59 1998 Ben Pfaff * Lots of source files: Add cast to unsigned character to calls to tolower() and toupper(). * aggregate.c: Set default_dict.splits to NULL. * command.c: (static variable tab[]) Add MATRIX DATA. * data-in.c: Add debugging defines. Formatting fixes. * expr-opt.c: Formatting fixes. * lexer.c: (syntax_error) Message fixes. * matrix-data.c: New enum series. (static vars fmt, section, diag, explicit_rowtype, signle_split, split_values, n_factors, factors, cells, pop_n, contents, n_contents) New vars. (cmd_matrix_data) Finished implementation. (compare_variables_by_mxd_vartype) New function. [DEBUGGING] (debug_print) New function. (static vars mtoken, mtokstr, mtoklen, mtokval) New vars. (read_matrices) New function. (read_matrices_without_rowtype) New function. (read_matrices_with_rowtype) New function. (read_splits) New function. (mget_token) New function. (force_eol) New function. [0] (test_tokenizer) New function. (matrix_data_source_destroy_source) New function. (glob var matrix_data_source) New var. * misc.h: Include ieeefp.h if present. * split-file.h: (cmd_split_file) Changes corresponding to struct dictionary changes. * str.h: Fix memmem prototype. * temporary.c: (save_dictionary, restore_dictionary, free_dictionary) Changes corresponding to struct dictionary changes. * var.h: (MXD_* enums) New enum series. (struct matrix_data_proc) New struct. (struct split) Removed. (struct dictionary) Changed `splits' member from `split *' to `variable **'. (macro force_create_variable) New macro. Replaced lots of create_variable()/assert() calls with calls to this macro. * vars-atr.c: (discard_variables) Changed assertion. [GLOBAL_DEBUGGING] (force_create_variable) New function called by the macro of the same name. (clear_variable) Changes to delete splits from the dictionary corresponding to struct dictionary changes. * vars-prs.c: (parse_variables) [GLOBAL_DEBUGGING] Check for corrupted variable `index' values in the dictionary passed in every time this function is called. * vfm.c: (dump_splits, SPLIT_FILE_procfunc) Changes corresponding to struct dictionary changes. Tue Jan 13 23:45:02 1998 Ben Pfaff * Makefile.am: (pspp_SOURCES) Add matrix-data.c. * command.c: New includes. (static array cmd_table[]) Add ERASE, HOST, NEW FILE. (cmd_erase) New function. [unix] (shell) New function. (run_command) New function. (cmd_host) New function. (cmd_new_file) New function. * expr-prs.c: (parse_primary) Message fix. * inpt-pgm.c: Formatting fix. (cmd_reread) Implement the FILE subcommand. * matrix-data.c: New file. * q2c.c: (dump_header) Change output commenting style. * weight.c: Comment fix. Tue Jan 13 00:53:39 1998 Ben Pfaff * aggregate.c: (buf64_10x) Renamed buf64_1xx, all references changed. (buf_10x) Renamed buf_1xx, all references changed. (cmd_aggregate) Implemented cases 010, 011, 110, and 111 (all cases now implemented). (create_sysfile) New function. (agr_11x_func) New function. * data-in.c: (parse_numeric) Work properly if there's an explicitly coded decimal point in the data and decimal places are specified on DATA LIST. Bug reported by Dr Eberhard W Lisse . * get.c: (cmd_get, cmd_save_internal) Allow extraneous slash before file specification on GET, SAVE, XSAVE. Bug reported by Dr Eberhard W Lisse . * q2c.c: [!HAVE_STRERROR] Include misc/strerror.c, not strerror.c. Bug reported by Alexandre Oliva . * sort.c: Include sort.h. Comment fixes. A few esthetic fixes. (static var separate_case_tab) New var. (cmd_sort_cases) Cancel temporary transformations here. Free v_sort before return. (sort_cases) Run an EXECUTE procedure if SEPARATE is nonzero and we're reading from a sort stream. Don't cancel temporary transformations. Offload internal sorting to do_internal_sort(). (do_internal_sort) New function. Handles internal sorting even when SEPARATE is nonzero. Doesn't free v_sort. (do_external_sort) Take new arg SEPARATE. Only destroy `x' if it's non-NULL. (write_initial_runs) Take new arg SEPARATE. Only destroy the old sink if SEPARATE is zero. (read_output_cases) Renamed read_sort_output(), all references changed. Now uses separate_case_tab when it exists. (write_separate) New function. * vfm.c: (page_to_disk) Destroy memory_source_cases, not memory_sink_cases. Don't redundantly call vfm_source->destroy_source(). (memory_stream_mode) After switching over, set memory_sink_cases to NULL. Sat Jan 10 23:35:51 1998 Ben Pfaff * aggregate.c: (struct agr_var) Expand dbl[] array from 2 to 3 elements. (static var prev_case) New, moved out of aggregate_single_case() local scope. (static var buf64_10x, buf_10x) New. (cmd_aggregate) Initialize prev_case. Comment fixes. Implement the 000, 001, 100, and 101 cases. Free prev_case. (parse_aggregate_functions) Disallow scratch variables. (free_aggregate_functions) Only free agr_dict if non-null. Use iter->function to determine numeric/string type, not iter->src->type. (aggregate_single_case) Don't manage prev_case. Initialize aggregate info after dumping it. (accumulate_aggregate_info) Fix sum, weighted sum, mean, weighted mean, stddev, weighted stddev definitions. (dump_aggregate_info) Implemented. (initialize_aggregate_info) Renamed from initialize_aggregate_functions(). Initializes dbl[2]. (agr_00x_trns_proc, agr_00x_end_func, write_case_to_sfm, agr_10x_trns_proc, agr_10x_trns_free, agr_10x_end_func) New. * cases.c: (alloc_val) Removed. * get.c: (cmd_save_internal) Initialize new `dict' member. * sfm-write.c: (sfm_write_dictionary, write_header, write_variable, write_value_labels, write_documents) Reorganize, simplify for new parameter structure. (write_variable) Only one variable * argument now. * sfm.h: (struct sfm_write_info) Removed `pri', `sec', and replaced by new `dict' member. * temporary.c: (new_dictionary) Initialize n_documents. * vars-atr.c: (dup_variable) Allocate `value's from dict into v->fv manually. (init_variable, replace_variable) Eliminate usage of alloc_val(). * vars-prs.c: (parse_DATA_LIST_vars) Accept PV_NO_SCRATCH option. * vfm.c: (arrange_compaction) Allow `temporary' value of 2 to signal that AGGREGATE is to be used for forming final cases. (close_active_file) Call end_func before stopping lagging. Cancel temporary after finishing compaction. (write_case) Comment fixes. Cleaned up. (compact_case) Let AGGREGATE handle compaction when `temporary' is 2. Sat Jan 10 02:10:47 1998 Ben Pfaff * Makefile.am: (BUILT_SOURCES) Add means.c. (pspp_SOURCES) Add means.c. (EXTRA_DIST) Add means.q. * command.c: (array cmd_table[]) Add MEANS. * common.h: Esthetic fixes. Comment fixes. Test for MAX_SHORT_STRING greater than 8. (macros LOWEST, HIGHEST) New. * data-in.c, data-list.c, recode.c: Comment fixes. * means.q: New file, base version. * mis-val.c: (parse_num_or_range, parse_numeric) Replace -DBL_MAX with LOWEST, DBL_MAX with HIGHEST. * q2c.c: (dump_vars) Add an enum to array types giving the number of values for the enum. * sfm-read.c: (sfm_read_dictionary, read_machine_flt64_info) Replace second_lowest_value with second_lowest_flt64. * sfm-write.c: (write_variable, write_rec_7_34) Replace second_lowest_value with second_lowest_flt64. * t-test.q: Comment fix. * temporary.c: (restore_dictionary) Esthetic fix. * tokens.h: (force_match_id, force_match, force_string, force_int, force_num, force_id) Replace msg() with syntax_error(). * var.h: (struct means_proc) New. (struct variable) Add mns member to `p' union. * vars-prs.c: (parse_variable, parse_dict_variable, parse_variables, parse_DATA_LIST_vars) Replace msg() with syntax_error(). Thu Jan 8 22:28:41 1998 Ben Pfaff * Makefile.am: (pspp_SOURCES) Add tab.h. * Most source files: Added a cast to unsigned char in usages of the ctype is*() functions. Replaced `end of command expected' calls to msg() with calls to syntax_error(). * frequencies.q: (dump_condensed) Fix tab_dim() column reference. * lexer.c: (hex_val) Removed (was dead code). (idmatch) Parenthesize function name to avoid macro expansion. * postscript.c: Comment fixes. (ps_preopen_driver) Change default font size to 10pt. * sfm-read.c: (read_variables) Byteswap sv.print, sv.write as int32s. (parse_format_spec) Change system-file format spec argument type to int32. Parse the format spec with bitwise operators. * sfmP.h: (struct sysfile_format) Removed. (struct sysfile_variable) Changed print, write members from sysfile_format to int32. * tokens.h: Esthetic fixes. [__GNUC__] (macro id_match) New macro to hopefully speed up identifier matching. (macros match_id, match_tok, match_int) Implemented in compiler-independent manner; no longer GNU C only. * vfm.h: Include time.h. Mon Jan 5 11:06:15 1998 Ben Pfaff * data-list.c: (dump_fixed_table) Change tab_dim(). * dump-sysfile.c: (open_sysfile) Fix mmap() call. * error.c: Include command.h. * frequencies.g: Formatting fixes. * frequencies.q: Add tab_dim() calls. Make the total cell a joined cell. * glob.c: Include command.h. * sfm-read.c: (struct sfm_fhuser_ext) New members sysmis, highest, lowest. (sfm_read_dictionary) Initialize sysmis, highest, lowest. (sfm_read_machine_flt64_info) Update sysmis, highest, lowest. (read_variables) Byteswap sv.type; byteswap sv.print, sv.write as the other elements (is this right?). (read_variables) Use lowest, highest members. (parse_format_spec) New arg `vv' for more stringent checking. (dump_dictionary) Byteswaps nonexplicit data. (sfm_read_case) Byteswap numeric data. * som.c: Initialize table_num to 1. (render_segments) Remember to increment y_index after each table segment. * sysfile-info.c: (cmd_sysfile_info) Change tab_dim(). Don't call avl_count() on a NULL tree. No title for the second table. (cmd_display) Handle DISPLAY VECTORS by calling display_vectors(). Handle AS_SCRATCH as AS_NAMES. Warn if no variables. Re-enable; fix call to display_variables(). (display_variables) Default to 4 columns, not 3. Set up headers. Column title is Variable, not Name. Fix index column. Add joint text. Add tab_dim(). Handle value labels properly. Handle DISPLAY LABELS properly. Draw boxes correctly. (describe_variable) Value labels don't need titles. Don't clear nonexistent index column. (compare_vectors_by_name) New function. (display_vectors) New function. * tab.c: (tab_height) Add assertion. (tab_null) Add debug code. (evaluate_dimensions) Add debug code. * var.h: (struct variable) get_proc data is sometimes used simultaneously with other per-procedure info, therefore it was removed from the union. All references changed. Sun Jan 4 18:13:33 1998 Ben Pfaff * ascii.c: (ascii_close_page) Put title on second line of headers if there is no subtitle. * command.c: (glob var cur_proc) Move definition here, from common.c. (cmd_remark) Emit blank line before remarks. * command.h: (glob var cur_proc) Move declaration here, from common.h. * data-list.c: (dump_fixed_table) Fix messages. (dump_free_table) Call tab_nat_dim(). * descript.q: (dump_z_table) Modify tab_dim() call. * frequencies.q: (dump_condensed, dump_statistics) Add tab_dim() call. (dump_statistics) Don't output header. * groff-font.c: Minor format fix. * html.c: Comment fix. * list.q: (write_varname) Indent after advancing page. * output.h: Minor reordering. * postscript.c: Comment fixes. Many places, '\n' was replaced by a reference to eol[]. (struct ps_driver_ext) New member eol[]. (ps_preopen_driver) Initialize eol[]. (ps_postopen_driver) Fix sense of text for text_opt, line_opt defaults. Handle headers. Fix test for minimum page length. (static var option_tab[]) Add `line-ends'. (ps_option) Handle line-ends to change eol[]. (postopen) Scale prop_em_width and fixed_width properly. Set the prologue title to outp_title if applicable. Replace the prologue line ends with eol[]. Call draw_headers() if headers are enabled. (text_width) New function. (out_text_plain) New function. (draw_headers) New function. * print.c: (dump_table) Call tab_nat_dim(). * som.c: (som_blank_line) Only advance a line if not at the top of a page. (som_submit) Move several informational table calls here. Increment subtable_num if SOMF_NO_TITLE not set. (output_table) Advance a line if SOMF_NO_SPACING not set. (render_columns, render_segments, render_simple) Handle spacing between tables. Handle table titles. Remove debug output. * som.h: (SOMF_*) New enum series. (struct som_table_class) New member `flags'. * sysfile-info.c: (cmd_sysfile_info) Calls tab_nat_dim(). No headers or spacing. (display_variables) Calls tab_nat_dim(). (describe_variable) Remove restriction on number of value labels. Make value labels separated by thin lines. * tab.c: (tab_create) Default `flags' to none. (tab_float) New arg `w'. All references changed. (tab_nat_dim) New function. (tab_output_text) No title or spacing. (tab_flags) New function. (tabi_flags) New function. (tabi_title) New function. (strip_height) Removed. (tabi_render) Skip title when necessary. (static var tab_tab_class) Add tabi_flags, tabi_title. (evaluate_dimensions) Disable display of column, row size. (sum_columns) Add title height to top header. (render_strip) Moved within file. * tab.h: (struct tab_table) New member `flags'. * vfm.c: (dump_splits) Calls tab_nat_dim(). No title. Sat Jan 3 16:55:44 1998 Ben Pfaff * Most source files: Add `const' attribute in all appropriate places. * sysfile-info.c: (cmd_sysfile_info) Add tab_dim() call, add a column to the variables table for use by describe_variable(). (cmd_display) Disable for the present. (display_documents) Don't wrap documents. (display_variables) Table has four columns now. (describe_variable) Table has four columns now. Don't use a subtable, use joined cells instead. * tab.c: (tab_create) Don't set `join'. (tab_realloc) ct array is not made up of a_string's. Reallocate trh, hrh, h arrays, initialize trh array. Initialize cell contents on GLOBAL_DEBUGGING, not DEBUGGING. (text_format) New function. (tab_title) Rewritten, uses text_format(). (tab_text) Rewritten, uses text_format(). (tab_joint_text) New function. (tab_join) Removed. (static var hit) New variable. (render_strip) New args r1, r2. Implement joined cells that fit on a single page. (tabi_render) Increment hit. Pass new args to render_strip(). (evaluate_dimensions) [GLOBAL_DEBUGGING] Check for uninitialized cells. For t_naw and t_nah, ignore joined cells and null cells in calculations. * tab.h: (struct tab_join_rect) Removed. (struct tab_table) Removed `join'. (TAB_JOIN_MAIN) Removed. (struct tab_joined_cell) New struct. (TAT_NOWRAP) New enum. Fri Jan 2 01:39:58 1998 Ben Pfaff * ascii.c: (ascii_postopen) Replace ASCII_* macros with their expansions. (ascii_postopen_driver) Fix initialization of *_spacing so that the TAL_0 bit doesn't count. * data-list.c: (dump_fixed_table) Use natural width for Format column. * glob.c: (rerange) Removed. (get_date) Formatting fixes. Internationalization fix. * html.c: (html_postopen_driver) Replace HTML_DEFAULT_OUTPUT_FILE with "pspp.html". * postscript.c: (ps_postopen_driver) Replace PS_DEFAULT_OUTPUT_FILE with "pspp.ps". * som.c: (som_submit) Don't eject page before every table. (output_table) Fix order of arguments on call to area(). (render_columns) Fix calculation of max_len. * tab.c: (tabi_cumulate) Minor change to increase elegance. (render_strip) New function. (strip_height) New function. (tabi_render) Rewrite as calls to render_strip(). * tab.h: (TAT_* enums) Removed TAT_RICH, all references removed. Renumbered TAT_PRINTF, TAT_TITLE, TAT_FIX to correspond better with the TAB_* and OUTP_T_* constants. Thu Jan 1 11:53:52 1998 Ben Pfaff * Makefile.am: Formatting fixes. * ascii.c: (ascii_postopen_driver) Initialize *_line_spacing[], *_line_width[]. * data-list.c: (dump_fixed_table) Add tab_dim() call. * descript.q: (dump_z_table, display) Add tab_dim() calls. * dump-sysfile.c: (glob var length) Make type off_t. (usage) Fix arguments. (main) Return 0. * output.h: (OUTP_T_*) Change constants' value to match tab.h. Now right-justification is the default so many references had to change. (struct outp_class) Removed line_width, all references changed. (OUTP_DEV_*) Add OUTP_DEV_DISABLED. (struct outp_driver) Add elements horiz_line_width, vert_line_width, horiz_line_spacing, vert_line_spacing. Remove som element. * postscript.c: (outp_encodings) Formatting fixes. Fix garbage collection. (postopen) Initialize all the informational members of outp_driver. * som.c: (som_blank_line) New function, renamed from blank_line(), all references changed. (som_submit) Disables drivers whose pages can't be opened. (render_columns, render_simple, render_segments) Add debug output. (render_columns) Fix loop range. (render_simple) Don't try to render the headers, they're taken care of automatically. Advance cp_y past the table when done. (render_segments) Fix loop ranges. * tab.c: Initialize new members of tab_table. (tab_vline) Handle trv[]; don't set style for spacing-only lines. (tab_hline) Handle trh[]; don't set style for spacing-only lines. (tab_box) Handle trh[], trv[]; don't set style for spacing-only lines. (set_expr) Removed. (tab_dim) New function. (tab_col_width) Removed. (tab_row_height) Removed. (tab_output_text) Call tab_dim(). (tabi_driver) Call evaluate_dimensions(), sum_columns(). (tabi_area) Implemented. (tabi_cumulate) Implemented. (tabi_render) Partially implemented, but broken. (var tab_table_class) Made static. (evaluate_dimensions) New function. (sum_columns) New function. * tab.h: (enum t_*) Now start at t_end. New: t_ptw, t_nr, t_nc, t_nah, t_naw, t_neg, t_xch, t_dup, t_lbl, t_jnz, t_sac, t_sar, t_scr, t_srr, t_sentinel. Removed: t_nat. (struct tab_table) New: wl, wr, ht, hb, trh, hrh, trv, wrv, dim, max_stack_height, w, h. Removed: ce, re. (macro blank_line) Removed. (glob var zero_length) Removed. Fri Dec 26 15:44:31 1997 Ben Pfaff * Most source files: include some of the new include files broken out of var.h. * Makefile.am: (pspp_SOURCES) Add all the new source files to the list. * aggregate.c: (glob var outfile) Make static. * command.c: (glob var pgm_state) Move here. * common.c: (glob vars endian, second_lowest_value, pgmname, finished, curdate, cur_proc, start_interactive, history_file) Move here. * descript.q: (structs dsc_z_score, descriptives_trns) Move here. * file-handle.q: (glob vars files, inline_file) Move here. * glob.c: Lost lots of glob vars, detailed in individual file entries. (init_glob) set_printer, set_screen were obsolete, deleted. set_cprompt has fewer spaces because pspp has fewer letters than fiasco. * inpt-pgm.c: (glob vars inp_init, inp_init_size) Move here. (inp_nval) Made static. * lexer.c: (glob vars token, tokval, tokstr, tokstr_size, tokstr_len, toklongstr, tokint) Move here. * misc.c: Lost several vars and functions. * set.q: (all the set_* variables) Move here. * str.c: (strmaxcpy, strbarepadcpy, strbarepadlencpy, strpadcpy, blpstrset, strpadcmp, memrev, memrmem, cmp_str) Move here from misc.c. * tab.c: (set_expr, tab_col_width, tab_row_height) New functions. * tab.h: (enum series t_*) New enums. (struct tab_table) Use arena struct tag. New members ce, re. * tokens.h: Comment fixes. * var.h: Move lots of enums and variables and functions and structures to other files. Use and declare a lot more union and struct tags. Comment fixes. * vector.c: (glob vars vec, nvec) Move here. * vfm.c: (glob vars reinit_sysmis, reinit_blanks, init_zero, init_blanks, last_vfm_invocation) Move here. * cases.h: New file. (struct long_vec) Move here. (vec_init, vec_clear, vec_insert, vec_delete, devector, envector) Move here. * command.h: New file. (STATE_* enums) Move here. (glob var pgm_state) Move here. * format.c: New file. (glob var formats) Move here. (parse_format_specifier_name, fmt_to_string, check_input_specifier, check_output_specifier, check_string_specifier, convert_fmt_ItoO, parse_format_specifier) Move here. * format.h: New file. Move functions now in format.c here. (FMT_* enums) Move here. (struct fmt_desc) Move here. (FCAT_* enums) Move here. (struct fmt_spec) Move here. (glob vars formats, fmt_parse_ignore_error) Move here. * inpt-pgm.h: New file. (INP_* enums) Move here, make #defines into enums. (glob vars inp_init, inp_init_size) Move here. * sort.h: New file. (glob vars v_sort, nv_sort) Move here. (sort_cases, read_sort_output) Move here. * vector.h: New file. (struct vector) Move here, add struct tag. (glob vars vec, nvec) Move here. (find_vector) Move here. * New file. (glob vars last_vfm_invocation, temp_case, reinit_sysmis, reinit_blanks, init_zero, init_blanks) Move here. (struct case_stream) Move here. (glob vars vfm_source, vfm_sink, vfm_memory_stream, vfm_disk_stream, sort_stream, data_list_source, input_program_source, file_type_source, get_source, n_lag) Move here. (procedure, write_case, lagged_case, compact_case, page_to_disk) Move here. Wed Dec 24 22:40:42 1997 Ben Pfaff * Makefile.am: (pspp_SOURCES) Added html.c, som.c, som.h. (LDADD) Add libdcdflib. * ascii.c: Comment and formatting fixes. Almost every external function had an assert added, checking driver_open and page_open. (ascii_init_driver) Broken into ascii_preopen_driver, ascii_postopen_driver, ascii_close_driver. Manages driver_open. (ascii_open_page) Sets page_open. (ascii_close_page) Clears page_open. * html.c: Comment and formatting fixes. Almost every external function had an assert added, checking driver_open and page_open. (html_init_driver) Broken into html_preopen_driver, html_postopen_driver, html_close_driver. Manages driver_open. (html_open_page) Sets page_open. (html_close_page) Clears page_open. (html_submit) Disabled. * lexer.c: (parse_string) Remove debugging printf. * list.q: (determine_layout) Open a page if one is not yet open. * output.c: Comment fixes. (add_class) Set the class member of the new list element. (parse_options) Don't handle device type. (colon_tokenize) New function. (configure_driver) New four-field format with a field for device type. Now initialize driver_open, page_open, next, and prev fields. Use new colon_tokenize() function. Don't do a memory copy to replace a driver, it doesn't work; instead delete the old driver and insert a new one. (destroy_driver) Don't call som_destroy_driver(). Close the page if it's open. Find the class in the list of classes and decrement that reference count. Remove the driver from the global driver list. (outp_iterate_enabled_drivers) Renamed outp_drivers(). All references changed. Rewritten. Don't return a driver that's not enabled. (outp_eject_page) All references to som_internal_eject_page() changed to use this. Sets cp_x to 0 as well as cp_y. * output.h: (OUTP_I_* enums) Removed. (struct som_submission_form) Removed. (struct outp_class) init_driver broken into preopen_driver, postopen_driver, and close_driver. submit changed to take a som_table argument. * postscript.c: Comment and formatting fixes. Almost every external function had an assert added, checking driver_open and page_open. (ps_init_driver) Broken into ps_preopen_driver, ps_postopen_driver, ps_close_driver. Manages driver_open. (ps_open_page) Sets page_open. (ps_close_page) Clears page_open. * som.c: New file, base implementation. * som.h: (struct som_table) Add struct tag. (enum SOM_COL_ACROSS) Removed. (SOM_ROWS, SOM_COLUMNS) New enums. (struct som_table_class) Add member `cumulate'. Remove `segment'; change `render' arguments. (struct som_point, struct som_rect) Removed. (som_submit_table) Fixed typo, should have been som_submit. * sysfile-info: (describe_variable) Don't try to insert a subtable; just destroy it for now. * t-test.q: Include dcdflib/cdflib.h instead of cdflib.h. Fix references to value labels. * tab.c: (tab_destroy) New function. (tab_columns) Change argument. [0] (tab_submit) Remove dead code. (tab_title) Allocate string from the table's arena. (tab_output_text) Only free the buffer if we allocated it. (tab_submit) New function. (static vars t, d) New static vars. (tabi_table, tabi_driver, tabi_count, tabi_area, tabi_columns, tabi_headers, tabi_cumulate, tabi_render) New functions. (glob var tab_table_class) New global var. * tab.h: (struct tab_join_rect) Don't use a som_rect; directly encapsulate the rectangle. All references changed. Sun Dec 21 16:18:58 1997 Ben Pfaff * All header files updated to use struct tags in addition to typedefs for all structures. Don't use word `struct' in struct tags. * Makefile.am: (pspp_SOURCES) Remove html.c. (INCLUDES) Replace the lib/* includes with a single lib/ include; all references updated. * command.c: (parse_cmd) Remove call to som_check_workspace. (output_line) Update to new som. * data-in.c: (parse_numeric) A single dot is not an error; it is the system-missing value. * data-list.c: (dump_fixed_table, dump_free_table) Update to new som. * data-out.c: Added `const' as appropriate to many prototypes. (convert_E, convert_F, convert_CCx) Take double argument instead of value * argument. (convert_format_to_string) Call changed functions appropriately. Instead of modifying the caller's value for FCAT_SHIFT_DECIMAL, make a local copy of the value. * descript.q: Remove custom_variables() prototype now provided by q2c. (custom_variables) Don't increment sbc_variables, the caller does this. (dump_z_table, display) Update to new som. * error.c: (vmsg) Add const to prototype. Remove code to handle `too many errors' condition. (check_error_count) New function. (msg) Add const to prototype. * filename.c: (open_file) Rewrite for elegance. * frequencies.q: Remove custom_*() prototypes now provided by q2c. (dump_full, dump_condensed, dump_statistics) Update for new som. * list.q: Don't include somP.h. Change all references to som_driver_ext to refer to the new members of som_driver. Change som_internal_eject_page() references to outp_eject_page(). * main.c: (parse) Rewrite for elegance. Add call to check_error_count(). * output.c: (add_class, outp_list_classes, outp_configure_driver) Rewrite or revise for new outp_driver_class_list structure. (outp_iterate_enabled_drivers) Fix comparison between disabled devices and current device type. (outp_eject_page) New function. * output.h: Comment fixes. (struct outp_driver) New members driver_open, page_open, cp_x, cp_y, font_height, prop_em_width, fixed_width. Deleted members ref_count, next. (struct outp_driver_class_list) New struct. (outp_class_list) Changed to type outp_driver_class_list; all references updated. * print.c: (dump_table, print_trns_proc) Updated for new som. * q2c.c: (dump_vars) Simplify array subcommand code. Declare prototypes for custom subcommands. (dump_subcommand) Always include the `else'. (dump_parser) Fix comments in output code. * set.q: Reordered functions. * som-frnt.c, som-high.c, som-low.c, somP.h: Removed. * som.h: Rewritten from scratch. * str.h: Remove dead code. * tab.c, tab.h: New files, base implementation. * sysfile-info.c: (cmd_sysfile_info, describe_variable) Update to new som. * t-test.q: New code from John Williams . Include math.h, cdflib.h. Many many new static vars and defines. (precalc, postcalc, g_postcalc, z_postcalc, t_pairs, t_groups, groups_calc, pairs_calc, z_dev_calc, z_calc) New functions. (struct value_list) New struct. (variance, covariance, pooled_variance, oneway, pearson_r, f_sig, t_crt, t_sig, print_t_groups) New functions. (cmd_t_test) Implemented. * temporary.c: (cancel_temporary) Only free the temp_dict if it's non-NULL. * vfm.c: (dump_splits) Update to new som. Thu Dec 4 23:02:22 1997 Ben Pfaff * Makefile.am: (fiasco_SOURCES) Add html.c. * aggregate.c: Base source. * ascii.c: (postopen, preclose) Reformat. * data-out.c, expr-evl.c: Comment fixes. * filename.c: (open_file) When opening a file for writing, use line buffering instead of full buffering for better interactive performance. Suggested by Valerio Aimale . Also, recognize special file names `stdin', `stdout', `stderr'. * groff-font.c: Comment fixes. * html.c: New file; base version. * list.q: (write_all_headers, clean_up, determine_layout, list_cases) Ignore `special' devices for now. Needs to be fixed later. * output.c: (outp_init) Add html driver to list; reverse list order. * output.h: (struct outp_class_struct) New members `special', `submit'; comment fixes. All references changed. * postscript.c: (ps_init_driver) Make defaults for text_opt, line_opt depend on whether the OUTP_DEV_SCREEN bit is set on the device. (postopen) Comment fix. (preclose) Comment fixes, formatting fixes. Change x->file.file references to more proper f->file. * som-high.c: (som_submit_table) Special classes use their own renderers. * som.h: Comment fixes. * temporary.c: (new_dictionary) Don't try to xstrdup() a NULL string. Tue Dec 2 14:36:07 1997 Ben Pfaff * Makefile.am: (fiasco_SOURCES) Add aggregate.c back in. * aggregate.c: Still working on this. * command.c: (cmd_table[]) Add AGGREGATE back in. (split_words) Make '-' a legal word separator as well as ' '. * main.c: Comment fixes. * q2c.c: (dump_parser) Don't require the procedure's full name to be present, in the generated source. * t-test.q: Change name to `t-test' from `t test'. Let PAIRS be multiply specified and let it be default; let MISSING, CRITERIA, FORMAT be multiply specified. (cmd_t_test) Parse command name. [DEBUGGING] Call debug_print(). (custom_groups) Fix defaults. (custom_pairs) Check whether this is a PAIRS subcommand before attempting to parse. Better garbage collection. Proper storage allocation. [DEBUGGING] (debug_print) New function. * temporary.c: Comment fixes. (copy_variable) Don't copy variable name and index. (save_dictionary) Copy variable name and index by hand. * vars-atr.c: Comment fixes. (create_variable) New dictionary argument. All references changed. (common_init_stuff) New dictionary argument. All references changed. (init_variable) New dictionary argument. All references changed. (dup_variable) New function. * vars-prs.c: (parse_variables) If there are any errors, we always return 0. Previously, it was possible for some types of errors to be ignored. Sat Nov 22 01:20:59 1997 Ben Pfaff * Makefile.am: (fiasco_SOURCES) For 0.1.5 release, remove aggregate.c. * command.c: (cmd_table[]) Comment out AGGREGATE; add T TEST. * list.q, t-test.q: Remove ALL option from VARLIST declaration in grammar rules. * q2c.c: Comment fixes. (SBC_* enums) Remove SBC_VARLIST_ALL; all references removed. * t-test.q: (cmd_list) Rename cmd_t_test. * temporary.c: (new_dictionary) Don't declare as static. Fri Nov 21 00:03:06 1997 Ben Pfaff * aggregate.c: Changes, still not finished. * file-handle.q, frequencies.q, list.q, set.q: Comment fixes. * q2c.c: Comment fixes. Now its output is internationalized. (get_token) Fix parsing of escapes within literal strings. (main) Fix bad #line directives in output. * t-test.q: Base implementation. * temporary.c: (new_dictionary) New function. (restore_dictionary) [__CHECKER__] Change fill character to * (from @). Sun Nov 16 01:29:57 1997 Ben Pfaff * Makefile.am: (BUILT_SOURCES, fiasco_SOURCES) Add t-test.c * aggregate.c: Changes, still not finished. * descript.q, list.q: Comment fixes. * q2c.c: Almost completely rewritten. * t-test.q: New file, not complete. Fri Nov 14 00:14:48 1997 Ben Pfaff * aggregate.c: Changes, still not finished. * sort.c: (sort_cases) Call cancel_temporary() instead of doing it by hand. * temporary.c: (cancel_temporary) New function. * vars-atr.c: (discard_variables) Call cancel_temporary() instead of doing it by hand. * vfm.c: (close_active_file) After restoring a TEMPORARY dictionary, set temp_dict to NULL. Cancel TEMPORARY through cancel_temporary(). (SPLIT_FILE_procfunc) Comment fix. Tue Oct 28 16:08:45 1997 Ben Pfaff * Makefile.am: (fiasco_SOURCES) Add aggregate.c. * aggregate.c: New file, not finished yet. * command.c: (cmd_table) Add AGGREGATE. * common.h: (pgm_state) Move declaration to var.h. * lexer.c: (bin_value_func, oct_value_func, hex_value_func) i18n fixes. (parse_string) Message fix. * recode.c: Comment fix. * sfm-read.c: (read_variables) Code esthetic fixes. (write_header) Default date is `Jan', not `JAN'. * sfmP.h: (bswap_int32) [!__linux__] Fix off-by-one errors. * sort.c: (cmd_sort_cases) Farm the work out to new function parse_sort_variables(). (parse_sort_variables) New function. (sort_cases) New function. Cancels temporary transformations, which sorting didn't do previously. (cmd_sort_cases) Better garbage collection on error. Uses do_external_sort(). (write_initial_runs, merge_once) Improved code esthetics. (sort_stream_read) Reduced to one call to read_output_cases(). (read_output_cases) New function. * var-labs.c: (cmd_variable_labels) Re-enabled truncation of variable labels to 120 characters. * var.h: Comment fixes. (glob var pgm_state) From common.h. * vars-atr.c: (discard_variables) Set pgm_state to STATE_INIT. * vars-prs.c: (parse_DATA_LIST_vars) Support PV_SINGLE in options. Set *names to NULL on error. * vfm.c: (memory_stream_init) Assert compaction_nval != 0. Thu Oct 9 09:59:49 1997 Ben Pfaff * sfm-write.c, vfm.c: [HAVE_UNISTD] #include , needed by SunOS4. From Alexandre Oliva . Wed Oct 8 18:55:24 1997 Ben Pfaff * vfm.c: (page_to_disk) Added missing local variables. Tue Oct 7 20:23:17 1997 Ben Pfaff * get.c: Comment fix. * sort.c: (cmd_sort_cases) Attempt to perform internal sort if the source is anything other than a disk stream, not just if it's in a memory stream. Call page_to_disk() before external sort. (allocate_cases) Message fix. * vfm.c: (prepare_for_writing) Warn user when paging workspace to disk. (page_to_disk) New function. Sun Oct 5 15:56:14 1997 Ben Pfaff * Makefile.am: (INCLUDES) Include .. instead of $(top_srcdir). * common.h: (macro strerror) Remove. From Alexandre Oliva . * get.c: (dict_delete_run) The number of variables to delete is not necessarily the number of variables that need to be shifted up. (trim_dictionary) Don't set *options to 0. Fix bug that caused too many variables to be deleted. * postscript.c: Comment fix. * q2c.c: Include strerror.c. From Alexandre Oliva . * set.q: #undef ON and OFF. From Alexandre Oliva . * sfm-read.c: (sfm_read_dictionary) Don't set the file class too early, otherwise errors cause a bad free(). * str.h: (macro nvsprintf) s/FORMATS/FORMAT/ typo. From Alexandre Oliva . * temporary.c: (save_dictionary) Don't allocate memory if n_documents is 0. * vfm.c: (memory_stream_write) Message fix. Sat Oct 4 16:20:43 1997 Ben Pfaff * command.c: (static var cmd_table[]) Define REPEATING DATA command. * common.h: Added support for broken systems that are missing EXIT_SUCCESS, EXIT_FAILURE, RAND_MAX, and/or strerror(). * Many source files: Replace syntax error messages via msg() with call to syntax_error(). * data-list.c: (dump_fixed_table) Add support for dumping table for REPEATING DATA as well as DATA LIST FIXED. (cmd_repeating_data) Allows and requires `/' between subcommands. Does proper thing with allowing rpd.starts_end to stay 0. Allows CONTINUED specifications to be omitted. Forces CONTINUED to be specified if ID is. Calculates starts_end, cont_end from logical record length as reported by fhp. Calls dump_fixed_table() if requested. Fixed length of record copied by memcpy. (parse_num_or_var) Sets `num' to 0, not NOT_INT, for variables. Message fix. (realize_value) Returns sensible value for out-of-range variable values. (rpd_parse_record) New argument `ofs'. Fixed confusion between length of occurrences and length of line. Added warning for fields that exceed the line length. Fixed infinite loop. (read_one_set_of_repetitions) Numerous minor changes for more complete SPSS compliance. Message fixes. * dfm.c: (dfm_close) If the file being closed is the inline file, read all the remaining data before closing it. (dfm_get_record) Don't close the file on lossage, as either it has been closed already or it doesn't belong to us. * error.c: (puts_stdout) New function. (vmsg) Use puts_stdout instead of puts. * file-handle.q: (fh_record_width) New function. * inpt-pgm.c: (init_case) Fixed buffer overrun when inp_nval % 4 == 0. (clear_case) Ditto. (input_program_source_read) Made an old kluge an approved method. * lexer.c: (syntax_error) New function. * misc.c: [BROKEN_RAND] (ansi_rand, ansi_srand; static var next) New. * output.c: (oupt_get_paper_size) Message fix. * q2c.c: Numerous fixes to formatting of generated code made to conform to GNU coding standards. Uses syntax_error() in generated code. Other miscellaneous generated message fixes. Added support for broken systems that are missing EXIT_SUCCESS, EXIT_FAILURE, RAND_MAX, and/or strerror(). Sat Oct 4 02:09:56 1997 Ben Pfaff * data-in.c: Comment fixes. * data-list.c: (struct repeating_data_trns) New member `id_spec'. (find_variable_input_spec) New function. (cmd_repeating_data) Initializes id_spec. (rpd_parse_record) Implemented. (read_one_set_of_repetitions) Returns -3 by default in order to kluge out some potential bugs. * data-out.c: Comment fixes. * file-type.c: (internal_cmd_record_type) Message fix. * inpt-pgm.c: (input_program_source_read) Special temporary kluge for handling -3 return value. Sat Sep 20 23:58:15 1997 Ben Pfaff * data-list.c: Comment fixes. (struct dls_var_spec) Reordered members. (read_from_data_list_fixed) Restructured. (struct repeating_data_trns) Reordered members. Renamed `starts' as `starts_beg', `ends' as `starts_end'. (cmd_repeating_data) Calculates length of repeated data if necessary and possible. (parse_num_or_var) Don't allow string variables. (realize_value) New function. (rpd_msg) New function. (rpd_parse_record) New function. Currently stubbed out. (read_one_set_of_repetitions) Implemented. * inpt-pgm.c: (input_program_source_read) Comment fix. Thu Sep 18 21:34:57 1997 Ben Pfaff * command.c: (cmd_end_repeat_p) Removed. (init_cmd_parser) Doesn't set cmd_end_repeat_p. (parse_cmd_name) Removed. * data-list.c: Comment fixes. (data_list_pgm) Removed `eof' member. (static var first) New var. (cmd_data_list) Sets `first'. Ensures that DATA LIST uses the FILE TYPE file inside FILE TYPE structures. (append_var_spec) Appends to *first, not dls.spec. (parse_fixed) Message fixes. (struct rpd_num_or_var) New. (struct repeating_data_trns) New. (static var rpd) New. (cmd_repeating_data) New function. (parse_num_or_var) New function. (parse_repeating_data) New function. (read_one_set_of_repetitions) New function. * file-type.c: (cmd_file_type) Message fixes. Always default_handle to FILE TYPE file handle. (internal_cmd_record_type) Message fixes. Wed Aug 20 14:22:03 1997 Ben Pfaff * repeat.c: Comment fix. Disable debugging. * temporary.c: (restore_dictionary) Sets splits to NULL and n_splits to 0 before destroying the variables because now doing this tries to remove split variables. * vars-atr.c: (discard_variables) Asserts that n_splits is 0 after destroying the dictionary. (clear_variable) Removes a variable from splits after destroying it. Mon Aug 18 18:06:55 1997 Ben Pfaff * cmdline.c: (set_compat) Removed. (pick_compat) Removed. (parse_command_line) Removed -c option. (pre_syntax_message) Removed -c option. (usage) Remove compatibility code. * common.h: (macros VER_PC, VER_WND, VER_X) Removed. (glob var compat) Removed. * compute.c: (type_check) Fixed messages about type mismatches. * data-list.c: (cmd_data_list) Removed compatibility code. (fixed_parse_compatible) Calls convert_negative_to_dash(). Fixed bug where it only set the variable in fx.spec if it created the variable itself. (dump_fmt_list) Spelling fix. (cut_field) Removed compatibility code. * dfm.c: (cmd_begin_data) Don't require a command terminator on BEGIN DATA command. * expr-evl.c: (evaluate_expression) Implement LAG. * expr-prs.c: (parse_add) Calls convert_negative_to_dash(). (parse_neg) Calls convert_negative_to_dash(). (LAG_func) Increases n_lag to the lag requested. Fixed assignment bug. * expr.h: (struct expression_struct) Removed member max_lag. * file-type.c: (parse_col_spec) Calls convert_negative_to_dash(). (internal_cmd_record_type) Removed special handling to produce negative numbers from dash tokens. * getline.c: (static var DO_REPEAT_level) New var. (getl_add_DO_REPEAT_file) Increments DO_REPEAT_level. (handle_line_buffer) Copies the line into getl_buf; doesn't call copy_with_DO_REPEAT_substitutions(). (getl_read_line) Maintains value of getl_mode. Calls perform_DO_REPEAT_substitutions() whenever DO_REPEAT_level is positive. (getl_close_file) Decrements DO_REPEAT_level when appropriate. * getline.h: (getl_mode) New glob var. * glob.c: Comment fixes. (init_glob) Restructured. Sets set_seed. (init_compat_dependent) Removed. All references removed. (get_date) Format changed from MM/DD/YY to DD MMM YYYY. (__htonl, __htons) Removed. (What were these for?) * lexer.c: (static var tbl) Dash set to class CNUM. (make_hexit) New function from data-out.c. (get_token_representation) Rewritten. (convert_negative_to_dash) New function. (lex_init_compat_dependent) Removed. (yylex) A dash is parsed as part of a number if it is followed by a digit. The ASCII representation of a number is copied to tokstr. String parsing farmed out to parse_string(). Comment fixes. (bin_value_func, oct_value_func, hex_value_func, parse_string) New functions. (preprocess_line) Line processing depends on interactive/batch mode, not on compatibility mode. Removed PC+ compatibility code. * loop.c: (loop_3_trns_proc) Comment fix. * main.c: Remove dead code. (main) Remove call to init_compat_dependent(). * misc.c: (convert_fmt_ItoO) Make E format conversion more conformant. * print.c: (parse_string_argument) Calls convert_negative_to_dash(). (fixed_parse_compatible) Calls convert_negative_to_dash(). * repeat.c: (RPT_* defines) Removed. (struct rpt_numeric) Removed. (struct repeat_entry) New member type, changed `replacement' from char * to char **. (clean_up) Deallocation adapted to new repeat_entry. (internal_cmd_do_repeat) `type' defaults to 0. Remove lookahead() usage. Creates vars for `type' of 1. (parse_ids) Sets type of 1. Adapted to new repeat_entry. (store_numeric) Rewritten, new interface. (parse_numbers) Rewritten. (parse_strings) Rewritten. (find_DO_REPEAT_substitution) New function. (perform_DO_REPEAT_substitutions) New function. (copy_with_DO_REPEAT_substitutions) Removed. (debug_print) Rewritten. * set.q: Comment fix. (custom_results) Removed compatibility code. (internal_cmd_set) Removed SET EMULATION subcommand. Removed compatibility code. * sysfile-info.c: (cmd_display) Removed compatibility code. * tokens.h: Comment fixes. (token types enum) Removed `toktype' typedef name for this int type. Removed SUBST. Restructured. * vars-atr.c: (discard_variables) Sets n_lag to 0. * vars-prs.c: Comment fix. * vfm.c: Comment fixes. (glob var n_lag) New var. (static vars lag_count, lag_head, lag_queue) New vars. (procedure) Removed argument nlag. (setup_lag) New function. (close_active_file) Discards lagging state. (lag_case) New function. (lagged_case) New function. (write_case) Lags a case if lagging. * weight.c: (cmd_weight) Removed compatibility code. Sun Aug 17 22:34:40 1997 Ben Pfaff * getline.h: (struct getl_script) New members loop_index, macros. * getline.c: (getl_add_file) Sets first_line field to NULL. (getl_add_DO_REPEAT_file) New function. (handle_line_buffer) When the current line's length is negative, set the filename and line number. Increment line number after reading line. Pass the line to copy_with_DO_REPEAT_substitutions() for processing. (getl_close_file) Free DO REPEAT lines before freeing the filename, and just set the filename to NULL when doing this, because otherwise the filename gets freed twice. * glob.c: (glob var queuing) Removed. All references removed. * lexer.c: Comment fixes. (get_token_representation) New function. * repeat.c: Comment fixes. (struct repeat_entry) Replaced type and v union members with a simple string. (append_record) New function. (internal_cmd_do_repeat) Started reforming it for the new repeat_entry struct. Properly records filename changes in the getl_line_buf. Fixed improper use of = for ==. Fixed sense of strncasecmp() result usage. Uses append_record() to simplify. Properly discards END REPEAT line. Calls getl_add_DO_REPEAT_file to add in the file. (copy_with_DO_REPEAT_substitutions) Started coding. [DEBUGGING] (debug_print_lines) New function. * set.q: (custom_results, internal_cmd_set) s/VER_PCP40/VER_PC/; * tokens.h: (macro is_id1, is_idn) New macros. Sat Aug 16 10:57:41 1997 Ben Pfaff * cmdline.c: (static var pre_syntax_message) Changed `win' compatibility mode to `wnd'. * data-list.c: (fixed_parse_spss) Renamed fixed_parse_compatible(). * glob.c: (init_glob) Excise unused code for program_invocation_short_name. * lexer.c: (preprocess_line) Leading indentors are ignored in Wnd as well as in X. * print.c: (fixed_parse_spss) Renamed fixed_parse_compatible(). * set.q: `win' compatibility renamed `wnd'. Thu Aug 14 22:11:12 1997 Ben Pfaff * filename.c: [__WIN32__] Change the included Windows header files (again). (absolute_filename_p) [__MSDOS__] A filename with a colon as the second character is absolute. (dirname) Fix logic error. Don't printf() the results. (prepend_dir) Don't printf() the results. * getline.c: (handle_line_buffer) New function. (getl_read_line) Reads line with handle_line_buffer() when appropriate. (getl_close_file) Discard line buffer data. * getline.h: Comment fixes. (struct getl_line_list) New struct. (getl_script_struct) Added line buffer members. These are hooks for use by DO REPEAT to allow it to insert virtual source code into the program. * glob.c: (init_glob) [__DJGPP__ || (__WIN32__ && __BORLANDC__)] Override Borland C++ stupidity that claims Windows has a console window size of 0x3. * repeat.c: This is in the process of being restructured from using a token-buffering approach to the DO REPEAT facility to using the more flexible approach of a line-buffering approach in conjunction with the getline module. Comment fixes. (struct tok_struct) Removed. (static vars queue_index, queue_head, queue) Removed. (static vars line_buf_head, line_buf_tail) New vars. (internal_cmd_do_repeat) Instead of queuing tokens, queue lines. Not complete. (pull_queue, destroy_queue) Removed. [DEBUGGING] (debug_print_tokens) Removed. Tue Aug 5 13:57:58 1997 Ben Pfaff * file-handle.q: (prepend_current_directory) New function. (internal_cmd_file_handle, fh_get_handle_by_filename) Prepends current directory before normalizing filename. * filename.c: (gnu_getcwd) New function. (absolute_filename_p) New function. (search_path) New argument, PREPEND. All references changed to pass NULL except those explicitly mentioned. Uses absolute_filename_p(). Prepends PREPEND before trying the filename. (dirname, prepend_dir) New functions. * getline.c: (getl_get_current_directory) New function. (getl_include) Passes getl_get_current_directory() as PREPEND arg to search_path(). Sun Aug 3 11:42:36 1997 Ben Pfaff * In several source files, the term `script' was replaced with `syntax file' inside error messages. Usage of the term `script' in the sense of a syntax file is now deprecated. * cmdline.c: (static vars pre_syntax_message, post_syntax_message) Updated messages. * dump-sysfile.c: (usage) Update message. * getline.c: (getl_read_line) Ignore lines beginning with `#!'. * getline.h: (glob var getl_include_path) Declare extern. * list.q: Define EXTERN as extern before #including somP.h. * var.h: Remove declaration of `disptype' variable. * vfm.c: (close_active_file) After switching the data sink to a data source, set vfm_sink to NULL, because it doesn't exist any more. Thu Jul 17 21:41:44 1997 Ben Pfaff * glob.c: [__BORLANDC__] Include math.h. Define _matherr() and _matherrl() to ignore all math errors. * sfm-read.c: (read_value_labels) When reading the labels from disk, read the little parts separately instead of as a struct; this avoids alignment problems. * sfm-write.c: (struct sfm_fhuser_ext) New member `elem_type'. (sfm_write_dictionary) Sets elem_type and frees it on lossage. (write_header) Allocates and initializes elem_type. (sfm_write_case) Uses elem_type to determine how to handle each flt64 element. (sfm_close) Frees elem_type. * sfmP.h: Comment fix. [__BORLANDC__] Uses #pragma -a to adjust structure member alignment. Thu Jul 17 01:55:12 1997 Ben Pfaff * Makefile.am: (fiasco_SOURCES) Remove display.c. * common.c: Fix typo. * dfm.c: (read_record) Remove strncasecmp() emulation and fix the sense of the condition. * expr-evl.c: (macro ALLOC_STRING_SPACE) [!PAGED_STACK] Add line-continuation backslash. * filename.c: [__WIN32__] Include before . * frequencies.q: (custom_grouped, add_percentile) Don't use a non-constant expression as an argument to sizeof. * glob.c: [__WIN32__ && __BORLANDC__] When including , undefine gettext macro because that's a conio function. * hash.h: (hsh_prime_tab declaration) Remove. * list.q: (write_fallback_headers) Move `leader' allocation out of main loop. Change to local_alloc() allocation. * output.h: Formatting fixes. Put __attribute__ in right place on function prototypes. * sfm-read.c: (read_machine_flt64_info, read_variables) Change incorrect `SECOND_LOWEST_VALUE' references to proper `second_lowest_value'. * som-frnt.c: (EXTERN macro) Define as `extern' instead of null value. This way 2 out of 3 of the som files define the vars extern, the correct way, that actually works under BC++. (som_set_float) Don't use nonconstant initializers for a struct. * som-high.c: Add the standard alloca() header. (replicate_table) Add prototype. Merged DISPLAY routine. * sysfile-info.c: (AS_*) New enum series. (cmd_sysfile_info) Gutted. Calls describe_variable() to do the dirty work. (cmd_display, display_macros, display_documents, display_variables) Stolen from defunct display.c. (describe_variable) New function. * temporary.c: [0] (display_tree) New debug function. (copy_variable) Performs shallow copy of value labels instead of deep copy; i.e., just copys the AVL tree and increments the reference counts. * val-labs.c: Comment fixes. (do_value_labels) Optionally skip leading forward slash. (get_label) Creates only a single value label instead of many copies of one, and sets the reference count. * display.c: Removed. * dump-sysfile.c: New file, not yet complete. Fri Jul 11 23:02:18 1997 Ben Pfaff For lots of source files I added more verbose_msg's. These aren't listed below as they have tested as being benign. In some cases these replaced debug_printf() calls. * output.c: (outp_read_devices) Message fix. * postscript.c: (output_encodings) Message fix. Reports errors on fclose(). (postopen) Message fix. Fri Jul 11 14:09:40 1997 Ben Pfaff * dfm.c: (dfm_close) Don't call fclose() for a NULL FILE. * filename.c: (close_file_ext) Set f->file to NULL *after* closing it. * main.c: Remove #include. * mis-val.c: (parse_numeric) Set .f member for each missing[] instead of trying to just set the missing[] itself, which is a gcc-specific idiom. * sfm-read.c: (read_variables) Same. * str.h: Add memmem() prototype. * val-labs.c, var-labs.c: Replace with . Thu Jul 10 22:13:53 1997 Ben Pfaff * Makefile.am: (q2c) Don't include any libraries in the link. * dfm.c: (force_line_buffer_extension) New macro. (count_tabs) New function. (tabs_To_spaces) New function. (read_record) Calls tabs_to_spaces() on the line being processed. * q2c.c: Disabled i18n for this proglet so that libintl.a doesn't have to be compiled twice (once for CC, once for LOCAL_CC). Sun Jul 6 19:14:33 1997 Ben Pfaff * Makefile.am: (INCLUDES) Add intl directory; fix directories. (LDADD) Add @INTLLIBS@. (q2c) Add LIBS, @INTLLIBS@ to link step. * inpt-pgm.c: Turn off debugging. * postscript.c: (postopen) Format fix. local_free() blocks returned by local_alloc(); don't free() them. Sat Jul 5 23:44:51 1997 Ben Pfaff * data-in.c: (parse_string_as_format) Comment fix. Fix check for string length. * data-list.c: (read_from_data_list_fixed) Pass proper value for LEN arg, not simply the full string length. * sort.c: (allocate_file_handles) Check SPSS compatible temp file directories before generic temp file directories. * vfm.c: Disable debugging. Fri Jul 4 13:26:41 1997 Ben Pfaff * get.c: Comment fix. (cmd_save_internal) Always passes GTSV_OPT_SAVE option. Wed Jun 25 22:52:28 1997 Ben Pfaff * expr-prs.c: (debug_print_postfix) Conditionally included on GLOBAL_DEBUGGING. Removed out_header() reference. * exprP.h: Removed #undef GLOBAL_DEBUGGING. Sun Jun 22 22:00:28 1997 Ben Pfaff * ascii.c: Removed obsolete ascii_close_page() prototype. * command.c: (output_line) Comment fix. * data-in.c: Formatting fix. (parse_string_as_format) Now the `fc' argument is used only for the purpose of error messages; it is not an index into the string passed. All references changed. * data-list.c: Comment fix. (cut_field) Comment fix. Now returns the column number of the position of the field cut out on success. (parse_field) Added `column' argument. Puts the column numbers in the error message. (read_from_data_list_free, read_from_data_list_list) Record the column number returned by cut_field(), pass it to parse_field(). * dfm.c: Comment fix. * do-ifP.h: Comment fix. * expr-prs.c: (SYSMIS_func) Implemented string-type arguments for the SYSMIS function. * expr.h, exprP.h: Comment fix. * glob.c: (init_glob) Only calls setlocale() and family if ENABLE_NLS set. * hash.h: Comment fix. * include.c: Comment fix. * output.c: Comment fix. * postscript.c: (ps_line_intersection) Simplified assertion. * repeat.c: Comment fix. * vars-atr.c: Comment fix. * vars-prs.c: Comment fix. * vfm.c: (vector_initialization) [DEBUGGING] Fixed undefined behavior with usage of postincrement. (memory_stream_read) Discards cases as it goes. Sun Jun 15 16:45:17 1997 Ben Pfaff * Makefile.am: Cleans q2c, not just distcleans it. Distcleans foo. * Most source files: Includes debug-print.h, related comment fixes. * cases.c: (alloc_val) Removed complex allocation code. Merely increments default_dict.nval and returns the former value. (envector, devector) Removed references to lv member of struct variable. * common.h: (macro VME) Replaced complex definition with simple one. * data-list.c: (cmd_data_list) Sets vfm_source instead of read_active_file and cancel_input_pgm. (read_from_data_list, cancel_data_list) Removed. (data_list_source_read, data_list_source_destroy_source) New functions. (glob var data_list_source) New var. * dfm.c: (open_file_r, open_file_w) Simplified debug output. (cmd_begin_data) Improved criteria for an input program accessing the inline file. Still not perfect. * do-if.c: (do_if_trns_proc) Simplified debug output. * expr-prs.c: Comment fixes. [DEBUGGING] (debug_print_postfix) Simplified debug output. * file-handle.q: (fh_close_handle) Simplified debug output. * file-type.c: Comment fixes. (cmd_file_type) Sets vfm_source instead of read_active_file and cancel_input_pgm. (cmd_end_file_type) On failure, discards variables in place of just canceling the input program. (read_from_file_type) Renamed file_type_source_read. (cancel_file_type) Renamed file_type_source_destroy_source. (glob var file_type_source) New var. * get.c: (GTSV_* enum series) New enums GTSV_OPT_SAVE, GTSV_NONE. (cmd_get) Initializes options to GTSV_NONE before passing to trim_dictionary(). Removed `lv' reference. Sets vfm_source instead of read_active_file and cancel_input_pgm. (cmd_save_internal) Initializes options before passing to trim_dictionary(). Local var `nval' removed. (dict_delete_run) Comment fixes. (trim_dictionary) Comment fixes. Disallows scratch variables if GTSV_OPT_SAVE set in options. (read_from_get) Renamed get_source_read. (cancel_get) Renamed get_source_destroy_source. (glob var get_source) New var. * inpt-pgm.c: (cmd_input_program) Sets vfm_source instead of read_active_file and cancel_input_pgm. (read_from_input_program) Renamed input_program_source_read. Simplified debug output. (cancel_input_program) Renamed input_program_source_destroy_source. (glob var input_program_source) New var. * loop.c: (loop_1_trns_proc) Simplified debug output. * main.c: (dump_token) Made eof output more explicit. * sfm-read.c: (read_variables, dump_dictionary) Removed `lv' references. * sort.c: (cmd_sort_cases) Disallows scratch variables. Removed code for always-memory or always-disk cases. malloc's case-list based on vfm_source_info.ncases. Explicit support for memory_stream via memory_source_cases. (do_external_sort) Sets vfm_source instead of read_active_file and cancel_input_pgm. (allocate_file_handles) The temporary directory permissions are set to 0700 instead of 0777. (allocate_cases) Formatting fixes. Simplified debug output. (output_record) Compacts the case if necessary before writing it out. (close_handle, open_handle_w) Simplified debug output. (write_initial_runs) Destroys vfm_sink, then sets it to sort_stream. Writes records to memory based on vfm_sink_info.case_size. (write_to_sort_cases) Renamed sort_stream_write(). (merge) Simplified error handling. Simplified debug output. Formatting fixes. (read_from_external_sort) Renamed sort_stream_read(). Reads records based on vfm_source_info.case_size. (sort_stream_write) Writes records to memory based on vfm_sink_info.case_size. (sort_stream_mode) New function. (glob var sort_stream) New variable. * temporary.c: (cmd_temporary) Simplified debug output. (copy_variable) Removed references to `lv'. * title.c: (get_title) Simplified debug output. * var.h: Comment fixes. (struct get_proc) Removed member `lv'. (struct variable) Removed member `lv'. Comment fixes. (glob vars read_active_file, write_active_file, cancel_input_pgm) Removed. (struct case_stream) New. * vars-atr.c: (discard_variables) Changed cancel_input_pgm, read_active_file references to use vfm_source. (init_variable, replace_variable) Removed references to `lv'. * vfm.c: Comment fixes. (glob var vfm_source, vfm_sink, vfm_source_info, vfm_sink_info) New variables. (static var queue, qh, qt, n_lag) Removed. All references removed. (glob var compaction_necessary, compaction_nval, compaction_case, paging) New variables. (record_case) Removed. (procedure) Comment fixes. Calls vfm_source->read() instead of read_active_file(). (lag) Removed. (prepare_for_writing, arrange_compaction, make_temp_case, vector_initialization, setup_filter) New function. (open_active_file) Most of the code moved into the abovementioned new functions. Now sets temp_dict to &default_dict if there is no temporary dictionary, for convenience. New debug output. (close_active_file) Deals with changing the sink to the source. Calls finish_compaction(). Frees compaction_case. Mostly rewritten. (glob vars disk_source_file, disk_sink_file) New vars. (destroy_active_file, read_from_memory) Removed. (disk_stream_init, disk_stream_read, disk_stream_write, disk_stream_mode, disk_stream_destroy_source, disk_stream_destroy_sink) New functions. (glob var vfm_disk_stream) New var. (glob vars memory_source_cases, memory_sink_cases, memory_sink_iter, memory_sink_max_cases) New vars. (memory_stream_init, memory_stream_read, memory_stream_write, memory_stream_mode, memory_stream_destroy_source, memory_stream_destroy_sink) New functions. (glob var vfm_memory_stream) New var. (write_case) Local var `i' renamed `cur_trns'; local var `retval' named `more_cases'. Simplified debug output. Otherwise mostly rewritten. (record_case) Moved into the stream drivers. Removed. (transform) Removed (was dead code). (SPLIT_FILE_procfunc) s/vfm_replacement/vfm_sink_info/. In the common case that the splits don't change, we don't need to copy the case into prev_case again--pointless. (compact_case) New function. (finish_compaction) New function. * vfmP.h: Comment fixes. (DEV_* enum series) Removed. (struct storage) Renamed `stream_info'. Removed variant record. Removed `device' member. * debug-print.h: New file. Sun Jun 8 01:12:38 1997 Ben Pfaff * autorecode.c: Turned off debugging. * data-list.c: (destroy_dls) Closes the associated file handle. * descript.q: (custom_variables) Added PV_NO_SCRATCH to parse_variables() options. * dfm.c: (open_file_r) Removed gratuituous argument to msg() call. * display.c: (display_variables) Really fixed null cell bug. * file-handle.q: (fh_close_handle) Changed debugging message. * frequencies.q: (custom_variables) Added PV_NO_SCRATCH to parse_variables() options. * list.q: Added PV_NO_SCRATCH in q2c varlist options. (cmd_list) Fails if no variables specified. (determine_layout) Writes blank lines manually. * loop.c: (loop_1_trns_proc) Made debugging code only print messages if debugging. * q2c.c: (dump_subcommand) Appends sbc->message to SBC_VARLIST parse_variables() arguments. (main) Parses optional parenthesized options to varlist subcommands into sbc->message. * sfm-read.c: Format fix. * var.h: (FV_*) New enum series. (PV_*) New enum PV_NO_SCRATCH. * vars-prs.c: (find_var) Removed. (fill_all_vars) Takes FV_* enum instead of boolean third argument. Rewritten to deal with scratch as well as system variables. (parse_variables) Error message on scratch variable if PV_NO_SCRATCH set. * vfm.c: (static var virt_begin_func) New var. (procedure) Sets up virt_begin_func. (SPLIT_FILE_procfunc) For the first case, calls virt_begin_func() after dump_splits(). For succeeding groups changes, calls virt_begin_func() instead of begin_func(). Fri Jun 6 22:42:23 1997 Ben Pfaff * count.c, data-out.c, file-handle.q, list.q, loop.c: Turned off debugging. * dfm.c: Added some debugging messages, disabled by default. (open_file_r) Fixed error message. (read_record) On eof on inline_file, instead of calling fh_close_handle(), simply jump to eof label like a normal file. Message fixes. * display.c: Thin lines between rows for certain kinds of listing. Fixed `null cell' bug. * error.c: (failure) Flush stdout, stderr before failing. * file-handle.q: (fh_close_handle) Added debugging message. * frequencies.q: (dump_full) Bottom line extends across entire table width. Changed title formatting. (dump_condensed) Changed title formatting. (dump_statistics) Fixed title formatting. * glob.c: (init_glob) Moved initialization of cur_proc out of #if. Sets default value of set_format. * list.q: (cmd_list) Calls blank_line() before determine_layout(). Passes write_all_headers() to procedure() as pre-group func. (write_all_headers) New function. (determine_layout) Removed calls to write_header(). Calls blank_line() before and after write_fallback_headers(). * recode.c: (recode_trns_free) Only attempts to free head->map if non-NULL. * sfm-read.c: (read_variables) Allows `#' at beginning of system file variable names but gives a warning. Sets `left' based on first character being/not being `#'. On lossage frees dict->var. * som-high.c: (som_draw_title) Simplified title formatting. * vfm.c: (dump_splits) Fixed and changed splits formatting. Thu Jun 5 22:51:15 1997 Ben Pfaff * autorecode.c: (cmd_autorecode) Sets h_trans to NULL at beginning. Frees v_src, v_dest on successful exit. Frees h_trans[*], h_trans on lossage. (recode) Frees h_trans[*], h_trans. * dfm.c: (dfm_close) Formatting change. (open_inline_file) Now passed a dfm_fhuser_ext to initialize; no longer allocates its own in inline_file. (open_file_r) Passes the local dfm_fhuser_ext to open_inline_file(). (open_file_w) Message fix. (read_record) Buffer reallocation strategy changed. Frees ext->line even in inline_file to prevent leaks. (dfm_put_record) Fixed bug where `ext' was cached before the file was opened and thus it would be NULL when the file really was open. (cmd_begin_data) Sets up inline_file basics itself, then calls open_inline_file() for the dfm_fhuser_ext. Formatting fix. * list.q: (write_line) Formatting fix. (clean_up) Minor strategy change. Sets proportional font after finishing cleanup. (determine_layout) Sets fixed font before writing regular headers, or after writing fallback headers. * modify-vars.c: (cmd_modify_vars) Frees variable lists for DROP and KEEP vars after using them. * postscript.c: (ps_init_driver) Frees x->family. (postopen) When loading fonts, free the temporary font name buffer after using it. (ps_text_set_font_by_position) Free temporary font name buffer after using it. (text) Fixed code that calculated `lig' so that `lig' always gets initialized. Formatting fix. * som-low.c: (get_cell_size, som_get_table_size) `prop_height' -> `font_height'. [GLOBAL_DEBUGGIGN] (check_table) Use arena_alloc() to allocate cells, not xmalloc(), so that the cells will get destroyed automatically. * sysfile-info.c: (cmd_sysfile_info) Frees the dictionary after using it. Tue Jun 3 23:33:22 1997 Ben Pfaff * ascii.c: (ascii_text_draw) Always sets metrics for strings that are drawn. * dfm.c: Comment fix. * list.q: Comment fixes. Include somP.h. Removed static vars table, n_columns, n_rows, part. New struct list_ext. New static var line_buf. (n_lines_remaining, n_chars_width, write_line) New functions. (cmd_list, list_cases) Rewritten. (begin_row, end_row, flush_table) Removed. (write_header, clean_up, write_varname, write_fallback_headers, determine_layout) New functions. * output.c: (outp_iterate_enabled_drivers) Minor reformat. * output.h: Comment fix. * postscript.c: Comment fix. (struct ps_driver_ext) Removed prop_size, fixed_size members; added font_size. All references changed. (ps_init_driver) Initializes font_size. Simplified space checking code. (static var option_tab[]) Removed prop-size, fixed-size; added font-size. (ps_option) Handles font_size. * som-high.c: Moved prototypes into somP.h. (som_init_driver) New function. (som_submit_table) Moved some code into new function som_init_driver(). (build_target) Moved some code into new function som_internal_eject_page(). (som_eject_page) Uses som_internal_eject_page(). (som_internal_eject_page) New function. * som-low.c: Moved prototypes into somP.h. * som.h: Formatting fixes. * somP.h: (struct som_driver_ext) Removed em_width; added prop_em_width, fixed_width. Mon Jun 2 14:25:25 1997 Ben Pfaff * Makefile.am: Added `localedir' definition. Added -DLOCALEDIR="..." to DEFS. Added -I. to INCLUDES. * ascii.c: (macro draw_line) Fixed capitalization. * ascii.c, autorecode.c, cases.c, cmdline.c, command.c, common.c, compute.c, count.c, data-in.c, data-list.c, data-out.c, descript.q, dfm.c, display.c, do-if.c, error.c, expr-evl.c, expr-opt.c, expr-prs.c, file-handle.q, file-type.c, filename.c, formats.c, frequencies.q, get.c, getline.c, glob.c, groff-font.c, hash.c, heap.c, include.c, inpt-pgm.c, lexer.c, list.q, loop.c, main.c, mis-val.c, misc.c, modify-vars.c, numeric.c, output.c, postscript.c, print.c, q2c.c, recode.c, rename-vars.c, repeat.c, sample.c, sel-if.c, sfm-read.c, sfm-write.c, sfmP.h, som-frnt.c, som-high.c, som-low.c, sort.c, split-file.c, sysfile-info.c, temporary.c, title.c, tokens.h, val-labs.c, var-labs.c, vars-atr.c, vars-prs.c, vector.c, vfm.c, weight.c: Marked strings for internationlization. * glob.c: [HAVE_LOCALE_H] Includes locale.h. Sun Jun 1 23:31:18 1997 Ben Pfaff * do-if.c, sort.c, val-labs.c: Comment fixes. * glob.c: (init_glob) Uncommented, updated i18n support. * arena.c, ascii.c, data-in.c, descript.q, error.c, expr-evl.c, expr-opt.c, expr-prs.c, filename.c, frequencies.q, groff-font.c, output.c, postscript.c, sfm-read.c, som-high.c, vars-prs.c: Made the declarations of macros taking arguments a lot nicer. Sun Jun 1 17:22:04 1997 Ben Pfaff * error.h: Removed CE, CW aliases for SE, SW. * q2c.c: Removed explicit streq() definition since it's duplicated in str.h. * approx.h, error.h, font.h, hash.h, misc.h, output.h, somP.h, stats.h, str.h, tokens.h: Made the declarations of macros taking arguments a lot nicer-looking of . Comment fixes. Sun Jun 1 12:02:06 1997 Ben Pfaff * cmdline.c: Comment fixes. (pick_compat) Changed return type to int. Now, instead of setting glob var `compat' to the emulation, returns the emulation. All references changed. (parse_command_line) Added terminating null to end of `long_options' array definition. (pre_syntax_message) Fixes. (usage) Shows the default emulation in the syntax message by calling pick_compat(). * getline.c: (getl_add_include_dir) Separates paths with PATH_DELIMITER, not DIR_SEPARATOR. * glob.c: (init_glob) Fixed references to DEFAULT_VER_PCP40, DEFAULT_VER_WIN61, DEFAULT_VER_X40. * output.c: (outp_configure_macro) Make earlier definitions for a particular key override later ones for the same key. Fri May 30 19:40:49 1997 Ben Pfaff * ascii.c: Comment fixes. * output.c: (outp_get_paper_size) s/STAT_OUTPUT_INIT_FILE/STAT_OUTPUT_PAPERSIZE_FILE/. Sun May 25 22:34:07 1997 Ben Pfaff * ascii.c, postscript.c, sfm-read.c, sfm-write.c, sort.c: Include . GNU libc 2 enforces this! * command.c: (parse_cmd) Fixed problem with `else' clause being paired with wrong `if'. Comment fix. Fri May 9 16:53:52 1997 Ben Pfaff * getline.c: [!HAVE_LIBREADLINE] (read_console) Changed blp_getline() to getline(). * output.c: (outp_eval_dimension) Changed the fix from last time; there was no variable `a'. * q2c.c: (get_line) Fixed boundary condition overrun bug. Mon May 5 21:58:22 1997 Ben Pfaff * output.c: (outp_evaluate_dimension) Fixed handling of negative numbers having fractional parts. Added case of a fraction without a whole-number part. Fri May 2 22:08:05 1997 Ben Pfaff * ascii.c: (ascii_text_get_font_position) Removed. * expr.h, exprP.h: Disabled debugging. * groff-font.c, postscript.c: Changed `groff' to `Groff' in several places. * output.h: (struct outp_class_struct) Removed text_get_font_position method. All references deleted. * postscript.c: Big change here. Fontmaps were completely eliminated because of a change in philosophy. Comment fixes. (struct ps_fontmap, ps2dit_map, font_family, dit2family_map) Removed. (struct ps_driver_ext) `position', `fontmap', `prop_name', `fixed_name' members removed. New members `prop_family', `fixed_family'. `family' member changed to type char *. (static var ps_fontmaps) Removed. () Removed. (ps_init_driver) Removed obsolete references, updated. Initializes `translate_x', `translate_y', `scale'. Doesn't read fontmap, of course. Refers to font names through internal_name rather than subversive means. Frees proper items. (static var option_tab[]) Removed `fontmap-file' option; renamed `fixed-font', `prop-font'. (ps_option) Corresponds to option_tab[]. (read_fontmap, release_fontmap, ps_to_dit, compare_ps2dit, hash_ps2dit, compare_dit2family, hash_dit2family, compare_family, hash_family) Removed. (postopen) Generates font names from family names. Gets PostScript font name properly. New prologue file comment `!!!' style. (ps_open_page) Adds translate_x, translate_y to BP prologue function; gives SF argument floating-point format. (ps_text_set_font_by_name) Doesn't try to map PostScript->Groff font name. Doesn't change font family. (ps_text_set_font_by_position) Generates Groff font name from font family name instead of through table lookup. (ps_text_set_font_by_family) Renamed `ps_text_set_font_family', all references changed. Reduced to simple string assignment. (ps_get_font_name) Removed. (ps_get_font_family) Reduced to string return. (text) Doesn't save `position' since it no longer exists. Ugly kluge to save font family--fix soon? (load_font) Removed PostScript name argument. Thu May 1 14:58:59 1997 Ben Pfaff * postscript.c: Comment fix. (ps_open_page) Puts scale factor in PostScript output. Sat Apr 26 11:49:32 1997 Ben Pfaff * Makefile.am: Distcleans q2c. Wed Apr 23 21:33:48 1997 Ben Pfaff * ascii.c: (delineate) Sets text size even if width is zero. * command.c: Comment fix. (static var cmd_table[]) Re-enabled EVALUATE command. (parse_cmd) Lotsa comment fixes. Fixed infinite loop in parsing of comments in script files. Now more liberal on criteria for performing a state transition--if *anything* happened correctly, not just if *everything* happened correctly. * data-out.c: (convert_F) Comment fix. Why in the fsck does Checker segfault on formatting large numbers and why in the fsck hadn't I noticed this before? * expr.h, exprP.h: No longer turn off GLOBAL_DEBUGGING. * list.q: (cmd_list) Commented out the actual output routine because of various problems. Probably will abandon the idea of using the general `crushed tables' for the LIST procedure. * temporary.c: (restore_dictionary) Sets var_by_name to NULL after clearing it. Allocates a new var_by_name dictionary before trying to add members to it. * vars-atr.c: [DEBUGGING] (dump_one_var_node) Removed argument `sib'. Changed type of `node' argument. [DEBUGGING] (dump_var_tree) Replaced avlwalk() with avl_walk_inorder(). (clear_variable) Only dumps the var tree if var_by_name non-NULL. [DEBUGGING] Only deletes the variable from var_by_name if that var non-NULL. Fri Apr 18 16:48:41 1997 Ben Pfaff * Makefile.am: Added include files to SOURCES. Added frequencies.q to EXTRA_DIST. Removed include/ from INCLUDES. Now includes rules for q2c. Added `boast' target. Fri Apr 18 15:42:22 1997 Ben Pfaff * Makefile.am: Maintainer-clean Makefile.in. * Makefile.am: Fixed redundant EXTRA_DIST line. * ascii.c: Comment fixes. (ascii_line_vert) Fixed overly aggressive range check. * display.c: Removed dead code. * list.q: Turn debugging on. (flush_table) New debug code. * sfm-read.c: (read_value_labels) malloc's the structure before trying to assign to its members. * sfm-write.c: Comment fix. * som-high.c: (som_submit_table) Sets som.t and som.d on each call to output_table(). (output_table) No arguments anymore--gets them through `som' global. New debug code. In crushed tables, now sets `htv' as well as `hv' to avoid bad confusion later. (dump_crush_page) New debug code. * som-low.c: (som_dump_crush_page) New debug code. Thu Mar 27 01:11:29 1997 Ben Pfaff All source files: Broke long lines into multiple lines. * ascii.c: (ascii_close_page) Uses host_system var in place of HOST_SYSTEM constant. * cmdline.c: (var syntax_message[]) Broke into pre_syntax_message[] and post_syntax_message[]. (usage) Outputs both parts, separated by driver list. * error.h: Fixed broken formatting. * expr-opt.c: (str_search, str_rsearch) New functions. * misc.c: (blp_getdelim) Removed. All references changed to `getdelim'. (str_search, str_rsearch) Removed. (memrmem) New function. * misc.h: (blp_getline) Removed. All reference changed to `getline'. * stat.h: New file. * filename.c: Includes "stat.h", not . (blp_getenv) Uses host_system var instead of HOST_SYSTEM constant. * output.c: (outp_list_classes) Changed output formatting. * sfm-write.c: (write_header) Uses host_system var instead of HOST_SYSTEM constant. (write_rec_7_34) Extracts version numbers from the version string. Untested. * sort.c: Includes "stat.h", not . * str.c: (strcasecmp) Removed. * title.c: (cmd_document) Uses host_system var instead of HOST_SYSTEM constant. * version.c: Generated on-the-fly by the Makefile instead of being static. * str.h: Comment fixes. Doesn't substitute for missing memmove or memcpy. [!HAVE_STRNCASECMP] Declares strncasecmp(). * version.h: Removed stray character. Comment fixes. (vars host_system, build_system) New vars. Mon Mar 24 21:47:31 1997 Ben Pfaff * Most source files: Changed formatting of copyright notice; fixed FSF address; reformatted to better conform to GNU standards; comment fixes. Added markups to prevent GNU indent from messing up my beautiful formatting :-). * q2c.c: (get_line) Ignores lines that begin with `/* *INDENT' so that GNU indent markups can be passed through without problems. Wed Feb 19 21:30:31 1997 Ben Pfaff * get.c: Turned off debugging. * glob.c: (init_glob) Turned on save-file compression by default. * sfm-write.c: (sfm_write_case) Fixed bug which resulted in less compression than was possible in save files. Sun Feb 16 20:57:20 1997 Ben Pfaff * data-out.c: (convert_F) Comment fixes. Debug message fixes. * frequencies.q: Removed Fiasco extensions. Updated calculation algorithms. Polished output format. (struct frq_info_struct) Removed members `max_degree', `min_n', all references removed. (macro frq_extensions) Removed. (static vars min_n, max_degree) Removed, all references removed. (internal_cmd_frequencies) Doesn't handle extensions. Doesn't calculate `min_n', `max_degree'. (postcalc) Passes new arg to dump_statistics(). (dump_full) Honor NOLABEL option. Buggy? Adds variable name title. (dump_condensed) Adds variable name title. (sum_freqs) Removed. (calc_stats) Updated calculation algorithm. (dump_statistics) Removed warning for too-few observations. Changed table formatting. Adds variable name title if passed new arg is nonzero. * output.h: Comment fix. * recode.c, sample.c, sort.c: Disabled debug code. * som-frnt.c: (som_set_value, som_set_float, som_set_text) Improved debug code. * var.h: (enum series frq_*) Removed Fiasco extensions. Sat Feb 15 21:26:53 1997 Ben Pfaff * command.c: Added PROCESS IF to command table. * Lots & lots of places, removed checks for NULLs preceding calls to free_expression(), which itself checks. * descript.q: Removed Fiasco extensions. Removed optimizations for non-weighted active files. Implemented some options. Finished polishing output format. Comment fixes. Merged `descript.g'. (static vars n_glob_miss_list, n_glob_valid, n_glob_missing, max_degree, min_n) Removed. (macro dsc_extensions) Removed. (struct dsc_info_struct) Removed `min_n' member, all references fixed. (internal_cmd_descriptives) Removed calculation of min_n, max_degree. Only deals with one `calc' routine instead of two flavors. (precalc) Eliminated redundancy. Updated for changes to descriptives_proc structure. (calc) Moved here from `descript.g'. Rewritten to calculate statistics via `moments about the mean' rather than by summing, summing squares, summing cubes, and so on. (postcalc) Rewritten for new-style statistical calculation. (display) Removed support for displaying variables across rows. No longer crushes the descriptives table. Removed ancient code. Added display of N, by variable and listwise. * descript.g: Removed; merged into `descript.q'. * expr-evl.c: (evaluate_expression) Now returns a double. For numeric results, it returns the result as well as storing it in the passed `value' structure if non-NULL. For string results it just returns 0.0 and it must be passed non-NULL. Many references to this function were optimized by use of this change, especially but not exclusively in `compute.c'. * frequencies.g: Comment fix. * glob.c: (glob var process_if_expr) New global var. * postscript.c: (static var option_tab[]) Corrected entry for `fixed_size'. (postopen) Sets x->size to x->prop_size. (ps_text_set_font_by_name) Sets font size as well as typeface for PROP and FIXED fonts. * sel-if.c: (cmd_process_if) New function. * sfm-write.c: (struct sfm_fhuser_ext) New member `n_cases'. (sfm_write_dictionary) Sets `n_cases' to 0. (sfm_write_case) Increments `n_cases'. (sfm_close) Attempts to seek the system file back to the header and write the number of cases in its proper slot. * som-frnt.c: (som_insert_table) Masks off expansion options since only SOPT_X_NORM seems to work sensibly. * som-low.c: (get_cell_size) Fixed bug when a table cell was sized with a `fixed' value of 2. * sort.c: (cmd_sort_cases) Cancels PROCESS IF. * sysfile-info.c: (cmd_sysfile_info) Doesn't display more than 10 value labels; uses SOPT_NONE instead of SOPT_X_BOTH. * var.h: (enum series dsc_*) Removed Fiasco extensions. (struct descriptives_proc) Removed `miss_noweight'; new members `X_bar', `M2', `M3', `M4', `min', `max'. * vars-atr.c: (discard_variables) Cancels PROCESS IF. * vfm.c: (close_active_file) Cancels PROCESS IF. (write_case) Doesn't process cases unselected by PROCESS IF. Fri Feb 14 23:32:58 1997 Ben Pfaff * glob.c: (glob var err) Removed. * sysfile-info.c: (cmd_sysfile_info) When adjusting table size, doesn't have to take into account number of value labels since they're in a subtable anyway. Also, doesn't display more than 10 value labels since we can't yet break pages in subtables. Tue Feb 4 15:15:50 1997 Ben Pfaff * som-frnt.c: (som_change_table_size) Simple change for elegance that shouldn't change behavior. (som_set_value) Comment fix. * som-high.c: (som_submit_table) Message fix. Wed Jan 22 21:54:00 1997 Ben Pfaff * command.c: Added SYSFILE INFO to command table. * file-handle.q: (fh_handle_filename) New function. * get.c: (save_trns_proc) Fixed a bug in padding of output data with spaces. * main.c: (parse) New return value for command functions, -3. * misc.h: Comment fix. * output.h: Comment fixes. (macro COMPONENTS) Removed. * postscript.c: (write_text) Modified literal_chars[] so that `(' and ')' are not written to the output in strings as literals. * sfm-read.c: (sfm_read_dictionary) New argument. (read_header) New argument. Sets the information structure's values from the header information. (read_variables) [__CHECKER__] Redefines isalnum()--some sort of bizarre Checker problem, I guess. (read_variables) Proper cleanup on lossage. * sfm.h: (struct sfm_read_info) New struct for use by sfm_read_dictionary(). * som-frnt.c: (som_create_table) New argument CREATE_FLAGS, currently used just for tables that can be dynamically resized and thus have to be allocated with arena_malloc() instead of arena_alloc(). All references changed. (som_change_table_size) New function. (som_insert_table) Bugfix: now inserts `cell', not `c'! * som-high.c: [GLOBAL_DEBUGGING] (check_table) Moved to som-low.c. (som_submit_table) [GLOBAL_DEBUGGING] Doesn't call check_table() any more. * som-low.c: (draw_cell) Calls draw_table_cell() for SCON_TABLE cells. (draw_intersection) Now takes an argument specifying the table in question. All references changed. (draw_table_cell) New function. (som_get_table_size) [GLOBAL_DEBUGGING] Calls check_table(). (som_get_table_size) Many nice new explanatory comments. [GLOBAL_DEBUGGING] (check_table) Moved here from som-high.c. * som.h: New enum series SOM_CREATE_* for use as create flags with som_create_table(). * str.h: Moved a comment here from TODO. * sysfile-info.c: New file. Reference implementation. Sun Jan 19 14:22:11 1997 Ben Pfaff * command.c: Added RENAME VARIABLES to table of commands. * data-in.c: (dls_error) Sets `cust_field'. (parse_N) Message fix. (parse_day_count) New function. (to_roman) Never outputs VX as a `short form' of V. (parse_month) Fixed parsing of Roman numerals. (parse_trailer) Message fix. (parse_DATE, parse_ADATE, parse_EDATE, parse_SDATE, parse_JDATE, parse_QYR, parse_MOYR, parse_WKYR, parse_DTIME) Issue a message if the date is invalid. (parse_SDATE) Fixed swapped day, year. (parse_JDATE) Fixed bug for dates in 1582. (parse_DTIME) Allows days not between 1 and 31. (parse_numeric) Makes local copy of f.type for easier usage. FMT_DOLLAR fixed. * data-out.c: (convert_F) When outputting as scientific, properly sets f.type as fp->type. (insert_commas) Fixed operator precedence problem with setting of nitems. Changed strcpy to memcpy (no null terminator). (convert_date) Fixed FMT_JDATE: added 1900 to year. (convert_CCx) Essentially rewritten, but now it works. * display.c: (cmd_display) Added DISPLAY FILE LABEL (undocumented feature of Fiasco). (display_documents) Implemented. * error.c: (glob var cust_field) New var. (vmsg) Displays cust_field as part of message classes DE and DW. * formats.c: (debug_print) Fixed to compile under updated dictionary format. * get.c: (cmd_get, cmd_save_internal) Close file handle on failure. * misc.c: (parse_format_specifier) Formatting fix. * modify-vars.c: (struct var_modification) Renamed `n_reorder' as `n_rename' for clarity. (cmd_modify_vars) Initializes `forward' and `positional' at appropriate times. Frees lists of vars to rename on failure. Comment fix. Frees memory on success. (rearrange_dict) Simplified `for' loop condition. * rename-vars.c: New file (reference implementation). * set.q: (internal_cmd_set) Fixed `emu' test condition. * sfm-read.c: (read_header) File label is created only if file label in file is not blank. (read_variables) Initializes `dict' local variable. (read_documents) Proper behavior on lossage. * sfm-write.c: (write_header) Doesn't blank out the file label (why was this here to begin with?!) * temporary.c: (save_dictionary) File label is copied only if non-NULL. Doesn't try to xstrdup() dictionary documents. Adapted so as to not irritate Checker. (free_dictionary) Only destroys var_by_name if non-NULL. * title.c: (cmd_file_label) Doesn't skip FILE, LABEL tokens. (cmd_document) Doesn't skip DOCUMENT token. Adds some header lines to the document, indents the document. Also, it works now. (add_document_line) New function. * var.h: (struct dictionary) Reordering. * vars-prs.c: (parse_variables) On lossage, only local_free()'s bits if it was allocated to begin with. Thu Jan 16 13:08:57 1997 Ben Pfaff * command.c: Added MODIFY VARS to list of commands. * configure.in: Updated custom macros for autoconf 2.12. Removed mmap reference; fixed termcap library reference. * display.c: (display_variables) Fixed a few bugs although it's still not well written. * error.c: [!__CHECKER__] (chkr_disp_call_chain) New function. (induce_segfault) Calls chkr_disp_call_chain() instead of inducing an actual SIGSEGV. * expr-opt.c: (evaluate_tree) Swapped order of arguments to str_search() and str_rsearch(). Fixed tests for matches on OP_INDEX and OP_RINDEX. * filename.c: (good_getcwd) Removed as the new libc for Checker doesn't contain this bug, apparently. * misc.c: (str_search, str_rsearch) Changed order of arguments for consistency with GNU memmem. (blp_getdelim) Changed `len' from `int' to `size_t'. * modify-vars.c: Reference implementation. * som-frnt.c: (zero_length) New global var. (som_create_table) Message fix. * som.h: Added gcc attributions to som_set_text(), som_output_text() prototypes. blank_line() refers to zero_length[] instead of a literal null string to suppress gcc warnings. * sort.c: (do_external_sort) Fixed fencepost error on lossage. (allocate_cases) Decrements x_max so the last element of x[] can be used by the algorithm. * var.h: Changed minor details of `variable' declaration. (struct modify_vars_proc) New struct. (struct variable) Added field p.mfv. * vars-atr.c: Comment fix. * vars-prs.c: (fill_all_vars) More optimal implementation. * vfm.c: (dump_splits) Sets the last byte of temp_buf to a null character, which it shouldn't have to do but printf() seems to read the null byte even though I supply a maximum length... Fri Jan 10 20:22:08 1997 Ben Pfaff * command.c: Removed command alias X for QUIT. (parse_cmd) Fixed comment parsing. * dfm.c: (struct dfm_fhuser_ext) Fields `len', `size' are now of type size_t. (read_record) Fixed references to len, size. (dfm_get_record) Restructured. * file-handle.h: (struct file_handle) Field `lrecl' now of type size_t. * file-handle.q: (internal_cmd_file_handle) Checks for nonpositive record length. * modify-vars.c: New file. Not complete. * set.q: (set_ccx) Fixed operator precedence problem regarding ^ and ==. * sfm-read.c: (bswap_flt64, read_header, write_variable) Fixed problems caused by int/size_t differences. * sort.c: (output_record, merge_once) Cast `size_t's to `int's in appropriate spots. * str.c: (strcasecmp) Fixed bug that cropped up when the strings being compared were of equal length. Thu Jan 2 19:08:23 1997 Ben Pfaff * command.c: Added DOCUMENT, DROP DOCUMENTS, FILE LABEL. * lexer.c: (get_dotted_rest_of_line) New function. * sel-if.c: (cmd_filter) Cannot choose string or scratch variables as filters. * sfm-read.c: (sfm_read_dictionary) Calls read_documents() to read type 6 records. Frees the dictionary properly. (read_header) Initializes the dictionary instead of letting read_variables() do it. Sets the dictionary file label from the system file. (read_documents) New function. * sfm-write.c: (sfm_write_dictionary) Calls write_documents() to write type 6 record if appropriate. (write_header) Writes file label from dictionary. (write_documents) New function. * temporary.c: (save_dictionary, restore_dictionary, free_dictionary) Properly handle new fields in dictionary struct. * title.c: (get_title) Returns after failure(). (cmd_file_label, cmd_document, cmd_drop_documents) New functions for new commands FILE LABEL, DOCUMENT, DROP DOCUMENTS. Untested. * var.h: (struct dictionary) New fields `label', `n_documents', `documents'. Wed Jan 1 22:08:10 1997 Ben Pfaff * command.c: Added FILTER to list of commands. * frequencies.g: [WEIGHTING] Removed test for weighting!=-1 since it's always true. * get.c: (cmd_save_internal) Removed weighting code since it's now handled by sfm-write.c. Properly commented out debug code. * glob.c: (glob var weighting) Removed. * sel-if.c: Comment fixes. (cmd_filter) New function. * sfm-read.c: (struct sfm_fhuser_ext) New field `weight_index'. (sfm_read_dictionary) Sets weighting variable direct in the created dictionary now. (Apparently we previously didn't support weighting on GET?) (read_header) Sets weight_index field in sfm_fhuser_ext from header read from disk. * sfm-write.c: (sfm_write_dictionary) Comment fix. (write_header) Now sets the weighting in the header from the passed primary dictionary instead of from the sfm_write_info. * sfm.h: (struct sfm_write_info) Removed field `weight'. * som-high.c: (dump_crush_table) Fixed a couple of assertions that broke on boundary conditions. * var.h: (struct dictionary) New fields `weight_var', `weight_index', and `filter_var'. (glob var weighting) Removed. This is now part of struct dictionary. All references changed; the less mechanical changes are described above. * vars-atr.c: (find_dict_variable) New function. * vfm.c: (static var filter_index) New variable. (open_active_file) Initializes filter_index from default_dict. (write_case) Calls proc_func() only if the filter variable is nonzero; this implements FILTER behavior. * weight.c: (static var weight_varname) Removed. (cmd_weight) Modified default_dict instead of glob vars. (update_weighting) Changed the signature to modify a dictionary instead of glob vars. Now returns the weighting variable. (get_weighting_variable) Removed; its function is absorbed by update_weighting(). (stop_weighting) Operates on a dictionary now. Wed Jan 1 17:00:59 1997 Ben Pfaff * sort.c: Removed debugging info from messages. (do_external_sort) Cleans up after itself by deleting the temporary directory on failure. (On success it is deleted by the input program.) (allocate_cases) Removed debug code. Added clean up code. (output_record) Removed debug code. (merge) Added code to close all the input files that are currently open. This is a likely location for bugs, because I'm not sure about boundary conditions. Removed an unnecesary heap_delete(). (merge_once) Removed input file "optimization" that in fact screwed up the rest of the code. Message and comment fixes. Sun Dec 29 21:36:48 1996 Ben Pfaff * error.c: [__CHECKER__] (induce_segfault) Flushes output streams. * heap.c: (heap_delete) New argument. * sort.c: Finished implementation of external sort. * vfm.c: (read_from_disk) Returns after a disk error. Sun Dec 22 23:10:39 1996 Ben Pfaff * sort.c: (static var state) Removed. (static vars max_handles, tmp_basename, tmp_extname, huffman_queue) New variables. (do_external_sort) Moved most code to new functions. Creates huffman_queue. (allocate_file_handles, allocate_cases) New functions. (static vars run_no, run_length, file_index, case_count) New variables. (output_record) Returns success. Now really writes to the output file. (begin_run, end_run) New functions. (write_initial_runs) Returns success. Initializes run_no to -1. Calls begin_run(), end_run() at appropriate times. Outputs debug messages. (write_to_sort_cases) Calls begin_run(), end_run() at appropriate times. (merge) New function. * heap.c, heap.h: New files. Hopefully in near-final form. Sat Dec 21 21:51:04 1996 Ben Pfaff * glob.c: Added write_active_file to global vars. * sort.c: Several new miscellaneous static variables. (cmd_sort_cases) Big comment fix. (perform_case_2) Renamed `do_external_sort' and completely rewritten. (case_2_proc_func) Removed. (output_record, write_initial_runs, write_to_sort_cases, compare_record) New functions. * vfm.c: [DEBUGGING] (index_to_varname) Excised bit rot. Tue Dec 17 18:57:59 1996 Ben Pfaff * sort.c: (perform_case_2) Changed the method for allocation of lots of memory--now allocates one case at a time in hopes that more cases can be allocated with heavily fragmented memory. * var.h: (write_active_file) New global var. * vfm.c: (procedure, close_active_file, write_case, SPLIT_FILE_procfunc) Now allow beginfunc, procfunc, and endfunc arguments to procedure() to be NULL. All references to procedure() that made use of dummy functions were changed to NULL functions. (open_active_file) If write_active_file is non-NULL, the output device becomes DEV_PGM (a new enum). (close_active_file) Sets write_active_file to NULL. (read_from_memory) Comment fix. (record_case) Calls write_active_file() when the output device is DEV_PGM. Sun Dec 15 15:32:16 1996 Ben Pfaff * sort.c: New file. * autorecode.c: (cmd_autorecode) Fixed parsing of options. Fixed checking for duplicate varnames. (recode) xmalloc()'s the transformation instead of arena_alloc()'ing it. (autorecode_trns_free) Destroys hash tables for each recoding specification. (autorecode_proc_func) Compares NULL to *vpp instead of vpp. * command.c: Added SORT CASES to cmd_table. (null_func, null_int_func) Prototyped. * descript.g: (calc_weight, calc_noweight) Computes own case number now. * frequencies.q: (dump_statistics) Fixed problem with too-few-cases warning message. * get.c: (cmd_save_internal) Handles weighting properly. * hash.c: (hsh_dump) Output format changed. (force_hsh_insert) Actually works now, prototype changed. * list.q: (static var case_num) New variable. (cmd_list) Initializes case_num. (list_cases) Increments case_num. * var.h: Added definitions for SORT CASES. Comment fixes. * vfm.c: Some definitions moved to new file vfmP.h. Comment fixes. `active' renamed vfm_active, `rep' renamed vfm_replacement, all references changed. (procedure) The procfunc no longer receives a case number. All references changed. (write_case) Subtle reordering. (SPLIT_FILE_procfunc) Counts cases differently. Slightly less redundant. * weight.c: (get_weighting_variable) New function. * vfmP.h: New file with definitions from vfm.c. Sat Dec 14 10:35:30 1996 Ben Pfaff * command.c: (FILE_TYPE_okay) Commented out some tests because they're clumsy and not yet needed. * var.h: Most *_trns structures moved to their respective source files. Some were moved into a new file, do-ifP.h. Comment fixes. (union any_trns) Changed to a typedef for trns_header. (struct input_program_pgm) Removed. * vars-prs.c: (parse_variables) Only local_free()'s bits if it was allocated in the first place. Fri Dec 13 21:30:53 1996 Ben Pfaff * autorecode.c: New file. * command.c: Added AUTORECODE to command table; re-enabled SET. * data-out.c: (convert_F) Handles infinities and NaNs properly. * error.c: (vmsg) Comment fixes. * hash.c: Comment fix. (hashpjw_d) New function. (hashpjw) Reimplemented as call to more general function hashpjw_d(). (internal_comparison_fn) Initializes pointers properly. (hsh_sort) [GLOBAL_DEBUGGING] New debugging code. (force_hsh_insert, force_hsh_find) New debugging wrapper functions. * main.c: (main) Message fix. * output.c: (outp_read_devices) Message fix. * set.q: Comment fixes. (custom_results) Implemented Wnd/X form of subcommand. (set_routing) New function. (internal_cmd_set) Implemented ERRORS, MESSAGES. * settings.h: (SET_ROUTE_*) New enum series. (set_results) Renamed set_results_file, all references changed. (set_messages) Removed. (glob vars set_errors, set_messages, set_results) New vars. * title.c: (get_title) Remembers to xstrdup() the result of get_rest_of_line(). * var.h: (arc_item, arc_spec, autorecode_trns) New structures for use by AUTORECODE. (union any_trns) New element `arc'. Fri Dec 6 23:53:47 1996 Ben Pfaff * command.c: (output_line) Removed references to set_screen. * error.c: (static var terminating) New var. (hcf) Sets terminating to 1. (vmsg) If terminating is nonzero, does not attempt to call hcf(). This prevents an infinite loop if an error occurs within hcf(). * expr-evl.c: (evaluate_expression) [__CHECKER__] Replaced case statement circumlocution with `case 42000' trick. (evaluate_expression) New support for OP_STR_MIS. * expr-opt.c: (evaluate_expression) [__CHECKER__] Replaced case statement circumlocution with `case 42000' trick. (dump_node) Handles OP_STR_MIS. * expr-prs.c: (MISSING_func, SYSMIS_func) Rewrote to handle string variables exceptions. (parse_function) Message fix. (ops[]) Added OP_STR_MIS. * expr.h: Added OP_STR_MIS to OP_* enum. Comment fixes. * exprP.h: [__CHECKER__] Removed case statement circumlocution. * glob.c: Removed set_scrnfile glob var. (init_glob) set_errorbreak set to 0 by default. * groff-font.c: Changed included files. (groff_read_font) Initializes font_arena local var correctly. (default_font) New function. * output.c: Comment fixes. (glob var disabled_devices) New variable. [GLOBAL_DEBUGGING] (static var iterating_driver_list) New variable. [GLOBAL_DEBUGGING] (reentrancy) New function. [GLOBAL_DEBUGGING] (outp_read_devices, outp_done, find_driver, outp_iterate_enabled_drivers) Calls to reentrancy(). (destroy_list) New function. (outp_done) Moved code to destroy_list(). (parse_options) Parses `listing', `screen', `printer' options internally. (configure_driver) Sets new `device' member of driver. (outp_iterate_enabled_drivers, outp_enable_device) New functions. * output.h: Comment fixes. New enum series OUTP_DEV_*. (struct outp_driver_struct) New member `device'. * postscript.c: (find_encoding_file) Doesn't display its own error messages. (default_encoding) New function. (switch_font) Calls default_encoding() if no encoding can be found. (text) Makes up a character metric if none exists for the desired character. (load_font) Properly copies a fallback filename. Calls default_font() for a font if none at all are known. * set.q: Comment fixes. Removed OUTPUT subcommand. (custom_listing) Calls outp_enable_device() to enable/disable listing device. (turn_screen_on) Removed. (internal_cmd_set) Calls outp_enable_device() to enable/disable screen, printer devices. * settings.h: Comment fixes. (glob vars set_output, set_printer, set_screen, set_scrnfile) Removed. * som-high.c: (som_submit_table, som_eject_page) Use outp_iterate_enabled_drivers() instead of iterating outp_driver_list directly. Wed Dec 4 21:34:17 1996 Ben Pfaff * data-in.c: (parse_EDATE, parse_SDATE) New functions. (parse_string_as_format) Handles new formats. (parse_numeric) Now handles DOT and PCT formats. * data-out.c: (convert_E, convert_F, insert_commas) Handle DOT format now. (convert_date) Handle EDATE and SDATE formats. (convert_CCx) Now if there's not room for the currency characters, converts it as F format if it's positive instead of giving up quickly. Also fixed save-and-restore bug with decimal point characters. (convert_format_to_string) Handles new formats. * misc.c: (formats[]) Added new formats. (convert_fmt_ItoO) Supports new formats. * sfm-read.c: (parse_format_spec) Supports new formats. Better data checking. New argument, all references changed. * sfm-write.c: (write_format_spec) Supports new formats. * var.h: New formats FMT_DOT, FMT_PCT, FMT_EDATE, FMT_SDATE. Comment fixes. Sun Dec 1 17:19:00 1996 Ben Pfaff * cmdline.c: Comment fixes. (parse_command_line) Changed return type to void. * data-in.c: (parse_string_as_format) Added FMT_CCA...FMT_CCE to switch. (parse_numeric) Handles international numbers (comma as decimal point). Some reformatting. * data-list.c: (parse_free) Default output format is now set_format instead of hard-coded F8.2. (read_from_data_list_list) Emits error message on undefined data only if set_undefined is nonzero. * data-out.c: (convert_E) Changes decimal point from period to comma if appropriate. Restructured. Better comments. (convert_F) Changes decimal point from period to comma if appropriate. (insert_commas) Major bug with handling of negative values fixed. Also, inserts periods instead of commas if appropriate. (convert_CCx) New function. (convert_format_to_string) Added FMT_CCA...FMT_CCE to switch. (num_to_string) Changed `.' to set_decimal. * dfm.c: Comment fixes. (dfm_close) Frees ext->line even in inline_file. (open_inline_file) New function. (open_file_r) When opening the inline file: now properly recognizes `BEGIN DATA.' line, and calls open_inline_file() to finish up. (read_record) Calls fh_close_handle() instead of dfm_close() to close the inline file. Makes a copy of the line getl_buf to avoid interlock problems. (dfm_get_record) Restructured. Now checks the return value of open_file_r(). (cmd_begin_data) Moved open code into open_inline_file(). Relaxed checking for use of inline file. No longer tries to close inline file. * error.c: (glob var error_already_flagged) New var. (vmsg) Message change. Now checks max number of errors/warnings, acts on it. * file-handle.q: (fh_handle_name) Now allows closing of inline_file. (fh_init_files) Reformatted. * get.c: (trim_dictionary) Checks SCOMP option instead of COMP. * getline.c: (getl_include) Fixed bug that popped up when called when file queue was empty. (read_console) Resets error_count, warning_count, error_already_flagged to zero. * glob.c: Many changes to update list of variables. (init_compat_dependent) Now this function is called whenever `compat' changes. It now sets set_seed only if it hasn't previously been referenced. It now calls lex_init_compat_dependent(). * include.c: (cmd_include_at) Frees temporary buffer instead of line buffer. (cmd_include) Doesn't make copy of include file name. * lexer.c: Comment fixes. (init_lex) Moved some code into new function lex_init_compat_dependent(). (lex_init_compat_dependent) New function. (hex_val) Simplified. (preprocess_line) Uses set_endcmd instead of hardcoding `.'. * main.c: Comment fixes. (main) Reformatted. * misc.c: (formats[]) Added FMT_CCA...FMT_CCE. (check_input_specifier) Disallows FMT_CCA...FMT_CCE. (convert_fmt_ItoO) Detects FMT_CCA...FMT_CCE. (setup_randomize) Sets set_seed_used. * set.q: Comment fixes. (custom_results) Conditionalizes on `compat'. (custom_log) Calls custom_journal(). (set_ccx) New function. (cmd_set) Calls init_compat_dependent() when `compat' changes. Calls set_ccx() to handle CCA...CCE. Sets set_grouping when set_decimal changes. Range-checks values for MITERATE, MNEST. Message fixes. * settings.h: Comment fixes. (struct set_cust_currency) New struct. (set_cc[], set_grouping, set_seed_used) New global vars. * var.h: (FMT_CCA...FMT_CCE) New output formats. (FCAT_OUTPUT_ONLY) New FCAT_* constant. Thu Nov 28 23:14:07 1996 Ben Pfaff * glob.c: Revised variables to correspond to settings.h. (init_glob) Initializes variables from settings.h properly. * set.q: Began long-overdue major revision to correspond to new philosophy. Most code changed. * settings.h: Mostly changed; reorganized, reordered, large new comment. Thu Nov 28 19:46:10 1996 Ben Pfaff * get.c: (cmd_save_internal) No longer forces compression off. * sfm-read.c: (read_compressed_data) If eof is reached when reading a new instruction octet, only signal error if we're in the middle of a case. * sfm-write.c: (COMPRESSION_BIAS) New #define. (struct sfm_fhuser_ext) New member `end'. (write_header) Refers to COMPRESSION_BIAS instead of magic 100.0. (ensure_buf_space) New function. (sfm_write_case) Reimplemented in order to support compression. (sfm_close) Writes out the remaining contents of the compression buffer if any. Wed Nov 27 23:18:35 1996 Ben Pfaff * command.c: Defined SAVE and XSAVE commands in command table. * common.h: second_lowest_value is of type flt64, not double. * file-handle.h: Comment fix. * get.c: Comment fixes. (static var `trns') New. (save_write_case_func, save_trns_proc, save_trns_free, null_func, cmd_save_internal, cmd_save, cmd_xsave) New functions. (dict_delete_run) Clears the variables and frees them now. (trim_dictionary) Sets default for compression. On KEEP subcommand, frees deleted variables as well as clearing them. Finally got the sense of the test for deleting all variables correct. [DEBUGGING] (dump_dict_variables) Message fix. * glob.c: (init_glob) set_compression set to 1 by default. * list.q: Properly #includes config.h. * misc.h: New macro REM_RND_UP. * settings.h: Comment fix. * sfm-read.c: (structs sysfile_header, sysfile_format, sysfile_variable; inline function bswap_int32) Moved to new file sfmP.h. (corrupt_msg) [__CHECKER__] No longer induces segfault. (sfm_read_dictionary) Fixed bug caused by failing to initialize var_by_index. (read_machine_flt64_info) Fixed some problems caused by confusion between flt64 and double types. (read_header) Message fix. (read_variables) Fixed set of cases in which we byte-swap sv.print and sv.write. Fixed confusion of flt64 and double. * sfm.h: (struct sfm_write_info) New. * som-high.c: (som_draw_title) Properly frees `s'. * temporary.c: (save_dictionary) Comment fix. * var.h: Comment fixes. New FMT_* enum, FMT_NUMBER_OF_FORMATS. (struct trns_header) Formatting fix. (struct save_trns) New. * vars-atr.c: (discard_variables) Comment fix. * sfm-write.c: New file, baseline release. * sfmP.h: New file, baseline release. Sun Nov 24 14:53:53 1996 Ben Pfaff * cmdline.c: (parse_command_line) `--version' output updated. (glob var syntax_message[]) Added my e-mail address. * file-handle.q, lexer.c, vfm.c: Changed many instances of `illegal' to `invalid'. * sfm-read.c: (struct sfm_fhuser_ext) New fields used as uncompression buffer. (sfm_close) Frees decompression buffer. (sfm_read_dictionary) Initializes decompression buffer. (buffer_input, read_compressed_data) New functions. (sfm_read_case) Restructured; now calls read_compressed_data() to handle compressed system file data. * var.h: Comment fix. Mon Nov 11 15:34:09 1996 Ben Pfaff * dfm.c: (dfm_close) Does not set h->{ext,class} because the caller handles it. * get.c: New comments. New static var `get_file'. (cmd_get) Now fully implemented. Calls discard_variables(); initializes fv and lv for all variables; new debug code; sets up the dictionary; sets up the input program. (read_from_get, cancel_get) New functions. * sfm-read.c: Comment fixes. (sfm_close) New static function. (sfm_read_dictionary) Properly sets up the class of the file_handle. No longer cares what size the data is in records of type 7. Also, on failure, properly cleans up the file_handle and free()s some stuff. (read_variables) No longer thinks it knows `nval' of the dictionary. Now sets p.get.fv, etc., instead of speculatively setting fv itself. (read_value_labels) Fixed off-by-one error in indexing of var_by_index[]. (sfm_read_case) New function. (sfm_r_class) New static var. * var.h: (get_proc) New struct. (struct variable) New member p.get. Thu Nov 7 20:52:28 1996 Ben Pfaff * get.c: Removed GTSV_OPT_MAP because of a misinterpretation of the manual's meaning. (rename_variables) New function. (trim_variables) Doesn't try to parse MAP any more. Removed debug code. Now properly reorders the dictionary on the KEEP keyword. * sfm-read.c: (read_value_labels) Fixed some bugs regarding garbage collection. * vars-atr.c: (clear_variable) New argument `dictionary *'. (rename_variable) New function. (free_val_lab) Reformatted. Thu Nov 7 17:29:16 1996 Ben Pfaff * var.h: Reindented entire file. Comment fixes. (glob vars var, var_by_name, nvar, N, nval, n_splits, splits) Removed. (glob var default_dict) New. (struct indirect_dictionary) Removed. * Many other source files were changed to add `default_dict.' before all references to the dictionary of the active file. * vars-atr.c: (make_indirect_dictionary) Removed. * glob.c: Reindented all variable declarations. Updated for changed var.h. Comment fixes. * temporary.c: (restore_dictionary, save_dictionary) Simplified because now we can mainly copy dictionary structs. * vars-prs.c: (is_dict_varname, parse_dict_variable, parse_variables) Takes dictionary instead of indirect_dictionary first argument. (parse_variables) Instead of calling make_indirect_dictionary, just sets DICT to &default_dict if DICT is NULL. Of course, lots of `*dict.' references had to be changed to `dict->'. Removed debug code. Thu Nov 7 15:48:52 1996 Ben Pfaff * get.c: Added GTSV_OPT_* series of enums. (trim_dictionary, dict_delete_run) New functions. [DEBUGGING] (dump_dict_variables) New function. (cmd_get) Calls trim_dictionary() to get dictionary fully set-up. [DEBUGGING] Calls dump_dict_variables() to display results. * glob.c: (cmp_variable) Now a public function declared in var.h. * sfm-read.c: Turned off debug code. Comment fixes. (read_machine_int32_info, read_machine_flt64_info) New functions to parse type 7 records. (sfm_read_dictionary) Properly byteswaps several fields now. Calls read_machine_*_info() to parse type 7 subtypes 3 and 4 records. [DEBUGGING] Dumps dictionary. (read_variables) Sets `index' field of variables created properly. Constructs avl tree of variables in dictionary. [DEBUGGING] No longer dumps dictionary. (read_value_labels) Properly byteswaps fields. [DEBUGGING] New debug code. [DEBUGGING] (dump_dictionary) No longer stubbed out. * temporary.c: (restore_dictionary) Destroys `var_by_name' glob var before destroying any variables just to save a little time. * var.h: (struct variable) Reordered in order to make name[] the first member; this makes pointers to `variable' pointers to the variable name, simplifying avl trees, etc. (struct indirect_dictionary) New struct. * vars-atr.c: (find_variable) Rewritten for efficiency. (make_indirect_dictionary, is_dict_varname, parse_dict_variable) New functions. (is_varname) Rewritten for efficiency. (parse_variables) New argument, which is a `dictionary *'. All references changed. This function now reads variable names from the dictionary passed, or from the default dictionary if NULL. Tue Nov 5 18:34:59 1996 Ben Pfaff * misc.h: Added new macro DIV_RND_UP to perform integer division, rounding up. Changed many references to ROUND_UP to use this instead. * sfm-read.c: Includes avl.h. (corrupt_msg) Induces a segfault under Checker. (macro assertive_bufread) New. Many references to bufread() now use this instead. (sfm_read_dictionary) Split up into several functions. Added code to read dictionary records following the the type 2 records. Not quite complete. New variable `var_by_index'. (read_header, read_variables) New functions extracted from sfm_read_dictionary(). (read_value_labels) New function. (bufread) Checks ferror() if fread() doesn't return the expected value; if ferror() is zero it's just EOF. (dump_dictionary) Stubbed out. * BTW: The source code now exceeds 50000 lines! Mon Nov 4 22:03:28 1996 Ben Pfaff * command.c: Added GET to cmd_table[]. * list.q: Removed reference to alloca headers. (cmd_list) Gave prototype. * sfm-read.c: Added DEBUGGING comments. (sfm_read_dictionary) Checks bias correctly. Sets dict->var_by_name to NULL. Calculates long_string_count correctly. realloc's dict->var[] array to minimum size. [DEBUGGING] Calls dump_dictionary. [DEBUGGING] (dump_dictionary) New function. * temporary.c: (save_dictionary) Sets var_by_name to NULL. (restore_dictionary) If the dictionary contains a non-NULL var_by_name, uses that instead of generating one. (free_dictionary) Destroys var_by_name. * var.h: (struct dictionary) Added field `var_by_name'. * get.c: New file, not complete. Sun Nov 3 12:24:36 1996 Ben Pfaff * mis-val.c: New enums MV_NOR_*. New struct num_or_range. (parse_num_or_range) New function. (parse_numeric) Reimplemented in order to support LOW THRU and THRU HIGH missing values. * output.h: [__GNUC__>1 && __OPTIMIZE__] (width, height) Made __attribute__((const)). * q2c.c: (get_token) Merged isdigit || isalpha into isalnum. * sfm-read.c: Finished reference implementation. * sfm.h: Includes var.h. * var.h: Comment fixes. (struct `variable') Reordered some fields. * vars-atr.c: (is_num_user_missing) Added support for MISSING_* constants added previously. Wed Oct 30 17:13:08 1996 Ben Pfaff * common.h: Comment fixes. Added declaration of `second_lowest_value' as variable or macro. Made `compat_type', `pgm_state_type' into anonymous enums. * display.c: Comment fix. * glob.c: [ENDIAN==UNKNOWN] Added definition for `endian' global var. [!defined SECOND_LOWEST_VALUE] Added definition for `second_lowest_value' global var. (compat, pgm_state global vars) Changed types to `int'. (init_glob) Initializes `second_lowest_value'. * sfm-read.c: Continued work, not complete. * var.h: Added new MISSING_* constants to handle LOWEST and HIGHEST. Sat Oct 26 23:06:06 1996 Ben Pfaff * sfm-read.c: New file, not complete. * cases.c: (vec_insert) Changed vector expansion algorithm. (vec_delete) Fixed bug that screwed up deletion sometimes, it was mucking up the RECODE transformation in particular. (envector) Harmless change in notation. dfm is now fairly well tested again. * dfm.c: (dfm_get_record) Only returns ext->ptr if ext is non-NULL--duh. (cmd_begin_data) if(ext->line) replaced by if(ext && ext->line). * recode.c: Comment fix. * sfm.h: Interface should be fairly final now, or at least for a day or so... * vfm.c: [DEBUGGING] (index_to_varname) New function. (open_active_file) [DEBUGGING] Translates ccase indices into variable names now to make it easier to understand what's really going on. Sat Oct 26 20:46:31 1996 Ben Pfaff * data-in.c: Comment fix. * data-list.c: Includes dfm.h. (do_reading) Uses new function dfm_push_cust(). * data-out.c: (convert_time, convert_WKDAY, convert_MONTH) Added `return 1;' at end. * file-handle.h: Completely changed. Some parts split off into new file dfm.h. Implemented in file-handle.q. (enum FH_*) Removed. (struct fh_ext_class) New struct. (struct file_handle) Retained only these fields: name, norm_fn, fn, recform, lrecl, mode. New fields class, ext. (get_handle_by_name, get_handle_by_filename, parse_file_handle, close_handle, handle_name) Added `fh_' prefix to name, all references changed. * dfm.h: New file, implemented in dfm.c. (get_record, put_record, fwd_record, bkwd_record, set_record, get_cur_col) Functions moved from file-handle.h, now prefixed with `dfm_'. (dfm_push_cust) New function. * sfm.h: New file. Incomplete. * dfm.c: All functions adjusted/rewritten for new dfm/fhp interface. Functions reordered, comments changed. Not well tested, probably full of bugs. (struct dfm_fhuser_ext) New struct. (dfm_close) New function. (open_file_r) Pickier about finding `BEGIN DATA.' line. (open_file_w) User messages changed. (get_record) Comment fixed. (read_record) Increments ext->ln even for inline_file. Calls dfm_close() for inline_file when `END DATA.' encountered. (dfm_get_record) Experimental restructuring. (dfm_push_cust) New function. (cmd_begin_data) Detects whether the inline file was fully read by checking whether it is still open; detects whether it was read at all by checking whether the line number is greater than zero. * file-handle.q: All functions adjust/rewritten for new dfm/fhp interface. Functions reordered, comments changed. Not well tested, probably full of bugs. (init_file_handle) Removed initializers for obsolete fields, added new fields. (fh_close_handle) Much simpler, now mainly calls the class function. (fh_init_files) Renamed inline file internal filename. * file-type.c: Includes dfm.h. (read_from_file_type) Doesn't use dfm internal state anymore. * inpt-pgm.c, print.c: Include dfm.h. * recode.c: (internal_cmd_recode) Casts strlen() return value to int in comparison with other int. * som-high.c: (build_target) Fixed operator precedence problem in if statement (& versus ==). Sat Oct 26 10:39:25 1996 Ben Pfaff * dfm.c: (read_record) Can now read fixed-length records; not tested. (put_record) Can now write fixed-length records; not tested. * file-handle.h: FH_* defines changed to enums. New enum series FH_RF_*, FH_MD_*. (struct file_handle) New members recform, lrecl, mode. * file-handle.q: Parser changed. (internal_cmd_file_handle) Added support for new /RECFORM, /MODE, /LRECL subcommands. These are compatible with Windows. (init_file_handle) Initializes recform, mode fields. * q2c.c: (get_line) When outputting `!' comment lines, now increments the output file line number so that `#line' directives are correct. (make_identifier) New function that converts an arbitrary string into a valid C identifier. (dump_vars) Calls make_identifier() in two places in order to suppress some errors for bad identifiers. (make_match) Allows TRUE as synonym for YES and FALSE as synonym for NO. Allows numbers to be prefixed by underscores to make them acceptable C identifiers but still to be parsed as numbers by the Fiasco lexer. Thu Oct 24 20:13:42 1996 Ben Pfaff * command.c: Re-enabled RECODE, SAMPLE, SELECT IF. * dfm.c: Comment fixes. (get_record) Gives error if file handle was opened for writing. (open_file_w) New function. (read_record) Uses strncasecmp if available. Improved error messages, comments. (put_record) New function. * file-handle.h: Moved function comments into dfm.c and file-handle.q. Comment fixes. Removed declarations of tilde_expand() and normalize_filename(). (struct file_handle) Changed `open' from boolean to enumerated field to allow for three states--closed, open for reading, open for writing--all references changed. * file-handle.q: Includes filename.h. * print.c: (CMD_* enums) Renamed PRT_* and moved into var.h; all references changed. (alloc_line) Makes allowance for line terminator characters in calculations. (print_trns_proc) Now handles OUTFILE, WRITE differences. (print_space_trns_proc) Handles OUTFILE differences. * recode.c, sample.c: Comment fixes. * var.h: (struct print_trns) Changed boolean field `eject' to bitmapped field `options'; all references changed. New enums PRT_* for use with this field. * exception.h, test-exception.c: Removed. Thu Oct 24 17:47:14 1996 Ben Pfaff * ascii.c: (delineate) Turned off debug output. * common.c: [Checker and Linux] (__assert_fail, __eprintf) Moved to error.c. * data-in.c: (parse_string_as_format) Sets the entire string value to spaces, not just the short string part of it. Is this correct now? * data-out.c: (convert_date) Fixed DATETIME format problems with decimal places, removed debug code. * dfm.c: (open_file_r) Fixed bug where an error would occur in the middle of parsing BEGIN DATA that would cause the lexer to read from a wild pointer `prog'; now calls new function preprocess_line() in lexer.c. * error.c: [__CHECKER__] (hcf) Calls induce_segfault() on improper termination. [Checker and Linux] (__assert_fail, _eprintf) Moved from common.c. Now call induce_segfault() to induce the segfault. (induce_segfault) New function. * expr-opt.c: Comment fix. (parse_sysvar) New function. (parse_primary) Added system variable support--calls parse_sysvar(). (global var ops) Added OP_CASENUM operator. * expr.h: Comment fixes. (OP_* enum) added OP_CASENUM operator. (struct casenum_node) New struct. (union any_union_union) New member `cas' of type `casenum_node'. * glob.c: (global var last_vfm_invocation) New var. (init_glob) Initializes last_vfm_invocation. * lexer.c: (lookahead) Fixed reversed condition on if statement. * getline.c: (get_line) Split into get_line() and preprocess_line(). (preprocess_line) New function. * var.h: Declares last_vfm_invocation. * vfm.c: (procedure) Sets last_vfm_invocation. Wed Oct 23 21:53:43 1996 Ben Pfaff * command.c: (parse_cmd) Fixed bad assertion related to lookahead(). * data-in.c: (parse_month) Implemented to parse months according to full interpretation of standard. (to_roman) New function. (parse_wk_delimiter) Bug fix (forgot to skip `WK' in string). (parse_weekday) Bug fix (forgot to skip all the day name). * data-list.c: (read_from_data_list_fixed) Fixed bug that screwed up parsing of multirecord data items. Also fixed user message. * data-out.c: Comment fix. (year2, year4, convert_date, convert_time, convert_WKDAY, convert_MONTH) New functions to support time & date output. (convert_format_to_string) Calls new time & date output routines. * expr-prs.c: (nary_num_func) Found a bug, but didn't fix it yet. * lexer.c: (lookahead) Noted a previously unnoticed caveat in comment. * main.c: [DEBUGGING] (dump_token) Updated to handle getline.h. * misc.c: (global var formats) Fixed declarations of DATETIME, TIME, DTIME. * postscript.c: (text) Fixed a pair of bugs in the reallocation of the output_char buffer. * vars-prs.c: (parse_DATA_LIST_vars) Fixed a failure to free memory bug. Fixed user messages. Tue Oct 22 17:27:04 1996 Ben Pfaff * Removed #pragma argsused from lots of places. * data-in.c: Implemented zoned decimal and time-date formats. Untested. This is a huge chunk of code--maybe 1000 lines and 50 new functions. * data-out.c: Implemented zoned decimal format. * expr.h: Moved yrmoda() declaration here from exprP.h. * misc.c: (global var formats) Minor fixes--added FCAT_SHIFT_DECIMAL to formats N and Z. (convert_fmt_ItoO) Added support for format Z. * som-frnt.c: (som_set_value) Fixed bug regarding string values. Mon Oct 21 20:39:59 1996 Ben Pfaff * command.c: (parse_cmd) [GLOBAL_DEBUGGING] Inserted call to som_check_workspace() that is activated between commands. * data-list.c: (dump_fixed_table, dump_free_table) Finished these for good, I hope. * list.q: (begin_row) Changed title expansion style from SOPT_X_VERT to SOPT_X_SHSP. * som-frnt.c: Now includes `somP.h'. (som_push_workspace, som_pop_workspace) New functions that, taken together, form a solution to the recursive table building problem mentioned yesterday. Surrounded every table output routine throughout the program with calls to these functions. [GLOBAL_DEBUGGING] (som_check_workspace) New function. (som_create_table) Checks that there's an active workspace. (som_destroy_all_tables, som_crush) Removed. * som-high.c: (global var som_preserve_tables) Removed, all references deleted. (som_submit_table) Checks that there's an active workspace. (dump_columnated_table) Doesn't columnate tables that would have just one row per column. (dump_crush_page, som_dump_crush_page) Removed debugging code. (som_dump_crush_page) Moved row number labels from left side of tables to right side. (som_get_table_size) Added support for SOPT_X_SHSP. * som.h: New cell expansion type SOPT_X_SHSP. * somP.h: (global vars arena_stack, n_arena_stack, m_arena_stack) New vars. (global var curtab_arena) Moved from som-frnt.c. Sun Oct 20 13:45:28 1996 Ben Pfaff * ascii.c: [GLOBAL_DEBUGGING] (SUPPRESS_WARNINGS) New debug option that causes bad location warnings to be suppressed. (delineate) Saves current font when calling draw_text(); fixed handling of NULLs when backing up. Also fixed line-wrapping bug. * command.c: Re-enabled `LEAVE', `NUMERIC', `PRINT', `PRINT EJECT', `PRINT FORMATS', `PRINT SPACE', `STRING', `TITLE', `WRITE'. * common.c: Added code to cause assertion failure to dump core when run under Checker. * data-list.c: (dump_fixed_table) Fixed some inconsistencies, but there are still bugs. * glob.c: (__eprintf) Removed. * list.q: Inserted som_preserve_tables kluge that prevents tables from being thrown away due to recursive table building through som_output_line being called from a transformation during the LIST procedure invocation. This is a general problem that must be solved in a better way since it applies to all procedures in general. (begin_row) Changed title options to SOM_X_VERT from SOM_X_BOTH. (flush_table) Removed SOM_TOPT_PRESERVE from submission options. * numeric.c: Fixed several errors in the form of msg() calls. * print.c: Updated for use of som. (dump_table) Reimplemented. (print_trns_proc) Calls som_eject_page() instead of eject_page(). Calls som_output_text() instead of outs_line(). * som-frnt.c: (som_destroy_all_tables) Sets som_preserve_tables to 0. (som_output_text) Function moved from som-low.c. Interface changed. * som-high.c: (som_preserve_tables) New global public variable declared in som.h. (som_submit_table) Destroys the tables only if som_preserve_tables is 0. (paginate_horizontally) Bugfix: sets som.mpw even if there's only one subrow per row. Now labels subrows if there's more than one subrow per row. (dump_crush_table) Added wishlist comment. (som_eject_page) New public function declared in som.h. * som-low.c: (som_dump_crush_page) Draws row labels if there's more than one subrow per row. (som_output_text) Moved to som-frnt.c. * som.h: (SOM_TOPT_PRESERVE) Removed. * title.c: (get_title) Changed interface. (cmd_title) Changed `title' to `outp_title'. (cmd_subtitle) Changed `subtitle' to `outp_subtitle'. Sun Oct 20 09:04:15 1996 Ben Pfaff * list.q: (flush_table) Conforms to new partial options in som_submission_form. * som-high.c: (paginate_horizontally) Changed form of subrow number labels. (build_target) Omits spacing before table if SOM_TOPT_PARTIAL_OMIT_TOP is selected. (dump_crush_page) Changed interface. Only trims bottom rule if SOM_TOPT_PARTIAL_OMIT_BTM is not selected. (dump_crush_table) Handles partial tables. (output_row_label) New function. (som_dump_crush_page) Emits subrow number labels. Draws vertical rule on the right edge of narrow subrows. * som.h: Changed SOM_SUB_PARTIAL_* series of submission type constants to a series of SOM_TOPT_PARTIAL_* submission options. All references updated. Fri Oct 18 19:46:49 1996 Ben Pfaff * misc.c: Comment fix. * som-high.c: (examine_table) Treats crushed tables separates for purpose of determining header size. (paginate_horizontally) Allots space for line numbers in crushed tables with lots of subrows per row. Calculates the `maximum page width', the width of the widest horizontal page. (build_target) Removed trim argument; all references changed. Stricter assertions. (dump_crush_page) New function. (dump_crush_table) Reimplemented. * som-low.c: (som_dump_page) Uses new RULE_ROW &c. constants. (som_dump_crush_page) Reimplemented, interface changed. * somP.h: Many many new helper macros for use with crushed tables. (global var som) Removed `tv', `cum_y' members; all references removed. New members `mpw', `digit_space'. Sun Sep 29 19:37:03 1996 Ben Pfaff * arena.c: (arena_alloc) [!DISCRETE_BLOCKS] Removed `size' variable, changed to constant 1024. (arena_ca_strdup) Changed `sizeof(a_string)' to `sizeof(c_string)'. (arena_ca_strdup) [!DISCRETE_BLOCKS] Changed bad cast from `(c_string *)' to `(char *)'; this fixed some offset problems. * filename.c: (readlink_malloc) Changed initial allocation from 100 bytes to 128. (good_getcwd) Changed from xmalloc() to local_alloc(); removed comment. * postscript.c: (read_fontmap) Fixed leak by changing &owner to &fm->owner in several places. * som-high.c: (output_table) Changed interface to rest of world. (examine_crush_table) Removed. Crushed tables are re-broken now, in preparation for rewrite. * som.h: Comment fix. Sat Sep 28 21:28:07 1996 Ben Pfaff * ascii.c: (ascii_init_driver) Disposes of x->file.filename and x itself in the cleanup stage. * descript.q: (display) At least temporarily, changed the table format to a crushed table. * list.q: (begin_row) At least temporarily, added horizontal lines between cases. * som-high.c: (examine_crush_table) Sets som.hh to the width of the horizontal "headers," that is, to the width of the far left and far right rules. (justify_pagination) Sets som.th to the width of the widest row in the crushed table. Fixed inner loop off-by-one error. * som-low.c: (som_dump_crush_page) Added code to draw horizontal rules. * somP.h: Comment fix. Fri Sep 27 20:08:39 1996 Ben Pfaff * filename.c: (open_file_ext) Now, doesn't set f->file to NULL before closing it; also, opens the constructed filename `s' instead of f->filename. * postscript.c: Moved initialization of x->loaded, x->prop, x->fixed, x->current, also the add_encoding() calls, into postopen(). (preclose) Destroys x->combos; sets x->loaded, x->combos to NULL; sets x->last_font to NULL; sets x->next_combo to zero. * som-high.c: (crushed_row_height) Moved definition farther up. (som_submit_table) Doesn't calculate line width, font size until after calling open_page(), to accomodate changes to PostScript driver. (vert_headers) Removed; equivalent functionality moved to examine_table(), examine_crush_table(). (justify_pagination) Replaced with different algorithm. (dump_crush_table) Bugfix that caused tables to fail to be clipped at the bottom of the page. Thu Sep 26 22:20:26 1996 Ben Pfaff * command.c: Added cmd_list back into cmd_table. * freq.c, frequencies.q, repeat.c, list.q, vars-atr.c, vfm.c: Comment fix: `#define DEBUGGING' --> `#define DEBUGGING 1'. * list.q: (flush_table) Updated to new som_submission_form format. * som-frnt.c: Comment fix. * som-high.c: Changed `#endif' to `#undef EXTERN'. (output_table) Calls som_get_table_size() directly; handles crushed tables. (examine_crush_table) New function; calls vert_headers(). (examine_table) Moved some code into new function, vert_headers(). (justify_pagination) New function. (dump_plain_table) Removed `static' from `cy'. (dump_crush_table) New function. * som-low.c: (som_dump_crush_page) New function. * som.h: Comment fixes. (enum SOM_TOPT_CRUSH) New. (SOM_SUB_PARTIAL_BEG, SOM_SUB_PARTIAL_MID, SOM_SUB_PARTIAL_END) Temporarily set to zero to make do with LIST procedure. * somP.h: Re-ordering. Wed Sep 25 19:36:11 1996 Ben Pfaff * som.c: Split into som-frnt.c, som-high.c, som-low.c. * somP.h: New file for use by som-high.c, som-low.c. * q2c.c: Added definition for VME. (get_line) Now dumps `!' comment lines to the output file verbatim. * crosstabs.q, descript.q, file-handle.q, frequencies.q, list.q, set.q: Changed format of `!' comment lines. Tue Sep 24 18:39:09 1996 Ben Pfaff * All source files: Added copyright notice. * common.c: (xmalloc, xrealloc, xstrdup) Cast size_t's to unsigned longs in msg() calls. * con32s.c: (xmalloc, xrealloc) Updated from common.c. * q2c.c: (xmalloc, xrealloc, xstrdup) Updated from common.c. Sat Sep 21 23:16:31 1996 Ben Pfaff * output.c: (outp_read_devices) Changed criteria for distinguishing different types of lines. Fri Sep 20 22:52:28 1996 Ben Pfaff * cmdline.c: Changed syntax message. * filename.c: (good_getcwd) Bug fix (?). (normalize_filename) [__BORLANDC__] Uses _fullpath() library function. (search_path) Appends DIR_SEPARATOR to directory name only if it does not already end with one. * glob.c: Checks STAT_PAGER envvar before PAGER. * output.c: Checks environment variables instead of just local macros. Tue Sep 10 21:39:00 1996 Ben Pfaff * arena.c: (arena_destroy) Swatted a subtle bug that cropped up when the pointer passed to the function was within the arena itself, so that it couldn't properly be set to NULL _after the arena was freed_. * command.c: Re-enabled DISPLAY. * display.c: Rewritten to handle tables. Untested. * filename.c: (search_path) Fixed memory leak. * frequencies.q: (cmd_frequencies) Frees v_variables. (postcalc) Calls cleanup_freq_tab() after displaying statistics. (cleanup_freq_tab) New function to garbage collect. (dump_full) Elegantized. * main.c: New comment. * output.h: New tag for tagged quotes: TAG_NEWLINE. * postscript.c: Comment fix. (release_fontmap, free_font_entry) New functions. (ps_init_driver) Sets free_font_entry() as the freefunc for hashtable `loaded'. Calls release_fontmap() when destroying a driver; also frees the output filename; also frees the ps_driver_ext block. (free_ps_encoding) Frees the filename as well as the encoding block. (output_encodings) Frees the line buffer and pops the msg-filename stack. (read_fontmap) Frees the fontmap filename and the line buffer. (postopen, preclose) Misc. garbage collection fixes. (ps_open_page) Destroys the `combos' hash table; sets `last_font' to NULL; this fixes some output problems. (text) Handles TAG_NEWLINE. Untested. * som.c: (cell_byte_size) Merged SCON_VALUE and SCON_TEXT cases. (som_set_string) Removed. All references changed to `som_set_text'. (som_set_text) Rewritten. New interface. More general. * som.h: Minor format changes. (struct som_value_cell) Removed; all references changed to `som_text_cell'. (enums SOT_*) Changed. Mon Sep 9 21:43:13 1996 Ben Pfaff * command.c: Re-enabled SPLIT FILE. * postscript.c: Comment fix. * som.h: Added `SOT_NONE'. * split-file.h: (cmd_split_file) Removed superfluous parenthesis. * vfm.c: (dump_splits) Reimplemented. Sat Sep 7 22:35:12 1996 Ben Pfaff * Compiled the project under gcc 2.7.2, which gave some new warnings. This led to many additions of casts from unsigned to int sprinkled throughout the code. * arena.c: Many uses of `unsigned' changed to `size_t'. * command.c: Added END FILE, END REPEAT to command table. (var cmd_end_repeat) Renamed cmd_end_repeat_p. (find_command, FILE_TYPE_okay) Not commented out anymore. (parse_cmd) Calls FILE_TYPE_okay again. (output_line) Added calls to som_output_text() to put the line in the output files. * common.c: (macro VME) Format changes. (xstrdup) Asserts that its argument is not NULL. * data-list.c: Implemented dump_fixed_table(). * inpt-pgm.c: Formatting changes. Comment changes. (end_case_proc) Renamed end_case_trns_proc. (cmd_end_file, end_file_trns_proc) New functions. * misc.c: Many uses of `int' and `unsigned' changed to `size_t'. * misc.h: (local_strdup) New macro corresponding to strdup() but allocating its data through local_alloc() if possible--that is, if GNU C is in use. * postscript.c: Comment changes. (quote_ps_name, quote_ps_string, output_encodings) New functions. (output_line, add_string) New macros supporting output_encodings(). (postopen) Fixed contents of ${fixed-font} and ${prop-font} substitution vars. Calls output_encodings() when a line consisting of `!encodings' is encountered. (preclose) Some code moved into quote_ps_string(). (dump_line) Changed into macro supporting dump_fancy_line(). (switch_font) Now outputs DSC "%%IncludeResource: font (...)" command when appropriate. (write_text) Fixed `literal_char' array (I think it's fixed, at least.) (text) Fixed bug when width was zero. Now exits immediately on zero height_left. Now, when executing `goto restart;', checks that cp `if(px!=-1 || py!=-1)'. (build_target) Only inserts spacing if SOM_TOPT_SPACING not selected. (som_text_table) Removed. (som_output_text) New function. * som.h: (struct som_submission_form) Removed `header', `reuse', replaced with bitmapped field `options'. (SOM_TOPT_*) New enum set for som_submission_form.options. (SOT_*) New enum set for som_output_text(). * temporary.c: (copy_variable) When copying the var label, only calls xstrdup() if it's non-NULL. * var.h: (enum type `vartype') Removed; all references changed to `int'. * vars-atr.c: (init_variable) Changed local var `nbytes' from `int' to `size_t'. Thu Sep 5 22:05:56 1996 Ben Pfaff * font.h: Comment changes. * groff-font.c: (groff_read_font) Initializes `name' field to NULL. Handles `encoding' field. * hash.c: (hsh_dump) [GLOBAL_DEBUGGING] Output formatting changes. * postscript.c: (struct font_entry) Removed `position' field. (struct ps_font_combo) New struct. (struct ps_driver_ext) Removed field `next_position'. New fields `combos', `next_combo'. `last_font' field changed from `font_entry *' to `ps_font_combo *'. (ps_init_driver) Reformatted; handles new fields. When OPO_AUTO_ENCODE is set, adds the two default fonts' encodings to the encoding list. (get_encoding, find_encoding_file) New functions. (add_encoding) Some code moved out into find_encoding_file(). (postopen) Changed value for ${title}. (preclose) Sets `loaded' field to NULL after destroying the hash table. (ps_open_page) Added comment. Inits the `combos' and `next_combo' fields. (ps_text_set_font_by_position) Figures out the current family if not known. (compare_ps_combo, hash_ps_combo, free_ps_combo) New functions. (switch_font) Implemented. (write_text) Calls switch_font() more often. Format changes. #undefs its macros after they're no longer useful. (text) Changed `continue' at one point to a jump to the top of the loop because we don't want `separate' reset to 0 at that point. (load_font) No longer sets `position' in the font_entry created. Wed Sep 4 21:45:35 1996 Ben Pfaff * font.h: (struct font_desc) New member `encoding', which is not properly handled yet. * glob.c: (init_glob) Some new i18n code, which is probably screwed up. * output.c: (outp_read_devices, outp_get_paper_size) Changed `size' local from `int' to `size_t'. * postscript.c: New driver configuration parameter `auto-encode'. New enums OPO_AUTO_ENCODE, ODA_COUNT. (struct font_entry) New member `position'. (struct ps_driver_ext) Reordered. New hash table member `encodings'; new members `next_position', `next_encoding', `last_font'. Members `current', `prop', `fixed' changed from type `font_desc *' to `font_entry *'; all references changed. (struct ps_encoding) New struct. (read_ps_encodings, compare_ps_encoding, hash_ps_encoding, free_ps_encoding, add_encoding) New functions. (ps_init_driver) Added OPO_AUTO_ENCODE to default x->output_options. Initializes new members of ps_driver_ext. Changed default value for prologue_fn, encoding_fn. Calls read_ps_encodings after loading default fonts. (option_tab[], ps_option) Handle new configuration parameter. (switch_font) New function. (struct output_char) `font' member changed from `font_desc *' to `font_entry *'. New member `separate'. (read_fontmap) Changed `size' from `int' to `size_t'. (output_line, put_number) New macros for write_text(). (write_text) Optimizes text output by consolidating multiple calls to PostScript `show' operator. (text) Keeps track of when text arguments can't be consolidated by write_text(), and marks those spots in the output stream. (load_font) Sets `position' of the allocated font_entry to -1, cuz the font hasn't been switched to by switch_font(), which is where the position is important--the PostScript is what cares about the position. Sat Aug 31 23:52:38 1996 Ben Pfaff * hash.c: (hsh_destroy) Ignores NULL argument. Doesn't try to call a NULL free_func. (hsh_rehash) Elegantized. (hsh_probe) Fix bug that manifested when the table was expanded and thus had to change location in memory. Good thing too--otherwise could have been much more subtle. (hsh_find) [GLOBAL_DEBUGGING] Not stubbed out anymore. (hsh_foreach) New function for hash table iteration. * hash.h: (struct hsh_iterator) New. * lexer.c: (parse_tagged_quote) Font and family name strings in tags are now null-terminated. * output.c: (outp_evaluate_dimension) Fixed over-aggressive unit parsing. (internal_get_paper_size, outp_get_paper_size) Fixed; now work as documented. (Never before tested?) * output.h: Comment changes. * postscript.c: New driver options `optimize-text-size', `optimize-line-size', `max-fonts-simult'. New enum set for specing cached line types. Comment fixes. (struct line_form) New struct. (struct ps_driver_struct) New members `text_opt', `line_opt', `max_fonts', `lines'. (ps_init_driver) Initializes new members of ps_driver_struct. (user option type enum set) New member `nonneg_int_arg'. (static var option_tab[]) Supports new options. (ps_option) Handles new options. (find_ps_file) Made static. No longer calls hsh_dump(). (ps_get_var) Made static. (preclose) Dumps out proper DSC trailer. (ps_open_page) Elegantized. (ps_close_page) Calls dump_lines() if appropriate. (ps_line_horz, ps_line_vert, ps_line_intersection) Reduced to wrappers around line(). (int_2_compare, compare_line, dump_line, dump_fancy_line, dump_lines, hash_line, free_line, line) New functions for support of line caching. (write_text, text) Made static. (text) Added to font support, not finished. Thu Aug 29 21:36:41 1996 Ben Pfaff * font.h: (struct font_desc) New members ascent, descent. * groff-font.c: (groff_read_font) Calculates font ascent and descent from the ascent and descent of the `d' and `p' characters, respectively, as per a suggestion on comp.fonts. * postscript.c: (ps_open_page, ps_close_page, ps_line_horz, ps_line_vert, ps_line_intersection) Rewritten to deal with changed prologue. (write_text) Handles text right-justification and centering (not full justification). Still very inefficient. (One output line per character?!) (struct output_char) Added fields for font and font size. (text) Many bugfixes. Sat Aug 24 23:26:00 1996 Ben Pfaff * cmdline.c: (usage) Calls outp_list_classes(). * font.h: Comment fix. * groff-font.c: New exported global var `space_index'. (groff_init) New function to initialize `space_index'. (hash_kern) Casts result to unsigned. (font_name_to_index) Renamed font_char_name_to_index. All references changed. Also, now returns the value of `space_index' when passed an ASCII space character as an argument. Fixed handling of nulls. (font_get_kern_adjust) Changed i from `int' to `unsigned'. Handles passed NULL pointers properly. * lexer.c: (parse_tagged_quote) Comment fix. Better range checking. * output.c: (outp_list_drivers) Removed. Removed all references. * output.h: Comment fixes. * postscript.c: (ps_open_global) Calls groff_init(). (output_char) New structure. (write_text) New function. (text) No longer stubbed out! Now the output is correct--with a few exceptions, one of them being that the page has to be held upside down into a mirror. Sun Aug 11 21:31:22 1996 Ben Pfaff * font.h: Comment fix. * font.c: (name_to_index) Renamed font_name_to_index, made extern. All callers changed. (number_to_index) Renamed font_number_to_index, made extern. All callers changed. (font_get_kern_adjust, font_get_char_metrics) New functions. * output.h: New constant OUTP_T_INTERNAL_DRAW. * postscript.c: Changed default line width back to 1/2 point. (ps_line_horz, ps_line_vert, ps_line_intersection) Now lines are in the center of the space allotted for them, not just a fixed offset from the edge of the space; this fixes some bugs. (ps_line_intersection) Now supports all command line styles. (ps_text_get_size) Bug fix in computation of em width. (text) New function, the meat behind ps_text_metrics and ps_text_draw. Not complete. (ps_text_metrics, ps_text_draw) Removed the stub taken from ascii.c; call text(). Sat Aug 10 23:28:17 1996 Ben Pfaff * arena.c: (arena_free) Assert that the argument is non-NULL. * groff-font.c: (add_kern) Calls arena_free() for old_kern if and only if old_kern is non-NULL. * postscript.c: (ps_init_driver) Changed default line width to 1 point. (postopen) New prologue variables. (ps_line_horz, ps_line_vert, ps_line_intersection) Implements some more of the common line styles properly, but not all. (ps_text_metrics) Fixed problem with this stubbed out version that kept it from taking font sizes into account. Thu Aug 8 22:31:11 1996 Ben Pfaff * arena.c: (arena_malloc) Bug fix. (arena_dump) [GLOBAL_DEBUGGING] New function. * ascii.c: Comment fix. (count_fancy_chars, delineate) Now static functions. * filename.c: (interp_vars) Bug fixes. * font.h: Comment fixes. * glob.c: (init_glob) Sets set_viewwidth, set_viewlength at beginning in case we have an error message to display before initializing the display. * groff-font.c: Comment fix. Changed rehash threshold from 2/3 full to 1/2 full. (groff_read_font) Bug fixes. (name_to_index) Increments hash.used. Sets `name' field of hash entry properly. (add_kern) Sets kern_max_used after rehashing. Other bug fixes. * hash.c: Return type changed. * postscript.c: Continued development. Now marks lines on the paper, but very buggy. Sat Aug 3 20:50:35 1996 Ben Pfaff * Changed comments in many source files from `/* xxx /* yyy */' to `/* xxx */ /* yyy */' for cleanliness. * arena.c: (arena_sd_strdup) New function. * ascii.c: (struct ascii_driver_ext) New member `file'. (ascii_init_driver) Fills out member `file' for initing; uses close_file_ext for closing drivers. (ascii_option) Changed %.*s back to %s because the a_string's are always null-terminated. (postopen, preclose) New functions. (ascii_open_page) Uses new style of open_file_ext. (ascii_option, commit_line_buf, output_lines) Use ext->file.file instead of this->output. (__assert_fail) Removed. * cmdline.c: Changed syntax_message[]. * error.c: #include's only if the history library is available, not if just the readline library is available. * filename.c: (expand_line) Removed alloca() support. (interp_vars) No longer tilde-expands argument. Limit on output length removed. (tilde_expand) Now treats argument as path rather than filename. [!unix] Now is a no-op function. (search_path) Better verbose message formatting. (open_file, close_file) Comment fixes. (close_file) [!unix] Doesn't bother with pipes. (open_file_ext) Completely rewritten, interface revamped. (close_file_ext) New function. * font.h: Comment changes. * frequencies.q: Removed AIX alloca support since it doesn't use alloca. * hash.c: Comment changes & additions. (hsh_create) Initializes entire table instead of first M entries. (hsh_probe) Stupid bug fixed. Now it works. (hsh_dump) [GLOBAL_DEBUGGING] New function. * main.c: (parse) Detects EOF properly in token-eating loop. Should the STOP token have its value changed to 0? * misc.c: (blp_getdelim) [HAVE_GETDELIM] Now it's a macro. (blp_getline) Now it's a macro. * output.h: (struct outp_driver) Removed members output, filename. * output.c: (outp_init) [!NO_POSTSCRIPT] Installs PostScript drivers in driver table. (outp_read_devices) Frees buf. Warns if there are no active output drivers. (outp_configure_clear) Sets outp_configure_vec to NULL after deleting its elements. (configure_driver, destroy_driver) Removed references to output, filename members of outp_driver. (outp_evaluate_dimension, internal_get_paper_size, outp_get_paper_size) New functions. * postscript.c: Continued development. Now links but doesn't make any marks on the page. Lotsa bugs I suppose. * str.c: (strcasecmp) [!HAVE_STRCASECMP] New function. * str.h: Comment changes. Sat Jul 27 22:32:38 1996 Ben Pfaff * Removed dependencies on non-nested comments in several files. Also removed references to (unix || __unix__) in #if's since prefh.orig makes those two equivalent. * ascii.c: (ascii_open_global) Creates ascii_arena. (ascii_close_global) Destroys ascii_arena. (ascii_init_driver) Doesn't create ascii_arena. (ascii_copy_driver) Removed. (ascii_option) Possible bugfix regarding %s vs. %.*s with a_string's. (outp_class ascii_class) Removed ascii_copy_driver reference. * frequencies.q: Now can display all statistics except median. Still not finished. * output.c: Handles outp_class.ref_count so output class destructors are called properly. (add_class) Sets ref_count to 0. (configure_driver) Initializes class if ref_count++ is 0. (destroy_driver) Destructs class if --ref_count is 0. Frees the class output file name. * output.h: (struct outp_class) Removed copy_driver, inited. Added ref_count. * postscript.c: Completely replaced but not finished. Tue Jul 23 21:48:36 1996 Ben Pfaff * approx.h: #includes . * arena.h, arena.c: Many functions changed to take an arena ** instead of an arena *, for consistency. All callers changed. (arena_alloc) Now creates a new arena if passed *A that is NULL. (arena_destroy) Sets *A to NULL. * ascii.c: (delineate) Implements OUTP_T_VERT correctly. Removed assertion that `width' be positive. * command.c: Removed #if's from cmd_table. (walk_cmdtable_func) [0] New function (debug code). (init_cmd_parser) [0] Dumps out cmd_table (debug code). (parse_cmd) Doesn't return failure for unimplemented commands. * common.h: (SYSMIS) Changed from DBL_MAX to -DBL_MAX. (SYSCODE) New constant macro. * descript.q: Checks for positive n_variables before performing analysis. * file-handle.q: (get_handle_by_filename) Bug fix: passes &f to avl_find instead of &fp as arg 2. * frequencies.g, frequencies.q: Continued updating; now compiles & works again, but not complete. * main.c: Changes to user messages. * misc.c: (reverse) [0] New function. * settings.h: Comment removed. #includes "common.h". * som.c: (som_set_null) New function. (som_set_value, som_set_string, som_set_text) More detailing assertions. (som_set_float) Implemented function. (dump_columnated_table) Bug fix regarding page breaks. (draw_cell) Bug fix regarding text that spilled out of a cell. (draw_intersection, draw_horz_rule, draw_vert_rule) No longer draw null lines. (get_cell_size) Support SCON_EMPTY cells. (get_table_size) When calculating rules' widths and heights, mask out SLIN_SPACING bit. Added SOPT_X_HLTL support. * som.h: (som_any_cell) New option SOPT_X_HTLT. Removed SOPT_X_SHADE. (struct som_submission_form) New member `header'; all users changed. * val-labs.c: (get_label) User messages changed. * var.h: Changed FREQUENCIES structures. * vars-atr.c: (is_num_user_missing, is_str_user_missing) Made inline. Fri Jul 19 19:11:13 1996 Ben Pfaff * approx.h: Definition of EPSILON now depends on system's DBL_EPSILON. Removed GNU C specific code. (cmpapx) Renamed approx_compare. * frequencies.g, frequencies.q: Continued updating; still doesn't compile. * groff-font.c: (name_to_index) Fix bug that kept it from compiling. * hash.c, hash.h: Completed work. * var.h: Changes to freq_tab, frequencies_proc. Wed Jul 17 21:23:36 1996 Ben Pfaff New hashing code. * hash.c, hash.h: New files. Not completed. * Makefile.am: Added hash.c to source file list. * font.h: (struct font_desc) New member kern_size_p. * groff-font.c: Uses hash.h. (hashpjw) Moved to hash.c. (next_prime_power) Rewrote, renamed hsh_next_prime, moved to hash.c. (static var hash) New member size_p. * var.h: Includes hash.h. (struct freq_tab) Changed AVL_TREE to hash_tab. * vars-prs.c: Comment, formatting fixes. * frequencies.g, frequencies.q: Continued updating. Not yet working. * formats.c: Bug fix. Tue Jul 16 22:10:04 1996 Ben Pfaff Increasing parallelism between DESCRIPTIVES and FREQUENCIES. * descript.g: Comment fixes. * descript.q: Comment fixes. Moved some declarations into var.h. Made dsc_info a static table. Updated FIXMEs. (internal_cmd_descriptives) Beautified. * frequencies.q: Started updating into working order. * frequencies.g: New file analogous to descript.g. * var.h: Comment fixes. Added structures for FREQUENCIES. * som.c: Removed vestiges of crushing and partial table support. Sun Jul 14 15:45:31 1996 Ben Pfaff * Many more changes to som.c especially, but these will not be documented as I have resolved to remove them. This patchlevel is being released solely so that I can fall back to it if I decide that removing the changes is not a good idea. Sat Jul 13 09:58:44 1996 Ben Pfaff * som.c: (global var som) New member `cum_y'. (build_target) Properly handles titles for partial tables. (dump_partial_beg, dump_partial_mid, dump_partial_end) Merged into single new function dump_partial(). Fixed problem with titles on partial tables. (dump_table) Calls dump_partial() for all parts of partial tables. (dump_page) Criteria for drawing title changed. Fri Jul 12 22:03:36 1996 Ben Pfaff * command.c: (cmd_table) Added LIST, WEIGHT. * command.c: (cmd_remark) No longer frees `s' since it's not dynamically allocated. * data-out.c: (convert_f) Now correctly handles the case where abs(v->f)<1 but v->f rounds to a value of 1.00 given the specified number of decimals. (som_destroy_all_tables) Removed argument. All callers changed. (som_vline, som_hline) Argument validity checking corrected. (som_set_value) Implemented half-heartedly. (replicate_table) Copies tables piece-by-piece when using Checker. * som.h: New line style SLIN_1THIN, currently equivalent to SLIN_0. New enum set SOM_SUB_*. (struct som_submission_form) Removed `seq_no'. Added `type'. * list.q: Newly working file; uses partial tables. * som.c: (som_reduce_table) Renamed som_set_table_height(). (som_crush) Removed argument `group'. (global var som) Removed `nt', `seq_no'. Added `type'. (som_submit_table) Arguments changed. (output_table) Removed partial table code. (build_target) New arg; partial table support added. All callers changed. (dump_plain_table) Removed partial table code. (dump_partial_beg, dump_partial_mid, dump_partial_end) New functions. (dump_table) Supports partial tables. (dump_page) New argument to allow not drawing top and/or bottom headers. All callers changed. Supports partial tables. Sat Jul 6 22:22:25 1996 Ben Pfaff * data-out.c: Changed `#include ' to `#include "approx.h". (convert_F) Comment fix. Now won't print `-.000', etc. * descript.q: Now Z-scores work, although there appears to be a bug (which might actually be in data-out.c:convert_F()). (descriptives_trns_proc, descriptives_trns_free) New functions. (run_z_pass) Implemented. * var.h: Comment fixes. (dsc_z_score, descriptives_trns) New structs. (descriptives_trns) Added to any_trns as `dsc'. * error.c, error.h: New error class, IS (Installation Script error), used in those instances where the error is in the installation, but there is a script file or installation file that can be usefully referred to. * output.c: Change many IE classes to IS classes. * cases.c, command.c, common.c, crosstabs.q, expr-evl.c, frequencies.q, list.q, vars-prs.c, vfm.c: Removed reference to HAVE_MALLOC_H because Borland C++ alloca() is broken, so why include the corresponding header? * glob.c: (init_glob) Don't malloc term_buffer under Checker. Don't bail out if termcap can't be read. * som.c: (som_destroy_table) Removed. (som_reduce_table, som_destroy_all_tables) New functions. (som_crush) New function, not implemented. * som.h: New table option STAB_CRUSH. Comment fix. New struct som_submission_form. Function prototypes revised. Outputting huge tables (1000s of rows) a few rows at a time is supported, though untested. May even break everything. Actually, the code doesn't even compile right now. * som.c: (struct som) New fields htv, nt, seq_no. (som_submit_table) Multiple arguments changed to a single pointer to struct submission_form. Only increments subtable_num if seq_no is zero. Only destroys table if it's not going to be reused. (replicate_table) New function. (output_table) Comment fix. (examine_table) Changed inline code to code calling replicate_table(). Calculates htv. Supports partial tables. (draw_title) Removed comment. (build_target) Only allows for title on first part of partial tables. (dump_plain_table) Only resets table chunk number on first part of partial tables; FIXME: doesn't work quite right. Supports partial tables. (dump_page) Titles only on first part of partial tables. Fri Jul 5 20:16:19 1996 Ben Pfaff * Thanks to an unreliable IDE hard drive, I have spent the last day reconstructing my Debian GNU/Linux installation and redoing the previous day's changes--somehow I managed to save every file except for output.c and output.h. So the following changes could really be considered independent of the output.c, output.h changes from Jul 4. * output.h, output.c: Moved the outp_configure_vec global var, outp_names struct, and enum set OUTP_S_* from output.h to output.c. outp_configure_vec is now static. Thu Jul 4 20:20:24 1996 Ben Pfaff * The entire philosophy behind configuration of the output drivers changed. Now there is a termcap-type configuration where drivers to be read are determined beforehand, rather than parsing the entire output init file and storing it in memory & deciding what to actually use later. Faster & more memory-efficient at the same time, cool. * output.c: Comment fix. Removed outp_init_drivers global var. Removed all references to synonyms. New structure outp_defn. New global vars outp_macros, outp_configure_vec. (search_name, delete_name, add_name, check_configure_vec, expand_name, find_defn_value) New static functions. (outp_configure_clear, outp_configure_add, outp_configure_macro, outp_read_devices) New extern functions. (outp_init) Much functionality moved into outp_read_devices. (outp_read_devices) Format of output init file changed; name of file is `devices' rather than `output' to avoid Makefile conflicts. (outp_clear) Renamed outp_done. (outp_list_classes) Bug fix, cleaned up. (outp_list_drivers) Not implemented anymore. (outp_configure_driver) Now a static function; simplified; now interpolates macros; supports new structure. (outp_enable_driver, match_synonym) Removed; all references removed. (find_driver) First argument removed. * output.h: Global var outp_init_drivers removed; new structure outp_names; new enum set OUTP_S_*; new global var outp_configure_vec; function prototypes for output.c exports updated. * main.c: (main) Calls outp_read_devices() after parsing the command line. * cmdline.c: (parse_command_line) New option -v --verbose; --version changed to -V. --device option changed syntax to just take a single device name. Accepts key=value declaration of output init file macros. Syntax message updated. * filename.c: (expand_line) New function. (interp_environ_vars) Renamed interp_vars; no longer uses fixed-size buffer. (blp_getenv) Allows $ARCH and $VER pseudo-environment-vars to be overridden by real environment vars. (search_path) Uses verbose_msg() instead of #ifdef'd printf(). * filename.h: interp_environ_vars() renamed interp_vars(). * error.c, error.h: Added extern variable `verbosity', message class MM. * error.c: (vmsg) Support message class MM. (verbose_msg) New function. * descript.q: (generate_z_varname) Bug fix in generation of Z-score varnames. (dump_z_table) Bug fix in column headers. * ascii.c: (ascii_init_driver) Changed minimum number of lines per page from 29 to 15. Don't set a default for ops[OPS_INIT, OPS_DONE]. Writes the uninit string when the driver is closed. (ascii_open_page) Write the init string before the first page. (output_shorts) Form of main loop changed from `while' to `for'. Bug fix with overstrikes: the character is printed *after* the backspace. Eliminated a lot of `& 0xff' modifiers. (advance_to_left_margin) New function. (return_carriage, output_lines) Handle left margin. Thu Jul 4 00:35:59 1996 Ben Pfaff * ascii.c: New option `carriage-return-style'. * ascii.c: (count_fancy_chars) New function. (delineate, text_metrics) Use new function; bug fixes regarding rich text strings. (text_draw) Bug fix with rich text. (output_string, output_shorts) Reordered. (output_shorts) Now handles boxchars and some overstrike font changes. (output_char, return_carriage) New functions. (output_lines) Now handles overstriking and font changes properly; some code moved to output_shorts. Tue Jul 2 22:13:23 1996 Ben Pfaff [GLOBAL_DEBUGGING] * ascii.c: New member `debug' in ascii_driver_ext. (ascii_init_driver, delineate) Uses new member. Now you can set a vertical height on writing text. * ascii.c: (delineate) Keeps track of vertical position. (text_draw) No longer considers fully justified text an internal error. * output.h: New flag OUTP_T_VERT; other OUTP_T_ values changed. Tables' titles are drawn; they can have variable height. * som.c: `som' struct has new member, title_height. (draw_title) New argument. Moved within file. All caller changed. (build_target) New argument, amount of space needed for first row. Calculates height of title, takes that into account. All callers changed. (dump_plain_table, dump_columnated_table) Took calculation of y1, y2 out of loop. (dump_columnated_table) [GLOBAL_DEBUGGING] Debugging code improved. (dump_columnated_table) Organized for readability. (dump_page) Makes use of som.title_height. * som.c: Many comment bug fixes. * descript.q: (try_name, generate_z_name) Bug fix regarding generation of Z-score variable names. * var.h: Removed num from descriptives_proc; all referents removed. Mon Jul 1 22:13:39 1996 Ben Pfaff * ascii.c: (ascii_line_horz, ascii_line_vert, ascii_line_intersection) Added debugging code. Added a descriptive line above each table to describe it. * command.c: (parse_cmd) Calls som_new_series. * som.c: New static vars table_num, subtable_num. New `som' member `title'. (dump_page) New arguments. (som_submit_table) Handle new variables. * som.c, som.h: (som_submit_table) New arguments. All callers changed. (som_new_series) New function. (build_target) Makes room for extra line. (draw_title) New function. (dump_page) Calls draw_title. Bug fix: doesn't always set som.ext->cp to 0. Columnation of tables support. * som.h: Deleted fr, lr, ri from som_table. Reorganized. * som.c: Deleted references to fr, lr, ri. (som_columnate) Bux fix: sets group member of table. (som_add_options) Function removed. (dump_table) Split into three functions; extensively reworked. * descript.q: (dump_z_table) Better output table formatting; added title support to correspond to som.h changes. (display) Title support. * output.h: Added OUTP_T_NONE. Mon Jul 1 13:00:00 1996 Ben Pfaff * descript.q: Improved handling of Z scores; still not perfect. * output.h, ascii.c: Added hook for getting em width of current font. * som.c: Uses new em-width hook. Added debugging code to several functions. (som_columnate) New argument. (som_add_options) Removed. Jun 29 17:40:47 1996 Ben Pfaff * som.h, som.c, output.c, output.h, ascii.c: Updated to work with rules as a property of the table instead of as a property of the cells. * ascii.c: Added `header' to table of options. * descript.q: Added even shorter statistic names; modified to work with new som interface. * misc.c (blp_getdelim): Bug fix. * version.c: includes 'conf.h'. ---------------------------------------------------------------------- Local Variables: mode: change-log version-control: never End: