Sun Jul 16 19:57:10 2006 Ben Pfaff * automake.mk: (src_language_data_io_libdata_io_a_SOURCE) Add print-space.c, placement-parser.c, placement-parser.h. * data-list.c: Basically rewrote the whole thing. Broke out a lot of code into placement-parser.c. Code is much cleaner now. * placement-parser.c: New file. * placement-parser.h: New file. * print.c: Basically rewrote the whole thing. Broke out PRINT SPACE into print-space.c. Code is much cleaner now. * print-space.c: New file. Sat Jul 1 17:39:40 2006 Ben Pfaff Fix bug #11612, "q2c documentation does not agree with code". * list.q: Audit use of q2c "+" prefixes that indicate that a command may appear multiple times. Sat Jul 1 20:44:22 2006 Ben Pfaff Fix bug #15786: System File Creation crashes if directoy is nonexistent. * get.c (parse_write_command): Check that the any_writer open succeeds. Tue Jun 27 22:44:28 2006 Ben Pfaff Fix regression in command name completion reported by John Darrington. Now completion is again state-dependent and occurs only on the first line of a command. * inpt-pgm.c: (cmd_input_program) Reading of first token in command moved into cmd_parse. Fri Jun 9 13:56:00 2006 Ben Pfaff Reform string library. * matrix-data.c (context): Use dynamic string. (another_token) Deal with changed dfm_get_record() interface. (mget_token) Ditto. (force_eol) Ditto. * data-list.c (struct data_list_pgm) Delete delims, delim_cnt members, replacing them by struct string delims. Update all references to use struct string functions. (cut_field) Change interface to avoid needing "end_blank", by getting the data-reader to remember that state for us. Change internals to use substring. Update both callers. * data-reader.c (read_file_record): Use ds_read_stream(). (dfm_get_record) Change interface to return substring. Updated all callers. (dfm_expand_tabs) Use ds_find_char(). Now maintain position relative to end-of-line. Use ds_swap(). (dfm_reread_record) Don't limit position by line length. (dfm_column_start) Make parameter const. (dfm_columns_past_end) New function. (dfm_get_column) New function. Thu May 25 18:26:26 WST 2006 John Darrington * print.c (print_trns_free): Made the code agree with the comment, by not freeing PRT. Has the side effect that the command no longer crashes on invalid syntax. Tue May 9 20:55:46 2006 Ben Pfaff * get.c (cmd_match_files): Fix memory leak replacing default_dict. Sat May 6 22:25:09 2006 Ben Pfaff Fix segfault. * list.q (write_fallback_headers): (write_fallback_headers) Properly record width of leader and pass it to write_varname(). Sat May 6 19:03:13 2006 Ben Pfaff * get.c: (mtf_merge_dictionary) Fix value label memory leak. Sat May 6 13:51:16 2006 Ben Pfaff Use a casefile, instead of a case sink, for MATCH FILES output. It's more straightforward, although it has the same effect. * get.c: (struct mtf_proc) Replace `sink' case sink member by `output' casefile member. (cmd_match_files) Work with casefile instead of sink. (mtf_processing) Add case to casefile instead of sink. Sat May 6 10:43:07 2006 Ben Pfaff Continue reforming procedure execution. In this phase, get rid of the output code for SPLIT FILE groups in procedure.c, which really shouldn't be doing any output. Move it into the individual procedures instead. This also adds some flexibility. * list.q (write_all_headers): Call output_split_file_values(). Wed May 3 23:00:17 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. * data-list.c: (data_list_trns_proc) Return TRNS_END_FILE at end of file. (Why didn't we do this before?) (cmd_match_files) Direct procedure output to null sink. Use discard_variables() instead of indirect version. * inpt-pgm.c: Use transformation chain. (struct input_program_pgm) Add trns_chain member. (cmd_input_program) Initialize trns_chain member and capture transformations with proc_capture_transformations(). (input_program_source_read) Use trns_chain_execute(). (destroy_input_program) Destroy input chain. Tue May 2 10:39:56 WST 2006 John Darrington * list.q Changed from using fixed length char buffers to struct string so that any length variables can be used. Mon May 1 18:21:19 2006 Ben Pfaff Further clean up the CMD_* command result codes. * (enum cmd_result_extensions) New. Add CMD_END_INPUT_PROGRAM and CMD_END_CASE result codes. (struct input_program_pgm) Added case_nr, write_case, wc_data members for use by END CASE transformation. (emit_END_CASE) New function. (cmd_input_program) Interpret CMD_END_CASE by outputting an END CASE transformation. If none is output by the input program itself, add one automatically at the end. Change lack of variables from warning to error. (cmd_end_input_program) Return CMD_END_INPUT_PROGRAM instead of CMD_END_SUBLOOP. (input_program_source_read) No longer any need to special-case END CASE. Handle TRNS_DROP_CASE properly. Initialize new members in inp for use by END CASE transformation. (destroy_input_program) New function. (input_program_source_destroy) Just call destroy_input_program(). (cmd_end_case) Just return CMD_END_CASE. (end_case_trns_proc) No longer a stub handled by input_program_source_read(). Actually output the case and increment the case number. Mon May 1 16:06:30 2006 Ben Pfaff Remove vestiges of REPEATING DATA support. * data-list.c: (struct rpd_num_or_var) Removed. (struct repeating_data_trns) Removed. (cmd_repeating_data) Removed. (find_variable_input_spec) Removed. (parse_num_or_var) Removed. (parse_repeating_data) Removed. (realize_value) Removed. (struct rpd_parse_info) Removed. (rpd_parse_record) Removed. (repeating_data_trns_proc) Removed. (repeating_data_trns_free) Removed. (repeating_data_set_write_case) Removed. (rpd_msg) Removed. * inpt-pgm.c: (input_program_source_read) Don't deal with REPEATING DATA. * data-list.h: Removed. * automake.mk (src_language_data_io_libdata_io_a_SOURCES): Removed data-list.h. Mon May 1 15:58:28 2006 Ben Pfaff Remove vestiges of FILE TYPE support. * data-list.c: (cmd_data_list) Don't check for FILE TYPE. (cmd_repeating_data) Ditto. * automake.mk (src_language_data_io_libdata_io_a_SOURCES): Remove file-type.c, file-type.h. * file-type.c: Removed. * file-type.h: Removed. Wed Apr 26 13:16:28 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. * data-list.c: (cmd_data_list) Use in_file_type() or in_input_program() in place of case_source_is_class() or case_source_is_complex(). * file-type.c: NB: Not really fixed except minimally to compile, because it doesn't work anyway. (in_file_type) New function. (cmd_record_type) No need to check that we're in FILE TYPE. (cmd_end_file_type) Ditto. (var file_type_source_class) Make static. * get.c: (cmd_match_files) Check vfm_source instead of pgm_state. * inpt-pgm.c: (in_input_program) New function. (cmd_input_program) Rewrite to include nested command processing loop. (cmd_end_input_program) Just return CMD_END_SUBLOOP. (var input_program_source_class) Make static. (cmd_end_case) No need to check that we're in INPUT PROGRAM. (cmd_end_file) Ditto. * automake.mk (src_language_data_io_libdata_io_a_SOURCES): Add file-type.h, inpt-pgm.h. * file-type.h: New file. * inpt-pgm.h: New file. Tue Apr 25 13:11:55 2006 Ben Pfaff * print.c: Don't special-case MS-DOS line terminators. (macro LINE_END_WIDTH) Removed. (alloc_line) Line ends are 1 byte. (print_trns_proc) Just output \n for line end. Sun Apr 23 22:05:58 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. * data-list.c: (macro RPD_ERR) Removed. (rpd_msg) New function. Updated all references to tmsg() to call this function instead. Sat Apr 15 19:38:13 2006 Ben Pfaff Remove last users of struct file_ext so we can get rid of it entirely. * data-reader.c: (struct dfm_reader) Change file member from struct file_ext to FILE *. Updated all references. (dfm_close_reader) Close file with fn_close() instead of fn_close_ext(). Also, make a copy of the file name from the file handle before closing it, because we can't extract it after we close the file. (dfm_open_reader) Open file with fn_open() instead of fn_open_ext(). * data-writer.c: (struct dfm_writer) Change file member struct file_ext to FILE *. Updated all references. (dfm_close_writer) Close file with fn_close() instead of fn_close_ext(). Also, make a copy of the file name from the file handle before closing it, because we can't extract it after we close the file. (dfm_open_writer) Open file with fn_open() instead of fn_open_ext(). Sat Apr 15 18:00:32 2006 Ben Pfaff * data-list.c: Add prototype to suppress warning for cmd_repeating_data(). Thu Mar 2 08:40:33 WST 2006 John Darrington * Moved files from src directory