Bug #21128. Reviewed by John Darrington.
[pspp-builds.git] / src / output / ChangeLog
1 2007-09-22  Ben Pfaff  <blp@gnu.org>
2
3         Bug #21128.  Reviewed by John Darrington.
4
5         * output.c (TWO_CHARS macro): Removed.
6         (outp_evaluate_dimension): Changed interface, rewritten.  Updated
7         all callers.
8         (internal_get_paper_size): Removed.
9         (parse_unit): New function.
10         (parse_paper_size): New function.
11         (outp_get_paper_size): Tweaked interface, rewritten.
12         (get_standard_paper_size): New function.
13         (read_paper_conf): New function.
14         (get_default_paper_size): New function.
15
16         * postscript.c (ps_open_driver): Use system default paper size as
17         default paper, instead of hard-coding US letter.
18         (handle_option): Allow outp_evaluate_dimension to supply error
19         message instead of generating it here.
20
21 2007-09-21  Ben Pfaff  <blp@gnu.org>
22
23         * ascii.c (struct ascii_driver_ext): New member reported_error.
24         (ascii_open_driver): Initialize reported_error.
25         (ascii_open_page): Initialize the rest of the ascii driver data
26         even if we fail to open the output file.  Fixes bug #21117.
27
28         * chart.c (chart_create): Initialize lp member.  Fixes crash if
29         chart initialization fails.
30
31         * html.c (html_open_driver): Don't free chart_file_name in error
32         case, since html_close_driver will do that.  Fixes crash if file
33         open fails.
34
35         * postscript.c (ps_close_driver): Don't try to write to file if
36         it's null.  Fixes crash if file open fails.
37
38 2007-09-08  John Darrington <john@darrington.wattle.id.au>      
39
40         * postscript.c html.c: Remove #include "getline.h" to concurr with 
41         new gnulib arrangements.
42
43 2007-08-23  Ben Pfaff  <blp@gnu.org>
44
45         Implement journaling.  Bug #17240.
46         
47         * automake.mk (output_sources): Add journal.c, journal.h.
48         
49         * journal.c: New file.
50         
51         * journal.h: New file.
52
53 2007-08-16  Ben Pfaff  <blp@gnu.org>
54
55         * output.c output.h: export function outp_configure_driver_line.
56         * ascii.c: Added an "append" property.
57         
58 2007-08-12  Ben Pfaff  <blp@gnu.org>
59
60         Add support for charts to ASCII driver.  Bug #16364.
61         Thanks to John Darrington for review.
62         
63         * ascii.c (struct ascii_driver_ext): Add chart_type,
64         chart_file_name, chart_cnt members.
65         (ascii_open_driver): Initialize new members.
66         (static array option_tab): Add new options, reorganize slightly.
67         (handle_option): Handle new options.
68         (ascii_submit): New function.
69         (ascii_chart_initialise): Implement.
70         (ascii_chart_finalise): Implement.
71
72         * chart.c (chart_init_separate): New function.
73         (chart_finalise_separate): New function.
74         
75         * dummy-chart.c (chart_init_separate): New function.
76         (chart_finalise_separate): New function.
77
78         * html.c (html_open_driver): Don't free chart_file_name.
79         (html_close_driver): Do free chart_file_name.
80         (handle_option): Only give an error for chart-files options that
81         don't contain "#".
82         (html_initialise_chart): Use new chart_init_separate.
83         (html_finalise_chart): Use new chart_finalise_separate.
84
85 2007-07-25  Ben Pfaff  <blp@gnu.org>
86
87         Allow the user to specify an initialization string to write at the
88         beginning of an ASCII output file.
89         * ascii.c (struct ascii_driver_ext): New member `init'.
90         (ascii_open_driver): Initialize `init'.
91         (ascii_close_driver): Parse `init'.
92         (ascii_open_page): Write `init' to output file.
93
94         * output.c (get_option_token): Fix parsing of octal constants.
95
96 2007-07-25  Ben Pfaff  <blp@gnu.org>
97
98         Make interactive output go to the terminal (bug #17213), by
99         causing the UI to flush output to the user when it prompts for a
100         command.
101
102         * ascii.c (ascii_open_driver): Move the file open into
103         ascii_open_page, so that we can re-open after a flush.
104         (ascii_close_driver): Close file using ascii_flush.
105         (ascii_open_page): Open the output file if it's not already open.
106         Use fn_open so that we can support pipes.
107         (ascii_close_page): Do nothing if output file not open.
108         (ascii_flush): New function.
109         (static var ascii_class): Add ascii_flush.
110
111         * manager.c (som_flush): New function.
112
113         * output.c (outp_flush): New function.
114
115 Tue Feb 20 07:03:48 2007  Ben Pfaff  <blp@gnu.org>
116
117         * html.c: Don't need to include "getlogin_r.h" anymore, because
118         gnulib merged it into <unistd.h>.
119
120 Sun Feb 18 11:20:35 2007  Ben Pfaff  <blp@gnu.org>
121
122         * postscript.c: Add missing _() around message.
123
124 Sun Feb 11 17:59:30 2007  Ben Pfaff  <blp@gnu.org>
125
126         * html.c (html_initialise_chart): Mark `this' parameter UNUSED to
127         account for NO_CHARTS case.
128
129 Sat Feb  3 21:56:46 2007  Ben Pfaff  <blp@gnu.org>
130
131         * table.c (tab_hline): Allow t->nr as y argument, so that we can
132         draw a line below the bottom row of the table.
133
134 Wed Feb  7 21:38:12 2007  Ben Pfaff  <blp@gnu.org>
135
136         * afm.c: Add #include <limits.h>.  Thanks to John McCabe-Dansted
137         <gmatht@gmail.com> for pointing out the need.
138
139 Sun Oct  8 07:09:34 WST 2006 John Darrington <john@darrington.wattle.id.au>
140
141         * table.c (tab_destroy): Freed title, since this is not allocated
142         from the pool.
143
144         * html.c (html_open_driver): Freed chart_file_name.
145
146 Wed Jul 12 21:03:37 2006  Ben Pfaff  <blp@gnu.org>
147
148         * table.c (tab_natural_width): Get rid of warning on empty column,
149         which tended to just trigger false positives because we handle
150         joined cells so badly.  We need a real fix, and the warning is not
151         helpful.
152
153         * table.c (tab_offset): [DEBUGGING] Let row, col arguments be as
154         big as row or column count.
155         
156 Wed Jul 12 20:58:19 2006  Ben Pfaff  <blp@gnu.org>
157
158         * output.c (outp_drivers): [DEBUGGING] Delete unused declaration.
159
160 Sat Jul  1 17:20:03 2006  Ben Pfaff  <blp@gnu.org>
161
162         Make the destination for charts configurable in the HTML driver.
163         Fixes bug #15723, "HTML driver creates .png files insecurely".
164
165         * htmlP.h: (struct html_driver_ext) Add chart_file_name, chart_cnt
166         members.
167         
168         * html.c: (html_open_driver) Initialize new members.
169         (option_tab var) Add "chart-files" option.
170         (handle_option) Parse "chart-files" option.
171         (html_initialise_chart) Name file based on "chart-files" option.
172         
173 Sat Jul  1 22:41:26 2006  Ben Pfaff  <blp@gnu.org>
174
175         Fix bug #16644: Output Driver crashes in DISPLAY VARIABLES.
176         
177         * table.c (tab_create): Don't allocate t->hrh, t->wrv yet, because
178         the table size might change before we're ready to use them.
179         (tabi_table) Allocate them here instead.
180
181 Fri Jun  9 14:42:35 2006  Ben Pfaff  <blp@gnu.org>
182
183         Reform string library.
184         
185         * output.c (init_default_drivers): Update call to
186         configure_driver() to new interface.
187         (get_option_token) Use a modifiable substring in interface instead
188         of a separate position parameter.  Use ss_get_*() functions.
189         (configure_driver) Take and work with substrings.
190         (configure_driver_line) Update call to configure_driver() to new
191         interface.
192         (outp_get_paper_size) Use substrings.
193
194         * output.h (struct outp_class): Change open_driver interface to
195         use substring.  Update all implementations.
196
197         * table.c (text_format): Change to return substring.
198         (tab_title) Use xvasprintf().
199
200         * table.h (struct tab_table): Change title member to char *.
201
202 Thu May 25 18:02:53 WST 2006 John Darrington <john@darrington.wattle.id.au>
203
204         * table.c: Removed redundant extern declaration.
205
206 Sun May 14 14:03:56 2006  Ben Pfaff  <blp@gnu.org>
207
208         * output.c (outp_eject_page): Always make sure that a page is open
209         upon return.
210
211 Sun May 14 13:54:58 2006  Ben Pfaff  <blp@gnu.org>
212
213         * postscript.c: (ps_chart_finalise) Fix format of %%EndDocument
214         comment, which screwed up gv's idea of where one page ended and
215         the next one began.  Thanks to John Darrington for pointing out
216         the bug.
217
218 Sun Apr 16 11:48:25 2006  Ben Pfaff  <blp@gnu.org>
219
220         Start reforming error message support.  In this phase, we get rid
221         of "installation errors" and change all uses of msg() in the
222         output drivers to uses of error() or error_at_line().
223
224         * Removed all inclusion of <libpspp/message.h> in this directory.
225
226         * output.c: Changed all uses of msg() to error() or
227         error_at_line().
228         (outp_read_devices) Maintain line number in int variable instead
229         of "struct file_locator".
230         (tokener) Renamed get_option_token(), rewritten, changed interface.
231         (outp_parse_options) Change `options' argument to type const
232         struct string *.  Rewritten.
233         (configure_driver) Passes a struct string * to ->open_driver()
234         instead of char *.
235         (outp_get_paper_size) Maintain line number in int variable instead
236         of "struct file_locator".  Removed stupid cache.
237
238         * output.h: (struct outp_class) Change `open_driver' function to
239         take const struct string * instead of const char *.  Updated all
240         implementations.
241
242 Mon Apr  3 11:14:38 2006  Ben Pfaff  <blp@gnu.org>
243
244         Rewrite a lot of the output drivers and infrastructure.
245         Started transitioning from msg() to error().
246         Vertical rules in tables now default to putting a small gap
247         between columns, instead of no gap or rule at all.
248         See NEWS for user-visible changes.
249
250         * automake.mk: (output_sources) Add afm.c, afm.h.  Remove font.h,
251         groff-font.c.
252         
253         * afm.c, afm.h: New files.
254
255         * font.h: Removed.
256
257         * groff-font.c: Removed.
258         
259         * ascii.c: Rewrote and simplified.
260
261         * html.c: Ditto.
262
263         * postscript.c: Ditto.
264
265         * output.c: (struct outp_driver_class_list) Move here from
266         output.h.  Remove ref_count member and all references to it.
267         (outp_init) Remove epsf_class references.
268         (init_default_drivers) Use new configure_driver_line() interface.
269         (parse_options) Renamed outp_parse_options(), changed interface.
270         (configure_driver) Changed args from `const char *'s to `const
271         struct string *'s.  Rewrote.  Don't call ->open_global().  Now
272         just calls ->open_driver() instead of ->preopen_driver(),
273         ->option(), ->postopen_driver().
274         (configure_driver_line) Adapt to new configure_driver() interface.
275         (destroy_driver) Don't call ->close_global().
276         (option_cmp) Removed.
277         (outp_match_keyword) Rewrite for simplicity.
278         (outp_open_page) New function.  Changed all equivalent
279         functionality to use this function instead.
280         (outp_close_page) Ditto.
281         (outp_eject_page) Use above functions.
282         (outp_string_width) Add font argument and change all callers to
283         pass one.
284
285         * output.h: (struct rect) Removed.
286         (OUTP_L_*) Name this enumeration "enum outp_line_style".
287         (OUTP_L_SPECIAL) Removed.
288         (struct color) Removed.
289         (OUTP_F_*) Removed.
290         (struct outp_styles) Removed.
291         (OUTP_T_*) Removed.
292         (enum outp_justification) New, containing OUTP_RIGHT, OUTP_LEFT,
293         OUTP_CENTER.
294         (enum outp_font) New, containing OUTP_FIXED, OUTP_PROPORTIONAL,
295         and OUTP_EMPHASIS.
296         (struct outp_text) Replaced `options' member by `font' and
297         `justification'.  Renamed `s' to `string'.  Removed `w', `l'.
298         Updated all usages.
299         (struct outp_class) Removed `magic', `open_global',
300         `close_global', `font_sizes', `preopen_driver', `option',
301         `postopen_driver', `line_horz', `line_vert', `line_intersection',
302         `box', `polyline_begin', `polyline_point', `polyline_end',
303         `text_set_font_by_name', `text_set_font_by_position',
304         `text_set_font_family', `text_get_font_name',
305         `text_get_font_family', `text_set_Size', and `text_get_size'
306         members.  Added `open_driver', `close_driver', `line' members.
307         Changed interface of `open_page', `close_page', `text_metrics',
308         `text_draw' members.  Updated all usages.
309         (struct outp_driver) Rearranged members.  Removed `driver_open',
310         `res', `horiz', `vert', `horiz_line_spacing', `vert_line_spacing'
311         members.
312         (struct outp_option_info) Removed.
313         (struct outp_driver_class_list) Removed.
314         (outp_match_keyword) Changed interface.
315
316         * table.c: (tab_create) Now ignores reallocable argument: tables
317         can always be reallocated.  Use pool_create_container().
318         Initialize vertical rules to UCHAR_MAX.
319         (options_to_font) New function.
320         (tab_destroy) Remove futile assignment.
321         (tab_realloc) Initialize vertical rules to UCHAR_MAX.
322         (text_format) Use xvasprintf() instead of local_alloc().
323         (tab_title) Always format the argument, and drop the option
324         argument.  Change all callers to agree.
325         (tab_natural_width) Adapt to new ->text_metrics() interface.
326         (tab_natural_height) Ditto.
327         (tab_joint_text) Clear rules within the joined cell.  Now
328         necessary because of the default to put spacing between cells.
329         (tab_output_text) Use xvasprintf() instead of local_alloc().
330         Remove special cases for fixed-width font.
331         (rule_to_spacing_type) New function.
332         (tabi_driver) Calculate rule widths manually now that we don't
333         have ->trh or ->trv.  Implement new default for vertical rules.
334         (render_rows) New function.
335         (tabi_render) Rewrite in terms of render_rows() for clarity.
336         (translate_justification) New function.
337         (rule_to_draw_type) New function.
338         (get_hrule) New function.
339         (get_vrule) New function.
340         (render_horz_rule) New function.
341         (render_vert_rule) New function.
342         (render_rule_intersection) New function.
343         (strip_width) New function.
344         (strip_height) New function.
345         (render_cell) New function.
346         (render_strip) Rewrite in terms of new functions.
347
348         * table.h: (TAB_EMPH) New flag.
349         (TAB_FIX) New flag.
350         (TAL_3) Removed.
351         (TAL_GAP) Added.
352         (TAL_SPACING) Removed.
353         (struct tab_table) Members `trh', `hrv', `hr_tot', `vr_tot'
354         removed.
355         [DEBUGGING] (reallocable) Removed.
356         (TAT_FIX) Removed.  All references replaced by TAB_FIX.
357         (TAT_TITLE) Now implies TAB_EMPH.
358                 
359 Thu Mar 30 16:26:56 2006  Ben Pfaff  <blp@gnu.org>
360
361         * output.c: (colon_tokenize) Removed.
362         (configure_driver_line) Rewrote to use ds_separate().  Fixed leak.
363
364 Tue Mar 28 13:50:53 WST 2006 John Darrington <john@darrington.wattle.id.au>
365
366         * html.c, postscript.c, output.c:  Changed to fit the new signature 
367         of fn_interp_vars
368         
369 Sun Mar  5 13:19:32 2006  Ben Pfaff  <blp@gnu.org>
370
371         * postscript.c: (postopen) Fix segfault when the active file has
372         no title.
373
374 Sat Mar  4 13:48:16 2006  Ben Pfaff  <blp@gnu.org>
375
376         We didn't provide a way to define these macros, so obviously
377         there's little demand for them.
378
379         * html.c: Don't test for NO_HTML.
380
381         * postscript.c: Don't test for NO_POSTSCRIPT.
382
383         * output.c: Don't test for either of those.
384
385 Thu Mar  2 08:40:33 WST 2006 John Darrington <john@darrington.wattle.id.au>
386         
387         * Moved files from src directory