ef3235121892c74fe1f4256478620d7aebf924c5
[pspp-builds.git] / src / language / data-io / ChangeLog
1 2007-07-11  Ben Pfaff  <blp@gnu.org>
2
3         * get.c (map_case): Create destination case instead of leaving it
4         undefined.  Fixes bug #20285.
5         Reviewed by John Darrington.
6
7 2007-06-06  Ben Pfaff  <blp@gnu.org>
8
9         * get.c: Essentially rewrite MATCH FILES to support FIRST and
10         LAST.
11
12 2007-06-06  Ben Pfaff  <blp@gnu.org>
13
14         Adapt case sources, sinks, and clients of procedure code to the
15         new infrastructure.
16         
17         * data-list.c: Make DATA LIST into a casereader.
18
19         * get.c: Change GET, IMPORT, SAVE, EXPORT to use casereaders,
20         casewriters.
21
22         * inpt-pgm.c: Use caseinit code.  Turn INPUT PROGRAM into a
23         casereader.
24
25         * list.q: Adapt to new procedure code.
26
27 2007-05-06  Ben Pfaff  <blp@gnu.org>
28
29         Abstract the documents within a dictionary a little better.
30         Thanks to John Darrington for suggestion, initial version, and
31         review.  Patch #5917.
32
33         * get.c (mtf_merge_dictionary): Simplify creating merged document.
34
35         * sys-file-info.c (display_documents): Use new
36         dict_get_document_line_cnt and dict_get_document_line functions.
37
38 Thu Feb  1 16:56:02 2007  Ben Pfaff  <blp@gnu.org>
39
40         * file-handle.q (fh_parse): Update to new fh_create_file
41         prototype.
42
43 Sat Dec 16 22:16:18 2006  Ben Pfaff  <blp@gnu.org>
44
45         Make it possible to pull cases from the active file with a
46         function call, instead of requiring indirection through a callback
47         function.
48
49         * automake.mk: Removed matrix-data.c.
50
51         * matrix-data.c: Removed.
52
53         * data-list.c (data_list_source_read): Conform with new
54         case_source_class interface.
55         (data_list_source_destroy): Ditto.
56
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
62         procedure interface.
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.
69
70         * inpt-pgm.c (is_valid_state): New function.
71         (input_program_source_read): Conform with new case_source_class
72         interface.
73         (input_program_source_destroy): Ditto.
74         (end_case_trns_proc): Now just needs to return TRNS_END_CASE.
75
76 Sat Dec  9 18:43:34 2006  Ben Pfaff  <blp@gnu.org>
77
78         * list.q (cmd_list): Use new var_create, var_destroy functions.
79
80 Thu Nov 30 21:51:58 2006  Ben Pfaff  <blp@gnu.org>
81
82         * inpt-pgm.c (cmd_reread): Always return error code upon detecting
83         syntax error.  Fixes bug #18419.  Thanks to John Darrington for
84         reporting this bug.
85
86 Sun Nov 19 09:17:45 2006  Ben Pfaff  <blp@gnu.org>
87
88         * data-list.c (parse_free): Follow documented (but odd) rule that
89         N format is treated as F format for free-field input.
90         
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.
94
95 Thu Nov  2 20:56:03 2006  Ben Pfaff  <blp@gnu.org>
96
97         Implement SKIP keyword on DATA LIST.  Fixes bug #17099.
98         
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.
102
103 Tue Oct 31 20:04:06 2006  Ben Pfaff  <blp@gnu.org>
104
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.
116         
117 Tue Oct 31 18:21:48 2006  Ben Pfaff  <blp@gnu.org>
118
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.
121
122 Sat Oct 28 11:57:19 2006  Ben Pfaff  <blp@gnu.org>
123
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.
130
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
134         `include_prefix'.
135         (internal_cmd_print) Allow an empty set of data to print.  Set
136         include_prefix.
137         (parse_specs) Allow an empty set of data to print.
138         (parse_variable_argument) Only add space with PRINT command.  Set
139         sysmis_as_spaces.
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.
145
146 Sat Oct 28 16:19:57 WST 2006 John Darrington <john@darrington.wattle.id.au>
147
148         * data-reader.c: Eliminated references to extern variable getl_buf
149
150 Sat Aug  5 08:25:07 2006  Ben Pfaff  <blp@gnu.org>
151
152         Fix bug #17329 in REREAD parsing, reported by John Darrington.
153
154         * inpt-pgm.c (cmd_reread): Fix file handle parsing.
155
156 Mon Jul 31 10:32:31 2006  Ben Pfaff  <blp@gnu.org>
157
158         * print.c (parse_specs): Allow a comma between specifications.
159
160 Sun Jul 16 19:57:10 2006  Ben Pfaff  <blp@gnu.org>
161
162         * automake.mk: (src_language_data_io_libdata_io_a_SOURCE) Add
163         print-space.c, placement-parser.c, placement-parser.h.
164
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.
167
168         * placement-parser.c: New file.
169
170         * placement-parser.h: New file.
171
172         * print.c: Basically rewrote the whole thing.  Broke out PRINT
173         SPACE into print-space.c.  Code is much cleaner now.
174
175         * print-space.c: New file.
176
177 Sat Jul  1 17:39:40 2006  Ben Pfaff  <blp@gnu.org>
178
179         Fix bug #11612, "q2c documentation does not agree with code".
180         
181         * list.q: Audit use of q2c "+" prefixes that indicate that a
182         command may appear multiple times.
183
184 Sat Jul  1 20:44:22 2006  Ben Pfaff  <blp@gnu.org>
185
186         Fix bug #15786: System File Creation crashes if directoy is
187         nonexistent.
188         
189         * get.c (parse_write_command): Check that the any_writer open
190         succeeds.
191
192 Tue Jun 27 22:44:28 2006  Ben Pfaff  <blp@gnu.org>
193
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.
197         
198         * inpt-pgm.c: (cmd_input_program) Reading of first token in
199         command moved into cmd_parse.
200
201 Fri Jun  9 13:56:00 2006  Ben Pfaff  <blp@gnu.org>
202
203         Reform string library.
204         
205         * matrix-data.c (context): Use dynamic string.
206         (another_token) Deal with changed dfm_get_record() interface.
207         (mget_token) Ditto.
208         (force_eol) Ditto.
209
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.
216
217         * data-reader.c (read_file_record): Use ds_read_stream().
218         (dfm_get_record) Change interface to return substring.  Updated
219         all callers.
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.
226
227 Thu May 25 18:26:26 WST 2006 John Darrington <john@darrington.wattle.id.au>
228
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.
232
233 Tue May  9 20:55:46 2006  Ben Pfaff  <blp@gnu.org>
234
235         * get.c (cmd_match_files): Fix memory leak replacing default_dict.
236
237 Sat May  6 22:25:09 2006  Ben Pfaff  <blp@gnu.org>
238
239         Fix segfault.
240         
241         * list.q (write_fallback_headers): (write_fallback_headers)
242         Properly record width of leader and pass it to write_varname().
243
244 Sat May  6 19:03:13 2006  Ben Pfaff  <blp@gnu.org>
245
246         * get.c: (mtf_merge_dictionary) Fix value label memory leak.
247
248 Sat May  6 13:51:16 2006  Ben Pfaff  <blp@gnu.org>
249
250         Use a casefile, instead of a case sink, for MATCH FILES output.
251         It's more straightforward, although it has the same effect.
252         
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.
257
258 Sat May  6 10:43:07 2006  Ben Pfaff  <blp@gnu.org>
259
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.
264
265         * list.q (write_all_headers): Call output_split_file_values().
266
267 Wed May  3 23:00:17 2006  Ben Pfaff  <blp@gnu.org>
268
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.
274          
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.
279
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.
286
287 Tue May  2 10:39:56 WST 2006 John Darrington <john@darrington.wattle.id.au>
288
289         * list.q Changed from using fixed length char buffers to struct 
290         string so that any length variables can be used.
291
292 Mon May  1 18:21:19 2006  Ben Pfaff  <blp@gnu.org>
293
294         Further clean up the CMD_* command result codes.
295         
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
306         CMD_END_SUBLOOP.
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.
316
317 Mon May  1 16:06:30 2006  Ben Pfaff  <blp@gnu.org>
318
319         Remove vestiges of REPEATING DATA support.
320         
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.
333         (rpd_msg) Removed.
334
335         * inpt-pgm.c: (input_program_source_read) Don't deal with
336         REPEATING DATA.
337
338         * data-list.h: Removed.
339
340         * automake.mk (src_language_data_io_libdata_io_a_SOURCES): Removed
341         data-list.h.
342
343 Mon May  1 15:58:28 2006  Ben Pfaff  <blp@gnu.org>
344
345         Remove vestiges of FILE TYPE support. 
346         
347         * data-list.c: (cmd_data_list) Don't check for FILE TYPE.
348         (cmd_repeating_data) Ditto.
349         
350         * automake.mk (src_language_data_io_libdata_io_a_SOURCES): Remove
351         file-type.c, file-type.h.
352
353         * file-type.c: Removed.
354         
355         * file-type.h: Removed.
356
357 Wed Apr 26 13:16:28 2006  Ben Pfaff  <blp@gnu.org>
358
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.
364         
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().
368
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.
375
376         * get.c: (cmd_match_files) Check vfm_source instead of pgm_state.
377
378         * inpt-pgm.c: (in_input_program) New function.
379         (cmd_input_program) Rewrite to include nested command processing
380         loop.
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.
385         
386         * automake.mk (src_language_data_io_libdata_io_a_SOURCES): Add
387         file-type.h, inpt-pgm.h.
388
389         * file-type.h: New file.
390
391         * inpt-pgm.h: New file.
392
393 Tue Apr 25 13:11:55 2006  Ben Pfaff  <blp@gnu.org>
394
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.
399
400 Sun Apr 23 22:05:58 2006  Ben Pfaff  <blp@gnu.org>
401
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.
405         
406         * data-list.c: (macro RPD_ERR) Removed.
407         (rpd_msg) New function.  Updated all references to tmsg() to call
408         this function instead.
409
410 Sat Apr 15 19:38:13 2006  Ben Pfaff  <blp@gnu.org>
411
412         Remove last users of struct file_ext so we can get rid of it
413         entirely.
414         
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
420         close the file.
421         (dfm_open_reader) Open file with fn_open() instead of
422         fn_open_ext().
423
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
429         close the file.
430         (dfm_open_writer) Open file with fn_open() instead of
431         fn_open_ext().
432
433 Sat Apr 15 18:00:32 2006  Ben Pfaff  <blp@gnu.org>
434
435         * data-list.c: Add prototype to suppress warning for
436         cmd_repeating_data().
437         
438 Thu Mar  2 08:40:33 WST 2006 John Darrington <john@darrington.wattle.id.au>
439         
440         * Moved files from src directory