Change some aspects of the PRINT, PRINT EJECT, and WRITE
[pspp-builds.git] / src / language / data-io / ChangeLog
1 Sat Oct 28 11:57:19 2006  Ben Pfaff  <blp@gnu.org>
2
3         * data-writer.c (struct dfm_writer): Removed `bounce' member, and
4         all references to it.
5         (dfm_put_record) Change semantics so that it adds formatting
6         itself, such as new-line characters, instead of putting that
7         responsibility on the caller.  Also, pad binary records with
8         spaces instead of zeros, for compatibility.
9
10         * print.c (struct prt_out_spec) New member `sysmis_as_spaces'.
11         (struct print_trns) Remove `omit_new_lines' and all references,
12         since dfm_put_record() is taking care of that.  Add
13         `include_prefix'.
14         (internal_cmd_print) Allow an empty set of data to print.  Set
15         include_prefix.
16         (parse_specs) Allow an empty set of data to print.
17         (parse_variable_argument) Only add space with PRINT command.  Set
18         sysmis_as_spaces.
19         (print_trns_proc) Indent records if include_prefix is set, for
20         compatibility.  Output SYSMIS as spaces if sysmis_as_spaces is
21         set.  Put "1" in first column if PRINT EJECT is used with an
22         external output file.
23         (flush_records) Ditto.
24
25 Sat Oct 28 16:19:57 WST 2006 John Darrington <john@darrington.wattle.id.au>
26
27         * data-reader.c: Eliminated references to extern variable getl_buf
28
29 Sat Aug  5 08:25:07 2006  Ben Pfaff  <blp@gnu.org>
30
31         Fix bug #17329 in REREAD parsing, reported by John Darrington.
32
33         * inpt-pgm.c (cmd_reread): Fix file handle parsing.
34
35 Mon Jul 31 10:32:31 2006  Ben Pfaff  <blp@gnu.org>
36
37         * print.c (parse_specs): Allow a comma between specifications.
38
39 Sun Jul 16 19:57:10 2006  Ben Pfaff  <blp@gnu.org>
40
41         * automake.mk: (src_language_data_io_libdata_io_a_SOURCE) Add
42         print-space.c, placement-parser.c, placement-parser.h.
43
44         * data-list.c: Basically rewrote the whole thing.  Broke out a lot
45         of code into placement-parser.c.  Code is much cleaner now.
46
47         * placement-parser.c: New file.
48
49         * placement-parser.h: New file.
50
51         * print.c: Basically rewrote the whole thing.  Broke out PRINT
52         SPACE into print-space.c.  Code is much cleaner now.
53
54         * print-space.c: New file.
55
56 Sat Jul  1 17:39:40 2006  Ben Pfaff  <blp@gnu.org>
57
58         Fix bug #11612, "q2c documentation does not agree with code".
59         
60         * list.q: Audit use of q2c "+" prefixes that indicate that a
61         command may appear multiple times.
62
63 Sat Jul  1 20:44:22 2006  Ben Pfaff  <blp@gnu.org>
64
65         Fix bug #15786: System File Creation crashes if directoy is
66         nonexistent.
67         
68         * get.c (parse_write_command): Check that the any_writer open
69         succeeds.
70
71 Tue Jun 27 22:44:28 2006  Ben Pfaff  <blp@gnu.org>
72
73         Fix regression in command name completion reported by John
74         Darrington.  Now completion is again state-dependent and occurs
75         only on the first line of a command.
76         
77         * inpt-pgm.c: (cmd_input_program) Reading of first token in
78         command moved into cmd_parse.
79
80 Fri Jun  9 13:56:00 2006  Ben Pfaff  <blp@gnu.org>
81
82         Reform string library.
83         
84         * matrix-data.c (context): Use dynamic string.
85         (another_token) Deal with changed dfm_get_record() interface.
86         (mget_token) Ditto.
87         (force_eol) Ditto.
88
89         * data-list.c (struct data_list_pgm) Delete delims, delim_cnt
90         members, replacing them by struct string delims.  Update all
91         references to use struct string functions.
92         (cut_field) Change interface to avoid needing "end_blank", by
93         getting the data-reader to remember that state for us.  Change
94         internals to use substring.  Update both callers.
95
96         * data-reader.c (read_file_record): Use ds_read_stream().
97         (dfm_get_record) Change interface to return substring.  Updated
98         all callers.
99         (dfm_expand_tabs) Use ds_find_char().  Now maintain position
100         relative to end-of-line.  Use ds_swap().
101         (dfm_reread_record) Don't limit position by line length.
102         (dfm_column_start) Make parameter const.
103         (dfm_columns_past_end) New function.
104         (dfm_get_column) New function.
105
106 Thu May 25 18:26:26 WST 2006 John Darrington <john@darrington.wattle.id.au>
107
108         * print.c (print_trns_free): Made the code agree with the comment, by
109         not freeing PRT.  Has the side effect that the command no longer
110         crashes on invalid syntax.
111
112 Tue May  9 20:55:46 2006  Ben Pfaff  <blp@gnu.org>
113
114         * get.c (cmd_match_files): Fix memory leak replacing default_dict.
115
116 Sat May  6 22:25:09 2006  Ben Pfaff  <blp@gnu.org>
117
118         Fix segfault.
119         
120         * list.q (write_fallback_headers): (write_fallback_headers)
121         Properly record width of leader and pass it to write_varname().
122
123 Sat May  6 19:03:13 2006  Ben Pfaff  <blp@gnu.org>
124
125         * get.c: (mtf_merge_dictionary) Fix value label memory leak.
126
127 Sat May  6 13:51:16 2006  Ben Pfaff  <blp@gnu.org>
128
129         Use a casefile, instead of a case sink, for MATCH FILES output.
130         It's more straightforward, although it has the same effect.
131         
132         * get.c: (struct mtf_proc) Replace `sink' case sink member by
133         `output' casefile member.
134         (cmd_match_files) Work with casefile instead of sink.
135         (mtf_processing) Add case to casefile instead of sink.
136
137 Sat May  6 10:43:07 2006  Ben Pfaff  <blp@gnu.org>
138
139         Continue reforming procedure execution.  In this phase, get rid of
140         the output code for SPLIT FILE groups in procedure.c, which really
141         shouldn't be doing any output.  Move it into the individual
142         procedures instead.  This also adds some flexibility.
143
144         * list.q (write_all_headers): Call output_split_file_values().
145
146 Wed May  3 23:00:17 2006  Ben Pfaff  <blp@gnu.org>
147
148         Continue reforming procedure execution.  In this phase, get rid of
149         many global variables, consolidating procedure execution in
150         procedure.c.  Encapsulate transformations in new "struct
151         trns_chain".  Also, change implementation of N OF CASES, FILTER,
152         and PROCESS IF from special cases to transformations.
153          
154         * data-list.c: (data_list_trns_proc) Return TRNS_END_FILE at end
155         of file.  (Why didn't we do this before?)
156         (cmd_match_files) Direct procedure output to null sink.
157         Use discard_variables() instead of indirect version.
158
159         * inpt-pgm.c: Use transformation chain.
160         (struct input_program_pgm) Add trns_chain member.
161         (cmd_input_program) Initialize trns_chain member and capture
162         transformations with proc_capture_transformations().
163         (input_program_source_read) Use trns_chain_execute().
164         (destroy_input_program) Destroy input chain.
165
166 Tue May  2 10:39:56 WST 2006 John Darrington <john@darrington.wattle.id.au>
167
168         * list.q Changed from using fixed length char buffers to struct 
169         string so that any length variables can be used.
170
171 Mon May  1 18:21:19 2006  Ben Pfaff  <blp@gnu.org>
172
173         Further clean up the CMD_* command result codes.
174         
175         * (enum cmd_result_extensions) New.  Add CMD_END_INPUT_PROGRAM and
176         CMD_END_CASE result codes.
177         (struct input_program_pgm) Added case_nr, write_case, wc_data
178         members for use by END CASE transformation.
179         (emit_END_CASE) New function.
180         (cmd_input_program) Interpret CMD_END_CASE by outputting an END
181         CASE transformation.  If none is output by the input program
182         itself, add one automatically at the end.  Change lack of
183         variables from warning to error.
184         (cmd_end_input_program) Return CMD_END_INPUT_PROGRAM instead of
185         CMD_END_SUBLOOP.
186         (input_program_source_read) No longer any need to special-case END
187         CASE.  Handle TRNS_DROP_CASE properly.  Initialize new members in
188         inp for use by END CASE transformation.
189         (destroy_input_program) New function.
190         (input_program_source_destroy) Just call destroy_input_program().
191         (cmd_end_case) Just return CMD_END_CASE.
192         (end_case_trns_proc) No longer a stub handled by
193         input_program_source_read().  Actually output the case and
194         increment the case number.
195
196 Mon May  1 16:06:30 2006  Ben Pfaff  <blp@gnu.org>
197
198         Remove vestiges of REPEATING DATA support.
199         
200         * data-list.c: (struct rpd_num_or_var) Removed.
201         (struct repeating_data_trns) Removed.
202         (cmd_repeating_data) Removed.
203         (find_variable_input_spec) Removed.
204         (parse_num_or_var) Removed.
205         (parse_repeating_data) Removed.
206         (realize_value) Removed.
207         (struct rpd_parse_info) Removed.
208         (rpd_parse_record) Removed.
209         (repeating_data_trns_proc) Removed.
210         (repeating_data_trns_free) Removed.
211         (repeating_data_set_write_case) Removed.
212         (rpd_msg) Removed.
213
214         * inpt-pgm.c: (input_program_source_read) Don't deal with
215         REPEATING DATA.
216
217         * data-list.h: Removed.
218
219         * automake.mk (src_language_data_io_libdata_io_a_SOURCES): Removed
220         data-list.h.
221
222 Mon May  1 15:58:28 2006  Ben Pfaff  <blp@gnu.org>
223
224         Remove vestiges of FILE TYPE support. 
225         
226         * data-list.c: (cmd_data_list) Don't check for FILE TYPE.
227         (cmd_repeating_data) Ditto.
228         
229         * automake.mk (src_language_data_io_libdata_io_a_SOURCES): Remove
230         file-type.c, file-type.h.
231
232         * file-type.c: Removed.
233         
234         * file-type.h: Removed.
235
236 Wed Apr 26 13:16:28 2006  Ben Pfaff  <blp@gnu.org>
237
238         Improve the way we handle the various parsing "states".  Until now
239         we've hard-coded the state transitions in the command definition
240         file, but that's error-prone and, worse, it's redundant--we can
241         figure out what state we're in anyhow.  We can cleanly handle
242         INPUT PROGRAM and FILE TYPE with a nested command-processing loop.
243         
244         * data-list.c: (cmd_data_list) Use in_file_type() or
245         in_input_program() in place of case_source_is_class() or
246         case_source_is_complex().
247
248         * file-type.c: NB: Not really fixed except minimally to compile,
249         because it doesn't work anyway.
250         (in_file_type) New function.
251         (cmd_record_type) No need to check that we're in FILE TYPE.
252         (cmd_end_file_type) Ditto.
253         (var file_type_source_class) Make static.
254
255         * get.c: (cmd_match_files) Check vfm_source instead of pgm_state.
256
257         * inpt-pgm.c: (in_input_program) New function.
258         (cmd_input_program) Rewrite to include nested command processing
259         loop.
260         (cmd_end_input_program) Just return CMD_END_SUBLOOP.
261         (var input_program_source_class) Make static.
262         (cmd_end_case) No need to check that we're in INPUT PROGRAM.
263         (cmd_end_file) Ditto.
264         
265         * automake.mk (src_language_data_io_libdata_io_a_SOURCES): Add
266         file-type.h, inpt-pgm.h.
267
268         * file-type.h: New file.
269
270         * inpt-pgm.h: New file.
271
272 Tue Apr 25 13:11:55 2006  Ben Pfaff  <blp@gnu.org>
273
274         * print.c: Don't special-case MS-DOS line terminators.
275         (macro LINE_END_WIDTH) Removed.
276         (alloc_line) Line ends are 1 byte.
277         (print_trns_proc) Just output \n for line end.
278
279 Sun Apr 23 22:05:58 2006  Ben Pfaff  <blp@gnu.org>
280
281         Continue reforming error message support.  In this phase, get rid
282         of message "titles" and put the message text in `struct error'.
283         Now `struct error' encapsulates a message more properly.
284         
285         * data-list.c: (macro RPD_ERR) Removed.
286         (rpd_msg) New function.  Updated all references to tmsg() to call
287         this function instead.
288
289 Sat Apr 15 19:38:13 2006  Ben Pfaff  <blp@gnu.org>
290
291         Remove last users of struct file_ext so we can get rid of it
292         entirely.
293         
294         * data-reader.c: (struct dfm_reader) Change file member from
295         struct file_ext to FILE *.  Updated all references.
296         (dfm_close_reader) Close file with fn_close() instead of
297         fn_close_ext().  Also, make a copy of the file name from the file
298         handle before closing it, because we can't extract it after we
299         close the file.
300         (dfm_open_reader) Open file with fn_open() instead of
301         fn_open_ext().
302
303         * data-writer.c: (struct dfm_writer) Change file member 
304         struct file_ext to FILE *.  Updated all references.
305         (dfm_close_writer) Close file with fn_close() instead of
306         fn_close_ext().  Also, make a copy of the file name from the file
307         handle before closing it, because we can't extract it after we
308         close the file.
309         (dfm_open_writer) Open file with fn_open() instead of
310         fn_open_ext().
311
312 Sat Apr 15 18:00:32 2006  Ben Pfaff  <blp@gnu.org>
313
314         * data-list.c: Add prototype to suppress warning for
315         cmd_repeating_data().
316         
317 Thu Mar  2 08:40:33 WST 2006 John Darrington <john@darrington.wattle.id.au>
318         
319         * Moved files from src directory