e649e8032833c271256f7d5261cf6c4d096d9c47
[pspp-builds.git] / src / ChangeLog
1         * Replaced '_' with '-' in most filenames.
2
3         * Renamed files as follows:
4                 vfm.[ch] to procedure.[ch]
5                 error.[ch] to message.[ch]
6                 getl.[ch] to line-buffer.[ch]
7                 mkfile.[ch] to make-file.[ch]
8                 pfm-write.h to por-file-writer.h
9                 pfm-write.c to por-file-writer.c
10                 sfmP.h to sfm-private.h
11                 lex-def.c to identifier.c
12                 lex-def.h to identifier.h
13                 sfm-read.c to sys-file-reader.c
14                 sfm-read.h to sys-file-reader.h
15                 sfm-write.h to sys-file-writer.h
16                 sfm-write.c to sys-file-writer.c
17                 chart.[ch] to chart-geometry.[ch]
18                 val.h to value.h
19                 var.h to variable.h
20                 vars-atr.c to variable.c
21                 ctl-stack.c to control-stack.c
22                 ctl-stack.h to control-stack.h
23                 dfm-read.c to data-reader.c
24                 dfm-write.c to data-writer.c
25                 dfm-write.h to data-writer.h
26                 dfm-read.h to data-reader.h
27                 apply-dict.c to apply-dictionary.c
28                 mis-val.c to missing-values.c
29                 sysfile-info.c to sys-file-info.c
30                 modify-vars.c to modifiy-variables.c
31                 rename-vars.c to rename-variables.c
32                 val-labs.c to value-labels.c
33                 var-display.c to variable-display.c
34                 var-labs.c to variable-label.c
35                 format-prs.c to format-parser.c
36                 range-prs.c to range-parser.c
37                 range-prs.h to range-parser.h
38                 subclist.c to subcommand-list.c
39                 subclist.h to subcommand-list.h
40                 vars-prs.c to variable-parser.c
41                 descript.c to descriptives.c
42                 sort-prs.c to sort-criteria.c/sort-cases.c
43                 sort-prs.h to sort-criteria.h
44                 sel-if.c to select-if.c
45                 algorithm.c to array.c
46                 algorithm.h to array.h
47                 bitvector.h to bit-vector.h
48                 som.c to manager.c
49                 som.h to manager.h
50                 tab.h to table.h
51                 tab.c to table.c
52                 readln.c to read-line.c
53                 readln.h to read-line.h
54                 cmdline.c to command-line.c
55                 cmdline.h to command-line.h
56
57
58 Sat Feb 11 22:35:20 2006  Ben Pfaff  <blp@gnu.org>
59
60         General clean-ups and minor bug fixes.
61
62         * filename.h: Move DIR_SEPARATOR, PATH_SEPARATOR here from
63         pref.h.orig.
64
65         * lex-def.h: (macro CHAR_IS_ID1) Removed.  All references changed
66         to lex_is_id1().
67         (macro CHAR_IS_IDN) Removed.  All references changed to
68         lex_is_idn().
69         
70         * lex-def.c: (lex_is_id1) New function.
71         (lex_is_idn) New function.
72         (lex_skip_identifier) New function.
73         (lex_id_match_len) Return bool instead of int.
74         (lex_id_match) Ditto.
75
76         * command.c: (parse_command_name) Convert parsed words to
77         uppercase to make error messages easier to read.
78         (cmd_host) Fix return value.
79
80         * dfm-read.c: (read_inline_record) Use tokens to check for BEGIN
81         DATA, not specialized lexical analysis.
82
83         * print.c: (print_space_trns_proc) Count of lines should be `int',
84         otherwise we might never finish.
85         (print_space_trns_free) Close writer.
86
87         * lexer.c: (enum string_type) New enum.
88         (lex_get) Remove essentially unused local variable `cp'.
89         Use enum string_type values.  Use parse_id().
90         (parse_id) New function.
91         (lex_look_ahead) Recognize octal strings too.
92         (strip_comments) New function.
93         (lex_get_line) Rewrite.
94         (lex_preprocess_line) Removed.
95         (convert_numeric_string_to_char_string) Use enum string_type.
96         (parse_string) Ditto.
97
98         * autorecode.c: (recode) Clone correct number of bytes based on
99         source string width.
100
101 Sat Feb 11 22:34:38 2006  Ben Pfaff  <blp@gnu.org>
102
103         Reduce dependencies on getl, and of getl.
104
105         * data-in.c: (vdls_error) Don't output different message depending
106         on whether we're interactive.
107
108         * getl.h: (struct getl_line_list) Removed.
109         (struct getl_script) Removed.
110         (GETL_PRPT_*) Removed.
111         (GETL_MODE_*) Removed.
112         (GETL_PROMPT_FIRST, GETL_PROMPT_LATER, GETL_PROMPT_DATA,
113         GETL_PROMPT_CNT) New enums.
114
115         * settings.c: (static var prompt) Removed.
116         (static var cprompt) Removed.
117         (static var dprompt) Removed.
118         (settings_done) Don't initialize prompt, cprompt, dprompt.
119         (get_prompt) Removed.
120         (set_prompt) Removed.
121         (get_dprompt) Removed.
122         (set_dprompt) Removed.
123         (get_cprompt) Removed.
124         (set_cprompt) Removed.
125
126         * pfm-read.c: (corrupt_msg) Don't show filename and line number,
127         to get rid of getl_location().
128
129         * sfm-read.c: (corrupt_msg) Ditto.
130
131         * getl.c: (struct getl_source) New.
132         (static var cur_source) New.
133         (static var last_source) New.
134         (static var DO_REPEAT_level) Removed.
135         (global var getl_head) Removed.
136         (global var getl_tail) Removed.
137         (getl_initialize) Call init_prompts().
138         (getl_add_file) Removed.
139         (getl_include) Removed.
140         (getl_add_DO_REPEAT_file) Removed.
141         (getl_handle_line_buffer) Removed.
142         (getl_close_file) Removed.
143         (getl_close_all) Removed.
144         (getl_is_separate) Removed.
145         (getl_set_separate) Removed.
146         (getl_reading_script) Removed.
147         (append_source) New function.
148         (include_source) New function.
149         (create_source) New function.
150         (create_syntax_file_source) New function.
151         (create_filter_source) New function.
152         (create_function_source) New function.
153         (create_interactive_source) New function.
154         (getl_append_syntax_file) New function.
155         (getl_include_syntax_file) New function.
156         (getl_include_filter) New function.
157         (getl_include_function) New function.
158         (getl_append_interactive) New function.
159         (getl_abort_noninteractive) New function.
160         (getl_is_interactive) New function.
161         (close_source) New function.
162         (getl_location) Use new `cur_source' var.
163         (getl_uninitialize) Use close_source().  Call uninit_prompts().
164         (read_syntax_file) New function.
165         (read_line_from_source) New function.
166         (do_read_line) New function.
167         (getl_read_line) Rewrite.
168         (static var prompts) New.
169         (static var current_style) New.
170         (init_prompts) New function.
171         (uninit_prompts) New function.
172         (getl_get_prompt) New function.
173         (getl_set_prompt) New function.
174         (getl_set_prompt_style) New function.
175         (get_prompt) New function.
176
177         * command.c: Merge the EXIT (aka Q, aka QUIT) and FINISH commands,
178         and make EXIT undocumented.  EXIT was a PSPP extension that never
179         really entirely made sense.
180         (cmd_exit) Removed.
181         (cmd_finish) Return CMD_EOF unconditionally.
182         (cmd_clear_transformations) Drop requirement of interactivity.
183
184         * command.def: Merge the EXIT (aka Q, aka QUIT) and FINISH
185         commands.
186
187         * repeat.c: Major changes to match getl revision.
188         (struct line_list) New struct.
189         (enum repeat_entry_type) New.
190         (struct repeat_entry) Made `type' an enum repeat_entry_type.
191         (struct repeat_block) New.
192         (static var repeat_tab) Removed.
193         (static var count) Removed.
194         (static var line_buf_head) Removed.
195         (static var line_buf_tail) Removed.
196         (cmd_do_repeat) Rewritten.
197         (clean_up) Removed.
198         (append_record) Removed.
199         (recognize_keyword) New function.
200         (internal_cmd_do_repeat) Removed.
201         (parse_specification) New function.
202         (skip_indentor) New function.
203         (recognize_do_repeat) New function.
204         (recognize_end_repeat) New function.
205         (parse_lines) New function.
206         (create_vars) New function.
207         (parse_ids) Use enum repeat_entry_type.
208         (parse_strings) Ditto.
209         (find_DO_REPEAT_substitution) Renamed find_substitution(),
210         rewrote.
211         (perform_DO_REPEAT_substitutions) Renamed do_repeat_filter(),
212         rewrote.
213         (do_repeat_read) New function.
214         (do_repeat_close) New function.
215
216         * data-list.c: Don't need to keep track of eof from getl anymore,
217         because getl can tell us now.
218         (struct data_list_pgm) Removed `eof' member.
219         (cmd_data_list) Don't assign to `eof'.
220         (get_data_list_read_func) Renamed read_from_data_list(), changed
221         interface.
222         (read_from_data_list_fixed) Changed interface.
223         (read_from_data_list_free) Changed interface.
224         (read_from_data_list_list) Changed interface.
225         (data_list_trns_proc) Rewrote based on dfm_eof() and
226         dfm_reader_error().
227         (data_list_source_read) Check for dfm reader errors.
228
229         * dfm-read.c: (enum dfm_reader_flags) Removed DFM_EOF in favor of
230         new `eof_cnt' member in struct dfm_reader.
231         (struct dfm_reader) New `eof_cnt' member.
232         (dfm_close_reader) Check `eof_cnt', not DFM_EOF.
233         (dfm_open_reader) Initialize `eof_cnt'.
234         (read_inline_record) Set prompt style with
235         getl_set_prompt_style().  
236         (read_record) Rewrite.
237         (cmd_begin_data) Set prompt style with getl_set_prompt_style().
238
239         * include.c: (cmd_include) Use getl_include_syntax_file().
240
241         * set.q: (cmd_set) Use getl_set_prompt().
242
243         * html.c: (postopen) Remove "source-file" expansion variable, to
244         avoid use of getl_location().
245
246         * postscript.c: (postopen) Remove "source-file" expansion
247         variable, to avoid use of getl_location().
248
249         * cmdline.c: (parse_command_line) Drop -c command line option,
250         because it wasn't very useful.  -i command line option now calls
251         getl_append_interactive().  Use new getl function interfaces.
252         Drop support for clearing dictionary between syntax files and thus
253         the "+" command line syntax.
254         (static var pre_syntax_message) Remove description of now-gone -c
255         option.  Remove "+" command line syntax.
256
257         * main.c: (main) Only call handle_error() if the return value is
258         an error.
259         (execute_command) Use getl_set_prompt_style().  Drop support for
260         clearing dictionary between syntax files.
261         (handle_error) Handle CMD_CASCADING_FAILURE.  Don't call err_break().
262
263         * readln.c: Drop lots of #ifdefs.  Now that the Autoconf tests are
264         pickier, we can just use HAVE_READLINE.
265         (static var welcomed) Move into welcome().
266         (welcome) Make `welcomed' a local static var.  Check for and read
267         history file here.
268         (global var getl_mode) Removed.
269         (global var getl_interactive) Removed.
270         (global var getl_prompt) Removed.
271         (getl_read_line) removed.
272         (readln_read) New function.
273         (read_console) Removed.
274         
275
276 Sat Feb 11 22:16:21 2006  Ben Pfaff  <blp@gnu.org>
277
278         Try to reduce some of the nastier dependencies on the error
279         module, and at the same time make PSPP nicer to deal with, by
280         getting rid of fatal errors.  All the existing calls to msg (FE,
281         ...) or err_cond_fail() or err_failure() have been replaced by
282         propagating an error upward to the command-dispatch layer.
283         Unfortunately this propagation took a fair bit of extra mechanism,
284         because now a lot of functions can fail that couldn't before.
285
286         New command return value CMD_CASCADING_FAILURE which indicates to
287         the command processor that syntax file processing should be
288         abandoned.  Many commands were modified to return
289         CMD_CASCADING_FAILURE.  When this modification was trivial it
290         isn't mentioned in detail below.
291
292         Transformation procedures (trns_proc_func) and free functions
293         (trns_free_func) now have a `bool' return type, which is normally
294         true, but false when an I/O or other serious error occurs.  All
295         transformation functions were modified to have this return type.
296         When this modification was trivial it isn't mentioned in detail
297         below.
298
299         * pspp-error.h: (FE) Removed this error class.
300
301         * error.c: (err_failure) Removed.
302         (err_cond_fail) Removed.
303         (err_break) Removed (it was unused).
304         (err_check_count) Don't cause a fatal error--instead, stop reading
305         the syntax file.
306         (err_vmsg) Don't have FE anymore, so no need to call terminate().
307
308         * any-reader.c: (any_reader_error) New function.
309
310         * any-writer.c: (any_writer_write) Propagate
311         scratch_writer_write_case()'s new return value.
312         (any_writer_error) New function.
313         (any_writer_close) Propagate underlying function's new return
314         value.
315
316         * casefile.c: Add an "error state" to a casefile.  A casefile that
317         encounters an I/O error enters the error state, and afterward
318         reading and writing cases fails.
319         (struct casefile) Add `ok' member.
320         (casefile_create) Set `ok' to true.
321         (casefile_destroy) Use io_error().
322         (casefile_error) New function.
323         (casefile_sleep) Now returns bool to indicate success.
324         (casefile_append) Ditto.
325         (casefile_append_xfer) Ditto.
326         (casefile_to_disk) Ditto.
327         (write_case_to_disk) Don't do anything in error state.
328         (flush_buffer) Don't do anything in error state.  Use io_error().
329         (reader_open_file) Ditto.
330         (fill_buffer) Ditto.
331         (casereader_read) Don't do anything in error state.  Handle
332         errors.
333         (casereader_read_xfer_assert) Removed, because now an I/O error
334         can occur even if the caller knows a case exists.
335         (io_error) New function.
336
337         * mkfile.c: (make_temp_file) Make failure non-fatal.
338         (make_unique_file_stream) Ditto.
339
340         * pfm-read.c: Add an error state.
341         (struct pfm_reader) Add `ok' member to indicate error state.
342         (error) Set `ok' to false.
343         (pfm_open_reader) Set `ok' to true.  Make failure non-fatal.
344         (pfm_read_case) Don't do anything in error state.
345         (pfm_read_error) New function.
346
347         * pfm-write.c: Postpone most error checking in favor of checking
348         ferror() afterward.
349         (pfm_open_writer) Make failure non-fatal.  Check for write error
350         after writing header.
351         (buf_write) Don't do anything if error has occurred.  Postpone
352         error checking.  Change return type to void.
353         (write_float) Postpone error checking.  Change return type to
354         void.
355         (write_int) Ditto.
356         (write_string) Ditto.
357         (write_header) Ditto.
358         (write_version_data) Ditto.
359         (write_format) Ditto.
360         (write_value) Ditto.
361         (write_variables) Ditto.
362         (write_value_labels) Ditto.
363         (pfm_write_case) Don't do anything if error has occurred.
364         (pfm_write_error) New function.
365         (pfm_close_writer) Change return type to bool.  Return false if an
366         I/O error occurred.
367
368         * scratch-reader.c: (scratch_reader_error) New function.
369
370         * scratch-writer.c: (scratch_writer_write_case) Change return type
371         to bool.  Propagate casefile error return.
372         (scratch_writer_error) New function.
373         (scratch_writer_close) Change return type to bool.  Propagate
374         casefile error return.
375
376         * sfm-read.c: Add an error state.
377         (struct sfm_reader) Add `ok' member.
378         (sfm_open_reader) Initialize `ok'.  Make errors non-fatal.
379         (buf_read) Set `ok' to false on error.
380         (buffer_input) Do nothing in error state.  Set `ok' to false on
381         error.
382         (read_compressed_data) Set `ok' false on error.
383         (sfm_read_case) Return false in error state.
384         (fread_ok) Set `ok' false on error.
385         (sfm_read_error) New function.
386
387         * sfm-write.c: Postpone most error checking in favor of checking
388         ferror() afterward.
389         (sfm_open_writer) Make failure non-fatal.  Check for write error
390         after writing header.
391         (write_header) Postpone error checking.  Change return type to
392         void.
393         (write_variable) Ditto.
394         (write_value_labels) Ditto.
395         (write_documents) Ditto.
396         (write_variable_display_parameters) Ditto.
397         (write_longvar_table) Ditto.
398         (write_rec_7_34) Ditto.
399         (buf_write) Ditto.
400         (ensure_buf_space) Ditto.
401         (sfm_write_case) Do nothing if write error has occurred.
402         (sfm_write_error) New function.
403         (pfm_close_writer) Change return type to bool.  Return false if an
404         I/O error occurred.
405
406         * var.h: Introduced a new return value for trns_proc_func that
407         means "a serious error has occurred, so abort the procedure
408         entirely".  Because the hard-coded values of -1, -2, etc. were
409         becoming even a worse idea now, also introduced some macros for
410         them: TRNS_CONTINUE, TRNS_DROP_CASE, TRNS_ERROR, TRNS_NEXT_CASE,
411         TRNS_END_FILE.  Also replaced all references to the hard-coded
412         values by uses of the macros.
413         
414         * command.h: New command return value CMD_CASCADING_FAILURE which
415         indicates to the command processor that syntax file processing
416         should be abandoned.
417
418         * dfm-read.c: (dfm_open_reader) Make failure non-fatal.
419         (dfm_reader_error) New function.
420         (read_inline_record) Make unexpected end of file nonfatal.
421         (read_file_record) Make read error nonfatal.
422         (dfm_eof) Make second unexpected end of file nonfatal.
423         (cmd_begin_data) Make errors nonfatal.  
424         
425         * dfm-write.c: (dfm_open_writer) Make failure non-fatal.
426         (dfm_write_error) New function.
427         (dfm_put_record) Do nothing in error state.  Now return error
428         state.
429         (dfm_close_reader) Now return `bool' indicating error state.
430
431         * file-type.c: (file_type_source_read) Now return `bool'
432         indicating error state.
433
434         * get.c: (case_reader_source_read) Now return `bool' indicating
435         write error.
436         (case_writer_destroy) Ditto.
437         (case_writer_write_case) Ditto.
438         (struct mtf_proc) New member `ok' indicating error state.
439         (cmd_match_files) Initialize and deal with `ok'.
440         (mtf_processing_finish) Now return `bool' indicating I/O error.
441         (mtf_free_file) Renamed mtf_close_file().  Now return `bool'
442         indicating I/O error.
443         (mtf_free) Now return `bool' indicating I/O error.
444         (mtf_delete_file_in_place) Ditto.
445         (mtf_read_nonactive_records) Ditto.
446         (mtf_processing) Ditto.
447
448         * inpt-pgm.c: (input_program_source_read) Now return `bool'
449         indicating I/O error.  Handle new TRNS_ERROR transformation return
450         value.
451
452         * matrix-data.c: Introduce error state.
453         (cmd_matrix_data) Check error return values.
454         (read_matrices_without_rowtype) Now return `bool' indicating I/O
455         error.
456         (matrix_data_read_without_rowtype) Ditto.
457         (dump_cell_content) Ditto.
458         (nr_output_data) Ditto.
459         (read_matrices_with_rowtype) Ditto.
460         (matrix_data_read_with_rowtype) Ditto.
461         (wr_output_data) Ditto.
462
463         * lexer.c: (lex_init) Make unexpected eof non-fatal.
464         (lex_get) Ditto.
465         (lex_look_ahead) Ditto.
466         (unexpected_eof) Removed.
467         (convert_numeric_string_to_char_string) Make unexpected eof
468         non-fatal.
469         (parse_string) Ditto.
470
471         * flip.c: Make I/O errors non-fatal.
472         (struct flip_pgm) Add `pool', `output_buf' members.
473         (cmd_flip) Create and use pool.  Propagate errors.
474         (destroy_flip_pgm) Rewrite, using pool.
475         (struct flip_sink_info) Removed.
476         (flip_sink_create) Use pool.  Make errors non-fatal.
477         (flip_sink_write) Make errors non-fatal.
478         (flip_file) Make errors non-fatal.  Make `bool' return type to
479         indicate failure.
480         (flip_sink_destroy) Remove.
481         (static var flip_sink_class) Use NULL as destroy func, not
482         flip_sink_destroy().
483
484         * sort.c: Make I/O errors non-fatal.  Propagate errors.
485         (sort_active_file_in_place) Propagate errors.
486         (sort_active_file_to_casefile) Ditto.
487         (do_internal_sort) Ditto.
488         (do_external_sort) Ditto.
489         (write_runs) Ditto.
490         (destroy_initial_run_state) Propagate errors via new `bool' return
491         type.
492         (merge) Propagate errors.
493         (merge_once) Ditto.
494
495         * output.c: [GLOBAL_DEBUGGING] Remove reentrancy detection,
496         because it used msg (FE, ...) and wasn't very useful.
497
498         * main.c: (handle_error) Handle CMD_CASCADING_FAILURE.
499
500         * vfm.c: (struct write_case_data) Change `proc_func' return type
501         to bool.
502         (procedure) Add `bool' return type to indicate I/O error.
503         Propagate errors.
504         (internal_procedure) Ditto.
505         (write_case) Ditto.
506         (execute_transformations) If a transformation returns TRNS_ERROR,
507         propagate the error.
508         (close_active_file) Add `bool' return type to indicate I/O error.
509         Propagate errors.
510         (cancel_transformations) Add `bool' return type to indicate I/O
511         error.  Propagate errors.
512         (struct split_aux_data) Change `proc_func' return type to bool.
513         (procedure_with_splits) Change `proc_func' return type to bool.
514         Add `bool' return type to indicate I/O error.
515         (multipass_procedure_with_splits) Change `split_func' return type
516         to bool.  Add `bool' return type to indicate I/O error.
517         (multipass_split_callback) Add `bool' return type to indicate I/O
518         error.  Propagate errors.
519
520         * vfm.h: (struct case_source_class) Change `read' return type from
521         void to bool to allow reporting I/O errors.  Updated all
522         implementations to do so.
523         (struct case_sink_class) Change `write' return type from void to
524         bool to allow reporting I/O errors.  Updated all implementations
525         to do so.
526
527 Sun Feb 12 18:12:56 2006  Ben Pfaff  <blp@gnu.org>
528
529         * pool.c: Useful new functions.
530         (pool_tmpfile) New function.
531         (pool_attach_file) New function.
532         (pool_detach_file) New function.
533         (pool_fopen) Reimplement in terms of pool_attach_file().
534         (pool_fclose) Reimplement in terms of pool_detach_file().  Fix
535         double-free.
536
537         * str.c: Useful new functions.
538         (ds_swap) New function.
539         (ds_rtrim_spaces) New function.
540         (ds_chomp) New function.
541         (ds_is_empty) New function.
542         (ds_first) New function.
543         (ds_last) New function.
544
545 Sat Feb 11 21:51:21 2006  Ben Pfaff  <blp@gnu.org>
546
547         Get rid of finished, start_interactive globals.
548
549         * command.c: (cmd_exit) Instead of setting `finished', return
550         CMD_EOF.
551         (cmd_finish) Ditto.
552
553         * command.h: New enum CMD_EOF.
554
555         * main.c: (global var finished) Removed.
556         (global var start_interactive) Removed.
557         (main) Execute commands until CMD_EOF is the return value.
558         If parse_command_line() returns false, don't execute any commands
559         at all.
560
561         * cmdline.c: (parse_command_line) If the command line indicates we
562         shouldn't execute syntax files, return false instead of
563         terminating.
564         (usage) Don't terminate.
565
566 Sat Feb 11 21:48:31 2006  Ben Pfaff  <blp@gnu.org>
567
568         Get rid of cur_proc global.  Replace by functions in err and tab
569         modules, which were the users.
570
571         * error.c: (static var command_name) New static var.
572         (err_vmsg) Use command_name.
573         (err_set_command_name) New function.
574
575         * tab.c: (static var command_name) New static var.
576         (tabi_title) Use command_name.
577         (tab_set_command_name) New function.
578
579         * command.c: (global var cur_proc) Removed.
580         (cmd_parse) Call err_set_command_name(), tab_set_command_name()
581         around executing command to set and clear command name.
582
583 Sat Feb 11 21:44:50 2006  Ben Pfaff  <blp@gnu.org>
584
585         Get rid of glob.c, glob.h.
586
587         * Makefile.am: (pspp_SOURCES) Remove glob.c, glob.h.
588         
589         * dictionary.c: Move default_dict definition here.
590
591         * glob.c: Removed.
592         (global var FILTER_before_TEMPORARY) Variable removed.  All
593         references deleted.  The info in this var was redundant with
594         temp_dict, so they were changed to use temp_dict where needed.
595
596         * glob.h: Removed.
597
598         * start-date.c: New file. Moved get_start_date() here.
599
600         * start-date.h: New file.
601
602 Fri Feb  3 20:34:52 2006  Ben Pfaff  <blp@gnu.org>
603  
604         * font.h: (struct font_set) Removed, because unused.
605  
606 Sat Jan 28 17:45:36 2006  Ben Pfaff  <blp@gnu.org>
607
608         Cleaner (faster?) way to compact cases.
609
610         * dictionary.c: (dict_compact_case) Removed.
611         (dict_needs_compaction) New function.
612         (struct copy_map) New structure.
613         (struct dict_compactor) New structure.
614         (dict_make_compactor) New function.
615         (dict_compactor_compact) New function.
616         (dict_compactor_destroy) New function.
617         
618 Sat Jan 28 17:24:22 2006  Ben Pfaff  <blp@gnu.org>
619
620         Cleanups.
621
622         * data-list.c: Make data_list_source_class static.
623         (dump_fixed_table) Use fh_get_name() to describe source of data.
624         (dump_free_table) Ditto.
625         (cmd_repeating_data) Eliminate special cases for inline file.
626
627         * dictionary.c: (dict_contains_var) Change return value from int to
628         bool.
629         (dict_rename_vars) Ditto.
630         (dict_create_vector) Ditto.
631
632 Sat Jan 28 17:20:50 2006  Ben Pfaff  <blp@gnu.org>
633
634         Add scratch file handles.
635
636         Now a file handle can refer to a disk file, to an in-memory
637         structure, or to the "inline" file, instead of just to a disk
638         file.  The introduction of new categories means that special cases
639         for the inline file in a few places could be eliminated, but it
640         also means that code that assumed that a handle refers to a file
641         has to check for that.
642
643         Also, now file handles can be freed, so code now must be sure not
644         to access a handle after closing it (with fh_close()).
645
646         * Makefile.am: Add any-reader.c, any-reader.h, any-writer.c,
647         any-writer.h, scratch-handle.c, scratch-handle.h,
648         scratch-reader.c, scratch-reader.h, scratch-writer.c,
649         scratch-writer.h to pspp_SOURCES.
650
651         * any-reader.c: New file.
652         
653         * any-reader.h: New file.
654         
655         * any-writer.c: New file.
656         
657         * any-writer.h: New file.
658
659         * scratch-handle.c: New file.
660         
661         * scratch-handle.h: New file.
662
663         * scratch-reader.c: New file.
664         
665         * scratch-reader.h: New file.
666
667         * scratch-writer.c: New file.
668         
669         * scratch-writer.h: New file.
670
671         * aggregate.c: Use an any_writer instead of an sfm_writer, to add
672         flexibility.
673
674         * apply-dict.c: Use an any_reader instead of an sfm_reader, to add
675         flexibility.
676
677         * command.def: Add CLOSE FILE HANDLE command.
678
679         * dfm-reader.c: Now fewer special cases for inline file.
680         (static var inline_open_cnt) Removed.
681         (static var inline_file) Removed.
682         (dfm_close_reader) Eliminate a special case for inline file.
683         Reorganize to avoid access-after-free.
684         (dfm_open_reader) Eliminate a special case for inline file.
685         (read_inline_record) Use bool instead of int.  No need to
686         increment line number.
687         (read_file_record) Use bool instead of int.
688         (read_record) Check whether file handle is inline file, instead of
689         for null pointer.
690         (dfm_eof) Ditto.
691         (dfm_expand_tabs) Ditto.
692         (dfm_push) Ditto.
693         (dfm_pop) Ditto.
694         (cmd_begin_data) Fix inaccurate check for whether the inline file
695         is in use--now we can tell by checking whether the inline file's
696         open count is positive.
697         
698         * file-handle-def.c: (struct file_handle) Reorder members.  Add
699         `deleted' member.  Add `referent' member.  Add `sh' member.
700         (static var default_handle) New variable.
701         (static var inline_file) New variable.
702         (fh_init) Initialize inline file.
703         (free_handle) New function.
704         (fh_done) Rewrite.
705         (fh_from_name) Don't return deleted handles.
706         (fh_from_filename) Ditto.
707         (fh_create) Removed.
708         (create_handle) New function.
709         (fh_create_file) New function.
710         (fh_create_scratch) New function.
711         (fh_inline_file) New function.
712         (fh_free) Rewrite.
713         (fh_open) Now requires a referent type mask and verifies it.  All
714         references updated.
715         (fh_close) If open_cnt goes to 0 on a deleted handle, free it.
716         (fh_is_open) New function.
717         (fh_get_referent) New function.
718         (fh_get_filename) Limit to handles that refer to files.
719         (fh_get_mode) Ditto.
720         (fh_get_record_width) Limit to handles that refer to files or the
721         inline file.
722         (fh_get_tab_width) Ditto.
723         (fh_get_scratch_handle) New function.
724         (fh_set_scratch_handle) New function.
725         (fh_get_default_handle) New function.
726         (fh_set_default_handle) New function.
727
728         * file-handle.h: (enum fh_referent) New type.
729         (enum fh_mode) Rename MODE_TEXT to FH_MODE_TEXT, MODE_BINARY to
730         FH_MODE_BINARY, and update all usages.
731
732         * file-handle.q: Add "scratch" as a possible mode.
733         (cmd_file_handle) Mention CLOSE FILE HANDLE in error message.
734         Use lex_end_of_command(), lex_sbc_missing().  Support creating
735         scratch handles.
736         (cmd_close_file_handle) New function.
737         (referent_name) New function.
738         (fh_parse) Now takes a referent type mask to specify handles that
739         can be accepted.  Updated all references.
740         
741         * filename.c: (fn_extension) New function.
742
743         * get.c: Use any_reader and any_writer and thereby merge code that
744         has been duplicated for each kind of file.  Also, we had something
745         here called `any_writer' before, so its name had to be changed to
746         `case_writer'.
747         (enum operation) Removed, because unused.
748         (struct get_pgm) Removed.
749         (get_pgm_free) Removed.
750         (get_source_destroy) Removed.
751         (get_source_read) Removed.
752         (global var get_source_class) Removed.
753         (static var case_reader_source_class) Removed.
754         (enum reader_command) New enum.
755         (struct case_reader_pgm) New struct.
756         (parse_read_command) New function.
757         (case_reader_pgm_free) New function.
758         (case_reader_source_destroy) New function.
759         (case_Reader_source_Read) New function.
760         (cmd_get) Rewrote as a call to parse_read_command().
761         (cmd_import) Ditto.
762         (struct any_writer) Rename to case_writer.  Drop `writer_type',
763         `writer' members in favor of an `any_writer' member named
764         `writer'.
765         (any_writer_destroy) Rename case_writer_destroy.  Use
766         any_writer_close().
767         (parse_write_command) Allow scratch files.  Use any_writer.
768         (any_writer_write_case) Rename case_writer_write_case().  Use
769         any_writer_write().
770 `       (struct mtf_file) Use any_reader.
771         (cmd_match_files) Allow scratch files.  Use any_reader.
772         (mtf_free_file) Use any_reader_close().
773         (mtf_read_nonactive_records) Use any_reader_read().
774         (mtf_processing) Use any_reader_read().
775         (struct import_pgm) Removed.
776         (import_pgm_free) Removed.
777         (import_source_destroy) Removed.
778         (import_source_read) Removed.
779         (global var import_source_class) Removed.
780
781         * glob.c: (global var default_handle) Removed.  Replaced all
782         references by fh_get_default_handle() or fh_set_default_handle().
783
784         * pfm-read.c: (static var portable_to_local) Moved from inside
785         read_header() to top level.
786         (pfm_detect) New function.
787
788         * pfm-write.c: (pfm_write_case) Make case argument const.
789         Reorganize to avoid access-after-free.
790
791         * print.c: (dump_table) Use fh_get_name() to describe source of
792         data.
793
794         * sfm-read.c: (sfm_close_reader) Reorganize to avoid
795         access-after-free.
796         (sfm_detect) New function.
797
798         * str.c: (str_lowercase) New function.
799
800         * vfm.c: Use new compaction interface.
801         (static var compaction_necessary) Removed.
802         (static var compactor) New variable.
803         (open_active_file) Initialize compactor.
804         (write_case) Use compactor.
805         (close_active_file) Free compactor.
806         
807 Wed Jan 11 19:28:39 2006  Ben Pfaff  <blp@gnu.org>
808
809         Clean up file handle code in preparation to add scratch file
810         handles.
811         
812         * file-handle-def.c: Lots of formatting cleanup.  Added function
813         comments.
814         (struct file_handle) Renamed `length' member
815         to `record_width'.  All references updated.
816         (fh_init) New function.  Moved here from file-handle.q.
817         (fh_done) New function.  Moved here from file-handle.q and
818         rewrote.
819         (get_handle_with_name) Renamed fh_from_name().
820         (get_handle_for_filename) Renamed fh_from_filename().
821         (create_file_handle) Renamed fh_create().  Changed to take a
822         `struct fh_properties' instead of discrete values.  Updated all
823         references.
824         (create_file_handle_with_defaults) Removed.  Updated all
825         references to use fh_create() with fh_default_properties().
826         (fh_default_properties) New function.
827         (destroy_file_handle) Removed.  The code is now in fh_done().
828         (handle_get_name) Renamed fh_get_name().
829         (handle_get_filename) Renamed fh_get_filename().
830         (handle_get_record_width) Renamed fh_get_record_width().
831         (handle_get_tab_width) Renamed fh_get_tab_width().
832
833         * file-handle-def.h: Formatting, comment fixes.
834         (enum file_handle_mode) Renamed struct fh_mode.
835         (struct fh_properties) New structure.
836         (fh_init) Move prototype here from file-handle.h.
837         (fh_done) Ditto.
838         (fh_close) Ditto.
839
840         * file-handle.q: (static var handle_list) Removed.
841         (fh_parse) Don't add handle to handle_list, because
842         file-handle-def.c has its own list.
843         (fh_init) Moved to file-handle-def.c.
844         (fh_done) Ditto.
845
846 Sun Jan 9 01:09  Jason Stover  <jason@sakla.net>
847
848         * regression.q: (run_regression) Moved coefficient initialization
849         to the linreg library. Altered other functions accordingly.
850
851 Sat Jan  7 13:30:54 WST 2006 John Darrington <john@darrington.wattle.id.au>
852
853         * command.c data-in.c main.c: Fixed bug which crept in when 
854           separating getl from readline.
855
856         * vars-atr.c value-labels.h: Fixed constness of  val_labs_count.
857
858 Fri Dec 23 20:59:01 WST 2005 John Darrington <john@darrington.wattle.id.au>
859
860         * getl.c error.c: Separated file_loc functionality from error.c
861
862 Mon Dec 19 14:01:56 WST 2005 John Darrington <john@darrington.wattle.id.au>
863
864         * format.c: Additional error checking.
865         * getl.[ch]: Separated into getl.c and readln.c
866         * settings.[ch]: Made CC_CNT public
867
868 Fri Dec 16 09:11:48 WST 2005 John Darrington <john@darrington.wattle.id.au>
869
870         * examine.q: Fixed buglet when cleaning up at end of procedure.
871
872 Tue Dec 13 22:34:42 2005  Ben Pfaff  <blp@gnu.org>
873
874         Move global initialization and cleanup code into main.c.
875         Remove vestigial log infrastructure.
876         Minor related cleanups.
877         
878         * command.c: (shell) When execl() fails, use _exit(), not
879         err_hcf().
880
881         * error.c: (err_hcf) Move into main.c, rename terminate().  All
882         callers updated.
883         (err_done) New function with just the error.c-specific code for
884         err_hcf().  Called by terminate().
885
886         * glob.c: Removed all Borland C, DJGPP cruft.
887         (init_glob) Merged into main().
888         (done_glob) Merged into terminate().
889         (get_date) Removed.
890         (get_start_date) New function.  All users of curdate updated to call
891         this function instead.
892
893         * lexer.c: (lex_init) Moved initialization of tokstr here, from
894         init_glob().
895         (lex_done) Moved destruction of tokstr here, from done_glob().
896
897         * main.c: (global var pgmname) Removed.  Changed all references to
898         program_name, which is defined by gnulib.
899         (global var curdate) Removed.
900         (main) Moved init_glob() code here.  Merged parse_script() in
901         here.
902         (parse_script) Removed.
903         (terminate) Moved err_hcf() here from error.c and renamed
904         terminate().  Merged done_glob() code in here.  Call err_done().
905         All callers updated.
906         (i18n_init) New function.
907         (fpu_init) New function.
908
909         * output.c: (outp_init) Make void.
910         (init_default_drivers) New function.
911         (outp_read_devices) If no drivers are initialized successfully,
912         call init_default_drivers() to initialize a default driver.
913         (outp_done) Make void.
914         (static var prog) Make const.
915         (parse_options) Make parameter const.
916         (colon_tokenize) Make return value const.
917         (configure_driver) Change prototype to take a broken-down driver
918         configuration instead of a line of text.
919         (configure_driver_line) New function that does what
920         configure_driver() did before.
921
922         * q2c.c: (global var pgmname) Rename program_name.
923
924         * settings.c: (settings_init) Renamed from init_settings().
925         (settings_done) Renamed from done_settings().
926
927         * vfm.c: (global var last_vfm_invocation) Make static.
928         (vfm_last_invocation) New function.  All references to
929         last_vfm_invocation update to call this.
930         (procedure) Call update_last_vfm_invocation().
931         (internal_procedure) Ditto.
932         (update_last_vfm_invocation) New function.
933         
934 Sat Dec 10 23:30:19 2005  Ben Pfaff  <blp@gnu.org>
935
936         Separate random numbers from other settings because of GSL
937         dependency.
938
939         * Makefile.am: Add random.c, random.h to sources.
940
941         * glob.c: (init_glob) Call random_init().
942         (done_glob) Call random_done().
943
944         * settings.c: (static var rng) Move to random.c.
945         (done_settings) Move freeing of RNG to random_done().
946         (get_rng) Move to random.c
947         (set_rng) Ditto.
948
949         * random.c: New file.
950
951         * random.h: New file.
952
953 Sat Dec 10 18:13:36 2005  Ben Pfaff  <blp@gnu.org>
954
955         Separate settings and the SET command, for modularity.
956         
957         * Makefile.am: Add settings.c to sources.
958
959         * glob.c: (global variable test_mode) Removed.
960
961         * set.q: Remove all the set_* variables.  Remove a lot of obsolete
962         SPSS/PC+ settings.  Remove the aux_*() routines.  Moved the
963         get_*() functions into settings.c.  Rewrite the settings code and
964         functions to call the new set_*() functions.  Rewrite custom
965         currency parsing.  Write new by-hand cmd_show().
966
967         * esttings.c: New file.  Moved the get_*() functions here from
968         set.q.  Created new set_*() functions to correspond with them.
969         Regularized the names and types of some functions and updated
970         their callers.  Added static, file-scope variables to support the
971         settings.
972
973         * q2c.c: Remove "aux" support, which was only needed by set.q.
974         
975 Sun Nov 27 06:43:46 WST 2005 John Darrington <john@darington.wattle.id.au>
976
977         * data-out.c format.h: Added return value to data_out function.
978
979         * value-labels.c: Fixed bug in val_labs_remove.
980
981 Sat Nov  5 18:37:26 2005  Ben Pfaff  <blp@gnu.org>
982
983         * Makefile.am: Remove devind.c, devind.h from list of source
984         files.
985
986         * devind.c: Removed.
987
988         * devind.h: Removed.
989
990         * list.q: Removed "support" for devind.
991
992         * output.c: Don't add devind class.
993
994 Sat Nov  5 18:21:00 2005  Ben Pfaff  <blp@gnu.org>
995
996         * var.h: (struct variable) Make `init', `reinit' bool values.
997         Rearrange fields.
998
999 Fri Nov  4 19:43:01 2005  Ben Pfaff  <blp@gnu.org>
1000
1001         * recode.c: Rewrote whole file, as clean-up.
1002
1003 Fri Nov  4 19:37:50 2005  Ben Pfaff  <blp@gnu.org>
1004
1005         * pool.c: Don't make alignment exception for x86.
1006         (pool_alloc) Return null for 0-size blocks.
1007         (pool_alloc_unaligned) New function.
1008         (pool_strndup) Removed.  Changed callers to use pool_clone_unaligned().
1009         (pool_clone_unaligned) New function.
1010         (pool_strdup) Use pool_clone_unaligned().
1011
1012         * var.h: (enum var_type) Give the NUMERIC, ALPHA enum this name.
1013         (struct variable) Use `enum var_type' for `type'.
1014
1015         * vars-atr.c: (var_type_adj) New function.
1016         (var_type_noun) New function.
1017
1018         * vars-prs: (parse_mixed_vars) Fix freeing code.
1019         (parse_mixed_vars_pool) New function.
1020
1021 Wed Nov  2 21:24:48 2005  Ben Pfaff  <blp@gnu.org>
1022
1023         * file-handle-def.c: Needed another #include, to avoid missing
1024         prototype warning.
1025
1026         * file-handle.q: (cmd_file_handle) Declarations must precede
1027         statements.  Free parse data on success as well as on failure, to
1028         avoid memory leak.
1029
1030         * get.c: (parse_write_command) Destroy dict on success, to avoid
1031         memory leak.
1032         
1033         * data-list.c: (cmd_repeating_data) Fix usage of saw_occurs,
1034         saw_length, saw_continued, saw_id, which were boolean but
1035         incorrectly treated as bitmaps as result of a previous
1036         half-finished cleanup.
1037
1038         * weight.c: (struct weight_trns) Unused, so removed.
1039
1040         * Makefile.am: Add range-prs.h to sources.
1041
1042 Wed Nov  2 21:24:15 2005  Ben Pfaff  <blp@gnu.org>
1043
1044         DO IF, LOOP cleanup.
1045
1046         * Makefile.am: Add ctl-stack.c, ctl-stack.h to source files.
1047         Reformat source file list to list one file per file, so that
1048         patches for future changes will be easier to read.
1049
1050         * ctl-stack.c, ctl-stack.h: New files.
1051
1052         * do-if.c: Rewrote whole file.
1053
1054         * do-ifP.h: Removed.
1055
1056         * loop.c: Rewrote whole file.
1057
1058         * glob.c: (global var ctl_stack) Move into ctl-stack.c.
1059
1060         * temporary.c: (cmd_temporary) Use ctl_stack_is_empty().
1061
1062         * vfm.c: (open_active_file) Use ctl_stack_clear().
1063
1064 Wed Nov  2 21:18:13 2005  Ben Pfaff  <blp@gnu.org>
1065
1066         New pool functions.
1067         
1068         * pool.c: (pool_create_at_offset) New function.
1069         (pool_add_subpool) New function.
1070
1071         * pool.h: (pool_create_container) New macro.
1072         
1073         * expressions/parse.c: (expr_parse_pool) New function.
1074         
1075         * autorecode.c: (recode) Use pool_create_container().
1076
1077         * count.c: (cmd_count) Ditto.
1078
1079 Wed Nov  2 19:59:32 2005  Ben Pfaff  <blp@gnu.org>
1080
1081         Clean up transformations, by getting rid of `struct trns_header',
1082         replacing it by `struct transformation' that has a void *
1083         `private' member.  Updated all uses of transformations to match,
1084         which was a lot of code.  Only major related changes listed below.
1085
1086         * compute.c: (cmd_if) Use get_proc_func().
1087         (cmd_compute) Use get_proc_func().
1088         (get_proc_func) New function.
1089
1090         * glob.c: (global var m_trns) Change type to size_t.
1091         (global var n_trns) Ditto.
1092         (global var f_trns) Ditto.
1093         (global var t_trns) Change type to struct transformation *.
1094
1095         * var.h: (struct trns_header) Removed.
1096         (struct transformation) New.
1097         (typedef trns_proc_func) Takes a void * instead of a struct
1098         trns_header *.
1099         (typedef trns_free_func) Ditto.
1100
1101         * vfm.c: (execute_transformations) Takes an array of
1102         transformations instead of trns_headers.
1103         (add_transformation) Change prototype from (trns_header *) to
1104         (trns_proc_func *, trns_free_func *, void *).
1105         (next_transformation) New function.
1106
1107 Sat Oct 29 16:25:36 2005  Ben Pfaff  <blp@gnu.org>
1108
1109         * count.c: Major cleanups.  Rename practically everything.
1110         Rewrite much of the code.  Use pools for memory management.  Use
1111         the new parse_num_range().
1112
1113         * mis-val.c: (cmd_missing_values) Use the new parse_num_range().
1114         (parse_number) Removed.
1115
1116         * missing-values.c: (mv_add_num_range) Don't add out-of-order
1117         ranges, e.g. where low > high.
1118
1119         * pool.c: (pool_2nrealloc) New function.
1120
1121         * range-prs.c: New file.
1122         (parse_num_range) New function.
1123         (parse_number) New function.
1124         
1125 Fri Oct 28 22:47:48 2005  Ben Pfaff  <blp@gnu.org>
1126
1127         Fix up potential overflows in size calculations by replacing
1128         instances of pool_alloc(p, x * sizeof *y) by pool_malloc(p, x,
1129         sizeof *y) everywhere I could find them.  Similarly by
1130         pool_malloc(), pool_realloc().
1131         (Order is important: pool_alloc(p, sizeof *y, x) will divide by 0
1132         if x is 0.)
1133
1134         * pool.c: (pool_nalloc) New function.
1135         (pool_nmalloc) New function.
1136         (pool_nrealloc) New function.
1137
1138 Thu Oct 27 11:16:53 WST 2005 John Darrington <john@darrington.wattle.id.au>
1139
1140         Separated the definition of a file handle object from the stuff 
1141         pertaining to the FILE HANDLE command.
1142
1143         * file-handle-def.[ch]: New files.
1144
1145         * dfm-read.c file-handle.h file-handle.q
1146         
1147 Tue Oct 25 21:56:23 2005  Ben Pfaff  <blp@gnu.org>
1148
1149         Fix up potential overflows in size calculations by replacing
1150         instances of xmalloc(x * sizeof *y) by xnmalloc(x, sizeof *y)
1151         everywhere I could find them.  Similarly by xrealloc(), malloc().
1152         (Order is important: xnmalloc(sizeof *y, x) will divide by 0 if x
1153         is 0.)
1154
1155         * alloc.c: (nmalloc) New function.
1156         (out_of_memory) Removed.  Replaced references by xalloc_die().
1157
1158         * sort.c: (allocate_cases) Fix segfault if memory allocation
1159         fails.
1160
1161         * subclist.c: (subc_list_double_create) Use xnmalloc() instead of
1162         malloc().
1163         (subc_list_double_push) Use xnrealloc() instead of realloc().
1164
1165 Wed Oct 26 08:43:51 WST 2005 John Darrington <john@darrington.wattle.id.au>
1166
1167         Dictionary abstraction part #2
1168
1169         * algorithm.c format.c str.c sysfile-info.c val.h var.h vars-atr.c:
1170           Removed unnecessary #include directives
1171
1172 Mon Oct 24 21:35:08 2005  Ben Pfaff  <blp@gnu.org>
1173
1174         * groff-font.c (font_msg): Use err_vmsg() instead of incorrectly
1175         trying to pass a va_list to tmsg().  Thanks to Jason Stover for
1176         reporting this bug.
1177
1178 Mon Oct 24 21:24:15 2005  Ben Pfaff  <blp@gnu.org>
1179
1180         Work to get rid of GCC 4.0 warnings, part 2.
1181
1182         In many files, change `unsigned char' to `char'.  This often
1183         requires adding casts to <ctype.h> functions.
1184
1185         * data-in.c: (parse_A) Use buf_copy_rpad().
1186
1187         * str.c: (str_copy_buf_trunc) New function.
1188
1189         * value-labels.c: (value_to_string) Fix mistaken use of strncpy(),
1190         by rewriting.
1191
1192 Mon Oct 24 13:42:32 WST 2005 John Darrington <john@darrington.wattle.id.au>
1193
1194         Moved some definitions to make it easier to abstract a dictionary 
1195         from the rest of PSPP.
1196
1197         * format-prs.c lex-def.[ch]:  New files.
1198
1199         * Makefile.am lexer.[ch] dictionary.c vars-atr.c vfm.c algorithm.c 
1200           format.c:  Moved some functions between modules.
1201         
1202 Sun Oct 23 19:28:08 2005  Ben Pfaff  <blp@gnu.org>
1203
1204         Work to get rid of GCC 4.0 warnings, part 1.
1205         
1206         In many files, change count parameters to parse_variables(),
1207         etc. from `int' to `size_t'.  Also change related variables and
1208         struct members.  Also change messages as needed (e.g. %d to %u
1209         with cast to unsigned).  Also change arithmetic as necessary
1210         (e.g. n >= m - 1 to n + 1 >= m). 
1211
1212         * crosstabs.q: (crs_custom_tables) Check for size_t overflow in
1213         multiplication.
1214
1215         * q2c.c: (dump_declarations) Generate code for size_t instead of
1216         int.
1217         
1218 Thu Oct 20 18:18:40 2005  Ben Pfaff  <blp@gnu.org>
1219
1220         * output.c: (outp_read_devices) Fix message.
1221
1222 Sat Sep 17 11:13:13 2005  Ben Pfaff  <blp@gnu.org>
1223
1224         * matrix-data.c: (cmd_matrix_data) Change type of variable whose
1225         address is passed to dict_get_vars() from size_t to int to match
1226         John's change below.
1227
1228         * modify-vars.c: (validate_var_modification) Ditto.
1229
1230 Mon Sep 12 19:26:06 WST 2005 John Darrington <john@darrington.wattle.id.au>
1231
1232         * dictionary.[ch]  Changed cnt from size_t* to int* since that's
1233         what it's called as, and on  x86_64 machines they're different sizes.
1234         
1235         * str.c: (ds_vprintf) Copied va_list args so they can be re-used
1236         
1237 Sun Aug 21 00:12:24 2005  Ben Pfaff  <blp@gnu.org>
1238
1239         * lexer.c: (lex_sbc_only_once) New function.
1240         (lex_sbc_missing) New function.
1241
1242 Sun Aug 21 00:00:47 2005  Ben Pfaff  <blp@gnu.org>
1243
1244         * case.h: (case_str) Make it return `unsigned char'.
1245
1246 Sat Aug 20 23:56:14 2005  Ben Pfaff  <blp@gnu.org>
1247
1248         Revamp SAVE, XSAVE, EXPORT.  Add (or at least parse) all the
1249         subcommands that we didn't support.  Fix bug 13911.  Fix bug
1250         reported by Adam Pierson (COMPRESSED and other subcommands didn't
1251         work on SAVE).  Refactor all related code.
1252         
1253         * command.def: Add XEXPORT command.
1254
1255         * dictionary.c: (dict_delete_scratch_vars) New function.
1256
1257         * get.c: (cmd_get) Fix parsing.
1258         (struct save_trns) Removed.
1259         (cmd_save_internal) Removed.
1260         (cmd_save) Removed.
1261         (do_write_case) Removed.
1262         (save_write_case_func) Removed.
1263         (save_trns_proc) Removed.
1264         (save_trns_free) Removed.
1265         (trim_dictionary) Removed.
1266         (struct export_proc) Removed.
1267         (cmd_export) Rewrote.
1268         (export_write_case_func) Removed.
1269         (export_proc_free) Removed.
1270         (enum writer_type) New enum.
1271         (enum command_type) New enum.
1272         (struct any_writer) New struct.
1273         (any_writer_destroy) New function.
1274         (parse_write_command) New function.
1275         (any_writer_write_case) New function.
1276         (parse_output_proc) New function.
1277         (output_proc) New function.
1278         (cmd_save) Rewrote.
1279         (cmd_xsave) Rewrote.
1280         (struct output_trns) New struct.
1281         (parse_output_trns) New function.
1282         (output_trns_proc) New function.
1283         (output_trns_free) New function.
1284         (cmd_xsave) Rewrote.
1285         (cmd_xexport) New function.
1286         (parse_dict_trim) New function.
1287         (struct mtf_proc) Change `by_cnt' member type to `int'.
1288         (cmd_import) Rewrote.
1289
1290         * pfm-write.c: (struct pfm_writer) Add `digits' member.
1291         (pfm_writer_default_options) New function.
1292         (pfm_open_writer) Add `opts' argument and handle options.
1293         (write_float) Write only as many digits as `digits' member says.
1294         (format_trig_double) Limit base-10 precision to LDBL_DIG.
1295
1296         * pfm-write.h: (enum pfm_type) Moved here from pfm-read.h.
1297         (struct pfm_write_options) New struct.
1298
1299         * sfm-write.c: (sfm_writer_default_options) New function.
1300         (sfm_open_writer) Remove `compress', `omit_long_names' args.  Add
1301         `opts' argument.  Implement options.
1302
1303         * sfm-write.h: (struct sfm_write_options) New struct.
1304
1305         * expressions/helpers.c: (copy_string) Make `old' arg `unsigned
1306         char *' instead of `char *'.
1307         
1308 Sat Aug  6 21:29:15 2005  Ben Pfaff  <blp@gnu.org>
1309
1310         * factor_stats.c: Needed <config.h> included earlier.
1311
1312         * percentiles.c: Needed to include <config.h>.
1313
1314         * val.h: Don't include "config.h".
1315
1316 Sat Aug  6 21:26:27 2005  Ben Pfaff  <blp@gnu.org>
1317
1318         Clean up treatment of missing values by moving all the code into
1319         one place.  All references to the missing value function were
1320         updated, but only major changes are detailed below.
1321
1322         * Makefile.am: Add missing-values.c, missing-values.h to sources.
1323
1324         * apply-dict.c: (cmd_apply_dictionary) Use mv_resize().
1325
1326         * dictionary.c: (dict_create_var) Initialize `miss' member with
1327         mv_init().
1328         (dict_clone_var) Copy `miss' member with mv_copy().
1329         
1330         * get.c: (mtf_merge_dictionary) Use mv_copy().
1331
1332         * missing-values.c: New file.
1333         
1334         * missing-values.h: New file.
1335
1336         * mis-val.c: Rewrite.  New version implements updated semantics.
1337
1338         * pfm-read.c: (read_variables) Rewrite missing value handling.
1339
1340         * pfm-write.c: (write_variables) Rewrite missing value handling.
1341
1342         * sfm-read.c: (read_variables) Rewrite missing value handling.
1343
1344         * sfm-write.c: (write_variable) Rewrite missing value handling.
1345
1346         * sfmP.h: Include "magic.h" to get definition of
1347         second_lowest_value.
1348
1349         * sysfile-info.c: (describe_variable) Rewrite missing value
1350         handling.
1351
1352         * val.h: Include "magic.h" to get definition of
1353         second_lowest_value.
1354
1355         * var.h: Include "missing-values.h".  Drop MISSING_* enums.
1356         (struct variable) Remove `miss_type', `missing'.  Add `miss'.
1357
1358         * vars-atr.c: (is_num_user_missing) Removed--use
1359         mv_is_num_user_missing().
1360         (is_str_user_missing) Removed--use mv_is_str_user_missing().
1361         (is_system_missing) Removed--use mv_is_value_system_missing().
1362         (is_missing) Removed--use mv_is_value_missing().
1363         (is_user_missing) Removed--use mv_is_value_user_missing().
1364         
1365 Sun Jul 31 14:09:57 2005  Ben Pfaff  <blp@gnu.org>
1366
1367         Adopt use of gnulib for portability.
1368
1369         * Make.build: Add $(top_srcdir)/gl and $(top_builddir)/gl to
1370         include path.
1371
1372         * Makefile.am: Remove bool.h, stat.h and change getline.[ch] to
1373         getl.[ch] in pspp_SOURCES.  Remove libmisc, add libgl in
1374         pspp_LDADD.
1375
1376         * In many source files, added an explicit inclusion of gettext.h
1377         and definition of _ macro.  These are no longer in pref.h because
1378         it interfered with definitions in a few gnulib source files.
1379
1380         * In many source files, changed #include "bool.h" to #include
1381         <stdbool.h>, which is provided by gnulib.
1382
1383         * alloc.c: Removed functions defined in gnulib:
1384         (xmalloc) Removed.
1385         (xcalloc) Removed.
1386         (xrealloc) Removed.
1387         (xstrdup) Removed.
1388         (out_of_memory) Redefined as wrapper for xalloc_die().
1389
1390         * alloc.h: Replace prototypes by #include "xalloc.h".
1391
1392         * casefile.c: Use full_read() and full_write() from gnulib instead
1393         of our home-grown versions.
1394         (full_read) Removed.
1395         (full_write) Removed.
1396
1397         * getline.c: Renamed getl.c.
1398
1399         * getline.h: Renamed getl.h, updated all references.
1400
1401         * filename.c: (fn_readlink) Change to wrapper around xreadlink()
1402         from gnulib.
1403
1404         * glob.c: Just #include <time.h> instead of the crazy rigmarole
1405         here before.
1406         (init_glob) Call set_program_name() to initial gnulib progname
1407         module.
1408
1409         * html.c: (postopen) Use getlogin_r(), gethostname() from gnulib.
1410
1411         * permissions.c: Use "stat-macros.h" from gnulib.
1412
1413         * postscript.c: Just #include <time.h> instead of the crazy
1414         rigmarole here before.
1415
1416         * q2c.c: (main) Make generated code #include "gettext.h".
1417
1418         * str.h: Get rid of most explicit declarations of standard
1419         functions, in favor of including gnulib header files.
1420
1421         * expressions/evaluate.c: Ditto.
1422
1423         * expressions/operations.h.pl: Make generated code #include
1424         <stdbool.h>, not "bool.h".
1425
1426 Sat Jul 30 23:13:17 2005  Ben Pfaff  <blp@gnu.org>
1427
1428         * expressions/parse.c: (validate_function_args) Fix two msg() bugs
1429         found by -Wformat.
1430
1431 Sat Jul 30 23:10:01 2005  Ben Pfaff  <blp@gnu.org>
1432
1433         * expressions/evaluate.c: (expr_debug_print_postfix) Don't pass
1434         null pointer to printf for %.*s.
1435
1436 Sat Jul 30 23:05:33 2005  Ben Pfaff  <blp@gnu.org>
1437
1438         * vars-atr.c: (var_is_valid_name) Fix three msg() bugs found by
1439         -Wformat.
1440
1441 Sat Jul 30 22:58:33 2005  Ben Pfaff  <blp@gnu.org>
1442
1443         * rank.q: (parse_rank_function) Fix msg() bug found by -Wformat.
1444
1445 Sat Jul 30 22:56:12 2005  Ben Pfaff  <blp@gnu.org>
1446
1447         * postscript.c: (postopen) Cast `char' to `unsigned char' before
1448         passing to isspace().
1449
1450 Sat Jul 30 22:52:09 2005  Ben Pfaff  <blp@gnu.org>
1451
1452         * pfm-read.c: (read_variables) Fix msg() bug found by -Wformat.
1453
1454 Sat Jul 30 22:50:57 2005  Ben Pfaff  <blp@gnu.org>
1455
1456         * histogram.c: Include <config.h>.
1457
1458 Sat Jul 30 22:48:50 2005  Ben Pfaff  <blp@gnu.org>
1459
1460         * get.c: (cmd_match_files) Fix msg() bug found by -Wformat.
1461
1462 Sat Jul 30 22:46:10 2005  Ben Pfaff  <blp@gnu.org>
1463
1464         * format.c: (check_common_specifier) Fix msg() bug found by
1465         -Wformat.
1466         (check_output_specifier) Ditto.
1467
1468 Sat Jul 30 22:43:57 2005  Ben Pfaff  <blp@gnu.org>
1469
1470         * file-handle.q: (cmd_file_handle) Fix msg() bug found by
1471         -Wformat.
1472
1473 Sat Jul 30 22:41:44 2005  Ben Pfaff  <blp@gnu.org>
1474
1475         * data-in.c: (parse_Z) [WORDS_BIGENDIAN] Don't declare buf[], to
1476         avoid "unused variable" warning.
1477
1478 Sat Jul 30 22:38:46 2005  Ben Pfaff  <blp@gnu.org>
1479
1480         * command.c: (find_word) Cast `char' to `unsigned char' before
1481         passing to isspace().
1482
1483 Sat Jul 30 22:36:29 2005  Ben Pfaff  <blp@gnu.org>
1484
1485         * case.c: (case_compare) Implement as delegating to
1486         case_compare_2dict().
1487
1488 Sat Jul 30 22:34:18 2005  Ben Pfaff  <blp@gnu.org>
1489
1490         * algorithm.c: Inclusion of <alloca.h> is unneeded.
1491
1492 Sat Jul 30 22:01:32 2005  Ben Pfaff  <blp@gnu.org>
1493
1494         * Make.build: Don't append -ansi to AM_CFLAGS for GCC.  Using
1495         -ansi changes the behavior of header files significantly.  It
1496         causes __STRICT_ANSI__ to be defined, and some headers interpret
1497         that as cause to e.g. not use `long long' or __attribute__.  The
1498         former example is bad when off_t is supposed to be `long long',
1499         and the latter prevents -Wformat from working.
1500
1501 Sun Jul 24 20:26:59 2005  Ben Pfaff  <blp@gnu.org>
1502
1503         Get rid of dependency on libgmp by writing our own routine for
1504         floating-point base conversion.
1505
1506         * pfm-write.c: (write_float) Rewrote.
1507         (write_int) Rewrote.
1508         (pow30_nonnegative) New function.
1509         (pow30) New function.
1510         (trig_to_char) New function.
1511         (format_trig_digits) New function.
1512         (recurse_format_trig_int) New function.
1513         (format_trig_int) New function.
1514         (should_round_up) New function.
1515         (try_round_up) New function.
1516         (format_trig_double) New function.
1517
1518 Sun Jul 24 18:49:20 2005  Ben Pfaff  <blp@gnu.org>
1519
1520         * data-in.c: (parse_numeric) Allow "1+23" even for F format, for
1521         compatibility.
1522
1523 Sun Jul 24 18:47:37 2005  Ben Pfaff  <blp@gnu.org>
1524
1525         * pfm-read.c: (read_version_data) Read and ignore author field.
1526
1527 Wed Jul  6 20:44:27 2005  Ben Pfaff  <blp@gnu.org>
1528
1529         * get.c: (mtf_processing) Don't assume that
1530         mtf_compare_BY_values() always returns -1, 0, or 1.  Actually, it
1531         returns a negative, zero, or positive result.  Fixes MATCH FILES
1532         bug on Mac OS X reported by "Marshall DeBerry" <mdb@radix.net>.
1533
1534 Mon Jul  4 18:01:15 2005  Ben Pfaff  <blp@gnu.org>
1535
1536         * flip.c: [HAVE_SYS_TYPES_H] Really include <sys/types.h>.  The
1537         preprocessor test for sys/types.h was accidentally inverted.  This
1538         was bug 12789.
1539
1540 Sun Jul  3 22:47:39 2005  Ben Pfaff  <blp@gnu.org>
1541
1542         * get.c: (cmd_match_files) Fix memory leak on `by' and on
1543         `vfm_source'.
1544
1545         * getline.c: [HAVE_LIBREADLINE] (read_console) Fix memory leak on
1546         `line'.
1547
1548         * vfm.c: (close_active_file) Remove unnecessary test.
1549
1550 Sun Jul  3 21:45:32 2005  Ben Pfaff  <blp@gnu.org>
1551
1552         Fix NDEBUG compile errors.
1553
1554         * hash.h: Needed explicit #include <assert.h>.
1555
1556         * linked-list.c: (ll_next) First arg is UNUSED when NDEBUG is
1557         defined.
1558
1559 Sun Jun 12 23:44:38 2005  Ben Pfaff  <blp@gnu.org>
1560
1561         Implement embedding for PostScript driver.  Fixes bug 12970.
1562
1563         * ascii.c: Fix compiler warnings.
1564
1565         * html.c: Ditto.
1566
1567         * chart.h: Add `file' member.
1568
1569         * output.h: (struct outp_class) initialise_chart, finalise_chart
1570         should take outp_driver *, not outp_class *.  Update all
1571         references.
1572
1573         * plot-chart.c: (chart_create) Fix segfault when there are no
1574         output drivers at all.
1575         (chart_submit) Call d->class->finalise_chart.
1576
1577         * postscript.c: (ps_open_page) Set cp_y to 0.
1578         (ps_submit) New function.
1579         (ps_chart_initialise) Implement.
1580         (ps_chart_finalise) Implement.
1581         (static var postscript_class) Add ps_submit.
1582         (static var epsf_class) Add ps_submit.
1583         
1584
1585 Sun Jun 12 14:54:40 2005  Ben Pfaff  <blp@gnu.org>
1586
1587         Did some more work on bug 12859 and then realized that a *good*
1588         solution would require some fundamental restructuring.  For now,
1589         I'm marking REPEATING DATA unimplemented, and then we can revisit
1590         it post-0.4.0.
1591         
1592         * command.def: Make REPEATING DATA unimplemented.
1593
1594         * data-list.c: (cmd_repeating_data) Assume inline file is 80
1595         characters wide.
1596         (realize_value) Revert previous changes; no longer needed.
1597         Updated all callers.
1598
1599         * error.c: (err_hcf) Set nfile_loc, mfile_loc to 0 after freeing
1600         file_loc, to avoid bad references later.
1601
1602         * str.c: Fix typo.
1603
1604 Tue Jun  7 00:14:09 2005  Ben Pfaff  <blp@gnu.org>
1605
1606         Make some code tolerant of reentry.  Should not be needed if other
1607         code is correct but it is good to be generally tolerant.
1608         
1609         * error.c: (err_hcf) Set file_loc to null after free().
1610
1611         * output.c: (outp_done) Similar changes.
1612
1613         * str.c: (ds_destroy) Ditto.
1614         
1615 Tue Jun  7 00:10:20 2005  Ben Pfaff  <blp@gnu.org>
1616
1617         Continue work on bug 12859, plus some code cleanup.
1618         
1619         * data-list.c: (cmd_repeating_data) Replace `seen' bitmap by
1620         boolean variables.  Don't try to compute starts_end, cont_end for
1621         inline file.  Calculate length only after parsing variable
1622         specifications.  Add proper transformation to list.
1623         (realize_value) If the rpd_num_or_var has no value, return new
1624         DEFAULT_MEMBER argument (for use with inline file).
1625         (repeating_data_trns_proc) Pass default values.
1626
1627         * dfm-read.c: (dfm_close_reader) Only skip data if *not* still
1628         open, and only if we actually started reading data.
1629
1630 Sun Jun  5 18:39:36 2005  Ben Pfaff  <blp@gnu.org>
1631
1632         Fix bug 11894.
1633         
1634         * output.c: (outp_read_devices) Fix message.
1635
1636 Fri May 27 12:34:43 WST 2005 John Darrington <john@darrington.wattle.id.au>
1637         
1638         * sort-prs.[ch] (newfiles), aggregate.c, sort.[ch]: Separated the guts 
1639         of the sort algorithm from the parser for the SORT command.
1640         
1641         * rank.q: Added the parser for the RANK command.
1642         
1643 Thu May 26 12:29:21 2005  Ben Pfaff  <blp@gnu.org>
1644
1645         Fix bug 13192.
1646
1647         * sort.c: (sort_parse_criteria) Only set *saw_direction if
1648         saw_direction is non-null.  Thanks to John Darrington for
1649         reporting this bug.
1650
1651 Tue May 24 21:52:55 2005  Ben Pfaff  <blp@gnu.org>
1652
1653         * get.c: (mtf_processing) Handle case of a lookup table as the
1654         active file.  Thanks to John Darrington for reporting this bug.
1655
1656 Wed May 25 10:27:02 WST 2005 John Darrington <john@darrington.wattle.id.au>
1657         
1658         * alloc.c alloc.h: (xcalloc) changed signature to imitate the
1659         POSIX  calloc function.
1660         
1661         * crosstabs.q get.c vars-prs.c: Updated calls to xcalloc to
1662         reflect new signature.
1663
1664         * sfm-read.c: Now much more robust in the face of badly formed
1665         system files.
1666
1667 Mon May 23 11:57:31 WST 2005 John Darrington <john@darrington.wattle.id.au>
1668
1669         *sfm-read.c: Fixed some bugs regarding long string continuation
1670         records, which the previous fix uncovered.
1671
1672 Sat May 21 12:48:34 WST 2005 John Darrington <john@darrington.wattle.id.au>
1673
1674         * sfm-read.c, sfmP.h:  Allow reading of system files when the 
1675         case_size value in the header is -1.  Also changed some Errors to 
1676         Warnings when reading system files.
1677
1678 Tue May 17 21:00:57 2005  Ben Pfaff  <blp@gnu.org>
1679
1680         * data-list.c: (data_list_trns_free) Don't free the argument
1681         because cancel_transformations() will do that itself.
1682         (data_list_source_destroy) Destroy the argument to
1683         data_list_trns_free(), because it no longer does so itself.
1684
1685 Tue May 17 18:29:35 2005  Ben Pfaff  <blp@gnu.org>
1686
1687         * data-out.c: (format_and_round) Don't output leading `-' if value
1688         rounds to zero.
1689
1690 Tue May 17 00:06:43 2005  Ben Pfaff  <blp@gnu.org>
1691
1692         Fix bug 11119.
1693
1694         * som.c: (output_encodings) If some cell in the table won't fit
1695         with the horizontal or vertical headers, cancel those headers.
1696
1697         * som.h: (struct som_table_class) Add fits_width, fits_length,
1698         set_headers members.
1699
1700         * tab.c: (tabi_fits_width) New function.
1701         (tabi_fits_length) New function.
1702         (tabi_set_headers) New function.
1703         (global var tab_table_class) Add the new functions as appropriate
1704         members.
1705         
1706 Mon May 16 22:34:06 2005  Ben Pfaff  <blp@gnu.org>
1707
1708         Fix rest of bug 13054.
1709
1710         * format.def: Fix EDATE, SDATE, ADATE, JDATE, QYR, MOYR, WKYR,
1711         DATETIME, TIME system/portable file values.
1712
1713 Mon May 16 22:31:15 2005  Ben Pfaff  <blp@gnu.org>
1714
1715         * data-list.c: (parse_free) Use make_input_format().
1716         
1717         * data-out.c: (num_to_string) Use make_output_format().
1718
1719         * dictionary.c: (dict_create_var) Ditto.
1720
1721         * format.c: (global var f8_2) New var.
1722         (make_input_format) New function.
1723         (make_output_format) New function.
1724
1725         * get.c: (cmd_match_files) Use make_output_format().
1726
1727         * list.q: (cmd_list) Ditto.
1728
1729         * matrix-data.c: Ditto.
1730
1731         * sfm-read.c: (parse_format_spec) Check output specifier
1732         thoroughly.
1733
1734         * tab.c: (tab_float) Use make_output_format().
1735
1736 Sun May 15 23:38:10 2005  Ben Pfaff  <blp@gnu.org>
1737
1738         Fix more of bug 13054.
1739         
1740         * format.def: FMT_A should allow 255-character output.  FMT_AHEX
1741         should allow 510-character input and output.
1742
1743         * data-out.c: (num_to_string) Get rid of NEW_STYLE option.
1744         (convert_E) Handle non-finite values.
1745         (try_F) Rewrite.
1746         (format_and_round) New function.
1747         (convert_infinite) New function used by try_F() and convert_E().
1748
1749 Sun May 15 23:36:55 2005  Ben Pfaff  <blp@gnu.org>
1750
1751         Regularize string and buffer function names so that they make some
1752         kind of sense.
1753
1754         * str.c: (mm_reverse) Rename buf_reverse().  Update all
1755         references.
1756         (mm_find_reverse) Rename buf_find_reverse().  Update all
1757         references.
1758         (mm_case_compare) Rename buf_compare_case().  Update all
1759         references.
1760         (st_compare_pad) Rename buf_compare_rpad().  Update all
1761         references.
1762         (str_compare_rpad) New function.
1763         (st_bare_pad_copy) Rename buf_copy_str_rpad().  Update all
1764         references.
1765         (buf_copy_str_lpad) New function.
1766         (st_bare_pad_len_copy) Rename buf_copy_rpad().  Update all
1767         references.
1768         (st_pad_copy) Rename str_copy_rpad().  Update all references.
1769         (st_trim_copy) Rename str_copy_trunc().  Update all references.
1770         (st_uppercase) Renamed str_uppercase().  Update all references.
1771         
1772 Sat May 14 08:22:26 WST 2005 John Darrington <john@darrington.wattle.id.au>
1773
1774         * dfm-read.c: Fixed polarity of test in dfm-close-reader.  Closes 
1775         Bug #13082
1776
1777 Tue May 10 20:08:18 2005  Ben Pfaff  <blp@gnu.org>
1778
1779         * data-in.c: (data_in) Add assertion to check input specifier.
1780
1781         * data-out.c: (data_out) Add assertion to check output specifier.
1782
1783 Tue May 10 19:56:35 2005  Ben Pfaff  <blp@gnu.org>
1784
1785         Start to fix bug 13054.
1786
1787         * format.c: (check_input_specifier) Improve error message.
1788         (check_input_specifier) Check F, COMMA, and DOLLAR formats for
1789         valid decimal places.
1790         (check_output_specifier) Ditto (but different criteria).
1791         (convert_fmt_ItoO) Assert valid input and output specifiers.
1792         Also, if input specifier has *any* decimal places, make the output
1793         specifier 1 place wider.
1794
1795 Mon May  9 07:14:29 WST 2005 John Darrington <john@darrington.wattle.id.au>
1796
1797         * sysfile-info.c: Fixed bug [# 13024 ]
1798
1799 Sun May  8 13:52:12 2005  Ben Pfaff  <blp@gnu.org>
1800
1801         "Fix" bug 13021 by disabling FILE TYPE.  Eventually, we should
1802         actually implement it.
1803
1804         * command.c: (FILE_TYPE_okay) Always return 1.
1805
1806         * command.def: Change FILE TYPE, END FILE TYPE into UNIMPL.
1807
1808         * file-type.c: Add prototypes to get rid of warnings.
1809
1810 Sun May  8 08:08:07 WST 2005 John Darrington <john@darrington.wattle.id.au>
1811
1812         * barchart.c box-whisker.c cartesian.c piechart.c plot-hist.c: Fixed 
1813         more ISO/IEC 9899:1990 conformance issues.
1814
1815 Wed May  4 23:54:02 2005  Ben Pfaff  <blp@gnu.org>
1816
1817         Fix bug 12948.  See also new test in
1818         tests/bugs/match-file-scratch.sh.
1819         
1820         * get.c: (mtf_merge_dictionary) Don't compact dictionary because
1821         that deletes scratch variables that someone else might be using,
1822         and because we can't reassign our sources' value indexes.
1823         Instead, simply don't copy scratch variables into the master
1824         dictionary.
1825
1826         * dictionary.c: (dict_compact_values) Delete variables from the
1827         dictionary passed in, not from default_dict (!).
1828
1829 Tue May  3 22:25:17 2005  Ben Pfaff  <blp@gnu.org>
1830
1831         Improve hash.c comments, error-checking.
1832         
1833         * hash.c: (struct hsh_table) [NDEBUG] Add hash_ordered member.
1834         (hsh_create) size == 0 should *not* return NULL!  Set
1835         hash_ordered.
1836         (hsh_clear) Set hash_ordered.
1837         (locate_matching_entry) Check hash_ordered.
1838         (hsh_rehash) Rename rehash().  Add assertion.  Set hash_ordered.
1839         (hsh_data) Set hash_ordered.  Add const-ness to return value and
1840         update all callers.
1841         (hsh_sort) Ditto.       
1842
1843 Wed May  4 08:50:11 WST 2005 John Darrington <john@darrington.wattle.id.au>
1844
1845         * casefile.c: Removed unnecessary #include <valgrind/valgrind.h>
1846
1847 Tue May  3 19:14:48 WST 2005 John Darrington <john@darrington.wattle.id.au>
1848
1849         * copyleft.c: Updated copyright date.
1850
1851         * Makefile.am: Removed erroneous explicit "-lplot"
1852
1853         * examine.q oneway.q: Made these files conform to ISO/IEC 9899:1990
1854
1855 Tue May  3 16:20:31 WST 2005 John Darrington <john@darrington.wattle.id.au>
1856
1857         * command.c command.def: Added description string for unimplemented commands.
1858
1859         * oneway.q: Sorted the hash tables before shipping out the results. Closes 
1860         bug [#12931].
1861
1862 Mon May  2 23:45:01 2005  Ben Pfaff  <blp@gnu.org>
1863
1864         Code improvements.
1865         
1866         * data-list.c:  (parse_fixed) Use lex_end_of_command().
1867         (parse_free) Ditto.
1868         (cmd_repeating_data) Set cont_end.num in right situations.
1869         (parse_repeating_data) Remove redundant test.
1870
1871 Mon May  2 23:37:19 2005  Ben Pfaff  <blp@gnu.org>
1872
1873         Partial fix for bug 12859.
1874         
1875         * data-list.c: (cmd_data_list) Add transformation properly in
1876         vfm_source == NULL case.
1877
1878 Mon May  2 23:27:28 2005  Ben Pfaff  <blp@gnu.org>
1879
1880         * lexer.c: (lex_error) Improve error messages.
1881
1882 Mon May  2 22:28:17 2005  Ben Pfaff  <blp@gnu.org>
1883
1884         * get.c: (cmd_match_files) Check token type before trying to match
1885         tokid.  Fixes bug 12923.
1886
1887 Mon May  2 22:16:51 2005  Ben Pfaff  <blp@gnu.org>
1888
1889         * flip.c: [HAVE_SYS_TYPES_H] Include <sys/types.h>.  Fixes bug
1890         12789.
1891
1892 Mon May  2 22:02:52 2005  Ben Pfaff  <blp@gnu.org>
1893
1894         * expressions/generate.pl: (get_token) Make use of /g
1895         backward-compatible with Perl 5.6.1.
1896
1897 Sun May  1 23:00:19 2005  Ben Pfaff  <blp@gnu.org>
1898
1899         * var-display.c: (cmd_variable_alignment) Fix memory leak.
1900         (cmd_variable_level) Ditto.
1901
1902 Sun May  1 22:49:04 2005  Ben Pfaff  <blp@gnu.org>
1903
1904         Hash table had buggy deletion function.  The fix required changing
1905         other functions to do probing in the required order.
1906
1907         * hash.c: (locate_matching_entry) Rewrite and change interface.
1908         (hsh_rehash) Rewrite to use locate_matching_entry().
1909         (hsh_probe) Ditto.
1910         (hsh_find) Ditto.
1911         (hsh_delete) Ditto.  Also, fix stupid bugs.
1912
1913 Sun May  1 22:24:58 2005  Ben Pfaff  <blp@gnu.org>
1914
1915         * dictionary.c: (dict_clone) Properly copy vectors.
1916
1917 Sun May  1 22:07:58 2005  Ben Pfaff  <blp@gnu.org>
1918
1919         New implementation of long variable names.  Each variable has a
1920         "normal" name, which may be up to 64 bytes long and which is used
1921         for all normal operations.  Variables may have a "short" name,
1922         which is limited to 8 bytes and used only for system and portable
1923         file input and output.
1924         
1925         Make tokid case-preserving.  Update most uses of tokid to treat it
1926         case-insensitively.
1927
1928         Update many commands to deal with long variable names.
1929
1930         * autorecode.c: (cmd_autorecode) Use strcasecmp() instead of strcmp().
1931
1932         * command.c: (cmd_parse) Ditto.
1933         (match_strings) Use toupper() before comparing characters.
1934         (conflicting_3char_prefixes) Use mm_case_compare() instead of
1935         memcmp().
1936         (cmd_match_words) Ditto.
1937
1938         * compute.c: (lvalue_parse) Use st_trim_copy() instead of
1939         strncpy().
1940
1941         * count.c: (struct cnt_var_info) Change n[] to fit long var name.
1942         Use st_trim_copy() instead of strcpy().
1943
1944         * data-in.c: (parse_enum) Use mm_case_compare() instead of
1945         memcmp().
1946
1947         * data-list.c: (struct dls_var_spec) Change name[] to fit long var
1948         name.
1949         (parse_free) Use st_trim_copy() instead of strcpy().
1950
1951         * descript.c: (struct dsc_var) Change z_name[] to fit long var
1952         name.
1953         (try_name) Use strcasecmp() instead of strcmp().
1954         (generate_z_varname) Use st_trim_copy() instead of strcpy().
1955         (descriptives_compare_dsc_vars) Use strcasecmp() instead of
1956         strcmp().
1957
1958         * dictionary.c: (struct dictionary) Removed `long_name_tab'
1959         member.
1960         (compare_long_names) Removed.
1961         (hash_long_name) Removed.
1962         (dict_create) Don't initialize `long_name_tab' member.
1963         (dict_clone) Copy short names into new dictionary. 
1964         (dict_clear) Don't clear `long_name_tab' member.
1965         (dict_get_varname_block) Removed.
1966         (dict_add_longvar_entry) Removed.
1967         (free_nte) Removed.
1968         (dict_destroy) Don't destroy `long_name_tab' member.
1969         (dict_create_var_from_short) Removed.
1970         (dict_create_var_x) Removed.
1971         (dict_create_var) Get rid of longname handling.
1972         Clear short name.
1973         (dict_clone_var) Get rid of longname parameter and longname
1974         handling.
1975         (dict_lookup_var) Get rid of longname handling.
1976         (dict_reorder_var) New function.
1977         (dict_rename_var) Clear short name.
1978         (dict_rename_vars) Get rid of longname handling.  Clear short
1979         names.
1980         (dict_create_vector) Support long vector names.
1981         (dict_lookup_vector) Use strcasecmp() instead of strcmp().
1982         (quasi_base27) Removed.
1983         (make_short_name) Removed.
1984         (compare_strings) New function.
1985         (hash_string) New function.
1986         (dict_assign_short_names) New function.
1987
1988         * file-handle.q: (get_handle_with_name) Use strcasecmp() instead
1989         of strcmp().
1990         (get_handle_for_filename) Support long handle names.
1991
1992         * file-type.c: (struct col_spec) Make `name' fit long var names.
1993         (cmd_file_type) Use strcasecmp() instead of strcmp().
1994
1995         * flip.c: (make_new_var) Rewrite.
1996         (flip_sink_write) Use st_trim_copy() instead of strncpy().
1997
1998         * format.c: (parse_format_specifier_name) Use mm_case_compare()
1999         instead of memcmp().
2000
2001         * get.c: (cmd_save_internal) Rephrase.
2002         (rename_variables) Drop test for identical variable name.
2003         (struct mtf_proc) Change `first', `last' to fit long var name.
2004
2005         * hash.c: (hsh_hash_case_string) New function for case-insensitive
2006         string hashing.
2007
2008         * lexer.c: (restore_token) Use st_trim_copy() instead of
2009         strncpy().
2010         (lex_get) Don't uppercase string when copying into tokid.
2011         (lex_put_back_id) Use st_trim_copy() instead of
2012         strncpy().
2013
2014         * list.q: (determine_layout) Consider length of variable names in
2015         choosing vertical layout.
2016
2017         * matrix-data.c: (cmd_matrix_data) Use strcasecmp() instead of
2018         strcmp().
2019         (string_to_content_type) Ditto.
2020
2021         * modify-vars.c: (compare_variables_given_ordering) Ditto.
2022         (struct var_renaming) Change `new_name' to fit long var name.
2023         (compare_var_renaming_by_new_name) Use strcasecmp() instead of
2024         strcmp().
2025
2026         * pfm-read.c: (read_variables) Disallow system variables in system
2027         files.
2028         (write_variables) Call dict_assign_short_names() and use
2029         short_name[] members.
2030
2031         * repeat.c: (internal_cmd_do_repeat) Use strcasecmp() instead of
2032         strcmp().
2033
2034         * sfm-read.c: (sfm_open_reader) Rewrite code for long variable
2035         map.  Reorder variables into same order as long variable map.
2036         (read_variables) Set short name.
2037
2038         * sfm-write.c: (sfm_open_writer) Call dict_assign_short_names().
2039         (write_variable) Use st_bare_pad_copy().
2040         (write_longvar_table) Rewrite.
2041
2042         * str.c: (mm_case_compare) New function.
2043
2044         * sysfile-info.c: (compare_vectors_by_name) Use strcasecmp()
2045         instead of strcmp().
2046
2047         * t-test.q: (tts_custom_groups) Remove redundant test.
2048         (tts_custom_pairs) Ditto.
2049
2050         * var.h: (struct variable) Change `name' to fit long var names.
2051         Remove `longname'.  Add `short_name' member.  Reorder some
2052         variables.
2053         (struct name_table_entry) Removed.
2054         (struct vector) Change `name' to fit long vector names.
2055
2056         * vars-atr.c: (var_is_valid_name) Allow long var names.
2057         (compare_var_names) Use strcasecmp() instead of strcmp().
2058         (compare_var_ptr_names) Ditto.
2059         (hash_var_name) Use hsh_hash_case_string().
2060         (hash_var_ptr_name) Ditto.
2061         (var_set_short_name) New function.
2062         (var_clear_short_name) New function.
2063         (var_set_short_name_suffix) New function.
2064
2065         * vars-prs.c: (parse_DATA_LIST_vars) Support long names.
2066         Use strcasecmp() instead of strcmp().
2067         (struct array_var_set) Removed `longname_tab'.
2068         (array_var_set_lookup_var_idx) Drop longname_tab support.
2069         (array_var_set_destroy) Don't destroy `longname_tab'.
2070         (var_set_create_from_array) Don't create `longname_tab'.
2071
2072         * vector.c: (cmd_vector) Use strcasecmp() instead of strcmp().
2073         Support long names.
2074
2075         * expressions/parse.c: (word_matches) Use mm_case_compare()
2076         instead of memcmp().
2077         (compare_strings) New function.
2078         (lookup_function) Use compare_strings() instead of strcmp().
2079         
2080 Sun May  1 22:07:43 2005  Ben Pfaff  <blp@gnu.org>
2081
2082         * algorithm.c: (move_element) New function.
2083
2084 Sun May  1 22:05:35 2005  Ben Pfaff  <blp@gnu.org>
2085
2086         * aggregate.c: (parse_aggregate_functions) Always initialize
2087         destvar.
2088
2089 Sun May  1 22:03:47 2005  Ben Pfaff  <blp@gnu.org>
2090
2091         * aggregate.c: (cmd_aggregate) Use dict_clone_var_assert().
2092
2093         * dictionary.c: (dict_clone) Ditto.
2094         (dict_clone_var_assert) New function.
2095
2096         * get.c: (mtf_merge_dictionary) Use dict_clone_var_assert().
2097
2098 Sun May  1 15:05:54 WST 2005 John Darrington <john@darrington.wattle.id.au>
2099
2100         * error.c: Added a string for the compiler version to the
2101         request_bug_report_and_abort function.
2102
2103         * groff_font.c, font.c: Removed manpage(1) style references from 
2104         comments, because RMS frowns upon them.
2105
2106 Thu Apr 28 18:52:06 2005  Ben Pfaff  <blp@gnu.org>
2107
2108         * expressions/parse.c: Improve previous fix for bug 12858 (LAG).
2109
2110 Fri Apr 29 09:28:00 WST 2005 John Darrington <john@darrington.wattle.id.au>
2111
2112         * expressions/parse.c: Added handler for OP_LAG_Vn and OP_LAG_Vs.  
2113         Fixed bug [#12858] .
2114
2115 Wed Apr 27 12:42:34 WST 2005 John Darrington <john@darrington.wattle.id.au>
2116
2117         * loop.c recode.c repeat.c: Fixed a couple of instances of SHORT_NAME_LEN 
2118         which should be LONG_NAME_LEN
2119
2120 Wed Apr 27 07:43:50 WST 2005 John Darrington <john@darrington.wattle.id.au>
2121
2122         * command.def echo.c:  Added the ECHO command.
2123
2124 Mon Apr 25 22:55:59 2005  Ben Pfaff  <blp@gnu.org>
2125
2126         Finish fixing MATCH FILES (bug 11677).
2127
2128         * get.c: (trim_dictionary) Rewrite in terms of drop_variables(),
2129         keep_variables(), rename_variables().
2130         (drop_variables) New function.
2131         (keep_variables) New function.
2132         (struct mtf_file) Rename `in' to `in_name'.  Add `in_var'.
2133         (cmd_match_files) Deal with in_var.  Use drop_variables(),
2134         keep_variables().  When IN is specified, require BY.  Set master
2135         variables after master dictionary is complete.  Add IN variables
2136         after master dictionary is complete.
2137         (mtf_free_file) Free `in_name'.
2138         (mtf_delete_file_in_place) Set in_var value to 0.
2139         (mtf_read_nonactive_records)  Rephrase.
2140         (mtf_processing) Support IN.  Rephrase.  Fix bugs.
2141         (mtf_merge_dictionary) Don't set master variables; we do that
2142         later now.
2143         (get_master) Don't insist that there's a master variable.
2144         
2145 Mon Apr 25 22:55:22 2005  Ben Pfaff  <blp@gnu.org>
2146
2147         Kluge to make some variable renaming sort of work.
2148         Needs real fix.
2149
2150         * dictionary.c: (dict_rename_var) Call dict_add_longvar_entry().
2151
2152 Mon Apr 25 22:52:28 2005  Ben Pfaff  <blp@gnu.org>
2153
2154         Add functions for comparing sets of variables between cases.
2155         Use the functions.
2156
2157         * case.c: (case_compare) New function.
2158         (case_compare_2dict) New function.
2159         
2160         * aggregate.c: (struct agr_proc) Remove `prev_break' member.  Add
2161         `break_case'.
2162         (cmd_aggregate) Nullify break_case.  Don't call
2163         initialize_aggregate_info().
2164         (agr_destroy) Destroy break_case.
2165         (aggregate_single_case) Rewrite.  Use case_compare().
2166         (dump_aggregate_info) Copy from break_case into output.
2167         (initialize_aggregate_info) Copy break_case from input.
2168
2169         * get.c: (mtf_compare_BY_values) Use case_compare_2dict().
2170
2171         * vfm.c: (equal_splits) Use case_compare().
2172
2173 Sat Apr 23 17:01:04 WST 2005 John Darrington <john@darrington.wattle.id.au>
2174
2175         * dictionary.c vars-prs.c sfm-write.c: Fixed some memory leaks
2176
2177 Sun Apr 17 23:08:15 2005  Ben Pfaff  <blp@gnu.org>
2178
2179         Start work on fixing MATCH FILES.
2180
2181         * get.c: (enum operation) Remove OP_MATCH.
2182         (trim_dictionary) Change return value to bool.  Don't support
2183         OP_MATCH.
2184         (struct mtf_file) Remove `first', `last' members.
2185         (struct mtf_proc) Add `first', `last' members.  Change mtf_case
2186         from `struct ccase *' to `struct ccase'.  Remove `by' member.
2187         (cmd_match_files) Essentially rewrite.
2188         (mtf_free) Don't free `by' member.  Destroy `mtf_case' member.
2189         (mtf_read_nonactive_records) mtf_ parameter is not unused.
2190         (mtf_processing) Ditto.  Also rephrase some code.
2191         (mtf_merge_dictionary) Rewrite for easy comprehension.  
2192
2193 Sun Apr 17 23:06:00 2005  Ben Pfaff  <blp@gnu.org>
2194
2195         * matrix-data.c: (wr_output_data) [DEBUGGING] Fix compilation
2196         error.
2197
2198         * q2c.c: (dump_token) [DEBUGGING] Fix compilation error.
2199         
2200 Thu Apr 14 2005 John Darrington
2201
2202         * var-display.c: New file.
2203
2204         * format.h var.h sfm-read.c sfm-write.c dictionary.c :  Added 
2205           display_width, measure and alignment parameters to variables.
2206
2207         * aggregate.c command.def compute.c count.c data-list.c descript.c
2208           dictionary.c dictionary.h expr-prs.c file-type.c flip.c get.c 
2209           lexer.c lexer.h loop.c modify-vars.c pfm-read.c recode.c repeat.c 
2210           sfm-read.c sfm-write.c sfm-write.h sfmP.h val-labs.c val.h var.h 
2211           vars-prs.c vector.c :  
2212               - Replaced literal constants representing maximum variable name 
2213                 length with macro definitions. 
2214               - Added support for long variable names.
2215               - Changed lexer such that it no longer makes tokens upper
2216                 case, but relies upon case insensitive behaviour of commands.
2217
2218 Mon Apr  4 22:27:34 2005  Ben Pfaff  <blp@gnu.org>
2219
2220         * aggregate.c: (parse_aggregate_functions) If dict_create_var()
2221         fails, don't dereference the resulting null pointer (bug 12427).
2222         Also, fix double free error.
2223
2224 Sat Mar 19 23:06:02 2005  Ben Pfaff  <blp@gnu.org>
2225
2226         * aggregate.c: (parse_aggregate_functions) Fix N_NO_VARS format.
2227         (accumulate_aggregate_info) Set int1 to 1 for SUM.
2228         (dump_aggregate_info) Only make SUM non-missing if there was at
2229         least one variate.
2230
2231 Sat Mar 19 14:48:19 2005  Ben Pfaff  <blp@gnu.org>
2232
2233         * aggregate.c: (dump_aggregate_info) Properly test whether the
2234         destination variable is numeric, when making the result
2235         system-missing for columnwise missing values.
2236
2237 Mon Mar 14 21:52:34 2005  Ben Pfaff  <blp@gnu.org>
2238
2239         * misc.h: Remove GCC specializations.
2240
2241 Mon Mar 14 21:07:23 2005  Ben Pfaff  <blp@gnu.org>
2242
2243         Make sort stable (bug 12313).
2244         
2245         * sort.c: Don't need to include some headers anymore.
2246         (static var min_buffers) New variable.
2247         (static var max_buffers) New variable.
2248         (static var allow_internal_sort) New variable.
2249         (cmd_sort_cases) Add test mode.
2250         (sort_execute) Rephrase.
2251         (do_internal_sort) Don't try internal sorting if
2252         allow_internal_sort is set.
2253         (struct external_sort) Renamed `initial_runs' to `runs' and
2254         updated all references.
2255         (macro MIN_BUFFER_TOTAL_SIZE_RECS) Removed.
2256         (macro MIN_BUFFER_SIZE_BYTES) Removed.
2257         (macro MIN_BUFFER_SIZE_RECS) Removed.
2258         (compare_initial_runs) Removed.
2259         (struct record_run) Add member `idx'.
2260         (write_initial_runs) Pass increasing values to process_case() as
2261         index.
2262         (process_case) Add `idx' parameter and use it to initialize new
2263         `idx' member.
2264         (allocate_cases) Limit allocated buffers to max_buffers.
2265         (compare_record_run) Use new `idx' member for last resort
2266         comparison, for stability.
2267         (end_run) Call casefile_sleep() on irs->casefile, to prevent
2268         running out of file descriptors.
2269         (struct merge_state) Removed.
2270         (merge) Don't need to allocate cases.  Always use MAX_MERGE_ORDER
2271         unless we have fewer runs left.  Always merge consecutive runs,
2272         for stability.  Return the final run.
2273         (mod) Removed.
2274         (choose_merge) New function.
2275         (merge_once) Rewritten.
2276
2277 Mon Mar 14 21:05:42 2005  Ben Pfaff  <blp@gnu.org>
2278
2279         * cmdline.c: (static var testing_mode) Move into
2280         parse_command_line().
2281         
2282 Mon Mar 14 21:05:13 2005  Ben Pfaff  <blp@gnu.org>
2283
2284         * algorithm.c: (remove_range) New function.
2285         (remove_element) New function.
2286
2287         * dictionary.c: (dict_delete_var) Use remove_element().
2288
2289         * flip.c: (cmd_flip) Ditto.
2290
2291 Sun Mar 13 22:52:05 2005  Ben Pfaff  <blp@gnu.org>
2292
2293         * file-handle.q: (struct file_handle) `open_mode' should not be
2294         const.
2295         
2296 Sun Mar 13 22:40:54 2005  Ben Pfaff  <blp@gnu.org>
2297
2298         First phase of making SORT CASES stable (bug 12313).
2299
2300         * sort.c: (struct indexed_case) New structure.
2301         (do_internal_sort) Rewrite to make internal sorting stable.
2302         (compare_case_dblptrs) Removed.
2303         (compare_indexed_cases) New function.
2304
2305 Sun Mar 13 22:38:40 2005  Ben Pfaff  <blp@gnu.org>
2306
2307         Clean-ups.
2308
2309         * casefile.c: (casereader_read_xfer_assert) New function.
2310
2311         * dictionary.c: (dict_compact_case) New function.
2312
2313         * flip.c: (struct flip_pgm) New member idx_to_fv.
2314         (cmd_flip) Initialize idx_to_fv member.
2315         (destroy_flip_pgm) Free idx_to_fv member.
2316         (flip_sink_write) Use struct flip_pgm member instead of case_sink
2317         member.
2318         (flip_sink_write) Ditto.
2319
2320         * vfm.c: (write_case) Use dict_compact_case() instead of
2321         compact_case().
2322         (compact_case) Removed.
2323         (storage_source_create) Removed `dict' parameter.  All references
2324         updated.
2325
2326         * vfm.h: (struct case_source) Removed `value_cnt' member.  All
2327         references removed.
2328         (struct case_sink) Removed `dict', `idx_to_fv' members.  All
2329         references removed.
2330
2331 Sun Mar 13 22:35:55 2005  Ben Pfaff  <blp@gnu.org>
2332
2333         More AGGREGATE fixes.
2334
2335         * aggregate.c: (accumulate_aggregate_info) Implement NMISS and
2336         NUMISS for strings.  Fix FOUT, POUT, FGT, FLT, FIN, FOUT for
2337         strings.
2338         (initialize_aggregate_info) Fix initialization for MIN, MAX for
2339         strings.
2340
2341 Sat Mar 12 23:26:21 2005  Ben Pfaff  <blp@gnu.org>
2342
2343         Start work on testing and debugging AGGREGATE.
2344
2345         * aggregate.c: (cmd_aggregate) Use discrete bool variables instead
2346         of a bit-map.  Require proper subcommand ordering.  Make OUTFILE
2347         subcommand mandatory.
2348         (parse_aggregate_functions) Check that PIN, POUT, FIN, FOUT
2349         functions' arguments are in the correct order and swap them if
2350         not.
2351         (accumulate_aggregate_info) Make SUM include weights.  Add various
2352         string functions.
2353         (dump_aggregate_info) Add various string functions.
2354         (initialize_aggregate_info) Initialize int1 for MIN, MAX.
2355
2356         * sort.c: (sort_parse_criteria) Add parameter for returning
2357         whether any directions were specified.  All callers updated.
2358
2359 Sun Mar 13 14:54:27 WST 2005 John Darrington <john@darrington.wattle.id.au>
2360
2361         * t-test.q: Fixed erroneous logic in compare_group_binary.
2362
2363 Sat Mar 12 13:29:21 2005  Ben Pfaff  <blp@gnu.org>
2364
2365         * split-file.c: (cmd_split_file) Ignore LAYERED and SEPARATE
2366         keywords (bug 11628).
2367
2368 Sat Mar 12 13:17:12 2005  Ben Pfaff  <blp@gnu.org>
2369
2370         * vfm.c: (procedure_with_splits) Fix bug 11492: end_func() must be
2371         called *before* close_active_file().
2372
2373 Sat Mar 12 12:20:57 2005  Ben Pfaff  <blp@gnu.org>
2374
2375         * file-handle.q: (struct file_handle) Change open_mode from
2376         character pointer to 3-char array, for safety.  Updated all
2377         references.
2378
2379 Sat Mar 12 12:15:49 2005  Ben Pfaff  <blp@gnu.org>
2380
2381         Thanks to Ben Kujala <bkujala@oregonchildcare.org> for reporting
2382         these bugs.
2383         
2384         * pfm-read.c: (read_header) Improve error message for many cases
2385         in which the input is not actually a portable file.
2386
2387         * file-handle.q: (fh_open) When we give an error message, actually
2388         return NULL.
2389
2390 Fri Mar 11 11:50:30 2005  Ben Pfaff  <blp@gnu.org>
2391
2392         * format.c: (check_common_specifier) New function for checks
2393         common to check_input_specifier() and check_output_specifier().
2394         (check_input_specifier) Use check_common_specifier().
2395         (check_output_specifier) Use check_common_specifier().
2396         (check_string_specifier) Removed.
2397         (check_specifier_type) New function.
2398         (check_specifier_width) New function.
2399         (get_format_var_width) Fix bug.
2400
2401         * formats.c: (internal_cmd_formats) Only accept numeric variables.
2402
2403         * lexer.c: (check_id) Rename lex_id_to_token(), make public,
2404         update all references.  Make case-insensitive.
2405
2406         * pfm-read.c: Essentially rewrite the whole file.  Now much
2407         cleaner.
2408
2409         * print.c: (check_string_width) New function.
2410         (fixed_parse_compatible) Use check_string_width(),
2411         check_specifier_type().
2412         (dump_fmt_list) Ditto.
2413
2414         * str.c: (st_trim_copy) New function.
2415         (st_uppercase) New function.
2416
2417         * vars-atr.c: (var_is_valid_name) New function.
2418         
2419         * expressions/parse.c: (type_coercion_core) Use
2420         check_specifier_type().
2421         
2422 Fri Mar 11 11:31:24 2005  Ben Pfaff  <blp@gnu.org>
2423
2424         * expressions/evaluate.c: (cmd_debug_evaluate) Fix memory leaks.
2425
2426         * expressions/parse.c: (no_match) Ditto.
2427
2428 Wed Mar  9 09:54:27 2005  Ben Pfaff  <blp@gnu.org>
2429
2430         * Makefile.am: (pspp_LDADD) Add libgsl-extras.a.
2431
2432         * expressions/helpers.c: (struct func_params) Removed.
2433         (generalized_idf) Removed.
2434         (cdf_beta) Removed.
2435         (idf_beta) Removed.
2436         (idf_fdist) Use gslextras_cdf_beta_Pinv() instead of idf_beta().
2437
2438         * expressions/operations.def: Implement IDF.BETA, CDF.BINOM,
2439         CDF.GEOM, CDF.HYPER, CDF.NEGBIN, CDF.POISSON using gsl-extras.
2440         Implement SIG.F, which I had overlooked previously.
2441
2442 Tue Mar  8 12:47:53 WST 2005 John Darrington <john@darrington.wattle.id.au>
2443
2444         * command.c command.def glob.[ch] cmdline.c: Made DEBUG cmds
2445         available only in testing mode.
2446
2447 Sun Mar  6 23:25:40 2005  Ben Pfaff  <blp@gnu.org>
2448
2449         * data-in.c: Use `bool' throughout, where relevant.
2450
2451 Sun Mar  6 19:52:22 2005  Ben Pfaff  <blp@gnu.org>
2452
2453         DATA LIST with free-field formats should not have implied decimal
2454         places (bug 12035).  Also clean up data-in.c a bit.
2455
2456         * data-in.h: (enum) Add DI_IMPLIED_DECIMALS.
2457
2458         * data-in.c: (apply_implied_decimals) New function.
2459         (parse_numeric) Don't adjust exponent if DI_IMPLIED_DECIMALS not
2460         set.  Also, get rid of gotos.
2461         (parse_Z) Use apply_implied_decimals() if the field doesn't
2462         contain a decimal point.
2463         (parse_N) Use apply_implied_decimals().
2464         (parse_IB) Ditto.
2465         (parse_PIB) Ditto.
2466         (parse_P) Ditto.
2467         (parse_PK) Ditto.
2468         (to_roman) Removed.
2469         (parse_enum) New function.
2470         (macro CHAR_IS_ROMAN) Removed.
2471         (macro ROMAN_VALUE) Removed.
2472         (parse_month) Use parse_enum().
2473         (parse_weekday) Use parse_enum().
2474         (parse_DATETIME) Use long for weekday.
2475
2476         * data-list.c: (read_from_data_list_fixed) Use
2477         DI_IMPLIED_DECIMALS.
2478
2479 Sun Mar  6 17:07:20 2005  Ben Pfaff  <blp@gnu.org>
2480
2481         When the lexer sees something like `-5' in the input, it has to
2482         decide whether it's a negative numeric constant token or a '-'
2483         token followed by a positive numeric constant token.  It always
2484         decides on the former, and then the parser can call
2485         lex_negative_to_dash() if it wants the latter.  However, this
2486         doesn't work for the case of `-0', because negative zero is
2487         (portably) indistinguishable from positive zero.  So now we divide
2488         T_NUM into two tokens, T_POS_NUM and T_NEG_NUM, to make the
2489         distinction clear.  This requires a little bit of extra effort,
2490         because there were several references to T_NUM in the code base.
2491         
2492         * lexer.c: (lex_get) Use T_NEG_NUM and T_POS_NUM to distinguish
2493         positive and negative numeric constants.
2494         (lex_double_p) Renamed lex_is_number().  Changed return type to
2495         bool.  Updated all relevant references to T_NUM to instead use
2496         this function.
2497         (lex_double) Renamed lex_number().  All references updated.
2498         (lex_integer_p) Renamed lex_is_integer().  Changed return type to
2499         bool.  All references updated.
2500         (lex_token_representation) Understand T_NEG_NUM and T_POS_NUM.
2501         (lex_negative_to_dash) Ditto.
2502         (dump_token) Ditto.
2503         
2504         * lexer.h: (enum) Add T_POS_NUM, T_NEG_NUM.  Remove T_NUM.
2505
2506 Sun Mar  6 22:09:20 2005  Ben Pfaff  <blp@gnu.org>
2507
2508         * expressions/operations.def: (NUMBER) Use DI_IMPLIED_DECIMALS.
2509
2510 Sun Mar  6 19:33:24 2005  Ben Pfaff  <blp@gnu.org>
2511
2512         * expressions/operations.def: (VEC_ELEM_NUM) Treat user-missing
2513         values as system-missing.
2514
2515         * expressions/parse.c: (parse_vector_element) Fix order of
2516         arguments in call to expr_allocate_binary().
2517
2518 Sun Mar  6 17:51:05 2005  Ben Pfaff  <blp@gnu.org>
2519
2520         * expressions/optimize.c: (optimize_tree) Fix optimization bug for
2521         x**2.
2522
2523         * expressions/parse.c: (type_coercion_core) Set *node to NULL on
2524         failure, as indicated by function comment.
2525         (parse_binary_operators) Always return NULL on type_coercion()
2526         failure.  Should have been doing this anyway, but bug in
2527         type_coercion_core() filtered through.
2528         (parse_add) Fix typo in user message.
2529         (parse_primary) Understand T_NEG_NUM and T_POS_NUM.
2530
2531 Sun Mar  6 10:47:13 2005  Ben Pfaff  <blp@gnu.org>
2532
2533         * expressions/operations.def: Add VALUE function.
2534
2535         * expressions/parse.c: (parse_function) Need an unary composite
2536         node for variables in A TO B, not a variable node.  Use
2537         allocate_unary_variable().
2538         (parse_primary) Use allocate_unary_variable().
2539         (allocate_unary_variable) New function.
2540
2541 Thu Mar  3 23:53:32 2005  Ben Pfaff  <blp@gnu.org>
2542
2543         * expressions/PSPP_expressions.pm: Renamed it back to generate.pl
2544         but fixed the real problem that was preventing the build from a
2545         separate directory.  I liked it my way better ;-)
2546         
2547 Thu Mar  3 23:17:51 2005  Ben Pfaff  <blp@gnu.org>
2548
2549         * expressions/parse.c: (expr_parse) Fix parameter type.  Thanks to
2550         John Darrington <john@darrington.wattle.id.au> for reporting this
2551         bug.
2552
2553 Thu Mar  3 22:10:25 WST 2005 John Darrington <john@darrington.wattle.id.au>
2554
2555         * expressions/Makefile.am expressions/evaluate.h.pl
2556           expressions/evaluate.inc.pl expressions/operations.h.pl
2557           expressions/optimize.inc.pl expressions/parse.inc.p:
2558
2559           Renamed generate.pl to PSPP_expressions.pm and adjusted *.pl
2560           to suit. 
2561
2562           Fixed everything so that it can be built from an arbitrary
2563           directory.
2564         
2565 Thu Mar  3 22:08:35 WST 2005 John Darrington <john@darrington.wattle.id.au>
2566
2567         * Makefile.am : Fixed up CLEANFILES target.
2568
2569 Mon Feb 28 23:49:56 2005  Ben Pfaff  <blp@gnu.org>
2570
2571         * str.h: Changed `struct len_string' to `struct fixed_string', a
2572         more accurate name.  Updated all references.
2573
2574 Mon Feb 28 23:35:30 2005  Ben Pfaff  <blp@gnu.org>
2575
2576         Redo calendar support.  Should now be bug-for-bug compatible.
2577         
2578         * calendar.c: New file.
2579
2580         * calendar.h: New file.
2581
2582         * data-in.c: Use new calendar functions.
2583         (parse_sign) Change sense of return value.
2584         (calendar_error) New function.
2585         (ymd_to_ofs) New function.
2586         (ymd_to_date) New function.
2587         (parse_DATE) Use new function.
2588         (parse_ADATE) Ditto.
2589         (parse_EDATE) Ditto.
2590         (parse_SDATE) Ditto.
2591         (parse_JDATE) Ditto.
2592         (parse_QYR) Ditto.
2593         (parse_MOYR) Ditto.
2594         (parse_WKYR) Ditto.
2595         (parse_TIME) Ditto.
2596         (parse_DTIME) Ditto.
2597         (parse_DATETIME) Ditto.
2598
2599         * data-out.c: (convert_date) Use new calendar functions.
2600
2601         * error.c: (err_vmsg) Changed interface to be more sensible.
2602         Updated all callers.
2603         (dump_message) Don't double new-lines (why did we do this
2604         anyway?).
2605
2606 Mon Feb 28 23:30:25 2005  Ben Pfaff  <blp@gnu.org>
2607
2608         * sfmP.h: (macro flt64) Moved here from pref.h.orig.
2609         (macro FLT64_MAX) Moved here from pref.h.orig.
2610
2611 Mon Feb 28 23:28:01 2005  Ben Pfaff  <blp@gnu.org>
2612
2613         * set.q: Support SET EPOCH.
2614         (static var set_epoch) New var.
2615         (aux_stc_custom_epoch) New function.
2616         (stc_custom_epoch) New function.
2617         (get_epoch) New function.
2618         (stc_custom_pager) [USE_INTERNAL_PAGER] Fix bug.
2619
2620         * format.c: Make it possible just to check whether a specifier is
2621         valid without emitting an error message.
2622         (parse_format_specifier_name) Change interface, update all
2623         callers.
2624         (check_input_specifier) Ditto.
2625         (check_output_specifier) Ditto.
2626         (parse_format_specifier) Ditto.
2627
2628 Mon Feb 28 23:24:08 2005  Ben Pfaff  <blp@gnu.org>
2629
2630         * command.def: Add DEBUG POOL.
2631
2632         * pool.c: (pool_destroy) Fix bug in deleting this pool from its
2633         parent.
2634         (pool_clear) Properly account for size of pool gizmo.
2635         (pool_realloc) Ditto.
2636         (pool_clone) New function.
2637
2638         * pool.h: Mark our allocation functions MALLOC_LIKE.
2639
2640 Mon Feb 28 23:21:26 2005  Ben Pfaff  <blp@gnu.org>
2641
2642         * Makefile.am: Move many definitions into new top-level
2643         Make.build.  Add expressions to SUBDIRS.  Add calendar.c,
2644         calendar.h.  Remove expr-evl.c, expr-opt.c expr-prs.c, expr.h,
2645         exprP.h, expr.def.
2646
2647         * case.c: (case_resize) New function.
2648         (case_swap) New function.
2649
2650         * casefile.c: Include mkfile.h.
2651
2652 Fri Feb 25 21:11:35 WST 2005 John Darrington <john@darrington.wattle.id.au>
2653
2654         * sfm-read.c: Fixed a buglet which caused a crash when trying
2655         to read a non-existent file.
2656
2657 Sun Feb 13 16:11:13 2005  Ben Pfaff  <blp@gnu.org>
2658
2659         Fix bug 11955.
2660
2661         * aggregate.c: (parse_aggregate_functions) Code cleanup.
2662         Important part: get rid of spurious copying of function->format to
2663         destvar->print and destvar->write.
2664
2665 Fri Feb 11 00:08:36 2005  Ben Pfaff  <blp@gnu.org>
2666
2667         Fix bug 11916, which was confusing a variable's `index' member
2668         with the variable's position in a var_set.  Although these are
2669         usually the same, they are not for array `var_set's.
2670         
2671         Took advantage of this bug as an opportunity to clean up and
2672         rewrite parse_var_set_vars().
2673
2674         * vars-prs.c: (parse_vs_variable_idx) New function.
2675         (parse_vs_variable) Reimplement in terms of
2676         parse_vs_variable_idx().
2677         (parse_var_idx_class) New function.
2678         (add_variable) New function.
2679         (add_variables) New function.
2680         (parse_var_set_vars) Rewritten.
2681         (struct var_set) Change `lookup_var' member that returns a
2682         variable into `lookup_var_idx' member that returns an int.
2683         Updated the var set implementations in obvious corresponding ways.
2684         Used compare_var_ptr_names(), hash_var_ptr_name() just added.
2685         
2686 Fri Feb 11 00:06:03 2005  Ben Pfaff  <blp@gnu.org>
2687
2688         Use our global variable compare & hash functions and give them
2689         better names.  Add similar functions for dealing with double
2690         pointers to variables.
2691         
2692         * vars-atr.c: (compare_variables) Renamed compare_var_names().
2693         (hash_variable) Renamed hash_var_name().
2694         (compare_var_ptr_names) New function.
2695         (hash_var_ptr_name) New function.
2696         
2697         * t-test.q: (cmd_t_test) Use global compare_var_names(),
2698         hash_var_name().
2699         (compare_var_name) Removed.
2700         (hash_var_name) Removed.
2701
2702 Fri Feb 11 00:04:39 2005  Ben Pfaff  <blp@gnu.org>
2703
2704         Fix dictionary bug.
2705         
2706         * dictionary.c: (compare_variable_dblptrs) Rename
2707         compare_var_ptrs() and fix it to properly dereference the double
2708         pointers.
2709
2710 Mon Feb  7 09:58:15 WST 2005 John Darrington <john@darrington.wattle.id.au>
2711
2712         crosstabs.q examine.q oneway.q q2c.c:  Added a q2c feature to 
2713         declare subcommands as mandatory.  Closed bug #11843
2714
2715 Sat Feb  5 20:35:10 WST 2005 John Darrington <john@darrington.wattle.id.au>
2716         
2717         * getline.c command.[ch] command.def:  Added (very rudimentary)
2718         support for line  completion when in interactive mode.  Partially 
2719         addresses bug #11693
2720         
2721 Mon Jan 31 09:52:51 WST 2005 John Darrington <john@darrington.wattle.id.au>
2722
2723         * examine.q factor_stats.c oneway.q output.c pfm-read.c: Fixed some
2724         problems revealed by valgrind.
2725
2726
2727 Wed Jan 26 11:44:11 WST 2005 John Darrington <john@darrington.wattle.id.au>
2728
2729         * set.q: Affixed a fix to the previous fix such that we'll be OK now
2730         whether or not PAGER is set.
2731
2732 Wed Jan 26 09:25:54 WST 2005 John Darrington <john@darrington.wattle.id.au>
2733
2734         * set.q: Copied the string produced by getenv("PAGER") thus avoiding
2735         "invalid free" errors.  Hopefully fixes bug #11722
2736
2737         * compute.c expr-prs.c: Check that lvalues are populated before 
2738         attempting to destroy them.  Closes bug #11676
2739
2740 Tue Jan 25 21:01:43 WST 2005 John Darrington <john@darrington.wattle.id.au>
2741
2742         * aggregate.c: Initialised the complete agr_proc structure.
2743         Closes bug #11675
2744
2745
2746 Sun Jan 23 23:02:21 2005  Ben Pfaff  <blp@gnu.org>
2747
2748         * print.c: (print_trns_free) Close the dfm writer if there is one,
2749         fixing a memory leak.
2750
2751 Mon Jan 24 12:24:36 WST 2005 John Darrington <john@darrington.wattle.id.au>
2752
2753         * glob.c oneway.q q2c.c t-test.q vfm.c: Still *more* memory leaks 
2754         fixed.
2755
2756
2757 Fri Jan 21 19:54:14 WST 2005 John Darrington <john@darrington.wattle.id.au>
2758
2759         * linked-list.[ch] Added
2760
2761         * examine.q file-handle.[hq] font.h glob.c groff-font.c postscript.c 
2762           set.q:    Yet more memory leaks
2763
2764 Tue Jan 18 23:12:40 WST 2005 John Darrington <john@darrington.wattle.id.au>
2765
2766         * t-test.q examine.q : More memory leaks fixed.
2767
2768 Tue Jan 18 19:26:59 WST 2005 John Darrington <john@darrington.wattle.id.au>
2769
2770         * examine.q  factor_stats.[ch] get.c pfm-read.c: Plugged numerous
2771         memory leaks.
2772
2773 Mon Jan 10 14:43:45 WST 2005 John Darrington <john@darrington.wattle.id.au>
2774
2775         * ascii.c cartesian.c casefile.c chart.h devind.c 
2776           examine.q frequencies.q
2777           html.c output.h piechart.c plot-chart.c plot-hist.c
2778
2779           Integrated the chart rendering into the output stream
2780           (currently only works for html).
2781           
2782           Removed gratuitous use of ifndef NO_CHARTS, and replaced with
2783           dummy-chart.c for compiling without charts.
2784
2785         * mkfile.[ch] Created.  
2786
2787         * som.[ch] tab.[ch]: Changed name of som_table to som_entity
2788         Added type element so we can tell if it's a chart or a table.
2789
2790         * chart.h examine.q piechart.c plot-chart.c plot-hist.c: changed the 
2791         API of charts to be more like that of tables.
2792
2793 Thu Jan 13 21:00:02 WST 2005 John Darrington <john@darrington.wattle.id.au>
2794
2795         * casefile.c main.c: Moved the SIGINT handler from casefile.c to
2796         main.c. Removed the handler for SIGQUIT.
2797
2798 Mon Jan 10 14:43:45 WST 2005 John Darrington <john@darrington.wattle.id.au>
2799
2800         * casefile.c: Added a signal handler to delete temp files on 
2801         SIGINT and SIGQUIT
2802
2803         * permissions.c Inhibited the PERMISSIONS command when SAFER is on.
2804
2805         * command.def Added a lot more unimplemented commands.
2806
2807         * copyleft.[ch] cmdline.c Moved legal information to copyleft.c
2808
2809 Sat Jan  8 23:58:34 2005  Ben Pfaff  <blp@gnu.org>
2810
2811         * sort.c: (compare_initial_runs) Needed additional level of
2812         dereferencing.
2813         (merge_once) Fix plenty of stupid mistakes.
2814
2815 Sat Jan  8 23:55:27 2005  Ben Pfaff  <blp@gnu.org>
2816
2817         * casefile.c: (casefile_sleep) Need to flush_buffer() after
2818         calling casefile_to_disk() or we will lose the last block in the
2819         file if the casefile started out as disk-based.
2820         (casefile_get_reader) Initialize reader->destructive to 0.
2821         (cmd_debug_casefile) Add new test pattern.
2822         (test_casefile) Define new test pattern to make sure
2823         casefile_sleep() works properly.
2824
2825 Fri Jan  7 08:00:05 WST 2005 John Darrington <john@darrington.wattle.id.au>
2826
2827         * Makefile.am chart.[ch]  histogram.[ch] piechart.c (Modified);
2828           plot-hist.c plot-chart.c (Added) Reorganised these files in an
2829           attempt to seperate the creation and processing of charts from their
2830           actuall renedering.
2831
2832         * examine.q frequencies.q generated charts conditional upon the NO_CHARTS
2833           macro.
2834
2835 Thu Jan  6 18:48:58 WST 2005 John Darrington <john@darrington.wattle.id.au>
2836
2837         * main.c Added a signal handler for SIGFPE
2838
2839         * sort.c Somewhat more robust fix to the previous entry.
2840
2841 Wed Jan  5 21:23:31 2005  Ben Pfaff  <blp@gnu.org>
2842
2843         * sort.c: (merge) Fix assertion for proper Huffman merge pattern:
2844         0 == 1 modulo 1.  See Knuth 5.4.9 (vol. 3, 2nd ed.,
2845         pp. 361).  Thanks to John Darrington <john@cellform.com.au> for
2846         reporting the bug.
2847
2848 Wed Jan  5 22:42:26 WST 2005 John Darrington <john@darrington.wattle.id.au>
2849
2850         * case.h Fixed bug # 11307
2851         
2852 Wed Jan  5 08:30:48 WST 2005 John Darrington <john@darrington.wattle.id.au>
2853
2854         * val-labs.c Fixed bug which caused a crash if VALUE LABELS had
2855         a trailing slash.
2856
2857 Mon Jan  3 17:44:37 2005  Ben Pfaff  <blp@gnu.org>
2858
2859         * pfm-read.c: (read_variables) Remove direct manipulation of
2860         v->aux, which is no longer needed.  Fixes bug 11483.
2861
2862 Sat Jan  1 19:01:16 WST 2005 John Darrington <john@darrington.wattle.id.au>
2863
2864         * data-list.c Fixed a bug in parsing delimiters.
2865
2866         * group.c vars-atr.c Fixed buglet in hash/compare functions for alpha
2867         values.
2868
2869         * percentiles.c Properly handled calculation of Tukey hinges where
2870         the number of data is small.
2871
2872         * oneway.q Used the generic value_to_string function for independent
2873         variable instead of trying to do it ourselves.
2874
2875         * box-whisker.c Fixed a buglet which caused a crash if the number of
2876         data was zero
2877
2878
2879 Fri Dec 31 16:47:45 WST 2004 John Darrington <john@darrington.wattle.id.au>
2880
2881         * examine.q box-whisker.c chart.h Implemented boxplots in EXAMINE
2882
2883         * percentiles.c Fixed some bugs when calculating percentiles when
2884         there's a small number of cases.
2885
2886 Wed Dec 29 08:18:08 WST 2004 John Darrington <john@darrington.wattle.id.au>
2887
2888         * percentiles.[ch] Added. Calculates percentiles and Tukey hinges
2889
2890         * examine.q factor_stats.[ch]  Added calculation of percentiles
2891
2892 Fri Dec 24 15:09:11 WST 2004 John Darrington <john@darrington.wattle.id.au>
2893
2894         * t-test.q Fixed bug #11227 Made t-test work when the independent
2895         variable is alpha
2896
2897 Sat Dec 11 11:43:45 WST 2004 John Darrington <john@darrington.wattle.id.au>
2898
2899         * factor_stats.c Fixed calculation of trimmed mean under various
2900         special conditions.
2901
2902 Sat Dec  4 17:14:45 WST 2004 John Darrington <john@darrington.wattle.id.au>
2903
2904         * histogram.c chart.[ch] factor_stats.c frequencies.q
2905
2906         Added code to calculate sensible histogram ranges and limits.
2907
2908 Thu Dec  2 13:37:43 WST 2004 John Darrington <john@darrington.wattle.id.au>
2909
2910         * chart.h Updated to reflect many API changes.
2911
2912         * cartesian.c chart.c Moved the definitions of chart_write_{xy}scale from 
2913         cartesian.c and into chart.c
2914
2915         * factorstats.[ch] Added the histogram calculations
2916
2917         * casefile.c Removed an unused variable.
2918
2919         * frequencies.q examine.q histogram.c  Reworked the API for 
2920         histograms.
2921
2922         * piechart.c  Revised the API for piecharts.
2923
2924         * var.h  Moved the definitions of freq_tab and freq out of var.h
2925         and into frequencies.q where they belong.
2926         
2927 Tue Nov 30 21:10:20 2004  Ben Pfaff  <blp@gnu.org>
2928
2929         * flip.c: (flip_file) Check for off_t separately from fseeko(),
2930         using AC_TYPE_OFF_T.
2931
2932 Tue Nov 30 08:47:41 2004  Ben Pfaff  <blp@gnu.org>
2933
2934         * flip.c: (flip_file) If fseeko() is not available, use long int
2935         for off_t.  Thanks to "Marshall DeBerry" <mdb@radix.net> for
2936         reporting the problem.
2937
2938 Mon Nov 29 12:20:59 WST 2004 John Darrington <john@darrington.wattle.id.au>
2939
2940         * examine.q factor_stats.[ch] Changed stderr to se_mean to avoid
2941         conflict with stdio.
2942
2943 Sun Nov 21 10:32:41 WST 2004 John Darrington <john@darrington.wattle.id.au>
2944
2945         * var-labs.c (var_to_string) Now returns null if the variable is null
2946
2947         * value-labels.c (value_to_string) Made it return null if either the 
2948         value or the variable is null.
2949
2950         * hash.c (hsh_clear) Fixed a buglet.
2951
2952         * examine.q  factor_stats.[ch] Largely  rewrote, because I'd started 
2953         with  the wrong model.
2954
2955         * casefile.[ch] Added a function to return the casereader.case_idx 
2956         member
2957
2958         * examine.q  Implemented the extreme values results.
2959
2960 John Darrington <john@darrington.wattle.id.au>
2961
2962         * settings.h set.c glob.[ch] frequencies.q q2c.c error.c lexer.[ch] 
2963           output.[ch] getline.c 
2964
2965           Plugged some memory leaks
2966
2967 Mon Nov 15 23:47:40 2004  Ben Pfaff  <blp@gnu.org>
2968
2969         Adopt GSL random number generators, paving the way for providing
2970         the complete suite of random number generators on expressions.
2971         
2972         * Makefile.am: Remove random.c, random.h.
2973
2974         * random.c: Removed.
2975
2976         * random.h: Removed.
2977
2978         * algorithm.c: (algo_default_random) Use GSL functions.
2979
2980         * casefile.c: (test_casefile) Use GSL RNG functions.
2981
2982         * expr-evl.c: (expr_evaluate) Use GSL RNG functions for OP_NORMAL,
2983         OP_UNIFORM.
2984
2985         * sample.c: (cmd_sample) Use GSL RNG functions.
2986         (sample_trns_proc) Ditto.
2987
2988         * set.q: (static var set_seed) Removed.
2989         (static var seed_flag) Removed.
2990         (static var rng) New variable.
2991         (aux_stc_custom_seed) No seed value anymore, don't print anything.
2992         (stc_custom_seed) Use new seed functions.
2993         (seed_is_set) Removed.
2994         (get_rng) New function that composes the entire external
2995         interface.
2996         (set_rng) New function.
2997         (random_seed) New function.
2998
2999 Mon Nov 15 22:08:25 2004  Ben Pfaff  <blp@gnu.org>
3000
3001         * expr-evl.c: (expr_evaluate) Fix XDATE.JDAY formula.  Thanks to
3002         John Darrington <john@darrington.wattle.id.au> for reporting this
3003         bug.
3004
3005 Tue Nov 16 13:19:18 WST 2004 John Darrington <john@darrington.wattle.id.au>
3006
3007         * permissions.c command.def Added the PERMISSIONS command
3008
3009 Mon Nov 15 01:33:32 2004  Ben Pfaff  <blp@gnu.org>
3010
3011         * q2c.c: (dump_header) Don't try to emit #includes at very top of
3012         output file because that will precede #include <config.h>, which
3013         is bad.
3014         (main) Add needed headers to /* (header) */ code.
3015
3016 Mon Nov 15 01:21:36 2004  Ben Pfaff  <blp@gnu.org>
3017
3018         Instead of making system or portable file readers responsible for
3019         dropping and reordering variables, make them read full cases and
3020         let the caller take care of any changes.
3021
3022         * get.c: New "case map" structure to handle this.  Use for GET,
3023         IMPORT, MATCH FILES.  Essentially rewrite the whole file.
3024
3025         * pfm-read.c: (pfm_read_case) Read into provided case.  Signature
3026         changed appropriately.
3027
3028         * sfm-read.c: (sfm_read_case) Ditto.
3029
3030 Mon Nov 15 00:47:45 2004  Ben Pfaff  <blp@gnu.org>
3031
3032         Decided that case_serialize() and case_unserialize() were too
3033         abstract.  Also we need a couple more functions to avoid excessive
3034         copying for data in/out fast paths.
3035
3036         * case.c: (case_serial_size) Removed.
3037         (case_serialize) Rename case_to_values() and make its argument
3038         explicitly an array of union values.
3039         (case_unserialize) Rename case_from_values() and make its argument
3040         explicitly an array of union values.
3041         (case_data_all) New function.
3042         (case_data_all_rw) New function.
3043
3044         * casefile.c: (struct casefile) Change buffer from array of
3045         unsigned char to array of union value for better accuracy.
3046         Redefine buffer_used and buffer_size in terms of values, not
3047         bytes.  Remove case_size because it is now redundant with
3048         value_cnt.  Fix up all references to these members.
3049
3050 Mon Nov 15 00:45:46 2004  Ben Pfaff  <blp@gnu.org>
3051
3052         * barchart.c: (struct subcat) Make `label' member const to silence
3053         GCC warning with -Wwrite-strings.
3054
3055         * cartesian.c: (struct dataset) Ditto.
3056
3057         * case.c: Don't re-define NDEBUG if already defined.
3058         Add lots of comments.
3059
3060         * str.c: Fix includes.
3061
3062         * crosstabs.q: Fix includes.
3063
3064         * examine.q: Fix includes.  Fix GCC warning about unused
3065         variables.
3066         
3067         * frequencies.q: (stat macro) Removed and replaced where used by
3068         its expansion.
3069
3070         * list.q: Fix includes.
3071
3072         * oneway.q: Fix includes.
3073
3074         * piechart.c: Fix includes.  Only define M_PI if not already
3075         defined.
3076
3077         * sfm-read.c: (bswap) New function.
3078         (bswap_int32) Write in terms of bswap.
3079         (bswap_flt64) Ditto.
3080
3081         * str.c: (ds_data) Add external definition here, needed because
3082         str.h has only an `extern inline' version.
3083
3084         * value-labels.c: Fix includes.
3085
3086 Mon Nov 15 00:40:55 2004  Ben Pfaff  <blp@gnu.org>
3087
3088         Instead of providing a system or portable file writer with a raw
3089         case in the format needed for output, provide it with a regular
3090         case.  The writer takes care of any needed translation.
3091
3092         * aggregate.c: Adopt new scheme for AGGREGATE.
3093         (struct agr_proc) sfm_agr_case member removed.
3094         (write_case_to_sfm) Removed because the new interface is easier to
3095         use.
3096
3097         * get.c: Adopt new scheme for SAVE, XSAVE, EXPORT.
3098
3099         * pfm-write.c: Implement new scheme.
3100
3101         * sfm-write.c: Ditto.
3102
3103 Mon Nov 15 00:32:24 2004  Ben Pfaff  <blp@gnu.org>
3104
3105         Instead of treating `struct file_handle' as a class to subclass
3106         into data files, system files, and portable files, instead use it
3107         as a helper that coordinates access.  Now it is opaque, too.
3108
3109         This means that most references to a struct file_handle are now
3110         changed into references to one of struct dfm_reader, struct
3111         dfm_writer, struct sfm_reader, struct sfm_writer, struct
3112         pfm_reader, or struct pfm_writer, according to what's being read
3113         or written.
3114
3115         Most related changes are only worth summarizing briefly.
3116
3117         * dictionary.c: (dict_clear) Destroy aux data in deleted
3118         variables.
3119         (dict_clear_aux) New function.
3120         (dict_create_var) Initialize aux, aux_dtor.
3121         (dict_delete_var) Destroy aux data in deleted variable.
3122
3123         * file-handle.h: (struct fh_ext_class) Removed.
3124         (struct file_handle) Removed.
3125         (fh_init_files) Removed.
3126
3127         * file-handle.q: Changed references to a handle's `private' member
3128         to direct references.
3129         (struct private_file_handle) Renamed file_handle.
3130         Add next, open_cnt, type, open_mode, aux members.
3131         (struct file_handle_list) Removed.
3132         (extern var inline_file) Removed.
3133         (static var file_handles) Changed from file_handle_list * to
3134         file_handle *.
3135         (create_file_handle) Initialize new members.
3136         (fh_close_handle) Removed.
3137         (mode_name) New function.
3138         (fh_open) New function.
3139         (fh_close) New function.
3140         (fh_parse_file_handle) Renamed fh_parse().
3141
3142         * glob.c: (init_glob) Remove fh_init_files() call.
3143         
3144         * aggregate.c: use sfm_writer.
3145         (create_sysfile) Removed because the new interface is simpler.
3146         
3147         * apply-dict.c: Use sfm_reader.
3148
3149         * data-list.c: Use dfm_reader.
3150
3151         * file-type.c: Use dfm_reader.
3152
3153         * get.c: Use sfm_reader, sfm_writer, pfm_reader, pfm_writer.
3154
3155         * inpt-pgm.c: Use dfm_reader.
3156
3157         * print.c: Use dfm_writer.
3158
3159         * sysfile-info: Use sfm_reader.
3160
3161         * dfm-read.c: Adopt new file handle infrastructure.
3162
3163         * dfm-write.c: Ditto.
3164
3165         * pfm-read.c: Ditto.
3166         
3167         * pfm-write.c: Ditto.
3168
3169         * sfm-read.c: Ditto.
3170
3171         * sfm-write.c: Ditto.
3172         
3173 Mon Nov 15 00:31:44 2004  Ben Pfaff  <blp@gnu.org>
3174
3175         Break dictionary functions into separate header file.
3176
3177         * dictionary.h: New file.
3178
3179         * var.h: Moved dict_*() functions to dictionary.h.
3180
3181 Mon Nov 15 00:30:33 2004  Ben Pfaff  <blp@gnu.org>
3182
3183         Get rid of procedure-specific union in struct variable, using
3184         instead a void * pointer and a destructor function.
3185
3186         Most related changes are only worth brief summaries.
3187
3188         * crosstabs.q: Fix includes.  Use new struct var_range in lieu of
3189         old p.crs member in struct variable.
3190         
3191         * frequencies.q: Fix includes.  Use new struct var_freqs in lieu
3192         of old p.frq member in struct variable.
3193
3194         * histogram.c: (draw_histogram) Takes new freq_tab arg because
3195         it's no longer possible to grab this from var->p.frq.
3196
3197         * piechart.c: (draw_piechart) Ditto.
3198
3199         * group.c: (group_proc_get) New function.
3200
3201         * levene.c: Use group_proc_get() in lieu of old p.grp_data member
3202         in struct variable.
3203
3204         * oneway.q: Ditto.
3205
3206         * t-test.q: Ditto.
3207
3208         * main.c: (execute_command) Clear aux data in default_dict after
3209         each command.  (It's debatable whether this should be done.)
3210
3211         * matrix-data.c: Use new struct mxd_var in lieu of old p.mxd
3212         member in struct variable.
3213
3214         * means.q: Get rid of integer mode, which is not included in
3215         recent SPSS and was the only code that wanted per-variable private
3216         data.
3217
3218         * var.h: (struct crosstab_proc) Removed.
3219         (struct frequencies_proc) Removed.
3220         (struct list_proc) Removed.
3221         (struct get_proc) Removed.
3222         (struct means_proc) Removed.
3223         (struct matrix_data_proc) Removed.
3224         (struct match_files_proc) Removed.
3225         (lots of enums) Removed.
3226         (struct variable) Removed members `p', `get'.  Add member
3227         `aux_dtor'.
3228
3229         * vars-atr.c: (var_attach_aux) New function.
3230         (var_detach_aux) New function.
3231         (var_clear_aux) New function.
3232         (var_dtor_free) New function.
3233         (discard_variables) Use NULL instead of inline_file.
3234
3235 Fri Nov 12 10:07:11 WST 2004 John Darrington <john@darrington.wattle.id.au>
3236
3237         * value-labs.c  Fixed the implmentation of value_to_string, so 
3238         that it properly handles alpha values.
3239
3240         * oneway.q  Changed instances where labels were being probed manually, 
3241         to use the canonical {var,value}_to_string functions
3242
3243 Thu Nov 11 21:01:31 WST 2004 John Darrington <john@darrington.wattle.id.au>
3244
3245         * examine.q cartesian.c chart.[ch]   Added normal and detrended normal
3246         plots.  Changed the API of the cartesian plot to be a much lower level
3247         thing.
3248
3249 Sun Nov  7 17:25:04 WST 2004 John Darrington <john@darrington.wattle.id.au>
3250
3251         * examine.q Added some of the parametric calculations
3252
3253         * factor_stats.[ch]  Created
3254         
3255 Sat Nov  6 21:24:31 WST 2004 John Darrington <john@darrington.wattle.id.au>
3256
3257         * examine.q  Changed the definition of factors to be a composite, and
3258         dealt with the consequences.
3259
3260 Sat Nov  6 20:40:38 WST 2004 John Darrington <john@darrington.wattle.id.au>
3261
3262         * examine.q Fixed problem where examine wasn't dealing properly with 
3263         splits
3264
3265 Sat Nov  6 14:49:47 WST 2004 John Darrington <john@darrington.wattle.id.au>
3266
3267         * oneway.q Fixed problem where oneway wasn't dealing properly with 
3268         splits
3269
3270 Thu Nov  4 11:09:01 WST 2004 John Darrington <john@darrington.wattle.id.au>
3271
3272         * q2c.c examine.q  Fixed a bug (feature?) whereby arrays in the
3273         command which had settings didn't get the appropriate code
3274         generated.
3275
3276         * val.h value-labels.[ch] var-labs.c Added v*to_string functions
3277         to convert variables/values to strings.
3278
3279         * examine.q  Added framework for the EXAMINE command.
3280
3281 Mon Nov  1 12:46:17 WST 2004 John Darrington <john@darrington.wattle.id.au>
3282
3283         * q2c.c frequencies.q set.q t-test.q  Fixed the q2c parsing of DBL 
3284         subcommand types.  Changed frequencies.q to use it rather then the 
3285         custom parser.  Dealt with the consequences.  Added a test for NTILES
3286         subcommand of frequencies.
3287
3288 Sat Oct 30 09:16:29 WST 2004 John Darrington <john@darrington.wattle.id.au>
3289
3290         * oneway.q   Fixed up the behaviour when given missing values
3291
3292         * levene.c oneway.q Fixed a buglet with the levene statistic and
3293         incorporated the levene test into the oneway command.
3294
3295         * group.h  t-test.q  Moved the CMP_EQ and CMP_LE symbols out of 
3296         global scope, since they're only relevant to T-TEST
3297
3298 Fri Oct 29 17:39:03 WST 2004 John Darrington <john@darrington.wattle.id.au>
3299
3300         * group.c group.h group_proc.h levene.c oneway.q t-test.q
3301
3302         Made the t-test more consistent
3303         with the way it handles groups.  That is, it now uses a hash instead
3304         of an array of 2.  Also, made the levene.c file independent of the 
3305         implementation of the t-test.  So now levene should be fine for both
3306         t-test and anova.
3307
3308         * Added an oneway.q file for one way anova
3309
3310 Wed Jun  2 22:08:02 2004  Ben Pfaff  <blp@gnu.org>
3311
3312         * descript.c: (cmd_descriptives) Remove harmless but bogus test in
3313         STATISTICS parsing.
3314
3315 Mon May 31 20:45:24 2004  Ben Pfaff  <blp@gnu.org>
3316
3317         Fix memory leaks.
3318
3319         * data-list.c: (cmd_data_list) Free dls->delims on lossage.
3320         (data_list_trns_free) Free dls->delims.
3321
3322         * t-test.q: (tts_custom_pairs) Free vars.
3323         (ssbox_one_sample_init) Fix tab_vline() argument.
3324         (ssbox_independent_samples_init) Ditto.
3325         (trbox_paired_init) Ditto.
3326         (trbox_one_sample_init) Ditto.
3327
3328 Mon May 31 17:19:27 2004  Ben Pfaff  <blp@gnu.org>
3329
3330         Generalize casefiles to the extent that we can use them for
3331         sorting and other kinds of data transformations.  Change cases to
3332         be copy-on-write to improve memory efficiency in common cases.
3333         Every access to a member of a `struct ccase' was changed to be a
3334         call to a case_*() function, especially case_data(), case_num(),
3335         case_str(), or case_data_rw().  Many instances of a local variable
3336         named "case_num" were changed to "case_idx" as a consequence.
3337         Many `struct ccase *' were changed to actual `struct ccase'
3338         because of copying semantics of cases.  In several places there
3339         was a choice between updating debug code to work with the new ADTs
3340         or just deleting it because it was useless; I chose to delete it.
3341  
3342         * Makefile.am: (pspp_SOURCES) Add case.c, case.h.
3343
3344         * case.c: New file.
3345
3346         * case.h: New file.
3347
3348         * aggregate.c: (struct agr_proc) Change type of `sort' to
3349         sort_criteria *.  Add `break_vars', `break_var_cnt' members.
3350         Rename `vars' to `agr_vars', all references updated.  Change
3351         `agr_case' to type `struct ccase'.
3352         (cmd_aggregate) Deal with new members.  Use case_create(),
3353         sort_active_file_in_place(), sort_active_file_to_casefile().
3354         (agr_destroy) Deal with new members.
3355         (aggregate_single_case) Ditto.
3356         (dump_aggregate_info) Ditto.
3357         (initialize_aggregate_info) Ditto.
3358         (agr_to_active_file) Ditto.
3359         (presorted_agr_to_sysfile) Ditto.
3360         (sort_agr_to_sysfile) Removed.
3361
3362         * alloc.c: (out_of_memory) Make non-static.
3363
3364         * alloc.h: Prototype out_of_memory().
3365
3366         * casefile.c: Switched from a linked list in-memory representation
3367         to a two-level array-style representation.  The linked list was
3368         appropriate when we could stick a header onto cases, but that's no
3369         longer the case.  Also, the two-level array will allow for random
3370         in-memory access in case that's ever wanted.  Also added the
3371         concept of a `destructive casereader', one that destroys cases in
3372         the underlying casefile as they are read out.
3373         (macro CASES_PER_BLOCK) New macro.
3374         (struct casefile) New members `value_cnt', `case_list_size',
3375         `case_acct_size', `being_destroyed', `cases'.  Removed `head',
3376         `tail'.
3377         (struct casereader) Removed `cur'.  Added `destructive', `c'.
3378         (global var casefiles) Made static.
3379         (static var case_bytes) New var.
3380         (casefile_create) Takes a value count, not a case size in bytes,
3381         to conform to the case interface.  All callers updated.  Deal with
3382         new and removed members.
3383         (casefile_destroy) Deal with new and removed members.
3384         (casefile_sleep) New function.
3385         (casefile_get_case_size) Removed.
3386         (casefile_get_value_cnt) New function.
3387         (casefile_append) Rewritten to deal with new and removed members.
3388         (casefile_append_xfer) New function.
3389         (write_case_to_disk) Use case_serialize().
3390         (call_posix_fadvise) Removed because posix_fadvise64 segfaults.
3391         Couldn't figure out why.
3392         (casefile_to_disk) Don't call call_posix_fadvise.  Rewritten to
3393         deal with new and removed members.
3394         (merge) Removed.
3395         (merge_sort) Removed.
3396         (casefile_sort) Removed.
3397         (casefile_get_reader) Deal with new and removed members.
3398         (casefile_get_destructive_reader) New function.
3399         (reader_open_file) Make code more readable.  Create case for
3400         reader.
3401         (casereader_get_casefile) New function.
3402         (casereader_read) Deal with new and removed members.  Now returns
3403         a copy of the case, so that the caller is responsible for
3404         destroying the returned case.
3405         (casereader_read_xfer) New function.
3406         (casereader_destroy) Destroy reader's case.
3407         (test_casefile) Second arg is now a value count, all callers
3408         updated.  Now tests destructive readers too.
3409         (get_random_case) Deal with new case ADT.
3410         (write_random_case) Ditto.
3411         (read_and_verify_random_case) Ditto.
3412
3413         * crosstabs.q: Remove debug code.
3414
3415         * descript.q: (calc_descriptives) Deal with new case, casefile
3416         ADTs.
3417
3418         * dfm.c: (cmd_begin_data) There's no storage_source_class anymore.
3419
3420         * do-if.c: Remove unneeded header inclusion.
3421
3422         * expr-prs.c: Remove debug code.
3423
3424         * exprP.h: Remove debug code.
3425
3426         * flip.c: (flip_file) Use fseeko() if available.
3427
3428         * formats.c: Remove debug code.
3429
3430         * get.c: Remove debug code.
3431         (struct mtf_file) Change `input' from `union value *' to `struct
3432         ccase', all references updated.
3433
3434         * levene.c: (levene) Deal with new case, casefile ADTs.
3435
3436         * list.q: Remove debug code.
3437
3438         * loop.c: Remove debug code.
3439         
3440         * matrix-data.c: Remove debug code.
3441
3442         * means.q: Remove debug code.
3443
3444         * mis-val.c: Remove debug code.
3445
3446         * pfm-read.c: Remove debug code.
3447         (pfm_read_code) Change second arg from `union value *' to `struct
3448         ccase *', all references updated.
3449
3450         * recode.c: (string_to_long) Make first arg const.
3451         (convert_to_double) Ditto.
3452
3453         * repeat.c: Remove debug code.
3454
3455         * sample.c: Remove debug code.
3456
3457         * sfm-read.c: Remove debug code.
3458         (sfm_read_case) Change second arg from `union value *' to `struct
3459         ccase *'.
3460
3461         * sort.c: Redone in terms of casefiles.
3462         (enum sort_direction) Moved here from sort.h.
3463         (struct sort_criterion) New structure.
3464         (struct sort_criteria) New structure.
3465         (cmd_sort_cases) Rewritten.
3466         (prepare_to_sort_active_file) New function.
3467         (sort_active_file_in_place) New function.
3468         (sort_active_file_to_casefile) New function.
3469         (parse_sort) Renamed sort_parse_criteria(), rewritten & interface
3470         changed, all callers updated.
3471         (destroy_sort_cases_pgm) Renamed sort_destroy_criteria(),
3472         rewritten & interface changed, all callers updated.
3473         (sort_cases) Renamed sort_execute(), rewritten & interface
3474         changed, all callers updated.
3475         (struct internal_sort) Removed.
3476         (do_internal_sort) Rewritten, interface changed.
3477         (destroy_internal_sort) Removed.
3478         (compare_case_dblptrs) Use sort_criteria instead of sort_case_pgm.
3479         (struct initial_run) Removed; an initial run is now just a
3480         casefile.
3481         (compare_initial_runs) Rewritten.
3482         (struct external_sort) Changed almost completely.
3483         (do_external_sort) Rewritten, interface changed.
3484         (destroy_external_sort) Rewritten.
3485         [HAVE_MKDTEMP] (make_temp_dir) Removed.
3486         [!HAVE_MKDTEMP] (do_mkdir) Removed.
3487         [!HAVE_MKDTEMP] (make_temp_dir) Removed.
3488         (init_external_sort) Removed.
3489         (simulate_error) Removed.
3490         (rmdir_temp_dir) Removed.
3491         (get_temp_file_name) Removed.
3492         (open_temp_file) Removed.
3493         (close_temp_file) Removed.
3494         (remove_temp_file) Removed.
3495         (write_temp_file) Removed.
3496         (read_temp_file) Removed.
3497         (struct record_run) Change `record' from `struct case_lit *' to
3498         `struct ccase'.
3499         (struct initial_run_state) Remove `idx_to_fv', `free_list',
3500         `file_idx', `output_file'.  Add `run', casefile'.  Change
3501         `last_output' from `struct case_list *' to `struct ccase'.
3502         (write_initial_runs) Change interface, rewrite.
3503         (sort_sink_write) Renamed process_case(), changed interfaced,
3504         rewrote.
3505         (destroy_initial_run_state) Rewritten.
3506         (allocate_cases) Rewritten.
3507         (compare_record) Interface changed, rewritten.
3508         (start_run) Rewritten.
3509         (end_run) Rewritten.
3510         (output_record) Rewritten.
3511         (grab_case) Removed.
3512         (release_case) Removed.
3513         (struct merge_case) Change `cases' from double pointer to single
3514         pointer.
3515         (merge) Deal with new case and casefile ADTs.
3516         (struct run) Removed.
3517         (merge_once) Rewritten, interface changed.
3518         (fill_run_buffer) Removed.
3519         (sort_sink_make_source) Removed.
3520         (sort_sink_class) Removed.
3521         (struct sort_source_aux) Removed.
3522         (sort_source_read_helper) Removed.
3523         (sort_source_read) Removed.
3524         (read_sort_output) Removed.
3525         (read_internal_sort_output) Removed.
3526         (read_external_sort_output) Removed.
3527         (sort_source_destroy) Removed.
3528         (sort_source_class) Removed.
3529
3530         * sort.h: (struct sort_cases_pgm) Removed.
3531         (enum sort_direction) Moved to sort.c.
3532
3533         * t-test.q: (calculate) Deal with new case, casefile ADTs.
3534
3535         * tab.c: Remove debug code.
3536
3537         * var-labs.c: Remove debug code.
3538
3539         * var.h: (struct ccase) Removed.
3540         (struct case_list) Removed.
3541
3542         * vars-atr.c: (discard_variables) Use free_case_source().
3543
3544         * vars-prs.c: (parse_vs_variable) Make arg const.
3545         (parse_dict_variable) Ditto.
3546         (parse_variables) Make struct dictionary * arg const.
3547         (parse_var_set_vars) Make struct var_set * arg const.
3548         (struct var_set) Add const to some of the function pointers' args.
3549         (var_set_get_cnt) Make arg const.
3550         (var_set_get_var) Make first arg const.
3551         (var_set_lookup_var) Make first arg const.
3552         (dict_var_set_get_cnt) Make arg const.
3553         (dict_var_set_get_var) Make first arg const.
3554         (dict_var_set_lookup_var) Make first arg const.
3555         (var_set_create_from_dict) Make arg const.  Add cast to aux
3556         assignment.
3557         (struct array_var_set) Add const to var member.
3558         (array_var_set_get_cnt) Make arg const.
3559         (array_var_set_get_var) Make first arg const.
3560         (array_var_set_lookup_var) Make first arg const.
3561         (var_set_create_from_array) Make first arg const.  Insert cast.
3562
3563         * vfm.c: (struct write_case_data) Change trns_case, sink_case
3564         members from `struct ccase *' to `struct ccase'.
3565         (static var lag_queue) Change from double to single pointer.
3566         (procedure) Optimize trivial case.
3567         (internal_procedure) Deal with changed case, case_source ADTs.
3568         (create_trns_case) Changed interface, rewrote.
3569         (open_active_interface) Initialize modified lag queue.
3570         (write_case) Deal with changed case ADT.
3571         (lag_case) Deal with modified lag queue.
3572         (close_active_file) Destroy modified lag queue.
3573         Deal with changed case_source, case_sink ADTs.
3574         (destroy_storage_stream_info) Make null arg into no-op.
3575         (storage_sink_make_source) Set aux in created source.
3576         (storage_source_read) Deal with changed case, casefile ADTs.
3577         (storage_source_create) New function.
3578         (lagged_case) Rewrite.
3579         (free_case_source) New function.
3580         (free_case_sink) Rewrite.
3581         (struct split_aux_data) Changed prev_case from `struct ccase *' to
3582         `struct ccase'.
3583         (procedure_with_splits) Deal with changed prev_case.
3584         (procedure_with_splits_callback) Ditto.
3585         (multipass_split_aux_data) Changed prev_case from `struct ccase *' to
3586         `struct ccase'.
3587         (multipass_procedure_with_splits) Deal with changed prev_case.
3588         (multipass_split_callback) Ditto.
3589         
3590         
3591 Mon May 31 17:19:06 2004  Ben Pfaff  <blp@gnu.org>
3592
3593         The workspace idea didn't work out.
3594
3595         * Makefile.am: (pspp_SOURCES) Remove workspace.c, workspace.h.
3596         
3597         * workspace.c: Removed.
3598
3599         * workspace.h: Removed.
3600
3601 Sun May 30 18:35:19 2004  Ben Pfaff  <blp@gnu.org>
3602
3603         Fully implement arbitrary delimiters on DATA LIST, extending the
3604         half implementation that was already there.
3605
3606         * data-list.c: (struct data_list_pgm) Remove `delim', add
3607         `delims', `delim_cnt'.
3608         (cmd_data_list) Initialize new members.  Parse delimiters and
3609         clean up code a bit.
3610         (cut_field) Extract fields with arbitrary delimiters.  Also, fix
3611         handling of leading commas.
3612         (read_from_data_list_fixed) Expand tabs.  Adapt to new DFM
3613         interfaces.
3614         (read_from_data_list_free) Adapt to new DFM interfaces.
3615         (read_from_data_list_list) Ditto.
3616         (repeating_data_trns_proc) Ditto.
3617
3618         * dfm.c: Split up reader and writer into separate code, because
3619         they do different things.  Use struct string instead of explicit
3620         allocation code, for clarity.
3621         (enum dfm_reader_flags) New enum.
3622         (struct dfm_fhuser_ext) Removed.
3623         (struct dfm_reader_ext) New.
3624         (get_reader) New function, used by just about all the reader
3625         functions.
3626         (dfm_close) Removed.
3627         (close_reader) New function.
3628         (dfm_open_for_reading) Rewrite initialization of dfm_fhuser_ext.
3629         (dfm_open_for_writing) Ditto.
3630         (macro force_line_buffer_expansion) Removed.
3631         (count_tabs) Removed.
3632         (tabs_to_spaces) Removed.
3633         (read_record) Deal with new dfm_reader_ext.  Use struct string
3634         functions.  Don't convert tabs to spaces.
3635         (dfm_eof) New function.
3636         (dfm_get_record) Changed interface, rewrote.
3637         (dfm_expand_tabs) New function.
3638         (dfm_fwd_record) Renamed dfm_forward_record(), updated to new
3639         dfm_reader_ext, rewritten.
3640         (dfm_bkwd_record) Renamed dfm_reread_record(), updated to new
3641         dfm_reader_ext, rewritten.
3642         (dfm_set_record) Removed in favor of dfm_forward_columns().
3643         (dfm_forward_columns) New function.
3644         (dfm_get_cur_col) Renamed dfm_column_start, updated to new
3645         dfm_reader_ext, rewritten.
3646         (static var dfm_r_class) Use close_reader for the destructor.
3647         (struct dfm_writer_ext) New.
3648         (dfm_put_record) Updated to new dfm_writer_ext, rewritten.  Uses
3649         bounce buffer now instead of local allocation.
3650         (close_writer) New function.
3651         (static var dfm_writer_ext) Use close_writer for destructor.
3652         (cmd_begin_data) Adapt to new dfm_reader_ext.
3653
3654         * file-handle.q: Add support for per-file tab width.
3655         (struct private_file_handle) Add tab_width member.
3656         (q2c specifications) Add tabwidth subcommand.
3657         (cmd_file_handle) Put parsed tab width into private_file_handle.
3658         (create_file_handle) Set default tab width.
3659         (handle_get_tab_width) New function.
3660
3661         * file-type.c: (file_type_source_read) Adapt to new DFM interface.
3662
3663         * inpt-pgm.c: (reread_trns_proc) Ditto.
3664
3665         * matrix-data.c: (context) Ditto.
3666         (another_token) Ditto.
3667         (mget_token) Ditto.
3668         (force_eol) Ditto.
3669
3670 Sun May 30 18:33:59 2004  Ben Pfaff  <blp@gnu.org>
3671
3672         * casefile.c: (casefile_destroy) Fix memory leak by freeing
3673         cf->filename.
3674         (casereader_destroy) Don't close file descriptor -1.
3675
3676         * recode.c: (cmd_recode) Fix memory leak.
3677
3678         * set.q: (q2c specifications) Fix typo in user message.
3679
3680         * str.c: (st_bare_pad_len_copy) Change memcpy to memmove to avoid
3681         undefined behavior for overlapping arguments.
3682
3683 Sun May 30 18:31:48 2004  Ben Pfaff  <blp@gnu.org>
3684
3685         * casefile.c: valgrind doesn't implement posix_fadvise() yet, so
3686         don't call it when we're running under valgrind.
3687         (call_posix_fadvise) New function.
3688         (casefile_to_disk) Use call_posix_fadvise().
3689         (reader_open_file) Ditto.
3690         
3691 Sun May 30 18:20:12 2004  Ben Pfaff  <blp@gnu.org>
3692
3693         Update our string ADTs, struct string and struct len_string.  Get
3694         rid of pool support, which was largely unused.  Rename lots of
3695         functions to have more obvious or consistent names.
3696         
3697         * ascii.c: Get rid of ascii_pool.  It was only used for string
3698         allocations.
3699         (ascii_open_global) Don't create ascii_pool.
3700         (ascii_close_driver) Don't destroy ascii_pool.
3701         (ascii_postopen_driver) Don't use pool.
3702         (ascii_close_driver) Destroy strings manually.
3703
3704         * str.c: (ds_create) Remove pool argument, all references updated.
3705         (ds_init) Ditto.
3706         (ds_replace) Remove pool support, make more efficient when we
3707         don't need to reallocate.
3708         (ds_destroy) Remove pool support.
3709         (ds_rpad) New function.
3710         (ds_size) Renamed ds_capacity(), all references updated.
3711         (ds_value) Renamed ds_c_str(), all references updated.
3712         (ds_concat) Renamed ds_puts(), all references updated.
3713         (ds_concat_buffer) Renamed ds_concat(), all references updated.
3714         (ds_putchar) Renamed ds_putc(), all references updated.
3715         (ds_getline) Renamed ds_gets(), all references updated.
3716         (ls_create) Remove pool argument, all references updated.
3717         (ls_create_buffer) Ditto.
3718         (ls_destroy) Removed pool support.
3719         (ls_value) Renamed ls_c_str(), all references updated.
3720
3721         * str.h: (ls_length) [__GNUC__] Add inline version.
3722         (ls_c_str) [__GNUC__] Add inline version.
3723         (ls_end) [__GNUC__] Add inline version.
3724         (struct string) Remove pool member.  Rename `size' to `capacity',
3725         all references updated.
3726
3727         * tab.c: (text_format) Instead of using pool argument to
3728         ls_create_buffer(), call pool_register() on allocated data.
3729
3730 Mon Apr 26 22:40:07 2004  Ben Pfaff  <blp@gnu.org>
3731
3732         We're abusing the current ASCII driver by telling it to allocate a
3733         9999-line, 9999-character page in the tests.  This causes some
3734         systems to curl up and die because it allocates 20 MB of
3735         contiguous RAM.  This change alleviates at least part of the
3736         problem.  It is mostly a stop-gap until the new output system is
3737         ready.
3738         
3739         * ascii.c: (struct line) New structure.
3740         (struct ascii_driver_ext) Remove `page', `page_size', `line_len',
3741         `line_len_size', `n_output' members.  Add `lines', `lines_cap'.
3742         (ascii_preopen_driver) Initialize new members, not old ones.
3743         (ascii_close_driver) Destroy new members, not old ones.
3744         (ascii_open_page) Allocate new members, not old ones.
3745         (expand_line) Allocate room in line.
3746         (draw_line) Use new members.
3747         (ascii_line_horz) Ditto.
3748         (ascii_line_vert) Ditto.
3749         (ascii_line_intersection) Ditto.
3750         (text_draw) Ditto.
3751         (output_lines) Ditto.
3752         (ascii_close_page) Ditto.
3753
3754 Sun Apr 25 23:40:15 2004  Ben Pfaff  <blp@gnu.org>
3755
3756         * matrix.c: Dead code.  Removed.
3757
3758         * matrix.h: Dead code.  Removed.
3759
3760 Fri Apr 16 23:59:51 2004  Ben Pfaff  <blp@gnu.org>
3761
3762         Contrary to what I'd always understood, there is an efficient
3763         algorithm for deletion from a hash table populated via linear
3764         probing.  This change implements it.
3765         
3766         * hash.c: (hsh_rehash) Probe in increasing order.
3767         (hsh_probe) Ditto.
3768         (locate_matching_entry) Ditto.
3769         (hsh_delete) Use Knuth's Algorithm 6.4R for deletion.
3770
3771 Tue Apr 13 19:24:15 2004  Ben Pfaff  <blp@gnu.org>
3772
3773         * moments.c (calc_moments): Adjust calculation of kurtosis to
3774         avoid subtracting huge numbers from huge numbers, on Michael
3775         Kiefte's advice.
3776
3777 Sun Apr 11 14:22:12 2004  Ben Pfaff  <blp@gnu.org>
3778
3779         Rework moments routines for improved numerical stability based on
3780         Michael Kiefte's advice.  Any bugs or remaining numerical problems
3781         are still mine though.
3782
3783         There is now a struct moments1 for use with one-pass moments.  It
3784         uses a provisional means algorithm as an attempt to improve
3785         accuracy of higher moments.  The older struct moments now only
3786         handles two-pass moments.
3787         
3788         * aggregate.c: Use moments1 instead moments.
3789
3790         * descript.c: Revert previous change, which is no longer needed
3791         due to the moments revision.
3792
3793         * moments.c: (calc_moments) New function for calculating variance,
3794         skewness, kurtosis.
3795         (moments_pass_one) Only accumulate weights bigger than zero.
3796         (moments_calculate) Allow calculating the mean on pass one, others
3797         require pass two.  Implement in terms of calc_moments().
3798         (struct moments1) New structure.
3799         (init_moments1) New function.
3800         (moments1_clear) Ditto.
3801         (moments1_create) Ditto.
3802         (moments1_add) Ditto.
3803         (moments1_calculate) Ditto.
3804         (moments1_destroy) Ditto.
3805         (cmd_debug_moments) Deal with `struct moments' or `struct
3806         moments1' as requested by user.
3807
3808 Sun Apr 11 14:21:55 2004  Ben Pfaff  <blp@gnu.org>
3809
3810         * Makefile.am (pspp_SOURCES): Remove debug.c.
3811
3812         * debug.c: Removed.  It was empty anyway.
3813
3814 Fri Apr  9 20:04:49 2004  Ben Pfaff  <blp@gnu.org>
3815
3816         * descript.c (calc_descriptives): Fix assert failure when only
3817         MOMENT_MEAN is needed.
3818
3819 2004-04-09  Michael Kiefte  <mkiefte@dal.ca>
3820
3821         * descript.c: 
3822
3823         fixed problem with parsing in match_statistic() causing
3824         "DESCRIPTIVE STAT=MEAN." to barf.
3825
3826         "MEAN" is now default if "SORT" given without specification.
3827
3828         Fixed infinite loop with "DESCRIPT GIBBERISH=ALL."  Parsing is
3829         generally less forgiving of syntax errors: better to have it do
3830         nothing and type it in again then to not know what it actually did
3831         instead.  
3832
3833         z-score transformation now checks score for user-missing values
3834         and checks std_dev for SYSMIS.
3835
3836 2004-04-06  Michael Kiefte  <mkiefte@dal.ca>
3837
3838         * aggregate.c, crosstabs.q, descript.c, dictionary.c, frequencies.q, levene.c, t-test.q, var.h: 
3839         Changed dict_get_case_weight() to accept an additional int * flag
3840         to complain about system-missing, user-missing, zero, or negative
3841         weights and updated existing functions to pass int * to
3842         dict_get_case_weight().
3843
3844 2004-04-05  jmd  <jmd@gnu.org>
3845
3846         * main.c: Fixed configuration problems with gsl
3847
3848         * t-test.q: Fixed some problems encountered when compiling under Cygwin
3849
3850 2004-04-03  blp  <blp@gnu.org>
3851
3852         * lexer.c, ChangeLog:
3853         Fix infinite loop on comment at end of file, add test.
3854
3855 2004-04-03  jmd  <jmd@gnu.org>
3856
3857         * settings.h, var.h, ChangeLog, Makefile.am, cmdline.c, command.c, command.h, error.h, filename.c, frequencies.q, lexer.h, main.c, q2c.c, set.q:
3858         Fixed the calculation of percentiles and added --syntax and --algorithm options
3859
3860 Sat Apr  3 11:43:37 2004  Ben Pfaff  <blp@gnu.org>
3861
3862         * lexer.c: (lex_skip_comment) Handle end-of-file correctly (I
3863         hope).
3864
3865 Sat Apr  3 15:00:18 WST 2004 John Darrington <john@darrington.wattle.id.au>
3866
3867         * frequencies.q:  Fixed the calculation of percentiles
3868
3869         * Makefile.am:  Added the --ansi flag and dealt with the
3870         consequences.  Added some entries to PSPP_sources so that
3871         make distcheck would pass
3872
3873         * cmdline.c:   Added the --syntax and --algorithm options
3874
3875         * q2c.c:  Added an implicit /ALGORITHM subcommand to everything.
3876
3877 Fri Apr  2 11:25:22 WAST 2004 John Darrington <john@darrington.wattle.id.au>
3878
3879         * t-test.q, levene.c, levene.h  Converted t-test (incl levene) to 
3880         use the new multipass_split_... mechanism.
3881
3882 Wed Mar 31 22:36:22 2004  Ben Pfaff  <blp@gnu.org>
3883
3884         * frequencies.q: (calc_stats) Use moments data structure and
3885         calc_seskew(), calc_sekurt() functions.
3886
3887         * set.q main.c settings.h Added support for --syntax and --algorithm 
3888         options
3889
3890 Tue Mar 30 22:04:19 2004  Ben Pfaff  <blp@gnu.org>
3891
3892         * vfm.c: Had to get last call to multipass_split_output() inside
3893         open_active_file()/close_active_file() pairing, so introduce new
3894         function.
3895         (internal_procedure) Move procedure() code here, except for calls
3896         to open_active_file() and close_active_file().
3897         (procedure) Wrap open_active_file() and close_active_file() around
3898         internal_procedure().
3899         (multipass_procedure_with_splits) Wrap open_active_file() and
3900         close_active_file() around internal_procedure().
3901
3902 Tue Mar 30 22:01:57 2004  Ben Pfaff  <blp@gnu.org>
3903
3904         * descript.c: (cmd_descriptives) Free `vars' to avoid memory leak.
3905
3906 Mon Mar 29 16:26:40 2004  Ben Pfaff  <blp@gnu.org>
3907
3908         * debug.c: Removed.  Moved cmd_debug_evaluate() into expr-evl.c.
3909
3910         * expr-evl.c: (cmd_debug_evaluate) Moved here from debug.c.
3911
3912 Mon Mar 29 16:03:08 2004  Ben Pfaff  <blp@gnu.org>
3913
3914         * algorithm.c: By default turn off some of the more expensive
3915         assertions.
3916         (expensive_assert) New macro which expands to assert if
3917         EXTRA_CHECKS is defined, to nothing otherwise.
3918         (unique) Use expensive_assert().
3919         (binary_search) Ditto.
3920         (push_heap) Ditto.
3921         (pop_heap) Ditto.
3922         (make_heap) Ditto.
3923         (sort_heap) Ditto.
3924
3925         * command.c: (conflicting_3char_prefixes) Words that are the same
3926         don't cause conflicts when they are abbreviated to the first three
3927         letters.
3928
3929         * expr-evl.c: (CONCAT_func) Fix memory leak by incrementing struct
3930         nonterm_node's n earlier.
3931         (generic_str_func) Ditto.
3932         
3933 Mon Mar 29 15:32:17 2004  Ben Pfaff  <blp@gnu.org>
3934
3935         Add support for multipass procedures.  Rewrite DESCRIPTIVES to
3936         test multipass support, take advantage of new moments
3937         calculation, and to not be such crappy code.  Get rid of q2c
3938         processing for DESCRIPTIVES.
3939
3940         * vfm.c: (struct multipass_split_aux_data) New structure.
3941         (multipass_procedure_with_splits) New function.
3942         (multipass_split_callback) New function.
3943         (multipass_split_output) New function.
3944         * descript.q: Removed.
3945
3946         * descript.c: New file.
3947
3948         * var.h: Removed descriptives enums.
3949         (struct descriptives_proc) Removed.
3950         (struct variable) Removed p.dsc.
3951
3952         * Makefile.am: (q_sources_c) Remove descript.c.
3953         (q_sources_q) Removed descript.q.
3954         
3955 Mon Mar 29 15:31:55 2004  Ben Pfaff  <blp@gnu.org>
3956
3957         New manager for keeping track of used workspace.
3958         
3959         * workspace.c: New file.
3960
3961         * workspace.h: New file.
3962
3963         * Makefile.am: (pspp_SOURCES) Add workspace.c, workspace.h.
3964
3965         * sort.c: (do_internal_sort) Use workspace_malloc().
3966         (destroy_internal_sort) Use workspace_free().
3967
3968 Mon Mar 29 15:31:08 2004  Ben Pfaff  <blp@gnu.org>
3969
3970         New `struct casefile' for managing sets of cases.
3971
3972         * casefile.c: New file.
3973
3974         * casefile.h: New file.
3975
3976         * command.def: Add DEBUG CASEFILE command.
3977
3978         * Makefile.am: (pspp_SOURCES) Add casefile.c, casefile.h.
3979
3980         * sort.c: (sort_cases) Move logic for sending storage file to disk
3981         into do_external_sort().
3982         (struct internal_sort) Use an array of ccase pointers instead of a
3983         case_list.
3984         (do_internal_sort) Rewrite to handle casefiles.
3985         (compare_case_list) Removed.
3986         (compare_cases) New function.
3987         (compare_case_dblptrs) New function.
3988         (read_internal_sort_output) Deal with new struct internal_sort.
3989
3990         * vfm.c: (static var workspace_overflow) Removed.
3991         (struct storage_stream_info) Removed all the members.  Added
3992         struct casefile * member.
3993         (storage_sink_open) Use casefile.
3994         (open_storage_file) Removed.
3995         (write_storage_file) Removed.
3996         (storage_to_disk) Removed.
3997         (destroy_storage_stream_info) Use casefile.
3998         (storage_sink_write) Use casefile.
3999         (storage_sink_make_source) Use casefile.
4000         (storage_source_count) Use casefile.
4001         (storage_source_read) Use casefile.
4002         (storage_source_on_disk) Removed.
4003         (storage_source_get_cases) Removed.
4004         (storage_source_set_cases) Removed.
4005         (storage_source_get_casefile) New function.
4006         
4007 Mon Mar 29 15:30:09 2004  Ben Pfaff  <blp@gnu.org>
4008
4009         New `struct moments' for calculating moments.
4010
4011         * stats.c: Removed.
4012
4013         * stats.h: Removed.
4014
4015         * moments.c: New file.
4016
4017         * moments.h: New file.
4018
4019         * command.def: Add DEBUG MOMENTS command.
4020
4021         * Makefile.am: (pspp_SOURCES) Add moments.c, moments.h.  Remove
4022         stats.c, stats.h.
4023
4024         * aggregate.c: Modify AGGREGATE to use the new moments
4025         calculation, even if not in such a great way.
4026         (struct agr_var) Add `moments' member.
4027         (parse_aggregate_functions) Set `moments' member to null.
4028         (agr_destroy) Destroy `moments' member.
4029         (accumulate_aggregate_info) Use `moments' for standard deviation.
4030         (dump_aggregate_info) Ditto.
4031         (initialize_aggregate_info) Create or clear `moments'.
4032
4033         * misc.h: Add pow2(), pow3(), pow4() functions in place of sqr(),
4034         cube(), pow4() that were in stats.h.  All references updated.
4035
4036         * crosstabs.q: stats.h had chi-square significance functions.  Use
4037         GSL instead.
4038         (display_chisq) Use gsl_cdf_chisq_Q() instead of chisq_sig().
4039
4040         * expr-evl.c: (expr_evaluate) Use moments_of_values() for
4041         OP_CFVAR, OP_MEAN, OP_SD, OP_VARIANCE.
4042                 
4043 Fri Mar 26 14:21:23 2004  Ben Pfaff  <blp@gnu.org>
4044
4045         * dictionary.c: (dict_compact_values) Compacted values need to
4046         start off from 0.
4047
4048 Fri Mar 26 00:54:57 2004  Ben Pfaff  <blp@gnu.org>
4049
4050         * var-labs.c: (cmd_variable_labels) For compatibility, don't allow
4051         `/' at start.  Check return value of parse_variables() for error
4052         return.
4053
4054 Fri Mar 26 00:19:27 2004  Ben Pfaff  <blp@gnu.org>
4055
4056         Revamp expressions: make the code a little nicer, and fix bugs
4057         found in testing.
4058         
4059         * expr-evl.c: (expr_evaluate) Make expression argument const.
4060         Support OP_ADD, OP_SUB, OP_MUL, OP_DIV instead of OP_PLUS, OP_MUL.
4061         OP_POW is missing for arg 2 <= 0.  OP_LOG is natural log, not
4062         base-10 log.  Fix OP_ANY, OP_ANY_STRING, OP_RANGE, OP_RANGE_STRING
4063         off-by-ones.  Add OP_MAX_STRING, OP_MIN_STRING.  Fix OP_TIME_HMS,
4064         OP_DATE_WKYR boundary conditions.  Add OP_CTIME_DAYS,
4065         OP_CTIME_HOURS, OP_CTIME_MINUTES, OP_CTIME_DAYS, OP_CTIME_SECONDS.
4066         Support OP_INDEX_2, OP_INDEX_3, OP_RINDEX_2, OP_RINDEX_3 instead
4067         of OP_INDEX, OP_INDEX_OPT, OP_RINDEX, OP_RINDEX_OPT.  Merge
4068         OP_LPAD_OPT into OP_LPAD, OP_RPAD_OPT into OP_RPAD, OP_LTRIM_OPT
4069         into OP_LTRIM, OP_RTRIM_OPT into OP_RTRIM, OP_NUMBER_OPT into
4070         OP_NUMBER.  Fix OP_RTRIM fragility.  Support OP_SUBSTR_2,
4071         OP_SUBSTR_3 instead of OP_SUBSTR, OP_SUBSTR_OPT.  Remove OP_INV.
4072         Simplify OP_SYSMIS.  Remove OP_STR_MIS.
4073
4074         * expr-opt.c: (optimize_expression) Rewrite.
4075         (macro n0) Removed.
4076         (macro n1) Removed.
4077         (macro n2) Removed.
4078         (macro s0) Removed.
4079         (macro s0l) Removed.
4080         (macro s1) Removed.
4081         (macro s1l) Removed.
4082         (macro s2) Removed.
4083         (macro s2l) Removed.
4084         (macro s) Removed.
4085         (macro sl) Removed.
4086         (eq_num_con) New function.
4087         (optimize_tree) New function.
4088         (macro rnc) Removed.
4089         (macro frnc) Removed.
4090         (str_search) Add const to string params.
4091         (str_rsearch) Ditto.
4092         (evaluate_tree_no_missing) Renamed from evaluate_tree.  Add num[],
4093         str[], str_len[] locals to substitute for most of removed macros.
4094         Support OP_ADD, OP_SUB, OP_MUL, OP_DIV instead of OP_PLUS, OP_MUL.
4095         Removed support for missing values because we're never called with
4096         missing values.  Use set_number() or set_number_errno() instead of
4097         rnc or frnc.  Removed any stuff that caused trouble in testing.
4098         We can re-add it later if it really slows anything.  Fix some
4099         random problems.
4100         (evaluate_tree_with_missing) Not yet supported.  To be added later
4101         if it's important.
4102         (repl_num_con) Removed.
4103         (collapse_node) New function.
4104         (force_repl_num_con) Removed.
4105         (set_number) New function.
4106         (set_number_errno) New function.
4107         (repl_str_con) Removed.
4108         (set_string) New function.
4109         (yrmoda) Tighten boundary conditions.  Adopt 2030 cut-off for
4110         2-digit years.
4111         (dump_node) No special case for OP_AND, OP_OR.
4112
4113         * expr-prs.c: (expr_prs) Honor EXPR_NO_OPTIMIZE bit.  Rewrite.
4114         (expr_get_type) New function.
4115         (type_check) Rewrite.
4116         (type_coercion) New function.
4117         (struct operator) New structure.
4118         (match_operator New function.
4119         (parse_binary_operators) New function.
4120         (parse_inverting_unary_operator) New function.
4121         (parse_or) Rewritten.
4122         (parse_and) Rewritten.
4123         (parse_not) Rewritten.
4124         (parse_rel) Rewritten.
4125         (parse_add) Rewritten.
4126         (parse_mul) Rewritten.
4127         (parse_neg) Rewritten.
4128         (parse_exp) Rewritten.
4129         (parse_sysvar) Add $TRUE, $FALSE system variables.
4130         Get $LENGTH, $WIDTH from get_viewlength(), get_viewwidth().
4131         (parse_primary) Use allocate_var_node(), allocate_num_con(),
4132         allocate_str_con().
4133         (struct function) Remove desc, change `func' prototype.
4134         (unary_func) Remove special cases.
4135         (MISSING_func) Reduce to unary_func() that just returns a boolean.
4136         (SYSMIS_func) Handle SYSMIS((x)) like SYSMIS(x).
4137         (VALUE_func) Use allocate_var_node().
4138         (nary_num_func) Allow MIN and MAX for strings.
4139         Use allocate_var_node().  Properly clean up.
4140         Fix return type.
4141         (generic_str_func) Use local table instead of removed `desc'
4142         member.  Mostly rewrite.
4143         (get_num_args) Revise error message.
4144         (parse_function) Return EXPR_ERROR, not 0 on error.
4145         (macro op) Removed.
4146         (macro varies) Removed.
4147         (ops[]) Use expr.def.
4148         (free_node) Do nothing if node is null.
4149         (allocate_num_con) New function.
4150         (allocate_str_con) New function.
4151         (allocate_var_node) New function.
4152         (allocate_binary_nonterminal) New function.
4153         (append_nonterminal_arg) Removed.
4154         (static var func_tab[]) Revised.
4155         (expr_debug_print_postfix) Make parameter const.
4156         Use printf() instead of debug_printf().
4157
4158         * expr.def: New file.
4159         
4160         * expr.h: Change PXP_* to EXPR_*, all references updated.  Also
4161         use named enum instead of unnamed, all references updated.  Add
4162         EXPR_ANY, EXPR_NO_OPTIMIZE.
4163
4164         * exprP.h: Remove EX_*.  Add DEFINE_OPERATOR.  Use expr.def
4165         instead of defining OP_* directly.
4166         (macro IS_TERMINAL) New macro.
4167         (macro IS_NONTERMINAL) New macro.
4168         (enum OP_NO_FLAGS) New.
4169         
4170 Fri Mar 26 00:18:01 2004  Ben Pfaff  <blp@gnu.org>
4171
4172         * error.c: (err_assert_fail) msg variable needs to be non-const.
4173
4174 Fri Mar 26 00:17:24 2004  Ben Pfaff  <blp@gnu.org>
4175
4176         * debug.c: (cmd_debug_evaluate) Rewrite.
4177
4178 Fri Mar 26 00:15:13 2004  Ben Pfaff  <blp@gnu.org>
4179
4180         Fix some CROSSTABS bit rot stupidity.
4181
4182         * crosstabs.q: Reorder the CELLS subcommands for compatibility.
4183         (internal_cmd_crosstabs) Initializes cells[] correctly.
4184         (float_M_suffix) Rename format_cell_entry(), change prototype,
4185         rewrite.
4186         (display_crosstabulation) Fix cell formatting.
4187
4188 Fri Mar 26 00:14:09 2004  Ben Pfaff  <blp@gnu.org>
4189
4190         Make lex_rest_of_line(), lex_entire_end() not discard lines.  Have
4191         to call lex_discard_line() to do that.
4192
4193         * command.c: (run_command) Call lex_discard_line() after
4194         lex_rest_of_line().
4195
4196         * lexer.c: (lex_entire_end) Change behavior.
4197         (lex_rest_of_line) Change behavior.  Return const char *.
4198         (lex_discard_line) Don't clear getl_buf, don't emit message.
4199
4200         * main.c: (handle_error) Emit message here.
4201
4202         * repeat.c: (internal_cmd_do_repeat) Use lex_discard_line()
4203         instead of lex_entire_line().
4204
4205         * str.c: (mm_find_reverse) Make length params size_t.  Rewrite.
4206
4207         * title.c: (get_title) Call lex_discard_line() after
4208         lex_rest_of_line().
4209         (cmd_file_label) Ditto.
4210         (cmd_document) Deal with const char * return value.
4211
4212 Fri Mar 26 00:10:16 2004  Ben Pfaff  <blp@gnu.org>
4213
4214         Removed REMARK command.
4215
4216         * command.c: (extract_prefix) Removed.
4217         (output_line) Removed.
4218         (cmd_remark) Removed.
4219
4220         * command.def: Remove REMARK.
4221
4222 Fri Mar 26 00:08:38 2004  Ben Pfaff  <blp@gnu.org>
4223
4224         Added abort() after lots of assert(0) invocations to avoid some
4225         compiler warnings.  We really need a NOT_REACHED macro.
4226
4227 Tue Mar 23 08:00:42 WAST 2004 John Darrington <john@darrington.wattle.id.au>
4228
4229         * sort.c: Added missing call to temp_file_close.  Changed error 
4230         messages to warnings.
4231
4232         * set.q: Improved setting of set_view{length,width} to be more tolerant
4233         of buggy OSes.
4234
4235 Sun Mar 21 10:11:14 WST 2004 John Darrington <john@darrington.wattle.id.au>
4236
4237         * val-labs.c: Fixed a bug where PSPP would crash, if VALUE LABELS was
4238         used with incorrect syntax.
4239
4240         * error.c, error.h et al:  Overridden definition of assert for a
4241         custom one.
4242
4243         * test-q.c: Fixed a buglet where it would crash if no /VARIABLES
4244         subcommand was given when it ought to have been.
4245
4246 Sat Mar 20 22:19:08 2004  Ben Pfaff  <blp@gnu.org>
4247
4248         * tab.c: (tab_vline) Fix assertions to respect row_ofs and
4249         col_ofs.
4250         (tab_hline) Ditto.
4251         (tab_box) Ditto.
4252         (tab_joint_text) Ditto.
4253
4254 Sat Mar 20 17:57:23 2004  Ben Pfaff  <blp@gnu.org>
4255
4256         * levene.c: Add #include.
4257
4258         * set.q: (set_viewport) Add `int' argument to make its prototype
4259         correct for signal().
4260
4261 Sat Mar 20 15:35:17 2004  Ben Pfaff  <blp@gnu.org>
4262
4263         * expr-evl.c: (expr_evaluate) Assert that `c' is nonzero before
4264         using it.
4265
4266 Sat Mar 20 15:18:16 2004  Ben Pfaff  <blp@gnu.org>
4267
4268         Changed DFM from open-at-first-access to explicit-open.  Before,
4269         calling dfm_get_record() or dfm_put_record() would automatically
4270         open the file.  Now, you have to call dfm_open_for_reading() or
4271         dfm_open_for_writing() explicitly.  This makes it possible to
4272         check permissions, file existence, etc. earlier.
4273
4274         Also made struct file_handle more opaque, and clean up in general.
4275
4276         * data-list.c: (cmd_data_list) Open handle for reading.
4277
4278         * dfm.c: (struct dfm_fhuser_ext) Add `where', `saw_begin_data'
4279         members.
4280         (open_file_r) Renamed dfm_open_for_reading(), rewrote.
4281         (open_file_w) Renamed dfm_open_for_writing(), rewrote.
4282         (open_inline_file) Removed.
4283         (read_record) For inline_file, if we haven't seen BEGIN DATA, read
4284         it.  Deal with line_number in extension record instead of file
4285         handle.
4286         (dfm_get_record) Rewrote.
4287         (dfm_put_record) Rewrote.
4288         (dfm_push) Assert file is open and one of ours.  Deal with
4289         line_number in extension record instead of file handle.
4290         (dfm_pop) Assert file is open and one of ours.  Deal with
4291         line_number in extension record instead of file handle.
4292         (cmd_begin_data) Use dfm_open_for_reading().  Mark that we saw
4293         BEGIN DATA.     
4294
4295         * file-handle.h: (enum constants RH_RF_*) Removed.
4296         (enum constants FH_MD_*) Removed.
4297         (struct file_handle) Removed `name', `norm_fn', `fn', `where',
4298         `recform', `lrecl', `mode' members.  Public references to
4299         `recform' changed to use handle_get_mode(), references to `lrecl'
4300         changed to use handle_get_record_width().  Added `private' member.
4301         (enum file_handle_mode) New.
4302
4303         * file-handle.q: (struct private_file_handle) New structure.
4304         (struct file_handle_list) New structure.
4305         (static var files) New.
4306         (static var file_handles) Removed.
4307         (init_file_handle) Removed.
4308         (create_file_handle) Removed.
4309         (get_handle_with_name) New function.
4310         (get_handle_for_filename) New function.
4311         (cmd_file_handle) Rewritten.
4312         (hash_file_handle) Removed.
4313         (cmp_file_handle) Removed.
4314         (fh_init_files) Rewritten.
4315         (fh_parse_file_handle) Rewritten.  Allows identifiers as
4316         filenames.
4317         (fh_get_handle_by_name) Renamed handle_get_name(), all references
4318         updated.  Rewritten.
4319         (fh_get_handle_by_filename) Renamed handle_get_filename(), all
4320         references updated.  Rewritten.
4321         (fh_record_width) Renamed handle_get_record_width(), all
4322         references updated.  Rewritten.
4323         (handle_get_mode) New function.
4324
4325         * file-type.c: (cmd_file_type) Open handle for reading.
4326
4327         * filename.c: [unix] (struct file_identity) New structure.
4328         [unix] (fn_get_identity) New function.
4329         [unix] (fn_free_identity) New function.
4330         [unix] (fn_compare_file_identities) New function.
4331         [!unix] (struct file_identity) New structure.
4332         [!unix] (fn_get_identity) New function.
4333         [!unix] (fn_free_identity) New function.
4334         [!unix] (fn_compare_file_identities) New function.
4335
4336         * lexer.c: (static var put) Renamed put_token, all references
4337         updated.
4338         (static var put_tokstr) New.
4339         (static var put_tokval) New.
4340         (lex_init) Initialize put_tokstr().
4341         (restore_token) New function.
4342         (save_token) New function.
4343         (lex_get) Use restore_token().
4344         (lex_put_back) Use save_token().
4345         (lex_put_back_id) New function.
4346         (lex_put_forward) Removed.
4347         (lex_preprocess_line) Set put_token instead of using
4348         lex_put_forward().
4349         (lex_negative_to_dash) Use save_token(), set put_token directly.
4350         (dump_token) Use stderr instead of stdout.
4351
4352         * main.c: (main) Remove call to cmd_init().
4353         
4354         * matrix-data.c: (cmd_matrix_data) Open file for reading.
4355
4356         * pfm-read.c: Use handle_get_filename() instead of trying to use
4357         h->fn directly, all over.
4358
4359         * pfm-write.c: Ditto.
4360
4361         * print.c: (internal_cmd_print) Open handle for writing.
4362         (dump_table) Use handle_get_filename().
4363         (print_trns_proc) Use handle_get_mode().
4364         (cmd_print_space) Use fh_parse_file_handle().
4365         Open handle for writing.
4366         [0] (debug_print) Removed.
4367
4368         * sfm-read.c: Use handle_get_filename() instead of trying to use
4369         h->fn directly, all over.
4370
4371         * sfm-write.c: Ditto.
4372
4373 Sat Mar 20 14:35:48 2004  Ben Pfaff  <blp@gnu.org>
4374
4375         Fix memory leaks.
4376         
4377         * autorecode.c: (arc_free) Free arc->src_values.
4378
4379         * error.c: (msg) Free buf.
4380
4381         * val-labs.c: (do_value_labels) Always free vars.
4382
4383         * vfm.c: (close_active_file) If sink has no make_source then call
4384         its destroy function.
4385
4386 Sat Mar 20 14:00:24 2004  Ben Pfaff  <blp@gnu.org>
4387
4388         Fixed cmd_parse() so that it always skips past a full command
4389         name.  A few special commands for which this would be bad get
4390         special treatment.  This lets us drop code for skipping past the
4391         end of a command name in most cmd_*() functions.  It's not worth
4392         listing all the commands affected.
4393
4394         * command.c: (struct command) Remove `cmd' member, replace by
4395         `name' member, all references updated.  Remove `word', `next',
4396         `skip_entire_name' members.
4397         (macro DEFCMD) Deal with revised `struct command'.
4398         (macro UNIMPL) Ditto.
4399         (macro SPCCMD) New macro for commands whose last word shouldn't be
4400         skipped.
4401         (static array cmd_table[]) Make const, rename `commands', remove
4402         sentinel element.
4403         (macro COMMAND_CNT) New macro.
4404         (split_words) Removed.
4405         (cmd_init) Removed.
4406         (FILE_TYPE_okay) Make parameter const.
4407         (cmd_parse) Improve error messages.
4408         (match_strings) New function.
4409         (next_word) New function.
4410         (enum command_match) New enum.
4411         (conflicting_3char_prefixes) New function.
4412         (conflicting_3char_prefix_command) New function.
4413         (cmd_match_words) New function.
4414         (count_matching_commands) New function.
4415         (get_command_name) New function.
4416         (free_words) New function.
4417         (unknown_command_error) New function.
4418         (figure_out_command) Renamed parse_command_name(), rewritten.
4419
4420         * command.def: Removed @ command.  Marked BEGIN DATA, DOCUMENT,
4421         FILE LABEL, REMARK, SUBTITLE, TITLE as special.  Renamed EVALUATE
4422         to DEBUG EVALUATE.  Added N alias for N OF CASES, SORT alias for
4423         SORT CASES.
4424
4425         * command.h: (macro SPCCMD) New.
4426
4427         * include.c: (cmd_include_at) Removed.
4428         (cmd_include) Allow identifier to be used as filename.
4429
4430         * inpt-pgm.c: (cmd_reread) Use fh_parse_file_handle().
4431
4432         * t-test.q: (cmd_t_test) Command name is now parsed for us.
4433         
4434
4435 Sat Mar 20 13:56:00 2004  Ben Pfaff  <blp@gnu.org>
4436
4437         Start work on better test framework.
4438         
4439         * Makefile.am: (pspp_sources) Add debug.c.
4440         
4441         * debug.c: New file.
4442
4443         * compute.c: (cmd_evaluate) Moved to debug.c, renamed
4444         cmd_debug_evaluate().
4445
4446         * expr-prs.c: (expr_parse) Remove PXP_DUMP support.
4447
4448         * expr.h: (enum constant PXP_DUMP) Removed.
4449
4450 Sat Mar 20 00:05:42 WST 2004 John Darrington <john@darrington.wattle.id.au>
4451
4452         * set.q:  Implemented the SHOW command, and synced it to the existing 
4453         SET cmd.
4454
4455         Added a handler for SIGWINCH so that viewlength and viewwidth follow
4456         changes as the window size is changed.
4457
4458         Added fallback to set viewlength and viewwidth from LINES and COLUMS
4459         environment variables if other methods are not available.
4460
4461         glob.c: Removed a lot of global variables from glob.c and encapsulated 
4462         them in set.q
4463
4464         random.c: Tidied up the way the random seed is set.
4465
4466         str.c: Added a ds_vprintf function.
4467
4468         error.c: Extended dump_message so that messages are always broken at
4469         '\n' characters.
4470         
4471 Thu Mar 18 11:07:14 2004  Ben Pfaff  <blp@gnu.org>
4472
4473         * pfm-write.c: (bufwrite) Write out the correct element for string
4474         variables.  From Andreas Streichardt <streichardt@globalpark.de>.
4475
4476 Mon Mar 15 20:48:03 2004  Ben Pfaff  <blp@gnu.org>
4477
4478         Get rid of static and global (!) vars in matrix-data.c.
4479
4480         * matrix-data.c: (static var nr_data) Removed.
4481         (static var nr_factor_values) Removed.
4482         (static var max_cell_index) Removed.
4483         (static var split_values) Removed.
4484         (struct nr_aux_data) New structure.
4485         (read_matrices_without_rowtype) Use a local struct nr_aux_data in
4486         place of static vars, pass to create_case_source() and procedure()
4487         as aux data.
4488         (nr_read_data_lines) Use struct nr_aux_data * parameter instead of
4489         struct matrix_data_pgm *.
4490         (nr_read_splits) Ditto.
4491         (nr_read_factors) Ditto.
4492         (nr_output_data) Ditto.
4493         (static var wr_content) Removed.
4494         (global var wr_data) Removed.
4495         (global var wr_current) Removed.
4496         (struct wr_aux_data) New structure.
4497         (read_matrices_with_rowtype) Use a local struct wr_aux_data in
4498         place of static vars, pass to create_case_source() and procedure()
4499         as aux data.
4500         (matrix_data_read_with_rowtype) Use struct wr_aux_data * parameter
4501         instead of matrix_data_pgm *.
4502         (wr_read_splits) Ditto.
4503         (wr_output_data) Ditto.
4504         (wr_read_rowtype) Ditto.
4505         (wr_read_factors) Ditto.
4506         (wr_read_indeps) Ditto.
4507         
4508 Mon Mar 15 20:07:29 2004  Ben Pfaff  <blp@gnu.org>
4509
4510         Get rid of static vars in autorecode.c.
4511
4512         * autorecode.c: (struct autorecode_trns) Rename `arc' to `specs',
4513         `n_arc' to `spec_cnt'.  All references updated.
4514         (static var v_src) Removed.
4515         (static var v_dest) Removed.
4516         (static var h_trns) Removed.
4517         (static var nv_src) Removed.
4518         (static var descend) Removed.
4519         (static var print) Removed.
4520         (enum direction) New enum.
4521         (struct autorecode_pgm) New structure.
4522         (cmd_autorecode) Use struct autorecode_pgm instead of static vars.
4523         Move n_dest local var into struct autorecode_pgm for ease of
4524         clean-up.  Use arc_free().
4525         (arc_free) New function.
4526         (recode) Modify to take struct autorecode_pgm * parameter instead
4527         of using statics.  Let the caller clean up.
4528         (autorecode_proc_func) Use struct autorecode_pgm * auxiliary data
4529         instead of statics.  Rearrange code a little.
4530
4531 Mon Mar 15 00:25:02 2004  Ben Pfaff  <blp@gnu.org>
4532
4533         Get rid of static, global vars in recode.c.  Remove debug code.
4534
4535         * recode.c: (static var head) Removed.
4536         (global var v) Removed.
4537         (global var nv) Removed.
4538         (cmd_recode) New local variables head, v, nv.  Initialize and free
4539         v.  Don't call debug_print().
4540         [DEBUGGING] (dump_dest) Removed.
4541         [DEBUGGING] (debug_print) Removed.
4542
4543 Mon Mar 15 00:14:49 2004  Ben Pfaff  <blp@gnu.org>
4544
4545         Get rid of static vars in expr-opt.c.
4546
4547         * expr-opt.c: (static var e) Removed.
4548         (static var nop) Removed.
4549         (static var mop) Removed.
4550         (static var ndbl) Removed.
4551         (static var mdbl) Removed.
4552         (static var nstr) Removed.
4553         (static var mstr) Removed.
4554         (static var nvars) Removed.
4555         (static var mvars) Removed.
4556         (struct expr_dump_state) New structure.
4557         (dump_expression) Use new struct expr_dump_state instead of static
4558         vars and pass to functions we call.
4559         (dump_node) Use struct expr_dump_state * parameter.
4560         (emit) Ditto.
4561         (emit_num_con) Ditto.
4562         (emit_str_con) Ditto.
4563         (emit_var) Ditto.
4564         
4565 Mon Mar 15 00:03:51 2004  Ben Pfaff  <blp@gnu.org>
4566
4567         Get rid of static var in COUNT.
4568
4569         * count.c: (static var head) Move into cmd_count().
4570         (cmd_count) [DEBUGGING] Don't call debug_print.
4571         [DEBUGGING] (debug_print) Removed.
4572
4573 Sun Mar 14 23:56:09 2004  Ben Pfaff  <blp@gnu.org>
4574
4575         Get rid of static vars in VALUE LABELS, ADD VALUE LABELS.
4576
4577         * val-labs.c: (static var v) Removed.
4578         (static var nv) Removed.
4579         [DEBUGGING] (debug_print) Removed.
4580         (verify_val_labs) Add struct variable **, int parameters.
4581         (get_label) Ditto.  Improve error messages, streamline.
4582         (erase_labels) New function for erasing value labels, taking over
4583         part of verify_val_labs()'s function.
4584         (init) Removed.
4585         (done) Removed.
4586         (cmd_value_labels) No need to call init() or done() anymore.
4587         (cmd_add_value_labels) Ditto.
4588         (do_value_labels) Add vars, var_cnt local variables.  Clean up
4589         after them internally.  Call erase_labels() if we should.  Don't
4590         call debug_print().
4591
4592 Sun Mar 14 23:33:53 2004  Ben Pfaff  <blp@gnu.org>
4593
4594         Get rid of static vars in MATCH FILES.
4595         
4596         * get.c: (static var mtf_head) Removed.
4597         (static var mtf_tail) Removed.
4598         (static var mtf_by) Removed.
4599         (static var mtf_n_by) Removed.
4600         (static var mtf_master) Removed.
4601         (static var mtf_seq_num) Removed.
4602         (static var mtf_seq_nums) Removed.
4603         (static var mtf_sink) Removed.
4604         (static var mtf_case) Removed.
4605         (struct mtf_proc) New structure.
4606         (cmd_match_files) Use struct mtf_proc instead of static vars.
4607         (mtf_processing_finish) Ditto.
4608         (mtf_free) Ditto.
4609         (mtf_delete_file_in_place) Ditto.
4610         (mtf_read_nonactive_records) Ditto.
4611         (mtf_compare_BY_values) Ditto.
4612         (mtf_processing) Ditto.
4613         (mtf_merge_dictionary) Ditto.
4614
4615 Sun Mar 14 22:48:12 2004  Ben Pfaff  <blp@gnu.org>
4616
4617         * command.def: Add CASESTOVARS, VARSTOCASES unimplemented commands.
4618
4619         * dictionary.c: (dict_rename_var) Add assertion.
4620         (dict_contains_var) Check by index instead of name.
4621
4622 Sun Mar 14 22:01:02 2004  Ben Pfaff  <blp@gnu.org>
4623
4624         Get rid of compaction_necessary, compaction_nval, compaction_case.
4625         Redo VFM interface.  Replace disk_sink and memory_sink by
4626         storage_sink, disk_source and memory_source by storage_source.
4627
4628         * vfm.h: (struct case_sink) Add `dict', `idx_to_fv', `value_cnt'
4629         members.
4630
4631         * vfm.c: 
4632         (struct write_case_data) Remove `begin_func', `end_func',
4633         `func_aux' members.  Add `aux', `trns_case', `sink_case',
4634         `cases_written', `cases_analyzed' members.
4635         (global var compaction_necessary) Make static.
4636         (global var compaction_nval) Removed.
4637         (global var compaction_case) Removed.
4638         (static var case_count) Removed.
4639         (struct procedure_aux_data) Removed.
4640         (struct split_aux_data) Removed.
4641         (procedure) Remove begin_func, end_func parameters.  Rewrite.
4642         (static var not_canceled) Removed.
4643         (process_active_file) Removed.
4644         (process_active_file_write_case) Removed.
4645         (process_active_file_output_case) Removed.
4646         (prepare_for_writing) Moved into open_active_file().
4647         (arrange_compaction) Ditto.
4648         (setup_lag) Ditto.
4649         (open_active_file) Rewrote.
4650         (write_case) New function.
4651         [DEBUGGING] (index_to_varname) Removed.
4652         (execute_transformations) New function.
4653         (exclude_this_case) Renamed filter_case(), changed interface.
4654         (clear_case) Added struct ccase * parameter to interface.
4655         (close_active_file) Added struct write_case_data * parameter,
4656         rewrote.
4657         (disk_sink_create) Removed.
4658         (disk_sink_destroy) Removed.
4659         (disk_sink_make_source) Removed.
4660         (disk_sink_write) Removed.
4661         (disk_source_count) Removed.
4662         (disk_source_destroy) Removed.
4663         (disk_source_read) Removed.
4664         (global var disk_sink_class) Removed.
4665         (global var disk_source_class) Removed.
4666         (global var memory_sink_class) Removed.
4667         (global var memory_source_class) Removed.
4668         (memory_sink_create) Removed.
4669         (memory_sink_destroy) Removed.
4670         (memory_sink_make_source) Removed.
4671         (memory_sink_write) Removed.
4672         (memory_source_count) Removed.
4673         (memory_source_destroy) Removed.
4674         (memory_source_get_cases) Removed.
4675         (memory_source_read) Removed.
4676         (memory_source_set_cases) Removed.
4677         (struct disk_stream_info) Removed.
4678         (struct memory_sink_info) Removed.
4679         (struct memory_source_info) Removed.
4680         (write_active_file_to_disk) Removed.
4681         (destroy_storage_stream_info) New function.
4682         (global var null_sink_class) New var.
4683         (global var storage_sink_class) New var.
4684         (global var storage_source_class) New var.
4685         (open_storage_file) New function.
4686         (storage_sink_destroy) New function.
4687         (storage_sink_make_source) New function.
4688         (storage_sink_open) New function.
4689         (storage_sink_write) New function.
4690         (storage_source_count) New function.
4691         (storage_source_destroy) New function.
4692         (storage_source_get_cases) New function.
4693         (storage_source_on_disk) New function.
4694         (storage_source_read) New function.
4695         (storage_source_set_cases) New function.
4696         (storage_source_to_disk) New function.
4697         (storage_to_disk) New function.
4698         (struct storage_stream_info) New structure.
4699         (write_storage_file) New function.
4700         (procedure_write_case) Removed.
4701         (create_case_source) Add `struct dictionary *' parameter, all
4702         references updated.
4703         (create_case_sink) Ditto.
4704         (free_case_sink) New function.
4705         (struct split_aux_data) New structure.
4706         (procedure_with_splits) New function implementing what procedure()
4707         used to.
4708         (SPLIT_FILE_proc_func) Removed.
4709         (procedure_with_splits_callback) New function.
4710         (equal_splits) New function.
4711         
4712         * aggregate.c: Pass around a struct instead of using statics.
4713         (static var outfile) Remove.
4714         (enum type) Give it tag `missing_treatment'.
4715         (static var missing) Remove.
4716         (static var sort) Remove.
4717         (static var agr_first) Remove.
4718         (static var agr_next) Remove.
4719         (static var case_count) Remove.
4720         (static var prev_case) Remove.
4721         (static var buf64_1xx) Remove.
4722         (static var buf_1xx) Remove.
4723         (struct agr_proc) New structure incorporating the above.
4724         (cmd_aggregate) Use new struct.  Clean up error handling using
4725         agr_destroy().  Completely rewrite actual implementation of
4726         aggregation.
4727         (create_sysfile) Add struct agr_proc * parameter, modify
4728         accordingly.
4729         (parse_aggregate_functions) Ditto.
4730         (free_aggregate_functions) Ditto.  Rename agr_destroy().
4731         (aggregate_single_case) Add struct agr_proc * parameter, modify
4732         accordingly.
4733         (accumulate_aggregate_info) Ditto.
4734         (dump_aggregate_info) Ditto.
4735         (initialize_aggregate_info) Ditto.
4736         (agr_00x_trns_proc) Removed.
4737         (agr_00x_end_func) Removed.
4738         (agr_10x_trns_proc) Removed.
4739         (agr_10x_trns_free) Removed.
4740         (agr_10x_end_func) Removed.
4741         (agr_11x_read) Removed.
4742         (agr_11x_finish) Removed.
4743         [DEBUGGING] (debug_print) Removed.
4744         (write_case_to_sfm) Add struct agr_proc * parameter, modify
4745         accordingly.
4746         (agr_to_active_file) New function.
4747         (presorted_agr_to_sysfile) New function.
4748         (sort_agr_to_sysfile) New function.
4749
4750         * autorecode.c: (cmd_autorecode) Use procedure_with_splits().
4751
4752         * crosstabs.q: (internal_cmd_crosstabs) Ditto.
4753
4754         * descript.q: (cmd_descriptives) Ditto.
4755
4756         * dfm.c: (cmd_begin_data) Check for storage_source_class.  Adapt
4757         to new procedure() interface.
4758
4759         * command.c: (cmd_execute) Adapt to new procedure() interface.
4760
4761         * dictionary.c: (dict_compact_values) Also delete scratch
4762         variables.
4763         (dict_get_compacted_value_cnt) New function.
4764         (dict_get_compacted_idx_to_fv) New function.
4765
4766         * flip.c: (cmd_flip) Warn about and cancel TEMPORARY.
4767         (cmd_flip) Adapt to new procedure() interface.
4768         (flip_sink_write) Use sink->idx_to_fv.
4769
4770         * frequencies.q: (internal_cmd_frequencies) Use
4771         procedure_with_splits().
4772
4773         * get.c: (cmd_save_internal) Adapt to new procedure() interface.
4774         (static var mtf_sink) New static var.
4775         (static var mtf_case) New static var.
4776         (cmd_match_files) Warn about and cancel TEMPORARY.  Redo the way
4777         we actually implement the matching.
4778         (mtf_delete_file_in_place) Use mtf_case.
4779         (mtf_processing) Use mtf_case and mtf_sink.
4780         (cmd_export) Adapt to new procedure() interface.
4781
4782         * levene.c: (levene) Use procedure_with_splits().
4783
4784         * list.q: (cmd_list) Use procedure_with_splits().
4785
4786         * matrix-data.c: (read_matrices_without_rowtype) Adapt to new
4787         procedure() interface.
4788         (read_matrices_with_rowtype) Ditto.
4789
4790         * modify-vars.c; (cmd_modify_vars) Warn about and cancel
4791         TEMPORARY.  Adapt to new procedure() interface.
4792
4793         * rename-vars.c: Warn about and cancel TEMPORARY.
4794
4795         * sort.c: (cmd_sort_cases) Warn about TEMPORARY.
4796         (sort_cases) Use dict_get_compacted_value_cnt() instead of
4797         compaction_nval.  Adapt to new procedure() interface.  Use
4798         storage_source_to_disk().
4799         (do_internal_sort) Don't try to dump the cases to memory.
4800         (compare_case_lists) Pass null idx_to_fv.
4801         (struct initial_run_state) Add `idx_to_fv' member.  Remove
4802         `case_size' member.
4803         (write_initial_runs) Don't initialize irs->case_size.  Adapt to
4804         new procedure() interface.  Reset irs->idx_to_fv after calling
4805         procedure().
4806         (sort_sink_write) Set irs->idx_to_fv.  Use case_size from struct
4807         sort_cases_pgm.  Pass irs, not struct sort_cases_pgm to
4808         push_heap().
4809         (destroy_initial_run_state) Don't dereference irs after freeing
4810         it.
4811         (allocate_cases) Don't calculate case_size locally.
4812         (compare_record) Add idx_to_fv parameter.
4813         (compare_record_run) Change parameter from struct sort_cases_pgm *
4814         to struct initial_run_state *.  Pass irs->idx_to_fv to
4815         compare_record().
4816         (compare_record_run) Third parameter now a struct
4817         initial_run_state *.
4818         (output_record) No need for out_case anymore.  Pass irs, not
4819         struct sort_cases_pgm to pop_heap().  Use case_size from struct
4820         sort_cases_pgm.
4821         (merge) Use case_size from struct sort_cases_pgm.
4822         (merge_once) Use case_size from struct sort_cases_pgm.
4823         Pass null pointer to compare_record() as idx_to_fv.
4824         (global var sort_sink_class) Make static.
4825
4826         * t-test.q: (cmd_t_test) Use procedure_with_splits().
4827
4828         * temporary.c: Remove debugging crap.
4829
4830 Sat Mar 13 14:19:52 WST 2004 John Darrington <john@darrington.wattle.id.au>
4831
4832         * t-test.q, levene.c: Fixed up the handling of MISSING values
4833         int the T-TEST
4834
4835 Fri Mar 12 16:23:35 WST 2004 John Darrington <john@darrington.wattle.id.au>
4836
4837         * t-test.q, levene.c: Added support for T-TEST /GROUP where only 
4838         one value is given.
4839
4840 Wed Mar 10 23:25:13 2004  Ben Pfaff  <blp@gnu.org>
4841
4842         Change explicit variable name checks into use of
4843         dict_class_from_id().
4844
4845         * dictionary.c: (dict_create_var)  Change explicit variable name
4846         check into use of dict_class_from_id().
4847
4848         * get.c: (trim_dictionary) Ditto.
4849
4850         * sel-if.c: (cmd_filter) Ditto.
4851
4852         * sysfile-info.c: (cmd_display) Ditto.
4853
4854         * vars-prs.c: (parse_DATA_LIST_vars) Ditto.
4855
4856         * vfm.c: (arrange_compaction) Ditto.
4857
4858         * weight.c: (cmd_weight) Ditto.
4859
4860 Wed Mar 10 21:16:34 2004  Ben Pfaff  <blp@gnu.org>
4861
4862         * temporary.c: (cmd_temporary) When TEMPORARY was the first
4863         transformation following the input program, if any, for some
4864         reason we special-cased f_trns.  That's just wrong.  It should
4865         always be set to n_trns.
4866
4867 Tue Mar  9 23:44:40 2004  Ben Pfaff  <blp@gnu.org>
4868
4869         * format.c: (parse_format_specifier_name) Fix brown-bag bug
4870         introduced in last check-in.
4871
4872 Tue Mar  9 23:10:41 2004  Ben Pfaff  <blp@gnu.org>
4873
4874         * format.c: (global array translate_fmt[]) Removed.
4875         (translate_fmt) New function as replacement.
4876         (parse_format_specifier_name) Rewrite.
4877
4878         * pfm-read.c: (convert_format) Use translate_fmt() instead of
4879         translate_fmt[].
4880
4881         * sfm-read.c: (parse_format_spec) Ditto.
4882
4883         * postscript.c: (text) Fix handling of fonts with missing
4884         ligatures.
4885
4886         * sort.c: (struct external_sort) Add temp_name member.
4887         (destroy_external_sort) Free temp_dir, temp_name members.
4888         (init_external_sort) Allocate temp_name.
4889         (get_temp_file_name) Change prototype.
4890         (open_temp_file) Deal with change to get_temp_file_name().
4891         (close_temp_file) Ditto.
4892         (remove_temp_file) Ditto.
4893         (write_temp_file) Ditto.
4894         (read_temp_file) Ditto.
4895         (sort_sink_destroy) Removed.
4896         (sort_sink_class) Change destroy member to null.
4897
4898 Tue Mar  9 22:36:34 2004  Ben Pfaff  <blp@gnu.org>
4899
4900         Eliminate temp_case.
4901
4902         * aggregate.c: (cmd_aggregate) No need to save/restore temp_case
4903         anymore.  Use agr_11x_finish().
4904         (aggregate_single_case) Make first param const.
4905         (accumulate_aggregate_info) Ditto.
4906         (agr_00x_end_func) Use compaction_case, not temp_case.
4907         (agr_11x_func) Break into agr_11x_read(), agr_11x_finish().
4908
4909         * data-list.c: (struct data_list_pgm) Add `case_size' member.
4910         (cmd_data_list) Initialize case_size.
4911         (read_from_data_list_fixed) Add struct ccase * param, use instead
4912         of temp_case.
4913         (read_from_data_list_free) Ditto.
4914         (read_from_data_list_list) Ditto.
4915         (read_one_case) Rename data_list_trns_proc(), all references
4916         updated.  Add argument in calling above functions.  Use c
4917         argument instead of temp_case.
4918         (destroy_dls) Rename data_list_trns_free(), all references
4919         updated.
4920
4921         * expr-evl.c: (expr_evaluate) Make second parameter const.
4922
4923         * file-type.c: (struct file_type_pgm) Add `case_size' member.
4924         (cmd_end_file_type) Initialize `case_size'.
4925         (file_type_source_read) Add struct ccase * parameter.  Use instead
4926         of temp_case.
4927
4928         * flip.c: Rewritten.
4929
4930         * get.c: (struct get_pgm) New structure to keep track of
4931         case_size.
4932         (cmd_get) Initialize case_size.
4933         (cmd_import) Ditto.
4934         (get_source) Deal with struct get_pgm.
4935         (get_source_read) Add struct ccase * parameter, use instead of
4936         temp_case.
4937         (import_source_read) Ditto.
4938
4939         * get.c: Use a null pointer instead of temp_case to represent the
4940         "current case" in a struct mtf_file's input member.
4941         (mtf_processing_finish) Pass null to mtf_processing(), not
4942         temp_case.
4943         (mtf_read_nonactive_records) Don't set iter->input to temp_case.
4944         (mtf_compare_BY_values) Add extra arg, use instead of null input
4945         members.
4946         (mtf_processing) Use c parameter instead of temp_case.  Pass
4947         compaction_case to process_active_file_output_case().
4948         
4949         * glob.c: (global variable temp_case) Removed.
4950
4951         * inpt-pgm.c: (struct input_program_pgm) Add `case_size' member.
4952         (cmd_input_program) Initialize case_size.  Set
4953         vfm_source->value_cnt.
4954         (init_case) Add struct ccase * parameter, use instead of
4955         temp_case.
4956         (clear_case) Ditto.
4957         (input_program_source_read) Ditto.
4958
4959         * matrix-data.c: (matrix_data_read_without_rowtype) Ditto.
4960         (dump_cell_content) Ditto.
4961         (nr_output_data) Ditto.
4962         (read_matrices_without_rowtype) Ditto.
4963         (matrix_data_read_with_rowtype) Ditto.
4964         (wr_read_splits) Ditto.
4965         (wr_output_data) Ditto.
4966
4967         * sort.h: (struct sort_cases_pgm) New member `case_size'.
4968         
4969         * sort.c: (sort_cases) Initialize scp->case_size.
4970         (struct external_sort) Remove `case_size' member.
4971         (write_initial_runs) Only call vfm_sink->class_destroy if
4972         non-null.
4973         (struct sort_source_aux) New structure.
4974         (sort_source_read_helper) New function.
4975         (sort_source_read) Use sort_source_read_helper().
4976         (read_sort_output) Change interface to be more reasonable.
4977         (read_internal_sort_output) Ditto.
4978         (read_external_sort_output) Ditto.
4979
4980         * vars-prs.c: (dict_class_to_name) Pass return value through
4981         gettext.
4982
4983         * vfm.c: (struct procedure_aux_data) Add `trns_case' member.
4984         (procedure) Initialize trns_case.
4985         (procedure) Pass trns_case to vfm_source->class->read().
4986         Free trns_case.
4987         (process_active_file) Start using struct procedure_aux_data.
4988         (process_active_file_write_case) Pass trns_case to
4989         transformations, lag_case(), clear_case().
4990         (process_active_file_output_case) Add struct ccase * parameter.
4991         (create_trns_case) New function.
4992         (make_temp_case) Removed.
4993         (vector_initialization) Removed.
4994         (close_active_file) Only call make_source if non-null, otherwise
4995         set vfm_source to null pointer.  Don't free temp_case.
4996         (disk_source_read) Add struct ccase * parameter, use instead of
4997         temp_case.
4998         (memory_source_read) Ditto.
4999         (lag_case) Add const struct ccase * member.
5000         (procedure_write_case) Use trns_case instead of temp_case.
5001         (clear_case) Add struct ccase * member, use instead of temp_case.
5002         (exclude_this_case) Ditto.
5003         (create_case_source) Add struct dictionary * parameter, use to
5004         initialize source->value_cnt.
5005
5006         * vfm.h: (struct case_source) Add `value_cnt' member.
5007         (struct case_source_class) Add struct ccase * parameter to `read'
5008         member function pointer.
5009         (struct case_sink_class) Make struct ccase * parameter const in
5010         `write' member function pointer.
5011         
5012 Wed Mar  3 20:44:37 2004  Ben Pfaff  <blp@gnu.org>
5013
5014         Fix a lot of "possibly uninitialized variable" warnings.  Some of
5015         them are even real bugs.  A few of them make me wonder how the
5016         code ever worked.
5017
5018         * aggregate.c: (parse_aggregate_functions) Initialize `function.
5019
5020         * ascii.c: (output_lines) Add default case to switch.
5021
5022         * crosstabs.q: Remove static variable `expected' and all
5023         references to it.
5024         (display_crosstabulation) Always calculate expected value.
5025         (calc_chisq) Ditto.
5026         (output_pivot_table) Initialize `cmp'.
5027         (display_crosstabulation) New variable `last_row', which is
5028         initialized.
5029
5030         * data-in.c: (parse_numeric) Always initialize sign.  How did this
5031         work at all?!
5032
5033         * data-list.c: (repeating_data_trns_proc) Always initialize code.
5034         Always set info.ofs.  (How did this work?!)
5035
5036         * expr-opt.c: (optimize_tree) Always initialize `m'.
5037         (evaluate_tree) Always initialize `c'.  (How did this work?)
5038
5039         * frequencies.q: (frq_custom_variables) Always initialize min,
5040         max.
5041         (frq_custom_grouped) Always initialize `dl'.
5042
5043         * groff-font.c: (groff_read_font) Always initialize char_set.
5044
5045         * matrix-data.c: (nr_output_data) Initialize `split'.
5046         (wr_read_splits) Remove shadowing split_cnt declaration.
5047         (wr_output_data) Initialize `split'.
5048
5049         * output.c: (tokener) Skip add character on syntax error.
5050
5051         * pool.c: (pool_strndup) Always set `copy'.  (How did this work?!)
5052
5053         * postscript.c: (read_ps_encodings) Use line.string instead of
5054         uninitialized `bp'.
5055         (write_text) Add default case to switch.
5056         (text) Always initialize multiple variables.  Fix bug with
5057         ligatures.
5058
5059         * print.c: (fixed_parse_fortran) Initialize head.
5060         (alloc_line) Add default case to switch.
5061
5062         * recode.c: (parse_dest_spec) Handle case where nothing matches.
5063         (recode_trns_proc) Move variable declaration inward.  Add default
5064         case to switch.
5065
5066         * sfm-read.c: (read_header) Initialize skip_amt.
5067
5068         * sysfile-info.c: (display_variables) Always initialize pc.
5069
5070         * vars-prs.c: Initialized `included'.
5071
5072 Wed Mar  3 09:30:09 2004  Ben Pfaff  <blp@gnu.org>
5073
5074         * main.c: (main) sigaction()'s sa_flags member was uninitialized.
5075         Just use signal() instead.
5076
5077 Wed Mar  3 09:26:30 2004  Ben Pfaff  <blp@gnu.org>
5078
5079         Get rid of vfm_sink_info and vfm_source_info.
5080         
5081         * aggregate.c: (agr_00x_end_func) Don't increment
5082         sfm_sink_info.ncases.
5083
5084         * sort.c: (do_internal_sort) Get case count from
5085         vfm_source->class->count().
5086         (struct external_sort) Add `case_size' member.
5087         (do_external_sort) Initialize case_size.
5088         (struct initial_run_state) Add `case_size' member.
5089         (write_initial_runs) Initialize case_size.
5090         (sort_sink_write) Use case_size.
5091         (read_external_sort_output) Use case_size.  Get case_cnt from
5092         initial_runs.
5093
5094         * vfm.c: (struct write_case_data) Add underscores to existing arg
5095         names, all references updated.  Renamed `aux' as `func_aux', all
5096         references updated.  Added new `aux' member.
5097         (global var vfm_source_info) Removed.
5098         (global var vfm_sink_info) Removed.
5099         (struct procedure_aux_data) New.
5100         (struct split_aux_data) New.
5101         (procedure) Use `aux' fields for procedure_aux_data,
5102         split_aux_data.
5103         (process_active_file_write_case) Pass case_count + 1 to
5104         transformation procedures, exclude_this_case().
5105         (process_active_file_output_case) Don't increment
5106         vfm_sink_info.ncases.
5107         (prepare_for_writing) Don't initialize vfm_sink_info.  Don't try
5108         to send data to disk early.
5109         (make_temp_case) Don't use vfm_sink_info.case_size.
5110         (close_active_file) Don't initialize vfm_source_info.
5111         (struct disk_stream_info) New, to allow for case_cnt and case_size fields.
5112         (disk_sink_create) Initialize and/or update disk_stream_info.
5113         (disk_sink_write) Ditto.
5114         (disk_sink_destroy) Ditto.
5115         (disk_sink_make_source) Ditto.
5116         (disk_source_read) Ditto.
5117         (disk_source_destroy) Ditto.
5118         (global var disk_source_class) Add disk_source_count().
5119         (disk_source_count) New function.
5120         (struct memory_sink_info) Add `case_cnt', `case_size' members.
5121         (struct memory_source_info) Ditto.
5122         (memory_sink_create) Deal with case_cnt, case_size.
5123         (memory_sink_write) Ditto.
5124         (memory_sink_make_source) Ditto.
5125         (memory_source_read) Ditto.
5126         (memory_source_count) New function.
5127         (memory_source_class) Add memory_source_count().
5128         (procedure_write_case) Don't use vfm_sink_info.ncases.  Do use
5129         proc_aux->cases_written, and pass it to transformation procedures
5130         and exclude_this_case ().
5131         (exclude_this_case) Add case_num parameter.  Pass it to
5132         expr_evaluate().
5133         (SPLIT_FILE_procfunc) Use split_aux->prev_case instead of static
5134         variable.
5135
5136         * vfm.h: (struct case_source_class) Add `count' member.
5137
5138         * vfmP.h: (struct stream_info) Removed.
5139         (global variable vfm_source_info) Removed.
5140         (global variable vfm_sink_info) Removed.
5141         
5142 Tue Mar  2 23:38:17 2004  Ben Pfaff  <blp@gnu.org>
5143
5144         * var.h: (typedef trns_proc_func) New typedef.
5145         (trns_free_func) New typedef.
5146         (struct trns_header) Change `proc' to type trns_proc_func, `free'
5147         to type trns_free_func.  This only changes the actual type of
5148         trns_proc_func, adding a `case_num' parameter.  Updated all
5149         implementations to use the typedefs instead.
5150
5151         * compute.c: (compute_num) Pass case_num to expr_evaluate().
5152         (compute_num_vec) Ditto.
5153         (compute_str) Ditto.
5154         (compute_str_vec) Ditto.
5155
5156         * do-if.c: (do_if_trns_proc) Ditto.
5157
5158         * expr-evl.c: (expr_evaluate) Add new case_num parameter, use for
5159         OP_CASENUM.
5160
5161         * inpt-pgm.c: (input_program_source_read) Maintain case count,
5162         pass to transformation functions.
5163         (reread_trns_proc) Pass case_num arg to expr_evaluate().
5164
5165         * loop.c: (loop_1_trns_proc) Ditto.
5166         (loop_2_trns_proc) Ditto.
5167         (loop_3_trns_proc) Ditto.
5168
5169         * print.c: (print_space_trns_proc) Ditto.
5170
5171         * sel-if.c: (select_if_proc) Ditto.
5172
5173 Tue Mar  2 11:36:52 2004  Ben Pfaff  <blp@gnu.org>
5174
5175         * frequencies.q: (cleanup_freq_tab) Avoid memory leak by
5176         destroying hash table.
5177
5178         * glob.c: (read_active_file) Variable not referenced, removed.
5179         (cancel_input_pgm) Ditto.
5180
5181         * levene.c: Add #include <stdlib.h> needed to call free().
5182
5183         * aggregate.c: (parse_aggregate_functions) Make `function'
5184         variable const.
5185
5186 Tue Mar  2 11:30:56 2004  Ben Pfaff  <blp@gnu.org>
5187
5188         Start working to eliminate VFM dependence on static variables.
5189
5190         * command.c: (cmd_parse) Use case_source_is_class().
5191
5192         * data-list.c: Rewrite to eliminate use of static variables.
5193
5194         * dfm.c: (cmd_begin_data) Use case_source_is_class().
5195
5196         * file-handle.q: (fh_handle_name) Make parameter const.
5197
5198         * file-type.c: Rewrite to eliminate use of static variables.
5199
5200         * flip.c: Rewrite to eliminate use of static variables.
5201
5202         * format.c: (get_format_var_width) New function.
5203
5204         * get.c: Eliminate use of static variables.
5205
5206         * inpt-pgm.c: Eliminate use of static variables.
5207
5208         * matrix-data.c: Eliminate use of static variables.
5209
5210         * set.q: (set_max_workspace) New variable.
5211         (cmd_set) Use SET WORKSPACE to modify set_max_workspace.
5212
5213         * var.h: (struct case_list) Move here from vfmP.h.
5214
5215         * vars-atr.c: (discard_variables) Handle new vfm_source type.
5216
5217         * vfm.c: (vfm_source) Change type from struct case_stream to
5218         struct case_source.
5219         (vfm_sink) Change type from struct case_stream to struct
5220         case_sink.
5221         (static var paging) Rename workspace_overflow, all references
5222         updated.
5223         (procedure) Use new class structures.
5224         (process_active_file) Ditto.
5225         (process_active_file_write_case) Ditto.
5226         (prepare_for_writing) Use set_max_workspace.  Use new class
5227         structures.
5228         (close_active_file) Use new class structures.  Free old sink.
5229         (global var disk_source_file) Removed.
5230         (global var disk_sink_file) Removed.
5231         (disk_stream_init) Removed.
5232         (disk_stream_read) Removed.
5233         (disk_stream_write) Removed.
5234         (disk_stream_mode) Removed.
5235         (disk_stream_destroy_source) Removed.
5236         (disk_stream_destroy_sink) Removed.
5237         (global var vfm_disk_stream) Removed.
5238         (disk_sink_create) New function.
5239         (disk_sink_write) New function.
5240         (disk_sink_destroy) New function.
5241         (disk_sink_make_source) New function.
5242         (disk_sink_class) New static var.
5243         (disk_source_read) New function.
5244         (disk_source_destroy) New function.
5245         (global var vfm_source_class) New var.
5246         (global var memory_source_cases) Removed.
5247         (global var memory_sink_cases) Removed.
5248         (global var memory_sink_max_cases) Removed.
5249         (struct memory_sink_info) New struct.
5250         (memory_stream_init) Removed.
5251         (memory_stream_read) Removed.
5252         (memory_stream_write) Removed.
5253         (memory_stream_mode) Removed.
5254         (memory_stream_destroy_source) Removed.
5255         (memory_stream_destroy_sink) Removed.
5256         (global var vfm_memory_stream) Removed.
5257         (page_to_disk) Renamed write_active_file_to_disk().
5258         (memory_sink_create) New function.
5259         (memory_sink_write) New function.
5260         (memory_sink_destroy) New function.
5261         (memory_sink_make_source) New function.
5262         (memory_sink_class) New static var.
5263         (memory_source_read) New function.
5264         (memory_source_destroy) New function.
5265         (memory_source_get_cases) New function.
5266         (memory_source_set_cases) New function.
5267         (global var vfm_source_class) New var.
5268         (procedure_write_case) Use new class structures.
5269         (create_case_source) New function.
5270         (case_source_is_complex) New function.
5271         (case_source_is_class) New function.
5272         (create_case_sink) New function.
5273
5274         * vfm.h: (global variable reinit_sysmis) Not used, removed.
5275         (global variable reinit_blanks) Not used, removed.
5276         (global variable init_zero) Not used, removed.
5277         (global variable init_blanks) Not used, removed.
5278         (struct case_source) New struct.
5279         (struct case_source_class) New struct.
5280         (struct case_sink) New struct.
5281         (struct case_sink_class) New struct.
5282         (struct case_stream) Removed.
5283
5284         * vfmP.h: (struct case_list) Moved to var.h.
5285
5286 Tue Mar  2 11:28:30 2004  Ben Pfaff  <blp@gnu.org>
5287
5288         * algorithm.c: (count_equal) New function.
5289         (count_if) New function.
5290         (unique) Add assertions.
5291         (partition) Add assertions.
5292         (is_partitioned) New function.
5293         (copy_if) Add assertions.
5294         (remove_equal) Add assertions.
5295         (lexicographical_compare) Rename lexicographical_compare_3way.
5296         (sort) Add assertions.  Rephrase some code.
5297         (is_sorted) New function.
5298
5299 Sun Feb 29 23:24:57 2004  Ben Pfaff  <blp@gnu.org>
5300
5301         Rewrite SORT CASES.
5302
5303         * sort.c: Completely rewrite.
5304
5305         * sort.h: Expose interface via struct sort_cases_pgm, not via
5306         global variables.
5307
5308         * aggregate.c: (sort) New static var.
5309         (cmd_aggregate) Use sort.
5310         (create_sysfile) Ditto.
5311         (aggregate_single_case) Ditto.
5312         (dump_aggregate_info) Ditto.
5313         (agr_00x_end_func) Ditto.
5314         (debug_print) Ditto.
5315
5316         * var.h: (enum SRT_ASCEND) Removed.
5317         (enum SRT_DESCEND) Removed.
5318         (struct sort_cases_proc) Removed.
5319         (struct variable) Remove p.srt member.
5320
5321 Sun Feb 29 23:22:45 2004  Ben Pfaff  <blp@gnu.org>
5322
5323         Get rid of the old, crappy heap structure and replace it by a new,
5324         shiny, C++ STL-like heap structure.
5325         
5326         * Makefile.am: (pspp_SOURCES) Remove heap.c, heap.h.
5327
5328         * algorithm.c: (push_heap) New function.
5329         (heapify) Ditto.
5330         (pop_heap) Ditto.
5331         (make_heap) Ditto.
5332         (sort_heap) Ditto.
5333         (is_heap) Ditto.
5334         
5335         * heap.c: Removed.
5336
5337         * heap.h: Removed.
5338
5339 Sun Feb 29 23:21:53 2004  Ben Pfaff  <blp@gnu.org>
5340
5341         Increase warning level.
5342         
5343         * Makefile.am: (AM_CFLAGS) Remove -Wnouninitialized.
5344
5345 Sat Feb 21 17:38:58 WST 2004 John Darrington <john@darrington.wattle.id.au>
5346
5347         * main.c: Added a signal handler for SIGSEGV requesting a bug report.
5348          
5349 Fri Feb 20 23:22:14 2004  Ben Pfaff  <blp@gnu.org>
5350
5351         * dictionary.c: (dict_create_var) Fix root cause of bug worked
5352         around by previous change log entry.
5353         
5354         * compute.c: (lvalue_finalize) Remove workaround from previous
5355         change log entry.
5356
5357 Fri Feb 20 14:37:41 WAST 2004 John Darrington <john@darrington.wattle.id.au>
5358
5359         * compute.c: Fixed a bug where the Format was not getting set for 
5360           computed variables (thus causing a crash when SAVEing).
5361
5362         * Added a test to stop this bug ever coming back
5363
5364 Wed Feb 18 22:21:35 2004  Ben Pfaff  <blp@gnu.org>
5365
5366         Got rid of approx.h.  In general, replaced all references to
5367         approx_eq() by ==, approx_lt() by <, etc.  Other types of changes
5368         noted below.
5369
5370         * Makefile.am: (pspp_SOURCES) Removed approx.h.
5371
5372         * data-out.c: (try_F) Replaced test for approx_eq(number, 0.0) by
5373         test for mag < EPSILON.
5374
5375         * misc.h: Add definition of EPSILON.
5376
5377 Wed Feb 18 21:32:44 2004  Ben Pfaff  <blp@gnu.org>
5378
5379         * vfm.c: (procedure) Add check to prevent recursive call.
5380
5381 Wed Feb 18 21:48:54 WST 2004 John Darrington <john@darrington.wattle.id.au>
5382
5383         * Moved the declarations relating to values to their own header file
5384           (val.h)
5385
5386         * Added levene.c and levene.h
5387
5388         * vars-atr.c: Changed the signature of compare_values to 
5389         take const * arguments.
5390                 
5391         * t-test.q: Changed the structure of struct t_test_proc 
5392        variables now contain their own group statistics information.
5393        Eventually, t_test_proc might get renamed, because it'd be 
5394        applicable to other commands too.
5395
5396 Mon Feb 16 23:15:51 2004  Ben Pfaff  <blp@gnu.org>
5397
5398         * data-out.c: Clean up.  Changed interface of convert_*() to take
5399         either a `double' or a `const char *' instead of a `const union
5400         value *'.  Update all implementations of those interfaces.
5401         (data_out) Use switch statements instead of a table.
5402         (convert_AHEX) Rewrite.
5403
5404         * format.h: Update comment.
5405
5406 Mon Feb 16 22:14:36 2004  Ben Pfaff  <blp@gnu.org>
5407
5408         * q2c.c: (dump_header) Add an Emacs header line to output files
5409         that makes generated .c files read-only by default, to make it
5410         difficult to accidentally change generated files.
5411
5412 Mon Feb 16 22:12:07 2004  Ben Pfaff  <blp@gnu.org>
5413
5414         * frequencies.q: (compare_freq_numeric_a) Compare by frequency,
5415         not bogus a->v.c <=> b->v.c pointer compare.
5416         (compare_freq_alpha_a) Ditto.
5417         (compare_freq_numeric_d) Ditto.
5418         (compare_freq_alpha_d) Ditto.
5419         
5420 Mon Feb 16 22:00:53 2004  Ben Pfaff  <blp@gnu.org>
5421
5422         Changed data_out() to store string data directly into a `union
5423         value''s s member, not indirectly into c.
5424
5425         * crosstabs.q: (output_pivot_table) Use format_short() instead of
5426         data_out().
5427         (table_value_missing) Ditto.
5428         (float_M_suffix) Ditto.
5429         (format_short) New function.
5430
5431         * data-in.h: (data_in_finite_line) Remove inline definition.
5432
5433         * data-list.c: (destroy_dls_var_spec) New function.
5434         (destroy_dls) Rewrite in terms of destroy_dls_var_spec().
5435         (data_list_source_destroy_source) Avoid cast.
5436         (struct repeating_data_trns) New field `id_value'.  Update
5437         comments.
5438         (cmd_repeating_data) Initialize id_value.  Use new
5439         repeating_data_trns_free() for freeing REPEATING DATA
5440         transformations.
5441         (rpd_parse_record) Rewrite support for record ID to be less bogus.
5442         (repeating_data_trns_free) New function.
5443
5444         * data-out.c: (data_out) Change return type to `void' by replacing
5445         error returns by writing a message into the output buffer.
5446         (convert_A) Read from v->s instead of v->c.
5447         (convert_AHEX) Ditto.
5448
5449         * expr-evl.c: Update comment.
5450         (expr_evaluate) Add assertion in OP_STRING case.
5451
5452         * format.h: (macro MAX_FORMATTED_LEN) New macro.
5453
5454         * list.q: (list_cases) Update for new data_out() semantics.
5455
5456         * print.c: (print_trns_proc) Ditto.
5457
5458         * tab.c: (tab_value) Ditto.
5459         (tab_float) Avoid stupid cast.
5460
5461         * var.h: Update comments.
5462         (macro MAX_STRING) New macro.
5463         (macro MAX_ELEMS_PER_VALUE) New macro.
5464
5465         * vars-atr.c: (compare_values) New function.
5466
5467         * vfm.c: (dump_splits) Update for new data_out() semantics.
5468
5469 Mon Feb 16 21:45:47 2004  Ben Pfaff  <blp@gnu.org>
5470
5471         * crosstabs.q: (struct table_entry) Rename v[] to values[].  All
5472         references updated.
5473         (struct crosstab) Rename v[] to vars[].  All references updated.
5474         (hash_table_entry) Replace the hash algorithm and fix a bug at the
5475         same time, which caused the hash value to depend only on a single
5476         value, not all of the variables' values.
5477         
5478 Mon Feb 16 12:49:53 2004  Ben Pfaff  <blp@gnu.org>
5479
5480         Clean up struct dictionary's value_cnt usage.
5481
5482         * dictionary.c: Add a function comment to each function.
5483         (struct dictionary) Rename value_cnt to next_value_idx, which more
5484         accurately reflects its meaning.  All references updated.
5485         (dict_rename_vars) Add assertion.
5486         (dict_get_value_cnt) Rename dict_get_next_value_idx().  All
5487         references updated.
5488         (dict_get_case_size) New function.
5489
5490         * aggregate.c: (create_sysfile) Use dict_get_case_size().
5491
5492         * get.c: (mtf_read_nonactive_records) Ditto.
5493
5494         * sort.c: (allocate_cases) Ditto.
5495         (write_initial_runs) Ditto.
5496         (merge) Ditto.
5497         (merge_once) Ditto.
5498
5499         * vfm.c: (prepare_for_writing) Ditto.
5500         (setup_lag) Ditto.
5501         (lag_case) Ditto.
5502
5503 Mon Feb 16 00:17:55 2004  Ben Pfaff  <blp@gnu.org>
5504
5505         Make vfm.c slightly less grotesque.
5506
5507         * vfm.c: (filter_var) Removed.
5508         (filter_index) Removed.
5509         (FILTERED macro) Removed.
5510         (exclude_this_case) New function.
5511         (process_active_file_write_case) Use exclude_this_case() instead
5512         of FILTERED and inline tests.
5513         (procedure_write_case) Ditto.
5514         (setup_filter) Removed.
5515         (open_active_file) Don't call setup_filter().
5516         (close_active_file) Call dict_get_filter() instead of checking
5517         filter_var.
5518
5519 Mon Feb 16 00:01:53 2004  Ben Pfaff  <blp@gnu.org>
5520
5521         * var.h: (struct variable) Update comments.
5522
5523 Sun Feb 15 23:14:59 2004  Ben Pfaff  <blp@gnu.org>
5524
5525         New functions dict_create_var_assert(), dict_lookup_var_assert().
5526         Converted several dict_*_var()/assert pairs into a single
5527         dict_*_var_assert().
5528
5529         * dictionary.c: (dict_create_var_assert) New function.
5530         (dict_lookup_var_assert) New function.
5531
5532 Sun Feb 15 23:06:08 2004  Ben Pfaff  <blp@gnu.org>
5533
5534         Got rid of "struct long_vec", envector(), devector(), etc.  Added
5535         two members `init', `reinit' to struct variable as a substitute.
5536         
5537         * Makefile.am: (pspp_SOURCES) Removed cases.c, cases.h.
5538         
5539         * cases.c: Removed.
5540
5541         * cases.h: Removed.
5542
5543         * aggregate.c: (parse_aggregate_functions) destvar doesn't need
5544         init.
5545
5546         * autorecode.c: (cmd_autorecode) destvars don't need init.
5547
5548         * compute.c: (lvalue_finalize) Set reinit.
5549
5550         * data-list.c: (fixed_parse_compatible) Don't need init usually.
5551         (dump_fmt_list) Ditto.
5552         (parse_free) Ditto.
5553
5554         * descript.q: (run_z_pass) Don't need init for z-scores.
5555
5556         * dictionary.c: (dict_create_var) Initialize `init', `reinit'
5557         members.
5558         (dict_clone_var) Copy `reinit' member, initialize `init' member.
5559
5560         * glob.c: (init_glob) Remove vec_init() calls.
5561
5562         * inpt-pgm.c: (cmd_end_input_program) Use `reinit', not `left'.
5563         
5564         * loop.c: (internal_cmd_loop) Don't need to call envector().
5565
5566         * numeric.c: (cmd_numeric) Ditto.
5567         (cmd_string) Ditto.
5568         (cmd_leave) Ditto.  Set `init', `reinit' members.
5569
5570         * recode.c: (cmd_recode) Don't need to call envector().
5571
5572         * repeat.c: (internal_cmd_do_repeat) Ditto.
5573
5574         * var.h: (struct variable) Remove `left'.  Add `init', `reinit'.
5575         (force_create_variable) Removed prototype.
5576         (force_dup_variable) Ditto.
5577
5578         * vector.c: (cmd_vector) Don't need to call envector().
5579
5580         * vfm.c: (reinit_sysmis) Removed.
5581         (reinit_blanks) Removed.
5582         (init_zero) Removed.
5583         (init_blanks) Removed.
5584         (process_active_file_write_case) No need to deal with vectors.
5585         Call clear_temp_case().
5586         (vector_initialization) Rewrite to use `init', `reinit'.
5587         (close_active_file) No need to call vec_clear().
5588         (procedure_write_case) Call clear_temp_case().
5589         (clear_temp_case) New function.
5590
5591 Sun Feb 15 20:50:36 2004  Ben Pfaff  <blp@gnu.org>
5592
5593         * pfm-write.c: (bufwrite) Get rid of nasty cast that also invoked
5594         undefined behavior.
5595
5596 Thu Feb 12 23:35:15 2004  Ben Pfaff  <blp@gnu.org>
5597
5598         Add auxiliary argument to procedure() interface.  Associated small
5599         clean-ups of vfm interface.
5600         
5601         * Updated every caller of procedure() and process_active_file() to
5602         reflect modified interface.  Simple, ordinary changes not listed
5603         otherwise below.
5604
5605         * Updated every function that implements struct case_stream's
5606         `read' function to take a write_case_func and a write_case_data.
5607         Also updated every caller of write_case() to instead call them
5608         through these arguments.  In some cases this meant that the extra
5609         args had to be threaded through a couple of extra levels.  This
5610         wasn't difficult or interesting so the details won't be given.
5611
5612         * data-list.c: (struct repeating_data_trns) Add members
5613         `write_case', `wc_data' as kluge.
5614         (read_one_set_of_repetitions) Rename repeating_data_trns_proc and
5615         make non-static.
5616         (repeating_data_set_write_case) New function.
5617
5618         * data-list.h: New file to declare repeating_data_trns_proc() and
5619         repeating_data_set_write_case().
5620
5621         * inpt-pgm.c: (input_program_source_read) Call
5622         repeating_data_set_write_case() for all the REPEATING DATA
5623         transformations, so that they know where to send their cases.
5624         It's a big kluge.  Also kluge in END CASE.
5625         (end_case_trns_proc) Never called anymore, but we still need it,
5626         so just assert(0).
5627
5628         * sort.c: (read_sort_output) Update to match struct case_stream
5629         `read' member.
5630
5631         * vfm.c: (struct write_case_data) New structure.
5632         (proc_func) Removed.
5633         (virt_proc_func) Removed.
5634         (begin_func) Removed.
5635         (virt_begin_func) Removed.
5636         (end_func) Removed.
5637         (write_case) Removed.
5638         (procedure) Added an auxiliary parameter to each function pointer
5639         argument's prototype.  Added an auxiliary data parameter.
5640         Rewrote.
5641         (process_active_file) Ditto.
5642         (process_active_file_write_case) Pass aux data along.
5643         (close_active_file) Ditto.
5644         (procedure_write_case) Ditto.
5645         (SPLIT_FILE_procfunc) Ditto.
5646
5647         * vfm.h: (typedef write_case_data) New.
5648         (typedef write_case_func) New.
5649         (struct case_stream) Add parameters to `read' member prototype.
5650         
5651 Thu Feb 12 19:24:53 WST 2004 John Darrington <john@darrington.wattle.id.au>
5652
5653         * t-test.q:  Added calculations for independent samples. (But no Levene
5654         test yet!)
5655
5656         * Makefile.am: Moved q_sources_c into own variable 
5657
5658 Wed Feb 11 23:56:51 2004  Ben Pfaff  <blp@gnu.org>
5659
5660         Miscellaneous cleanups.
5661         
5662         * Change unused to UNUSED in many source files to reflect modified
5663         pref.h.  Change use of __WIN32__, __MSDOS, __DJGPP__,
5664         __CYGWIN32__, __unix__, and unix not to assume that they're
5665         defined to a nonzero value.  Change use of __attribute__ to use
5666         NO_RETURN or PRINTF_FORMAT instead.
5667         
5668         * alloc.h: Move definitions for local_alloc(), local_free() here
5669         from ../pref.h.orig and simplify.
5670
5671         * expr-evl.c: Instead of working differently based on PAGED_STACK,
5672         use a pool allocator unconditionally.
5673         (CHECK_STRING_SPACE) Removed.
5674         (ALLOC_STRING_SPACE) Removed.
5675         (expr_evaluate) Use e->pool instead of CHECK_STRING_SPACE and
5676         ALLOC_STRING_SPACE.
5677
5678         * expr-opt.c: (dump_expression) Allocate string pool.
5679
5680         * expr-prs.c: (expr_free) Free string pool.
5681
5682         * pool.c: (pool_destroy) This pool must be removed from its
5683         parent's list of gizmos, not from its own.  Use free_all_gizmos().
5684         (pool_clear) New function.
5685         (free_all_gizmos) New function.
5686         (pool_alloc) Use space in empty block after this one if any.
5687         (pool_release) Only empty out blocks, don't actually free() them.
5688
5689         * print.c: Get rid of PAGED_STACK special case by always
5690         dynamically allocating line buffers.
5691         (struct print_trns) Always include the `line' member.
5692         (internal_cmd_print) Always initialize the `line' member.
5693         (alloc_line) Always allocate memory for `line'.
5694         (print_trns_proc) Always initialize buf from `line' member.
5695         (print_trns_free) Always free `line' memory.
5696
5697         * sort.c: (allocate_file_handles) Special-case MS-DOS for mkdir()
5698         call.
5699         
5700 Wed Feb 11 20:33:18 2004  Ben Pfaff  <blp@gnu.org>
5701
5702         * flip.c: Fixed crash from FLIP when a numeric variable is
5703           specified on NEWNAMES and a large value is used, and a couple of
5704           other minor bugs besides.
5705           (struct varname) Make name a 9-character fixed-size array
5706           instead of a 1-character variable size array.
5707           (make_new_var) Allow digits in variable names.
5708           (flip_stream_write) Limit numeric values to 8 characters and
5709           format system missing and very large and small values more
5710           appropriately.
5711
5712 Thu Feb  5 13:19:06 WAST 2004 John Darrington <john@darrington.wattle.id.au>
5713
5714         * command.c: Fixed test on command return status for the correct 
5715           value,  which had been causing a crash under certain invalid input.
5716
5717 Wed Feb  4 15:34:11 WST 2004 John Darrington <john@darrington.wattle.id.au>
5718
5719         * t-test.q: Added calculations for the one sample variant of the T-TEST
5720
5721 Tue Feb  3 20:09:54 2004  Ben Pfaff  <blp@gnu.org>
5722
5723         * tab.c: (render_strip) Fix bug that sometimes caused joined text
5724           in joined cells to be rendered outside box boundaries.
5725
5726 Tue Feb  3 18:56:45 WST 2004 John Darrington <john@darrington.wattle.id.au>
5727
5728         * random.c (rng_create): Fixed seeding so that it gets reseeded after
5729         SET seed=xx has been called.
5730
5731 Mon Jan 19 14:08:09 2004  Ben Pfaff  <blp@gnu.org> 
5732
5733         * random.c (rng_get_double): Fix always-returning-zero bug in my
5734         preferred way, and at the same time make sure rounding doesn't
5735         bite us.
5736
5737 Thu Jan  1 23:16:41 2004  Ben Pfaff  <blp@gnu.org>
5738
5739         * html.c: (change_attributes) Dead code, removed.
5740         (escape_string) Eliminate code to call change_attributes() that
5741         never actually called it.
5742         (output_tab_table) Get rid of dependence on tab_hit
5743         and struct tab_joined_cell's hit member, which are abominations.
5744
5745         * tab.c: (tab_output_text) Don't call
5746         d->class->text_set_font_by_name if it's a null pointer.
5747         (macro UNROLL_LOOP) Eliminate.
5748         (macro UNROLL_3_LOOPS) Eliminate.
5749         (tabi_render) Rewrite not to use the above macros.
5750
5751 Thu Jan  1 23:09:07 2004  Ben Pfaff  <blp@gnu.org>
5752
5753         Start working on a new output driver system, one that doesn't suck
5754         so much, by adding a "device-independent" output driver.  The idea
5755         is to write out only a single output stream, then use separate
5756         processes to translate them into whatever formats we want.  This
5757         is similar to how "groff" works with its various output drivers
5758         (grops, grotty, grodvi, ...).
5759         
5760         * Makefile.am: (pspp_SOURCES) Add devind.c, devind.h.
5761
5762         * list.q: (write_all_headers) Stub out devind class.
5763         (clean_up) Ditto.
5764         (determine_layout) Ditto.
5765         (list_cases) Ditto.
5766
5767         * output.c: (outp_init) Add devind class.
5768
5769         * devind.c: New file.
5770
5771         * devind.h: New file.
5772
5773 Thu Jan  1 23:08:14 2004  Ben Pfaff  <blp@gnu.org>
5774
5775         * frequencies.q: (hash_value_alpha) Fixed up the previous change
5776         to use the proper string length.
5777
5778 Wed Dec 31 16:27:33 WAST 2003 John Darrington <john@darrington.wattle.id.au>
5779
5780         * Fixed bug where FREQ would crash on alpha values
5781
5782 Tue Dec 30 22:42:57 2003  Ben Pfaff  <blp@gnu.org>
5783
5784         * Removed bletcherous alloca() workarounds for AIX from top of
5785         many files.  AIX can use the alternative alloca() implementation
5786         instead.
5787
5788 Tue Dec 30 22:35:16 2003  Ben Pfaff  <blp@gnu.org>
5789
5790         * ascii.c: (ascii_option) Fix implementation of headers option.
5791
5792 Tue Dec 30 22:32:53 2003  Ben Pfaff  <blp@gnu.org>
5793
5794         * ascii.c: Add a "squeeze" option to the ASCII driver to squeeze
5795         multiple blank lines into one.
5796         (struct ascii_driver_ext) Add squeeze_blank_lines option.
5797         (ascii_preopen_driver) Initialize squeeze_blank_lines.
5798         (static var option_tab) Add squeeze entry.
5799         (ascii_option) Set squeeze_blank_lines.
5800         (output_lines) Implement squeezing blank lines.
5801
5802 Wed Dec 31 07:19:46 WST 2003 John Darrington <john@darrington.wattle.id.au>
5803
5804         * Removed redundant code from output.h
5805
5806 Sat Dec 27 22:17:52 2003  Ben Pfaff  <blp@gnu.org>
5807
5808         Dictionary classes: each variable is "ordinary", "system", or
5809         "scratch".
5810
5811         * var.h: (enum dict_class) New enum.
5812
5813         * vars-prs.c: (dict_class_from_id) New function.
5814         (dict_class_to_name) New function.
5815
5816 Sat Dec 27 22:16:06 2003  Ben Pfaff  <blp@gnu.org>
5817
5818         * var.h: (struct freq_tab_set) Removed (not used).
5819
5820 Sat Dec 27 22:15:21 2003  Ben Pfaff  <blp@gnu.org>
5821
5822         * value-labels.c: (val_labs_destroy) vls needs to be freed too.
5823
5824 Sat Dec 27 22:10:49 2003  Ben Pfaff  <blp@gnu.org>
5825
5826         * stats.c: (hypercube) Rename pow4().  All references updated.
5827
5828 Sat Dec 27 22:05:49 2003  Ben Pfaff  <blp@gnu.org>
5829
5830         * rename-vars.c: (cmd_rename_variables) Rewritten.
5831         (compare_name) Removed.
5832
5833 Sat Dec 27 22:03:51 2003  Ben Pfaff  <blp@gnu.org>
5834
5835         var_set feature, and code taking advantage of it.
5836         
5837         * crosstabs.q: (static var var_dict) Removed.
5838         (static var variables) New variable.
5839         (static var variables_cnt) New variable.
5840         (cmd_crosstabs) Free variables instead of var_dict.
5841         (internal_cmd_crosstabs) Initialize and use variables,
5842         variables_cnt instead of var_dict.
5843         (free_var_dict) Removed.
5844         (crs_custom_tables) Use var_set instead of a copied dictionary.
5845         (crs_custom_variables) Set up variables, variables_cnt instead of
5846         var_dict.
5847         [DEBUGGING] (debug_print) Ditto.
5848
5849         * means.q: (mns_custom_tables) Use var_set instead of a copied
5850         dictionary.
5851
5852         * vars-prs.c: (parse_vs_variable) New function.
5853         (parse_dict_variable) Rewritten.
5854         (parse_variable) Rewritten.
5855         (parse_variables) Renamed parse_var_set_vars(), rewritten.
5856         (parse_variables) New function in terms of parse_var_set_vars().
5857         Now requires its first argument to be non-null.  All references
5858         that passed a null pointer updated to pass default_dict instead.
5859         (macro id_dict) Removed.
5860         (parse_DATA_LIST_vars) Add assertions.
5861         (parse_mixed_vars) Ditto.
5862         (struct var_set) New structure.
5863         (var_set_get_cnt) New function.
5864         (var_set_get_var) New function.
5865         (var_set_lookup_var) New function.
5866         (var_set_destroy) New function.
5867         (dict_var_set_get_cnt) New function.
5868         (dict_var_set_get_var) New function.
5869         (dict_var_set_lookup_var) New function.
5870         (dict_var_set_destroy) New function.
5871         (var_set_create_from_dict) New function.
5872         (struct array_var_set) New structure.
5873         (array_var_set_get_cnt) New function.
5874         (array_var_set_get_var) New function.
5875         (array_var_set_lookup_var) New function.
5876         (array_var_set_destroy) New function.
5877         (var_set_create_from_array) New function.
5878
5879         * q2c.c: (dump_parser) Use parse_variables(default_dict, ...)
5880         instead of parse_variables(NULL, ...) in output code.
5881
5882 Sat Dec 27 21:38:53 2003  Ben Pfaff  <blp@gnu.org>
5883
5884         Change inp_init from a 2-bit vector to an ordinary array.
5885         Initialize it all in cmd_end_input_program() instead of in
5886         create_variable().
5887
5888         * inpt-pgm.c: (enum value_init_type) New enum.
5889         (global var inp_init) Change to `enum value_init_type *', make
5890         static.
5891         (inp_init_size) Removed.
5892         (inp_nval) Change to `size_t', make static.
5893         (cmd_input_program) Don't initialize inp_init or inp_init_size.
5894         (cmd_end_input_program) Initialize inp_init, inp_nval.
5895         (init_case) Rewrite.
5896         (clear_case) Rewrite.
5897
5898         * inpt-pgm.h: Removed.
5899
5900 Sat Dec 27 21:36:38 2003  Ben Pfaff  <blp@gnu.org>
5901
5902         * hash.c: (hsh_hash_bytes) Use Fowler-Noll-Vo hash instead of
5903         Colin Plumb hash.  It is simpler and should better resist
5904         collisions.
5905         (hsh_hash_string) Ditto.
5906
5907 Sat Dec 27 21:34:57 2003  Ben Pfaff  <blp@gnu.org>
5908
5909         * get.c: (export_write_case_func) Remove debug printing code.
5910
5911 Sat Dec 27 21:11:09 2003  Ben Pfaff  <blp@gnu.org>
5912
5913         * get.c: (cmd_save_internal) Rename parameter.  Use &t->h instead
5914         of cast.
5915         (save_write_case_func) Use &trns->h instead of cast.
5916         (cmd_export) Use &t->h instead of cast.
5917
5918 Sat Dec 27 20:57:42 2003  Ben Pfaff  <blp@gnu.org>
5919
5920         Moved vectors into the dictionary.
5921
5922         * var.h: (struct vector) Moved here from vector.h.  `index' member
5923         renamed `idx', `v' renamed `var', `nv' renamed `cnt'.  All
5924         references updated.
5925         
5926         * vector.h: Removed.
5927
5928         * vector.c: (global var vec) Removed.
5929         (global var nvec) Removed.
5930         (cmd_vector) Rewritten.
5931         (find_vector) Removed.
5932
5933         * dictionary.c: (dict_create_vector) New function.
5934         (dict_get_vector) New function, replaces reading global vec[]
5935         array.
5936         (dict_get_vector_cnt) New function, replaces reading global nvec
5937         variable.
5938         (dict_lookup_vector) New function, replaces find_vector().
5939         (dict_clear_vectors) New function.
5940
5941 Sat Dec 27 20:54:01 2003  Ben Pfaff  <blp@gnu.org>
5942
5943         Start to move away from `struct variable' p `union' member to void
5944         * aux member.
5945
5946         * var.h: (struct variable) Add `aux' member.
5947
5948 Sat Dec 27 20:36:25 2003  Ben Pfaff  <blp@gnu.org>
5949
5950         Get rid of struct variable `foo' member.
5951
5952         * frequencies.q: (internal_cmd_frequencies) Use p.frq.used instead
5953         of foo.
5954         (frq_custom_variables) Ditto.
5955         (frq_custom_grouped) Ditto.
5956
5957         * get.c: (struct save_trns) Change `var' member from `int *' to
5958         `struct variable **'.
5959         (cmd_save_internal) Use aux instead of foo.
5960         (save_trns_proc) Use revised `var' member.
5961         (static var mtf_seq_no) Renamed mtf_seq_num.
5962         (static var mtf_seq_nums) New static var.
5963         (cmd_match_files) Initialize mtf_seq_nums.
5964         (mtf_free) Free mtf_seq_nums.
5965         (mtf_processing) Use mtf_seq_nums instead of foo.
5966         (mtf_merge_dictionary) No need to initialize mv->foo.
5967         (cmd_export) Use aux instead of foo.  Use revised `var' member.
5968         (mns_custom_tables) Don't use foo to check for duplicates, that's
5969         what PV_NO_DUPLICATE is for.
5970
5971         * var.h: (struct variable) Remove `foo' member.
5972         (struct frequencies_proc) New member.
5973         
5974 Sat Dec 27 19:46:13 2003  Ben Pfaff  <blp@gnu.org>
5975
5976         Clean up COMPUTE and IF.
5977
5978         * compute.c: More or less rewrite the darn thing.
5979         (struct compute_trns) Rename and reorder and add and delete
5980         members.
5981         (cmd_compute) Rewrite.
5982         (compute_num) Make conditional on test expression.  Now used for
5983         both COMPUTE and IF.
5984         (compute_num_vec) Ditto.
5985         (compute_str) Ditto.
5986         (compute_str_vec) Ditto.
5987         (cmd_if) Rewrite.
5988         (if_num) Removed.
5989         (if_num_vec) Removed.
5990         (if_str) Removed.
5991         (if_str_vec) Removed.
5992         (parse_target_expression) Renamed parse_rvalue_expression(),
5993         rewritten.
5994         (new_trns) Renamed compute_trns_create(), rewritten.
5995         (delete_trns) Removed.
5996         (free_trns) Renamed compute_trns_free(), rewritten.
5997         (struct lvalue) New structure.
5998         (parse_var_or_vec) Renamed lvalue_parse(), rewritten.
5999         (lvalue_get_type) New function.
6000         (lvalue_is_vector) New function.
6001         (lvalue_finalize) New function.
6002         (lvalue_destroy) New function.
6003         
6004 Sat Dec 27 19:44:14 2003  Ben Pfaff  <blp@gnu.org>
6005
6006         * command.def: Disallow MODIFY VARS in input mode, so that
6007         variables can't get dropped and confuse cmd_end_input_program()'s
6008         attempt to fill inp_init[].
6009         
6010         * modify-vars.c: (static var forward_positional_ordering) New
6011         variable.
6012         (struct var_modification) Entirely changed.
6013         (rearrange_dict) Interface changed, rewritten.
6014         (cmd_modify_vars) Deal with modified struct var_modification, much
6015         rewritten.
6016         (struct var_renaming) New structure.
6017         (compare_var_renaming_by_new_name) New function.
6018         (validate_var_modification) New function.
6019
6020         * var.h: (struct modify_vars_proc) Removed.
6021         (struct variable) Removed member p.mfv.
6022
6023 Sat Dec 27 19:40:26 2003  Ben Pfaff  <blp@gnu.org>
6024
6025         Make EVALUATE a valid command whether we're debugging or not, so
6026         that `make check' can succeed regardless of whether debugging is
6027         turned on.
6028         
6029         * command.def: [GLOBAL_DEBUGGING] Drop the #if.
6030
6031         * compute.c: [GLOBAL_DEBUGGING] (cmd_evaluate) Drop the #if.
6032
6033 Sat Dec 27 19:34:40 2003  Ben Pfaff  <blp@gnu.org>
6034
6035         * apply-dict.c: (cmd_apply_dictionary) Replace a ghastly switch
6036         statement by a simple if test.
6037
6038         * dfm.c: (dfm_get_record) Add assertion.
6039
6040 Sat Dec 27 17:51:26 2003  Ben Pfaff  <blp@gnu.org>
6041
6042         For each file x.c, move #include "x.h" to the very top of the
6043         include list, to catch x.h failing to include the proper headers.
6044
6045 Sat Dec 27 17:50:19 2003  Ben Pfaff  <blp@gnu.org>
6046
6047         * algorithm.c: (find) New function.
6048         (remove_equal) New function.
6049         (set_difference) New function.
6050         (adjacent_find_equal) New function.
6051         [TEST_UNIQUE] Removed test case.
6052         (copy_if) Find end test.
6053
6054 Sat Dec 27 17:42:45 2003  Ben Pfaff  <blp@gnu.org>
6055
6056         * dictionary.c: (dict_get_case_weight) New convenience function.
6057
6058         * aggregate.c: (accumulate_aggregate_info) Use
6059         dict_get_case_weight().
6060
6061         * frequencies.q: (calc_general) Ditto.
6062         (calc_integer) Ditto.
6063         (calc) Ditto.
6064
6065         * t-test.q: (groups_calc) Ditto.
6066         (z_calc) Ditto.
6067
6068 Sat Dec 27 17:29:45 2003  Ben Pfaff  <blp@gnu.org>
6069
6070         * glob.c: (global var default_dict) Change from `struct
6071         dictionary' to `struct dictionary *'.  All references changed.
6072         (init_glob) Initialize default_dict with dict_create().
6073
6074 Sat Dec 27 17:06:06 2003  Ben Pfaff  <blp@gnu.org>
6075
6076         struct dictionary now made opaque.  All related functions:
6077
6078         * get.c: (rename_variables) Removed.
6079         (dict_delete_run) Removed.
6080         
6081         * temporary.c: (copy_variable) Removed.
6082         (new_dictionary) Removed.
6083         (save_dictionary) Removed.
6084         (restore_dictionary) Removed.
6085         (free_dictionary) Removed.
6086
6087         * vars-atr.c: (clear_default_dict) Removed.
6088         (find_variable) Removed.
6089         (find_dict_variable) Removed.
6090         (create_variable) Removed.
6091         (delete_variable) Removed.
6092         (common_init_stuff) Removed.
6093         (init_variable) Removed.  Updating of inp_init moved into
6094         cmd_end_input_program().
6095         (replace_variable) Removed.
6096         (rename_variable) Removed.
6097         (clear_variable) Removed.
6098         (dup_variable) Removed.
6099
6100         * vars-prs.c: (is_varname) Removed.
6101         (is_dict_varname) Removed.
6102         (fill_all_vars) Removed.
6103
6104         * vector.c: (find_vector) Removed.
6105
6106         * weight.c: (stop_weighting) Removed.
6107
6108         * dictionary.c: New file.
6109         (dict_create) New, replaces new_dictionary().
6110         (dict_clone) New, replaces save_dictionary() and
6111         restore_dictionary().
6112         (dict_clear) New, replaces clear_default_dict().
6113         (dict_destroy) New, replaces free_dictionary().
6114         (dict_get_var_cnt) New function, replaces references to
6115         dict->nvar.
6116         (dict_get_var) New function, replaces references to dict->var[i].
6117         (dict_get_vars) New function, replaces fill_all_vars().
6118         (dict_create_var) New, replaces create_variable().  Interface
6119         drops `type' parameter, using a zero `width' to designate numeric.
6120         (dict_clone_var) New, replaces dup_variable().
6121         (dict_rename_var) New, replaces rename_variable().
6122         (dict_lookup_var) New, replaces find_variable(),
6123         find_dict_variable(), is_varname().
6124         (dict_contains_var) New function.
6125         (compare_variable_dblptrs) New function.
6126         (dict_delete_var) New function, replaces clear_variable().
6127         (dict_delete_vars) New function, replaces dict_delete_run().
6128         (dict_reorder_vars) New function.
6129         (dict_rename_vars) New function, replaces rename_variables().
6130         (dict_get_weight) New function, replaces reading dict->weight_var.
6131         (dict_set_weight) New function, replaces writing dict->weight_var
6132         or calling stop_weight(dict).
6133         (dict_get_filter) New function, replaces reading dict->filter_var.
6134         (dict_set_filter) New function, replaces writing dict->filter_var.
6135         (dict_get_case_limit) New function, replaces reading dict->N.
6136         (dict_set_case_limit) New function, replaces writing dict->N.
6137         (dict_get_value_cnt) New function, replaces reading dict->nval.
6138         (dict_compact_values) New function, replaces a loop that was
6139         replicated in several places.
6140         (dict_get_split_vars) New function, replaces reading dict->splits.
6141         (dict_get_split_cnt) New function, replaces reading
6142         dict->n_splits.
6143         (dict_set_split_vars) New function, replaces writing dict->splits.
6144         (dict_get_label) New function, replaces reading dict->label.
6145         (dict_set_label) New function, replaces writing dict->label.
6146         (dict_get_documents) New function, replaces reading
6147         dict->documents.
6148         (dict_set_documents) New function, replaces writing
6149         dict->documents.
6150         
6151         All references to above functions updated.
6152         
6153         * aggregate.c: (cmd_aggregate) Copy file label and documents from
6154         old dictionary to new by hand, because dict_create() can't do it
6155         itself.  Use dict_set_documents(), dict_set_split_vars().
6156
6157         * temporary.c: (cancel_temporary) Also set temp_dict to NULL after
6158         calling dict_destroy().
6159
6160         * data-list.c: (dls_var_spec) Remove `type' member, replace by
6161         `width'.
6162         (fixed_parse_compatible) Some slightly nontrivial changes for
6163         dict_create_var().
6164         (dump_fmt_list) Ditto.
6165         (parse_free) Ditto.
6166
6167         * file-type.c: (create_col_var) Ditto.
6168
6169         * get.c: (cmd_get) Use dict_compact_values() instead of a loop.
6170         (trim_dictionary) Use dict_delete_vars(), dict_reorder_vars().
6171         (rename_variables) Use dict_rename_vars().
6172         (mtf_merge_dictionary) Use dict_get_documents(),
6173         dict_set_documents(), dict_compact_values().
6174
6175         * pfm-read.c: (read_variables) Deal with changes to weighting.
6176
6177         * q2c.c: (dump_parser) Use dict_lookup_var() instead of
6178         is_varname() in output code.
6179
6180         * sfm-read.c: (read_header) Use dict_create(), dict_set_label(),
6181         other dictionary functions.
6182
6183         * title.c: (add_document_line) Use dict_get_documents(),
6184         dict_set_documents().
6185
6186         * vars-atr.c: (discard_variables) Use dict_clear(default_dict),
6187         reset default_handle by hand.  dict_clear() will clear vectors so
6188         there's no need for that by hand.
6189
6190         * vfm.c: (close_active_file) Move call to finish_compaction()
6191         earlier, so that we can do the compaction as a single step using
6192         dict_compact_values().  Use dict_clear_vectors().
6193         (finish_compaction) Use dict_delete_var(), dict_compact_values().
6194                 
6195         Some functions don't have replacements:
6196
6197         * vars-atr.c: (force_create_variable) Removed.  All references
6198         updated to dict_create_var() followed by an assertion.
6199         (force_dup_variable) Removed.  All references updated to
6200         dict_clone_var() followed by an assertion.
6201         
6202         * weight.c: (update_weighting) Removed.  No longer necessary, so
6203         all references removed.
6204
6205 Sat Dec 27 16:43:01 2003  Ben Pfaff  <blp@gnu.org>
6206
6207         Clean up AGGREGATE.
6208         
6209         * aggregate.c: Eliminate separation of weighted and unweighted
6210         case.  It made the code too obscure and I doubt it was actually
6211         faster.  Instead, all code uses the "weighted" code, because
6212         that's a generalization of the "unweighted" code.
6213         (FWEIGHT) Removed.
6214         (FOPTIONS) Ditto.
6215         (parse_aggregate_functions) No need to set FWEIGHT.
6216         (accumulate_aggregate_info) Get rid of FWEIGHT cases.
6217         (dump_aggregate_info) Ditto.
6218         (initialize_aggregate_info) No need for special plain_function
6219         that gets rid of FWEIGHT option.
6220
6221         * aggregate.c: Get rid of approximations.
6222         (accumulate_aggregate_info) Don't use approx_gt(), approx_lt(),
6223         approx_in_range().
6224         (aggregate_single_case) Don't use approx_ne().
6225
6226 Sat Dec 27 16:19:36 2003  Ben Pfaff  <blp@gnu.org>
6227
6228         * ascii.c (ascii_line_width): Dead code, removed.
6229
6230         * postscript.c (ps_line_width): Ditto.
6231
6232         * q2c.c (xrealloc): Ditto.
6233
6234         * count.c (internal_cmd_count): Ditto.
6235
6236         * means.q (validate_dependent_endpoint): Ditto.
6237
6238         * set.q: (cmd_gset) Ditto.
6239
6240         * weight.c: [0] (weight_trns_proc) Ditto.
6241
6242 Sat Dec 27 16:18:16 2003  Ben Pfaff  <blp@gnu.org>
6243
6244         Make the code -Wmissing-prototypes clean.
6245
6246         * Makefile.am (version.c): Add #include "version.h".
6247         
6248         * ascii.c: (ascii_open_global) Make static.
6249         (ascii_close_page) Ditto.
6250         (ascii_font_sizes) Ditto.
6251         (ascii_postopen_driver) Ditto.
6252         (ascii_close_driver) Ditto.
6253         (ascii_option) Ditto.
6254         (ascii_open_page) Ditto.
6255         (ascii_line_horz) Ditto.
6256         (ascii_line_vert) Ditto.
6257         (ascii_line_intersection) Ditto.
6258         (ascii_box) Ditto.
6259         (ascii_polyline_begin) Ditto.
6260         (ascii_polyline_point) Ditto.
6261         (ascii_polyline_end) Ditto.
6262         (ascii_text_set_font_by_name) Ditto.
6263         (ascii_text_set_font_by_position) Ditto.
6264         (ascii_text_set_font_by_family) Ditto.
6265         (ascii_text_get_font_name) Ditto.
6266         (ascii_text_get_font_family) Ditto.
6267         (ascii_text_set_size) Ditto.
6268         (ascii_text_get_size) Ditto.
6269         (ascii_text_metrics) Ditto.
6270         (ascii_text_draw) Ditto.
6271         (ascii_close_page) Ditto.
6272
6273         * cmdline.h: New header for parse_command_line().  Used where
6274         needed.
6275
6276         * command.c: Move prototypes for cmd_*() functions to command.h.
6277
6278         * command.h: Prototypes for cmd_*() functions moved here from
6279         command.c.
6280
6281         * crosstabs.q: (gamma_int) Ditto.
6282
6283         * file-handle.h: Add fh_init_files() prototype.
6284         
6285         * getline.c: (welcome) Ditto.
6286
6287         * glob.h: New header for init_glob().  Used where appropriate.
6288
6289         * hash.c: (comparison_helper) Ditto.
6290
6291         * html.c: (html_open_global) Ditto.
6292         (html_close_global) Ditto.
6293         (html_preopen_driver) Ditto.
6294         (html_postopen_driver) Ditto.
6295         (html_close_driver) Ditto.
6296         (html_option) Ditto.
6297         (html_open_page) Ditto.
6298         (html_close_page) Ditto.
6299         (html_submit) Ditto.
6300
6301         * inpt-pgm.c: (input_program_source_read) Ditto.
6302
6303         * output.c: (find_defn_value) Ditto.
6304         (destroy_list) Ditto.
6305
6306         * pfm-read.c: (read_int) Ditto.
6307
6308         * postscript.c: (ps_open_global) Ditto.
6309         (ps_close_global) Ditto.
6310         (ps_font_sizes) Ditto.
6311         (ps_preopen_driver) Ditto.
6312         (ps_postopen_driver) Ditto.
6313         (ps_close_driver) Ditto.
6314         (ps_option) Ditto.
6315         (ps_open_page) Ditto.
6316         (ps_close_page) Ditto.
6317         (ps_line_horz) Ditto.
6318         (ps_line_vert) Ditto.
6319         (ps_line_intersection) Ditto.
6320         (ps_box) Ditto.
6321         (ps_polyline_begin) Ditto.
6322         (ps_polyline_point) Ditto.
6323         (ps_polyline_end) Ditto.
6324         (ps_text_set_font_by_name) Ditto.
6325         (ps_text_set_font_by_position) Ditto.
6326         (ps_text_set_font_family) Ditto.
6327         (ps_text_get_font_name) Ditto.
6328         (ps_text_get_font_family) Ditto.
6329         (ps_text_set_size) Ditto.
6330         (ps_text_get_size) Ditto.
6331         (ps_text_metrics) Ditto.
6332         (ps_text_draw) Ditto.
6333
6334         * q2c.c: (finish_up) Ditto.
6335         (xmalloc) Ditto.
6336         (xstrdup) Ditto.
6337         (get_buffer) Ditto.
6338         (st_lower) Ditto.
6339         (st_upper) Ditto.
6340         (skip_ws) Ditto.
6341         (get_line) Ditto.
6342         (add_symbol) Ditto.
6343         (find_symbol) Ditto.
6344         (lex_get) Ditto.
6345         (force_id) Ditto.
6346         (force_string) Ditto.
6347         (match_id) Ditto.
6348         (match_token) Ditto.
6349         (skip_token) Ditto.
6350         (parse) Ditto.
6351         (parse_setting) Ditto.
6352         (parse_specifier) Ditto.
6353         (parse_specifiers) Ditto.
6354         (parse_subcommand) Ditto.
6355         (dump_specifier_vars) Ditto.
6356         (is_keyword) Ditto.
6357         (make_identifier) Ditto.
6358         (dump_declarations) Ditto.
6359         (dump_specifier_init) Ditto.
6360         (dump_vars_init) Ditto.
6361         (make_match) Ditto.
6362         (dump_specifier_parse) Ditto.
6363         (dump_subcommand) Ditto.
6364         (dump_parser) Ditto.
6365         (dump_header) Ditto.
6366         (dump_free) Ditto.
6367         (recognize_directive) Ditto.
6368
6369         * recode.c: (string_to_long) Ditto.
6370
6371         * repeat.c: (find_DO_REPEAT_substitution) Ditto.
6372
6373         * repeat.h: New header for perform_DO_REPEAT_substitutions, used
6374         where appropriate.
6375
6376         * sort.c: (sort_stream_read) Ditto.
6377         (sort_stream_mode) Ditto.
6378         
6379 Fri Dec 19 23:35:04 2003  Ben Pfaff  <blp@gnu.org>
6380
6381         * algorithm.c (binary_search): Fix comparison.
6382
6383 Fri Dec 19 23:27:45 2003  Ben Pfaff  <blp@gnu.org>
6384
6385         * algorithm.c: (binary_search) Fix assertion.
6386
6387 Fri Dec 19 21:31:48 2003  Ben Pfaff  <blp@gnu.org>
6388
6389         * sysfile-info.c: (compare_vectors_by_name) Rewrite.
6390
6391 Fri Dec 19 21:30:24 2003  Ben Pfaff  <blp@gnu.org>
6392
6393         * sort.c: (compare_case_lists) Rewrite.
6394
6395 Fri Dec 19 16:44:22 2003  Ben Pfaff  <blp@gnu.org>
6396
6397         * quicksort.c: Removed (not used).
6398
6399         * quicksort.h: Removed (not used).
6400
6401         * sort.c: Removed blp_quicksort() prototype.
6402
6403 Fri Dec 19 16:42:13 2003  Ben Pfaff  <blp@gnu.org>
6404
6405         * postscript.c: (int_2_compare) Rewrite.
6406         (compare_line) Rewrite.
6407
6408 Fri Dec 19 16:38:35 2003  Ben Pfaff  <blp@gnu.org>
6409
6410         * matrix-data.c (compare_factors) Use lexicographical_compare()
6411         algorithm.
6412         (compare_doubles) New function.
6413         
6414         * algorithm.c: (lexicographical_compare) New algorithm.
6415
6416 Fri Dec 19 16:23:45 2003  Ben Pfaff  <blp@gnu.org>
6417
6418         * matrix-data.c (compare_variables_by_mxd_vartype): Rewrite.
6419
6420 Fri Dec 19 15:54:45 2003  Ben Pfaff  <blp@gnu.org>
6421
6422         * expr-prs.c: (cmp_func) Removed.
6423         (parse_function) Use binary_search() algorithm.
6424         (compare_functions) New function.
6425         (init_func_tab) Use sort() algorithm.
6426
6427         * algorithm.c: (binary_search) New algorithm.
6428
6429 Fri Dec 19 15:50:45 2003  Ben Pfaff  <blp@gnu.org>
6430
6431         * descript.q: (display) Use sort() algorithm instead of qsort().
6432         (compare_func) Removed.
6433         (descriptives_compare_variables) New function.
6434
6435 Fri Dec 19 15:08:38 2003  Ben Pfaff  <blp@gnu.org>
6436
6437         Get rid of AVL trees.  Hashes are more appropriate for everything
6438         PSPP does.
6439
6440         * Makefile.am: (pspp_SOURCES) Remove avl.c, avl.h.
6441         
6442         * avl.c: Removed.
6443
6444         * avl.h: Removed.
6445
6446 Fri Dec 19 14:33:31 2003  Ben Pfaff  <blp@gnu.org>
6447
6448         Much code can be clarified by using C++ STL-like algorithms.  Not
6449         all uses of these algorithms are listed below, only the ones where
6450         the change to an algorithm was the only change of interest.
6451         
6452         * Makefile.am: (pspp_SOURCES) Add algorithm.c, algorithm.h.
6453         
6454         * algorithm.c: New file.
6455
6456         * algorithm.h: New file.
6457
6458         * modify-vars.c: (static var forward) Removed.
6459         (static var positional) Removed.
6460         (compare_variables) Removed.
6461         (struct ordering) New.
6462         (cmd_modify_vars) Use sort() algorithm.
6463         (compare_variables_given_ordering) New function.
6464         (rearrange_dict) Use sort() algorithm.
6465
6466         * sysfile-info.c: (cmd_display) Use sort() algorithm.
6467         (cmp_var_by_name) Removed.
6468
6469 Fri Dec 19 14:26:17 2003  Ben Pfaff  <blp@gnu.org>
6470
6471         Make file handles use a hash table.
6472         
6473         * file-handle.q: (files) Change to hash table, make static.
6474         (cmd_file_handle) Use hash table functions.
6475         (fh_get_handle_by_filename) Ditto.
6476         (fh_get_handle_by_name) Ditto.
6477         (hash_file_handle) New function.
6478         (cmp_file_handle) Rewrite.
6479         (fh_init_files) Use hash table functions.
6480
6481 Fri Dec 19 14:24:38 2003  Ben Pfaff  <blp@gnu.org>
6482
6483         Clean up FREQUENCIES.
6484         
6485         * Makefile.am: (pspp_SOURCES) Remove frequencies.g.
6486
6487         * frequencies.q: Remove a lot of old #if'd out code at the end.
6488         (internal_cmd_frequencies) Use calc() instead of calc_no_weight()
6489         or calc_weight().  Initialize percentile_values.
6490         (calc) New function based on calc_weight() from frequencies.g.
6491         (precalc) Use hash functions.
6492         (static var comparison_func) Removed.
6493         (static var comparison_param) Removed.
6494         (comparison_helper) Removed.
6495         (get_freq_comparator) New function.
6496         (not_missing) New function.
6497         (add_freq) Removed.
6498         (postprocess_freq_tab) Use hash table functions, algorithms,
6499         get_freq_comparator().  Rewrite.
6500         (cleanup_freq_tab) Rephrase.
6501         (add_percentile) Clean up spacing.
6502         (hash_value_numeric) New function.
6503         (hash_value_alpha) New function.
6504         (compare_value_numeric_a) Rewrite.
6505         (compare_value_alpha_a) Rewrite.
6506         (compare_value_numeric_d) Rewrite.
6507         (compare_value_alpha_d) Rewrite.
6508         (compare_freq_numeric_a) Rewrite.
6509         (compare_freq_alpha_a) Rewrite.
6510         (compare_freq_numeric_d) Rewrite.
6511         (compare_freq_alpha_d) Rewrite.
6512         (calc_stats) Clean up mode, percentiles, max.
6513         (dump_statistics) Clean up spacing.
6514         
6515         * frequencies.g: Removed.
6516
6517         * var.h: (struct freq_tab) Change `data' to hash table.
6518
6519 Fri Dec 19 14:15:46 2003  Ben Pfaff  <blp@gnu.org>
6520
6521         * file-handle.h: Remove declaration of global variable `files',
6522         which wasn't used anywhere.
6523
6524         * postscript.c: (add_encoding) Remove superfluous cast.
6525         (line) Ditto.
6526
6527         * sfm-read.c: [linux] (bswap_int32) Drop ntohl() non-portable
6528         version.
6529
6530         * temporary.c: [0] (display_tree) Removed.
6531
6532 Fri Dec 19 14:13:04 2003  Ben Pfaff  <blp@gnu.org>
6533
6534         Implement a new random number generator based on the alleged RC4
6535         algorithm.
6536
6537         * expr-evl.c: (expr_evaluate) Use rng_get_double_normal() instead
6538         of rand_normal().
6539
6540         * random.c: [!HAVE_GOOD_RANDOM] (real_rand) Removed.
6541         [!HAVE_GOOD_RANDOM] (real_srand) Removed.
6542         (macro k) Removed.
6543         (static var V[]) Removed.
6544         (static var Y) Removed.
6545         (static var X2) Removed.
6546         (setup_randomize) Removed.
6547         (shuffle) Removed.
6548         (rand_uniform) Removed.
6549         (rand_normal) Removed.
6550         (struct rng) New structure.
6551         (rng_create) New function.
6552         (rng_destroy) New function.
6553         (swap_byte) New static function.
6554         (rng_seed) New function.
6555         (rng_get_bytes) New function.
6556         (rng_get_int) New function.
6557         (rng_get_unsigned) New function.
6558         (rng_get_double) New function.
6559         (rng_get_double_normal) New function.
6560         (pspp_rng) New function.
6561
6562         * random.h: Sync up to random.c.
6563
6564         * sample.c: (struct sample_trns) Make `frac' unsigned and a
6565         fraction of UINT_MAX, not 65536.
6566         (cmd_sample) Use rng_get_unsigned(), rng_get_double(), UINT_MAX
6567         fraction.
6568
6569         * vfm.c: (open_active_file) No need to call setup_randomize() any
6570         longer.
6571
6572 Fri Dec 19 12:05:56 2003  Ben Pfaff  <blp@gnu.org>
6573
6574         Change dictionary name indexes to use hash tables instead of AVL
6575         trees.
6576
6577         * crosstabs.q: (free_var_dict) Use hash tables.
6578         (crs_custom_tables) Ditto.
6579         (calc_general) Ditto.
6580         (compare_table_entry) Rewrite.
6581         (enum_var_values) Reorder parameters.  All references updated.
6582         Rewrite.
6583
6584         * get.c: (rename_variable) Use hash tables.
6585         (mtf_merge_dictionary) Ditto.
6586
6587         * glob.c: (init_glob) Use hash tables.
6588         (cmp_variable) Removed.
6589
6590         * means.q: (mns_custom_tables) Use hash tables.
6591
6592         * modify-vars.c: (rearrange_dict) Use hash tables.
6593
6594         * rename-vars.c: (cmd_rename_variables) Use hash tables.
6595
6596         * sfm-read.c: (read_header) Use hash tables.
6597         (read_variables) Ditto.
6598
6599         * temporary.c: (new_dictionary) Use hash tables.
6600         (save_dictionary) Ditto.
6601         (restore_dictionary) Ditto.
6602
6603         * var.h: (struct dictionary) Change AVL tree `var_by_name' into
6604         hash table `name_tab'.
6605
6606         * vars-atr.c: [DEBUGGING] (dump_one_var_node) Removed.
6607         [DEBUGGING] (dump_var_tree) Removed.
6608         (find_variable) Use hash tables.
6609         (find_dict_variable) Ditto.
6610         (common_init_stuff) Ditto.
6611         (rename_variable) Ditto.
6612         (clear_variable) Ditto.  Also, remove debug code.
6613         (dup_variable) Use hash tables.
6614
6615         * vars-prs.c: (fill_all_vars) Use hash tables.
6616         (is_dict_varname) Ditto.
6617         (parse_dict_variable) Ditto.
6618         
6619 Fri Dec 19 11:46:23 2003  Ben Pfaff  <blp@gnu.org>
6620
6621         Change value labels to use hash tables instead of AVL trees, and
6622         change value labels into an ADT.
6623
6624         * Makefile.am: (pspp_SOURCES) Add value-labels.c, value-labels.h.
6625         
6626         * value-labels.c: New file.
6627
6628         * value-labels.h: New file.
6629
6630         * apply-dict.c: (cmd_apply_dictionary) Use value label ADT.
6631         Get rid of a stupid use of goto.
6632
6633         * autorecode.c: (compare_alpha_value) Rewrite.
6634         (hash_alpha_value) Ditto.
6635         (compare_numeric_value) Rewrite.
6636         (hash_numeric_value) Ditto.
6637
6638         * frequencies.q: (dump_full) Use value label ADT.
6639
6640         * pfm-read.c: (read_value_label) Use value label ADT.
6641
6642         * pfm-write.c: (write_value_labels) Use value label ADT.
6643
6644         * sfm-read.c: (read_variables) Use value label ADT.
6645         (read_value_labels) Rewrite.
6646
6647         * sfm-write.c: (write_value_labels) Rewrite.
6648
6649         * sysfile-info.c: (cmd_sysfile_info) Use value label ADT.
6650         (display_variables) Ditto.
6651         (describe_variable) Ditto.
6652
6653         * t-test.q: (print_t_groups) Use value label ADT.
6654
6655         * temporary.c: (copy_variable) Use value label ADT.
6656         (free_dictionary) Ditto.
6657
6658         * val-labs.c: (verify_val_labs) Use value label ADT.
6659         (get_label) Ditto.
6660         (debug_print) Ditto.
6661         (val_lab_cmp) Removed.
6662         (inc_ref_count) Removed.
6663         (copy_value_labels) Removed.
6664
6665         * var.h: (struct value_label) Removed.
6666         (struct variable) Change AVL tree `val_lab' into hash table
6667         `val_labs'.
6668
6669         * vars-atr.c: (init_variable) Use value label ADT.
6670         (clear_variable) Ditto.
6671         (free_value_label) Removed.
6672         (free_val_lab) Removed.
6673         (get_val_lab) Removed.
6674         (compare_variables) New function.
6675         (hash_variable) New function.
6676
6677         * vfm.c: (dump_splits) Use value label ADT.
6678
6679 Fri Dec 19 11:18:11 2003  Ben Pfaff  <blp@gnu.org>
6680
6681         Add to the hash table interface.
6682
6683         * hash.c: (hsh_hash_bytes) Add assertion.
6684         (hsh_hash_string) Ditto.
6685         (hsh_clear) Ditto.
6686         (hsh_rehash) Ditto.
6687         (hsh_probe) Ditto.
6688         (hsh_create) Ditto.  Also make minimum `size'.
6689         (hsh_destroy) Rephrase.
6690         (sort_nulls_last) Removed.
6691         (not_null) New function.
6692         (hsh_data) Ditto.
6693         (comparison_helper) Ditto.
6694         (hsh_sort) Rewritten.
6695         (hsh_data_copy) New function.
6696         (hsh_sort_copy) Ditto.
6697         (hsh_insert) Ditto.
6698         (hsh_replace) Ditto.
6699         (hsh_hash_double) Ditto.
6700         (hsh_delete) Fix stupid bug.
6701         
6702 Thu Dec 18 12:27:03 WAST 2003 John Darrington <john@darrington.wattle.id.au>
6703         * added a calculation of the mode to FREQUENCIES
6704
6705 Wed Dec 17 12:53:01 WAST 2003 John Darrington <john@darrington.wattle.id.au>
6706
6707         * moved (un)defs of DEBUGGING to config.h
6708
6709 Mon Dec 15 21:35:59 2003  Ben Pfaff  <blp@gnu.org>
6710
6711         * groff-font.c: (add_kern) Fix indentation.
6712         (add_kern) Use & instead of % to take power-of-2 modulus.
6713         (font_get_kern_adjust) Likewise.
6714
6715 Fri Dec 12 23:54:37 2003  Ben Pfaff  <blp@gnu.org>
6716
6717         * autorecode.c: (recode) Replace stupid use of memcpy() by
6718         memberwise copy.
6719         (hash_alpha_value) Use hsh_hash_bytes().  Get rid of nasty casts.
6720         (hash_numeric_value) Ditto.
6721         (autorecode_proc_func) pool_strdup() was wrong here because the
6722         source string was not null-terminated.  Use new pool_strndup()
6723         instead.
6724
6725         * crosstabs.q: (enum_var_values) Remove superfluous and bizarre
6726         use of hsh_iterator_init().
6727
6728         * data-in.c: (parse_N) Initialize i->v->f.
6729
6730         * flip.c: (cmd_flip) Use memmove(), not memcpy(), to copy
6731         overlapping arrays.
6732
6733         * groff-font.c: Use power-of-2 hash table sizes, not prime.
6734         (groff_read_font) Don't call hsh_next_prime().  Don't call
6735         fclose(NULL).
6736         (static var hash) Remove `size_p', `max_used' members.
6737         (font_char_name_to_index) Don't call hsh_next_prime().  Use
6738         hsh_hash_string() instead of hashpjw(), & instead of %.
6739         (default_font) Don't call hsh_next_prime().
6740
6741         * pool.c: (pool_strndup) New function.
6742         (pool_strdup) Reimplement in terms of pool_strndup.
6743
6744         * postscript.c: (hash_font_entry) Use hsh_hash_string().  Get rid
6745         of nasty casts.
6746         (hash_ps_encoding) Use hsh_hash_string().
6747         (hash_ps_combo) Use hsh_hash_string(), hsh_hash_int().
6748         (hash_filename2font) Use hsh_hash_string().
6749
6750         * som.c: Add #include <stdlib.h>.
6751
6752         * tab.c: (tab_destroy) Don't set t->container after freeing `t'
6753         (by destroying its pool).
6754         
6755 Fri Dec 12 23:18:59 2003  Ben Pfaff  <blp@gnu.org>
6756
6757         Miscellaneous hash table code cleanup:
6758         
6759         * hash.h: (struct hsh_table) Moved into hash.c.
6760         (hsh_count) Ditto, and transformed into function.
6761         (hsh_compare_func) New typedef, used for defining otherwise-long
6762         function types here and in hash.c
6763         (hsh_hash_func) Ditto.
6764         (hsh_free_func) Ditto.
6765         
6766         * hash.c: (struct hsh_table) Renamed `n' to `used', `m' to `size',
6767         `table' to `entries'.  Removed `mp'.  All references updated.
6768         (hsh_clear) Don't shrink entries array; if the hash was this big
6769         once, it probably will be again.
6770         (hsh_rehash) Made static.
6771         (force_hsh_insert) Renamed hsh_force_insert.
6772         (force_hsh_find) Renamed hsh_force_find.
6773
6774         Made hash table sizes powers of 2, because that's fine with any
6775         reasonable hash function and because taking a power-of-2 modulus
6776         is faster than any other:
6777         
6778         (hsh_prime_tab) Removed;
6779         (hsh_next_prime) Ditto.
6780         (next_power_of_2) New function.
6781         (hsh_create) Use next_power_of_2.
6782         (hsh_rehash) Use & instead of %.
6783
6784         Cleaned up hsh_sort:
6785         
6786         (internal_comparison_fn) Removed.
6787         (sort_nulls_last) New function.
6788         (hsh_sort) Removed second parameter, switched to using the new
6789         quicksort() function from quicksort.h to avoid using nasty need
6790         for static variables with qsort().  All references updated.
6791
6792         Changed the hash functions offered, because there are better hash
6793         functions than the ones we had, and cleaned up the names to boot:
6794         
6795         * hash.c: (hashpjw_d) Removed.
6796         (hashpjw) Ditto.
6797         (hsh_hash_bytes) New function.
6798         (hsh_hash_string) New function.
6799         (hsh_hash_int) New function.
6800
6801         Improved the hash table iteration interface:
6802         
6803         * hash.h: (hsh_iterator_init) Removed.
6804         (struct hsh_iterator) Removed `init' member, change `next' to
6805         size_t.
6806
6807         * hash.c: (hsh_foreach) Removed.  All references updated to use
6808         hsh_first/hsh_next instead.
6809         (hsh_first) New function.  Notably, unlike hsh_foreach() it does
6810         not treat a null pointer as an empty hash table.
6811         (hsh_next) New function.
6812
6813         Made deletion possible, though slow:
6814
6815         * hash.c: (locate_matching_entry) New function.
6816         (hsh_find) Use locate_matching_entry().
6817         (hsh_delete) New function also using locate_matching_entry().
6818         (hsh_force_delete) New function.
6819
6820 Fri Dec 12 23:16:10 2003  Ben Pfaff  <blp@gnu.org>
6821
6822         * quicksort.c: New file implementing a sort routine with a
6823         interface better than qsort() because it passes a user-provided
6824         parameter to the sort routine.
6825
6826         * Makefile.am: Add quicksort.c, quicksort.h.
6827
6828 Fri Dec 12 13:31:58 2003  Ben Pfaff  <blp@gnu.org>
6829
6830         * All source files: Get rid of nasty special cases for Checker,
6831         which is pretty obsolete now.
6832
6833 Thu Dec 11 21:38:24 WST 2003 John Darrington <john@darrington.wattle.id.au>
6834
6835         * Fixed a bug apparent when using the FREQUENCIES command with the
6836         html driver.  The html driver was incorrectly trying to display 
6837         empty cells.
6838
6839 Sun Jan  2 21:40:13 2000  Ben Pfaff  <blp@gnu.org>
6840
6841         * Makefile.am: Reorganized.  Put locale dir in version.c instead
6842         of passing it to each compile command.  Only put local gmp libs in
6843         LD_ADD if not installed on system.  Remove `boast' target.
6844
6845         * All source files: struct and union typedefs eliminated.
6846         `sizeof type' replaced by `sizeof object' where practical.  Moved
6847         `unused' qualifiers from start to end of declarations for gcc
6848         2.7.2 compatibility.  Change `while (1)' to `for (;;)'.  Made
6849         assertions on pointers strictly compliant.  Removed _ prefixes on
6850         some function parameter names.
6851
6852         * alloc.c: New source file, containing these external linkage
6853         functions removed from common.c: xmalloc, xcalloc, xrealloc,
6854         xstrdup.
6855
6856         * arena.c: Removed.
6857         
6858         * arena.h: Removed.
6859
6860         * ascii.c: Migrated from arenas to pools.
6861         (struct ascii_driver_ext) ops[], box[], fonts[] changed from
6862         c_string to len_string.  All references changed.
6863         (ascii_option) Signature changed to comply to new output.c
6864         interface.
6865         (count_fancy_chars) Removed.
6866         (delineate) Removed support for rich text.
6867         (ascii_text_metrics) Ditto.
6868         (text_draw) Ditto.
6869         (output_shorts) Change `box', `off', `on' from c_string to
6870         len_string.  Change `remaining' from int to size_t.
6871         (ascii_close_page) Make page numbering less haphazard.
6872
6873         * autorecode.c: Migrate from arenas to pools.
6874
6875         * avl.c: Migrate from arenas to pools.  Synch from libavl 1.4.0.
6876
6877         * bitvector.h: New file containing these macros from misc.h:
6878         SET_BIT, CLEAR_BIT, SET_BIT_TO, TEST_BIT, BIT_INDEX.
6879
6880         * command.c: (struct command) cmd1, cmd2, cmd3 members changed to
6881         word[3].  ncmd removed.
6882         (var empty_string) Removed.
6883         (var cmd_table) Declaration updated.
6884         (var cmdtab) Removed.
6885         (cmp_command) Removed.
6886         (split_words) Rewritten to use strtok_r().
6887         (init_cmd_parser) Renamed cmd_init().  Rewritten.
6888         (find_command) Removed.
6889         (FILE_TYPE_okay) Rewritten.
6890         (cmd_parse) Rewritten.  Semantics of the return value of command
6891         handlers has changed: they must now return one of the new CMD_*
6892         enumerals, rather than a magic value.  This meant that all
6893         commands had to be modified, and they were.
6894         (figure_out_command) New function.
6895
6896         * command.def: Add CORRELATIONS, PEARSON CORRELATIONS.  Add
6897         #defines for INIT, INPU, etc.
6898
6899         * command.h: New CMD_* enum series.
6900         (cur_proc) Make const char *, not char *.
6901         (cmd_init) Prototype.
6902         (cmd_parse) Ditto.
6903
6904         * common.c: Removed.
6905
6906         * common.h: Removed.
6907
6908         * correlations.q: New file.
6909
6910         * crosstabs.q: Migrate from arenas to pools.  Migrate to new-style
6911         q2c.
6912         (custom_tables) Renamed crs_custom_tables().
6913         (custom_variables) Renamed crs_custom_variables().
6914         (calc_integer) Add in some `const' qualifiers.
6915         (table_value_missing) Change from a_string to len_string.
6916         (float_M_suffix) Change from a_string to len_string.
6917
6918         * data-in.c: Rewritten.  All references to
6919         parse_string_as_format() changed to data_in().
6920
6921         * data-in.h: New file.
6922
6923         * data-list.c: Change DLS_* from #define's to enums.  Move from
6924         rpd_msg() to tmsg().
6925         (RPD_ERR) New #define.
6926         (do_reading) Change dfm_push_cust() to dfm_push(), pop_cust() to
6927         dfm_pop().
6928         (read_from_data_list_fixed) Change from old
6929         parse_string_as_format() to new data_in().
6930         (read_from_data_list_free) Ditto.
6931         (read_from_data_list_list) Ditto.
6932         (cmd_repeating_data) Modify approach to checking for end of
6933         command.
6934         (rpd_msg) Removed.
6935         (rpd_parse_record) Change from old parse_string_as_format() to new
6936         data_in().  Change from old convert_format_to_string() to new
6937         data_out().
6938         (read_one_set_of_repetitions) Change dfm_push_cust() to
6939         dfm_push(), pop_cust() to dfm_pop().
6940
6941         * data-out.c: Rewritten.  All references to
6942         convert_format_to_string() changed to data_out().
6943
6944         * descript.q: Migrate to new q2c.
6945         (cmd_descriptives) Removed.
6946         (internal_cmd_descriptives) Renamed cmd_descriptives ().
6947         (custom_variables) Renamed dsc_custom_variables().
6948
6949         * dfm.c: (struct dfm_fhuser_ext) `ln' removed.  All references
6950         removed.
6951         (open_file_r) Initialize h->where.line_number.  Migrate to new
6952         struct string.
6953         (open_file_w) Initialize h->where.line_number.
6954         (read_record) Change from ext->ln to h->where.line_number.
6955         Migrate to struct string.
6956         (dfm_put_record) Rephrased.
6957         (dfm_push_cust) Renamed dfm_push(), rewritten.
6958         (dfm_pop) New function.
6959
6960         * error.c: All references updated.
6961         (glob var error_count) Renamed err_err_count.
6962         (glob var warning_count) Renamed err_warning_count.
6963         (glob var error_already_flagged) Renamed err_already_flagged.
6964         (glob var verbosity) Renamed err_verbosity.
6965         (glob var cust_fn) Removed.
6966         (glob var cust_ln) Removed.
6967         (static var file_loc) New.
6968         (static var nfile_loc) New.
6969         (static var mfile_loc) New.
6970         (tmsg) New function.
6971         (push_cust) Removed.
6972         (pop_cust) Removed.
6973         (msg) Rewritten.
6974         (static var terminating) Removed.
6975         (failure) Renamed err_failure().
6976         (hcf) Renamed err_hcf().
6977         (err_push_file_locator) New function.
6978         (err_pop_file_locator) New function.
6979         (err_location) New function.
6980         (check_error_count) Renamed err_check_count().
6981         (vmsg) Renamed err_vmsg().  Interface changed.
6982         (verbose_msg) Removed.
6983         (err_cond_fail) New function.
6984         (error_break) Renamed err_break().
6985
6986         * error.h: All references updated.
6987         (enum MSG_CLASS_COUNT) Renamed ERR_CLASS_COUNT.
6988         (enum ERR_CLASS_MASK, ERR_VERBOSITY_SHIFT, ERR_VERBOSITY_MASK)
6989         New.
6990         (struct file_locator) New.
6991         (struct error) New.
6992         (macro verbose_msg) Removed.
6993         (macro cond_fail) Removed.
6994
6995         * expr-opt.c: (evaluate_tree) sizeof(char) == 1.
6996
6997         * expr-prs.c: Reorganized.  All references updated.
6998         (exprtypename) Renamed expr_type_name().
6999         (typename) Renamed type_name().
7000         (free_expression) Renamed expr_free().
7001         (parse_expression) Renamed expr_parse().  Uses new type_check()
7002         function.
7003         (init_functab) Renamed init_func_tab().
7004         (type_check) New function.
7005         (parse_or) Rewritten to use new allocate_nonterminal() and
7006         append_nonterminal_arg() functions.
7007         (parse_and) Ditto.
7008         (parse_not) Ditto.
7009         (parse_rel) Ditto.  Also simplified logic.
7010         (parse_add) Ditto.
7011         (parse_mul) Ditto.
7012         (parse_neg) Ditto.
7013         (parse_exp) Ditto.
7014         (SYSMIS_func) Ditto.
7015         (VALUE_func) Rephrased.
7016         (CONCAT_func) Fix memory leak by replacing free by free_node on
7017         lossage.
7018         (generic_str_func) Ditto.
7019         (parse_function) Ditto.  Also rephrasings.  Uses bsearch() to find
7020         function.
7021         (allocate_nonterminal) New function.
7022         (append_nonterminal_arg) New function.
7023         (static func_tab[]) Now at file level.
7024         (cmp_func) Moved.
7025         (init_func_tab) Moved.  Now just uses qsort() to sort func_tab[].
7026
7027         * expr.h: (enum series OP_*) Moved to exprP.h.
7028         (OP_* defines) Ditto.
7029         (struct op_desc) Ditto.
7030         (global ops[]) Ditto.
7031         (struct num_con_node) Ditto.
7032         (struct str_con_node) Ditto.
7033         (struct var_node) Ditto.
7034         (struct lag_node) Ditto.
7035         (struct casenum_node) Ditto.
7036         (struct nonterm_node) Ditto.
7037         (union any_node) Members renamed.
7038         (struct sys_node) Removed.
7039         (struct val_node) Removed.
7040         (operator typedef) Removed.
7041         (typedef exprtype) Removed.
7042         (enum series EX_*) Moved to exprP.h.
7043         (struct expression) Ditto.  Also renamed a lot of the members.
7044         (PXP_* defines) Changed to enums.
7045         (free_node prototype) Moved to exprP.h.
7046
7047         * file-handle.h: (struct file_handle) New member `where'.
7048
7049         * file-handle.q: Migrated to new q2c format.
7050         (prepend_current_directory) Removed (dead code).
7051         (cmd_file_handle) Incorporated all of internal_cmd_file_handle().
7052         (fh_get_handle_by_filename) Removed dead code.
7053         Set new `where' member.
7054
7055         * file-type.c: (file_type_source_read) References to
7056         parse_string_as_format() changed to data_in().
7057         dfm_push_cust()/pop_cust() changed to dfm_push()/dfm_pop().
7058
7059         * filename.c: All references updated.
7060         (init_filename) Renamed fn_init().
7061         (expand_line) Removed.
7062         (macro EXPAND_LINE) Removed.
7063         (interp_vars) Renamed fn_interp_vars().  Now uses st_*() instead
7064         of custom functions.
7065         (gnu_getcwd) Renamed fn_get_cwd(), rewritten.
7066         (tilde_expand) Renamed fn_tilde_expand(), uses ds_*().
7067         (normalize_filename) Renamed fn_normalize().
7068         (search_path) Renamed fn_search_path(), rewritten.
7069         (prepend_dir) Renamed fn_prepend_dir().
7070         (blp_getenv) Renamed fn_getenv().
7071         (blp_dirname) Renamed fn_dirname().
7072         (fn_basename) New function, not used.
7073         (absolute_filename_p) Renamed fn_absolute_p().
7074         (is_special_filename) Renamed fn_special_p().
7075         (file_exists) Renamed fn_exists_p().
7076         (readlink_malloc) Renamed fn_readlink().
7077         (getenv_default) Renamed fn_getenv_default().
7078         (open_file) Renamed fn_open().
7079         (close_file) Renamed fn_close().
7080         (open_file_ext) Renamed fn_open_ext().
7081         (close_file_ext) Renamed fn_close_ext().
7082
7083         * font.h: Migrate from arenas to pools.
7084
7085         * format.c: (parse_format_specifier_name) Deal with ds_* strings.
7086
7087         * frequencies.g: Migrate from arenas to pools.
7088
7089         * frequencies.q: Migrate to new q2c version.  Migrate from arenas
7090         to pools.
7091
7092         * getline.c: All references updated.
7093         (global getl_buf) Changed from char * to struct string.
7094         (static getl_include_path) Ditto.
7095         (global getl_buf_len) Removed.
7096         (global getl_buf_size) Removed.
7097         (getl_include_path) Deal with new getl_buf, getl_include_path.
7098         (getl_uninitialize) New function.
7099         (getl_get_current_directory) Rewritten.
7100         (getl_clear_include_path) Rewritten.
7101         (getl_add_include_dir) Rewritten.
7102         (getl_add_file) Assertion fixed.
7103         (getl_add_virtual_file) Change initial value of `remaining_loops'
7104         from 2 to 1.
7105         (welcome) Rewritten.
7106         (handle_line_buffer) Make static.  Change logic to make
7107         getl_add_virtual_file() change sensible.  Use ds_*() strings.
7108         (getl_read_line) Use ds_*() strings.  Implement SET ECHO.
7109         (getl_close_file) Moved.
7110         (getl_location) New function.
7111
7112         * getline.h: All references updated.
7113         (macro curln) Removed.
7114         (macro curfn) Removed.
7115         (macro am_interactive) Renamed getl_am_interactive.
7116         (macro am_reading_script) Renamed getl_reading_script.
7117
7118         * glob.c: (global fmt_parse_ignore_error) Removed.
7119         (init_glob) Use locale_dir not LOCALEDIR.  Use feholdexcept() on
7120         systems that support it (C99).  Turn off SET ECHO by default.  No
7121         necessary julcal initialization anymore.
7122
7123         * groff-font.c: Migrate from arenas to pools.
7124         (groff_read_font) Use err_push_file_locator().
7125         (groff_read_DESC) Ditto.
7126         (font_msg) Use tmsg().
7127
7128         * hash.c: (hsh_sort) Fix debug code.
7129         [GLOBAL_DEBUGGING] Include stdio.h.
7130
7131         * hash.h: (macro force_hsh_insert) Rephrase.
7132
7133         * heap.c: Rewritten.
7134         
7135         * heap.h: Rewritten.
7136
7137         * html.c: (html_option) Change from outp_value to struct string.
7138         (postopen) Change from curfn to getl_location().
7139         (escape_string) Remove rich-text code.  Signature changed.
7140         (output_tab_table) Switch from a_string to struct len_string.
7141         Remove rich text support.
7142
7143         * lexer.c: All references updated.  Largely rewritten.  Major
7144         changes listed below.  Removed tagged quote support.  Adapted to
7145         struct string tokstr.
7146         (global tokstr) Changed to struct string.
7147         (global tokstr_size) Removed.
7148         (global tokstr_len) Removed.
7149         (global tokid) New.
7150         (global tokint) Removed.
7151         (global toklongstr) Removed.
7152         (C* defines) Removed.
7153         (static tbl[]) Removed.
7154         (static id[]) Removed.
7155         (static une[]) Removed.
7156         (discard_line) Renamed lex_discard_line().
7157         (get_entire_line) Renamed lex_entire_line().
7158         (get_rest_of_line) Renamed lex_rest_of_line().
7159         (get_dotted_rest_of_line) Merged into lex_rest_of_line().
7160         (make_hexit) Removed.
7161         (syntax_error) Renamed lex_error().  Return value removed.
7162         (get_token_representation) Renamed lex_token_representation().
7163         (putback) Renamed lex_put_back().
7164         (putfwd) Renamed lex_put_forward().
7165         (convert_negative_to_dash) Renamed lex_negative_to_dash().
7166         (set_prog) Renamed lex_set_prog().
7167         (init_lex) Renamed lex_init().
7168         (reset_eof) Renamed lex_reset_eof().
7169         (lookahead) Renamed lex_look_ahead().
7170         (check_id) Rewritten.
7171         (yylex) Renamed lex_get(), rewritten.
7172         (lex_end_of_command) New function.  Many commands were rephrased
7173         using this.
7174         (lex_integer_p) New function.  Replaces compare of tokint against
7175         NOT_LONG.
7176         (lex_integer) New function.  Replaces tokint.
7177         (match_tok) Renamed lex_match().
7178         (match_id) Renamed lex_match_id().
7179         (match_int) Renamed lex_match_int().
7180         (force_match_id) Renamed lex_force_match_id(), added return value.
7181         (force_match) Renamed lex_force_match(), added return value.
7182         (force_string) Renamed lex_force_string(), added return value.
7183         (force_int) Renamed lex_force_int(), added return value.
7184         (lex_id_match_len) New function.
7185         (id_match) Renamed lex_id_match(), rewritten.
7186         (get_line) Renamed lex_get_line().
7187         (preprocess_line) Renamed lex_preprocess_line().
7188         (tokname) Renamed lex_token_name().
7189         (bin_value_func) Removed.
7190         (oct_value_func) Removed.
7191         (hex_value_func) Removed.
7192         (unexpected_eof) New function.
7193         (convert_numeric_string_to_char_string) New function.
7194         (parse_string) Rewritten, signature changed.
7195         (add_tokstr_char) Removed.
7196         (add_tokstr_unsigned) Removed.
7197         (add_tokstr_string) Removed.
7198         (parse_tagged_quote) Removed.
7199         (skip_comment) Renamed lex_skip_comment().
7200
7201         * lexer.h: All references updated.
7202         (macro is_id1) Renamed CHAR_IS_ID1.
7203         (macro is_idn) Renamed CHAR_IS_IDN.
7204         (token names ID, NUM, STRING, STOP, ... WITH, EXP) Renamed with
7205         prefix T_: T_ID, T_NUM, T_STRING, T_STOP, ... T_WITH, T_EXP.
7206         (macro get_token) Removed.
7207         (macro id_match) Removed.
7208         (macro force_match_id) Removed.
7209         (macro force_match) Removed.
7210         (macro force_string) Removed.
7211         (macro force_int) Removed.
7212         (macro force_num) Removed.
7213         (macro force_id) Removed.
7214
7215         * lexerP.h: Removed.
7216
7217         * list.q: Migrated to new q2c format.
7218         (write_line) Deal with struct len_string.
7219         (write_varname) Ditto.
7220         (write_fallback_headers) Ditto.
7221
7222         * magic.c: New file, incorporating the following global variables
7223         previously in other files: endian, second_lowest_value.  And both
7224         of those are conditional on #define's.
7225
7226         * magic.h: New file, incorporating the following global variable
7227         declarations: endian, second_lowest_value, and the following macro
7228         declarations: NOT_DOUBLE, NOT_LONG, NOT_INT.
7229
7230         * main.c: Added declarations of pgmname, finished, curdate,
7231         start_interactive.
7232         (main) Call new parse_script() function.
7233         (parse_script) New function.
7234         (execute_command) New function.
7235         (dump_token) Removed.
7236         (handle_error) New function.
7237
7238         * matrix.c: New file.
7239
7240         * matrix.h: New file.
7241
7242         * matrix-data.c: Migrated from arenas to pools.
7243         (mget_token) Change from parse_string_as_format() to data_in().
7244
7245         * means.q: Migrate to new q2c.
7246         (custom_tables) Renamed mns_custom_tables().
7247         (custom_crossbreak) Renamed mns_custom_crossbreak().
7248         (custom_variables) Renamed mns_custom_variables().
7249
7250         * mis-val.c: (static var width) Changed from `int' to `size_t'.
7251         (parse_varnames) Prototype.
7252         (parse_numeric) Rephrasings.
7253         (parse_alpha) Adapt to new struct string tokstr.
7254
7255         * misc.c: (intlog10) Rewritten.
7256         (spacing) Removed.
7257         (ansi_rand) Renamed real_rand(), moved into random.c.
7258         (ansi_srand) Renamed real_srand(), moved into random.c.
7259         (setup_randomize) Moved to random.c.
7260         (rand_uniform) Ditto.
7261         (rand_normal) Ditto.
7262         (rand_simple) Ditto.
7263         (get_config_line) Removed.
7264         (reverse) Removed (dead code).
7265
7266         * misc.h: (macro SET_BIT) Moved to bitvector.h.
7267         (macro CLEAR_BIT) Ditto.
7268         (macro TEST_BIT) Ditto.
7269         (macro SET_BIT_TO) Ditto.
7270         (macro BIT_INDEX) Ditto.
7271
7272         * output.c: (outp_read_devices) Move to err_push_file_locator()
7273         from push_cust().  Use struct string.
7274         (expand_op_tokstr) Removed.
7275         (static var op_tokstr) Changed to struct string.
7276         (static var op_tokstr_size) Removed.
7277         (tokener) Rephrasings.  Use struct string.
7278         (parse_options) Use struct string.
7279         (destroy_driver) Fix assertion.
7280         (outp_get_paper_size) Move to err_push_file_locator().
7281         [0] Removed dead code.
7282         (outp_string_width) Move to len_string.
7283
7284         * output.h: Comment fixes.
7285         (TAG_* enum series) Removed.
7286         (struct outp_value) Removed.
7287         (enum OUTP_T_FANCY) Removed.
7288         (struct outp_text) `s' changed from a_string to len_string.
7289         (struct outp_class) `option' change arg 3 from outp_value to
7290         struct string.
7291
7292         * pfm-read.c: (corrupt_msg) Rewritten.
7293
7294         * pfm-write.c: (bufwrite) Fix assertion.
7295
7296         * pool.c: New file, reference version.
7297
7298         * pool.h: New file, reference version.
7299
7300         * postscript.c: (ps_font_sizes) Fix assertion.
7301         (ps_option) Change arg 3 from outp_value to struct string.
7302         Adapt to struct string.
7303         (macro output_line) Removed.
7304         (macro add_string) Removed.
7305         (output_encodings) Adapted to struct string.  Moved to
7306         err_push_file_locator().
7307         (find_encoding_file) Fix assertion.
7308         (read_ps_encodings) Move to err_push_file_locator().
7309         (postopen) Use getl_location() instead of curfn.
7310         (out_text_plain) Move to len_string.
7311         (text) Ditto.  Remove rich text support.
7312
7313         * print.c: (cmd_print) Remove now-unneeded resource cleanup code.
7314         (cmd_print_eject) Ditto.
7315         (cmd_write) Ditto.
7316         (internal_cmd_print) Now cleans up after itself.  Uses
7317         fh_parse_file_handle() now.
7318         (cmd_print_space) Use PXP_NUMERIC to type-check.
7319
7320         * q2c.c: Overhauled.  Removed _("") i18n support.  All references
7321         updated.  All output functions updated to handle structures rather
7322         than local or static variables.  Adapt to new PSPP lex_*()
7323         functions.
7324         (macro _) Removed.
7325         (macro N_) Removed.
7326         (macro MAX_N_SBC) Removed.
7327         (global bare) Removed.
7328         (enum STRING) Renamed T_STRING.
7329         (enum ID) Renamed T_ID.
7330         (get_buffer) Buffer size increased.
7331         (strlower) Renamed st_lower(), rephrased.
7332         (strupper) Renamed st_upper(), rephrased.
7333         (skip_ws) New function.
7334         (get_line) Don't special-case any types of lines (like those
7335         beginning with ! or $, for instance).
7336         (get_token) Renamed lex_get().  Rephrased.
7337         (static var `prefix') New.
7338         (parse) New function.
7339         (parse_setting) Minor rephrasing.
7340         (dump_specifier_vars) Ditto.
7341         (make_identifier) Put null terminator on identifier, duh.
7342         (dump_vars) Renamed dump_declarations().  Never indent.  Never
7343         static.  Output changed entirely.
7344         (dump_specifier_init) Rephrase.
7345         (dump_vars_init) No index variable needed.  Other modifications.
7346         (dump_parser) Don't parse command name.  Do dump functions instead
7347         of just code fragments.
7348         (dump_free) Dump function instead of code fragment.
7349         (recognize_directive) New function.
7350         (main) Use recognize_directive().  Don't rely on magic $ line
7351         beginning: instead, parse comments.  Update list of headers.
7352
7353         * random.c: New file, containing the following functions:
7354         real_rand(), real_srand(), setup_randomize, shuffle, rand_uniform,
7355         rand_normal, rand_simple.
7356
7357         * random.h: New file.
7358
7359         * recode.c: (cmd_recode) Merge internal_cmd_recode() into this
7360         function.  `max_src_width', `max_dst_width' changed to size_t.
7361         (internal_cmd_recode) Removed.
7362         (parse_dest_spec) Merge similar cases.
7363         (parse_src_spec) Add assertion.
7364
7365         * repeat.c: (recognize_keyword) New function.
7366         (internal_cmd_do_repeat) Parse and handle PRINT keyword on END
7367         REPEAT.  Improve recognition of END REPEAT (use
7368         recognize_keyword()).  Move from curfn to getl_location().  Use
7369         struct string.
7370                 
7371         (perform_DO_REPEAT_substitutions) Adapt to struct string.
7372
7373         * set.q: Adapt to new q2c.
7374         (cmd_set) Range-check some values better.
7375         (custom_blanks) Renamed stc_custom_blanks().
7376         (custom_length) Renamed stc_custom_length().
7377         (custom_results) Renamed stc_custom_results().
7378         (custom_seed) Renamed stc_custom_seed().
7379         (custom_width) Renamed stc_custom_width().
7380         (custom_format) Renamed stc_custom_format().
7381         (custom_journal) Renamed stc_custom_journal().
7382         (custom_color) Renamed stc_custom_color().
7383         (custom_listing) Renamed stc_custom_listing().
7384         (custom_disk) Renamed stc_custom_disk().
7385         (custom_log) Renamed stc_custom_log().
7386         (custom_rcolor) Renamed stc_custom_rcolor().
7387         (custom_viewlength) Renamed stc_custom_viewlength().
7388         (custom_workdev) Renamed stc_custom_workdev().
7389
7390         * settings.h: Not necessary to include format.h any longer.
7391
7392         * sfm-read.h: (macro bswap_int32) Moved here from sfmP.h.
7393         (corrupt_msg) Rewritten.
7394
7395         * sort.c: Adapt to rewritten heap ADT.
7396
7397         * str.c: (aa_strcpy) Removed.
7398         (ab_strcpy) Removed.
7399         (ac_strcpy) Removed.
7400         (ba_strcpy) Removed.
7401         (bb_strcpy) Removed.
7402         (ca_strcpy) Removed.
7403         (aa_strdup) Removed.
7404         (aa_strdupcpy) Removed.
7405         (ba_strdup) Removed.
7406         (sa_strdup) Removed.
7407         (memrev) Renamed mm_reverse().
7408         (memrmem) Renamed mm_find_reverse().
7409         (cmp_str) Renamed st_compare_pad().
7410         (strmaxcpy) Removed.
7411         (strbarepadcpy) Renamed st_bare_pad_copy(), signature changed.
7412         (strbarepadlencpy) Renamed st_bare_pad_len_copy(), signature
7413         changed.
7414         (strpadcpy) Renamed st_pad_copy(), signature changed.
7415         (blpstrset) Removed.
7416         (ds_create) New function.
7417         (ds_init) New function.
7418         (ds_replace) New function.
7419         (ds_destroy) New function.
7420         (ds_clear) New function.
7421         (ds_extend) New function.
7422         (ds_shrink) New function.
7423         (ds_truncate) New function.
7424         (ds_length) New function.
7425         (ds_size) New function.
7426         (ds_value) New function.
7427         (ds_end) New function.
7428         (ds_concat) New function.
7429         (ds_concat_buffer) New function.
7430         (ds_printf) New function.
7431         (ds_putchar) New function.
7432         (ds_getline) New function.
7433         (ds_get_config_line) New function derived from the old
7434         misc.c:get_config_line().
7435         (ls_create) New function.
7436         (ls_create_buffer) New function.
7437         (ls_init) New function.
7438         (ls_shallow_copy) New function.
7439         (ls_destroy) New function.
7440         (ls_null) New function.
7441         (ls_null_p) New function.
7442         (ls_empty_p) New function.
7443         (ls_length) New function.
7444         (ls_value) New function.
7445         (ls_end) New function.
7446
7447         * str.h: Reformatted.
7448         (struct a_string) Removed.
7449         (struct b_string) Removed.
7450         (struct c_string) Removed.
7451         (struct len_string) New.
7452         (struct string) New.
7453         (macro as_streq) Removed.
7454         (macro bs_streq) Removed.
7455         (macro cs_streq) Removed.
7456         (macro sa_streq) Removed.
7457         (macro sb_streq) Removed.
7458         [__GNUC__] (inline function ds_putchar) New function.
7459         [__GNUC__] (inline function ds_length) New function.
7460         [__GNUC__] (inline function ds_value) New function.
7461         [__GNUC__] (inline function ds_end) New function.
7462
7463         * sysfile-info.c: (cmd_sysfile_info) Rephrased.
7464         (display_vectors) Fix missing i18n.
7465
7466         * t-test.q: Migrate to new q2c.
7467
7468         * tab.c: Migrate from arenas to pools.
7469         (tab_create) Use struct len_string.
7470         (tab_realloc) Ditto.
7471         (text_format) Ditto.
7472         (tab_joint_text) Ditto.
7473         (tab_natural_width) Remove rich text support.
7474         (tab_natural_height) Ditto.
7475         (tab_output_text) Handle TAT_FIX.
7476         (tab_raw) Change arg from a_string to len_string.
7477         (tabi_driver) Fix assertion.  Use struct len_string.
7478         (render_strip) Use struct len_string.  Remove rich text support.
7479         Add `const' qualifiers.
7480
7481         * tab.h: (enum TAB_RICH) Remove.
7482         (enums TAB_COL_NONE, TAB_COL_DONE) New.  Where appropriate,
7483         SOM_COL_* updated to read TAB_COL_*.
7484         (struct tab_table) Change arena to pool.  Change a_string to
7485         len_string.
7486
7487         * temporary.c: (restore_dictionary) Rewrite Checker code.
7488
7489         * var.h: (macros MAX_SHORT_STRING, MIN_LONG_STRING, SYSMIS,
7490         LOWEST, HIGHEST) Moved here from common.h.
7491         (typedef any_trns) Removed.  All references changed to `struct
7492         trns_header'.
7493
7494         * vars-atr.c: (force_create_variable) Fix assertion.
7495         (force_dup_variable) Fix assertion.
7496         
7497 Thu Jun  3 18:40:42 1999  Ben Pfaff  <blp@gnu.org>
7498
7499         Using alphanumeric variables in functions under AGGREGATE
7500         segfaulted.  Fixed.  Thanks to Dr. Dirk Melcher
7501         <BZN-mdksh@t-online.de> for reporting this bug.
7502         
7503         * aggregate.c: (parse_aggregate_functions) When setting the
7504         FSTRING bit, also allocate memory for the `string' member of
7505         agr_next.
7506         (free_aggregate_functions) Free iter->string.  Don't use the
7507         non-function bits when indexing the array of functions.
7508         [DEBUGGING] (debug_print) Don't use the non-function bits when
7509         indexing the array of functions.        
7510
7511 Sun May 30 00:00:54 1999  Ben Pfaff  <blp@gnu.org>
7512
7513         Under certain circumstances, the final case would be omitted from
7514         the results of an AGGREGATE operation.  Fixed.  Thanks to Dr. Dirk
7515         Melcher <BZN-mdksh@t-online.de> for reporting this bug.
7516         
7517         * aggregate.c (agr_00x_end_func): Increment number of cases in
7518         sink before writing case.  For streams that keep track of how many
7519         cases there are based on this value, this means that the last case
7520         will be read in on the next stream read.
7521
7522 Sat May 29 22:03:31 1999  Ben Pfaff  <blp@gnu.org>
7523
7524         Undefined behavior was invoked by referencing a freed pointer.
7525         
7526         * vfm.c (memory_stream_write): Free pointer *after* checking for
7527         non-null status.
7528
7529 Sat May 29 22:02:22 1999  Ben Pfaff  <blp@gnu.org>
7530
7531         A wrong record size was displayed when paging the active file to
7532         disk.
7533         
7534         * vfm.c: (memory_stream_write) Fix off-by-one error.
7535
7536 Sat May 29 21:50:26 1999  Ben Pfaff  <blp@gnu.org>
7537
7538         Not having enough temporary space for sorting caused a core dump.
7539         Fixed.
7540         
7541         * sort.c: (allocate_cases) Initialize i.
7542
7543 Sat May 29 21:40:54 1999  Ben Pfaff  <blp@gnu.org>
7544
7545         Syntax errors in function descriptions on AGGREGATE caused core
7546         dumps.  Fixed.
7547         
7548         * aggregate.c (cmd_aggregate): Don't free agr_dict after calling
7549         free_aggregate_functions(), since that function already frees
7550         agr_dict.
7551         
7552 Sat May 29 21:06:10 1999  Ben Pfaff  <blp@gnu.org>
7553
7554         A null pointer was dereferenced, causing a core dump, when
7555         PERCENTILES was specified on FREQUENCIES.  This fixes the problem,
7556         but PSPP still doesn't calculate percentiles.  Thanks to Regnor
7557         Jernsletten <rjernsle@eunet.no> for reporting this problem.
7558         
7559         * arena.c: (arena_malloc) If the arena hasn't been initialized
7560         already, initialize it.
7561
7562 Sat May 29 20:47:29 1999  Ben Pfaff  <blp@gnu.org>
7563
7564         * Makefile.cygwin: New file supplied by Hankin <hankin@dunno.com>
7565         for compilation with Cygnus Windows B20.  Not used by other
7566         systems.
7567
7568 Sat May 29 20:36:04 1999  Ben Pfaff  <blp@gnu.org>
7569
7570         SORT always sorted in ascending order.  Fixed.  Thanks to Dr. Dirk
7571         Melcher <BZN-mdksh@t-online.de> for reporting this bug.
7572
7573         * sort.c: (compare_case_lists) Reverse sense of comparison if
7574         sorting in descending order.
7575         (compare_record) Ditto.
7576
7577 Tue Mar  9 13:18:54 1999  Ben Pfaff  <blp@gnu.org>
7578
7579         SPLIT FILE with a string variable caused a core dump.  Fixed.
7580
7581         * vfm.c: If the variable is a string then make a temporary value
7582         struct pointing to it.  The underlying problem is a lot bigger
7583         than this (see TODO) but this is a stopgap for the simple case at
7584         least.
7585         
7586 Tue Mar  9 13:15:53 1999  Ben Pfaff  <blp@gnu.org>
7587
7588         Nested INCLUDEs didn't work.  Fixed.
7589
7590         * getline.c: (getl_include) Set first_line to NULL in allocated
7591         structure.
7592
7593 Tue Mar  9 13:13:46 1999  Ben Pfaff  <blp@gnu.org>
7594
7595         The MATCH FILES procedure set the values of variables not present
7596         to 0.  It should have been SYSMIS.  This is now fixed.
7597
7598         * get.c: (mtf_delete_file_in_place) Replace 0.0 by SYSMIS.
7599
7600 Tue Mar  9 12:52:23 1999  Ben Pfaff  <blp@gnu.org>
7601
7602         The REMARK command was too aggressive about skipping lines.  It
7603         didn't like being the last command in a file.
7604
7605         * command.c: (cmd_remark) Call get_entire_line() instead of
7606         get_line().
7607
7608 Tue Mar  9 12:48:05 1999  Ben Pfaff  <blp@gnu.org>
7609
7610         Comment parsing wasn't consistent with the rest of the code in its
7611         idea of where one command ends and another starts.  This meant
7612         that sometimes commands would be mysteriously ignored.  Thanks to
7613         Dr. Dirk Melcher <BZN-mdksh@t-online.de> for reporting this bug.
7614          
7615         * command.c: (parse_cmd) Hand off comment parsing to new function
7616         skip_comment() in lexer.c.
7617         * lexer.c: (skip_comment) New function.
7618
7619 Wed Jan 20 20:22:07 1999  Ben Pfaff  <blp@gnu.org>
7620
7621         The TABLE subcommand on MATCH FILES worked only erratically at
7622         best.  This fixes it.  Thanks to Dr. Dirk Melcher
7623         <BZN-mdksh@t-online.de> for reporting this bug.
7624
7625         * get.c: (mtf_compare_BY_values) When comparing string values, a
7626         difference of 1 is still a difference :-)
7627         (mtf_processing) Inverted TABLE reading logic fixed.  Also don't
7628         advance TABLE files automatically when matched.  Comment fixes.
7629
7630 Tue Jan 19 22:32:31 1999  Ben Pfaff  <blp@gnu.org>
7631
7632         VARIABLE LABELS rejected a slash before the first variable
7633         specification, contradicting the documentation.  Thanks to Walter
7634         M. Gray <graywm@northernc.on.ca> for reporting this bug.
7635
7636         * var-labs.c: (cmd_variable_labels) Ignore a leading slash in
7637         command specification.
7638
7639 Tue Jan 19 22:29:54 1999  Ben Pfaff  <blp@gnu.org>
7640
7641         Because of an incorrect optimization in memory allocation,
7642         CROSSTABS sometimes segfaulted when asked to output multiple
7643         tables.  Thanks to Walter M. Gray <graywm@northernc.on.ca> for
7644         reporting this bug.
7645
7646         * crosstabs.q: (postcalc) New variables maxcols, maxcells, which
7647         are passed to output_pivot_table() for its use.
7648         (output_pivot_table) Instead of assuming the number of columns is
7649         constant, keep track with maxcols.  In general mode, use maxcells
7650         to determine whether more matrix cells need to be allocated.    
7651
7652 Tue Jan 19 22:27:46 1999  Ben Pfaff  <blp@gnu.org>
7653
7654         CROSSTABS didn't display value labels for column and row
7655         variables.  Thanks to Walter M. Gray <graywm@northernc.on.ca> for
7656         reporting this bug.
7657
7658         * crosstabs.q: (table_value_missing) If the specified value has a
7659         value label for this variable, then show it instead of the raw
7660         value.
7661         (display_dimensions) Delegate display of value_labels to
7662         table_value_missing.
7663
7664 Mon Jan 18 20:04:06 1999  Ben Pfaff  <blp@gnu.org>
7665
7666         WRITE didn't write line ends.  Fixed.  Thanks to Dr. Dirk Melcher
7667         <BZN-mdksh@t-online.de> for reporting this bug.
7668
7669         * print.c: (print_trns_proc) Write (CR/)LF if PRINT is used _or_
7670         if the file isn't declared as binary.
7671
7672 Mon Jan 18 19:56:45 1999  Ben Pfaff  <blp@gnu.org>
7673
7674         MATCH FILES corrupted memory and dumped core on some syntax
7675         errors.  Fixed.
7676
7677         * get.c: (cmd_match_files) Set file->handle to NULL before
7678         jumping to lossage.
7679         (mtf_free_file) Don't free a null dictionary.   
7680
7681 Mon Jan 18 19:27:57 1999  Ben Pfaff  <blp@gnu.org>
7682
7683         MATCH FILES should set numeric values not available to the
7684         system-missing value, not to 0.  Thanks to Dr. Dirk Melcher
7685         <BZN-mdksh@t-online.de> for reporting this bug.
7686
7687         * get.c: (mtf_processing) Set unused records to system-missing,
7688         not 0.
7689
7690 Mon Jan 18 15:06:46 1999  Ben Pfaff  <blp@gnu.org>
7691
7692         KEEP didn't work properly on the SAVE procedure.  Fixed.  Thanks
7693         to Ralf Geschke <ralf@kuerbis.org> for reporting this bug.
7694
7695         * temporary.c: (save_dictionary) Initialize var_by_name AVL tree
7696         in newly created dictionary, and add each copied variable to the
7697         tree.
7698  
7699 Mon Jan 18 15:04:48 1999  Ben Pfaff  <blp@gnu.org>
7700
7701         Memory leak fix.
7702         
7703         * get.c: (trim_dictionary) Free variable list for KEEP after
7704         finishing with it.
7705
7706 Mon Jan 18 12:57:36 1999  Ben Pfaff  <blp@gnu.org>
7707
7708         Some systems didn't like the way open_file was coded.  Thanks to
7709         Hankin <hankin@rogue.consultco.com> for pointing this out.
7710
7711         * filename.c: (open_file) Don't try to store stdin, stdout,
7712         stderr as part of an array, because that doesn't always work.
7713
7714 Mon Jan 18 12:53:27 1999  Ben Pfaff  <blp@gnu.org>
7715
7716         The SAVE procedure didn't save long string variables properly.
7717         Fixed by this patch.  Thanks to Hankin
7718         <hankin@rogue.consultco.com> for this patch.
7719         
7720         * sfm-write.c: (write_variable) Fix off-by-one error in writing
7721         out variable pad records.
7722
7723 Tue Jan  5 14:29:27 1999  Ben Pfaff  <blp@gnu.org>
7724
7725         Previously, if PRINT SPACE were given a negative argument, it
7726         would report an error, then spin in an (almost) infinite loop.
7727         This fixes that behavior.
7728
7729         * print.c: (print_space_trns_proc) After reporting a negative
7730         argument, set number of lines to print to 1.
7731
7732 Tue Jan  5 13:59:55 1999  Ben Pfaff  <blp@gnu.org>
7733
7734         SPSS 8.0 outputs some new record types in its system files, and it
7735         allows longer value labels.  Accept these system files.
7736
7737         * sfm-read.c: (sfm_read_dictionary) Ignore record type 7 subtype
7738         11 emitted by SPSS 8.0.
7739         
7740 Tue Jan  5 13:55:50 1999  Ben Pfaff  <blp@gnu.org>
7741
7742         The LIST procedure was too conservative in allocating space for
7743         buffers, which caused a bug that only showed up with very long
7744         output variables.  Thanks to Hankin <hankin@dunno.com> for this
7745         bug report.
7746
7747         * list.q: (determine_layout) Allocate 1022 bytes instead of 256.
7748
7749 Tue Jan  5 13:34:34 1999  Ben Pfaff  <blp@gnu.org>
7750
7751         Typo meant string format specifiers weren't checked properly.  I
7752         think that Hankin <hankin@dunno.com> sent me this report, but I'm
7753         willing to be corrected on this point.
7754  
7755         * format.c: (check_string_specifier) Fix obvious typo.  
7756
7757 Tue Jan  5 12:50:42 1999  Ben Pfaff  <blp@gnu.org>
7758
7759         Using $CASENUM in an expression didn't work.  Here's a fix.
7760         Thanks to Dirk Melcher <BZN-mdksh@t-online.de> for reporting this
7761         bug.
7762          
7763         * expr-evl.c: (evaluate_expression) Add OP_CASENUM case.
7764
7765         * expr-opt.c: (dump_node) OP_CASENUM is acceptable.
7766
7767 Tue Jan  5 12:47:48 1999  Ben Pfaff  <blp@gnu.org>
7768
7769         The changes in 0.2.1 to fix DATA LIST FREE parsing broke some
7770         other behavior, *sigh*.  This patch hopefully fixes that.  This
7771         time I've actually tested it.
7772
7773         Thanks to Hankin <hankin@dunno.com> for reporting this bug.
7774
7775         * data-list.c: (read_from_data_list_free,
7776         read_from_data_list_list) Call parse_string_as_format() directly
7777         without mucking around with the field width.
7778
7779 Tue Jan  5 12:31:19 1999  Ben Pfaff  <blp@gnu.org>
7780
7781         Occasionally, you may encounter a script that wants to be
7782         interpreted in interactive mode.  Make -i emulate this behavior to
7783         allow such scripts to be executed with PSPP.
7784
7785         Thanks to Hankin <hankin@dunno.com> for reporting this behavior.
7786
7787         * cmdline.c: (pre_syntax_message[]) Update -i description.
7788
7789         * lexer.c: (preprocess_line) When getl_interactive is 2 (i.e.,
7790         when -i is given on the command line) don't treat unindented lines
7791         as starting a new command.
7792
7793 Tue Jan  5 12:30:10 1999  Ben Pfaff  <blp@gnu.org>
7794
7795         In conjunction with egcs 1.1.1, Checker emits some bogus warnings,
7796         mostly caused by local initialized aggregates.  After egcs is
7797         fixed upstream these can be removed, but for now they're not a big
7798         deal.
7799         
7800         * ascii.c: (ascii_postopen_driver) Checker chokes on local
7801         initialized arrays.  Avoid this.
7802
7803         * sfm-write.c: (sfm_write_dictionary) Don't use a local
7804         initialized struct.
7805
7806 Tue Jan  5 12:07:24 1999  Ben Pfaff  <blp@gnu.org>
7807
7808         egcs 1.1.1 has some new warnings relative to gcc 2.8.1, which the
7809         following changes avoid.  Currently I compile sources with egcs
7810         1.1.1 and gcc 2.7.2.3 before sending them out.
7811
7812         * apply-dict.c: (apply_dict) Use new avl_traverser_init() macro.
7813         
7814         * ascii.c: (option_tab[]) Initialize all struct members.
7815
7816         * avl.h: (avl_traverser_init) New macro.
7817         
7818         * command.c: (DEFCMD, UNIMPL macros, cmd_table[]) Initialize all
7819         struct members.
7820
7821         * crosstabs.q: (enum_var_values) Use new hsh_iterator_init()
7822         macro.
7823
7824         * hash.c: Comment fix.
7825
7826         * hash.h: (hsh_iterator_init) New macro.
7827
7828         * html.c: (option_tab[]) Initialize all struct members.
7829
7830         * pfm-write.c: (write_value_labels) Use new avl_traverser_init()
7831         macro.
7832
7833         * postscript.c: (option_tab[]) Initialize all struct members.
7834         (output_encodings, preclose, dump_lines) Use new
7835         hsh_iterator_init() macro.
7836
7837         * sfm-write.c: (write_value_labels) Use new avl_traverser_init()
7838         macro.
7839
7840         * sysfile-info.c: (describe_variable) Use new avl_traverser_init()
7841         macro.
7842
7843 Thu Nov 19 12:32:45 1998  Ben Pfaff  <blp@gnu.org>
7844
7845         * data-in.c: Examined each of the parsing functions to make sure
7846         that they wouldn't dump core if they were passed a string of the
7847         wrong length, since now the DATA LIST FREE/LIST routines don't
7848         check for field width before passing it to the data parser.
7849         (parse_RBHEX, parse_AHEX) Reject odd length input.
7850         (parse_string_as_format) Reject input that's too short or too
7851         long.
7852
7853         * data-list.c: Before, the DATA LIST FREE/LIST routines would pad
7854         a field to its entire declared output width then pass it to the
7855         data-in parsing routines.  This contradicted the documented
7856         behavior.  This is fixed in these changes.  Thanks to Mark H. Wood
7857         <mwood@IUPUI.Edu>.  In addition, this fixes a few more details of
7858         free-format parsing that differed from SPSS.
7859         (cut_field) Commas and spaces are treated identically.  Returns
7860         the proper column instead of a fixed 1 value.
7861         (parse_field) Removed.
7862         (read_from_data_list_free, read_from_data_list_list) Call
7863         parse_string_as_format directly instead of parse_field.
7864
7865         * heap.c: (heap_delete) Stylistic fixes.
7866
7867 Sun Aug  9 11:12:13 1998  Ben Pfaff  <blp@gnu.org>
7868
7869         * loop.c: (loop_2_trns_proc) Formatting fix.
7870
7871         * sel-if.c: (cmd_filter) Set FILTER_before_TEMPORARY.
7872
7873         * var.h: (glob var FILTER_before_TEMPORARY) New global var.
7874
7875         * vfm.c: (macro FILTERED) New.
7876         (static var filter_var) New.
7877         (process_active_file_write_case) Use FILTERED.
7878         (setup_filter) Set filter_var.
7879         (close_active_file) Delete the filter if not
7880         FILTER_before_TEMPORARY.
7881         (procedure_write_case) Use FILTERED.
7882
7883 Sat Aug  8 00:20:14 1998  Ben Pfaff  <blp@gnu.org>
7884
7885         * crosstabs.q: Changed /PIVOT={ON,OFF} to /FORMAT={PIVOT,NOPIVOT}.
7886
7887         * data-in.c: (parse_day_count) Message fix.
7888         (parse_month) Style fix.
7889
7890         * data-list.c: (struct data_list_pgm) New member eof.
7891         (cmd_data_list) Init eof to 0.
7892         (do_reading) Implement the /END subcommand and read-past-eof
7893         checking.
7894
7895         * do-if.c: Include stdio.h when debugging.
7896         (cmd_else_if) Make sure the command is .-terminated.
7897
7898         * glob.c: (init_glob) Capitalize the command prompt.
7899
7900         * inpt-pgm.c: (end_case_trns_proc) Debugging message.
7901         (end_file_trns_proc) Debugging message.
7902
7903         * loop.c: (internal_cmd_loop) Make it work when there's no loop
7904         index!
7905         (loop_2_trns_proc) Enable MXLOOPS (why was this disabled?)
7906
7907         * main.c: (dump_token) Make kwtab[] const.
7908
7909         * set.q: Spelling, comment fixes.
7910
7911         * sysfile-info.c: (cmd_display) DISPLAY VECTORS not DISPLAY
7912         VECTOR.
7913
7914         * vars-prs.c: (fill_all_vars) Style fix.
7915
7916         * vfm.c: (index_to_varname) Return const.
7917
7918 Tue Aug  4 23:49:23 1998  Ben Pfaff  <blp@gnu.org>
7919
7920         * Changes in many source files for partial -ansi -pedantic and
7921         no-debugging compliance: Remove trailing common in enum
7922         declarations; add `unused' attributes; insert some appropriate
7923         casts.
7924
7925         * cmdline.c: (parse_command_line) Add new --testing-mode flag.
7926
7927         * command.c: (shell) Make static.
7928         (run_command) Make static.
7929
7930         * data-list.c: (dump_fixed_table) Remove use of local_strdup().
7931
7932         * dfm.c: (cmd_begin_data) I18n fix.
7933
7934         * error.c: (verbose_msg) Define if __STRICT_ANSI__.
7935
7936         * error.h: (macro verbose_msg) Define if __STRICT_ANSI__.
7937
7938         * expr-opt.c: (evaluate_tree) Don't initialize local arrays if
7939         __STRICT_ANSI__.
7940
7941         * file-handle.q: Don't prepend the source file directory name to
7942         the data file name.  (Ongoing issue.)
7943         (prepend_current_directory) Comment out.
7944         (internal_cmd_file_handle) Don't call prepend_current_directory().
7945         (fh_get_handle_by_filename) Ditto.
7946
7947         * filename.c: Append zero byte to readlink() return value.
7948
7949         * getline.c: (getl_read_line) I18n fix.
7950
7951         * lexer.h: Don't use gcc features if __STRICT_ANSI__.
7952
7953         * misc.h: Don't use gcc features if __STRICT_ANSI__.
7954
7955         * pfm-write.c: (bufwrite) Don't try to increment a void * pointer
7956         directly.
7957
7958         * postscript.c: (output_encodings) Don't use local_strdup().
7959         (postopen) Ditto.
7960
7961         * print.c: Don't use gcc features if __STRICT_ANSI__.
7962
7963         * q2c.c: (dump_vars) Don't put a , at the end of the last enum.
7964
7965         * recode.c: (parse_src_spec) Fully brace nested if's.
7966
7967         * set.q: (global var set_testing_mode) New var.
7968
7969 Wed Jul 29 22:01:44 1998  Ben Pfaff  <blp@gnu.org>
7970
7971         * ascii.c: Add some more `unused' attributes that only come into
7972         play when NDEBUG is defined.
7973         (ascii_close_page) Set s_len when reallocating s.
7974         
7975         * crosstabs.q: (delete_missing) New function.
7976         (output_pivot_table) Call delete_missing() if /MISSING=REPORT.
7977         (make_summary_table) Create summary table reallocable.
7978
7979         * postscript.c: Add more `unused' attributes as above.
7980
7981         * tab.c: (tab_create) [GLOBAL_DEBUGGING] Set reallocable member.
7982         (tab_realloc) [GLOBAL_DEBUGGING] Assert that table is reallocable.
7983          
7984         * tab.h: (struct tab_table) [GLOBAL_DEBUGGING] New `reallocable'
7985         member.
7986
7987         * var.h: (macro force_dup_variable) [!GLOBAL_DEBUGGING] Remove
7988         gratuitous space between parameter definition.
7989
7990         * vars-atr.c: Changed some assert(0)'s to abort()'s to prevent
7991         complaints about running off the end of functions with NDEBUG
7992         enabled.
7993
7994 Sun Jul  5 00:17:25 1998  Ben Pfaff  <blp@gnu.org>
7995
7996         * Several source files: Removed some PORTME notes when reflection
7997         revealed that ANSI forbids that sort of breakage.  Also, added
7998         lots of `unused' qualifiers here and there.
7999
8000         * aggregate.c: (accumulate_aggregate_info) Remove local var
8001         weighting that turned out not to be used.
8002
8003         * avl.c: Update to version 1.1.0.  Add unused specifier.
8004         (avl_destroy) Initialize ab to 0.  Comment fixes.  Cast return
8005         value to void *.
8006         (avl_probe) Replace some instances of 1 with +1 where appropriate.
8007         (avl_find) Cast return value to void *.
8008         (avl_delete) q doesn't need to be initialized at the beginning of
8009         the function.  Replace some instances of 1 with +1.
8010         (force_avl_delete) Renamed avl_force_delete, all references changed.
8011         (compare_ints) `param' marked unused.
8012         (print_int) `param' marked unused.
8013         (recurse_tree) Replace some instances of 1 with +1.
8014
8015         * avl.h: Update to version 1.1.0.  Only declares avl function
8016         types if not already declared.
8017         (AVL_MAX_HEIGHT) Only define if not already defined.
8018         (struct avl_node) New unused member char pad[2].
8019         [GLOBAL_DEBUGGING] Change conditionalization to NDEBUG instead.
8020         (force_avl_insert) Renamed avl_force_insert.
8021         (force_avl_delete) Renamed avl_force_delete.
8022
8023         * crosstabs.q: (struct table_entry) Put `freq' into a union with
8024         new member `data'.
8025         (struct crosstab) Add new member `ofs'.
8026         (glob var int_tab) Removed.
8027         (custom_tables) In integer mode, assign v[i] properly through the
8028         indirect var_dict.
8029         (custom_variables) Now p.crs.max == max + 1.
8030         [DEBUGGING] (debug_print) p.crs.min and p.crs.max are now ints.
8031         (precalc) Implement integer mode.
8032         (calc_integer) Implement integer mode.
8033         (compare_table_entry) Remove unused local variable `comparing'.
8034         (make_summary_table) Implement integer mode.
8035         (macro ns_rows) Implemented as static variable now.
8036         (several variables) Made static, from global.
8037         (output_pivot_table) Use table_value_missing() for column heads.
8038         Remove several unused local variables.  Implement integer mode
8039         table summing.  Count up ns_rows.
8040         (crosstabs_dim) Make columns wider when /MISSING=REPORT requested.
8041         (find_pivot_extent) Moved into find_pivot_extent_general; now just
8042         calls that function or find_pivot_extent_integer.
8043         (find_pivot_extent_integer) New function.
8044         (enum_var_values) Implemented for integer mode.
8045         (table_value_missing) New function.
8046         (display_dimensions) Call table_value_missing() for heads.
8047         (float_M_suffix) New function.
8048         (display_crosstabulation) Call table_value_missing() for row
8049         heads.  Handle missing values in /MISSING=REPORT mode.
8050         (calc_fisher) Remove unused var N.
8051         (calc_r) Remove unused var fact.
8052
8053         * data-list.c: (dump_fixed_table) Fix table dimensioning.
8054         (read_one_set_of_repetitions) Remove unused vars var_spec, column.
8055
8056         * data-out.c: (insert_commas) Remove unused var cp.
8057         (convert_CCx) Remove unused vars save_set_decimal,
8058         save_set_grouping.
8059
8060         * descript.q: (dump_z_table) Fix table dimensioning.
8061         (pre_calc) Remove unused var j.
8062         (display) Remove unused vars title, s.  Fix table dimensioning.
8063
8064         * expr-evl.c: Comment fixes.
8065
8066         * frequencies.q: (full_dim) New function.
8067         (dump_full) Fix table dimensioning.
8068         (condensed_dim) New function.
8069         (dump_condensed) Fix table dimensioning.
8070
8071         * get.c: (cmd_match_files) Remove unused var n_val.  Remove unused
8072         label winnage.
8073
8074         * html.c: (html_close_drive) Remove unused var i.
8075         (postopen) Remove unused vars title, curfn_len, cp.
8076         (preclose) Remove unused vars this, x.
8077
8078         * lexer.c: Comment fixes.
8079
8080         * matrix-data.c: (cmd_matrix_data) Remove unused var index.
8081
8082         * means.q: (custom_tables) Remove unused var m_dim.
8083
8084         * mis-val.c: Format fix.
8085
8086         * modify-vars.c: (cmd_modify_vars) Remove unused var new_dict.
8087
8088         * output.c: (outp_get_paper_size) Remove unused var cp.
8089
8090         * pfm-read.c: (read_float) Remove unused var save, unused label
8091         underflow.
8092         (read_variables) Remove unused vars cp, j.
8093         (read_value_label) Remove unused var j.
8094
8095         * pfm-write.c: (bufwrite) Remove unused var i.
8096
8097         * postscript.c: (ps_postopen_drive) Remove unused vars dev_info,
8098         fn.
8099         (output_encodings) Remove unused vars char_cp, n_output.
8100         (read_ps_encodings) Remove unused var ep.
8101         (postopen) Remove unused var title.
8102         (preclose) Remove unused var fp.
8103         (ps_open_page) Remove unused vars true, false, orientation,
8104         mirror_horz, mirror_vert, width, length.
8105         (ps_text_metrics) Remove unused var x.
8106
8107         * q2c.c: (find_symbol) Remove unused var y.
8108         (parse_setting) Remove unused parameter sbc, all references
8109         changed.
8110         (dump_parser) Remove unused var cp.
8111         (dump_free) Remove unused var i.
8112
8113         * set.q: (static vars args, n) Removed.
8114         (internal_cmd_gset) Removed.
8115
8116         * sfm-read.c: (sfm_read_dictionary) Removed unused var i.
8117         (read_machine_flt64_info) Removed unused var file_endian.
8118         (read_documents) Removed unused var i.
8119         (read_compressed_data) Removed unused parameter dict, all
8120         references changed.
8121
8122         * sfm-write.c: (bufwrite) Removed unused var i.
8123         (sfm_write_case) Removed unused var i.
8124
8125         * sort.c: (merge_once) Remove unused var t.
8126         (write_separate) #if 0 out as dead code.
8127
8128         * split-file.c: (cmd_split_file) Remove unused var i.
8129
8130         * sysfile-info.c: (sysfile_info_dim) New function.
8131         (cmd_sysfile_info) Fix table dimensioning.
8132         (variables_dim) New function.
8133         (display_variables) Fix table dimensioning.
8134         (describe_variable) Remove unused var prev_r.
8135
8136         * t-test.q: (z_postcalc) Removed.
8137         (pairs_calc) Remove unused var bad_weight.
8138         (postcalc) Remove unused vars dfn, dfd.
8139
8140         * tab.c: (tab_create) Set t->dim to NULL.
8141         (tab_dim) Make sure t->dim is NULL first.
8142         (tab_natural_width) Remove parameter `clamp'.
8143         (tab_value) Remove duplicate assertion for table.
8144         (tab_raw) New function.
8145         (nowrap_dim) New function.
8146         (wrap_dim) New function.
8147         (tab_output_text) Fix table dimensioning.
8148
8149         * tab.h: (tab_raw) New macro.
8150
8151         * val-labs.c: (get_label) Remove unused var type.
8152         (copy_value_labels) Remove unused var trav.
8153
8154         * var.h: (struct crosstab_proc) Completely changed.
8155
8156         * vars-prs.c: (parse_dict_variable) Remove unused var v.
8157
8158         * vfm.c: (open_active_file) Remove unused vars i, lp.
8159
8160         * weight.c: (weight_trns_proc) #if 0 out as dead code.
8161         
8162 Tue Jun  2 23:37:21 1998  Ben Pfaff  <blp@gnu.org>
8163
8164         * Makefile.am: Add apply-dict.c, flip.c.
8165
8166         * apply-dict.c: New file.
8167         
8168         * command.c: (struct command) Make cmd[] larger for CLEAR
8169         TRANSFORMATIONS command name.
8170         (parse_cmd) Make sure we're in a valid state before using it as an
8171         index.  Discard variables and reset state on invalid transitions.
8172         (cmd_clear_transformations) New function.
8173
8174         * command.def: Add APPLY DICTIONARY, CLEAR TRANSFORMATIONS, FLIP.
8175         Add unimplemented PRESERVE, RESTORE.
8176
8177         * file-handle.h: Include stddef.h.
8178
8179         * flip.c: New file.
8180         
8181         * pfm-read.c: (parse_value) Pad value label values with spaces,
8182         not nulls.
8183
8184         * sfm-read.c: (struct sfm_fhuser_ext) Add reference count.
8185         (sfm_close) Decrement reference count, make sure it's zero.
8186         (sfm_maybe_close) New function.
8187         (sfm_read_dictionary) Handle reference counts.
8188
8189         * vars-atr.c: (clear_default_dict) New function.
8190         (discard_variables) Use clear_default_dict().
8191
8192 Sun May 31 00:58:05 1998  Ben Pfaff  <blp@gnu.org>
8193
8194         * Makefile.am: Add pfm-write.c.
8195         (LDADD) Add the libgmp2 libraries.
8196
8197         * command.def: Define EXPORT.
8198
8199         * get.c: (cmd_export) New function.
8200         (export_write_case_func) New function.
8201
8202         * pfm-read.c: (static spss2ascii[]) Make it const.
8203
8204         * pfm-write.c: New file.
8205
8206         * sfm-write.c: Formatting, comment fixes.
8207
8208         * var.h: Comment fix.
8209
8210 Fri May 29 21:44:12 1998  Ben Pfaff  <blp@gnu.org>
8211
8212         * Makefile.am: Add pfm.h, pfm-read.c.
8213
8214         * command.def: IMPORT is now implemented.
8215
8216         * format.c: (glob var translate_fmt[]) New var.
8217
8218         * get.c: (enum GTSV_NONE) Renamed GTSV_OPT_NONE.
8219         (cmd_import) New function.
8220         (import_source_read) New function.
8221         (glob var import_source) New var.
8222
8223         * pfm-read.c: New file.
8224
8225         * pfm.h: New file.
8226         
8227         * sfm-read.c: (parse_format_spec) Local variable translate_fmt[]
8228         moved in format.c.
8229         (dump_dictionary) Disabled printing a couple of items.
8230
8231 Mon May 25 12:42:37 1998  Ben Pfaff  <blp@gnu.org>
8232
8233         * crosstabs.q: (postcalc) Call make_summary_table().
8234         (make_summary_table) New function.
8235         (insert_summary) New function.
8236         (display_dimensions) Remove some unnecessary arguments, all
8237         references changed.
8238         (output_pivot_table) Fix lots of problems with the risk table
8239         setup.
8240         (submit) Don't display an empty table.
8241         (display_risk) Fix order of arguments to calc_risk().
8242
8243         * glob.c: Always include assert.h and stdlib.h.
8244
8245         * output.h: (enum OUTP_T_JUST_FULL) Removed, all references
8246         removed.
8247
8248         * tab.c: (tab_create) Cosmetic changes.
8249
8250         * tab.h: (enum TAB_JUSTIFY) Removed, all references removed.
8251
8252 Sun May 24 22:39:23 1998  Ben Pfaff  <blp@gnu.org>
8253
8254         * tab.def: Removed.
8255
8256         * crosstabs.q: (output_pivot_table) Headers drawing and submission
8257         code simplified, moved into new function submit().
8258         (submit) New function.
8259         (crosstabs_dim) New function.
8260         (display_directional) Substitute variable names for %s where
8261         appropriate.
8262         (somers_d_v[], somers_d_ase[], somers_d_t[]) New static vars.
8263         (calc_symmetric) Initialize parameters only if non-NULL.
8264         Calculate Somers' d.
8265         (calc_directional) Calculate Somers' d (or copy it, really).
8266         Calculate eta.
8267
8268         * output.c: (outp_string_width) New function.
8269
8270         * postscript.c: (postopen) Calculate font widths based on the
8271         width of the zero '0' character, not the width of the space
8272         character.  Set paper-width and paper-length based on points, not
8273         device units.
8274         (ps_open_page) Fix page setup string for landscape mode.
8275
8276         * som.h: (struct som_dimension) Removed.
8277         (struct som_table_class) height, width members take int * not
8278         som_dimesion * now.
8279
8280         * tab.c: Many functions now have added parameter validation.
8281         (tab_height, tab_width) These functions were removed and merged
8282         into a single function tab_resize(), and all references changed.
8283         (tab_dim) Rewritten since the interface changed; reduced from
8284         hundreds of lines to two.  All callers were changed.  Currently
8285         most of them just use tab_natural_dimensions as their callback and
8286         await detailed translation of functionality.
8287         (tab_natural_width) New function.
8288         (tab_natural_height) New function.
8289         (tab_natural_dimensions) New function.  This is a callback
8290         function, not something that you'd want to call directly.
8291         (tab_nat_dim) Removed.
8292         (tabi_table) Allocates t->w and t->h.
8293         (tabi_driver) Inlined sum_columns()'s functionality.  Calls the
8294         dimensions callback.
8295         (evaluate_dimensions) Removed.
8296         (sum_columns) Removed.
8297
8298         * tab.h: (enum TAL_1THIN) Removed.
8299         (enum series t_*) Removed.
8300         (struct tab_table) Members trh, trv changed to unsigned char *
8301         from int *.  Member dim changed to a function pointer from a
8302         unsigned char *.  Member max_stack_height removed.  New members
8303         hr_tot, vr_tot.
8304         (macros tab_l, tab_r, tab_t, tab_b) New.
8305
8306 Sat May 23 23:22:13 1998  Ben Pfaff  <blp@gnu.org>
8307
8308         * ascii.c: (delineate) Assign last_space_nchars before skipping
8309         spaces, to fix right justification.
8310
8311         * crosstabs.q: (static vars risk, direct) New vars.
8312         (static var pearson_r) Removed.
8313         (glob var chisq_fisher) Made static.
8314         (static vars row_tot[], col_tot[]) Don't include grand total
8315         anymore.
8316         (static var grand_total) Renamed W, all references changed.
8317         (output_pivot_table) Only make `table' if num_cells != 0.  Make
8318         risk and directional tables.  Deal with grand total no longer part
8319         of col_tot[].  Free rows and cols after we're done with them.
8320         (display_risk) New function.
8321         (display_directional) New function.
8322         (clac_r) Rewritten so that it stores all its results into its
8323         arguments, so it can be used for Spearman's correlation too.
8324         (calc_symmetric) Added a t[] argument, all references changed.
8325         Calculates ASEs for tau-b, tau-c, gamma.  Calculates Spearman's r,
8326         Pearson's r, Cohen's kappa.
8327         (calc_risk) New function.
8328         (calc_directional) New function.
8329
8330         * som.c: (som_submit) Improved debugging code.
8331
8332         * stats.c: (hypercube) New function.
8333         (cube) New function.
8334         (sqr) New function.
8335         (normal_sig) Went back to old implementation, which actually
8336         worked.
8337
8338         * stats.h: (macros square, cube, hypercube) Removed.  The
8339         equivalent functions in stats.c are inlined here; all references
8340         to square changed to sqr.
8341
8342 Fri May 22 00:03:41 1998  Ben Pfaff  <blp@gnu.org>
8343
8344         * crosstabs.q: (N_SYMMETRIC) New define.
8345         (postcalc) Disable debug printing.
8346         (static vars chisq_fisher, pearson_r) New.
8347         (output_pivot_table) Add support for symmetric measures.  Add
8348         chi-square output of exact sigs.
8349         (display_chisq) Rewritten.
8350         (display_symmetric) New function.
8351         (gamma_int) New function.
8352         (Pr) New function.
8353         (swap) New function.
8354         (calc_fisher) New function.
8355         (calc_chisq) Check boundary conditions better. Calculate Yates,
8356         Fisher, Mantel-Haenszel tests.
8357         (calc_r) New function.
8358         (calc_symmetric) New function.
8359
8360         * stats.c: (normal_sig) Rewritten with new algorithm.  Renamed
8361         from calc_normal.
8362         (chisq_sig) Better boundary conditions.  Renamed from
8363         calc_significance.
8364
8365         * tab.h: (struct tab_table) New member cf.
8366
8367         * tab.c: (tab_create) Set cf.
8368         (tab_width) New function.
8369         (tab_realloc) Handle cf.
8370         (tab_vline) Handle cf.
8371         (tab_hline) Handle cf.
8372         (tab_box) Handle cf.
8373         (tab_value) Handle cf.
8374         (tab_float) Handle cf.
8375         (tab_text) Handle cf.
8376         (tab_joint_text) Handle cf.
8377         (tab_offset) Handle cf.
8378         (tab_next_row) Handle cf.
8379         (evaluate_dimensions) Handle cf.
8380         (render_strip) Handle cf.
8381
8382 Wed May 20 00:03:59 1998  Ben Pfaff  <blp@gnu.org>
8383
8384         * crosstabs.q: (postcalc) New vars row_tot, col_tot, pass them to
8385         output_pivot_table().
8386         (output_pivot_table) Moved lots of local variables outside and
8387         made them static.  Add beginnings of chi-square statistic
8388         support.  Now column and row totals aren't in the main matrix.
8389         Always zero out any leftover rows & columns after we're done with
8390         the table entries.  Move all output stuff into
8391         display_dimensions(), display_crosstabs(), display_chisq().
8392         (display_dimensions) New function.
8393         (display_crosstabulation) New function.
8394         (display_chisq) New function.
8395         (calc_chisq) Implemented Pearson and likelihood-ratio chisquares.
8396
8397         * frequencies.q: (dump_full, dump_condensed) Remove tab_null()
8398         references, simplify logic.
8399
8400         * postscript.c: Remove scale, translate-x, translate-y,
8401         mirror-horz, mirror-vert, rotate-180 options.
8402         (struct ps_driver_ext) Remove scale, translate_x, translate_y.
8403         All references deleted.
8404         (macro YT) New macro.
8405         (array option_tab[]) Removed options.
8406         (ps_option) Removed options.
8407         (ps_open_page) Write page setup explicitly to output file, without
8408         using now-deleted BP function.
8409         (macro dump_line) Use YT().
8410         (macro dump_thick_line) Use YT().
8411         (draw_headers) Use YT().
8412         (switch_font) Reorder arguments to SF function.
8413         (write_text) Use YT().
8414
8415         * sfm-read.c: (sfm_read_case) Don't attempt to read variables that
8416         have get.fv == -1.
8417
8418         * sysfile-info.c: (describe_variables) Don't use tab_nulls().
8419
8420         * tab.c: (tab_create) Initialize t->ct to zeros.  Remove
8421         null-debugging code.
8422         (tab_realloc) Remove null-debugging code.  Initialize new regions
8423         of t->ct to zeros.
8424         (tab_vline) Support offsets.
8425         (tab_hline) Support offsets.
8426         (tab_box) Support offsets.
8427         (tab_null) Removed.
8428         (tab_nulls) Removed.
8429         (tab_row) Removed.
8430         (tab_col) Removed.
8431         (evaluate_dimensions) Remove null-debugging code.  Understand
8432         TAB_EMPTY attribute.  Assert that text.s.s is always non-NULL if
8433         TAB_EMPTY not present.
8434
8435         * tab.h: New cell attribute TAB_EMPTY.
8436         (macros tab_nr, tab_nc, tab_row, tab_col) New.
8437
8438         * vars-atr.c: (init_variable) Set get.fv to -1 so that GET doesn't
8439         try to read them from system files.
8440
8441         * vfm.c: (dump_splits) Don't call tab_null().   
8442
8443 Sat May 16 19:36:55 1998  Ben Pfaff  <blp@gnu.org>
8444
8445         * crosstabs.q: (struct crosstab) Added `missing' member.
8446         (custom_tables) Init missing.
8447         (calc_general) Handle missing values.
8448         (calc_chisq) New function.
8449         (output_pivot_table) Start work on chi-square output.  Update for
8450         new tab offset support functions.  Shorten statistic names.
8451
8452         * Several files: add in more `const's to placate gcc's warnings.
8453
8454         * tab.h: (struct tab_table) Add col_ofs, row_ofs members.  Comment
8455         fixes.
8456
8457         * tab.c: (tab_height, tab_realloc, tab_vline, tab_hline, tab_box,
8458         tab_null, tab_nulls, tab_value, tab_float, tab_text,
8459         tab_joint_text) Add col_ofs and row_ofs support.
8460         (tab_offset) New function.
8461         (tab_next_row) New function.
8462         (tab_row) New function.
8463         (tab_col) New function.
8464         (tabi_table) Add col_ofs and row_ofs support.
8465
8466         * vars-atr.c: (is_system_missing) New function.
8467
8468 Tue May 12 16:14:30 1998  Ben Pfaff  <blp@gnu.org>
8469
8470         * crosstabs.q: Expanded subcommand names RESID --> RESIDUAL, etc.
8471         (static var no_cells) Removed.
8472         (static var num_cells) New.
8473         (static var expected) New.
8474         (static var cells[]) New.
8475         (internal_cmd_crosstabs) Deal with new variables.
8476         (postcalc) Removed most of the meat and put it in new function
8477         output_pivot_table().
8478         (output_pivot_table) Calculates and outputs an entire pivot table.
8479
8480         * postscript.c: (postopen) Fix problems with free()ing addresses
8481         not obtained from malloc().
8482
8483         * som.c: (som_submit) Add assertion.
8484
8485         * sysfile-info.c: (describe_variable) Use new tab_nulls()
8486         function.
8487
8488         * tab.c: (static var tab_names[]) New.
8489         (tab_realloc) -1 for nc or nr indicates no change.
8490         (tab_nulls) New function.
8491         (tab_dim) Use tab_names[].
8492         (tabi_cumulate) Don't include bottom or right headers.  Furrfu.
8493         (evaluate_dimensions) Don't terminate on uninited cells, just put
8494         an X in them and emit a notice.  Use tab_names[].
8495
8496         * tab.h: Move bits into tab.def.
8497
8498         * tab.def: New.  Don't try to declare tab_table_class because then
8499         som.h has to be included.       
8500         
8501 Thu May  7 22:55:04 1998  Ben Pfaff  <blp@gnu.org>
8502
8503         * command.def: New file, contains all the command definitions
8504         previously included bodily in command.c.
8505
8506         * format.def: New file, contains all of the format definitions
8507         previously split across format.h, format.c, and sfm-write.c.
8508
8509         * lexer.h: Renamed from tokens.h in order to match corresponding
8510         .c file name.
8511
8512         * lexerP.h: Moved some rarely used functions exported by lexer.c
8513         into here.
8514
8515         * Makefile.am: Commemorate renamed files.
8516         (EXTRA_DIST) Add command.def, format.def.
8517
8518         * command.c: [0] (walk_cmdtable_func) Removed.
8519
8520         * crosstabs.q: (postcalc) Made it work and print out matrices
8521         proving it.
8522         (enum_column_values) Renamed enum_var_values, generalized for any
8523         variable.
8524
8525         * format.h: (struct fmt_desc) New member `spss'.
8526
8527         * q2c.c: (main) Generated code includes lexer.h instead of
8528         tokens.h.
8529
8530         * sfm-write.c: (write_format_spec) Use new spss member of fmt_spec
8531         instead of an independent translation table.
8532
8533 Tue May  5 13:19:03 1998  Ben Pfaff  <blp@gnu.org>
8534
8535         * Lots of source files: Added const to declarations.
8536
8537         * aggregate.c: (parse_aggregate_function) Rename inner i to j.
8538         
8539         * arena.c: (arena_clear) Set prev pointer to null when done.
8540
8541         * ascii.c: (ascii_option) Rename index as indx.
8542
8543         * avl.c: This is now a separate library called libavl.
8544         (xmalloc) Make static.
8545         (avl_probe) Step A7 can use the cache instead of an explicit
8546         compare.
8547         (avl_delete) Don't maintain a q pointer because it's always
8548         available in the pointer stack.  Comment fix.
8549
8550         * avl.h: This is now a separate library called libavl.
8551
8552         * command.c: (cmd_table[]) Remove spurious trailing "".
8553
8554         * common.h: Only include random() fix if this system needs it.
8555
8556         * crosstabs.q: Include alloca headers.
8557         (n_sorted_tab) New global var.
8558         (postcalc) Mostly rewritten.
8559         (find_pivot_extent) Rewritten.
8560         (enum_column_values) Rewritten.
8561
8562         * data-out.c: (convert_F) Rename inner n as n_spaces.
8563
8564         * error.c: (dump_message) Don't have an outer var i.
8565
8566         * file-handle.q: (static var f) Removed.  All references removed.
8567         (internal_cmd_file_handle) Uses a local variable instead of f.
8568
8569         * get.c: (trim_dictionary) Change scope of i, i1, i2.
8570         (cmd_match_files) Don't strcpy tokstr into sbc (why was this ever
8571         done?)
8572
8573         * getline.h: Declare getl_history as extern.  Reported by
8574         palme@uni-wuppertal.de (Hubert Palme).
8575
8576         * postscript.c: (postopen) Some large mods for constness.
8577
8578         * recode.c: Remove spurious copyrights since PSPP is owned by FSF
8579         anyway.
8580
8581 Fri Apr 24 12:52:47 1998  Ben Pfaff  <blp@gnu.org>
8582
8583         * Makefile.am: Rename BUILT_SOURCES to q_sources, all references
8584         changed.  Add avl.c, avl.h to pspp_SOURCES.  Remove avllib from
8585         LDADD.
8586
8587         * avl.c, avl.h: New files.  These form a clean-room
8588         reimplementation of avllib.  Iterative algorithms are used in
8589         place of recursive ones, so there is no resemblance in the code.
8590
8591         * Lots of headers: Don't include other headers by default.
8592
8593         * Lots of source files: Explicitly include all needed headers.
8594
8595         * arena.c: (arena_clear) New function.
8596
8597         * crosstabs.q: (ROW_VAR, COL_VAR) New enums.
8598         (static var ar) Removed.
8599         (staitc vars ar_tc, ar_col) New.
8600         (cmd_crosstabs) Destroy the arenas.
8601         (internal_cmd_crosstabs) Create the arenas.
8602         (precalc) Don't need a free function for the hash.
8603         (calc_general) Make sure to zero out the trailer on the key data
8604         before inserting.
8605         (print_table_entries) Updated.
8606         (postcalc) Worked on actually implementing.
8607         (find_pivot_extent) New function.
8608         (compare_value) New function.
8609         (enum_column_values) New function.
8610
8611         * data-in.c: (parse_month) Make local array `static const'.
8612         
8613         * data-out.c: (convert_date) Make local array `static const'.
8614         (convert_WKDAY) Same.
8615         (convert_MONTH) Same.
8616
8617         * frequencies.q: (postprocess_freq_tab) avl_walk_inorder() has
8618         been renamed to avl_walk().
8619         
8620         * hash.c: Rewritten more efficiently.
8621
8622         * hash.h: Add attribute const to hsh_next_prime declaration.
8623
8624         * lexer.c: (id_match) Make arguments const.
8625
8626         * postscript.c: (ps_postopen_driver) Make default fonts the
8627         Helvetica family.
8628
8629         * q2c.c: (main) Generated code needs stdlib.h.
8630
8631         * sfm-write.c: (write_value_labels) An avl_traverser needs to be
8632         initialized to 0 now, not to NULL.  All other references to
8633         avl_traverser were updated in the same way.
8634
8635         * tokens.h: Macro version of id_match updated to use const
8636         properly.
8637
8638         * val-labs.c: (inc_ref_count) New function.
8639         (copy_value_labels) Simply through use of new avl_copy() function.
8640
8641 Wed Apr 15 13:01:58 1998  Ben Pfaff  <blp@gnu.org>
8642
8643         * crosstabs.q: Probably doesn't compile.  New PIVOT subcommand.
8644         (postcalc) Worked on this.
8645
8646         * postscript.c: (OPO_DOUBLE_LINE) New enum.
8647         (struct ps_driver_ext) New line_width_thick member.
8648         (ps_preopen_drive) Init line_width_thick.
8649         (option_tab[]) Add line-* options.
8650         (ps_option) Parse line-* options.
8651         (postopen) Add line_width_thick support.  Strip leading spaces on
8652         prologue output lines.
8653         (ps_open_page) Include line_width_thick in output.
8654         (macro dump_thick_line) New.
8655         (dump_fancy_line) Support thick lines as well as double lines.
8656
8657 Tue Apr 14 00:50:08 1998  Ben Pfaff  <blp@gnu.org>
8658
8659         * Makefile.am: Add crosstabs.c to BUILT_SOURCES.  Add crosstabs.q
8660         to pspp_SOURCES.  Add crosstabs.q to EXTRA_DIST.
8661
8662         * Many source files: Rename `options' to `pv_opts' as appropriate.
8663
8664         * command.c: (static var cmd_table[]) Add CROSSTABS command.
8665
8666         * common.c: (xcalloc) New function.
8667
8668         * crosstabs.q: New file.  Not finished yet, though.
8669                 
8670         * data-list.c: Comment fix.
8671
8672         * error.c: Remove some old Checker cruft.
8673
8674         * frequencies.q: (dump_full) Cumulate valid percent instead of
8675         regular percent.
8676
8677         * getline.c: Comment fix.
8678
8679         * hash.c: Comment fixes.
8680
8681         * hash.h: (struct hsh_table) Make hash functions return unsigned
8682         instead of int to avoid problems with taking the modulo of
8683         negative return values.  All references changed.
8684
8685         * misc.c: (intlog10) Make its table static const instead of auto.
8686
8687         * sfm-read.c: (read_header) Make `prefix' static const instead of
8688         auto.
8689
8690         * var.h: (union value) Add member `hash'.
8691         (struct variable) Rename prv_index as `foo'--all references
8692         changed.  Reorder.
8693         (typedef pv_opts) Removed.  All references changed.
8694
8695         * vars-prs.c: (parse_variables) Message fixes.
8696         
8697 Mon Mar  9 15:35:08 1998  Ben Pfaff  <blp@gnu.org>
8698
8699         * get.c: (cmd_match_files) Don't reverse the order of FILEs as
8700         they are being inserted.  Don't check for BY variables of
8701         different types.  Discard variables if the active file isn't
8702         included in the merge.
8703         (mtf_processing) Essentially rewritten.
8704         (mtf_merge_dictionary) Check for master/slave variables of
8705         different types/widths.
8706
8707         * vfm.c: (static var not_canceled) New var.
8708         (process_active_file) Don't call vfm_source->read() if
8709         there's no vfm-source.  Initialize not_canceled.
8710         (process_active_file_write_case) Honor and update not_canceled.
8711         (prepare_for_writing) Rollback changes from yesterday, they were
8712         wrong.
8713         (close_active_file) Don't destroy vfm_source unless it exists.
8714         
8715 Mon Mar  9 00:56:16 1998  Ben Pfaff  <blp@gnu.org>
8716
8717         * Lots of source files: Added { } around nested if/else constructs
8718         to avoid new gcc 2.8 warnings.
8719
8720         * data-in.c: (parse_Z) Declare `int' type explicitly.
8721         (convert_Z) Ditto.
8722
8723         * get.c: (struct mtf_file) Add prev, next_min, by, input members.
8724         (cmd_match_files) Initialize mtf_by_values.  Manage by, input,
8725         prev members.  Put TABLEs at the end of the chain and FILEs at the
8726         beginning.  Don't allow the active file in STATE_INIT.  Use proper
8727         `seen' value for the active file.  Fill out the by members and
8728         make sure they're of consistent type.  Do the actual merge
8729         operation.
8730         (mtf_processing_finish) New function.
8731         (var_type_description) New function.
8732         (mtf_free_file) New function.
8733         (mtf_free) Rewritten.
8734         (mtf_delete_file_in_place) New function.
8735         (mtf_read_nonactive_records) New function.
8736         (mtf_compare_BY_values) New function.
8737         (static var mtf_seq_no) New var.
8738         (mtf_processing) New function.
8739         (mtf_merge_dictionary) Assign nval members for the system file
8740         dictionary.  Assign fv values for its variables.  Point each slave
8741         variable to the corresponding master variable.
8742
8743         * hash.c: Include str.h.
8744
8745         * mis-val.c: (copy_missing_values) src arg is const.
8746
8747         * misc.c: (spacing) Make `max' var explicitly int.
8748
8749         * sfm-read.c: (dump_dictionary) Message reformatting.
8750         (sfm_read_case) Add assertion.
8751
8752         * sort.c: Esthetic fixes.
8753
8754         * var.h: (struct match_files_proc) New struct.
8755         (struct variable) Add private data match_files_proc.
8756
8757         * vars-atr.c: (delete_variable) Implement.  Add argument for the
8758         dictionary that owning the variable.
8759         (dup_variable) Add assertion.
8760
8761         * vfm.c: Comment fixes, hopefully the comments are correct now.
8762         (process_active_file) New function.
8763         (process_active_file_write_case) New function.
8764         (process_active_file_output_case) New function.
8765         (prepare_for_writing) Use temp_dict->nval for vfm_info, not
8766         default_dict.nval.
8767         (write_case) Renamed procedure_write_case().  Now write_case is a
8768         pointer to a function.  Style fixes.
8769         
8770 1998-03-05  Ben Pfaff  <blp@gnu.org>
8771
8772         * Makefile.am: (q2c) Link with libmisc.
8773         (version.c) Define default_config_path, include_path,
8774         groff_font_path.
8775
8776         * ascii.c: (ascii_postopen_driver) When the default newline string
8777         is requested, open file in text mode.  Suggested by
8778         palme@uni-wuppertal.de (Hubert Palme).
8779         (static vars line_buf, line_p) Change from char * to unsigned char
8780         *.
8781         (ascii_close_page) char * to unsigned char *.
8782
8783         * cmdline.c: (parse_command_line) Implement -r option by
8784         prepending ~/.pspp/rc to the list of files to process.
8785
8786         * command.c: (cmd_remark) Reset getl_prompt to the standard prompt
8787         before pulling in a final line.
8788         (null_func, null_int_func) Removed (dead code).
8789
8790         * descript.q: (display) Calculate width of variable name column
8791         properly.  Calculate number of valid cases properly.  Reported by
8792         palme@uni-wuppertal.de (Hubert Palme).
8793
8794         * filename.c: (init_filename) Use default_config_path instead of
8795         now obsolete CONFIG_PATH.
8796
8797         * getline.c: (getl_initialize) Use include_path instead of now
8798         obsolete INCLUDE_PATH.
8799         (getl_add_file) New argument `where'.  All references changed.
8800
8801         * groff.c: (find_font_file) Use groff_font_path instead of now
8802         obsolete GROFF_FONT_PATH.
8803         
8804         * postscript.c: (find_ps_file) Use groff_font_path instead of now
8805         obsolete GROFF_FONT_PATH.  Copy through temporary variable to
8806         avoid problems with constness.
8807
8808         * str.h: (macro cs_streq) New macro.
8809
8810         * version.h: (glob var default_config_path, include_path,
8811         groff_font_path) New vars.
8812         
8813 1998-02-23  Ben Pfaff  <blp@gnu.org>
8814
8815         * Many source files: Change verbose_msg() priority levels and
8816         messages.
8817
8818         * aggregate.c: Include debug-print.h.
8819
8820         * cmdline.c: (parse_command_line) Add --safer/-s and --command/-c
8821         options.
8822         (static var pre_syntax_message) Document --safer/-s and
8823         --command/-c.
8824
8825         * command.c: (cmd_erase, cmd_host) Disable if set_safer is set.
8826
8827         * dfm.c: (open_inline_file) [__CHECKER__] Zero out ext->file,
8828         because it's not used but it's still copied.
8829         (open_file_r) Remove gratuitous debug message.
8830
8831         * filename.c: (safety_violation) New function.
8832         (open_file) Remove gratuitous debug messages.  Don't allow pipe
8833         files if set_safer is set.
8834
8835         * get.c: Turn off debugging.
8836
8837         * getline.c: (getl_add_virtual_file) New function.
8838         (getl_read_line) Add verbose_msg() call for opening new syntax
8839         file.
8840         (getl_perform_delayed_reset) Add a return value describing whether
8841         any action was taken.  Call reset_eof().
8842
8843         * getline.h: Comment fix.
8844
8845         * groff-font.c: (groff_read_font) Use `goto next_iteration' in
8846         place of incorrect `continue'.  Use strtok_r() instead of
8847         strtok().  Always check strtok_r() return value.
8848         (groff_read_DESC) Use strtok_r() instead of strtok().
8849
8850         * lexer.c: (reset_eof) New function.
8851
8852         * main.c: (parse) Get a token after performing a delayed reset
8853         action; allow empty syntax files.
8854
8855         * postscript.c: (output_encodings) Use strtok_r() instead of
8856         strtok().
8857
8858         * q2c.c: (dump_parser) Use strtok_r() instead of strtok().
8859
8860         * set.q: Comment fixes.
8861         (glob var set_safer) New var.
8862         (internal_cmd_set) Support SAFER.
8863
8864         * str.h: [!HAVE_STRTOK_R] Declare strtok_r() prototype.
8865
8866         * temporary.c: (free_dictionary) Set d->splits to NULL after
8867         freeing.
8868
8869         * vars-atr.c: (clear_variable) Decrement dict->n_splits if
8870         variable deleted, not if it *isn't* deleted.
8871
8872 1998-02-16  Ben Pfaff  <blp@gnu.org>
8873
8874         * command.c: (array cmd_table[]) Add MATCH FILES.
8875
8876         * common.c: Comment fixes.
8877
8878         * data-list.c, dfm.c, error.c, filename.c, list.q, matrix-data.c,
8879         modify-vars.c, postscript.c, sfm-read.c, sfm-write.c, tab.c:
8880         Include alloca.h.  Problem reported by palme@uni-wuppertal.de
8881         (Hubert Palme).
8882
8883         * expr-opt.c: Include str.h.  Problem reported by
8884         palme@uni-wuppertal.de (Hubert Palme).
8885
8886         * get.c: (cmd_get) [DEBUGGING] Update v->p.get to v->get.
8887         (static var mtf_by) Change from char ** to variable **.
8888         (static var mtf_master) New var.
8889         (mtf_merge_dictionary) New function.
8890         (cmd_match_files) Init mtf_master.  Parse mtf_by according to new
8891         var type.  Reorder tests properly.  Initialize file->dict.  Detect
8892         TABLE= without BY=.  Read file dictionaries and merge them.  Give
8893         subcommand name with IN, LAST, FIRST error messages.  Create IN,
8894         LAST, FIRST variables.  Comment fixes.
8895         (mtf_free) Don't free default_dict.  Free mtf_master.
8896
8897         * getline.c: Define getl_mode.  Change getl_buf_size to size_t
8898         from int.
8899         (handle_line_buffer) Cast int to size_t in comparison to avoid
8900         warning.
8901
8902         * getline.h: Declare getl_mode extern.
8903
8904         * groff-font.c: (groff_read_font) Type-fix calls to getline.
8905         (groff_read_DESC) Make line_size a size_t.
8906         (match_tok) Parenthesize name to avoid macro expansion.
8907
8908         * mis-val.c: (copy_missing_values) New function.
8909
8910         * postscript.c: (postopen) Make buf_size a size_t.
8911
8912         * sfm-read.c: (dump_dictionary) Make global from static.  Print
8913         variable info in parts for easier debugging with Checker.
8914
8915         * temporary.c: (copy_variable) Use copy_value_labels().
8916         (new_dictionary) New arg: whether to copy file label, documents.
8917
8918         * val-labs.c: (copy_value_labels) New function.
8919
8920         * var.h: (enums MISSING_*) Add MISSING_COUNT.
8921
8922         * vars-atr.c: [GLOBAL_DEBUGGING] (force_dup_variable) New
8923         function.
8924         (dup_variable) Set prv_index, get.fv, get.nv.
8925
8926 Fri Feb 13 15:38:36 1998  Ben Pfaff  <blp@gnu.org>
8927
8928         * Makefile.am: (pspp_SOURCE) Add htmlP.h.
8929
8930         * Many source files: For ANSI-compliance, add empty statement
8931         after label.  Reported by palme@uni-wuppertal.de (Hubert Palme)
8932         and Micah Altman <maltman@www-vdc.fas.harvard.edu>.
8933
8934         * data-in.c: (parse_numeric) Some header files break on
8935         -DBL_MIN_10_EXP because they get a --; add () for safety.
8936         Reported by palme@uni-wuppertal.de (Hubert Palme).
8937
8938         * dfm.c: Idea by Dr Eberhard W Lisse <el@linux.lisse.na>.
8939         (struct dfm_fhuser_ext) Change `file' from FILE * to file_ext.
8940         (dfm_close) Use close_file_ext.
8941         (open_inline_file) Set file.file to NULL, not file.
8942         (open_file_r, open_file_w) Initialize file.file; fill in file_ext
8943         struct and use open_file_ext().
8944         (read_record) Use file.file.
8945
8946         * file-handle.q: (prepend_current_directory) Pass through special
8947         filenames.
8948
8949         * filename.c: Only include unistd.h if HAVE_UNISTD_H.
8950         (normalize_filename) Pass through special filenames.
8951         (open_file, close_file) Accept pipe| and |pipe syntaxes as
8952         equivalent.
8953         (dirname) Rename blp_dirname() because of name conflict on some
8954         OS.  All references changed.  Reported by palme@uni-wuppertal.de
8955         (Hubert Palme).
8956         (is_special_filename) New function.
8957
8958         * get.c: (GTSV_OPT*) Add GTSV_OPT_MATCH_FILES.
8959         (trim_dictionary) Conditionalize some of the options on whether
8960         GTSV_OPT_MATCH_FILES is in *options.
8961         (rename_variables) Don't allow variables to be renamed as scratch
8962         variables.
8963         (MTF_*) New enum series.
8964         (struct mtf_file) New struct.
8965         (static vars mtf_head, mtf_tail, mtf_by, mtf_n_by, mtf_free) New
8966         vars.
8967         (cmd_match_files, mtf_free) New functions.
8968
8969         * lexer.c: (match_int) Needed parentheses around name to escape
8970         macro expansion.  Reported by Micah Altman
8971         <maltman@www-vdc.fas.harvard.edu>.
8972
8973         * print.c: Needed to include alloca.h.  Reported by Micah Altman
8974         <maltman@www-vdc.fas.harvard.edu>.
8975
8976         * recode.c: (convert_to_double) Parenthesize -DBL_MIN_10_EXP to
8977         -(DBL_MIN_10_EXP).  Reported by palme@uni-wuppertal.de (Hubert
8978         Palme).
8979         
8980         * str.h: Include stdarg.h.  Reported by palme@uni-wuppertal.de
8981         (Hubert Palme) and Micah Altman <maltman@www-vdc.fas.harvard.edu>.
8982
8983 Thu Feb  5 00:18:21 1998  Ben Pfaff  <blp@gnu.org>
8984
8985         * html.c: (struct html_driver_ext) Move into htmlP.h.
8986         (html_preopen_driver) Initialize cp_x, cp_y.
8987         (html_submit) Implement as call to output_tab_table().
8988         (change_attributes) New function.
8989         (escape_string) New function.
8990         (output_tab_table) New function.
8991
8992         * list.q: (write_all_headers) Add code for writing headers for the
8993         html driver.
8994         (clean_up) Write out the html close-table tag.
8995         (determine_layout) Ignore html driver.
8996         (list_cases) Write html data.
8997
8998         * som.c: (som_submit) Move more of the code into output_table().
8999
9000         * tab.c: (static var hit) Make a global var and rename tab_hit.
9001         (static var tab_table_class) Make a global var.
9002
9003         * htmlP.h: New file.
9004
9005 Tue Feb  3 16:12:18 1998  Ben Pfaff  <blp@gnu.org>
9006
9007         * dump-sysfile.c: Removed.
9008
9009         * html.c: (preclose) Change comment in emitted code.
9010
9011         * matrix-data.c: Debugging off by default.  Comment fixes.
9012         (static var container) New var.
9013         (cmd_matrix_data) Create and destroy container.  Initialize
9014         is_per_factor[] to 0s.  Move code into new function
9015         string_to_content_type().  Require split values to be present in
9016         the data when ROWTYPE_ is explicit.  Call specific function, not
9017         general read_matrices().
9018         (string_to_content_type) New function.
9019         (context) Exclude all whitespace, not just spaces.
9020         (mget_token) A dot is a number.  Add assertion.
9021         (static var data) Renamed nr_data.
9022         (static var factor_values) Renamed nr_factor_values.
9023         (read_matrices) Renamed read_matrices_without_rowtype().  Handle
9024         only specific case.  Close data_file before exit.
9025         (fill_matrix) New function.
9026         (read_data_lines) Renamed nr_read_data_lines().  Remove debug
9027         printing.  Style fixes.  Message fixes.  Move code into
9028         fill_matrix().
9029         (read_matrices_without_rowtype) Rename
9030         matrix_data_read_without_rowtype().  Fix off-by-one error on
9031         loops.  Allocate nr_data[] memory from arena.
9032         (read_matrices_with_rowtype) Removed.
9033         (read_splits) Renamed nr_read_splits().  Style fixes.
9034         (read_factors) Renamed nr_read_factors().
9035         (dump_cell_content) Comment fixes.  Arguments changed.  Change
9036         debug printing.  All references changed.
9037         (output_data) Renamed nr_output_data().
9038         (static var wr_content) New var.
9039         (struct factor_data) New struct.
9040         (static var wr_data) New var.
9041         (static var wr_current) New var.
9042         (matrix_data_source_destroy_source) Removed.
9043         (read_matrices_with_rowtype) New function.
9044         (matrix_data_read_with_rowtype) New function.
9045         (wr_read_splits) New function.
9046         (compare_factors) New function.
9047         (wr_output_data) New function.
9048         (wr_read_rowtype) New function.
9049         (wr_read_factors) New function.
9050         (wr_read_indeps) New function.
9051         (glob var matrix_data_source) Make destroy_source member NULL as
9052         well.
9053
9054 Fri Jan 23 00:09:08 1998  Ben Pfaff  <blp@gnu.org>
9055
9056         * lexer.c: (syntax_error) Give better error message when at end of
9057         file.
9058
9059         * matrix-data.c: (var content_names[]) Fix PROX spelling.  Change
9060         N_SCALAR to output as plain N.
9061         (mdump_token) Change output format.
9062         (context) Fix message output interaction with spaces in input.
9063         (another_token) New function.
9064         (force_eol) Improved error message.
9065         (static var max_cell_index) New var.
9066         (read_matrices) Init `cells'.  factor_values is now per-cell.
9067         Init max_cell_index.
9068         (read_data_lines) Replace `compare' local with new `compare' arg.
9069         Debugging messages changed.  Only read factors if per_factor.
9070         Propagate error return from read_factors(), force_eol().
9071         Copy N_SCALAR values across the N vector.
9072         (read_matrices_without_rowtype) Don't init `cells'.  Don't need to
9073         check parentheses manually since we now have is_per_factor[].
9074         Call read_data_lines() with new args.  Check for end of data after
9075         looping, using another_token().
9076         (read_factors) Arguments changed.  Use max_cell_index to determine
9077         whether to read or compare factors.  Message fixes.
9078         (dump_cell_content) New function.
9079         (output_data) Completely rewritten because content types were
9080         supported to be nested inside factor values, not vice versa.
9081         
9082 Thu Jan 22 00:26:38 1998  Ben Pfaff  <blp@gnu.org>
9083
9084         * lexer.c: (syntax_error) Support formatted varargs messages.
9085
9086         * matrix-data.c: Turn debugging on by default.
9087         (static content_type[]) New array.
9088         (static content_names[]) New array.
9089         (static rowtype_, varname_) New vars.
9090         (static is_per_factor[]) New array.
9091         (static split_values) Moved declaration.
9092         (static n_continuous, first_continuous) New var.
9093         (cmd_matrix_data) Don't init split_values.  Assign ROWTYPE_ to
9094         rowtype_.  Simplify SPLIT code.  Init is_per_factor[].  Assign
9095         VARNAME_ to varname_.  Initialize first_continuous, n_continuous.
9096         Check for continuous variables.
9097         [DEBUGGING] (debug_print) Remove content_names[].
9098         (mdump_token) New macro.
9099         (mget_token_dump) New function.
9100         (mdump_token) New function.
9101         (context) New function.
9102         (mget_token) Fix messages.
9103         (static var data, split_values, factor_values) New vars.
9104         (read_matrices) Manage split_values, factor_values.
9105         (read_data_lines) New function.
9106         (read_matrices_without_rowtype) Implemented.
9107         (read_splits) Message fixes.  Uses `just_read'.
9108         (read_factors) New function.
9109         (output_data) New function.
9110         (matrix_data_source_destroy_source) Close the file handle.
9111         (glob var matrix_source) Change name from "DATA LIST" to "MATRIX
9112         DATA".
9113
9114         * str.c: (strpadcmp) Removed.
9115
9116         * vfm.c: (dump_splits) Initialize i; fix test for end of splits.
9117
9118 Sun Jan 18 00:30:59 1998  Ben Pfaff  <blp@gnu.org>
9119
9120         * Lots of source files: Add cast to unsigned character to calls to
9121         tolower() and toupper().
9122
9123         * aggregate.c: Set default_dict.splits to NULL.
9124
9125         * command.c: (static variable tab[]) Add MATRIX DATA.
9126
9127         * data-in.c: Add debugging defines.  Formatting fixes.
9128
9129         * expr-opt.c: Formatting fixes.
9130
9131         * lexer.c: (syntax_error) Message fixes.
9132
9133         * matrix-data.c: New enum series.
9134         (static vars fmt, section, diag, explicit_rowtype, signle_split,
9135         split_values, n_factors, factors, cells, pop_n, contents,
9136         n_contents) New vars.
9137         (cmd_matrix_data) Finished implementation.
9138         (compare_variables_by_mxd_vartype) New function.
9139         [DEBUGGING] (debug_print) New function.
9140         (static vars mtoken, mtokstr, mtoklen, mtokval) New vars.
9141         (read_matrices) New function.
9142         (read_matrices_without_rowtype) New function.
9143         (read_matrices_with_rowtype) New function.
9144         (read_splits) New function.
9145         (mget_token) New function.
9146         (force_eol) New function.
9147         [0] (test_tokenizer) New function.
9148         (matrix_data_source_destroy_source) New function.
9149         (glob var matrix_data_source) New var.
9150
9151         * misc.h: Include ieeefp.h if present.
9152
9153         * split-file.h: (cmd_split_file) Changes corresponding to struct
9154         dictionary changes.
9155
9156         * str.h: Fix memmem prototype.
9157
9158         * temporary.c: (save_dictionary, restore_dictionary,
9159         free_dictionary) Changes corresponding to struct dictionary
9160         changes.
9161
9162         * var.h: (MXD_* enums) New enum series.
9163         (struct matrix_data_proc) New struct.
9164         (struct split) Removed.
9165         (struct dictionary) Changed `splits' member from `split *' to
9166         `variable **'.
9167         (macro force_create_variable) New macro.  Replaced lots of
9168         create_variable()/assert() calls with calls to this macro.
9169
9170         * vars-atr.c: (discard_variables) Changed assertion.
9171         [GLOBAL_DEBUGGING] (force_create_variable) New function
9172         called by the macro of the same name.
9173         (clear_variable) Changes to delete splits from the dictionary
9174         corresponding to struct dictionary changes.
9175
9176         * vars-prs.c: (parse_variables) [GLOBAL_DEBUGGING] Check for
9177         corrupted variable `index' values in the dictionary passed in
9178         every time this function is called.
9179
9180         * vfm.c: (dump_splits, SPLIT_FILE_procfunc) Changes corresponding
9181         to struct dictionary changes.
9182
9183 Tue Jan 13 23:45:02 1998  Ben Pfaff  <blp@gnu.org>
9184
9185         * Makefile.am: (pspp_SOURCES) Add matrix-data.c.
9186
9187         * command.c: New includes.
9188         (static array cmd_table[]) Add ERASE, HOST, NEW FILE.
9189         (cmd_erase) New function.
9190         [unix] (shell) New function.
9191         (run_command) New function.
9192         (cmd_host) New function.
9193         (cmd_new_file) New function.
9194
9195         * expr-prs.c: (parse_primary) Message fix.
9196
9197         * inpt-pgm.c: Formatting fix.
9198         (cmd_reread) Implement the FILE subcommand.
9199
9200         * matrix-data.c: New file.
9201
9202         * q2c.c: (dump_header) Change output commenting style.
9203
9204         * weight.c: Comment fix.
9205
9206 Tue Jan 13 00:53:39 1998  Ben Pfaff  <blp@gnu.org>
9207
9208         * aggregate.c: (buf64_10x) Renamed buf64_1xx, all references
9209         changed.
9210         (buf_10x) Renamed buf_1xx, all references changed.
9211         (cmd_aggregate) Implemented cases 010, 011, 110, and 111 (all
9212         cases now implemented).
9213         (create_sysfile) New function.
9214         (agr_11x_func) New function.
9215
9216         * data-in.c: (parse_numeric) Work properly if there's an
9217         explicitly coded decimal point in the data and decimal places are
9218         specified on DATA LIST.  Bug reported by Dr Eberhard W Lisse
9219         <el@linux.lisse.na>.
9220
9221         * get.c: (cmd_get, cmd_save_internal) Allow extraneous slash
9222         before file specification on GET, SAVE, XSAVE.  Bug reported by Dr
9223         Eberhard W Lisse <el@linux.lisse.na>.
9224
9225         * q2c.c: [!HAVE_STRERROR] Include misc/strerror.c, not
9226         strerror.c.  Bug reported by Alexandre Oliva
9227         <oliva@dcc.unicamp.br>.
9228
9229         * sort.c: Include sort.h.  Comment fixes.  A few esthetic fixes.
9230         (static var separate_case_tab) New var.
9231         (cmd_sort_cases) Cancel temporary transformations here.  Free
9232         v_sort before return.
9233         (sort_cases) Run an EXECUTE procedure if SEPARATE is nonzero and
9234         we're reading from a sort stream.  Don't cancel temporary
9235         transformations.  Offload internal sorting to do_internal_sort().
9236         (do_internal_sort) New function.  Handles internal sorting even
9237         when SEPARATE is nonzero.  Doesn't free v_sort.
9238         (do_external_sort) Take new arg SEPARATE.  Only destroy `x' if
9239         it's non-NULL.
9240         (write_initial_runs) Take new arg SEPARATE.  Only destroy the old
9241         sink if SEPARATE is zero.
9242         (read_output_cases) Renamed read_sort_output(), all references
9243         changed.  Now uses separate_case_tab when it exists.
9244         (write_separate) New function.
9245
9246         * vfm.c: (page_to_disk) Destroy memory_source_cases, not
9247         memory_sink_cases.  Don't redundantly call
9248         vfm_source->destroy_source().
9249         (memory_stream_mode) After switching over, set memory_sink_cases
9250         to NULL.
9251
9252 Sat Jan 10 23:35:51 1998  Ben Pfaff  <blp@gnu.org>
9253
9254         * aggregate.c: (struct agr_var) Expand dbl[] array from 2 to 3
9255         elements.
9256         (static var prev_case) New, moved out of aggregate_single_case()
9257         local scope.
9258         (static var buf64_10x, buf_10x) New.
9259         (cmd_aggregate) Initialize prev_case.  Comment fixes.  Implement
9260         the 000, 001, 100, and 101 cases.  Free prev_case.
9261         (parse_aggregate_functions) Disallow scratch variables.
9262         (free_aggregate_functions) Only free agr_dict if non-null.  Use
9263         iter->function to determine numeric/string type, not
9264         iter->src->type.
9265         (aggregate_single_case) Don't manage prev_case.  Initialize
9266         aggregate info after dumping it.
9267         (accumulate_aggregate_info) Fix sum, weighted sum, mean, weighted
9268         mean, stddev, weighted stddev definitions.
9269         (dump_aggregate_info) Implemented.
9270         (initialize_aggregate_info) Renamed from
9271         initialize_aggregate_functions().  Initializes dbl[2].
9272         (agr_00x_trns_proc, agr_00x_end_func, write_case_to_sfm,
9273         agr_10x_trns_proc, agr_10x_trns_free, agr_10x_end_func) New.
9274
9275         * cases.c: (alloc_val) Removed.
9276
9277         * get.c: (cmd_save_internal) Initialize new `dict' member.
9278
9279         * sfm-write.c: (sfm_write_dictionary, write_header,
9280         write_variable, write_value_labels, write_documents) Reorganize,
9281         simplify for new parameter structure.
9282         (write_variable) Only one variable * argument now.
9283
9284         * sfm.h: (struct sfm_write_info) Removed `pri', `sec', and
9285         replaced by new `dict' member.
9286
9287         * temporary.c: (new_dictionary) Initialize n_documents.
9288
9289         * vars-atr.c: (dup_variable) Allocate `value's from dict into
9290         v->fv manually.
9291         (init_variable, replace_variable) Eliminate usage of alloc_val().
9292
9293         * vars-prs.c: (parse_DATA_LIST_vars) Accept PV_NO_SCRATCH option.
9294
9295         * vfm.c: (arrange_compaction) Allow `temporary' value of 2 to
9296         signal that AGGREGATE is to be used for forming final cases.
9297         (close_active_file) Call end_func before stopping lagging.  Cancel
9298         temporary after finishing compaction.
9299         (write_case) Comment fixes.  Cleaned up.
9300         (compact_case) Let AGGREGATE handle compaction when `temporary' is
9301         2.
9302
9303 Sat Jan 10 02:10:47 1998  Ben Pfaff  <blp@gnu.org>
9304
9305         * Makefile.am: (BUILT_SOURCES) Add means.c.
9306         (pspp_SOURCES) Add means.c.
9307         (EXTRA_DIST) Add means.q.
9308
9309         * command.c: (array cmd_table[]) Add MEANS.
9310
9311         * common.h: Esthetic fixes.  Comment fixes.  Test for
9312         MAX_SHORT_STRING greater than 8.
9313         (macros LOWEST, HIGHEST) New.
9314
9315         * data-in.c, data-list.c, recode.c: Comment fixes.
9316
9317         * means.q: New file, base version.
9318
9319         * mis-val.c: (parse_num_or_range, parse_numeric) Replace -DBL_MAX
9320         with LOWEST, DBL_MAX with HIGHEST.
9321
9322         * q2c.c: (dump_vars) Add an enum to array types giving the number
9323         of values for the enum.
9324
9325         * sfm-read.c: (sfm_read_dictionary, read_machine_flt64_info)
9326         Replace second_lowest_value with second_lowest_flt64.
9327
9328         * sfm-write.c: (write_variable, write_rec_7_34) Replace
9329         second_lowest_value with second_lowest_flt64.
9330
9331         * t-test.q: Comment fix.
9332
9333         * temporary.c: (restore_dictionary) Esthetic fix.
9334
9335         * tokens.h: (force_match_id, force_match, force_string, force_int,
9336         force_num, force_id) Replace msg() with syntax_error().
9337
9338         * var.h: (struct means_proc) New.
9339         (struct variable) Add mns member to `p' union.
9340
9341         * vars-prs.c: (parse_variable, parse_dict_variable,
9342         parse_variables, parse_DATA_LIST_vars) Replace msg() with
9343         syntax_error().
9344
9345 Thu Jan  8 22:28:41 1998  Ben Pfaff  <blp@gnu.org>
9346
9347         * Makefile.am: (pspp_SOURCES) Add tab.h.
9348
9349         * Most source files: Added a cast to unsigned char in usages of
9350         the ctype is*() functions.  Replaced `end of command expected'
9351         calls to msg() with calls to syntax_error().
9352
9353         * frequencies.q: (dump_condensed) Fix tab_dim() column reference.
9354
9355         * lexer.c: (hex_val) Removed (was dead code).
9356         (idmatch) Parenthesize function name to avoid macro expansion.
9357
9358         * postscript.c: Comment fixes.
9359         (ps_preopen_driver) Change default font size to 10pt.
9360
9361         * sfm-read.c: (read_variables) Byteswap sv.print, sv.write as
9362         int32s.
9363         (parse_format_spec) Change system-file format spec argument type
9364         to int32.  Parse the format spec with bitwise operators.
9365
9366         * sfmP.h: (struct sysfile_format) Removed.
9367         (struct sysfile_variable) Changed print, write members from
9368         sysfile_format to int32.
9369
9370         * tokens.h: Esthetic fixes.
9371         [__GNUC__] (macro id_match) New macro to hopefully speed up
9372         identifier matching.
9373         (macros match_id, match_tok, match_int) Implemented in
9374         compiler-independent manner; no longer GNU C only.
9375
9376         * vfm.h: Include time.h.
9377
9378 Mon Jan  5 11:06:15 1998  Ben Pfaff  <blp@gnu.org>
9379
9380         * data-list.c: (dump_fixed_table) Change tab_dim().
9381
9382         * dump-sysfile.c: (open_sysfile) Fix mmap() call.
9383
9384         * error.c: Include command.h.
9385
9386         * frequencies.g: Formatting fixes.
9387
9388         * frequencies.q: Add tab_dim() calls.  Make the total cell a
9389         joined cell.
9390
9391         * glob.c: Include command.h.
9392
9393         * sfm-read.c: (struct sfm_fhuser_ext) New members sysmis, highest,
9394         lowest.
9395         (sfm_read_dictionary) Initialize sysmis, highest, lowest.
9396         (sfm_read_machine_flt64_info) Update sysmis, highest, lowest.
9397         (read_variables) Byteswap sv.type; byteswap sv.print, sv.write as
9398         the other elements (is this right?).
9399         (read_variables) Use lowest, highest members.
9400         (parse_format_spec) New arg `vv' for more stringent checking.
9401         (dump_dictionary) Byteswaps nonexplicit data.
9402         (sfm_read_case) Byteswap numeric data.
9403
9404         * som.c: Initialize table_num to 1.
9405         (render_segments) Remember to increment y_index after each table
9406         segment.
9407
9408         * sysfile-info.c: (cmd_sysfile_info) Change tab_dim().  Don't call
9409         avl_count() on a NULL tree.  No title for the second table.
9410         (cmd_display) Handle DISPLAY VECTORS by calling display_vectors().
9411         Handle AS_SCRATCH as AS_NAMES.  Warn if no variables.  Re-enable;
9412         fix call to display_variables().
9413         (display_variables) Default to 4 columns, not 3.  Set up headers.
9414         Column title is Variable, not Name.  Fix index column.
9415         Add joint text.  Add tab_dim().  Handle value labels properly.
9416         Handle DISPLAY LABELS properly.  Draw boxes correctly.
9417         (describe_variable) Value labels don't need titles.  Don't clear
9418         nonexistent index column.
9419         (compare_vectors_by_name) New function.
9420         (display_vectors) New function.
9421
9422         * tab.c: (tab_height) Add assertion.
9423         (tab_null) Add debug code.
9424         (evaluate_dimensions) Add debug code.
9425
9426         * var.h: (struct variable) get_proc data is sometimes used
9427         simultaneously with other per-procedure info, therefore it was
9428         removed from the union.  All references changed.        
9429
9430 Sun Jan  4 18:13:33 1998  Ben Pfaff  <blp@gnu.org>
9431
9432         * ascii.c: (ascii_close_page) Put title on second line of headers
9433         if there is no subtitle.
9434
9435         * command.c: (glob var cur_proc) Move definition here, from
9436         common.c.
9437         (cmd_remark) Emit blank line before remarks.
9438
9439         * command.h: (glob var cur_proc) Move declaration here, from
9440         common.h.
9441
9442         * data-list.c: (dump_fixed_table) Fix messages.
9443         (dump_free_table) Call tab_nat_dim().
9444
9445         * descript.q: (dump_z_table) Modify tab_dim() call.
9446
9447         * frequencies.q: (dump_condensed, dump_statistics) Add tab_dim()
9448         call.
9449         (dump_statistics) Don't output header.
9450
9451         * groff-font.c: Minor format fix.
9452
9453         * html.c: Comment fix.
9454
9455         * list.q: (write_varname) Indent after advancing page.
9456
9457         * output.h: Minor reordering.
9458
9459         * postscript.c: Comment fixes.  Many places, '\n' was replaced by
9460         a reference to eol[].
9461         (struct ps_driver_ext) New member eol[].
9462         (ps_preopen_driver) Initialize eol[].
9463         (ps_postopen_driver) Fix sense of text for text_opt, line_opt
9464         defaults.  Handle headers.  Fix test for minimum page length.
9465         (static var option_tab[]) Add `line-ends'.
9466         (ps_option) Handle line-ends to change eol[].
9467         (postopen) Scale prop_em_width and fixed_width properly.  Set the
9468         prologue title to outp_title if applicable.  Replace the prologue
9469         line ends with eol[].  Call draw_headers() if headers are enabled.
9470         (text_width) New function.
9471         (out_text_plain) New function.
9472         (draw_headers) New function.
9473
9474         * print.c: (dump_table) Call tab_nat_dim().
9475
9476         * som.c: (som_blank_line) Only advance a line if not at the top of
9477         a page.
9478         (som_submit) Move several informational table calls here.
9479         Increment subtable_num if SOMF_NO_TITLE not set.
9480         (output_table) Advance a line if SOMF_NO_SPACING not set.
9481         (render_columns, render_segments, render_simple) Handle spacing
9482         between tables.  Handle table titles.  Remove debug output.
9483
9484         * som.h: (SOMF_*) New enum series.
9485         (struct som_table_class) New member `flags'.
9486
9487         * sysfile-info.c: (cmd_sysfile_info) Calls tab_nat_dim().  No
9488         headers or spacing.
9489         (display_variables) Calls tab_nat_dim().
9490         (describe_variable) Remove restriction on number of value labels.
9491         Make value labels separated by thin lines.
9492
9493         * tab.c: (tab_create) Default `flags' to none.
9494         (tab_float) New arg `w'.  All references changed.
9495         (tab_nat_dim) New function.
9496         (tab_output_text) No title or spacing.
9497         (tab_flags) New function.
9498         (tabi_flags) New function.
9499         (tabi_title) New function.
9500         (strip_height) Removed.
9501         (tabi_render) Skip title when necessary.
9502         (static var tab_tab_class) Add tabi_flags, tabi_title.
9503         (evaluate_dimensions) Disable display of column, row size.
9504         (sum_columns) Add title height to top header.
9505         (render_strip) Moved within file.
9506
9507         * tab.h: (struct tab_table) New member `flags'.
9508
9509         * vfm.c: (dump_splits) Calls tab_nat_dim().  No title.
9510
9511 Sat Jan  3 16:55:44 1998  Ben Pfaff  <blp@gnu.org>
9512
9513         * Most source files: Add `const' attribute in all appropriate
9514         places.
9515         
9516         * sysfile-info.c: (cmd_sysfile_info) Add tab_dim() call, add a
9517         column to the variables table for use by describe_variable().
9518         (cmd_display) Disable for the present.
9519         (display_documents) Don't wrap documents.
9520         (display_variables) Table has four columns now.
9521         (describe_variable) Table has four columns now.  Don't use a
9522         subtable, use joined cells instead.
9523
9524         * tab.c: (tab_create) Don't set `join'.
9525         (tab_realloc) ct array is not made up of a_string's.
9526         Reallocate trh, hrh, h arrays, initialize trh array.  Initialize
9527         cell contents on GLOBAL_DEBUGGING, not DEBUGGING.
9528         (text_format) New function.
9529         (tab_title) Rewritten, uses text_format().
9530         (tab_text) Rewritten, uses text_format().
9531         (tab_joint_text) New function.
9532         (tab_join) Removed.
9533         (static var hit) New variable.
9534         (render_strip) New args r1, r2.  Implement joined cells that fit
9535         on a single page.
9536         (tabi_render) Increment hit.  Pass new args to render_strip().
9537         (evaluate_dimensions) [GLOBAL_DEBUGGING] Check for uninitialized
9538         cells.  For t_naw and t_nah, ignore joined cells and null cells in
9539         calculations.
9540         
9541         * tab.h: (struct tab_join_rect) Removed.
9542         (struct tab_table) Removed `join'.
9543         (TAB_JOIN_MAIN) Removed.
9544         (struct tab_joined_cell) New struct.
9545         (TAT_NOWRAP) New enum.
9546
9547 Fri Jan  2 01:39:58 1998  Ben Pfaff  <blp@gnu.org>
9548
9549         * ascii.c: (ascii_postopen) Replace ASCII_* macros with their
9550         expansions.
9551         (ascii_postopen_driver) Fix initialization of *_spacing so that
9552         the TAL_0 bit doesn't count.
9553
9554         * data-list.c: (dump_fixed_table) Use natural width for Format
9555         column.
9556
9557         * glob.c: (rerange) Removed.
9558         (get_date) Formatting fixes.  Internationalization fix.
9559
9560         * html.c: (html_postopen_driver) Replace HTML_DEFAULT_OUTPUT_FILE
9561         with "pspp.html".
9562
9563         * postscript.c: (ps_postopen_driver) Replace
9564         PS_DEFAULT_OUTPUT_FILE with "pspp.ps".
9565
9566         * som.c: (som_submit) Don't eject page before every table.
9567         (output_table) Fix order of arguments on call to area().
9568         (render_columns) Fix calculation of max_len.
9569         
9570         * tab.c: (tabi_cumulate) Minor change to increase elegance.
9571         (render_strip) New function.
9572         (strip_height) New function.
9573         (tabi_render) Rewrite as calls to render_strip().
9574
9575         * tab.h: (TAT_* enums) Removed TAT_RICH, all references removed.
9576         Renumbered TAT_PRINTF, TAT_TITLE, TAT_FIX to correspond better
9577         with the TAB_* and OUTP_T_* constants.
9578         
9579 Thu Jan  1 11:53:52 1998  Ben Pfaff  <blp@gnu.org>
9580
9581         * Makefile.am: Formatting fixes.
9582
9583         * ascii.c: (ascii_postopen_driver) Initialize *_line_spacing[],
9584         *_line_width[].
9585
9586         * data-list.c: (dump_fixed_table) Add tab_dim() call.
9587
9588         * descript.q: (dump_z_table, display) Add tab_dim() calls.
9589
9590         * dump-sysfile.c: (glob var length) Make type off_t.
9591         (usage) Fix arguments.
9592         (main) Return 0.
9593
9594         * output.h: (OUTP_T_*) Change constants' value to match tab.h.
9595         Now right-justification is the default so many references had to
9596         change.
9597         (struct outp_class) Removed line_width, all references changed.
9598         (OUTP_DEV_*) Add OUTP_DEV_DISABLED.
9599         (struct outp_driver) Add elements horiz_line_width,
9600         vert_line_width, horiz_line_spacing, vert_line_spacing.  Remove
9601         som element.
9602
9603         * postscript.c: (outp_encodings) Formatting fixes.  Fix garbage
9604         collection.
9605         (postopen) Initialize all the informational members of
9606         outp_driver.
9607
9608         * som.c: (som_blank_line) New function, renamed from blank_line(),
9609         all references changed.
9610         (som_submit) Disables drivers whose pages can't be opened.
9611         (render_columns, render_simple, render_segments) Add debug output.
9612         (render_columns) Fix loop range.
9613         (render_simple) Don't try to render the headers, they're taken
9614         care of automatically.  Advance cp_y past the table when done.
9615         (render_segments) Fix loop ranges.
9616
9617         * tab.c: Initialize new members of tab_table.
9618         (tab_vline) Handle trv[]; don't set style for spacing-only lines.
9619         (tab_hline) Handle trh[]; don't set style for spacing-only lines.
9620         (tab_box) Handle trh[], trv[]; don't set style for spacing-only
9621         lines.
9622         (set_expr) Removed.
9623         (tab_dim) New function.
9624         (tab_col_width) Removed.
9625         (tab_row_height) Removed.
9626         (tab_output_text) Call tab_dim().
9627         (tabi_driver) Call evaluate_dimensions(), sum_columns().
9628         (tabi_area) Implemented.
9629         (tabi_cumulate) Implemented.
9630         (tabi_render) Partially implemented, but broken.
9631         (var tab_table_class) Made static.
9632         (evaluate_dimensions) New function.
9633         (sum_columns) New function.
9634
9635         * tab.h: (enum t_*) Now start at t_end.  New: t_ptw, t_nr, t_nc,
9636         t_nah, t_naw, t_neg, t_xch, t_dup, t_lbl, t_jnz, t_sac, t_sar,
9637         t_scr, t_srr, t_sentinel.  Removed: t_nat.
9638         (struct tab_table) New: wl, wr, ht, hb, trh, hrh, trv, wrv, dim,
9639         max_stack_height, w, h.  Removed: ce, re.
9640         (macro blank_line) Removed.
9641         (glob var zero_length) Removed.
9642
9643 Fri Dec 26 15:44:31 1997  Ben Pfaff  <blp@gnu.org>
9644
9645         * Most source files: include some of the new include files broken
9646         out of var.h.
9647         
9648         * Makefile.am: (pspp_SOURCES) Add all the new source files to the
9649         list.
9650
9651         * aggregate.c: (glob var outfile) Make static.
9652
9653         * command.c: (glob var pgm_state) Move here.
9654
9655         * common.c: (glob vars endian, second_lowest_value, pgmname,
9656         finished, curdate, cur_proc, start_interactive, history_file) Move
9657         here.
9658
9659         * descript.q: (structs dsc_z_score, descriptives_trns) Move here.
9660
9661         * file-handle.q: (glob vars files, inline_file) Move here.
9662
9663         * glob.c: Lost lots of glob vars, detailed in individual file
9664         entries.
9665         (init_glob) set_printer, set_screen were obsolete, deleted.
9666         set_cprompt has fewer spaces because pspp has fewer letters than
9667         fiasco.
9668
9669         * inpt-pgm.c: (glob vars inp_init, inp_init_size) Move here.
9670         (inp_nval) Made static.
9671
9672         * lexer.c: (glob vars token, tokval, tokstr, tokstr_size,
9673         tokstr_len, toklongstr, tokint) Move here.
9674
9675         * misc.c: Lost several vars and functions.
9676
9677         * set.q: (all the set_* variables) Move here.
9678
9679         * str.c: (strmaxcpy, strbarepadcpy, strbarepadlencpy, strpadcpy,
9680         blpstrset, strpadcmp, memrev, memrmem, cmp_str) Move here from
9681         misc.c.
9682
9683         * tab.c: (set_expr, tab_col_width, tab_row_height) New functions.
9684
9685         * tab.h: (enum series t_*) New enums.
9686         (struct tab_table) Use arena struct tag.  New members ce, re.
9687
9688         * tokens.h: Comment fixes.
9689
9690         * var.h: Move lots of enums and variables and functions and
9691         structures to other files.  Use and declare a lot more union and
9692         struct tags.  Comment fixes.  
9693
9694         * vector.c: (glob vars vec, nvec) Move here.
9695
9696         * vfm.c: (glob vars reinit_sysmis, reinit_blanks, init_zero,
9697         init_blanks, last_vfm_invocation) Move here.
9698
9699         * cases.h: New file.
9700         (struct long_vec) Move here.
9701         (vec_init, vec_clear, vec_insert, vec_delete, devector, envector)
9702         Move here.
9703
9704         * command.h: New file.
9705         (STATE_* enums) Move here.
9706         (glob var pgm_state) Move here.
9707
9708         * format.c: New file.
9709         (glob var formats) Move here.
9710         (parse_format_specifier_name, fmt_to_string,
9711         check_input_specifier, check_output_specifier,
9712         check_string_specifier, convert_fmt_ItoO, parse_format_specifier)
9713         Move here.
9714
9715         * format.h: New file.  Move functions now in format.c here.
9716         (FMT_* enums) Move here.
9717         (struct fmt_desc) Move here.
9718         (FCAT_* enums) Move here.
9719         (struct fmt_spec) Move here.
9720         (glob vars formats, fmt_parse_ignore_error) Move here.
9721
9722         * inpt-pgm.h: New file.
9723         (INP_* enums) Move here, make #defines into enums.
9724         (glob vars inp_init, inp_init_size) Move here.
9725
9726         * sort.h: New file.
9727         (glob vars v_sort, nv_sort) Move here.
9728         (sort_cases, read_sort_output) Move here.
9729
9730         * vector.h: New file.
9731         (struct vector) Move here, add struct tag.
9732         (glob vars vec, nvec) Move here.
9733         (find_vector) Move here.
9734
9735         * New file.
9736         (glob vars last_vfm_invocation, temp_case, reinit_sysmis,
9737         reinit_blanks, init_zero, init_blanks) Move here.
9738         (struct case_stream) Move here.
9739         (glob vars vfm_source, vfm_sink, vfm_memory_stream,
9740         vfm_disk_stream, sort_stream, data_list_source,
9741         input_program_source, file_type_source, get_source, n_lag) Move
9742         here.
9743         (procedure, write_case, lagged_case, compact_case, page_to_disk)
9744         Move here.
9745                 
9746 Wed Dec 24 22:40:42 1997  Ben Pfaff  <blp@gnu.org>
9747
9748         * Makefile.am: (pspp_SOURCES) Added html.c, som.c, som.h.
9749         (LDADD) Add libdcdflib.
9750
9751         * ascii.c: Comment and formatting fixes.  Almost every external
9752         function had an assert added, checking driver_open and page_open.
9753         (ascii_init_driver) Broken into ascii_preopen_driver,
9754         ascii_postopen_driver, ascii_close_driver.  Manages driver_open.
9755         (ascii_open_page) Sets page_open.
9756         (ascii_close_page) Clears page_open.
9757
9758         * html.c: Comment and formatting fixes.  Almost every external
9759         function had an assert added, checking driver_open and page_open.
9760         (html_init_driver) Broken into html_preopen_driver,
9761         html_postopen_driver, html_close_driver.  Manages driver_open.
9762         (html_open_page) Sets page_open.
9763         (html_close_page) Clears page_open.
9764         (html_submit) Disabled.
9765
9766         * lexer.c: (parse_string) Remove debugging printf.
9767
9768         * list.q: (determine_layout) Open a page if one is not yet open.
9769
9770         * output.c: Comment fixes.
9771         (add_class) Set the class member of the new list element.
9772         (parse_options) Don't handle device type.
9773         (colon_tokenize) New function.
9774         (configure_driver) New four-field format with a field for device
9775         type.  Now initialize driver_open, page_open, next, and prev
9776         fields.  Use new colon_tokenize() function.  Don't do a memory
9777         copy to replace a driver, it doesn't work; instead delete the old
9778         driver and insert a new one.
9779         (destroy_driver) Don't call som_destroy_driver().  Close the page
9780         if it's open.  Find the class in the list of classes and decrement
9781         that reference count.  Remove the driver from the global driver
9782         list.
9783         (outp_iterate_enabled_drivers) Renamed outp_drivers().  All
9784         references changed.  Rewritten.  Don't return a driver that's not
9785         enabled.
9786         (outp_eject_page) All references to som_internal_eject_page()
9787         changed to use this.  Sets cp_x to 0 as well as cp_y.
9788
9789         * output.h: (OUTP_I_* enums) Removed.
9790         (struct som_submission_form) Removed.
9791         (struct outp_class) init_driver broken into preopen_driver,
9792         postopen_driver, and close_driver.  submit changed to take a
9793         som_table argument.
9794
9795         * postscript.c: Comment and formatting fixes.  Almost every
9796         external function had an assert added, checking driver_open and
9797         page_open.
9798         (ps_init_driver) Broken into ps_preopen_driver,
9799         ps_postopen_driver, ps_close_driver.  Manages driver_open.
9800         (ps_open_page) Sets page_open.
9801         (ps_close_page) Clears page_open.
9802
9803         * som.c: New file, base implementation.
9804         
9805         * som.h: (struct som_table) Add struct tag.
9806         (enum SOM_COL_ACROSS) Removed.
9807         (SOM_ROWS, SOM_COLUMNS) New enums.
9808         (struct som_table_class) Add member `cumulate'.  Remove `segment';
9809         change `render' arguments.
9810         (struct som_point, struct som_rect) Removed.
9811         (som_submit_table) Fixed typo, should have been som_submit.
9812
9813         * sysfile-info: (describe_variable) Don't try to insert a
9814         subtable; just destroy it for now.
9815
9816         * t-test.q: Include dcdflib/cdflib.h instead of cdflib.h.  Fix
9817         references to value labels.
9818
9819         * tab.c: (tab_destroy) New function.
9820         (tab_columns) Change argument.
9821         [0] (tab_submit) Remove dead code.
9822         (tab_title) Allocate string from the table's arena.
9823         (tab_output_text) Only free the buffer if we allocated it.
9824         (tab_submit) New function.
9825         (static vars t, d) New static vars.
9826         (tabi_table, tabi_driver, tabi_count, tabi_area, tabi_columns,
9827         tabi_headers, tabi_cumulate, tabi_render) New functions.
9828         (glob var tab_table_class) New global var.
9829
9830         * tab.h: (struct tab_join_rect) Don't use a som_rect; directly
9831         encapsulate the rectangle.  All references changed.
9832         
9833 Sun Dec 21 16:18:58 1997  Ben Pfaff  <blp@gnu.org>
9834
9835         * All header files updated to use struct tags in addition to
9836         typedefs for all structures.  Don't use word `struct' in struct
9837         tags.
9838         
9839         * Makefile.am: (pspp_SOURCES) Remove html.c.
9840         (INCLUDES) Replace the lib/* includes with a single lib/ include;
9841         all references updated.
9842
9843         * command.c: (parse_cmd) Remove call to som_check_workspace.
9844         (output_line) Update to new som.
9845
9846         * data-in.c: (parse_numeric) A single dot is not an error; it is
9847         the system-missing value.
9848
9849         * data-list.c: (dump_fixed_table, dump_free_table) Update to new
9850         som.
9851
9852         * data-out.c: Added `const' as appropriate to many prototypes.
9853         (convert_E, convert_F, convert_CCx) Take double argument instead
9854         of value * argument.
9855         (convert_format_to_string) Call changed functions appropriately.
9856         Instead of modifying the caller's value for FCAT_SHIFT_DECIMAL,
9857         make a local copy of the value.
9858
9859         * descript.q: Remove custom_variables() prototype now provided by
9860         q2c.  
9861         (custom_variables) Don't increment sbc_variables, the caller does
9862         this.
9863         (dump_z_table, display) Update to new som.
9864
9865         * error.c: (vmsg) Add const to prototype.  Remove code to handle
9866         `too many errors' condition.
9867         (check_error_count) New function.
9868         (msg) Add const to prototype.
9869
9870         * filename.c: (open_file) Rewrite for elegance.
9871
9872         * frequencies.q: Remove custom_*() prototypes now provided by q2c.
9873         (dump_full, dump_condensed, dump_statistics) Update for new som.
9874
9875         * list.q: Don't include somP.h.  Change all references to
9876         som_driver_ext to refer to the new members of som_driver.  Change
9877         som_internal_eject_page() references to outp_eject_page().
9878
9879         * main.c: (parse) Rewrite for elegance.  Add call to
9880         check_error_count().
9881
9882         * output.c: (add_class, outp_list_classes, outp_configure_driver)
9883         Rewrite or revise for new outp_driver_class_list structure.
9884         (outp_iterate_enabled_drivers) Fix comparison between disabled
9885         devices and current device type.
9886         (outp_eject_page) New function.
9887
9888         * output.h: Comment fixes.
9889         (struct outp_driver) New members driver_open, page_open, cp_x,
9890         cp_y, font_height, prop_em_width, fixed_width.  Deleted members
9891         ref_count, next.
9892         (struct outp_driver_class_list) New struct.
9893         (outp_class_list) Changed to type outp_driver_class_list; all
9894         references updated.
9895
9896         * print.c: (dump_table, print_trns_proc) Updated for new som.
9897
9898         * q2c.c: (dump_vars) Simplify array subcommand code.  Declare
9899         prototypes for custom subcommands.
9900         (dump_subcommand) Always include the `else'.
9901         (dump_parser) Fix comments in output code.
9902
9903         * set.q: Reordered functions.
9904
9905         * som-frnt.c, som-high.c, som-low.c, somP.h: Removed.
9906         
9907         * som.h: Rewritten from scratch.
9908
9909         * str.h: Remove dead code.
9910
9911         * tab.c, tab.h: New files, base implementation.
9912
9913         * sysfile-info.c: (cmd_sysfile_info, describe_variable) Update to
9914         new som.
9915
9916         * t-test.q: New code from John Williams
9917         <johnr.williams@stonebow.otago.ac.nz>.  Include math.h, cdflib.h.
9918         Many many new static vars and defines.
9919         (precalc, postcalc, g_postcalc, z_postcalc, t_pairs, t_groups,
9920         groups_calc, pairs_calc, z_dev_calc, z_calc) New functions.
9921         (struct value_list) New struct.
9922         (variance, covariance, pooled_variance, oneway, pearson_r, f_sig,
9923         t_crt, t_sig, print_t_groups) New functions.
9924         (cmd_t_test) Implemented.
9925
9926         * temporary.c: (cancel_temporary) Only free the temp_dict if it's
9927         non-NULL.
9928
9929         * vfm.c: (dump_splits) Update to new som.
9930
9931 Thu Dec  4 23:02:22 1997  Ben Pfaff  <blp@gnu.org>
9932
9933         * Makefile.am: (fiasco_SOURCES) Add html.c.
9934
9935         * aggregate.c: Base source.
9936
9937         * ascii.c: (postopen, preclose) Reformat.
9938
9939         * data-out.c, expr-evl.c: Comment fixes.
9940         
9941         * filename.c: (open_file) When opening a file for writing, use
9942         line buffering instead of full buffering for better interactive
9943         performance.  Suggested by Valerio Aimale
9944         <valerio@svpop.com.dist.unige.it>.  Also, recognize special file
9945         names `stdin', `stdout', `stderr'.
9946
9947         * groff-font.c: Comment fixes.
9948
9949         * html.c: New file; base version.
9950
9951         * list.q: (write_all_headers, clean_up, determine_layout,
9952         list_cases) Ignore `special' devices for now.  Needs to be fixed
9953         later.
9954
9955         * output.c: (outp_init) Add html driver to list; reverse list
9956         order.
9957
9958         * output.h: (struct outp_class_struct) New members `special',
9959         `submit'; comment fixes.  All references changed.
9960
9961         * postscript.c: (ps_init_driver) Make defaults for text_opt,
9962         line_opt depend on whether the OUTP_DEV_SCREEN bit is set on the
9963         device.
9964         (postopen) Comment fix.
9965         (preclose) Comment fixes, formatting fixes.  Change x->file.file
9966         references to more proper f->file.
9967
9968         * som-high.c: (som_submit_table) Special classes use their own
9969         renderers.
9970
9971         * som.h: Comment fixes.
9972
9973         * temporary.c: (new_dictionary) Don't try to xstrdup() a NULL
9974         string.
9975         
9976 Tue Dec  2 14:36:07 1997  Ben Pfaff  <blp@gnu.org>
9977
9978         * Makefile.am: (fiasco_SOURCES) Add aggregate.c back in.
9979
9980         * aggregate.c: Still working on this.
9981
9982         * command.c: (cmd_table[]) Add AGGREGATE back in.
9983         (split_words) Make '-' a legal word separator as well as ' '.
9984
9985         * main.c: Comment fixes.
9986
9987         * q2c.c: (dump_parser) Don't require the procedure's full name to
9988         be present, in the generated source.
9989
9990         * t-test.q: Change name to `t-test' from `t test'.  Let PAIRS be
9991         multiply specified and let it be default; let MISSING, CRITERIA,
9992         FORMAT be multiply specified.
9993         (cmd_t_test) Parse command name.  [DEBUGGING] Call debug_print().
9994         (custom_groups) Fix defaults.
9995         (custom_pairs) Check whether this is a PAIRS subcommand before
9996         attempting to parse.  Better garbage collection.  Proper storage
9997         allocation.
9998         [DEBUGGING] (debug_print) New function.
9999
10000         * temporary.c: Comment fixes.
10001         (copy_variable) Don't copy variable name and index.
10002         (save_dictionary) Copy variable name and index by hand.
10003
10004         * vars-atr.c: Comment fixes.
10005         (create_variable) New dictionary argument.  All references
10006         changed.
10007         (common_init_stuff) New dictionary argument.  All references
10008         changed.
10009         (init_variable) New dictionary argument.  All references changed.
10010         (dup_variable) New function.
10011
10012         * vars-prs.c: (parse_variables) If there are any errors, we always
10013         return 0.  Previously, it was possible for some types of errors to
10014         be ignored.
10015         
10016 Sat Nov 22 01:20:59 1997  Ben Pfaff  <blp@gnu.org>
10017
10018         * Makefile.am: (fiasco_SOURCES) For 0.1.5 release, remove
10019         aggregate.c.
10020
10021         * command.c: (cmd_table[]) Comment out AGGREGATE; add T TEST.
10022
10023         * list.q, t-test.q: Remove ALL option from VARLIST declaration in
10024         grammar rules.
10025
10026         * q2c.c: Comment fixes.
10027         (SBC_* enums) Remove SBC_VARLIST_ALL; all references removed.
10028         
10029         * t-test.q: (cmd_list) Rename cmd_t_test.
10030
10031         * temporary.c: (new_dictionary) Don't declare as static.
10032         
10033 Fri Nov 21 00:03:06 1997  Ben Pfaff  <blp@gnu.org>
10034
10035         * aggregate.c: Changes, still not finished.
10036
10037         * file-handle.q, frequencies.q, list.q, set.q: Comment fixes.
10038
10039         * q2c.c: Comment fixes.  Now its output is internationalized.
10040         (get_token) Fix parsing of escapes within literal strings.
10041         (main) Fix bad #line directives in output.
10042
10043         * t-test.q: Base implementation.
10044
10045         * temporary.c: (new_dictionary) New function.
10046         (restore_dictionary) [__CHECKER__] Change fill character to *
10047         (from @).
10048         
10049 Sun Nov 16 01:29:57 1997  Ben Pfaff  <blp@gnu.org>
10050
10051         * Makefile.am: (BUILT_SOURCES, fiasco_SOURCES) Add t-test.c
10052
10053         * aggregate.c: Changes, still not finished.
10054
10055         * descript.q, list.q: Comment fixes.
10056
10057         * q2c.c: Almost completely rewritten.
10058
10059         * t-test.q: New file, not complete.
10060
10061 Fri Nov 14 00:14:48 1997  Ben Pfaff  <blp@gnu.org>
10062
10063         * aggregate.c: Changes, still not finished.
10064
10065         * sort.c: (sort_cases) Call cancel_temporary() instead of doing it
10066         by hand.
10067
10068         * temporary.c: (cancel_temporary) New function.
10069
10070         * vars-atr.c: (discard_variables) Call cancel_temporary() instead
10071         of doing it by hand.
10072
10073         * vfm.c: (close_active_file) After restoring a TEMPORARY
10074         dictionary, set temp_dict to NULL.  Cancel TEMPORARY through
10075         cancel_temporary().
10076         (SPLIT_FILE_procfunc) Comment fix.
10077
10078 Tue Oct 28 16:08:45 1997  Ben Pfaff  <blp@gnu.org>
10079
10080         * Makefile.am: (fiasco_SOURCES) Add aggregate.c.
10081
10082         * aggregate.c: New file, not finished yet.
10083
10084         * command.c: (cmd_table) Add AGGREGATE.
10085
10086         * common.h: (pgm_state) Move declaration to var.h.
10087
10088         * lexer.c: (bin_value_func, oct_value_func, hex_value_func) i18n
10089         fixes.
10090         (parse_string) Message fix.
10091
10092         * recode.c: Comment fix.
10093
10094         * sfm-read.c: (read_variables) Code esthetic fixes.
10095         (write_header) Default date is `Jan', not `JAN'.
10096
10097         * sfmP.h: (bswap_int32) [!__linux__] Fix off-by-one errors.
10098
10099         * sort.c: (cmd_sort_cases) Farm the work out to new function
10100         parse_sort_variables().
10101         (parse_sort_variables) New function.
10102         (sort_cases) New function.  Cancels temporary transformations,
10103         which sorting didn't do previously.
10104         (cmd_sort_cases) Better garbage collection on error.  Uses
10105         do_external_sort().
10106         (write_initial_runs, merge_once) Improved code esthetics.
10107         (sort_stream_read) Reduced to one call to read_output_cases().
10108         (read_output_cases) New function.
10109
10110         * var-labs.c: (cmd_variable_labels) Re-enabled truncation of
10111         variable labels to 120 characters.
10112
10113         * var.h: Comment fixes.
10114         (glob var pgm_state) From common.h.
10115
10116         * vars-atr.c: (discard_variables) Set pgm_state to STATE_INIT.
10117
10118         * vars-prs.c: (parse_DATA_LIST_vars) Support PV_SINGLE in
10119         options.  Set *names to NULL on error.
10120
10121         * vfm.c: (memory_stream_init) Assert compaction_nval != 0.
10122
10123 Thu Oct  9 09:59:49 1997  Ben Pfaff  <blp@gnu.org>
10124
10125         * sfm-write.c, vfm.c: [HAVE_UNISTD] #include <unistd.h>, needed by
10126         SunOS4.  From Alexandre Oliva <oliva@dcc.unicamp.br>.
10127
10128 Wed Oct  8 18:55:24 1997  Ben Pfaff  <blp@gnu.org>
10129
10130         * vfm.c: (page_to_disk) Added missing local variables.
10131
10132 Tue Oct  7 20:23:17 1997  Ben Pfaff  <blp@gnu.org>
10133
10134         * get.c: Comment fix.
10135
10136         * sort.c: (cmd_sort_cases) Attempt to perform internal sort if the
10137         source is anything other than a disk stream, not just if it's in a
10138         memory stream.  Call page_to_disk() before external sort.
10139         (allocate_cases) Message fix.
10140
10141         * vfm.c: (prepare_for_writing) Warn user when paging workspace to
10142         disk.
10143         (page_to_disk) New function.
10144
10145 Sun Oct  5 15:56:14 1997  Ben Pfaff  <blp@gnu.org>
10146
10147         * Makefile.am: (INCLUDES) Include .. instead of $(top_srcdir).
10148
10149         * common.h: (macro strerror) Remove.  From Alexandre Oliva
10150         <oliva@dcc.unicamp.br>.
10151
10152         * get.c: (dict_delete_run) The number of variables to delete is
10153         not necessarily the number of variables that need to be shifted
10154         up.
10155         (trim_dictionary) Don't set *options to 0.  Fix bug that caused
10156         too many variables to be deleted.
10157
10158         * postscript.c: Comment fix.
10159
10160         * q2c.c: Include strerror.c.  From Alexandre Oliva
10161         <oliva@dcc.unicamp.br>.
10162
10163         * set.q: #undef ON and OFF.  From Alexandre Oliva
10164         <oliva@dcc.unicamp.br>.
10165
10166         * sfm-read.c: (sfm_read_dictionary) Don't set the file class too
10167         early, otherwise errors cause a bad free().
10168
10169         * str.h: (macro nvsprintf) s/FORMATS/FORMAT/ typo.  From Alexandre
10170         Oliva <oliva@dcc.unicamp.br>.
10171
10172         * temporary.c: (save_dictionary) Don't allocate memory if
10173         n_documents is 0.
10174
10175         * vfm.c: (memory_stream_write) Message fix.
10176
10177 Sat Oct  4 16:20:43 1997  Ben Pfaff  <blp@gnu.org>
10178
10179         * command.c: (static var cmd_table[]) Define REPEATING DATA
10180         command.
10181
10182         * common.h: Added support for broken systems that are missing
10183         EXIT_SUCCESS, EXIT_FAILURE, RAND_MAX, and/or strerror().
10184
10185         * Many source files: Replace syntax error messages via msg() with
10186         call to syntax_error().
10187
10188         * data-list.c: (dump_fixed_table) Add support for dumping table
10189         for REPEATING DATA as well as DATA LIST FIXED.
10190         (cmd_repeating_data) Allows and requires `/' between subcommands.
10191         Does proper thing with allowing rpd.starts_end to stay 0.  Allows
10192         CONTINUED specifications to be omitted.  Forces CONTINUED to be
10193         specified if ID is.  Calculates starts_end, cont_end from logical
10194         record length as reported by fhp.  Calls dump_fixed_table() if
10195         requested.  Fixed length of record copied by memcpy.
10196         (parse_num_or_var) Sets `num' to 0, not NOT_INT, for variables.
10197         Message fix.
10198         (realize_value) Returns sensible value for out-of-range variable
10199         values.
10200         (rpd_parse_record) New argument `ofs'.  Fixed confusion between
10201         length of occurrences and length of line.  Added warning for
10202         fields that exceed the line length.  Fixed infinite loop.
10203         (read_one_set_of_repetitions) Numerous minor changes for more
10204         complete SPSS compliance.  Message fixes.
10205
10206         * dfm.c: (dfm_close) If the file being closed is the inline file,
10207         read all the remaining data before closing it.
10208         (dfm_get_record) Don't close the file on lossage, as either it
10209         has been closed already or it doesn't belong to us.
10210
10211         * error.c: (puts_stdout) New function.
10212         (vmsg) Use puts_stdout instead of puts.
10213
10214         * file-handle.q: (fh_record_width) New function.
10215
10216         * inpt-pgm.c: (init_case) Fixed buffer overrun when inp_nval % 4
10217         == 0.
10218         (clear_case) Ditto.
10219         (input_program_source_read) Made an old kluge an approved method.
10220
10221         * lexer.c: (syntax_error) New function.
10222
10223         * misc.c: [BROKEN_RAND] (ansi_rand, ansi_srand; static var next)
10224         New.
10225
10226         * output.c: (oupt_get_paper_size) Message fix.
10227
10228         * q2c.c: Numerous fixes to formatting of generated code made to
10229         conform to GNU coding standards.  Uses syntax_error() in generated
10230         code.  Other miscellaneous generated message fixes.  Added support
10231         for broken systems that are missing EXIT_SUCCESS, EXIT_FAILURE,
10232         RAND_MAX, and/or strerror().
10233
10234 Sat Oct  4 02:09:56 1997  Ben Pfaff  <blp@gnu.org>
10235
10236         * data-in.c: Comment fixes.
10237
10238         * data-list.c: (struct repeating_data_trns) New member `id_spec'.
10239         (find_variable_input_spec) New function.
10240         (cmd_repeating_data) Initializes id_spec.
10241         (rpd_parse_record) Implemented.
10242         (read_one_set_of_repetitions) Returns -3 by default in order to
10243         kluge out some potential bugs.
10244
10245         * data-out.c: Comment fixes.
10246
10247         * file-type.c: (internal_cmd_record_type) Message fix.
10248
10249         * inpt-pgm.c: (input_program_source_read) Special temporary kluge
10250         for handling -3 return value.
10251
10252 Sat Sep 20 23:58:15 1997  Ben Pfaff  <blp@gnu.org>
10253
10254         * data-list.c: Comment fixes.
10255         (struct dls_var_spec) Reordered members.
10256         (read_from_data_list_fixed) Restructured.
10257         (struct repeating_data_trns) Reordered members.  Renamed `starts'
10258         as `starts_beg', `ends' as `starts_end'.
10259         (cmd_repeating_data) Calculates length of repeated data if
10260         necessary and possible.
10261         (parse_num_or_var) Don't allow string variables.
10262         (realize_value) New function.
10263         (rpd_msg) New function.
10264         (rpd_parse_record) New function.  Currently stubbed out.
10265         (read_one_set_of_repetitions) Implemented.
10266
10267         * inpt-pgm.c: (input_program_source_read) Comment fix.
10268
10269 Thu Sep 18 21:34:57 1997  Ben Pfaff  <blp@gnu.org>
10270
10271         * command.c: (cmd_end_repeat_p) Removed.
10272         (init_cmd_parser) Doesn't set cmd_end_repeat_p.
10273         (parse_cmd_name) Removed.
10274
10275         * data-list.c: Comment fixes.
10276         (data_list_pgm) Removed `eof' member.
10277         (static var first) New var.
10278         (cmd_data_list) Sets `first'.  Ensures that DATA LIST uses the
10279         FILE TYPE file inside FILE TYPE structures.
10280         (append_var_spec) Appends to *first, not dls.spec.
10281         (parse_fixed) Message fixes.
10282         (struct rpd_num_or_var) New.
10283         (struct repeating_data_trns) New.
10284         (static var rpd) New.
10285         (cmd_repeating_data) New function.
10286         (parse_num_or_var) New function.
10287         (parse_repeating_data) New function.
10288         (read_one_set_of_repetitions) New function.
10289
10290         * file-type.c: (cmd_file_type) Message fixes.  Always
10291         default_handle to FILE TYPE file handle.
10292         (internal_cmd_record_type) Message fixes.
10293
10294 Wed Aug 20 14:22:03 1997  Ben Pfaff  <blp@gnu.org>
10295
10296         * repeat.c: Comment fix.  Disable debugging.
10297
10298         * temporary.c: (restore_dictionary) Sets splits to NULL and
10299         n_splits to 0 before destroying the variables because now doing
10300         this tries to remove split variables.
10301
10302         * vars-atr.c: (discard_variables) Asserts that n_splits is 0 after
10303         destroying the dictionary.
10304         (clear_variable) Removes a variable from splits after destroying
10305         it.
10306
10307 Mon Aug 18 18:06:55 1997  Ben Pfaff  <blp@gnu.org>
10308
10309         * cmdline.c: (set_compat) Removed.
10310         (pick_compat) Removed.
10311         (parse_command_line) Removed -c option.
10312         (pre_syntax_message) Removed -c option.
10313         (usage) Remove compatibility code.
10314
10315         * common.h: (macros VER_PC, VER_WND, VER_X) Removed.
10316         (glob var compat) Removed.
10317
10318         * compute.c: (type_check) Fixed messages about type mismatches.
10319
10320         * data-list.c: (cmd_data_list) Removed compatibility code.
10321         (fixed_parse_compatible) Calls convert_negative_to_dash().
10322         Fixed bug where it only set the variable in fx.spec if it created
10323         the variable itself.
10324         (dump_fmt_list) Spelling fix.
10325         (cut_field) Removed compatibility code.
10326
10327         * dfm.c: (cmd_begin_data) Don't require a command terminator on
10328         BEGIN DATA command.
10329
10330         * expr-evl.c: (evaluate_expression) Implement LAG.
10331
10332         * expr-prs.c: (parse_add) Calls convert_negative_to_dash().
10333         (parse_neg) Calls convert_negative_to_dash().
10334         (LAG_func) Increases n_lag to the lag requested.  Fixed assignment
10335         bug.
10336
10337         * expr.h: (struct expression_struct) Removed member max_lag.
10338
10339         * file-type.c: (parse_col_spec) Calls convert_negative_to_dash().
10340         (internal_cmd_record_type) Removed special handling to produce
10341         negative numbers from dash tokens.
10342
10343         * getline.c: (static var DO_REPEAT_level) New var.
10344         (getl_add_DO_REPEAT_file) Increments DO_REPEAT_level.
10345         (handle_line_buffer) Copies the line into getl_buf; doesn't call
10346         copy_with_DO_REPEAT_substitutions().
10347         (getl_read_line) Maintains value of getl_mode.  Calls
10348         perform_DO_REPEAT_substitutions() whenever DO_REPEAT_level is
10349         positive.
10350         (getl_close_file) Decrements DO_REPEAT_level when appropriate.
10351
10352         * getline.h: (getl_mode) New glob var.
10353
10354         * glob.c: Comment fixes.
10355         (init_glob) Restructured.  Sets set_seed.
10356         (init_compat_dependent) Removed.  All references removed.
10357         (get_date) Format changed from MM/DD/YY to DD MMM YYYY.
10358         (__htonl, __htons) Removed.  (What were these for?)
10359
10360         * lexer.c: (static var tbl) Dash set to class CNUM.
10361         (make_hexit) New function from data-out.c.
10362         (get_token_representation) Rewritten.
10363         (convert_negative_to_dash) New function.
10364         (lex_init_compat_dependent) Removed.
10365         (yylex) A dash is parsed as part of a number if it is followed by
10366         a digit.  The ASCII representation of a number is copied to
10367         tokstr.  String parsing farmed out to parse_string().  Comment
10368         fixes.
10369         (bin_value_func, oct_value_func, hex_value_func, parse_string) New
10370         functions.
10371         (preprocess_line) Line processing depends on interactive/batch
10372         mode, not on compatibility mode.  Removed PC+ compatibility code.
10373
10374         * loop.c: (loop_3_trns_proc) Comment fix.
10375
10376         * main.c: Remove dead code.
10377         (main) Remove call to init_compat_dependent().
10378
10379         * misc.c: (convert_fmt_ItoO) Make E format conversion more
10380         conformant.
10381
10382         * print.c: (parse_string_argument) Calls
10383         convert_negative_to_dash().
10384         (fixed_parse_compatible) Calls convert_negative_to_dash().
10385
10386         * repeat.c: (RPT_* defines) Removed.
10387         (struct rpt_numeric) Removed.
10388         (struct repeat_entry) New member type, changed `replacement' from
10389         char * to char **.
10390         (clean_up) Deallocation adapted to new repeat_entry.
10391         (internal_cmd_do_repeat) `type' defaults to 0.  Remove lookahead()
10392         usage.  Creates vars for `type' of 1.
10393         (parse_ids) Sets type of 1.  Adapted to new repeat_entry.
10394         (store_numeric) Rewritten, new interface.
10395         (parse_numbers) Rewritten.
10396         (parse_strings) Rewritten.
10397         (find_DO_REPEAT_substitution) New function.
10398         (perform_DO_REPEAT_substitutions) New function.
10399         (copy_with_DO_REPEAT_substitutions) Removed.
10400         (debug_print) Rewritten.
10401
10402         * set.q: Comment fix.
10403         (custom_results) Removed compatibility code.
10404         (internal_cmd_set) Removed SET EMULATION subcommand.  Removed
10405         compatibility code.
10406
10407         * sysfile-info.c: (cmd_display) Removed compatibility code.
10408
10409         * tokens.h: Comment fixes.
10410         (token types enum) Removed `toktype' typedef name for this int
10411         type.  Removed SUBST.  Restructured.
10412
10413         * vars-atr.c: (discard_variables) Sets n_lag to 0.
10414
10415         * vars-prs.c: Comment fix.
10416
10417         * vfm.c: Comment fixes.
10418         (glob var n_lag) New var.
10419         (static vars lag_count, lag_head, lag_queue) New vars.
10420         (procedure) Removed argument nlag.
10421         (setup_lag) New function.
10422         (close_active_file) Discards lagging state.
10423         (lag_case) New function.
10424         (lagged_case) New function.
10425         (write_case) Lags a case if lagging.
10426
10427         * weight.c: (cmd_weight) Removed compatibility code.
10428         
10429 Sun Aug 17 22:34:40 1997  Ben Pfaff  <blp@gnu.org>
10430
10431         * getline.h: (struct getl_script) New members loop_index, macros.
10432
10433         * getline.c: (getl_add_file) Sets first_line field to NULL.
10434         (getl_add_DO_REPEAT_file) New function.
10435         (handle_line_buffer) When the current line's length is negative,
10436         set the filename and line number.  Increment line number after
10437         reading line.  Pass the line to
10438         copy_with_DO_REPEAT_substitutions() for processing.
10439         (getl_close_file) Free DO REPEAT lines before freeing the
10440         filename, and just set the filename to NULL when doing this,
10441         because otherwise the filename gets freed twice.
10442
10443         * glob.c: (glob var queuing) Removed.  All references removed.
10444
10445         * lexer.c: Comment fixes.
10446         (get_token_representation) New function.
10447
10448         * repeat.c: Comment fixes.
10449         (struct repeat_entry) Replaced type and v union members with a
10450         simple string.
10451         (append_record) New function.
10452         (internal_cmd_do_repeat) Started reforming it for the new
10453         repeat_entry struct.  Properly records filename changes in the
10454         getl_line_buf.  Fixed improper use of = for ==.  Fixed sense of
10455         strncasecmp() result usage.  Uses append_record() to simplify.
10456         Properly discards END REPEAT line.  Calls getl_add_DO_REPEAT_file
10457         to add in the file.
10458
10459         (copy_with_DO_REPEAT_substitutions) Started coding.
10460
10461         [DEBUGGING] (debug_print_lines) New function.
10462
10463         * set.q: (custom_results, internal_cmd_set) s/VER_PCP40/VER_PC/;
10464
10465         * tokens.h: (macro is_id1, is_idn) New macros.
10466
10467 Sat Aug 16 10:57:41 1997  Ben Pfaff  <blp@gnu.org>
10468
10469         * cmdline.c: (static var pre_syntax_message) Changed `win'
10470         compatibility mode to `wnd'.
10471
10472         * data-list.c: (fixed_parse_spss) Renamed
10473         fixed_parse_compatible().
10474
10475         * glob.c: (init_glob) Excise unused code for
10476         program_invocation_short_name.
10477
10478         * lexer.c: (preprocess_line) Leading indentors are ignored in Wnd
10479         as well as in X.
10480
10481         * print.c: (fixed_parse_spss) Renamed fixed_parse_compatible().
10482
10483         * set.q: `win' compatibility renamed `wnd'.
10484
10485 Thu Aug 14 22:11:12 1997  Ben Pfaff  <blp@gnu.org>
10486
10487         * filename.c: [__WIN32__] Change the included Windows header files
10488         (again).
10489         (absolute_filename_p) [__MSDOS__] A filename with a colon as the
10490         second character is absolute.
10491         (dirname) Fix logic error.  Don't printf() the results.
10492         (prepend_dir) Don't printf() the results.
10493
10494         * getline.c: (handle_line_buffer) New function.
10495         (getl_read_line) Reads line with handle_line_buffer() when
10496         appropriate.
10497         (getl_close_file) Discard line buffer data.
10498
10499         * getline.h: Comment fixes.
10500         (struct getl_line_list) New struct.
10501         (getl_script_struct) Added line buffer members.  These are hooks
10502         for use by DO REPEAT to allow it to insert virtual source code
10503         into the program.
10504
10505         * glob.c: (init_glob) [__DJGPP__ || (__WIN32__ && __BORLANDC__)]
10506         Override Borland C++ stupidity that claims Windows has a console
10507         window size of 0x3.
10508
10509         * repeat.c: This is in the process of being restructured from
10510         using a token-buffering approach to the DO REPEAT facility to
10511         using the more flexible approach of a line-buffering approach in
10512         conjunction with the getline module.  Comment fixes.
10513         (struct tok_struct) Removed.
10514         (static vars queue_index, queue_head, queue) Removed.
10515         (static vars line_buf_head, line_buf_tail) New vars.
10516         (internal_cmd_do_repeat) Instead of queuing tokens, queue lines.
10517         Not complete.
10518         (pull_queue, destroy_queue) Removed.
10519         [DEBUGGING] (debug_print_tokens) Removed.
10520
10521 Tue Aug  5 13:57:58 1997  Ben Pfaff  <blp@gnu.org>
10522
10523         * file-handle.q: (prepend_current_directory) New function.
10524         (internal_cmd_file_handle, fh_get_handle_by_filename) Prepends
10525         current directory before normalizing filename.
10526
10527         * filename.c: (gnu_getcwd) New function.
10528         (absolute_filename_p) New function.
10529         (search_path) New argument, PREPEND.  All references changed to
10530         pass NULL except those explicitly mentioned.  Uses
10531         absolute_filename_p().  Prepends PREPEND before trying the
10532         filename.
10533         (dirname, prepend_dir) New functions.
10534
10535         * getline.c: (getl_get_current_directory) New function.
10536         (getl_include) Passes getl_get_current_directory() as PREPEND arg
10537         to search_path().
10538                 
10539 Sun Aug  3 11:42:36 1997  Ben Pfaff  <blp@gnu.org>
10540
10541         * In several source files, the term `script' was replaced with
10542         `syntax file' inside error messages.  Usage of the term `script'
10543         in the sense of a syntax file is now deprecated.
10544
10545         * cmdline.c: (static vars pre_syntax_message, post_syntax_message)
10546         Updated messages.
10547
10548         * dump-sysfile.c: (usage) Update message.
10549
10550         * getline.c: (getl_read_line) Ignore lines beginning with `#!'.
10551
10552         * getline.h: (glob var getl_include_path) Declare extern.
10553
10554         * list.q: Define EXTERN as extern before #including somP.h.
10555
10556         * var.h: Remove declaration of `disptype' variable.
10557
10558         * vfm.c: (close_active_file) After switching the data sink to a
10559         data source, set vfm_sink to NULL, because it doesn't exist any
10560         more.
10561
10562 Thu Jul 17 21:41:44 1997  Ben Pfaff  <blp@gnu.org>
10563
10564         * glob.c: [__BORLANDC__] Include math.h.  Define _matherr() and
10565         _matherrl() to ignore all math errors.
10566
10567         * sfm-read.c: (read_value_labels) When reading the labels from
10568         disk, read the little parts separately instead of as a struct;
10569         this avoids alignment problems.
10570
10571         * sfm-write.c: (struct sfm_fhuser_ext) New member `elem_type'.
10572         (sfm_write_dictionary) Sets elem_type and frees it on lossage.
10573         (write_header) Allocates and initializes elem_type.
10574         (sfm_write_case) Uses elem_type to determine how to handle each
10575         flt64 element.
10576         (sfm_close) Frees elem_type.
10577
10578         * sfmP.h: Comment fix.
10579         [__BORLANDC__] Uses #pragma -a to adjust structure member
10580         alignment.
10581         
10582 Thu Jul 17 01:55:12 1997  Ben Pfaff  <blp@gnu.org>
10583
10584         * Makefile.am: (fiasco_SOURCES) Remove display.c.
10585
10586         * common.c: Fix typo.
10587
10588         * dfm.c: (read_record) Remove strncasecmp() emulation and fix the
10589         sense of the condition.
10590
10591         * expr-evl.c: (macro ALLOC_STRING_SPACE) [!PAGED_STACK] Add
10592         line-continuation backslash.
10593
10594         * filename.c: [__WIN32__] Include <windef.h> before <winbase.h>.
10595
10596         * frequencies.q: (custom_grouped, add_percentile) Don't use a
10597         non-constant expression as an argument to sizeof.
10598
10599         * glob.c: [__WIN32__ && __BORLANDC__] When including <conio.h>,
10600         undefine gettext macro because that's a conio function.
10601
10602         * hash.h: (hsh_prime_tab declaration) Remove.
10603
10604         * list.q: (write_fallback_headers) Move `leader' allocation out of
10605         main loop.  Change to local_alloc() allocation.
10606
10607         * output.h: Formatting fixes.  Put __attribute__ in right place on
10608         function prototypes.
10609
10610         * sfm-read.c: (read_machine_flt64_info, read_variables) Change
10611         incorrect `SECOND_LOWEST_VALUE' references to proper
10612         `second_lowest_value'.
10613
10614         * som-frnt.c: (EXTERN macro) Define as `extern' instead of null
10615         value.  This way 2 out of 3 of the som files define the vars
10616         extern, the correct way, that actually works under BC++.
10617         (som_set_float) Don't use nonconstant initializers for a struct.
10618
10619         * som-high.c: Add the standard alloca() header.
10620         (replicate_table) Add prototype.
10621
10622         Merged DISPLAY routine.
10623         * sysfile-info.c: (AS_*) New enum series.
10624         (cmd_sysfile_info) Gutted.  Calls describe_variable() to do the
10625         dirty work.
10626         (cmd_display, display_macros, display_documents,
10627         display_variables) Stolen from defunct display.c.
10628         (describe_variable) New function.
10629
10630         * temporary.c: [0] (display_tree) New debug function.
10631         (copy_variable) Performs shallow copy of value labels instead of
10632         deep copy; i.e., just copys the AVL tree and increments the
10633         reference counts.
10634
10635         * val-labs.c: Comment fixes.
10636         (do_value_labels) Optionally skip leading forward slash.
10637         (get_label) Creates only a single value label instead of many
10638         copies of one, and sets the reference count.
10639
10640         * display.c: Removed.
10641
10642         * dump-sysfile.c: New file, not yet complete.
10643
10644 Fri Jul 11 23:02:18 1997  Ben Pfaff  <blp@gnu.org>
10645
10646         For lots of source files I added more verbose_msg's.  These aren't
10647         listed below as they have tested as being benign.  In some cases
10648         these replaced debug_printf() calls.
10649
10650         * output.c: (outp_read_devices) Message fix.
10651
10652         * postscript.c: (output_encodings) Message fix.  Reports errors on
10653         fclose().
10654         (postopen) Message fix.
10655         
10656 Fri Jul 11 14:09:40 1997  Ben Pfaff  <blp@gnu.org>
10657
10658         * dfm.c: (dfm_close) Don't call fclose() for a NULL FILE.
10659
10660         * filename.c: (close_file_ext) Set f->file to NULL *after* closing
10661         it.
10662
10663         * main.c: Remove <malloc.h> #include.
10664
10665         * mis-val.c: (parse_numeric) Set .f member for each missing[]
10666         instead of trying to just set the missing[] itself, which is a
10667         gcc-specific idiom.
10668
10669         * sfm-read.c: (read_variables) Same.
10670
10671         * str.h: Add memmem() prototype.
10672
10673         * val-labs.c, var-labs.c: Replace <malloc.h> with <stdlib.h>.
10674
10675 Thu Jul 10 22:13:53 1997  Ben Pfaff  <blp@gnu.org>
10676
10677         * Makefile.am: (q2c) Don't include any libraries in the link.
10678
10679         * dfm.c: (force_line_buffer_extension) New macro.
10680         (count_tabs) New function.
10681         (tabs_To_spaces) New function.
10682         (read_record) Calls tabs_to_spaces() on the line being processed.
10683
10684         * q2c.c: Disabled i18n for this proglet so that libintl.a doesn't
10685         have to be compiled twice (once for CC, once for LOCAL_CC).
10686  
10687 Sun Jul  6 19:14:33 1997  Ben Pfaff  <blp@gnu.org>
10688
10689         * Makefile.am: (INCLUDES) Add intl directory; fix directories.
10690         (LDADD) Add @INTLLIBS@.
10691         (q2c) Add LIBS, @INTLLIBS@ to link step.
10692
10693         * inpt-pgm.c: Turn off debugging.
10694
10695         * postscript.c: (postopen) Format fix.  local_free() blocks
10696         returned by local_alloc(); don't free() them.
10697
10698 Sat Jul  5 23:44:51 1997  Ben Pfaff  <blp@gnu.org>
10699
10700         * data-in.c: (parse_string_as_format) Comment fix.  Fix check for
10701         string length.
10702
10703         * data-list.c: (read_from_data_list_fixed) Pass proper value for
10704         LEN arg, not simply the full string length.
10705
10706         * sort.c: (allocate_file_handles) Check SPSS compatible temp file
10707         directories before generic temp file directories.
10708
10709         * vfm.c: Disable debugging.
10710
10711 Fri Jul  4 13:26:41 1997  Ben Pfaff  <blp@gnu.org>
10712
10713         * get.c: Comment fix.
10714         (cmd_save_internal) Always passes GTSV_OPT_SAVE option.
10715
10716 Wed Jun 25 22:52:28 1997  Ben Pfaff  <blp@gnu.org>
10717
10718         * expr-prs.c: (debug_print_postfix) Conditionally included on
10719         GLOBAL_DEBUGGING.  Removed out_header() reference.
10720
10721         * exprP.h: Removed #undef GLOBAL_DEBUGGING.
10722
10723 Sun Jun 22 22:00:28 1997  Ben Pfaff  <blp@gnu.org>
10724
10725         * ascii.c: Removed obsolete ascii_close_page() prototype.
10726
10727         * command.c: (output_line) Comment fix.
10728
10729         * data-in.c: Formatting fix.
10730         (parse_string_as_format) Now the `fc' argument is used only for
10731         the purpose of error messages; it is not an index into the string
10732         passed.  All references changed.
10733
10734         * data-list.c: Comment fix.
10735         (cut_field) Comment fix.  Now returns the column number of the
10736         position of the field cut out on success.
10737         (parse_field) Added `column' argument.  Puts the column numbers in
10738         the error message.
10739         (read_from_data_list_free, read_from_data_list_list) Record the
10740         column number returned by cut_field(), pass it to parse_field().
10741
10742         * dfm.c: Comment fix.
10743
10744         * do-ifP.h: Comment fix.
10745
10746         * expr-prs.c: (SYSMIS_func) Implemented string-type arguments for
10747         the SYSMIS function.
10748
10749         * expr.h, exprP.h: Comment fix.
10750
10751         * glob.c: (init_glob) Only calls setlocale() and family if
10752         ENABLE_NLS set.
10753
10754         * hash.h: Comment fix.
10755
10756         * include.c: Comment fix.
10757
10758         * output.c: Comment fix.
10759
10760         * postscript.c: (ps_line_intersection) Simplified assertion.
10761
10762         * repeat.c: Comment fix.
10763
10764         * vars-atr.c: Comment fix.
10765
10766         * vars-prs.c: Comment fix.
10767
10768         * vfm.c: (vector_initialization) [DEBUGGING] Fixed undefined
10769         behavior with usage of postincrement.
10770         (memory_stream_read) Discards cases as it goes. 
10771
10772 Sun Jun 15 16:45:17 1997  Ben Pfaff  <blp@gnu.org>
10773
10774         * Makefile.am: Cleans q2c, not just distcleans it.  Distcleans
10775         foo.
10776
10777         * Most source files: Includes debug-print.h, related comment
10778         fixes.
10779
10780         * cases.c: (alloc_val) Removed complex allocation code.  Merely
10781         increments default_dict.nval and returns the former value.
10782         (envector, devector) Removed references to lv member of struct
10783         variable.
10784
10785         * common.h: (macro VME) Replaced complex definition with simple
10786         one.
10787
10788         * data-list.c: (cmd_data_list) Sets vfm_source instead of
10789         read_active_file and cancel_input_pgm.
10790         (read_from_data_list, cancel_data_list) Removed.
10791         (data_list_source_read, data_list_source_destroy_source) New
10792         functions.
10793         (glob var data_list_source) New var.
10794
10795         * dfm.c: (open_file_r, open_file_w) Simplified debug output.
10796         (cmd_begin_data) Improved criteria for an input program accessing
10797         the inline file.  Still not perfect.
10798
10799         * do-if.c: (do_if_trns_proc) Simplified debug output.
10800
10801         * expr-prs.c: Comment fixes.
10802         [DEBUGGING] (debug_print_postfix) Simplified debug output.
10803
10804         * file-handle.q: (fh_close_handle) Simplified debug output.
10805
10806         * file-type.c: Comment fixes.
10807         (cmd_file_type) Sets vfm_source instead of read_active_file and
10808         cancel_input_pgm.
10809         (cmd_end_file_type) On failure, discards variables in place of
10810         just canceling the input program.
10811         (read_from_file_type) Renamed file_type_source_read.
10812         (cancel_file_type) Renamed file_type_source_destroy_source.
10813         (glob var file_type_source) New var.
10814
10815         * get.c: (GTSV_* enum series) New enums GTSV_OPT_SAVE, GTSV_NONE.
10816         (cmd_get) Initializes options to GTSV_NONE before passing to
10817         trim_dictionary().  Removed `lv' reference.  Sets vfm_source
10818         instead of read_active_file and cancel_input_pgm.
10819         (cmd_save_internal) Initializes options before passing to
10820         trim_dictionary().  Local var `nval' removed.
10821         (dict_delete_run) Comment fixes.
10822         (trim_dictionary) Comment fixes.  Disallows scratch variables if
10823         GTSV_OPT_SAVE set in options.
10824         (read_from_get) Renamed get_source_read.
10825         (cancel_get) Renamed get_source_destroy_source.
10826         (glob var get_source) New var.
10827
10828         * inpt-pgm.c: (cmd_input_program) Sets vfm_source instead of
10829         read_active_file and cancel_input_pgm.
10830         (read_from_input_program) Renamed input_program_source_read.
10831         Simplified debug output.
10832         (cancel_input_program) Renamed
10833         input_program_source_destroy_source.
10834         (glob var input_program_source) New var.
10835
10836         * loop.c: (loop_1_trns_proc) Simplified debug output.
10837
10838         * main.c: (dump_token) Made eof output more explicit.
10839
10840         * sfm-read.c: (read_variables, dump_dictionary) Removed `lv'
10841         references.
10842
10843         * sort.c: (cmd_sort_cases) Disallows scratch variables.  Removed
10844         code for always-memory or always-disk cases.  malloc's case-list
10845         based on vfm_source_info.ncases.  Explicit support for
10846         memory_stream via memory_source_cases.
10847         (do_external_sort) Sets vfm_source instead of read_active_file and
10848         cancel_input_pgm.
10849         (allocate_file_handles) The temporary directory permissions are
10850         set to 0700 instead of 0777.
10851         (allocate_cases) Formatting fixes.  Simplified debug output.
10852         (output_record) Compacts the case if necessary before writing it
10853         out.
10854         (close_handle, open_handle_w) Simplified debug output.
10855         (write_initial_runs) Destroys vfm_sink, then sets it to
10856         sort_stream.  Writes records to memory based on
10857         vfm_sink_info.case_size.
10858         (write_to_sort_cases) Renamed sort_stream_write().
10859         (merge) Simplified error handling.  Simplified debug output.
10860         Formatting fixes.
10861         (read_from_external_sort) Renamed sort_stream_read().
10862         Reads records based on vfm_source_info.case_size.
10863         (sort_stream_write) Writes records to memory based on
10864         vfm_sink_info.case_size.
10865         (sort_stream_mode) New function.
10866         (glob var sort_stream) New variable.
10867
10868         * temporary.c: (cmd_temporary) Simplified debug output.
10869         (copy_variable) Removed references to `lv'.
10870
10871         * title.c: (get_title) Simplified debug output.
10872
10873         * var.h: Comment fixes.
10874         (struct get_proc) Removed member `lv'.
10875         (struct variable) Removed member `lv'.  Comment fixes.
10876         (glob vars read_active_file, write_active_file, cancel_input_pgm)
10877         Removed.
10878         (struct case_stream) New.
10879
10880         * vars-atr.c: (discard_variables) Changed cancel_input_pgm,
10881         read_active_file references to use vfm_source.
10882         (init_variable, replace_variable) Removed references to `lv'.
10883
10884         * vfm.c: Comment fixes.
10885         (glob var vfm_source, vfm_sink, vfm_source_info, vfm_sink_info)
10886         New variables.
10887         (static var queue, qh, qt, n_lag) Removed.  All references
10888         removed.
10889         (glob var compaction_necessary, compaction_nval, compaction_case,
10890         paging) New variables.
10891         (record_case) Removed.
10892         (procedure) Comment fixes.  Calls vfm_source->read() instead of
10893         read_active_file().
10894         (lag) Removed.
10895         (prepare_for_writing, arrange_compaction, make_temp_case,
10896         vector_initialization, setup_filter) New function.
10897         (open_active_file) Most of the code moved into the abovementioned
10898         new functions.  Now sets temp_dict to &default_dict if there is no
10899         temporary dictionary, for convenience.  New debug output.
10900         (close_active_file) Deals with changing the sink to the source.
10901         Calls finish_compaction().  Frees compaction_case.  Mostly
10902         rewritten.
10903         (glob vars disk_source_file, disk_sink_file) New vars.
10904         (destroy_active_file, read_from_memory) Removed.
10905         (disk_stream_init, disk_stream_read, disk_stream_write,
10906         disk_stream_mode, disk_stream_destroy_source,
10907         disk_stream_destroy_sink) New functions.
10908         (glob var vfm_disk_stream) New var.
10909         (glob vars memory_source_cases, memory_sink_cases,
10910         memory_sink_iter, memory_sink_max_cases) New vars.
10911         (memory_stream_init, memory_stream_read, memory_stream_write,
10912         memory_stream_mode, memory_stream_destroy_source,
10913         memory_stream_destroy_sink) New functions.
10914         (glob var vfm_memory_stream) New var.
10915         (write_case) Local var `i' renamed `cur_trns'; local var `retval'
10916         named `more_cases'.  Simplified debug output.  Otherwise mostly
10917         rewritten.
10918         (record_case) Moved into the stream drivers.  Removed.
10919         (transform) Removed (was dead code).
10920         (SPLIT_FILE_procfunc) s/vfm_replacement/vfm_sink_info/.  In the
10921         common case that the splits don't change, we don't need to copy
10922         the case into prev_case again--pointless.
10923         (compact_case) New function.
10924         (finish_compaction) New function.
10925
10926         * vfmP.h: Comment fixes.
10927         (DEV_* enum series) Removed. 
10928         (struct storage) Renamed `stream_info'.  Removed variant record.
10929         Removed `device' member.
10930
10931         * debug-print.h: New file.
10932         
10933 Sun Jun  8 01:12:38 1997  Ben Pfaff  <blp@gnu.org>
10934
10935         * autorecode.c: Turned off debugging.
10936
10937         * data-list.c: (destroy_dls) Closes the associated file handle.
10938
10939         * descript.q: (custom_variables) Added PV_NO_SCRATCH to
10940         parse_variables() options.
10941
10942         * dfm.c: (open_file_r) Removed gratuituous argument to msg() call.
10943
10944         * display.c: (display_variables) Really fixed null cell bug.
10945
10946         * file-handle.q: (fh_close_handle) Changed debugging message.
10947
10948         * frequencies.q: (custom_variables) Added PV_NO_SCRATCH to
10949         parse_variables() options.
10950
10951         * list.q: Added PV_NO_SCRATCH in q2c varlist options.
10952         (cmd_list) Fails if no variables specified.
10953         (determine_layout) Writes blank lines manually.
10954
10955         * loop.c: (loop_1_trns_proc) Made debugging code only print
10956         messages if debugging.
10957
10958         * q2c.c: (dump_subcommand) Appends sbc->message to SBC_VARLIST
10959         parse_variables() arguments.
10960         (main) Parses optional parenthesized options to varlist
10961         subcommands into sbc->message.
10962
10963         * sfm-read.c: Format fix.
10964
10965         * var.h: (FV_*) New enum series.
10966         (PV_*) New enum PV_NO_SCRATCH.
10967
10968         * vars-prs.c: (find_var) Removed.
10969         (fill_all_vars) Takes FV_* enum instead of boolean third
10970         argument.  Rewritten to deal with scratch as well as system
10971         variables.
10972         (parse_variables) Error message on scratch variable if
10973         PV_NO_SCRATCH set.
10974
10975         * vfm.c: (static var virt_begin_func) New var.
10976         (procedure) Sets up virt_begin_func.
10977         (SPLIT_FILE_procfunc) For the first case, calls virt_begin_func()
10978         after dump_splits().  For succeeding groups changes, calls
10979         virt_begin_func() instead of begin_func().      
10980
10981 Fri Jun  6 22:42:23 1997  Ben Pfaff  <blp@gnu.org>
10982
10983         * count.c, data-out.c, file-handle.q, list.q, loop.c: Turned off
10984         debugging.
10985
10986         * dfm.c: Added some debugging messages, disabled by default.
10987         (open_file_r) Fixed error message.
10988         (read_record) On eof on inline_file, instead of calling
10989         fh_close_handle(), simply jump to eof label like a normal file.
10990         Message fixes.
10991
10992         * display.c: Thin lines between rows for certain kinds of
10993         listing.  Fixed `null cell' bug.
10994
10995         * error.c: (failure) Flush stdout, stderr before failing.
10996
10997         * file-handle.q: (fh_close_handle) Added debugging message.
10998
10999         * frequencies.q: (dump_full) Bottom line extends across entire
11000         table width.  Changed title formatting.
11001         (dump_condensed) Changed title formatting.
11002         (dump_statistics) Fixed title formatting.
11003
11004         * glob.c: (init_glob) Moved initialization of cur_proc out of #if.
11005         Sets default value of set_format.
11006
11007         * list.q: (cmd_list) Calls blank_line() before determine_layout().
11008         Passes write_all_headers() to procedure() as pre-group func.
11009         (write_all_headers) New function.
11010         (determine_layout) Removed calls to write_header().
11011         Calls blank_line() before and after write_fallback_headers().
11012
11013         * recode.c: (recode_trns_free) Only attempts to free head->map if
11014         non-NULL.
11015
11016         * sfm-read.c: (read_variables) Allows `#' at beginning of system
11017         file variable names but gives a warning.  Sets `left' based on
11018         first character being/not being `#'.  On lossage frees dict->var.
11019
11020         * som-high.c: (som_draw_title) Simplified title formatting.
11021
11022         * vfm.c: (dump_splits) Fixed and changed splits formatting.
11023
11024 Thu Jun  5 22:51:15 1997  Ben Pfaff  <blp@gnu.org>
11025
11026         * autorecode.c: (cmd_autorecode) Sets h_trans to NULL at
11027         beginning.  Frees v_src, v_dest on successful exit.  Frees
11028         h_trans[*], h_trans on lossage.
11029         (recode) Frees h_trans[*], h_trans.
11030
11031         * dfm.c: (dfm_close) Formatting change.
11032         (open_inline_file) Now passed a dfm_fhuser_ext to initialize; no
11033         longer allocates its own in inline_file.
11034         (open_file_r) Passes the local dfm_fhuser_ext to
11035         open_inline_file().
11036         (open_file_w) Message fix. 
11037         (read_record) Buffer reallocation strategy changed.  Frees
11038         ext->line even in inline_file to prevent leaks.
11039         (dfm_put_record) Fixed bug where `ext' was cached before the file
11040         was opened and thus it would be NULL when the file really was
11041         open.
11042         (cmd_begin_data) Sets up inline_file basics itself, then calls
11043         open_inline_file() for the dfm_fhuser_ext.  Formatting fix.
11044
11045         * list.q: (write_line) Formatting fix.
11046         (clean_up) Minor strategy change.  Sets proportional font after
11047         finishing cleanup.
11048         (determine_layout) Sets fixed font before writing regular headers,
11049         or after writing fallback headers.
11050
11051         * modify-vars.c: (cmd_modify_vars) Frees variable lists for DROP
11052         and KEEP vars after using them.
11053
11054         * postscript.c: (ps_init_driver) Frees x->family.
11055         (postopen) When loading fonts, free the temporary font name buffer
11056         after using it.
11057         (ps_text_set_font_by_position) Free temporary font name buffer
11058         after using it.
11059         (text) Fixed code that calculated `lig' so that `lig' always gets
11060         initialized.  Formatting fix.
11061
11062         * som-low.c: (get_cell_size, som_get_table_size) `prop_height' ->
11063         `font_height'.
11064         [GLOBAL_DEBUGGIGN] (check_table) Use arena_alloc() to allocate
11065         cells, not xmalloc(), so that the cells will get destroyed
11066         automatically.
11067
11068         * sysfile-info.c: (cmd_sysfile_info) Frees the dictionary after
11069         using it.
11070
11071 Tue Jun  3 23:33:22 1997  Ben Pfaff  <blp@gnu.org>
11072
11073         * ascii.c: (ascii_text_draw) Always sets metrics for strings that
11074         are drawn.
11075
11076         * dfm.c: Comment fix.
11077
11078         * list.q: Comment fixes.  Include somP.h.  Removed static vars
11079         table, n_columns, n_rows, part.  New struct list_ext.  New static
11080         var line_buf.
11081         (n_lines_remaining, n_chars_width, write_line) New functions.
11082         (cmd_list, list_cases) Rewritten.
11083         (begin_row, end_row, flush_table) Removed.
11084         (write_header, clean_up, write_varname, write_fallback_headers,
11085         determine_layout) New functions.
11086
11087         * output.c: (outp_iterate_enabled_drivers) Minor reformat.
11088
11089         * output.h: Comment fix.
11090
11091         * postscript.c: Comment fix.
11092         (struct ps_driver_ext) Removed prop_size, fixed_size members;
11093         added font_size.  All references changed.
11094         (ps_init_driver) Initializes font_size.  Simplified space checking
11095         code.
11096         (static var option_tab[]) Removed prop-size, fixed-size; added
11097         font-size.
11098         (ps_option) Handles font_size.
11099
11100         * som-high.c: Moved prototypes into somP.h.
11101         (som_init_driver) New function.
11102         (som_submit_table) Moved some code into new function
11103         som_init_driver().
11104         (build_target) Moved some code into new function
11105         som_internal_eject_page().
11106         (som_eject_page) Uses som_internal_eject_page().
11107         (som_internal_eject_page) New function.
11108
11109         * som-low.c: Moved prototypes into somP.h.
11110
11111         * som.h: Formatting fixes.
11112
11113         * somP.h: (struct som_driver_ext) Removed em_width;
11114         added prop_em_width, fixed_width.
11115
11116 Mon Jun  2 14:25:25 1997  Ben Pfaff  <blp@gnu.org>
11117
11118         * Makefile.am: Added `localedir' definition.  Added
11119         -DLOCALEDIR="..." to DEFS.  Added -I. to INCLUDES.
11120
11121         * ascii.c: (macro draw_line) Fixed capitalization.
11122
11123         * ascii.c, autorecode.c, cases.c, cmdline.c, command.c, common.c,
11124         compute.c, count.c, data-in.c, data-list.c, data-out.c,
11125         descript.q, dfm.c, display.c, do-if.c, error.c, expr-evl.c,
11126         expr-opt.c, expr-prs.c, file-handle.q, file-type.c, filename.c,
11127         formats.c, frequencies.q, get.c, getline.c, glob.c, groff-font.c,
11128         hash.c, heap.c, include.c, inpt-pgm.c, lexer.c, list.q, loop.c,
11129         main.c, mis-val.c, misc.c, modify-vars.c, numeric.c, output.c,
11130         postscript.c, print.c, q2c.c, recode.c, rename-vars.c, repeat.c,
11131         sample.c, sel-if.c, sfm-read.c, sfm-write.c, sfmP.h, som-frnt.c,
11132         som-high.c, som-low.c, sort.c, split-file.c, sysfile-info.c,
11133         temporary.c, title.c, tokens.h, val-labs.c, var-labs.c,
11134         vars-atr.c, vars-prs.c, vector.c, vfm.c, weight.c: Marked strings
11135         for internationlization.
11136
11137         * glob.c: [HAVE_LOCALE_H] Includes locale.h.
11138
11139 Sun Jun  1 23:31:18 1997  Ben Pfaff  <blp@gnu.org>
11140
11141         * do-if.c, sort.c, val-labs.c: Comment fixes.
11142
11143         * glob.c: (init_glob) Uncommented, updated i18n support.
11144         
11145         * arena.c, ascii.c, data-in.c, descript.q, error.c, expr-evl.c,
11146         expr-opt.c, expr-prs.c, filename.c, frequencies.q, groff-font.c,
11147         output.c, postscript.c, sfm-read.c, som-high.c, vars-prs.c: Made
11148         the declarations of macros taking arguments a lot nicer.
11149
11150 Sun Jun  1 17:22:04 1997  Ben Pfaff  <blp@gnu.org>
11151
11152         * error.h: Removed CE, CW aliases for SE, SW.
11153
11154         * q2c.c: Removed explicit streq() definition since it's duplicated
11155         in str.h.
11156         
11157         * approx.h, error.h, font.h, hash.h, misc.h, output.h, somP.h,
11158         stats.h, str.h, tokens.h: Made the declarations of macros taking
11159         arguments a lot nicer-looking of <pinard@iro.umontreal.ca>.
11160         Comment fixes.
11161
11162 Sun Jun  1 12:02:06 1997  Ben Pfaff  <blp@gnu.org>
11163
11164         * cmdline.c: Comment fixes.
11165         (pick_compat) Changed return type to int.  Now, instead of setting
11166         glob var `compat' to the emulation, returns the emulation.  All
11167         references changed.
11168         (parse_command_line) Added terminating null to end of
11169         `long_options' array definition.
11170         (pre_syntax_message) Fixes.
11171         (usage) Shows the default emulation in the syntax message by
11172         calling pick_compat().
11173
11174         * getline.c: (getl_add_include_dir) Separates paths with
11175         PATH_DELIMITER, not DIR_SEPARATOR.
11176
11177         * glob.c: (init_glob) Fixed references to DEFAULT_VER_PCP40,
11178         DEFAULT_VER_WIN61, DEFAULT_VER_X40.
11179
11180         * output.c: (outp_configure_macro) Make earlier definitions for a
11181         particular key override later ones for the same key.
11182         
11183 Fri May 30 19:40:49 1997  Ben Pfaff  <blp@gnu.org>
11184
11185         * ascii.c: Comment fixes.
11186
11187         * output.c: (outp_get_paper_size)
11188         s/STAT_OUTPUT_INIT_FILE/STAT_OUTPUT_PAPERSIZE_FILE/.
11189         
11190 Sun May 25 22:34:07 1997  Ben Pfaff  <blp@gnu.org>
11191
11192         * ascii.c, postscript.c, sfm-read.c, sfm-write.c, sort.c: Include
11193         <errno.h>.  GNU libc 2 enforces this!
11194
11195         * command.c: (parse_cmd) Fixed problem with `else' clause being
11196         paired with wrong `if'.  Comment fix.
11197
11198 Fri May  9 16:53:52 1997  Ben Pfaff  <blp@gnu.org>
11199
11200         * getline.c: [!HAVE_LIBREADLINE] (read_console) Changed
11201         blp_getline() to getline().
11202
11203         * output.c: (outp_eval_dimension) Changed the fix from last time;
11204         there was no variable `a'.
11205
11206         * q2c.c: (get_line) Fixed boundary condition overrun bug.
11207
11208 Mon May  5 21:58:22 1997  Ben Pfaff  <blp@gnu.org>
11209
11210         * output.c: (outp_evaluate_dimension) Fixed handling of negative
11211         numbers having fractional parts.  Added case of a fraction without
11212         a whole-number part.
11213
11214 Fri May  2 22:08:05 1997  Ben Pfaff  <blp@gnu.org>
11215
11216         * ascii.c: (ascii_text_get_font_position) Removed.
11217
11218         * expr.h, exprP.h: Disabled debugging.
11219
11220         * groff-font.c, postscript.c: Changed `groff' to `Groff' in
11221         several places.
11222
11223         * output.h: (struct outp_class_struct) Removed
11224         text_get_font_position method.  All references deleted.
11225
11226         * postscript.c: Big change here.  Fontmaps were completely
11227         eliminated because of a change in philosophy.  Comment fixes.
11228         (struct ps_fontmap, ps2dit_map, font_family, dit2family_map)
11229         Removed.
11230         (struct ps_driver_ext) `position', `fontmap', `prop_name',
11231         `fixed_name' members removed.  New members `prop_family',
11232         `fixed_family'.  `family' member changed to type char *.
11233         (static var ps_fontmaps) Removed.
11234         () Removed.
11235         (ps_init_driver) Removed obsolete references, updated.
11236         Initializes `translate_x', `translate_y', `scale'.  Doesn't read
11237         fontmap, of course.  Refers to font names through internal_name
11238         rather than subversive means.  Frees proper items.
11239         (static var option_tab[]) Removed `fontmap-file' option; renamed
11240         `fixed-font', `prop-font'.
11241         (ps_option) Corresponds to option_tab[].
11242         (read_fontmap, release_fontmap, ps_to_dit, compare_ps2dit,
11243         hash_ps2dit, compare_dit2family, hash_dit2family, compare_family,
11244         hash_family) Removed.
11245         (postopen) Generates font names from family names.  Gets
11246         PostScript font name properly.  New prologue file comment `!!!'
11247         style.
11248         (ps_open_page) Adds translate_x, translate_y to BP prologue
11249         function; gives SF argument floating-point format.
11250         (ps_text_set_font_by_name) Doesn't try to map PostScript->Groff
11251         font name.  Doesn't change font family.
11252         (ps_text_set_font_by_position) Generates Groff font name from font
11253         family name instead of through table lookup.
11254         (ps_text_set_font_by_family) Renamed `ps_text_set_font_family',
11255         all references changed.  Reduced to simple string assignment.
11256         (ps_get_font_name) Removed.
11257         (ps_get_font_family) Reduced to string return.
11258         (text) Doesn't save `position' since it no longer exists.  Ugly
11259         kluge to save font family--fix soon?
11260         (load_font) Removed PostScript name argument.
11261         
11262 Thu May  1 14:58:59 1997  Ben Pfaff  <blp@gnu.org>
11263
11264         * postscript.c: Comment fix.
11265         (ps_open_page) Puts scale factor in PostScript output.
11266         
11267 Sat Apr 26 11:49:32 1997  Ben Pfaff  <blp@gnu.org>
11268
11269         * Makefile.am: Distcleans q2c.
11270
11271 Wed Apr 23 21:33:48 1997  Ben Pfaff  <blp@gnu.org>
11272
11273         * ascii.c: (delineate) Sets text size even if width is zero.
11274
11275         * command.c: Comment fix.
11276         (static var cmd_table[]) Re-enabled EVALUATE command.
11277         (parse_cmd) Lotsa comment fixes.  Fixed infinite loop in parsing
11278         of comments in script files.  Now more liberal on criteria for
11279         performing a state transition--if *anything* happened correctly,
11280         not just if *everything* happened correctly.
11281
11282         * data-out.c: (convert_F) Comment fix.  Why in the fsck does
11283         Checker segfault on formatting large numbers and why in the fsck
11284         hadn't I noticed this before?
11285
11286         * expr.h, exprP.h: No longer turn off GLOBAL_DEBUGGING.
11287
11288         * list.q: (cmd_list) Commented out the actual output routine
11289         because of various problems.  Probably will abandon the idea of
11290         using the general `crushed tables' for the LIST procedure.
11291
11292         * temporary.c: (restore_dictionary) Sets var_by_name to NULL after
11293         clearing it.  Allocates a new var_by_name dictionary before trying
11294         to add members to it.
11295
11296         * vars-atr.c: [DEBUGGING] (dump_one_var_node) Removed argument
11297         `sib'.  Changed type of `node' argument.
11298         [DEBUGGING] (dump_var_tree) Replaced avlwalk() with
11299         avl_walk_inorder().
11300         (clear_variable) Only dumps the var tree if var_by_name non-NULL.
11301         [DEBUGGING] Only deletes the variable from var_by_name if that var
11302         non-NULL.
11303
11304 Fri Apr 18 16:48:41 1997  Ben Pfaff  <blp@gnu.org>
11305
11306         * Makefile.am: Added include files to SOURCES.  Added
11307         frequencies.q to EXTRA_DIST.  Removed include/ from INCLUDES.  Now
11308         includes rules for q2c.  Added `boast' target.
11309
11310 Fri Apr 18 15:42:22 1997  Ben Pfaff  <blp@gnu.org>
11311
11312         * Makefile.am: Maintainer-clean Makefile.in.
11313         
11314         * Makefile.am: Fixed redundant EXTRA_DIST line.
11315
11316         * ascii.c: Comment fixes.
11317         (ascii_line_vert) Fixed overly aggressive range check.
11318
11319         * display.c: Removed dead code.
11320
11321         * list.q: Turn debugging on.
11322         (flush_table) New debug code.
11323
11324         * sfm-read.c: (read_value_labels) malloc's the structure before
11325         trying to assign to its members.
11326
11327         * sfm-write.c: Comment fix.
11328
11329         * som-high.c: (som_submit_table) Sets som.t and som.d on each call
11330         to output_table().
11331         (output_table) No arguments anymore--gets them through `som'
11332         global.  New debug code.  In crushed tables, now sets `htv' as
11333         well as `hv' to avoid bad confusion later.
11334         (dump_crush_page) New debug code.
11335
11336         * som-low.c: (som_dump_crush_page) New debug code.
11337
11338 Thu Mar 27 01:11:29 1997  Ben Pfaff  <blp@gnu.org>
11339
11340         All source files: Broke long lines into multiple lines.
11341         
11342         * ascii.c: (ascii_close_page) Uses host_system var in place of
11343         HOST_SYSTEM constant.
11344
11345         * cmdline.c: (var syntax_message[]) Broke into
11346         pre_syntax_message[] and post_syntax_message[].
11347         (usage) Outputs both parts, separated by driver list.
11348
11349         * error.h: Fixed broken formatting.
11350
11351         * expr-opt.c: (str_search, str_rsearch) New functions.
11352
11353         * misc.c: (blp_getdelim) Removed.  All references changed to
11354         `getdelim'.
11355         (str_search, str_rsearch) Removed.
11356         (memrmem) New function.
11357
11358         * misc.h: (blp_getline) Removed.  All reference changed to
11359         `getline'.
11360
11361         * stat.h: New file.
11362
11363         * filename.c: Includes "stat.h", not <sys/stat.h>.
11364         (blp_getenv) Uses host_system var instead of HOST_SYSTEM constant.
11365
11366         * output.c: (outp_list_classes) Changed output formatting.
11367
11368         * sfm-write.c: (write_header) Uses host_system var instead of
11369         HOST_SYSTEM constant.
11370         (write_rec_7_34) Extracts version numbers from the version string.
11371         Untested.
11372
11373         * sort.c: Includes "stat.h", not <sys/stat.h>.
11374
11375         * str.c: (strcasecmp) Removed.
11376
11377         * title.c: (cmd_document) Uses host_system var instead of
11378         HOST_SYSTEM constant.
11379
11380         * version.c: Generated on-the-fly by the Makefile instead of being
11381         static.
11382
11383         * str.h: Comment fixes.  Doesn't substitute for missing memmove or
11384         memcpy.
11385         [!HAVE_STRNCASECMP] Declares strncasecmp().
11386
11387         * version.h: Removed stray character.  Comment fixes.
11388         (vars host_system, build_system) New vars.
11389
11390 Mon Mar 24 21:47:31 1997  Ben Pfaff  <blp@gnu.org>
11391
11392         * Most source files: Changed formatting of copyright notice; fixed
11393         FSF address; reformatted to better conform to GNU standards;
11394         comment fixes.  Added markups to prevent GNU indent from messing
11395         up my beautiful formatting :-).
11396         
11397         * q2c.c: (get_line) Ignores lines that begin with `/* *INDENT' so
11398         that GNU indent markups can be passed through without problems.
11399
11400 Wed Feb 19 21:30:31 1997  Ben Pfaff  <blp@gnu.org>
11401
11402         * get.c: Turned off debugging.
11403
11404         * glob.c: (init_glob) Turned on save-file compression by default.
11405
11406         * sfm-write.c: (sfm_write_case) Fixed bug which resulted in less
11407         compression than was possible in save files.
11408
11409 Sun Feb 16 20:57:20 1997  Ben Pfaff  <blp@gnu.org>
11410
11411         * data-out.c: (convert_F) Comment fixes.  Debug message fixes.
11412
11413         * frequencies.q: Removed Fiasco extensions.  Updated calculation
11414         algorithms.  Polished output format. 
11415         (struct frq_info_struct) Removed members `max_degree', `min_n',
11416         all references removed.
11417         (macro frq_extensions) Removed.
11418         (static vars min_n, max_degree) Removed, all references removed.
11419         (internal_cmd_frequencies) Doesn't handle extensions.  Doesn't
11420         calculate `min_n', `max_degree'.
11421         (postcalc) Passes new arg to dump_statistics().
11422         (dump_full) Honor NOLABEL option.  Buggy?  Adds variable name
11423         title.
11424         (dump_condensed) Adds variable name title.
11425         (sum_freqs) Removed.
11426         (calc_stats) Updated calculation algorithm.
11427         (dump_statistics) Removed warning for too-few observations.
11428         Changed table formatting.  Adds variable name title if passed new
11429         arg is nonzero.
11430
11431         * output.h: Comment fix.
11432
11433         * recode.c, sample.c, sort.c: Disabled debug code.
11434
11435         * som-frnt.c: (som_set_value, som_set_float, som_set_text)
11436         Improved debug code.
11437
11438         * var.h: (enum series frq_*) Removed Fiasco extensions.
11439
11440 Sat Feb 15 21:26:53 1997  Ben Pfaff  <blp@gnu.org>
11441
11442         * command.c: Added PROCESS IF to command table.
11443
11444         * Lots & lots of places, removed checks for NULLs preceding calls
11445         to free_expression(), which itself checks.
11446
11447         * descript.q: Removed Fiasco extensions.  Removed optimizations
11448         for non-weighted active files.  Implemented some options.
11449         Finished polishing output format.  Comment fixes.  Merged
11450         `descript.g'.
11451         (static vars n_glob_miss_list, n_glob_valid, n_glob_missing,
11452         max_degree, min_n) Removed.
11453         (macro dsc_extensions) Removed.
11454         (struct dsc_info_struct) Removed `min_n' member, all references
11455         fixed.
11456         (internal_cmd_descriptives) Removed calculation of min_n,
11457         max_degree.  Only deals with one `calc' routine instead of two
11458         flavors.
11459         (precalc) Eliminated redundancy.  Updated for changes to
11460         descriptives_proc structure.
11461         (calc) Moved here from `descript.g'.  Rewritten to calculate
11462         statistics via `moments about the mean' rather than by summing,
11463         summing squares, summing cubes, and so on.
11464         (postcalc) Rewritten for new-style statistical calculation.
11465         (display) Removed support for displaying variables across rows.
11466         No longer crushes the descriptives table.  Removed ancient code.
11467         Added display of N, by variable and listwise.
11468
11469         * descript.g: Removed; merged into `descript.q'.
11470
11471         * expr-evl.c: (evaluate_expression) Now returns a double.  For
11472         numeric results, it returns the result as well as storing it in
11473         the passed `value' structure if non-NULL.  For string results it
11474         just returns 0.0 and it must be passed non-NULL.  Many references
11475         to this function were optimized by use of this change, especially
11476         but not exclusively in `compute.c'.
11477
11478         * frequencies.g: Comment fix.
11479
11480         * glob.c: (glob var process_if_expr) New global var.
11481
11482         * postscript.c: (static var option_tab[]) Corrected entry for
11483         `fixed_size'.
11484         (postopen) Sets x->size to x->prop_size.
11485         (ps_text_set_font_by_name) Sets font size as well as typeface for
11486         PROP and FIXED fonts.
11487         
11488         * sel-if.c: (cmd_process_if) New function.
11489
11490         * sfm-write.c: (struct sfm_fhuser_ext) New member `n_cases'.
11491         (sfm_write_dictionary) Sets `n_cases' to 0.
11492         (sfm_write_case) Increments `n_cases'.
11493         (sfm_close) Attempts to seek the system file back to the header
11494         and write the number of cases in its proper slot.
11495
11496         * som-frnt.c: (som_insert_table) Masks off expansion options since
11497         only SOPT_X_NORM seems to work sensibly.
11498
11499         * som-low.c: (get_cell_size) Fixed bug when a table cell was sized
11500         with a `fixed' value of 2.
11501
11502         * sort.c: (cmd_sort_cases) Cancels PROCESS IF.
11503
11504         * sysfile-info.c: (cmd_sysfile_info) Doesn't display more than 10
11505         value labels; uses SOPT_NONE instead of SOPT_X_BOTH.
11506
11507         * var.h: (enum series dsc_*) Removed Fiasco extensions.
11508         (struct descriptives_proc) Removed `miss_noweight'; new members
11509         `X_bar', `M2', `M3', `M4', `min', `max'.
11510
11511         * vars-atr.c: (discard_variables) Cancels PROCESS IF.
11512
11513         * vfm.c: (close_active_file) Cancels PROCESS IF.
11514         (write_case) Doesn't process cases unselected by PROCESS IF.
11515
11516 Fri Feb 14 23:32:58 1997  Ben Pfaff  <blp@gnu.org>
11517
11518         * glob.c: (glob var err) Removed.
11519
11520         * sysfile-info.c: (cmd_sysfile_info) When adjusting table size,
11521         doesn't have to take into account number of value labels since
11522         they're in a subtable anyway.  Also, doesn't display more than 10
11523         value labels since we can't yet break pages in subtables.
11524
11525 Tue Feb  4 15:15:50 1997  Ben Pfaff  <blp@gnu.org>
11526
11527         * som-frnt.c: (som_change_table_size) Simple change for elegance
11528         that shouldn't change behavior.
11529         (som_set_value) Comment fix.
11530
11531         * som-high.c: (som_submit_table) Message fix.
11532
11533 Wed Jan 22 21:54:00 1997  Ben Pfaff  <blp@gnu.org>
11534
11535         * command.c: Added SYSFILE INFO to command table.
11536
11537         * file-handle.q: (fh_handle_filename) New function.
11538
11539         * get.c: (save_trns_proc) Fixed a bug in padding of output data
11540         with spaces.
11541
11542         * main.c: (parse) New return value for command functions, -3.
11543
11544         * misc.h: Comment fix.
11545
11546         * output.h: Comment fixes.
11547         (macro COMPONENTS) Removed.
11548
11549         * postscript.c: (write_text) Modified literal_chars[] so that `('
11550         and ')' are not written to the output in strings as literals.
11551
11552         * sfm-read.c: (sfm_read_dictionary) New argument.
11553         (read_header) New argument.  Sets the information structure's
11554         values from the header information.  
11555         (read_variables) [__CHECKER__] Redefines isalnum()--some sort of
11556         bizarre Checker problem, I guess.
11557         (read_variables) Proper cleanup on lossage.
11558
11559         * sfm.h: (struct sfm_read_info) New struct for use by
11560         sfm_read_dictionary().
11561
11562         * som-frnt.c: (som_create_table) New argument CREATE_FLAGS,
11563         currently used just for tables that can be dynamically resized and
11564         thus have to be allocated with arena_malloc() instead of
11565         arena_alloc().  All references changed.
11566         (som_change_table_size) New function.
11567         (som_insert_table) Bugfix: now inserts `cell', not `c'!
11568
11569         * som-high.c: [GLOBAL_DEBUGGING] (check_table) Moved to som-low.c.
11570         (som_submit_table) [GLOBAL_DEBUGGING] Doesn't call check_table()
11571         any more.
11572
11573         * som-low.c: (draw_cell) Calls draw_table_cell() for SCON_TABLE
11574         cells.
11575         (draw_intersection) Now takes an argument specifying the table in
11576         question.  All references changed.
11577         (draw_table_cell) New function.
11578         (som_get_table_size) [GLOBAL_DEBUGGING] Calls check_table().
11579         (som_get_table_size) Many nice new explanatory comments.
11580         [GLOBAL_DEBUGGING] (check_table) Moved here from som-high.c.
11581
11582         * som.h: New enum series SOM_CREATE_* for use as create flags with
11583         som_create_table().
11584
11585         * str.h: Moved a comment here from TODO.
11586
11587         * sysfile-info.c: New file.  Reference implementation.
11588
11589 Sun Jan 19 14:22:11 1997  Ben Pfaff  <blp@gnu.org>
11590
11591         * command.c: Added RENAME VARIABLES to table of commands.
11592
11593         * data-in.c: (dls_error) Sets `cust_field'.
11594         (parse_N) Message fix.
11595         (parse_day_count) New function.
11596         (to_roman) Never outputs VX as a `short form' of V.
11597         (parse_month) Fixed parsing of Roman numerals.
11598         (parse_trailer) Message fix.
11599         (parse_DATE, parse_ADATE, parse_EDATE, parse_SDATE, parse_JDATE,
11600         parse_QYR, parse_MOYR, parse_WKYR, parse_DTIME) Issue a message if
11601         the date is invalid.
11602         (parse_SDATE) Fixed swapped day, year.
11603         (parse_JDATE) Fixed bug for dates in 1582.
11604         (parse_DTIME) Allows days not between 1 and 31.
11605         (parse_numeric) Makes local copy of f.type for easier usage.
11606         FMT_DOLLAR fixed.
11607
11608         * data-out.c: (convert_F) When outputting as scientific, properly
11609         sets f.type as fp->type.
11610         (insert_commas) Fixed operator precedence problem with setting of
11611         nitems.  Changed strcpy to memcpy (no null terminator). 
11612         (convert_date) Fixed FMT_JDATE: added 1900 to year.
11613         (convert_CCx) Essentially rewritten, but now it works.
11614
11615         * display.c: (cmd_display) Added DISPLAY FILE LABEL (undocumented
11616         feature of Fiasco).
11617         (display_documents) Implemented.
11618
11619         * error.c: (glob var cust_field) New var.
11620         (vmsg) Displays cust_field as part of message classes DE and DW.
11621
11622         * formats.c: (debug_print) Fixed to compile under updated
11623         dictionary format.
11624
11625         * get.c: (cmd_get, cmd_save_internal) Close file handle on
11626         failure.
11627
11628         * misc.c: (parse_format_specifier) Formatting fix.
11629
11630         * modify-vars.c: (struct var_modification) Renamed `n_reorder' as
11631         `n_rename' for clarity.
11632         (cmd_modify_vars) Initializes `forward' and `positional' at
11633         appropriate times.  Frees lists of vars to rename on failure.
11634         Comment fix.  Frees memory on success.  
11635         (rearrange_dict) Simplified `for' loop condition.
11636
11637         * rename-vars.c: New file (reference implementation).
11638         
11639         * set.q: (internal_cmd_set) Fixed `emu' test condition.
11640
11641         * sfm-read.c: (read_header) File label is created only if file
11642         label in file is not blank.
11643         (read_variables) Initializes `dict' local variable.
11644         (read_documents) Proper behavior on lossage.
11645
11646         * sfm-write.c: (write_header) Doesn't blank out the file label
11647         (why was this here to begin with?!)
11648
11649         * temporary.c: (save_dictionary) File label is copied only if
11650         non-NULL.  Doesn't try to xstrdup() dictionary documents.
11651         Adapted so as to not irritate Checker.
11652         (free_dictionary) Only destroys var_by_name if non-NULL.
11653
11654         * title.c: (cmd_file_label) Doesn't skip FILE, LABEL tokens.
11655         (cmd_document) Doesn't skip DOCUMENT token.  Adds some header
11656         lines to the document, indents the document.  Also, it works now.
11657         (add_document_line) New function.
11658
11659         * var.h: (struct dictionary) Reordering.
11660
11661         * vars-prs.c: (parse_variables) On lossage, only local_free()'s
11662         bits if it was allocated to begin with.
11663
11664 Thu Jan 16 13:08:57 1997  Ben Pfaff  <blp@gnu.org>
11665
11666         * command.c: Added MODIFY VARS to list of commands.
11667
11668         * configure.in: Updated custom macros for autoconf 2.12.  Removed
11669         mmap reference; fixed termcap library reference.
11670
11671         * display.c: (display_variables) Fixed a few bugs although it's
11672         still not well written.
11673
11674         * error.c: [!__CHECKER__] (chkr_disp_call_chain) New function.
11675         (induce_segfault) Calls chkr_disp_call_chain() instead of
11676         inducing an actual SIGSEGV.
11677
11678         * expr-opt.c: (evaluate_tree) Swapped order of arguments to
11679         str_search() and str_rsearch().  Fixed tests for matches on
11680         OP_INDEX and OP_RINDEX.
11681
11682         * filename.c: (good_getcwd) Removed as the new libc for Checker
11683         doesn't contain this bug, apparently.
11684
11685         * misc.c: (str_search, str_rsearch) Changed order of arguments for
11686         consistency with GNU memmem.
11687         (blp_getdelim) Changed `len' from `int' to `size_t'.
11688
11689         * modify-vars.c: Reference implementation.
11690
11691         * som-frnt.c: (zero_length) New global var.
11692         (som_create_table) Message fix.
11693
11694         * som.h: Added gcc attributions to som_set_text(),
11695         som_output_text() prototypes.  blank_line() refers to
11696         zero_length[] instead of a literal null string to suppress gcc
11697         warnings.
11698
11699         * sort.c: (do_external_sort) Fixed fencepost error on lossage.
11700         (allocate_cases) Decrements x_max so the last element of x[] can
11701         be used by the algorithm.
11702
11703         * var.h: Changed minor details of `variable' declaration.  
11704         (struct modify_vars_proc) New struct.
11705         (struct variable) Added field p.mfv.
11706
11707         * vars-atr.c: Comment fix.
11708
11709         * vars-prs.c: (fill_all_vars) More optimal implementation.
11710
11711         * vfm.c: (dump_splits) Sets the last byte of temp_buf to a null
11712         character, which it shouldn't have to do but printf() seems to
11713         read the null byte even though I supply a maximum length...
11714
11715 Fri Jan 10 20:22:08 1997  Ben Pfaff  <blp@gnu.org>
11716
11717         * command.c: Removed command alias X for QUIT.
11718         (parse_cmd) Fixed comment parsing.
11719
11720         * dfm.c: (struct dfm_fhuser_ext) Fields `len', `size' are now of
11721         type size_t.
11722         (read_record) Fixed references to len, size.
11723         (dfm_get_record) Restructured.
11724
11725         * file-handle.h: (struct file_handle) Field `lrecl' now of type
11726         size_t.
11727
11728         * file-handle.q: (internal_cmd_file_handle) Checks for nonpositive
11729         record length.
11730
11731         * modify-vars.c: New file.  Not complete.
11732         
11733         * set.q: (set_ccx) Fixed operator precedence problem regarding ^
11734         and ==.
11735
11736         * sfm-read.c: (bswap_flt64, read_header, write_variable) Fixed
11737         problems caused by int/size_t differences.
11738
11739         * sort.c: (output_record, merge_once) Cast `size_t's to `int's in
11740         appropriate spots.
11741
11742         * str.c: (strcasecmp) Fixed bug that cropped up when the strings
11743         being compared were of equal length.
11744
11745 Thu Jan  2 19:08:23 1997  Ben Pfaff  <blp@gnu.org>
11746
11747         * command.c: Added DOCUMENT, DROP DOCUMENTS, FILE LABEL.
11748
11749         * lexer.c: (get_dotted_rest_of_line) New function.
11750
11751         * sel-if.c: (cmd_filter) Cannot choose string or scratch variables
11752         as filters.
11753
11754         * sfm-read.c: (sfm_read_dictionary) Calls read_documents() to read
11755         type 6 records.  Frees the dictionary properly.
11756         (read_header) Initializes the dictionary instead of letting
11757         read_variables() do it.  Sets the dictionary file label from the
11758         system file.
11759         (read_documents) New function.
11760
11761         * sfm-write.c: (sfm_write_dictionary) Calls write_documents() to
11762         write type 6 record if appropriate.
11763         (write_header) Writes file label from dictionary.
11764         (write_documents) New function.
11765
11766         * temporary.c: (save_dictionary, restore_dictionary,
11767         free_dictionary) Properly handle new fields in dictionary struct.
11768
11769         * title.c: (get_title) Returns after failure().
11770         (cmd_file_label, cmd_document, cmd_drop_documents) New functions
11771         for new commands FILE LABEL, DOCUMENT, DROP DOCUMENTS.  Untested.
11772
11773         * var.h: (struct dictionary) New fields `label', `n_documents',
11774         `documents'.
11775
11776 Wed Jan  1 22:08:10 1997  Ben Pfaff  <blp@gnu.org>
11777
11778         * command.c: Added FILTER to list of commands.
11779
11780         * frequencies.g: [WEIGHTING] Removed test for weighting!=-1 since
11781         it's always true.
11782
11783         * get.c: (cmd_save_internal) Removed weighting code since it's now
11784         handled by sfm-write.c.  Properly commented out debug code.
11785
11786         * glob.c: (glob var weighting) Removed.
11787
11788         * sel-if.c: Comment fixes.
11789         (cmd_filter) New function.
11790
11791         * sfm-read.c: (struct sfm_fhuser_ext) New field `weight_index'.
11792         (sfm_read_dictionary) Sets weighting variable direct in the
11793         created dictionary now.  (Apparently we previously didn't support
11794         weighting on GET?)
11795         (read_header) Sets weight_index field in sfm_fhuser_ext from
11796         header read from disk.
11797
11798         * sfm-write.c: (sfm_write_dictionary) Comment fix.
11799         (write_header) Now sets the weighting in the header from the
11800         passed primary dictionary instead of from the sfm_write_info.
11801
11802         * sfm.h: (struct sfm_write_info) Removed field `weight'.
11803
11804         * som-high.c: (dump_crush_table) Fixed a couple of assertions that
11805         broke on boundary conditions.
11806
11807         * var.h: (struct dictionary) New fields `weight_var',
11808         `weight_index', and `filter_var'.
11809         (glob var weighting) Removed.  This is now part of struct
11810         dictionary.  All references changed; the less mechanical changes
11811         are described above.
11812
11813         * vars-atr.c: (find_dict_variable) New function.
11814
11815         * vfm.c: (static var filter_index) New variable.
11816         (open_active_file) Initializes filter_index from default_dict.
11817         (write_case) Calls proc_func() only if the filter variable is
11818         nonzero; this implements FILTER behavior.
11819
11820         * weight.c: (static var weight_varname) Removed.
11821         (cmd_weight) Modified default_dict instead of glob vars.
11822         (update_weighting) Changed the signature to modify a dictionary
11823         instead of glob vars.  Now returns the weighting variable.
11824         (get_weighting_variable) Removed; its function is absorbed by
11825         update_weighting().
11826         (stop_weighting) Operates on a dictionary now.
11827
11828 Wed Jan  1 17:00:59 1997  Ben Pfaff  <blp@gnu.org>
11829
11830         * sort.c: Removed debugging info from messages.
11831         (do_external_sort) Cleans up after itself by deleting the
11832         temporary directory on failure.  (On success it is deleted by the
11833         input program.)
11834         (allocate_cases) Removed debug code.  Added clean up code.
11835         (output_record) Removed debug code.
11836         (merge) Added code to close all the input files that are currently
11837         open.  This is a likely location for bugs, because I'm not sure
11838         about boundary conditions.  Removed an unnecesary heap_delete().
11839         (merge_once) Removed input file "optimization" that in fact
11840         screwed up the rest of the code.  Message and comment fixes.
11841
11842 Sun Dec 29 21:36:48 1996  Ben Pfaff  <blp@gnu.org>
11843
11844         * error.c: [__CHECKER__] (induce_segfault) Flushes output streams.
11845
11846         * heap.c: (heap_delete) New argument.
11847
11848         * sort.c: Finished implementation of external sort.
11849
11850         * vfm.c: (read_from_disk) Returns after a disk error.
11851
11852 Sun Dec 22 23:10:39 1996  Ben Pfaff  <blp@gnu.org>
11853
11854         * sort.c: (static var state) Removed.
11855         (static vars max_handles, tmp_basename, tmp_extname,
11856         huffman_queue) New variables.
11857         (do_external_sort) Moved most code to new functions.
11858         Creates huffman_queue.
11859         (allocate_file_handles, allocate_cases) New functions.
11860         (static vars run_no, run_length, file_index, case_count) New
11861         variables. 
11862         (output_record) Returns success.  Now really writes to the output
11863         file.
11864         (begin_run, end_run) New functions.
11865         (write_initial_runs) Returns success.  Initializes run_no to -1.
11866         Calls begin_run(), end_run() at appropriate times.  Outputs debug
11867         messages.
11868         (write_to_sort_cases) Calls begin_run(), end_run() at appropriate
11869         times.
11870         (merge) New function.
11871
11872         * heap.c, heap.h: New files.  Hopefully in near-final form.
11873
11874 Sat Dec 21 21:51:04 1996  Ben Pfaff  <blp@gnu.org>
11875
11876         * glob.c: Added write_active_file to global vars.
11877
11878         * sort.c: Several new miscellaneous static variables.
11879         (cmd_sort_cases) Big comment fix.
11880         (perform_case_2) Renamed `do_external_sort' and completely
11881         rewritten.
11882         (case_2_proc_func) Removed.
11883         (output_record, write_initial_runs, write_to_sort_cases,
11884         compare_record) New functions.
11885
11886         * vfm.c: [DEBUGGING] (index_to_varname) Excised bit rot.
11887
11888 Tue Dec 17 18:57:59 1996  Ben Pfaff  <blp@gnu.org>
11889
11890         * sort.c: (perform_case_2) Changed the method for allocation of
11891         lots of memory--now allocates one case at a time in hopes that
11892         more cases can be allocated with heavily fragmented memory.
11893
11894         * var.h: (write_active_file) New global var.
11895
11896         * vfm.c: (procedure, close_active_file, write_case,
11897         SPLIT_FILE_procfunc) Now allow beginfunc, procfunc, and endfunc
11898         arguments to procedure() to be NULL.  All references to
11899         procedure() that made use of dummy functions were changed to NULL
11900         functions.
11901         (open_active_file) If write_active_file is non-NULL, the output
11902         device becomes DEV_PGM (a new enum).
11903         (close_active_file) Sets write_active_file to NULL.
11904         (read_from_memory) Comment fix.
11905         (record_case) Calls write_active_file() when the output device is
11906         DEV_PGM.
11907
11908 Sun Dec 15 15:32:16 1996  Ben Pfaff  <blp@gnu.org>
11909
11910         * sort.c: New file.
11911
11912         * autorecode.c: (cmd_autorecode) Fixed parsing of options.
11913         Fixed checking for duplicate varnames.
11914         (recode) xmalloc()'s the transformation instead of arena_alloc()'ing
11915         it.
11916         (autorecode_trns_free) Destroys hash tables for each recoding
11917         specification.
11918         (autorecode_proc_func) Compares NULL to *vpp instead of vpp.
11919
11920         * command.c: Added SORT CASES to cmd_table.
11921         (null_func, null_int_func) Prototyped.
11922
11923         * descript.g: (calc_weight, calc_noweight) Computes own case
11924         number now.
11925         
11926         * frequencies.q: (dump_statistics) Fixed problem with
11927         too-few-cases warning message.
11928
11929         * get.c: (cmd_save_internal) Handles weighting properly.
11930
11931         * hash.c: (hsh_dump) Output format changed.
11932         (force_hsh_insert) Actually works now, prototype changed.
11933
11934         * list.q: (static var case_num) New variable.
11935         (cmd_list) Initializes case_num.
11936         (list_cases) Increments case_num.
11937
11938         * var.h: Added definitions for SORT CASES.  Comment fixes.
11939
11940         * vfm.c: Some definitions moved to new file vfmP.h.  Comment
11941         fixes.  `active' renamed vfm_active, `rep' renamed
11942         vfm_replacement, all references changed.
11943         (procedure) The procfunc no longer receives a case number.  All
11944         references changed.
11945         (write_case) Subtle reordering.
11946         (SPLIT_FILE_procfunc) Counts cases differently.  Slightly less
11947         redundant.
11948
11949         * weight.c: (get_weighting_variable) New function.
11950
11951         * vfmP.h: New file with definitions from vfm.c.
11952
11953 Sat Dec 14 10:35:30 1996  Ben Pfaff  <blp@gnu.org>
11954
11955         * command.c: (FILE_TYPE_okay) Commented out some tests because
11956         they're clumsy and not yet needed.
11957
11958         * var.h: Most *_trns structures moved to their respective source
11959         files.  Some were moved into a new file, do-ifP.h.  Comment fixes.
11960         (union any_trns) Changed to a typedef for trns_header.
11961         (struct input_program_pgm) Removed.
11962
11963         * vars-prs.c: (parse_variables) Only local_free()'s bits if it
11964         was allocated in the first place.
11965
11966 Fri Dec 13 21:30:53 1996  Ben Pfaff  <blp@gnu.org>
11967
11968         * autorecode.c: New file.
11969         
11970         * command.c: Added AUTORECODE to command table; re-enabled SET.
11971
11972         * data-out.c: (convert_F) Handles infinities and NaNs properly.
11973
11974         * error.c: (vmsg) Comment fixes.
11975
11976         * hash.c: Comment fix.
11977         (hashpjw_d) New function.
11978         (hashpjw) Reimplemented as call to more general function
11979         hashpjw_d().
11980         (internal_comparison_fn) Initializes pointers properly.
11981         (hsh_sort) [GLOBAL_DEBUGGING] New debugging code.
11982         (force_hsh_insert, force_hsh_find) New debugging wrapper
11983         functions.
11984
11985         * main.c: (main) Message fix.
11986
11987         * output.c: (outp_read_devices) Message fix.
11988
11989         * set.q: Comment fixes.
11990         (custom_results) Implemented Wnd/X form of subcommand.
11991         (set_routing) New function.
11992         (internal_cmd_set) Implemented ERRORS, MESSAGES.
11993
11994         * settings.h: (SET_ROUTE_*) New enum series.
11995         (set_results) Renamed set_results_file, all references changed.
11996         (set_messages) Removed.
11997         (glob vars set_errors, set_messages, set_results) New vars.
11998
11999         * title.c: (get_title) Remembers to xstrdup() the result of
12000         get_rest_of_line().
12001
12002         * var.h: (arc_item, arc_spec, autorecode_trns) New structures for
12003         use by AUTORECODE.
12004         (union any_trns) New element `arc'.
12005
12006 Fri Dec  6 23:53:47 1996  Ben Pfaff  <blp@gnu.org>
12007
12008         * command.c: (output_line) Removed references to set_screen.
12009
12010         * error.c: (static var terminating) New var.
12011         (hcf) Sets terminating to 1.
12012         (vmsg) If terminating is nonzero, does not attempt to call hcf().
12013         This prevents an infinite loop if an error occurs within hcf().
12014
12015         * expr-evl.c: (evaluate_expression) [__CHECKER__] Replaced case
12016         statement circumlocution with `case 42000' trick.
12017         (evaluate_expression) New support for OP_STR_MIS.
12018
12019         * expr-opt.c: (evaluate_expression) [__CHECKER__] Replaced case
12020         statement circumlocution with `case 42000' trick.
12021         (dump_node) Handles OP_STR_MIS.
12022
12023         * expr-prs.c: (MISSING_func, SYSMIS_func) Rewrote to handle string
12024         variables exceptions.
12025         (parse_function) Message fix.
12026         (ops[]) Added OP_STR_MIS.
12027
12028         * expr.h: Added OP_STR_MIS to OP_* enum.  Comment fixes.
12029
12030         * exprP.h: [__CHECKER__] Removed case statement circumlocution.
12031
12032         * glob.c: Removed set_scrnfile glob var.
12033         (init_glob) set_errorbreak set to 0 by default.
12034
12035         * groff-font.c: Changed included files.
12036         (groff_read_font) Initializes font_arena local var correctly.
12037         (default_font) New function.
12038
12039         * output.c: Comment fixes.
12040         (glob var disabled_devices) New variable.
12041         [GLOBAL_DEBUGGING] (static var iterating_driver_list) New
12042         variable.
12043         [GLOBAL_DEBUGGING] (reentrancy) New function.
12044         [GLOBAL_DEBUGGING] (outp_read_devices, outp_done, find_driver,
12045         outp_iterate_enabled_drivers) Calls to reentrancy().
12046         (destroy_list) New function.
12047         (outp_done) Moved code to destroy_list().
12048         (parse_options) Parses `listing', `screen', `printer' options
12049         internally.
12050         (configure_driver) Sets new `device' member of driver.
12051         (outp_iterate_enabled_drivers, outp_enable_device) New functions.
12052
12053         * output.h: Comment fixes.  New enum series OUTP_DEV_*.
12054         (struct outp_driver_struct) New member `device'.
12055
12056         * postscript.c: (find_encoding_file) Doesn't display its own error
12057         messages.
12058         (default_encoding) New function.
12059         (switch_font) Calls default_encoding() if no encoding can be
12060         found.
12061         (text) Makes up a character metric if none exists for the desired
12062         character.
12063         (load_font) Properly copies a fallback filename.  Calls
12064         default_font() for a font if none at all are known.
12065
12066         * set.q: Comment fixes.  Removed OUTPUT subcommand.
12067         (custom_listing) Calls outp_enable_device() to enable/disable
12068         listing device.
12069         (turn_screen_on) Removed.
12070         (internal_cmd_set) Calls outp_enable_device() to enable/disable
12071         screen, printer devices.
12072
12073         * settings.h: Comment fixes.
12074         (glob vars set_output, set_printer, set_screen, set_scrnfile)
12075         Removed.
12076
12077         * som-high.c: (som_submit_table, som_eject_page) Use
12078         outp_iterate_enabled_drivers() instead of iterating
12079         outp_driver_list directly.
12080
12081 Wed Dec  4 21:34:17 1996  Ben Pfaff  <blp@gnu.org>
12082
12083         * data-in.c: (parse_EDATE, parse_SDATE) New functions.
12084         (parse_string_as_format) Handles new formats.
12085         (parse_numeric) Now handles DOT and PCT formats.
12086
12087         * data-out.c: (convert_E, convert_F, insert_commas) Handle DOT
12088         format now.
12089         (convert_date) Handle EDATE and SDATE formats.
12090         (convert_CCx) Now if there's not room for the currency characters,
12091         converts it as F format if it's positive instead of giving up
12092         quickly.  Also fixed save-and-restore bug with decimal point
12093         characters.  
12094         (convert_format_to_string) Handles new formats.
12095
12096         * misc.c: (formats[]) Added new formats.
12097         (convert_fmt_ItoO) Supports new formats.
12098
12099         * sfm-read.c: (parse_format_spec) Supports new formats.  Better
12100         data checking.  New argument, all references changed.
12101
12102         * sfm-write.c: (write_format_spec) Supports new formats.
12103
12104         * var.h: New formats FMT_DOT, FMT_PCT, FMT_EDATE, FMT_SDATE.
12105         Comment fixes.
12106
12107 Sun Dec  1 17:19:00 1996  Ben Pfaff  <blp@gnu.org>
12108
12109         * cmdline.c: Comment fixes.
12110         (parse_command_line) Changed return type to void.
12111
12112         * data-in.c: (parse_string_as_format) Added FMT_CCA...FMT_CCE to
12113         switch.
12114         (parse_numeric) Handles international numbers (comma as decimal
12115         point).  Some reformatting.
12116
12117         * data-list.c: (parse_free) Default output format is now
12118         set_format instead of hard-coded F8.2.
12119         (read_from_data_list_list) Emits error message on undefined data
12120         only if set_undefined is nonzero.
12121
12122         * data-out.c: (convert_E) Changes decimal point from period to
12123         comma if appropriate.  Restructured.  Better comments.
12124         (convert_F) Changes decimal point from period to comma if
12125         appropriate.
12126         (insert_commas) Major bug with handling of negative values fixed.
12127         Also, inserts periods instead of commas if appropriate.
12128         (convert_CCx) New function.
12129         (convert_format_to_string) Added FMT_CCA...FMT_CCE to switch.
12130         (num_to_string) Changed `.' to set_decimal.
12131
12132         * dfm.c: Comment fixes.
12133         (dfm_close) Frees ext->line even in inline_file.
12134         (open_inline_file) New function.
12135         (open_file_r) When opening the inline file: now properly
12136         recognizes `BEGIN DATA.' line, and calls open_inline_file() to
12137         finish up.
12138         (read_record) Calls fh_close_handle() instead of dfm_close() to
12139         close the inline file.  Makes a copy of the line getl_buf to avoid
12140         interlock problems.
12141         (dfm_get_record) Restructured.  Now checks the return value of
12142         open_file_r().
12143         (cmd_begin_data) Moved open code into open_inline_file().  Relaxed
12144         checking for use of inline file.  No longer tries to close inline
12145         file.
12146
12147         * error.c: (glob var error_already_flagged) New var.
12148         (vmsg) Message change.  Now checks max number of errors/warnings,
12149         acts on it.
12150
12151         * file-handle.q: (fh_handle_name) Now allows closing of
12152         inline_file.
12153         (fh_init_files) Reformatted.
12154
12155         * get.c: (trim_dictionary) Checks SCOMP option instead of COMP.
12156
12157         * getline.c: (getl_include) Fixed bug that popped up when called
12158         when file queue was empty.
12159         (read_console) Resets error_count, warning_count,
12160         error_already_flagged to zero.
12161
12162         * glob.c: Many changes to update list of variables.
12163         (init_compat_dependent) Now this function is called whenever
12164         `compat' changes.  It now sets set_seed only if it hasn't
12165         previously been referenced.  It now calls
12166         lex_init_compat_dependent().
12167
12168         * include.c: (cmd_include_at) Frees temporary buffer instead of
12169         line buffer.  
12170         (cmd_include) Doesn't make copy of include file name.
12171
12172         * lexer.c: Comment fixes.
12173         (init_lex) Moved some code into new function
12174         lex_init_compat_dependent().
12175         (lex_init_compat_dependent) New function.
12176         (hex_val) Simplified.
12177         (preprocess_line) Uses set_endcmd instead of hardcoding `.'.
12178
12179         * main.c: Comment fixes.
12180         (main) Reformatted.
12181
12182         * misc.c: (formats[]) Added FMT_CCA...FMT_CCE.
12183         (check_input_specifier) Disallows FMT_CCA...FMT_CCE.
12184         (convert_fmt_ItoO) Detects FMT_CCA...FMT_CCE.
12185         (setup_randomize) Sets set_seed_used.
12186
12187         * set.q: Comment fixes.
12188         (custom_results) Conditionalizes on `compat'.
12189         (custom_log) Calls custom_journal().
12190         (set_ccx) New function.
12191         (cmd_set) Calls init_compat_dependent() when `compat' changes.
12192         Calls set_ccx() to handle CCA...CCE.  Sets set_grouping
12193         when set_decimal changes.  Range-checks values for MITERATE,
12194         MNEST.  Message fixes.
12195
12196         * settings.h: Comment fixes.
12197         (struct set_cust_currency) New struct.
12198         (set_cc[], set_grouping, set_seed_used) New global vars.
12199
12200         * var.h: (FMT_CCA...FMT_CCE) New output formats.
12201         (FCAT_OUTPUT_ONLY) New FCAT_* constant.
12202
12203 Thu Nov 28 23:14:07 1996  Ben Pfaff  <blp@gnu.org>
12204
12205         * glob.c: Revised variables to correspond to settings.h.
12206         (init_glob) Initializes variables from settings.h properly.
12207
12208         * set.q: Began long-overdue major revision to correspond to new
12209         philosophy.  Most code changed. 
12210
12211         * settings.h: Mostly changed; reorganized, reordered, large new
12212         comment.
12213
12214 Thu Nov 28 19:46:10 1996  Ben Pfaff  <blp@gnu.org>
12215
12216         * get.c: (cmd_save_internal) No longer forces compression off.
12217
12218         * sfm-read.c: (read_compressed_data) If eof is reached when
12219         reading a new instruction octet, only signal error if we're in the
12220         middle of a case.
12221
12222         * sfm-write.c: (COMPRESSION_BIAS) New #define.
12223         (struct sfm_fhuser_ext) New member `end'.
12224         (write_header) Refers to COMPRESSION_BIAS instead of magic 100.0.
12225         (ensure_buf_space) New function.
12226         (sfm_write_case) Reimplemented in order to support compression.
12227         (sfm_close) Writes out the remaining contents of the compression
12228         buffer if any.
12229
12230 Wed Nov 27 23:18:35 1996  Ben Pfaff  <blp@gnu.org>
12231
12232         * command.c: Defined SAVE and XSAVE commands in command table.
12233
12234         * common.h: second_lowest_value is of type flt64, not double.
12235
12236         * file-handle.h: Comment fix.
12237
12238         * get.c: Comment fixes.
12239         (static var `trns') New.
12240         (save_write_case_func, save_trns_proc, save_trns_free, null_func,
12241         cmd_save_internal, cmd_save, cmd_xsave) New functions.
12242         (dict_delete_run) Clears the variables and frees them now.
12243         (trim_dictionary) Sets default for compression.
12244         On KEEP subcommand, frees deleted variables as well as clearing
12245         them.  Finally got the sense of the test for deleting all
12246         variables correct.
12247         [DEBUGGING] (dump_dict_variables) Message fix.
12248
12249         * glob.c: (init_glob) set_compression set to 1 by default.
12250
12251         * list.q: Properly #includes config.h.
12252
12253         * misc.h: New macro REM_RND_UP.
12254
12255         * settings.h: Comment fix.
12256
12257         * sfm-read.c: (structs sysfile_header, sysfile_format,
12258         sysfile_variable; inline function bswap_int32) Moved to new file
12259         sfmP.h.
12260         (corrupt_msg) [__CHECKER__] No longer induces segfault.
12261         (sfm_read_dictionary) Fixed bug caused by failing to initialize
12262         var_by_index.
12263         (read_machine_flt64_info) Fixed some problems caused by confusion
12264         between flt64 and double types.
12265         (read_header) Message fix.
12266         (read_variables) Fixed set of cases in which we byte-swap sv.print
12267         and sv.write.  Fixed confusion of flt64 and double.
12268
12269         * sfm.h: (struct sfm_write_info) New.
12270
12271         * som-high.c: (som_draw_title) Properly frees `s'.
12272
12273         * temporary.c: (save_dictionary) Comment fix.
12274
12275         * var.h: Comment fixes.  New FMT_* enum, FMT_NUMBER_OF_FORMATS.
12276         (struct trns_header) Formatting fix.
12277         (struct save_trns) New.
12278
12279         * vars-atr.c: (discard_variables) Comment fix.
12280
12281         * sfm-write.c: New file, baseline release.
12282
12283         * sfmP.h: New file, baseline release.
12284
12285 Sun Nov 24 14:53:53 1996  Ben Pfaff  <blp@gnu.org>
12286
12287         * cmdline.c: (parse_command_line) `--version' output updated.
12288         (glob var syntax_message[]) Added my e-mail address.
12289
12290         * file-handle.q, lexer.c, vfm.c: Changed many instances of
12291         `illegal' to `invalid'.
12292
12293         * sfm-read.c: (struct sfm_fhuser_ext) New fields used as
12294         uncompression buffer.
12295         (sfm_close) Frees decompression buffer.
12296         (sfm_read_dictionary) Initializes decompression buffer.
12297         (buffer_input, read_compressed_data) New functions.
12298         (sfm_read_case) Restructured; now calls read_compressed_data() to
12299         handle compressed system file data.
12300
12301         * var.h: Comment fix.
12302
12303 Mon Nov 11 15:34:09 1996  Ben Pfaff  <blp@gnu.org>
12304
12305         * dfm.c: (dfm_close) Does not set h->{ext,class} because the
12306         caller handles it.
12307          
12308         * get.c: New comments.  New static var `get_file'.
12309         (cmd_get) Now fully implemented.  Calls discard_variables();
12310         initializes fv and lv for all variables; new debug code; sets
12311         up the dictionary; sets up the input program.
12312         (read_from_get, cancel_get) New functions.
12313
12314         * sfm-read.c: Comment fixes.
12315         (sfm_close) New static function.
12316         (sfm_read_dictionary) Properly sets up the class of the
12317         file_handle.  No longer cares what size the data is in records of
12318         type 7.  Also, on failure, properly cleans up the file_handle and
12319         free()s some stuff.
12320         (read_variables) No longer thinks it knows `nval' of the
12321         dictionary.  Now sets p.get.fv, etc., instead of speculatively
12322         setting fv itself.
12323         (read_value_labels) Fixed off-by-one error in indexing of
12324         var_by_index[].
12325         (sfm_read_case) New function.
12326         (sfm_r_class) New static var.
12327
12328         * var.h: (get_proc) New struct.
12329         (struct variable) New member p.get.
12330
12331 Thu Nov  7 20:52:28 1996  Ben Pfaff  <blp@gnu.org>
12332
12333         * get.c: Removed GTSV_OPT_MAP because of a misinterpretation of
12334         the manual's meaning.
12335         (rename_variables) New function.
12336         (trim_variables) Doesn't try to parse MAP any more.  Removed debug
12337         code.  Now properly reorders the dictionary on the KEEP keyword.
12338
12339         * sfm-read.c: (read_value_labels) Fixed some bugs regarding
12340         garbage collection.
12341
12342         * vars-atr.c: (clear_variable) New argument `dictionary *'.
12343         (rename_variable) New function.
12344         (free_val_lab) Reformatted.
12345
12346 Thu Nov  7 17:29:16 1996  Ben Pfaff  <blp@gnu.org>
12347
12348         * var.h: Reindented entire file.  Comment fixes.
12349         (glob vars var, var_by_name, nvar, N, nval, n_splits, splits)
12350         Removed.
12351         (glob var default_dict) New.
12352         (struct indirect_dictionary) Removed.
12353
12354         * Many other source files were changed to add `default_dict.'
12355         before all references to the dictionary of the active file.
12356         
12357         * vars-atr.c: (make_indirect_dictionary) Removed.
12358
12359         * glob.c: Reindented all variable declarations.  Updated for
12360         changed var.h.  Comment fixes.
12361
12362         * temporary.c: (restore_dictionary, save_dictionary) Simplified
12363         because now we can mainly copy dictionary structs.
12364
12365         * vars-prs.c: (is_dict_varname, parse_dict_variable,
12366         parse_variables) Takes dictionary instead of indirect_dictionary
12367         first argument.
12368         (parse_variables) Instead of calling make_indirect_dictionary,
12369         just sets DICT to &default_dict if DICT is NULL.  Of course, lots
12370         of `*dict.' references had to be changed to `dict->'.  Removed
12371         debug code.
12372
12373 Thu Nov  7 15:48:52 1996  Ben Pfaff  <blp@gnu.org>
12374
12375         * get.c: Added GTSV_OPT_* series of enums.
12376         (trim_dictionary, dict_delete_run) New functions.
12377         [DEBUGGING] (dump_dict_variables) New function.
12378         (cmd_get) Calls trim_dictionary() to get dictionary fully set-up.
12379         [DEBUGGING] Calls dump_dict_variables() to display results.
12380
12381         * glob.c: (cmp_variable) Now a public function declared in var.h.
12382
12383         * sfm-read.c: Turned off debug code.  Comment fixes.
12384         (read_machine_int32_info, read_machine_flt64_info) New functions
12385         to parse type 7 records.
12386         (sfm_read_dictionary) Properly byteswaps several fields now.
12387         Calls read_machine_*_info() to parse type 7 subtypes 3 and 4
12388         records.  [DEBUGGING] Dumps dictionary.
12389         (read_variables) Sets `index' field of variables created properly.
12390         Constructs avl tree of variables in dictionary.  [DEBUGGING] No
12391         longer dumps dictionary.
12392         (read_value_labels) Properly byteswaps fields.  [DEBUGGING] New
12393         debug code.
12394         [DEBUGGING] (dump_dictionary) No longer stubbed out.
12395
12396         * temporary.c: (restore_dictionary) Destroys `var_by_name' glob
12397         var before destroying any variables just to save a little time.
12398
12399         * var.h: (struct variable) Reordered in order to make name[] the
12400         first member; this makes pointers to `variable' pointers to the
12401         variable name, simplifying avl trees, etc.
12402         (struct indirect_dictionary) New struct.
12403
12404         * vars-atr.c: (find_variable) Rewritten for efficiency.
12405         (make_indirect_dictionary, is_dict_varname, parse_dict_variable)
12406         New functions.
12407         (is_varname) Rewritten for efficiency.
12408         (parse_variables) New argument, which is a `dictionary *'.  All
12409         references changed.  This function now reads variable names from
12410         the dictionary passed, or from the default dictionary if NULL.
12411
12412 Tue Nov  5 18:34:59 1996  Ben Pfaff  <blp@gnu.org>
12413
12414         * misc.h: Added new macro DIV_RND_UP to perform integer division,
12415         rounding up.  Changed many references to ROUND_UP to use this
12416         instead.
12417
12418         * sfm-read.c: Includes avl.h.
12419         (corrupt_msg) Induces a segfault under Checker.
12420         (macro assertive_bufread) New.  Many references to bufread() now
12421         use this instead.
12422         (sfm_read_dictionary) Split up into several functions.  Added code
12423         to read dictionary records following the the type 2 records.  Not
12424         quite complete.  New variable `var_by_index'.
12425         (read_header, read_variables) New functions extracted from
12426         sfm_read_dictionary().
12427         (read_value_labels) New function.
12428         (bufread) Checks ferror() if fread() doesn't return the expected
12429         value; if ferror() is zero it's just EOF.
12430         (dump_dictionary) Stubbed out.
12431
12432         * BTW: The source code now exceeds 50000 lines!
12433         
12434 Mon Nov  4 22:03:28 1996  Ben Pfaff  <blp@gnu.org>
12435
12436         * command.c: Added GET to cmd_table[].
12437
12438         * list.q: Removed reference to alloca headers.
12439         (cmd_list) Gave prototype.
12440
12441         * sfm-read.c: Added DEBUGGING comments.
12442         (sfm_read_dictionary) Checks bias correctly.  Sets
12443         dict->var_by_name to NULL.  Calculates long_string_count
12444         correctly.  realloc's dict->var[] array to minimum size.
12445         [DEBUGGING] Calls dump_dictionary.
12446         [DEBUGGING] (dump_dictionary) New function.
12447
12448         * temporary.c: (save_dictionary) Sets var_by_name to NULL.
12449         (restore_dictionary) If the dictionary contains a non-NULL
12450         var_by_name, uses that instead of generating one.
12451         (free_dictionary) Destroys var_by_name.
12452
12453         * var.h: (struct dictionary) Added field `var_by_name'.
12454
12455         * get.c: New file, not complete.
12456
12457 Sun Nov  3 12:24:36 1996  Ben Pfaff  <blp@gnu.org>
12458
12459         * mis-val.c: New enums MV_NOR_*.  New struct num_or_range.
12460         (parse_num_or_range) New function.
12461         (parse_numeric) Reimplemented in order to support LOW THRU <n> and
12462         <n> THRU HIGH missing values.
12463
12464         * output.h: [__GNUC__>1 && __OPTIMIZE__] (width, height) Made
12465         __attribute__((const)).
12466
12467         * q2c.c: (get_token) Merged isdigit || isalpha into isalnum.
12468
12469         * sfm-read.c: Finished reference implementation.
12470
12471         * sfm.h: Includes var.h.
12472
12473         * var.h: Comment fixes.
12474         (struct `variable') Reordered some fields.
12475
12476         * vars-atr.c: (is_num_user_missing) Added support for MISSING_*
12477         constants added previously.
12478
12479 Wed Oct 30 17:13:08 1996  Ben Pfaff  <blp@gnu.org>
12480
12481         * common.h: Comment fixes.  Added declaration of
12482         `second_lowest_value' as variable or macro.  Made `compat_type',
12483         `pgm_state_type' into anonymous enums.
12484
12485         * display.c: Comment fix.
12486
12487         * glob.c: [ENDIAN==UNKNOWN] Added definition for `endian' global
12488         var.
12489         [!defined SECOND_LOWEST_VALUE] Added definition for
12490         `second_lowest_value' global var.
12491         (compat, pgm_state global vars) Changed types to `int'.
12492         (init_glob) Initializes `second_lowest_value'.
12493
12494         * sfm-read.c: Continued work, not complete.
12495
12496         * var.h: Added new MISSING_* constants to handle LOWEST and
12497         HIGHEST.
12498
12499 Sat Oct 26 23:06:06 1996  Ben Pfaff  <blp@gnu.org>
12500
12501         * sfm-read.c: New file, not complete.
12502
12503         * cases.c: (vec_insert) Changed vector expansion algorithm.
12504         (vec_delete) Fixed bug that screwed up deletion sometimes, it was
12505         mucking up the RECODE transformation in particular.
12506         (envector) Harmless change in notation.
12507
12508         dfm is now fairly well tested again.  
12509         * dfm.c: (dfm_get_record) Only returns ext->ptr if ext is
12510         non-NULL--duh.
12511         (cmd_begin_data) if(ext->line) replaced by if(ext && ext->line).
12512
12513         * recode.c: Comment fix.
12514
12515         * sfm.h: Interface should be fairly final now, or at least for a
12516         day or so...
12517
12518         * vfm.c: [DEBUGGING] (index_to_varname) New function.
12519         (open_active_file) [DEBUGGING] Translates ccase indices into
12520         variable names now to make it easier to understand what's really
12521         going on.
12522
12523 Sat Oct 26 20:46:31 1996  Ben Pfaff  <blp@gnu.org>
12524
12525         * data-in.c: Comment fix.
12526
12527         * data-list.c: Includes dfm.h.
12528         (do_reading) Uses new function dfm_push_cust().
12529
12530         * data-out.c: (convert_time, convert_WKDAY, convert_MONTH) Added
12531         `return 1;' at end.
12532
12533         * file-handle.h: Completely changed.  Some parts split off into
12534         new file dfm.h.  Implemented in file-handle.q.
12535         (enum FH_*) Removed.
12536         (struct fh_ext_class) New struct.
12537         (struct file_handle) Retained only these fields: name, norm_fn,
12538         fn, recform, lrecl, mode.  New fields class, ext.
12539         (get_handle_by_name, get_handle_by_filename, parse_file_handle,
12540         close_handle, handle_name) Added `fh_' prefix to name, all
12541         references changed.
12542
12543         * dfm.h: New file, implemented in dfm.c.
12544         (get_record, put_record, fwd_record, bkwd_record, set_record,
12545         get_cur_col) Functions moved from file-handle.h, now prefixed with
12546         `dfm_'.
12547         (dfm_push_cust) New function.
12548
12549         * sfm.h: New file.  Incomplete.
12550
12551         * dfm.c: All functions adjusted/rewritten for new dfm/fhp
12552         interface.  Functions reordered, comments changed.  Not well
12553         tested, probably full of bugs.
12554         (struct dfm_fhuser_ext) New struct.
12555         (dfm_close) New function.
12556         (open_file_r) Pickier about finding `BEGIN DATA.' line.
12557         (open_file_w) User messages changed.
12558         (get_record) Comment fixed.
12559         (read_record) Increments ext->ln even for inline_file.  Calls
12560         dfm_close() for inline_file when `END DATA.' encountered.
12561         (dfm_get_record) Experimental restructuring.
12562         (dfm_push_cust) New function.
12563         (cmd_begin_data) Detects whether the inline file was fully read by
12564         checking whether it is still open; detects whether it was read at
12565         all by checking whether the line number is greater than zero.
12566
12567         * file-handle.q: All functions adjust/rewritten for new dfm/fhp
12568         interface.  Functions reordered, comments changed.  Not well
12569         tested, probably full of bugs.
12570         (init_file_handle) Removed initializers for obsolete fields, added
12571         new fields.
12572         (fh_close_handle) Much simpler, now mainly calls the class
12573         function.
12574         (fh_init_files) Renamed inline file internal filename.
12575
12576         * file-type.c: Includes dfm.h.
12577         (read_from_file_type) Doesn't use dfm internal state anymore.
12578
12579         * inpt-pgm.c, print.c: Include dfm.h.
12580
12581         * recode.c: (internal_cmd_recode) Casts strlen() return value to
12582         int in comparison with other int.
12583
12584         * som-high.c: (build_target) Fixed operator precedence problem in
12585         if statement (& versus ==).
12586
12587 Sat Oct 26 10:39:25 1996  Ben Pfaff  <blp@gnu.org>
12588
12589         * dfm.c: (read_record) Can now read fixed-length records; not
12590         tested.
12591         (put_record) Can now write fixed-length records; not tested.
12592
12593         * file-handle.h: FH_* defines changed to enums.  New enum series
12594         FH_RF_*, FH_MD_*.
12595         (struct file_handle) New members recform, lrecl, mode.
12596
12597         * file-handle.q: Parser changed.
12598         (internal_cmd_file_handle) Added support for new /RECFORM, /MODE,
12599         /LRECL subcommands.  These are compatible with Windows.
12600         (init_file_handle) Initializes recform, mode fields.
12601
12602         * q2c.c: (get_line) When outputting `!' comment lines, now
12603         increments the output file line number so that `#line' directives
12604         are correct.
12605         (make_identifier) New function that converts an arbitrary string
12606         into a valid C identifier.
12607         (dump_vars) Calls make_identifier() in two places in order to
12608         suppress some errors for bad identifiers.
12609         (make_match) Allows TRUE as synonym for YES and FALSE as synonym
12610         for NO.  Allows numbers to be prefixed by underscores to make them
12611         acceptable C identifiers but still to be parsed as numbers by the
12612         Fiasco lexer.
12613
12614 Thu Oct 24 20:13:42 1996  Ben Pfaff  <blp@gnu.org>
12615
12616         * command.c: Re-enabled RECODE, SAMPLE, SELECT IF.
12617         
12618         * dfm.c: Comment fixes. (get_record) Gives error if file handle
12619         was opened for writing.
12620         (open_file_w) New function.
12621         (read_record) Uses strncasecmp if available.  Improved error
12622         messages, comments.
12623         (put_record) New function.
12624
12625         * file-handle.h: Moved function comments into dfm.c and
12626         file-handle.q.  Comment fixes.  Removed declarations of
12627         tilde_expand() and normalize_filename().
12628         (struct file_handle) Changed `open' from boolean to enumerated
12629         field to allow for three states--closed, open for reading, open
12630         for writing--all references changed.
12631
12632         * file-handle.q: Includes filename.h.
12633
12634         * print.c: (CMD_* enums) Renamed PRT_* and moved into var.h; all
12635         references changed.
12636         (alloc_line) Makes allowance for line terminator characters in
12637         calculations.
12638         (print_trns_proc) Now handles OUTFILE, WRITE differences.
12639         (print_space_trns_proc) Handles OUTFILE differences.
12640
12641         * recode.c, sample.c: Comment fixes.
12642
12643         * var.h: (struct print_trns) Changed boolean field `eject' to
12644         bitmapped field `options'; all references changed.  New enums
12645         PRT_* for use with this field.
12646
12647         * exception.h, test-exception.c: Removed.
12648
12649 Thu Oct 24 17:47:14 1996  Ben Pfaff  <blp@gnu.org>
12650
12651         * ascii.c: (delineate) Turned off debug output.
12652
12653         * common.c: [Checker and Linux] (__assert_fail, __eprintf) Moved
12654         to error.c.
12655
12656         * data-in.c: (parse_string_as_format) Sets the entire string value
12657         to spaces, not just the short string part of it.  Is this correct
12658         now? 
12659
12660         * data-out.c: (convert_date) Fixed DATETIME format problems with
12661         decimal places, removed debug code.
12662
12663         * dfm.c: (open_file_r) Fixed bug where an error would occur in the
12664         middle of parsing BEGIN DATA that would cause the lexer to read
12665         from a wild pointer `prog'; now calls new function
12666         preprocess_line() in lexer.c.
12667
12668         * error.c: [__CHECKER__] (hcf) Calls induce_segfault() on improper
12669         termination.
12670         [Checker and Linux] (__assert_fail, _eprintf) Moved from common.c.
12671         Now call induce_segfault() to induce the segfault.
12672         (induce_segfault) New function.
12673
12674         * expr-opt.c: Comment fix.
12675         (parse_sysvar) New function.
12676         (parse_primary) Added system variable support--calls
12677         parse_sysvar().
12678         (global var ops) Added OP_CASENUM operator.
12679
12680         * expr.h: Comment fixes.
12681         (OP_* enum) added OP_CASENUM operator.
12682         (struct casenum_node) New struct.
12683         (union any_union_union) New member `cas' of type `casenum_node'.
12684
12685         * glob.c: (global var last_vfm_invocation) New var.
12686         (init_glob) Initializes last_vfm_invocation.
12687
12688         * lexer.c: (lookahead) Fixed reversed condition on if statement.
12689
12690         * getline.c: (get_line) Split into get_line() and preprocess_line().
12691         (preprocess_line) New function.
12692
12693         * var.h: Declares last_vfm_invocation.
12694
12695         * vfm.c: (procedure) Sets last_vfm_invocation.
12696
12697 Wed Oct 23 21:53:43 1996  Ben Pfaff  <blp@gnu.org>
12698
12699         * command.c: (parse_cmd) Fixed bad assertion related to
12700         lookahead().
12701
12702         * data-in.c: (parse_month) Implemented to parse months according
12703         to full interpretation of standard.
12704         (to_roman) New function.
12705         (parse_wk_delimiter) Bug fix (forgot to skip `WK' in string).
12706         (parse_weekday) Bug fix (forgot to skip all the day name).
12707
12708         * data-list.c: (read_from_data_list_fixed) Fixed bug that screwed
12709         up parsing of multirecord data items.  Also fixed user message.
12710
12711         * data-out.c: Comment fix.
12712         (year2, year4, convert_date, convert_time, convert_WKDAY,
12713         convert_MONTH) New functions to support time & date output.
12714         (convert_format_to_string) Calls new time & date output routines.
12715
12716         * expr-prs.c: (nary_num_func) Found a bug, but didn't fix it yet.
12717
12718         * lexer.c: (lookahead) Noted a previously unnoticed caveat in
12719         comment.
12720
12721         * main.c: [DEBUGGING] (dump_token) Updated to handle getline.h.
12722
12723         * misc.c: (global var formats) Fixed declarations of DATETIME,
12724         TIME, DTIME.
12725
12726         * postscript.c: (text) Fixed a pair of bugs in the reallocation of
12727         the output_char buffer.
12728
12729         * vars-prs.c: (parse_DATA_LIST_vars) Fixed a failure to free
12730         memory bug.  Fixed user messages.
12731
12732 Tue Oct 22 17:27:04 1996  Ben Pfaff  <blp@gnu.org>
12733
12734         * Removed #pragma argsused from lots of places.
12735         
12736         * data-in.c: Implemented zoned decimal and time-date formats.
12737         Untested.  This is a huge chunk of code--maybe 1000 lines and 50
12738         new functions.
12739
12740         * data-out.c: Implemented zoned decimal format.
12741
12742         * expr.h: Moved yrmoda() declaration here from exprP.h.
12743
12744         * misc.c: (global var formats) Minor fixes--added
12745         FCAT_SHIFT_DECIMAL to formats N and Z.
12746         (convert_fmt_ItoO) Added support for format Z.
12747
12748         * som-frnt.c: (som_set_value) Fixed bug regarding string values.
12749
12750 Mon Oct 21 20:39:59 1996  Ben Pfaff  <blp@gnu.org>
12751
12752         * command.c: (parse_cmd) [GLOBAL_DEBUGGING] Inserted call to
12753         som_check_workspace() that is activated between commands.
12754
12755         * data-list.c: (dump_fixed_table, dump_free_table) Finished these
12756         for good, I hope.
12757
12758         * list.q: (begin_row) Changed title expansion style from
12759         SOPT_X_VERT to SOPT_X_SHSP.
12760
12761         * som-frnt.c: Now includes `somP.h'.
12762         (som_push_workspace, som_pop_workspace) New functions that, taken
12763         together, form a solution to the recursive table building problem
12764         mentioned yesterday.  Surrounded every table output routine
12765         throughout the program with calls to these functions.
12766         [GLOBAL_DEBUGGING] (som_check_workspace) New function.
12767         (som_create_table) Checks that there's an active workspace.
12768         (som_destroy_all_tables, som_crush) Removed.
12769
12770         * som-high.c: (global var som_preserve_tables) Removed, all
12771         references deleted.
12772         (som_submit_table) Checks that there's an active workspace.
12773         (dump_columnated_table) Doesn't columnate tables that would have
12774         just one row per column.
12775         (dump_crush_page, som_dump_crush_page) Removed debugging code.
12776         (som_dump_crush_page) Moved row number labels from left side of
12777         tables to right side.
12778         (som_get_table_size) Added support for SOPT_X_SHSP.
12779
12780         * som.h: New cell expansion type SOPT_X_SHSP.
12781
12782         * somP.h: (global vars arena_stack, n_arena_stack, m_arena_stack)
12783         New vars.
12784         (global var curtab_arena) Moved from som-frnt.c.
12785
12786 Sun Oct 20 13:45:28 1996  Ben Pfaff  <blp@gnu.org>
12787
12788         * ascii.c: [GLOBAL_DEBUGGING] (SUPPRESS_WARNINGS) New debug option
12789         that causes bad location warnings to be suppressed.
12790         (delineate) Saves current font when calling draw_text(); fixed
12791         handling of NULLs when backing up.  Also fixed line-wrapping bug.
12792
12793         * command.c: Re-enabled `LEAVE', `NUMERIC', `PRINT', `PRINT EJECT',
12794         `PRINT FORMATS', `PRINT SPACE', `STRING', `TITLE', `WRITE'.
12795
12796         * common.c: Added code to cause assertion failure to dump core
12797         when run under Checker.
12798
12799         * data-list.c: (dump_fixed_table) Fixed some inconsistencies, but
12800         there are still bugs.
12801
12802         * glob.c: (__eprintf) Removed.
12803
12804         * list.q: Inserted som_preserve_tables kluge that prevents tables
12805         from being thrown away due to recursive table building through
12806         som_output_line being called from a transformation during the LIST
12807         procedure invocation.  This is a general problem that must be
12808         solved in a better way since it applies to all procedures in
12809         general.
12810         (begin_row) Changed title options to SOM_X_VERT from SOM_X_BOTH.
12811         (flush_table) Removed SOM_TOPT_PRESERVE from submission options.
12812
12813         * numeric.c: Fixed several errors in the form of msg() calls.
12814
12815         * print.c: Updated for use of som.
12816         (dump_table) Reimplemented.
12817         (print_trns_proc) Calls som_eject_page() instead of eject_page().
12818         Calls som_output_text() instead of outs_line().
12819
12820         * som-frnt.c: (som_destroy_all_tables) Sets som_preserve_tables to
12821         0.
12822         (som_output_text) Function moved from som-low.c.  Interface
12823         changed.
12824
12825         * som-high.c: (som_preserve_tables) New global public variable
12826         declared in som.h.
12827         (som_submit_table) Destroys the tables only if som_preserve_tables
12828         is 0.
12829         (paginate_horizontally) Bugfix: sets som.mpw even if there's only
12830         one subrow per row.  Now labels subrows if there's more than one
12831         subrow per row.
12832         (dump_crush_table) Added wishlist comment.
12833         (som_eject_page) New public function declared in som.h.
12834
12835         * som-low.c: (som_dump_crush_page) Draws row labels if there's
12836         more than one subrow per row.
12837         (som_output_text) Moved to som-frnt.c.
12838
12839         * som.h: (SOM_TOPT_PRESERVE) Removed.
12840
12841         * title.c: (get_title) Changed interface.
12842         (cmd_title) Changed `title' to `outp_title'.
12843         (cmd_subtitle) Changed `subtitle' to `outp_subtitle'.
12844
12845 Sun Oct 20 09:04:15 1996  Ben Pfaff  <blp@gnu.org>
12846
12847         * list.q: (flush_table) Conforms to new partial options in
12848         som_submission_form.
12849
12850         * som-high.c: (paginate_horizontally) Changed form of subrow
12851         number labels.
12852         (build_target) Omits spacing before table if
12853         SOM_TOPT_PARTIAL_OMIT_TOP is selected.
12854         (dump_crush_page) Changed interface.  Only trims bottom rule if
12855         SOM_TOPT_PARTIAL_OMIT_BTM is not selected.
12856         (dump_crush_table) Handles partial tables.
12857         (output_row_label) New function.
12858         (som_dump_crush_page) Emits subrow number labels.  Draws vertical
12859         rule on the right edge of narrow subrows.
12860
12861         * som.h: Changed SOM_SUB_PARTIAL_* series of submission type
12862         constants to a series of SOM_TOPT_PARTIAL_* submission options.
12863         All references updated.
12864
12865 Fri Oct 18 19:46:49 1996  Ben Pfaff  <blp@gnu.org>
12866
12867         * misc.c: Comment fix.
12868
12869         * som-high.c: (examine_table) Treats crushed tables separates for
12870         purpose of determining header size.
12871         (paginate_horizontally) Allots space for line numbers in crushed
12872         tables with lots of subrows per row.  Calculates the `maximum page
12873         width', the width of the widest horizontal page.
12874         (build_target) Removed trim argument; all references changed.
12875         Stricter assertions.  (dump_crush_page) New function.
12876         (dump_crush_table) Reimplemented.
12877
12878         * som-low.c: (som_dump_page) Uses new RULE_ROW &c. constants.
12879         (som_dump_crush_page) Reimplemented, interface changed.
12880
12881         * somP.h: Many many new helper macros for use with crushed tables.
12882         (global var som) Removed `tv', `cum_y' members; all references
12883         removed.  New members `mpw', `digit_space'.
12884
12885 Sun Sep 29 19:37:03 1996  Ben Pfaff  <blp@gnu.org>
12886
12887         * arena.c: (arena_alloc) [!DISCRETE_BLOCKS] Removed `size'
12888         variable, changed to constant 1024.
12889         (arena_ca_strdup) Changed `sizeof(a_string)' to
12890         `sizeof(c_string)'.
12891         (arena_ca_strdup) [!DISCRETE_BLOCKS] Changed bad cast from
12892         `(c_string *)' to `(char *)'; this fixed some offset problems.
12893
12894         * filename.c: (readlink_malloc) Changed initial allocation from
12895         100 bytes to 128.
12896         (good_getcwd) Changed from xmalloc() to local_alloc(); removed
12897         comment.
12898
12899         * postscript.c: (read_fontmap) Fixed leak by changing &owner to
12900         &fm->owner in several places.
12901
12902         * som-high.c: (output_table) Changed interface to rest of world.
12903         (examine_crush_table) Removed.  Crushed tables are re-broken now,
12904         in preparation for rewrite.
12905
12906         * som.h: Comment fix.
12907
12908 Sat Sep 28 21:28:07 1996  Ben Pfaff  <blp@gnu.org>
12909
12910         * ascii.c: (ascii_init_driver) Disposes of x->file.filename and x
12911         itself in the cleanup stage.
12912
12913         * descript.q: (display) At least temporarily, changed the table
12914         format to a crushed table.
12915
12916         * list.q: (begin_row) At least temporarily, added horizontal lines
12917         between cases.
12918
12919         * som-high.c: (examine_crush_table) Sets som.hh to the width of
12920         the horizontal "headers," that is, to the width of the far left
12921         and far right rules.
12922         (justify_pagination) Sets som.th to the width of the widest row
12923         in the crushed table.  Fixed inner loop off-by-one error.
12924
12925         * som-low.c: (som_dump_crush_page) Added code to draw horizontal
12926         rules.
12927
12928         * somP.h: Comment fix.
12929
12930 Fri Sep 27 20:08:39 1996  Ben Pfaff  <blp@gnu.org>
12931
12932         * filename.c: (open_file_ext) Now, doesn't set f->file to NULL
12933         before closing it; also, opens the constructed filename `s'
12934         instead of f->filename.
12935
12936         * postscript.c: Moved initialization of x->loaded, x->prop,
12937         x->fixed, x->current, also the add_encoding() calls, into
12938         postopen().
12939         (preclose) Destroys x->combos; sets x->loaded, x->combos to NULL;
12940         sets x->last_font to NULL; sets x->next_combo to zero.
12941
12942         * som-high.c: (crushed_row_height) Moved definition farther up.
12943         (som_submit_table) Doesn't calculate line width, font size until
12944         after calling open_page(), to accomodate changes to PostScript
12945         driver.
12946         (vert_headers) Removed; equivalent functionality moved to
12947         examine_table(), examine_crush_table().
12948         (justify_pagination) Replaced with different algorithm.
12949         (dump_crush_table) Bugfix that caused tables to fail to be clipped
12950         at the bottom of the page.
12951
12952 Thu Sep 26 22:20:26 1996  Ben Pfaff  <blp@gnu.org>
12953
12954         * command.c: Added cmd_list back into cmd_table.
12955
12956         * freq.c, frequencies.q, repeat.c, list.q, vars-atr.c, vfm.c:
12957         Comment fix: `#define DEBUGGING' --> `#define DEBUGGING 1'.
12958
12959         * list.q: (flush_table) Updated to new som_submission_form format.
12960
12961         * som-frnt.c: Comment fix.
12962
12963         * som-high.c: Changed `#endif' to `#undef EXTERN'.
12964         (output_table) Calls som_get_table_size() directly; handles
12965         crushed tables.
12966         (examine_crush_table) New function; calls vert_headers().
12967         (examine_table) Moved some code into new function, vert_headers().
12968         (justify_pagination) New function.
12969         (dump_plain_table) Removed `static' from `cy'.
12970         (dump_crush_table) New function.
12971
12972         * som-low.c: (som_dump_crush_page) New function.
12973
12974         * som.h: Comment fixes.
12975         (enum SOM_TOPT_CRUSH) New.
12976         (SOM_SUB_PARTIAL_BEG, SOM_SUB_PARTIAL_MID, SOM_SUB_PARTIAL_END)
12977         Temporarily set to zero to make do with LIST procedure.
12978
12979         * somP.h: Re-ordering.
12980
12981 Wed Sep 25 19:36:11 1996  Ben Pfaff  <blp@gnu.org>
12982
12983         * som.c: Split into som-frnt.c, som-high.c, som-low.c.
12984
12985         * somP.h: New file for use by som-high.c, som-low.c.
12986
12987         * q2c.c: Added definition for VME.
12988         (get_line) Now dumps `!' comment lines to the output file
12989         verbatim.
12990
12991         * crosstabs.q, descript.q, file-handle.q, frequencies.q, list.q,
12992         set.q: Changed format of `!' comment lines.
12993
12994 Tue Sep 24 18:39:09 1996  Ben Pfaff  <blp@gnu.org>
12995
12996         * All source files: Added copyright notice.
12997
12998         * common.c: (xmalloc, xrealloc, xstrdup) Cast size_t's to unsigned
12999         longs in msg() calls.
13000
13001         * con32s.c: (xmalloc, xrealloc) Updated from common.c.
13002
13003         * q2c.c: (xmalloc, xrealloc, xstrdup) Updated from common.c.
13004
13005 Sat Sep 21 23:16:31 1996  Ben Pfaff  <blp@gnu.org>
13006
13007         * output.c: (outp_read_devices) Changed criteria for
13008         distinguishing different types of lines.
13009
13010 Fri Sep 20 22:52:28 1996  Ben Pfaff  <blp@gnu.org>
13011
13012         * cmdline.c: Changed syntax message.
13013
13014         * filename.c: (good_getcwd) Bug fix (?).
13015         (normalize_filename) [__BORLANDC__] Uses _fullpath() library
13016         function.
13017         (search_path) Appends DIR_SEPARATOR to directory name only if it
13018         does not already end with one.
13019
13020         * glob.c: Checks STAT_PAGER envvar before PAGER.
13021
13022         * output.c: Checks environment variables instead of just local
13023         macros.
13024
13025 Tue Sep 10 21:39:00 1996  Ben Pfaff  <blp@gnu.org>
13026
13027         * arena.c: (arena_destroy) Swatted a subtle bug that cropped up
13028         when the pointer passed to the function was within the arena
13029         itself, so that it couldn't properly be set to NULL _after the
13030         arena was freed_.
13031
13032         * command.c: Re-enabled DISPLAY.
13033
13034         * display.c: Rewritten to handle tables.  Untested.
13035
13036         * filename.c: (search_path) Fixed memory leak.
13037
13038         * frequencies.q: (cmd_frequencies) Frees v_variables.
13039         (postcalc) Calls cleanup_freq_tab() after displaying statistics.
13040         (cleanup_freq_tab) New function to garbage collect.
13041         (dump_full) Elegantized.
13042
13043         * main.c: New comment.
13044
13045         * output.h: New tag for tagged quotes: TAG_NEWLINE.
13046
13047         * postscript.c: Comment fix.
13048         (release_fontmap, free_font_entry) New functions.
13049         (ps_init_driver) Sets free_font_entry() as the freefunc for
13050         hashtable `loaded'.  Calls release_fontmap() when destroying a
13051         driver; also frees the output filename; also frees the
13052         ps_driver_ext block.
13053         (free_ps_encoding) Frees the filename as well as the encoding
13054         block.
13055         (output_encodings) Frees the line buffer and pops the msg-filename
13056         stack.
13057         (read_fontmap) Frees the fontmap filename and the line buffer.
13058         (postopen, preclose) Misc. garbage collection fixes.
13059         (ps_open_page) Destroys the `combos' hash table; sets `last_font'
13060         to NULL; this fixes some output problems.
13061         (text) Handles TAG_NEWLINE.  Untested.
13062
13063         * som.c: (cell_byte_size) Merged SCON_VALUE and SCON_TEXT cases.
13064         (som_set_string) Removed.  All references changed to
13065         `som_set_text'.
13066         (som_set_text) Rewritten.  New interface.  More general.
13067
13068         * som.h: Minor format changes.
13069         (struct som_value_cell) Removed; all references changed to
13070         `som_text_cell'.
13071         (enums SOT_*) Changed.
13072
13073 Mon Sep  9 21:43:13 1996  Ben Pfaff  <blp@gnu.org>
13074
13075         * command.c: Re-enabled SPLIT FILE.
13076
13077         * postscript.c: Comment fix.
13078
13079         * som.h: Added `SOT_NONE'.
13080
13081         * split-file.h: (cmd_split_file) Removed superfluous parenthesis.
13082
13083         * vfm.c: (dump_splits) Reimplemented.
13084
13085 Sat Sep  7 22:35:12 1996  Ben Pfaff  <blp@gnu.org>
13086
13087         * Compiled the project under gcc 2.7.2, which gave some new
13088         warnings.  This led to many additions of casts from unsigned to
13089         int sprinkled throughout the code.
13090         
13091         * arena.c: Many uses of `unsigned' changed to `size_t'.
13092
13093         * command.c: Added END FILE, END REPEAT to command table.
13094         (var cmd_end_repeat) Renamed cmd_end_repeat_p.
13095         (find_command, FILE_TYPE_okay) Not commented out anymore.
13096         (parse_cmd) Calls FILE_TYPE_okay again.
13097         (output_line) Added calls to som_output_text() to put the line
13098         in the output files.
13099
13100         * common.c: (macro VME) Format changes.
13101         (xstrdup) Asserts that its argument is not NULL.
13102         
13103         * data-list.c: Implemented dump_fixed_table().
13104         
13105         * inpt-pgm.c: Formatting changes.  Comment changes.
13106         (end_case_proc) Renamed end_case_trns_proc.
13107         (cmd_end_file, end_file_trns_proc) New functions.
13108
13109         * misc.c: Many uses of `int' and `unsigned' changed to `size_t'.
13110
13111         * misc.h: (local_strdup) New macro corresponding to strdup() but
13112         allocating its data through local_alloc() if possible--that is, if
13113         GNU C is in use.
13114
13115         * postscript.c: Comment changes.
13116         (quote_ps_name, quote_ps_string, output_encodings) New functions.
13117         (output_line, add_string) New macros supporting
13118         output_encodings().
13119         (postopen) Fixed contents of ${fixed-font} and ${prop-font}
13120         substitution vars.  Calls output_encodings() when a line
13121         consisting of `!encodings' is encountered.
13122         (preclose) Some code moved into quote_ps_string().
13123         (dump_line) Changed into macro supporting dump_fancy_line().
13124         (switch_font) Now outputs DSC "%%IncludeResource: font (...)"
13125         command when appropriate.
13126         (write_text) Fixed `literal_char' array (I think it's fixed, at
13127         least.)
13128         (text) Fixed bug when width was zero.  Now exits immediately on
13129         zero height_left.  Now, when executing `goto restart;', checks
13130         that cp<end, so that we don't read beyond end-of-string.  Also,
13131         outputs the correct code to the output file by outputting the code
13132         from the metric instead of the internal metric index.
13133
13134         * repeat.c: (cmd_end_repeat) New function.
13135
13136         * som.c: (var som) `headers' renamed `options' and semantics
13137         changed.  All references changed.
13138         (draw_title) `if(px!=-1 || px!=-1)' --> `if(px!=-1 || py!=-1)'.
13139         (build_target) Only inserts spacing if SOM_TOPT_SPACING not
13140         selected.
13141         (som_text_table) Removed.
13142         (som_output_text) New function.
13143
13144         * som.h: (struct som_submission_form) Removed `header', `reuse',
13145         replaced with bitmapped field `options'.
13146         (SOM_TOPT_*) New enum set for som_submission_form.options.
13147         (SOT_*) New enum set for som_output_text().
13148
13149         * temporary.c: (copy_variable) When copying the var label, only
13150         calls xstrdup() if it's non-NULL.
13151
13152         * var.h: (enum type `vartype') Removed; all references changed to
13153         `int'.
13154
13155         * vars-atr.c: (init_variable) Changed local var `nbytes' from
13156         `int' to `size_t'.
13157
13158 Thu Sep  5 22:05:56 1996  Ben Pfaff  <blp@gnu.org>
13159
13160         * font.h: Comment changes.
13161
13162         * groff-font.c: (groff_read_font) Initializes `name' field to
13163         NULL.  Handles `encoding' field.
13164
13165         * hash.c: (hsh_dump) [GLOBAL_DEBUGGING] Output formatting changes.
13166
13167         * postscript.c: (struct font_entry) Removed `position' field.
13168         (struct ps_font_combo) New struct.
13169         (struct ps_driver_ext) Removed field `next_position'.  New fields
13170         `combos', `next_combo'.  `last_font' field changed from
13171         `font_entry *' to `ps_font_combo *'.
13172         (ps_init_driver) Reformatted; handles new fields.  When
13173         OPO_AUTO_ENCODE is set, adds the two default fonts' encodings to
13174         the encoding list.
13175         (get_encoding, find_encoding_file) New functions.
13176         (add_encoding) Some code moved out into find_encoding_file().
13177         (postopen) Changed value for ${title}.
13178         (preclose) Sets `loaded' field to NULL after destroying the hash
13179         table.
13180         (ps_open_page) Added comment.  Inits the `combos' and `next_combo'
13181         fields.
13182         (ps_text_set_font_by_position) Figures out the current family if
13183         not known.
13184         (compare_ps_combo, hash_ps_combo, free_ps_combo) New functions.
13185         (switch_font) Implemented.
13186         (write_text) Calls switch_font() more often.  Format changes.
13187         #undefs its macros after they're no longer useful.
13188         (text) Changed `continue' at one point to a jump to the top of the
13189         loop because we don't want `separate' reset to 0 at that point.
13190         (load_font) No longer sets `position' in the font_entry created.
13191
13192 Wed Sep  4 21:45:35 1996  Ben Pfaff  <blp@gnu.org>
13193
13194         * font.h: (struct font_desc) New member `encoding', which is not
13195         properly handled yet.
13196
13197         * glob.c: (init_glob) Some new i18n code, which is probably
13198         screwed up.
13199
13200         * output.c: (outp_read_devices, outp_get_paper_size) Changed
13201         `size' local from `int' to `size_t'.
13202
13203         * postscript.c: New driver configuration parameter `auto-encode'.
13204         New enums OPO_AUTO_ENCODE, ODA_COUNT.
13205         (struct font_entry) New member `position'.
13206         (struct ps_driver_ext) Reordered.  New hash table member
13207         `encodings'; new members `next_position', `next_encoding',
13208         `last_font'.  Members `current', `prop', `fixed' changed from type
13209         `font_desc *' to `font_entry *'; all references changed.
13210         (struct ps_encoding) New struct.
13211         (read_ps_encodings, compare_ps_encoding, hash_ps_encoding,
13212         free_ps_encoding, add_encoding) New functions.
13213         (ps_init_driver) Added OPO_AUTO_ENCODE to default
13214         x->output_options.  Initializes new members of ps_driver_ext.
13215         Changed default value for prologue_fn, encoding_fn.  Calls
13216         read_ps_encodings after loading default fonts.
13217         (option_tab[], ps_option) Handle new configuration parameter.
13218         (switch_font) New function.
13219         (struct output_char) `font' member changed from `font_desc *' to
13220         `font_entry *'.  New member `separate'.
13221         (read_fontmap) Changed `size' from `int' to `size_t'.
13222         (output_line, put_number) New macros for write_text().
13223         (write_text) Optimizes text output by consolidating multiple
13224         calls to PostScript `show' operator.
13225         (text) Keeps track of when text arguments can't be consolidated by
13226         write_text(), and marks those spots in the output stream.
13227         (load_font) Sets `position' of the allocated font_entry to -1, cuz
13228         the font hasn't been switched to by switch_font(), which is where
13229         the position is important--the PostScript is what cares about the
13230         position.
13231
13232 Sat Aug 31 23:52:38 1996  Ben Pfaff  <blp@gnu.org>
13233
13234         * hash.c: (hsh_destroy) Ignores NULL argument.  Doesn't try to
13235         call a NULL free_func.
13236         (hsh_rehash) Elegantized.
13237         (hsh_probe) Fix bug that manifested when the table was expanded
13238         and thus had to change location in memory.  Good thing
13239         too--otherwise could have been much more subtle.
13240         (hsh_find) [GLOBAL_DEBUGGING] Not stubbed out anymore.
13241         (hsh_foreach) New function for hash table iteration.
13242
13243         * hash.h: (struct hsh_iterator) New.
13244
13245         * lexer.c: (parse_tagged_quote) Font and family name strings in
13246         tags are now null-terminated.
13247
13248         * output.c: (outp_evaluate_dimension) Fixed over-aggressive unit
13249         parsing.
13250         (internal_get_paper_size, outp_get_paper_size) Fixed; now work as
13251         documented.  (Never before tested?)
13252
13253         * output.h: Comment changes.
13254
13255         * postscript.c: New driver options `optimize-text-size',
13256         `optimize-line-size', `max-fonts-simult'.  New enum set for
13257         specing cached line types.  Comment fixes.
13258         (struct line_form) New struct.
13259         (struct ps_driver_struct) New members `text_opt', `line_opt',
13260         `max_fonts', `lines'.
13261         (ps_init_driver) Initializes new members of ps_driver_struct.
13262         (user option type enum set) New member `nonneg_int_arg'.
13263         (static var option_tab[]) Supports new options.
13264         (ps_option) Handles new options.
13265         (find_ps_file) Made static.  No longer calls hsh_dump().
13266         (ps_get_var) Made static.
13267         (preclose) Dumps out proper DSC trailer.
13268         (ps_open_page) Elegantized.
13269         (ps_close_page) Calls dump_lines() if appropriate.
13270         (ps_line_horz, ps_line_vert, ps_line_intersection) Reduced to
13271         wrappers around line().
13272         (int_2_compare, compare_line, dump_line, dump_fancy_line,
13273         dump_lines, hash_line, free_line, line) New functions for support
13274         of line caching.
13275         (write_text, text) Made static.
13276         (text) Added to font support, not finished.
13277
13278 Thu Aug 29 21:36:41 1996  Ben Pfaff  <blp@gnu.org>
13279
13280         * font.h: (struct font_desc) New members ascent, descent.
13281
13282         * groff-font.c: (groff_read_font) Calculates font ascent and
13283         descent from the ascent and descent of the `d' and `p' characters,
13284         respectively, as per a suggestion on comp.fonts.
13285
13286         * postscript.c: (ps_open_page, ps_close_page, ps_line_horz,
13287         ps_line_vert, ps_line_intersection) Rewritten to deal with changed
13288         prologue.
13289         (write_text) Handles text right-justification and centering (not
13290         full justification).  Still very inefficient.  (One output line
13291         per character?!)
13292         (struct output_char) Added fields for font and font size.
13293         (text) Many bugfixes.
13294
13295 Sat Aug 24 23:26:00 1996  Ben Pfaff  <blp@gnu.org>
13296
13297         * cmdline.c: (usage) Calls outp_list_classes().
13298
13299         * font.h: Comment fix.
13300
13301         * groff-font.c: New exported global var `space_index'.
13302         (groff_init) New function to initialize `space_index'.
13303         (hash_kern) Casts result to unsigned.
13304         (font_name_to_index) Renamed font_char_name_to_index.  All
13305         references changed.  Also, now returns the value of `space_index'
13306         when passed an ASCII space character as an argument.  Fixed
13307         handling of nulls.
13308         (font_get_kern_adjust) Changed i from `int' to `unsigned'.
13309         Handles passed NULL pointers properly.
13310
13311         * lexer.c: (parse_tagged_quote) Comment fix.  Better range
13312         checking.
13313
13314         * output.c: (outp_list_drivers) Removed.  Removed all references.
13315         
13316         * output.h: Comment fixes.
13317
13318         * postscript.c: (ps_open_global) Calls groff_init().
13319         (output_char) New structure.
13320         (write_text) New function.
13321         (text) No longer stubbed out!  Now the output is correct--with a
13322         few exceptions, one of them being that the page has to be held
13323         upside down into a mirror.
13324
13325 Sun Aug 11 21:31:22 1996  Ben Pfaff  <blp@gnu.org>
13326
13327         * font.h: Comment fix.
13328         
13329         * font.c: (name_to_index) Renamed font_name_to_index, made extern.
13330         All callers changed.
13331         (number_to_index) Renamed font_number_to_index, made extern.  All
13332         callers changed.
13333         (font_get_kern_adjust, font_get_char_metrics) New functions.
13334
13335         * output.h: New constant OUTP_T_INTERNAL_DRAW.
13336
13337         * postscript.c: Changed default line width back to 1/2 point.
13338         (ps_line_horz, ps_line_vert, ps_line_intersection) Now lines are
13339         in the center of the space allotted for them, not just a fixed
13340         offset from the edge of the space; this fixes some bugs.
13341         (ps_line_intersection) Now supports all command line styles.
13342         (ps_text_get_size) Bug fix in computation of em width.
13343         (text) New function, the meat behind ps_text_metrics and
13344         ps_text_draw.  Not complete.
13345         (ps_text_metrics, ps_text_draw) Removed the stub taken from
13346         ascii.c; call text().
13347
13348 Sat Aug 10 23:28:17 1996  Ben Pfaff  <blp@gnu.org>
13349
13350         * arena.c: (arena_free) Assert that the argument is non-NULL.
13351         
13352         * groff-font.c: (add_kern) Calls arena_free() for old_kern if and
13353         only if old_kern is non-NULL.
13354
13355         * postscript.c: (ps_init_driver) Changed default line width to 1
13356         point.
13357         (postopen) New prologue variables.
13358         (ps_line_horz, ps_line_vert, ps_line_intersection) Implements some
13359         more of the common line styles properly, but not all.
13360         (ps_text_metrics) Fixed problem with this stubbed out version that
13361         kept it from taking font sizes into account.
13362
13363 Thu Aug  8 22:31:11 1996  Ben Pfaff  <blp@gnu.org>
13364
13365         * arena.c: (arena_malloc) Bug fix.
13366         (arena_dump) [GLOBAL_DEBUGGING] New function.
13367
13368         * ascii.c: Comment fix.
13369         (count_fancy_chars, delineate) Now static functions.
13370         
13371         * filename.c: (interp_vars) Bug fixes.
13372
13373         * font.h: Comment fixes.
13374
13375         * glob.c: (init_glob) Sets set_viewwidth, set_viewlength at
13376         beginning in case we have an error message to display before
13377         initializing the display.
13378
13379         * groff-font.c: Comment fix.  Changed rehash threshold from 2/3
13380         full to 1/2 full.
13381         (groff_read_font) Bug fixes.
13382         (name_to_index) Increments hash.used.  Sets `name' field of hash
13383         entry properly.
13384         (add_kern) Sets kern_max_used after rehashing.  Other bug fixes.
13385
13386         * hash.c: Return type changed.
13387
13388         * postscript.c: Continued development.  Now marks lines on the
13389         paper, but very buggy.
13390
13391 Sat Aug  3 20:50:35 1996  Ben Pfaff  <blp@gnu.org>
13392
13393         * Changed comments in many source files from `/* xxx /* yyy */' to
13394         `/* xxx */ /* yyy */' for cleanliness.
13395
13396         * arena.c: (arena_sd_strdup) New function.
13397         
13398         * ascii.c: (struct ascii_driver_ext) New member `file'.
13399         (ascii_init_driver) Fills out member `file' for initing; uses
13400         close_file_ext for closing drivers.
13401         (ascii_option) Changed %.*s back to %s because the a_string's are
13402         always null-terminated.
13403         (postopen, preclose) New functions.
13404         (ascii_open_page) Uses new style of open_file_ext.
13405         (ascii_option, commit_line_buf, output_lines) Use ext->file.file
13406         instead of this->output.
13407         (__assert_fail) Removed.
13408
13409         * cmdline.c: Changed syntax_message[].
13410
13411         * error.c: #include's <readline/history.h> only if the history
13412         library is available, not if just the readline library is
13413         available.
13414
13415         * filename.c: (expand_line) Removed alloca() support.
13416         (interp_vars) No longer tilde-expands argument.  Limit on output
13417         length removed.
13418         (tilde_expand) Now treats argument as path rather than filename.
13419         [!unix] Now is a no-op function.
13420         (search_path) Better verbose message formatting.
13421         (open_file, close_file) Comment fixes.
13422         (close_file) [!unix] Doesn't bother with pipes.
13423         (open_file_ext) Completely rewritten, interface revamped.
13424         (close_file_ext) New function.
13425
13426         * font.h: Comment changes.
13427
13428         * frequencies.q: Removed AIX alloca support since it doesn't use
13429         alloca.
13430
13431         * hash.c: Comment changes & additions.
13432         (hsh_create) Initializes entire table instead of first M entries.
13433         (hsh_probe) Stupid bug fixed.  Now it works.
13434         (hsh_dump) [GLOBAL_DEBUGGING] New function.
13435
13436         * main.c: (parse) Detects EOF properly in token-eating loop.
13437         Should the STOP token have its value changed to 0?
13438
13439         * misc.c: (blp_getdelim) [HAVE_GETDELIM] Now it's a macro.
13440         (blp_getline) Now it's a macro.
13441
13442         * output.h: (struct outp_driver) Removed members output, filename.
13443         
13444         * output.c: (outp_init) [!NO_POSTSCRIPT] Installs PostScript
13445         drivers in driver table.
13446         (outp_read_devices) Frees buf.  Warns if there are no active
13447         output drivers.
13448         (outp_configure_clear) Sets outp_configure_vec to NULL after
13449         deleting its elements.
13450         (configure_driver, destroy_driver) Removed references to output,
13451         filename members of outp_driver.
13452         (outp_evaluate_dimension, internal_get_paper_size,
13453         outp_get_paper_size) New functions.
13454
13455         * postscript.c: Continued development.  Now links but doesn't make
13456         any marks on the page.  Lotsa bugs I suppose.
13457
13458         * str.c: (strcasecmp) [!HAVE_STRCASECMP] New function.
13459
13460         * str.h: Comment changes.
13461
13462 Sat Jul 27 22:32:38 1996  Ben Pfaff  <blp@gnu.org>
13463
13464         * Removed dependencies on non-nested comments in several files.
13465         Also removed references to (unix || __unix__) in #if's since
13466         prefh.orig makes those two equivalent.
13467         
13468         * ascii.c: (ascii_open_global) Creates ascii_arena.
13469         (ascii_close_global) Destroys ascii_arena.
13470         (ascii_init_driver) Doesn't create ascii_arena.
13471         (ascii_copy_driver) Removed.
13472         (ascii_option) Possible bugfix regarding %s vs. %.*s with a_string's.
13473         (outp_class ascii_class) Removed ascii_copy_driver reference.
13474
13475         * frequencies.q: Now can display all statistics except median.
13476         Still not finished.
13477
13478         * output.c: Handles outp_class.ref_count so output class
13479         destructors are called properly.
13480         (add_class) Sets ref_count to 0.
13481         (configure_driver) Initializes class if ref_count++ is 0.
13482         (destroy_driver) Destructs class if --ref_count is 0.  Frees the
13483         class output file name.
13484         
13485         * output.h: (struct outp_class) Removed copy_driver, inited.
13486         Added ref_count.
13487
13488         * postscript.c: Completely replaced but not finished.
13489         
13490 Tue Jul 23 21:48:36 1996  Ben Pfaff  <blp@gnu.org>
13491
13492         * approx.h: #includes <float.h>.
13493
13494         * arena.h, arena.c: Many functions changed to take an arena **
13495         instead of an arena *, for consistency.  All callers changed.
13496         (arena_alloc) Now creates a new arena if passed *A that is NULL.
13497         (arena_destroy) Sets *A to NULL.
13498         
13499         * ascii.c: (delineate) Implements OUTP_T_VERT correctly.  Removed
13500         assertion that `width' be positive.
13501
13502         * command.c: Removed #if's from cmd_table.
13503         (walk_cmdtable_func) [0] New function (debug code).
13504         (init_cmd_parser) [0] Dumps out cmd_table (debug code).
13505         (parse_cmd) Doesn't return failure for unimplemented commands.
13506
13507         * common.h: (SYSMIS) Changed from DBL_MAX to -DBL_MAX.
13508         (SYSCODE) New constant macro.
13509
13510         * descript.q: Checks for positive n_variables before performing
13511         analysis.
13512
13513         * file-handle.q: (get_handle_by_filename) Bug fix: passes &f to
13514         avl_find instead of &fp as arg 2.
13515
13516         * frequencies.g, frequencies.q: Continued updating; now compiles &
13517         works again, but not complete.
13518
13519         * main.c: Changes to user messages.
13520
13521         * misc.c: (reverse) [0] New function.
13522
13523         * settings.h: Comment removed.  #includes "common.h".
13524
13525         * som.c: (som_set_null) New function.
13526         (som_set_value, som_set_string, som_set_text) More detailing
13527         assertions.
13528         (som_set_float) Implemented function.
13529         (dump_columnated_table) Bug fix regarding page breaks.
13530         (draw_cell) Bug fix regarding text that spilled out of a cell.
13531         (draw_intersection, draw_horz_rule, draw_vert_rule) No longer draw
13532         null lines.
13533         (get_cell_size) Support SCON_EMPTY cells.
13534         (get_table_size) When calculating rules' widths and heights, mask
13535         out SLIN_SPACING bit.  Added SOPT_X_HLTL support.
13536         
13537         * som.h: (som_any_cell) New option SOPT_X_HTLT.  Removed
13538         SOPT_X_SHADE.
13539         (struct som_submission_form) New member `header'; all users
13540         changed.
13541
13542         * val-labs.c: (get_label) User messages changed.
13543
13544         * var.h: Changed FREQUENCIES structures.
13545
13546         * vars-atr.c: (is_num_user_missing, is_str_user_missing) Made
13547         inline.
13548         
13549 Fri Jul 19 19:11:13 1996  Ben Pfaff  <blp@gnu.org>
13550
13551         * approx.h: Definition of EPSILON now depends on system's
13552         DBL_EPSILON.  Removed GNU C specific code.
13553         (cmpapx) Renamed approx_compare.
13554
13555         * frequencies.g, frequencies.q: Continued updating; still doesn't
13556         compile.
13557
13558         * groff-font.c: (name_to_index) Fix bug that kept it from
13559         compiling.
13560
13561         * hash.c, hash.h: Completed work.
13562
13563         * var.h: Changes to freq_tab, frequencies_proc.
13564         
13565 Wed Jul 17 21:23:36 1996  Ben Pfaff  <blp@gnu.org>
13566
13567         New hashing code.
13568         * hash.c, hash.h: New files.  Not completed.
13569         * Makefile.am: Added hash.c to source file list.
13570         * font.h: (struct font_desc) New member kern_size_p.
13571         * groff-font.c: Uses hash.h.
13572         (hashpjw) Moved to hash.c.
13573         (next_prime_power) Rewrote, renamed hsh_next_prime, moved to
13574         hash.c.
13575         (static var hash) New member size_p.
13576         * var.h: Includes hash.h.
13577         (struct freq_tab) Changed AVL_TREE to hash_tab.
13578
13579         * vars-prs.c: Comment, formatting fixes.
13580
13581         * frequencies.g, frequencies.q: Continued updating.  Not yet
13582         working.
13583
13584         * formats.c: Bug fix.
13585
13586 Tue Jul 16 22:10:04 1996  Ben Pfaff  <blp@gnu.org>
13587
13588         Increasing parallelism between DESCRIPTIVES and FREQUENCIES.
13589         * descript.g: Comment fixes.
13590         * descript.q: Comment fixes.  Moved some declarations into var.h.
13591         Made dsc_info a static table.  Updated FIXMEs.
13592         (internal_cmd_descriptives) Beautified.
13593         
13594         * frequencies.q: Started updating into working order.
13595         * frequencies.g: New file analogous to descript.g.
13596         * var.h: Comment fixes.  Added structures for FREQUENCIES.
13597         
13598         * som.c: Removed vestiges of crushing and partial table support.
13599
13600 Sun Jul 14 15:45:31 1996  Ben Pfaff  <blp@gnu.org>
13601
13602         * Many more changes to som.c especially, but these will not be
13603         documented as I have resolved to remove them.  This patchlevel is
13604         being released solely so that I can fall back to it if I decide
13605         that removing the changes is not a good idea.
13606
13607 Sat Jul 13 09:58:44 1996  Ben Pfaff  <blp@gnu.org>
13608
13609         * som.c: (global var som) New member `cum_y'.
13610         (build_target) Properly handles titles for partial tables.
13611         (dump_partial_beg, dump_partial_mid, dump_partial_end)
13612         Merged into single new function dump_partial().  Fixed problem
13613         with titles on partial tables.
13614         (dump_table) Calls dump_partial() for all parts of partial tables.
13615         (dump_page) Criteria for drawing title changed.
13616         
13617 Fri Jul 12 22:03:36 1996  Ben Pfaff  <blp@gnu.org>
13618
13619         * command.c: (cmd_table) Added LIST, WEIGHT.
13620
13621         * command.c: (cmd_remark) No longer frees `s' since it's not
13622         dynamically allocated.
13623         
13624         * data-out.c: (convert_f) Now correctly handles the case where
13625         abs(v->f)<1 but v->f rounds to a value of 1.00 given the specified
13626         number of decimals.
13627         (som_destroy_all_tables) Removed argument.  All callers changed.
13628         (som_vline, som_hline) Argument validity checking corrected.
13629         (som_set_value) Implemented half-heartedly.
13630         (replicate_table) Copies tables piece-by-piece when using Checker.
13631
13632         * som.h: New line style SLIN_1THIN, currently equivalent to
13633         SLIN_0.  New enum set SOM_SUB_*.
13634         (struct som_submission_form) Removed `seq_no'.  Added `type'.
13635         
13636         * list.q: Newly working file; uses partial tables.
13637         
13638         * som.c: (som_reduce_table) Renamed som_set_table_height().
13639         (som_crush) Removed argument `group'.
13640         (global var som) Removed `nt', `seq_no'.  Added `type'.
13641         (som_submit_table) Arguments changed.
13642         (output_table) Removed partial table code.
13643         (build_target) New arg; partial table support added.  All callers
13644         changed.
13645         (dump_plain_table) Removed partial table code.
13646         (dump_partial_beg, dump_partial_mid, dump_partial_end) New functions.
13647         (dump_table) Supports partial tables.
13648         (dump_page) New argument to allow not drawing top and/or bottom
13649         headers.  All callers changed.  Supports partial tables.
13650
13651 Sat Jul  6 22:22:25 1996  Ben Pfaff  <blp@gnu.org>
13652
13653         * data-out.c: Changed `#include <approx.h>' to `#include
13654         "approx.h".
13655         (convert_F) Comment fix.  Now won't print `-.000', etc.
13656
13657         * descript.q: Now Z-scores work, although there appears to
13658         be a bug (which might actually be in data-out.c:convert_F()).
13659         (descriptives_trns_proc, descriptives_trns_free) New functions.
13660         (run_z_pass) Implemented.
13661         
13662         * var.h: Comment fixes.
13663         (dsc_z_score, descriptives_trns) New structs.
13664         (descriptives_trns) Added to any_trns as `dsc'.
13665
13666         * error.c, error.h: New error class, IS (Installation Script
13667         error), used in those instances where the error is in the
13668         installation, but there is a script file or installation file that
13669         can be usefully referred to.
13670         
13671         * output.c: Change many IE classes to IS classes.
13672
13673         * cases.c, command.c, common.c, crosstabs.q, expr-evl.c,
13674         frequencies.q, list.q, vars-prs.c, vfm.c: Removed reference to
13675         HAVE_MALLOC_H because Borland C++ alloca() is broken, so why
13676         include the corresponding header?
13677         
13678         * glob.c: (init_glob) Don't malloc term_buffer under Checker.
13679         Don't bail out if termcap can't be read.
13680
13681         * som.c: (som_destroy_table) Removed.
13682         (som_reduce_table, som_destroy_all_tables) New functions.
13683         (som_crush) New function, not implemented.
13684         
13685         * som.h: New table option STAB_CRUSH.  Comment fix.  New struct
13686         som_submission_form.  Function prototypes revised.
13687
13688         Outputting huge tables (1000s of rows) a few rows at a time
13689         is supported, though untested.  May even break everything.
13690         Actually, the code doesn't even compile right now.
13691         * som.c: (struct som) New fields htv, nt, seq_no.
13692         (som_submit_table) Multiple arguments changed to a single
13693         pointer to struct submission_form.  Only increments subtable_num
13694         if seq_no is zero.  Only destroys table if it's not going to
13695         be reused.
13696         (replicate_table) New function.
13697         (output_table) Comment fix.
13698         (examine_table) Changed inline code to code calling
13699         replicate_table().  Calculates htv.  Supports partial tables.
13700         (draw_title) Removed comment.
13701         (build_target) Only allows for title on first part of partial
13702         tables.
13703         (dump_plain_table) Only resets table chunk number on first part
13704         of partial tables; FIXME: doesn't work quite right.  Supports
13705         partial tables.
13706         (dump_page) Titles only on first part of partial tables.
13707
13708 Fri Jul  5 20:16:19 1996  Ben Pfaff  <blp@gnu.org>
13709
13710         * Thanks to an unreliable IDE hard drive, I have spent the last
13711         day reconstructing my Debian GNU/Linux installation and redoing
13712         the previous day's changes--somehow I managed to save every file
13713         except for output.c and output.h.  So the following changes could
13714         really be considered independent of the output.c, output.h changes
13715         from Jul 4.
13716
13717         * output.h, output.c: Moved the outp_configure_vec global var,
13718         outp_names struct, and enum set OUTP_S_* from output.h to output.c.
13719         outp_configure_vec is now static.
13720         
13721 Thu Jul  4 20:20:24 1996  Ben Pfaff  <blp@gnu.org>
13722
13723         * The entire philosophy behind configuration of the output drivers
13724         changed.  Now there is a termcap-type configuration where drivers
13725         to be read are determined beforehand, rather than parsing the
13726         entire output init file and storing it in memory & deciding what
13727         to actually use later.  Faster & more memory-efficient at the same
13728         time, cool.
13729         
13730         * output.c: Comment fix.  Removed outp_init_drivers global var.
13731         Removed all references to synonyms.  New structure outp_defn.  New
13732         global vars outp_macros, outp_configure_vec.
13733         (search_name, delete_name, add_name, check_configure_vec,
13734         expand_name, find_defn_value) New static functions.
13735         (outp_configure_clear, outp_configure_add, outp_configure_macro,
13736         outp_read_devices) New extern functions.
13737         (outp_init) Much functionality moved into outp_read_devices.
13738         (outp_read_devices) Format of output init file changed; name of
13739         file is `devices' rather than `output' to avoid Makefile
13740         conflicts.
13741         (outp_clear) Renamed outp_done.
13742         (outp_list_classes) Bug fix, cleaned up.
13743         (outp_list_drivers) Not implemented anymore.
13744         (outp_configure_driver) Now a static function; simplified; now
13745         interpolates macros; supports new structure.
13746         (outp_enable_driver, match_synonym) Removed; all references
13747         removed.
13748         (find_driver) First argument removed.
13749         
13750         * output.h: Global var outp_init_drivers removed; new structure
13751         outp_names; new enum set OUTP_S_*; new global var
13752         outp_configure_vec; function prototypes for output.c exports
13753         updated.
13754         
13755         * main.c: (main) Calls outp_read_devices() after parsing the
13756         command line.
13757         
13758         * cmdline.c: (parse_command_line) New option -v --verbose;
13759         --version changed to -V.  --device option changed syntax to just
13760         take a single device name.  Accepts key=value declaration of
13761         output init file macros.  Syntax message updated.
13762
13763         * filename.c: (expand_line) New function.
13764         (interp_environ_vars) Renamed interp_vars; no longer uses
13765         fixed-size buffer.
13766         (blp_getenv) Allows $ARCH and $VER pseudo-environment-vars to be
13767         overridden by real environment vars.
13768         (search_path) Uses verbose_msg() instead of #ifdef'd printf().
13769         * filename.h: interp_environ_vars() renamed interp_vars().
13770         
13771         * error.c, error.h: Added extern variable `verbosity', message
13772         class MM.
13773         
13774         * error.c: (vmsg) Support message class MM.
13775         (verbose_msg) New function.
13776
13777         * descript.q: (generate_z_varname) Bug fix in generation of
13778         Z-score varnames.
13779         (dump_z_table) Bug fix in column headers.
13780         
13781         * ascii.c: (ascii_init_driver) Changed minimum number of lines per
13782         page from 29 to 15.  Don't set a default for ops[OPS_INIT,
13783         OPS_DONE].  Writes the uninit string when the driver is closed.
13784         (ascii_open_page) Write the init string before the first page.
13785         (output_shorts) Form of main loop changed from `while' to `for'.
13786         Bug fix with overstrikes: the character is printed *after* the
13787         backspace.  Eliminated a lot of `& 0xff' modifiers.
13788         (advance_to_left_margin) New function.
13789         (return_carriage, output_lines) Handle left margin.
13790
13791 Thu Jul  4 00:35:59 1996  Ben Pfaff  <blp@gnu.org>
13792
13793         * ascii.c: New option `carriage-return-style'.
13794
13795         * ascii.c: (count_fancy_chars) New function.
13796         (delineate, text_metrics) Use new function; bug fixes regarding
13797         rich text strings.
13798         (text_draw) Bug fix with rich text.
13799         (output_string, output_shorts) Reordered.
13800         (output_shorts) Now handles boxchars and some overstrike font
13801         changes.
13802         (output_char, return_carriage) New functions.
13803         (output_lines) Now handles overstriking and font changes properly;
13804         some code moved to output_shorts.
13805
13806 Tue Jul  2 22:13:23 1996  Ben Pfaff  <blp@gnu.org>
13807
13808         [GLOBAL_DEBUGGING]
13809         * ascii.c: New member `debug' in ascii_driver_ext.
13810         (ascii_init_driver, delineate) Uses new member.
13811
13812         Now you can set a vertical height on writing text.
13813         * ascii.c: (delineate) Keeps track of vertical position.
13814         (text_draw) No longer considers fully justified text an internal
13815         error.
13816         
13817         * output.h: New flag OUTP_T_VERT; other OUTP_T_ values changed.
13818
13819         Tables' titles are drawn; they can have variable height.
13820         * som.c: `som' struct has new member, title_height.
13821         (draw_title) New argument.  Moved within file.  All caller
13822         changed.
13823         (build_target) New argument, amount of space needed for first row.
13824         Calculates height of title, takes that into account.  All callers
13825         changed.
13826         (dump_plain_table, dump_columnated_table) Took calculation of y1,
13827         y2 out of loop.
13828         (dump_columnated_table) [GLOBAL_DEBUGGING] Debugging code
13829         improved.
13830         (dump_columnated_table) Organized for readability.
13831         (dump_page) Makes use of som.title_height.
13832
13833         * som.c: Many comment bug fixes.
13834
13835         * descript.q: (try_name, generate_z_name) Bug fix regarding
13836         generation of Z-score variable names.
13837         * var.h: Removed num from descriptives_proc; all referents removed.
13838
13839 Mon Jul  1 22:13:39 1996  Ben Pfaff  <blp@gnu.org>
13840
13841         * ascii.c: (ascii_line_horz, ascii_line_vert,
13842         ascii_line_intersection) Added debugging code.
13843
13844         Added a descriptive line above each table to describe it.
13845         * command.c: (parse_cmd) Calls som_new_series.
13846         
13847         * som.c: New static vars table_num, subtable_num.  New `som'
13848         member `title'.
13849         (dump_page) New arguments.
13850         (som_submit_table) Handle new variables.
13851         
13852         * som.c, som.h: (som_submit_table) New arguments.  All callers
13853         changed.
13854         (som_new_series) New function.
13855         (build_target) Makes room for extra line.
13856         (draw_title) New function.
13857         (dump_page) Calls draw_title.  Bug fix: doesn't always set
13858         som.ext->cp to 0.
13859         
13860         Columnation of tables support.
13861         * som.h: Deleted fr, lr, ri from som_table.  Reorganized.
13862         
13863         * som.c: Deleted references to fr, lr, ri.
13864         (som_columnate) Bux fix: sets group member of table.
13865         (som_add_options) Function removed.
13866         (dump_table) Split into three functions; extensively reworked.
13867         
13868         * descript.q: (dump_z_table) Better output table formatting; added
13869         title support to correspond to som.h changes.
13870         (display) Title support.
13871
13872         * output.h: Added OUTP_T_NONE.
13873         
13874 Mon Jul  1 13:00:00 1996  Ben Pfaff  <blp@gnu.org>
13875
13876         * descript.q: Improved handling of Z scores; still not perfect.
13877         
13878         * output.h, ascii.c: Added hook for getting em width of current
13879         font.
13880         
13881         * som.c: Uses new em-width hook.  Added debugging code to
13882         several functions.
13883         (som_columnate) New argument.
13884         (som_add_options) Removed.
13885
13886 Jun 29 17:40:47 1996  Ben Pfaff  <blp@gnu.org>
13887
13888         * som.h, som.c, output.c, output.h, ascii.c: Updated to work with
13889         rules as a property of the table instead of as a property of the
13890         cells.
13891         
13892         * ascii.c: Added `header' to table of options.
13893         
13894         * descript.q: Added even shorter statistic names; modified to work
13895         with new som interface.
13896         
13897         * misc.c (blp_getdelim): Bug fix.
13898         
13899         * version.c: includes 'conf.h'.
13900         
13901 ----------------------------------------------------------------------
13902 Local Variables:
13903 mode: change-log
13904 version-control: never
13905 End: