Continue reforming error message support. In this phase, rename
[pspp-builds.git] / src / ChangeLog
1 Mon Apr 24 17:40:08 2006  Ben Pfaff  <blp@gnu.org>
2
3         Continue reforming error message support.  In this phase, rename
4         all the message functions and types to start with "msg", except
5         for the ones that will be moving to other modules anyway.
6
7         All references to the identifiers below were updated likewise.
8         
9         * message.c: (err_done) Renamed msg_done().
10         (err_push_file_locator) Renamed msg_push_msg_locator().
11         (err_pop_file_locator) Renamed msg_pop_msg_locator().
12         (err_location) Renamed msg_location().
13         (err_set_command_name) Renamed msg_set_command_name().
14
15 Mon Apr 24 14:11:33 2006  Ben Pfaff  <blp@gnu.org>
16
17         * message.c: Use exit.h from gnulib instead of checking for and
18         defining EXIT_SUCCESS and EXIT_FAILURE by hand.
19
20 Sun Apr 23 22:00:23 2006  Ben Pfaff  <blp@gnu.org>
21
22         Continue reforming error message support.  In this phase, get rid
23         of message "titles" and put the message text in `struct error'.
24         Now `struct error' encapsulates a message more properly.
25
26         * message.c: (tmsg) Removed.
27         (msg) Use err_msg() instead of err_vmsg().  Format message
28         ourselves.
29         (err_vmsg) Renamed err_msg().  Changed interface, dropping message
30         and va_list args which are now in the error struct.
31                 
32 Sun Apr 23 20:35:28 2006  Ben Pfaff  <blp@gnu.org>
33
34         Continue reforming error message support.
35
36         * message.c: Use linebreak module from gnulib instead of home-brew
37         line breaking.
38         (puts_stdout) Rewrote.
39         (dump_message) Rewrote.  Changed interface and updated all callers.
40         (compulsory_break) Removed.
41         (char_is_break) Removed.
42         (break_before) Removed.
43         (break_after) Removed.
44         (macro BREAK_LONG_WORD) Removed.
45
46 Sun Apr 16 20:41:10 2006  Ben Pfaff  <blp@gnu.org>
47
48         Continue reforming error message support.  In this phase, we
49         divide the classification of messages along "category" and
50         "severity" axes.
51
52         * message.c: (err_vmsg) Rewrite to deal with categories and
53         severities in a straightforward manner instead of mixing them into
54         classes.
55         [0] (puts_stderr) Removed (dead code).
56         (msg) Changed first argument from `int' to `enum msg_class'.
57         (tmsg) Ditto.
58
59 Sun Apr 16 18:53:12 2006  Ben Pfaff  <blp@gnu.org>
60
61         GNU standards require "file name" instead of "filename" in
62         documentation.  It's nice for our code to follow the convention
63         too.
64
65         Basically did search and replace in the whole source tree.  Major
66         changes in function names or struct member names have their own
67         change log entries.
68
69 Sun Apr 16 15:58:56 2006  Ben Pfaff  <blp@gnu.org>
70
71         Continue reforming error message support.  In this phase, we get
72         rid of VM() and the other msg() support for "verbosity", replacing
73         it by a new function verbose_msg().
74
75         * message.c: (verbose_msg) New function.
76         (err_vmsg) Remove support for verbosity levels.
77
78 Sun Apr 16 11:46:51 2006  Ben Pfaff  <blp@gnu.org>
79
80         Start reforming error message support.  In this phase, we get rid
81         of "installation errors" and change all uses of msg() in the
82         output drivers to uses of error() or error_at_line().
83
84         * message.c: (err_vmsg) Get rid of IE, IS support.
85
86 Sat Mar 11 14:17:47 WST 2006 John Darrington <john@darrington.wattle.id.au>
87
88         * automake.mk: Changed the pattern specific AM_CPPFLAGS to two target 
89           specific ones. Eventually there will be none at all.
90
91         * automake.mk: Moved the pspp binary to ui/terminal
92
93 Sat Mar  4 12:59:08 2006  Ben Pfaff  <blp@gnu.org>
94
95         * In many source files, #include "compiler.h" to get GCC attribute
96         definitions.
97
98 Sat Mar  4 12:28:09 2006  Ben Pfaff  <blp@gnu.org>
99
100         * In many source files, replace INT_DIGITS by
101         INT_STRLEN_BOUND(int) and include intprops.h.
102
103 John Darrington:
104         
105         * Replaced '_' with '-' in most filenames.
106
107         * Renamed files as follows:
108                 vfm.[ch] to procedure.[ch]
109                 error.[ch] to message.[ch]
110                 getl.[ch] to line-buffer.[ch]
111                 mkfile.[ch] to make-file.[ch]
112                 pfm-write.h to por-file-writer.h
113                 pfm-write.c to por-file-writer.c
114                 sfmP.h to sfm-private.h
115                 lex-def.c to identifier.c
116                 lex-def.h to identifier.h
117                 sfm-read.c to sys-file-reader.c
118                 sfm-read.h to sys-file-reader.h
119                 sfm-write.h to sys-file-writer.h
120                 sfm-write.c to sys-file-writer.c
121                 chart.[ch] to chart-geometry.[ch]
122                 val.h to value.h
123                 var.h to variable.h
124                 vars-atr.c to variable.c
125                 ctl-stack.c to control-stack.c
126                 ctl-stack.h to control-stack.h
127                 dfm-read.c to data-reader.c
128                 dfm-write.c to data-writer.c
129                 dfm-write.h to data-writer.h
130                 dfm-read.h to data-reader.h
131                 apply-dict.c to apply-dictionary.c
132                 mis-val.c to missing-values.c
133                 sysfile-info.c to sys-file-info.c
134                 modify-vars.c to modifiy-variables.c
135                 rename-vars.c to rename-variables.c
136                 val-labs.c to value-labels.c
137                 var-display.c to variable-display.c
138                 var-labs.c to variable-label.c
139                 format-prs.c to format-parser.c
140                 range-prs.c to range-parser.c
141                 range-prs.h to range-parser.h
142                 subclist.c to subcommand-list.c
143                 subclist.h to subcommand-list.h
144                 vars-prs.c to variable-parser.c
145                 descript.c to descriptives.c
146                 sort-prs.c to sort-criteria.c/sort-cases.c
147                 sort-prs.h to sort-criteria.h
148                 sel-if.c to select-if.c
149                 algorithm.c to array.c
150                 algorithm.h to array.h
151                 bitvector.h to bit-vector.h
152                 som.c to manager.c
153                 som.h to manager.h
154                 tab.h to table.h
155                 tab.c to table.c
156                 readln.c to read-line.c
157                 readln.h to read-line.h
158                 cmdline.c to command-line.c
159                 cmdline.h to command-line.h
160
161
162 Sat Feb 11 22:35:20 2006  Ben Pfaff  <blp@gnu.org>
163
164         General clean-ups and minor bug fixes.
165
166         * filename.h: Move DIR_SEPARATOR, PATH_SEPARATOR here from
167         pref.h.orig.
168
169         * lex-def.h: (macro CHAR_IS_ID1) Removed.  All references changed
170         to lex_is_id1().
171         (macro CHAR_IS_IDN) Removed.  All references changed to
172         lex_is_idn().
173         
174         * lex-def.c: (lex_is_id1) New function.
175         (lex_is_idn) New function.
176         (lex_skip_identifier) New function.
177         (lex_id_match_len) Return bool instead of int.
178         (lex_id_match) Ditto.
179
180         * command.c: (parse_command_name) Convert parsed words to
181         uppercase to make error messages easier to read.
182         (cmd_host) Fix return value.
183
184         * dfm-read.c: (read_inline_record) Use tokens to check for BEGIN
185         DATA, not specialized lexical analysis.
186
187         * print.c: (print_space_trns_proc) Count of lines should be `int',
188         otherwise we might never finish.
189         (print_space_trns_free) Close writer.
190
191         * lexer.c: (enum string_type) New enum.
192         (lex_get) Remove essentially unused local variable `cp'.
193         Use enum string_type values.  Use parse_id().
194         (parse_id) New function.
195         (lex_look_ahead) Recognize octal strings too.
196         (strip_comments) New function.
197         (lex_get_line) Rewrite.
198         (lex_preprocess_line) Removed.
199         (convert_numeric_string_to_char_string) Use enum string_type.
200         (parse_string) Ditto.
201
202         * autorecode.c: (recode) Clone correct number of bytes based on
203         source string width.
204
205 Sat Feb 11 22:34:38 2006  Ben Pfaff  <blp@gnu.org>
206
207         Reduce dependencies on getl, and of getl.
208
209         * data-in.c: (vdls_error) Don't output different message depending
210         on whether we're interactive.
211
212         * getl.h: (struct getl_line_list) Removed.
213         (struct getl_script) Removed.
214         (GETL_PRPT_*) Removed.
215         (GETL_MODE_*) Removed.
216         (GETL_PROMPT_FIRST, GETL_PROMPT_LATER, GETL_PROMPT_DATA,
217         GETL_PROMPT_CNT) New enums.
218
219         * settings.c: (static var prompt) Removed.
220         (static var cprompt) Removed.
221         (static var dprompt) Removed.
222         (settings_done) Don't initialize prompt, cprompt, dprompt.
223         (get_prompt) Removed.
224         (set_prompt) Removed.
225         (get_dprompt) Removed.
226         (set_dprompt) Removed.
227         (get_cprompt) Removed.
228         (set_cprompt) Removed.
229
230         * pfm-read.c: (corrupt_msg) Don't show filename and line number,
231         to get rid of getl_location().
232
233         * sfm-read.c: (corrupt_msg) Ditto.
234
235         * getl.c: (struct getl_source) New.
236         (static var cur_source) New.
237         (static var last_source) New.
238         (static var DO_REPEAT_level) Removed.
239         (global var getl_head) Removed.
240         (global var getl_tail) Removed.
241         (getl_initialize) Call init_prompts().
242         (getl_add_file) Removed.
243         (getl_include) Removed.
244         (getl_add_DO_REPEAT_file) Removed.
245         (getl_handle_line_buffer) Removed.
246         (getl_close_file) Removed.
247         (getl_close_all) Removed.
248         (getl_is_separate) Removed.
249         (getl_set_separate) Removed.
250         (getl_reading_script) Removed.
251         (append_source) New function.
252         (include_source) New function.
253         (create_source) New function.
254         (create_syntax_file_source) New function.
255         (create_filter_source) New function.
256         (create_function_source) New function.
257         (create_interactive_source) New function.
258         (getl_append_syntax_file) New function.
259         (getl_include_syntax_file) New function.
260         (getl_include_filter) New function.
261         (getl_include_function) New function.
262         (getl_append_interactive) New function.
263         (getl_abort_noninteractive) New function.
264         (getl_is_interactive) New function.
265         (close_source) New function.
266         (getl_location) Use new `cur_source' var.
267         (getl_uninitialize) Use close_source().  Call uninit_prompts().
268         (read_syntax_file) New function.
269         (read_line_from_source) New function.
270         (do_read_line) New function.
271         (getl_read_line) Rewrite.
272         (static var prompts) New.
273         (static var current_style) New.
274         (init_prompts) New function.
275         (uninit_prompts) New function.
276         (getl_get_prompt) New function.
277         (getl_set_prompt) New function.
278         (getl_set_prompt_style) New function.
279         (get_prompt) New function.
280
281         * command.c: Merge the EXIT (aka Q, aka QUIT) and FINISH commands,
282         and make EXIT undocumented.  EXIT was a PSPP extension that never
283         really entirely made sense.
284         (cmd_exit) Removed.
285         (cmd_finish) Return CMD_EOF unconditionally.
286         (cmd_clear_transformations) Drop requirement of interactivity.
287
288         * command.def: Merge the EXIT (aka Q, aka QUIT) and FINISH
289         commands.
290
291         * repeat.c: Major changes to match getl revision.
292         (struct line_list) New struct.
293         (enum repeat_entry_type) New.
294         (struct repeat_entry) Made `type' an enum repeat_entry_type.
295         (struct repeat_block) New.
296         (static var repeat_tab) Removed.
297         (static var count) Removed.
298         (static var line_buf_head) Removed.
299         (static var line_buf_tail) Removed.
300         (cmd_do_repeat) Rewritten.
301         (clean_up) Removed.
302         (append_record) Removed.
303         (recognize_keyword) New function.
304         (internal_cmd_do_repeat) Removed.
305         (parse_specification) New function.
306         (skip_indentor) New function.
307         (recognize_do_repeat) New function.
308         (recognize_end_repeat) New function.
309         (parse_lines) New function.
310         (create_vars) New function.
311         (parse_ids) Use enum repeat_entry_type.
312         (parse_strings) Ditto.
313         (find_DO_REPEAT_substitution) Renamed find_substitution(),
314         rewrote.
315         (perform_DO_REPEAT_substitutions) Renamed do_repeat_filter(),
316         rewrote.
317         (do_repeat_read) New function.
318         (do_repeat_close) New function.
319
320         * data-list.c: Don't need to keep track of eof from getl anymore,
321         because getl can tell us now.
322         (struct data_list_pgm) Removed `eof' member.
323         (cmd_data_list) Don't assign to `eof'.
324         (get_data_list_read_func) Renamed read_from_data_list(), changed
325         interface.
326         (read_from_data_list_fixed) Changed interface.
327         (read_from_data_list_free) Changed interface.
328         (read_from_data_list_list) Changed interface.
329         (data_list_trns_proc) Rewrote based on dfm_eof() and
330         dfm_reader_error().
331         (data_list_source_read) Check for dfm reader errors.
332
333         * dfm-read.c: (enum dfm_reader_flags) Removed DFM_EOF in favor of
334         new `eof_cnt' member in struct dfm_reader.
335         (struct dfm_reader) New `eof_cnt' member.
336         (dfm_close_reader) Check `eof_cnt', not DFM_EOF.
337         (dfm_open_reader) Initialize `eof_cnt'.
338         (read_inline_record) Set prompt style with
339         getl_set_prompt_style().  
340         (read_record) Rewrite.
341         (cmd_begin_data) Set prompt style with getl_set_prompt_style().
342
343         * include.c: (cmd_include) Use getl_include_syntax_file().
344
345         * set.q: (cmd_set) Use getl_set_prompt().
346
347         * html.c: (postopen) Remove "source-file" expansion variable, to
348         avoid use of getl_location().
349
350         * postscript.c: (postopen) Remove "source-file" expansion
351         variable, to avoid use of getl_location().
352
353         * cmdline.c: (parse_command_line) Drop -c command line option,
354         because it wasn't very useful.  -i command line option now calls
355         getl_append_interactive().  Use new getl function interfaces.
356         Drop support for clearing dictionary between syntax files and thus
357         the "+" command line syntax.
358         (static var pre_syntax_message) Remove description of now-gone -c
359         option.  Remove "+" command line syntax.
360
361         * main.c: (main) Only call handle_error() if the return value is
362         an error.
363         (execute_command) Use getl_set_prompt_style().  Drop support for
364         clearing dictionary between syntax files.
365         (handle_error) Handle CMD_CASCADING_FAILURE.  Don't call err_break().
366
367         * readln.c: Drop lots of #ifdefs.  Now that the Autoconf tests are
368         pickier, we can just use HAVE_READLINE.
369         (static var welcomed) Move into welcome().
370         (welcome) Make `welcomed' a local static var.  Check for and read
371         history file here.
372         (global var getl_mode) Removed.
373         (global var getl_interactive) Removed.
374         (global var getl_prompt) Removed.
375         (getl_read_line) removed.
376         (readln_read) New function.
377         (read_console) Removed.
378         
379
380 Sat Feb 11 22:16:21 2006  Ben Pfaff  <blp@gnu.org>
381
382         Try to reduce some of the nastier dependencies on the error
383         module, and at the same time make PSPP nicer to deal with, by
384         getting rid of fatal errors.  All the existing calls to msg (FE,
385         ...) or err_cond_fail() or err_failure() have been replaced by
386         propagating an error upward to the command-dispatch layer.
387         Unfortunately this propagation took a fair bit of extra mechanism,
388         because now a lot of functions can fail that couldn't before.
389
390         New command return value CMD_CASCADING_FAILURE which indicates to
391         the command processor that syntax file processing should be
392         abandoned.  Many commands were modified to return
393         CMD_CASCADING_FAILURE.  When this modification was trivial it
394         isn't mentioned in detail below.
395
396         Transformation procedures (trns_proc_func) and free functions
397         (trns_free_func) now have a `bool' return type, which is normally
398         true, but false when an I/O or other serious error occurs.  All
399         transformation functions were modified to have this return type.
400         When this modification was trivial it isn't mentioned in detail
401         below.
402
403         * pspp-error.h: (FE) Removed this error class.
404
405         * error.c: (err_failure) Removed.
406         (err_cond_fail) Removed.
407         (err_break) Removed (it was unused).
408         (err_check_count) Don't cause a fatal error--instead, stop reading
409         the syntax file.
410         (err_vmsg) Don't have FE anymore, so no need to call terminate().
411
412         * any-reader.c: (any_reader_error) New function.
413
414         * any-writer.c: (any_writer_write) Propagate
415         scratch_writer_write_case()'s new return value.
416         (any_writer_error) New function.
417         (any_writer_close) Propagate underlying function's new return
418         value.
419
420         * casefile.c: Add an "error state" to a casefile.  A casefile that
421         encounters an I/O error enters the error state, and afterward
422         reading and writing cases fails.
423         (struct casefile) Add `ok' member.
424         (casefile_create) Set `ok' to true.
425         (casefile_destroy) Use io_error().
426         (casefile_error) New function.
427         (casefile_sleep) Now returns bool to indicate success.
428         (casefile_append) Ditto.
429         (casefile_append_xfer) Ditto.
430         (casefile_to_disk) Ditto.
431         (write_case_to_disk) Don't do anything in error state.
432         (flush_buffer) Don't do anything in error state.  Use io_error().
433         (reader_open_file) Ditto.
434         (fill_buffer) Ditto.
435         (casereader_read) Don't do anything in error state.  Handle
436         errors.
437         (casereader_read_xfer_assert) Removed, because now an I/O error
438         can occur even if the caller knows a case exists.
439         (io_error) New function.
440
441         * mkfile.c: (make_temp_file) Make failure non-fatal.
442         (make_unique_file_stream) Ditto.
443
444         * pfm-read.c: Add an error state.
445         (struct pfm_reader) Add `ok' member to indicate error state.
446         (error) Set `ok' to false.
447         (pfm_open_reader) Set `ok' to true.  Make failure non-fatal.
448         (pfm_read_case) Don't do anything in error state.
449         (pfm_read_error) New function.
450
451         * pfm-write.c: Postpone most error checking in favor of checking
452         ferror() afterward.
453         (pfm_open_writer) Make failure non-fatal.  Check for write error
454         after writing header.
455         (buf_write) Don't do anything if error has occurred.  Postpone
456         error checking.  Change return type to void.
457         (write_float) Postpone error checking.  Change return type to
458         void.
459         (write_int) Ditto.
460         (write_string) Ditto.
461         (write_header) Ditto.
462         (write_version_data) Ditto.
463         (write_format) Ditto.
464         (write_value) Ditto.
465         (write_variables) Ditto.
466         (write_value_labels) Ditto.
467         (pfm_write_case) Don't do anything if error has occurred.
468         (pfm_write_error) New function.
469         (pfm_close_writer) Change return type to bool.  Return false if an
470         I/O error occurred.
471
472         * scratch-reader.c: (scratch_reader_error) New function.
473
474         * scratch-writer.c: (scratch_writer_write_case) Change return type
475         to bool.  Propagate casefile error return.
476         (scratch_writer_error) New function.
477         (scratch_writer_close) Change return type to bool.  Propagate
478         casefile error return.
479
480         * sfm-read.c: Add an error state.
481         (struct sfm_reader) Add `ok' member.
482         (sfm_open_reader) Initialize `ok'.  Make errors non-fatal.
483         (buf_read) Set `ok' to false on error.
484         (buffer_input) Do nothing in error state.  Set `ok' to false on
485         error.
486         (read_compressed_data) Set `ok' false on error.
487         (sfm_read_case) Return false in error state.
488         (fread_ok) Set `ok' false on error.
489         (sfm_read_error) New function.
490
491         * sfm-write.c: Postpone most error checking in favor of checking
492         ferror() afterward.
493         (sfm_open_writer) Make failure non-fatal.  Check for write error
494         after writing header.
495         (write_header) Postpone error checking.  Change return type to
496         void.
497         (write_variable) Ditto.
498         (write_value_labels) Ditto.
499         (write_documents) Ditto.
500         (write_variable_display_parameters) Ditto.
501         (write_longvar_table) Ditto.
502         (write_rec_7_34) Ditto.
503         (buf_write) Ditto.
504         (ensure_buf_space) Ditto.
505         (sfm_write_case) Do nothing if write error has occurred.
506         (sfm_write_error) New function.
507         (pfm_close_writer) Change return type to bool.  Return false if an
508         I/O error occurred.
509
510         * var.h: Introduced a new return value for trns_proc_func that
511         means "a serious error has occurred, so abort the procedure
512         entirely".  Because the hard-coded values of -1, -2, etc. were
513         becoming even a worse idea now, also introduced some macros for
514         them: TRNS_CONTINUE, TRNS_DROP_CASE, TRNS_ERROR, TRNS_NEXT_CASE,
515         TRNS_END_FILE.  Also replaced all references to the hard-coded
516         values by uses of the macros.
517         
518         * command.h: New command return value CMD_CASCADING_FAILURE which
519         indicates to the command processor that syntax file processing
520         should be abandoned.
521
522         * dfm-read.c: (dfm_open_reader) Make failure non-fatal.
523         (dfm_reader_error) New function.
524         (read_inline_record) Make unexpected end of file nonfatal.
525         (read_file_record) Make read error nonfatal.
526         (dfm_eof) Make second unexpected end of file nonfatal.
527         (cmd_begin_data) Make errors nonfatal.  
528         
529         * dfm-write.c: (dfm_open_writer) Make failure non-fatal.
530         (dfm_write_error) New function.
531         (dfm_put_record) Do nothing in error state.  Now return error
532         state.
533         (dfm_close_reader) Now return `bool' indicating error state.
534
535         * file-type.c: (file_type_source_read) Now return `bool'
536         indicating error state.
537
538         * get.c: (case_reader_source_read) Now return `bool' indicating
539         write error.
540         (case_writer_destroy) Ditto.
541         (case_writer_write_case) Ditto.
542         (struct mtf_proc) New member `ok' indicating error state.
543         (cmd_match_files) Initialize and deal with `ok'.
544         (mtf_processing_finish) Now return `bool' indicating I/O error.
545         (mtf_free_file) Renamed mtf_close_file().  Now return `bool'
546         indicating I/O error.
547         (mtf_free) Now return `bool' indicating I/O error.
548         (mtf_delete_file_in_place) Ditto.
549         (mtf_read_nonactive_records) Ditto.
550         (mtf_processing) Ditto.
551
552         * inpt-pgm.c: (input_program_source_read) Now return `bool'
553         indicating I/O error.  Handle new TRNS_ERROR transformation return
554         value.
555
556         * matrix-data.c: Introduce error state.
557         (cmd_matrix_data) Check error return values.
558         (read_matrices_without_rowtype) Now return `bool' indicating I/O
559         error.
560         (matrix_data_read_without_rowtype) Ditto.
561         (dump_cell_content) Ditto.
562         (nr_output_data) Ditto.
563         (read_matrices_with_rowtype) Ditto.
564         (matrix_data_read_with_rowtype) Ditto.
565         (wr_output_data) Ditto.
566
567         * lexer.c: (lex_init) Make unexpected eof non-fatal.
568         (lex_get) Ditto.
569         (lex_look_ahead) Ditto.
570         (unexpected_eof) Removed.
571         (convert_numeric_string_to_char_string) Make unexpected eof
572         non-fatal.
573         (parse_string) Ditto.
574
575         * flip.c: Make I/O errors non-fatal.
576         (struct flip_pgm) Add `pool', `output_buf' members.
577         (cmd_flip) Create and use pool.  Propagate errors.
578         (destroy_flip_pgm) Rewrite, using pool.
579         (struct flip_sink_info) Removed.
580         (flip_sink_create) Use pool.  Make errors non-fatal.
581         (flip_sink_write) Make errors non-fatal.
582         (flip_file) Make errors non-fatal.  Make `bool' return type to
583         indicate failure.
584         (flip_sink_destroy) Remove.
585         (static var flip_sink_class) Use NULL as destroy func, not
586         flip_sink_destroy().
587
588         * sort.c: Make I/O errors non-fatal.  Propagate errors.
589         (sort_active_file_in_place) Propagate errors.
590         (sort_active_file_to_casefile) Ditto.
591         (do_internal_sort) Ditto.
592         (do_external_sort) Ditto.
593         (write_runs) Ditto.
594         (destroy_initial_run_state) Propagate errors via new `bool' return
595         type.
596         (merge) Propagate errors.
597         (merge_once) Ditto.
598
599         * output.c: [GLOBAL_DEBUGGING] Remove reentrancy detection,
600         because it used msg (FE, ...) and wasn't very useful.
601
602         * main.c: (handle_error) Handle CMD_CASCADING_FAILURE.
603
604         * vfm.c: (struct write_case_data) Change `proc_func' return type
605         to bool.
606         (procedure) Add `bool' return type to indicate I/O error.
607         Propagate errors.
608         (internal_procedure) Ditto.
609         (write_case) Ditto.
610         (execute_transformations) If a transformation returns TRNS_ERROR,
611         propagate the error.
612         (close_active_file) Add `bool' return type to indicate I/O error.
613         Propagate errors.
614         (cancel_transformations) Add `bool' return type to indicate I/O
615         error.  Propagate errors.
616         (struct split_aux_data) Change `proc_func' return type to bool.
617         (procedure_with_splits) Change `proc_func' return type to bool.
618         Add `bool' return type to indicate I/O error.
619         (multipass_procedure_with_splits) Change `split_func' return type
620         to bool.  Add `bool' return type to indicate I/O error.
621         (multipass_split_callback) Add `bool' return type to indicate I/O
622         error.  Propagate errors.
623
624         * vfm.h: (struct case_source_class) Change `read' return type from
625         void to bool to allow reporting I/O errors.  Updated all
626         implementations to do so.
627         (struct case_sink_class) Change `write' return type from void to
628         bool to allow reporting I/O errors.  Updated all implementations
629         to do so.
630
631 Sun Feb 12 18:12:56 2006  Ben Pfaff  <blp@gnu.org>
632
633         * pool.c: Useful new functions.
634         (pool_tmpfile) New function.
635         (pool_attach_file) New function.
636         (pool_detach_file) New function.
637         (pool_fopen) Reimplement in terms of pool_attach_file().
638         (pool_fclose) Reimplement in terms of pool_detach_file().  Fix
639         double-free.
640
641         * str.c: Useful new functions.
642         (ds_swap) New function.
643         (ds_rtrim_spaces) New function.
644         (ds_chomp) New function.
645         (ds_is_empty) New function.
646         (ds_first) New function.
647         (ds_last) New function.
648
649 Sat Feb 11 21:51:21 2006  Ben Pfaff  <blp@gnu.org>
650
651         Get rid of finished, start_interactive globals.
652
653         * command.c: (cmd_exit) Instead of setting `finished', return
654         CMD_EOF.
655         (cmd_finish) Ditto.
656
657         * command.h: New enum CMD_EOF.
658
659         * main.c: (global var finished) Removed.
660         (global var start_interactive) Removed.
661         (main) Execute commands until CMD_EOF is the return value.
662         If parse_command_line() returns false, don't execute any commands
663         at all.
664
665         * cmdline.c: (parse_command_line) If the command line indicates we
666         shouldn't execute syntax files, return false instead of
667         terminating.
668         (usage) Don't terminate.
669
670 Sat Feb 11 21:48:31 2006  Ben Pfaff  <blp@gnu.org>
671
672         Get rid of cur_proc global.  Replace by functions in err and tab
673         modules, which were the users.
674
675         * error.c: (static var command_name) New static var.
676         (err_vmsg) Use command_name.
677         (err_set_command_name) New function.
678
679         * tab.c: (static var command_name) New static var.
680         (tabi_title) Use command_name.
681         (tab_set_command_name) New function.
682
683         * command.c: (global var cur_proc) Removed.
684         (cmd_parse) Call err_set_command_name(), tab_set_command_name()
685         around executing command to set and clear command name.
686
687 Sat Feb 11 21:44:50 2006  Ben Pfaff  <blp@gnu.org>
688
689         Get rid of glob.c, glob.h.
690
691         * Makefile.am: (pspp_SOURCES) Remove glob.c, glob.h.
692         
693         * dictionary.c: Move default_dict definition here.
694
695         * glob.c: Removed.
696         (global var FILTER_before_TEMPORARY) Variable removed.  All
697         references deleted.  The info in this var was redundant with
698         temp_dict, so they were changed to use temp_dict where needed.
699
700         * glob.h: Removed.
701
702         * start-date.c: New file. Moved get_start_date() here.
703
704         * start-date.h: New file.
705
706 Fri Feb  3 20:34:52 2006  Ben Pfaff  <blp@gnu.org>
707  
708         * font.h: (struct font_set) Removed, because unused.
709  
710 Sat Jan 28 17:45:36 2006  Ben Pfaff  <blp@gnu.org>
711
712         Cleaner (faster?) way to compact cases.
713
714         * dictionary.c: (dict_compact_case) Removed.
715         (dict_needs_compaction) New function.
716         (struct copy_map) New structure.
717         (struct dict_compactor) New structure.
718         (dict_make_compactor) New function.
719         (dict_compactor_compact) New function.
720         (dict_compactor_destroy) New function.
721         
722 Sat Jan 28 17:24:22 2006  Ben Pfaff  <blp@gnu.org>
723
724         Cleanups.
725
726         * data-list.c: Make data_list_source_class static.
727         (dump_fixed_table) Use fh_get_name() to describe source of data.
728         (dump_free_table) Ditto.
729         (cmd_repeating_data) Eliminate special cases for inline file.
730
731         * dictionary.c: (dict_contains_var) Change return value from int to
732         bool.
733         (dict_rename_vars) Ditto.
734         (dict_create_vector) Ditto.
735
736 Sat Jan 28 17:20:50 2006  Ben Pfaff  <blp@gnu.org>
737
738         Add scratch file handles.
739
740         Now a file handle can refer to a disk file, to an in-memory
741         structure, or to the "inline" file, instead of just to a disk
742         file.  The introduction of new categories means that special cases
743         for the inline file in a few places could be eliminated, but it
744         also means that code that assumed that a handle refers to a file
745         has to check for that.
746
747         Also, now file handles can be freed, so code now must be sure not
748         to access a handle after closing it (with fh_close()).
749
750         * Makefile.am: Add any-reader.c, any-reader.h, any-writer.c,
751         any-writer.h, scratch-handle.c, scratch-handle.h,
752         scratch-reader.c, scratch-reader.h, scratch-writer.c,
753         scratch-writer.h to pspp_SOURCES.
754
755         * any-reader.c: New file.
756         
757         * any-reader.h: New file.
758         
759         * any-writer.c: New file.
760         
761         * any-writer.h: New file.
762
763         * scratch-handle.c: New file.
764         
765         * scratch-handle.h: New file.
766
767         * scratch-reader.c: New file.
768         
769         * scratch-reader.h: New file.
770
771         * scratch-writer.c: New file.
772         
773         * scratch-writer.h: New file.
774
775         * aggregate.c: Use an any_writer instead of an sfm_writer, to add
776         flexibility.
777
778         * apply-dict.c: Use an any_reader instead of an sfm_reader, to add
779         flexibility.
780
781         * command.def: Add CLOSE FILE HANDLE command.
782
783         * dfm-reader.c: Now fewer special cases for inline file.
784         (static var inline_open_cnt) Removed.
785         (static var inline_file) Removed.
786         (dfm_close_reader) Eliminate a special case for inline file.
787         Reorganize to avoid access-after-free.
788         (dfm_open_reader) Eliminate a special case for inline file.
789         (read_inline_record) Use bool instead of int.  No need to
790         increment line number.
791         (read_file_record) Use bool instead of int.
792         (read_record) Check whether file handle is inline file, instead of
793         for null pointer.
794         (dfm_eof) Ditto.
795         (dfm_expand_tabs) Ditto.
796         (dfm_push) Ditto.
797         (dfm_pop) Ditto.
798         (cmd_begin_data) Fix inaccurate check for whether the inline file
799         is in use--now we can tell by checking whether the inline file's
800         open count is positive.
801         
802         * file-handle-def.c: (struct file_handle) Reorder members.  Add
803         `deleted' member.  Add `referent' member.  Add `sh' member.
804         (static var default_handle) New variable.
805         (static var inline_file) New variable.
806         (fh_init) Initialize inline file.
807         (free_handle) New function.
808         (fh_done) Rewrite.
809         (fh_from_name) Don't return deleted handles.
810         (fh_from_filename) Ditto.
811         (fh_create) Removed.
812         (create_handle) New function.
813         (fh_create_file) New function.
814         (fh_create_scratch) New function.
815         (fh_inline_file) New function.
816         (fh_free) Rewrite.
817         (fh_open) Now requires a referent type mask and verifies it.  All
818         references updated.
819         (fh_close) If open_cnt goes to 0 on a deleted handle, free it.
820         (fh_is_open) New function.
821         (fh_get_referent) New function.
822         (fh_get_filename) Limit to handles that refer to files.
823         (fh_get_mode) Ditto.
824         (fh_get_record_width) Limit to handles that refer to files or the
825         inline file.
826         (fh_get_tab_width) Ditto.
827         (fh_get_scratch_handle) New function.
828         (fh_set_scratch_handle) New function.
829         (fh_get_default_handle) New function.
830         (fh_set_default_handle) New function.
831
832         * file-handle.h: (enum fh_referent) New type.
833         (enum fh_mode) Rename MODE_TEXT to FH_MODE_TEXT, MODE_BINARY to
834         FH_MODE_BINARY, and update all usages.
835
836         * file-handle.q: Add "scratch" as a possible mode.
837         (cmd_file_handle) Mention CLOSE FILE HANDLE in error message.
838         Use lex_end_of_command(), lex_sbc_missing().  Support creating
839         scratch handles.
840         (cmd_close_file_handle) New function.
841         (referent_name) New function.
842         (fh_parse) Now takes a referent type mask to specify handles that
843         can be accepted.  Updated all references.
844         
845         * filename.c: (fn_extension) New function.
846
847         * get.c: Use any_reader and any_writer and thereby merge code that
848         has been duplicated for each kind of file.  Also, we had something
849         here called `any_writer' before, so its name had to be changed to
850         `case_writer'.
851         (enum operation) Removed, because unused.
852         (struct get_pgm) Removed.
853         (get_pgm_free) Removed.
854         (get_source_destroy) Removed.
855         (get_source_read) Removed.
856         (global var get_source_class) Removed.
857         (static var case_reader_source_class) Removed.
858         (enum reader_command) New enum.
859         (struct case_reader_pgm) New struct.
860         (parse_read_command) New function.
861         (case_reader_pgm_free) New function.
862         (case_reader_source_destroy) New function.
863         (case_Reader_source_Read) New function.
864         (cmd_get) Rewrote as a call to parse_read_command().
865         (cmd_import) Ditto.
866         (struct any_writer) Rename to case_writer.  Drop `writer_type',
867         `writer' members in favor of an `any_writer' member named
868         `writer'.
869         (any_writer_destroy) Rename case_writer_destroy.  Use
870         any_writer_close().
871         (parse_write_command) Allow scratch files.  Use any_writer.
872         (any_writer_write_case) Rename case_writer_write_case().  Use
873         any_writer_write().
874 `       (struct mtf_file) Use any_reader.
875         (cmd_match_files) Allow scratch files.  Use any_reader.
876         (mtf_free_file) Use any_reader_close().
877         (mtf_read_nonactive_records) Use any_reader_read().
878         (mtf_processing) Use any_reader_read().
879         (struct import_pgm) Removed.
880         (import_pgm_free) Removed.
881         (import_source_destroy) Removed.
882         (import_source_read) Removed.
883         (global var import_source_class) Removed.
884
885         * glob.c: (global var default_handle) Removed.  Replaced all
886         references by fh_get_default_handle() or fh_set_default_handle().
887
888         * pfm-read.c: (static var portable_to_local) Moved from inside
889         read_header() to top level.
890         (pfm_detect) New function.
891
892         * pfm-write.c: (pfm_write_case) Make case argument const.
893         Reorganize to avoid access-after-free.
894
895         * print.c: (dump_table) Use fh_get_name() to describe source of
896         data.
897
898         * sfm-read.c: (sfm_close_reader) Reorganize to avoid
899         access-after-free.
900         (sfm_detect) New function.
901
902         * str.c: (str_lowercase) New function.
903
904         * vfm.c: Use new compaction interface.
905         (static var compaction_necessary) Removed.
906         (static var compactor) New variable.
907         (open_active_file) Initialize compactor.
908         (write_case) Use compactor.
909         (close_active_file) Free compactor.
910         
911 Wed Jan 11 19:28:39 2006  Ben Pfaff  <blp@gnu.org>
912
913         Clean up file handle code in preparation to add scratch file
914         handles.
915         
916         * file-handle-def.c: Lots of formatting cleanup.  Added function
917         comments.
918         (struct file_handle) Renamed `length' member
919         to `record_width'.  All references updated.
920         (fh_init) New function.  Moved here from file-handle.q.
921         (fh_done) New function.  Moved here from file-handle.q and
922         rewrote.
923         (get_handle_with_name) Renamed fh_from_name().
924         (get_handle_for_filename) Renamed fh_from_filename().
925         (create_file_handle) Renamed fh_create().  Changed to take a
926         `struct fh_properties' instead of discrete values.  Updated all
927         references.
928         (create_file_handle_with_defaults) Removed.  Updated all
929         references to use fh_create() with fh_default_properties().
930         (fh_default_properties) New function.
931         (destroy_file_handle) Removed.  The code is now in fh_done().
932         (handle_get_name) Renamed fh_get_name().
933         (handle_get_filename) Renamed fh_get_filename().
934         (handle_get_record_width) Renamed fh_get_record_width().
935         (handle_get_tab_width) Renamed fh_get_tab_width().
936
937         * file-handle-def.h: Formatting, comment fixes.
938         (enum file_handle_mode) Renamed struct fh_mode.
939         (struct fh_properties) New structure.
940         (fh_init) Move prototype here from file-handle.h.
941         (fh_done) Ditto.
942         (fh_close) Ditto.
943
944         * file-handle.q: (static var handle_list) Removed.
945         (fh_parse) Don't add handle to handle_list, because
946         file-handle-def.c has its own list.
947         (fh_init) Moved to file-handle-def.c.
948         (fh_done) Ditto.
949
950 Sun Jan 9 01:09  Jason Stover  <jason@sakla.net>
951
952         * regression.q: (run_regression) Moved coefficient initialization
953         to the linreg library. Altered other functions accordingly.
954
955 Sat Jan  7 13:30:54 WST 2006 John Darrington <john@darrington.wattle.id.au>
956
957         * command.c data-in.c main.c: Fixed bug which crept in when 
958           separating getl from readline.
959
960         * vars-atr.c value-labels.h: Fixed constness of  val_labs_count.
961
962 Fri Dec 23 20:59:01 WST 2005 John Darrington <john@darrington.wattle.id.au>
963
964         * getl.c error.c: Separated file_loc functionality from error.c
965
966 Mon Dec 19 14:01:56 WST 2005 John Darrington <john@darrington.wattle.id.au>
967
968         * format.c: Additional error checking.
969         * getl.[ch]: Separated into getl.c and readln.c
970         * settings.[ch]: Made CC_CNT public
971
972 Fri Dec 16 09:11:48 WST 2005 John Darrington <john@darrington.wattle.id.au>
973
974         * examine.q: Fixed buglet when cleaning up at end of procedure.
975
976 Tue Dec 13 22:34:42 2005  Ben Pfaff  <blp@gnu.org>
977
978         Move global initialization and cleanup code into main.c.
979         Remove vestigial log infrastructure.
980         Minor related cleanups.
981         
982         * command.c: (shell) When execl() fails, use _exit(), not
983         err_hcf().
984
985         * error.c: (err_hcf) Move into main.c, rename terminate().  All
986         callers updated.
987         (err_done) New function with just the error.c-specific code for
988         err_hcf().  Called by terminate().
989
990         * glob.c: Removed all Borland C, DJGPP cruft.
991         (init_glob) Merged into main().
992         (done_glob) Merged into terminate().
993         (get_date) Removed.
994         (get_start_date) New function.  All users of curdate updated to call
995         this function instead.
996
997         * lexer.c: (lex_init) Moved initialization of tokstr here, from
998         init_glob().
999         (lex_done) Moved destruction of tokstr here, from done_glob().
1000
1001         * main.c: (global var pgmname) Removed.  Changed all references to
1002         program_name, which is defined by gnulib.
1003         (global var curdate) Removed.
1004         (main) Moved init_glob() code here.  Merged parse_script() in
1005         here.
1006         (parse_script) Removed.
1007         (terminate) Moved err_hcf() here from error.c and renamed
1008         terminate().  Merged done_glob() code in here.  Call err_done().
1009         All callers updated.
1010         (i18n_init) New function.
1011         (fpu_init) New function.
1012
1013         * output.c: (outp_init) Make void.
1014         (init_default_drivers) New function.
1015         (outp_read_devices) If no drivers are initialized successfully,
1016         call init_default_drivers() to initialize a default driver.
1017         (outp_done) Make void.
1018         (static var prog) Make const.
1019         (parse_options) Make parameter const.
1020         (colon_tokenize) Make return value const.
1021         (configure_driver) Change prototype to take a broken-down driver
1022         configuration instead of a line of text.
1023         (configure_driver_line) New function that does what
1024         configure_driver() did before.
1025
1026         * q2c.c: (global var pgmname) Rename program_name.
1027
1028         * settings.c: (settings_init) Renamed from init_settings().
1029         (settings_done) Renamed from done_settings().
1030
1031         * vfm.c: (global var last_vfm_invocation) Make static.
1032         (vfm_last_invocation) New function.  All references to
1033         last_vfm_invocation update to call this.
1034         (procedure) Call update_last_vfm_invocation().
1035         (internal_procedure) Ditto.
1036         (update_last_vfm_invocation) New function.
1037         
1038 Sat Dec 10 23:30:19 2005  Ben Pfaff  <blp@gnu.org>
1039
1040         Separate random numbers from other settings because of GSL
1041         dependency.
1042
1043         * Makefile.am: Add random.c, random.h to sources.
1044
1045         * glob.c: (init_glob) Call random_init().
1046         (done_glob) Call random_done().
1047
1048         * settings.c: (static var rng) Move to random.c.
1049         (done_settings) Move freeing of RNG to random_done().
1050         (get_rng) Move to random.c
1051         (set_rng) Ditto.
1052
1053         * random.c: New file.
1054
1055         * random.h: New file.
1056
1057 Sat Dec 10 18:13:36 2005  Ben Pfaff  <blp@gnu.org>
1058
1059         Separate settings and the SET command, for modularity.
1060         
1061         * Makefile.am: Add settings.c to sources.
1062
1063         * glob.c: (global variable test_mode) Removed.
1064
1065         * set.q: Remove all the set_* variables.  Remove a lot of obsolete
1066         SPSS/PC+ settings.  Remove the aux_*() routines.  Moved the
1067         get_*() functions into settings.c.  Rewrite the settings code and
1068         functions to call the new set_*() functions.  Rewrite custom
1069         currency parsing.  Write new by-hand cmd_show().
1070
1071         * esttings.c: New file.  Moved the get_*() functions here from
1072         set.q.  Created new set_*() functions to correspond with them.
1073         Regularized the names and types of some functions and updated
1074         their callers.  Added static, file-scope variables to support the
1075         settings.
1076
1077         * q2c.c: Remove "aux" support, which was only needed by set.q.
1078         
1079 Sun Nov 27 06:43:46 WST 2005 John Darrington <john@darington.wattle.id.au>
1080
1081         * data-out.c format.h: Added return value to data_out function.
1082
1083         * value-labels.c: Fixed bug in val_labs_remove.
1084
1085 Sat Nov  5 18:37:26 2005  Ben Pfaff  <blp@gnu.org>
1086
1087         * Makefile.am: Remove devind.c, devind.h from list of source
1088         files.
1089
1090         * devind.c: Removed.
1091
1092         * devind.h: Removed.
1093
1094         * list.q: Removed "support" for devind.
1095
1096         * output.c: Don't add devind class.
1097
1098 Sat Nov  5 18:21:00 2005  Ben Pfaff  <blp@gnu.org>
1099
1100         * var.h: (struct variable) Make `init', `reinit' bool values.
1101         Rearrange fields.
1102
1103 Fri Nov  4 19:43:01 2005  Ben Pfaff  <blp@gnu.org>
1104
1105         * recode.c: Rewrote whole file, as clean-up.
1106
1107 Fri Nov  4 19:37:50 2005  Ben Pfaff  <blp@gnu.org>
1108
1109         * pool.c: Don't make alignment exception for x86.
1110         (pool_alloc) Return null for 0-size blocks.
1111         (pool_alloc_unaligned) New function.
1112         (pool_strndup) Removed.  Changed callers to use pool_clone_unaligned().
1113         (pool_clone_unaligned) New function.
1114         (pool_strdup) Use pool_clone_unaligned().
1115
1116         * var.h: (enum var_type) Give the NUMERIC, ALPHA enum this name.
1117         (struct variable) Use `enum var_type' for `type'.
1118
1119         * vars-atr.c: (var_type_adj) New function.
1120         (var_type_noun) New function.
1121
1122         * vars-prs: (parse_mixed_vars) Fix freeing code.
1123         (parse_mixed_vars_pool) New function.
1124
1125 Wed Nov  2 21:24:48 2005  Ben Pfaff  <blp@gnu.org>
1126
1127         * file-handle-def.c: Needed another #include, to avoid missing
1128         prototype warning.
1129
1130         * file-handle.q: (cmd_file_handle) Declarations must precede
1131         statements.  Free parse data on success as well as on failure, to
1132         avoid memory leak.
1133
1134         * get.c: (parse_write_command) Destroy dict on success, to avoid
1135         memory leak.
1136         
1137         * data-list.c: (cmd_repeating_data) Fix usage of saw_occurs,
1138         saw_length, saw_continued, saw_id, which were boolean but
1139         incorrectly treated as bitmaps as result of a previous
1140         half-finished cleanup.
1141
1142         * weight.c: (struct weight_trns) Unused, so removed.
1143
1144         * Makefile.am: Add range-prs.h to sources.
1145
1146 Wed Nov  2 21:24:15 2005  Ben Pfaff  <blp@gnu.org>
1147
1148         DO IF, LOOP cleanup.
1149
1150         * Makefile.am: Add ctl-stack.c, ctl-stack.h to source files.
1151         Reformat source file list to list one file per file, so that
1152         patches for future changes will be easier to read.
1153
1154         * ctl-stack.c, ctl-stack.h: New files.
1155
1156         * do-if.c: Rewrote whole file.
1157
1158         * do-ifP.h: Removed.
1159
1160         * loop.c: Rewrote whole file.
1161
1162         * glob.c: (global var ctl_stack) Move into ctl-stack.c.
1163
1164         * temporary.c: (cmd_temporary) Use ctl_stack_is_empty().
1165
1166         * vfm.c: (open_active_file) Use ctl_stack_clear().
1167
1168 Wed Nov  2 21:18:13 2005  Ben Pfaff  <blp@gnu.org>
1169
1170         New pool functions.
1171         
1172         * pool.c: (pool_create_at_offset) New function.
1173         (pool_add_subpool) New function.
1174
1175         * pool.h: (pool_create_container) New macro.
1176         
1177         * expressions/parse.c: (expr_parse_pool) New function.
1178         
1179         * autorecode.c: (recode) Use pool_create_container().
1180
1181         * count.c: (cmd_count) Ditto.
1182
1183 Wed Nov  2 19:59:32 2005  Ben Pfaff  <blp@gnu.org>
1184
1185         Clean up transformations, by getting rid of `struct trns_header',
1186         replacing it by `struct transformation' that has a void *
1187         `private' member.  Updated all uses of transformations to match,
1188         which was a lot of code.  Only major related changes listed below.
1189
1190         * compute.c: (cmd_if) Use get_proc_func().
1191         (cmd_compute) Use get_proc_func().
1192         (get_proc_func) New function.
1193
1194         * glob.c: (global var m_trns) Change type to size_t.
1195         (global var n_trns) Ditto.
1196         (global var f_trns) Ditto.
1197         (global var t_trns) Change type to struct transformation *.
1198
1199         * var.h: (struct trns_header) Removed.
1200         (struct transformation) New.
1201         (typedef trns_proc_func) Takes a void * instead of a struct
1202         trns_header *.
1203         (typedef trns_free_func) Ditto.
1204
1205         * vfm.c: (execute_transformations) Takes an array of
1206         transformations instead of trns_headers.
1207         (add_transformation) Change prototype from (trns_header *) to
1208         (trns_proc_func *, trns_free_func *, void *).
1209         (next_transformation) New function.
1210
1211 Sat Oct 29 16:25:36 2005  Ben Pfaff  <blp@gnu.org>
1212
1213         * count.c: Major cleanups.  Rename practically everything.
1214         Rewrite much of the code.  Use pools for memory management.  Use
1215         the new parse_num_range().
1216
1217         * mis-val.c: (cmd_missing_values) Use the new parse_num_range().
1218         (parse_number) Removed.
1219
1220         * missing-values.c: (mv_add_num_range) Don't add out-of-order
1221         ranges, e.g. where low > high.
1222
1223         * pool.c: (pool_2nrealloc) New function.
1224
1225         * range-prs.c: New file.
1226         (parse_num_range) New function.
1227         (parse_number) New function.
1228         
1229 Fri Oct 28 22:47:48 2005  Ben Pfaff  <blp@gnu.org>
1230
1231         Fix up potential overflows in size calculations by replacing
1232         instances of pool_alloc(p, x * sizeof *y) by pool_malloc(p, x,
1233         sizeof *y) everywhere I could find them.  Similarly by
1234         pool_malloc(), pool_realloc().
1235         (Order is important: pool_alloc(p, sizeof *y, x) will divide by 0
1236         if x is 0.)
1237
1238         * pool.c: (pool_nalloc) New function.
1239         (pool_nmalloc) New function.
1240         (pool_nrealloc) New function.
1241
1242 Thu Oct 27 11:16:53 WST 2005 John Darrington <john@darrington.wattle.id.au>
1243
1244         Separated the definition of a file handle object from the stuff 
1245         pertaining to the FILE HANDLE command.
1246
1247         * file-handle-def.[ch]: New files.
1248
1249         * dfm-read.c file-handle.h file-handle.q
1250         
1251 Tue Oct 25 21:56:23 2005  Ben Pfaff  <blp@gnu.org>
1252
1253         Fix up potential overflows in size calculations by replacing
1254         instances of xmalloc(x * sizeof *y) by xnmalloc(x, sizeof *y)
1255         everywhere I could find them.  Similarly by xrealloc(), malloc().
1256         (Order is important: xnmalloc(sizeof *y, x) will divide by 0 if x
1257         is 0.)
1258
1259         * alloc.c: (nmalloc) New function.
1260         (out_of_memory) Removed.  Replaced references by xalloc_die().
1261
1262         * sort.c: (allocate_cases) Fix segfault if memory allocation
1263         fails.
1264
1265         * subclist.c: (subc_list_double_create) Use xnmalloc() instead of
1266         malloc().
1267         (subc_list_double_push) Use xnrealloc() instead of realloc().
1268
1269 Wed Oct 26 08:43:51 WST 2005 John Darrington <john@darrington.wattle.id.au>
1270
1271         Dictionary abstraction part #2
1272
1273         * algorithm.c format.c str.c sysfile-info.c val.h var.h vars-atr.c:
1274           Removed unnecessary #include directives
1275
1276 Mon Oct 24 21:35:08 2005  Ben Pfaff  <blp@gnu.org>
1277
1278         * groff-font.c (font_msg): Use err_vmsg() instead of incorrectly
1279         trying to pass a va_list to tmsg().  Thanks to Jason Stover for
1280         reporting this bug.
1281
1282 Mon Oct 24 21:24:15 2005  Ben Pfaff  <blp@gnu.org>
1283
1284         Work to get rid of GCC 4.0 warnings, part 2.
1285
1286         In many files, change `unsigned char' to `char'.  This often
1287         requires adding casts to <ctype.h> functions.
1288
1289         * data-in.c: (parse_A) Use buf_copy_rpad().
1290
1291         * str.c: (str_copy_buf_trunc) New function.
1292
1293         * value-labels.c: (value_to_string) Fix mistaken use of strncpy(),
1294         by rewriting.
1295
1296 Mon Oct 24 13:42:32 WST 2005 John Darrington <john@darrington.wattle.id.au>
1297
1298         Moved some definitions to make it easier to abstract a dictionary 
1299         from the rest of PSPP.
1300
1301         * format-prs.c lex-def.[ch]:  New files.
1302
1303         * Makefile.am lexer.[ch] dictionary.c vars-atr.c vfm.c algorithm.c 
1304           format.c:  Moved some functions between modules.
1305         
1306 Sun Oct 23 19:28:08 2005  Ben Pfaff  <blp@gnu.org>
1307
1308         Work to get rid of GCC 4.0 warnings, part 1.
1309         
1310         In many files, change count parameters to parse_variables(),
1311         etc. from `int' to `size_t'.  Also change related variables and
1312         struct members.  Also change messages as needed (e.g. %d to %u
1313         with cast to unsigned).  Also change arithmetic as necessary
1314         (e.g. n >= m - 1 to n + 1 >= m). 
1315
1316         * crosstabs.q: (crs_custom_tables) Check for size_t overflow in
1317         multiplication.
1318
1319         * q2c.c: (dump_declarations) Generate code for size_t instead of
1320         int.
1321         
1322 Thu Oct 20 18:18:40 2005  Ben Pfaff  <blp@gnu.org>
1323
1324         * output.c: (outp_read_devices) Fix message.
1325
1326 Sat Sep 17 11:13:13 2005  Ben Pfaff  <blp@gnu.org>
1327
1328         * matrix-data.c: (cmd_matrix_data) Change type of variable whose
1329         address is passed to dict_get_vars() from size_t to int to match
1330         John's change below.
1331
1332         * modify-vars.c: (validate_var_modification) Ditto.
1333
1334 Mon Sep 12 19:26:06 WST 2005 John Darrington <john@darrington.wattle.id.au>
1335
1336         * dictionary.[ch]  Changed cnt from size_t* to int* since that's
1337         what it's called as, and on  x86_64 machines they're different sizes.
1338         
1339         * str.c: (ds_vprintf) Copied va_list args so they can be re-used
1340         
1341 Sun Aug 21 00:12:24 2005  Ben Pfaff  <blp@gnu.org>
1342
1343         * lexer.c: (lex_sbc_only_once) New function.
1344         (lex_sbc_missing) New function.
1345
1346 Sun Aug 21 00:00:47 2005  Ben Pfaff  <blp@gnu.org>
1347
1348         * case.h: (case_str) Make it return `unsigned char'.
1349
1350 Sat Aug 20 23:56:14 2005  Ben Pfaff  <blp@gnu.org>
1351
1352         Revamp SAVE, XSAVE, EXPORT.  Add (or at least parse) all the
1353         subcommands that we didn't support.  Fix bug 13911.  Fix bug
1354         reported by Adam Pierson (COMPRESSED and other subcommands didn't
1355         work on SAVE).  Refactor all related code.
1356         
1357         * command.def: Add XEXPORT command.
1358
1359         * dictionary.c: (dict_delete_scratch_vars) New function.
1360
1361         * get.c: (cmd_get) Fix parsing.
1362         (struct save_trns) Removed.
1363         (cmd_save_internal) Removed.
1364         (cmd_save) Removed.
1365         (do_write_case) Removed.
1366         (save_write_case_func) Removed.
1367         (save_trns_proc) Removed.
1368         (save_trns_free) Removed.
1369         (trim_dictionary) Removed.
1370         (struct export_proc) Removed.
1371         (cmd_export) Rewrote.
1372         (export_write_case_func) Removed.
1373         (export_proc_free) Removed.
1374         (enum writer_type) New enum.
1375         (enum command_type) New enum.
1376         (struct any_writer) New struct.
1377         (any_writer_destroy) New function.
1378         (parse_write_command) New function.
1379         (any_writer_write_case) New function.
1380         (parse_output_proc) New function.
1381         (output_proc) New function.
1382         (cmd_save) Rewrote.
1383         (cmd_xsave) Rewrote.
1384         (struct output_trns) New struct.
1385         (parse_output_trns) New function.
1386         (output_trns_proc) New function.
1387         (output_trns_free) New function.
1388         (cmd_xsave) Rewrote.
1389         (cmd_xexport) New function.
1390         (parse_dict_trim) New function.
1391         (struct mtf_proc) Change `by_cnt' member type to `int'.
1392         (cmd_import) Rewrote.
1393
1394         * pfm-write.c: (struct pfm_writer) Add `digits' member.
1395         (pfm_writer_default_options) New function.
1396         (pfm_open_writer) Add `opts' argument and handle options.
1397         (write_float) Write only as many digits as `digits' member says.
1398         (format_trig_double) Limit base-10 precision to LDBL_DIG.
1399
1400         * pfm-write.h: (enum pfm_type) Moved here from pfm-read.h.
1401         (struct pfm_write_options) New struct.
1402
1403         * sfm-write.c: (sfm_writer_default_options) New function.
1404         (sfm_open_writer) Remove `compress', `omit_long_names' args.  Add
1405         `opts' argument.  Implement options.
1406
1407         * sfm-write.h: (struct sfm_write_options) New struct.
1408
1409         * expressions/helpers.c: (copy_string) Make `old' arg `unsigned
1410         char *' instead of `char *'.
1411         
1412 Sat Aug  6 21:29:15 2005  Ben Pfaff  <blp@gnu.org>
1413
1414         * factor_stats.c: Needed <config.h> included earlier.
1415
1416         * percentiles.c: Needed to include <config.h>.
1417
1418         * val.h: Don't include "config.h".
1419
1420 Sat Aug  6 21:26:27 2005  Ben Pfaff  <blp@gnu.org>
1421
1422         Clean up treatment of missing values by moving all the code into
1423         one place.  All references to the missing value function were
1424         updated, but only major changes are detailed below.
1425
1426         * Makefile.am: Add missing-values.c, missing-values.h to sources.
1427
1428         * apply-dict.c: (cmd_apply_dictionary) Use mv_resize().
1429
1430         * dictionary.c: (dict_create_var) Initialize `miss' member with
1431         mv_init().
1432         (dict_clone_var) Copy `miss' member with mv_copy().
1433         
1434         * get.c: (mtf_merge_dictionary) Use mv_copy().
1435
1436         * missing-values.c: New file.
1437         
1438         * missing-values.h: New file.
1439
1440         * mis-val.c: Rewrite.  New version implements updated semantics.
1441
1442         * pfm-read.c: (read_variables) Rewrite missing value handling.
1443
1444         * pfm-write.c: (write_variables) Rewrite missing value handling.
1445
1446         * sfm-read.c: (read_variables) Rewrite missing value handling.
1447
1448         * sfm-write.c: (write_variable) Rewrite missing value handling.
1449
1450         * sfmP.h: Include "magic.h" to get definition of
1451         second_lowest_value.
1452
1453         * sysfile-info.c: (describe_variable) Rewrite missing value
1454         handling.
1455
1456         * val.h: Include "magic.h" to get definition of
1457         second_lowest_value.
1458
1459         * var.h: Include "missing-values.h".  Drop MISSING_* enums.
1460         (struct variable) Remove `miss_type', `missing'.  Add `miss'.
1461
1462         * vars-atr.c: (is_num_user_missing) Removed--use
1463         mv_is_num_user_missing().
1464         (is_str_user_missing) Removed--use mv_is_str_user_missing().
1465         (is_system_missing) Removed--use mv_is_value_system_missing().
1466         (is_missing) Removed--use mv_is_value_missing().
1467         (is_user_missing) Removed--use mv_is_value_user_missing().
1468         
1469 Sun Jul 31 14:09:57 2005  Ben Pfaff  <blp@gnu.org>
1470
1471         Adopt use of gnulib for portability.
1472
1473         * Make.build: Add $(top_srcdir)/gl and $(top_builddir)/gl to
1474         include path.
1475
1476         * Makefile.am: Remove bool.h, stat.h and change getline.[ch] to
1477         getl.[ch] in pspp_SOURCES.  Remove libmisc, add libgl in
1478         pspp_LDADD.
1479
1480         * In many source files, added an explicit inclusion of gettext.h
1481         and definition of _ macro.  These are no longer in pref.h because
1482         it interfered with definitions in a few gnulib source files.
1483
1484         * In many source files, changed #include "bool.h" to #include
1485         <stdbool.h>, which is provided by gnulib.
1486
1487         * alloc.c: Removed functions defined in gnulib:
1488         (xmalloc) Removed.
1489         (xcalloc) Removed.
1490         (xrealloc) Removed.
1491         (xstrdup) Removed.
1492         (out_of_memory) Redefined as wrapper for xalloc_die().
1493
1494         * alloc.h: Replace prototypes by #include "xalloc.h".
1495
1496         * casefile.c: Use full_read() and full_write() from gnulib instead
1497         of our home-grown versions.
1498         (full_read) Removed.
1499         (full_write) Removed.
1500
1501         * getline.c: Renamed getl.c.
1502
1503         * getline.h: Renamed getl.h, updated all references.
1504
1505         * filename.c: (fn_readlink) Change to wrapper around xreadlink()
1506         from gnulib.
1507
1508         * glob.c: Just #include <time.h> instead of the crazy rigmarole
1509         here before.
1510         (init_glob) Call set_program_name() to initial gnulib progname
1511         module.
1512
1513         * html.c: (postopen) Use getlogin_r(), gethostname() from gnulib.
1514
1515         * permissions.c: Use "stat-macros.h" from gnulib.
1516
1517         * postscript.c: Just #include <time.h> instead of the crazy
1518         rigmarole here before.
1519
1520         * q2c.c: (main) Make generated code #include "gettext.h".
1521
1522         * str.h: Get rid of most explicit declarations of standard
1523         functions, in favor of including gnulib header files.
1524
1525         * expressions/evaluate.c: Ditto.
1526
1527         * expressions/operations.h.pl: Make generated code #include
1528         <stdbool.h>, not "bool.h".
1529
1530 Sat Jul 30 23:13:17 2005  Ben Pfaff  <blp@gnu.org>
1531
1532         * expressions/parse.c: (validate_function_args) Fix two msg() bugs
1533         found by -Wformat.
1534
1535 Sat Jul 30 23:10:01 2005  Ben Pfaff  <blp@gnu.org>
1536
1537         * expressions/evaluate.c: (expr_debug_print_postfix) Don't pass
1538         null pointer to printf for %.*s.
1539
1540 Sat Jul 30 23:05:33 2005  Ben Pfaff  <blp@gnu.org>
1541
1542         * vars-atr.c: (var_is_valid_name) Fix three msg() bugs found by
1543         -Wformat.
1544
1545 Sat Jul 30 22:58:33 2005  Ben Pfaff  <blp@gnu.org>
1546
1547         * rank.q: (parse_rank_function) Fix msg() bug found by -Wformat.
1548
1549 Sat Jul 30 22:56:12 2005  Ben Pfaff  <blp@gnu.org>
1550
1551         * postscript.c: (postopen) Cast `char' to `unsigned char' before
1552         passing to isspace().
1553
1554 Sat Jul 30 22:52:09 2005  Ben Pfaff  <blp@gnu.org>
1555
1556         * pfm-read.c: (read_variables) Fix msg() bug found by -Wformat.
1557
1558 Sat Jul 30 22:50:57 2005  Ben Pfaff  <blp@gnu.org>
1559
1560         * histogram.c: Include <config.h>.
1561
1562 Sat Jul 30 22:48:50 2005  Ben Pfaff  <blp@gnu.org>
1563
1564         * get.c: (cmd_match_files) Fix msg() bug found by -Wformat.
1565
1566 Sat Jul 30 22:46:10 2005  Ben Pfaff  <blp@gnu.org>
1567
1568         * format.c: (check_common_specifier) Fix msg() bug found by
1569         -Wformat.
1570         (check_output_specifier) Ditto.
1571
1572 Sat Jul 30 22:43:57 2005  Ben Pfaff  <blp@gnu.org>
1573
1574         * file-handle.q: (cmd_file_handle) Fix msg() bug found by
1575         -Wformat.
1576
1577 Sat Jul 30 22:41:44 2005  Ben Pfaff  <blp@gnu.org>
1578
1579         * data-in.c: (parse_Z) [WORDS_BIGENDIAN] Don't declare buf[], to
1580         avoid "unused variable" warning.
1581
1582 Sat Jul 30 22:38:46 2005  Ben Pfaff  <blp@gnu.org>
1583
1584         * command.c: (find_word) Cast `char' to `unsigned char' before
1585         passing to isspace().
1586
1587 Sat Jul 30 22:36:29 2005  Ben Pfaff  <blp@gnu.org>
1588
1589         * case.c: (case_compare) Implement as delegating to
1590         case_compare_2dict().
1591
1592 Sat Jul 30 22:34:18 2005  Ben Pfaff  <blp@gnu.org>
1593
1594         * algorithm.c: Inclusion of <alloca.h> is unneeded.
1595
1596 Sat Jul 30 22:01:32 2005  Ben Pfaff  <blp@gnu.org>
1597
1598         * Make.build: Don't append -ansi to AM_CFLAGS for GCC.  Using
1599         -ansi changes the behavior of header files significantly.  It
1600         causes __STRICT_ANSI__ to be defined, and some headers interpret
1601         that as cause to e.g. not use `long long' or __attribute__.  The
1602         former example is bad when off_t is supposed to be `long long',
1603         and the latter prevents -Wformat from working.
1604
1605 Sun Jul 24 20:26:59 2005  Ben Pfaff  <blp@gnu.org>
1606
1607         Get rid of dependency on libgmp by writing our own routine for
1608         floating-point base conversion.
1609
1610         * pfm-write.c: (write_float) Rewrote.
1611         (write_int) Rewrote.
1612         (pow30_nonnegative) New function.
1613         (pow30) New function.
1614         (trig_to_char) New function.
1615         (format_trig_digits) New function.
1616         (recurse_format_trig_int) New function.
1617         (format_trig_int) New function.
1618         (should_round_up) New function.
1619         (try_round_up) New function.
1620         (format_trig_double) New function.
1621
1622 Sun Jul 24 18:49:20 2005  Ben Pfaff  <blp@gnu.org>
1623
1624         * data-in.c: (parse_numeric) Allow "1+23" even for F format, for
1625         compatibility.
1626
1627 Sun Jul 24 18:47:37 2005  Ben Pfaff  <blp@gnu.org>
1628
1629         * pfm-read.c: (read_version_data) Read and ignore author field.
1630
1631 Wed Jul  6 20:44:27 2005  Ben Pfaff  <blp@gnu.org>
1632
1633         * get.c: (mtf_processing) Don't assume that
1634         mtf_compare_BY_values() always returns -1, 0, or 1.  Actually, it
1635         returns a negative, zero, or positive result.  Fixes MATCH FILES
1636         bug on Mac OS X reported by "Marshall DeBerry" <mdb@radix.net>.
1637
1638 Mon Jul  4 18:01:15 2005  Ben Pfaff  <blp@gnu.org>
1639
1640         * flip.c: [HAVE_SYS_TYPES_H] Really include <sys/types.h>.  The
1641         preprocessor test for sys/types.h was accidentally inverted.  This
1642         was bug 12789.
1643
1644 Sun Jul  3 22:47:39 2005  Ben Pfaff  <blp@gnu.org>
1645
1646         * get.c: (cmd_match_files) Fix memory leak on `by' and on
1647         `vfm_source'.
1648
1649         * getline.c: [HAVE_LIBREADLINE] (read_console) Fix memory leak on
1650         `line'.
1651
1652         * vfm.c: (close_active_file) Remove unnecessary test.
1653
1654 Sun Jul  3 21:45:32 2005  Ben Pfaff  <blp@gnu.org>
1655
1656         Fix NDEBUG compile errors.
1657
1658         * hash.h: Needed explicit #include <assert.h>.
1659
1660         * linked-list.c: (ll_next) First arg is UNUSED when NDEBUG is
1661         defined.
1662
1663 Sun Jun 12 23:44:38 2005  Ben Pfaff  <blp@gnu.org>
1664
1665         Implement embedding for PostScript driver.  Fixes bug 12970.
1666
1667         * ascii.c: Fix compiler warnings.
1668
1669         * html.c: Ditto.
1670
1671         * chart.h: Add `file' member.
1672
1673         * output.h: (struct outp_class) initialise_chart, finalise_chart
1674         should take outp_driver *, not outp_class *.  Update all
1675         references.
1676
1677         * plot-chart.c: (chart_create) Fix segfault when there are no
1678         output drivers at all.
1679         (chart_submit) Call d->class->finalise_chart.
1680
1681         * postscript.c: (ps_open_page) Set cp_y to 0.
1682         (ps_submit) New function.
1683         (ps_chart_initialise) Implement.
1684         (ps_chart_finalise) Implement.
1685         (static var postscript_class) Add ps_submit.
1686         (static var epsf_class) Add ps_submit.
1687         
1688
1689 Sun Jun 12 14:54:40 2005  Ben Pfaff  <blp@gnu.org>
1690
1691         Did some more work on bug 12859 and then realized that a *good*
1692         solution would require some fundamental restructuring.  For now,
1693         I'm marking REPEATING DATA unimplemented, and then we can revisit
1694         it post-0.4.0.
1695         
1696         * command.def: Make REPEATING DATA unimplemented.
1697
1698         * data-list.c: (cmd_repeating_data) Assume inline file is 80
1699         characters wide.
1700         (realize_value) Revert previous changes; no longer needed.
1701         Updated all callers.
1702
1703         * error.c: (err_hcf) Set nfile_loc, mfile_loc to 0 after freeing
1704         file_loc, to avoid bad references later.
1705
1706         * str.c: Fix typo.
1707
1708 Tue Jun  7 00:14:09 2005  Ben Pfaff  <blp@gnu.org>
1709
1710         Make some code tolerant of reentry.  Should not be needed if other
1711         code is correct but it is good to be generally tolerant.
1712         
1713         * error.c: (err_hcf) Set file_loc to null after free().
1714
1715         * output.c: (outp_done) Similar changes.
1716
1717         * str.c: (ds_destroy) Ditto.
1718         
1719 Tue Jun  7 00:10:20 2005  Ben Pfaff  <blp@gnu.org>
1720
1721         Continue work on bug 12859, plus some code cleanup.
1722         
1723         * data-list.c: (cmd_repeating_data) Replace `seen' bitmap by
1724         boolean variables.  Don't try to compute starts_end, cont_end for
1725         inline file.  Calculate length only after parsing variable
1726         specifications.  Add proper transformation to list.
1727         (realize_value) If the rpd_num_or_var has no value, return new
1728         DEFAULT_MEMBER argument (for use with inline file).
1729         (repeating_data_trns_proc) Pass default values.
1730
1731         * dfm-read.c: (dfm_close_reader) Only skip data if *not* still
1732         open, and only if we actually started reading data.
1733
1734 Sun Jun  5 18:39:36 2005  Ben Pfaff  <blp@gnu.org>
1735
1736         Fix bug 11894.
1737         
1738         * output.c: (outp_read_devices) Fix message.
1739
1740 Fri May 27 12:34:43 WST 2005 John Darrington <john@darrington.wattle.id.au>
1741         
1742         * sort-prs.[ch] (newfiles), aggregate.c, sort.[ch]: Separated the guts 
1743         of the sort algorithm from the parser for the SORT command.
1744         
1745         * rank.q: Added the parser for the RANK command.
1746         
1747 Thu May 26 12:29:21 2005  Ben Pfaff  <blp@gnu.org>
1748
1749         Fix bug 13192.
1750
1751         * sort.c: (sort_parse_criteria) Only set *saw_direction if
1752         saw_direction is non-null.  Thanks to John Darrington for
1753         reporting this bug.
1754
1755 Tue May 24 21:52:55 2005  Ben Pfaff  <blp@gnu.org>
1756
1757         * get.c: (mtf_processing) Handle case of a lookup table as the
1758         active file.  Thanks to John Darrington for reporting this bug.
1759
1760 Wed May 25 10:27:02 WST 2005 John Darrington <john@darrington.wattle.id.au>
1761         
1762         * alloc.c alloc.h: (xcalloc) changed signature to imitate the
1763         POSIX  calloc function.
1764         
1765         * crosstabs.q get.c vars-prs.c: Updated calls to xcalloc to
1766         reflect new signature.
1767
1768         * sfm-read.c: Now much more robust in the face of badly formed
1769         system files.
1770
1771 Mon May 23 11:57:31 WST 2005 John Darrington <john@darrington.wattle.id.au>
1772
1773         *sfm-read.c: Fixed some bugs regarding long string continuation
1774         records, which the previous fix uncovered.
1775
1776 Sat May 21 12:48:34 WST 2005 John Darrington <john@darrington.wattle.id.au>
1777
1778         * sfm-read.c, sfmP.h:  Allow reading of system files when the 
1779         case_size value in the header is -1.  Also changed some Errors to 
1780         Warnings when reading system files.
1781
1782 Tue May 17 21:00:57 2005  Ben Pfaff  <blp@gnu.org>
1783
1784         * data-list.c: (data_list_trns_free) Don't free the argument
1785         because cancel_transformations() will do that itself.
1786         (data_list_source_destroy) Destroy the argument to
1787         data_list_trns_free(), because it no longer does so itself.
1788
1789 Tue May 17 18:29:35 2005  Ben Pfaff  <blp@gnu.org>
1790
1791         * data-out.c: (format_and_round) Don't output leading `-' if value
1792         rounds to zero.
1793
1794 Tue May 17 00:06:43 2005  Ben Pfaff  <blp@gnu.org>
1795
1796         Fix bug 11119.
1797
1798         * som.c: (output_encodings) If some cell in the table won't fit
1799         with the horizontal or vertical headers, cancel those headers.
1800
1801         * som.h: (struct som_table_class) Add fits_width, fits_length,
1802         set_headers members.
1803
1804         * tab.c: (tabi_fits_width) New function.
1805         (tabi_fits_length) New function.
1806         (tabi_set_headers) New function.
1807         (global var tab_table_class) Add the new functions as appropriate
1808         members.
1809         
1810 Mon May 16 22:34:06 2005  Ben Pfaff  <blp@gnu.org>
1811
1812         Fix rest of bug 13054.
1813
1814         * format.def: Fix EDATE, SDATE, ADATE, JDATE, QYR, MOYR, WKYR,
1815         DATETIME, TIME system/portable file values.
1816
1817 Mon May 16 22:31:15 2005  Ben Pfaff  <blp@gnu.org>
1818
1819         * data-list.c: (parse_free) Use make_input_format().
1820         
1821         * data-out.c: (num_to_string) Use make_output_format().
1822
1823         * dictionary.c: (dict_create_var) Ditto.
1824
1825         * format.c: (global var f8_2) New var.
1826         (make_input_format) New function.
1827         (make_output_format) New function.
1828
1829         * get.c: (cmd_match_files) Use make_output_format().
1830
1831         * list.q: (cmd_list) Ditto.
1832
1833         * matrix-data.c: Ditto.
1834
1835         * sfm-read.c: (parse_format_spec) Check output specifier
1836         thoroughly.
1837
1838         * tab.c: (tab_float) Use make_output_format().
1839
1840 Sun May 15 23:38:10 2005  Ben Pfaff  <blp@gnu.org>
1841
1842         Fix more of bug 13054.
1843         
1844         * format.def: FMT_A should allow 255-character output.  FMT_AHEX
1845         should allow 510-character input and output.
1846
1847         * data-out.c: (num_to_string) Get rid of NEW_STYLE option.
1848         (convert_E) Handle non-finite values.
1849         (try_F) Rewrite.
1850         (format_and_round) New function.
1851         (convert_infinite) New function used by try_F() and convert_E().
1852
1853 Sun May 15 23:36:55 2005  Ben Pfaff  <blp@gnu.org>
1854
1855         Regularize string and buffer function names so that they make some
1856         kind of sense.
1857
1858         * str.c: (mm_reverse) Rename buf_reverse().  Update all
1859         references.
1860         (mm_find_reverse) Rename buf_find_reverse().  Update all
1861         references.
1862         (mm_case_compare) Rename buf_compare_case().  Update all
1863         references.
1864         (st_compare_pad) Rename buf_compare_rpad().  Update all
1865         references.
1866         (str_compare_rpad) New function.
1867         (st_bare_pad_copy) Rename buf_copy_str_rpad().  Update all
1868         references.
1869         (buf_copy_str_lpad) New function.
1870         (st_bare_pad_len_copy) Rename buf_copy_rpad().  Update all
1871         references.
1872         (st_pad_copy) Rename str_copy_rpad().  Update all references.
1873         (st_trim_copy) Rename str_copy_trunc().  Update all references.
1874         (st_uppercase) Renamed str_uppercase().  Update all references.
1875         
1876 Sat May 14 08:22:26 WST 2005 John Darrington <john@darrington.wattle.id.au>
1877
1878         * dfm-read.c: Fixed polarity of test in dfm-close-reader.  Closes 
1879         Bug #13082
1880
1881 Tue May 10 20:08:18 2005  Ben Pfaff  <blp@gnu.org>
1882
1883         * data-in.c: (data_in) Add assertion to check input specifier.
1884
1885         * data-out.c: (data_out) Add assertion to check output specifier.
1886
1887 Tue May 10 19:56:35 2005  Ben Pfaff  <blp@gnu.org>
1888
1889         Start to fix bug 13054.
1890
1891         * format.c: (check_input_specifier) Improve error message.
1892         (check_input_specifier) Check F, COMMA, and DOLLAR formats for
1893         valid decimal places.
1894         (check_output_specifier) Ditto (but different criteria).
1895         (convert_fmt_ItoO) Assert valid input and output specifiers.
1896         Also, if input specifier has *any* decimal places, make the output
1897         specifier 1 place wider.
1898
1899 Mon May  9 07:14:29 WST 2005 John Darrington <john@darrington.wattle.id.au>
1900
1901         * sysfile-info.c: Fixed bug [# 13024 ]
1902
1903 Sun May  8 13:52:12 2005  Ben Pfaff  <blp@gnu.org>
1904
1905         "Fix" bug 13021 by disabling FILE TYPE.  Eventually, we should
1906         actually implement it.
1907
1908         * command.c: (FILE_TYPE_okay) Always return 1.
1909
1910         * command.def: Change FILE TYPE, END FILE TYPE into UNIMPL.
1911
1912         * file-type.c: Add prototypes to get rid of warnings.
1913
1914 Sun May  8 08:08:07 WST 2005 John Darrington <john@darrington.wattle.id.au>
1915
1916         * barchart.c box-whisker.c cartesian.c piechart.c plot-hist.c: Fixed 
1917         more ISO/IEC 9899:1990 conformance issues.
1918
1919 Wed May  4 23:54:02 2005  Ben Pfaff  <blp@gnu.org>
1920
1921         Fix bug 12948.  See also new test in
1922         tests/bugs/match-file-scratch.sh.
1923         
1924         * get.c: (mtf_merge_dictionary) Don't compact dictionary because
1925         that deletes scratch variables that someone else might be using,
1926         and because we can't reassign our sources' value indexes.
1927         Instead, simply don't copy scratch variables into the master
1928         dictionary.
1929
1930         * dictionary.c: (dict_compact_values) Delete variables from the
1931         dictionary passed in, not from default_dict (!).
1932
1933 Tue May  3 22:25:17 2005  Ben Pfaff  <blp@gnu.org>
1934
1935         Improve hash.c comments, error-checking.
1936         
1937         * hash.c: (struct hsh_table) [NDEBUG] Add hash_ordered member.
1938         (hsh_create) size == 0 should *not* return NULL!  Set
1939         hash_ordered.
1940         (hsh_clear) Set hash_ordered.
1941         (locate_matching_entry) Check hash_ordered.
1942         (hsh_rehash) Rename rehash().  Add assertion.  Set hash_ordered.
1943         (hsh_data) Set hash_ordered.  Add const-ness to return value and
1944         update all callers.
1945         (hsh_sort) Ditto.       
1946
1947 Wed May  4 08:50:11 WST 2005 John Darrington <john@darrington.wattle.id.au>
1948
1949         * casefile.c: Removed unnecessary #include <valgrind/valgrind.h>
1950
1951 Tue May  3 19:14:48 WST 2005 John Darrington <john@darrington.wattle.id.au>
1952
1953         * copyleft.c: Updated copyright date.
1954
1955         * Makefile.am: Removed erroneous explicit "-lplot"
1956
1957         * examine.q oneway.q: Made these files conform to ISO/IEC 9899:1990
1958
1959 Tue May  3 16:20:31 WST 2005 John Darrington <john@darrington.wattle.id.au>
1960
1961         * command.c command.def: Added description string for unimplemented commands.
1962
1963         * oneway.q: Sorted the hash tables before shipping out the results. Closes 
1964         bug [#12931].
1965
1966 Mon May  2 23:45:01 2005  Ben Pfaff  <blp@gnu.org>
1967
1968         Code improvements.
1969         
1970         * data-list.c:  (parse_fixed) Use lex_end_of_command().
1971         (parse_free) Ditto.
1972         (cmd_repeating_data) Set cont_end.num in right situations.
1973         (parse_repeating_data) Remove redundant test.
1974
1975 Mon May  2 23:37:19 2005  Ben Pfaff  <blp@gnu.org>
1976
1977         Partial fix for bug 12859.
1978         
1979         * data-list.c: (cmd_data_list) Add transformation properly in
1980         vfm_source == NULL case.
1981
1982 Mon May  2 23:27:28 2005  Ben Pfaff  <blp@gnu.org>
1983
1984         * lexer.c: (lex_error) Improve error messages.
1985
1986 Mon May  2 22:28:17 2005  Ben Pfaff  <blp@gnu.org>
1987
1988         * get.c: (cmd_match_files) Check token type before trying to match
1989         tokid.  Fixes bug 12923.
1990
1991 Mon May  2 22:16:51 2005  Ben Pfaff  <blp@gnu.org>
1992
1993         * flip.c: [HAVE_SYS_TYPES_H] Include <sys/types.h>.  Fixes bug
1994         12789.
1995
1996 Mon May  2 22:02:52 2005  Ben Pfaff  <blp@gnu.org>
1997
1998         * expressions/generate.pl: (get_token) Make use of /g
1999         backward-compatible with Perl 5.6.1.
2000
2001 Sun May  1 23:00:19 2005  Ben Pfaff  <blp@gnu.org>
2002
2003         * var-display.c: (cmd_variable_alignment) Fix memory leak.
2004         (cmd_variable_level) Ditto.
2005
2006 Sun May  1 22:49:04 2005  Ben Pfaff  <blp@gnu.org>
2007
2008         Hash table had buggy deletion function.  The fix required changing
2009         other functions to do probing in the required order.
2010
2011         * hash.c: (locate_matching_entry) Rewrite and change interface.
2012         (hsh_rehash) Rewrite to use locate_matching_entry().
2013         (hsh_probe) Ditto.
2014         (hsh_find) Ditto.
2015         (hsh_delete) Ditto.  Also, fix stupid bugs.
2016
2017 Sun May  1 22:24:58 2005  Ben Pfaff  <blp@gnu.org>
2018
2019         * dictionary.c: (dict_clone) Properly copy vectors.
2020
2021 Sun May  1 22:07:58 2005  Ben Pfaff  <blp@gnu.org>
2022
2023         New implementation of long variable names.  Each variable has a
2024         "normal" name, which may be up to 64 bytes long and which is used
2025         for all normal operations.  Variables may have a "short" name,
2026         which is limited to 8 bytes and used only for system and portable
2027         file input and output.
2028         
2029         Make tokid case-preserving.  Update most uses of tokid to treat it
2030         case-insensitively.
2031
2032         Update many commands to deal with long variable names.
2033
2034         * autorecode.c: (cmd_autorecode) Use strcasecmp() instead of strcmp().
2035
2036         * command.c: (cmd_parse) Ditto.
2037         (match_strings) Use toupper() before comparing characters.
2038         (conflicting_3char_prefixes) Use mm_case_compare() instead of
2039         memcmp().
2040         (cmd_match_words) Ditto.
2041
2042         * compute.c: (lvalue_parse) Use st_trim_copy() instead of
2043         strncpy().
2044
2045         * count.c: (struct cnt_var_info) Change n[] to fit long var name.
2046         Use st_trim_copy() instead of strcpy().
2047
2048         * data-in.c: (parse_enum) Use mm_case_compare() instead of
2049         memcmp().
2050
2051         * data-list.c: (struct dls_var_spec) Change name[] to fit long var
2052         name.
2053         (parse_free) Use st_trim_copy() instead of strcpy().
2054
2055         * descript.c: (struct dsc_var) Change z_name[] to fit long var
2056         name.
2057         (try_name) Use strcasecmp() instead of strcmp().
2058         (generate_z_varname) Use st_trim_copy() instead of strcpy().
2059         (descriptives_compare_dsc_vars) Use strcasecmp() instead of
2060         strcmp().
2061
2062         * dictionary.c: (struct dictionary) Removed `long_name_tab'
2063         member.
2064         (compare_long_names) Removed.
2065         (hash_long_name) Removed.
2066         (dict_create) Don't initialize `long_name_tab' member.
2067         (dict_clone) Copy short names into new dictionary. 
2068         (dict_clear) Don't clear `long_name_tab' member.
2069         (dict_get_varname_block) Removed.
2070         (dict_add_longvar_entry) Removed.
2071         (free_nte) Removed.
2072         (dict_destroy) Don't destroy `long_name_tab' member.
2073         (dict_create_var_from_short) Removed.
2074         (dict_create_var_x) Removed.
2075         (dict_create_var) Get rid of longname handling.
2076         Clear short name.
2077         (dict_clone_var) Get rid of longname parameter and longname
2078         handling.
2079         (dict_lookup_var) Get rid of longname handling.
2080         (dict_reorder_var) New function.
2081         (dict_rename_var) Clear short name.
2082         (dict_rename_vars) Get rid of longname handling.  Clear short
2083         names.
2084         (dict_create_vector) Support long vector names.
2085         (dict_lookup_vector) Use strcasecmp() instead of strcmp().
2086         (quasi_base27) Removed.
2087         (make_short_name) Removed.
2088         (compare_strings) New function.
2089         (hash_string) New function.
2090         (dict_assign_short_names) New function.
2091
2092         * file-handle.q: (get_handle_with_name) Use strcasecmp() instead
2093         of strcmp().
2094         (get_handle_for_filename) Support long handle names.
2095
2096         * file-type.c: (struct col_spec) Make `name' fit long var names.
2097         (cmd_file_type) Use strcasecmp() instead of strcmp().
2098
2099         * flip.c: (make_new_var) Rewrite.
2100         (flip_sink_write) Use st_trim_copy() instead of strncpy().
2101
2102         * format.c: (parse_format_specifier_name) Use mm_case_compare()
2103         instead of memcmp().
2104
2105         * get.c: (cmd_save_internal) Rephrase.
2106         (rename_variables) Drop test for identical variable name.
2107         (struct mtf_proc) Change `first', `last' to fit long var name.
2108
2109         * hash.c: (hsh_hash_case_string) New function for case-insensitive
2110         string hashing.
2111
2112         * lexer.c: (restore_token) Use st_trim_copy() instead of
2113         strncpy().
2114         (lex_get) Don't uppercase string when copying into tokid.
2115         (lex_put_back_id) Use st_trim_copy() instead of
2116         strncpy().
2117
2118         * list.q: (determine_layout) Consider length of variable names in
2119         choosing vertical layout.
2120
2121         * matrix-data.c: (cmd_matrix_data) Use strcasecmp() instead of
2122         strcmp().
2123         (string_to_content_type) Ditto.
2124
2125         * modify-vars.c: (compare_variables_given_ordering) Ditto.
2126         (struct var_renaming) Change `new_name' to fit long var name.
2127         (compare_var_renaming_by_new_name) Use strcasecmp() instead of
2128         strcmp().
2129
2130         * pfm-read.c: (read_variables) Disallow system variables in system
2131         files.
2132         (write_variables) Call dict_assign_short_names() and use
2133         short_name[] members.
2134
2135         * repeat.c: (internal_cmd_do_repeat) Use strcasecmp() instead of
2136         strcmp().
2137
2138         * sfm-read.c: (sfm_open_reader) Rewrite code for long variable
2139         map.  Reorder variables into same order as long variable map.
2140         (read_variables) Set short name.
2141
2142         * sfm-write.c: (sfm_open_writer) Call dict_assign_short_names().
2143         (write_variable) Use st_bare_pad_copy().
2144         (write_longvar_table) Rewrite.
2145
2146         * str.c: (mm_case_compare) New function.
2147
2148         * sysfile-info.c: (compare_vectors_by_name) Use strcasecmp()
2149         instead of strcmp().
2150
2151         * t-test.q: (tts_custom_groups) Remove redundant test.
2152         (tts_custom_pairs) Ditto.
2153
2154         * var.h: (struct variable) Change `name' to fit long var names.
2155         Remove `longname'.  Add `short_name' member.  Reorder some
2156         variables.
2157         (struct name_table_entry) Removed.
2158         (struct vector) Change `name' to fit long vector names.
2159
2160         * vars-atr.c: (var_is_valid_name) Allow long var names.
2161         (compare_var_names) Use strcasecmp() instead of strcmp().
2162         (compare_var_ptr_names) Ditto.
2163         (hash_var_name) Use hsh_hash_case_string().
2164         (hash_var_ptr_name) Ditto.
2165         (var_set_short_name) New function.
2166         (var_clear_short_name) New function.
2167         (var_set_short_name_suffix) New function.
2168
2169         * vars-prs.c: (parse_DATA_LIST_vars) Support long names.
2170         Use strcasecmp() instead of strcmp().
2171         (struct array_var_set) Removed `longname_tab'.
2172         (array_var_set_lookup_var_idx) Drop longname_tab support.
2173         (array_var_set_destroy) Don't destroy `longname_tab'.
2174         (var_set_create_from_array) Don't create `longname_tab'.
2175
2176         * vector.c: (cmd_vector) Use strcasecmp() instead of strcmp().
2177         Support long names.
2178
2179         * expressions/parse.c: (word_matches) Use mm_case_compare()
2180         instead of memcmp().
2181         (compare_strings) New function.
2182         (lookup_function) Use compare_strings() instead of strcmp().
2183         
2184 Sun May  1 22:07:43 2005  Ben Pfaff  <blp@gnu.org>
2185
2186         * algorithm.c: (move_element) New function.
2187
2188 Sun May  1 22:05:35 2005  Ben Pfaff  <blp@gnu.org>
2189
2190         * aggregate.c: (parse_aggregate_functions) Always initialize
2191         destvar.
2192
2193 Sun May  1 22:03:47 2005  Ben Pfaff  <blp@gnu.org>
2194
2195         * aggregate.c: (cmd_aggregate) Use dict_clone_var_assert().
2196
2197         * dictionary.c: (dict_clone) Ditto.
2198         (dict_clone_var_assert) New function.
2199
2200         * get.c: (mtf_merge_dictionary) Use dict_clone_var_assert().
2201
2202 Sun May  1 15:05:54 WST 2005 John Darrington <john@darrington.wattle.id.au>
2203
2204         * error.c: Added a string for the compiler version to the
2205         request_bug_report_and_abort function.
2206
2207         * groff_font.c, font.c: Removed manpage(1) style references from 
2208         comments, because RMS frowns upon them.
2209
2210 Thu Apr 28 18:52:06 2005  Ben Pfaff  <blp@gnu.org>
2211
2212         * expressions/parse.c: Improve previous fix for bug 12858 (LAG).
2213
2214 Fri Apr 29 09:28:00 WST 2005 John Darrington <john@darrington.wattle.id.au>
2215
2216         * expressions/parse.c: Added handler for OP_LAG_Vn and OP_LAG_Vs.  
2217         Fixed bug [#12858] .
2218
2219 Wed Apr 27 12:42:34 WST 2005 John Darrington <john@darrington.wattle.id.au>
2220
2221         * loop.c recode.c repeat.c: Fixed a couple of instances of SHORT_NAME_LEN 
2222         which should be LONG_NAME_LEN
2223
2224 Wed Apr 27 07:43:50 WST 2005 John Darrington <john@darrington.wattle.id.au>
2225
2226         * command.def echo.c:  Added the ECHO command.
2227
2228 Mon Apr 25 22:55:59 2005  Ben Pfaff  <blp@gnu.org>
2229
2230         Finish fixing MATCH FILES (bug 11677).
2231
2232         * get.c: (trim_dictionary) Rewrite in terms of drop_variables(),
2233         keep_variables(), rename_variables().
2234         (drop_variables) New function.
2235         (keep_variables) New function.
2236         (struct mtf_file) Rename `in' to `in_name'.  Add `in_var'.
2237         (cmd_match_files) Deal with in_var.  Use drop_variables(),
2238         keep_variables().  When IN is specified, require BY.  Set master
2239         variables after master dictionary is complete.  Add IN variables
2240         after master dictionary is complete.
2241         (mtf_free_file) Free `in_name'.
2242         (mtf_delete_file_in_place) Set in_var value to 0.
2243         (mtf_read_nonactive_records)  Rephrase.
2244         (mtf_processing) Support IN.  Rephrase.  Fix bugs.
2245         (mtf_merge_dictionary) Don't set master variables; we do that
2246         later now.
2247         (get_master) Don't insist that there's a master variable.
2248         
2249 Mon Apr 25 22:55:22 2005  Ben Pfaff  <blp@gnu.org>
2250
2251         Kluge to make some variable renaming sort of work.
2252         Needs real fix.
2253
2254         * dictionary.c: (dict_rename_var) Call dict_add_longvar_entry().
2255
2256 Mon Apr 25 22:52:28 2005  Ben Pfaff  <blp@gnu.org>
2257
2258         Add functions for comparing sets of variables between cases.
2259         Use the functions.
2260
2261         * case.c: (case_compare) New function.
2262         (case_compare_2dict) New function.
2263         
2264         * aggregate.c: (struct agr_proc) Remove `prev_break' member.  Add
2265         `break_case'.
2266         (cmd_aggregate) Nullify break_case.  Don't call
2267         initialize_aggregate_info().
2268         (agr_destroy) Destroy break_case.
2269         (aggregate_single_case) Rewrite.  Use case_compare().
2270         (dump_aggregate_info) Copy from break_case into output.
2271         (initialize_aggregate_info) Copy break_case from input.
2272
2273         * get.c: (mtf_compare_BY_values) Use case_compare_2dict().
2274
2275         * vfm.c: (equal_splits) Use case_compare().
2276
2277 Sat Apr 23 17:01:04 WST 2005 John Darrington <john@darrington.wattle.id.au>
2278
2279         * dictionary.c vars-prs.c sfm-write.c: Fixed some memory leaks
2280
2281 Sun Apr 17 23:08:15 2005  Ben Pfaff  <blp@gnu.org>
2282
2283         Start work on fixing MATCH FILES.
2284
2285         * get.c: (enum operation) Remove OP_MATCH.
2286         (trim_dictionary) Change return value to bool.  Don't support
2287         OP_MATCH.
2288         (struct mtf_file) Remove `first', `last' members.
2289         (struct mtf_proc) Add `first', `last' members.  Change mtf_case
2290         from `struct ccase *' to `struct ccase'.  Remove `by' member.
2291         (cmd_match_files) Essentially rewrite.
2292         (mtf_free) Don't free `by' member.  Destroy `mtf_case' member.
2293         (mtf_read_nonactive_records) mtf_ parameter is not unused.
2294         (mtf_processing) Ditto.  Also rephrase some code.
2295         (mtf_merge_dictionary) Rewrite for easy comprehension.  
2296
2297 Sun Apr 17 23:06:00 2005  Ben Pfaff  <blp@gnu.org>
2298
2299         * matrix-data.c: (wr_output_data) [DEBUGGING] Fix compilation
2300         error.
2301
2302         * q2c.c: (dump_token) [DEBUGGING] Fix compilation error.
2303         
2304 Thu Apr 14 2005 John Darrington
2305
2306         * var-display.c: New file.
2307
2308         * format.h var.h sfm-read.c sfm-write.c dictionary.c :  Added 
2309           display_width, measure and alignment parameters to variables.
2310
2311         * aggregate.c command.def compute.c count.c data-list.c descript.c
2312           dictionary.c dictionary.h expr-prs.c file-type.c flip.c get.c 
2313           lexer.c lexer.h loop.c modify-vars.c pfm-read.c recode.c repeat.c 
2314           sfm-read.c sfm-write.c sfm-write.h sfmP.h val-labs.c val.h var.h 
2315           vars-prs.c vector.c :  
2316               - Replaced literal constants representing maximum variable name 
2317                 length with macro definitions. 
2318               - Added support for long variable names.
2319               - Changed lexer such that it no longer makes tokens upper
2320                 case, but relies upon case insensitive behaviour of commands.
2321
2322 Mon Apr  4 22:27:34 2005  Ben Pfaff  <blp@gnu.org>
2323
2324         * aggregate.c: (parse_aggregate_functions) If dict_create_var()
2325         fails, don't dereference the resulting null pointer (bug 12427).
2326         Also, fix double free error.
2327
2328 Sat Mar 19 23:06:02 2005  Ben Pfaff  <blp@gnu.org>
2329
2330         * aggregate.c: (parse_aggregate_functions) Fix N_NO_VARS format.
2331         (accumulate_aggregate_info) Set int1 to 1 for SUM.
2332         (dump_aggregate_info) Only make SUM non-missing if there was at
2333         least one variate.
2334
2335 Sat Mar 19 14:48:19 2005  Ben Pfaff  <blp@gnu.org>
2336
2337         * aggregate.c: (dump_aggregate_info) Properly test whether the
2338         destination variable is numeric, when making the result
2339         system-missing for columnwise missing values.
2340
2341 Mon Mar 14 21:52:34 2005  Ben Pfaff  <blp@gnu.org>
2342
2343         * misc.h: Remove GCC specializations.
2344
2345 Mon Mar 14 21:07:23 2005  Ben Pfaff  <blp@gnu.org>
2346
2347         Make sort stable (bug 12313).
2348         
2349         * sort.c: Don't need to include some headers anymore.
2350         (static var min_buffers) New variable.
2351         (static var max_buffers) New variable.
2352         (static var allow_internal_sort) New variable.
2353         (cmd_sort_cases) Add test mode.
2354         (sort_execute) Rephrase.
2355         (do_internal_sort) Don't try internal sorting if
2356         allow_internal_sort is set.
2357         (struct external_sort) Renamed `initial_runs' to `runs' and
2358         updated all references.
2359         (macro MIN_BUFFER_TOTAL_SIZE_RECS) Removed.
2360         (macro MIN_BUFFER_SIZE_BYTES) Removed.
2361         (macro MIN_BUFFER_SIZE_RECS) Removed.
2362         (compare_initial_runs) Removed.
2363         (struct record_run) Add member `idx'.
2364         (write_initial_runs) Pass increasing values to process_case() as
2365         index.
2366         (process_case) Add `idx' parameter and use it to initialize new
2367         `idx' member.
2368         (allocate_cases) Limit allocated buffers to max_buffers.
2369         (compare_record_run) Use new `idx' member for last resort
2370         comparison, for stability.
2371         (end_run) Call casefile_sleep() on irs->casefile, to prevent
2372         running out of file descriptors.
2373         (struct merge_state) Removed.
2374         (merge) Don't need to allocate cases.  Always use MAX_MERGE_ORDER
2375         unless we have fewer runs left.  Always merge consecutive runs,
2376         for stability.  Return the final run.
2377         (mod) Removed.
2378         (choose_merge) New function.
2379         (merge_once) Rewritten.
2380
2381 Mon Mar 14 21:05:42 2005  Ben Pfaff  <blp@gnu.org>
2382
2383         * cmdline.c: (static var testing_mode) Move into
2384         parse_command_line().
2385         
2386 Mon Mar 14 21:05:13 2005  Ben Pfaff  <blp@gnu.org>
2387
2388         * algorithm.c: (remove_range) New function.
2389         (remove_element) New function.
2390
2391         * dictionary.c: (dict_delete_var) Use remove_element().
2392
2393         * flip.c: (cmd_flip) Ditto.
2394
2395 Sun Mar 13 22:52:05 2005  Ben Pfaff  <blp@gnu.org>
2396
2397         * file-handle.q: (struct file_handle) `open_mode' should not be
2398         const.
2399         
2400 Sun Mar 13 22:40:54 2005  Ben Pfaff  <blp@gnu.org>
2401
2402         First phase of making SORT CASES stable (bug 12313).
2403
2404         * sort.c: (struct indexed_case) New structure.
2405         (do_internal_sort) Rewrite to make internal sorting stable.
2406         (compare_case_dblptrs) Removed.
2407         (compare_indexed_cases) New function.
2408
2409 Sun Mar 13 22:38:40 2005  Ben Pfaff  <blp@gnu.org>
2410
2411         Clean-ups.
2412
2413         * casefile.c: (casereader_read_xfer_assert) New function.
2414
2415         * dictionary.c: (dict_compact_case) New function.
2416
2417         * flip.c: (struct flip_pgm) New member idx_to_fv.
2418         (cmd_flip) Initialize idx_to_fv member.
2419         (destroy_flip_pgm) Free idx_to_fv member.
2420         (flip_sink_write) Use struct flip_pgm member instead of case_sink
2421         member.
2422         (flip_sink_write) Ditto.
2423
2424         * vfm.c: (write_case) Use dict_compact_case() instead of
2425         compact_case().
2426         (compact_case) Removed.
2427         (storage_source_create) Removed `dict' parameter.  All references
2428         updated.
2429
2430         * vfm.h: (struct case_source) Removed `value_cnt' member.  All
2431         references removed.
2432         (struct case_sink) Removed `dict', `idx_to_fv' members.  All
2433         references removed.
2434
2435 Sun Mar 13 22:35:55 2005  Ben Pfaff  <blp@gnu.org>
2436
2437         More AGGREGATE fixes.
2438
2439         * aggregate.c: (accumulate_aggregate_info) Implement NMISS and
2440         NUMISS for strings.  Fix FOUT, POUT, FGT, FLT, FIN, FOUT for
2441         strings.
2442         (initialize_aggregate_info) Fix initialization for MIN, MAX for
2443         strings.
2444
2445 Sat Mar 12 23:26:21 2005  Ben Pfaff  <blp@gnu.org>
2446
2447         Start work on testing and debugging AGGREGATE.
2448
2449         * aggregate.c: (cmd_aggregate) Use discrete bool variables instead
2450         of a bit-map.  Require proper subcommand ordering.  Make OUTFILE
2451         subcommand mandatory.
2452         (parse_aggregate_functions) Check that PIN, POUT, FIN, FOUT
2453         functions' arguments are in the correct order and swap them if
2454         not.
2455         (accumulate_aggregate_info) Make SUM include weights.  Add various
2456         string functions.
2457         (dump_aggregate_info) Add various string functions.
2458         (initialize_aggregate_info) Initialize int1 for MIN, MAX.
2459
2460         * sort.c: (sort_parse_criteria) Add parameter for returning
2461         whether any directions were specified.  All callers updated.
2462
2463 Sun Mar 13 14:54:27 WST 2005 John Darrington <john@darrington.wattle.id.au>
2464
2465         * t-test.q: Fixed erroneous logic in compare_group_binary.
2466
2467 Sat Mar 12 13:29:21 2005  Ben Pfaff  <blp@gnu.org>
2468
2469         * split-file.c: (cmd_split_file) Ignore LAYERED and SEPARATE
2470         keywords (bug 11628).
2471
2472 Sat Mar 12 13:17:12 2005  Ben Pfaff  <blp@gnu.org>
2473
2474         * vfm.c: (procedure_with_splits) Fix bug 11492: end_func() must be
2475         called *before* close_active_file().
2476
2477 Sat Mar 12 12:20:57 2005  Ben Pfaff  <blp@gnu.org>
2478
2479         * file-handle.q: (struct file_handle) Change open_mode from
2480         character pointer to 3-char array, for safety.  Updated all
2481         references.
2482
2483 Sat Mar 12 12:15:49 2005  Ben Pfaff  <blp@gnu.org>
2484
2485         Thanks to Ben Kujala <bkujala@oregonchildcare.org> for reporting
2486         these bugs.
2487         
2488         * pfm-read.c: (read_header) Improve error message for many cases
2489         in which the input is not actually a portable file.
2490
2491         * file-handle.q: (fh_open) When we give an error message, actually
2492         return NULL.
2493
2494 Fri Mar 11 11:50:30 2005  Ben Pfaff  <blp@gnu.org>
2495
2496         * format.c: (check_common_specifier) New function for checks
2497         common to check_input_specifier() and check_output_specifier().
2498         (check_input_specifier) Use check_common_specifier().
2499         (check_output_specifier) Use check_common_specifier().
2500         (check_string_specifier) Removed.
2501         (check_specifier_type) New function.
2502         (check_specifier_width) New function.
2503         (get_format_var_width) Fix bug.
2504
2505         * formats.c: (internal_cmd_formats) Only accept numeric variables.
2506
2507         * lexer.c: (check_id) Rename lex_id_to_token(), make public,
2508         update all references.  Make case-insensitive.
2509
2510         * pfm-read.c: Essentially rewrite the whole file.  Now much
2511         cleaner.
2512
2513         * print.c: (check_string_width) New function.
2514         (fixed_parse_compatible) Use check_string_width(),
2515         check_specifier_type().
2516         (dump_fmt_list) Ditto.
2517
2518         * str.c: (st_trim_copy) New function.
2519         (st_uppercase) New function.
2520
2521         * vars-atr.c: (var_is_valid_name) New function.
2522         
2523         * expressions/parse.c: (type_coercion_core) Use
2524         check_specifier_type().
2525         
2526 Fri Mar 11 11:31:24 2005  Ben Pfaff  <blp@gnu.org>
2527
2528         * expressions/evaluate.c: (cmd_debug_evaluate) Fix memory leaks.
2529
2530         * expressions/parse.c: (no_match) Ditto.
2531
2532 Wed Mar  9 09:54:27 2005  Ben Pfaff  <blp@gnu.org>
2533
2534         * Makefile.am: (pspp_LDADD) Add libgsl-extras.a.
2535
2536         * expressions/helpers.c: (struct func_params) Removed.
2537         (generalized_idf) Removed.
2538         (cdf_beta) Removed.
2539         (idf_beta) Removed.
2540         (idf_fdist) Use gslextras_cdf_beta_Pinv() instead of idf_beta().
2541
2542         * expressions/operations.def: Implement IDF.BETA, CDF.BINOM,
2543         CDF.GEOM, CDF.HYPER, CDF.NEGBIN, CDF.POISSON using gsl-extras.
2544         Implement SIG.F, which I had overlooked previously.
2545
2546 Tue Mar  8 12:47:53 WST 2005 John Darrington <john@darrington.wattle.id.au>
2547
2548         * command.c command.def glob.[ch] cmdline.c: Made DEBUG cmds
2549         available only in testing mode.
2550
2551 Sun Mar  6 23:25:40 2005  Ben Pfaff  <blp@gnu.org>
2552
2553         * data-in.c: Use `bool' throughout, where relevant.
2554
2555 Sun Mar  6 19:52:22 2005  Ben Pfaff  <blp@gnu.org>
2556
2557         DATA LIST with free-field formats should not have implied decimal
2558         places (bug 12035).  Also clean up data-in.c a bit.
2559
2560         * data-in.h: (enum) Add DI_IMPLIED_DECIMALS.
2561
2562         * data-in.c: (apply_implied_decimals) New function.
2563         (parse_numeric) Don't adjust exponent if DI_IMPLIED_DECIMALS not
2564         set.  Also, get rid of gotos.
2565         (parse_Z) Use apply_implied_decimals() if the field doesn't
2566         contain a decimal point.
2567         (parse_N) Use apply_implied_decimals().
2568         (parse_IB) Ditto.
2569         (parse_PIB) Ditto.
2570         (parse_P) Ditto.
2571         (parse_PK) Ditto.
2572         (to_roman) Removed.
2573         (parse_enum) New function.
2574         (macro CHAR_IS_ROMAN) Removed.
2575         (macro ROMAN_VALUE) Removed.
2576         (parse_month) Use parse_enum().
2577         (parse_weekday) Use parse_enum().
2578         (parse_DATETIME) Use long for weekday.
2579
2580         * data-list.c: (read_from_data_list_fixed) Use
2581         DI_IMPLIED_DECIMALS.
2582
2583 Sun Mar  6 17:07:20 2005  Ben Pfaff  <blp@gnu.org>
2584
2585         When the lexer sees something like `-5' in the input, it has to
2586         decide whether it's a negative numeric constant token or a '-'
2587         token followed by a positive numeric constant token.  It always
2588         decides on the former, and then the parser can call
2589         lex_negative_to_dash() if it wants the latter.  However, this
2590         doesn't work for the case of `-0', because negative zero is
2591         (portably) indistinguishable from positive zero.  So now we divide
2592         T_NUM into two tokens, T_POS_NUM and T_NEG_NUM, to make the
2593         distinction clear.  This requires a little bit of extra effort,
2594         because there were several references to T_NUM in the code base.
2595         
2596         * lexer.c: (lex_get) Use T_NEG_NUM and T_POS_NUM to distinguish
2597         positive and negative numeric constants.
2598         (lex_double_p) Renamed lex_is_number().  Changed return type to
2599         bool.  Updated all relevant references to T_NUM to instead use
2600         this function.
2601         (lex_double) Renamed lex_number().  All references updated.
2602         (lex_integer_p) Renamed lex_is_integer().  Changed return type to
2603         bool.  All references updated.
2604         (lex_token_representation) Understand T_NEG_NUM and T_POS_NUM.
2605         (lex_negative_to_dash) Ditto.
2606         (dump_token) Ditto.
2607         
2608         * lexer.h: (enum) Add T_POS_NUM, T_NEG_NUM.  Remove T_NUM.
2609
2610 Sun Mar  6 22:09:20 2005  Ben Pfaff  <blp@gnu.org>
2611
2612         * expressions/operations.def: (NUMBER) Use DI_IMPLIED_DECIMALS.
2613
2614 Sun Mar  6 19:33:24 2005  Ben Pfaff  <blp@gnu.org>
2615
2616         * expressions/operations.def: (VEC_ELEM_NUM) Treat user-missing
2617         values as system-missing.
2618
2619         * expressions/parse.c: (parse_vector_element) Fix order of
2620         arguments in call to expr_allocate_binary().
2621
2622 Sun Mar  6 17:51:05 2005  Ben Pfaff  <blp@gnu.org>
2623
2624         * expressions/optimize.c: (optimize_tree) Fix optimization bug for
2625         x**2.
2626
2627         * expressions/parse.c: (type_coercion_core) Set *node to NULL on
2628         failure, as indicated by function comment.
2629         (parse_binary_operators) Always return NULL on type_coercion()
2630         failure.  Should have been doing this anyway, but bug in
2631         type_coercion_core() filtered through.
2632         (parse_add) Fix typo in user message.
2633         (parse_primary) Understand T_NEG_NUM and T_POS_NUM.
2634
2635 Sun Mar  6 10:47:13 2005  Ben Pfaff  <blp@gnu.org>
2636
2637         * expressions/operations.def: Add VALUE function.
2638
2639         * expressions/parse.c: (parse_function) Need an unary composite
2640         node for variables in A TO B, not a variable node.  Use
2641         allocate_unary_variable().
2642         (parse_primary) Use allocate_unary_variable().
2643         (allocate_unary_variable) New function.
2644
2645 Thu Mar  3 23:53:32 2005  Ben Pfaff  <blp@gnu.org>
2646
2647         * expressions/PSPP_expressions.pm: Renamed it back to generate.pl
2648         but fixed the real problem that was preventing the build from a
2649         separate directory.  I liked it my way better ;-)
2650         
2651 Thu Mar  3 23:17:51 2005  Ben Pfaff  <blp@gnu.org>
2652
2653         * expressions/parse.c: (expr_parse) Fix parameter type.  Thanks to
2654         John Darrington <john@darrington.wattle.id.au> for reporting this
2655         bug.
2656
2657 Thu Mar  3 22:10:25 WST 2005 John Darrington <john@darrington.wattle.id.au>
2658
2659         * expressions/Makefile.am expressions/evaluate.h.pl
2660           expressions/evaluate.inc.pl expressions/operations.h.pl
2661           expressions/optimize.inc.pl expressions/parse.inc.p:
2662
2663           Renamed generate.pl to PSPP_expressions.pm and adjusted *.pl
2664           to suit. 
2665
2666           Fixed everything so that it can be built from an arbitrary
2667           directory.
2668         
2669 Thu Mar  3 22:08:35 WST 2005 John Darrington <john@darrington.wattle.id.au>
2670
2671         * Makefile.am : Fixed up CLEANFILES target.
2672
2673 Mon Feb 28 23:49:56 2005  Ben Pfaff  <blp@gnu.org>
2674
2675         * str.h: Changed `struct len_string' to `struct fixed_string', a
2676         more accurate name.  Updated all references.
2677
2678 Mon Feb 28 23:35:30 2005  Ben Pfaff  <blp@gnu.org>
2679
2680         Redo calendar support.  Should now be bug-for-bug compatible.
2681         
2682         * calendar.c: New file.
2683
2684         * calendar.h: New file.
2685
2686         * data-in.c: Use new calendar functions.
2687         (parse_sign) Change sense of return value.
2688         (calendar_error) New function.
2689         (ymd_to_ofs) New function.
2690         (ymd_to_date) New function.
2691         (parse_DATE) Use new function.
2692         (parse_ADATE) Ditto.
2693         (parse_EDATE) Ditto.
2694         (parse_SDATE) Ditto.
2695         (parse_JDATE) Ditto.
2696         (parse_QYR) Ditto.
2697         (parse_MOYR) Ditto.
2698         (parse_WKYR) Ditto.
2699         (parse_TIME) Ditto.
2700         (parse_DTIME) Ditto.
2701         (parse_DATETIME) Ditto.
2702
2703         * data-out.c: (convert_date) Use new calendar functions.
2704
2705         * error.c: (err_vmsg) Changed interface to be more sensible.
2706         Updated all callers.
2707         (dump_message) Don't double new-lines (why did we do this
2708         anyway?).
2709
2710 Mon Feb 28 23:30:25 2005  Ben Pfaff  <blp@gnu.org>
2711
2712         * sfmP.h: (macro flt64) Moved here from pref.h.orig.
2713         (macro FLT64_MAX) Moved here from pref.h.orig.
2714
2715 Mon Feb 28 23:28:01 2005  Ben Pfaff  <blp@gnu.org>
2716
2717         * set.q: Support SET EPOCH.
2718         (static var set_epoch) New var.
2719         (aux_stc_custom_epoch) New function.
2720         (stc_custom_epoch) New function.
2721         (get_epoch) New function.
2722         (stc_custom_pager) [USE_INTERNAL_PAGER] Fix bug.
2723
2724         * format.c: Make it possible just to check whether a specifier is
2725         valid without emitting an error message.
2726         (parse_format_specifier_name) Change interface, update all
2727         callers.
2728         (check_input_specifier) Ditto.
2729         (check_output_specifier) Ditto.
2730         (parse_format_specifier) Ditto.
2731
2732 Mon Feb 28 23:24:08 2005  Ben Pfaff  <blp@gnu.org>
2733
2734         * command.def: Add DEBUG POOL.
2735
2736         * pool.c: (pool_destroy) Fix bug in deleting this pool from its
2737         parent.
2738         (pool_clear) Properly account for size of pool gizmo.
2739         (pool_realloc) Ditto.
2740         (pool_clone) New function.
2741
2742         * pool.h: Mark our allocation functions MALLOC_LIKE.
2743
2744 Mon Feb 28 23:21:26 2005  Ben Pfaff  <blp@gnu.org>
2745
2746         * Makefile.am: Move many definitions into new top-level
2747         Make.build.  Add expressions to SUBDIRS.  Add calendar.c,
2748         calendar.h.  Remove expr-evl.c, expr-opt.c expr-prs.c, expr.h,
2749         exprP.h, expr.def.
2750
2751         * case.c: (case_resize) New function.
2752         (case_swap) New function.
2753
2754         * casefile.c: Include mkfile.h.
2755
2756 Fri Feb 25 21:11:35 WST 2005 John Darrington <john@darrington.wattle.id.au>
2757
2758         * sfm-read.c: Fixed a buglet which caused a crash when trying
2759         to read a non-existent file.
2760
2761 Sun Feb 13 16:11:13 2005  Ben Pfaff  <blp@gnu.org>
2762
2763         Fix bug 11955.
2764
2765         * aggregate.c: (parse_aggregate_functions) Code cleanup.
2766         Important part: get rid of spurious copying of function->format to
2767         destvar->print and destvar->write.
2768
2769 Fri Feb 11 00:08:36 2005  Ben Pfaff  <blp@gnu.org>
2770
2771         Fix bug 11916, which was confusing a variable's `index' member
2772         with the variable's position in a var_set.  Although these are
2773         usually the same, they are not for array `var_set's.
2774         
2775         Took advantage of this bug as an opportunity to clean up and
2776         rewrite parse_var_set_vars().
2777
2778         * vars-prs.c: (parse_vs_variable_idx) New function.
2779         (parse_vs_variable) Reimplement in terms of
2780         parse_vs_variable_idx().
2781         (parse_var_idx_class) New function.
2782         (add_variable) New function.
2783         (add_variables) New function.
2784         (parse_var_set_vars) Rewritten.
2785         (struct var_set) Change `lookup_var' member that returns a
2786         variable into `lookup_var_idx' member that returns an int.
2787         Updated the var set implementations in obvious corresponding ways.
2788         Used compare_var_ptr_names(), hash_var_ptr_name() just added.
2789         
2790 Fri Feb 11 00:06:03 2005  Ben Pfaff  <blp@gnu.org>
2791
2792         Use our global variable compare & hash functions and give them
2793         better names.  Add similar functions for dealing with double
2794         pointers to variables.
2795         
2796         * vars-atr.c: (compare_variables) Renamed compare_var_names().
2797         (hash_variable) Renamed hash_var_name().
2798         (compare_var_ptr_names) New function.
2799         (hash_var_ptr_name) New function.
2800         
2801         * t-test.q: (cmd_t_test) Use global compare_var_names(),
2802         hash_var_name().
2803         (compare_var_name) Removed.
2804         (hash_var_name) Removed.
2805
2806 Fri Feb 11 00:04:39 2005  Ben Pfaff  <blp@gnu.org>
2807
2808         Fix dictionary bug.
2809         
2810         * dictionary.c: (compare_variable_dblptrs) Rename
2811         compare_var_ptrs() and fix it to properly dereference the double
2812         pointers.
2813
2814 Mon Feb  7 09:58:15 WST 2005 John Darrington <john@darrington.wattle.id.au>
2815
2816         crosstabs.q examine.q oneway.q q2c.c:  Added a q2c feature to 
2817         declare subcommands as mandatory.  Closed bug #11843
2818
2819 Sat Feb  5 20:35:10 WST 2005 John Darrington <john@darrington.wattle.id.au>
2820         
2821         * getline.c command.[ch] command.def:  Added (very rudimentary)
2822         support for line  completion when in interactive mode.  Partially 
2823         addresses bug #11693
2824         
2825 Mon Jan 31 09:52:51 WST 2005 John Darrington <john@darrington.wattle.id.au>
2826
2827         * examine.q factor_stats.c oneway.q output.c pfm-read.c: Fixed some
2828         problems revealed by valgrind.
2829
2830
2831 Wed Jan 26 11:44:11 WST 2005 John Darrington <john@darrington.wattle.id.au>
2832
2833         * set.q: Affixed a fix to the previous fix such that we'll be OK now
2834         whether or not PAGER is set.
2835
2836 Wed Jan 26 09:25:54 WST 2005 John Darrington <john@darrington.wattle.id.au>
2837
2838         * set.q: Copied the string produced by getenv("PAGER") thus avoiding
2839         "invalid free" errors.  Hopefully fixes bug #11722
2840
2841         * compute.c expr-prs.c: Check that lvalues are populated before 
2842         attempting to destroy them.  Closes bug #11676
2843
2844 Tue Jan 25 21:01:43 WST 2005 John Darrington <john@darrington.wattle.id.au>
2845
2846         * aggregate.c: Initialised the complete agr_proc structure.
2847         Closes bug #11675
2848
2849
2850 Sun Jan 23 23:02:21 2005  Ben Pfaff  <blp@gnu.org>
2851
2852         * print.c: (print_trns_free) Close the dfm writer if there is one,
2853         fixing a memory leak.
2854
2855 Mon Jan 24 12:24:36 WST 2005 John Darrington <john@darrington.wattle.id.au>
2856
2857         * glob.c oneway.q q2c.c t-test.q vfm.c: Still *more* memory leaks 
2858         fixed.
2859
2860
2861 Fri Jan 21 19:54:14 WST 2005 John Darrington <john@darrington.wattle.id.au>
2862
2863         * linked-list.[ch] Added
2864
2865         * examine.q file-handle.[hq] font.h glob.c groff-font.c postscript.c 
2866           set.q:    Yet more memory leaks
2867
2868 Tue Jan 18 23:12:40 WST 2005 John Darrington <john@darrington.wattle.id.au>
2869
2870         * t-test.q examine.q : More memory leaks fixed.
2871
2872 Tue Jan 18 19:26:59 WST 2005 John Darrington <john@darrington.wattle.id.au>
2873
2874         * examine.q  factor_stats.[ch] get.c pfm-read.c: Plugged numerous
2875         memory leaks.
2876
2877 Mon Jan 10 14:43:45 WST 2005 John Darrington <john@darrington.wattle.id.au>
2878
2879         * ascii.c cartesian.c casefile.c chart.h devind.c 
2880           examine.q frequencies.q
2881           html.c output.h piechart.c plot-chart.c plot-hist.c
2882
2883           Integrated the chart rendering into the output stream
2884           (currently only works for html).
2885           
2886           Removed gratuitous use of ifndef NO_CHARTS, and replaced with
2887           dummy-chart.c for compiling without charts.
2888
2889         * mkfile.[ch] Created.  
2890
2891         * som.[ch] tab.[ch]: Changed name of som_table to som_entity
2892         Added type element so we can tell if it's a chart or a table.
2893
2894         * chart.h examine.q piechart.c plot-chart.c plot-hist.c: changed the 
2895         API of charts to be more like that of tables.
2896
2897 Thu Jan 13 21:00:02 WST 2005 John Darrington <john@darrington.wattle.id.au>
2898
2899         * casefile.c main.c: Moved the SIGINT handler from casefile.c to
2900         main.c. Removed the handler for SIGQUIT.
2901
2902 Mon Jan 10 14:43:45 WST 2005 John Darrington <john@darrington.wattle.id.au>
2903
2904         * casefile.c: Added a signal handler to delete temp files on 
2905         SIGINT and SIGQUIT
2906
2907         * permissions.c Inhibited the PERMISSIONS command when SAFER is on.
2908
2909         * command.def Added a lot more unimplemented commands.
2910
2911         * copyleft.[ch] cmdline.c Moved legal information to copyleft.c
2912
2913 Sat Jan  8 23:58:34 2005  Ben Pfaff  <blp@gnu.org>
2914
2915         * sort.c: (compare_initial_runs) Needed additional level of
2916         dereferencing.
2917         (merge_once) Fix plenty of stupid mistakes.
2918
2919 Sat Jan  8 23:55:27 2005  Ben Pfaff  <blp@gnu.org>
2920
2921         * casefile.c: (casefile_sleep) Need to flush_buffer() after
2922         calling casefile_to_disk() or we will lose the last block in the
2923         file if the casefile started out as disk-based.
2924         (casefile_get_reader) Initialize reader->destructive to 0.
2925         (cmd_debug_casefile) Add new test pattern.
2926         (test_casefile) Define new test pattern to make sure
2927         casefile_sleep() works properly.
2928
2929 Fri Jan  7 08:00:05 WST 2005 John Darrington <john@darrington.wattle.id.au>
2930
2931         * Makefile.am chart.[ch]  histogram.[ch] piechart.c (Modified);
2932           plot-hist.c plot-chart.c (Added) Reorganised these files in an
2933           attempt to seperate the creation and processing of charts from their
2934           actuall renedering.
2935
2936         * examine.q frequencies.q generated charts conditional upon the NO_CHARTS
2937           macro.
2938
2939 Thu Jan  6 18:48:58 WST 2005 John Darrington <john@darrington.wattle.id.au>
2940
2941         * main.c Added a signal handler for SIGFPE
2942
2943         * sort.c Somewhat more robust fix to the previous entry.
2944
2945 Wed Jan  5 21:23:31 2005  Ben Pfaff  <blp@gnu.org>
2946
2947         * sort.c: (merge) Fix assertion for proper Huffman merge pattern:
2948         0 == 1 modulo 1.  See Knuth 5.4.9 (vol. 3, 2nd ed.,
2949         pp. 361).  Thanks to John Darrington <john@cellform.com.au> for
2950         reporting the bug.
2951
2952 Wed Jan  5 22:42:26 WST 2005 John Darrington <john@darrington.wattle.id.au>
2953
2954         * case.h Fixed bug # 11307
2955         
2956 Wed Jan  5 08:30:48 WST 2005 John Darrington <john@darrington.wattle.id.au>
2957
2958         * val-labs.c Fixed bug which caused a crash if VALUE LABELS had
2959         a trailing slash.
2960
2961 Mon Jan  3 17:44:37 2005  Ben Pfaff  <blp@gnu.org>
2962
2963         * pfm-read.c: (read_variables) Remove direct manipulation of
2964         v->aux, which is no longer needed.  Fixes bug 11483.
2965
2966 Sat Jan  1 19:01:16 WST 2005 John Darrington <john@darrington.wattle.id.au>
2967
2968         * data-list.c Fixed a bug in parsing delimiters.
2969
2970         * group.c vars-atr.c Fixed buglet in hash/compare functions for alpha
2971         values.
2972
2973         * percentiles.c Properly handled calculation of Tukey hinges where
2974         the number of data is small.
2975
2976         * oneway.q Used the generic value_to_string function for independent
2977         variable instead of trying to do it ourselves.
2978
2979         * box-whisker.c Fixed a buglet which caused a crash if the number of
2980         data was zero
2981
2982
2983 Fri Dec 31 16:47:45 WST 2004 John Darrington <john@darrington.wattle.id.au>
2984
2985         * examine.q box-whisker.c chart.h Implemented boxplots in EXAMINE
2986
2987         * percentiles.c Fixed some bugs when calculating percentiles when
2988         there's a small number of cases.
2989
2990 Wed Dec 29 08:18:08 WST 2004 John Darrington <john@darrington.wattle.id.au>
2991
2992         * percentiles.[ch] Added. Calculates percentiles and Tukey hinges
2993
2994         * examine.q factor_stats.[ch]  Added calculation of percentiles
2995
2996 Fri Dec 24 15:09:11 WST 2004 John Darrington <john@darrington.wattle.id.au>
2997
2998         * t-test.q Fixed bug #11227 Made t-test work when the independent
2999         variable is alpha
3000
3001 Sat Dec 11 11:43:45 WST 2004 John Darrington <john@darrington.wattle.id.au>
3002
3003         * factor_stats.c Fixed calculation of trimmed mean under various
3004         special conditions.
3005
3006 Sat Dec  4 17:14:45 WST 2004 John Darrington <john@darrington.wattle.id.au>
3007
3008         * histogram.c chart.[ch] factor_stats.c frequencies.q
3009
3010         Added code to calculate sensible histogram ranges and limits.
3011
3012 Thu Dec  2 13:37:43 WST 2004 John Darrington <john@darrington.wattle.id.au>
3013
3014         * chart.h Updated to reflect many API changes.
3015
3016         * cartesian.c chart.c Moved the definitions of chart_write_{xy}scale from 
3017         cartesian.c and into chart.c
3018
3019         * factorstats.[ch] Added the histogram calculations
3020
3021         * casefile.c Removed an unused variable.
3022
3023         * frequencies.q examine.q histogram.c  Reworked the API for 
3024         histograms.
3025
3026         * piechart.c  Revised the API for piecharts.
3027
3028         * var.h  Moved the definitions of freq_tab and freq out of var.h
3029         and into frequencies.q where they belong.
3030         
3031 Tue Nov 30 21:10:20 2004  Ben Pfaff  <blp@gnu.org>
3032
3033         * flip.c: (flip_file) Check for off_t separately from fseeko(),
3034         using AC_TYPE_OFF_T.
3035
3036 Tue Nov 30 08:47:41 2004  Ben Pfaff  <blp@gnu.org>
3037
3038         * flip.c: (flip_file) If fseeko() is not available, use long int
3039         for off_t.  Thanks to "Marshall DeBerry" <mdb@radix.net> for
3040         reporting the problem.
3041
3042 Mon Nov 29 12:20:59 WST 2004 John Darrington <john@darrington.wattle.id.au>
3043
3044         * examine.q factor_stats.[ch] Changed stderr to se_mean to avoid
3045         conflict with stdio.
3046
3047 Sun Nov 21 10:32:41 WST 2004 John Darrington <john@darrington.wattle.id.au>
3048
3049         * var-labs.c (var_to_string) Now returns null if the variable is null
3050
3051         * value-labels.c (value_to_string) Made it return null if either the 
3052         value or the variable is null.
3053
3054         * hash.c (hsh_clear) Fixed a buglet.
3055
3056         * examine.q  factor_stats.[ch] Largely  rewrote, because I'd started 
3057         with  the wrong model.
3058
3059         * casefile.[ch] Added a function to return the casereader.case_idx 
3060         member
3061
3062         * examine.q  Implemented the extreme values results.
3063
3064 John Darrington <john@darrington.wattle.id.au>
3065
3066         * settings.h set.c glob.[ch] frequencies.q q2c.c error.c lexer.[ch] 
3067           output.[ch] getline.c 
3068
3069           Plugged some memory leaks
3070
3071 Mon Nov 15 23:47:40 2004  Ben Pfaff  <blp@gnu.org>
3072
3073         Adopt GSL random number generators, paving the way for providing
3074         the complete suite of random number generators on expressions.
3075         
3076         * Makefile.am: Remove random.c, random.h.
3077
3078         * random.c: Removed.
3079
3080         * random.h: Removed.
3081
3082         * algorithm.c: (algo_default_random) Use GSL functions.
3083
3084         * casefile.c: (test_casefile) Use GSL RNG functions.
3085
3086         * expr-evl.c: (expr_evaluate) Use GSL RNG functions for OP_NORMAL,
3087         OP_UNIFORM.
3088
3089         * sample.c: (cmd_sample) Use GSL RNG functions.
3090         (sample_trns_proc) Ditto.
3091
3092         * set.q: (static var set_seed) Removed.
3093         (static var seed_flag) Removed.
3094         (static var rng) New variable.
3095         (aux_stc_custom_seed) No seed value anymore, don't print anything.
3096         (stc_custom_seed) Use new seed functions.
3097         (seed_is_set) Removed.
3098         (get_rng) New function that composes the entire external
3099         interface.
3100         (set_rng) New function.
3101         (random_seed) New function.
3102
3103 Mon Nov 15 22:08:25 2004  Ben Pfaff  <blp@gnu.org>
3104
3105         * expr-evl.c: (expr_evaluate) Fix XDATE.JDAY formula.  Thanks to
3106         John Darrington <john@darrington.wattle.id.au> for reporting this
3107         bug.
3108
3109 Tue Nov 16 13:19:18 WST 2004 John Darrington <john@darrington.wattle.id.au>
3110
3111         * permissions.c command.def Added the PERMISSIONS command
3112
3113 Mon Nov 15 01:33:32 2004  Ben Pfaff  <blp@gnu.org>
3114
3115         * q2c.c: (dump_header) Don't try to emit #includes at very top of
3116         output file because that will precede #include <config.h>, which
3117         is bad.
3118         (main) Add needed headers to /* (header) */ code.
3119
3120 Mon Nov 15 01:21:36 2004  Ben Pfaff  <blp@gnu.org>
3121
3122         Instead of making system or portable file readers responsible for
3123         dropping and reordering variables, make them read full cases and
3124         let the caller take care of any changes.
3125
3126         * get.c: New "case map" structure to handle this.  Use for GET,
3127         IMPORT, MATCH FILES.  Essentially rewrite the whole file.
3128
3129         * pfm-read.c: (pfm_read_case) Read into provided case.  Signature
3130         changed appropriately.
3131
3132         * sfm-read.c: (sfm_read_case) Ditto.
3133
3134 Mon Nov 15 00:47:45 2004  Ben Pfaff  <blp@gnu.org>
3135
3136         Decided that case_serialize() and case_unserialize() were too
3137         abstract.  Also we need a couple more functions to avoid excessive
3138         copying for data in/out fast paths.
3139
3140         * case.c: (case_serial_size) Removed.
3141         (case_serialize) Rename case_to_values() and make its argument
3142         explicitly an array of union values.
3143         (case_unserialize) Rename case_from_values() and make its argument
3144         explicitly an array of union values.
3145         (case_data_all) New function.
3146         (case_data_all_rw) New function.
3147
3148         * casefile.c: (struct casefile) Change buffer from array of
3149         unsigned char to array of union value for better accuracy.
3150         Redefine buffer_used and buffer_size in terms of values, not
3151         bytes.  Remove case_size because it is now redundant with
3152         value_cnt.  Fix up all references to these members.
3153
3154 Mon Nov 15 00:45:46 2004  Ben Pfaff  <blp@gnu.org>
3155
3156         * barchart.c: (struct subcat) Make `label' member const to silence
3157         GCC warning with -Wwrite-strings.
3158
3159         * cartesian.c: (struct dataset) Ditto.
3160
3161         * case.c: Don't re-define NDEBUG if already defined.
3162         Add lots of comments.
3163
3164         * str.c: Fix includes.
3165
3166         * crosstabs.q: Fix includes.
3167
3168         * examine.q: Fix includes.  Fix GCC warning about unused
3169         variables.
3170         
3171         * frequencies.q: (stat macro) Removed and replaced where used by
3172         its expansion.
3173
3174         * list.q: Fix includes.
3175
3176         * oneway.q: Fix includes.
3177
3178         * piechart.c: Fix includes.  Only define M_PI if not already
3179         defined.
3180
3181         * sfm-read.c: (bswap) New function.
3182         (bswap_int32) Write in terms of bswap.
3183         (bswap_flt64) Ditto.
3184
3185         * str.c: (ds_data) Add external definition here, needed because
3186         str.h has only an `extern inline' version.
3187
3188         * value-labels.c: Fix includes.
3189
3190 Mon Nov 15 00:40:55 2004  Ben Pfaff  <blp@gnu.org>
3191
3192         Instead of providing a system or portable file writer with a raw
3193         case in the format needed for output, provide it with a regular
3194         case.  The writer takes care of any needed translation.
3195
3196         * aggregate.c: Adopt new scheme for AGGREGATE.
3197         (struct agr_proc) sfm_agr_case member removed.
3198         (write_case_to_sfm) Removed because the new interface is easier to
3199         use.
3200
3201         * get.c: Adopt new scheme for SAVE, XSAVE, EXPORT.
3202
3203         * pfm-write.c: Implement new scheme.
3204
3205         * sfm-write.c: Ditto.
3206
3207 Mon Nov 15 00:32:24 2004  Ben Pfaff  <blp@gnu.org>
3208
3209         Instead of treating `struct file_handle' as a class to subclass
3210         into data files, system files, and portable files, instead use it
3211         as a helper that coordinates access.  Now it is opaque, too.
3212
3213         This means that most references to a struct file_handle are now
3214         changed into references to one of struct dfm_reader, struct
3215         dfm_writer, struct sfm_reader, struct sfm_writer, struct
3216         pfm_reader, or struct pfm_writer, according to what's being read
3217         or written.
3218
3219         Most related changes are only worth summarizing briefly.
3220
3221         * dictionary.c: (dict_clear) Destroy aux data in deleted
3222         variables.
3223         (dict_clear_aux) New function.
3224         (dict_create_var) Initialize aux, aux_dtor.
3225         (dict_delete_var) Destroy aux data in deleted variable.
3226
3227         * file-handle.h: (struct fh_ext_class) Removed.
3228         (struct file_handle) Removed.
3229         (fh_init_files) Removed.
3230
3231         * file-handle.q: Changed references to a handle's `private' member
3232         to direct references.
3233         (struct private_file_handle) Renamed file_handle.
3234         Add next, open_cnt, type, open_mode, aux members.
3235         (struct file_handle_list) Removed.
3236         (extern var inline_file) Removed.
3237         (static var file_handles) Changed from file_handle_list * to
3238         file_handle *.
3239         (create_file_handle) Initialize new members.
3240         (fh_close_handle) Removed.
3241         (mode_name) New function.
3242         (fh_open) New function.
3243         (fh_close) New function.
3244         (fh_parse_file_handle) Renamed fh_parse().
3245
3246         * glob.c: (init_glob) Remove fh_init_files() call.
3247         
3248         * aggregate.c: use sfm_writer.
3249         (create_sysfile) Removed because the new interface is simpler.
3250         
3251         * apply-dict.c: Use sfm_reader.
3252
3253         * data-list.c: Use dfm_reader.
3254
3255         * file-type.c: Use dfm_reader.
3256
3257         * get.c: Use sfm_reader, sfm_writer, pfm_reader, pfm_writer.
3258
3259         * inpt-pgm.c: Use dfm_reader.
3260
3261         * print.c: Use dfm_writer.
3262
3263         * sysfile-info: Use sfm_reader.
3264
3265         * dfm-read.c: Adopt new file handle infrastructure.
3266
3267         * dfm-write.c: Ditto.
3268
3269         * pfm-read.c: Ditto.
3270         
3271         * pfm-write.c: Ditto.
3272
3273         * sfm-read.c: Ditto.
3274
3275         * sfm-write.c: Ditto.
3276         
3277 Mon Nov 15 00:31:44 2004  Ben Pfaff  <blp@gnu.org>
3278
3279         Break dictionary functions into separate header file.
3280
3281         * dictionary.h: New file.
3282
3283         * var.h: Moved dict_*() functions to dictionary.h.
3284
3285 Mon Nov 15 00:30:33 2004  Ben Pfaff  <blp@gnu.org>
3286
3287         Get rid of procedure-specific union in struct variable, using
3288         instead a void * pointer and a destructor function.
3289
3290         Most related changes are only worth brief summaries.
3291
3292         * crosstabs.q: Fix includes.  Use new struct var_range in lieu of
3293         old p.crs member in struct variable.
3294         
3295         * frequencies.q: Fix includes.  Use new struct var_freqs in lieu
3296         of old p.frq member in struct variable.
3297
3298         * histogram.c: (draw_histogram) Takes new freq_tab arg because
3299         it's no longer possible to grab this from var->p.frq.
3300
3301         * piechart.c: (draw_piechart) Ditto.
3302
3303         * group.c: (group_proc_get) New function.
3304
3305         * levene.c: Use group_proc_get() in lieu of old p.grp_data member
3306         in struct variable.
3307
3308         * oneway.q: Ditto.
3309
3310         * t-test.q: Ditto.
3311
3312         * main.c: (execute_command) Clear aux data in default_dict after
3313         each command.  (It's debatable whether this should be done.)
3314
3315         * matrix-data.c: Use new struct mxd_var in lieu of old p.mxd
3316         member in struct variable.
3317
3318         * means.q: Get rid of integer mode, which is not included in
3319         recent SPSS and was the only code that wanted per-variable private
3320         data.
3321
3322         * var.h: (struct crosstab_proc) Removed.
3323         (struct frequencies_proc) Removed.
3324         (struct list_proc) Removed.
3325         (struct get_proc) Removed.
3326         (struct means_proc) Removed.
3327         (struct matrix_data_proc) Removed.
3328         (struct match_files_proc) Removed.
3329         (lots of enums) Removed.
3330         (struct variable) Removed members `p', `get'.  Add member
3331         `aux_dtor'.
3332
3333         * vars-atr.c: (var_attach_aux) New function.
3334         (var_detach_aux) New function.
3335         (var_clear_aux) New function.
3336         (var_dtor_free) New function.
3337         (discard_variables) Use NULL instead of inline_file.
3338
3339 Fri Nov 12 10:07:11 WST 2004 John Darrington <john@darrington.wattle.id.au>
3340
3341         * value-labs.c  Fixed the implmentation of value_to_string, so 
3342         that it properly handles alpha values.
3343
3344         * oneway.q  Changed instances where labels were being probed manually, 
3345         to use the canonical {var,value}_to_string functions
3346
3347 Thu Nov 11 21:01:31 WST 2004 John Darrington <john@darrington.wattle.id.au>
3348
3349         * examine.q cartesian.c chart.[ch]   Added normal and detrended normal
3350         plots.  Changed the API of the cartesian plot to be a much lower level
3351         thing.
3352
3353 Sun Nov  7 17:25:04 WST 2004 John Darrington <john@darrington.wattle.id.au>
3354
3355         * examine.q Added some of the parametric calculations
3356
3357         * factor_stats.[ch]  Created
3358         
3359 Sat Nov  6 21:24:31 WST 2004 John Darrington <john@darrington.wattle.id.au>
3360
3361         * examine.q  Changed the definition of factors to be a composite, and
3362         dealt with the consequences.
3363
3364 Sat Nov  6 20:40:38 WST 2004 John Darrington <john@darrington.wattle.id.au>
3365
3366         * examine.q Fixed problem where examine wasn't dealing properly with 
3367         splits
3368
3369 Sat Nov  6 14:49:47 WST 2004 John Darrington <john@darrington.wattle.id.au>
3370
3371         * oneway.q Fixed problem where oneway wasn't dealing properly with 
3372         splits
3373
3374 Thu Nov  4 11:09:01 WST 2004 John Darrington <john@darrington.wattle.id.au>
3375
3376         * q2c.c examine.q  Fixed a bug (feature?) whereby arrays in the
3377         command which had settings didn't get the appropriate code
3378         generated.
3379
3380         * val.h value-labels.[ch] var-labs.c Added v*to_string functions
3381         to convert variables/values to strings.
3382
3383         * examine.q  Added framework for the EXAMINE command.
3384
3385 Mon Nov  1 12:46:17 WST 2004 John Darrington <john@darrington.wattle.id.au>
3386
3387         * q2c.c frequencies.q set.q t-test.q  Fixed the q2c parsing of DBL 
3388         subcommand types.  Changed frequencies.q to use it rather then the 
3389         custom parser.  Dealt with the consequences.  Added a test for NTILES
3390         subcommand of frequencies.
3391
3392 Sat Oct 30 09:16:29 WST 2004 John Darrington <john@darrington.wattle.id.au>
3393
3394         * oneway.q   Fixed up the behaviour when given missing values
3395
3396         * levene.c oneway.q Fixed a buglet with the levene statistic and
3397         incorporated the levene test into the oneway command.
3398
3399         * group.h  t-test.q  Moved the CMP_EQ and CMP_LE symbols out of 
3400         global scope, since they're only relevant to T-TEST
3401
3402 Fri Oct 29 17:39:03 WST 2004 John Darrington <john@darrington.wattle.id.au>
3403
3404         * group.c group.h group_proc.h levene.c oneway.q t-test.q
3405
3406         Made the t-test more consistent
3407         with the way it handles groups.  That is, it now uses a hash instead
3408         of an array of 2.  Also, made the levene.c file independent of the 
3409         implementation of the t-test.  So now levene should be fine for both
3410         t-test and anova.
3411
3412         * Added an oneway.q file for one way anova
3413
3414 Wed Jun  2 22:08:02 2004  Ben Pfaff  <blp@gnu.org>
3415
3416         * descript.c: (cmd_descriptives) Remove harmless but bogus test in
3417         STATISTICS parsing.
3418
3419 Mon May 31 20:45:24 2004  Ben Pfaff  <blp@gnu.org>
3420
3421         Fix memory leaks.
3422
3423         * data-list.c: (cmd_data_list) Free dls->delims on lossage.
3424         (data_list_trns_free) Free dls->delims.
3425
3426         * t-test.q: (tts_custom_pairs) Free vars.
3427         (ssbox_one_sample_init) Fix tab_vline() argument.
3428         (ssbox_independent_samples_init) Ditto.
3429         (trbox_paired_init) Ditto.
3430         (trbox_one_sample_init) Ditto.
3431
3432 Mon May 31 17:19:27 2004  Ben Pfaff  <blp@gnu.org>
3433
3434         Generalize casefiles to the extent that we can use them for
3435         sorting and other kinds of data transformations.  Change cases to
3436         be copy-on-write to improve memory efficiency in common cases.
3437         Every access to a member of a `struct ccase' was changed to be a
3438         call to a case_*() function, especially case_data(), case_num(),
3439         case_str(), or case_data_rw().  Many instances of a local variable
3440         named "case_num" were changed to "case_idx" as a consequence.
3441         Many `struct ccase *' were changed to actual `struct ccase'
3442         because of copying semantics of cases.  In several places there
3443         was a choice between updating debug code to work with the new ADTs
3444         or just deleting it because it was useless; I chose to delete it.
3445  
3446         * Makefile.am: (pspp_SOURCES) Add case.c, case.h.
3447
3448         * case.c: New file.
3449
3450         * case.h: New file.
3451
3452         * aggregate.c: (struct agr_proc) Change type of `sort' to
3453         sort_criteria *.  Add `break_vars', `break_var_cnt' members.
3454         Rename `vars' to `agr_vars', all references updated.  Change
3455         `agr_case' to type `struct ccase'.
3456         (cmd_aggregate) Deal with new members.  Use case_create(),
3457         sort_active_file_in_place(), sort_active_file_to_casefile().
3458         (agr_destroy) Deal with new members.
3459         (aggregate_single_case) Ditto.
3460         (dump_aggregate_info) Ditto.
3461         (initialize_aggregate_info) Ditto.
3462         (agr_to_active_file) Ditto.
3463         (presorted_agr_to_sysfile) Ditto.
3464         (sort_agr_to_sysfile) Removed.
3465
3466         * alloc.c: (out_of_memory) Make non-static.
3467
3468         * alloc.h: Prototype out_of_memory().
3469
3470         * casefile.c: Switched from a linked list in-memory representation
3471         to a two-level array-style representation.  The linked list was
3472         appropriate when we could stick a header onto cases, but that's no
3473         longer the case.  Also, the two-level array will allow for random
3474         in-memory access in case that's ever wanted.  Also added the
3475         concept of a `destructive casereader', one that destroys cases in
3476         the underlying casefile as they are read out.
3477         (macro CASES_PER_BLOCK) New macro.
3478         (struct casefile) New members `value_cnt', `case_list_size',
3479         `case_acct_size', `being_destroyed', `cases'.  Removed `head',
3480         `tail'.
3481         (struct casereader) Removed `cur'.  Added `destructive', `c'.
3482         (global var casefiles) Made static.
3483         (static var case_bytes) New var.
3484         (casefile_create) Takes a value count, not a case size in bytes,
3485         to conform to the case interface.  All callers updated.  Deal with
3486         new and removed members.
3487         (casefile_destroy) Deal with new and removed members.
3488         (casefile_sleep) New function.
3489         (casefile_get_case_size) Removed.
3490         (casefile_get_value_cnt) New function.
3491         (casefile_append) Rewritten to deal with new and removed members.
3492         (casefile_append_xfer) New function.
3493         (write_case_to_disk) Use case_serialize().
3494         (call_posix_fadvise) Removed because posix_fadvise64 segfaults.
3495         Couldn't figure out why.
3496         (casefile_to_disk) Don't call call_posix_fadvise.  Rewritten to
3497         deal with new and removed members.
3498         (merge) Removed.
3499         (merge_sort) Removed.
3500         (casefile_sort) Removed.
3501         (casefile_get_reader) Deal with new and removed members.
3502         (casefile_get_destructive_reader) New function.
3503         (reader_open_file) Make code more readable.  Create case for
3504         reader.
3505         (casereader_get_casefile) New function.
3506         (casereader_read) Deal with new and removed members.  Now returns
3507         a copy of the case, so that the caller is responsible for
3508         destroying the returned case.
3509         (casereader_read_xfer) New function.
3510         (casereader_destroy) Destroy reader's case.
3511         (test_casefile) Second arg is now a value count, all callers
3512         updated.  Now tests destructive readers too.
3513         (get_random_case) Deal with new case ADT.
3514         (write_random_case) Ditto.
3515         (read_and_verify_random_case) Ditto.
3516
3517         * crosstabs.q: Remove debug code.
3518
3519         * descript.q: (calc_descriptives) Deal with new case, casefile
3520         ADTs.
3521
3522         * dfm.c: (cmd_begin_data) There's no storage_source_class anymore.
3523
3524         * do-if.c: Remove unneeded header inclusion.
3525
3526         * expr-prs.c: Remove debug code.
3527
3528         * exprP.h: Remove debug code.
3529
3530         * flip.c: (flip_file) Use fseeko() if available.
3531
3532         * formats.c: Remove debug code.
3533
3534         * get.c: Remove debug code.
3535         (struct mtf_file) Change `input' from `union value *' to `struct
3536         ccase', all references updated.
3537
3538         * levene.c: (levene) Deal with new case, casefile ADTs.
3539
3540         * list.q: Remove debug code.
3541
3542         * loop.c: Remove debug code.
3543         
3544         * matrix-data.c: Remove debug code.
3545
3546         * means.q: Remove debug code.
3547
3548         * mis-val.c: Remove debug code.
3549
3550         * pfm-read.c: Remove debug code.
3551         (pfm_read_code) Change second arg from `union value *' to `struct
3552         ccase *', all references updated.
3553
3554         * recode.c: (string_to_long) Make first arg const.
3555         (convert_to_double) Ditto.
3556
3557         * repeat.c: Remove debug code.
3558
3559         * sample.c: Remove debug code.
3560
3561         * sfm-read.c: Remove debug code.
3562         (sfm_read_case) Change second arg from `union value *' to `struct
3563         ccase *'.
3564
3565         * sort.c: Redone in terms of casefiles.
3566         (enum sort_direction) Moved here from sort.h.
3567         (struct sort_criterion) New structure.
3568         (struct sort_criteria) New structure.
3569         (cmd_sort_cases) Rewritten.
3570         (prepare_to_sort_active_file) New function.
3571         (sort_active_file_in_place) New function.
3572         (sort_active_file_to_casefile) New function.
3573         (parse_sort) Renamed sort_parse_criteria(), rewritten & interface
3574         changed, all callers updated.
3575         (destroy_sort_cases_pgm) Renamed sort_destroy_criteria(),
3576         rewritten & interface changed, all callers updated.
3577         (sort_cases) Renamed sort_execute(), rewritten & interface
3578         changed, all callers updated.
3579         (struct internal_sort) Removed.
3580         (do_internal_sort) Rewritten, interface changed.
3581         (destroy_internal_sort) Removed.
3582         (compare_case_dblptrs) Use sort_criteria instead of sort_case_pgm.
3583         (struct initial_run) Removed; an initial run is now just a
3584         casefile.
3585         (compare_initial_runs) Rewritten.
3586         (struct external_sort) Changed almost completely.
3587         (do_external_sort) Rewritten, interface changed.
3588         (destroy_external_sort) Rewritten.
3589         [HAVE_MKDTEMP] (make_temp_dir) Removed.
3590         [!HAVE_MKDTEMP] (do_mkdir) Removed.
3591         [!HAVE_MKDTEMP] (make_temp_dir) Removed.
3592         (init_external_sort) Removed.
3593         (simulate_error) Removed.
3594         (rmdir_temp_dir) Removed.
3595         (get_temp_file_name) Removed.
3596         (open_temp_file) Removed.
3597         (close_temp_file) Removed.
3598         (remove_temp_file) Removed.
3599         (write_temp_file) Removed.
3600         (read_temp_file) Removed.
3601         (struct record_run) Change `record' from `struct case_lit *' to
3602         `struct ccase'.
3603         (struct initial_run_state) Remove `idx_to_fv', `free_list',
3604         `file_idx', `output_file'.  Add `run', casefile'.  Change
3605         `last_output' from `struct case_list *' to `struct ccase'.
3606         (write_initial_runs) Change interface, rewrite.
3607         (sort_sink_write) Renamed process_case(), changed interfaced,
3608         rewrote.
3609         (destroy_initial_run_state) Rewritten.
3610         (allocate_cases) Rewritten.
3611         (compare_record) Interface changed, rewritten.
3612         (start_run) Rewritten.
3613         (end_run) Rewritten.
3614         (output_record) Rewritten.
3615         (grab_case) Removed.
3616         (release_case) Removed.
3617         (struct merge_case) Change `cases' from double pointer to single
3618         pointer.
3619         (merge) Deal with new case and casefile ADTs.
3620         (struct run) Removed.
3621         (merge_once) Rewritten, interface changed.
3622         (fill_run_buffer) Removed.
3623         (sort_sink_make_source) Removed.
3624         (sort_sink_class) Removed.
3625         (struct sort_source_aux) Removed.
3626         (sort_source_read_helper) Removed.
3627         (sort_source_read) Removed.
3628         (read_sort_output) Removed.
3629         (read_internal_sort_output) Removed.
3630         (read_external_sort_output) Removed.
3631         (sort_source_destroy) Removed.
3632         (sort_source_class) Removed.
3633
3634         * sort.h: (struct sort_cases_pgm) Removed.
3635         (enum sort_direction) Moved to sort.c.
3636
3637         * t-test.q: (calculate) Deal with new case, casefile ADTs.
3638
3639         * tab.c: Remove debug code.
3640
3641         * var-labs.c: Remove debug code.
3642
3643         * var.h: (struct ccase) Removed.
3644         (struct case_list) Removed.
3645
3646         * vars-atr.c: (discard_variables) Use free_case_source().
3647
3648         * vars-prs.c: (parse_vs_variable) Make arg const.
3649         (parse_dict_variable) Ditto.
3650         (parse_variables) Make struct dictionary * arg const.
3651         (parse_var_set_vars) Make struct var_set * arg const.
3652         (struct var_set) Add const to some of the function pointers' args.
3653         (var_set_get_cnt) Make arg const.
3654         (var_set_get_var) Make first arg const.
3655         (var_set_lookup_var) Make first arg const.
3656         (dict_var_set_get_cnt) Make arg const.
3657         (dict_var_set_get_var) Make first arg const.
3658         (dict_var_set_lookup_var) Make first arg const.
3659         (var_set_create_from_dict) Make arg const.  Add cast to aux
3660         assignment.
3661         (struct array_var_set) Add const to var member.
3662         (array_var_set_get_cnt) Make arg const.
3663         (array_var_set_get_var) Make first arg const.
3664         (array_var_set_lookup_var) Make first arg const.
3665         (var_set_create_from_array) Make first arg const.  Insert cast.
3666
3667         * vfm.c: (struct write_case_data) Change trns_case, sink_case
3668         members from `struct ccase *' to `struct ccase'.
3669         (static var lag_queue) Change from double to single pointer.
3670         (procedure) Optimize trivial case.
3671         (internal_procedure) Deal with changed case, case_source ADTs.
3672         (create_trns_case) Changed interface, rewrote.
3673         (open_active_interface) Initialize modified lag queue.
3674         (write_case) Deal with changed case ADT.
3675         (lag_case) Deal with modified lag queue.
3676         (close_active_file) Destroy modified lag queue.
3677         Deal with changed case_source, case_sink ADTs.
3678         (destroy_storage_stream_info) Make null arg into no-op.
3679         (storage_sink_make_source) Set aux in created source.
3680         (storage_source_read) Deal with changed case, casefile ADTs.
3681         (storage_source_create) New function.
3682         (lagged_case) Rewrite.
3683         (free_case_source) New function.
3684         (free_case_sink) Rewrite.
3685         (struct split_aux_data) Changed prev_case from `struct ccase *' to
3686         `struct ccase'.
3687         (procedure_with_splits) Deal with changed prev_case.
3688         (procedure_with_splits_callback) Ditto.
3689         (multipass_split_aux_data) Changed prev_case from `struct ccase *' to
3690         `struct ccase'.
3691         (multipass_procedure_with_splits) Deal with changed prev_case.
3692         (multipass_split_callback) Ditto.
3693         
3694         
3695 Mon May 31 17:19:06 2004  Ben Pfaff  <blp@gnu.org>
3696
3697         The workspace idea didn't work out.
3698
3699         * Makefile.am: (pspp_SOURCES) Remove workspace.c, workspace.h.
3700         
3701         * workspace.c: Removed.
3702
3703         * workspace.h: Removed.
3704
3705 Sun May 30 18:35:19 2004  Ben Pfaff  <blp@gnu.org>
3706
3707         Fully implement arbitrary delimiters on DATA LIST, extending the
3708         half implementation that was already there.
3709
3710         * data-list.c: (struct data_list_pgm) Remove `delim', add
3711         `delims', `delim_cnt'.
3712         (cmd_data_list) Initialize new members.  Parse delimiters and
3713         clean up code a bit.
3714         (cut_field) Extract fields with arbitrary delimiters.  Also, fix
3715         handling of leading commas.
3716         (read_from_data_list_fixed) Expand tabs.  Adapt to new DFM
3717         interfaces.
3718         (read_from_data_list_free) Adapt to new DFM interfaces.
3719         (read_from_data_list_list) Ditto.
3720         (repeating_data_trns_proc) Ditto.
3721
3722         * dfm.c: Split up reader and writer into separate code, because
3723         they do different things.  Use struct string instead of explicit
3724         allocation code, for clarity.
3725         (enum dfm_reader_flags) New enum.
3726         (struct dfm_fhuser_ext) Removed.
3727         (struct dfm_reader_ext) New.
3728         (get_reader) New function, used by just about all the reader
3729         functions.
3730         (dfm_close) Removed.
3731         (close_reader) New function.
3732         (dfm_open_for_reading) Rewrite initialization of dfm_fhuser_ext.
3733         (dfm_open_for_writing) Ditto.
3734         (macro force_line_buffer_expansion) Removed.
3735         (count_tabs) Removed.
3736         (tabs_to_spaces) Removed.
3737         (read_record) Deal with new dfm_reader_ext.  Use struct string
3738         functions.  Don't convert tabs to spaces.
3739         (dfm_eof) New function.
3740         (dfm_get_record) Changed interface, rewrote.
3741         (dfm_expand_tabs) New function.
3742         (dfm_fwd_record) Renamed dfm_forward_record(), updated to new
3743         dfm_reader_ext, rewritten.
3744         (dfm_bkwd_record) Renamed dfm_reread_record(), updated to new
3745         dfm_reader_ext, rewritten.
3746         (dfm_set_record) Removed in favor of dfm_forward_columns().
3747         (dfm_forward_columns) New function.
3748         (dfm_get_cur_col) Renamed dfm_column_start, updated to new
3749         dfm_reader_ext, rewritten.
3750         (static var dfm_r_class) Use close_reader for the destructor.
3751         (struct dfm_writer_ext) New.
3752         (dfm_put_record) Updated to new dfm_writer_ext, rewritten.  Uses
3753         bounce buffer now instead of local allocation.
3754         (close_writer) New function.
3755         (static var dfm_writer_ext) Use close_writer for destructor.
3756         (cmd_begin_data) Adapt to new dfm_reader_ext.
3757
3758         * file-handle.q: Add support for per-file tab width.
3759         (struct private_file_handle) Add tab_width member.
3760         (q2c specifications) Add tabwidth subcommand.
3761         (cmd_file_handle) Put parsed tab width into private_file_handle.
3762         (create_file_handle) Set default tab width.
3763         (handle_get_tab_width) New function.
3764
3765         * file-type.c: (file_type_source_read) Adapt to new DFM interface.
3766
3767         * inpt-pgm.c: (reread_trns_proc) Ditto.
3768
3769         * matrix-data.c: (context) Ditto.
3770         (another_token) Ditto.
3771         (mget_token) Ditto.
3772         (force_eol) Ditto.
3773
3774 Sun May 30 18:33:59 2004  Ben Pfaff  <blp@gnu.org>
3775
3776         * casefile.c: (casefile_destroy) Fix memory leak by freeing
3777         cf->filename.
3778         (casereader_destroy) Don't close file descriptor -1.
3779
3780         * recode.c: (cmd_recode) Fix memory leak.
3781
3782         * set.q: (q2c specifications) Fix typo in user message.
3783
3784         * str.c: (st_bare_pad_len_copy) Change memcpy to memmove to avoid
3785         undefined behavior for overlapping arguments.
3786
3787 Sun May 30 18:31:48 2004  Ben Pfaff  <blp@gnu.org>
3788
3789         * casefile.c: valgrind doesn't implement posix_fadvise() yet, so
3790         don't call it when we're running under valgrind.
3791         (call_posix_fadvise) New function.
3792         (casefile_to_disk) Use call_posix_fadvise().
3793         (reader_open_file) Ditto.
3794         
3795 Sun May 30 18:20:12 2004  Ben Pfaff  <blp@gnu.org>
3796
3797         Update our string ADTs, struct string and struct len_string.  Get
3798         rid of pool support, which was largely unused.  Rename lots of
3799         functions to have more obvious or consistent names.
3800         
3801         * ascii.c: Get rid of ascii_pool.  It was only used for string
3802         allocations.
3803         (ascii_open_global) Don't create ascii_pool.
3804         (ascii_close_driver) Don't destroy ascii_pool.
3805         (ascii_postopen_driver) Don't use pool.
3806         (ascii_close_driver) Destroy strings manually.
3807
3808         * str.c: (ds_create) Remove pool argument, all references updated.
3809         (ds_init) Ditto.
3810         (ds_replace) Remove pool support, make more efficient when we
3811         don't need to reallocate.
3812         (ds_destroy) Remove pool support.
3813         (ds_rpad) New function.
3814         (ds_size) Renamed ds_capacity(), all references updated.
3815         (ds_value) Renamed ds_c_str(), all references updated.
3816         (ds_concat) Renamed ds_puts(), all references updated.
3817         (ds_concat_buffer) Renamed ds_concat(), all references updated.
3818         (ds_putchar) Renamed ds_putc(), all references updated.
3819         (ds_getline) Renamed ds_gets(), all references updated.
3820         (ls_create) Remove pool argument, all references updated.
3821         (ls_create_buffer) Ditto.
3822         (ls_destroy) Removed pool support.
3823         (ls_value) Renamed ls_c_str(), all references updated.
3824
3825         * str.h: (ls_length) [__GNUC__] Add inline version.
3826         (ls_c_str) [__GNUC__] Add inline version.
3827         (ls_end) [__GNUC__] Add inline version.
3828         (struct string) Remove pool member.  Rename `size' to `capacity',
3829         all references updated.
3830
3831         * tab.c: (text_format) Instead of using pool argument to
3832         ls_create_buffer(), call pool_register() on allocated data.
3833
3834 Mon Apr 26 22:40:07 2004  Ben Pfaff  <blp@gnu.org>
3835
3836         We're abusing the current ASCII driver by telling it to allocate a
3837         9999-line, 9999-character page in the tests.  This causes some
3838         systems to curl up and die because it allocates 20 MB of
3839         contiguous RAM.  This change alleviates at least part of the
3840         problem.  It is mostly a stop-gap until the new output system is
3841         ready.
3842         
3843         * ascii.c: (struct line) New structure.
3844         (struct ascii_driver_ext) Remove `page', `page_size', `line_len',
3845         `line_len_size', `n_output' members.  Add `lines', `lines_cap'.
3846         (ascii_preopen_driver) Initialize new members, not old ones.
3847         (ascii_close_driver) Destroy new members, not old ones.
3848         (ascii_open_page) Allocate new members, not old ones.
3849         (expand_line) Allocate room in line.
3850         (draw_line) Use new members.
3851         (ascii_line_horz) Ditto.
3852         (ascii_line_vert) Ditto.
3853         (ascii_line_intersection) Ditto.
3854         (text_draw) Ditto.
3855         (output_lines) Ditto.
3856         (ascii_close_page) Ditto.
3857
3858 Sun Apr 25 23:40:15 2004  Ben Pfaff  <blp@gnu.org>
3859
3860         * matrix.c: Dead code.  Removed.
3861
3862         * matrix.h: Dead code.  Removed.
3863
3864 Fri Apr 16 23:59:51 2004  Ben Pfaff  <blp@gnu.org>
3865
3866         Contrary to what I'd always understood, there is an efficient
3867         algorithm for deletion from a hash table populated via linear
3868         probing.  This change implements it.
3869         
3870         * hash.c: (hsh_rehash) Probe in increasing order.
3871         (hsh_probe) Ditto.
3872         (locate_matching_entry) Ditto.
3873         (hsh_delete) Use Knuth's Algorithm 6.4R for deletion.
3874
3875 Tue Apr 13 19:24:15 2004  Ben Pfaff  <blp@gnu.org>
3876
3877         * moments.c (calc_moments): Adjust calculation of kurtosis to
3878         avoid subtracting huge numbers from huge numbers, on Michael
3879         Kiefte's advice.
3880
3881 Sun Apr 11 14:22:12 2004  Ben Pfaff  <blp@gnu.org>
3882
3883         Rework moments routines for improved numerical stability based on
3884         Michael Kiefte's advice.  Any bugs or remaining numerical problems
3885         are still mine though.
3886
3887         There is now a struct moments1 for use with one-pass moments.  It
3888         uses a provisional means algorithm as an attempt to improve
3889         accuracy of higher moments.  The older struct moments now only
3890         handles two-pass moments.
3891         
3892         * aggregate.c: Use moments1 instead moments.
3893
3894         * descript.c: Revert previous change, which is no longer needed
3895         due to the moments revision.
3896
3897         * moments.c: (calc_moments) New function for calculating variance,
3898         skewness, kurtosis.
3899         (moments_pass_one) Only accumulate weights bigger than zero.
3900         (moments_calculate) Allow calculating the mean on pass one, others
3901         require pass two.  Implement in terms of calc_moments().
3902         (struct moments1) New structure.
3903         (init_moments1) New function.
3904         (moments1_clear) Ditto.
3905         (moments1_create) Ditto.
3906         (moments1_add) Ditto.
3907         (moments1_calculate) Ditto.
3908         (moments1_destroy) Ditto.
3909         (cmd_debug_moments) Deal with `struct moments' or `struct
3910         moments1' as requested by user.
3911
3912 Sun Apr 11 14:21:55 2004  Ben Pfaff  <blp@gnu.org>
3913
3914         * Makefile.am (pspp_SOURCES): Remove debug.c.
3915
3916         * debug.c: Removed.  It was empty anyway.
3917
3918 Fri Apr  9 20:04:49 2004  Ben Pfaff  <blp@gnu.org>
3919
3920         * descript.c (calc_descriptives): Fix assert failure when only
3921         MOMENT_MEAN is needed.
3922
3923 2004-04-09  Michael Kiefte  <mkiefte@dal.ca>
3924
3925         * descript.c: 
3926
3927         fixed problem with parsing in match_statistic() causing
3928         "DESCRIPTIVE STAT=MEAN." to barf.
3929
3930         "MEAN" is now default if "SORT" given without specification.
3931
3932         Fixed infinite loop with "DESCRIPT GIBBERISH=ALL."  Parsing is
3933         generally less forgiving of syntax errors: better to have it do
3934         nothing and type it in again then to not know what it actually did
3935         instead.  
3936
3937         z-score transformation now checks score for user-missing values
3938         and checks std_dev for SYSMIS.
3939
3940 2004-04-06  Michael Kiefte  <mkiefte@dal.ca>
3941
3942         * aggregate.c, crosstabs.q, descript.c, dictionary.c, frequencies.q, levene.c, t-test.q, var.h: 
3943         Changed dict_get_case_weight() to accept an additional int * flag
3944         to complain about system-missing, user-missing, zero, or negative
3945         weights and updated existing functions to pass int * to
3946         dict_get_case_weight().
3947
3948 2004-04-05  jmd  <jmd@gnu.org>
3949
3950         * main.c: Fixed configuration problems with gsl
3951
3952         * t-test.q: Fixed some problems encountered when compiling under Cygwin
3953
3954 2004-04-03  blp  <blp@gnu.org>
3955
3956         * lexer.c, ChangeLog:
3957         Fix infinite loop on comment at end of file, add test.
3958
3959 2004-04-03  jmd  <jmd@gnu.org>
3960
3961         * 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:
3962         Fixed the calculation of percentiles and added --syntax and --algorithm options
3963
3964 Sat Apr  3 11:43:37 2004  Ben Pfaff  <blp@gnu.org>
3965
3966         * lexer.c: (lex_skip_comment) Handle end-of-file correctly (I
3967         hope).
3968
3969 Sat Apr  3 15:00:18 WST 2004 John Darrington <john@darrington.wattle.id.au>
3970
3971         * frequencies.q:  Fixed the calculation of percentiles
3972
3973         * Makefile.am:  Added the --ansi flag and dealt with the
3974         consequences.  Added some entries to PSPP_sources so that
3975         make distcheck would pass
3976
3977         * cmdline.c:   Added the --syntax and --algorithm options
3978
3979         * q2c.c:  Added an implicit /ALGORITHM subcommand to everything.
3980
3981 Fri Apr  2 11:25:22 WAST 2004 John Darrington <john@darrington.wattle.id.au>
3982
3983         * t-test.q, levene.c, levene.h  Converted t-test (incl levene) to 
3984         use the new multipass_split_... mechanism.
3985
3986 Wed Mar 31 22:36:22 2004  Ben Pfaff  <blp@gnu.org>
3987
3988         * frequencies.q: (calc_stats) Use moments data structure and
3989         calc_seskew(), calc_sekurt() functions.
3990
3991         * set.q main.c settings.h Added support for --syntax and --algorithm 
3992         options
3993
3994 Tue Mar 30 22:04:19 2004  Ben Pfaff  <blp@gnu.org>
3995
3996         * vfm.c: Had to get last call to multipass_split_output() inside
3997         open_active_file()/close_active_file() pairing, so introduce new
3998         function.
3999         (internal_procedure) Move procedure() code here, except for calls
4000         to open_active_file() and close_active_file().
4001         (procedure) Wrap open_active_file() and close_active_file() around
4002         internal_procedure().
4003         (multipass_procedure_with_splits) Wrap open_active_file() and
4004         close_active_file() around internal_procedure().
4005
4006 Tue Mar 30 22:01:57 2004  Ben Pfaff  <blp@gnu.org>
4007
4008         * descript.c: (cmd_descriptives) Free `vars' to avoid memory leak.
4009
4010 Mon Mar 29 16:26:40 2004  Ben Pfaff  <blp@gnu.org>
4011
4012         * debug.c: Removed.  Moved cmd_debug_evaluate() into expr-evl.c.
4013
4014         * expr-evl.c: (cmd_debug_evaluate) Moved here from debug.c.
4015
4016 Mon Mar 29 16:03:08 2004  Ben Pfaff  <blp@gnu.org>
4017
4018         * algorithm.c: By default turn off some of the more expensive
4019         assertions.
4020         (expensive_assert) New macro which expands to assert if
4021         EXTRA_CHECKS is defined, to nothing otherwise.
4022         (unique) Use expensive_assert().
4023         (binary_search) Ditto.
4024         (push_heap) Ditto.
4025         (pop_heap) Ditto.
4026         (make_heap) Ditto.
4027         (sort_heap) Ditto.
4028
4029         * command.c: (conflicting_3char_prefixes) Words that are the same
4030         don't cause conflicts when they are abbreviated to the first three
4031         letters.
4032
4033         * expr-evl.c: (CONCAT_func) Fix memory leak by incrementing struct
4034         nonterm_node's n earlier.
4035         (generic_str_func) Ditto.
4036         
4037 Mon Mar 29 15:32:17 2004  Ben Pfaff  <blp@gnu.org>
4038
4039         Add support for multipass procedures.  Rewrite DESCRIPTIVES to
4040         test multipass support, take advantage of new moments
4041         calculation, and to not be such crappy code.  Get rid of q2c
4042         processing for DESCRIPTIVES.
4043
4044         * vfm.c: (struct multipass_split_aux_data) New structure.
4045         (multipass_procedure_with_splits) New function.
4046         (multipass_split_callback) New function.
4047         (multipass_split_output) New function.
4048         * descript.q: Removed.
4049
4050         * descript.c: New file.
4051
4052         * var.h: Removed descriptives enums.
4053         (struct descriptives_proc) Removed.
4054         (struct variable) Removed p.dsc.
4055
4056         * Makefile.am: (q_sources_c) Remove descript.c.
4057         (q_sources_q) Removed descript.q.
4058         
4059 Mon Mar 29 15:31:55 2004  Ben Pfaff  <blp@gnu.org>
4060
4061         New manager for keeping track of used workspace.
4062         
4063         * workspace.c: New file.
4064
4065         * workspace.h: New file.
4066
4067         * Makefile.am: (pspp_SOURCES) Add workspace.c, workspace.h.
4068
4069         * sort.c: (do_internal_sort) Use workspace_malloc().
4070         (destroy_internal_sort) Use workspace_free().
4071
4072 Mon Mar 29 15:31:08 2004  Ben Pfaff  <blp@gnu.org>
4073
4074         New `struct casefile' for managing sets of cases.
4075
4076         * casefile.c: New file.
4077
4078         * casefile.h: New file.
4079
4080         * command.def: Add DEBUG CASEFILE command.
4081
4082         * Makefile.am: (pspp_SOURCES) Add casefile.c, casefile.h.
4083
4084         * sort.c: (sort_cases) Move logic for sending storage file to disk
4085         into do_external_sort().
4086         (struct internal_sort) Use an array of ccase pointers instead of a
4087         case_list.
4088         (do_internal_sort) Rewrite to handle casefiles.
4089         (compare_case_list) Removed.
4090         (compare_cases) New function.
4091         (compare_case_dblptrs) New function.
4092         (read_internal_sort_output) Deal with new struct internal_sort.
4093
4094         * vfm.c: (static var workspace_overflow) Removed.
4095         (struct storage_stream_info) Removed all the members.  Added
4096         struct casefile * member.
4097         (storage_sink_open) Use casefile.
4098         (open_storage_file) Removed.
4099         (write_storage_file) Removed.
4100         (storage_to_disk) Removed.
4101         (destroy_storage_stream_info) Use casefile.
4102         (storage_sink_write) Use casefile.
4103         (storage_sink_make_source) Use casefile.
4104         (storage_source_count) Use casefile.
4105         (storage_source_read) Use casefile.
4106         (storage_source_on_disk) Removed.
4107         (storage_source_get_cases) Removed.
4108         (storage_source_set_cases) Removed.
4109         (storage_source_get_casefile) New function.
4110         
4111 Mon Mar 29 15:30:09 2004  Ben Pfaff  <blp@gnu.org>
4112
4113         New `struct moments' for calculating moments.
4114
4115         * stats.c: Removed.
4116
4117         * stats.h: Removed.
4118
4119         * moments.c: New file.
4120
4121         * moments.h: New file.
4122
4123         * command.def: Add DEBUG MOMENTS command.
4124
4125         * Makefile.am: (pspp_SOURCES) Add moments.c, moments.h.  Remove
4126         stats.c, stats.h.
4127
4128         * aggregate.c: Modify AGGREGATE to use the new moments
4129         calculation, even if not in such a great way.
4130         (struct agr_var) Add `moments' member.
4131         (parse_aggregate_functions) Set `moments' member to null.
4132         (agr_destroy) Destroy `moments' member.
4133         (accumulate_aggregate_info) Use `moments' for standard deviation.
4134         (dump_aggregate_info) Ditto.
4135         (initialize_aggregate_info) Create or clear `moments'.
4136
4137         * misc.h: Add pow2(), pow3(), pow4() functions in place of sqr(),
4138         cube(), pow4() that were in stats.h.  All references updated.
4139
4140         * crosstabs.q: stats.h had chi-square significance functions.  Use
4141         GSL instead.
4142         (display_chisq) Use gsl_cdf_chisq_Q() instead of chisq_sig().
4143
4144         * expr-evl.c: (expr_evaluate) Use moments_of_values() for
4145         OP_CFVAR, OP_MEAN, OP_SD, OP_VARIANCE.
4146                 
4147 Fri Mar 26 14:21:23 2004  Ben Pfaff  <blp@gnu.org>
4148
4149         * dictionary.c: (dict_compact_values) Compacted values need to
4150         start off from 0.
4151
4152 Fri Mar 26 00:54:57 2004  Ben Pfaff  <blp@gnu.org>
4153
4154         * var-labs.c: (cmd_variable_labels) For compatibility, don't allow
4155         `/' at start.  Check return value of parse_variables() for error
4156         return.
4157
4158 Fri Mar 26 00:19:27 2004  Ben Pfaff  <blp@gnu.org>
4159
4160         Revamp expressions: make the code a little nicer, and fix bugs
4161         found in testing.
4162         
4163         * expr-evl.c: (expr_evaluate) Make expression argument const.
4164         Support OP_ADD, OP_SUB, OP_MUL, OP_DIV instead of OP_PLUS, OP_MUL.
4165         OP_POW is missing for arg 2 <= 0.  OP_LOG is natural log, not
4166         base-10 log.  Fix OP_ANY, OP_ANY_STRING, OP_RANGE, OP_RANGE_STRING
4167         off-by-ones.  Add OP_MAX_STRING, OP_MIN_STRING.  Fix OP_TIME_HMS,
4168         OP_DATE_WKYR boundary conditions.  Add OP_CTIME_DAYS,
4169         OP_CTIME_HOURS, OP_CTIME_MINUTES, OP_CTIME_DAYS, OP_CTIME_SECONDS.
4170         Support OP_INDEX_2, OP_INDEX_3, OP_RINDEX_2, OP_RINDEX_3 instead
4171         of OP_INDEX, OP_INDEX_OPT, OP_RINDEX, OP_RINDEX_OPT.  Merge
4172         OP_LPAD_OPT into OP_LPAD, OP_RPAD_OPT into OP_RPAD, OP_LTRIM_OPT
4173         into OP_LTRIM, OP_RTRIM_OPT into OP_RTRIM, OP_NUMBER_OPT into
4174         OP_NUMBER.  Fix OP_RTRIM fragility.  Support OP_SUBSTR_2,
4175         OP_SUBSTR_3 instead of OP_SUBSTR, OP_SUBSTR_OPT.  Remove OP_INV.
4176         Simplify OP_SYSMIS.  Remove OP_STR_MIS.
4177
4178         * expr-opt.c: (optimize_expression) Rewrite.
4179         (macro n0) Removed.
4180         (macro n1) Removed.
4181         (macro n2) Removed.
4182         (macro s0) Removed.
4183         (macro s0l) Removed.
4184         (macro s1) Removed.
4185         (macro s1l) Removed.
4186         (macro s2) Removed.
4187         (macro s2l) Removed.
4188         (macro s) Removed.
4189         (macro sl) Removed.
4190         (eq_num_con) New function.
4191         (optimize_tree) New function.
4192         (macro rnc) Removed.
4193         (macro frnc) Removed.
4194         (str_search) Add const to string params.
4195         (str_rsearch) Ditto.
4196         (evaluate_tree_no_missing) Renamed from evaluate_tree.  Add num[],
4197         str[], str_len[] locals to substitute for most of removed macros.
4198         Support OP_ADD, OP_SUB, OP_MUL, OP_DIV instead of OP_PLUS, OP_MUL.
4199         Removed support for missing values because we're never called with
4200         missing values.  Use set_number() or set_number_errno() instead of
4201         rnc or frnc.  Removed any stuff that caused trouble in testing.
4202         We can re-add it later if it really slows anything.  Fix some
4203         random problems.
4204         (evaluate_tree_with_missing) Not yet supported.  To be added later
4205         if it's important.
4206         (repl_num_con) Removed.
4207         (collapse_node) New function.
4208         (force_repl_num_con) Removed.
4209         (set_number) New function.
4210         (set_number_errno) New function.
4211         (repl_str_con) Removed.
4212         (set_string) New function.
4213         (yrmoda) Tighten boundary conditions.  Adopt 2030 cut-off for
4214         2-digit years.
4215         (dump_node) No special case for OP_AND, OP_OR.
4216
4217         * expr-prs.c: (expr_prs) Honor EXPR_NO_OPTIMIZE bit.  Rewrite.
4218         (expr_get_type) New function.
4219         (type_check) Rewrite.
4220         (type_coercion) New function.
4221         (struct operator) New structure.
4222         (match_operator New function.
4223         (parse_binary_operators) New function.
4224         (parse_inverting_unary_operator) New function.
4225         (parse_or) Rewritten.
4226         (parse_and) Rewritten.
4227         (parse_not) Rewritten.
4228         (parse_rel) Rewritten.
4229         (parse_add) Rewritten.
4230         (parse_mul) Rewritten.
4231         (parse_neg) Rewritten.
4232         (parse_exp) Rewritten.
4233         (parse_sysvar) Add $TRUE, $FALSE system variables.
4234         Get $LENGTH, $WIDTH from get_viewlength(), get_viewwidth().
4235         (parse_primary) Use allocate_var_node(), allocate_num_con(),
4236         allocate_str_con().
4237         (struct function) Remove desc, change `func' prototype.
4238         (unary_func) Remove special cases.
4239         (MISSING_func) Reduce to unary_func() that just returns a boolean.
4240         (SYSMIS_func) Handle SYSMIS((x)) like SYSMIS(x).
4241         (VALUE_func) Use allocate_var_node().
4242         (nary_num_func) Allow MIN and MAX for strings.
4243         Use allocate_var_node().  Properly clean up.
4244         Fix return type.
4245         (generic_str_func) Use local table instead of removed `desc'
4246         member.  Mostly rewrite.
4247         (get_num_args) Revise error message.
4248         (parse_function) Return EXPR_ERROR, not 0 on error.
4249         (macro op) Removed.
4250         (macro varies) Removed.
4251         (ops[]) Use expr.def.
4252         (free_node) Do nothing if node is null.
4253         (allocate_num_con) New function.
4254         (allocate_str_con) New function.
4255         (allocate_var_node) New function.
4256         (allocate_binary_nonterminal) New function.
4257         (append_nonterminal_arg) Removed.
4258         (static var func_tab[]) Revised.
4259         (expr_debug_print_postfix) Make parameter const.
4260         Use printf() instead of debug_printf().
4261
4262         * expr.def: New file.
4263         
4264         * expr.h: Change PXP_* to EXPR_*, all references updated.  Also
4265         use named enum instead of unnamed, all references updated.  Add
4266         EXPR_ANY, EXPR_NO_OPTIMIZE.
4267
4268         * exprP.h: Remove EX_*.  Add DEFINE_OPERATOR.  Use expr.def
4269         instead of defining OP_* directly.
4270         (macro IS_TERMINAL) New macro.
4271         (macro IS_NONTERMINAL) New macro.
4272         (enum OP_NO_FLAGS) New.
4273         
4274 Fri Mar 26 00:18:01 2004  Ben Pfaff  <blp@gnu.org>
4275
4276         * error.c: (err_assert_fail) msg variable needs to be non-const.
4277
4278 Fri Mar 26 00:17:24 2004  Ben Pfaff  <blp@gnu.org>
4279
4280         * debug.c: (cmd_debug_evaluate) Rewrite.
4281
4282 Fri Mar 26 00:15:13 2004  Ben Pfaff  <blp@gnu.org>
4283
4284         Fix some CROSSTABS bit rot stupidity.
4285
4286         * crosstabs.q: Reorder the CELLS subcommands for compatibility.
4287         (internal_cmd_crosstabs) Initializes cells[] correctly.
4288         (float_M_suffix) Rename format_cell_entry(), change prototype,
4289         rewrite.
4290         (display_crosstabulation) Fix cell formatting.
4291
4292 Fri Mar 26 00:14:09 2004  Ben Pfaff  <blp@gnu.org>
4293
4294         Make lex_rest_of_line(), lex_entire_end() not discard lines.  Have
4295         to call lex_discard_line() to do that.
4296
4297         * command.c: (run_command) Call lex_discard_line() after
4298         lex_rest_of_line().
4299
4300         * lexer.c: (lex_entire_end) Change behavior.
4301         (lex_rest_of_line) Change behavior.  Return const char *.
4302         (lex_discard_line) Don't clear getl_buf, don't emit message.
4303
4304         * main.c: (handle_error) Emit message here.
4305
4306         * repeat.c: (internal_cmd_do_repeat) Use lex_discard_line()
4307         instead of lex_entire_line().
4308
4309         * str.c: (mm_find_reverse) Make length params size_t.  Rewrite.
4310
4311         * title.c: (get_title) Call lex_discard_line() after
4312         lex_rest_of_line().
4313         (cmd_file_label) Ditto.
4314         (cmd_document) Deal with const char * return value.
4315
4316 Fri Mar 26 00:10:16 2004  Ben Pfaff  <blp@gnu.org>
4317
4318         Removed REMARK command.
4319
4320         * command.c: (extract_prefix) Removed.
4321         (output_line) Removed.
4322         (cmd_remark) Removed.
4323
4324         * command.def: Remove REMARK.
4325
4326 Fri Mar 26 00:08:38 2004  Ben Pfaff  <blp@gnu.org>
4327
4328         Added abort() after lots of assert(0) invocations to avoid some
4329         compiler warnings.  We really need a NOT_REACHED macro.
4330
4331 Tue Mar 23 08:00:42 WAST 2004 John Darrington <john@darrington.wattle.id.au>
4332
4333         * sort.c: Added missing call to temp_file_close.  Changed error 
4334         messages to warnings.
4335
4336         * set.q: Improved setting of set_view{length,width} to be more tolerant
4337         of buggy OSes.
4338
4339 Sun Mar 21 10:11:14 WST 2004 John Darrington <john@darrington.wattle.id.au>
4340
4341         * val-labs.c: Fixed a bug where PSPP would crash, if VALUE LABELS was
4342         used with incorrect syntax.
4343
4344         * error.c, error.h et al:  Overridden definition of assert for a
4345         custom one.
4346
4347         * test-q.c: Fixed a buglet where it would crash if no /VARIABLES
4348         subcommand was given when it ought to have been.
4349
4350 Sat Mar 20 22:19:08 2004  Ben Pfaff  <blp@gnu.org>
4351
4352         * tab.c: (tab_vline) Fix assertions to respect row_ofs and
4353         col_ofs.
4354         (tab_hline) Ditto.
4355         (tab_box) Ditto.
4356         (tab_joint_text) Ditto.
4357
4358 Sat Mar 20 17:57:23 2004  Ben Pfaff  <blp@gnu.org>
4359
4360         * levene.c: Add #include.
4361
4362         * set.q: (set_viewport) Add `int' argument to make its prototype
4363         correct for signal().
4364
4365 Sat Mar 20 15:35:17 2004  Ben Pfaff  <blp@gnu.org>
4366
4367         * expr-evl.c: (expr_evaluate) Assert that `c' is nonzero before
4368         using it.
4369
4370 Sat Mar 20 15:18:16 2004  Ben Pfaff  <blp@gnu.org>
4371
4372         Changed DFM from open-at-first-access to explicit-open.  Before,
4373         calling dfm_get_record() or dfm_put_record() would automatically
4374         open the file.  Now, you have to call dfm_open_for_reading() or
4375         dfm_open_for_writing() explicitly.  This makes it possible to
4376         check permissions, file existence, etc. earlier.
4377
4378         Also made struct file_handle more opaque, and clean up in general.
4379
4380         * data-list.c: (cmd_data_list) Open handle for reading.
4381
4382         * dfm.c: (struct dfm_fhuser_ext) Add `where', `saw_begin_data'
4383         members.
4384         (open_file_r) Renamed dfm_open_for_reading(), rewrote.
4385         (open_file_w) Renamed dfm_open_for_writing(), rewrote.
4386         (open_inline_file) Removed.
4387         (read_record) For inline_file, if we haven't seen BEGIN DATA, read
4388         it.  Deal with line_number in extension record instead of file
4389         handle.
4390         (dfm_get_record) Rewrote.
4391         (dfm_put_record) Rewrote.
4392         (dfm_push) Assert file is open and one of ours.  Deal with
4393         line_number in extension record instead of file handle.
4394         (dfm_pop) Assert file is open and one of ours.  Deal with
4395         line_number in extension record instead of file handle.
4396         (cmd_begin_data) Use dfm_open_for_reading().  Mark that we saw
4397         BEGIN DATA.     
4398
4399         * file-handle.h: (enum constants RH_RF_*) Removed.
4400         (enum constants FH_MD_*) Removed.
4401         (struct file_handle) Removed `name', `norm_fn', `fn', `where',
4402         `recform', `lrecl', `mode' members.  Public references to
4403         `recform' changed to use handle_get_mode(), references to `lrecl'
4404         changed to use handle_get_record_width().  Added `private' member.
4405         (enum file_handle_mode) New.
4406
4407         * file-handle.q: (struct private_file_handle) New structure.
4408         (struct file_handle_list) New structure.
4409         (static var files) New.
4410         (static var file_handles) Removed.
4411         (init_file_handle) Removed.
4412         (create_file_handle) Removed.
4413         (get_handle_with_name) New function.
4414         (get_handle_for_filename) New function.
4415         (cmd_file_handle) Rewritten.
4416         (hash_file_handle) Removed.
4417         (cmp_file_handle) Removed.
4418         (fh_init_files) Rewritten.
4419         (fh_parse_file_handle) Rewritten.  Allows identifiers as
4420         filenames.
4421         (fh_get_handle_by_name) Renamed handle_get_name(), all references
4422         updated.  Rewritten.
4423         (fh_get_handle_by_filename) Renamed handle_get_filename(), all
4424         references updated.  Rewritten.
4425         (fh_record_width) Renamed handle_get_record_width(), all
4426         references updated.  Rewritten.
4427         (handle_get_mode) New function.
4428
4429         * file-type.c: (cmd_file_type) Open handle for reading.
4430
4431         * filename.c: [unix] (struct file_identity) New structure.
4432         [unix] (fn_get_identity) New function.
4433         [unix] (fn_free_identity) New function.
4434         [unix] (fn_compare_file_identities) New function.
4435         [!unix] (struct file_identity) New structure.
4436         [!unix] (fn_get_identity) New function.
4437         [!unix] (fn_free_identity) New function.
4438         [!unix] (fn_compare_file_identities) New function.
4439
4440         * lexer.c: (static var put) Renamed put_token, all references
4441         updated.
4442         (static var put_tokstr) New.
4443         (static var put_tokval) New.
4444         (lex_init) Initialize put_tokstr().
4445         (restore_token) New function.
4446         (save_token) New function.
4447         (lex_get) Use restore_token().
4448         (lex_put_back) Use save_token().
4449         (lex_put_back_id) New function.
4450         (lex_put_forward) Removed.
4451         (lex_preprocess_line) Set put_token instead of using
4452         lex_put_forward().
4453         (lex_negative_to_dash) Use save_token(), set put_token directly.
4454         (dump_token) Use stderr instead of stdout.
4455
4456         * main.c: (main) Remove call to cmd_init().
4457         
4458         * matrix-data.c: (cmd_matrix_data) Open file for reading.
4459
4460         * pfm-read.c: Use handle_get_filename() instead of trying to use
4461         h->fn directly, all over.
4462
4463         * pfm-write.c: Ditto.
4464
4465         * print.c: (internal_cmd_print) Open handle for writing.
4466         (dump_table) Use handle_get_filename().
4467         (print_trns_proc) Use handle_get_mode().
4468         (cmd_print_space) Use fh_parse_file_handle().
4469         Open handle for writing.
4470         [0] (debug_print) Removed.
4471
4472         * sfm-read.c: Use handle_get_filename() instead of trying to use
4473         h->fn directly, all over.
4474
4475         * sfm-write.c: Ditto.
4476
4477 Sat Mar 20 14:35:48 2004  Ben Pfaff  <blp@gnu.org>
4478
4479         Fix memory leaks.
4480         
4481         * autorecode.c: (arc_free) Free arc->src_values.
4482
4483         * error.c: (msg) Free buf.
4484
4485         * val-labs.c: (do_value_labels) Always free vars.
4486
4487         * vfm.c: (close_active_file) If sink has no make_source then call
4488         its destroy function.
4489
4490 Sat Mar 20 14:00:24 2004  Ben Pfaff  <blp@gnu.org>
4491
4492         Fixed cmd_parse() so that it always skips past a full command
4493         name.  A few special commands for which this would be bad get
4494         special treatment.  This lets us drop code for skipping past the
4495         end of a command name in most cmd_*() functions.  It's not worth
4496         listing all the commands affected.
4497
4498         * command.c: (struct command) Remove `cmd' member, replace by
4499         `name' member, all references updated.  Remove `word', `next',
4500         `skip_entire_name' members.
4501         (macro DEFCMD) Deal with revised `struct command'.
4502         (macro UNIMPL) Ditto.
4503         (macro SPCCMD) New macro for commands whose last word shouldn't be
4504         skipped.
4505         (static array cmd_table[]) Make const, rename `commands', remove
4506         sentinel element.
4507         (macro COMMAND_CNT) New macro.
4508         (split_words) Removed.
4509         (cmd_init) Removed.
4510         (FILE_TYPE_okay) Make parameter const.
4511         (cmd_parse) Improve error messages.
4512         (match_strings) New function.
4513         (next_word) New function.
4514         (enum command_match) New enum.
4515         (conflicting_3char_prefixes) New function.
4516         (conflicting_3char_prefix_command) New function.
4517         (cmd_match_words) New function.
4518         (count_matching_commands) New function.
4519         (get_command_name) New function.
4520         (free_words) New function.
4521         (unknown_command_error) New function.
4522         (figure_out_command) Renamed parse_command_name(), rewritten.
4523
4524         * command.def: Removed @ command.  Marked BEGIN DATA, DOCUMENT,
4525         FILE LABEL, REMARK, SUBTITLE, TITLE as special.  Renamed EVALUATE
4526         to DEBUG EVALUATE.  Added N alias for N OF CASES, SORT alias for
4527         SORT CASES.
4528
4529         * command.h: (macro SPCCMD) New.
4530
4531         * include.c: (cmd_include_at) Removed.
4532         (cmd_include) Allow identifier to be used as filename.
4533
4534         * inpt-pgm.c: (cmd_reread) Use fh_parse_file_handle().
4535
4536         * t-test.q: (cmd_t_test) Command name is now parsed for us.
4537         
4538
4539 Sat Mar 20 13:56:00 2004  Ben Pfaff  <blp@gnu.org>
4540
4541         Start work on better test framework.
4542         
4543         * Makefile.am: (pspp_sources) Add debug.c.
4544         
4545         * debug.c: New file.
4546
4547         * compute.c: (cmd_evaluate) Moved to debug.c, renamed
4548         cmd_debug_evaluate().
4549
4550         * expr-prs.c: (expr_parse) Remove PXP_DUMP support.
4551
4552         * expr.h: (enum constant PXP_DUMP) Removed.
4553
4554 Sat Mar 20 00:05:42 WST 2004 John Darrington <john@darrington.wattle.id.au>
4555
4556         * set.q:  Implemented the SHOW command, and synced it to the existing 
4557         SET cmd.
4558
4559         Added a handler for SIGWINCH so that viewlength and viewwidth follow
4560         changes as the window size is changed.
4561
4562         Added fallback to set viewlength and viewwidth from LINES and COLUMS
4563         environment variables if other methods are not available.
4564
4565         glob.c: Removed a lot of global variables from glob.c and encapsulated 
4566         them in set.q
4567
4568         random.c: Tidied up the way the random seed is set.
4569
4570         str.c: Added a ds_vprintf function.
4571
4572         error.c: Extended dump_message so that messages are always broken at
4573         '\n' characters.
4574         
4575 Thu Mar 18 11:07:14 2004  Ben Pfaff  <blp@gnu.org>
4576
4577         * pfm-write.c: (bufwrite) Write out the correct element for string
4578         variables.  From Andreas Streichardt <streichardt@globalpark.de>.
4579
4580 Mon Mar 15 20:48:03 2004  Ben Pfaff  <blp@gnu.org>
4581
4582         Get rid of static and global (!) vars in matrix-data.c.
4583
4584         * matrix-data.c: (static var nr_data) Removed.
4585         (static var nr_factor_values) Removed.
4586         (static var max_cell_index) Removed.
4587         (static var split_values) Removed.
4588         (struct nr_aux_data) New structure.
4589         (read_matrices_without_rowtype) Use a local struct nr_aux_data in
4590         place of static vars, pass to create_case_source() and procedure()
4591         as aux data.
4592         (nr_read_data_lines) Use struct nr_aux_data * parameter instead of
4593         struct matrix_data_pgm *.
4594         (nr_read_splits) Ditto.
4595         (nr_read_factors) Ditto.
4596         (nr_output_data) Ditto.
4597         (static var wr_content) Removed.
4598         (global var wr_data) Removed.
4599         (global var wr_current) Removed.
4600         (struct wr_aux_data) New structure.
4601         (read_matrices_with_rowtype) Use a local struct wr_aux_data in
4602         place of static vars, pass to create_case_source() and procedure()
4603         as aux data.
4604         (matrix_data_read_with_rowtype) Use struct wr_aux_data * parameter
4605         instead of matrix_data_pgm *.
4606         (wr_read_splits) Ditto.
4607         (wr_output_data) Ditto.
4608         (wr_read_rowtype) Ditto.
4609         (wr_read_factors) Ditto.
4610         (wr_read_indeps) Ditto.
4611         
4612 Mon Mar 15 20:07:29 2004  Ben Pfaff  <blp@gnu.org>
4613
4614         Get rid of static vars in autorecode.c.
4615
4616         * autorecode.c: (struct autorecode_trns) Rename `arc' to `specs',
4617         `n_arc' to `spec_cnt'.  All references updated.
4618         (static var v_src) Removed.
4619         (static var v_dest) Removed.
4620         (static var h_trns) Removed.
4621         (static var nv_src) Removed.
4622         (static var descend) Removed.
4623         (static var print) Removed.
4624         (enum direction) New enum.
4625         (struct autorecode_pgm) New structure.
4626         (cmd_autorecode) Use struct autorecode_pgm instead of static vars.
4627         Move n_dest local var into struct autorecode_pgm for ease of
4628         clean-up.  Use arc_free().
4629         (arc_free) New function.
4630         (recode) Modify to take struct autorecode_pgm * parameter instead
4631         of using statics.  Let the caller clean up.
4632         (autorecode_proc_func) Use struct autorecode_pgm * auxiliary data
4633         instead of statics.  Rearrange code a little.
4634
4635 Mon Mar 15 00:25:02 2004  Ben Pfaff  <blp@gnu.org>
4636
4637         Get rid of static, global vars in recode.c.  Remove debug code.
4638
4639         * recode.c: (static var head) Removed.
4640         (global var v) Removed.
4641         (global var nv) Removed.
4642         (cmd_recode) New local variables head, v, nv.  Initialize and free
4643         v.  Don't call debug_print().
4644         [DEBUGGING] (dump_dest) Removed.
4645         [DEBUGGING] (debug_print) Removed.
4646
4647 Mon Mar 15 00:14:49 2004  Ben Pfaff  <blp@gnu.org>
4648
4649         Get rid of static vars in expr-opt.c.
4650
4651         * expr-opt.c: (static var e) Removed.
4652         (static var nop) Removed.
4653         (static var mop) Removed.
4654         (static var ndbl) Removed.
4655         (static var mdbl) Removed.
4656         (static var nstr) Removed.
4657         (static var mstr) Removed.
4658         (static var nvars) Removed.
4659         (static var mvars) Removed.
4660         (struct expr_dump_state) New structure.
4661         (dump_expression) Use new struct expr_dump_state instead of static
4662         vars and pass to functions we call.
4663         (dump_node) Use struct expr_dump_state * parameter.
4664         (emit) Ditto.
4665         (emit_num_con) Ditto.
4666         (emit_str_con) Ditto.
4667         (emit_var) Ditto.
4668         
4669 Mon Mar 15 00:03:51 2004  Ben Pfaff  <blp@gnu.org>
4670
4671         Get rid of static var in COUNT.
4672
4673         * count.c: (static var head) Move into cmd_count().
4674         (cmd_count) [DEBUGGING] Don't call debug_print.
4675         [DEBUGGING] (debug_print) Removed.
4676
4677 Sun Mar 14 23:56:09 2004  Ben Pfaff  <blp@gnu.org>
4678
4679         Get rid of static vars in VALUE LABELS, ADD VALUE LABELS.
4680
4681         * val-labs.c: (static var v) Removed.
4682         (static var nv) Removed.
4683         [DEBUGGING] (debug_print) Removed.
4684         (verify_val_labs) Add struct variable **, int parameters.
4685         (get_label) Ditto.  Improve error messages, streamline.
4686         (erase_labels) New function for erasing value labels, taking over
4687         part of verify_val_labs()'s function.
4688         (init) Removed.
4689         (done) Removed.
4690         (cmd_value_labels) No need to call init() or done() anymore.
4691         (cmd_add_value_labels) Ditto.
4692         (do_value_labels) Add vars, var_cnt local variables.  Clean up
4693         after them internally.  Call erase_labels() if we should.  Don't
4694         call debug_print().
4695
4696 Sun Mar 14 23:33:53 2004  Ben Pfaff  <blp@gnu.org>
4697
4698         Get rid of static vars in MATCH FILES.
4699         
4700         * get.c: (static var mtf_head) Removed.
4701         (static var mtf_tail) Removed.
4702         (static var mtf_by) Removed.
4703         (static var mtf_n_by) Removed.
4704         (static var mtf_master) Removed.
4705         (static var mtf_seq_num) Removed.
4706         (static var mtf_seq_nums) Removed.
4707         (static var mtf_sink) Removed.
4708         (static var mtf_case) Removed.
4709         (struct mtf_proc) New structure.
4710         (cmd_match_files) Use struct mtf_proc instead of static vars.
4711         (mtf_processing_finish) Ditto.
4712         (mtf_free) Ditto.
4713         (mtf_delete_file_in_place) Ditto.
4714         (mtf_read_nonactive_records) Ditto.
4715         (mtf_compare_BY_values) Ditto.
4716         (mtf_processing) Ditto.
4717         (mtf_merge_dictionary) Ditto.
4718
4719 Sun Mar 14 22:48:12 2004  Ben Pfaff  <blp@gnu.org>
4720
4721         * command.def: Add CASESTOVARS, VARSTOCASES unimplemented commands.
4722
4723         * dictionary.c: (dict_rename_var) Add assertion.
4724         (dict_contains_var) Check by index instead of name.
4725
4726 Sun Mar 14 22:01:02 2004  Ben Pfaff  <blp@gnu.org>
4727
4728         Get rid of compaction_necessary, compaction_nval, compaction_case.
4729         Redo VFM interface.  Replace disk_sink and memory_sink by
4730         storage_sink, disk_source and memory_source by storage_source.
4731
4732         * vfm.h: (struct case_sink) Add `dict', `idx_to_fv', `value_cnt'
4733         members.
4734
4735         * vfm.c: 
4736         (struct write_case_data) Remove `begin_func', `end_func',
4737         `func_aux' members.  Add `aux', `trns_case', `sink_case',
4738         `cases_written', `cases_analyzed' members.
4739         (global var compaction_necessary) Make static.
4740         (global var compaction_nval) Removed.
4741         (global var compaction_case) Removed.
4742         (static var case_count) Removed.
4743         (struct procedure_aux_data) Removed.
4744         (struct split_aux_data) Removed.
4745         (procedure) Remove begin_func, end_func parameters.  Rewrite.
4746         (static var not_canceled) Removed.
4747         (process_active_file) Removed.
4748         (process_active_file_write_case) Removed.
4749         (process_active_file_output_case) Removed.
4750         (prepare_for_writing) Moved into open_active_file().
4751         (arrange_compaction) Ditto.
4752         (setup_lag) Ditto.
4753         (open_active_file) Rewrote.
4754         (write_case) New function.
4755         [DEBUGGING] (index_to_varname) Removed.
4756         (execute_transformations) New function.
4757         (exclude_this_case) Renamed filter_case(), changed interface.
4758         (clear_case) Added struct ccase * parameter to interface.
4759         (close_active_file) Added struct write_case_data * parameter,
4760         rewrote.
4761         (disk_sink_create) Removed.
4762         (disk_sink_destroy) Removed.
4763         (disk_sink_make_source) Removed.
4764         (disk_sink_write) Removed.
4765         (disk_source_count) Removed.
4766         (disk_source_destroy) Removed.
4767         (disk_source_read) Removed.
4768         (global var disk_sink_class) Removed.
4769         (global var disk_source_class) Removed.
4770         (global var memory_sink_class) Removed.
4771         (global var memory_source_class) Removed.
4772         (memory_sink_create) Removed.
4773         (memory_sink_destroy) Removed.
4774         (memory_sink_make_source) Removed.
4775         (memory_sink_write) Removed.
4776         (memory_source_count) Removed.
4777         (memory_source_destroy) Removed.
4778         (memory_source_get_cases) Removed.
4779         (memory_source_read) Removed.
4780         (memory_source_set_cases) Removed.
4781         (struct disk_stream_info) Removed.
4782         (struct memory_sink_info) Removed.
4783         (struct memory_source_info) Removed.
4784         (write_active_file_to_disk) Removed.
4785         (destroy_storage_stream_info) New function.
4786         (global var null_sink_class) New var.
4787         (global var storage_sink_class) New var.
4788         (global var storage_source_class) New var.
4789         (open_storage_file) New function.
4790         (storage_sink_destroy) New function.
4791         (storage_sink_make_source) New function.
4792         (storage_sink_open) New function.
4793         (storage_sink_write) New function.
4794         (storage_source_count) New function.
4795         (storage_source_destroy) New function.
4796         (storage_source_get_cases) New function.
4797         (storage_source_on_disk) New function.
4798         (storage_source_read) New function.
4799         (storage_source_set_cases) New function.
4800         (storage_source_to_disk) New function.
4801         (storage_to_disk) New function.
4802         (struct storage_stream_info) New structure.
4803         (write_storage_file) New function.
4804         (procedure_write_case) Removed.
4805         (create_case_source) Add `struct dictionary *' parameter, all
4806         references updated.
4807         (create_case_sink) Ditto.
4808         (free_case_sink) New function.
4809         (struct split_aux_data) New structure.
4810         (procedure_with_splits) New function implementing what procedure()
4811         used to.
4812         (SPLIT_FILE_proc_func) Removed.
4813         (procedure_with_splits_callback) New function.
4814         (equal_splits) New function.
4815         
4816         * aggregate.c: Pass around a struct instead of using statics.
4817         (static var outfile) Remove.
4818         (enum type) Give it tag `missing_treatment'.
4819         (static var missing) Remove.
4820         (static var sort) Remove.
4821         (static var agr_first) Remove.
4822         (static var agr_next) Remove.
4823         (static var case_count) Remove.
4824         (static var prev_case) Remove.
4825         (static var buf64_1xx) Remove.
4826         (static var buf_1xx) Remove.
4827         (struct agr_proc) New structure incorporating the above.
4828         (cmd_aggregate) Use new struct.  Clean up error handling using
4829         agr_destroy().  Completely rewrite actual implementation of
4830         aggregation.
4831         (create_sysfile) Add struct agr_proc * parameter, modify
4832         accordingly.
4833         (parse_aggregate_functions) Ditto.
4834         (free_aggregate_functions) Ditto.  Rename agr_destroy().
4835         (aggregate_single_case) Add struct agr_proc * parameter, modify
4836         accordingly.
4837         (accumulate_aggregate_info) Ditto.
4838         (dump_aggregate_info) Ditto.
4839         (initialize_aggregate_info) Ditto.
4840         (agr_00x_trns_proc) Removed.
4841         (agr_00x_end_func) Removed.
4842         (agr_10x_trns_proc) Removed.
4843         (agr_10x_trns_free) Removed.
4844         (agr_10x_end_func) Removed.
4845         (agr_11x_read) Removed.
4846         (agr_11x_finish) Removed.
4847         [DEBUGGING] (debug_print) Removed.
4848         (write_case_to_sfm) Add struct agr_proc * parameter, modify
4849         accordingly.
4850         (agr_to_active_file) New function.
4851         (presorted_agr_to_sysfile) New function.
4852         (sort_agr_to_sysfile) New function.
4853
4854         * autorecode.c: (cmd_autorecode) Use procedure_with_splits().
4855
4856         * crosstabs.q: (internal_cmd_crosstabs) Ditto.
4857
4858         * descript.q: (cmd_descriptives) Ditto.
4859
4860         * dfm.c: (cmd_begin_data) Check for storage_source_class.  Adapt
4861         to new procedure() interface.
4862
4863         * command.c: (cmd_execute) Adapt to new procedure() interface.
4864
4865         * dictionary.c: (dict_compact_values) Also delete scratch
4866         variables.
4867         (dict_get_compacted_value_cnt) New function.
4868         (dict_get_compacted_idx_to_fv) New function.
4869
4870         * flip.c: (cmd_flip) Warn about and cancel TEMPORARY.
4871         (cmd_flip) Adapt to new procedure() interface.
4872         (flip_sink_write) Use sink->idx_to_fv.
4873
4874         * frequencies.q: (internal_cmd_frequencies) Use
4875         procedure_with_splits().
4876
4877         * get.c: (cmd_save_internal) Adapt to new procedure() interface.
4878         (static var mtf_sink) New static var.
4879         (static var mtf_case) New static var.
4880         (cmd_match_files) Warn about and cancel TEMPORARY.  Redo the way
4881         we actually implement the matching.
4882         (mtf_delete_file_in_place) Use mtf_case.
4883         (mtf_processing) Use mtf_case and mtf_sink.
4884         (cmd_export) Adapt to new procedure() interface.
4885
4886         * levene.c: (levene) Use procedure_with_splits().
4887
4888         * list.q: (cmd_list) Use procedure_with_splits().
4889
4890         * matrix-data.c: (read_matrices_without_rowtype) Adapt to new
4891         procedure() interface.
4892         (read_matrices_with_rowtype) Ditto.
4893
4894         * modify-vars.c; (cmd_modify_vars) Warn about and cancel
4895         TEMPORARY.  Adapt to new procedure() interface.
4896
4897         * rename-vars.c: Warn about and cancel TEMPORARY.
4898
4899         * sort.c: (cmd_sort_cases) Warn about TEMPORARY.
4900         (sort_cases) Use dict_get_compacted_value_cnt() instead of
4901         compaction_nval.  Adapt to new procedure() interface.  Use
4902         storage_source_to_disk().
4903         (do_internal_sort) Don't try to dump the cases to memory.
4904         (compare_case_lists) Pass null idx_to_fv.
4905         (struct initial_run_state) Add `idx_to_fv' member.  Remove
4906         `case_size' member.
4907         (write_initial_runs) Don't initialize irs->case_size.  Adapt to
4908         new procedure() interface.  Reset irs->idx_to_fv after calling
4909         procedure().
4910         (sort_sink_write) Set irs->idx_to_fv.  Use case_size from struct
4911         sort_cases_pgm.  Pass irs, not struct sort_cases_pgm to
4912         push_heap().
4913         (destroy_initial_run_state) Don't dereference irs after freeing
4914         it.
4915         (allocate_cases) Don't calculate case_size locally.
4916         (compare_record) Add idx_to_fv parameter.
4917         (compare_record_run) Change parameter from struct sort_cases_pgm *
4918         to struct initial_run_state *.  Pass irs->idx_to_fv to
4919         compare_record().
4920         (compare_record_run) Third parameter now a struct
4921         initial_run_state *.
4922         (output_record) No need for out_case anymore.  Pass irs, not
4923         struct sort_cases_pgm to pop_heap().  Use case_size from struct
4924         sort_cases_pgm.
4925         (merge) Use case_size from struct sort_cases_pgm.
4926         (merge_once) Use case_size from struct sort_cases_pgm.
4927         Pass null pointer to compare_record() as idx_to_fv.
4928         (global var sort_sink_class) Make static.
4929
4930         * t-test.q: (cmd_t_test) Use procedure_with_splits().
4931
4932         * temporary.c: Remove debugging crap.
4933
4934 Sat Mar 13 14:19:52 WST 2004 John Darrington <john@darrington.wattle.id.au>
4935
4936         * t-test.q, levene.c: Fixed up the handling of MISSING values
4937         int the T-TEST
4938
4939 Fri Mar 12 16:23:35 WST 2004 John Darrington <john@darrington.wattle.id.au>
4940
4941         * t-test.q, levene.c: Added support for T-TEST /GROUP where only 
4942         one value is given.
4943
4944 Wed Mar 10 23:25:13 2004  Ben Pfaff  <blp@gnu.org>
4945
4946         Change explicit variable name checks into use of
4947         dict_class_from_id().
4948
4949         * dictionary.c: (dict_create_var)  Change explicit variable name
4950         check into use of dict_class_from_id().
4951
4952         * get.c: (trim_dictionary) Ditto.
4953
4954         * sel-if.c: (cmd_filter) Ditto.
4955
4956         * sysfile-info.c: (cmd_display) Ditto.
4957
4958         * vars-prs.c: (parse_DATA_LIST_vars) Ditto.
4959
4960         * vfm.c: (arrange_compaction) Ditto.
4961
4962         * weight.c: (cmd_weight) Ditto.
4963
4964 Wed Mar 10 21:16:34 2004  Ben Pfaff  <blp@gnu.org>
4965
4966         * temporary.c: (cmd_temporary) When TEMPORARY was the first
4967         transformation following the input program, if any, for some
4968         reason we special-cased f_trns.  That's just wrong.  It should
4969         always be set to n_trns.
4970
4971 Tue Mar  9 23:44:40 2004  Ben Pfaff  <blp@gnu.org>
4972
4973         * format.c: (parse_format_specifier_name) Fix brown-bag bug
4974         introduced in last check-in.
4975
4976 Tue Mar  9 23:10:41 2004  Ben Pfaff  <blp@gnu.org>
4977
4978         * format.c: (global array translate_fmt[]) Removed.
4979         (translate_fmt) New function as replacement.
4980         (parse_format_specifier_name) Rewrite.
4981
4982         * pfm-read.c: (convert_format) Use translate_fmt() instead of
4983         translate_fmt[].
4984
4985         * sfm-read.c: (parse_format_spec) Ditto.
4986
4987         * postscript.c: (text) Fix handling of fonts with missing
4988         ligatures.
4989
4990         * sort.c: (struct external_sort) Add temp_name member.
4991         (destroy_external_sort) Free temp_dir, temp_name members.
4992         (init_external_sort) Allocate temp_name.
4993         (get_temp_file_name) Change prototype.
4994         (open_temp_file) Deal with change to get_temp_file_name().
4995         (close_temp_file) Ditto.
4996         (remove_temp_file) Ditto.
4997         (write_temp_file) Ditto.
4998         (read_temp_file) Ditto.
4999         (sort_sink_destroy) Removed.
5000         (sort_sink_class) Change destroy member to null.
5001
5002 Tue Mar  9 22:36:34 2004  Ben Pfaff  <blp@gnu.org>
5003
5004         Eliminate temp_case.
5005
5006         * aggregate.c: (cmd_aggregate) No need to save/restore temp_case
5007         anymore.  Use agr_11x_finish().
5008         (aggregate_single_case) Make first param const.
5009         (accumulate_aggregate_info) Ditto.
5010         (agr_00x_end_func) Use compaction_case, not temp_case.
5011         (agr_11x_func) Break into agr_11x_read(), agr_11x_finish().
5012
5013         * data-list.c: (struct data_list_pgm) Add `case_size' member.
5014         (cmd_data_list) Initialize case_size.
5015         (read_from_data_list_fixed) Add struct ccase * param, use instead
5016         of temp_case.
5017         (read_from_data_list_free) Ditto.
5018         (read_from_data_list_list) Ditto.
5019         (read_one_case) Rename data_list_trns_proc(), all references
5020         updated.  Add argument in calling above functions.  Use c
5021         argument instead of temp_case.
5022         (destroy_dls) Rename data_list_trns_free(), all references
5023         updated.
5024
5025         * expr-evl.c: (expr_evaluate) Make second parameter const.
5026
5027         * file-type.c: (struct file_type_pgm) Add `case_size' member.
5028         (cmd_end_file_type) Initialize `case_size'.
5029         (file_type_source_read) Add struct ccase * parameter.  Use instead
5030         of temp_case.
5031
5032         * flip.c: Rewritten.
5033
5034         * get.c: (struct get_pgm) New structure to keep track of
5035         case_size.
5036         (cmd_get) Initialize case_size.
5037         (cmd_import) Ditto.
5038         (get_source) Deal with struct get_pgm.
5039         (get_source_read) Add struct ccase * parameter, use instead of
5040         temp_case.
5041         (import_source_read) Ditto.
5042
5043         * get.c: Use a null pointer instead of temp_case to represent the
5044         "current case" in a struct mtf_file's input member.
5045         (mtf_processing_finish) Pass null to mtf_processing(), not
5046         temp_case.
5047         (mtf_read_nonactive_records) Don't set iter->input to temp_case.
5048         (mtf_compare_BY_values) Add extra arg, use instead of null input
5049         members.
5050         (mtf_processing) Use c parameter instead of temp_case.  Pass
5051         compaction_case to process_active_file_output_case().
5052         
5053         * glob.c: (global variable temp_case) Removed.
5054
5055         * inpt-pgm.c: (struct input_program_pgm) Add `case_size' member.
5056         (cmd_input_program) Initialize case_size.  Set
5057         vfm_source->value_cnt.
5058         (init_case) Add struct ccase * parameter, use instead of
5059         temp_case.
5060         (clear_case) Ditto.
5061         (input_program_source_read) Ditto.
5062
5063         * matrix-data.c: (matrix_data_read_without_rowtype) Ditto.
5064         (dump_cell_content) Ditto.
5065         (nr_output_data) Ditto.
5066         (read_matrices_without_rowtype) Ditto.
5067         (matrix_data_read_with_rowtype) Ditto.
5068         (wr_read_splits) Ditto.
5069         (wr_output_data) Ditto.
5070
5071         * sort.h: (struct sort_cases_pgm) New member `case_size'.
5072         
5073         * sort.c: (sort_cases) Initialize scp->case_size.
5074         (struct external_sort) Remove `case_size' member.
5075         (write_initial_runs) Only call vfm_sink->class_destroy if
5076         non-null.
5077         (struct sort_source_aux) New structure.
5078         (sort_source_read_helper) New function.
5079         (sort_source_read) Use sort_source_read_helper().
5080         (read_sort_output) Change interface to be more reasonable.
5081         (read_internal_sort_output) Ditto.
5082         (read_external_sort_output) Ditto.
5083
5084         * vars-prs.c: (dict_class_to_name) Pass return value through
5085         gettext.
5086
5087         * vfm.c: (struct procedure_aux_data) Add `trns_case' member.
5088         (procedure) Initialize trns_case.
5089         (procedure) Pass trns_case to vfm_source->class->read().
5090         Free trns_case.
5091         (process_active_file) Start using struct procedure_aux_data.
5092         (process_active_file_write_case) Pass trns_case to
5093         transformations, lag_case(), clear_case().
5094         (process_active_file_output_case) Add struct ccase * parameter.
5095         (create_trns_case) New function.
5096         (make_temp_case) Removed.
5097         (vector_initialization) Removed.
5098         (close_active_file) Only call make_source if non-null, otherwise
5099         set vfm_source to null pointer.  Don't free temp_case.
5100         (disk_source_read) Add struct ccase * parameter, use instead of
5101         temp_case.
5102         (memory_source_read) Ditto.
5103         (lag_case) Add const struct ccase * member.
5104         (procedure_write_case) Use trns_case instead of temp_case.
5105         (clear_case) Add struct ccase * member, use instead of temp_case.
5106         (exclude_this_case) Ditto.
5107         (create_case_source) Add struct dictionary * parameter, use to
5108         initialize source->value_cnt.
5109
5110         * vfm.h: (struct case_source) Add `value_cnt' member.
5111         (struct case_source_class) Add struct ccase * parameter to `read'
5112         member function pointer.
5113         (struct case_sink_class) Make struct ccase * parameter const in
5114         `write' member function pointer.
5115         
5116 Wed Mar  3 20:44:37 2004  Ben Pfaff  <blp@gnu.org>
5117
5118         Fix a lot of "possibly uninitialized variable" warnings.  Some of
5119         them are even real bugs.  A few of them make me wonder how the
5120         code ever worked.
5121
5122         * aggregate.c: (parse_aggregate_functions) Initialize `function.
5123
5124         * ascii.c: (output_lines) Add default case to switch.
5125
5126         * crosstabs.q: Remove static variable `expected' and all
5127         references to it.
5128         (display_crosstabulation) Always calculate expected value.
5129         (calc_chisq) Ditto.
5130         (output_pivot_table) Initialize `cmp'.
5131         (display_crosstabulation) New variable `last_row', which is
5132         initialized.
5133
5134         * data-in.c: (parse_numeric) Always initialize sign.  How did this
5135         work at all?!
5136
5137         * data-list.c: (repeating_data_trns_proc) Always initialize code.
5138         Always set info.ofs.  (How did this work?!)
5139
5140         * expr-opt.c: (optimize_tree) Always initialize `m'.
5141         (evaluate_tree) Always initialize `c'.  (How did this work?)
5142
5143         * frequencies.q: (frq_custom_variables) Always initialize min,
5144         max.
5145         (frq_custom_grouped) Always initialize `dl'.
5146
5147         * groff-font.c: (groff_read_font) Always initialize char_set.
5148
5149         * matrix-data.c: (nr_output_data) Initialize `split'.
5150         (wr_read_splits) Remove shadowing split_cnt declaration.
5151         (wr_output_data) Initialize `split'.
5152
5153         * output.c: (tokener) Skip add character on syntax error.
5154
5155         * pool.c: (pool_strndup) Always set `copy'.  (How did this work?!)
5156
5157         * postscript.c: (read_ps_encodings) Use line.string instead of
5158         uninitialized `bp'.
5159         (write_text) Add default case to switch.
5160         (text) Always initialize multiple variables.  Fix bug with
5161         ligatures.
5162
5163         * print.c: (fixed_parse_fortran) Initialize head.
5164         (alloc_line) Add default case to switch.
5165
5166         * recode.c: (parse_dest_spec) Handle case where nothing matches.
5167         (recode_trns_proc) Move variable declaration inward.  Add default
5168         case to switch.
5169
5170         * sfm-read.c: (read_header) Initialize skip_amt.
5171
5172         * sysfile-info.c: (display_variables) Always initialize pc.
5173
5174         * vars-prs.c: Initialized `included'.
5175
5176 Wed Mar  3 09:30:09 2004  Ben Pfaff  <blp@gnu.org>
5177
5178         * main.c: (main) sigaction()'s sa_flags member was uninitialized.
5179         Just use signal() instead.
5180
5181 Wed Mar  3 09:26:30 2004  Ben Pfaff  <blp@gnu.org>
5182
5183         Get rid of vfm_sink_info and vfm_source_info.
5184         
5185         * aggregate.c: (agr_00x_end_func) Don't increment
5186         sfm_sink_info.ncases.
5187
5188         * sort.c: (do_internal_sort) Get case count from
5189         vfm_source->class->count().
5190         (struct external_sort) Add `case_size' member.
5191         (do_external_sort) Initialize case_size.
5192         (struct initial_run_state) Add `case_size' member.
5193         (write_initial_runs) Initialize case_size.
5194         (sort_sink_write) Use case_size.
5195         (read_external_sort_output) Use case_size.  Get case_cnt from
5196         initial_runs.
5197
5198         * vfm.c: (struct write_case_data) Add underscores to existing arg
5199         names, all references updated.  Renamed `aux' as `func_aux', all
5200         references updated.  Added new `aux' member.
5201         (global var vfm_source_info) Removed.
5202         (global var vfm_sink_info) Removed.
5203         (struct procedure_aux_data) New.
5204         (struct split_aux_data) New.
5205         (procedure) Use `aux' fields for procedure_aux_data,
5206         split_aux_data.
5207         (process_active_file_write_case) Pass case_count + 1 to
5208         transformation procedures, exclude_this_case().
5209         (process_active_file_output_case) Don't increment
5210         vfm_sink_info.ncases.
5211         (prepare_for_writing) Don't initialize vfm_sink_info.  Don't try
5212         to send data to disk early.
5213         (make_temp_case) Don't use vfm_sink_info.case_size.
5214         (close_active_file) Don't initialize vfm_source_info.
5215         (struct disk_stream_info) New, to allow for case_cnt and case_size fields.
5216         (disk_sink_create) Initialize and/or update disk_stream_info.
5217         (disk_sink_write) Ditto.
5218         (disk_sink_destroy) Ditto.
5219         (disk_sink_make_source) Ditto.
5220         (disk_source_read) Ditto.
5221         (disk_source_destroy) Ditto.
5222         (global var disk_source_class) Add disk_source_count().
5223         (disk_source_count) New function.
5224         (struct memory_sink_info) Add `case_cnt', `case_size' members.
5225         (struct memory_source_info) Ditto.
5226         (memory_sink_create) Deal with case_cnt, case_size.
5227         (memory_sink_write) Ditto.
5228         (memory_sink_make_source) Ditto.
5229         (memory_source_read) Ditto.
5230         (memory_source_count) New function.
5231         (memory_source_class) Add memory_source_count().
5232         (procedure_write_case) Don't use vfm_sink_info.ncases.  Do use
5233         proc_aux->cases_written, and pass it to transformation procedures
5234         and exclude_this_case ().
5235         (exclude_this_case) Add case_num parameter.  Pass it to
5236         expr_evaluate().
5237         (SPLIT_FILE_procfunc) Use split_aux->prev_case instead of static
5238         variable.
5239
5240         * vfm.h: (struct case_source_class) Add `count' member.
5241
5242         * vfmP.h: (struct stream_info) Removed.
5243         (global variable vfm_source_info) Removed.
5244         (global variable vfm_sink_info) Removed.
5245         
5246 Tue Mar  2 23:38:17 2004  Ben Pfaff  <blp@gnu.org>
5247
5248         * var.h: (typedef trns_proc_func) New typedef.
5249         (trns_free_func) New typedef.
5250         (struct trns_header) Change `proc' to type trns_proc_func, `free'
5251         to type trns_free_func.  This only changes the actual type of
5252         trns_proc_func, adding a `case_num' parameter.  Updated all
5253         implementations to use the typedefs instead.
5254
5255         * compute.c: (compute_num) Pass case_num to expr_evaluate().
5256         (compute_num_vec) Ditto.
5257         (compute_str) Ditto.
5258         (compute_str_vec) Ditto.
5259
5260         * do-if.c: (do_if_trns_proc) Ditto.
5261
5262         * expr-evl.c: (expr_evaluate) Add new case_num parameter, use for
5263         OP_CASENUM.
5264
5265         * inpt-pgm.c: (input_program_source_read) Maintain case count,
5266         pass to transformation functions.
5267         (reread_trns_proc) Pass case_num arg to expr_evaluate().
5268
5269         * loop.c: (loop_1_trns_proc) Ditto.
5270         (loop_2_trns_proc) Ditto.
5271         (loop_3_trns_proc) Ditto.
5272
5273         * print.c: (print_space_trns_proc) Ditto.
5274
5275         * sel-if.c: (select_if_proc) Ditto.
5276
5277 Tue Mar  2 11:36:52 2004  Ben Pfaff  <blp@gnu.org>
5278
5279         * frequencies.q: (cleanup_freq_tab) Avoid memory leak by
5280         destroying hash table.
5281
5282         * glob.c: (read_active_file) Variable not referenced, removed.
5283         (cancel_input_pgm) Ditto.
5284
5285         * levene.c: Add #include <stdlib.h> needed to call free().
5286
5287         * aggregate.c: (parse_aggregate_functions) Make `function'
5288         variable const.
5289
5290 Tue Mar  2 11:30:56 2004  Ben Pfaff  <blp@gnu.org>
5291
5292         Start working to eliminate VFM dependence on static variables.
5293
5294         * command.c: (cmd_parse) Use case_source_is_class().
5295
5296         * data-list.c: Rewrite to eliminate use of static variables.
5297
5298         * dfm.c: (cmd_begin_data) Use case_source_is_class().
5299
5300         * file-handle.q: (fh_handle_name) Make parameter const.
5301
5302         * file-type.c: Rewrite to eliminate use of static variables.
5303
5304         * flip.c: Rewrite to eliminate use of static variables.
5305
5306         * format.c: (get_format_var_width) New function.
5307
5308         * get.c: Eliminate use of static variables.
5309
5310         * inpt-pgm.c: Eliminate use of static variables.
5311
5312         * matrix-data.c: Eliminate use of static variables.
5313
5314         * set.q: (set_max_workspace) New variable.
5315         (cmd_set) Use SET WORKSPACE to modify set_max_workspace.
5316
5317         * var.h: (struct case_list) Move here from vfmP.h.
5318
5319         * vars-atr.c: (discard_variables) Handle new vfm_source type.
5320
5321         * vfm.c: (vfm_source) Change type from struct case_stream to
5322         struct case_source.
5323         (vfm_sink) Change type from struct case_stream to struct
5324         case_sink.
5325         (static var paging) Rename workspace_overflow, all references
5326         updated.
5327         (procedure) Use new class structures.
5328         (process_active_file) Ditto.
5329         (process_active_file_write_case) Ditto.
5330         (prepare_for_writing) Use set_max_workspace.  Use new class
5331         structures.
5332         (close_active_file) Use new class structures.  Free old sink.
5333         (global var disk_source_file) Removed.
5334         (global var disk_sink_file) Removed.
5335         (disk_stream_init) Removed.
5336         (disk_stream_read) Removed.
5337         (disk_stream_write) Removed.
5338         (disk_stream_mode) Removed.
5339         (disk_stream_destroy_source) Removed.
5340         (disk_stream_destroy_sink) Removed.
5341         (global var vfm_disk_stream) Removed.
5342         (disk_sink_create) New function.
5343         (disk_sink_write) New function.
5344         (disk_sink_destroy) New function.
5345         (disk_sink_make_source) New function.
5346         (disk_sink_class) New static var.
5347         (disk_source_read) New function.
5348         (disk_source_destroy) New function.
5349         (global var vfm_source_class) New var.
5350         (global var memory_source_cases) Removed.
5351         (global var memory_sink_cases) Removed.
5352         (global var memory_sink_max_cases) Removed.
5353         (struct memory_sink_info) New struct.
5354         (memory_stream_init) Removed.
5355         (memory_stream_read) Removed.
5356         (memory_stream_write) Removed.
5357         (memory_stream_mode) Removed.
5358         (memory_stream_destroy_source) Removed.
5359         (memory_stream_destroy_sink) Removed.
5360         (global var vfm_memory_stream) Removed.
5361         (page_to_disk) Renamed write_active_file_to_disk().
5362         (memory_sink_create) New function.
5363         (memory_sink_write) New function.
5364         (memory_sink_destroy) New function.
5365         (memory_sink_make_source) New function.
5366         (memory_sink_class) New static var.
5367         (memory_source_read) New function.
5368         (memory_source_destroy) New function.
5369         (memory_source_get_cases) New function.
5370         (memory_source_set_cases) New function.
5371         (global var vfm_source_class) New var.
5372         (procedure_write_case) Use new class structures.
5373         (create_case_source) New function.
5374         (case_source_is_complex) New function.
5375         (case_source_is_class) New function.
5376         (create_case_sink) New function.
5377
5378         * vfm.h: (global variable reinit_sysmis) Not used, removed.
5379         (global variable reinit_blanks) Not used, removed.
5380         (global variable init_zero) Not used, removed.
5381         (global variable init_blanks) Not used, removed.
5382         (struct case_source) New struct.
5383         (struct case_source_class) New struct.
5384         (struct case_sink) New struct.
5385         (struct case_sink_class) New struct.
5386         (struct case_stream) Removed.
5387
5388         * vfmP.h: (struct case_list) Moved to var.h.
5389
5390 Tue Mar  2 11:28:30 2004  Ben Pfaff  <blp@gnu.org>
5391
5392         * algorithm.c: (count_equal) New function.
5393         (count_if) New function.
5394         (unique) Add assertions.
5395         (partition) Add assertions.
5396         (is_partitioned) New function.
5397         (copy_if) Add assertions.
5398         (remove_equal) Add assertions.
5399         (lexicographical_compare) Rename lexicographical_compare_3way.
5400         (sort) Add assertions.  Rephrase some code.
5401         (is_sorted) New function.
5402
5403 Sun Feb 29 23:24:57 2004  Ben Pfaff  <blp@gnu.org>
5404
5405         Rewrite SORT CASES.
5406
5407         * sort.c: Completely rewrite.
5408
5409         * sort.h: Expose interface via struct sort_cases_pgm, not via
5410         global variables.
5411
5412         * aggregate.c: (sort) New static var.
5413         (cmd_aggregate) Use sort.
5414         (create_sysfile) Ditto.
5415         (aggregate_single_case) Ditto.
5416         (dump_aggregate_info) Ditto.
5417         (agr_00x_end_func) Ditto.
5418         (debug_print) Ditto.
5419
5420         * var.h: (enum SRT_ASCEND) Removed.
5421         (enum SRT_DESCEND) Removed.
5422         (struct sort_cases_proc) Removed.
5423         (struct variable) Remove p.srt member.
5424
5425 Sun Feb 29 23:22:45 2004  Ben Pfaff  <blp@gnu.org>
5426
5427         Get rid of the old, crappy heap structure and replace it by a new,
5428         shiny, C++ STL-like heap structure.
5429         
5430         * Makefile.am: (pspp_SOURCES) Remove heap.c, heap.h.
5431
5432         * algorithm.c: (push_heap) New function.
5433         (heapify) Ditto.
5434         (pop_heap) Ditto.
5435         (make_heap) Ditto.
5436         (sort_heap) Ditto.
5437         (is_heap) Ditto.
5438         
5439         * heap.c: Removed.
5440
5441         * heap.h: Removed.
5442
5443 Sun Feb 29 23:21:53 2004  Ben Pfaff  <blp@gnu.org>
5444
5445         Increase warning level.
5446         
5447         * Makefile.am: (AM_CFLAGS) Remove -Wnouninitialized.
5448
5449 Sat Feb 21 17:38:58 WST 2004 John Darrington <john@darrington.wattle.id.au>
5450
5451         * main.c: Added a signal handler for SIGSEGV requesting a bug report.
5452          
5453 Fri Feb 20 23:22:14 2004  Ben Pfaff  <blp@gnu.org>
5454
5455         * dictionary.c: (dict_create_var) Fix root cause of bug worked
5456         around by previous change log entry.
5457         
5458         * compute.c: (lvalue_finalize) Remove workaround from previous
5459         change log entry.
5460
5461 Fri Feb 20 14:37:41 WAST 2004 John Darrington <john@darrington.wattle.id.au>
5462
5463         * compute.c: Fixed a bug where the Format was not getting set for 
5464           computed variables (thus causing a crash when SAVEing).
5465
5466         * Added a test to stop this bug ever coming back
5467
5468 Wed Feb 18 22:21:35 2004  Ben Pfaff  <blp@gnu.org>
5469
5470         Got rid of approx.h.  In general, replaced all references to
5471         approx_eq() by ==, approx_lt() by <, etc.  Other types of changes
5472         noted below.
5473
5474         * Makefile.am: (pspp_SOURCES) Removed approx.h.
5475
5476         * data-out.c: (try_F) Replaced test for approx_eq(number, 0.0) by
5477         test for mag < EPSILON.
5478
5479         * misc.h: Add definition of EPSILON.
5480
5481 Wed Feb 18 21:32:44 2004  Ben Pfaff  <blp@gnu.org>
5482
5483         * vfm.c: (procedure) Add check to prevent recursive call.
5484
5485 Wed Feb 18 21:48:54 WST 2004 John Darrington <john@darrington.wattle.id.au>
5486
5487         * Moved the declarations relating to values to their own header file
5488           (val.h)
5489
5490         * Added levene.c and levene.h
5491
5492         * vars-atr.c: Changed the signature of compare_values to 
5493         take const * arguments.
5494                 
5495         * t-test.q: Changed the structure of struct t_test_proc 
5496        variables now contain their own group statistics information.
5497        Eventually, t_test_proc might get renamed, because it'd be 
5498        applicable to other commands too.
5499
5500 Mon Feb 16 23:15:51 2004  Ben Pfaff  <blp@gnu.org>
5501
5502         * data-out.c: Clean up.  Changed interface of convert_*() to take
5503         either a `double' or a `const char *' instead of a `const union
5504         value *'.  Update all implementations of those interfaces.
5505         (data_out) Use switch statements instead of a table.
5506         (convert_AHEX) Rewrite.
5507
5508         * format.h: Update comment.
5509
5510 Mon Feb 16 22:14:36 2004  Ben Pfaff  <blp@gnu.org>
5511
5512         * q2c.c: (dump_header) Add an Emacs header line to output files
5513         that makes generated .c files read-only by default, to make it
5514         difficult to accidentally change generated files.
5515
5516 Mon Feb 16 22:12:07 2004  Ben Pfaff  <blp@gnu.org>
5517
5518         * frequencies.q: (compare_freq_numeric_a) Compare by frequency,
5519         not bogus a->v.c <=> b->v.c pointer compare.
5520         (compare_freq_alpha_a) Ditto.
5521         (compare_freq_numeric_d) Ditto.
5522         (compare_freq_alpha_d) Ditto.
5523         
5524 Mon Feb 16 22:00:53 2004  Ben Pfaff  <blp@gnu.org>
5525
5526         Changed data_out() to store string data directly into a `union
5527         value''s s member, not indirectly into c.
5528
5529         * crosstabs.q: (output_pivot_table) Use format_short() instead of
5530         data_out().
5531         (table_value_missing) Ditto.
5532         (float_M_suffix) Ditto.
5533         (format_short) New function.
5534
5535         * data-in.h: (data_in_finite_line) Remove inline definition.
5536
5537         * data-list.c: (destroy_dls_var_spec) New function.
5538         (destroy_dls) Rewrite in terms of destroy_dls_var_spec().
5539         (data_list_source_destroy_source) Avoid cast.
5540         (struct repeating_data_trns) New field `id_value'.  Update
5541         comments.
5542         (cmd_repeating_data) Initialize id_value.  Use new
5543         repeating_data_trns_free() for freeing REPEATING DATA
5544         transformations.
5545         (rpd_parse_record) Rewrite support for record ID to be less bogus.
5546         (repeating_data_trns_free) New function.
5547
5548         * data-out.c: (data_out) Change return type to `void' by replacing
5549         error returns by writing a message into the output buffer.
5550         (convert_A) Read from v->s instead of v->c.
5551         (convert_AHEX) Ditto.
5552
5553         * expr-evl.c: Update comment.
5554         (expr_evaluate) Add assertion in OP_STRING case.
5555
5556         * format.h: (macro MAX_FORMATTED_LEN) New macro.
5557
5558         * list.q: (list_cases) Update for new data_out() semantics.
5559
5560         * print.c: (print_trns_proc) Ditto.
5561
5562         * tab.c: (tab_value) Ditto.
5563         (tab_float) Avoid stupid cast.
5564
5565         * var.h: Update comments.
5566         (macro MAX_STRING) New macro.
5567         (macro MAX_ELEMS_PER_VALUE) New macro.
5568
5569         * vars-atr.c: (compare_values) New function.
5570
5571         * vfm.c: (dump_splits) Update for new data_out() semantics.
5572
5573 Mon Feb 16 21:45:47 2004  Ben Pfaff  <blp@gnu.org>
5574
5575         * crosstabs.q: (struct table_entry) Rename v[] to values[].  All
5576         references updated.
5577         (struct crosstab) Rename v[] to vars[].  All references updated.
5578         (hash_table_entry) Replace the hash algorithm and fix a bug at the
5579         same time, which caused the hash value to depend only on a single
5580         value, not all of the variables' values.
5581         
5582 Mon Feb 16 12:49:53 2004  Ben Pfaff  <blp@gnu.org>
5583
5584         Clean up struct dictionary's value_cnt usage.
5585
5586         * dictionary.c: Add a function comment to each function.
5587         (struct dictionary) Rename value_cnt to next_value_idx, which more
5588         accurately reflects its meaning.  All references updated.
5589         (dict_rename_vars) Add assertion.
5590         (dict_get_value_cnt) Rename dict_get_next_value_idx().  All
5591         references updated.
5592         (dict_get_case_size) New function.
5593
5594         * aggregate.c: (create_sysfile) Use dict_get_case_size().
5595
5596         * get.c: (mtf_read_nonactive_records) Ditto.
5597
5598         * sort.c: (allocate_cases) Ditto.
5599         (write_initial_runs) Ditto.
5600         (merge) Ditto.
5601         (merge_once) Ditto.
5602
5603         * vfm.c: (prepare_for_writing) Ditto.
5604         (setup_lag) Ditto.
5605         (lag_case) Ditto.
5606
5607 Mon Feb 16 00:17:55 2004  Ben Pfaff  <blp@gnu.org>
5608
5609         Make vfm.c slightly less grotesque.
5610
5611         * vfm.c: (filter_var) Removed.
5612         (filter_index) Removed.
5613         (FILTERED macro) Removed.
5614         (exclude_this_case) New function.
5615         (process_active_file_write_case) Use exclude_this_case() instead
5616         of FILTERED and inline tests.
5617         (procedure_write_case) Ditto.
5618         (setup_filter) Removed.
5619         (open_active_file) Don't call setup_filter().
5620         (close_active_file) Call dict_get_filter() instead of checking
5621         filter_var.
5622
5623 Mon Feb 16 00:01:53 2004  Ben Pfaff  <blp@gnu.org>
5624
5625         * var.h: (struct variable) Update comments.
5626
5627 Sun Feb 15 23:14:59 2004  Ben Pfaff  <blp@gnu.org>
5628
5629         New functions dict_create_var_assert(), dict_lookup_var_assert().
5630         Converted several dict_*_var()/assert pairs into a single
5631         dict_*_var_assert().
5632
5633         * dictionary.c: (dict_create_var_assert) New function.
5634         (dict_lookup_var_assert) New function.
5635
5636 Sun Feb 15 23:06:08 2004  Ben Pfaff  <blp@gnu.org>
5637
5638         Got rid of "struct long_vec", envector(), devector(), etc.  Added
5639         two members `init', `reinit' to struct variable as a substitute.
5640         
5641         * Makefile.am: (pspp_SOURCES) Removed cases.c, cases.h.
5642         
5643         * cases.c: Removed.
5644
5645         * cases.h: Removed.
5646
5647         * aggregate.c: (parse_aggregate_functions) destvar doesn't need
5648         init.
5649
5650         * autorecode.c: (cmd_autorecode) destvars don't need init.
5651
5652         * compute.c: (lvalue_finalize) Set reinit.
5653
5654         * data-list.c: (fixed_parse_compatible) Don't need init usually.
5655         (dump_fmt_list) Ditto.
5656         (parse_free) Ditto.
5657
5658         * descript.q: (run_z_pass) Don't need init for z-scores.
5659
5660         * dictionary.c: (dict_create_var) Initialize `init', `reinit'
5661         members.
5662         (dict_clone_var) Copy `reinit' member, initialize `init' member.
5663
5664         * glob.c: (init_glob) Remove vec_init() calls.
5665
5666         * inpt-pgm.c: (cmd_end_input_program) Use `reinit', not `left'.
5667         
5668         * loop.c: (internal_cmd_loop) Don't need to call envector().
5669
5670         * numeric.c: (cmd_numeric) Ditto.
5671         (cmd_string) Ditto.
5672         (cmd_leave) Ditto.  Set `init', `reinit' members.
5673
5674         * recode.c: (cmd_recode) Don't need to call envector().
5675
5676         * repeat.c: (internal_cmd_do_repeat) Ditto.
5677
5678         * var.h: (struct variable) Remove `left'.  Add `init', `reinit'.
5679         (force_create_variable) Removed prototype.
5680         (force_dup_variable) Ditto.
5681
5682         * vector.c: (cmd_vector) Don't need to call envector().
5683
5684         * vfm.c: (reinit_sysmis) Removed.
5685         (reinit_blanks) Removed.
5686         (init_zero) Removed.
5687         (init_blanks) Removed.
5688         (process_active_file_write_case) No need to deal with vectors.
5689         Call clear_temp_case().
5690         (vector_initialization) Rewrite to use `init', `reinit'.
5691         (close_active_file) No need to call vec_clear().
5692         (procedure_write_case) Call clear_temp_case().
5693         (clear_temp_case) New function.
5694
5695 Sun Feb 15 20:50:36 2004  Ben Pfaff  <blp@gnu.org>
5696
5697         * pfm-write.c: (bufwrite) Get rid of nasty cast that also invoked
5698         undefined behavior.
5699
5700 Thu Feb 12 23:35:15 2004  Ben Pfaff  <blp@gnu.org>
5701
5702         Add auxiliary argument to procedure() interface.  Associated small
5703         clean-ups of vfm interface.
5704         
5705         * Updated every caller of procedure() and process_active_file() to
5706         reflect modified interface.  Simple, ordinary changes not listed
5707         otherwise below.
5708
5709         * Updated every function that implements struct case_stream's
5710         `read' function to take a write_case_func and a write_case_data.
5711         Also updated every caller of write_case() to instead call them
5712         through these arguments.  In some cases this meant that the extra
5713         args had to be threaded through a couple of extra levels.  This
5714         wasn't difficult or interesting so the details won't be given.
5715
5716         * data-list.c: (struct repeating_data_trns) Add members
5717         `write_case', `wc_data' as kluge.
5718         (read_one_set_of_repetitions) Rename repeating_data_trns_proc and
5719         make non-static.
5720         (repeating_data_set_write_case) New function.
5721
5722         * data-list.h: New file to declare repeating_data_trns_proc() and
5723         repeating_data_set_write_case().
5724
5725         * inpt-pgm.c: (input_program_source_read) Call
5726         repeating_data_set_write_case() for all the REPEATING DATA
5727         transformations, so that they know where to send their cases.
5728         It's a big kluge.  Also kluge in END CASE.
5729         (end_case_trns_proc) Never called anymore, but we still need it,
5730         so just assert(0).
5731
5732         * sort.c: (read_sort_output) Update to match struct case_stream
5733         `read' member.
5734
5735         * vfm.c: (struct write_case_data) New structure.
5736         (proc_func) Removed.
5737         (virt_proc_func) Removed.
5738         (begin_func) Removed.
5739         (virt_begin_func) Removed.
5740         (end_func) Removed.
5741         (write_case) Removed.
5742         (procedure) Added an auxiliary parameter to each function pointer
5743         argument's prototype.  Added an auxiliary data parameter.
5744         Rewrote.
5745         (process_active_file) Ditto.
5746         (process_active_file_write_case) Pass aux data along.
5747         (close_active_file) Ditto.
5748         (procedure_write_case) Ditto.
5749         (SPLIT_FILE_procfunc) Ditto.
5750
5751         * vfm.h: (typedef write_case_data) New.
5752         (typedef write_case_func) New.
5753         (struct case_stream) Add parameters to `read' member prototype.
5754         
5755 Thu Feb 12 19:24:53 WST 2004 John Darrington <john@darrington.wattle.id.au>
5756
5757         * t-test.q:  Added calculations for independent samples. (But no Levene
5758         test yet!)
5759
5760         * Makefile.am: Moved q_sources_c into own variable 
5761
5762 Wed Feb 11 23:56:51 2004  Ben Pfaff  <blp@gnu.org>
5763
5764         Miscellaneous cleanups.
5765         
5766         * Change unused to UNUSED in many source files to reflect modified
5767         pref.h.  Change use of __WIN32__, __MSDOS, __DJGPP__,
5768         __CYGWIN32__, __unix__, and unix not to assume that they're
5769         defined to a nonzero value.  Change use of __attribute__ to use
5770         NO_RETURN or PRINTF_FORMAT instead.
5771         
5772         * alloc.h: Move definitions for local_alloc(), local_free() here
5773         from ../pref.h.orig and simplify.
5774
5775         * expr-evl.c: Instead of working differently based on PAGED_STACK,
5776         use a pool allocator unconditionally.
5777         (CHECK_STRING_SPACE) Removed.
5778         (ALLOC_STRING_SPACE) Removed.
5779         (expr_evaluate) Use e->pool instead of CHECK_STRING_SPACE and
5780         ALLOC_STRING_SPACE.
5781
5782         * expr-opt.c: (dump_expression) Allocate string pool.
5783
5784         * expr-prs.c: (expr_free) Free string pool.
5785
5786         * pool.c: (pool_destroy) This pool must be removed from its
5787         parent's list of gizmos, not from its own.  Use free_all_gizmos().
5788         (pool_clear) New function.
5789         (free_all_gizmos) New function.
5790         (pool_alloc) Use space in empty block after this one if any.
5791         (pool_release) Only empty out blocks, don't actually free() them.
5792
5793         * print.c: Get rid of PAGED_STACK special case by always
5794         dynamically allocating line buffers.
5795         (struct print_trns) Always include the `line' member.
5796         (internal_cmd_print) Always initialize the `line' member.
5797         (alloc_line) Always allocate memory for `line'.
5798         (print_trns_proc) Always initialize buf from `line' member.
5799         (print_trns_free) Always free `line' memory.
5800
5801         * sort.c: (allocate_file_handles) Special-case MS-DOS for mkdir()
5802         call.
5803         
5804 Wed Feb 11 20:33:18 2004  Ben Pfaff  <blp@gnu.org>
5805
5806         * flip.c: Fixed crash from FLIP when a numeric variable is
5807           specified on NEWNAMES and a large value is used, and a couple of
5808           other minor bugs besides.
5809           (struct varname) Make name a 9-character fixed-size array
5810           instead of a 1-character variable size array.
5811           (make_new_var) Allow digits in variable names.
5812           (flip_stream_write) Limit numeric values to 8 characters and
5813           format system missing and very large and small values more
5814           appropriately.
5815
5816 Thu Feb  5 13:19:06 WAST 2004 John Darrington <john@darrington.wattle.id.au>
5817
5818         * command.c: Fixed test on command return status for the correct 
5819           value,  which had been causing a crash under certain invalid input.
5820
5821 Wed Feb  4 15:34:11 WST 2004 John Darrington <john@darrington.wattle.id.au>
5822
5823         * t-test.q: Added calculations for the one sample variant of the T-TEST
5824
5825 Tue Feb  3 20:09:54 2004  Ben Pfaff  <blp@gnu.org>
5826
5827         * tab.c: (render_strip) Fix bug that sometimes caused joined text
5828           in joined cells to be rendered outside box boundaries.
5829
5830 Tue Feb  3 18:56:45 WST 2004 John Darrington <john@darrington.wattle.id.au>
5831
5832         * random.c (rng_create): Fixed seeding so that it gets reseeded after
5833         SET seed=xx has been called.
5834
5835 Mon Jan 19 14:08:09 2004  Ben Pfaff  <blp@gnu.org> 
5836
5837         * random.c (rng_get_double): Fix always-returning-zero bug in my
5838         preferred way, and at the same time make sure rounding doesn't
5839         bite us.
5840
5841 Thu Jan  1 23:16:41 2004  Ben Pfaff  <blp@gnu.org>
5842
5843         * html.c: (change_attributes) Dead code, removed.
5844         (escape_string) Eliminate code to call change_attributes() that
5845         never actually called it.
5846         (output_tab_table) Get rid of dependence on tab_hit
5847         and struct tab_joined_cell's hit member, which are abominations.
5848
5849         * tab.c: (tab_output_text) Don't call
5850         d->class->text_set_font_by_name if it's a null pointer.
5851         (macro UNROLL_LOOP) Eliminate.
5852         (macro UNROLL_3_LOOPS) Eliminate.
5853         (tabi_render) Rewrite not to use the above macros.
5854
5855 Thu Jan  1 23:09:07 2004  Ben Pfaff  <blp@gnu.org>
5856
5857         Start working on a new output driver system, one that doesn't suck
5858         so much, by adding a "device-independent" output driver.  The idea
5859         is to write out only a single output stream, then use separate
5860         processes to translate them into whatever formats we want.  This
5861         is similar to how "groff" works with its various output drivers
5862         (grops, grotty, grodvi, ...).
5863         
5864         * Makefile.am: (pspp_SOURCES) Add devind.c, devind.h.
5865
5866         * list.q: (write_all_headers) Stub out devind class.
5867         (clean_up) Ditto.
5868         (determine_layout) Ditto.
5869         (list_cases) Ditto.
5870
5871         * output.c: (outp_init) Add devind class.
5872
5873         * devind.c: New file.
5874
5875         * devind.h: New file.
5876
5877 Thu Jan  1 23:08:14 2004  Ben Pfaff  <blp@gnu.org>
5878
5879         * frequencies.q: (hash_value_alpha) Fixed up the previous change
5880         to use the proper string length.
5881
5882 Wed Dec 31 16:27:33 WAST 2003 John Darrington <john@darrington.wattle.id.au>
5883
5884         * Fixed bug where FREQ would crash on alpha values
5885
5886 Tue Dec 30 22:42:57 2003  Ben Pfaff  <blp@gnu.org>
5887
5888         * Removed bletcherous alloca() workarounds for AIX from top of
5889         many files.  AIX can use the alternative alloca() implementation
5890         instead.
5891
5892 Tue Dec 30 22:35:16 2003  Ben Pfaff  <blp@gnu.org>
5893
5894         * ascii.c: (ascii_option) Fix implementation of headers option.
5895
5896 Tue Dec 30 22:32:53 2003  Ben Pfaff  <blp@gnu.org>
5897
5898         * ascii.c: Add a "squeeze" option to the ASCII driver to squeeze
5899         multiple blank lines into one.
5900         (struct ascii_driver_ext) Add squeeze_blank_lines option.
5901         (ascii_preopen_driver) Initialize squeeze_blank_lines.
5902         (static var option_tab) Add squeeze entry.
5903         (ascii_option) Set squeeze_blank_lines.
5904         (output_lines) Implement squeezing blank lines.
5905
5906 Wed Dec 31 07:19:46 WST 2003 John Darrington <john@darrington.wattle.id.au>
5907
5908         * Removed redundant code from output.h
5909
5910 Sat Dec 27 22:17:52 2003  Ben Pfaff  <blp@gnu.org>
5911
5912         Dictionary classes: each variable is "ordinary", "system", or
5913         "scratch".
5914
5915         * var.h: (enum dict_class) New enum.
5916
5917         * vars-prs.c: (dict_class_from_id) New function.
5918         (dict_class_to_name) New function.
5919
5920 Sat Dec 27 22:16:06 2003  Ben Pfaff  <blp@gnu.org>
5921
5922         * var.h: (struct freq_tab_set) Removed (not used).
5923
5924 Sat Dec 27 22:15:21 2003  Ben Pfaff  <blp@gnu.org>
5925
5926         * value-labels.c: (val_labs_destroy) vls needs to be freed too.
5927
5928 Sat Dec 27 22:10:49 2003  Ben Pfaff  <blp@gnu.org>
5929
5930         * stats.c: (hypercube) Rename pow4().  All references updated.
5931
5932 Sat Dec 27 22:05:49 2003  Ben Pfaff  <blp@gnu.org>
5933
5934         * rename-vars.c: (cmd_rename_variables) Rewritten.
5935         (compare_name) Removed.
5936
5937 Sat Dec 27 22:03:51 2003  Ben Pfaff  <blp@gnu.org>
5938
5939         var_set feature, and code taking advantage of it.
5940         
5941         * crosstabs.q: (static var var_dict) Removed.
5942         (static var variables) New variable.
5943         (static var variables_cnt) New variable.
5944         (cmd_crosstabs) Free variables instead of var_dict.
5945         (internal_cmd_crosstabs) Initialize and use variables,
5946         variables_cnt instead of var_dict.
5947         (free_var_dict) Removed.
5948         (crs_custom_tables) Use var_set instead of a copied dictionary.
5949         (crs_custom_variables) Set up variables, variables_cnt instead of
5950         var_dict.
5951         [DEBUGGING] (debug_print) Ditto.
5952
5953         * means.q: (mns_custom_tables) Use var_set instead of a copied
5954         dictionary.
5955
5956         * vars-prs.c: (parse_vs_variable) New function.
5957         (parse_dict_variable) Rewritten.
5958         (parse_variable) Rewritten.
5959         (parse_variables) Renamed parse_var_set_vars(), rewritten.
5960         (parse_variables) New function in terms of parse_var_set_vars().
5961         Now requires its first argument to be non-null.  All references
5962         that passed a null pointer updated to pass default_dict instead.
5963         (macro id_dict) Removed.
5964         (parse_DATA_LIST_vars) Add assertions.
5965         (parse_mixed_vars) Ditto.
5966         (struct var_set) New structure.
5967         (var_set_get_cnt) New function.
5968         (var_set_get_var) New function.
5969         (var_set_lookup_var) New function.
5970         (var_set_destroy) New function.
5971         (dict_var_set_get_cnt) New function.
5972         (dict_var_set_get_var) New function.
5973         (dict_var_set_lookup_var) New function.
5974         (dict_var_set_destroy) New function.
5975         (var_set_create_from_dict) New function.
5976         (struct array_var_set) New structure.
5977         (array_var_set_get_cnt) New function.
5978         (array_var_set_get_var) New function.
5979         (array_var_set_lookup_var) New function.
5980         (array_var_set_destroy) New function.
5981         (var_set_create_from_array) New function.
5982
5983         * q2c.c: (dump_parser) Use parse_variables(default_dict, ...)
5984         instead of parse_variables(NULL, ...) in output code.
5985
5986 Sat Dec 27 21:38:53 2003  Ben Pfaff  <blp@gnu.org>
5987
5988         Change inp_init from a 2-bit vector to an ordinary array.
5989         Initialize it all in cmd_end_input_program() instead of in
5990         create_variable().
5991
5992         * inpt-pgm.c: (enum value_init_type) New enum.
5993         (global var inp_init) Change to `enum value_init_type *', make
5994         static.
5995         (inp_init_size) Removed.
5996         (inp_nval) Change to `size_t', make static.
5997         (cmd_input_program) Don't initialize inp_init or inp_init_size.
5998         (cmd_end_input_program) Initialize inp_init, inp_nval.
5999         (init_case) Rewrite.
6000         (clear_case) Rewrite.
6001
6002         * inpt-pgm.h: Removed.
6003
6004 Sat Dec 27 21:36:38 2003  Ben Pfaff  <blp@gnu.org>
6005
6006         * hash.c: (hsh_hash_bytes) Use Fowler-Noll-Vo hash instead of
6007         Colin Plumb hash.  It is simpler and should better resist
6008         collisions.
6009         (hsh_hash_string) Ditto.
6010
6011 Sat Dec 27 21:34:57 2003  Ben Pfaff  <blp@gnu.org>
6012
6013         * get.c: (export_write_case_func) Remove debug printing code.
6014
6015 Sat Dec 27 21:11:09 2003  Ben Pfaff  <blp@gnu.org>
6016
6017         * get.c: (cmd_save_internal) Rename parameter.  Use &t->h instead
6018         of cast.
6019         (save_write_case_func) Use &trns->h instead of cast.
6020         (cmd_export) Use &t->h instead of cast.
6021
6022 Sat Dec 27 20:57:42 2003  Ben Pfaff  <blp@gnu.org>
6023
6024         Moved vectors into the dictionary.
6025
6026         * var.h: (struct vector) Moved here from vector.h.  `index' member
6027         renamed `idx', `v' renamed `var', `nv' renamed `cnt'.  All
6028         references updated.
6029         
6030         * vector.h: Removed.
6031
6032         * vector.c: (global var vec) Removed.
6033         (global var nvec) Removed.
6034         (cmd_vector) Rewritten.
6035         (find_vector) Removed.
6036
6037         * dictionary.c: (dict_create_vector) New function.
6038         (dict_get_vector) New function, replaces reading global vec[]
6039         array.
6040         (dict_get_vector_cnt) New function, replaces reading global nvec
6041         variable.
6042         (dict_lookup_vector) New function, replaces find_vector().
6043         (dict_clear_vectors) New function.
6044
6045 Sat Dec 27 20:54:01 2003  Ben Pfaff  <blp@gnu.org>
6046
6047         Start to move away from `struct variable' p `union' member to void
6048         * aux member.
6049
6050         * var.h: (struct variable) Add `aux' member.
6051
6052 Sat Dec 27 20:36:25 2003  Ben Pfaff  <blp@gnu.org>
6053
6054         Get rid of struct variable `foo' member.
6055
6056         * frequencies.q: (internal_cmd_frequencies) Use p.frq.used instead
6057         of foo.
6058         (frq_custom_variables) Ditto.
6059         (frq_custom_grouped) Ditto.
6060
6061         * get.c: (struct save_trns) Change `var' member from `int *' to
6062         `struct variable **'.
6063         (cmd_save_internal) Use aux instead of foo.
6064         (save_trns_proc) Use revised `var' member.
6065         (static var mtf_seq_no) Renamed mtf_seq_num.
6066         (static var mtf_seq_nums) New static var.
6067         (cmd_match_files) Initialize mtf_seq_nums.
6068         (mtf_free) Free mtf_seq_nums.
6069         (mtf_processing) Use mtf_seq_nums instead of foo.
6070         (mtf_merge_dictionary) No need to initialize mv->foo.
6071         (cmd_export) Use aux instead of foo.  Use revised `var' member.
6072         (mns_custom_tables) Don't use foo to check for duplicates, that's
6073         what PV_NO_DUPLICATE is for.
6074
6075         * var.h: (struct variable) Remove `foo' member.
6076         (struct frequencies_proc) New member.
6077         
6078 Sat Dec 27 19:46:13 2003  Ben Pfaff  <blp@gnu.org>
6079
6080         Clean up COMPUTE and IF.
6081
6082         * compute.c: More or less rewrite the darn thing.
6083         (struct compute_trns) Rename and reorder and add and delete
6084         members.
6085         (cmd_compute) Rewrite.
6086         (compute_num) Make conditional on test expression.  Now used for
6087         both COMPUTE and IF.
6088         (compute_num_vec) Ditto.
6089         (compute_str) Ditto.
6090         (compute_str_vec) Ditto.
6091         (cmd_if) Rewrite.
6092         (if_num) Removed.
6093         (if_num_vec) Removed.
6094         (if_str) Removed.
6095         (if_str_vec) Removed.
6096         (parse_target_expression) Renamed parse_rvalue_expression(),
6097         rewritten.
6098         (new_trns) Renamed compute_trns_create(), rewritten.
6099         (delete_trns) Removed.
6100         (free_trns) Renamed compute_trns_free(), rewritten.
6101         (struct lvalue) New structure.
6102         (parse_var_or_vec) Renamed lvalue_parse(), rewritten.
6103         (lvalue_get_type) New function.
6104         (lvalue_is_vector) New function.
6105         (lvalue_finalize) New function.
6106         (lvalue_destroy) New function.
6107         
6108 Sat Dec 27 19:44:14 2003  Ben Pfaff  <blp@gnu.org>
6109
6110         * command.def: Disallow MODIFY VARS in input mode, so that
6111         variables can't get dropped and confuse cmd_end_input_program()'s
6112         attempt to fill inp_init[].
6113         
6114         * modify-vars.c: (static var forward_positional_ordering) New
6115         variable.
6116         (struct var_modification) Entirely changed.
6117         (rearrange_dict) Interface changed, rewritten.
6118         (cmd_modify_vars) Deal with modified struct var_modification, much
6119         rewritten.
6120         (struct var_renaming) New structure.
6121         (compare_var_renaming_by_new_name) New function.
6122         (validate_var_modification) New function.
6123
6124         * var.h: (struct modify_vars_proc) Removed.
6125         (struct variable) Removed member p.mfv.
6126
6127 Sat Dec 27 19:40:26 2003  Ben Pfaff  <blp@gnu.org>
6128
6129         Make EVALUATE a valid command whether we're debugging or not, so
6130         that `make check' can succeed regardless of whether debugging is
6131         turned on.
6132         
6133         * command.def: [GLOBAL_DEBUGGING] Drop the #if.
6134
6135         * compute.c: [GLOBAL_DEBUGGING] (cmd_evaluate) Drop the #if.
6136
6137 Sat Dec 27 19:34:40 2003  Ben Pfaff  <blp@gnu.org>
6138
6139         * apply-dict.c: (cmd_apply_dictionary) Replace a ghastly switch
6140         statement by a simple if test.
6141
6142         * dfm.c: (dfm_get_record) Add assertion.
6143
6144 Sat Dec 27 17:51:26 2003  Ben Pfaff  <blp@gnu.org>
6145
6146         For each file x.c, move #include "x.h" to the very top of the
6147         include list, to catch x.h failing to include the proper headers.
6148
6149 Sat Dec 27 17:50:19 2003  Ben Pfaff  <blp@gnu.org>
6150
6151         * algorithm.c: (find) New function.
6152         (remove_equal) New function.
6153         (set_difference) New function.
6154         (adjacent_find_equal) New function.
6155         [TEST_UNIQUE] Removed test case.
6156         (copy_if) Find end test.
6157
6158 Sat Dec 27 17:42:45 2003  Ben Pfaff  <blp@gnu.org>
6159
6160         * dictionary.c: (dict_get_case_weight) New convenience function.
6161
6162         * aggregate.c: (accumulate_aggregate_info) Use
6163         dict_get_case_weight().
6164
6165         * frequencies.q: (calc_general) Ditto.
6166         (calc_integer) Ditto.
6167         (calc) Ditto.
6168
6169         * t-test.q: (groups_calc) Ditto.
6170         (z_calc) Ditto.
6171
6172 Sat Dec 27 17:29:45 2003  Ben Pfaff  <blp@gnu.org>
6173
6174         * glob.c: (global var default_dict) Change from `struct
6175         dictionary' to `struct dictionary *'.  All references changed.
6176         (init_glob) Initialize default_dict with dict_create().
6177
6178 Sat Dec 27 17:06:06 2003  Ben Pfaff  <blp@gnu.org>
6179
6180         struct dictionary now made opaque.  All related functions:
6181
6182         * get.c: (rename_variables) Removed.
6183         (dict_delete_run) Removed.
6184         
6185         * temporary.c: (copy_variable) Removed.
6186         (new_dictionary) Removed.
6187         (save_dictionary) Removed.
6188         (restore_dictionary) Removed.
6189         (free_dictionary) Removed.
6190
6191         * vars-atr.c: (clear_default_dict) Removed.
6192         (find_variable) Removed.
6193         (find_dict_variable) Removed.
6194         (create_variable) Removed.
6195         (delete_variable) Removed.
6196         (common_init_stuff) Removed.
6197         (init_variable) Removed.  Updating of inp_init moved into
6198         cmd_end_input_program().
6199         (replace_variable) Removed.
6200         (rename_variable) Removed.
6201         (clear_variable) Removed.
6202         (dup_variable) Removed.
6203
6204         * vars-prs.c: (is_varname) Removed.
6205         (is_dict_varname) Removed.
6206         (fill_all_vars) Removed.
6207
6208         * vector.c: (find_vector) Removed.
6209
6210         * weight.c: (stop_weighting) Removed.
6211
6212         * dictionary.c: New file.
6213         (dict_create) New, replaces new_dictionary().
6214         (dict_clone) New, replaces save_dictionary() and
6215         restore_dictionary().
6216         (dict_clear) New, replaces clear_default_dict().
6217         (dict_destroy) New, replaces free_dictionary().
6218         (dict_get_var_cnt) New function, replaces references to
6219         dict->nvar.
6220         (dict_get_var) New function, replaces references to dict->var[i].
6221         (dict_get_vars) New function, replaces fill_all_vars().
6222         (dict_create_var) New, replaces create_variable().  Interface
6223         drops `type' parameter, using a zero `width' to designate numeric.
6224         (dict_clone_var) New, replaces dup_variable().
6225         (dict_rename_var) New, replaces rename_variable().
6226         (dict_lookup_var) New, replaces find_variable(),
6227         find_dict_variable(), is_varname().
6228         (dict_contains_var) New function.
6229         (compare_variable_dblptrs) New function.
6230         (dict_delete_var) New function, replaces clear_variable().
6231         (dict_delete_vars) New function, replaces dict_delete_run().
6232         (dict_reorder_vars) New function.
6233         (dict_rename_vars) New function, replaces rename_variables().
6234         (dict_get_weight) New function, replaces reading dict->weight_var.
6235         (dict_set_weight) New function, replaces writing dict->weight_var
6236         or calling stop_weight(dict).
6237         (dict_get_filter) New function, replaces reading dict->filter_var.
6238         (dict_set_filter) New function, replaces writing dict->filter_var.
6239         (dict_get_case_limit) New function, replaces reading dict->N.
6240         (dict_set_case_limit) New function, replaces writing dict->N.
6241         (dict_get_value_cnt) New function, replaces reading dict->nval.
6242         (dict_compact_values) New function, replaces a loop that was
6243         replicated in several places.
6244         (dict_get_split_vars) New function, replaces reading dict->splits.
6245         (dict_get_split_cnt) New function, replaces reading
6246         dict->n_splits.
6247         (dict_set_split_vars) New function, replaces writing dict->splits.
6248         (dict_get_label) New function, replaces reading dict->label.
6249         (dict_set_label) New function, replaces writing dict->label.
6250         (dict_get_documents) New function, replaces reading
6251         dict->documents.
6252         (dict_set_documents) New function, replaces writing
6253         dict->documents.
6254         
6255         All references to above functions updated.
6256         
6257         * aggregate.c: (cmd_aggregate) Copy file label and documents from
6258         old dictionary to new by hand, because dict_create() can't do it
6259         itself.  Use dict_set_documents(), dict_set_split_vars().
6260
6261         * temporary.c: (cancel_temporary) Also set temp_dict to NULL after
6262         calling dict_destroy().
6263
6264         * data-list.c: (dls_var_spec) Remove `type' member, replace by
6265         `width'.
6266         (fixed_parse_compatible) Some slightly nontrivial changes for
6267         dict_create_var().
6268         (dump_fmt_list) Ditto.
6269         (parse_free) Ditto.
6270
6271         * file-type.c: (create_col_var) Ditto.
6272
6273         * get.c: (cmd_get) Use dict_compact_values() instead of a loop.
6274         (trim_dictionary) Use dict_delete_vars(), dict_reorder_vars().
6275         (rename_variables) Use dict_rename_vars().
6276         (mtf_merge_dictionary) Use dict_get_documents(),
6277         dict_set_documents(), dict_compact_values().
6278
6279         * pfm-read.c: (read_variables) Deal with changes to weighting.
6280
6281         * q2c.c: (dump_parser) Use dict_lookup_var() instead of
6282         is_varname() in output code.
6283
6284         * sfm-read.c: (read_header) Use dict_create(), dict_set_label(),
6285         other dictionary functions.
6286
6287         * title.c: (add_document_line) Use dict_get_documents(),
6288         dict_set_documents().
6289
6290         * vars-atr.c: (discard_variables) Use dict_clear(default_dict),
6291         reset default_handle by hand.  dict_clear() will clear vectors so
6292         there's no need for that by hand.
6293
6294         * vfm.c: (close_active_file) Move call to finish_compaction()
6295         earlier, so that we can do the compaction as a single step using
6296         dict_compact_values().  Use dict_clear_vectors().
6297         (finish_compaction) Use dict_delete_var(), dict_compact_values().
6298                 
6299         Some functions don't have replacements:
6300
6301         * vars-atr.c: (force_create_variable) Removed.  All references
6302         updated to dict_create_var() followed by an assertion.
6303         (force_dup_variable) Removed.  All references updated to
6304         dict_clone_var() followed by an assertion.
6305         
6306         * weight.c: (update_weighting) Removed.  No longer necessary, so
6307         all references removed.
6308
6309 Sat Dec 27 16:43:01 2003  Ben Pfaff  <blp@gnu.org>
6310
6311         Clean up AGGREGATE.
6312         
6313         * aggregate.c: Eliminate separation of weighted and unweighted
6314         case.  It made the code too obscure and I doubt it was actually
6315         faster.  Instead, all code uses the "weighted" code, because
6316         that's a generalization of the "unweighted" code.
6317         (FWEIGHT) Removed.
6318         (FOPTIONS) Ditto.
6319         (parse_aggregate_functions) No need to set FWEIGHT.
6320         (accumulate_aggregate_info) Get rid of FWEIGHT cases.
6321         (dump_aggregate_info) Ditto.
6322         (initialize_aggregate_info) No need for special plain_function
6323         that gets rid of FWEIGHT option.
6324
6325         * aggregate.c: Get rid of approximations.
6326         (accumulate_aggregate_info) Don't use approx_gt(), approx_lt(),
6327         approx_in_range().
6328         (aggregate_single_case) Don't use approx_ne().
6329
6330 Sat Dec 27 16:19:36 2003  Ben Pfaff  <blp@gnu.org>
6331
6332         * ascii.c (ascii_line_width): Dead code, removed.
6333
6334         * postscript.c (ps_line_width): Ditto.
6335
6336         * q2c.c (xrealloc): Ditto.
6337
6338         * count.c (internal_cmd_count): Ditto.
6339
6340         * means.q (validate_dependent_endpoint): Ditto.
6341
6342         * set.q: (cmd_gset) Ditto.
6343
6344         * weight.c: [0] (weight_trns_proc) Ditto.
6345
6346 Sat Dec 27 16:18:16 2003  Ben Pfaff  <blp@gnu.org>
6347
6348         Make the code -Wmissing-prototypes clean.
6349
6350         * Makefile.am (version.c): Add #include "version.h".
6351         
6352         * ascii.c: (ascii_open_global) Make static.
6353         (ascii_close_page) Ditto.
6354         (ascii_font_sizes) Ditto.
6355         (ascii_postopen_driver) Ditto.
6356         (ascii_close_driver) Ditto.
6357         (ascii_option) Ditto.
6358         (ascii_open_page) Ditto.
6359         (ascii_line_horz) Ditto.
6360         (ascii_line_vert) Ditto.
6361         (ascii_line_intersection) Ditto.
6362         (ascii_box) Ditto.
6363         (ascii_polyline_begin) Ditto.
6364         (ascii_polyline_point) Ditto.
6365         (ascii_polyline_end) Ditto.
6366         (ascii_text_set_font_by_name) Ditto.
6367         (ascii_text_set_font_by_position) Ditto.
6368         (ascii_text_set_font_by_family) Ditto.
6369         (ascii_text_get_font_name) Ditto.
6370         (ascii_text_get_font_family) Ditto.
6371         (ascii_text_set_size) Ditto.
6372         (ascii_text_get_size) Ditto.
6373         (ascii_text_metrics) Ditto.
6374         (ascii_text_draw) Ditto.
6375         (ascii_close_page) Ditto.
6376
6377         * cmdline.h: New header for parse_command_line().  Used where
6378         needed.
6379
6380         * command.c: Move prototypes for cmd_*() functions to command.h.
6381
6382         * command.h: Prototypes for cmd_*() functions moved here from
6383         command.c.
6384
6385         * crosstabs.q: (gamma_int) Ditto.
6386
6387         * file-handle.h: Add fh_init_files() prototype.
6388         
6389         * getline.c: (welcome) Ditto.
6390
6391         * glob.h: New header for init_glob().  Used where appropriate.
6392
6393         * hash.c: (comparison_helper) Ditto.
6394
6395         * html.c: (html_open_global) Ditto.
6396         (html_close_global) Ditto.
6397         (html_preopen_driver) Ditto.
6398         (html_postopen_driver) Ditto.
6399         (html_close_driver) Ditto.
6400         (html_option) Ditto.
6401         (html_open_page) Ditto.
6402         (html_close_page) Ditto.
6403         (html_submit) Ditto.
6404
6405         * inpt-pgm.c: (input_program_source_read) Ditto.
6406
6407         * output.c: (find_defn_value) Ditto.
6408         (destroy_list) Ditto.
6409
6410         * pfm-read.c: (read_int) Ditto.
6411
6412         * postscript.c: (ps_open_global) Ditto.
6413         (ps_close_global) Ditto.
6414         (ps_font_sizes) Ditto.
6415         (ps_preopen_driver) Ditto.
6416         (ps_postopen_driver) Ditto.
6417         (ps_close_driver) Ditto.
6418         (ps_option) Ditto.
6419         (ps_open_page) Ditto.
6420         (ps_close_page) Ditto.
6421         (ps_line_horz) Ditto.
6422         (ps_line_vert) Ditto.
6423         (ps_line_intersection) Ditto.
6424         (ps_box) Ditto.
6425         (ps_polyline_begin) Ditto.
6426         (ps_polyline_point) Ditto.
6427         (ps_polyline_end) Ditto.
6428         (ps_text_set_font_by_name) Ditto.
6429         (ps_text_set_font_by_position) Ditto.
6430         (ps_text_set_font_family) Ditto.
6431         (ps_text_get_font_name) Ditto.
6432         (ps_text_get_font_family) Ditto.
6433         (ps_text_set_size) Ditto.
6434         (ps_text_get_size) Ditto.
6435         (ps_text_metrics) Ditto.
6436         (ps_text_draw) Ditto.
6437
6438         * q2c.c: (finish_up) Ditto.
6439         (xmalloc) Ditto.
6440         (xstrdup) Ditto.
6441         (get_buffer) Ditto.
6442         (st_lower) Ditto.
6443         (st_upper) Ditto.
6444         (skip_ws) Ditto.
6445         (get_line) Ditto.
6446         (add_symbol) Ditto.
6447         (find_symbol) Ditto.
6448         (lex_get) Ditto.
6449         (force_id) Ditto.
6450         (force_string) Ditto.
6451         (match_id) Ditto.
6452         (match_token) Ditto.
6453         (skip_token) Ditto.
6454         (parse) Ditto.
6455         (parse_setting) Ditto.
6456         (parse_specifier) Ditto.
6457         (parse_specifiers) Ditto.
6458         (parse_subcommand) Ditto.
6459         (dump_specifier_vars) Ditto.
6460         (is_keyword) Ditto.
6461         (make_identifier) Ditto.
6462         (dump_declarations) Ditto.
6463         (dump_specifier_init) Ditto.
6464         (dump_vars_init) Ditto.
6465         (make_match) Ditto.
6466         (dump_specifier_parse) Ditto.
6467         (dump_subcommand) Ditto.
6468         (dump_parser) Ditto.
6469         (dump_header) Ditto.
6470         (dump_free) Ditto.
6471         (recognize_directive) Ditto.
6472
6473         * recode.c: (string_to_long) Ditto.
6474
6475         * repeat.c: (find_DO_REPEAT_substitution) Ditto.
6476
6477         * repeat.h: New header for perform_DO_REPEAT_substitutions, used
6478         where appropriate.
6479
6480         * sort.c: (sort_stream_read) Ditto.
6481         (sort_stream_mode) Ditto.
6482         
6483 Fri Dec 19 23:35:04 2003  Ben Pfaff  <blp@gnu.org>
6484
6485         * algorithm.c (binary_search): Fix comparison.
6486
6487 Fri Dec 19 23:27:45 2003  Ben Pfaff  <blp@gnu.org>
6488
6489         * algorithm.c: (binary_search) Fix assertion.
6490
6491 Fri Dec 19 21:31:48 2003  Ben Pfaff  <blp@gnu.org>
6492
6493         * sysfile-info.c: (compare_vectors_by_name) Rewrite.
6494
6495 Fri Dec 19 21:30:24 2003  Ben Pfaff  <blp@gnu.org>
6496
6497         * sort.c: (compare_case_lists) Rewrite.
6498
6499 Fri Dec 19 16:44:22 2003  Ben Pfaff  <blp@gnu.org>
6500
6501         * quicksort.c: Removed (not used).
6502
6503         * quicksort.h: Removed (not used).
6504
6505         * sort.c: Removed blp_quicksort() prototype.
6506
6507 Fri Dec 19 16:42:13 2003  Ben Pfaff  <blp@gnu.org>
6508
6509         * postscript.c: (int_2_compare) Rewrite.
6510         (compare_line) Rewrite.
6511
6512 Fri Dec 19 16:38:35 2003  Ben Pfaff  <blp@gnu.org>
6513
6514         * matrix-data.c (compare_factors) Use lexicographical_compare()
6515         algorithm.
6516         (compare_doubles) New function.
6517         
6518         * algorithm.c: (lexicographical_compare) New algorithm.
6519
6520 Fri Dec 19 16:23:45 2003  Ben Pfaff  <blp@gnu.org>
6521
6522         * matrix-data.c (compare_variables_by_mxd_vartype): Rewrite.
6523
6524 Fri Dec 19 15:54:45 2003  Ben Pfaff  <blp@gnu.org>
6525
6526         * expr-prs.c: (cmp_func) Removed.
6527         (parse_function) Use binary_search() algorithm.
6528         (compare_functions) New function.
6529         (init_func_tab) Use sort() algorithm.
6530
6531         * algorithm.c: (binary_search) New algorithm.
6532
6533 Fri Dec 19 15:50:45 2003  Ben Pfaff  <blp@gnu.org>
6534
6535         * descript.q: (display) Use sort() algorithm instead of qsort().
6536         (compare_func) Removed.
6537         (descriptives_compare_variables) New function.
6538
6539 Fri Dec 19 15:08:38 2003  Ben Pfaff  <blp@gnu.org>
6540
6541         Get rid of AVL trees.  Hashes are more appropriate for everything
6542         PSPP does.
6543
6544         * Makefile.am: (pspp_SOURCES) Remove avl.c, avl.h.
6545         
6546         * avl.c: Removed.
6547
6548         * avl.h: Removed.
6549
6550 Fri Dec 19 14:33:31 2003  Ben Pfaff  <blp@gnu.org>
6551
6552         Much code can be clarified by using C++ STL-like algorithms.  Not
6553         all uses of these algorithms are listed below, only the ones where
6554         the change to an algorithm was the only change of interest.
6555         
6556         * Makefile.am: (pspp_SOURCES) Add algorithm.c, algorithm.h.
6557         
6558         * algorithm.c: New file.
6559
6560         * algorithm.h: New file.
6561
6562         * modify-vars.c: (static var forward) Removed.
6563         (static var positional) Removed.
6564         (compare_variables) Removed.
6565         (struct ordering) New.
6566         (cmd_modify_vars) Use sort() algorithm.
6567         (compare_variables_given_ordering) New function.
6568         (rearrange_dict) Use sort() algorithm.
6569
6570         * sysfile-info.c: (cmd_display) Use sort() algorithm.
6571         (cmp_var_by_name) Removed.
6572
6573 Fri Dec 19 14:26:17 2003  Ben Pfaff  <blp@gnu.org>
6574
6575         Make file handles use a hash table.
6576         
6577         * file-handle.q: (files) Change to hash table, make static.
6578         (cmd_file_handle) Use hash table functions.
6579         (fh_get_handle_by_filename) Ditto.
6580         (fh_get_handle_by_name) Ditto.
6581         (hash_file_handle) New function.
6582         (cmp_file_handle) Rewrite.
6583         (fh_init_files) Use hash table functions.
6584
6585 Fri Dec 19 14:24:38 2003  Ben Pfaff  <blp@gnu.org>
6586
6587         Clean up FREQUENCIES.
6588         
6589         * Makefile.am: (pspp_SOURCES) Remove frequencies.g.
6590
6591         * frequencies.q: Remove a lot of old #if'd out code at the end.
6592         (internal_cmd_frequencies) Use calc() instead of calc_no_weight()
6593         or calc_weight().  Initialize percentile_values.
6594         (calc) New function based on calc_weight() from frequencies.g.
6595         (precalc) Use hash functions.
6596         (static var comparison_func) Removed.
6597         (static var comparison_param) Removed.
6598         (comparison_helper) Removed.
6599         (get_freq_comparator) New function.
6600         (not_missing) New function.
6601         (add_freq) Removed.
6602         (postprocess_freq_tab) Use hash table functions, algorithms,
6603         get_freq_comparator().  Rewrite.
6604         (cleanup_freq_tab) Rephrase.
6605         (add_percentile) Clean up spacing.
6606         (hash_value_numeric) New function.
6607         (hash_value_alpha) New function.
6608         (compare_value_numeric_a) Rewrite.
6609         (compare_value_alpha_a) Rewrite.
6610         (compare_value_numeric_d) Rewrite.
6611         (compare_value_alpha_d) Rewrite.
6612         (compare_freq_numeric_a) Rewrite.
6613         (compare_freq_alpha_a) Rewrite.
6614         (compare_freq_numeric_d) Rewrite.
6615         (compare_freq_alpha_d) Rewrite.
6616         (calc_stats) Clean up mode, percentiles, max.
6617         (dump_statistics) Clean up spacing.
6618         
6619         * frequencies.g: Removed.
6620
6621         * var.h: (struct freq_tab) Change `data' to hash table.
6622
6623 Fri Dec 19 14:15:46 2003  Ben Pfaff  <blp@gnu.org>
6624
6625         * file-handle.h: Remove declaration of global variable `files',
6626         which wasn't used anywhere.
6627
6628         * postscript.c: (add_encoding) Remove superfluous cast.
6629         (line) Ditto.
6630
6631         * sfm-read.c: [linux] (bswap_int32) Drop ntohl() non-portable
6632         version.
6633
6634         * temporary.c: [0] (display_tree) Removed.
6635
6636 Fri Dec 19 14:13:04 2003  Ben Pfaff  <blp@gnu.org>
6637
6638         Implement a new random number generator based on the alleged RC4
6639         algorithm.
6640
6641         * expr-evl.c: (expr_evaluate) Use rng_get_double_normal() instead
6642         of rand_normal().
6643
6644         * random.c: [!HAVE_GOOD_RANDOM] (real_rand) Removed.
6645         [!HAVE_GOOD_RANDOM] (real_srand) Removed.
6646         (macro k) Removed.
6647         (static var V[]) Removed.
6648         (static var Y) Removed.
6649         (static var X2) Removed.
6650         (setup_randomize) Removed.
6651         (shuffle) Removed.
6652         (rand_uniform) Removed.
6653         (rand_normal) Removed.
6654         (struct rng) New structure.
6655         (rng_create) New function.
6656         (rng_destroy) New function.
6657         (swap_byte) New static function.
6658         (rng_seed) New function.
6659         (rng_get_bytes) New function.
6660         (rng_get_int) New function.
6661         (rng_get_unsigned) New function.
6662         (rng_get_double) New function.
6663         (rng_get_double_normal) New function.
6664         (pspp_rng) New function.
6665
6666         * random.h: Sync up to random.c.
6667
6668         * sample.c: (struct sample_trns) Make `frac' unsigned and a
6669         fraction of UINT_MAX, not 65536.
6670         (cmd_sample) Use rng_get_unsigned(), rng_get_double(), UINT_MAX
6671         fraction.
6672
6673         * vfm.c: (open_active_file) No need to call setup_randomize() any
6674         longer.
6675
6676 Fri Dec 19 12:05:56 2003  Ben Pfaff  <blp@gnu.org>
6677
6678         Change dictionary name indexes to use hash tables instead of AVL
6679         trees.
6680
6681         * crosstabs.q: (free_var_dict) Use hash tables.
6682         (crs_custom_tables) Ditto.
6683         (calc_general) Ditto.
6684         (compare_table_entry) Rewrite.
6685         (enum_var_values) Reorder parameters.  All references updated.
6686         Rewrite.
6687
6688         * get.c: (rename_variable) Use hash tables.
6689         (mtf_merge_dictionary) Ditto.
6690
6691         * glob.c: (init_glob) Use hash tables.
6692         (cmp_variable) Removed.
6693
6694         * means.q: (mns_custom_tables) Use hash tables.
6695
6696         * modify-vars.c: (rearrange_dict) Use hash tables.
6697
6698         * rename-vars.c: (cmd_rename_variables) Use hash tables.
6699
6700         * sfm-read.c: (read_header) Use hash tables.
6701         (read_variables) Ditto.
6702
6703         * temporary.c: (new_dictionary) Use hash tables.
6704         (save_dictionary) Ditto.
6705         (restore_dictionary) Ditto.
6706
6707         * var.h: (struct dictionary) Change AVL tree `var_by_name' into
6708         hash table `name_tab'.
6709
6710         * vars-atr.c: [DEBUGGING] (dump_one_var_node) Removed.
6711         [DEBUGGING] (dump_var_tree) Removed.
6712         (find_variable) Use hash tables.
6713         (find_dict_variable) Ditto.
6714         (common_init_stuff) Ditto.
6715         (rename_variable) Ditto.
6716         (clear_variable) Ditto.  Also, remove debug code.
6717         (dup_variable) Use hash tables.
6718
6719         * vars-prs.c: (fill_all_vars) Use hash tables.
6720         (is_dict_varname) Ditto.
6721         (parse_dict_variable) Ditto.
6722         
6723 Fri Dec 19 11:46:23 2003  Ben Pfaff  <blp@gnu.org>
6724
6725         Change value labels to use hash tables instead of AVL trees, and
6726         change value labels into an ADT.
6727
6728         * Makefile.am: (pspp_SOURCES) Add value-labels.c, value-labels.h.
6729         
6730         * value-labels.c: New file.
6731
6732         * value-labels.h: New file.
6733
6734         * apply-dict.c: (cmd_apply_dictionary) Use value label ADT.
6735         Get rid of a stupid use of goto.
6736
6737         * autorecode.c: (compare_alpha_value) Rewrite.
6738         (hash_alpha_value) Ditto.
6739         (compare_numeric_value) Rewrite.
6740         (hash_numeric_value) Ditto.
6741
6742         * frequencies.q: (dump_full) Use value label ADT.
6743
6744         * pfm-read.c: (read_value_label) Use value label ADT.
6745
6746         * pfm-write.c: (write_value_labels) Use value label ADT.
6747
6748         * sfm-read.c: (read_variables) Use value label ADT.
6749         (read_value_labels) Rewrite.
6750
6751         * sfm-write.c: (write_value_labels) Rewrite.
6752
6753         * sysfile-info.c: (cmd_sysfile_info) Use value label ADT.
6754         (display_variables) Ditto.
6755         (describe_variable) Ditto.
6756
6757         * t-test.q: (print_t_groups) Use value label ADT.
6758
6759         * temporary.c: (copy_variable) Use value label ADT.
6760         (free_dictionary) Ditto.
6761
6762         * val-labs.c: (verify_val_labs) Use value label ADT.
6763         (get_label) Ditto.
6764         (debug_print) Ditto.
6765         (val_lab_cmp) Removed.
6766         (inc_ref_count) Removed.
6767         (copy_value_labels) Removed.
6768
6769         * var.h: (struct value_label) Removed.
6770         (struct variable) Change AVL tree `val_lab' into hash table
6771         `val_labs'.
6772
6773         * vars-atr.c: (init_variable) Use value label ADT.
6774         (clear_variable) Ditto.
6775         (free_value_label) Removed.
6776         (free_val_lab) Removed.
6777         (get_val_lab) Removed.
6778         (compare_variables) New function.
6779         (hash_variable) New function.
6780
6781         * vfm.c: (dump_splits) Use value label ADT.
6782
6783 Fri Dec 19 11:18:11 2003  Ben Pfaff  <blp@gnu.org>
6784
6785         Add to the hash table interface.
6786
6787         * hash.c: (hsh_hash_bytes) Add assertion.
6788         (hsh_hash_string) Ditto.
6789         (hsh_clear) Ditto.
6790         (hsh_rehash) Ditto.
6791         (hsh_probe) Ditto.
6792         (hsh_create) Ditto.  Also make minimum `size'.
6793         (hsh_destroy) Rephrase.
6794         (sort_nulls_last) Removed.
6795         (not_null) New function.
6796         (hsh_data) Ditto.
6797         (comparison_helper) Ditto.
6798         (hsh_sort) Rewritten.
6799         (hsh_data_copy) New function.
6800         (hsh_sort_copy) Ditto.
6801         (hsh_insert) Ditto.
6802         (hsh_replace) Ditto.
6803         (hsh_hash_double) Ditto.
6804         (hsh_delete) Fix stupid bug.
6805         
6806 Thu Dec 18 12:27:03 WAST 2003 John Darrington <john@darrington.wattle.id.au>
6807         * added a calculation of the mode to FREQUENCIES
6808
6809 Wed Dec 17 12:53:01 WAST 2003 John Darrington <john@darrington.wattle.id.au>
6810
6811         * moved (un)defs of DEBUGGING to config.h
6812
6813 Mon Dec 15 21:35:59 2003  Ben Pfaff  <blp@gnu.org>
6814
6815         * groff-font.c: (add_kern) Fix indentation.
6816         (add_kern) Use & instead of % to take power-of-2 modulus.
6817         (font_get_kern_adjust) Likewise.
6818
6819 Fri Dec 12 23:54:37 2003  Ben Pfaff  <blp@gnu.org>
6820
6821         * autorecode.c: (recode) Replace stupid use of memcpy() by
6822         memberwise copy.
6823         (hash_alpha_value) Use hsh_hash_bytes().  Get rid of nasty casts.
6824         (hash_numeric_value) Ditto.
6825         (autorecode_proc_func) pool_strdup() was wrong here because the
6826         source string was not null-terminated.  Use new pool_strndup()
6827         instead.
6828
6829         * crosstabs.q: (enum_var_values) Remove superfluous and bizarre
6830         use of hsh_iterator_init().
6831
6832         * data-in.c: (parse_N) Initialize i->v->f.
6833
6834         * flip.c: (cmd_flip) Use memmove(), not memcpy(), to copy
6835         overlapping arrays.
6836
6837         * groff-font.c: Use power-of-2 hash table sizes, not prime.
6838         (groff_read_font) Don't call hsh_next_prime().  Don't call
6839         fclose(NULL).
6840         (static var hash) Remove `size_p', `max_used' members.
6841         (font_char_name_to_index) Don't call hsh_next_prime().  Use
6842         hsh_hash_string() instead of hashpjw(), & instead of %.
6843         (default_font) Don't call hsh_next_prime().
6844
6845         * pool.c: (pool_strndup) New function.
6846         (pool_strdup) Reimplement in terms of pool_strndup.
6847
6848         * postscript.c: (hash_font_entry) Use hsh_hash_string().  Get rid
6849         of nasty casts.
6850         (hash_ps_encoding) Use hsh_hash_string().
6851         (hash_ps_combo) Use hsh_hash_string(), hsh_hash_int().
6852         (hash_filename2font) Use hsh_hash_string().
6853
6854         * som.c: Add #include <stdlib.h>.
6855
6856         * tab.c: (tab_destroy) Don't set t->container after freeing `t'
6857         (by destroying its pool).
6858         
6859 Fri Dec 12 23:18:59 2003  Ben Pfaff  <blp@gnu.org>
6860
6861         Miscellaneous hash table code cleanup:
6862         
6863         * hash.h: (struct hsh_table) Moved into hash.c.
6864         (hsh_count) Ditto, and transformed into function.
6865         (hsh_compare_func) New typedef, used for defining otherwise-long
6866         function types here and in hash.c
6867         (hsh_hash_func) Ditto.
6868         (hsh_free_func) Ditto.
6869         
6870         * hash.c: (struct hsh_table) Renamed `n' to `used', `m' to `size',
6871         `table' to `entries'.  Removed `mp'.  All references updated.
6872         (hsh_clear) Don't shrink entries array; if the hash was this big
6873         once, it probably will be again.
6874         (hsh_rehash) Made static.
6875         (force_hsh_insert) Renamed hsh_force_insert.
6876         (force_hsh_find) Renamed hsh_force_find.
6877
6878         Made hash table sizes powers of 2, because that's fine with any
6879         reasonable hash function and because taking a power-of-2 modulus
6880         is faster than any other:
6881         
6882         (hsh_prime_tab) Removed;
6883         (hsh_next_prime) Ditto.
6884         (next_power_of_2) New function.
6885         (hsh_create) Use next_power_of_2.
6886         (hsh_rehash) Use & instead of %.
6887
6888         Cleaned up hsh_sort:
6889         
6890         (internal_comparison_fn) Removed.
6891         (sort_nulls_last) New function.
6892         (hsh_sort) Removed second parameter, switched to using the new
6893         quicksort() function from quicksort.h to avoid using nasty need
6894         for static variables with qsort().  All references updated.
6895
6896         Changed the hash functions offered, because there are better hash
6897         functions than the ones we had, and cleaned up the names to boot:
6898         
6899         * hash.c: (hashpjw_d) Removed.
6900         (hashpjw) Ditto.
6901         (hsh_hash_bytes) New function.
6902         (hsh_hash_string) New function.
6903         (hsh_hash_int) New function.
6904
6905         Improved the hash table iteration interface:
6906         
6907         * hash.h: (hsh_iterator_init) Removed.
6908         (struct hsh_iterator) Removed `init' member, change `next' to
6909         size_t.
6910
6911         * hash.c: (hsh_foreach) Removed.  All references updated to use
6912         hsh_first/hsh_next instead.
6913         (hsh_first) New function.  Notably, unlike hsh_foreach() it does
6914         not treat a null pointer as an empty hash table.
6915         (hsh_next) New function.
6916
6917         Made deletion possible, though slow:
6918
6919         * hash.c: (locate_matching_entry) New function.
6920         (hsh_find) Use locate_matching_entry().
6921         (hsh_delete) New function also using locate_matching_entry().
6922         (hsh_force_delete) New function.
6923
6924 Fri Dec 12 23:16:10 2003  Ben Pfaff  <blp@gnu.org>
6925
6926         * quicksort.c: New file implementing a sort routine with a
6927         interface better than qsort() because it passes a user-provided
6928         parameter to the sort routine.
6929
6930         * Makefile.am: Add quicksort.c, quicksort.h.
6931
6932 Fri Dec 12 13:31:58 2003  Ben Pfaff  <blp@gnu.org>
6933
6934         * All source files: Get rid of nasty special cases for Checker,
6935         which is pretty obsolete now.
6936
6937 Thu Dec 11 21:38:24 WST 2003 John Darrington <john@darrington.wattle.id.au>
6938
6939         * Fixed a bug apparent when using the FREQUENCIES command with the
6940         html driver.  The html driver was incorrectly trying to display 
6941         empty cells.
6942
6943 Sun Jan  2 21:40:13 2000  Ben Pfaff  <blp@gnu.org>
6944
6945         * Makefile.am: Reorganized.  Put locale dir in version.c instead
6946         of passing it to each compile command.  Only put local gmp libs in
6947         LD_ADD if not installed on system.  Remove `boast' target.
6948
6949         * All source files: struct and union typedefs eliminated.
6950         `sizeof type' replaced by `sizeof object' where practical.  Moved
6951         `unused' qualifiers from start to end of declarations for gcc
6952         2.7.2 compatibility.  Change `while (1)' to `for (;;)'.  Made
6953         assertions on pointers strictly compliant.  Removed _ prefixes on
6954         some function parameter names.
6955
6956         * alloc.c: New source file, containing these external linkage
6957         functions removed from common.c: xmalloc, xcalloc, xrealloc,
6958         xstrdup.
6959
6960         * arena.c: Removed.
6961         
6962         * arena.h: Removed.
6963
6964         * ascii.c: Migrated from arenas to pools.
6965         (struct ascii_driver_ext) ops[], box[], fonts[] changed from
6966         c_string to len_string.  All references changed.
6967         (ascii_option) Signature changed to comply to new output.c
6968         interface.
6969         (count_fancy_chars) Removed.
6970         (delineate) Removed support for rich text.
6971         (ascii_text_metrics) Ditto.
6972         (text_draw) Ditto.
6973         (output_shorts) Change `box', `off', `on' from c_string to
6974         len_string.  Change `remaining' from int to size_t.
6975         (ascii_close_page) Make page numbering less haphazard.
6976
6977         * autorecode.c: Migrate from arenas to pools.
6978
6979         * avl.c: Migrate from arenas to pools.  Synch from libavl 1.4.0.
6980
6981         * bitvector.h: New file containing these macros from misc.h:
6982         SET_BIT, CLEAR_BIT, SET_BIT_TO, TEST_BIT, BIT_INDEX.
6983
6984         * command.c: (struct command) cmd1, cmd2, cmd3 members changed to
6985         word[3].  ncmd removed.
6986         (var empty_string) Removed.
6987         (var cmd_table) Declaration updated.
6988         (var cmdtab) Removed.
6989         (cmp_command) Removed.
6990         (split_words) Rewritten to use strtok_r().
6991         (init_cmd_parser) Renamed cmd_init().  Rewritten.
6992         (find_command) Removed.
6993         (FILE_TYPE_okay) Rewritten.
6994         (cmd_parse) Rewritten.  Semantics of the return value of command
6995         handlers has changed: they must now return one of the new CMD_*
6996         enumerals, rather than a magic value.  This meant that all
6997         commands had to be modified, and they were.
6998         (figure_out_command) New function.
6999
7000         * command.def: Add CORRELATIONS, PEARSON CORRELATIONS.  Add
7001         #defines for INIT, INPU, etc.
7002
7003         * command.h: New CMD_* enum series.
7004         (cur_proc) Make const char *, not char *.
7005         (cmd_init) Prototype.
7006         (cmd_parse) Ditto.
7007
7008         * common.c: Removed.
7009
7010         * common.h: Removed.
7011
7012         * correlations.q: New file.
7013
7014         * crosstabs.q: Migrate from arenas to pools.  Migrate to new-style
7015         q2c.
7016         (custom_tables) Renamed crs_custom_tables().
7017         (custom_variables) Renamed crs_custom_variables().
7018         (calc_integer) Add in some `const' qualifiers.
7019         (table_value_missing) Change from a_string to len_string.
7020         (float_M_suffix) Change from a_string to len_string.
7021
7022         * data-in.c: Rewritten.  All references to
7023         parse_string_as_format() changed to data_in().
7024
7025         * data-in.h: New file.
7026
7027         * data-list.c: Change DLS_* from #define's to enums.  Move from
7028         rpd_msg() to tmsg().
7029         (RPD_ERR) New #define.
7030         (do_reading) Change dfm_push_cust() to dfm_push(), pop_cust() to
7031         dfm_pop().
7032         (read_from_data_list_fixed) Change from old
7033         parse_string_as_format() to new data_in().
7034         (read_from_data_list_free) Ditto.
7035         (read_from_data_list_list) Ditto.
7036         (cmd_repeating_data) Modify approach to checking for end of
7037         command.
7038         (rpd_msg) Removed.
7039         (rpd_parse_record) Change from old parse_string_as_format() to new
7040         data_in().  Change from old convert_format_to_string() to new
7041         data_out().
7042         (read_one_set_of_repetitions) Change dfm_push_cust() to
7043         dfm_push(), pop_cust() to dfm_pop().
7044
7045         * data-out.c: Rewritten.  All references to
7046         convert_format_to_string() changed to data_out().
7047
7048         * descript.q: Migrate to new q2c.
7049         (cmd_descriptives) Removed.
7050         (internal_cmd_descriptives) Renamed cmd_descriptives ().
7051         (custom_variables) Renamed dsc_custom_variables().
7052
7053         * dfm.c: (struct dfm_fhuser_ext) `ln' removed.  All references
7054         removed.
7055         (open_file_r) Initialize h->where.line_number.  Migrate to new
7056         struct string.
7057         (open_file_w) Initialize h->where.line_number.
7058         (read_record) Change from ext->ln to h->where.line_number.
7059         Migrate to struct string.
7060         (dfm_put_record) Rephrased.
7061         (dfm_push_cust) Renamed dfm_push(), rewritten.
7062         (dfm_pop) New function.
7063
7064         * error.c: All references updated.
7065         (glob var error_count) Renamed err_err_count.
7066         (glob var warning_count) Renamed err_warning_count.
7067         (glob var error_already_flagged) Renamed err_already_flagged.
7068         (glob var verbosity) Renamed err_verbosity.
7069         (glob var cust_fn) Removed.
7070         (glob var cust_ln) Removed.
7071         (static var file_loc) New.
7072         (static var nfile_loc) New.
7073         (static var mfile_loc) New.
7074         (tmsg) New function.
7075         (push_cust) Removed.
7076         (pop_cust) Removed.
7077         (msg) Rewritten.
7078         (static var terminating) Removed.
7079         (failure) Renamed err_failure().
7080         (hcf) Renamed err_hcf().
7081         (err_push_file_locator) New function.
7082         (err_pop_file_locator) New function.
7083         (err_location) New function.
7084         (check_error_count) Renamed err_check_count().
7085         (vmsg) Renamed err_vmsg().  Interface changed.
7086         (verbose_msg) Removed.
7087         (err_cond_fail) New function.
7088         (error_break) Renamed err_break().
7089
7090         * error.h: All references updated.
7091         (enum MSG_CLASS_COUNT) Renamed ERR_CLASS_COUNT.
7092         (enum ERR_CLASS_MASK, ERR_VERBOSITY_SHIFT, ERR_VERBOSITY_MASK)
7093         New.
7094         (struct file_locator) New.
7095         (struct error) New.
7096         (macro verbose_msg) Removed.
7097         (macro cond_fail) Removed.
7098
7099         * expr-opt.c: (evaluate_tree) sizeof(char) == 1.
7100
7101         * expr-prs.c: Reorganized.  All references updated.
7102         (exprtypename) Renamed expr_type_name().
7103         (typename) Renamed type_name().
7104         (free_expression) Renamed expr_free().
7105         (parse_expression) Renamed expr_parse().  Uses new type_check()
7106         function.
7107         (init_functab) Renamed init_func_tab().
7108         (type_check) New function.
7109         (parse_or) Rewritten to use new allocate_nonterminal() and
7110         append_nonterminal_arg() functions.
7111         (parse_and) Ditto.
7112         (parse_not) Ditto.
7113         (parse_rel) Ditto.  Also simplified logic.
7114         (parse_add) Ditto.
7115         (parse_mul) Ditto.
7116         (parse_neg) Ditto.
7117         (parse_exp) Ditto.
7118         (SYSMIS_func) Ditto.
7119         (VALUE_func) Rephrased.
7120         (CONCAT_func) Fix memory leak by replacing free by free_node on
7121         lossage.
7122         (generic_str_func) Ditto.
7123         (parse_function) Ditto.  Also rephrasings.  Uses bsearch() to find
7124         function.
7125         (allocate_nonterminal) New function.
7126         (append_nonterminal_arg) New function.
7127         (static func_tab[]) Now at file level.
7128         (cmp_func) Moved.
7129         (init_func_tab) Moved.  Now just uses qsort() to sort func_tab[].
7130
7131         * expr.h: (enum series OP_*) Moved to exprP.h.
7132         (OP_* defines) Ditto.
7133         (struct op_desc) Ditto.
7134         (global ops[]) Ditto.
7135         (struct num_con_node) Ditto.
7136         (struct str_con_node) Ditto.
7137         (struct var_node) Ditto.
7138         (struct lag_node) Ditto.
7139         (struct casenum_node) Ditto.
7140         (struct nonterm_node) Ditto.
7141         (union any_node) Members renamed.
7142         (struct sys_node) Removed.
7143         (struct val_node) Removed.
7144         (operator typedef) Removed.
7145         (typedef exprtype) Removed.
7146         (enum series EX_*) Moved to exprP.h.
7147         (struct expression) Ditto.  Also renamed a lot of the members.
7148         (PXP_* defines) Changed to enums.
7149         (free_node prototype) Moved to exprP.h.
7150
7151         * file-handle.h: (struct file_handle) New member `where'.
7152
7153         * file-handle.q: Migrated to new q2c format.
7154         (prepend_current_directory) Removed (dead code).
7155         (cmd_file_handle) Incorporated all of internal_cmd_file_handle().
7156         (fh_get_handle_by_filename) Removed dead code.
7157         Set new `where' member.
7158
7159         * file-type.c: (file_type_source_read) References to
7160         parse_string_as_format() changed to data_in().
7161         dfm_push_cust()/pop_cust() changed to dfm_push()/dfm_pop().
7162
7163         * filename.c: All references updated.
7164         (init_filename) Renamed fn_init().
7165         (expand_line) Removed.
7166         (macro EXPAND_LINE) Removed.
7167         (interp_vars) Renamed fn_interp_vars().  Now uses st_*() instead
7168         of custom functions.
7169         (gnu_getcwd) Renamed fn_get_cwd(), rewritten.
7170         (tilde_expand) Renamed fn_tilde_expand(), uses ds_*().
7171         (normalize_filename) Renamed fn_normalize().
7172         (search_path) Renamed fn_search_path(), rewritten.
7173         (prepend_dir) Renamed fn_prepend_dir().
7174         (blp_getenv) Renamed fn_getenv().
7175         (blp_dirname) Renamed fn_dirname().
7176         (fn_basename) New function, not used.
7177         (absolute_filename_p) Renamed fn_absolute_p().
7178         (is_special_filename) Renamed fn_special_p().
7179         (file_exists) Renamed fn_exists_p().
7180         (readlink_malloc) Renamed fn_readlink().
7181         (getenv_default) Renamed fn_getenv_default().
7182         (open_file) Renamed fn_open().
7183         (close_file) Renamed fn_close().
7184         (open_file_ext) Renamed fn_open_ext().
7185         (close_file_ext) Renamed fn_close_ext().
7186
7187         * font.h: Migrate from arenas to pools.
7188
7189         * format.c: (parse_format_specifier_name) Deal with ds_* strings.
7190
7191         * frequencies.g: Migrate from arenas to pools.
7192
7193         * frequencies.q: Migrate to new q2c version.  Migrate from arenas
7194         to pools.
7195
7196         * getline.c: All references updated.
7197         (global getl_buf) Changed from char * to struct string.
7198         (static getl_include_path) Ditto.
7199         (global getl_buf_len) Removed.
7200         (global getl_buf_size) Removed.
7201         (getl_include_path) Deal with new getl_buf, getl_include_path.
7202         (getl_uninitialize) New function.
7203         (getl_get_current_directory) Rewritten.
7204         (getl_clear_include_path) Rewritten.
7205         (getl_add_include_dir) Rewritten.
7206         (getl_add_file) Assertion fixed.
7207         (getl_add_virtual_file) Change initial value of `remaining_loops'
7208         from 2 to 1.
7209         (welcome) Rewritten.
7210         (handle_line_buffer) Make static.  Change logic to make
7211         getl_add_virtual_file() change sensible.  Use ds_*() strings.
7212         (getl_read_line) Use ds_*() strings.  Implement SET ECHO.
7213         (getl_close_file) Moved.
7214         (getl_location) New function.
7215
7216         * getline.h: All references updated.
7217         (macro curln) Removed.
7218         (macro curfn) Removed.
7219         (macro am_interactive) Renamed getl_am_interactive.
7220         (macro am_reading_script) Renamed getl_reading_script.
7221
7222         * glob.c: (global fmt_parse_ignore_error) Removed.
7223         (init_glob) Use locale_dir not LOCALEDIR.  Use feholdexcept() on
7224         systems that support it (C99).  Turn off SET ECHO by default.  No
7225         necessary julcal initialization anymore.
7226
7227         * groff-font.c: Migrate from arenas to pools.
7228         (groff_read_font) Use err_push_file_locator().
7229         (groff_read_DESC) Ditto.
7230         (font_msg) Use tmsg().
7231
7232         * hash.c: (hsh_sort) Fix debug code.
7233         [GLOBAL_DEBUGGING] Include stdio.h.
7234
7235         * hash.h: (macro force_hsh_insert) Rephrase.
7236
7237         * heap.c: Rewritten.
7238         
7239         * heap.h: Rewritten.
7240
7241         * html.c: (html_option) Change from outp_value to struct string.
7242         (postopen) Change from curfn to getl_location().
7243         (escape_string) Remove rich-text code.  Signature changed.
7244         (output_tab_table) Switch from a_string to struct len_string.
7245         Remove rich text support.
7246
7247         * lexer.c: All references updated.  Largely rewritten.  Major
7248         changes listed below.  Removed tagged quote support.  Adapted to
7249         struct string tokstr.
7250         (global tokstr) Changed to struct string.
7251         (global tokstr_size) Removed.
7252         (global tokstr_len) Removed.
7253         (global tokid) New.
7254         (global tokint) Removed.
7255         (global toklongstr) Removed.
7256         (C* defines) Removed.
7257         (static tbl[]) Removed.
7258         (static id[]) Removed.
7259         (static une[]) Removed.
7260         (discard_line) Renamed lex_discard_line().
7261         (get_entire_line) Renamed lex_entire_line().
7262         (get_rest_of_line) Renamed lex_rest_of_line().
7263         (get_dotted_rest_of_line) Merged into lex_rest_of_line().
7264         (make_hexit) Removed.
7265         (syntax_error) Renamed lex_error().  Return value removed.
7266         (get_token_representation) Renamed lex_token_representation().
7267         (putback) Renamed lex_put_back().
7268         (putfwd) Renamed lex_put_forward().
7269         (convert_negative_to_dash) Renamed lex_negative_to_dash().
7270         (set_prog) Renamed lex_set_prog().
7271         (init_lex) Renamed lex_init().
7272         (reset_eof) Renamed lex_reset_eof().
7273         (lookahead) Renamed lex_look_ahead().
7274         (check_id) Rewritten.
7275         (yylex) Renamed lex_get(), rewritten.
7276         (lex_end_of_command) New function.  Many commands were rephrased
7277         using this.
7278         (lex_integer_p) New function.  Replaces compare of tokint against
7279         NOT_LONG.
7280         (lex_integer) New function.  Replaces tokint.
7281         (match_tok) Renamed lex_match().
7282         (match_id) Renamed lex_match_id().
7283         (match_int) Renamed lex_match_int().
7284         (force_match_id) Renamed lex_force_match_id(), added return value.
7285         (force_match) Renamed lex_force_match(), added return value.
7286         (force_string) Renamed lex_force_string(), added return value.
7287         (force_int) Renamed lex_force_int(), added return value.
7288         (lex_id_match_len) New function.
7289         (id_match) Renamed lex_id_match(), rewritten.
7290         (get_line) Renamed lex_get_line().
7291         (preprocess_line) Renamed lex_preprocess_line().
7292         (tokname) Renamed lex_token_name().
7293         (bin_value_func) Removed.
7294         (oct_value_func) Removed.
7295         (hex_value_func) Removed.
7296         (unexpected_eof) New function.
7297         (convert_numeric_string_to_char_string) New function.
7298         (parse_string) Rewritten, signature changed.
7299         (add_tokstr_char) Removed.
7300         (add_tokstr_unsigned) Removed.
7301         (add_tokstr_string) Removed.
7302         (parse_tagged_quote) Removed.
7303         (skip_comment) Renamed lex_skip_comment().
7304
7305         * lexer.h: All references updated.
7306         (macro is_id1) Renamed CHAR_IS_ID1.
7307         (macro is_idn) Renamed CHAR_IS_IDN.
7308         (token names ID, NUM, STRING, STOP, ... WITH, EXP) Renamed with
7309         prefix T_: T_ID, T_NUM, T_STRING, T_STOP, ... T_WITH, T_EXP.
7310         (macro get_token) Removed.
7311         (macro id_match) Removed.
7312         (macro force_match_id) Removed.
7313         (macro force_match) Removed.
7314         (macro force_string) Removed.
7315         (macro force_int) Removed.
7316         (macro force_num) Removed.
7317         (macro force_id) Removed.
7318
7319         * lexerP.h: Removed.
7320
7321         * list.q: Migrated to new q2c format.
7322         (write_line) Deal with struct len_string.
7323         (write_varname) Ditto.
7324         (write_fallback_headers) Ditto.
7325
7326         * magic.c: New file, incorporating the following global variables
7327         previously in other files: endian, second_lowest_value.  And both
7328         of those are conditional on #define's.
7329
7330         * magic.h: New file, incorporating the following global variable
7331         declarations: endian, second_lowest_value, and the following macro
7332         declarations: NOT_DOUBLE, NOT_LONG, NOT_INT.
7333
7334         * main.c: Added declarations of pgmname, finished, curdate,
7335         start_interactive.
7336         (main) Call new parse_script() function.
7337         (parse_script) New function.
7338         (execute_command) New function.
7339         (dump_token) Removed.
7340         (handle_error) New function.
7341
7342         * matrix.c: New file.
7343
7344         * matrix.h: New file.
7345
7346         * matrix-data.c: Migrated from arenas to pools.
7347         (mget_token) Change from parse_string_as_format() to data_in().
7348
7349         * means.q: Migrate to new q2c.
7350         (custom_tables) Renamed mns_custom_tables().
7351         (custom_crossbreak) Renamed mns_custom_crossbreak().
7352         (custom_variables) Renamed mns_custom_variables().
7353
7354         * mis-val.c: (static var width) Changed from `int' to `size_t'.
7355         (parse_varnames) Prototype.
7356         (parse_numeric) Rephrasings.
7357         (parse_alpha) Adapt to new struct string tokstr.
7358
7359         * misc.c: (intlog10) Rewritten.
7360         (spacing) Removed.
7361         (ansi_rand) Renamed real_rand(), moved into random.c.
7362         (ansi_srand) Renamed real_srand(), moved into random.c.
7363         (setup_randomize) Moved to random.c.
7364         (rand_uniform) Ditto.
7365         (rand_normal) Ditto.
7366         (rand_simple) Ditto.
7367         (get_config_line) Removed.
7368         (reverse) Removed (dead code).
7369
7370         * misc.h: (macro SET_BIT) Moved to bitvector.h.
7371         (macro CLEAR_BIT) Ditto.
7372         (macro TEST_BIT) Ditto.
7373         (macro SET_BIT_TO) Ditto.
7374         (macro BIT_INDEX) Ditto.
7375
7376         * output.c: (outp_read_devices) Move to err_push_file_locator()
7377         from push_cust().  Use struct string.
7378         (expand_op_tokstr) Removed.
7379         (static var op_tokstr) Changed to struct string.
7380         (static var op_tokstr_size) Removed.
7381         (tokener) Rephrasings.  Use struct string.
7382         (parse_options) Use struct string.
7383         (destroy_driver) Fix assertion.
7384         (outp_get_paper_size) Move to err_push_file_locator().
7385         [0] Removed dead code.
7386         (outp_string_width) Move to len_string.
7387
7388         * output.h: Comment fixes.
7389         (TAG_* enum series) Removed.
7390         (struct outp_value) Removed.
7391         (enum OUTP_T_FANCY) Removed.
7392         (struct outp_text) `s' changed from a_string to len_string.
7393         (struct outp_class) `option' change arg 3 from outp_value to
7394         struct string.
7395
7396         * pfm-read.c: (corrupt_msg) Rewritten.
7397
7398         * pfm-write.c: (bufwrite) Fix assertion.
7399
7400         * pool.c: New file, reference version.
7401
7402         * pool.h: New file, reference version.
7403
7404         * postscript.c: (ps_font_sizes) Fix assertion.
7405         (ps_option) Change arg 3 from outp_value to struct string.
7406         Adapt to struct string.
7407         (macro output_line) Removed.
7408         (macro add_string) Removed.
7409         (output_encodings) Adapted to struct string.  Moved to
7410         err_push_file_locator().
7411         (find_encoding_file) Fix assertion.
7412         (read_ps_encodings) Move to err_push_file_locator().
7413         (postopen) Use getl_location() instead of curfn.
7414         (out_text_plain) Move to len_string.
7415         (text) Ditto.  Remove rich text support.
7416
7417         * print.c: (cmd_print) Remove now-unneeded resource cleanup code.
7418         (cmd_print_eject) Ditto.
7419         (cmd_write) Ditto.
7420         (internal_cmd_print) Now cleans up after itself.  Uses
7421         fh_parse_file_handle() now.
7422         (cmd_print_space) Use PXP_NUMERIC to type-check.
7423
7424         * q2c.c: Overhauled.  Removed _("") i18n support.  All references
7425         updated.  All output functions updated to handle structures rather
7426         than local or static variables.  Adapt to new PSPP lex_*()
7427         functions.
7428         (macro _) Removed.
7429         (macro N_) Removed.
7430         (macro MAX_N_SBC) Removed.
7431         (global bare) Removed.
7432         (enum STRING) Renamed T_STRING.
7433         (enum ID) Renamed T_ID.
7434         (get_buffer) Buffer size increased.
7435         (strlower) Renamed st_lower(), rephrased.
7436         (strupper) Renamed st_upper(), rephrased.
7437         (skip_ws) New function.
7438         (get_line) Don't special-case any types of lines (like those
7439         beginning with ! or $, for instance).
7440         (get_token) Renamed lex_get().  Rephrased.
7441         (static var `prefix') New.
7442         (parse) New function.
7443         (parse_setting) Minor rephrasing.
7444         (dump_specifier_vars) Ditto.
7445         (make_identifier) Put null terminator on identifier, duh.
7446         (dump_vars) Renamed dump_declarations().  Never indent.  Never
7447         static.  Output changed entirely.
7448         (dump_specifier_init) Rephrase.
7449         (dump_vars_init) No index variable needed.  Other modifications.
7450         (dump_parser) Don't parse command name.  Do dump functions instead
7451         of just code fragments.
7452         (dump_free) Dump function instead of code fragment.
7453         (recognize_directive) New function.
7454         (main) Use recognize_directive().  Don't rely on magic $ line
7455         beginning: instead, parse comments.  Update list of headers.
7456
7457         * random.c: New file, containing the following functions:
7458         real_rand(), real_srand(), setup_randomize, shuffle, rand_uniform,
7459         rand_normal, rand_simple.
7460
7461         * random.h: New file.
7462
7463         * recode.c: (cmd_recode) Merge internal_cmd_recode() into this
7464         function.  `max_src_width', `max_dst_width' changed to size_t.
7465         (internal_cmd_recode) Removed.
7466         (parse_dest_spec) Merge similar cases.
7467         (parse_src_spec) Add assertion.
7468
7469         * repeat.c: (recognize_keyword) New function.
7470         (internal_cmd_do_repeat) Parse and handle PRINT keyword on END
7471         REPEAT.  Improve recognition of END REPEAT (use
7472         recognize_keyword()).  Move from curfn to getl_location().  Use
7473         struct string.
7474                 
7475         (perform_DO_REPEAT_substitutions) Adapt to struct string.
7476
7477         * set.q: Adapt to new q2c.
7478         (cmd_set) Range-check some values better.
7479         (custom_blanks) Renamed stc_custom_blanks().
7480         (custom_length) Renamed stc_custom_length().
7481         (custom_results) Renamed stc_custom_results().
7482         (custom_seed) Renamed stc_custom_seed().
7483         (custom_width) Renamed stc_custom_width().
7484         (custom_format) Renamed stc_custom_format().
7485         (custom_journal) Renamed stc_custom_journal().
7486         (custom_color) Renamed stc_custom_color().
7487         (custom_listing) Renamed stc_custom_listing().
7488         (custom_disk) Renamed stc_custom_disk().
7489         (custom_log) Renamed stc_custom_log().
7490         (custom_rcolor) Renamed stc_custom_rcolor().
7491         (custom_viewlength) Renamed stc_custom_viewlength().
7492         (custom_workdev) Renamed stc_custom_workdev().
7493
7494         * settings.h: Not necessary to include format.h any longer.
7495
7496         * sfm-read.h: (macro bswap_int32) Moved here from sfmP.h.
7497         (corrupt_msg) Rewritten.
7498
7499         * sort.c: Adapt to rewritten heap ADT.
7500
7501         * str.c: (aa_strcpy) Removed.
7502         (ab_strcpy) Removed.
7503         (ac_strcpy) Removed.
7504         (ba_strcpy) Removed.
7505         (bb_strcpy) Removed.
7506         (ca_strcpy) Removed.
7507         (aa_strdup) Removed.
7508         (aa_strdupcpy) Removed.
7509         (ba_strdup) Removed.
7510         (sa_strdup) Removed.
7511         (memrev) Renamed mm_reverse().
7512         (memrmem) Renamed mm_find_reverse().
7513         (cmp_str) Renamed st_compare_pad().
7514         (strmaxcpy) Removed.
7515         (strbarepadcpy) Renamed st_bare_pad_copy(), signature changed.
7516         (strbarepadlencpy) Renamed st_bare_pad_len_copy(), signature
7517         changed.
7518         (strpadcpy) Renamed st_pad_copy(), signature changed.
7519         (blpstrset) Removed.
7520         (ds_create) New function.
7521         (ds_init) New function.
7522         (ds_replace) New function.
7523         (ds_destroy) New function.
7524         (ds_clear) New function.
7525         (ds_extend) New function.
7526         (ds_shrink) New function.
7527         (ds_truncate) New function.
7528         (ds_length) New function.
7529         (ds_size) New function.
7530         (ds_value) New function.
7531         (ds_end) New function.
7532         (ds_concat) New function.
7533         (ds_concat_buffer) New function.
7534         (ds_printf) New function.
7535         (ds_putchar) New function.
7536         (ds_getline) New function.
7537         (ds_get_config_line) New function derived from the old
7538         misc.c:get_config_line().
7539         (ls_create) New function.
7540         (ls_create_buffer) New function.
7541         (ls_init) New function.
7542         (ls_shallow_copy) New function.
7543         (ls_destroy) New function.
7544         (ls_null) New function.
7545         (ls_null_p) New function.
7546         (ls_empty_p) New function.
7547         (ls_length) New function.
7548         (ls_value) New function.
7549         (ls_end) New function.
7550
7551         * str.h: Reformatted.
7552         (struct a_string) Removed.
7553         (struct b_string) Removed.
7554         (struct c_string) Removed.
7555         (struct len_string) New.
7556         (struct string) New.
7557         (macro as_streq) Removed.
7558         (macro bs_streq) Removed.
7559         (macro cs_streq) Removed.
7560         (macro sa_streq) Removed.
7561         (macro sb_streq) Removed.
7562         [__GNUC__] (inline function ds_putchar) New function.
7563         [__GNUC__] (inline function ds_length) New function.
7564         [__GNUC__] (inline function ds_value) New function.
7565         [__GNUC__] (inline function ds_end) New function.
7566
7567         * sysfile-info.c: (cmd_sysfile_info) Rephrased.
7568         (display_vectors) Fix missing i18n.
7569
7570         * t-test.q: Migrate to new q2c.
7571
7572         * tab.c: Migrate from arenas to pools.
7573         (tab_create) Use struct len_string.
7574         (tab_realloc) Ditto.
7575         (text_format) Ditto.
7576         (tab_joint_text) Ditto.
7577         (tab_natural_width) Remove rich text support.
7578         (tab_natural_height) Ditto.
7579         (tab_output_text) Handle TAT_FIX.
7580         (tab_raw) Change arg from a_string to len_string.
7581         (tabi_driver) Fix assertion.  Use struct len_string.
7582         (render_strip) Use struct len_string.  Remove rich text support.
7583         Add `const' qualifiers.
7584
7585         * tab.h: (enum TAB_RICH) Remove.
7586         (enums TAB_COL_NONE, TAB_COL_DONE) New.  Where appropriate,
7587         SOM_COL_* updated to read TAB_COL_*.
7588         (struct tab_table) Change arena to pool.  Change a_string to
7589         len_string.
7590
7591         * temporary.c: (restore_dictionary) Rewrite Checker code.
7592
7593         * var.h: (macros MAX_SHORT_STRING, MIN_LONG_STRING, SYSMIS,
7594         LOWEST, HIGHEST) Moved here from common.h.
7595         (typedef any_trns) Removed.  All references changed to `struct
7596         trns_header'.
7597
7598         * vars-atr.c: (force_create_variable) Fix assertion.
7599         (force_dup_variable) Fix assertion.
7600         
7601 Thu Jun  3 18:40:42 1999  Ben Pfaff  <blp@gnu.org>
7602
7603         Using alphanumeric variables in functions under AGGREGATE
7604         segfaulted.  Fixed.  Thanks to Dr. Dirk Melcher
7605         <BZN-mdksh@t-online.de> for reporting this bug.
7606         
7607         * aggregate.c: (parse_aggregate_functions) When setting the
7608         FSTRING bit, also allocate memory for the `string' member of
7609         agr_next.
7610         (free_aggregate_functions) Free iter->string.  Don't use the
7611         non-function bits when indexing the array of functions.
7612         [DEBUGGING] (debug_print) Don't use the non-function bits when
7613         indexing the array of functions.        
7614
7615 Sun May 30 00:00:54 1999  Ben Pfaff  <blp@gnu.org>
7616
7617         Under certain circumstances, the final case would be omitted from
7618         the results of an AGGREGATE operation.  Fixed.  Thanks to Dr. Dirk
7619         Melcher <BZN-mdksh@t-online.de> for reporting this bug.
7620         
7621         * aggregate.c (agr_00x_end_func): Increment number of cases in
7622         sink before writing case.  For streams that keep track of how many
7623         cases there are based on this value, this means that the last case
7624         will be read in on the next stream read.
7625
7626 Sat May 29 22:03:31 1999  Ben Pfaff  <blp@gnu.org>
7627
7628         Undefined behavior was invoked by referencing a freed pointer.
7629         
7630         * vfm.c (memory_stream_write): Free pointer *after* checking for
7631         non-null status.
7632
7633 Sat May 29 22:02:22 1999  Ben Pfaff  <blp@gnu.org>
7634
7635         A wrong record size was displayed when paging the active file to
7636         disk.
7637         
7638         * vfm.c: (memory_stream_write) Fix off-by-one error.
7639
7640 Sat May 29 21:50:26 1999  Ben Pfaff  <blp@gnu.org>
7641
7642         Not having enough temporary space for sorting caused a core dump.
7643         Fixed.
7644         
7645         * sort.c: (allocate_cases) Initialize i.
7646
7647 Sat May 29 21:40:54 1999  Ben Pfaff  <blp@gnu.org>
7648
7649         Syntax errors in function descriptions on AGGREGATE caused core
7650         dumps.  Fixed.
7651         
7652         * aggregate.c (cmd_aggregate): Don't free agr_dict after calling
7653         free_aggregate_functions(), since that function already frees
7654         agr_dict.
7655         
7656 Sat May 29 21:06:10 1999  Ben Pfaff  <blp@gnu.org>
7657
7658         A null pointer was dereferenced, causing a core dump, when
7659         PERCENTILES was specified on FREQUENCIES.  This fixes the problem,
7660         but PSPP still doesn't calculate percentiles.  Thanks to Regnor
7661         Jernsletten <rjernsle@eunet.no> for reporting this problem.
7662         
7663         * arena.c: (arena_malloc) If the arena hasn't been initialized
7664         already, initialize it.
7665
7666 Sat May 29 20:47:29 1999  Ben Pfaff  <blp@gnu.org>
7667
7668         * Makefile.cygwin: New file supplied by Hankin <hankin@dunno.com>
7669         for compilation with Cygnus Windows B20.  Not used by other
7670         systems.
7671
7672 Sat May 29 20:36:04 1999  Ben Pfaff  <blp@gnu.org>
7673
7674         SORT always sorted in ascending order.  Fixed.  Thanks to Dr. Dirk
7675         Melcher <BZN-mdksh@t-online.de> for reporting this bug.
7676
7677         * sort.c: (compare_case_lists) Reverse sense of comparison if
7678         sorting in descending order.
7679         (compare_record) Ditto.
7680
7681 Tue Mar  9 13:18:54 1999  Ben Pfaff  <blp@gnu.org>
7682
7683         SPLIT FILE with a string variable caused a core dump.  Fixed.
7684
7685         * vfm.c: If the variable is a string then make a temporary value
7686         struct pointing to it.  The underlying problem is a lot bigger
7687         than this (see TODO) but this is a stopgap for the simple case at
7688         least.
7689         
7690 Tue Mar  9 13:15:53 1999  Ben Pfaff  <blp@gnu.org>
7691
7692         Nested INCLUDEs didn't work.  Fixed.
7693
7694         * getline.c: (getl_include) Set first_line to NULL in allocated
7695         structure.
7696
7697 Tue Mar  9 13:13:46 1999  Ben Pfaff  <blp@gnu.org>
7698
7699         The MATCH FILES procedure set the values of variables not present
7700         to 0.  It should have been SYSMIS.  This is now fixed.
7701
7702         * get.c: (mtf_delete_file_in_place) Replace 0.0 by SYSMIS.
7703
7704 Tue Mar  9 12:52:23 1999  Ben Pfaff  <blp@gnu.org>
7705
7706         The REMARK command was too aggressive about skipping lines.  It
7707         didn't like being the last command in a file.
7708
7709         * command.c: (cmd_remark) Call get_entire_line() instead of
7710         get_line().
7711
7712 Tue Mar  9 12:48:05 1999  Ben Pfaff  <blp@gnu.org>
7713
7714         Comment parsing wasn't consistent with the rest of the code in its
7715         idea of where one command ends and another starts.  This meant
7716         that sometimes commands would be mysteriously ignored.  Thanks to
7717         Dr. Dirk Melcher <BZN-mdksh@t-online.de> for reporting this bug.
7718          
7719         * command.c: (parse_cmd) Hand off comment parsing to new function
7720         skip_comment() in lexer.c.
7721         * lexer.c: (skip_comment) New function.
7722
7723 Wed Jan 20 20:22:07 1999  Ben Pfaff  <blp@gnu.org>
7724
7725         The TABLE subcommand on MATCH FILES worked only erratically at
7726         best.  This fixes it.  Thanks to Dr. Dirk Melcher
7727         <BZN-mdksh@t-online.de> for reporting this bug.
7728
7729         * get.c: (mtf_compare_BY_values) When comparing string values, a
7730         difference of 1 is still a difference :-)
7731         (mtf_processing) Inverted TABLE reading logic fixed.  Also don't
7732         advance TABLE files automatically when matched.  Comment fixes.
7733
7734 Tue Jan 19 22:32:31 1999  Ben Pfaff  <blp@gnu.org>
7735
7736         VARIABLE LABELS rejected a slash before the first variable
7737         specification, contradicting the documentation.  Thanks to Walter
7738         M. Gray <graywm@northernc.on.ca> for reporting this bug.
7739
7740         * var-labs.c: (cmd_variable_labels) Ignore a leading slash in
7741         command specification.
7742
7743 Tue Jan 19 22:29:54 1999  Ben Pfaff  <blp@gnu.org>
7744
7745         Because of an incorrect optimization in memory allocation,
7746         CROSSTABS sometimes segfaulted when asked to output multiple
7747         tables.  Thanks to Walter M. Gray <graywm@northernc.on.ca> for
7748         reporting this bug.
7749
7750         * crosstabs.q: (postcalc) New variables maxcols, maxcells, which
7751         are passed to output_pivot_table() for its use.
7752         (output_pivot_table) Instead of assuming the number of columns is
7753         constant, keep track with maxcols.  In general mode, use maxcells
7754         to determine whether more matrix cells need to be allocated.    
7755
7756 Tue Jan 19 22:27:46 1999  Ben Pfaff  <blp@gnu.org>
7757
7758         CROSSTABS didn't display value labels for column and row
7759         variables.  Thanks to Walter M. Gray <graywm@northernc.on.ca> for
7760         reporting this bug.
7761
7762         * crosstabs.q: (table_value_missing) If the specified value has a
7763         value label for this variable, then show it instead of the raw
7764         value.
7765         (display_dimensions) Delegate display of value_labels to
7766         table_value_missing.
7767
7768 Mon Jan 18 20:04:06 1999  Ben Pfaff  <blp@gnu.org>
7769
7770         WRITE didn't write line ends.  Fixed.  Thanks to Dr. Dirk Melcher
7771         <BZN-mdksh@t-online.de> for reporting this bug.
7772
7773         * print.c: (print_trns_proc) Write (CR/)LF if PRINT is used _or_
7774         if the file isn't declared as binary.
7775
7776 Mon Jan 18 19:56:45 1999  Ben Pfaff  <blp@gnu.org>
7777
7778         MATCH FILES corrupted memory and dumped core on some syntax
7779         errors.  Fixed.
7780
7781         * get.c: (cmd_match_files) Set file->handle to NULL before
7782         jumping to lossage.
7783         (mtf_free_file) Don't free a null dictionary.   
7784
7785 Mon Jan 18 19:27:57 1999  Ben Pfaff  <blp@gnu.org>
7786
7787         MATCH FILES should set numeric values not available to the
7788         system-missing value, not to 0.  Thanks to Dr. Dirk Melcher
7789         <BZN-mdksh@t-online.de> for reporting this bug.
7790
7791         * get.c: (mtf_processing) Set unused records to system-missing,
7792         not 0.
7793
7794 Mon Jan 18 15:06:46 1999  Ben Pfaff  <blp@gnu.org>
7795
7796         KEEP didn't work properly on the SAVE procedure.  Fixed.  Thanks
7797         to Ralf Geschke <ralf@kuerbis.org> for reporting this bug.
7798
7799         * temporary.c: (save_dictionary) Initialize var_by_name AVL tree
7800         in newly created dictionary, and add each copied variable to the
7801         tree.
7802  
7803 Mon Jan 18 15:04:48 1999  Ben Pfaff  <blp@gnu.org>
7804
7805         Memory leak fix.
7806         
7807         * get.c: (trim_dictionary) Free variable list for KEEP after
7808         finishing with it.
7809
7810 Mon Jan 18 12:57:36 1999  Ben Pfaff  <blp@gnu.org>
7811
7812         Some systems didn't like the way open_file was coded.  Thanks to
7813         Hankin <hankin@rogue.consultco.com> for pointing this out.
7814
7815         * filename.c: (open_file) Don't try to store stdin, stdout,
7816         stderr as part of an array, because that doesn't always work.
7817
7818 Mon Jan 18 12:53:27 1999  Ben Pfaff  <blp@gnu.org>
7819
7820         The SAVE procedure didn't save long string variables properly.
7821         Fixed by this patch.  Thanks to Hankin
7822         <hankin@rogue.consultco.com> for this patch.
7823         
7824         * sfm-write.c: (write_variable) Fix off-by-one error in writing
7825         out variable pad records.
7826
7827 Tue Jan  5 14:29:27 1999  Ben Pfaff  <blp@gnu.org>
7828
7829         Previously, if PRINT SPACE were given a negative argument, it
7830         would report an error, then spin in an (almost) infinite loop.
7831         This fixes that behavior.
7832
7833         * print.c: (print_space_trns_proc) After reporting a negative
7834         argument, set number of lines to print to 1.
7835
7836 Tue Jan  5 13:59:55 1999  Ben Pfaff  <blp@gnu.org>
7837
7838         SPSS 8.0 outputs some new record types in its system files, and it
7839         allows longer value labels.  Accept these system files.
7840
7841         * sfm-read.c: (sfm_read_dictionary) Ignore record type 7 subtype
7842         11 emitted by SPSS 8.0.
7843         
7844 Tue Jan  5 13:55:50 1999  Ben Pfaff  <blp@gnu.org>
7845
7846         The LIST procedure was too conservative in allocating space for
7847         buffers, which caused a bug that only showed up with very long
7848         output variables.  Thanks to Hankin <hankin@dunno.com> for this
7849         bug report.
7850
7851         * list.q: (determine_layout) Allocate 1022 bytes instead of 256.
7852
7853 Tue Jan  5 13:34:34 1999  Ben Pfaff  <blp@gnu.org>
7854
7855         Typo meant string format specifiers weren't checked properly.  I
7856         think that Hankin <hankin@dunno.com> sent me this report, but I'm
7857         willing to be corrected on this point.
7858  
7859         * format.c: (check_string_specifier) Fix obvious typo.  
7860
7861 Tue Jan  5 12:50:42 1999  Ben Pfaff  <blp@gnu.org>
7862
7863         Using $CASENUM in an expression didn't work.  Here's a fix.
7864         Thanks to Dirk Melcher <BZN-mdksh@t-online.de> for reporting this
7865         bug.
7866          
7867         * expr-evl.c: (evaluate_expression) Add OP_CASENUM case.
7868
7869         * expr-opt.c: (dump_node) OP_CASENUM is acceptable.
7870
7871 Tue Jan  5 12:47:48 1999  Ben Pfaff  <blp@gnu.org>
7872
7873         The changes in 0.2.1 to fix DATA LIST FREE parsing broke some
7874         other behavior, *sigh*.  This patch hopefully fixes that.  This
7875         time I've actually tested it.
7876
7877         Thanks to Hankin <hankin@dunno.com> for reporting this bug.
7878
7879         * data-list.c: (read_from_data_list_free,
7880         read_from_data_list_list) Call parse_string_as_format() directly
7881         without mucking around with the field width.
7882
7883 Tue Jan  5 12:31:19 1999  Ben Pfaff  <blp@gnu.org>
7884
7885         Occasionally, you may encounter a script that wants to be
7886         interpreted in interactive mode.  Make -i emulate this behavior to
7887         allow such scripts to be executed with PSPP.
7888
7889         Thanks to Hankin <hankin@dunno.com> for reporting this behavior.
7890
7891         * cmdline.c: (pre_syntax_message[]) Update -i description.
7892
7893         * lexer.c: (preprocess_line) When getl_interactive is 2 (i.e.,
7894         when -i is given on the command line) don't treat unindented lines
7895         as starting a new command.
7896
7897 Tue Jan  5 12:30:10 1999  Ben Pfaff  <blp@gnu.org>
7898
7899         In conjunction with egcs 1.1.1, Checker emits some bogus warnings,
7900         mostly caused by local initialized aggregates.  After egcs is
7901         fixed upstream these can be removed, but for now they're not a big
7902         deal.
7903         
7904         * ascii.c: (ascii_postopen_driver) Checker chokes on local
7905         initialized arrays.  Avoid this.
7906
7907         * sfm-write.c: (sfm_write_dictionary) Don't use a local
7908         initialized struct.
7909
7910 Tue Jan  5 12:07:24 1999  Ben Pfaff  <blp@gnu.org>
7911
7912         egcs 1.1.1 has some new warnings relative to gcc 2.8.1, which the
7913         following changes avoid.  Currently I compile sources with egcs
7914         1.1.1 and gcc 2.7.2.3 before sending them out.
7915
7916         * apply-dict.c: (apply_dict) Use new avl_traverser_init() macro.
7917         
7918         * ascii.c: (option_tab[]) Initialize all struct members.
7919
7920         * avl.h: (avl_traverser_init) New macro.
7921         
7922         * command.c: (DEFCMD, UNIMPL macros, cmd_table[]) Initialize all
7923         struct members.
7924
7925         * crosstabs.q: (enum_var_values) Use new hsh_iterator_init()
7926         macro.
7927
7928         * hash.c: Comment fix.
7929
7930         * hash.h: (hsh_iterator_init) New macro.
7931
7932         * html.c: (option_tab[]) Initialize all struct members.
7933
7934         * pfm-write.c: (write_value_labels) Use new avl_traverser_init()
7935         macro.
7936
7937         * postscript.c: (option_tab[]) Initialize all struct members.
7938         (output_encodings, preclose, dump_lines) Use new
7939         hsh_iterator_init() macro.
7940
7941         * sfm-write.c: (write_value_labels) Use new avl_traverser_init()
7942         macro.
7943
7944         * sysfile-info.c: (describe_variable) Use new avl_traverser_init()
7945         macro.
7946
7947 Thu Nov 19 12:32:45 1998  Ben Pfaff  <blp@gnu.org>
7948
7949         * data-in.c: Examined each of the parsing functions to make sure
7950         that they wouldn't dump core if they were passed a string of the
7951         wrong length, since now the DATA LIST FREE/LIST routines don't
7952         check for field width before passing it to the data parser.
7953         (parse_RBHEX, parse_AHEX) Reject odd length input.
7954         (parse_string_as_format) Reject input that's too short or too
7955         long.
7956
7957         * data-list.c: Before, the DATA LIST FREE/LIST routines would pad
7958         a field to its entire declared output width then pass it to the
7959         data-in parsing routines.  This contradicted the documented
7960         behavior.  This is fixed in these changes.  Thanks to Mark H. Wood
7961         <mwood@IUPUI.Edu>.  In addition, this fixes a few more details of
7962         free-format parsing that differed from SPSS.
7963         (cut_field) Commas and spaces are treated identically.  Returns
7964         the proper column instead of a fixed 1 value.
7965         (parse_field) Removed.
7966         (read_from_data_list_free, read_from_data_list_list) Call
7967         parse_string_as_format directly instead of parse_field.
7968
7969         * heap.c: (heap_delete) Stylistic fixes.
7970
7971 Sun Aug  9 11:12:13 1998  Ben Pfaff  <blp@gnu.org>
7972
7973         * loop.c: (loop_2_trns_proc) Formatting fix.
7974
7975         * sel-if.c: (cmd_filter) Set FILTER_before_TEMPORARY.
7976
7977         * var.h: (glob var FILTER_before_TEMPORARY) New global var.
7978
7979         * vfm.c: (macro FILTERED) New.
7980         (static var filter_var) New.
7981         (process_active_file_write_case) Use FILTERED.
7982         (setup_filter) Set filter_var.
7983         (close_active_file) Delete the filter if not
7984         FILTER_before_TEMPORARY.
7985         (procedure_write_case) Use FILTERED.
7986
7987 Sat Aug  8 00:20:14 1998  Ben Pfaff  <blp@gnu.org>
7988
7989         * crosstabs.q: Changed /PIVOT={ON,OFF} to /FORMAT={PIVOT,NOPIVOT}.
7990
7991         * data-in.c: (parse_day_count) Message fix.
7992         (parse_month) Style fix.
7993
7994         * data-list.c: (struct data_list_pgm) New member eof.
7995         (cmd_data_list) Init eof to 0.
7996         (do_reading) Implement the /END subcommand and read-past-eof
7997         checking.
7998
7999         * do-if.c: Include stdio.h when debugging.
8000         (cmd_else_if) Make sure the command is .-terminated.
8001
8002         * glob.c: (init_glob) Capitalize the command prompt.
8003
8004         * inpt-pgm.c: (end_case_trns_proc) Debugging message.
8005         (end_file_trns_proc) Debugging message.
8006
8007         * loop.c: (internal_cmd_loop) Make it work when there's no loop
8008         index!
8009         (loop_2_trns_proc) Enable MXLOOPS (why was this disabled?)
8010
8011         * main.c: (dump_token) Make kwtab[] const.
8012
8013         * set.q: Spelling, comment fixes.
8014
8015         * sysfile-info.c: (cmd_display) DISPLAY VECTORS not DISPLAY
8016         VECTOR.
8017
8018         * vars-prs.c: (fill_all_vars) Style fix.
8019
8020         * vfm.c: (index_to_varname) Return const.
8021
8022 Tue Aug  4 23:49:23 1998  Ben Pfaff  <blp@gnu.org>
8023
8024         * Changes in many source files for partial -ansi -pedantic and
8025         no-debugging compliance: Remove trailing common in enum
8026         declarations; add `unused' attributes; insert some appropriate
8027         casts.
8028
8029         * cmdline.c: (parse_command_line) Add new --testing-mode flag.
8030
8031         * command.c: (shell) Make static.
8032         (run_command) Make static.
8033
8034         * data-list.c: (dump_fixed_table) Remove use of local_strdup().
8035
8036         * dfm.c: (cmd_begin_data) I18n fix.
8037
8038         * error.c: (verbose_msg) Define if __STRICT_ANSI__.
8039
8040         * error.h: (macro verbose_msg) Define if __STRICT_ANSI__.
8041
8042         * expr-opt.c: (evaluate_tree) Don't initialize local arrays if
8043         __STRICT_ANSI__.
8044
8045         * file-handle.q: Don't prepend the source file directory name to
8046         the data file name.  (Ongoing issue.)
8047         (prepend_current_directory) Comment out.
8048         (internal_cmd_file_handle) Don't call prepend_current_directory().
8049         (fh_get_handle_by_filename) Ditto.
8050
8051         * filename.c: Append zero byte to readlink() return value.
8052
8053         * getline.c: (getl_read_line) I18n fix.
8054
8055         * lexer.h: Don't use gcc features if __STRICT_ANSI__.
8056
8057         * misc.h: Don't use gcc features if __STRICT_ANSI__.
8058
8059         * pfm-write.c: (bufwrite) Don't try to increment a void * pointer
8060         directly.
8061
8062         * postscript.c: (output_encodings) Don't use local_strdup().
8063         (postopen) Ditto.
8064
8065         * print.c: Don't use gcc features if __STRICT_ANSI__.
8066
8067         * q2c.c: (dump_vars) Don't put a , at the end of the last enum.
8068
8069         * recode.c: (parse_src_spec) Fully brace nested if's.
8070
8071         * set.q: (global var set_testing_mode) New var.
8072
8073 Wed Jul 29 22:01:44 1998  Ben Pfaff  <blp@gnu.org>
8074
8075         * ascii.c: Add some more `unused' attributes that only come into
8076         play when NDEBUG is defined.
8077         (ascii_close_page) Set s_len when reallocating s.
8078         
8079         * crosstabs.q: (delete_missing) New function.
8080         (output_pivot_table) Call delete_missing() if /MISSING=REPORT.
8081         (make_summary_table) Create summary table reallocable.
8082
8083         * postscript.c: Add more `unused' attributes as above.
8084
8085         * tab.c: (tab_create) [GLOBAL_DEBUGGING] Set reallocable member.
8086         (tab_realloc) [GLOBAL_DEBUGGING] Assert that table is reallocable.
8087          
8088         * tab.h: (struct tab_table) [GLOBAL_DEBUGGING] New `reallocable'
8089         member.
8090
8091         * var.h: (macro force_dup_variable) [!GLOBAL_DEBUGGING] Remove
8092         gratuitous space between parameter definition.
8093
8094         * vars-atr.c: Changed some assert(0)'s to abort()'s to prevent
8095         complaints about running off the end of functions with NDEBUG
8096         enabled.
8097
8098 Sun Jul  5 00:17:25 1998  Ben Pfaff  <blp@gnu.org>
8099
8100         * Several source files: Removed some PORTME notes when reflection
8101         revealed that ANSI forbids that sort of breakage.  Also, added
8102         lots of `unused' qualifiers here and there.
8103
8104         * aggregate.c: (accumulate_aggregate_info) Remove local var
8105         weighting that turned out not to be used.
8106
8107         * avl.c: Update to version 1.1.0.  Add unused specifier.
8108         (avl_destroy) Initialize ab to 0.  Comment fixes.  Cast return
8109         value to void *.
8110         (avl_probe) Replace some instances of 1 with +1 where appropriate.
8111         (avl_find) Cast return value to void *.
8112         (avl_delete) q doesn't need to be initialized at the beginning of
8113         the function.  Replace some instances of 1 with +1.
8114         (force_avl_delete) Renamed avl_force_delete, all references changed.
8115         (compare_ints) `param' marked unused.
8116         (print_int) `param' marked unused.
8117         (recurse_tree) Replace some instances of 1 with +1.
8118
8119         * avl.h: Update to version 1.1.0.  Only declares avl function
8120         types if not already declared.
8121         (AVL_MAX_HEIGHT) Only define if not already defined.
8122         (struct avl_node) New unused member char pad[2].
8123         [GLOBAL_DEBUGGING] Change conditionalization to NDEBUG instead.
8124         (force_avl_insert) Renamed avl_force_insert.
8125         (force_avl_delete) Renamed avl_force_delete.
8126
8127         * crosstabs.q: (struct table_entry) Put `freq' into a union with
8128         new member `data'.
8129         (struct crosstab) Add new member `ofs'.
8130         (glob var int_tab) Removed.
8131         (custom_tables) In integer mode, assign v[i] properly through the
8132         indirect var_dict.
8133         (custom_variables) Now p.crs.max == max + 1.
8134         [DEBUGGING] (debug_print) p.crs.min and p.crs.max are now ints.
8135         (precalc) Implement integer mode.
8136         (calc_integer) Implement integer mode.
8137         (compare_table_entry) Remove unused local variable `comparing'.
8138         (make_summary_table) Implement integer mode.
8139         (macro ns_rows) Implemented as static variable now.
8140         (several variables) Made static, from global.
8141         (output_pivot_table) Use table_value_missing() for column heads.
8142         Remove several unused local variables.  Implement integer mode
8143         table summing.  Count up ns_rows.
8144         (crosstabs_dim) Make columns wider when /MISSING=REPORT requested.
8145         (find_pivot_extent) Moved into find_pivot_extent_general; now just
8146         calls that function or find_pivot_extent_integer.
8147         (find_pivot_extent_integer) New function.
8148         (enum_var_values) Implemented for integer mode.
8149         (table_value_missing) New function.
8150         (display_dimensions) Call table_value_missing() for heads.
8151         (float_M_suffix) New function.
8152         (display_crosstabulation) Call table_value_missing() for row
8153         heads.  Handle missing values in /MISSING=REPORT mode.
8154         (calc_fisher) Remove unused var N.
8155         (calc_r) Remove unused var fact.
8156
8157         * data-list.c: (dump_fixed_table) Fix table dimensioning.
8158         (read_one_set_of_repetitions) Remove unused vars var_spec, column.
8159
8160         * data-out.c: (insert_commas) Remove unused var cp.
8161         (convert_CCx) Remove unused vars save_set_decimal,
8162         save_set_grouping.
8163
8164         * descript.q: (dump_z_table) Fix table dimensioning.
8165         (pre_calc) Remove unused var j.
8166         (display) Remove unused vars title, s.  Fix table dimensioning.
8167
8168         * expr-evl.c: Comment fixes.
8169
8170         * frequencies.q: (full_dim) New function.
8171         (dump_full) Fix table dimensioning.
8172         (condensed_dim) New function.
8173         (dump_condensed) Fix table dimensioning.
8174
8175         * get.c: (cmd_match_files) Remove unused var n_val.  Remove unused
8176         label winnage.
8177
8178         * html.c: (html_close_drive) Remove unused var i.
8179         (postopen) Remove unused vars title, curfn_len, cp.
8180         (preclose) Remove unused vars this, x.
8181
8182         * lexer.c: Comment fixes.
8183
8184         * matrix-data.c: (cmd_matrix_data) Remove unused var index.
8185
8186         * means.q: (custom_tables) Remove unused var m_dim.
8187
8188         * mis-val.c: Format fix.
8189
8190         * modify-vars.c: (cmd_modify_vars) Remove unused var new_dict.
8191
8192         * output.c: (outp_get_paper_size) Remove unused var cp.
8193
8194         * pfm-read.c: (read_float) Remove unused var save, unused label
8195         underflow.
8196         (read_variables) Remove unused vars cp, j.
8197         (read_value_label) Remove unused var j.
8198
8199         * pfm-write.c: (bufwrite) Remove unused var i.
8200
8201         * postscript.c: (ps_postopen_drive) Remove unused vars dev_info,
8202         fn.
8203         (output_encodings) Remove unused vars char_cp, n_output.
8204         (read_ps_encodings) Remove unused var ep.
8205         (postopen) Remove unused var title.
8206         (preclose) Remove unused var fp.
8207         (ps_open_page) Remove unused vars true, false, orientation,
8208         mirror_horz, mirror_vert, width, length.
8209         (ps_text_metrics) Remove unused var x.
8210
8211         * q2c.c: (find_symbol) Remove unused var y.
8212         (parse_setting) Remove unused parameter sbc, all references
8213         changed.
8214         (dump_parser) Remove unused var cp.
8215         (dump_free) Remove unused var i.
8216
8217         * set.q: (static vars args, n) Removed.
8218         (internal_cmd_gset) Removed.
8219
8220         * sfm-read.c: (sfm_read_dictionary) Removed unused var i.
8221         (read_machine_flt64_info) Removed unused var file_endian.
8222         (read_documents) Removed unused var i.
8223         (read_compressed_data) Removed unused parameter dict, all
8224         references changed.
8225
8226         * sfm-write.c: (bufwrite) Removed unused var i.
8227         (sfm_write_case) Removed unused var i.
8228
8229         * sort.c: (merge_once) Remove unused var t.
8230         (write_separate) #if 0 out as dead code.
8231
8232         * split-file.c: (cmd_split_file) Remove unused var i.
8233
8234         * sysfile-info.c: (sysfile_info_dim) New function.
8235         (cmd_sysfile_info) Fix table dimensioning.
8236         (variables_dim) New function.
8237         (display_variables) Fix table dimensioning.
8238         (describe_variable) Remove unused var prev_r.
8239
8240         * t-test.q: (z_postcalc) Removed.
8241         (pairs_calc) Remove unused var bad_weight.
8242         (postcalc) Remove unused vars dfn, dfd.
8243
8244         * tab.c: (tab_create) Set t->dim to NULL.
8245         (tab_dim) Make sure t->dim is NULL first.
8246         (tab_natural_width) Remove parameter `clamp'.
8247         (tab_value) Remove duplicate assertion for table.
8248         (tab_raw) New function.
8249         (nowrap_dim) New function.
8250         (wrap_dim) New function.
8251         (tab_output_text) Fix table dimensioning.
8252
8253         * tab.h: (tab_raw) New macro.
8254
8255         * val-labs.c: (get_label) Remove unused var type.
8256         (copy_value_labels) Remove unused var trav.
8257
8258         * var.h: (struct crosstab_proc) Completely changed.
8259
8260         * vars-prs.c: (parse_dict_variable) Remove unused var v.
8261
8262         * vfm.c: (open_active_file) Remove unused vars i, lp.
8263
8264         * weight.c: (weight_trns_proc) #if 0 out as dead code.
8265         
8266 Tue Jun  2 23:37:21 1998  Ben Pfaff  <blp@gnu.org>
8267
8268         * Makefile.am: Add apply-dict.c, flip.c.
8269
8270         * apply-dict.c: New file.
8271         
8272         * command.c: (struct command) Make cmd[] larger for CLEAR
8273         TRANSFORMATIONS command name.
8274         (parse_cmd) Make sure we're in a valid state before using it as an
8275         index.  Discard variables and reset state on invalid transitions.
8276         (cmd_clear_transformations) New function.
8277
8278         * command.def: Add APPLY DICTIONARY, CLEAR TRANSFORMATIONS, FLIP.
8279         Add unimplemented PRESERVE, RESTORE.
8280
8281         * file-handle.h: Include stddef.h.
8282
8283         * flip.c: New file.
8284         
8285         * pfm-read.c: (parse_value) Pad value label values with spaces,
8286         not nulls.
8287
8288         * sfm-read.c: (struct sfm_fhuser_ext) Add reference count.
8289         (sfm_close) Decrement reference count, make sure it's zero.
8290         (sfm_maybe_close) New function.
8291         (sfm_read_dictionary) Handle reference counts.
8292
8293         * vars-atr.c: (clear_default_dict) New function.
8294         (discard_variables) Use clear_default_dict().
8295
8296 Sun May 31 00:58:05 1998  Ben Pfaff  <blp@gnu.org>
8297
8298         * Makefile.am: Add pfm-write.c.
8299         (LDADD) Add the libgmp2 libraries.
8300
8301         * command.def: Define EXPORT.
8302
8303         * get.c: (cmd_export) New function.
8304         (export_write_case_func) New function.
8305
8306         * pfm-read.c: (static spss2ascii[]) Make it const.
8307
8308         * pfm-write.c: New file.
8309
8310         * sfm-write.c: Formatting, comment fixes.
8311
8312         * var.h: Comment fix.
8313
8314 Fri May 29 21:44:12 1998  Ben Pfaff  <blp@gnu.org>
8315
8316         * Makefile.am: Add pfm.h, pfm-read.c.
8317
8318         * command.def: IMPORT is now implemented.
8319
8320         * format.c: (glob var translate_fmt[]) New var.
8321
8322         * get.c: (enum GTSV_NONE) Renamed GTSV_OPT_NONE.
8323         (cmd_import) New function.
8324         (import_source_read) New function.
8325         (glob var import_source) New var.
8326
8327         * pfm-read.c: New file.
8328
8329         * pfm.h: New file.
8330         
8331         * sfm-read.c: (parse_format_spec) Local variable translate_fmt[]
8332         moved in format.c.
8333         (dump_dictionary) Disabled printing a couple of items.
8334
8335 Mon May 25 12:42:37 1998  Ben Pfaff  <blp@gnu.org>
8336
8337         * crosstabs.q: (postcalc) Call make_summary_table().
8338         (make_summary_table) New function.
8339         (insert_summary) New function.
8340         (display_dimensions) Remove some unnecessary arguments, all
8341         references changed.
8342         (output_pivot_table) Fix lots of problems with the risk table
8343         setup.
8344         (submit) Don't display an empty table.
8345         (display_risk) Fix order of arguments to calc_risk().
8346
8347         * glob.c: Always include assert.h and stdlib.h.
8348
8349         * output.h: (enum OUTP_T_JUST_FULL) Removed, all references
8350         removed.
8351
8352         * tab.c: (tab_create) Cosmetic changes.
8353
8354         * tab.h: (enum TAB_JUSTIFY) Removed, all references removed.
8355
8356 Sun May 24 22:39:23 1998  Ben Pfaff  <blp@gnu.org>
8357
8358         * tab.def: Removed.
8359
8360         * crosstabs.q: (output_pivot_table) Headers drawing and submission
8361         code simplified, moved into new function submit().
8362         (submit) New function.
8363         (crosstabs_dim) New function.
8364         (display_directional) Substitute variable names for %s where
8365         appropriate.
8366         (somers_d_v[], somers_d_ase[], somers_d_t[]) New static vars.
8367         (calc_symmetric) Initialize parameters only if non-NULL.
8368         Calculate Somers' d.
8369         (calc_directional) Calculate Somers' d (or copy it, really).
8370         Calculate eta.
8371
8372         * output.c: (outp_string_width) New function.
8373
8374         * postscript.c: (postopen) Calculate font widths based on the
8375         width of the zero '0' character, not the width of the space
8376         character.  Set paper-width and paper-length based on points, not
8377         device units.
8378         (ps_open_page) Fix page setup string for landscape mode.
8379
8380         * som.h: (struct som_dimension) Removed.
8381         (struct som_table_class) height, width members take int * not
8382         som_dimesion * now.
8383
8384         * tab.c: Many functions now have added parameter validation.
8385         (tab_height, tab_width) These functions were removed and merged
8386         into a single function tab_resize(), and all references changed.
8387         (tab_dim) Rewritten since the interface changed; reduced from
8388         hundreds of lines to two.  All callers were changed.  Currently
8389         most of them just use tab_natural_dimensions as their callback and
8390         await detailed translation of functionality.
8391         (tab_natural_width) New function.
8392         (tab_natural_height) New function.
8393         (tab_natural_dimensions) New function.  This is a callback
8394         function, not something that you'd want to call directly.
8395         (tab_nat_dim) Removed.
8396         (tabi_table) Allocates t->w and t->h.
8397         (tabi_driver) Inlined sum_columns()'s functionality.  Calls the
8398         dimensions callback.
8399         (evaluate_dimensions) Removed.
8400         (sum_columns) Removed.
8401
8402         * tab.h: (enum TAL_1THIN) Removed.
8403         (enum series t_*) Removed.
8404         (struct tab_table) Members trh, trv changed to unsigned char *
8405         from int *.  Member dim changed to a function pointer from a
8406         unsigned char *.  Member max_stack_height removed.  New members
8407         hr_tot, vr_tot.
8408         (macros tab_l, tab_r, tab_t, tab_b) New.
8409
8410 Sat May 23 23:22:13 1998  Ben Pfaff  <blp@gnu.org>
8411
8412         * ascii.c: (delineate) Assign last_space_nchars before skipping
8413         spaces, to fix right justification.
8414
8415         * crosstabs.q: (static vars risk, direct) New vars.
8416         (static var pearson_r) Removed.
8417         (glob var chisq_fisher) Made static.
8418         (static vars row_tot[], col_tot[]) Don't include grand total
8419         anymore.
8420         (static var grand_total) Renamed W, all references changed.
8421         (output_pivot_table) Only make `table' if num_cells != 0.  Make
8422         risk and directional tables.  Deal with grand total no longer part
8423         of col_tot[].  Free rows and cols after we're done with them.
8424         (display_risk) New function.
8425         (display_directional) New function.
8426         (clac_r) Rewritten so that it stores all its results into its
8427         arguments, so it can be used for Spearman's correlation too.
8428         (calc_symmetric) Added a t[] argument, all references changed.
8429         Calculates ASEs for tau-b, tau-c, gamma.  Calculates Spearman's r,
8430         Pearson's r, Cohen's kappa.
8431         (calc_risk) New function.
8432         (calc_directional) New function.
8433
8434         * som.c: (som_submit) Improved debugging code.
8435
8436         * stats.c: (hypercube) New function.
8437         (cube) New function.
8438         (sqr) New function.
8439         (normal_sig) Went back to old implementation, which actually
8440         worked.
8441
8442         * stats.h: (macros square, cube, hypercube) Removed.  The
8443         equivalent functions in stats.c are inlined here; all references
8444         to square changed to sqr.
8445
8446 Fri May 22 00:03:41 1998  Ben Pfaff  <blp@gnu.org>
8447
8448         * crosstabs.q: (N_SYMMETRIC) New define.
8449         (postcalc) Disable debug printing.
8450         (static vars chisq_fisher, pearson_r) New.
8451         (output_pivot_table) Add support for symmetric measures.  Add
8452         chi-square output of exact sigs.
8453         (display_chisq) Rewritten.
8454         (display_symmetric) New function.
8455         (gamma_int) New function.
8456         (Pr) New function.
8457         (swap) New function.
8458         (calc_fisher) New function.
8459         (calc_chisq) Check boundary conditions better. Calculate Yates,
8460         Fisher, Mantel-Haenszel tests.
8461         (calc_r) New function.
8462         (calc_symmetric) New function.
8463
8464         * stats.c: (normal_sig) Rewritten with new algorithm.  Renamed
8465         from calc_normal.
8466         (chisq_sig) Better boundary conditions.  Renamed from
8467         calc_significance.
8468
8469         * tab.h: (struct tab_table) New member cf.
8470
8471         * tab.c: (tab_create) Set cf.
8472         (tab_width) New function.
8473         (tab_realloc) Handle cf.
8474         (tab_vline) Handle cf.
8475         (tab_hline) Handle cf.
8476         (tab_box) Handle cf.
8477         (tab_value) Handle cf.
8478         (tab_float) Handle cf.
8479         (tab_text) Handle cf.
8480         (tab_joint_text) Handle cf.
8481         (tab_offset) Handle cf.
8482         (tab_next_row) Handle cf.
8483         (evaluate_dimensions) Handle cf.
8484         (render_strip) Handle cf.
8485
8486 Wed May 20 00:03:59 1998  Ben Pfaff  <blp@gnu.org>
8487
8488         * crosstabs.q: (postcalc) New vars row_tot, col_tot, pass them to
8489         output_pivot_table().
8490         (output_pivot_table) Moved lots of local variables outside and
8491         made them static.  Add beginnings of chi-square statistic
8492         support.  Now column and row totals aren't in the main matrix.
8493         Always zero out any leftover rows & columns after we're done with
8494         the table entries.  Move all output stuff into
8495         display_dimensions(), display_crosstabs(), display_chisq().
8496         (display_dimensions) New function.
8497         (display_crosstabulation) New function.
8498         (display_chisq) New function.
8499         (calc_chisq) Implemented Pearson and likelihood-ratio chisquares.
8500
8501         * frequencies.q: (dump_full, dump_condensed) Remove tab_null()
8502         references, simplify logic.
8503
8504         * postscript.c: Remove scale, translate-x, translate-y,
8505         mirror-horz, mirror-vert, rotate-180 options.
8506         (struct ps_driver_ext) Remove scale, translate_x, translate_y.
8507         All references deleted.
8508         (macro YT) New macro.
8509         (array option_tab[]) Removed options.
8510         (ps_option) Removed options.
8511         (ps_open_page) Write page setup explicitly to output file, without
8512         using now-deleted BP function.
8513         (macro dump_line) Use YT().
8514         (macro dump_thick_line) Use YT().
8515         (draw_headers) Use YT().
8516         (switch_font) Reorder arguments to SF function.
8517         (write_text) Use YT().
8518
8519         * sfm-read.c: (sfm_read_case) Don't attempt to read variables that
8520         have get.fv == -1.
8521
8522         * sysfile-info.c: (describe_variables) Don't use tab_nulls().
8523
8524         * tab.c: (tab_create) Initialize t->ct to zeros.  Remove
8525         null-debugging code.
8526         (tab_realloc) Remove null-debugging code.  Initialize new regions
8527         of t->ct to zeros.
8528         (tab_vline) Support offsets.
8529         (tab_hline) Support offsets.
8530         (tab_box) Support offsets.
8531         (tab_null) Removed.
8532         (tab_nulls) Removed.
8533         (tab_row) Removed.
8534         (tab_col) Removed.
8535         (evaluate_dimensions) Remove null-debugging code.  Understand
8536         TAB_EMPTY attribute.  Assert that text.s.s is always non-NULL if
8537         TAB_EMPTY not present.
8538
8539         * tab.h: New cell attribute TAB_EMPTY.
8540         (macros tab_nr, tab_nc, tab_row, tab_col) New.
8541
8542         * vars-atr.c: (init_variable) Set get.fv to -1 so that GET doesn't
8543         try to read them from system files.
8544
8545         * vfm.c: (dump_splits) Don't call tab_null().   
8546
8547 Sat May 16 19:36:55 1998  Ben Pfaff  <blp@gnu.org>
8548
8549         * crosstabs.q: (struct crosstab) Added `missing' member.
8550         (custom_tables) Init missing.
8551         (calc_general) Handle missing values.
8552         (calc_chisq) New function.
8553         (output_pivot_table) Start work on chi-square output.  Update for
8554         new tab offset support functions.  Shorten statistic names.
8555
8556         * Several files: add in more `const's to placate gcc's warnings.
8557
8558         * tab.h: (struct tab_table) Add col_ofs, row_ofs members.  Comment
8559         fixes.
8560
8561         * tab.c: (tab_height, tab_realloc, tab_vline, tab_hline, tab_box,
8562         tab_null, tab_nulls, tab_value, tab_float, tab_text,
8563         tab_joint_text) Add col_ofs and row_ofs support.
8564         (tab_offset) New function.
8565         (tab_next_row) New function.
8566         (tab_row) New function.
8567         (tab_col) New function.
8568         (tabi_table) Add col_ofs and row_ofs support.
8569
8570         * vars-atr.c: (is_system_missing) New function.
8571
8572 Tue May 12 16:14:30 1998  Ben Pfaff  <blp@gnu.org>
8573
8574         * crosstabs.q: Expanded subcommand names RESID --> RESIDUAL, etc.
8575         (static var no_cells) Removed.
8576         (static var num_cells) New.
8577         (static var expected) New.
8578         (static var cells[]) New.
8579         (internal_cmd_crosstabs) Deal with new variables.
8580         (postcalc) Removed most of the meat and put it in new function
8581         output_pivot_table().
8582         (output_pivot_table) Calculates and outputs an entire pivot table.
8583
8584         * postscript.c: (postopen) Fix problems with free()ing addresses
8585         not obtained from malloc().
8586
8587         * som.c: (som_submit) Add assertion.
8588
8589         * sysfile-info.c: (describe_variable) Use new tab_nulls()
8590         function.
8591
8592         * tab.c: (static var tab_names[]) New.
8593         (tab_realloc) -1 for nc or nr indicates no change.
8594         (tab_nulls) New function.
8595         (tab_dim) Use tab_names[].
8596         (tabi_cumulate) Don't include bottom or right headers.  Furrfu.
8597         (evaluate_dimensions) Don't terminate on uninited cells, just put
8598         an X in them and emit a notice.  Use tab_names[].
8599
8600         * tab.h: Move bits into tab.def.
8601
8602         * tab.def: New.  Don't try to declare tab_table_class because then
8603         som.h has to be included.       
8604         
8605 Thu May  7 22:55:04 1998  Ben Pfaff  <blp@gnu.org>
8606
8607         * command.def: New file, contains all the command definitions
8608         previously included bodily in command.c.
8609
8610         * format.def: New file, contains all of the format definitions
8611         previously split across format.h, format.c, and sfm-write.c.
8612
8613         * lexer.h: Renamed from tokens.h in order to match corresponding
8614         .c file name.
8615
8616         * lexerP.h: Moved some rarely used functions exported by lexer.c
8617         into here.
8618
8619         * Makefile.am: Commemorate renamed files.
8620         (EXTRA_DIST) Add command.def, format.def.
8621
8622         * command.c: [0] (walk_cmdtable_func) Removed.
8623
8624         * crosstabs.q: (postcalc) Made it work and print out matrices
8625         proving it.
8626         (enum_column_values) Renamed enum_var_values, generalized for any
8627         variable.
8628
8629         * format.h: (struct fmt_desc) New member `spss'.
8630
8631         * q2c.c: (main) Generated code includes lexer.h instead of
8632         tokens.h.
8633
8634         * sfm-write.c: (write_format_spec) Use new spss member of fmt_spec
8635         instead of an independent translation table.
8636
8637 Tue May  5 13:19:03 1998  Ben Pfaff  <blp@gnu.org>
8638
8639         * Lots of source files: Added const to declarations.
8640
8641         * aggregate.c: (parse_aggregate_function) Rename inner i to j.
8642         
8643         * arena.c: (arena_clear) Set prev pointer to null when done.
8644
8645         * ascii.c: (ascii_option) Rename index as indx.
8646
8647         * avl.c: This is now a separate library called libavl.
8648         (xmalloc) Make static.
8649         (avl_probe) Step A7 can use the cache instead of an explicit
8650         compare.
8651         (avl_delete) Don't maintain a q pointer because it's always
8652         available in the pointer stack.  Comment fix.
8653
8654         * avl.h: This is now a separate library called libavl.
8655
8656         * command.c: (cmd_table[]) Remove spurious trailing "".
8657
8658         * common.h: Only include random() fix if this system needs it.
8659
8660         * crosstabs.q: Include alloca headers.
8661         (n_sorted_tab) New global var.
8662         (postcalc) Mostly rewritten.
8663         (find_pivot_extent) Rewritten.
8664         (enum_column_values) Rewritten.
8665
8666         * data-out.c: (convert_F) Rename inner n as n_spaces.
8667
8668         * error.c: (dump_message) Don't have an outer var i.
8669
8670         * file-handle.q: (static var f) Removed.  All references removed.
8671         (internal_cmd_file_handle) Uses a local variable instead of f.
8672
8673         * get.c: (trim_dictionary) Change scope of i, i1, i2.
8674         (cmd_match_files) Don't strcpy tokstr into sbc (why was this ever
8675         done?)
8676
8677         * getline.h: Declare getl_history as extern.  Reported by
8678         palme@uni-wuppertal.de (Hubert Palme).
8679
8680         * postscript.c: (postopen) Some large mods for constness.
8681
8682         * recode.c: Remove spurious copyrights since PSPP is owned by FSF
8683         anyway.
8684
8685 Fri Apr 24 12:52:47 1998  Ben Pfaff  <blp@gnu.org>
8686
8687         * Makefile.am: Rename BUILT_SOURCES to q_sources, all references
8688         changed.  Add avl.c, avl.h to pspp_SOURCES.  Remove avllib from
8689         LDADD.
8690
8691         * avl.c, avl.h: New files.  These form a clean-room
8692         reimplementation of avllib.  Iterative algorithms are used in
8693         place of recursive ones, so there is no resemblance in the code.
8694
8695         * Lots of headers: Don't include other headers by default.
8696
8697         * Lots of source files: Explicitly include all needed headers.
8698
8699         * arena.c: (arena_clear) New function.
8700
8701         * crosstabs.q: (ROW_VAR, COL_VAR) New enums.
8702         (static var ar) Removed.
8703         (staitc vars ar_tc, ar_col) New.
8704         (cmd_crosstabs) Destroy the arenas.
8705         (internal_cmd_crosstabs) Create the arenas.
8706         (precalc) Don't need a free function for the hash.
8707         (calc_general) Make sure to zero out the trailer on the key data
8708         before inserting.
8709         (print_table_entries) Updated.
8710         (postcalc) Worked on actually implementing.
8711         (find_pivot_extent) New function.
8712         (compare_value) New function.
8713         (enum_column_values) New function.
8714
8715         * data-in.c: (parse_month) Make local array `static const'.
8716         
8717         * data-out.c: (convert_date) Make local array `static const'.
8718         (convert_WKDAY) Same.
8719         (convert_MONTH) Same.
8720
8721         * frequencies.q: (postprocess_freq_tab) avl_walk_inorder() has
8722         been renamed to avl_walk().
8723         
8724         * hash.c: Rewritten more efficiently.
8725
8726         * hash.h: Add attribute const to hsh_next_prime declaration.
8727
8728         * lexer.c: (id_match) Make arguments const.
8729
8730         * postscript.c: (ps_postopen_driver) Make default fonts the
8731         Helvetica family.
8732
8733         * q2c.c: (main) Generated code needs stdlib.h.
8734
8735         * sfm-write.c: (write_value_labels) An avl_traverser needs to be
8736         initialized to 0 now, not to NULL.  All other references to
8737         avl_traverser were updated in the same way.
8738
8739         * tokens.h: Macro version of id_match updated to use const
8740         properly.
8741
8742         * val-labs.c: (inc_ref_count) New function.
8743         (copy_value_labels) Simply through use of new avl_copy() function.
8744
8745 Wed Apr 15 13:01:58 1998  Ben Pfaff  <blp@gnu.org>
8746
8747         * crosstabs.q: Probably doesn't compile.  New PIVOT subcommand.
8748         (postcalc) Worked on this.
8749
8750         * postscript.c: (OPO_DOUBLE_LINE) New enum.
8751         (struct ps_driver_ext) New line_width_thick member.
8752         (ps_preopen_drive) Init line_width_thick.
8753         (option_tab[]) Add line-* options.
8754         (ps_option) Parse line-* options.
8755         (postopen) Add line_width_thick support.  Strip leading spaces on
8756         prologue output lines.
8757         (ps_open_page) Include line_width_thick in output.
8758         (macro dump_thick_line) New.
8759         (dump_fancy_line) Support thick lines as well as double lines.
8760
8761 Tue Apr 14 00:50:08 1998  Ben Pfaff  <blp@gnu.org>
8762
8763         * Makefile.am: Add crosstabs.c to BUILT_SOURCES.  Add crosstabs.q
8764         to pspp_SOURCES.  Add crosstabs.q to EXTRA_DIST.
8765
8766         * Many source files: Rename `options' to `pv_opts' as appropriate.
8767
8768         * command.c: (static var cmd_table[]) Add CROSSTABS command.
8769
8770         * common.c: (xcalloc) New function.
8771
8772         * crosstabs.q: New file.  Not finished yet, though.
8773                 
8774         * data-list.c: Comment fix.
8775
8776         * error.c: Remove some old Checker cruft.
8777
8778         * frequencies.q: (dump_full) Cumulate valid percent instead of
8779         regular percent.
8780
8781         * getline.c: Comment fix.
8782
8783         * hash.c: Comment fixes.
8784
8785         * hash.h: (struct hsh_table) Make hash functions return unsigned
8786         instead of int to avoid problems with taking the modulo of
8787         negative return values.  All references changed.
8788
8789         * misc.c: (intlog10) Make its table static const instead of auto.
8790
8791         * sfm-read.c: (read_header) Make `prefix' static const instead of
8792         auto.
8793
8794         * var.h: (union value) Add member `hash'.
8795         (struct variable) Rename prv_index as `foo'--all references
8796         changed.  Reorder.
8797         (typedef pv_opts) Removed.  All references changed.
8798
8799         * vars-prs.c: (parse_variables) Message fixes.
8800         
8801 Mon Mar  9 15:35:08 1998  Ben Pfaff  <blp@gnu.org>
8802
8803         * get.c: (cmd_match_files) Don't reverse the order of FILEs as
8804         they are being inserted.  Don't check for BY variables of
8805         different types.  Discard variables if the active file isn't
8806         included in the merge.
8807         (mtf_processing) Essentially rewritten.
8808         (mtf_merge_dictionary) Check for master/slave variables of
8809         different types/widths.
8810
8811         * vfm.c: (static var not_canceled) New var.
8812         (process_active_file) Don't call vfm_source->read() if
8813         there's no vfm-source.  Initialize not_canceled.
8814         (process_active_file_write_case) Honor and update not_canceled.
8815         (prepare_for_writing) Rollback changes from yesterday, they were
8816         wrong.
8817         (close_active_file) Don't destroy vfm_source unless it exists.
8818         
8819 Mon Mar  9 00:56:16 1998  Ben Pfaff  <blp@gnu.org>
8820
8821         * Lots of source files: Added { } around nested if/else constructs
8822         to avoid new gcc 2.8 warnings.
8823
8824         * data-in.c: (parse_Z) Declare `int' type explicitly.
8825         (convert_Z) Ditto.
8826
8827         * get.c: (struct mtf_file) Add prev, next_min, by, input members.
8828         (cmd_match_files) Initialize mtf_by_values.  Manage by, input,
8829         prev members.  Put TABLEs at the end of the chain and FILEs at the
8830         beginning.  Don't allow the active file in STATE_INIT.  Use proper
8831         `seen' value for the active file.  Fill out the by members and
8832         make sure they're of consistent type.  Do the actual merge
8833         operation.
8834         (mtf_processing_finish) New function.
8835         (var_type_description) New function.
8836         (mtf_free_file) New function.
8837         (mtf_free) Rewritten.
8838         (mtf_delete_file_in_place) New function.
8839         (mtf_read_nonactive_records) New function.
8840         (mtf_compare_BY_values) New function.
8841         (static var mtf_seq_no) New var.
8842         (mtf_processing) New function.
8843         (mtf_merge_dictionary) Assign nval members for the system file
8844         dictionary.  Assign fv values for its variables.  Point each slave
8845         variable to the corresponding master variable.
8846
8847         * hash.c: Include str.h.
8848
8849         * mis-val.c: (copy_missing_values) src arg is const.
8850
8851         * misc.c: (spacing) Make `max' var explicitly int.
8852
8853         * sfm-read.c: (dump_dictionary) Message reformatting.
8854         (sfm_read_case) Add assertion.
8855
8856         * sort.c: Esthetic fixes.
8857
8858         * var.h: (struct match_files_proc) New struct.
8859         (struct variable) Add private data match_files_proc.
8860
8861         * vars-atr.c: (delete_variable) Implement.  Add argument for the
8862         dictionary that owning the variable.
8863         (dup_variable) Add assertion.
8864
8865         * vfm.c: Comment fixes, hopefully the comments are correct now.
8866         (process_active_file) New function.
8867         (process_active_file_write_case) New function.
8868         (process_active_file_output_case) New function.
8869         (prepare_for_writing) Use temp_dict->nval for vfm_info, not
8870         default_dict.nval.
8871         (write_case) Renamed procedure_write_case().  Now write_case is a
8872         pointer to a function.  Style fixes.
8873         
8874 1998-03-05  Ben Pfaff  <blp@gnu.org>
8875
8876         * Makefile.am: (q2c) Link with libmisc.
8877         (version.c) Define default_config_path, include_path,
8878         groff_font_path.
8879
8880         * ascii.c: (ascii_postopen_driver) When the default newline string
8881         is requested, open file in text mode.  Suggested by
8882         palme@uni-wuppertal.de (Hubert Palme).
8883         (static vars line_buf, line_p) Change from char * to unsigned char
8884         *.
8885         (ascii_close_page) char * to unsigned char *.
8886
8887         * cmdline.c: (parse_command_line) Implement -r option by
8888         prepending ~/.pspp/rc to the list of files to process.
8889
8890         * command.c: (cmd_remark) Reset getl_prompt to the standard prompt
8891         before pulling in a final line.
8892         (null_func, null_int_func) Removed (dead code).
8893
8894         * descript.q: (display) Calculate width of variable name column
8895         properly.  Calculate number of valid cases properly.  Reported by
8896         palme@uni-wuppertal.de (Hubert Palme).
8897
8898         * filename.c: (init_filename) Use default_config_path instead of
8899         now obsolete CONFIG_PATH.
8900
8901         * getline.c: (getl_initialize) Use include_path instead of now
8902         obsolete INCLUDE_PATH.
8903         (getl_add_file) New argument `where'.  All references changed.
8904
8905         * groff.c: (find_font_file) Use groff_font_path instead of now
8906         obsolete GROFF_FONT_PATH.
8907         
8908         * postscript.c: (find_ps_file) Use groff_font_path instead of now
8909         obsolete GROFF_FONT_PATH.  Copy through temporary variable to
8910         avoid problems with constness.
8911
8912         * str.h: (macro cs_streq) New macro.
8913
8914         * version.h: (glob var default_config_path, include_path,
8915         groff_font_path) New vars.
8916         
8917 1998-02-23  Ben Pfaff  <blp@gnu.org>
8918
8919         * Many source files: Change verbose_msg() priority levels and
8920         messages.
8921
8922         * aggregate.c: Include debug-print.h.
8923
8924         * cmdline.c: (parse_command_line) Add --safer/-s and --command/-c
8925         options.
8926         (static var pre_syntax_message) Document --safer/-s and
8927         --command/-c.
8928
8929         * command.c: (cmd_erase, cmd_host) Disable if set_safer is set.
8930
8931         * dfm.c: (open_inline_file) [__CHECKER__] Zero out ext->file,
8932         because it's not used but it's still copied.
8933         (open_file_r) Remove gratuitous debug message.
8934
8935         * filename.c: (safety_violation) New function.
8936         (open_file) Remove gratuitous debug messages.  Don't allow pipe
8937         files if set_safer is set.
8938
8939         * get.c: Turn off debugging.
8940
8941         * getline.c: (getl_add_virtual_file) New function.
8942         (getl_read_line) Add verbose_msg() call for opening new syntax
8943         file.
8944         (getl_perform_delayed_reset) Add a return value describing whether
8945         any action was taken.  Call reset_eof().
8946
8947         * getline.h: Comment fix.
8948
8949         * groff-font.c: (groff_read_font) Use `goto next_iteration' in
8950         place of incorrect `continue'.  Use strtok_r() instead of
8951         strtok().  Always check strtok_r() return value.
8952         (groff_read_DESC) Use strtok_r() instead of strtok().
8953
8954         * lexer.c: (reset_eof) New function.
8955
8956         * main.c: (parse) Get a token after performing a delayed reset
8957         action; allow empty syntax files.
8958
8959         * postscript.c: (output_encodings) Use strtok_r() instead of
8960         strtok().
8961
8962         * q2c.c: (dump_parser) Use strtok_r() instead of strtok().
8963
8964         * set.q: Comment fixes.
8965         (glob var set_safer) New var.
8966         (internal_cmd_set) Support SAFER.
8967
8968         * str.h: [!HAVE_STRTOK_R] Declare strtok_r() prototype.
8969
8970         * temporary.c: (free_dictionary) Set d->splits to NULL after
8971         freeing.
8972
8973         * vars-atr.c: (clear_variable) Decrement dict->n_splits if
8974         variable deleted, not if it *isn't* deleted.
8975
8976 1998-02-16  Ben Pfaff  <blp@gnu.org>
8977
8978         * command.c: (array cmd_table[]) Add MATCH FILES.
8979
8980         * common.c: Comment fixes.
8981
8982         * data-list.c, dfm.c, error.c, filename.c, list.q, matrix-data.c,
8983         modify-vars.c, postscript.c, sfm-read.c, sfm-write.c, tab.c:
8984         Include alloca.h.  Problem reported by palme@uni-wuppertal.de
8985         (Hubert Palme).
8986
8987         * expr-opt.c: Include str.h.  Problem reported by
8988         palme@uni-wuppertal.de (Hubert Palme).
8989
8990         * get.c: (cmd_get) [DEBUGGING] Update v->p.get to v->get.
8991         (static var mtf_by) Change from char ** to variable **.
8992         (static var mtf_master) New var.
8993         (mtf_merge_dictionary) New function.
8994         (cmd_match_files) Init mtf_master.  Parse mtf_by according to new
8995         var type.  Reorder tests properly.  Initialize file->dict.  Detect
8996         TABLE= without BY=.  Read file dictionaries and merge them.  Give
8997         subcommand name with IN, LAST, FIRST error messages.  Create IN,
8998         LAST, FIRST variables.  Comment fixes.
8999         (mtf_free) Don't free default_dict.  Free mtf_master.
9000
9001         * getline.c: Define getl_mode.  Change getl_buf_size to size_t
9002         from int.
9003         (handle_line_buffer) Cast int to size_t in comparison to avoid
9004         warning.
9005
9006         * getline.h: Declare getl_mode extern.
9007
9008         * groff-font.c: (groff_read_font) Type-fix calls to getline.
9009         (groff_read_DESC) Make line_size a size_t.
9010         (match_tok) Parenthesize name to avoid macro expansion.
9011
9012         * mis-val.c: (copy_missing_values) New function.
9013
9014         * postscript.c: (postopen) Make buf_size a size_t.
9015
9016         * sfm-read.c: (dump_dictionary) Make global from static.  Print
9017         variable info in parts for easier debugging with Checker.
9018
9019         * temporary.c: (copy_variable) Use copy_value_labels().
9020         (new_dictionary) New arg: whether to copy file label, documents.
9021
9022         * val-labs.c: (copy_value_labels) New function.
9023
9024         * var.h: (enums MISSING_*) Add MISSING_COUNT.
9025
9026         * vars-atr.c: [GLOBAL_DEBUGGING] (force_dup_variable) New
9027         function.
9028         (dup_variable) Set prv_index, get.fv, get.nv.
9029
9030 Fri Feb 13 15:38:36 1998  Ben Pfaff  <blp@gnu.org>
9031
9032         * Makefile.am: (pspp_SOURCE) Add htmlP.h.
9033
9034         * Many source files: For ANSI-compliance, add empty statement
9035         after label.  Reported by palme@uni-wuppertal.de (Hubert Palme)
9036         and Micah Altman <maltman@www-vdc.fas.harvard.edu>.
9037
9038         * data-in.c: (parse_numeric) Some header files break on
9039         -DBL_MIN_10_EXP because they get a --; add () for safety.
9040         Reported by palme@uni-wuppertal.de (Hubert Palme).
9041
9042         * dfm.c: Idea by Dr Eberhard W Lisse <el@linux.lisse.na>.
9043         (struct dfm_fhuser_ext) Change `file' from FILE * to file_ext.
9044         (dfm_close) Use close_file_ext.
9045         (open_inline_file) Set file.file to NULL, not file.
9046         (open_file_r, open_file_w) Initialize file.file; fill in file_ext
9047         struct and use open_file_ext().
9048         (read_record) Use file.file.
9049
9050         * file-handle.q: (prepend_current_directory) Pass through special
9051         filenames.
9052
9053         * filename.c: Only include unistd.h if HAVE_UNISTD_H.
9054         (normalize_filename) Pass through special filenames.
9055         (open_file, close_file) Accept pipe| and |pipe syntaxes as
9056         equivalent.
9057         (dirname) Rename blp_dirname() because of name conflict on some
9058         OS.  All references changed.  Reported by palme@uni-wuppertal.de
9059         (Hubert Palme).
9060         (is_special_filename) New function.
9061
9062         * get.c: (GTSV_OPT*) Add GTSV_OPT_MATCH_FILES.
9063         (trim_dictionary) Conditionalize some of the options on whether
9064         GTSV_OPT_MATCH_FILES is in *options.
9065         (rename_variables) Don't allow variables to be renamed as scratch
9066         variables.
9067         (MTF_*) New enum series.
9068         (struct mtf_file) New struct.
9069         (static vars mtf_head, mtf_tail, mtf_by, mtf_n_by, mtf_free) New
9070         vars.
9071         (cmd_match_files, mtf_free) New functions.
9072
9073         * lexer.c: (match_int) Needed parentheses around name to escape
9074         macro expansion.  Reported by Micah Altman
9075         <maltman@www-vdc.fas.harvard.edu>.
9076
9077         * print.c: Needed to include alloca.h.  Reported by Micah Altman
9078         <maltman@www-vdc.fas.harvard.edu>.
9079
9080         * recode.c: (convert_to_double) Parenthesize -DBL_MIN_10_EXP to
9081         -(DBL_MIN_10_EXP).  Reported by palme@uni-wuppertal.de (Hubert
9082         Palme).
9083         
9084         * str.h: Include stdarg.h.  Reported by palme@uni-wuppertal.de
9085         (Hubert Palme) and Micah Altman <maltman@www-vdc.fas.harvard.edu>.
9086
9087 Thu Feb  5 00:18:21 1998  Ben Pfaff  <blp@gnu.org>
9088
9089         * html.c: (struct html_driver_ext) Move into htmlP.h.
9090         (html_preopen_driver) Initialize cp_x, cp_y.
9091         (html_submit) Implement as call to output_tab_table().
9092         (change_attributes) New function.
9093         (escape_string) New function.
9094         (output_tab_table) New function.
9095
9096         * list.q: (write_all_headers) Add code for writing headers for the
9097         html driver.
9098         (clean_up) Write out the html close-table tag.
9099         (determine_layout) Ignore html driver.
9100         (list_cases) Write html data.
9101
9102         * som.c: (som_submit) Move more of the code into output_table().
9103
9104         * tab.c: (static var hit) Make a global var and rename tab_hit.
9105         (static var tab_table_class) Make a global var.
9106
9107         * htmlP.h: New file.
9108
9109 Tue Feb  3 16:12:18 1998  Ben Pfaff  <blp@gnu.org>
9110
9111         * dump-sysfile.c: Removed.
9112
9113         * html.c: (preclose) Change comment in emitted code.
9114
9115         * matrix-data.c: Debugging off by default.  Comment fixes.
9116         (static var container) New var.
9117         (cmd_matrix_data) Create and destroy container.  Initialize
9118         is_per_factor[] to 0s.  Move code into new function
9119         string_to_content_type().  Require split values to be present in
9120         the data when ROWTYPE_ is explicit.  Call specific function, not
9121         general read_matrices().
9122         (string_to_content_type) New function.
9123         (context) Exclude all whitespace, not just spaces.
9124         (mget_token) A dot is a number.  Add assertion.
9125         (static var data) Renamed nr_data.
9126         (static var factor_values) Renamed nr_factor_values.
9127         (read_matrices) Renamed read_matrices_without_rowtype().  Handle
9128         only specific case.  Close data_file before exit.
9129         (fill_matrix) New function.
9130         (read_data_lines) Renamed nr_read_data_lines().  Remove debug
9131         printing.  Style fixes.  Message fixes.  Move code into
9132         fill_matrix().
9133         (read_matrices_without_rowtype) Rename
9134         matrix_data_read_without_rowtype().  Fix off-by-one error on
9135         loops.  Allocate nr_data[] memory from arena.
9136         (read_matrices_with_rowtype) Removed.
9137         (read_splits) Renamed nr_read_splits().  Style fixes.
9138         (read_factors) Renamed nr_read_factors().
9139         (dump_cell_content) Comment fixes.  Arguments changed.  Change
9140         debug printing.  All references changed.
9141         (output_data) Renamed nr_output_data().
9142         (static var wr_content) New var.
9143         (struct factor_data) New struct.
9144         (static var wr_data) New var.
9145         (static var wr_current) New var.
9146         (matrix_data_source_destroy_source) Removed.
9147         (read_matrices_with_rowtype) New function.
9148         (matrix_data_read_with_rowtype) New function.
9149         (wr_read_splits) New function.
9150         (compare_factors) New function.
9151         (wr_output_data) New function.
9152         (wr_read_rowtype) New function.
9153         (wr_read_factors) New function.
9154         (wr_read_indeps) New function.
9155         (glob var matrix_data_source) Make destroy_source member NULL as
9156         well.
9157
9158 Fri Jan 23 00:09:08 1998  Ben Pfaff  <blp@gnu.org>
9159
9160         * lexer.c: (syntax_error) Give better error message when at end of
9161         file.
9162
9163         * matrix-data.c: (var content_names[]) Fix PROX spelling.  Change
9164         N_SCALAR to output as plain N.
9165         (mdump_token) Change output format.
9166         (context) Fix message output interaction with spaces in input.
9167         (another_token) New function.
9168         (force_eol) Improved error message.
9169         (static var max_cell_index) New var.
9170         (read_matrices) Init `cells'.  factor_values is now per-cell.
9171         Init max_cell_index.
9172         (read_data_lines) Replace `compare' local with new `compare' arg.
9173         Debugging messages changed.  Only read factors if per_factor.
9174         Propagate error return from read_factors(), force_eol().
9175         Copy N_SCALAR values across the N vector.
9176         (read_matrices_without_rowtype) Don't init `cells'.  Don't need to
9177         check parentheses manually since we now have is_per_factor[].
9178         Call read_data_lines() with new args.  Check for end of data after
9179         looping, using another_token().
9180         (read_factors) Arguments changed.  Use max_cell_index to determine
9181         whether to read or compare factors.  Message fixes.
9182         (dump_cell_content) New function.
9183         (output_data) Completely rewritten because content types were
9184         supported to be nested inside factor values, not vice versa.
9185         
9186 Thu Jan 22 00:26:38 1998  Ben Pfaff  <blp@gnu.org>
9187
9188         * lexer.c: (syntax_error) Support formatted varargs messages.
9189
9190         * matrix-data.c: Turn debugging on by default.
9191         (static content_type[]) New array.
9192         (static content_names[]) New array.
9193         (static rowtype_, varname_) New vars.
9194         (static is_per_factor[]) New array.
9195         (static split_values) Moved declaration.
9196         (static n_continuous, first_continuous) New var.
9197         (cmd_matrix_data) Don't init split_values.  Assign ROWTYPE_ to
9198         rowtype_.  Simplify SPLIT code.  Init is_per_factor[].  Assign
9199         VARNAME_ to varname_.  Initialize first_continuous, n_continuous.
9200         Check for continuous variables.
9201         [DEBUGGING] (debug_print) Remove content_names[].
9202         (mdump_token) New macro.
9203         (mget_token_dump) New function.
9204         (mdump_token) New function.
9205         (context) New function.
9206         (mget_token) Fix messages.
9207         (static var data, split_values, factor_values) New vars.
9208         (read_matrices) Manage split_values, factor_values.
9209         (read_data_lines) New function.
9210         (read_matrices_without_rowtype) Implemented.
9211         (read_splits) Message fixes.  Uses `just_read'.
9212         (read_factors) New function.
9213         (output_data) New function.
9214         (matrix_data_source_destroy_source) Close the file handle.
9215         (glob var matrix_source) Change name from "DATA LIST" to "MATRIX
9216         DATA".
9217
9218         * str.c: (strpadcmp) Removed.
9219
9220         * vfm.c: (dump_splits) Initialize i; fix test for end of splits.
9221
9222 Sun Jan 18 00:30:59 1998  Ben Pfaff  <blp@gnu.org>
9223
9224         * Lots of source files: Add cast to unsigned character to calls to
9225         tolower() and toupper().
9226
9227         * aggregate.c: Set default_dict.splits to NULL.
9228
9229         * command.c: (static variable tab[]) Add MATRIX DATA.
9230
9231         * data-in.c: Add debugging defines.  Formatting fixes.
9232
9233         * expr-opt.c: Formatting fixes.
9234
9235         * lexer.c: (syntax_error) Message fixes.
9236
9237         * matrix-data.c: New enum series.
9238         (static vars fmt, section, diag, explicit_rowtype, signle_split,
9239         split_values, n_factors, factors, cells, pop_n, contents,
9240         n_contents) New vars.
9241         (cmd_matrix_data) Finished implementation.
9242         (compare_variables_by_mxd_vartype) New function.
9243         [DEBUGGING] (debug_print) New function.
9244         (static vars mtoken, mtokstr, mtoklen, mtokval) New vars.
9245         (read_matrices) New function.
9246         (read_matrices_without_rowtype) New function.
9247         (read_matrices_with_rowtype) New function.
9248         (read_splits) New function.
9249         (mget_token) New function.
9250         (force_eol) New function.
9251         [0] (test_tokenizer) New function.
9252         (matrix_data_source_destroy_source) New function.
9253         (glob var matrix_data_source) New var.
9254
9255         * misc.h: Include ieeefp.h if present.
9256
9257         * split-file.h: (cmd_split_file) Changes corresponding to struct
9258         dictionary changes.
9259
9260         * str.h: Fix memmem prototype.
9261
9262         * temporary.c: (save_dictionary, restore_dictionary,
9263         free_dictionary) Changes corresponding to struct dictionary
9264         changes.
9265
9266         * var.h: (MXD_* enums) New enum series.
9267         (struct matrix_data_proc) New struct.
9268         (struct split) Removed.
9269         (struct dictionary) Changed `splits' member from `split *' to
9270         `variable **'.
9271         (macro force_create_variable) New macro.  Replaced lots of
9272         create_variable()/assert() calls with calls to this macro.
9273
9274         * vars-atr.c: (discard_variables) Changed assertion.
9275         [GLOBAL_DEBUGGING] (force_create_variable) New function
9276         called by the macro of the same name.
9277         (clear_variable) Changes to delete splits from the dictionary
9278         corresponding to struct dictionary changes.
9279
9280         * vars-prs.c: (parse_variables) [GLOBAL_DEBUGGING] Check for
9281         corrupted variable `index' values in the dictionary passed in
9282         every time this function is called.
9283
9284         * vfm.c: (dump_splits, SPLIT_FILE_procfunc) Changes corresponding
9285         to struct dictionary changes.
9286
9287 Tue Jan 13 23:45:02 1998  Ben Pfaff  <blp@gnu.org>
9288
9289         * Makefile.am: (pspp_SOURCES) Add matrix-data.c.
9290
9291         * command.c: New includes.
9292         (static array cmd_table[]) Add ERASE, HOST, NEW FILE.
9293         (cmd_erase) New function.
9294         [unix] (shell) New function.
9295         (run_command) New function.
9296         (cmd_host) New function.
9297         (cmd_new_file) New function.
9298
9299         * expr-prs.c: (parse_primary) Message fix.
9300
9301         * inpt-pgm.c: Formatting fix.
9302         (cmd_reread) Implement the FILE subcommand.
9303
9304         * matrix-data.c: New file.
9305
9306         * q2c.c: (dump_header) Change output commenting style.
9307
9308         * weight.c: Comment fix.
9309
9310 Tue Jan 13 00:53:39 1998  Ben Pfaff  <blp@gnu.org>
9311
9312         * aggregate.c: (buf64_10x) Renamed buf64_1xx, all references
9313         changed.
9314         (buf_10x) Renamed buf_1xx, all references changed.
9315         (cmd_aggregate) Implemented cases 010, 011, 110, and 111 (all
9316         cases now implemented).
9317         (create_sysfile) New function.
9318         (agr_11x_func) New function.
9319
9320         * data-in.c: (parse_numeric) Work properly if there's an
9321         explicitly coded decimal point in the data and decimal places are
9322         specified on DATA LIST.  Bug reported by Dr Eberhard W Lisse
9323         <el@linux.lisse.na>.
9324
9325         * get.c: (cmd_get, cmd_save_internal) Allow extraneous slash
9326         before file specification on GET, SAVE, XSAVE.  Bug reported by Dr
9327         Eberhard W Lisse <el@linux.lisse.na>.
9328
9329         * q2c.c: [!HAVE_STRERROR] Include misc/strerror.c, not
9330         strerror.c.  Bug reported by Alexandre Oliva
9331         <oliva@dcc.unicamp.br>.
9332
9333         * sort.c: Include sort.h.  Comment fixes.  A few esthetic fixes.
9334         (static var separate_case_tab) New var.
9335         (cmd_sort_cases) Cancel temporary transformations here.  Free
9336         v_sort before return.
9337         (sort_cases) Run an EXECUTE procedure if SEPARATE is nonzero and
9338         we're reading from a sort stream.  Don't cancel temporary
9339         transformations.  Offload internal sorting to do_internal_sort().
9340         (do_internal_sort) New function.  Handles internal sorting even
9341         when SEPARATE is nonzero.  Doesn't free v_sort.
9342         (do_external_sort) Take new arg SEPARATE.  Only destroy `x' if
9343         it's non-NULL.
9344         (write_initial_runs) Take new arg SEPARATE.  Only destroy the old
9345         sink if SEPARATE is zero.
9346         (read_output_cases) Renamed read_sort_output(), all references
9347         changed.  Now uses separate_case_tab when it exists.
9348         (write_separate) New function.
9349
9350         * vfm.c: (page_to_disk) Destroy memory_source_cases, not
9351         memory_sink_cases.  Don't redundantly call
9352         vfm_source->destroy_source().
9353         (memory_stream_mode) After switching over, set memory_sink_cases
9354         to NULL.
9355
9356 Sat Jan 10 23:35:51 1998  Ben Pfaff  <blp@gnu.org>
9357
9358         * aggregate.c: (struct agr_var) Expand dbl[] array from 2 to 3
9359         elements.
9360         (static var prev_case) New, moved out of aggregate_single_case()
9361         local scope.
9362         (static var buf64_10x, buf_10x) New.
9363         (cmd_aggregate) Initialize prev_case.  Comment fixes.  Implement
9364         the 000, 001, 100, and 101 cases.  Free prev_case.
9365         (parse_aggregate_functions) Disallow scratch variables.
9366         (free_aggregate_functions) Only free agr_dict if non-null.  Use
9367         iter->function to determine numeric/string type, not
9368         iter->src->type.
9369         (aggregate_single_case) Don't manage prev_case.  Initialize
9370         aggregate info after dumping it.
9371         (accumulate_aggregate_info) Fix sum, weighted sum, mean, weighted
9372         mean, stddev, weighted stddev definitions.
9373         (dump_aggregate_info) Implemented.
9374         (initialize_aggregate_info) Renamed from
9375         initialize_aggregate_functions().  Initializes dbl[2].
9376         (agr_00x_trns_proc, agr_00x_end_func, write_case_to_sfm,
9377         agr_10x_trns_proc, agr_10x_trns_free, agr_10x_end_func) New.
9378
9379         * cases.c: (alloc_val) Removed.
9380
9381         * get.c: (cmd_save_internal) Initialize new `dict' member.
9382
9383         * sfm-write.c: (sfm_write_dictionary, write_header,
9384         write_variable, write_value_labels, write_documents) Reorganize,
9385         simplify for new parameter structure.
9386         (write_variable) Only one variable * argument now.
9387
9388         * sfm.h: (struct sfm_write_info) Removed `pri', `sec', and
9389         replaced by new `dict' member.
9390
9391         * temporary.c: (new_dictionary) Initialize n_documents.
9392
9393         * vars-atr.c: (dup_variable) Allocate `value's from dict into
9394         v->fv manually.
9395         (init_variable, replace_variable) Eliminate usage of alloc_val().
9396
9397         * vars-prs.c: (parse_DATA_LIST_vars) Accept PV_NO_SCRATCH option.
9398
9399         * vfm.c: (arrange_compaction) Allow `temporary' value of 2 to
9400         signal that AGGREGATE is to be used for forming final cases.
9401         (close_active_file) Call end_func before stopping lagging.  Cancel
9402         temporary after finishing compaction.
9403         (write_case) Comment fixes.  Cleaned up.
9404         (compact_case) Let AGGREGATE handle compaction when `temporary' is
9405         2.
9406
9407 Sat Jan 10 02:10:47 1998  Ben Pfaff  <blp@gnu.org>
9408
9409         * Makefile.am: (BUILT_SOURCES) Add means.c.
9410         (pspp_SOURCES) Add means.c.
9411         (EXTRA_DIST) Add means.q.
9412
9413         * command.c: (array cmd_table[]) Add MEANS.
9414
9415         * common.h: Esthetic fixes.  Comment fixes.  Test for
9416         MAX_SHORT_STRING greater than 8.
9417         (macros LOWEST, HIGHEST) New.
9418
9419         * data-in.c, data-list.c, recode.c: Comment fixes.
9420
9421         * means.q: New file, base version.
9422
9423         * mis-val.c: (parse_num_or_range, parse_numeric) Replace -DBL_MAX
9424         with LOWEST, DBL_MAX with HIGHEST.
9425
9426         * q2c.c: (dump_vars) Add an enum to array types giving the number
9427         of values for the enum.
9428
9429         * sfm-read.c: (sfm_read_dictionary, read_machine_flt64_info)
9430         Replace second_lowest_value with second_lowest_flt64.
9431
9432         * sfm-write.c: (write_variable, write_rec_7_34) Replace
9433         second_lowest_value with second_lowest_flt64.
9434
9435         * t-test.q: Comment fix.
9436
9437         * temporary.c: (restore_dictionary) Esthetic fix.
9438
9439         * tokens.h: (force_match_id, force_match, force_string, force_int,
9440         force_num, force_id) Replace msg() with syntax_error().
9441
9442         * var.h: (struct means_proc) New.
9443         (struct variable) Add mns member to `p' union.
9444
9445         * vars-prs.c: (parse_variable, parse_dict_variable,
9446         parse_variables, parse_DATA_LIST_vars) Replace msg() with
9447         syntax_error().
9448
9449 Thu Jan  8 22:28:41 1998  Ben Pfaff  <blp@gnu.org>
9450
9451         * Makefile.am: (pspp_SOURCES) Add tab.h.
9452
9453         * Most source files: Added a cast to unsigned char in usages of
9454         the ctype is*() functions.  Replaced `end of command expected'
9455         calls to msg() with calls to syntax_error().
9456
9457         * frequencies.q: (dump_condensed) Fix tab_dim() column reference.
9458
9459         * lexer.c: (hex_val) Removed (was dead code).
9460         (idmatch) Parenthesize function name to avoid macro expansion.
9461
9462         * postscript.c: Comment fixes.
9463         (ps_preopen_driver) Change default font size to 10pt.
9464
9465         * sfm-read.c: (read_variables) Byteswap sv.print, sv.write as
9466         int32s.
9467         (parse_format_spec) Change system-file format spec argument type
9468         to int32.  Parse the format spec with bitwise operators.
9469
9470         * sfmP.h: (struct sysfile_format) Removed.
9471         (struct sysfile_variable) Changed print, write members from
9472         sysfile_format to int32.
9473
9474         * tokens.h: Esthetic fixes.
9475         [__GNUC__] (macro id_match) New macro to hopefully speed up
9476         identifier matching.
9477         (macros match_id, match_tok, match_int) Implemented in
9478         compiler-independent manner; no longer GNU C only.
9479
9480         * vfm.h: Include time.h.
9481
9482 Mon Jan  5 11:06:15 1998  Ben Pfaff  <blp@gnu.org>
9483
9484         * data-list.c: (dump_fixed_table) Change tab_dim().
9485
9486         * dump-sysfile.c: (open_sysfile) Fix mmap() call.
9487
9488         * error.c: Include command.h.
9489
9490         * frequencies.g: Formatting fixes.
9491
9492         * frequencies.q: Add tab_dim() calls.  Make the total cell a
9493         joined cell.
9494
9495         * glob.c: Include command.h.
9496
9497         * sfm-read.c: (struct sfm_fhuser_ext) New members sysmis, highest,
9498         lowest.
9499         (sfm_read_dictionary) Initialize sysmis, highest, lowest.
9500         (sfm_read_machine_flt64_info) Update sysmis, highest, lowest.
9501         (read_variables) Byteswap sv.type; byteswap sv.print, sv.write as
9502         the other elements (is this right?).
9503         (read_variables) Use lowest, highest members.
9504         (parse_format_spec) New arg `vv' for more stringent checking.
9505         (dump_dictionary) Byteswaps nonexplicit data.
9506         (sfm_read_case) Byteswap numeric data.
9507
9508         * som.c: Initialize table_num to 1.
9509         (render_segments) Remember to increment y_index after each table
9510         segment.
9511
9512         * sysfile-info.c: (cmd_sysfile_info) Change tab_dim().  Don't call
9513         avl_count() on a NULL tree.  No title for the second table.
9514         (cmd_display) Handle DISPLAY VECTORS by calling display_vectors().
9515         Handle AS_SCRATCH as AS_NAMES.  Warn if no variables.  Re-enable;
9516         fix call to display_variables().
9517         (display_variables) Default to 4 columns, not 3.  Set up headers.
9518         Column title is Variable, not Name.  Fix index column.
9519         Add joint text.  Add tab_dim().  Handle value labels properly.
9520         Handle DISPLAY LABELS properly.  Draw boxes correctly.
9521         (describe_variable) Value labels don't need titles.  Don't clear
9522         nonexistent index column.
9523         (compare_vectors_by_name) New function.
9524         (display_vectors) New function.
9525
9526         * tab.c: (tab_height) Add assertion.
9527         (tab_null) Add debug code.
9528         (evaluate_dimensions) Add debug code.
9529
9530         * var.h: (struct variable) get_proc data is sometimes used
9531         simultaneously with other per-procedure info, therefore it was
9532         removed from the union.  All references changed.        
9533
9534 Sun Jan  4 18:13:33 1998  Ben Pfaff  <blp@gnu.org>
9535
9536         * ascii.c: (ascii_close_page) Put title on second line of headers
9537         if there is no subtitle.
9538
9539         * command.c: (glob var cur_proc) Move definition here, from
9540         common.c.
9541         (cmd_remark) Emit blank line before remarks.
9542
9543         * command.h: (glob var cur_proc) Move declaration here, from
9544         common.h.
9545
9546         * data-list.c: (dump_fixed_table) Fix messages.
9547         (dump_free_table) Call tab_nat_dim().
9548
9549         * descript.q: (dump_z_table) Modify tab_dim() call.
9550
9551         * frequencies.q: (dump_condensed, dump_statistics) Add tab_dim()
9552         call.
9553         (dump_statistics) Don't output header.
9554
9555         * groff-font.c: Minor format fix.
9556
9557         * html.c: Comment fix.
9558
9559         * list.q: (write_varname) Indent after advancing page.
9560
9561         * output.h: Minor reordering.
9562
9563         * postscript.c: Comment fixes.  Many places, '\n' was replaced by
9564         a reference to eol[].
9565         (struct ps_driver_ext) New member eol[].
9566         (ps_preopen_driver) Initialize eol[].
9567         (ps_postopen_driver) Fix sense of text for text_opt, line_opt
9568         defaults.  Handle headers.  Fix test for minimum page length.
9569         (static var option_tab[]) Add `line-ends'.
9570         (ps_option) Handle line-ends to change eol[].
9571         (postopen) Scale prop_em_width and fixed_width properly.  Set the
9572         prologue title to outp_title if applicable.  Replace the prologue
9573         line ends with eol[].  Call draw_headers() if headers are enabled.
9574         (text_width) New function.
9575         (out_text_plain) New function.
9576         (draw_headers) New function.
9577
9578         * print.c: (dump_table) Call tab_nat_dim().
9579
9580         * som.c: (som_blank_line) Only advance a line if not at the top of
9581         a page.
9582         (som_submit) Move several informational table calls here.
9583         Increment subtable_num if SOMF_NO_TITLE not set.
9584         (output_table) Advance a line if SOMF_NO_SPACING not set.
9585         (render_columns, render_segments, render_simple) Handle spacing
9586         between tables.  Handle table titles.  Remove debug output.
9587
9588         * som.h: (SOMF_*) New enum series.
9589         (struct som_table_class) New member `flags'.
9590
9591         * sysfile-info.c: (cmd_sysfile_info) Calls tab_nat_dim().  No
9592         headers or spacing.
9593         (display_variables) Calls tab_nat_dim().
9594         (describe_variable) Remove restriction on number of value labels.
9595         Make value labels separated by thin lines.
9596
9597         * tab.c: (tab_create) Default `flags' to none.
9598         (tab_float) New arg `w'.  All references changed.
9599         (tab_nat_dim) New function.
9600         (tab_output_text) No title or spacing.
9601         (tab_flags) New function.
9602         (tabi_flags) New function.
9603         (tabi_title) New function.
9604         (strip_height) Removed.
9605         (tabi_render) Skip title when necessary.
9606         (static var tab_tab_class) Add tabi_flags, tabi_title.
9607         (evaluate_dimensions) Disable display of column, row size.
9608         (sum_columns) Add title height to top header.
9609         (render_strip) Moved within file.
9610
9611         * tab.h: (struct tab_table) New member `flags'.
9612
9613         * vfm.c: (dump_splits) Calls tab_nat_dim().  No title.
9614
9615 Sat Jan  3 16:55:44 1998  Ben Pfaff  <blp@gnu.org>
9616
9617         * Most source files: Add `const' attribute in all appropriate
9618         places.
9619         
9620         * sysfile-info.c: (cmd_sysfile_info) Add tab_dim() call, add a
9621         column to the variables table for use by describe_variable().
9622         (cmd_display) Disable for the present.
9623         (display_documents) Don't wrap documents.
9624         (display_variables) Table has four columns now.
9625         (describe_variable) Table has four columns now.  Don't use a
9626         subtable, use joined cells instead.
9627
9628         * tab.c: (tab_create) Don't set `join'.
9629         (tab_realloc) ct array is not made up of a_string's.
9630         Reallocate trh, hrh, h arrays, initialize trh array.  Initialize
9631         cell contents on GLOBAL_DEBUGGING, not DEBUGGING.
9632         (text_format) New function.
9633         (tab_title) Rewritten, uses text_format().
9634         (tab_text) Rewritten, uses text_format().
9635         (tab_joint_text) New function.
9636         (tab_join) Removed.
9637         (static var hit) New variable.
9638         (render_strip) New args r1, r2.  Implement joined cells that fit
9639         on a single page.
9640         (tabi_render) Increment hit.  Pass new args to render_strip().
9641         (evaluate_dimensions) [GLOBAL_DEBUGGING] Check for uninitialized
9642         cells.  For t_naw and t_nah, ignore joined cells and null cells in
9643         calculations.
9644         
9645         * tab.h: (struct tab_join_rect) Removed.
9646         (struct tab_table) Removed `join'.
9647         (TAB_JOIN_MAIN) Removed.
9648         (struct tab_joined_cell) New struct.
9649         (TAT_NOWRAP) New enum.
9650
9651 Fri Jan  2 01:39:58 1998  Ben Pfaff  <blp@gnu.org>
9652
9653         * ascii.c: (ascii_postopen) Replace ASCII_* macros with their
9654         expansions.
9655         (ascii_postopen_driver) Fix initialization of *_spacing so that
9656         the TAL_0 bit doesn't count.
9657
9658         * data-list.c: (dump_fixed_table) Use natural width for Format
9659         column.
9660
9661         * glob.c: (rerange) Removed.
9662         (get_date) Formatting fixes.  Internationalization fix.
9663
9664         * html.c: (html_postopen_driver) Replace HTML_DEFAULT_OUTPUT_FILE
9665         with "pspp.html".
9666
9667         * postscript.c: (ps_postopen_driver) Replace
9668         PS_DEFAULT_OUTPUT_FILE with "pspp.ps".
9669
9670         * som.c: (som_submit) Don't eject page before every table.
9671         (output_table) Fix order of arguments on call to area().
9672         (render_columns) Fix calculation of max_len.
9673         
9674         * tab.c: (tabi_cumulate) Minor change to increase elegance.
9675         (render_strip) New function.
9676         (strip_height) New function.
9677         (tabi_render) Rewrite as calls to render_strip().
9678
9679         * tab.h: (TAT_* enums) Removed TAT_RICH, all references removed.
9680         Renumbered TAT_PRINTF, TAT_TITLE, TAT_FIX to correspond better
9681         with the TAB_* and OUTP_T_* constants.
9682         
9683 Thu Jan  1 11:53:52 1998  Ben Pfaff  <blp@gnu.org>
9684
9685         * Makefile.am: Formatting fixes.
9686
9687         * ascii.c: (ascii_postopen_driver) Initialize *_line_spacing[],
9688         *_line_width[].
9689
9690         * data-list.c: (dump_fixed_table) Add tab_dim() call.
9691
9692         * descript.q: (dump_z_table, display) Add tab_dim() calls.
9693
9694         * dump-sysfile.c: (glob var length) Make type off_t.
9695         (usage) Fix arguments.
9696         (main) Return 0.
9697
9698         * output.h: (OUTP_T_*) Change constants' value to match tab.h.
9699         Now right-justification is the default so many references had to
9700         change.
9701         (struct outp_class) Removed line_width, all references changed.
9702         (OUTP_DEV_*) Add OUTP_DEV_DISABLED.
9703         (struct outp_driver) Add elements horiz_line_width,
9704         vert_line_width, horiz_line_spacing, vert_line_spacing.  Remove
9705         som element.
9706
9707         * postscript.c: (outp_encodings) Formatting fixes.  Fix garbage
9708         collection.
9709         (postopen) Initialize all the informational members of
9710         outp_driver.
9711
9712         * som.c: (som_blank_line) New function, renamed from blank_line(),
9713         all references changed.
9714         (som_submit) Disables drivers whose pages can't be opened.
9715         (render_columns, render_simple, render_segments) Add debug output.
9716         (render_columns) Fix loop range.
9717         (render_simple) Don't try to render the headers, they're taken
9718         care of automatically.  Advance cp_y past the table when done.
9719         (render_segments) Fix loop ranges.
9720
9721         * tab.c: Initialize new members of tab_table.
9722         (tab_vline) Handle trv[]; don't set style for spacing-only lines.
9723         (tab_hline) Handle trh[]; don't set style for spacing-only lines.
9724         (tab_box) Handle trh[], trv[]; don't set style for spacing-only
9725         lines.
9726         (set_expr) Removed.
9727         (tab_dim) New function.
9728         (tab_col_width) Removed.
9729         (tab_row_height) Removed.
9730         (tab_output_text) Call tab_dim().
9731         (tabi_driver) Call evaluate_dimensions(), sum_columns().
9732         (tabi_area) Implemented.
9733         (tabi_cumulate) Implemented.
9734         (tabi_render) Partially implemented, but broken.
9735         (var tab_table_class) Made static.
9736         (evaluate_dimensions) New function.
9737         (sum_columns) New function.
9738
9739         * tab.h: (enum t_*) Now start at t_end.  New: t_ptw, t_nr, t_nc,
9740         t_nah, t_naw, t_neg, t_xch, t_dup, t_lbl, t_jnz, t_sac, t_sar,
9741         t_scr, t_srr, t_sentinel.  Removed: t_nat.
9742         (struct tab_table) New: wl, wr, ht, hb, trh, hrh, trv, wrv, dim,
9743         max_stack_height, w, h.  Removed: ce, re.
9744         (macro blank_line) Removed.
9745         (glob var zero_length) Removed.
9746
9747 Fri Dec 26 15:44:31 1997  Ben Pfaff  <blp@gnu.org>
9748
9749         * Most source files: include some of the new include files broken
9750         out of var.h.
9751         
9752         * Makefile.am: (pspp_SOURCES) Add all the new source files to the
9753         list.
9754
9755         * aggregate.c: (glob var outfile) Make static.
9756
9757         * command.c: (glob var pgm_state) Move here.
9758
9759         * common.c: (glob vars endian, second_lowest_value, pgmname,
9760         finished, curdate, cur_proc, start_interactive, history_file) Move
9761         here.
9762
9763         * descript.q: (structs dsc_z_score, descriptives_trns) Move here.
9764
9765         * file-handle.q: (glob vars files, inline_file) Move here.
9766
9767         * glob.c: Lost lots of glob vars, detailed in individual file
9768         entries.
9769         (init_glob) set_printer, set_screen were obsolete, deleted.
9770         set_cprompt has fewer spaces because pspp has fewer letters than
9771         fiasco.
9772
9773         * inpt-pgm.c: (glob vars inp_init, inp_init_size) Move here.
9774         (inp_nval) Made static.
9775
9776         * lexer.c: (glob vars token, tokval, tokstr, tokstr_size,
9777         tokstr_len, toklongstr, tokint) Move here.
9778
9779         * misc.c: Lost several vars and functions.
9780
9781         * set.q: (all the set_* variables) Move here.
9782
9783         * str.c: (strmaxcpy, strbarepadcpy, strbarepadlencpy, strpadcpy,
9784         blpstrset, strpadcmp, memrev, memrmem, cmp_str) Move here from
9785         misc.c.
9786
9787         * tab.c: (set_expr, tab_col_width, tab_row_height) New functions.
9788
9789         * tab.h: (enum series t_*) New enums.
9790         (struct tab_table) Use arena struct tag.  New members ce, re.
9791
9792         * tokens.h: Comment fixes.
9793
9794         * var.h: Move lots of enums and variables and functions and
9795         structures to other files.  Use and declare a lot more union and
9796         struct tags.  Comment fixes.  
9797
9798         * vector.c: (glob vars vec, nvec) Move here.
9799
9800         * vfm.c: (glob vars reinit_sysmis, reinit_blanks, init_zero,
9801         init_blanks, last_vfm_invocation) Move here.
9802
9803         * cases.h: New file.
9804         (struct long_vec) Move here.
9805         (vec_init, vec_clear, vec_insert, vec_delete, devector, envector)
9806         Move here.
9807
9808         * command.h: New file.
9809         (STATE_* enums) Move here.
9810         (glob var pgm_state) Move here.
9811
9812         * format.c: New file.
9813         (glob var formats) Move here.
9814         (parse_format_specifier_name, fmt_to_string,
9815         check_input_specifier, check_output_specifier,
9816         check_string_specifier, convert_fmt_ItoO, parse_format_specifier)
9817         Move here.
9818
9819         * format.h: New file.  Move functions now in format.c here.
9820         (FMT_* enums) Move here.
9821         (struct fmt_desc) Move here.
9822         (FCAT_* enums) Move here.
9823         (struct fmt_spec) Move here.
9824         (glob vars formats, fmt_parse_ignore_error) Move here.
9825
9826         * inpt-pgm.h: New file.
9827         (INP_* enums) Move here, make #defines into enums.
9828         (glob vars inp_init, inp_init_size) Move here.
9829
9830         * sort.h: New file.
9831         (glob vars v_sort, nv_sort) Move here.
9832         (sort_cases, read_sort_output) Move here.
9833
9834         * vector.h: New file.
9835         (struct vector) Move here, add struct tag.
9836         (glob vars vec, nvec) Move here.
9837         (find_vector) Move here.
9838
9839         * New file.
9840         (glob vars last_vfm_invocation, temp_case, reinit_sysmis,
9841         reinit_blanks, init_zero, init_blanks) Move here.
9842         (struct case_stream) Move here.
9843         (glob vars vfm_source, vfm_sink, vfm_memory_stream,
9844         vfm_disk_stream, sort_stream, data_list_source,
9845         input_program_source, file_type_source, get_source, n_lag) Move
9846         here.
9847         (procedure, write_case, lagged_case, compact_case, page_to_disk)
9848         Move here.
9849                 
9850 Wed Dec 24 22:40:42 1997  Ben Pfaff  <blp@gnu.org>
9851
9852         * Makefile.am: (pspp_SOURCES) Added html.c, som.c, som.h.
9853         (LDADD) Add libdcdflib.
9854
9855         * ascii.c: Comment and formatting fixes.  Almost every external
9856         function had an assert added, checking driver_open and page_open.
9857         (ascii_init_driver) Broken into ascii_preopen_driver,
9858         ascii_postopen_driver, ascii_close_driver.  Manages driver_open.
9859         (ascii_open_page) Sets page_open.
9860         (ascii_close_page) Clears page_open.
9861
9862         * html.c: Comment and formatting fixes.  Almost every external
9863         function had an assert added, checking driver_open and page_open.
9864         (html_init_driver) Broken into html_preopen_driver,
9865         html_postopen_driver, html_close_driver.  Manages driver_open.
9866         (html_open_page) Sets page_open.
9867         (html_close_page) Clears page_open.
9868         (html_submit) Disabled.
9869
9870         * lexer.c: (parse_string) Remove debugging printf.
9871
9872         * list.q: (determine_layout) Open a page if one is not yet open.
9873
9874         * output.c: Comment fixes.
9875         (add_class) Set the class member of the new list element.
9876         (parse_options) Don't handle device type.
9877         (colon_tokenize) New function.
9878         (configure_driver) New four-field format with a field for device
9879         type.  Now initialize driver_open, page_open, next, and prev
9880         fields.  Use new colon_tokenize() function.  Don't do a memory
9881         copy to replace a driver, it doesn't work; instead delete the old
9882         driver and insert a new one.
9883         (destroy_driver) Don't call som_destroy_driver().  Close the page
9884         if it's open.  Find the class in the list of classes and decrement
9885         that reference count.  Remove the driver from the global driver
9886         list.
9887         (outp_iterate_enabled_drivers) Renamed outp_drivers().  All
9888         references changed.  Rewritten.  Don't return a driver that's not
9889         enabled.
9890         (outp_eject_page) All references to som_internal_eject_page()
9891         changed to use this.  Sets cp_x to 0 as well as cp_y.
9892
9893         * output.h: (OUTP_I_* enums) Removed.
9894         (struct som_submission_form) Removed.
9895         (struct outp_class) init_driver broken into preopen_driver,
9896         postopen_driver, and close_driver.  submit changed to take a
9897         som_table argument.
9898
9899         * postscript.c: Comment and formatting fixes.  Almost every
9900         external function had an assert added, checking driver_open and
9901         page_open.
9902         (ps_init_driver) Broken into ps_preopen_driver,
9903         ps_postopen_driver, ps_close_driver.  Manages driver_open.
9904         (ps_open_page) Sets page_open.
9905         (ps_close_page) Clears page_open.
9906
9907         * som.c: New file, base implementation.
9908         
9909         * som.h: (struct som_table) Add struct tag.
9910         (enum SOM_COL_ACROSS) Removed.
9911         (SOM_ROWS, SOM_COLUMNS) New enums.
9912         (struct som_table_class) Add member `cumulate'.  Remove `segment';
9913         change `render' arguments.
9914         (struct som_point, struct som_rect) Removed.
9915         (som_submit_table) Fixed typo, should have been som_submit.
9916
9917         * sysfile-info: (describe_variable) Don't try to insert a
9918         subtable; just destroy it for now.
9919
9920         * t-test.q: Include dcdflib/cdflib.h instead of cdflib.h.  Fix
9921         references to value labels.
9922
9923         * tab.c: (tab_destroy) New function.
9924         (tab_columns) Change argument.
9925         [0] (tab_submit) Remove dead code.
9926         (tab_title) Allocate string from the table's arena.
9927         (tab_output_text) Only free the buffer if we allocated it.
9928         (tab_submit) New function.
9929         (static vars t, d) New static vars.
9930         (tabi_table, tabi_driver, tabi_count, tabi_area, tabi_columns,
9931         tabi_headers, tabi_cumulate, tabi_render) New functions.
9932         (glob var tab_table_class) New global var.
9933
9934         * tab.h: (struct tab_join_rect) Don't use a som_rect; directly
9935         encapsulate the rectangle.  All references changed.
9936         
9937 Sun Dec 21 16:18:58 1997  Ben Pfaff  <blp@gnu.org>
9938
9939         * All header files updated to use struct tags in addition to
9940         typedefs for all structures.  Don't use word `struct' in struct
9941         tags.
9942         
9943         * Makefile.am: (pspp_SOURCES) Remove html.c.
9944         (INCLUDES) Replace the lib/* includes with a single lib/ include;
9945         all references updated.
9946
9947         * command.c: (parse_cmd) Remove call to som_check_workspace.
9948         (output_line) Update to new som.
9949
9950         * data-in.c: (parse_numeric) A single dot is not an error; it is
9951         the system-missing value.
9952
9953         * data-list.c: (dump_fixed_table, dump_free_table) Update to new
9954         som.
9955
9956         * data-out.c: Added `const' as appropriate to many prototypes.
9957         (convert_E, convert_F, convert_CCx) Take double argument instead
9958         of value * argument.
9959         (convert_format_to_string) Call changed functions appropriately.
9960         Instead of modifying the caller's value for FCAT_SHIFT_DECIMAL,
9961         make a local copy of the value.
9962
9963         * descript.q: Remove custom_variables() prototype now provided by
9964         q2c.  
9965         (custom_variables) Don't increment sbc_variables, the caller does
9966         this.
9967         (dump_z_table, display) Update to new som.
9968
9969         * error.c: (vmsg) Add const to prototype.  Remove code to handle
9970         `too many errors' condition.
9971         (check_error_count) New function.
9972         (msg) Add const to prototype.
9973
9974         * filename.c: (open_file) Rewrite for elegance.
9975
9976         * frequencies.q: Remove custom_*() prototypes now provided by q2c.
9977         (dump_full, dump_condensed, dump_statistics) Update for new som.
9978
9979         * list.q: Don't include somP.h.  Change all references to
9980         som_driver_ext to refer to the new members of som_driver.  Change
9981         som_internal_eject_page() references to outp_eject_page().
9982
9983         * main.c: (parse) Rewrite for elegance.  Add call to
9984         check_error_count().
9985
9986         * output.c: (add_class, outp_list_classes, outp_configure_driver)
9987         Rewrite or revise for new outp_driver_class_list structure.
9988         (outp_iterate_enabled_drivers) Fix comparison between disabled
9989         devices and current device type.
9990         (outp_eject_page) New function.
9991
9992         * output.h: Comment fixes.
9993         (struct outp_driver) New members driver_open, page_open, cp_x,
9994         cp_y, font_height, prop_em_width, fixed_width.  Deleted members
9995         ref_count, next.
9996         (struct outp_driver_class_list) New struct.
9997         (outp_class_list) Changed to type outp_driver_class_list; all
9998         references updated.
9999
10000         * print.c: (dump_table, print_trns_proc) Updated for new som.
10001
10002         * q2c.c: (dump_vars) Simplify array subcommand code.  Declare
10003         prototypes for custom subcommands.
10004         (dump_subcommand) Always include the `else'.
10005         (dump_parser) Fix comments in output code.
10006
10007         * set.q: Reordered functions.
10008
10009         * som-frnt.c, som-high.c, som-low.c, somP.h: Removed.
10010         
10011         * som.h: Rewritten from scratch.
10012
10013         * str.h: Remove dead code.
10014
10015         * tab.c, tab.h: New files, base implementation.
10016
10017         * sysfile-info.c: (cmd_sysfile_info, describe_variable) Update to
10018         new som.
10019
10020         * t-test.q: New code from John Williams
10021         <johnr.williams@stonebow.otago.ac.nz>.  Include math.h, cdflib.h.
10022         Many many new static vars and defines.
10023         (precalc, postcalc, g_postcalc, z_postcalc, t_pairs, t_groups,
10024         groups_calc, pairs_calc, z_dev_calc, z_calc) New functions.
10025         (struct value_list) New struct.
10026         (variance, covariance, pooled_variance, oneway, pearson_r, f_sig,
10027         t_crt, t_sig, print_t_groups) New functions.
10028         (cmd_t_test) Implemented.
10029
10030         * temporary.c: (cancel_temporary) Only free the temp_dict if it's
10031         non-NULL.
10032
10033         * vfm.c: (dump_splits) Update to new som.
10034
10035 Thu Dec  4 23:02:22 1997  Ben Pfaff  <blp@gnu.org>
10036
10037         * Makefile.am: (fiasco_SOURCES) Add html.c.
10038
10039         * aggregate.c: Base source.
10040
10041         * ascii.c: (postopen, preclose) Reformat.
10042
10043         * data-out.c, expr-evl.c: Comment fixes.
10044         
10045         * filename.c: (open_file) When opening a file for writing, use
10046         line buffering instead of full buffering for better interactive
10047         performance.  Suggested by Valerio Aimale
10048         <valerio@svpop.com.dist.unige.it>.  Also, recognize special file
10049         names `stdin', `stdout', `stderr'.
10050
10051         * groff-font.c: Comment fixes.
10052
10053         * html.c: New file; base version.
10054
10055         * list.q: (write_all_headers, clean_up, determine_layout,
10056         list_cases) Ignore `special' devices for now.  Needs to be fixed
10057         later.
10058
10059         * output.c: (outp_init) Add html driver to list; reverse list
10060         order.
10061
10062         * output.h: (struct outp_class_struct) New members `special',
10063         `submit'; comment fixes.  All references changed.
10064
10065         * postscript.c: (ps_init_driver) Make defaults for text_opt,
10066         line_opt depend on whether the OUTP_DEV_SCREEN bit is set on the
10067         device.
10068         (postopen) Comment fix.
10069         (preclose) Comment fixes, formatting fixes.  Change x->file.file
10070         references to more proper f->file.
10071
10072         * som-high.c: (som_submit_table) Special classes use their own
10073         renderers.
10074
10075         * som.h: Comment fixes.
10076
10077         * temporary.c: (new_dictionary) Don't try to xstrdup() a NULL
10078         string.
10079         
10080 Tue Dec  2 14:36:07 1997  Ben Pfaff  <blp@gnu.org>
10081
10082         * Makefile.am: (fiasco_SOURCES) Add aggregate.c back in.
10083
10084         * aggregate.c: Still working on this.
10085
10086         * command.c: (cmd_table[]) Add AGGREGATE back in.
10087         (split_words) Make '-' a legal word separator as well as ' '.
10088
10089         * main.c: Comment fixes.
10090
10091         * q2c.c: (dump_parser) Don't require the procedure's full name to
10092         be present, in the generated source.
10093
10094         * t-test.q: Change name to `t-test' from `t test'.  Let PAIRS be
10095         multiply specified and let it be default; let MISSING, CRITERIA,
10096         FORMAT be multiply specified.
10097         (cmd_t_test) Parse command name.  [DEBUGGING] Call debug_print().
10098         (custom_groups) Fix defaults.
10099         (custom_pairs) Check whether this is a PAIRS subcommand before
10100         attempting to parse.  Better garbage collection.  Proper storage
10101         allocation.
10102         [DEBUGGING] (debug_print) New function.
10103
10104         * temporary.c: Comment fixes.
10105         (copy_variable) Don't copy variable name and index.
10106         (save_dictionary) Copy variable name and index by hand.
10107
10108         * vars-atr.c: Comment fixes.
10109         (create_variable) New dictionary argument.  All references
10110         changed.
10111         (common_init_stuff) New dictionary argument.  All references
10112         changed.
10113         (init_variable) New dictionary argument.  All references changed.
10114         (dup_variable) New function.
10115
10116         * vars-prs.c: (parse_variables) If there are any errors, we always
10117         return 0.  Previously, it was possible for some types of errors to
10118         be ignored.
10119         
10120 Sat Nov 22 01:20:59 1997  Ben Pfaff  <blp@gnu.org>
10121
10122         * Makefile.am: (fiasco_SOURCES) For 0.1.5 release, remove
10123         aggregate.c.
10124
10125         * command.c: (cmd_table[]) Comment out AGGREGATE; add T TEST.
10126
10127         * list.q, t-test.q: Remove ALL option from VARLIST declaration in
10128         grammar rules.
10129
10130         * q2c.c: Comment fixes.
10131         (SBC_* enums) Remove SBC_VARLIST_ALL; all references removed.
10132         
10133         * t-test.q: (cmd_list) Rename cmd_t_test.
10134
10135         * temporary.c: (new_dictionary) Don't declare as static.
10136         
10137 Fri Nov 21 00:03:06 1997  Ben Pfaff  <blp@gnu.org>
10138
10139         * aggregate.c: Changes, still not finished.
10140
10141         * file-handle.q, frequencies.q, list.q, set.q: Comment fixes.
10142
10143         * q2c.c: Comment fixes.  Now its output is internationalized.
10144         (get_token) Fix parsing of escapes within literal strings.
10145         (main) Fix bad #line directives in output.
10146
10147         * t-test.q: Base implementation.
10148
10149         * temporary.c: (new_dictionary) New function.
10150         (restore_dictionary) [__CHECKER__] Change fill character to *
10151         (from @).
10152         
10153 Sun Nov 16 01:29:57 1997  Ben Pfaff  <blp@gnu.org>
10154
10155         * Makefile.am: (BUILT_SOURCES, fiasco_SOURCES) Add t-test.c
10156
10157         * aggregate.c: Changes, still not finished.
10158
10159         * descript.q, list.q: Comment fixes.
10160
10161         * q2c.c: Almost completely rewritten.
10162
10163         * t-test.q: New file, not complete.
10164
10165 Fri Nov 14 00:14:48 1997  Ben Pfaff  <blp@gnu.org>
10166
10167         * aggregate.c: Changes, still not finished.
10168
10169         * sort.c: (sort_cases) Call cancel_temporary() instead of doing it
10170         by hand.
10171
10172         * temporary.c: (cancel_temporary) New function.
10173
10174         * vars-atr.c: (discard_variables) Call cancel_temporary() instead
10175         of doing it by hand.
10176
10177         * vfm.c: (close_active_file) After restoring a TEMPORARY
10178         dictionary, set temp_dict to NULL.  Cancel TEMPORARY through
10179         cancel_temporary().
10180         (SPLIT_FILE_procfunc) Comment fix.
10181
10182 Tue Oct 28 16:08:45 1997  Ben Pfaff  <blp@gnu.org>
10183
10184         * Makefile.am: (fiasco_SOURCES) Add aggregate.c.
10185
10186         * aggregate.c: New file, not finished yet.
10187
10188         * command.c: (cmd_table) Add AGGREGATE.
10189
10190         * common.h: (pgm_state) Move declaration to var.h.
10191
10192         * lexer.c: (bin_value_func, oct_value_func, hex_value_func) i18n
10193         fixes.
10194         (parse_string) Message fix.
10195
10196         * recode.c: Comment fix.
10197
10198         * sfm-read.c: (read_variables) Code esthetic fixes.
10199         (write_header) Default date is `Jan', not `JAN'.
10200
10201         * sfmP.h: (bswap_int32) [!__linux__] Fix off-by-one errors.
10202
10203         * sort.c: (cmd_sort_cases) Farm the work out to new function
10204         parse_sort_variables().
10205         (parse_sort_variables) New function.
10206         (sort_cases) New function.  Cancels temporary transformations,
10207         which sorting didn't do previously.
10208         (cmd_sort_cases) Better garbage collection on error.  Uses
10209         do_external_sort().
10210         (write_initial_runs, merge_once) Improved code esthetics.
10211         (sort_stream_read) Reduced to one call to read_output_cases().
10212         (read_output_cases) New function.
10213
10214         * var-labs.c: (cmd_variable_labels) Re-enabled truncation of
10215         variable labels to 120 characters.
10216
10217         * var.h: Comment fixes.
10218         (glob var pgm_state) From common.h.
10219
10220         * vars-atr.c: (discard_variables) Set pgm_state to STATE_INIT.
10221
10222         * vars-prs.c: (parse_DATA_LIST_vars) Support PV_SINGLE in
10223         options.  Set *names to NULL on error.
10224
10225         * vfm.c: (memory_stream_init) Assert compaction_nval != 0.
10226
10227 Thu Oct  9 09:59:49 1997  Ben Pfaff  <blp@gnu.org>
10228
10229         * sfm-write.c, vfm.c: [HAVE_UNISTD] #include <unistd.h>, needed by
10230         SunOS4.  From Alexandre Oliva <oliva@dcc.unicamp.br>.
10231
10232 Wed Oct  8 18:55:24 1997  Ben Pfaff  <blp@gnu.org>
10233
10234         * vfm.c: (page_to_disk) Added missing local variables.
10235
10236 Tue Oct  7 20:23:17 1997  Ben Pfaff  <blp@gnu.org>
10237
10238         * get.c: Comment fix.
10239
10240         * sort.c: (cmd_sort_cases) Attempt to perform internal sort if the
10241         source is anything other than a disk stream, not just if it's in a
10242         memory stream.  Call page_to_disk() before external sort.
10243         (allocate_cases) Message fix.
10244
10245         * vfm.c: (prepare_for_writing) Warn user when paging workspace to
10246         disk.
10247         (page_to_disk) New function.
10248
10249 Sun Oct  5 15:56:14 1997  Ben Pfaff  <blp@gnu.org>
10250
10251         * Makefile.am: (INCLUDES) Include .. instead of $(top_srcdir).
10252
10253         * common.h: (macro strerror) Remove.  From Alexandre Oliva
10254         <oliva@dcc.unicamp.br>.
10255
10256         * get.c: (dict_delete_run) The number of variables to delete is
10257         not necessarily the number of variables that need to be shifted
10258         up.
10259         (trim_dictionary) Don't set *options to 0.  Fix bug that caused
10260         too many variables to be deleted.
10261
10262         * postscript.c: Comment fix.
10263
10264         * q2c.c: Include strerror.c.  From Alexandre Oliva
10265         <oliva@dcc.unicamp.br>.
10266
10267         * set.q: #undef ON and OFF.  From Alexandre Oliva
10268         <oliva@dcc.unicamp.br>.
10269
10270         * sfm-read.c: (sfm_read_dictionary) Don't set the file class too
10271         early, otherwise errors cause a bad free().
10272
10273         * str.h: (macro nvsprintf) s/FORMATS/FORMAT/ typo.  From Alexandre
10274         Oliva <oliva@dcc.unicamp.br>.
10275
10276         * temporary.c: (save_dictionary) Don't allocate memory if
10277         n_documents is 0.
10278
10279         * vfm.c: (memory_stream_write) Message fix.
10280
10281 Sat Oct  4 16:20:43 1997  Ben Pfaff  <blp@gnu.org>
10282
10283         * command.c: (static var cmd_table[]) Define REPEATING DATA
10284         command.
10285
10286         * common.h: Added support for broken systems that are missing
10287         EXIT_SUCCESS, EXIT_FAILURE, RAND_MAX, and/or strerror().
10288
10289         * Many source files: Replace syntax error messages via msg() with
10290         call to syntax_error().
10291
10292         * data-list.c: (dump_fixed_table) Add support for dumping table
10293         for REPEATING DATA as well as DATA LIST FIXED.
10294         (cmd_repeating_data) Allows and requires `/' between subcommands.
10295         Does proper thing with allowing rpd.starts_end to stay 0.  Allows
10296         CONTINUED specifications to be omitted.  Forces CONTINUED to be
10297         specified if ID is.  Calculates starts_end, cont_end from logical
10298         record length as reported by fhp.  Calls dump_fixed_table() if
10299         requested.  Fixed length of record copied by memcpy.
10300         (parse_num_or_var) Sets `num' to 0, not NOT_INT, for variables.
10301         Message fix.
10302         (realize_value) Returns sensible value for out-of-range variable
10303         values.
10304         (rpd_parse_record) New argument `ofs'.  Fixed confusion between
10305         length of occurrences and length of line.  Added warning for
10306         fields that exceed the line length.  Fixed infinite loop.
10307         (read_one_set_of_repetitions) Numerous minor changes for more
10308         complete SPSS compliance.  Message fixes.
10309
10310         * dfm.c: (dfm_close) If the file being closed is the inline file,
10311         read all the remaining data before closing it.
10312         (dfm_get_record) Don't close the file on lossage, as either it
10313         has been closed already or it doesn't belong to us.
10314
10315         * error.c: (puts_stdout) New function.
10316         (vmsg) Use puts_stdout instead of puts.
10317
10318         * file-handle.q: (fh_record_width) New function.
10319
10320         * inpt-pgm.c: (init_case) Fixed buffer overrun when inp_nval % 4
10321         == 0.
10322         (clear_case) Ditto.
10323         (input_program_source_read) Made an old kluge an approved method.
10324
10325         * lexer.c: (syntax_error) New function.
10326
10327         * misc.c: [BROKEN_RAND] (ansi_rand, ansi_srand; static var next)
10328         New.
10329
10330         * output.c: (oupt_get_paper_size) Message fix.
10331
10332         * q2c.c: Numerous fixes to formatting of generated code made to
10333         conform to GNU coding standards.  Uses syntax_error() in generated
10334         code.  Other miscellaneous generated message fixes.  Added support
10335         for broken systems that are missing EXIT_SUCCESS, EXIT_FAILURE,
10336         RAND_MAX, and/or strerror().
10337
10338 Sat Oct  4 02:09:56 1997  Ben Pfaff  <blp@gnu.org>
10339
10340         * data-in.c: Comment fixes.
10341
10342         * data-list.c: (struct repeating_data_trns) New member `id_spec'.
10343         (find_variable_input_spec) New function.
10344         (cmd_repeating_data) Initializes id_spec.
10345         (rpd_parse_record) Implemented.
10346         (read_one_set_of_repetitions) Returns -3 by default in order to
10347         kluge out some potential bugs.
10348
10349         * data-out.c: Comment fixes.
10350
10351         * file-type.c: (internal_cmd_record_type) Message fix.
10352
10353         * inpt-pgm.c: (input_program_source_read) Special temporary kluge
10354         for handling -3 return value.
10355
10356 Sat Sep 20 23:58:15 1997  Ben Pfaff  <blp@gnu.org>
10357
10358         * data-list.c: Comment fixes.
10359         (struct dls_var_spec) Reordered members.
10360         (read_from_data_list_fixed) Restructured.
10361         (struct repeating_data_trns) Reordered members.  Renamed `starts'
10362         as `starts_beg', `ends' as `starts_end'.
10363         (cmd_repeating_data) Calculates length of repeated data if
10364         necessary and possible.
10365         (parse_num_or_var) Don't allow string variables.
10366         (realize_value) New function.
10367         (rpd_msg) New function.
10368         (rpd_parse_record) New function.  Currently stubbed out.
10369         (read_one_set_of_repetitions) Implemented.
10370
10371         * inpt-pgm.c: (input_program_source_read) Comment fix.
10372
10373 Thu Sep 18 21:34:57 1997  Ben Pfaff  <blp@gnu.org>
10374
10375         * command.c: (cmd_end_repeat_p) Removed.
10376         (init_cmd_parser) Doesn't set cmd_end_repeat_p.
10377         (parse_cmd_name) Removed.
10378
10379         * data-list.c: Comment fixes.
10380         (data_list_pgm) Removed `eof' member.
10381         (static var first) New var.
10382         (cmd_data_list) Sets `first'.  Ensures that DATA LIST uses the
10383         FILE TYPE file inside FILE TYPE structures.
10384         (append_var_spec) Appends to *first, not dls.spec.
10385         (parse_fixed) Message fixes.
10386         (struct rpd_num_or_var) New.
10387         (struct repeating_data_trns) New.
10388         (static var rpd) New.
10389         (cmd_repeating_data) New function.
10390         (parse_num_or_var) New function.
10391         (parse_repeating_data) New function.
10392         (read_one_set_of_repetitions) New function.
10393
10394         * file-type.c: (cmd_file_type) Message fixes.  Always
10395         default_handle to FILE TYPE file handle.
10396         (internal_cmd_record_type) Message fixes.
10397
10398 Wed Aug 20 14:22:03 1997  Ben Pfaff  <blp@gnu.org>
10399
10400         * repeat.c: Comment fix.  Disable debugging.
10401
10402         * temporary.c: (restore_dictionary) Sets splits to NULL and
10403         n_splits to 0 before destroying the variables because now doing
10404         this tries to remove split variables.
10405
10406         * vars-atr.c: (discard_variables) Asserts that n_splits is 0 after
10407         destroying the dictionary.
10408         (clear_variable) Removes a variable from splits after destroying
10409         it.
10410
10411 Mon Aug 18 18:06:55 1997  Ben Pfaff  <blp@gnu.org>
10412
10413         * cmdline.c: (set_compat) Removed.
10414         (pick_compat) Removed.
10415         (parse_command_line) Removed -c option.
10416         (pre_syntax_message) Removed -c option.
10417         (usage) Remove compatibility code.
10418
10419         * common.h: (macros VER_PC, VER_WND, VER_X) Removed.
10420         (glob var compat) Removed.
10421
10422         * compute.c: (type_check) Fixed messages about type mismatches.
10423
10424         * data-list.c: (cmd_data_list) Removed compatibility code.
10425         (fixed_parse_compatible) Calls convert_negative_to_dash().
10426         Fixed bug where it only set the variable in fx.spec if it created
10427         the variable itself.
10428         (dump_fmt_list) Spelling fix.
10429         (cut_field) Removed compatibility code.
10430
10431         * dfm.c: (cmd_begin_data) Don't require a command terminator on
10432         BEGIN DATA command.
10433
10434         * expr-evl.c: (evaluate_expression) Implement LAG.
10435
10436         * expr-prs.c: (parse_add) Calls convert_negative_to_dash().
10437         (parse_neg) Calls convert_negative_to_dash().
10438         (LAG_func) Increases n_lag to the lag requested.  Fixed assignment
10439         bug.
10440
10441         * expr.h: (struct expression_struct) Removed member max_lag.
10442
10443         * file-type.c: (parse_col_spec) Calls convert_negative_to_dash().
10444         (internal_cmd_record_type) Removed special handling to produce
10445         negative numbers from dash tokens.
10446
10447         * getline.c: (static var DO_REPEAT_level) New var.
10448         (getl_add_DO_REPEAT_file) Increments DO_REPEAT_level.
10449         (handle_line_buffer) Copies the line into getl_buf; doesn't call
10450         copy_with_DO_REPEAT_substitutions().
10451         (getl_read_line) Maintains value of getl_mode.  Calls
10452         perform_DO_REPEAT_substitutions() whenever DO_REPEAT_level is
10453         positive.
10454         (getl_close_file) Decrements DO_REPEAT_level when appropriate.
10455
10456         * getline.h: (getl_mode) New glob var.
10457
10458         * glob.c: Comment fixes.
10459         (init_glob) Restructured.  Sets set_seed.
10460         (init_compat_dependent) Removed.  All references removed.
10461         (get_date) Format changed from MM/DD/YY to DD MMM YYYY.
10462         (__htonl, __htons) Removed.  (What were these for?)
10463
10464         * lexer.c: (static var tbl) Dash set to class CNUM.
10465         (make_hexit) New function from data-out.c.
10466         (get_token_representation) Rewritten.
10467         (convert_negative_to_dash) New function.
10468         (lex_init_compat_dependent) Removed.
10469         (yylex) A dash is parsed as part of a number if it is followed by
10470         a digit.  The ASCII representation of a number is copied to
10471         tokstr.  String parsing farmed out to parse_string().  Comment
10472         fixes.
10473         (bin_value_func, oct_value_func, hex_value_func, parse_string) New
10474         functions.
10475         (preprocess_line) Line processing depends on interactive/batch
10476         mode, not on compatibility mode.  Removed PC+ compatibility code.
10477
10478         * loop.c: (loop_3_trns_proc) Comment fix.
10479
10480         * main.c: Remove dead code.
10481         (main) Remove call to init_compat_dependent().
10482
10483         * misc.c: (convert_fmt_ItoO) Make E format conversion more
10484         conformant.
10485
10486         * print.c: (parse_string_argument) Calls
10487         convert_negative_to_dash().
10488         (fixed_parse_compatible) Calls convert_negative_to_dash().
10489
10490         * repeat.c: (RPT_* defines) Removed.
10491         (struct rpt_numeric) Removed.
10492         (struct repeat_entry) New member type, changed `replacement' from
10493         char * to char **.
10494         (clean_up) Deallocation adapted to new repeat_entry.
10495         (internal_cmd_do_repeat) `type' defaults to 0.  Remove lookahead()
10496         usage.  Creates vars for `type' of 1.
10497         (parse_ids) Sets type of 1.  Adapted to new repeat_entry.
10498         (store_numeric) Rewritten, new interface.
10499         (parse_numbers) Rewritten.
10500         (parse_strings) Rewritten.
10501         (find_DO_REPEAT_substitution) New function.
10502         (perform_DO_REPEAT_substitutions) New function.
10503         (copy_with_DO_REPEAT_substitutions) Removed.
10504         (debug_print) Rewritten.
10505
10506         * set.q: Comment fix.
10507         (custom_results) Removed compatibility code.
10508         (internal_cmd_set) Removed SET EMULATION subcommand.  Removed
10509         compatibility code.
10510
10511         * sysfile-info.c: (cmd_display) Removed compatibility code.
10512
10513         * tokens.h: Comment fixes.
10514         (token types enum) Removed `toktype' typedef name for this int
10515         type.  Removed SUBST.  Restructured.
10516
10517         * vars-atr.c: (discard_variables) Sets n_lag to 0.
10518
10519         * vars-prs.c: Comment fix.
10520
10521         * vfm.c: Comment fixes.
10522         (glob var n_lag) New var.
10523         (static vars lag_count, lag_head, lag_queue) New vars.
10524         (procedure) Removed argument nlag.
10525         (setup_lag) New function.
10526         (close_active_file) Discards lagging state.
10527         (lag_case) New function.
10528         (lagged_case) New function.
10529         (write_case) Lags a case if lagging.
10530
10531         * weight.c: (cmd_weight) Removed compatibility code.
10532         
10533 Sun Aug 17 22:34:40 1997  Ben Pfaff  <blp@gnu.org>
10534
10535         * getline.h: (struct getl_script) New members loop_index, macros.
10536
10537         * getline.c: (getl_add_file) Sets first_line field to NULL.
10538         (getl_add_DO_REPEAT_file) New function.
10539         (handle_line_buffer) When the current line's length is negative,
10540         set the filename and line number.  Increment line number after
10541         reading line.  Pass the line to
10542         copy_with_DO_REPEAT_substitutions() for processing.
10543         (getl_close_file) Free DO REPEAT lines before freeing the
10544         filename, and just set the filename to NULL when doing this,
10545         because otherwise the filename gets freed twice.
10546
10547         * glob.c: (glob var queuing) Removed.  All references removed.
10548
10549         * lexer.c: Comment fixes.
10550         (get_token_representation) New function.
10551
10552         * repeat.c: Comment fixes.
10553         (struct repeat_entry) Replaced type and v union members with a
10554         simple string.
10555         (append_record) New function.
10556         (internal_cmd_do_repeat) Started reforming it for the new
10557         repeat_entry struct.  Properly records filename changes in the
10558         getl_line_buf.  Fixed improper use of = for ==.  Fixed sense of
10559         strncasecmp() result usage.  Uses append_record() to simplify.
10560         Properly discards END REPEAT line.  Calls getl_add_DO_REPEAT_file
10561         to add in the file.
10562
10563         (copy_with_DO_REPEAT_substitutions) Started coding.
10564
10565         [DEBUGGING] (debug_print_lines) New function.
10566
10567         * set.q: (custom_results, internal_cmd_set) s/VER_PCP40/VER_PC/;
10568
10569         * tokens.h: (macro is_id1, is_idn) New macros.
10570
10571 Sat Aug 16 10:57:41 1997  Ben Pfaff  <blp@gnu.org>
10572
10573         * cmdline.c: (static var pre_syntax_message) Changed `win'
10574         compatibility mode to `wnd'.
10575
10576         * data-list.c: (fixed_parse_spss) Renamed
10577         fixed_parse_compatible().
10578
10579         * glob.c: (init_glob) Excise unused code for
10580         program_invocation_short_name.
10581
10582         * lexer.c: (preprocess_line) Leading indentors are ignored in Wnd
10583         as well as in X.
10584
10585         * print.c: (fixed_parse_spss) Renamed fixed_parse_compatible().
10586
10587         * set.q: `win' compatibility renamed `wnd'.
10588
10589 Thu Aug 14 22:11:12 1997  Ben Pfaff  <blp@gnu.org>
10590
10591         * filename.c: [__WIN32__] Change the included Windows header files
10592         (again).
10593         (absolute_filename_p) [__MSDOS__] A filename with a colon as the
10594         second character is absolute.
10595         (dirname) Fix logic error.  Don't printf() the results.
10596         (prepend_dir) Don't printf() the results.
10597
10598         * getline.c: (handle_line_buffer) New function.
10599         (getl_read_line) Reads line with handle_line_buffer() when
10600         appropriate.
10601         (getl_close_file) Discard line buffer data.
10602
10603         * getline.h: Comment fixes.
10604         (struct getl_line_list) New struct.
10605         (getl_script_struct) Added line buffer members.  These are hooks
10606         for use by DO REPEAT to allow it to insert virtual source code
10607         into the program.
10608
10609         * glob.c: (init_glob) [__DJGPP__ || (__WIN32__ && __BORLANDC__)]
10610         Override Borland C++ stupidity that claims Windows has a console
10611         window size of 0x3.
10612
10613         * repeat.c: This is in the process of being restructured from
10614         using a token-buffering approach to the DO REPEAT facility to
10615         using the more flexible approach of a line-buffering approach in
10616         conjunction with the getline module.  Comment fixes.
10617         (struct tok_struct) Removed.
10618         (static vars queue_index, queue_head, queue) Removed.
10619         (static vars line_buf_head, line_buf_tail) New vars.
10620         (internal_cmd_do_repeat) Instead of queuing tokens, queue lines.
10621         Not complete.
10622         (pull_queue, destroy_queue) Removed.
10623         [DEBUGGING] (debug_print_tokens) Removed.
10624
10625 Tue Aug  5 13:57:58 1997  Ben Pfaff  <blp@gnu.org>
10626
10627         * file-handle.q: (prepend_current_directory) New function.
10628         (internal_cmd_file_handle, fh_get_handle_by_filename) Prepends
10629         current directory before normalizing filename.
10630
10631         * filename.c: (gnu_getcwd) New function.
10632         (absolute_filename_p) New function.
10633         (search_path) New argument, PREPEND.  All references changed to
10634         pass NULL except those explicitly mentioned.  Uses
10635         absolute_filename_p().  Prepends PREPEND before trying the
10636         filename.
10637         (dirname, prepend_dir) New functions.
10638
10639         * getline.c: (getl_get_current_directory) New function.
10640         (getl_include) Passes getl_get_current_directory() as PREPEND arg
10641         to search_path().
10642                 
10643 Sun Aug  3 11:42:36 1997  Ben Pfaff  <blp@gnu.org>
10644
10645         * In several source files, the term `script' was replaced with
10646         `syntax file' inside error messages.  Usage of the term `script'
10647         in the sense of a syntax file is now deprecated.
10648
10649         * cmdline.c: (static vars pre_syntax_message, post_syntax_message)
10650         Updated messages.
10651
10652         * dump-sysfile.c: (usage) Update message.
10653
10654         * getline.c: (getl_read_line) Ignore lines beginning with `#!'.
10655
10656         * getline.h: (glob var getl_include_path) Declare extern.
10657
10658         * list.q: Define EXTERN as extern before #including somP.h.
10659
10660         * var.h: Remove declaration of `disptype' variable.
10661
10662         * vfm.c: (close_active_file) After switching the data sink to a
10663         data source, set vfm_sink to NULL, because it doesn't exist any
10664         more.
10665
10666 Thu Jul 17 21:41:44 1997  Ben Pfaff  <blp@gnu.org>
10667
10668         * glob.c: [__BORLANDC__] Include math.h.  Define _matherr() and
10669         _matherrl() to ignore all math errors.
10670
10671         * sfm-read.c: (read_value_labels) When reading the labels from
10672         disk, read the little parts separately instead of as a struct;
10673         this avoids alignment problems.
10674
10675         * sfm-write.c: (struct sfm_fhuser_ext) New member `elem_type'.
10676         (sfm_write_dictionary) Sets elem_type and frees it on lossage.
10677         (write_header) Allocates and initializes elem_type.
10678         (sfm_write_case) Uses elem_type to determine how to handle each
10679         flt64 element.
10680         (sfm_close) Frees elem_type.
10681
10682         * sfmP.h: Comment fix.
10683         [__BORLANDC__] Uses #pragma -a to adjust structure member
10684         alignment.
10685         
10686 Thu Jul 17 01:55:12 1997  Ben Pfaff  <blp@gnu.org>
10687
10688         * Makefile.am: (fiasco_SOURCES) Remove display.c.
10689
10690         * common.c: Fix typo.
10691
10692         * dfm.c: (read_record) Remove strncasecmp() emulation and fix the
10693         sense of the condition.
10694
10695         * expr-evl.c: (macro ALLOC_STRING_SPACE) [!PAGED_STACK] Add
10696         line-continuation backslash.
10697
10698         * filename.c: [__WIN32__] Include <windef.h> before <winbase.h>.
10699
10700         * frequencies.q: (custom_grouped, add_percentile) Don't use a
10701         non-constant expression as an argument to sizeof.
10702
10703         * glob.c: [__WIN32__ && __BORLANDC__] When including <conio.h>,
10704         undefine gettext macro because that's a conio function.
10705
10706         * hash.h: (hsh_prime_tab declaration) Remove.
10707
10708         * list.q: (write_fallback_headers) Move `leader' allocation out of
10709         main loop.  Change to local_alloc() allocation.
10710
10711         * output.h: Formatting fixes.  Put __attribute__ in right place on
10712         function prototypes.
10713
10714         * sfm-read.c: (read_machine_flt64_info, read_variables) Change
10715         incorrect `SECOND_LOWEST_VALUE' references to proper
10716         `second_lowest_value'.
10717
10718         * som-frnt.c: (EXTERN macro) Define as `extern' instead of null
10719         value.  This way 2 out of 3 of the som files define the vars
10720         extern, the correct way, that actually works under BC++.
10721         (som_set_float) Don't use nonconstant initializers for a struct.
10722
10723         * som-high.c: Add the standard alloca() header.
10724         (replicate_table) Add prototype.
10725
10726         Merged DISPLAY routine.
10727         * sysfile-info.c: (AS_*) New enum series.
10728         (cmd_sysfile_info) Gutted.  Calls describe_variable() to do the
10729         dirty work.
10730         (cmd_display, display_macros, display_documents,
10731         display_variables) Stolen from defunct display.c.
10732         (describe_variable) New function.
10733
10734         * temporary.c: [0] (display_tree) New debug function.
10735         (copy_variable) Performs shallow copy of value labels instead of
10736         deep copy; i.e., just copys the AVL tree and increments the
10737         reference counts.
10738
10739         * val-labs.c: Comment fixes.
10740         (do_value_labels) Optionally skip leading forward slash.
10741         (get_label) Creates only a single value label instead of many
10742         copies of one, and sets the reference count.
10743
10744         * display.c: Removed.
10745
10746         * dump-sysfile.c: New file, not yet complete.
10747
10748 Fri Jul 11 23:02:18 1997  Ben Pfaff  <blp@gnu.org>
10749
10750         For lots of source files I added more verbose_msg's.  These aren't
10751         listed below as they have tested as being benign.  In some cases
10752         these replaced debug_printf() calls.
10753
10754         * output.c: (outp_read_devices) Message fix.
10755
10756         * postscript.c: (output_encodings) Message fix.  Reports errors on
10757         fclose().
10758         (postopen) Message fix.
10759         
10760 Fri Jul 11 14:09:40 1997  Ben Pfaff  <blp@gnu.org>
10761
10762         * dfm.c: (dfm_close) Don't call fclose() for a NULL FILE.
10763
10764         * filename.c: (close_file_ext) Set f->file to NULL *after* closing
10765         it.
10766
10767         * main.c: Remove <malloc.h> #include.
10768
10769         * mis-val.c: (parse_numeric) Set .f member for each missing[]
10770         instead of trying to just set the missing[] itself, which is a
10771         gcc-specific idiom.
10772
10773         * sfm-read.c: (read_variables) Same.
10774
10775         * str.h: Add memmem() prototype.
10776
10777         * val-labs.c, var-labs.c: Replace <malloc.h> with <stdlib.h>.
10778
10779 Thu Jul 10 22:13:53 1997  Ben Pfaff  <blp@gnu.org>
10780
10781         * Makefile.am: (q2c) Don't include any libraries in the link.
10782
10783         * dfm.c: (force_line_buffer_extension) New macro.
10784         (count_tabs) New function.
10785         (tabs_To_spaces) New function.
10786         (read_record) Calls tabs_to_spaces() on the line being processed.
10787
10788         * q2c.c: Disabled i18n for this proglet so that libintl.a doesn't
10789         have to be compiled twice (once for CC, once for LOCAL_CC).
10790  
10791 Sun Jul  6 19:14:33 1997  Ben Pfaff  <blp@gnu.org>
10792
10793         * Makefile.am: (INCLUDES) Add intl directory; fix directories.
10794         (LDADD) Add @INTLLIBS@.
10795         (q2c) Add LIBS, @INTLLIBS@ to link step.
10796
10797         * inpt-pgm.c: Turn off debugging.
10798
10799         * postscript.c: (postopen) Format fix.  local_free() blocks
10800         returned by local_alloc(); don't free() them.
10801
10802 Sat Jul  5 23:44:51 1997  Ben Pfaff  <blp@gnu.org>
10803
10804         * data-in.c: (parse_string_as_format) Comment fix.  Fix check for
10805         string length.
10806
10807         * data-list.c: (read_from_data_list_fixed) Pass proper value for
10808         LEN arg, not simply the full string length.
10809
10810         * sort.c: (allocate_file_handles) Check SPSS compatible temp file
10811         directories before generic temp file directories.
10812
10813         * vfm.c: Disable debugging.
10814
10815 Fri Jul  4 13:26:41 1997  Ben Pfaff  <blp@gnu.org>
10816
10817         * get.c: Comment fix.
10818         (cmd_save_internal) Always passes GTSV_OPT_SAVE option.
10819
10820 Wed Jun 25 22:52:28 1997  Ben Pfaff  <blp@gnu.org>
10821
10822         * expr-prs.c: (debug_print_postfix) Conditionally included on
10823         GLOBAL_DEBUGGING.  Removed out_header() reference.
10824
10825         * exprP.h: Removed #undef GLOBAL_DEBUGGING.
10826
10827 Sun Jun 22 22:00:28 1997  Ben Pfaff  <blp@gnu.org>
10828
10829         * ascii.c: Removed obsolete ascii_close_page() prototype.
10830
10831         * command.c: (output_line) Comment fix.
10832
10833         * data-in.c: Formatting fix.
10834         (parse_string_as_format) Now the `fc' argument is used only for
10835         the purpose of error messages; it is not an index into the string
10836         passed.  All references changed.
10837
10838         * data-list.c: Comment fix.
10839         (cut_field) Comment fix.  Now returns the column number of the
10840         position of the field cut out on success.
10841         (parse_field) Added `column' argument.  Puts the column numbers in
10842         the error message.
10843         (read_from_data_list_free, read_from_data_list_list) Record the
10844         column number returned by cut_field(), pass it to parse_field().
10845
10846         * dfm.c: Comment fix.
10847
10848         * do-ifP.h: Comment fix.
10849
10850         * expr-prs.c: (SYSMIS_func) Implemented string-type arguments for
10851         the SYSMIS function.
10852
10853         * expr.h, exprP.h: Comment fix.
10854
10855         * glob.c: (init_glob) Only calls setlocale() and family if
10856         ENABLE_NLS set.
10857
10858         * hash.h: Comment fix.
10859
10860         * include.c: Comment fix.
10861
10862         * output.c: Comment fix.
10863
10864         * postscript.c: (ps_line_intersection) Simplified assertion.
10865
10866         * repeat.c: Comment fix.
10867
10868         * vars-atr.c: Comment fix.
10869
10870         * vars-prs.c: Comment fix.
10871
10872         * vfm.c: (vector_initialization) [DEBUGGING] Fixed undefined
10873         behavior with usage of postincrement.
10874         (memory_stream_read) Discards cases as it goes. 
10875
10876 Sun Jun 15 16:45:17 1997  Ben Pfaff  <blp@gnu.org>
10877
10878         * Makefile.am: Cleans q2c, not just distcleans it.  Distcleans
10879         foo.
10880
10881         * Most source files: Includes debug-print.h, related comment
10882         fixes.
10883
10884         * cases.c: (alloc_val) Removed complex allocation code.  Merely
10885         increments default_dict.nval and returns the former value.
10886         (envector, devector) Removed references to lv member of struct
10887         variable.
10888
10889         * common.h: (macro VME) Replaced complex definition with simple
10890         one.
10891
10892         * data-list.c: (cmd_data_list) Sets vfm_source instead of
10893         read_active_file and cancel_input_pgm.
10894         (read_from_data_list, cancel_data_list) Removed.
10895         (data_list_source_read, data_list_source_destroy_source) New
10896         functions.
10897         (glob var data_list_source) New var.
10898
10899         * dfm.c: (open_file_r, open_file_w) Simplified debug output.
10900         (cmd_begin_data) Improved criteria for an input program accessing
10901         the inline file.  Still not perfect.
10902
10903         * do-if.c: (do_if_trns_proc) Simplified debug output.
10904
10905         * expr-prs.c: Comment fixes.
10906         [DEBUGGING] (debug_print_postfix) Simplified debug output.
10907
10908         * file-handle.q: (fh_close_handle) Simplified debug output.
10909
10910         * file-type.c: Comment fixes.
10911         (cmd_file_type) Sets vfm_source instead of read_active_file and
10912         cancel_input_pgm.
10913         (cmd_end_file_type) On failure, discards variables in place of
10914         just canceling the input program.
10915         (read_from_file_type) Renamed file_type_source_read.
10916         (cancel_file_type) Renamed file_type_source_destroy_source.
10917         (glob var file_type_source) New var.
10918
10919         * get.c: (GTSV_* enum series) New enums GTSV_OPT_SAVE, GTSV_NONE.
10920         (cmd_get) Initializes options to GTSV_NONE before passing to
10921         trim_dictionary().  Removed `lv' reference.  Sets vfm_source
10922         instead of read_active_file and cancel_input_pgm.
10923         (cmd_save_internal) Initializes options before passing to
10924         trim_dictionary().  Local var `nval' removed.
10925         (dict_delete_run) Comment fixes.
10926         (trim_dictionary) Comment fixes.  Disallows scratch variables if
10927         GTSV_OPT_SAVE set in options.
10928         (read_from_get) Renamed get_source_read.
10929         (cancel_get) Renamed get_source_destroy_source.
10930         (glob var get_source) New var.
10931
10932         * inpt-pgm.c: (cmd_input_program) Sets vfm_source instead of
10933         read_active_file and cancel_input_pgm.
10934         (read_from_input_program) Renamed input_program_source_read.
10935         Simplified debug output.
10936         (cancel_input_program) Renamed
10937         input_program_source_destroy_source.
10938         (glob var input_program_source) New var.
10939
10940         * loop.c: (loop_1_trns_proc) Simplified debug output.
10941
10942         * main.c: (dump_token) Made eof output more explicit.
10943
10944         * sfm-read.c: (read_variables, dump_dictionary) Removed `lv'
10945         references.
10946
10947         * sort.c: (cmd_sort_cases) Disallows scratch variables.  Removed
10948         code for always-memory or always-disk cases.  malloc's case-list
10949         based on vfm_source_info.ncases.  Explicit support for
10950         memory_stream via memory_source_cases.
10951         (do_external_sort) Sets vfm_source instead of read_active_file and
10952         cancel_input_pgm.
10953         (allocate_file_handles) The temporary directory permissions are
10954         set to 0700 instead of 0777.
10955         (allocate_cases) Formatting fixes.  Simplified debug output.
10956         (output_record) Compacts the case if necessary before writing it
10957         out.
10958         (close_handle, open_handle_w) Simplified debug output.
10959         (write_initial_runs) Destroys vfm_sink, then sets it to
10960         sort_stream.  Writes records to memory based on
10961         vfm_sink_info.case_size.
10962         (write_to_sort_cases) Renamed sort_stream_write().
10963         (merge) Simplified error handling.  Simplified debug output.
10964         Formatting fixes.
10965         (read_from_external_sort) Renamed sort_stream_read().
10966         Reads records based on vfm_source_info.case_size.
10967         (sort_stream_write) Writes records to memory based on
10968         vfm_sink_info.case_size.
10969         (sort_stream_mode) New function.
10970         (glob var sort_stream) New variable.
10971
10972         * temporary.c: (cmd_temporary) Simplified debug output.
10973         (copy_variable) Removed references to `lv'.
10974
10975         * title.c: (get_title) Simplified debug output.
10976
10977         * var.h: Comment fixes.
10978         (struct get_proc) Removed member `lv'.
10979         (struct variable) Removed member `lv'.  Comment fixes.
10980         (glob vars read_active_file, write_active_file, cancel_input_pgm)
10981         Removed.
10982         (struct case_stream) New.
10983
10984         * vars-atr.c: (discard_variables) Changed cancel_input_pgm,
10985         read_active_file references to use vfm_source.
10986         (init_variable, replace_variable) Removed references to `lv'.
10987
10988         * vfm.c: Comment fixes.
10989         (glob var vfm_source, vfm_sink, vfm_source_info, vfm_sink_info)
10990         New variables.
10991         (static var queue, qh, qt, n_lag) Removed.  All references
10992         removed.
10993         (glob var compaction_necessary, compaction_nval, compaction_case,
10994         paging) New variables.
10995         (record_case) Removed.
10996         (procedure) Comment fixes.  Calls vfm_source->read() instead of
10997         read_active_file().
10998         (lag) Removed.
10999         (prepare_for_writing, arrange_compaction, make_temp_case,
11000         vector_initialization, setup_filter) New function.
11001         (open_active_file) Most of the code moved into the abovementioned
11002         new functions.  Now sets temp_dict to &default_dict if there is no
11003         temporary dictionary, for convenience.  New debug output.
11004         (close_active_file) Deals with changing the sink to the source.
11005         Calls finish_compaction().  Frees compaction_case.  Mostly
11006         rewritten.
11007         (glob vars disk_source_file, disk_sink_file) New vars.
11008         (destroy_active_file, read_from_memory) Removed.
11009         (disk_stream_init, disk_stream_read, disk_stream_write,
11010         disk_stream_mode, disk_stream_destroy_source,
11011         disk_stream_destroy_sink) New functions.
11012         (glob var vfm_disk_stream) New var.
11013         (glob vars memory_source_cases, memory_sink_cases,
11014         memory_sink_iter, memory_sink_max_cases) New vars.
11015         (memory_stream_init, memory_stream_read, memory_stream_write,
11016         memory_stream_mode, memory_stream_destroy_source,
11017         memory_stream_destroy_sink) New functions.
11018         (glob var vfm_memory_stream) New var.
11019         (write_case) Local var `i' renamed `cur_trns'; local var `retval'
11020         named `more_cases'.  Simplified debug output.  Otherwise mostly
11021         rewritten.
11022         (record_case) Moved into the stream drivers.  Removed.
11023         (transform) Removed (was dead code).
11024         (SPLIT_FILE_procfunc) s/vfm_replacement/vfm_sink_info/.  In the
11025         common case that the splits don't change, we don't need to copy
11026         the case into prev_case again--pointless.
11027         (compact_case) New function.
11028         (finish_compaction) New function.
11029
11030         * vfmP.h: Comment fixes.
11031         (DEV_* enum series) Removed. 
11032         (struct storage) Renamed `stream_info'.  Removed variant record.
11033         Removed `device' member.
11034
11035         * debug-print.h: New file.
11036         
11037 Sun Jun  8 01:12:38 1997  Ben Pfaff  <blp@gnu.org>
11038
11039         * autorecode.c: Turned off debugging.
11040
11041         * data-list.c: (destroy_dls) Closes the associated file handle.
11042
11043         * descript.q: (custom_variables) Added PV_NO_SCRATCH to
11044         parse_variables() options.
11045
11046         * dfm.c: (open_file_r) Removed gratuituous argument to msg() call.
11047
11048         * display.c: (display_variables) Really fixed null cell bug.
11049
11050         * file-handle.q: (fh_close_handle) Changed debugging message.
11051
11052         * frequencies.q: (custom_variables) Added PV_NO_SCRATCH to
11053         parse_variables() options.
11054
11055         * list.q: Added PV_NO_SCRATCH in q2c varlist options.
11056         (cmd_list) Fails if no variables specified.
11057         (determine_layout) Writes blank lines manually.
11058
11059         * loop.c: (loop_1_trns_proc) Made debugging code only print
11060         messages if debugging.
11061
11062         * q2c.c: (dump_subcommand) Appends sbc->message to SBC_VARLIST
11063         parse_variables() arguments.
11064         (main) Parses optional parenthesized options to varlist
11065         subcommands into sbc->message.
11066
11067         * sfm-read.c: Format fix.
11068
11069         * var.h: (FV_*) New enum series.
11070         (PV_*) New enum PV_NO_SCRATCH.
11071
11072         * vars-prs.c: (find_var) Removed.
11073         (fill_all_vars) Takes FV_* enum instead of boolean third
11074         argument.  Rewritten to deal with scratch as well as system
11075         variables.
11076         (parse_variables) Error message on scratch variable if
11077         PV_NO_SCRATCH set.
11078
11079         * vfm.c: (static var virt_begin_func) New var.
11080         (procedure) Sets up virt_begin_func.
11081         (SPLIT_FILE_procfunc) For the first case, calls virt_begin_func()
11082         after dump_splits().  For succeeding groups changes, calls
11083         virt_begin_func() instead of begin_func().      
11084
11085 Fri Jun  6 22:42:23 1997  Ben Pfaff  <blp@gnu.org>
11086
11087         * count.c, data-out.c, file-handle.q, list.q, loop.c: Turned off
11088         debugging.
11089
11090         * dfm.c: Added some debugging messages, disabled by default.
11091         (open_file_r) Fixed error message.
11092         (read_record) On eof on inline_file, instead of calling
11093         fh_close_handle(), simply jump to eof label like a normal file.
11094         Message fixes.
11095
11096         * display.c: Thin lines between rows for certain kinds of
11097         listing.  Fixed `null cell' bug.
11098
11099         * error.c: (failure) Flush stdout, stderr before failing.
11100
11101         * file-handle.q: (fh_close_handle) Added debugging message.
11102
11103         * frequencies.q: (dump_full) Bottom line extends across entire
11104         table width.  Changed title formatting.
11105         (dump_condensed) Changed title formatting.
11106         (dump_statistics) Fixed title formatting.
11107
11108         * glob.c: (init_glob) Moved initialization of cur_proc out of #if.
11109         Sets default value of set_format.
11110
11111         * list.q: (cmd_list) Calls blank_line() before determine_layout().
11112         Passes write_all_headers() to procedure() as pre-group func.
11113         (write_all_headers) New function.
11114         (determine_layout) Removed calls to write_header().
11115         Calls blank_line() before and after write_fallback_headers().
11116
11117         * recode.c: (recode_trns_free) Only attempts to free head->map if
11118         non-NULL.
11119
11120         * sfm-read.c: (read_variables) Allows `#' at beginning of system
11121         file variable names but gives a warning.  Sets `left' based on
11122         first character being/not being `#'.  On lossage frees dict->var.
11123
11124         * som-high.c: (som_draw_title) Simplified title formatting.
11125
11126         * vfm.c: (dump_splits) Fixed and changed splits formatting.
11127
11128 Thu Jun  5 22:51:15 1997  Ben Pfaff  <blp@gnu.org>
11129
11130         * autorecode.c: (cmd_autorecode) Sets h_trans to NULL at
11131         beginning.  Frees v_src, v_dest on successful exit.  Frees
11132         h_trans[*], h_trans on lossage.
11133         (recode) Frees h_trans[*], h_trans.
11134
11135         * dfm.c: (dfm_close) Formatting change.
11136         (open_inline_file) Now passed a dfm_fhuser_ext to initialize; no
11137         longer allocates its own in inline_file.
11138         (open_file_r) Passes the local dfm_fhuser_ext to
11139         open_inline_file().
11140         (open_file_w) Message fix. 
11141         (read_record) Buffer reallocation strategy changed.  Frees
11142         ext->line even in inline_file to prevent leaks.
11143         (dfm_put_record) Fixed bug where `ext' was cached before the file
11144         was opened and thus it would be NULL when the file really was
11145         open.
11146         (cmd_begin_data) Sets up inline_file basics itself, then calls
11147         open_inline_file() for the dfm_fhuser_ext.  Formatting fix.
11148
11149         * list.q: (write_line) Formatting fix.
11150         (clean_up) Minor strategy change.  Sets proportional font after
11151         finishing cleanup.
11152         (determine_layout) Sets fixed font before writing regular headers,
11153         or after writing fallback headers.
11154
11155         * modify-vars.c: (cmd_modify_vars) Frees variable lists for DROP
11156         and KEEP vars after using them.
11157
11158         * postscript.c: (ps_init_driver) Frees x->family.
11159         (postopen) When loading fonts, free the temporary font name buffer
11160         after using it.
11161         (ps_text_set_font_by_position) Free temporary font name buffer
11162         after using it.
11163         (text) Fixed code that calculated `lig' so that `lig' always gets
11164         initialized.  Formatting fix.
11165
11166         * som-low.c: (get_cell_size, som_get_table_size) `prop_height' ->
11167         `font_height'.
11168         [GLOBAL_DEBUGGIGN] (check_table) Use arena_alloc() to allocate
11169         cells, not xmalloc(), so that the cells will get destroyed
11170         automatically.
11171
11172         * sysfile-info.c: (cmd_sysfile_info) Frees the dictionary after
11173         using it.
11174
11175 Tue Jun  3 23:33:22 1997  Ben Pfaff  <blp@gnu.org>
11176
11177         * ascii.c: (ascii_text_draw) Always sets metrics for strings that
11178         are drawn.
11179
11180         * dfm.c: Comment fix.
11181
11182         * list.q: Comment fixes.  Include somP.h.  Removed static vars
11183         table, n_columns, n_rows, part.  New struct list_ext.  New static
11184         var line_buf.
11185         (n_lines_remaining, n_chars_width, write_line) New functions.
11186         (cmd_list, list_cases) Rewritten.
11187         (begin_row, end_row, flush_table) Removed.
11188         (write_header, clean_up, write_varname, write_fallback_headers,
11189         determine_layout) New functions.
11190
11191         * output.c: (outp_iterate_enabled_drivers) Minor reformat.
11192
11193         * output.h: Comment fix.
11194
11195         * postscript.c: Comment fix.
11196         (struct ps_driver_ext) Removed prop_size, fixed_size members;
11197         added font_size.  All references changed.
11198         (ps_init_driver) Initializes font_size.  Simplified space checking
11199         code.
11200         (static var option_tab[]) Removed prop-size, fixed-size; added
11201         font-size.
11202         (ps_option) Handles font_size.
11203
11204         * som-high.c: Moved prototypes into somP.h.
11205         (som_init_driver) New function.
11206         (som_submit_table) Moved some code into new function
11207         som_init_driver().
11208         (build_target) Moved some code into new function
11209         som_internal_eject_page().
11210         (som_eject_page) Uses som_internal_eject_page().
11211         (som_internal_eject_page) New function.
11212
11213         * som-low.c: Moved prototypes into somP.h.
11214
11215         * som.h: Formatting fixes.
11216
11217         * somP.h: (struct som_driver_ext) Removed em_width;
11218         added prop_em_width, fixed_width.
11219
11220 Mon Jun  2 14:25:25 1997  Ben Pfaff  <blp@gnu.org>
11221
11222         * Makefile.am: Added `localedir' definition.  Added
11223         -DLOCALEDIR="..." to DEFS.  Added -I. to INCLUDES.
11224
11225         * ascii.c: (macro draw_line) Fixed capitalization.
11226
11227         * ascii.c, autorecode.c, cases.c, cmdline.c, command.c, common.c,
11228         compute.c, count.c, data-in.c, data-list.c, data-out.c,
11229         descript.q, dfm.c, display.c, do-if.c, error.c, expr-evl.c,
11230         expr-opt.c, expr-prs.c, file-handle.q, file-type.c, filename.c,
11231         formats.c, frequencies.q, get.c, getline.c, glob.c, groff-font.c,
11232         hash.c, heap.c, include.c, inpt-pgm.c, lexer.c, list.q, loop.c,
11233         main.c, mis-val.c, misc.c, modify-vars.c, numeric.c, output.c,
11234         postscript.c, print.c, q2c.c, recode.c, rename-vars.c, repeat.c,
11235         sample.c, sel-if.c, sfm-read.c, sfm-write.c, sfmP.h, som-frnt.c,
11236         som-high.c, som-low.c, sort.c, split-file.c, sysfile-info.c,
11237         temporary.c, title.c, tokens.h, val-labs.c, var-labs.c,
11238         vars-atr.c, vars-prs.c, vector.c, vfm.c, weight.c: Marked strings
11239         for internationlization.
11240
11241         * glob.c: [HAVE_LOCALE_H] Includes locale.h.
11242
11243 Sun Jun  1 23:31:18 1997  Ben Pfaff  <blp@gnu.org>
11244
11245         * do-if.c, sort.c, val-labs.c: Comment fixes.
11246
11247         * glob.c: (init_glob) Uncommented, updated i18n support.
11248         
11249         * arena.c, ascii.c, data-in.c, descript.q, error.c, expr-evl.c,
11250         expr-opt.c, expr-prs.c, filename.c, frequencies.q, groff-font.c,
11251         output.c, postscript.c, sfm-read.c, som-high.c, vars-prs.c: Made
11252         the declarations of macros taking arguments a lot nicer.
11253
11254 Sun Jun  1 17:22:04 1997  Ben Pfaff  <blp@gnu.org>
11255
11256         * error.h: Removed CE, CW aliases for SE, SW.
11257
11258         * q2c.c: Removed explicit streq() definition since it's duplicated
11259         in str.h.
11260         
11261         * approx.h, error.h, font.h, hash.h, misc.h, output.h, somP.h,
11262         stats.h, str.h, tokens.h: Made the declarations of macros taking
11263         arguments a lot nicer-looking of <pinard@iro.umontreal.ca>.
11264         Comment fixes.
11265
11266 Sun Jun  1 12:02:06 1997  Ben Pfaff  <blp@gnu.org>
11267
11268         * cmdline.c: Comment fixes.
11269         (pick_compat) Changed return type to int.  Now, instead of setting
11270         glob var `compat' to the emulation, returns the emulation.  All
11271         references changed.
11272         (parse_command_line) Added terminating null to end of
11273         `long_options' array definition.
11274         (pre_syntax_message) Fixes.
11275         (usage) Shows the default emulation in the syntax message by
11276         calling pick_compat().
11277
11278         * getline.c: (getl_add_include_dir) Separates paths with
11279         PATH_DELIMITER, not DIR_SEPARATOR.
11280
11281         * glob.c: (init_glob) Fixed references to DEFAULT_VER_PCP40,
11282         DEFAULT_VER_WIN61, DEFAULT_VER_X40.
11283
11284         * output.c: (outp_configure_macro) Make earlier definitions for a
11285         particular key override later ones for the same key.
11286         
11287 Fri May 30 19:40:49 1997  Ben Pfaff  <blp@gnu.org>
11288
11289         * ascii.c: Comment fixes.
11290
11291         * output.c: (outp_get_paper_size)
11292         s/STAT_OUTPUT_INIT_FILE/STAT_OUTPUT_PAPERSIZE_FILE/.
11293         
11294 Sun May 25 22:34:07 1997  Ben Pfaff  <blp@gnu.org>
11295
11296         * ascii.c, postscript.c, sfm-read.c, sfm-write.c, sort.c: Include
11297         <errno.h>.  GNU libc 2 enforces this!
11298
11299         * command.c: (parse_cmd) Fixed problem with `else' clause being
11300         paired with wrong `if'.  Comment fix.
11301
11302 Fri May  9 16:53:52 1997  Ben Pfaff  <blp@gnu.org>
11303
11304         * getline.c: [!HAVE_LIBREADLINE] (read_console) Changed
11305         blp_getline() to getline().
11306
11307         * output.c: (outp_eval_dimension) Changed the fix from last time;
11308         there was no variable `a'.
11309
11310         * q2c.c: (get_line) Fixed boundary condition overrun bug.
11311
11312 Mon May  5 21:58:22 1997  Ben Pfaff  <blp@gnu.org>
11313
11314         * output.c: (outp_evaluate_dimension) Fixed handling of negative
11315         numbers having fractional parts.  Added case of a fraction without
11316         a whole-number part.
11317
11318 Fri May  2 22:08:05 1997  Ben Pfaff  <blp@gnu.org>
11319
11320         * ascii.c: (ascii_text_get_font_position) Removed.
11321
11322         * expr.h, exprP.h: Disabled debugging.
11323
11324         * groff-font.c, postscript.c: Changed `groff' to `Groff' in
11325         several places.
11326
11327         * output.h: (struct outp_class_struct) Removed
11328         text_get_font_position method.  All references deleted.
11329
11330         * postscript.c: Big change here.  Fontmaps were completely
11331         eliminated because of a change in philosophy.  Comment fixes.
11332         (struct ps_fontmap, ps2dit_map, font_family, dit2family_map)
11333         Removed.
11334         (struct ps_driver_ext) `position', `fontmap', `prop_name',
11335         `fixed_name' members removed.  New members `prop_family',
11336         `fixed_family'.  `family' member changed to type char *.
11337         (static var ps_fontmaps) Removed.
11338         () Removed.
11339         (ps_init_driver) Removed obsolete references, updated.
11340         Initializes `translate_x', `translate_y', `scale'.  Doesn't read
11341         fontmap, of course.  Refers to font names through internal_name
11342         rather than subversive means.  Frees proper items.
11343         (static var option_tab[]) Removed `fontmap-file' option; renamed
11344         `fixed-font', `prop-font'.
11345         (ps_option) Corresponds to option_tab[].
11346         (read_fontmap, release_fontmap, ps_to_dit, compare_ps2dit,
11347         hash_ps2dit, compare_dit2family, hash_dit2family, compare_family,
11348         hash_family) Removed.
11349         (postopen) Generates font names from family names.  Gets
11350         PostScript font name properly.  New prologue file comment `!!!'
11351         style.
11352         (ps_open_page) Adds translate_x, translate_y to BP prologue
11353         function; gives SF argument floating-point format.
11354         (ps_text_set_font_by_name) Doesn't try to map PostScript->Groff
11355         font name.  Doesn't change font family.
11356         (ps_text_set_font_by_position) Generates Groff font name from font
11357         family name instead of through table lookup.
11358         (ps_text_set_font_by_family) Renamed `ps_text_set_font_family',
11359         all references changed.  Reduced to simple string assignment.
11360         (ps_get_font_name) Removed.
11361         (ps_get_font_family) Reduced to string return.
11362         (text) Doesn't save `position' since it no longer exists.  Ugly
11363         kluge to save font family--fix soon?
11364         (load_font) Removed PostScript name argument.
11365         
11366 Thu May  1 14:58:59 1997  Ben Pfaff  <blp@gnu.org>
11367
11368         * postscript.c: Comment fix.
11369         (ps_open_page) Puts scale factor in PostScript output.
11370         
11371 Sat Apr 26 11:49:32 1997  Ben Pfaff  <blp@gnu.org>
11372
11373         * Makefile.am: Distcleans q2c.
11374
11375 Wed Apr 23 21:33:48 1997  Ben Pfaff  <blp@gnu.org>
11376
11377         * ascii.c: (delineate) Sets text size even if width is zero.
11378
11379         * command.c: Comment fix.
11380         (static var cmd_table[]) Re-enabled EVALUATE command.
11381         (parse_cmd) Lotsa comment fixes.  Fixed infinite loop in parsing
11382         of comments in script files.  Now more liberal on criteria for
11383         performing a state transition--if *anything* happened correctly,
11384         not just if *everything* happened correctly.
11385
11386         * data-out.c: (convert_F) Comment fix.  Why in the fsck does
11387         Checker segfault on formatting large numbers and why in the fsck
11388         hadn't I noticed this before?
11389
11390         * expr.h, exprP.h: No longer turn off GLOBAL_DEBUGGING.
11391
11392         * list.q: (cmd_list) Commented out the actual output routine
11393         because of various problems.  Probably will abandon the idea of
11394         using the general `crushed tables' for the LIST procedure.
11395
11396         * temporary.c: (restore_dictionary) Sets var_by_name to NULL after
11397         clearing it.  Allocates a new var_by_name dictionary before trying
11398         to add members to it.
11399
11400         * vars-atr.c: [DEBUGGING] (dump_one_var_node) Removed argument
11401         `sib'.  Changed type of `node' argument.
11402         [DEBUGGING] (dump_var_tree) Replaced avlwalk() with
11403         avl_walk_inorder().
11404         (clear_variable) Only dumps the var tree if var_by_name non-NULL.
11405         [DEBUGGING] Only deletes the variable from var_by_name if that var
11406         non-NULL.
11407
11408 Fri Apr 18 16:48:41 1997  Ben Pfaff  <blp@gnu.org>
11409
11410         * Makefile.am: Added include files to SOURCES.  Added
11411         frequencies.q to EXTRA_DIST.  Removed include/ from INCLUDES.  Now
11412         includes rules for q2c.  Added `boast' target.
11413
11414 Fri Apr 18 15:42:22 1997  Ben Pfaff  <blp@gnu.org>
11415
11416         * Makefile.am: Maintainer-clean Makefile.in.
11417         
11418         * Makefile.am: Fixed redundant EXTRA_DIST line.
11419
11420         * ascii.c: Comment fixes.
11421         (ascii_line_vert) Fixed overly aggressive range check.
11422
11423         * display.c: Removed dead code.
11424
11425         * list.q: Turn debugging on.
11426         (flush_table) New debug code.
11427
11428         * sfm-read.c: (read_value_labels) malloc's the structure before
11429         trying to assign to its members.
11430
11431         * sfm-write.c: Comment fix.
11432
11433         * som-high.c: (som_submit_table) Sets som.t and som.d on each call
11434         to output_table().
11435         (output_table) No arguments anymore--gets them through `som'
11436         global.  New debug code.  In crushed tables, now sets `htv' as
11437         well as `hv' to avoid bad confusion later.
11438         (dump_crush_page) New debug code.
11439
11440         * som-low.c: (som_dump_crush_page) New debug code.
11441
11442 Thu Mar 27 01:11:29 1997  Ben Pfaff  <blp@gnu.org>
11443
11444         All source files: Broke long lines into multiple lines.
11445         
11446         * ascii.c: (ascii_close_page) Uses host_system var in place of
11447         HOST_SYSTEM constant.
11448
11449         * cmdline.c: (var syntax_message[]) Broke into
11450         pre_syntax_message[] and post_syntax_message[].
11451         (usage) Outputs both parts, separated by driver list.
11452
11453         * error.h: Fixed broken formatting.
11454
11455         * expr-opt.c: (str_search, str_rsearch) New functions.
11456
11457         * misc.c: (blp_getdelim) Removed.  All references changed to
11458         `getdelim'.
11459         (str_search, str_rsearch) Removed.
11460         (memrmem) New function.
11461
11462         * misc.h: (blp_getline) Removed.  All reference changed to
11463         `getline'.
11464
11465         * stat.h: New file.
11466
11467         * filename.c: Includes "stat.h", not <sys/stat.h>.
11468         (blp_getenv) Uses host_system var instead of HOST_SYSTEM constant.
11469
11470         * output.c: (outp_list_classes) Changed output formatting.
11471
11472         * sfm-write.c: (write_header) Uses host_system var instead of
11473         HOST_SYSTEM constant.
11474         (write_rec_7_34) Extracts version numbers from the version string.
11475         Untested.
11476
11477         * sort.c: Includes "stat.h", not <sys/stat.h>.
11478
11479         * str.c: (strcasecmp) Removed.
11480
11481         * title.c: (cmd_document) Uses host_system var instead of
11482         HOST_SYSTEM constant.
11483
11484         * version.c: Generated on-the-fly by the Makefile instead of being
11485         static.
11486
11487         * str.h: Comment fixes.  Doesn't substitute for missing memmove or
11488         memcpy.
11489         [!HAVE_STRNCASECMP] Declares strncasecmp().
11490
11491         * version.h: Removed stray character.  Comment fixes.
11492         (vars host_system, build_system) New vars.
11493
11494 Mon Mar 24 21:47:31 1997  Ben Pfaff  <blp@gnu.org>
11495
11496         * Most source files: Changed formatting of copyright notice; fixed
11497         FSF address; reformatted to better conform to GNU standards;
11498         comment fixes.  Added markups to prevent GNU indent from messing
11499         up my beautiful formatting :-).
11500         
11501         * q2c.c: (get_line) Ignores lines that begin with `/* *INDENT' so
11502         that GNU indent markups can be passed through without problems.
11503
11504 Wed Feb 19 21:30:31 1997  Ben Pfaff  <blp@gnu.org>
11505
11506         * get.c: Turned off debugging.
11507
11508         * glob.c: (init_glob) Turned on save-file compression by default.
11509
11510         * sfm-write.c: (sfm_write_case) Fixed bug which resulted in less
11511         compression than was possible in save files.
11512
11513 Sun Feb 16 20:57:20 1997  Ben Pfaff  <blp@gnu.org>
11514
11515         * data-out.c: (convert_F) Comment fixes.  Debug message fixes.
11516
11517         * frequencies.q: Removed Fiasco extensions.  Updated calculation
11518         algorithms.  Polished output format. 
11519         (struct frq_info_struct) Removed members `max_degree', `min_n',
11520         all references removed.
11521         (macro frq_extensions) Removed.
11522         (static vars min_n, max_degree) Removed, all references removed.
11523         (internal_cmd_frequencies) Doesn't handle extensions.  Doesn't
11524         calculate `min_n', `max_degree'.
11525         (postcalc) Passes new arg to dump_statistics().
11526         (dump_full) Honor NOLABEL option.  Buggy?  Adds variable name
11527         title.
11528         (dump_condensed) Adds variable name title.
11529         (sum_freqs) Removed.
11530         (calc_stats) Updated calculation algorithm.
11531         (dump_statistics) Removed warning for too-few observations.
11532         Changed table formatting.  Adds variable name title if passed new
11533         arg is nonzero.
11534
11535         * output.h: Comment fix.
11536
11537         * recode.c, sample.c, sort.c: Disabled debug code.
11538
11539         * som-frnt.c: (som_set_value, som_set_float, som_set_text)
11540         Improved debug code.
11541
11542         * var.h: (enum series frq_*) Removed Fiasco extensions.
11543
11544 Sat Feb 15 21:26:53 1997  Ben Pfaff  <blp@gnu.org>
11545
11546         * command.c: Added PROCESS IF to command table.
11547
11548         * Lots & lots of places, removed checks for NULLs preceding calls
11549         to free_expression(), which itself checks.
11550
11551         * descript.q: Removed Fiasco extensions.  Removed optimizations
11552         for non-weighted active files.  Implemented some options.
11553         Finished polishing output format.  Comment fixes.  Merged
11554         `descript.g'.
11555         (static vars n_glob_miss_list, n_glob_valid, n_glob_missing,
11556         max_degree, min_n) Removed.
11557         (macro dsc_extensions) Removed.
11558         (struct dsc_info_struct) Removed `min_n' member, all references
11559         fixed.
11560         (internal_cmd_descriptives) Removed calculation of min_n,
11561         max_degree.  Only deals with one `calc' routine instead of two
11562         flavors.
11563         (precalc) Eliminated redundancy.  Updated for changes to
11564         descriptives_proc structure.
11565         (calc) Moved here from `descript.g'.  Rewritten to calculate
11566         statistics via `moments about the mean' rather than by summing,
11567         summing squares, summing cubes, and so on.
11568         (postcalc) Rewritten for new-style statistical calculation.
11569         (display) Removed support for displaying variables across rows.
11570         No longer crushes the descriptives table.  Removed ancient code.
11571         Added display of N, by variable and listwise.
11572
11573         * descript.g: Removed; merged into `descript.q'.
11574
11575         * expr-evl.c: (evaluate_expression) Now returns a double.  For
11576         numeric results, it returns the result as well as storing it in
11577         the passed `value' structure if non-NULL.  For string results it
11578         just returns 0.0 and it must be passed non-NULL.  Many references
11579         to this function were optimized by use of this change, especially
11580         but not exclusively in `compute.c'.
11581
11582         * frequencies.g: Comment fix.
11583
11584         * glob.c: (glob var process_if_expr) New global var.
11585
11586         * postscript.c: (static var option_tab[]) Corrected entry for
11587         `fixed_size'.
11588         (postopen) Sets x->size to x->prop_size.
11589         (ps_text_set_font_by_name) Sets font size as well as typeface for
11590         PROP and FIXED fonts.
11591         
11592         * sel-if.c: (cmd_process_if) New function.
11593
11594         * sfm-write.c: (struct sfm_fhuser_ext) New member `n_cases'.
11595         (sfm_write_dictionary) Sets `n_cases' to 0.
11596         (sfm_write_case) Increments `n_cases'.
11597         (sfm_close) Attempts to seek the system file back to the header
11598         and write the number of cases in its proper slot.
11599
11600         * som-frnt.c: (som_insert_table) Masks off expansion options since
11601         only SOPT_X_NORM seems to work sensibly.
11602
11603         * som-low.c: (get_cell_size) Fixed bug when a table cell was sized
11604         with a `fixed' value of 2.
11605
11606         * sort.c: (cmd_sort_cases) Cancels PROCESS IF.
11607
11608         * sysfile-info.c: (cmd_sysfile_info) Doesn't display more than 10
11609         value labels; uses SOPT_NONE instead of SOPT_X_BOTH.
11610
11611         * var.h: (enum series dsc_*) Removed Fiasco extensions.
11612         (struct descriptives_proc) Removed `miss_noweight'; new members
11613         `X_bar', `M2', `M3', `M4', `min', `max'.
11614
11615         * vars-atr.c: (discard_variables) Cancels PROCESS IF.
11616
11617         * vfm.c: (close_active_file) Cancels PROCESS IF.
11618         (write_case) Doesn't process cases unselected by PROCESS IF.
11619
11620 Fri Feb 14 23:32:58 1997  Ben Pfaff  <blp@gnu.org>
11621
11622         * glob.c: (glob var err) Removed.
11623
11624         * sysfile-info.c: (cmd_sysfile_info) When adjusting table size,
11625         doesn't have to take into account number of value labels since
11626         they're in a subtable anyway.  Also, doesn't display more than 10
11627         value labels since we can't yet break pages in subtables.
11628
11629 Tue Feb  4 15:15:50 1997  Ben Pfaff  <blp@gnu.org>
11630
11631         * som-frnt.c: (som_change_table_size) Simple change for elegance
11632         that shouldn't change behavior.
11633         (som_set_value) Comment fix.
11634
11635         * som-high.c: (som_submit_table) Message fix.
11636
11637 Wed Jan 22 21:54:00 1997  Ben Pfaff  <blp@gnu.org>
11638
11639         * command.c: Added SYSFILE INFO to command table.
11640
11641         * file-handle.q: (fh_handle_filename) New function.
11642
11643         * get.c: (save_trns_proc) Fixed a bug in padding of output data
11644         with spaces.
11645
11646         * main.c: (parse) New return value for command functions, -3.
11647
11648         * misc.h: Comment fix.
11649
11650         * output.h: Comment fixes.
11651         (macro COMPONENTS) Removed.
11652
11653         * postscript.c: (write_text) Modified literal_chars[] so that `('
11654         and ')' are not written to the output in strings as literals.
11655
11656         * sfm-read.c: (sfm_read_dictionary) New argument.
11657         (read_header) New argument.  Sets the information structure's
11658         values from the header information.  
11659         (read_variables) [__CHECKER__] Redefines isalnum()--some sort of
11660         bizarre Checker problem, I guess.
11661         (read_variables) Proper cleanup on lossage.
11662
11663         * sfm.h: (struct sfm_read_info) New struct for use by
11664         sfm_read_dictionary().
11665
11666         * som-frnt.c: (som_create_table) New argument CREATE_FLAGS,
11667         currently used just for tables that can be dynamically resized and
11668         thus have to be allocated with arena_malloc() instead of
11669         arena_alloc().  All references changed.
11670         (som_change_table_size) New function.
11671         (som_insert_table) Bugfix: now inserts `cell', not `c'!
11672
11673         * som-high.c: [GLOBAL_DEBUGGING] (check_table) Moved to som-low.c.
11674         (som_submit_table) [GLOBAL_DEBUGGING] Doesn't call check_table()
11675         any more.
11676
11677         * som-low.c: (draw_cell) Calls draw_table_cell() for SCON_TABLE
11678         cells.
11679         (draw_intersection) Now takes an argument specifying the table in
11680         question.  All references changed.
11681         (draw_table_cell) New function.
11682         (som_get_table_size) [GLOBAL_DEBUGGING] Calls check_table().
11683         (som_get_table_size) Many nice new explanatory comments.
11684         [GLOBAL_DEBUGGING] (check_table) Moved here from som-high.c.
11685
11686         * som.h: New enum series SOM_CREATE_* for use as create flags with
11687         som_create_table().
11688
11689         * str.h: Moved a comment here from TODO.
11690
11691         * sysfile-info.c: New file.  Reference implementation.
11692
11693 Sun Jan 19 14:22:11 1997  Ben Pfaff  <blp@gnu.org>
11694
11695         * command.c: Added RENAME VARIABLES to table of commands.
11696
11697         * data-in.c: (dls_error) Sets `cust_field'.
11698         (parse_N) Message fix.
11699         (parse_day_count) New function.
11700         (to_roman) Never outputs VX as a `short form' of V.
11701         (parse_month) Fixed parsing of Roman numerals.
11702         (parse_trailer) Message fix.
11703         (parse_DATE, parse_ADATE, parse_EDATE, parse_SDATE, parse_JDATE,
11704         parse_QYR, parse_MOYR, parse_WKYR, parse_DTIME) Issue a message if
11705         the date is invalid.
11706         (parse_SDATE) Fixed swapped day, year.
11707         (parse_JDATE) Fixed bug for dates in 1582.
11708         (parse_DTIME) Allows days not between 1 and 31.
11709         (parse_numeric) Makes local copy of f.type for easier usage.
11710         FMT_DOLLAR fixed.
11711
11712         * data-out.c: (convert_F) When outputting as scientific, properly
11713         sets f.type as fp->type.
11714         (insert_commas) Fixed operator precedence problem with setting of
11715         nitems.  Changed strcpy to memcpy (no null terminator). 
11716         (convert_date) Fixed FMT_JDATE: added 1900 to year.
11717         (convert_CCx) Essentially rewritten, but now it works.
11718
11719         * display.c: (cmd_display) Added DISPLAY FILE LABEL (undocumented
11720         feature of Fiasco).
11721         (display_documents) Implemented.
11722
11723         * error.c: (glob var cust_field) New var.
11724         (vmsg) Displays cust_field as part of message classes DE and DW.
11725
11726         * formats.c: (debug_print) Fixed to compile under updated
11727         dictionary format.
11728
11729         * get.c: (cmd_get, cmd_save_internal) Close file handle on
11730         failure.
11731
11732         * misc.c: (parse_format_specifier) Formatting fix.
11733
11734         * modify-vars.c: (struct var_modification) Renamed `n_reorder' as
11735         `n_rename' for clarity.
11736         (cmd_modify_vars) Initializes `forward' and `positional' at
11737         appropriate times.  Frees lists of vars to rename on failure.
11738         Comment fix.  Frees memory on success.  
11739         (rearrange_dict) Simplified `for' loop condition.
11740
11741         * rename-vars.c: New file (reference implementation).
11742         
11743         * set.q: (internal_cmd_set) Fixed `emu' test condition.
11744
11745         * sfm-read.c: (read_header) File label is created only if file
11746         label in file is not blank.
11747         (read_variables) Initializes `dict' local variable.
11748         (read_documents) Proper behavior on lossage.
11749
11750         * sfm-write.c: (write_header) Doesn't blank out the file label
11751         (why was this here to begin with?!)
11752
11753         * temporary.c: (save_dictionary) File label is copied only if
11754         non-NULL.  Doesn't try to xstrdup() dictionary documents.
11755         Adapted so as to not irritate Checker.
11756         (free_dictionary) Only destroys var_by_name if non-NULL.
11757
11758         * title.c: (cmd_file_label) Doesn't skip FILE, LABEL tokens.
11759         (cmd_document) Doesn't skip DOCUMENT token.  Adds some header
11760         lines to the document, indents the document.  Also, it works now.
11761         (add_document_line) New function.
11762
11763         * var.h: (struct dictionary) Reordering.
11764
11765         * vars-prs.c: (parse_variables) On lossage, only local_free()'s
11766         bits if it was allocated to begin with.
11767
11768 Thu Jan 16 13:08:57 1997  Ben Pfaff  <blp@gnu.org>
11769
11770         * command.c: Added MODIFY VARS to list of commands.
11771
11772         * configure.in: Updated custom macros for autoconf 2.12.  Removed
11773         mmap reference; fixed termcap library reference.
11774
11775         * display.c: (display_variables) Fixed a few bugs although it's
11776         still not well written.
11777
11778         * error.c: [!__CHECKER__] (chkr_disp_call_chain) New function.
11779         (induce_segfault) Calls chkr_disp_call_chain() instead of
11780         inducing an actual SIGSEGV.
11781
11782         * expr-opt.c: (evaluate_tree) Swapped order of arguments to
11783         str_search() and str_rsearch().  Fixed tests for matches on
11784         OP_INDEX and OP_RINDEX.
11785
11786         * filename.c: (good_getcwd) Removed as the new libc for Checker
11787         doesn't contain this bug, apparently.
11788
11789         * misc.c: (str_search, str_rsearch) Changed order of arguments for
11790         consistency with GNU memmem.
11791         (blp_getdelim) Changed `len' from `int' to `size_t'.
11792
11793         * modify-vars.c: Reference implementation.
11794
11795         * som-frnt.c: (zero_length) New global var.
11796         (som_create_table) Message fix.
11797
11798         * som.h: Added gcc attributions to som_set_text(),
11799         som_output_text() prototypes.  blank_line() refers to
11800         zero_length[] instead of a literal null string to suppress gcc
11801         warnings.
11802
11803         * sort.c: (do_external_sort) Fixed fencepost error on lossage.
11804         (allocate_cases) Decrements x_max so the last element of x[] can
11805         be used by the algorithm.
11806
11807         * var.h: Changed minor details of `variable' declaration.  
11808         (struct modify_vars_proc) New struct.
11809         (struct variable) Added field p.mfv.
11810
11811         * vars-atr.c: Comment fix.
11812
11813         * vars-prs.c: (fill_all_vars) More optimal implementation.
11814
11815         * vfm.c: (dump_splits) Sets the last byte of temp_buf to a null
11816         character, which it shouldn't have to do but printf() seems to
11817         read the null byte even though I supply a maximum length...
11818
11819 Fri Jan 10 20:22:08 1997  Ben Pfaff  <blp@gnu.org>
11820
11821         * command.c: Removed command alias X for QUIT.
11822         (parse_cmd) Fixed comment parsing.
11823
11824         * dfm.c: (struct dfm_fhuser_ext) Fields `len', `size' are now of
11825         type size_t.
11826         (read_record) Fixed references to len, size.
11827         (dfm_get_record) Restructured.
11828
11829         * file-handle.h: (struct file_handle) Field `lrecl' now of type
11830         size_t.
11831
11832         * file-handle.q: (internal_cmd_file_handle) Checks for nonpositive
11833         record length.
11834
11835         * modify-vars.c: New file.  Not complete.
11836         
11837         * set.q: (set_ccx) Fixed operator precedence problem regarding ^
11838         and ==.
11839
11840         * sfm-read.c: (bswap_flt64, read_header, write_variable) Fixed
11841         problems caused by int/size_t differences.
11842
11843         * sort.c: (output_record, merge_once) Cast `size_t's to `int's in
11844         appropriate spots.
11845
11846         * str.c: (strcasecmp) Fixed bug that cropped up when the strings
11847         being compared were of equal length.
11848
11849 Thu Jan  2 19:08:23 1997  Ben Pfaff  <blp@gnu.org>
11850
11851         * command.c: Added DOCUMENT, DROP DOCUMENTS, FILE LABEL.
11852
11853         * lexer.c: (get_dotted_rest_of_line) New function.
11854
11855         * sel-if.c: (cmd_filter) Cannot choose string or scratch variables
11856         as filters.
11857
11858         * sfm-read.c: (sfm_read_dictionary) Calls read_documents() to read
11859         type 6 records.  Frees the dictionary properly.
11860         (read_header) Initializes the dictionary instead of letting
11861         read_variables() do it.  Sets the dictionary file label from the
11862         system file.
11863         (read_documents) New function.
11864
11865         * sfm-write.c: (sfm_write_dictionary) Calls write_documents() to
11866         write type 6 record if appropriate.
11867         (write_header) Writes file label from dictionary.
11868         (write_documents) New function.
11869
11870         * temporary.c: (save_dictionary, restore_dictionary,
11871         free_dictionary) Properly handle new fields in dictionary struct.
11872
11873         * title.c: (get_title) Returns after failure().
11874         (cmd_file_label, cmd_document, cmd_drop_documents) New functions
11875         for new commands FILE LABEL, DOCUMENT, DROP DOCUMENTS.  Untested.
11876
11877         * var.h: (struct dictionary) New fields `label', `n_documents',
11878         `documents'.
11879
11880 Wed Jan  1 22:08:10 1997  Ben Pfaff  <blp@gnu.org>
11881
11882         * command.c: Added FILTER to list of commands.
11883
11884         * frequencies.g: [WEIGHTING] Removed test for weighting!=-1 since
11885         it's always true.
11886
11887         * get.c: (cmd_save_internal) Removed weighting code since it's now
11888         handled by sfm-write.c.  Properly commented out debug code.
11889
11890         * glob.c: (glob var weighting) Removed.
11891
11892         * sel-if.c: Comment fixes.
11893         (cmd_filter) New function.
11894
11895         * sfm-read.c: (struct sfm_fhuser_ext) New field `weight_index'.
11896         (sfm_read_dictionary) Sets weighting variable direct in the
11897         created dictionary now.  (Apparently we previously didn't support
11898         weighting on GET?)
11899         (read_header) Sets weight_index field in sfm_fhuser_ext from
11900         header read from disk.
11901
11902         * sfm-write.c: (sfm_write_dictionary) Comment fix.
11903         (write_header) Now sets the weighting in the header from the
11904         passed primary dictionary instead of from the sfm_write_info.
11905
11906         * sfm.h: (struct sfm_write_info) Removed field `weight'.
11907
11908         * som-high.c: (dump_crush_table) Fixed a couple of assertions that
11909         broke on boundary conditions.
11910
11911         * var.h: (struct dictionary) New fields `weight_var',
11912         `weight_index', and `filter_var'.
11913         (glob var weighting) Removed.  This is now part of struct
11914         dictionary.  All references changed; the less mechanical changes
11915         are described above.
11916
11917         * vars-atr.c: (find_dict_variable) New function.
11918
11919         * vfm.c: (static var filter_index) New variable.
11920         (open_active_file) Initializes filter_index from default_dict.
11921         (write_case) Calls proc_func() only if the filter variable is
11922         nonzero; this implements FILTER behavior.
11923
11924         * weight.c: (static var weight_varname) Removed.
11925         (cmd_weight) Modified default_dict instead of glob vars.
11926         (update_weighting) Changed the signature to modify a dictionary
11927         instead of glob vars.  Now returns the weighting variable.
11928         (get_weighting_variable) Removed; its function is absorbed by
11929         update_weighting().
11930         (stop_weighting) Operates on a dictionary now.
11931
11932 Wed Jan  1 17:00:59 1997  Ben Pfaff  <blp@gnu.org>
11933
11934         * sort.c: Removed debugging info from messages.
11935         (do_external_sort) Cleans up after itself by deleting the
11936         temporary directory on failure.  (On success it is deleted by the
11937         input program.)
11938         (allocate_cases) Removed debug code.  Added clean up code.
11939         (output_record) Removed debug code.
11940         (merge) Added code to close all the input files that are currently
11941         open.  This is a likely location for bugs, because I'm not sure
11942         about boundary conditions.  Removed an unnecesary heap_delete().
11943         (merge_once) Removed input file "optimization" that in fact
11944         screwed up the rest of the code.  Message and comment fixes.
11945
11946 Sun Dec 29 21:36:48 1996  Ben Pfaff  <blp@gnu.org>
11947
11948         * error.c: [__CHECKER__] (induce_segfault) Flushes output streams.
11949
11950         * heap.c: (heap_delete) New argument.
11951
11952         * sort.c: Finished implementation of external sort.
11953
11954         * vfm.c: (read_from_disk) Returns after a disk error.
11955
11956 Sun Dec 22 23:10:39 1996  Ben Pfaff  <blp@gnu.org>
11957
11958         * sort.c: (static var state) Removed.
11959         (static vars max_handles, tmp_basename, tmp_extname,
11960         huffman_queue) New variables.
11961         (do_external_sort) Moved most code to new functions.
11962         Creates huffman_queue.
11963         (allocate_file_handles, allocate_cases) New functions.
11964         (static vars run_no, run_length, file_index, case_count) New
11965         variables. 
11966         (output_record) Returns success.  Now really writes to the output
11967         file.
11968         (begin_run, end_run) New functions.
11969         (write_initial_runs) Returns success.  Initializes run_no to -1.
11970         Calls begin_run(), end_run() at appropriate times.  Outputs debug
11971         messages.
11972         (write_to_sort_cases) Calls begin_run(), end_run() at appropriate
11973         times.
11974         (merge) New function.
11975
11976         * heap.c, heap.h: New files.  Hopefully in near-final form.
11977
11978 Sat Dec 21 21:51:04 1996  Ben Pfaff  <blp@gnu.org>
11979
11980         * glob.c: Added write_active_file to global vars.
11981
11982         * sort.c: Several new miscellaneous static variables.
11983         (cmd_sort_cases) Big comment fix.
11984         (perform_case_2) Renamed `do_external_sort' and completely
11985         rewritten.
11986         (case_2_proc_func) Removed.
11987         (output_record, write_initial_runs, write_to_sort_cases,
11988         compare_record) New functions.
11989
11990         * vfm.c: [DEBUGGING] (index_to_varname) Excised bit rot.
11991
11992 Tue Dec 17 18:57:59 1996  Ben Pfaff  <blp@gnu.org>
11993
11994         * sort.c: (perform_case_2) Changed the method for allocation of
11995         lots of memory--now allocates one case at a time in hopes that
11996         more cases can be allocated with heavily fragmented memory.
11997
11998         * var.h: (write_active_file) New global var.
11999
12000         * vfm.c: (procedure, close_active_file, write_case,
12001         SPLIT_FILE_procfunc) Now allow beginfunc, procfunc, and endfunc
12002         arguments to procedure() to be NULL.  All references to
12003         procedure() that made use of dummy functions were changed to NULL
12004         functions.
12005         (open_active_file) If write_active_file is non-NULL, the output
12006         device becomes DEV_PGM (a new enum).
12007         (close_active_file) Sets write_active_file to NULL.
12008         (read_from_memory) Comment fix.
12009         (record_case) Calls write_active_file() when the output device is
12010         DEV_PGM.
12011
12012 Sun Dec 15 15:32:16 1996  Ben Pfaff  <blp@gnu.org>
12013
12014         * sort.c: New file.
12015
12016         * autorecode.c: (cmd_autorecode) Fixed parsing of options.
12017         Fixed checking for duplicate varnames.
12018         (recode) xmalloc()'s the transformation instead of arena_alloc()'ing
12019         it.
12020         (autorecode_trns_free) Destroys hash tables for each recoding
12021         specification.
12022         (autorecode_proc_func) Compares NULL to *vpp instead of vpp.
12023
12024         * command.c: Added SORT CASES to cmd_table.
12025         (null_func, null_int_func) Prototyped.
12026
12027         * descript.g: (calc_weight, calc_noweight) Computes own case
12028         number now.
12029         
12030         * frequencies.q: (dump_statistics) Fixed problem with
12031         too-few-cases warning message.
12032
12033         * get.c: (cmd_save_internal) Handles weighting properly.
12034
12035         * hash.c: (hsh_dump) Output format changed.
12036         (force_hsh_insert) Actually works now, prototype changed.
12037
12038         * list.q: (static var case_num) New variable.
12039         (cmd_list) Initializes case_num.
12040         (list_cases) Increments case_num.
12041
12042         * var.h: Added definitions for SORT CASES.  Comment fixes.
12043
12044         * vfm.c: Some definitions moved to new file vfmP.h.  Comment
12045         fixes.  `active' renamed vfm_active, `rep' renamed
12046         vfm_replacement, all references changed.
12047         (procedure) The procfunc no longer receives a case number.  All
12048         references changed.
12049         (write_case) Subtle reordering.
12050         (SPLIT_FILE_procfunc) Counts cases differently.  Slightly less
12051         redundant.
12052
12053         * weight.c: (get_weighting_variable) New function.
12054
12055         * vfmP.h: New file with definitions from vfm.c.
12056
12057 Sat Dec 14 10:35:30 1996  Ben Pfaff  <blp@gnu.org>
12058
12059         * command.c: (FILE_TYPE_okay) Commented out some tests because
12060         they're clumsy and not yet needed.
12061
12062         * var.h: Most *_trns structures moved to their respective source
12063         files.  Some were moved into a new file, do-ifP.h.  Comment fixes.
12064         (union any_trns) Changed to a typedef for trns_header.
12065         (struct input_program_pgm) Removed.
12066
12067         * vars-prs.c: (parse_variables) Only local_free()'s bits if it
12068         was allocated in the first place.
12069
12070 Fri Dec 13 21:30:53 1996  Ben Pfaff  <blp@gnu.org>
12071
12072         * autorecode.c: New file.
12073         
12074         * command.c: Added AUTORECODE to command table; re-enabled SET.
12075
12076         * data-out.c: (convert_F) Handles infinities and NaNs properly.
12077
12078         * error.c: (vmsg) Comment fixes.
12079
12080         * hash.c: Comment fix.
12081         (hashpjw_d) New function.
12082         (hashpjw) Reimplemented as call to more general function
12083         hashpjw_d().
12084         (internal_comparison_fn) Initializes pointers properly.
12085         (hsh_sort) [GLOBAL_DEBUGGING] New debugging code.
12086         (force_hsh_insert, force_hsh_find) New debugging wrapper
12087         functions.
12088
12089         * main.c: (main) Message fix.
12090
12091         * output.c: (outp_read_devices) Message fix.
12092
12093         * set.q: Comment fixes.
12094         (custom_results) Implemented Wnd/X form of subcommand.
12095         (set_routing) New function.
12096         (internal_cmd_set) Implemented ERRORS, MESSAGES.
12097
12098         * settings.h: (SET_ROUTE_*) New enum series.
12099         (set_results) Renamed set_results_file, all references changed.
12100         (set_messages) Removed.
12101         (glob vars set_errors, set_messages, set_results) New vars.
12102
12103         * title.c: (get_title) Remembers to xstrdup() the result of
12104         get_rest_of_line().
12105
12106         * var.h: (arc_item, arc_spec, autorecode_trns) New structures for
12107         use by AUTORECODE.
12108         (union any_trns) New element `arc'.
12109
12110 Fri Dec  6 23:53:47 1996  Ben Pfaff  <blp@gnu.org>
12111
12112         * command.c: (output_line) Removed references to set_screen.
12113
12114         * error.c: (static var terminating) New var.
12115         (hcf) Sets terminating to 1.
12116         (vmsg) If terminating is nonzero, does not attempt to call hcf().
12117         This prevents an infinite loop if an error occurs within hcf().
12118
12119         * expr-evl.c: (evaluate_expression) [__CHECKER__] Replaced case
12120         statement circumlocution with `case 42000' trick.
12121         (evaluate_expression) New support for OP_STR_MIS.
12122
12123         * expr-opt.c: (evaluate_expression) [__CHECKER__] Replaced case
12124         statement circumlocution with `case 42000' trick.
12125         (dump_node) Handles OP_STR_MIS.
12126
12127         * expr-prs.c: (MISSING_func, SYSMIS_func) Rewrote to handle string
12128         variables exceptions.
12129         (parse_function) Message fix.
12130         (ops[]) Added OP_STR_MIS.
12131
12132         * expr.h: Added OP_STR_MIS to OP_* enum.  Comment fixes.
12133
12134         * exprP.h: [__CHECKER__] Removed case statement circumlocution.
12135
12136         * glob.c: Removed set_scrnfile glob var.
12137         (init_glob) set_errorbreak set to 0 by default.
12138
12139         * groff-font.c: Changed included files.
12140         (groff_read_font) Initializes font_arena local var correctly.
12141         (default_font) New function.
12142
12143         * output.c: Comment fixes.
12144         (glob var disabled_devices) New variable.
12145         [GLOBAL_DEBUGGING] (static var iterating_driver_list) New
12146         variable.
12147         [GLOBAL_DEBUGGING] (reentrancy) New function.
12148         [GLOBAL_DEBUGGING] (outp_read_devices, outp_done, find_driver,
12149         outp_iterate_enabled_drivers) Calls to reentrancy().
12150         (destroy_list) New function.
12151         (outp_done) Moved code to destroy_list().
12152         (parse_options) Parses `listing', `screen', `printer' options
12153         internally.
12154         (configure_driver) Sets new `device' member of driver.
12155         (outp_iterate_enabled_drivers, outp_enable_device) New functions.
12156
12157         * output.h: Comment fixes.  New enum series OUTP_DEV_*.
12158         (struct outp_driver_struct) New member `device'.
12159
12160         * postscript.c: (find_encoding_file) Doesn't display its own error
12161         messages.
12162         (default_encoding) New function.
12163         (switch_font) Calls default_encoding() if no encoding can be
12164         found.
12165         (text) Makes up a character metric if none exists for the desired
12166         character.
12167         (load_font) Properly copies a fallback filename.  Calls
12168         default_font() for a font if none at all are known.
12169
12170         * set.q: Comment fixes.  Removed OUTPUT subcommand.
12171         (custom_listing) Calls outp_enable_device() to enable/disable
12172         listing device.
12173         (turn_screen_on) Removed.
12174         (internal_cmd_set) Calls outp_enable_device() to enable/disable
12175         screen, printer devices.
12176
12177         * settings.h: Comment fixes.
12178         (glob vars set_output, set_printer, set_screen, set_scrnfile)
12179         Removed.
12180
12181         * som-high.c: (som_submit_table, som_eject_page) Use
12182         outp_iterate_enabled_drivers() instead of iterating
12183         outp_driver_list directly.
12184
12185 Wed Dec  4 21:34:17 1996  Ben Pfaff  <blp@gnu.org>
12186
12187         * data-in.c: (parse_EDATE, parse_SDATE) New functions.
12188         (parse_string_as_format) Handles new formats.
12189         (parse_numeric) Now handles DOT and PCT formats.
12190
12191         * data-out.c: (convert_E, convert_F, insert_commas) Handle DOT
12192         format now.
12193         (convert_date) Handle EDATE and SDATE formats.
12194         (convert_CCx) Now if there's not room for the currency characters,
12195         converts it as F format if it's positive instead of giving up
12196         quickly.  Also fixed save-and-restore bug with decimal point
12197         characters.  
12198         (convert_format_to_string) Handles new formats.
12199
12200         * misc.c: (formats[]) Added new formats.
12201         (convert_fmt_ItoO) Supports new formats.
12202
12203         * sfm-read.c: (parse_format_spec) Supports new formats.  Better
12204         data checking.  New argument, all references changed.
12205
12206         * sfm-write.c: (write_format_spec) Supports new formats.
12207
12208         * var.h: New formats FMT_DOT, FMT_PCT, FMT_EDATE, FMT_SDATE.
12209         Comment fixes.
12210
12211 Sun Dec  1 17:19:00 1996  Ben Pfaff  <blp@gnu.org>
12212
12213         * cmdline.c: Comment fixes.
12214         (parse_command_line) Changed return type to void.
12215
12216         * data-in.c: (parse_string_as_format) Added FMT_CCA...FMT_CCE to
12217         switch.
12218         (parse_numeric) Handles international numbers (comma as decimal
12219         point).  Some reformatting.
12220
12221         * data-list.c: (parse_free) Default output format is now
12222         set_format instead of hard-coded F8.2.
12223         (read_from_data_list_list) Emits error message on undefined data
12224         only if set_undefined is nonzero.
12225
12226         * data-out.c: (convert_E) Changes decimal point from period to
12227         comma if appropriate.  Restructured.  Better comments.
12228         (convert_F) Changes decimal point from period to comma if
12229         appropriate.
12230         (insert_commas) Major bug with handling of negative values fixed.
12231         Also, inserts periods instead of commas if appropriate.
12232         (convert_CCx) New function.
12233         (convert_format_to_string) Added FMT_CCA...FMT_CCE to switch.
12234         (num_to_string) Changed `.' to set_decimal.
12235
12236         * dfm.c: Comment fixes.
12237         (dfm_close) Frees ext->line even in inline_file.
12238         (open_inline_file) New function.
12239         (open_file_r) When opening the inline file: now properly
12240         recognizes `BEGIN DATA.' line, and calls open_inline_file() to
12241         finish up.
12242         (read_record) Calls fh_close_handle() instead of dfm_close() to
12243         close the inline file.  Makes a copy of the line getl_buf to avoid
12244         interlock problems.
12245         (dfm_get_record) Restructured.  Now checks the return value of
12246         open_file_r().
12247         (cmd_begin_data) Moved open code into open_inline_file().  Relaxed
12248         checking for use of inline file.  No longer tries to close inline
12249         file.
12250
12251         * error.c: (glob var error_already_flagged) New var.
12252         (vmsg) Message change.  Now checks max number of errors/warnings,
12253         acts on it.
12254
12255         * file-handle.q: (fh_handle_name) Now allows closing of
12256         inline_file.
12257         (fh_init_files) Reformatted.
12258
12259         * get.c: (trim_dictionary) Checks SCOMP option instead of COMP.
12260
12261         * getline.c: (getl_include) Fixed bug that popped up when called
12262         when file queue was empty.
12263         (read_console) Resets error_count, warning_count,
12264         error_already_flagged to zero.
12265
12266         * glob.c: Many changes to update list of variables.
12267         (init_compat_dependent) Now this function is called whenever
12268         `compat' changes.  It now sets set_seed only if it hasn't
12269         previously been referenced.  It now calls
12270         lex_init_compat_dependent().
12271
12272         * include.c: (cmd_include_at) Frees temporary buffer instead of
12273         line buffer.  
12274         (cmd_include) Doesn't make copy of include file name.
12275
12276         * lexer.c: Comment fixes.
12277         (init_lex) Moved some code into new function
12278         lex_init_compat_dependent().
12279         (lex_init_compat_dependent) New function.
12280         (hex_val) Simplified.
12281         (preprocess_line) Uses set_endcmd instead of hardcoding `.'.
12282
12283         * main.c: Comment fixes.
12284         (main) Reformatted.
12285
12286         * misc.c: (formats[]) Added FMT_CCA...FMT_CCE.
12287         (check_input_specifier) Disallows FMT_CCA...FMT_CCE.
12288         (convert_fmt_ItoO) Detects FMT_CCA...FMT_CCE.
12289         (setup_randomize) Sets set_seed_used.
12290
12291         * set.q: Comment fixes.
12292         (custom_results) Conditionalizes on `compat'.
12293         (custom_log) Calls custom_journal().
12294         (set_ccx) New function.
12295         (cmd_set) Calls init_compat_dependent() when `compat' changes.
12296         Calls set_ccx() to handle CCA...CCE.  Sets set_grouping
12297         when set_decimal changes.  Range-checks values for MITERATE,
12298         MNEST.  Message fixes.
12299
12300         * settings.h: Comment fixes.
12301         (struct set_cust_currency) New struct.
12302         (set_cc[], set_grouping, set_seed_used) New global vars.
12303
12304         * var.h: (FMT_CCA...FMT_CCE) New output formats.
12305         (FCAT_OUTPUT_ONLY) New FCAT_* constant.
12306
12307 Thu Nov 28 23:14:07 1996  Ben Pfaff  <blp@gnu.org>
12308
12309         * glob.c: Revised variables to correspond to settings.h.
12310         (init_glob) Initializes variables from settings.h properly.
12311
12312         * set.q: Began long-overdue major revision to correspond to new
12313         philosophy.  Most code changed. 
12314
12315         * settings.h: Mostly changed; reorganized, reordered, large new
12316         comment.
12317
12318 Thu Nov 28 19:46:10 1996  Ben Pfaff  <blp@gnu.org>
12319
12320         * get.c: (cmd_save_internal) No longer forces compression off.
12321
12322         * sfm-read.c: (read_compressed_data) If eof is reached when
12323         reading a new instruction octet, only signal error if we're in the
12324         middle of a case.
12325
12326         * sfm-write.c: (COMPRESSION_BIAS) New #define.
12327         (struct sfm_fhuser_ext) New member `end'.
12328         (write_header) Refers to COMPRESSION_BIAS instead of magic 100.0.
12329         (ensure_buf_space) New function.
12330         (sfm_write_case) Reimplemented in order to support compression.
12331         (sfm_close) Writes out the remaining contents of the compression
12332         buffer if any.
12333
12334 Wed Nov 27 23:18:35 1996  Ben Pfaff  <blp@gnu.org>
12335
12336         * command.c: Defined SAVE and XSAVE commands in command table.
12337
12338         * common.h: second_lowest_value is of type flt64, not double.
12339
12340         * file-handle.h: Comment fix.
12341
12342         * get.c: Comment fixes.
12343         (static var `trns') New.
12344         (save_write_case_func, save_trns_proc, save_trns_free, null_func,
12345         cmd_save_internal, cmd_save, cmd_xsave) New functions.
12346         (dict_delete_run) Clears the variables and frees them now.
12347         (trim_dictionary) Sets default for compression.
12348         On KEEP subcommand, frees deleted variables as well as clearing
12349         them.  Finally got the sense of the test for deleting all
12350         variables correct.
12351         [DEBUGGING] (dump_dict_variables) Message fix.
12352
12353         * glob.c: (init_glob) set_compression set to 1 by default.
12354
12355         * list.q: Properly #includes config.h.
12356
12357         * misc.h: New macro REM_RND_UP.
12358
12359         * settings.h: Comment fix.
12360
12361         * sfm-read.c: (structs sysfile_header, sysfile_format,
12362         sysfile_variable; inline function bswap_int32) Moved to new file
12363         sfmP.h.
12364         (corrupt_msg) [__CHECKER__] No longer induces segfault.
12365         (sfm_read_dictionary) Fixed bug caused by failing to initialize
12366         var_by_index.
12367         (read_machine_flt64_info) Fixed some problems caused by confusion
12368         between flt64 and double types.
12369         (read_header) Message fix.
12370         (read_variables) Fixed set of cases in which we byte-swap sv.print
12371         and sv.write.  Fixed confusion of flt64 and double.
12372
12373         * sfm.h: (struct sfm_write_info) New.
12374
12375         * som-high.c: (som_draw_title) Properly frees `s'.
12376
12377         * temporary.c: (save_dictionary) Comment fix.
12378
12379         * var.h: Comment fixes.  New FMT_* enum, FMT_NUMBER_OF_FORMATS.
12380         (struct trns_header) Formatting fix.
12381         (struct save_trns) New.
12382
12383         * vars-atr.c: (discard_variables) Comment fix.
12384
12385         * sfm-write.c: New file, baseline release.
12386
12387         * sfmP.h: New file, baseline release.
12388
12389 Sun Nov 24 14:53:53 1996  Ben Pfaff  <blp@gnu.org>
12390
12391         * cmdline.c: (parse_command_line) `--version' output updated.
12392         (glob var syntax_message[]) Added my e-mail address.
12393
12394         * file-handle.q, lexer.c, vfm.c: Changed many instances of
12395         `illegal' to `invalid'.
12396
12397         * sfm-read.c: (struct sfm_fhuser_ext) New fields used as
12398         uncompression buffer.
12399         (sfm_close) Frees decompression buffer.
12400         (sfm_read_dictionary) Initializes decompression buffer.
12401         (buffer_input, read_compressed_data) New functions.
12402         (sfm_read_case) Restructured; now calls read_compressed_data() to
12403         handle compressed system file data.
12404
12405         * var.h: Comment fix.
12406
12407 Mon Nov 11 15:34:09 1996  Ben Pfaff  <blp@gnu.org>
12408
12409         * dfm.c: (dfm_close) Does not set h->{ext,class} because the
12410         caller handles it.
12411          
12412         * get.c: New comments.  New static var `get_file'.
12413         (cmd_get) Now fully implemented.  Calls discard_variables();
12414         initializes fv and lv for all variables; new debug code; sets
12415         up the dictionary; sets up the input program.
12416         (read_from_get, cancel_get) New functions.
12417
12418         * sfm-read.c: Comment fixes.
12419         (sfm_close) New static function.
12420         (sfm_read_dictionary) Properly sets up the class of the
12421         file_handle.  No longer cares what size the data is in records of
12422         type 7.  Also, on failure, properly cleans up the file_handle and
12423         free()s some stuff.
12424         (read_variables) No longer thinks it knows `nval' of the
12425         dictionary.  Now sets p.get.fv, etc., instead of speculatively
12426         setting fv itself.
12427         (read_value_labels) Fixed off-by-one error in indexing of
12428         var_by_index[].
12429         (sfm_read_case) New function.
12430         (sfm_r_class) New static var.
12431
12432         * var.h: (get_proc) New struct.
12433         (struct variable) New member p.get.
12434
12435 Thu Nov  7 20:52:28 1996  Ben Pfaff  <blp@gnu.org>
12436
12437         * get.c: Removed GTSV_OPT_MAP because of a misinterpretation of
12438         the manual's meaning.
12439         (rename_variables) New function.
12440         (trim_variables) Doesn't try to parse MAP any more.  Removed debug
12441         code.  Now properly reorders the dictionary on the KEEP keyword.
12442
12443         * sfm-read.c: (read_value_labels) Fixed some bugs regarding
12444         garbage collection.
12445
12446         * vars-atr.c: (clear_variable) New argument `dictionary *'.
12447         (rename_variable) New function.
12448         (free_val_lab) Reformatted.
12449
12450 Thu Nov  7 17:29:16 1996  Ben Pfaff  <blp@gnu.org>
12451
12452         * var.h: Reindented entire file.  Comment fixes.
12453         (glob vars var, var_by_name, nvar, N, nval, n_splits, splits)
12454         Removed.
12455         (glob var default_dict) New.
12456         (struct indirect_dictionary) Removed.
12457
12458         * Many other source files were changed to add `default_dict.'
12459         before all references to the dictionary of the active file.
12460         
12461         * vars-atr.c: (make_indirect_dictionary) Removed.
12462
12463         * glob.c: Reindented all variable declarations.  Updated for
12464         changed var.h.  Comment fixes.
12465
12466         * temporary.c: (restore_dictionary, save_dictionary) Simplified
12467         because now we can mainly copy dictionary structs.
12468
12469         * vars-prs.c: (is_dict_varname, parse_dict_variable,
12470         parse_variables) Takes dictionary instead of indirect_dictionary
12471         first argument.
12472         (parse_variables) Instead of calling make_indirect_dictionary,
12473         just sets DICT to &default_dict if DICT is NULL.  Of course, lots
12474         of `*dict.' references had to be changed to `dict->'.  Removed
12475         debug code.
12476
12477 Thu Nov  7 15:48:52 1996  Ben Pfaff  <blp@gnu.org>
12478
12479         * get.c: Added GTSV_OPT_* series of enums.
12480         (trim_dictionary, dict_delete_run) New functions.
12481         [DEBUGGING] (dump_dict_variables) New function.
12482         (cmd_get) Calls trim_dictionary() to get dictionary fully set-up.
12483         [DEBUGGING] Calls dump_dict_variables() to display results.
12484
12485         * glob.c: (cmp_variable) Now a public function declared in var.h.
12486
12487         * sfm-read.c: Turned off debug code.  Comment fixes.
12488         (read_machine_int32_info, read_machine_flt64_info) New functions
12489         to parse type 7 records.
12490         (sfm_read_dictionary) Properly byteswaps several fields now.
12491         Calls read_machine_*_info() to parse type 7 subtypes 3 and 4
12492         records.  [DEBUGGING] Dumps dictionary.
12493         (read_variables) Sets `index' field of variables created properly.
12494         Constructs avl tree of variables in dictionary.  [DEBUGGING] No
12495         longer dumps dictionary.
12496         (read_value_labels) Properly byteswaps fields.  [DEBUGGING] New
12497         debug code.
12498         [DEBUGGING] (dump_dictionary) No longer stubbed out.
12499
12500         * temporary.c: (restore_dictionary) Destroys `var_by_name' glob
12501         var before destroying any variables just to save a little time.
12502
12503         * var.h: (struct variable) Reordered in order to make name[] the
12504         first member; this makes pointers to `variable' pointers to the
12505         variable name, simplifying avl trees, etc.
12506         (struct indirect_dictionary) New struct.
12507
12508         * vars-atr.c: (find_variable) Rewritten for efficiency.
12509         (make_indirect_dictionary, is_dict_varname, parse_dict_variable)
12510         New functions.
12511         (is_varname) Rewritten for efficiency.
12512         (parse_variables) New argument, which is a `dictionary *'.  All
12513         references changed.  This function now reads variable names from
12514         the dictionary passed, or from the default dictionary if NULL.
12515
12516 Tue Nov  5 18:34:59 1996  Ben Pfaff  <blp@gnu.org>
12517
12518         * misc.h: Added new macro DIV_RND_UP to perform integer division,
12519         rounding up.  Changed many references to ROUND_UP to use this
12520         instead.
12521
12522         * sfm-read.c: Includes avl.h.
12523         (corrupt_msg) Induces a segfault under Checker.
12524         (macro assertive_bufread) New.  Many references to bufread() now
12525         use this instead.
12526         (sfm_read_dictionary) Split up into several functions.  Added code
12527         to read dictionary records following the the type 2 records.  Not
12528         quite complete.  New variable `var_by_index'.
12529         (read_header, read_variables) New functions extracted from
12530         sfm_read_dictionary().
12531         (read_value_labels) New function.
12532         (bufread) Checks ferror() if fread() doesn't return the expected
12533         value; if ferror() is zero it's just EOF.
12534         (dump_dictionary) Stubbed out.
12535
12536         * BTW: The source code now exceeds 50000 lines!
12537         
12538 Mon Nov  4 22:03:28 1996  Ben Pfaff  <blp@gnu.org>
12539
12540         * command.c: Added GET to cmd_table[].
12541
12542         * list.q: Removed reference to alloca headers.
12543         (cmd_list) Gave prototype.
12544
12545         * sfm-read.c: Added DEBUGGING comments.
12546         (sfm_read_dictionary) Checks bias correctly.  Sets
12547         dict->var_by_name to NULL.  Calculates long_string_count
12548         correctly.  realloc's dict->var[] array to minimum size.
12549         [DEBUGGING] Calls dump_dictionary.
12550         [DEBUGGING] (dump_dictionary) New function.
12551
12552         * temporary.c: (save_dictionary) Sets var_by_name to NULL.
12553         (restore_dictionary) If the dictionary contains a non-NULL
12554         var_by_name, uses that instead of generating one.
12555         (free_dictionary) Destroys var_by_name.
12556
12557         * var.h: (struct dictionary) Added field `var_by_name'.
12558
12559         * get.c: New file, not complete.
12560
12561 Sun Nov  3 12:24:36 1996  Ben Pfaff  <blp@gnu.org>
12562
12563         * mis-val.c: New enums MV_NOR_*.  New struct num_or_range.
12564         (parse_num_or_range) New function.
12565         (parse_numeric) Reimplemented in order to support LOW THRU <n> and
12566         <n> THRU HIGH missing values.
12567
12568         * output.h: [__GNUC__>1 && __OPTIMIZE__] (width, height) Made
12569         __attribute__((const)).
12570
12571         * q2c.c: (get_token) Merged isdigit || isalpha into isalnum.
12572
12573         * sfm-read.c: Finished reference implementation.
12574
12575         * sfm.h: Includes var.h.
12576
12577         * var.h: Comment fixes.
12578         (struct `variable') Reordered some fields.
12579
12580         * vars-atr.c: (is_num_user_missing) Added support for MISSING_*
12581         constants added previously.
12582
12583 Wed Oct 30 17:13:08 1996  Ben Pfaff  <blp@gnu.org>
12584
12585         * common.h: Comment fixes.  Added declaration of
12586         `second_lowest_value' as variable or macro.  Made `compat_type',
12587         `pgm_state_type' into anonymous enums.
12588
12589         * display.c: Comment fix.
12590
12591         * glob.c: [ENDIAN==UNKNOWN] Added definition for `endian' global
12592         var.
12593         [!defined SECOND_LOWEST_VALUE] Added definition for
12594         `second_lowest_value' global var.
12595         (compat, pgm_state global vars) Changed types to `int'.
12596         (init_glob) Initializes `second_lowest_value'.
12597
12598         * sfm-read.c: Continued work, not complete.
12599
12600         * var.h: Added new MISSING_* constants to handle LOWEST and
12601         HIGHEST.
12602
12603 Sat Oct 26 23:06:06 1996  Ben Pfaff  <blp@gnu.org>
12604
12605         * sfm-read.c: New file, not complete.
12606
12607         * cases.c: (vec_insert) Changed vector expansion algorithm.
12608         (vec_delete) Fixed bug that screwed up deletion sometimes, it was
12609         mucking up the RECODE transformation in particular.
12610         (envector) Harmless change in notation.
12611
12612         dfm is now fairly well tested again.  
12613         * dfm.c: (dfm_get_record) Only returns ext->ptr if ext is
12614         non-NULL--duh.
12615         (cmd_begin_data) if(ext->line) replaced by if(ext && ext->line).
12616
12617         * recode.c: Comment fix.
12618
12619         * sfm.h: Interface should be fairly final now, or at least for a
12620         day or so...
12621
12622         * vfm.c: [DEBUGGING] (index_to_varname) New function.
12623         (open_active_file) [DEBUGGING] Translates ccase indices into
12624         variable names now to make it easier to understand what's really
12625         going on.
12626
12627 Sat Oct 26 20:46:31 1996  Ben Pfaff  <blp@gnu.org>
12628
12629         * data-in.c: Comment fix.
12630
12631         * data-list.c: Includes dfm.h.
12632         (do_reading) Uses new function dfm_push_cust().
12633
12634         * data-out.c: (convert_time, convert_WKDAY, convert_MONTH) Added
12635         `return 1;' at end.
12636
12637         * file-handle.h: Completely changed.  Some parts split off into
12638         new file dfm.h.  Implemented in file-handle.q.
12639         (enum FH_*) Removed.
12640         (struct fh_ext_class) New struct.
12641         (struct file_handle) Retained only these fields: name, norm_fn,
12642         fn, recform, lrecl, mode.  New fields class, ext.
12643         (get_handle_by_name, get_handle_by_filename, parse_file_handle,
12644         close_handle, handle_name) Added `fh_' prefix to name, all
12645         references changed.
12646
12647         * dfm.h: New file, implemented in dfm.c.
12648         (get_record, put_record, fwd_record, bkwd_record, set_record,
12649         get_cur_col) Functions moved from file-handle.h, now prefixed with
12650         `dfm_'.
12651         (dfm_push_cust) New function.
12652
12653         * sfm.h: New file.  Incomplete.
12654
12655         * dfm.c: All functions adjusted/rewritten for new dfm/fhp
12656         interface.  Functions reordered, comments changed.  Not well
12657         tested, probably full of bugs.
12658         (struct dfm_fhuser_ext) New struct.
12659         (dfm_close) New function.
12660         (open_file_r) Pickier about finding `BEGIN DATA.' line.
12661         (open_file_w) User messages changed.
12662         (get_record) Comment fixed.
12663         (read_record) Increments ext->ln even for inline_file.  Calls
12664         dfm_close() for inline_file when `END DATA.' encountered.
12665         (dfm_get_record) Experimental restructuring.
12666         (dfm_push_cust) New function.
12667         (cmd_begin_data) Detects whether the inline file was fully read by
12668         checking whether it is still open; detects whether it was read at
12669         all by checking whether the line number is greater than zero.
12670
12671         * file-handle.q: All functions adjust/rewritten for new dfm/fhp
12672         interface.  Functions reordered, comments changed.  Not well
12673         tested, probably full of bugs.
12674         (init_file_handle) Removed initializers for obsolete fields, added
12675         new fields.
12676         (fh_close_handle) Much simpler, now mainly calls the class
12677         function.
12678         (fh_init_files) Renamed inline file internal filename.
12679
12680         * file-type.c: Includes dfm.h.
12681         (read_from_file_type) Doesn't use dfm internal state anymore.
12682
12683         * inpt-pgm.c, print.c: Include dfm.h.
12684
12685         * recode.c: (internal_cmd_recode) Casts strlen() return value to
12686         int in comparison with other int.
12687
12688         * som-high.c: (build_target) Fixed operator precedence problem in
12689         if statement (& versus ==).
12690
12691 Sat Oct 26 10:39:25 1996  Ben Pfaff  <blp@gnu.org>
12692
12693         * dfm.c: (read_record) Can now read fixed-length records; not
12694         tested.
12695         (put_record) Can now write fixed-length records; not tested.
12696
12697         * file-handle.h: FH_* defines changed to enums.  New enum series
12698         FH_RF_*, FH_MD_*.
12699         (struct file_handle) New members recform, lrecl, mode.
12700
12701         * file-handle.q: Parser changed.
12702         (internal_cmd_file_handle) Added support for new /RECFORM, /MODE,
12703         /LRECL subcommands.  These are compatible with Windows.
12704         (init_file_handle) Initializes recform, mode fields.
12705
12706         * q2c.c: (get_line) When outputting `!' comment lines, now
12707         increments the output file line number so that `#line' directives
12708         are correct.
12709         (make_identifier) New function that converts an arbitrary string
12710         into a valid C identifier.
12711         (dump_vars) Calls make_identifier() in two places in order to
12712         suppress some errors for bad identifiers.
12713         (make_match) Allows TRUE as synonym for YES and FALSE as synonym
12714         for NO.  Allows numbers to be prefixed by underscores to make them
12715         acceptable C identifiers but still to be parsed as numbers by the
12716         Fiasco lexer.
12717
12718 Thu Oct 24 20:13:42 1996  Ben Pfaff  <blp@gnu.org>
12719
12720         * command.c: Re-enabled RECODE, SAMPLE, SELECT IF.
12721         
12722         * dfm.c: Comment fixes. (get_record) Gives error if file handle
12723         was opened for writing.
12724         (open_file_w) New function.
12725         (read_record) Uses strncasecmp if available.  Improved error
12726         messages, comments.
12727         (put_record) New function.
12728
12729         * file-handle.h: Moved function comments into dfm.c and
12730         file-handle.q.  Comment fixes.  Removed declarations of
12731         tilde_expand() and normalize_filename().
12732         (struct file_handle) Changed `open' from boolean to enumerated
12733         field to allow for three states--closed, open for reading, open
12734         for writing--all references changed.
12735
12736         * file-handle.q: Includes filename.h.
12737
12738         * print.c: (CMD_* enums) Renamed PRT_* and moved into var.h; all
12739         references changed.
12740         (alloc_line) Makes allowance for line terminator characters in
12741         calculations.
12742         (print_trns_proc) Now handles OUTFILE, WRITE differences.
12743         (print_space_trns_proc) Handles OUTFILE differences.
12744
12745         * recode.c, sample.c: Comment fixes.
12746
12747         * var.h: (struct print_trns) Changed boolean field `eject' to
12748         bitmapped field `options'; all references changed.  New enums
12749         PRT_* for use with this field.
12750
12751         * exception.h, test-exception.c: Removed.
12752
12753 Thu Oct 24 17:47:14 1996  Ben Pfaff  <blp@gnu.org>
12754
12755         * ascii.c: (delineate) Turned off debug output.
12756
12757         * common.c: [Checker and Linux] (__assert_fail, __eprintf) Moved
12758         to error.c.
12759
12760         * data-in.c: (parse_string_as_format) Sets the entire string value
12761         to spaces, not just the short string part of it.  Is this correct
12762         now? 
12763
12764         * data-out.c: (convert_date) Fixed DATETIME format problems with
12765         decimal places, removed debug code.
12766
12767         * dfm.c: (open_file_r) Fixed bug where an error would occur in the
12768         middle of parsing BEGIN DATA that would cause the lexer to read
12769         from a wild pointer `prog'; now calls new function
12770         preprocess_line() in lexer.c.
12771
12772         * error.c: [__CHECKER__] (hcf) Calls induce_segfault() on improper
12773         termination.
12774         [Checker and Linux] (__assert_fail, _eprintf) Moved from common.c.
12775         Now call induce_segfault() to induce the segfault.
12776         (induce_segfault) New function.
12777
12778         * expr-opt.c: Comment fix.
12779         (parse_sysvar) New function.
12780         (parse_primary) Added system variable support--calls
12781         parse_sysvar().
12782         (global var ops) Added OP_CASENUM operator.
12783
12784         * expr.h: Comment fixes.
12785         (OP_* enum) added OP_CASENUM operator.
12786         (struct casenum_node) New struct.
12787         (union any_union_union) New member `cas' of type `casenum_node'.
12788
12789         * glob.c: (global var last_vfm_invocation) New var.
12790         (init_glob) Initializes last_vfm_invocation.
12791
12792         * lexer.c: (lookahead) Fixed reversed condition on if statement.
12793
12794         * getline.c: (get_line) Split into get_line() and preprocess_line().
12795         (preprocess_line) New function.
12796
12797         * var.h: Declares last_vfm_invocation.
12798
12799         * vfm.c: (procedure) Sets last_vfm_invocation.
12800
12801 Wed Oct 23 21:53:43 1996  Ben Pfaff  <blp@gnu.org>
12802
12803         * command.c: (parse_cmd) Fixed bad assertion related to
12804         lookahead().
12805
12806         * data-in.c: (parse_month) Implemented to parse months according
12807         to full interpretation of standard.
12808         (to_roman) New function.
12809         (parse_wk_delimiter) Bug fix (forgot to skip `WK' in string).
12810         (parse_weekday) Bug fix (forgot to skip all the day name).
12811
12812         * data-list.c: (read_from_data_list_fixed) Fixed bug that screwed
12813         up parsing of multirecord data items.  Also fixed user message.
12814
12815         * data-out.c: Comment fix.
12816         (year2, year4, convert_date, convert_time, convert_WKDAY,
12817         convert_MONTH) New functions to support time & date output.
12818         (convert_format_to_string) Calls new time & date output routines.
12819
12820         * expr-prs.c: (nary_num_func) Found a bug, but didn't fix it yet.
12821
12822         * lexer.c: (lookahead) Noted a previously unnoticed caveat in
12823         comment.
12824
12825         * main.c: [DEBUGGING] (dump_token) Updated to handle getline.h.
12826
12827         * misc.c: (global var formats) Fixed declarations of DATETIME,
12828         TIME, DTIME.
12829
12830         * postscript.c: (text) Fixed a pair of bugs in the reallocation of
12831         the output_char buffer.
12832
12833         * vars-prs.c: (parse_DATA_LIST_vars) Fixed a failure to free
12834         memory bug.  Fixed user messages.
12835
12836 Tue Oct 22 17:27:04 1996  Ben Pfaff  <blp@gnu.org>
12837
12838         * Removed #pragma argsused from lots of places.
12839         
12840         * data-in.c: Implemented zoned decimal and time-date formats.
12841         Untested.  This is a huge chunk of code--maybe 1000 lines and 50
12842         new functions.
12843
12844         * data-out.c: Implemented zoned decimal format.
12845
12846         * expr.h: Moved yrmoda() declaration here from exprP.h.
12847
12848         * misc.c: (global var formats) Minor fixes--added
12849         FCAT_SHIFT_DECIMAL to formats N and Z.
12850         (convert_fmt_ItoO) Added support for format Z.
12851
12852         * som-frnt.c: (som_set_value) Fixed bug regarding string values.
12853
12854 Mon Oct 21 20:39:59 1996  Ben Pfaff  <blp@gnu.org>
12855
12856         * command.c: (parse_cmd) [GLOBAL_DEBUGGING] Inserted call to
12857         som_check_workspace() that is activated between commands.
12858
12859         * data-list.c: (dump_fixed_table, dump_free_table) Finished these
12860         for good, I hope.
12861
12862         * list.q: (begin_row) Changed title expansion style from
12863         SOPT_X_VERT to SOPT_X_SHSP.
12864
12865         * som-frnt.c: Now includes `somP.h'.
12866         (som_push_workspace, som_pop_workspace) New functions that, taken
12867         together, form a solution to the recursive table building problem
12868         mentioned yesterday.  Surrounded every table output routine
12869         throughout the program with calls to these functions.
12870         [GLOBAL_DEBUGGING] (som_check_workspace) New function.
12871         (som_create_table) Checks that there's an active workspace.
12872         (som_destroy_all_tables, som_crush) Removed.
12873
12874         * som-high.c: (global var som_preserve_tables) Removed, all
12875         references deleted.
12876         (som_submit_table) Checks that there's an active workspace.
12877         (dump_columnated_table) Doesn't columnate tables that would have
12878         just one row per column.
12879         (dump_crush_page, som_dump_crush_page) Removed debugging code.
12880         (som_dump_crush_page) Moved row number labels from left side of
12881         tables to right side.
12882         (som_get_table_size) Added support for SOPT_X_SHSP.
12883
12884         * som.h: New cell expansion type SOPT_X_SHSP.
12885
12886         * somP.h: (global vars arena_stack, n_arena_stack, m_arena_stack)
12887         New vars.
12888         (global var curtab_arena) Moved from som-frnt.c.
12889
12890 Sun Oct 20 13:45:28 1996  Ben Pfaff  <blp@gnu.org>
12891
12892         * ascii.c: [GLOBAL_DEBUGGING] (SUPPRESS_WARNINGS) New debug option
12893         that causes bad location warnings to be suppressed.
12894         (delineate) Saves current font when calling draw_text(); fixed
12895         handling of NULLs when backing up.  Also fixed line-wrapping bug.
12896
12897         * command.c: Re-enabled `LEAVE', `NUMERIC', `PRINT', `PRINT EJECT',
12898         `PRINT FORMATS', `PRINT SPACE', `STRING', `TITLE', `WRITE'.
12899
12900         * common.c: Added code to cause assertion failure to dump core
12901         when run under Checker.
12902
12903         * data-list.c: (dump_fixed_table) Fixed some inconsistencies, but
12904         there are still bugs.
12905
12906         * glob.c: (__eprintf) Removed.
12907
12908         * list.q: Inserted som_preserve_tables kluge that prevents tables
12909         from being thrown away due to recursive table building through
12910         som_output_line being called from a transformation during the LIST
12911         procedure invocation.  This is a general problem that must be
12912         solved in a better way since it applies to all procedures in
12913         general.
12914         (begin_row) Changed title options to SOM_X_VERT from SOM_X_BOTH.
12915         (flush_table) Removed SOM_TOPT_PRESERVE from submission options.
12916
12917         * numeric.c: Fixed several errors in the form of msg() calls.
12918
12919         * print.c: Updated for use of som.
12920         (dump_table) Reimplemented.
12921         (print_trns_proc) Calls som_eject_page() instead of eject_page().
12922         Calls som_output_text() instead of outs_line().
12923
12924         * som-frnt.c: (som_destroy_all_tables) Sets som_preserve_tables to
12925         0.
12926         (som_output_text) Function moved from som-low.c.  Interface
12927         changed.
12928
12929         * som-high.c: (som_preserve_tables) New global public variable
12930         declared in som.h.
12931         (som_submit_table) Destroys the tables only if som_preserve_tables
12932         is 0.
12933         (paginate_horizontally) Bugfix: sets som.mpw even if there's only
12934         one subrow per row.  Now labels subrows if there's more than one
12935         subrow per row.
12936         (dump_crush_table) Added wishlist comment.
12937         (som_eject_page) New public function declared in som.h.
12938
12939         * som-low.c: (som_dump_crush_page) Draws row labels if there's
12940         more than one subrow per row.
12941         (som_output_text) Moved to som-frnt.c.
12942
12943         * som.h: (SOM_TOPT_PRESERVE) Removed.
12944
12945         * title.c: (get_title) Changed interface.
12946         (cmd_title) Changed `title' to `outp_title'.
12947         (cmd_subtitle) Changed `subtitle' to `outp_subtitle'.
12948
12949 Sun Oct 20 09:04:15 1996  Ben Pfaff  <blp@gnu.org>
12950
12951         * list.q: (flush_table) Conforms to new partial options in
12952         som_submission_form.
12953
12954         * som-high.c: (paginate_horizontally) Changed form of subrow
12955         number labels.
12956         (build_target) Omits spacing before table if
12957         SOM_TOPT_PARTIAL_OMIT_TOP is selected.
12958         (dump_crush_page) Changed interface.  Only trims bottom rule if
12959         SOM_TOPT_PARTIAL_OMIT_BTM is not selected.
12960         (dump_crush_table) Handles partial tables.
12961         (output_row_label) New function.
12962         (som_dump_crush_page) Emits subrow number labels.  Draws vertical
12963         rule on the right edge of narrow subrows.
12964
12965         * som.h: Changed SOM_SUB_PARTIAL_* series of submission type
12966         constants to a series of SOM_TOPT_PARTIAL_* submission options.
12967         All references updated.
12968
12969 Fri Oct 18 19:46:49 1996  Ben Pfaff  <blp@gnu.org>
12970
12971         * misc.c: Comment fix.
12972
12973         * som-high.c: (examine_table) Treats crushed tables separates for
12974         purpose of determining header size.
12975         (paginate_horizontally) Allots space for line numbers in crushed
12976         tables with lots of subrows per row.  Calculates the `maximum page
12977         width', the width of the widest horizontal page.
12978         (build_target) Removed trim argument; all references changed.
12979         Stricter assertions.  (dump_crush_page) New function.
12980         (dump_crush_table) Reimplemented.
12981
12982         * som-low.c: (som_dump_page) Uses new RULE_ROW &c. constants.
12983         (som_dump_crush_page) Reimplemented, interface changed.
12984
12985         * somP.h: Many many new helper macros for use with crushed tables.
12986         (global var som) Removed `tv', `cum_y' members; all references
12987         removed.  New members `mpw', `digit_space'.
12988
12989 Sun Sep 29 19:37:03 1996  Ben Pfaff  <blp@gnu.org>
12990
12991         * arena.c: (arena_alloc) [!DISCRETE_BLOCKS] Removed `size'
12992         variable, changed to constant 1024.
12993         (arena_ca_strdup) Changed `sizeof(a_string)' to
12994         `sizeof(c_string)'.
12995         (arena_ca_strdup) [!DISCRETE_BLOCKS] Changed bad cast from
12996         `(c_string *)' to `(char *)'; this fixed some offset problems.
12997
12998         * filename.c: (readlink_malloc) Changed initial allocation from
12999         100 bytes to 128.
13000         (good_getcwd) Changed from xmalloc() to local_alloc(); removed
13001         comment.
13002
13003         * postscript.c: (read_fontmap) Fixed leak by changing &owner to
13004         &fm->owner in several places.
13005
13006         * som-high.c: (output_table) Changed interface to rest of world.
13007         (examine_crush_table) Removed.  Crushed tables are re-broken now,
13008         in preparation for rewrite.
13009
13010         * som.h: Comment fix.
13011
13012 Sat Sep 28 21:28:07 1996  Ben Pfaff  <blp@gnu.org>
13013
13014         * ascii.c: (ascii_init_driver) Disposes of x->file.filename and x
13015         itself in the cleanup stage.
13016
13017         * descript.q: (display) At least temporarily, changed the table
13018         format to a crushed table.
13019
13020         * list.q: (begin_row) At least temporarily, added horizontal lines
13021         between cases.
13022
13023         * som-high.c: (examine_crush_table) Sets som.hh to the width of
13024         the horizontal "headers," that is, to the width of the far left
13025         and far right rules.
13026         (justify_pagination) Sets som.th to the width of the widest row
13027         in the crushed table.  Fixed inner loop off-by-one error.
13028
13029         * som-low.c: (som_dump_crush_page) Added code to draw horizontal
13030         rules.
13031
13032         * somP.h: Comment fix.
13033
13034 Fri Sep 27 20:08:39 1996  Ben Pfaff  <blp@gnu.org>
13035
13036         * filename.c: (open_file_ext) Now, doesn't set f->file to NULL
13037         before closing it; also, opens the constructed filename `s'
13038         instead of f->filename.
13039
13040         * postscript.c: Moved initialization of x->loaded, x->prop,
13041         x->fixed, x->current, also the add_encoding() calls, into
13042         postopen().
13043         (preclose) Destroys x->combos; sets x->loaded, x->combos to NULL;
13044         sets x->last_font to NULL; sets x->next_combo to zero.
13045
13046         * som-high.c: (crushed_row_height) Moved definition farther up.
13047         (som_submit_table) Doesn't calculate line width, font size until
13048         after calling open_page(), to accomodate changes to PostScript
13049         driver.
13050         (vert_headers) Removed; equivalent functionality moved to
13051         examine_table(), examine_crush_table().
13052         (justify_pagination) Replaced with different algorithm.
13053         (dump_crush_table) Bugfix that caused tables to fail to be clipped
13054         at the bottom of the page.
13055
13056 Thu Sep 26 22:20:26 1996  Ben Pfaff  <blp@gnu.org>
13057
13058         * command.c: Added cmd_list back into cmd_table.
13059
13060         * freq.c, frequencies.q, repeat.c, list.q, vars-atr.c, vfm.c:
13061         Comment fix: `#define DEBUGGING' --> `#define DEBUGGING 1'.
13062
13063         * list.q: (flush_table) Updated to new som_submission_form format.
13064
13065         * som-frnt.c: Comment fix.
13066
13067         * som-high.c: Changed `#endif' to `#undef EXTERN'.
13068         (output_table) Calls som_get_table_size() directly; handles
13069         crushed tables.
13070         (examine_crush_table) New function; calls vert_headers().
13071         (examine_table) Moved some code into new function, vert_headers().
13072         (justify_pagination) New function.
13073         (dump_plain_table) Removed `static' from `cy'.
13074         (dump_crush_table) New function.
13075
13076         * som-low.c: (som_dump_crush_page) New function.
13077
13078         * som.h: Comment fixes.
13079         (enum SOM_TOPT_CRUSH) New.
13080         (SOM_SUB_PARTIAL_BEG, SOM_SUB_PARTIAL_MID, SOM_SUB_PARTIAL_END)
13081         Temporarily set to zero to make do with LIST procedure.
13082
13083         * somP.h: Re-ordering.
13084
13085 Wed Sep 25 19:36:11 1996  Ben Pfaff  <blp@gnu.org>
13086
13087         * som.c: Split into som-frnt.c, som-high.c, som-low.c.
13088
13089         * somP.h: New file for use by som-high.c, som-low.c.
13090
13091         * q2c.c: Added definition for VME.
13092         (get_line) Now dumps `!' comment lines to the output file
13093         verbatim.
13094
13095         * crosstabs.q, descript.q, file-handle.q, frequencies.q, list.q,
13096         set.q: Changed format of `!' comment lines.
13097
13098 Tue Sep 24 18:39:09 1996  Ben Pfaff  <blp@gnu.org>
13099
13100         * All source files: Added copyright notice.
13101
13102         * common.c: (xmalloc, xrealloc, xstrdup) Cast size_t's to unsigned
13103         longs in msg() calls.
13104
13105         * con32s.c: (xmalloc, xrealloc) Updated from common.c.
13106
13107         * q2c.c: (xmalloc, xrealloc, xstrdup) Updated from common.c.
13108
13109 Sat Sep 21 23:16:31 1996  Ben Pfaff  <blp@gnu.org>
13110
13111         * output.c: (outp_read_devices) Changed criteria for
13112         distinguishing different types of lines.
13113
13114 Fri Sep 20 22:52:28 1996  Ben Pfaff  <blp@gnu.org>
13115
13116         * cmdline.c: Changed syntax message.
13117
13118         * filename.c: (good_getcwd) Bug fix (?).
13119         (normalize_filename) [__BORLANDC__] Uses _fullpath() library
13120         function.
13121         (search_path) Appends DIR_SEPARATOR to directory name only if it
13122         does not already end with one.
13123
13124         * glob.c: Checks STAT_PAGER envvar before PAGER.
13125
13126         * output.c: Checks environment variables instead of just local
13127         macros.
13128
13129 Tue Sep 10 21:39:00 1996  Ben Pfaff  <blp@gnu.org>
13130
13131         * arena.c: (arena_destroy) Swatted a subtle bug that cropped up
13132         when the pointer passed to the function was within the arena
13133         itself, so that it couldn't properly be set to NULL _after the
13134         arena was freed_.
13135
13136         * command.c: Re-enabled DISPLAY.
13137
13138         * display.c: Rewritten to handle tables.  Untested.
13139
13140         * filename.c: (search_path) Fixed memory leak.
13141
13142         * frequencies.q: (cmd_frequencies) Frees v_variables.
13143         (postcalc) Calls cleanup_freq_tab() after displaying statistics.
13144         (cleanup_freq_tab) New function to garbage collect.
13145         (dump_full) Elegantized.
13146
13147         * main.c: New comment.
13148
13149         * output.h: New tag for tagged quotes: TAG_NEWLINE.
13150
13151         * postscript.c: Comment fix.
13152         (release_fontmap, free_font_entry) New functions.
13153         (ps_init_driver) Sets free_font_entry() as the freefunc for
13154         hashtable `loaded'.  Calls release_fontmap() when destroying a
13155         driver; also frees the output filename; also frees the
13156         ps_driver_ext block.
13157         (free_ps_encoding) Frees the filename as well as the encoding
13158         block.
13159         (output_encodings) Frees the line buffer and pops the msg-filename
13160         stack.
13161         (read_fontmap) Frees the fontmap filename and the line buffer.
13162         (postopen, preclose) Misc. garbage collection fixes.
13163         (ps_open_page) Destroys the `combos' hash table; sets `last_font'
13164         to NULL; this fixes some output problems.
13165         (text) Handles TAG_NEWLINE.  Untested.
13166
13167         * som.c: (cell_byte_size) Merged SCON_VALUE and SCON_TEXT cases.
13168         (som_set_string) Removed.  All references changed to
13169         `som_set_text'.
13170         (som_set_text) Rewritten.  New interface.  More general.
13171
13172         * som.h: Minor format changes.
13173         (struct som_value_cell) Removed; all references changed to
13174         `som_text_cell'.
13175         (enums SOT_*) Changed.
13176
13177 Mon Sep  9 21:43:13 1996  Ben Pfaff  <blp@gnu.org>
13178
13179         * command.c: Re-enabled SPLIT FILE.
13180
13181         * postscript.c: Comment fix.
13182
13183         * som.h: Added `SOT_NONE'.
13184
13185         * split-file.h: (cmd_split_file) Removed superfluous parenthesis.
13186
13187         * vfm.c: (dump_splits) Reimplemented.
13188
13189 Sat Sep  7 22:35:12 1996  Ben Pfaff  <blp@gnu.org>
13190
13191         * Compiled the project under gcc 2.7.2, which gave some new
13192         warnings.  This led to many additions of casts from unsigned to
13193         int sprinkled throughout the code.
13194         
13195         * arena.c: Many uses of `unsigned' changed to `size_t'.
13196
13197         * command.c: Added END FILE, END REPEAT to command table.
13198         (var cmd_end_repeat) Renamed cmd_end_repeat_p.
13199         (find_command, FILE_TYPE_okay) Not commented out anymore.
13200         (parse_cmd) Calls FILE_TYPE_okay again.
13201         (output_line) Added calls to som_output_text() to put the line
13202         in the output files.
13203
13204         * common.c: (macro VME) Format changes.
13205         (xstrdup) Asserts that its argument is not NULL.
13206         
13207         * data-list.c: Implemented dump_fixed_table().
13208         
13209         * inpt-pgm.c: Formatting changes.  Comment changes.
13210         (end_case_proc) Renamed end_case_trns_proc.
13211         (cmd_end_file, end_file_trns_proc) New functions.
13212
13213         * misc.c: Many uses of `int' and `unsigned' changed to `size_t'.
13214
13215         * misc.h: (local_strdup) New macro corresponding to strdup() but
13216         allocating its data through local_alloc() if possible--that is, if
13217         GNU C is in use.
13218
13219         * postscript.c: Comment changes.
13220         (quote_ps_name, quote_ps_string, output_encodings) New functions.
13221         (output_line, add_string) New macros supporting
13222         output_encodings().
13223         (postopen) Fixed contents of ${fixed-font} and ${prop-font}
13224         substitution vars.  Calls output_encodings() when a line
13225         consisting of `!encodings' is encountered.
13226         (preclose) Some code moved into quote_ps_string().
13227         (dump_line) Changed into macro supporting dump_fancy_line().
13228         (switch_font) Now outputs DSC "%%IncludeResource: font (...)"
13229         command when appropriate.
13230         (write_text) Fixed `literal_char' array (I think it's fixed, at
13231         least.)
13232         (text) Fixed bug when width was zero.  Now exits immediately on
13233         zero height_left.  Now, when executing `goto restart;', checks
13234         that cp<end, so that we don't read beyond end-of-string.  Also,
13235         outputs the correct code to the output file by outputting the code
13236         from the metric instead of the internal metric index.
13237
13238         * repeat.c: (cmd_end_repeat) New function.
13239
13240         * som.c: (var som) `headers' renamed `options' and semantics
13241         changed.  All references changed.
13242         (draw_title) `if(px!=-1 || px!=-1)' --> `if(px!=-1 || py!=-1)'.
13243         (build_target) Only inserts spacing if SOM_TOPT_SPACING not
13244         selected.
13245         (som_text_table) Removed.
13246         (som_output_text) New function.
13247
13248         * som.h: (struct som_submission_form) Removed `header', `reuse',
13249         replaced with bitmapped field `options'.
13250         (SOM_TOPT_*) New enum set for som_submission_form.options.
13251         (SOT_*) New enum set for som_output_text().
13252
13253         * temporary.c: (copy_variable) When copying the var label, only
13254         calls xstrdup() if it's non-NULL.
13255
13256         * var.h: (enum type `vartype') Removed; all references changed to
13257         `int'.
13258
13259         * vars-atr.c: (init_variable) Changed local var `nbytes' from
13260         `int' to `size_t'.
13261
13262 Thu Sep  5 22:05:56 1996  Ben Pfaff  <blp@gnu.org>
13263
13264         * font.h: Comment changes.
13265
13266         * groff-font.c: (groff_read_font) Initializes `name' field to
13267         NULL.  Handles `encoding' field.
13268
13269         * hash.c: (hsh_dump) [GLOBAL_DEBUGGING] Output formatting changes.
13270
13271         * postscript.c: (struct font_entry) Removed `position' field.
13272         (struct ps_font_combo) New struct.
13273         (struct ps_driver_ext) Removed field `next_position'.  New fields
13274         `combos', `next_combo'.  `last_font' field changed from
13275         `font_entry *' to `ps_font_combo *'.
13276         (ps_init_driver) Reformatted; handles new fields.  When
13277         OPO_AUTO_ENCODE is set, adds the two default fonts' encodings to
13278         the encoding list.
13279         (get_encoding, find_encoding_file) New functions.
13280         (add_encoding) Some code moved out into find_encoding_file().
13281         (postopen) Changed value for ${title}.
13282         (preclose) Sets `loaded' field to NULL after destroying the hash
13283         table.
13284         (ps_open_page) Added comment.  Inits the `combos' and `next_combo'
13285         fields.
13286         (ps_text_set_font_by_position) Figures out the current family if
13287         not known.
13288         (compare_ps_combo, hash_ps_combo, free_ps_combo) New functions.
13289         (switch_font) Implemented.
13290         (write_text) Calls switch_font() more often.  Format changes.
13291         #undefs its macros after they're no longer useful.
13292         (text) Changed `continue' at one point to a jump to the top of the
13293         loop because we don't want `separate' reset to 0 at that point.
13294         (load_font) No longer sets `position' in the font_entry created.
13295
13296 Wed Sep  4 21:45:35 1996  Ben Pfaff  <blp@gnu.org>
13297
13298         * font.h: (struct font_desc) New member `encoding', which is not
13299         properly handled yet.
13300
13301         * glob.c: (init_glob) Some new i18n code, which is probably
13302         screwed up.
13303
13304         * output.c: (outp_read_devices, outp_get_paper_size) Changed
13305         `size' local from `int' to `size_t'.
13306
13307         * postscript.c: New driver configuration parameter `auto-encode'.
13308         New enums OPO_AUTO_ENCODE, ODA_COUNT.
13309         (struct font_entry) New member `position'.
13310         (struct ps_driver_ext) Reordered.  New hash table member
13311         `encodings'; new members `next_position', `next_encoding',
13312         `last_font'.  Members `current', `prop', `fixed' changed from type
13313         `font_desc *' to `font_entry *'; all references changed.
13314         (struct ps_encoding) New struct.
13315         (read_ps_encodings, compare_ps_encoding, hash_ps_encoding,
13316         free_ps_encoding, add_encoding) New functions.
13317         (ps_init_driver) Added OPO_AUTO_ENCODE to default
13318         x->output_options.  Initializes new members of ps_driver_ext.
13319         Changed default value for prologue_fn, encoding_fn.  Calls
13320         read_ps_encodings after loading default fonts.
13321         (option_tab[], ps_option) Handle new configuration parameter.
13322         (switch_font) New function.
13323         (struct output_char) `font' member changed from `font_desc *' to
13324         `font_entry *'.  New member `separate'.
13325         (read_fontmap) Changed `size' from `int' to `size_t'.
13326         (output_line, put_number) New macros for write_text().
13327         (write_text) Optimizes text output by consolidating multiple
13328         calls to PostScript `show' operator.
13329         (text) Keeps track of when text arguments can't be consolidated by
13330         write_text(), and marks those spots in the output stream.
13331         (load_font) Sets `position' of the allocated font_entry to -1, cuz
13332         the font hasn't been switched to by switch_font(), which is where
13333         the position is important--the PostScript is what cares about the
13334         position.
13335
13336 Sat Aug 31 23:52:38 1996  Ben Pfaff  <blp@gnu.org>
13337
13338         * hash.c: (hsh_destroy) Ignores NULL argument.  Doesn't try to
13339         call a NULL free_func.
13340         (hsh_rehash) Elegantized.
13341         (hsh_probe) Fix bug that manifested when the table was expanded
13342         and thus had to change location in memory.  Good thing
13343         too--otherwise could have been much more subtle.
13344         (hsh_find) [GLOBAL_DEBUGGING] Not stubbed out anymore.
13345         (hsh_foreach) New function for hash table iteration.
13346
13347         * hash.h: (struct hsh_iterator) New.
13348
13349         * lexer.c: (parse_tagged_quote) Font and family name strings in
13350         tags are now null-terminated.
13351
13352         * output.c: (outp_evaluate_dimension) Fixed over-aggressive unit
13353         parsing.
13354         (internal_get_paper_size, outp_get_paper_size) Fixed; now work as
13355         documented.  (Never before tested?)
13356
13357         * output.h: Comment changes.
13358
13359         * postscript.c: New driver options `optimize-text-size',
13360         `optimize-line-size', `max-fonts-simult'.  New enum set for
13361         specing cached line types.  Comment fixes.
13362         (struct line_form) New struct.
13363         (struct ps_driver_struct) New members `text_opt', `line_opt',
13364         `max_fonts', `lines'.
13365         (ps_init_driver) Initializes new members of ps_driver_struct.
13366         (user option type enum set) New member `nonneg_int_arg'.
13367         (static var option_tab[]) Supports new options.
13368         (ps_option) Handles new options.
13369         (find_ps_file) Made static.  No longer calls hsh_dump().
13370         (ps_get_var) Made static.
13371         (preclose) Dumps out proper DSC trailer.
13372         (ps_open_page) Elegantized.
13373         (ps_close_page) Calls dump_lines() if appropriate.
13374         (ps_line_horz, ps_line_vert, ps_line_intersection) Reduced to
13375         wrappers around line().
13376         (int_2_compare, compare_line, dump_line, dump_fancy_line,
13377         dump_lines, hash_line, free_line, line) New functions for support
13378         of line caching.
13379         (write_text, text) Made static.
13380         (text) Added to font support, not finished.
13381
13382 Thu Aug 29 21:36:41 1996  Ben Pfaff  <blp@gnu.org>
13383
13384         * font.h: (struct font_desc) New members ascent, descent.
13385
13386         * groff-font.c: (groff_read_font) Calculates font ascent and
13387         descent from the ascent and descent of the `d' and `p' characters,
13388         respectively, as per a suggestion on comp.fonts.
13389
13390         * postscript.c: (ps_open_page, ps_close_page, ps_line_horz,
13391         ps_line_vert, ps_line_intersection) Rewritten to deal with changed
13392         prologue.
13393         (write_text) Handles text right-justification and centering (not
13394         full justification).  Still very inefficient.  (One output line
13395         per character?!)
13396         (struct output_char) Added fields for font and font size.
13397         (text) Many bugfixes.
13398
13399 Sat Aug 24 23:26:00 1996  Ben Pfaff  <blp@gnu.org>
13400
13401         * cmdline.c: (usage) Calls outp_list_classes().
13402
13403         * font.h: Comment fix.
13404
13405         * groff-font.c: New exported global var `space_index'.
13406         (groff_init) New function to initialize `space_index'.
13407         (hash_kern) Casts result to unsigned.
13408         (font_name_to_index) Renamed font_char_name_to_index.  All
13409         references changed.  Also, now returns the value of `space_index'
13410         when passed an ASCII space character as an argument.  Fixed
13411         handling of nulls.
13412         (font_get_kern_adjust) Changed i from `int' to `unsigned'.
13413         Handles passed NULL pointers properly.
13414
13415         * lexer.c: (parse_tagged_quote) Comment fix.  Better range
13416         checking.
13417
13418         * output.c: (outp_list_drivers) Removed.  Removed all references.
13419         
13420         * output.h: Comment fixes.
13421
13422         * postscript.c: (ps_open_global) Calls groff_init().
13423         (output_char) New structure.
13424         (write_text) New function.
13425         (text) No longer stubbed out!  Now the output is correct--with a
13426         few exceptions, one of them being that the page has to be held
13427         upside down into a mirror.
13428
13429 Sun Aug 11 21:31:22 1996  Ben Pfaff  <blp@gnu.org>
13430
13431         * font.h: Comment fix.
13432         
13433         * font.c: (name_to_index) Renamed font_name_to_index, made extern.
13434         All callers changed.
13435         (number_to_index) Renamed font_number_to_index, made extern.  All
13436         callers changed.
13437         (font_get_kern_adjust, font_get_char_metrics) New functions.
13438
13439         * output.h: New constant OUTP_T_INTERNAL_DRAW.
13440
13441         * postscript.c: Changed default line width back to 1/2 point.
13442         (ps_line_horz, ps_line_vert, ps_line_intersection) Now lines are
13443         in the center of the space allotted for them, not just a fixed
13444         offset from the edge of the space; this fixes some bugs.
13445         (ps_line_intersection) Now supports all command line styles.
13446         (ps_text_get_size) Bug fix in computation of em width.
13447         (text) New function, the meat behind ps_text_metrics and
13448         ps_text_draw.  Not complete.
13449         (ps_text_metrics, ps_text_draw) Removed the stub taken from
13450         ascii.c; call text().
13451
13452 Sat Aug 10 23:28:17 1996  Ben Pfaff  <blp@gnu.org>
13453
13454         * arena.c: (arena_free) Assert that the argument is non-NULL.
13455         
13456         * groff-font.c: (add_kern) Calls arena_free() for old_kern if and
13457         only if old_kern is non-NULL.
13458
13459         * postscript.c: (ps_init_driver) Changed default line width to 1
13460         point.
13461         (postopen) New prologue variables.
13462         (ps_line_horz, ps_line_vert, ps_line_intersection) Implements some
13463         more of the common line styles properly, but not all.
13464         (ps_text_metrics) Fixed problem with this stubbed out version that
13465         kept it from taking font sizes into account.
13466
13467 Thu Aug  8 22:31:11 1996  Ben Pfaff  <blp@gnu.org>
13468
13469         * arena.c: (arena_malloc) Bug fix.
13470         (arena_dump) [GLOBAL_DEBUGGING] New function.
13471
13472         * ascii.c: Comment fix.
13473         (count_fancy_chars, delineate) Now static functions.
13474         
13475         * filename.c: (interp_vars) Bug fixes.
13476
13477         * font.h: Comment fixes.
13478
13479         * glob.c: (init_glob) Sets set_viewwidth, set_viewlength at
13480         beginning in case we have an error message to display before
13481         initializing the display.
13482
13483         * groff-font.c: Comment fix.  Changed rehash threshold from 2/3
13484         full to 1/2 full.
13485         (groff_read_font) Bug fixes.
13486         (name_to_index) Increments hash.used.  Sets `name' field of hash
13487         entry properly.
13488         (add_kern) Sets kern_max_used after rehashing.  Other bug fixes.
13489
13490         * hash.c: Return type changed.
13491
13492         * postscript.c: Continued development.  Now marks lines on the
13493         paper, but very buggy.
13494
13495 Sat Aug  3 20:50:35 1996  Ben Pfaff  <blp@gnu.org>
13496
13497         * Changed comments in many source files from `/* xxx /* yyy */' to
13498         `/* xxx */ /* yyy */' for cleanliness.
13499
13500         * arena.c: (arena_sd_strdup) New function.
13501         
13502         * ascii.c: (struct ascii_driver_ext) New member `file'.
13503         (ascii_init_driver) Fills out member `file' for initing; uses
13504         close_file_ext for closing drivers.
13505         (ascii_option) Changed %.*s back to %s because the a_string's are
13506         always null-terminated.
13507         (postopen, preclose) New functions.
13508         (ascii_open_page) Uses new style of open_file_ext.
13509         (ascii_option, commit_line_buf, output_lines) Use ext->file.file
13510         instead of this->output.
13511         (__assert_fail) Removed.
13512
13513         * cmdline.c: Changed syntax_message[].
13514
13515         * error.c: #include's <readline/history.h> only if the history
13516         library is available, not if just the readline library is
13517         available.
13518
13519         * filename.c: (expand_line) Removed alloca() support.
13520         (interp_vars) No longer tilde-expands argument.  Limit on output
13521         length removed.
13522         (tilde_expand) Now treats argument as path rather than filename.
13523         [!unix] Now is a no-op function.
13524         (search_path) Better verbose message formatting.
13525         (open_file, close_file) Comment fixes.
13526         (close_file) [!unix] Doesn't bother with pipes.
13527         (open_file_ext) Completely rewritten, interface revamped.
13528         (close_file_ext) New function.
13529
13530         * font.h: Comment changes.
13531
13532         * frequencies.q: Removed AIX alloca support since it doesn't use
13533         alloca.
13534
13535         * hash.c: Comment changes & additions.
13536         (hsh_create) Initializes entire table instead of first M entries.
13537         (hsh_probe) Stupid bug fixed.  Now it works.
13538         (hsh_dump) [GLOBAL_DEBUGGING] New function.
13539
13540         * main.c: (parse) Detects EOF properly in token-eating loop.
13541         Should the STOP token have its value changed to 0?
13542
13543         * misc.c: (blp_getdelim) [HAVE_GETDELIM] Now it's a macro.
13544         (blp_getline) Now it's a macro.
13545
13546         * output.h: (struct outp_driver) Removed members output, filename.
13547         
13548         * output.c: (outp_init) [!NO_POSTSCRIPT] Installs PostScript
13549         drivers in driver table.
13550         (outp_read_devices) Frees buf.  Warns if there are no active
13551         output drivers.
13552         (outp_configure_clear) Sets outp_configure_vec to NULL after
13553         deleting its elements.
13554         (configure_driver, destroy_driver) Removed references to output,
13555         filename members of outp_driver.
13556         (outp_evaluate_dimension, internal_get_paper_size,
13557         outp_get_paper_size) New functions.
13558
13559         * postscript.c: Continued development.  Now links but doesn't make
13560         any marks on the page.  Lotsa bugs I suppose.
13561
13562         * str.c: (strcasecmp) [!HAVE_STRCASECMP] New function.
13563
13564         * str.h: Comment changes.
13565
13566 Sat Jul 27 22:32:38 1996  Ben Pfaff  <blp@gnu.org>
13567
13568         * Removed dependencies on non-nested comments in several files.
13569         Also removed references to (unix || __unix__) in #if's since
13570         prefh.orig makes those two equivalent.
13571         
13572         * ascii.c: (ascii_open_global) Creates ascii_arena.
13573         (ascii_close_global) Destroys ascii_arena.
13574         (ascii_init_driver) Doesn't create ascii_arena.
13575         (ascii_copy_driver) Removed.
13576         (ascii_option) Possible bugfix regarding %s vs. %.*s with a_string's.
13577         (outp_class ascii_class) Removed ascii_copy_driver reference.
13578
13579         * frequencies.q: Now can display all statistics except median.
13580         Still not finished.
13581
13582         * output.c: Handles outp_class.ref_count so output class
13583         destructors are called properly.
13584         (add_class) Sets ref_count to 0.
13585         (configure_driver) Initializes class if ref_count++ is 0.
13586         (destroy_driver) Destructs class if --ref_count is 0.  Frees the
13587         class output file name.
13588         
13589         * output.h: (struct outp_class) Removed copy_driver, inited.
13590         Added ref_count.
13591
13592         * postscript.c: Completely replaced but not finished.
13593         
13594 Tue Jul 23 21:48:36 1996  Ben Pfaff  <blp@gnu.org>
13595
13596         * approx.h: #includes <float.h>.
13597
13598         * arena.h, arena.c: Many functions changed to take an arena **
13599         instead of an arena *, for consistency.  All callers changed.
13600         (arena_alloc) Now creates a new arena if passed *A that is NULL.
13601         (arena_destroy) Sets *A to NULL.
13602         
13603         * ascii.c: (delineate) Implements OUTP_T_VERT correctly.  Removed
13604         assertion that `width' be positive.
13605
13606         * command.c: Removed #if's from cmd_table.
13607         (walk_cmdtable_func) [0] New function (debug code).
13608         (init_cmd_parser) [0] Dumps out cmd_table (debug code).
13609         (parse_cmd) Doesn't return failure for unimplemented commands.
13610
13611         * common.h: (SYSMIS) Changed from DBL_MAX to -DBL_MAX.
13612         (SYSCODE) New constant macro.
13613
13614         * descript.q: Checks for positive n_variables before performing
13615         analysis.
13616
13617         * file-handle.q: (get_handle_by_filename) Bug fix: passes &f to
13618         avl_find instead of &fp as arg 2.
13619
13620         * frequencies.g, frequencies.q: Continued updating; now compiles &
13621         works again, but not complete.
13622
13623         * main.c: Changes to user messages.
13624
13625         * misc.c: (reverse) [0] New function.
13626
13627         * settings.h: Comment removed.  #includes "common.h".
13628
13629         * som.c: (som_set_null) New function.
13630         (som_set_value, som_set_string, som_set_text) More detailing
13631         assertions.
13632         (som_set_float) Implemented function.
13633         (dump_columnated_table) Bug fix regarding page breaks.
13634         (draw_cell) Bug fix regarding text that spilled out of a cell.
13635         (draw_intersection, draw_horz_rule, draw_vert_rule) No longer draw
13636         null lines.
13637         (get_cell_size) Support SCON_EMPTY cells.
13638         (get_table_size) When calculating rules' widths and heights, mask
13639         out SLIN_SPACING bit.  Added SOPT_X_HLTL support.
13640         
13641         * som.h: (som_any_cell) New option SOPT_X_HTLT.  Removed
13642         SOPT_X_SHADE.
13643         (struct som_submission_form) New member `header'; all users
13644         changed.
13645
13646         * val-labs.c: (get_label) User messages changed.
13647
13648         * var.h: Changed FREQUENCIES structures.
13649
13650         * vars-atr.c: (is_num_user_missing, is_str_user_missing) Made
13651         inline.
13652         
13653 Fri Jul 19 19:11:13 1996  Ben Pfaff  <blp@gnu.org>
13654
13655         * approx.h: Definition of EPSILON now depends on system's
13656         DBL_EPSILON.  Removed GNU C specific code.
13657         (cmpapx) Renamed approx_compare.
13658
13659         * frequencies.g, frequencies.q: Continued updating; still doesn't
13660         compile.
13661
13662         * groff-font.c: (name_to_index) Fix bug that kept it from
13663         compiling.
13664
13665         * hash.c, hash.h: Completed work.
13666
13667         * var.h: Changes to freq_tab, frequencies_proc.
13668         
13669 Wed Jul 17 21:23:36 1996  Ben Pfaff  <blp@gnu.org>
13670
13671         New hashing code.
13672         * hash.c, hash.h: New files.  Not completed.
13673         * Makefile.am: Added hash.c to source file list.
13674         * font.h: (struct font_desc) New member kern_size_p.
13675         * groff-font.c: Uses hash.h.
13676         (hashpjw) Moved to hash.c.
13677         (next_prime_power) Rewrote, renamed hsh_next_prime, moved to
13678         hash.c.
13679         (static var hash) New member size_p.
13680         * var.h: Includes hash.h.
13681         (struct freq_tab) Changed AVL_TREE to hash_tab.
13682
13683         * vars-prs.c: Comment, formatting fixes.
13684
13685         * frequencies.g, frequencies.q: Continued updating.  Not yet
13686         working.
13687
13688         * formats.c: Bug fix.
13689
13690 Tue Jul 16 22:10:04 1996  Ben Pfaff  <blp@gnu.org>
13691
13692         Increasing parallelism between DESCRIPTIVES and FREQUENCIES.
13693         * descript.g: Comment fixes.
13694         * descript.q: Comment fixes.  Moved some declarations into var.h.
13695         Made dsc_info a static table.  Updated FIXMEs.
13696         (internal_cmd_descriptives) Beautified.
13697         
13698         * frequencies.q: Started updating into working order.
13699         * frequencies.g: New file analogous to descript.g.
13700         * var.h: Comment fixes.  Added structures for FREQUENCIES.
13701         
13702         * som.c: Removed vestiges of crushing and partial table support.
13703
13704 Sun Jul 14 15:45:31 1996  Ben Pfaff  <blp@gnu.org>
13705
13706         * Many more changes to som.c especially, but these will not be
13707         documented as I have resolved to remove them.  This patchlevel is
13708         being released solely so that I can fall back to it if I decide
13709         that removing the changes is not a good idea.
13710
13711 Sat Jul 13 09:58:44 1996  Ben Pfaff  <blp@gnu.org>
13712
13713         * som.c: (global var som) New member `cum_y'.
13714         (build_target) Properly handles titles for partial tables.
13715         (dump_partial_beg, dump_partial_mid, dump_partial_end)
13716         Merged into single new function dump_partial().  Fixed problem
13717         with titles on partial tables.
13718         (dump_table) Calls dump_partial() for all parts of partial tables.
13719         (dump_page) Criteria for drawing title changed.
13720         
13721 Fri Jul 12 22:03:36 1996  Ben Pfaff  <blp@gnu.org>
13722
13723         * command.c: (cmd_table) Added LIST, WEIGHT.
13724
13725         * command.c: (cmd_remark) No longer frees `s' since it's not
13726         dynamically allocated.
13727         
13728         * data-out.c: (convert_f) Now correctly handles the case where
13729         abs(v->f)<1 but v->f rounds to a value of 1.00 given the specified
13730         number of decimals.
13731         (som_destroy_all_tables) Removed argument.  All callers changed.
13732         (som_vline, som_hline) Argument validity checking corrected.
13733         (som_set_value) Implemented half-heartedly.
13734         (replicate_table) Copies tables piece-by-piece when using Checker.
13735
13736         * som.h: New line style SLIN_1THIN, currently equivalent to
13737         SLIN_0.  New enum set SOM_SUB_*.
13738         (struct som_submission_form) Removed `seq_no'.  Added `type'.
13739         
13740         * list.q: Newly working file; uses partial tables.
13741         
13742         * som.c: (som_reduce_table) Renamed som_set_table_height().
13743         (som_crush) Removed argument `group'.
13744         (global var som) Removed `nt', `seq_no'.  Added `type'.
13745         (som_submit_table) Arguments changed.
13746         (output_table) Removed partial table code.
13747         (build_target) New arg; partial table support added.  All callers
13748         changed.
13749         (dump_plain_table) Removed partial table code.
13750         (dump_partial_beg, dump_partial_mid, dump_partial_end) New functions.
13751         (dump_table) Supports partial tables.
13752         (dump_page) New argument to allow not drawing top and/or bottom
13753         headers.  All callers changed.  Supports partial tables.
13754
13755 Sat Jul  6 22:22:25 1996  Ben Pfaff  <blp@gnu.org>
13756
13757         * data-out.c: Changed `#include <approx.h>' to `#include
13758         "approx.h".
13759         (convert_F) Comment fix.  Now won't print `-.000', etc.
13760
13761         * descript.q: Now Z-scores work, although there appears to
13762         be a bug (which might actually be in data-out.c:convert_F()).
13763         (descriptives_trns_proc, descriptives_trns_free) New functions.
13764         (run_z_pass) Implemented.
13765         
13766         * var.h: Comment fixes.
13767         (dsc_z_score, descriptives_trns) New structs.
13768         (descriptives_trns) Added to any_trns as `dsc'.
13769
13770         * error.c, error.h: New error class, IS (Installation Script
13771         error), used in those instances where the error is in the
13772         installation, but there is a script file or installation file that
13773         can be usefully referred to.
13774         
13775         * output.c: Change many IE classes to IS classes.
13776
13777         * cases.c, command.c, common.c, crosstabs.q, expr-evl.c,
13778         frequencies.q, list.q, vars-prs.c, vfm.c: Removed reference to
13779         HAVE_MALLOC_H because Borland C++ alloca() is broken, so why
13780         include the corresponding header?
13781         
13782         * glob.c: (init_glob) Don't malloc term_buffer under Checker.
13783         Don't bail out if termcap can't be read.
13784
13785         * som.c: (som_destroy_table) Removed.
13786         (som_reduce_table, som_destroy_all_tables) New functions.
13787         (som_crush) New function, not implemented.
13788         
13789         * som.h: New table option STAB_CRUSH.  Comment fix.  New struct
13790         som_submission_form.  Function prototypes revised.
13791
13792         Outputting huge tables (1000s of rows) a few rows at a time
13793         is supported, though untested.  May even break everything.
13794         Actually, the code doesn't even compile right now.
13795         * som.c: (struct som) New fields htv, nt, seq_no.
13796         (som_submit_table) Multiple arguments changed to a single
13797         pointer to struct submission_form.  Only increments subtable_num
13798         if seq_no is zero.  Only destroys table if it's not going to
13799         be reused.
13800         (replicate_table) New function.
13801         (output_table) Comment fix.
13802         (examine_table) Changed inline code to code calling
13803         replicate_table().  Calculates htv.  Supports partial tables.
13804         (draw_title) Removed comment.
13805         (build_target) Only allows for title on first part of partial
13806         tables.
13807         (dump_plain_table) Only resets table chunk number on first part
13808         of partial tables; FIXME: doesn't work quite right.  Supports
13809         partial tables.
13810         (dump_page) Titles only on first part of partial tables.
13811
13812 Fri Jul  5 20:16:19 1996  Ben Pfaff  <blp@gnu.org>
13813
13814         * Thanks to an unreliable IDE hard drive, I have spent the last
13815         day reconstructing my Debian GNU/Linux installation and redoing
13816         the previous day's changes--somehow I managed to save every file
13817         except for output.c and output.h.  So the following changes could
13818         really be considered independent of the output.c, output.h changes
13819         from Jul 4.
13820
13821         * output.h, output.c: Moved the outp_configure_vec global var,
13822         outp_names struct, and enum set OUTP_S_* from output.h to output.c.
13823         outp_configure_vec is now static.
13824         
13825 Thu Jul  4 20:20:24 1996  Ben Pfaff  <blp@gnu.org>
13826
13827         * The entire philosophy behind configuration of the output drivers
13828         changed.  Now there is a termcap-type configuration where drivers
13829         to be read are determined beforehand, rather than parsing the
13830         entire output init file and storing it in memory & deciding what
13831         to actually use later.  Faster & more memory-efficient at the same
13832         time, cool.
13833         
13834         * output.c: Comment fix.  Removed outp_init_drivers global var.
13835         Removed all references to synonyms.  New structure outp_defn.  New
13836         global vars outp_macros, outp_configure_vec.
13837         (search_name, delete_name, add_name, check_configure_vec,
13838         expand_name, find_defn_value) New static functions.
13839         (outp_configure_clear, outp_configure_add, outp_configure_macro,
13840         outp_read_devices) New extern functions.
13841         (outp_init) Much functionality moved into outp_read_devices.
13842         (outp_read_devices) Format of output init file changed; name of
13843         file is `devices' rather than `output' to avoid Makefile
13844         conflicts.
13845         (outp_clear) Renamed outp_done.
13846         (outp_list_classes) Bug fix, cleaned up.
13847         (outp_list_drivers) Not implemented anymore.
13848         (outp_configure_driver) Now a static function; simplified; now
13849         interpolates macros; supports new structure.
13850         (outp_enable_driver, match_synonym) Removed; all references
13851         removed.
13852         (find_driver) First argument removed.
13853         
13854         * output.h: Global var outp_init_drivers removed; new structure
13855         outp_names; new enum set OUTP_S_*; new global var
13856         outp_configure_vec; function prototypes for output.c exports
13857         updated.
13858         
13859         * main.c: (main) Calls outp_read_devices() after parsing the
13860         command line.
13861         
13862         * cmdline.c: (parse_command_line) New option -v --verbose;
13863         --version changed to -V.  --device option changed syntax to just
13864         take a single device name.  Accepts key=value declaration of
13865         output init file macros.  Syntax message updated.
13866
13867         * filename.c: (expand_line) New function.
13868         (interp_environ_vars) Renamed interp_vars; no longer uses
13869         fixed-size buffer.
13870         (blp_getenv) Allows $ARCH and $VER pseudo-environment-vars to be
13871         overridden by real environment vars.
13872         (search_path) Uses verbose_msg() instead of #ifdef'd printf().
13873         * filename.h: interp_environ_vars() renamed interp_vars().
13874         
13875         * error.c, error.h: Added extern variable `verbosity', message
13876         class MM.
13877         
13878         * error.c: (vmsg) Support message class MM.
13879         (verbose_msg) New function.
13880
13881         * descript.q: (generate_z_varname) Bug fix in generation of
13882         Z-score varnames.
13883         (dump_z_table) Bug fix in column headers.
13884         
13885         * ascii.c: (ascii_init_driver) Changed minimum number of lines per
13886         page from 29 to 15.  Don't set a default for ops[OPS_INIT,
13887         OPS_DONE].  Writes the uninit string when the driver is closed.
13888         (ascii_open_page) Write the init string before the first page.
13889         (output_shorts) Form of main loop changed from `while' to `for'.
13890         Bug fix with overstrikes: the character is printed *after* the
13891         backspace.  Eliminated a lot of `& 0xff' modifiers.
13892         (advance_to_left_margin) New function.
13893         (return_carriage, output_lines) Handle left margin.
13894
13895 Thu Jul  4 00:35:59 1996  Ben Pfaff  <blp@gnu.org>
13896
13897         * ascii.c: New option `carriage-return-style'.
13898
13899         * ascii.c: (count_fancy_chars) New function.
13900         (delineate, text_metrics) Use new function; bug fixes regarding
13901         rich text strings.
13902         (text_draw) Bug fix with rich text.
13903         (output_string, output_shorts) Reordered.
13904         (output_shorts) Now handles boxchars and some overstrike font
13905         changes.
13906         (output_char, return_carriage) New functions.
13907         (output_lines) Now handles overstriking and font changes properly;
13908         some code moved to output_shorts.
13909
13910 Tue Jul  2 22:13:23 1996  Ben Pfaff  <blp@gnu.org>
13911
13912         [GLOBAL_DEBUGGING]
13913         * ascii.c: New member `debug' in ascii_driver_ext.
13914         (ascii_init_driver, delineate) Uses new member.
13915
13916         Now you can set a vertical height on writing text.
13917         * ascii.c: (delineate) Keeps track of vertical position.
13918         (text_draw) No longer considers fully justified text an internal
13919         error.
13920         
13921         * output.h: New flag OUTP_T_VERT; other OUTP_T_ values changed.
13922
13923         Tables' titles are drawn; they can have variable height.
13924         * som.c: `som' struct has new member, title_height.
13925         (draw_title) New argument.  Moved within file.  All caller
13926         changed.
13927         (build_target) New argument, amount of space needed for first row.
13928         Calculates height of title, takes that into account.  All callers
13929         changed.
13930         (dump_plain_table, dump_columnated_table) Took calculation of y1,
13931         y2 out of loop.
13932         (dump_columnated_table) [GLOBAL_DEBUGGING] Debugging code
13933         improved.
13934         (dump_columnated_table) Organized for readability.
13935         (dump_page) Makes use of som.title_height.
13936
13937         * som.c: Many comment bug fixes.
13938
13939         * descript.q: (try_name, generate_z_name) Bug fix regarding
13940         generation of Z-score variable names.
13941         * var.h: Removed num from descriptives_proc; all referents removed.
13942
13943 Mon Jul  1 22:13:39 1996  Ben Pfaff  <blp@gnu.org>
13944
13945         * ascii.c: (ascii_line_horz, ascii_line_vert,
13946         ascii_line_intersection) Added debugging code.
13947
13948         Added a descriptive line above each table to describe it.
13949         * command.c: (parse_cmd) Calls som_new_series.
13950         
13951         * som.c: New static vars table_num, subtable_num.  New `som'
13952         member `title'.
13953         (dump_page) New arguments.
13954         (som_submit_table) Handle new variables.
13955         
13956         * som.c, som.h: (som_submit_table) New arguments.  All callers
13957         changed.
13958         (som_new_series) New function.
13959         (build_target) Makes room for extra line.
13960         (draw_title) New function.
13961         (dump_page) Calls draw_title.  Bug fix: doesn't always set
13962         som.ext->cp to 0.
13963         
13964         Columnation of tables support.
13965         * som.h: Deleted fr, lr, ri from som_table.  Reorganized.
13966         
13967         * som.c: Deleted references to fr, lr, ri.
13968         (som_columnate) Bux fix: sets group member of table.
13969         (som_add_options) Function removed.
13970         (dump_table) Split into three functions; extensively reworked.
13971         
13972         * descript.q: (dump_z_table) Better output table formatting; added
13973         title support to correspond to som.h changes.
13974         (display) Title support.
13975
13976         * output.h: Added OUTP_T_NONE.
13977         
13978 Mon Jul  1 13:00:00 1996  Ben Pfaff  <blp@gnu.org>
13979
13980         * descript.q: Improved handling of Z scores; still not perfect.
13981         
13982         * output.h, ascii.c: Added hook for getting em width of current
13983         font.
13984         
13985         * som.c: Uses new em-width hook.  Added debugging code to
13986         several functions.
13987         (som_columnate) New argument.
13988         (som_add_options) Removed.
13989
13990 Jun 29 17:40:47 1996  Ben Pfaff  <blp@gnu.org>
13991
13992         * som.h, som.c, output.c, output.h, ascii.c: Updated to work with
13993         rules as a property of the table instead of as a property of the
13994         cells.
13995         
13996         * ascii.c: Added `header' to table of options.
13997         
13998         * descript.q: Added even shorter statistic names; modified to work
13999         with new som interface.
14000         
14001         * misc.c (blp_getdelim): Bug fix.
14002         
14003         * version.c: includes 'conf.h'.
14004         
14005 ----------------------------------------------------------------------
14006 Local Variables:
14007 mode: change-log
14008 version-control: never
14009 End: