1 2007-07-11 Ben Pfaff <blp@gnu.org>
3 * get.c (map_case): Create destination case instead of leaving it
4 undefined. Fixes bug #20285.
5 Reviewed by John Darrington.
7 2007-06-06 Ben Pfaff <blp@gnu.org>
9 * get.c: Essentially rewrite MATCH FILES to support FIRST and
12 2007-06-06 Ben Pfaff <blp@gnu.org>
14 Adapt case sources, sinks, and clients of procedure code to the
17 * data-list.c: Make DATA LIST into a casereader.
19 * get.c: Change GET, IMPORT, SAVE, EXPORT to use casereaders,
22 * inpt-pgm.c: Use caseinit code. Turn INPUT PROGRAM into a
25 * list.q: Adapt to new procedure code.
27 2007-05-06 Ben Pfaff <blp@gnu.org>
29 Abstract the documents within a dictionary a little better.
30 Thanks to John Darrington for suggestion, initial version, and
33 * get.c (mtf_merge_dictionary): Simplify creating merged document.
35 * sys-file-info.c (display_documents): Use new
36 dict_get_document_line_cnt and dict_get_document_line functions.
38 Thu Feb 1 16:56:02 2007 Ben Pfaff <blp@gnu.org>
40 * file-handle.q (fh_parse): Update to new fh_create_file
43 Sat Dec 16 22:16:18 2006 Ben Pfaff <blp@gnu.org>
45 Make it possible to pull cases from the active file with a
46 function call, instead of requiring indirection through a callback
49 * automake.mk: Removed matrix-data.c.
51 * matrix-data.c: Removed.
53 * data-list.c (data_list_source_read): Conform with new
54 case_source_class interface.
55 (data_list_source_destroy): Ditto.
57 * get.c (case_reader_source_class): Ditto.
58 (case_reader_source_destroy): Ditto.
59 (parse_output_proc): Take advantage of new procedure interface.
60 (output_proc): Removed.
61 (struct mtf_file): Add "struct ccase *" member to allow use of new
63 (cmd_match_files): Take advantage of new procedure interface.
64 (mtf_processing_finish): Removed.
65 (mtf_read_nonactive_records): Renamed mtf_read_records. Now reads
66 from every file, without any exception for the active file.
67 (mtf_compare_BY_values): Simplify for new interface.
68 (mtf_processing): Simplify for new interface.
70 * inpt-pgm.c (is_valid_state): New function.
71 (input_program_source_read): Conform with new case_source_class
73 (input_program_source_destroy): Ditto.
74 (end_case_trns_proc): Now just needs to return TRNS_END_CASE.
76 Sat Dec 9 18:43:34 2006 Ben Pfaff <blp@gnu.org>
78 * list.q (cmd_list): Use new var_create, var_destroy functions.
80 Thu Nov 30 21:51:58 2006 Ben Pfaff <blp@gnu.org>
82 * inpt-pgm.c (cmd_reread): Always return error code upon detecting
83 syntax error. Fixes bug #18419. Thanks to John Darrington for
86 Sun Nov 19 09:17:45 2006 Ben Pfaff <blp@gnu.org>
88 * data-list.c (parse_free): Follow documented (but odd) rule that
89 N format is treated as F format for free-field input.
91 * data-reader.c (read_file_record): Drop new-line character from
92 input text lines. This is symmetrical with the recently changed
93 dfm_put_record semantics.
95 Thu Nov 2 20:56:03 2006 Ben Pfaff <blp@gnu.org>
97 Implement SKIP keyword on DATA LIST. Fixes bug #17099.
99 * data-list.c: (struct data_list_pgm) Add `skip_records' members.
100 (cmd_data_list) Set skip_records based on user input.
101 (data_list_source_read) Skip records requested by user.
103 Tue Oct 31 20:04:06 2006 Ben Pfaff <blp@gnu.org>
105 * placement-parser.c: (PRS_TYPE_T) Now that struct fmt_spec uses
106 an enum fmt_type for its type member, we can't depend on the
107 ability to put negative values into that member as out-of-band
108 values, because enum fmt_type might be an unsigned type. So use
109 values around SCHAR_MAX instead, because we know that SCHAR_MAX
110 will fit into any type, signed or unsigned, and there aren't
111 nearly that many format types.
112 (parse_var_placements) Add for_input parameter to specify whether
113 we're parsing input or output formats. Update all callers.
114 (fixed_parse_columns) Ditto.
115 (fixed_parse_fortran) Ditto.
117 Tue Oct 31 18:21:48 2006 Ben Pfaff <blp@gnu.org>
119 * print-space.c (print_space_trns_proc): Let dfm_put_record add
120 the new-line character, to match dfm_put_record change below.
122 Sat Oct 28 11:57:19 2006 Ben Pfaff <blp@gnu.org>
124 * data-writer.c (struct dfm_writer): Removed `bounce' member, and
125 all references to it.
126 (dfm_put_record) Change semantics so that it adds formatting
127 itself, such as new-line characters, instead of putting that
128 responsibility on the caller. Also, pad binary records with
129 spaces instead of zeros, for compatibility.
131 * print.c (struct prt_out_spec) New member `sysmis_as_spaces'.
132 (struct print_trns) Remove `omit_new_lines' and all references,
133 since dfm_put_record() is taking care of that. Add
135 (internal_cmd_print) Allow an empty set of data to print. Set
137 (parse_specs) Allow an empty set of data to print.
138 (parse_variable_argument) Only add space with PRINT command. Set
140 (print_trns_proc) Indent records if include_prefix is set, for
141 compatibility. Output SYSMIS as spaces if sysmis_as_spaces is
142 set. Put "1" in first column if PRINT EJECT is used with an
143 external output file.
144 (flush_records) Ditto.
146 Sat Oct 28 16:19:57 WST 2006 John Darrington <john@darrington.wattle.id.au>
148 * data-reader.c: Eliminated references to extern variable getl_buf
150 Sat Aug 5 08:25:07 2006 Ben Pfaff <blp@gnu.org>
152 Fix bug #17329 in REREAD parsing, reported by John Darrington.
154 * inpt-pgm.c (cmd_reread): Fix file handle parsing.
156 Mon Jul 31 10:32:31 2006 Ben Pfaff <blp@gnu.org>
158 * print.c (parse_specs): Allow a comma between specifications.
160 Sun Jul 16 19:57:10 2006 Ben Pfaff <blp@gnu.org>
162 * automake.mk: (src_language_data_io_libdata_io_a_SOURCE) Add
163 print-space.c, placement-parser.c, placement-parser.h.
165 * data-list.c: Basically rewrote the whole thing. Broke out a lot
166 of code into placement-parser.c. Code is much cleaner now.
168 * placement-parser.c: New file.
170 * placement-parser.h: New file.
172 * print.c: Basically rewrote the whole thing. Broke out PRINT
173 SPACE into print-space.c. Code is much cleaner now.
175 * print-space.c: New file.
177 Sat Jul 1 17:39:40 2006 Ben Pfaff <blp@gnu.org>
179 Fix bug #11612, "q2c documentation does not agree with code".
181 * list.q: Audit use of q2c "+" prefixes that indicate that a
182 command may appear multiple times.
184 Sat Jul 1 20:44:22 2006 Ben Pfaff <blp@gnu.org>
186 Fix bug #15786: System File Creation crashes if directoy is
189 * get.c (parse_write_command): Check that the any_writer open
192 Tue Jun 27 22:44:28 2006 Ben Pfaff <blp@gnu.org>
194 Fix regression in command name completion reported by John
195 Darrington. Now completion is again state-dependent and occurs
196 only on the first line of a command.
198 * inpt-pgm.c: (cmd_input_program) Reading of first token in
199 command moved into cmd_parse.
201 Fri Jun 9 13:56:00 2006 Ben Pfaff <blp@gnu.org>
203 Reform string library.
205 * matrix-data.c (context): Use dynamic string.
206 (another_token) Deal with changed dfm_get_record() interface.
210 * data-list.c (struct data_list_pgm) Delete delims, delim_cnt
211 members, replacing them by struct string delims. Update all
212 references to use struct string functions.
213 (cut_field) Change interface to avoid needing "end_blank", by
214 getting the data-reader to remember that state for us. Change
215 internals to use substring. Update both callers.
217 * data-reader.c (read_file_record): Use ds_read_stream().
218 (dfm_get_record) Change interface to return substring. Updated
220 (dfm_expand_tabs) Use ds_find_char(). Now maintain position
221 relative to end-of-line. Use ds_swap().
222 (dfm_reread_record) Don't limit position by line length.
223 (dfm_column_start) Make parameter const.
224 (dfm_columns_past_end) New function.
225 (dfm_get_column) New function.
227 Thu May 25 18:26:26 WST 2006 John Darrington <john@darrington.wattle.id.au>
229 * print.c (print_trns_free): Made the code agree with the comment, by
230 not freeing PRT. Has the side effect that the command no longer
231 crashes on invalid syntax.
233 Tue May 9 20:55:46 2006 Ben Pfaff <blp@gnu.org>
235 * get.c (cmd_match_files): Fix memory leak replacing default_dict.
237 Sat May 6 22:25:09 2006 Ben Pfaff <blp@gnu.org>
241 * list.q (write_fallback_headers): (write_fallback_headers)
242 Properly record width of leader and pass it to write_varname().
244 Sat May 6 19:03:13 2006 Ben Pfaff <blp@gnu.org>
246 * get.c: (mtf_merge_dictionary) Fix value label memory leak.
248 Sat May 6 13:51:16 2006 Ben Pfaff <blp@gnu.org>
250 Use a casefile, instead of a case sink, for MATCH FILES output.
251 It's more straightforward, although it has the same effect.
253 * get.c: (struct mtf_proc) Replace `sink' case sink member by
254 `output' casefile member.
255 (cmd_match_files) Work with casefile instead of sink.
256 (mtf_processing) Add case to casefile instead of sink.
258 Sat May 6 10:43:07 2006 Ben Pfaff <blp@gnu.org>
260 Continue reforming procedure execution. In this phase, get rid of
261 the output code for SPLIT FILE groups in procedure.c, which really
262 shouldn't be doing any output. Move it into the individual
263 procedures instead. This also adds some flexibility.
265 * list.q (write_all_headers): Call output_split_file_values().
267 Wed May 3 23:00:17 2006 Ben Pfaff <blp@gnu.org>
269 Continue reforming procedure execution. In this phase, get rid of
270 many global variables, consolidating procedure execution in
271 procedure.c. Encapsulate transformations in new "struct
272 trns_chain". Also, change implementation of N OF CASES, FILTER,
273 and PROCESS IF from special cases to transformations.
275 * data-list.c: (data_list_trns_proc) Return TRNS_END_FILE at end
276 of file. (Why didn't we do this before?)
277 (cmd_match_files) Direct procedure output to null sink.
278 Use discard_variables() instead of indirect version.
280 * inpt-pgm.c: Use transformation chain.
281 (struct input_program_pgm) Add trns_chain member.
282 (cmd_input_program) Initialize trns_chain member and capture
283 transformations with proc_capture_transformations().
284 (input_program_source_read) Use trns_chain_execute().
285 (destroy_input_program) Destroy input chain.
287 Tue May 2 10:39:56 WST 2006 John Darrington <john@darrington.wattle.id.au>
289 * list.q Changed from using fixed length char buffers to struct
290 string so that any length variables can be used.
292 Mon May 1 18:21:19 2006 Ben Pfaff <blp@gnu.org>
294 Further clean up the CMD_* command result codes.
296 * (enum cmd_result_extensions) New. Add CMD_END_INPUT_PROGRAM and
297 CMD_END_CASE result codes.
298 (struct input_program_pgm) Added case_nr, write_case, wc_data
299 members for use by END CASE transformation.
300 (emit_END_CASE) New function.
301 (cmd_input_program) Interpret CMD_END_CASE by outputting an END
302 CASE transformation. If none is output by the input program
303 itself, add one automatically at the end. Change lack of
304 variables from warning to error.
305 (cmd_end_input_program) Return CMD_END_INPUT_PROGRAM instead of
307 (input_program_source_read) No longer any need to special-case END
308 CASE. Handle TRNS_DROP_CASE properly. Initialize new members in
309 inp for use by END CASE transformation.
310 (destroy_input_program) New function.
311 (input_program_source_destroy) Just call destroy_input_program().
312 (cmd_end_case) Just return CMD_END_CASE.
313 (end_case_trns_proc) No longer a stub handled by
314 input_program_source_read(). Actually output the case and
315 increment the case number.
317 Mon May 1 16:06:30 2006 Ben Pfaff <blp@gnu.org>
319 Remove vestiges of REPEATING DATA support.
321 * data-list.c: (struct rpd_num_or_var) Removed.
322 (struct repeating_data_trns) Removed.
323 (cmd_repeating_data) Removed.
324 (find_variable_input_spec) Removed.
325 (parse_num_or_var) Removed.
326 (parse_repeating_data) Removed.
327 (realize_value) Removed.
328 (struct rpd_parse_info) Removed.
329 (rpd_parse_record) Removed.
330 (repeating_data_trns_proc) Removed.
331 (repeating_data_trns_free) Removed.
332 (repeating_data_set_write_case) Removed.
335 * inpt-pgm.c: (input_program_source_read) Don't deal with
338 * data-list.h: Removed.
340 * automake.mk (src_language_data_io_libdata_io_a_SOURCES): Removed
343 Mon May 1 15:58:28 2006 Ben Pfaff <blp@gnu.org>
345 Remove vestiges of FILE TYPE support.
347 * data-list.c: (cmd_data_list) Don't check for FILE TYPE.
348 (cmd_repeating_data) Ditto.
350 * automake.mk (src_language_data_io_libdata_io_a_SOURCES): Remove
351 file-type.c, file-type.h.
353 * file-type.c: Removed.
355 * file-type.h: Removed.
357 Wed Apr 26 13:16:28 2006 Ben Pfaff <blp@gnu.org>
359 Improve the way we handle the various parsing "states". Until now
360 we've hard-coded the state transitions in the command definition
361 file, but that's error-prone and, worse, it's redundant--we can
362 figure out what state we're in anyhow. We can cleanly handle
363 INPUT PROGRAM and FILE TYPE with a nested command-processing loop.
365 * data-list.c: (cmd_data_list) Use in_file_type() or
366 in_input_program() in place of case_source_is_class() or
367 case_source_is_complex().
369 * file-type.c: NB: Not really fixed except minimally to compile,
370 because it doesn't work anyway.
371 (in_file_type) New function.
372 (cmd_record_type) No need to check that we're in FILE TYPE.
373 (cmd_end_file_type) Ditto.
374 (var file_type_source_class) Make static.
376 * get.c: (cmd_match_files) Check vfm_source instead of pgm_state.
378 * inpt-pgm.c: (in_input_program) New function.
379 (cmd_input_program) Rewrite to include nested command processing
381 (cmd_end_input_program) Just return CMD_END_SUBLOOP.
382 (var input_program_source_class) Make static.
383 (cmd_end_case) No need to check that we're in INPUT PROGRAM.
384 (cmd_end_file) Ditto.
386 * automake.mk (src_language_data_io_libdata_io_a_SOURCES): Add
387 file-type.h, inpt-pgm.h.
389 * file-type.h: New file.
391 * inpt-pgm.h: New file.
393 Tue Apr 25 13:11:55 2006 Ben Pfaff <blp@gnu.org>
395 * print.c: Don't special-case MS-DOS line terminators.
396 (macro LINE_END_WIDTH) Removed.
397 (alloc_line) Line ends are 1 byte.
398 (print_trns_proc) Just output \n for line end.
400 Sun Apr 23 22:05:58 2006 Ben Pfaff <blp@gnu.org>
402 Continue reforming error message support. In this phase, get rid
403 of message "titles" and put the message text in `struct error'.
404 Now `struct error' encapsulates a message more properly.
406 * data-list.c: (macro RPD_ERR) Removed.
407 (rpd_msg) New function. Updated all references to tmsg() to call
408 this function instead.
410 Sat Apr 15 19:38:13 2006 Ben Pfaff <blp@gnu.org>
412 Remove last users of struct file_ext so we can get rid of it
415 * data-reader.c: (struct dfm_reader) Change file member from
416 struct file_ext to FILE *. Updated all references.
417 (dfm_close_reader) Close file with fn_close() instead of
418 fn_close_ext(). Also, make a copy of the file name from the file
419 handle before closing it, because we can't extract it after we
421 (dfm_open_reader) Open file with fn_open() instead of
424 * data-writer.c: (struct dfm_writer) Change file member
425 struct file_ext to FILE *. Updated all references.
426 (dfm_close_writer) Close file with fn_close() instead of
427 fn_close_ext(). Also, make a copy of the file name from the file
428 handle before closing it, because we can't extract it after we
430 (dfm_open_writer) Open file with fn_open() instead of
433 Sat Apr 15 18:00:32 2006 Ben Pfaff <blp@gnu.org>
435 * data-list.c: Add prototype to suppress warning for
436 cmd_repeating_data().
438 Thu Mar 2 08:40:33 WST 2006 John Darrington <john@darrington.wattle.id.au>
440 * Moved files from src directory