Continue reforming procedure execution. In this phase, break
[pspp] / src / ChangeLog
1 Wed Apr 26 19:33:52 2006  Ben Pfaff  <blp@gnu.org>
2
3         Continue reforming procedure execution.  In this phase, break
4         procedure.c into multiple files.
5         
6         * procedure.c (vfm_last_invocation): Rename
7         time_of_last_procedure().  Update all references.
8         (struct storage_stream_info) Move to data/storage-stream.c.
9         (storage_sink_open) Ditto.
10         (destroy_storage_stream_info) Ditto.
11         (storage_sink_write) Ditto.
12         (storage_sink_destroy) Ditto.
13         (storage_sink_make_source) Ditto.
14         (var storage_sink_class) Ditto.
15         (storage_source_count) Ditto.
16         (storage_source_read) Ditto.
17         (storage_source_destroy) Ditto.
18         (storage_source_class) Ditto.
19         (storage_source_get_casefile) Ditto.
20         (storage_source_create) Ditto.
21         (null_sink_class) Move to data/case-sink.c.
22         (create_case_source) Move to data/case-source.c.
23         (free_case_source) Ditto.
24         (case_source_is_class) Ditto.
25         (create_case_sink) Move to data/case-sink.c.
26         (free_case_sink) Ditto.
27
28         * procedure.h: (struct case_source) Move to data/case-source.h.
29         (struct case_source_class) Ditto.
30         (struct case_sink) Move to data/case-sink.h.
31         (struct case_sink_class) Ditto.
32
33 Thu Apr 27 09:28:25 WST 2006 John Darrington <john@darrington.wattle.id.au>
34         
35         * automake.mk: Removed explicit dependencies for message.o, since
36         that module no longer exists.
37
38 Wed Apr 26 15:29:45 2006  Ben Pfaff  <blp@gnu.org>
39
40         Start reforming procedure execution.  In this phase, get rid of
41         function prototypes for never-defined functions.
42         
43         * procedure.h: Get rid of function prototypes for never-defined
44         functions.
45
46 Wed Apr 26 12:58:46 2006  Ben Pfaff  <blp@gnu.org>
47
48         Improve the way we handle the various parsing "states".  Until now
49         we've hard-coded the state transitions in the command definition
50         file, but that's error-prone and, worse, it's redundant--we can
51         figure out what state we're in anyhow.  We can cleanly handle
52         INPUT PROGRAM and FILE TYPE with a nested command-processing loop.
53         
54         * procedure.c (case_source_is_complex): Removed.
55         (discard_variables) No need to set pgm_state anymore.
56
57 Tue Apr 25 11:06:49 2006  Ben Pfaff  <blp@gnu.org>
58
59         Finish reforming error message support.  In this phase, move
60         message.c into libpspp.
61         
62         * message.c: Move to libpspp.
63
64 Tue Apr 25 10:47:37 2006  Ben Pfaff  <blp@gnu.org>
65
66         Continue reforming error message support.  In this phase, drop
67         actual message printing from core code, substituting a callback,
68         and add the callback to each UI.  Also, move verbose_msg() into
69         its own module.
70
71         * message.c: (var err_error_count) Renamed error_count and moved
72         to ui/terminal/msg-ui.c.
73         (var err_warning_count) Renamed warning_count and moved to
74         ui/terminal/msg-ui.c.
75         (err_check_count) Renamed check_msg_count() and moved to
76         ui/terminal/msg-ui.c.
77         (dump_message) Rewrote to take stream instead of function pointer
78         and moved to ui/terminal/msg-ui.c.
79         (msg_emit) Moved its guts to ui/terminal/msg-ui.c as handle_msg()
80         and rewrote to just pass message to callback.
81         
82         (var err_verbosity) Renamed "verbosity" and moved to
83         libpspp/verbose-msg.c.
84         (verbose_msg) Moved to libpspp/verbose-msg.c.
85         
86         (var err_already_flagged) Removed.
87         (puts_stdout) Removed.
88         
89         (var msg_handler) New static variable.
90         (msg_init) New function.
91         (msg_get_command_name) New function.
92         
93 Mon Apr 24 17:40:08 2006  Ben Pfaff  <blp@gnu.org>
94
95         Continue reforming error message support.  In this phase, rename
96         all the message functions and types to start with "msg", except
97         for the ones that will be moving to other modules anyway.
98
99         All references to the identifiers below were updated likewise.
100         
101         * message.c: (err_done) Renamed msg_done().
102         (err_push_file_locator) Renamed msg_push_msg_locator().
103         (err_pop_file_locator) Renamed msg_pop_msg_locator().
104         (err_location) Renamed msg_location().
105         (err_set_command_name) Renamed msg_set_command_name().
106
107 Mon Apr 24 14:11:33 2006  Ben Pfaff  <blp@gnu.org>
108
109         * message.c: Use exit.h from gnulib instead of checking for and
110         defining EXIT_SUCCESS and EXIT_FAILURE by hand.
111
112 Sun Apr 23 22:00:23 2006  Ben Pfaff  <blp@gnu.org>
113
114         Continue reforming error message support.  In this phase, get rid
115         of message "titles" and put the message text in `struct error'.
116         Now `struct error' encapsulates a message more properly.
117
118         * message.c: (tmsg) Removed.
119         (msg) Use err_msg() instead of err_vmsg().  Format message
120         ourselves.
121         (err_vmsg) Renamed err_msg().  Changed interface, dropping message
122         and va_list args which are now in the error struct.
123                 
124 Sun Apr 23 20:35:28 2006  Ben Pfaff  <blp@gnu.org>
125
126         Continue reforming error message support.
127
128         * message.c: Use linebreak module from gnulib instead of home-brew
129         line breaking.
130         (puts_stdout) Rewrote.
131         (dump_message) Rewrote.  Changed interface and updated all callers.
132         (compulsory_break) Removed.
133         (char_is_break) Removed.
134         (break_before) Removed.
135         (break_after) Removed.
136         (macro BREAK_LONG_WORD) Removed.
137
138 Sun Apr 16 20:41:10 2006  Ben Pfaff  <blp@gnu.org>
139
140         Continue reforming error message support.  In this phase, we
141         divide the classification of messages along "category" and
142         "severity" axes.
143
144         * message.c: (err_vmsg) Rewrite to deal with categories and
145         severities in a straightforward manner instead of mixing them into
146         classes.
147         [0] (puts_stderr) Removed (dead code).
148         (msg) Changed first argument from `int' to `enum msg_class'.
149         (tmsg) Ditto.
150
151 Sun Apr 16 18:53:12 2006  Ben Pfaff  <blp@gnu.org>
152
153         GNU standards require "file name" instead of "filename" in
154         documentation.  It's nice for our code to follow the convention
155         too.
156
157         Basically did search and replace in the whole source tree.  Major
158         changes in function names or struct member names have their own
159         change log entries.
160
161 Sun Apr 16 15:58:56 2006  Ben Pfaff  <blp@gnu.org>
162
163         Continue reforming error message support.  In this phase, we get
164         rid of VM() and the other msg() support for "verbosity", replacing
165         it by a new function verbose_msg().
166
167         * message.c: (verbose_msg) New function.
168         (err_vmsg) Remove support for verbosity levels.
169
170 Sun Apr 16 11:46:51 2006  Ben Pfaff  <blp@gnu.org>
171
172         Start reforming error message support.  In this phase, we get rid
173         of "installation errors" and change all uses of msg() in the
174         output drivers to uses of error() or error_at_line().
175
176         * message.c: (err_vmsg) Get rid of IE, IS support.
177
178 Sat Mar 11 14:17:47 WST 2006 John Darrington <john@darrington.wattle.id.au>
179
180         * automake.mk: Changed the pattern specific AM_CPPFLAGS to two target 
181           specific ones. Eventually there will be none at all.
182
183         * automake.mk: Moved the pspp binary to ui/terminal
184
185 Sat Mar  4 12:59:08 2006  Ben Pfaff  <blp@gnu.org>
186
187         * In many source files, #include "compiler.h" to get GCC attribute
188         definitions.
189
190 Sat Mar  4 12:28:09 2006  Ben Pfaff  <blp@gnu.org>
191
192         * In many source files, replace INT_DIGITS by
193         INT_STRLEN_BOUND(int) and include intprops.h.
194
195 John Darrington:
196         
197         * Replaced '_' with '-' in most filenames.
198
199         * Renamed files as follows:
200                 vfm.[ch] to procedure.[ch]
201                 error.[ch] to message.[ch]
202                 getl.[ch] to line-buffer.[ch]
203                 mkfile.[ch] to make-file.[ch]
204                 pfm-write.h to por-file-writer.h
205                 pfm-write.c to por-file-writer.c
206                 sfmP.h to sfm-private.h
207                 lex-def.c to identifier.c
208                 lex-def.h to identifier.h
209                 sfm-read.c to sys-file-reader.c
210                 sfm-read.h to sys-file-reader.h
211                 sfm-write.h to sys-file-writer.h
212                 sfm-write.c to sys-file-writer.c
213                 chart.[ch] to chart-geometry.[ch]
214                 val.h to value.h
215                 var.h to variable.h
216                 vars-atr.c to variable.c
217                 ctl-stack.c to control-stack.c
218                 ctl-stack.h to control-stack.h
219                 dfm-read.c to data-reader.c
220                 dfm-write.c to data-writer.c
221                 dfm-write.h to data-writer.h
222                 dfm-read.h to data-reader.h
223                 apply-dict.c to apply-dictionary.c
224                 mis-val.c to missing-values.c
225                 sysfile-info.c to sys-file-info.c
226                 modify-vars.c to modifiy-variables.c
227                 rename-vars.c to rename-variables.c
228                 val-labs.c to value-labels.c
229                 var-display.c to variable-display.c
230                 var-labs.c to variable-label.c
231                 format-prs.c to format-parser.c
232                 range-prs.c to range-parser.c
233                 range-prs.h to range-parser.h
234                 subclist.c to subcommand-list.c
235                 subclist.h to subcommand-list.h
236                 vars-prs.c to variable-parser.c
237                 descript.c to descriptives.c
238                 sort-prs.c to sort-criteria.c/sort-cases.c
239                 sort-prs.h to sort-criteria.h
240                 sel-if.c to select-if.c
241                 algorithm.c to array.c
242                 algorithm.h to array.h
243                 bitvector.h to bit-vector.h
244                 som.c to manager.c
245                 som.h to manager.h
246                 tab.h to table.h
247                 tab.c to table.c
248                 readln.c to read-line.c
249                 readln.h to read-line.h
250                 cmdline.c to command-line.c
251                 cmdline.h to command-line.h
252
253
254 Sat Feb 11 22:35:20 2006  Ben Pfaff  <blp@gnu.org>
255
256         General clean-ups and minor bug fixes.
257
258         * filename.h: Move DIR_SEPARATOR, PATH_SEPARATOR here from
259         pref.h.orig.
260
261         * lex-def.h: (macro CHAR_IS_ID1) Removed.  All references changed
262         to lex_is_id1().
263         (macro CHAR_IS_IDN) Removed.  All references changed to
264         lex_is_idn().
265         
266         * lex-def.c: (lex_is_id1) New function.
267         (lex_is_idn) New function.
268         (lex_skip_identifier) New function.
269         (lex_id_match_len) Return bool instead of int.
270         (lex_id_match) Ditto.
271
272         * command.c: (parse_command_name) Convert parsed words to
273         uppercase to make error messages easier to read.
274         (cmd_host) Fix return value.
275
276         * dfm-read.c: (read_inline_record) Use tokens to check for BEGIN
277         DATA, not specialized lexical analysis.
278
279         * print.c: (print_space_trns_proc) Count of lines should be `int',
280         otherwise we might never finish.
281         (print_space_trns_free) Close writer.
282
283         * lexer.c: (enum string_type) New enum.
284         (lex_get) Remove essentially unused local variable `cp'.
285         Use enum string_type values.  Use parse_id().
286         (parse_id) New function.
287         (lex_look_ahead) Recognize octal strings too.
288         (strip_comments) New function.
289         (lex_get_line) Rewrite.
290         (lex_preprocess_line) Removed.
291         (convert_numeric_string_to_char_string) Use enum string_type.
292         (parse_string) Ditto.
293
294         * autorecode.c: (recode) Clone correct number of bytes based on
295         source string width.
296
297 Sat Feb 11 22:34:38 2006  Ben Pfaff  <blp@gnu.org>
298
299         Reduce dependencies on getl, and of getl.
300
301         * data-in.c: (vdls_error) Don't output different message depending
302         on whether we're interactive.
303
304         * getl.h: (struct getl_line_list) Removed.
305         (struct getl_script) Removed.
306         (GETL_PRPT_*) Removed.
307         (GETL_MODE_*) Removed.
308         (GETL_PROMPT_FIRST, GETL_PROMPT_LATER, GETL_PROMPT_DATA,
309         GETL_PROMPT_CNT) New enums.
310
311         * settings.c: (static var prompt) Removed.
312         (static var cprompt) Removed.
313         (static var dprompt) Removed.
314         (settings_done) Don't initialize prompt, cprompt, dprompt.
315         (get_prompt) Removed.
316         (set_prompt) Removed.
317         (get_dprompt) Removed.
318         (set_dprompt) Removed.
319         (get_cprompt) Removed.
320         (set_cprompt) Removed.
321
322         * pfm-read.c: (corrupt_msg) Don't show filename and line number,
323         to get rid of getl_location().
324
325         * sfm-read.c: (corrupt_msg) Ditto.
326
327         * getl.c: (struct getl_source) New.
328         (static var cur_source) New.
329         (static var last_source) New.
330         (static var DO_REPEAT_level) Removed.
331         (global var getl_head) Removed.
332         (global var getl_tail) Removed.
333         (getl_initialize) Call init_prompts().
334         (getl_add_file) Removed.
335         (getl_include) Removed.
336         (getl_add_DO_REPEAT_file) Removed.
337         (getl_handle_line_buffer) Removed.
338         (getl_close_file) Removed.
339         (getl_close_all) Removed.
340         (getl_is_separate) Removed.
341         (getl_set_separate) Removed.
342         (getl_reading_script) Removed.
343         (append_source) New function.
344         (include_source) New function.
345         (create_source) New function.
346         (create_syntax_file_source) New function.
347         (create_filter_source) New function.
348         (create_function_source) New function.
349         (create_interactive_source) New function.
350         (getl_append_syntax_file) New function.
351         (getl_include_syntax_file) New function.
352         (getl_include_filter) New function.
353         (getl_include_function) New function.
354         (getl_append_interactive) New function.
355         (getl_abort_noninteractive) New function.
356         (getl_is_interactive) New function.
357         (close_source) New function.
358         (getl_location) Use new `cur_source' var.
359         (getl_uninitialize) Use close_source().  Call uninit_prompts().
360         (read_syntax_file) New function.
361         (read_line_from_source) New function.
362         (do_read_line) New function.
363         (getl_read_line) Rewrite.
364         (static var prompts) New.
365         (static var current_style) New.
366         (init_prompts) New function.
367         (uninit_prompts) New function.
368         (getl_get_prompt) New function.
369         (getl_set_prompt) New function.
370         (getl_set_prompt_style) New function.
371         (get_prompt) New function.
372
373         * command.c: Merge the EXIT (aka Q, aka QUIT) and FINISH commands,
374         and make EXIT undocumented.  EXIT was a PSPP extension that never
375         really entirely made sense.
376         (cmd_exit) Removed.
377         (cmd_finish) Return CMD_EOF unconditionally.
378         (cmd_clear_transformations) Drop requirement of interactivity.
379
380         * command.def: Merge the EXIT (aka Q, aka QUIT) and FINISH
381         commands.
382
383         * repeat.c: Major changes to match getl revision.
384         (struct line_list) New struct.
385         (enum repeat_entry_type) New.
386         (struct repeat_entry) Made `type' an enum repeat_entry_type.
387         (struct repeat_block) New.
388         (static var repeat_tab) Removed.
389         (static var count) Removed.
390         (static var line_buf_head) Removed.
391         (static var line_buf_tail) Removed.
392         (cmd_do_repeat) Rewritten.
393         (clean_up) Removed.
394         (append_record) Removed.
395         (recognize_keyword) New function.
396         (internal_cmd_do_repeat) Removed.
397         (parse_specification) New function.
398         (skip_indentor) New function.
399         (recognize_do_repeat) New function.
400         (recognize_end_repeat) New function.
401         (parse_lines) New function.
402         (create_vars) New function.
403         (parse_ids) Use enum repeat_entry_type.
404         (parse_strings) Ditto.
405         (find_DO_REPEAT_substitution) Renamed find_substitution(),
406         rewrote.
407         (perform_DO_REPEAT_substitutions) Renamed do_repeat_filter(),
408         rewrote.
409         (do_repeat_read) New function.
410         (do_repeat_close) New function.
411
412         * data-list.c: Don't need to keep track of eof from getl anymore,
413         because getl can tell us now.
414         (struct data_list_pgm) Removed `eof' member.
415         (cmd_data_list) Don't assign to `eof'.
416         (get_data_list_read_func) Renamed read_from_data_list(), changed
417         interface.
418         (read_from_data_list_fixed) Changed interface.
419         (read_from_data_list_free) Changed interface.
420         (read_from_data_list_list) Changed interface.
421         (data_list_trns_proc) Rewrote based on dfm_eof() and
422         dfm_reader_error().
423         (data_list_source_read) Check for dfm reader errors.
424
425         * dfm-read.c: (enum dfm_reader_flags) Removed DFM_EOF in favor of
426         new `eof_cnt' member in struct dfm_reader.
427         (struct dfm_reader) New `eof_cnt' member.
428         (dfm_close_reader) Check `eof_cnt', not DFM_EOF.
429         (dfm_open_reader) Initialize `eof_cnt'.
430         (read_inline_record) Set prompt style with
431         getl_set_prompt_style().  
432         (read_record) Rewrite.
433         (cmd_begin_data) Set prompt style with getl_set_prompt_style().
434
435         * include.c: (cmd_include) Use getl_include_syntax_file().
436
437         * set.q: (cmd_set) Use getl_set_prompt().
438
439         * html.c: (postopen) Remove "source-file" expansion variable, to
440         avoid use of getl_location().
441
442         * postscript.c: (postopen) Remove "source-file" expansion
443         variable, to avoid use of getl_location().
444
445         * cmdline.c: (parse_command_line) Drop -c command line option,
446         because it wasn't very useful.  -i command line option now calls
447         getl_append_interactive().  Use new getl function interfaces.
448         Drop support for clearing dictionary between syntax files and thus
449         the "+" command line syntax.
450         (static var pre_syntax_message) Remove description of now-gone -c
451         option.  Remove "+" command line syntax.
452
453         * main.c: (main) Only call handle_error() if the return value is
454         an error.
455         (execute_command) Use getl_set_prompt_style().  Drop support for
456         clearing dictionary between syntax files.
457         (handle_error) Handle CMD_CASCADING_FAILURE.  Don't call err_break().
458
459         * readln.c: Drop lots of #ifdefs.  Now that the Autoconf tests are
460         pickier, we can just use HAVE_READLINE.
461         (static var welcomed) Move into welcome().
462         (welcome) Make `welcomed' a local static var.  Check for and read
463         history file here.
464         (global var getl_mode) Removed.
465         (global var getl_interactive) Removed.
466         (global var getl_prompt) Removed.
467         (getl_read_line) removed.
468         (readln_read) New function.
469         (read_console) Removed.
470         
471
472 Sat Feb 11 22:16:21 2006  Ben Pfaff  <blp@gnu.org>
473
474         Try to reduce some of the nastier dependencies on the error
475         module, and at the same time make PSPP nicer to deal with, by
476         getting rid of fatal errors.  All the existing calls to msg (FE,
477         ...) or err_cond_fail() or err_failure() have been replaced by
478         propagating an error upward to the command-dispatch layer.
479         Unfortunately this propagation took a fair bit of extra mechanism,
480         because now a lot of functions can fail that couldn't before.
481
482         New command return value CMD_CASCADING_FAILURE which indicates to
483         the command processor that syntax file processing should be
484         abandoned.  Many commands were modified to return
485         CMD_CASCADING_FAILURE.  When this modification was trivial it
486         isn't mentioned in detail below.
487
488         Transformation procedures (trns_proc_func) and free functions
489         (trns_free_func) now have a `bool' return type, which is normally
490         true, but false when an I/O or other serious error occurs.  All
491         transformation functions were modified to have this return type.
492         When this modification was trivial it isn't mentioned in detail
493         below.
494
495         * pspp-error.h: (FE) Removed this error class.
496
497         * error.c: (err_failure) Removed.
498         (err_cond_fail) Removed.
499         (err_break) Removed (it was unused).
500         (err_check_count) Don't cause a fatal error--instead, stop reading
501         the syntax file.
502         (err_vmsg) Don't have FE anymore, so no need to call terminate().
503
504         * any-reader.c: (any_reader_error) New function.
505
506         * any-writer.c: (any_writer_write) Propagate
507         scratch_writer_write_case()'s new return value.
508         (any_writer_error) New function.
509         (any_writer_close) Propagate underlying function's new return
510         value.
511
512         * casefile.c: Add an "error state" to a casefile.  A casefile that
513         encounters an I/O error enters the error state, and afterward
514         reading and writing cases fails.
515         (struct casefile) Add `ok' member.
516         (casefile_create) Set `ok' to true.
517         (casefile_destroy) Use io_error().
518         (casefile_error) New function.
519         (casefile_sleep) Now returns bool to indicate success.
520         (casefile_append) Ditto.
521         (casefile_append_xfer) Ditto.
522         (casefile_to_disk) Ditto.
523         (write_case_to_disk) Don't do anything in error state.
524         (flush_buffer) Don't do anything in error state.  Use io_error().
525         (reader_open_file) Ditto.
526         (fill_buffer) Ditto.
527         (casereader_read) Don't do anything in error state.  Handle
528         errors.
529         (casereader_read_xfer_assert) Removed, because now an I/O error
530         can occur even if the caller knows a case exists.
531         (io_error) New function.
532
533         * mkfile.c: (make_temp_file) Make failure non-fatal.
534         (make_unique_file_stream) Ditto.
535
536         * pfm-read.c: Add an error state.
537         (struct pfm_reader) Add `ok' member to indicate error state.
538         (error) Set `ok' to false.
539         (pfm_open_reader) Set `ok' to true.  Make failure non-fatal.
540         (pfm_read_case) Don't do anything in error state.
541         (pfm_read_error) New function.
542
543         * pfm-write.c: Postpone most error checking in favor of checking
544         ferror() afterward.
545         (pfm_open_writer) Make failure non-fatal.  Check for write error
546         after writing header.
547         (buf_write) Don't do anything if error has occurred.  Postpone
548         error checking.  Change return type to void.
549         (write_float) Postpone error checking.  Change return type to
550         void.
551         (write_int) Ditto.
552         (write_string) Ditto.
553         (write_header) Ditto.
554         (write_version_data) Ditto.
555         (write_format) Ditto.
556         (write_value) Ditto.
557         (write_variables) Ditto.
558         (write_value_labels) Ditto.
559         (pfm_write_case) Don't do anything if error has occurred.
560         (pfm_write_error) New function.
561         (pfm_close_writer) Change return type to bool.  Return false if an
562         I/O error occurred.
563
564         * scratch-reader.c: (scratch_reader_error) New function.
565
566         * scratch-writer.c: (scratch_writer_write_case) Change return type
567         to bool.  Propagate casefile error return.
568         (scratch_writer_error) New function.
569         (scratch_writer_close) Change return type to bool.  Propagate
570         casefile error return.
571
572         * sfm-read.c: Add an error state.
573         (struct sfm_reader) Add `ok' member.
574         (sfm_open_reader) Initialize `ok'.  Make errors non-fatal.
575         (buf_read) Set `ok' to false on error.
576         (buffer_input) Do nothing in error state.  Set `ok' to false on
577         error.
578         (read_compressed_data) Set `ok' false on error.
579         (sfm_read_case) Return false in error state.
580         (fread_ok) Set `ok' false on error.
581         (sfm_read_error) New function.
582
583         * sfm-write.c: Postpone most error checking in favor of checking
584         ferror() afterward.
585         (sfm_open_writer) Make failure non-fatal.  Check for write error
586         after writing header.
587         (write_header) Postpone error checking.  Change return type to
588         void.
589         (write_variable) Ditto.
590         (write_value_labels) Ditto.
591         (write_documents) Ditto.
592         (write_variable_display_parameters) Ditto.
593         (write_longvar_table) Ditto.
594         (write_rec_7_34) Ditto.
595         (buf_write) Ditto.
596         (ensure_buf_space) Ditto.
597         (sfm_write_case) Do nothing if write error has occurred.
598         (sfm_write_error) New function.
599         (pfm_close_writer) Change return type to bool.  Return false if an
600         I/O error occurred.
601
602         * var.h: Introduced a new return value for trns_proc_func that
603         means "a serious error has occurred, so abort the procedure
604         entirely".  Because the hard-coded values of -1, -2, etc. were
605         becoming even a worse idea now, also introduced some macros for
606         them: TRNS_CONTINUE, TRNS_DROP_CASE, TRNS_ERROR, TRNS_NEXT_CASE,
607         TRNS_END_FILE.  Also replaced all references to the hard-coded
608         values by uses of the macros.
609         
610         * command.h: New command return value CMD_CASCADING_FAILURE which
611         indicates to the command processor that syntax file processing
612         should be abandoned.
613
614         * dfm-read.c: (dfm_open_reader) Make failure non-fatal.
615         (dfm_reader_error) New function.
616         (read_inline_record) Make unexpected end of file nonfatal.
617         (read_file_record) Make read error nonfatal.
618         (dfm_eof) Make second unexpected end of file nonfatal.
619         (cmd_begin_data) Make errors nonfatal.  
620         
621         * dfm-write.c: (dfm_open_writer) Make failure non-fatal.
622         (dfm_write_error) New function.
623         (dfm_put_record) Do nothing in error state.  Now return error
624         state.
625         (dfm_close_reader) Now return `bool' indicating error state.
626
627         * file-type.c: (file_type_source_read) Now return `bool'
628         indicating error state.
629
630         * get.c: (case_reader_source_read) Now return `bool' indicating
631         write error.
632         (case_writer_destroy) Ditto.
633         (case_writer_write_case) Ditto.
634         (struct mtf_proc) New member `ok' indicating error state.
635         (cmd_match_files) Initialize and deal with `ok'.
636         (mtf_processing_finish) Now return `bool' indicating I/O error.
637         (mtf_free_file) Renamed mtf_close_file().  Now return `bool'
638         indicating I/O error.
639         (mtf_free) Now return `bool' indicating I/O error.
640         (mtf_delete_file_in_place) Ditto.
641         (mtf_read_nonactive_records) Ditto.
642         (mtf_processing) Ditto.
643
644         * inpt-pgm.c: (input_program_source_read) Now return `bool'
645         indicating I/O error.  Handle new TRNS_ERROR transformation return
646         value.
647
648         * matrix-data.c: Introduce error state.
649         (cmd_matrix_data) Check error return values.
650         (read_matrices_without_rowtype) Now return `bool' indicating I/O
651         error.
652         (matrix_data_read_without_rowtype) Ditto.
653         (dump_cell_content) Ditto.
654         (nr_output_data) Ditto.
655         (read_matrices_with_rowtype) Ditto.
656         (matrix_data_read_with_rowtype) Ditto.
657         (wr_output_data) Ditto.
658
659         * lexer.c: (lex_init) Make unexpected eof non-fatal.
660         (lex_get) Ditto.
661         (lex_look_ahead) Ditto.
662         (unexpected_eof) Removed.
663         (convert_numeric_string_to_char_string) Make unexpected eof
664         non-fatal.
665         (parse_string) Ditto.
666
667         * flip.c: Make I/O errors non-fatal.
668         (struct flip_pgm) Add `pool', `output_buf' members.
669         (cmd_flip) Create and use pool.  Propagate errors.
670         (destroy_flip_pgm) Rewrite, using pool.
671         (struct flip_sink_info) Removed.
672         (flip_sink_create) Use pool.  Make errors non-fatal.
673         (flip_sink_write) Make errors non-fatal.
674         (flip_file) Make errors non-fatal.  Make `bool' return type to
675         indicate failure.
676         (flip_sink_destroy) Remove.
677         (static var flip_sink_class) Use NULL as destroy func, not
678         flip_sink_destroy().
679
680         * sort.c: Make I/O errors non-fatal.  Propagate errors.
681         (sort_active_file_in_place) Propagate errors.
682         (sort_active_file_to_casefile) Ditto.
683         (do_internal_sort) Ditto.
684         (do_external_sort) Ditto.
685         (write_runs) Ditto.
686         (destroy_initial_run_state) Propagate errors via new `bool' return
687         type.
688         (merge) Propagate errors.
689         (merge_once) Ditto.
690
691         * output.c: [GLOBAL_DEBUGGING] Remove reentrancy detection,
692         because it used msg (FE, ...) and wasn't very useful.
693
694         * main.c: (handle_error) Handle CMD_CASCADING_FAILURE.
695
696         * vfm.c: (struct write_case_data) Change `proc_func' return type
697         to bool.
698         (procedure) Add `bool' return type to indicate I/O error.
699         Propagate errors.
700         (internal_procedure) Ditto.
701         (write_case) Ditto.
702         (execute_transformations) If a transformation returns TRNS_ERROR,
703         propagate the error.
704         (close_active_file) Add `bool' return type to indicate I/O error.
705         Propagate errors.
706         (cancel_transformations) Add `bool' return type to indicate I/O
707         error.  Propagate errors.
708         (struct split_aux_data) Change `proc_func' return type to bool.
709         (procedure_with_splits) Change `proc_func' return type to bool.
710         Add `bool' return type to indicate I/O error.
711         (multipass_procedure_with_splits) Change `split_func' return type
712         to bool.  Add `bool' return type to indicate I/O error.
713         (multipass_split_callback) Add `bool' return type to indicate I/O
714         error.  Propagate errors.
715
716         * vfm.h: (struct case_source_class) Change `read' return type from
717         void to bool to allow reporting I/O errors.  Updated all
718         implementations to do so.
719         (struct case_sink_class) Change `write' return type from void to
720         bool to allow reporting I/O errors.  Updated all implementations
721         to do so.
722
723 Sun Feb 12 18:12:56 2006  Ben Pfaff  <blp@gnu.org>
724
725         * pool.c: Useful new functions.
726         (pool_tmpfile) New function.
727         (pool_attach_file) New function.
728         (pool_detach_file) New function.
729         (pool_fopen) Reimplement in terms of pool_attach_file().
730         (pool_fclose) Reimplement in terms of pool_detach_file().  Fix
731         double-free.
732
733         * str.c: Useful new functions.
734         (ds_swap) New function.
735         (ds_rtrim_spaces) New function.
736         (ds_chomp) New function.
737         (ds_is_empty) New function.
738         (ds_first) New function.
739         (ds_last) New function.
740
741 Sat Feb 11 21:51:21 2006  Ben Pfaff  <blp@gnu.org>
742
743         Get rid of finished, start_interactive globals.
744
745         * command.c: (cmd_exit) Instead of setting `finished', return
746         CMD_EOF.
747         (cmd_finish) Ditto.
748
749         * command.h: New enum CMD_EOF.
750
751         * main.c: (global var finished) Removed.
752         (global var start_interactive) Removed.
753         (main) Execute commands until CMD_EOF is the return value.
754         If parse_command_line() returns false, don't execute any commands
755         at all.
756
757         * cmdline.c: (parse_command_line) If the command line indicates we
758         shouldn't execute syntax files, return false instead of
759         terminating.
760         (usage) Don't terminate.
761
762 Sat Feb 11 21:48:31 2006  Ben Pfaff  <blp@gnu.org>
763
764         Get rid of cur_proc global.  Replace by functions in err and tab
765         modules, which were the users.
766
767         * error.c: (static var command_name) New static var.
768         (err_vmsg) Use command_name.
769         (err_set_command_name) New function.
770
771         * tab.c: (static var command_name) New static var.
772         (tabi_title) Use command_name.
773         (tab_set_command_name) New function.
774
775         * command.c: (global var cur_proc) Removed.
776         (cmd_parse) Call err_set_command_name(), tab_set_command_name()
777         around executing command to set and clear command name.
778
779 Sat Feb 11 21:44:50 2006  Ben Pfaff  <blp@gnu.org>
780
781         Get rid of glob.c, glob.h.
782
783         * Makefile.am: (pspp_SOURCES) Remove glob.c, glob.h.
784         
785         * dictionary.c: Move default_dict definition here.
786
787         * glob.c: Removed.
788         (global var FILTER_before_TEMPORARY) Variable removed.  All
789         references deleted.  The info in this var was redundant with
790         temp_dict, so they were changed to use temp_dict where needed.
791
792         * glob.h: Removed.
793
794         * start-date.c: New file. Moved get_start_date() here.
795
796         * start-date.h: New file.
797
798 Fri Feb  3 20:34:52 2006  Ben Pfaff  <blp@gnu.org>
799  
800         * font.h: (struct font_set) Removed, because unused.
801  
802 Sat Jan 28 17:45:36 2006  Ben Pfaff  <blp@gnu.org>
803
804         Cleaner (faster?) way to compact cases.
805
806         * dictionary.c: (dict_compact_case) Removed.
807         (dict_needs_compaction) New function.
808         (struct copy_map) New structure.
809         (struct dict_compactor) New structure.
810         (dict_make_compactor) New function.
811         (dict_compactor_compact) New function.
812         (dict_compactor_destroy) New function.
813         
814 Sat Jan 28 17:24:22 2006  Ben Pfaff  <blp@gnu.org>
815
816         Cleanups.
817
818         * data-list.c: Make data_list_source_class static.
819         (dump_fixed_table) Use fh_get_name() to describe source of data.
820         (dump_free_table) Ditto.
821         (cmd_repeating_data) Eliminate special cases for inline file.
822
823         * dictionary.c: (dict_contains_var) Change return value from int to
824         bool.
825         (dict_rename_vars) Ditto.
826         (dict_create_vector) Ditto.
827
828 Sat Jan 28 17:20:50 2006  Ben Pfaff  <blp@gnu.org>
829
830         Add scratch file handles.
831
832         Now a file handle can refer to a disk file, to an in-memory
833         structure, or to the "inline" file, instead of just to a disk
834         file.  The introduction of new categories means that special cases
835         for the inline file in a few places could be eliminated, but it
836         also means that code that assumed that a handle refers to a file
837         has to check for that.
838
839         Also, now file handles can be freed, so code now must be sure not
840         to access a handle after closing it (with fh_close()).
841
842         * Makefile.am: Add any-reader.c, any-reader.h, any-writer.c,
843         any-writer.h, scratch-handle.c, scratch-handle.h,
844         scratch-reader.c, scratch-reader.h, scratch-writer.c,
845         scratch-writer.h to pspp_SOURCES.
846
847         * any-reader.c: New file.
848         
849         * any-reader.h: New file.
850         
851         * any-writer.c: New file.
852         
853         * any-writer.h: New file.
854
855         * scratch-handle.c: New file.
856         
857         * scratch-handle.h: New file.
858
859         * scratch-reader.c: New file.
860         
861         * scratch-reader.h: New file.
862
863         * scratch-writer.c: New file.
864         
865         * scratch-writer.h: New file.
866
867         * aggregate.c: Use an any_writer instead of an sfm_writer, to add
868         flexibility.
869
870         * apply-dict.c: Use an any_reader instead of an sfm_reader, to add
871         flexibility.
872
873         * command.def: Add CLOSE FILE HANDLE command.
874
875         * dfm-reader.c: Now fewer special cases for inline file.
876         (static var inline_open_cnt) Removed.
877         (static var inline_file) Removed.
878         (dfm_close_reader) Eliminate a special case for inline file.
879         Reorganize to avoid access-after-free.
880         (dfm_open_reader) Eliminate a special case for inline file.
881         (read_inline_record) Use bool instead of int.  No need to
882         increment line number.
883         (read_file_record) Use bool instead of int.
884         (read_record) Check whether file handle is inline file, instead of
885         for null pointer.
886         (dfm_eof) Ditto.
887         (dfm_expand_tabs) Ditto.
888         (dfm_push) Ditto.
889         (dfm_pop) Ditto.
890         (cmd_begin_data) Fix inaccurate check for whether the inline file
891         is in use--now we can tell by checking whether the inline file's
892         open count is positive.
893         
894         * file-handle-def.c: (struct file_handle) Reorder members.  Add
895         `deleted' member.  Add `referent' member.  Add `sh' member.
896         (static var default_handle) New variable.
897         (static var inline_file) New variable.
898         (fh_init) Initialize inline file.
899         (free_handle) New function.
900         (fh_done) Rewrite.
901         (fh_from_name) Don't return deleted handles.
902         (fh_from_filename) Ditto.
903         (fh_create) Removed.
904         (create_handle) New function.
905         (fh_create_file) New function.
906         (fh_create_scratch) New function.
907         (fh_inline_file) New function.
908         (fh_free) Rewrite.
909         (fh_open) Now requires a referent type mask and verifies it.  All
910         references updated.
911         (fh_close) If open_cnt goes to 0 on a deleted handle, free it.
912         (fh_is_open) New function.
913         (fh_get_referent) New function.
914         (fh_get_filename) Limit to handles that refer to files.
915         (fh_get_mode) Ditto.
916         (fh_get_record_width) Limit to handles that refer to files or the
917         inline file.
918         (fh_get_tab_width) Ditto.
919         (fh_get_scratch_handle) New function.
920         (fh_set_scratch_handle) New function.
921         (fh_get_default_handle) New function.
922         (fh_set_default_handle) New function.
923
924         * file-handle.h: (enum fh_referent) New type.
925         (enum fh_mode) Rename MODE_TEXT to FH_MODE_TEXT, MODE_BINARY to
926         FH_MODE_BINARY, and update all usages.
927
928         * file-handle.q: Add "scratch" as a possible mode.
929         (cmd_file_handle) Mention CLOSE FILE HANDLE in error message.
930         Use lex_end_of_command(), lex_sbc_missing().  Support creating
931         scratch handles.
932         (cmd_close_file_handle) New function.
933         (referent_name) New function.
934         (fh_parse) Now takes a referent type mask to specify handles that
935         can be accepted.  Updated all references.
936         
937         * filename.c: (fn_extension) New function.
938
939         * get.c: Use any_reader and any_writer and thereby merge code that
940         has been duplicated for each kind of file.  Also, we had something
941         here called `any_writer' before, so its name had to be changed to
942         `case_writer'.
943         (enum operation) Removed, because unused.
944         (struct get_pgm) Removed.
945         (get_pgm_free) Removed.
946         (get_source_destroy) Removed.
947         (get_source_read) Removed.
948         (global var get_source_class) Removed.
949         (static var case_reader_source_class) Removed.
950         (enum reader_command) New enum.
951         (struct case_reader_pgm) New struct.
952         (parse_read_command) New function.
953         (case_reader_pgm_free) New function.
954         (case_reader_source_destroy) New function.
955         (case_Reader_source_Read) New function.
956         (cmd_get) Rewrote as a call to parse_read_command().
957         (cmd_import) Ditto.
958         (struct any_writer) Rename to case_writer.  Drop `writer_type',
959         `writer' members in favor of an `any_writer' member named
960         `writer'.
961         (any_writer_destroy) Rename case_writer_destroy.  Use
962         any_writer_close().
963         (parse_write_command) Allow scratch files.  Use any_writer.
964         (any_writer_write_case) Rename case_writer_write_case().  Use
965         any_writer_write().
966 `       (struct mtf_file) Use any_reader.
967         (cmd_match_files) Allow scratch files.  Use any_reader.
968         (mtf_free_file) Use any_reader_close().
969         (mtf_read_nonactive_records) Use any_reader_read().
970         (mtf_processing) Use any_reader_read().
971         (struct import_pgm) Removed.
972         (import_pgm_free) Removed.
973         (import_source_destroy) Removed.
974         (import_source_read) Removed.
975         (global var import_source_class) Removed.
976
977         * glob.c: (global var default_handle) Removed.  Replaced all
978         references by fh_get_default_handle() or fh_set_default_handle().
979
980         * pfm-read.c: (static var portable_to_local) Moved from inside
981         read_header() to top level.
982         (pfm_detect) New function.
983
984         * pfm-write.c: (pfm_write_case) Make case argument const.
985         Reorganize to avoid access-after-free.
986
987         * print.c: (dump_table) Use fh_get_name() to describe source of
988         data.
989
990         * sfm-read.c: (sfm_close_reader) Reorganize to avoid
991         access-after-free.
992         (sfm_detect) New function.
993
994         * str.c: (str_lowercase) New function.
995
996         * vfm.c: Use new compaction interface.
997         (static var compaction_necessary) Removed.
998         (static var compactor) New variable.
999         (open_active_file) Initialize compactor.
1000         (write_case) Use compactor.
1001         (close_active_file) Free compactor.
1002         
1003 Wed Jan 11 19:28:39 2006  Ben Pfaff  <blp@gnu.org>
1004
1005         Clean up file handle code in preparation to add scratch file
1006         handles.
1007         
1008         * file-handle-def.c: Lots of formatting cleanup.  Added function
1009         comments.
1010         (struct file_handle) Renamed `length' member
1011         to `record_width'.  All references updated.
1012         (fh_init) New function.  Moved here from file-handle.q.
1013         (fh_done) New function.  Moved here from file-handle.q and
1014         rewrote.
1015         (get_handle_with_name) Renamed fh_from_name().
1016         (get_handle_for_filename) Renamed fh_from_filename().
1017         (create_file_handle) Renamed fh_create().  Changed to take a
1018         `struct fh_properties' instead of discrete values.  Updated all
1019         references.
1020         (create_file_handle_with_defaults) Removed.  Updated all
1021         references to use fh_create() with fh_default_properties().
1022         (fh_default_properties) New function.
1023         (destroy_file_handle) Removed.  The code is now in fh_done().
1024         (handle_get_name) Renamed fh_get_name().
1025         (handle_get_filename) Renamed fh_get_filename().
1026         (handle_get_record_width) Renamed fh_get_record_width().
1027         (handle_get_tab_width) Renamed fh_get_tab_width().
1028
1029         * file-handle-def.h: Formatting, comment fixes.
1030         (enum file_handle_mode) Renamed struct fh_mode.
1031         (struct fh_properties) New structure.
1032         (fh_init) Move prototype here from file-handle.h.
1033         (fh_done) Ditto.
1034         (fh_close) Ditto.
1035
1036         * file-handle.q: (static var handle_list) Removed.
1037         (fh_parse) Don't add handle to handle_list, because
1038         file-handle-def.c has its own list.
1039         (fh_init) Moved to file-handle-def.c.
1040         (fh_done) Ditto.
1041
1042 Sun Jan 9 01:09  Jason Stover  <jason@sakla.net>
1043
1044         * regression.q: (run_regression) Moved coefficient initialization
1045         to the linreg library. Altered other functions accordingly.
1046
1047 Sat Jan  7 13:30:54 WST 2006 John Darrington <john@darrington.wattle.id.au>
1048
1049         * command.c data-in.c main.c: Fixed bug which crept in when 
1050           separating getl from readline.
1051
1052         * vars-atr.c value-labels.h: Fixed constness of  val_labs_count.
1053
1054 Fri Dec 23 20:59:01 WST 2005 John Darrington <john@darrington.wattle.id.au>
1055
1056         * getl.c error.c: Separated file_loc functionality from error.c
1057
1058 Mon Dec 19 14:01:56 WST 2005 John Darrington <john@darrington.wattle.id.au>
1059
1060         * format.c: Additional error checking.
1061         * getl.[ch]: Separated into getl.c and readln.c
1062         * settings.[ch]: Made CC_CNT public
1063
1064 Fri Dec 16 09:11:48 WST 2005 John Darrington <john@darrington.wattle.id.au>
1065
1066         * examine.q: Fixed buglet when cleaning up at end of procedure.
1067
1068 Tue Dec 13 22:34:42 2005  Ben Pfaff  <blp@gnu.org>
1069
1070         Move global initialization and cleanup code into main.c.
1071         Remove vestigial log infrastructure.
1072         Minor related cleanups.
1073         
1074         * command.c: (shell) When execl() fails, use _exit(), not
1075         err_hcf().
1076
1077         * error.c: (err_hcf) Move into main.c, rename terminate().  All
1078         callers updated.
1079         (err_done) New function with just the error.c-specific code for
1080         err_hcf().  Called by terminate().
1081
1082         * glob.c: Removed all Borland C, DJGPP cruft.
1083         (init_glob) Merged into main().
1084         (done_glob) Merged into terminate().
1085         (get_date) Removed.
1086         (get_start_date) New function.  All users of curdate updated to call
1087         this function instead.
1088
1089         * lexer.c: (lex_init) Moved initialization of tokstr here, from
1090         init_glob().
1091         (lex_done) Moved destruction of tokstr here, from done_glob().
1092
1093         * main.c: (global var pgmname) Removed.  Changed all references to
1094         program_name, which is defined by gnulib.
1095         (global var curdate) Removed.
1096         (main) Moved init_glob() code here.  Merged parse_script() in
1097         here.
1098         (parse_script) Removed.
1099         (terminate) Moved err_hcf() here from error.c and renamed
1100         terminate().  Merged done_glob() code in here.  Call err_done().
1101         All callers updated.
1102         (i18n_init) New function.
1103         (fpu_init) New function.
1104
1105         * output.c: (outp_init) Make void.
1106         (init_default_drivers) New function.
1107         (outp_read_devices) If no drivers are initialized successfully,
1108         call init_default_drivers() to initialize a default driver.
1109         (outp_done) Make void.
1110         (static var prog) Make const.
1111         (parse_options) Make parameter const.
1112         (colon_tokenize) Make return value const.
1113         (configure_driver) Change prototype to take a broken-down driver
1114         configuration instead of a line of text.
1115         (configure_driver_line) New function that does what
1116         configure_driver() did before.
1117
1118         * q2c.c: (global var pgmname) Rename program_name.
1119
1120         * settings.c: (settings_init) Renamed from init_settings().
1121         (settings_done) Renamed from done_settings().
1122
1123         * vfm.c: (global var last_vfm_invocation) Make static.
1124         (vfm_last_invocation) New function.  All references to
1125         last_vfm_invocation update to call this.
1126         (procedure) Call update_last_vfm_invocation().
1127         (internal_procedure) Ditto.
1128         (update_last_vfm_invocation) New function.
1129         
1130 Sat Dec 10 23:30:19 2005  Ben Pfaff  <blp@gnu.org>
1131
1132         Separate random numbers from other settings because of GSL
1133         dependency.
1134
1135         * Makefile.am: Add random.c, random.h to sources.
1136
1137         * glob.c: (init_glob) Call random_init().
1138         (done_glob) Call random_done().
1139
1140         * settings.c: (static var rng) Move to random.c.
1141         (done_settings) Move freeing of RNG to random_done().
1142         (get_rng) Move to random.c
1143         (set_rng) Ditto.
1144
1145         * random.c: New file.
1146
1147         * random.h: New file.
1148
1149 Sat Dec 10 18:13:36 2005  Ben Pfaff  <blp@gnu.org>
1150
1151         Separate settings and the SET command, for modularity.
1152         
1153         * Makefile.am: Add settings.c to sources.
1154
1155         * glob.c: (global variable test_mode) Removed.
1156
1157         * set.q: Remove all the set_* variables.  Remove a lot of obsolete
1158         SPSS/PC+ settings.  Remove the aux_*() routines.  Moved the
1159         get_*() functions into settings.c.  Rewrite the settings code and
1160         functions to call the new set_*() functions.  Rewrite custom
1161         currency parsing.  Write new by-hand cmd_show().
1162
1163         * esttings.c: New file.  Moved the get_*() functions here from
1164         set.q.  Created new set_*() functions to correspond with them.
1165         Regularized the names and types of some functions and updated
1166         their callers.  Added static, file-scope variables to support the
1167         settings.
1168
1169         * q2c.c: Remove "aux" support, which was only needed by set.q.
1170         
1171 Sun Nov 27 06:43:46 WST 2005 John Darrington <john@darington.wattle.id.au>
1172
1173         * data-out.c format.h: Added return value to data_out function.
1174
1175         * value-labels.c: Fixed bug in val_labs_remove.
1176
1177 Sat Nov  5 18:37:26 2005  Ben Pfaff  <blp@gnu.org>
1178
1179         * Makefile.am: Remove devind.c, devind.h from list of source
1180         files.
1181
1182         * devind.c: Removed.
1183
1184         * devind.h: Removed.
1185
1186         * list.q: Removed "support" for devind.
1187
1188         * output.c: Don't add devind class.
1189
1190 Sat Nov  5 18:21:00 2005  Ben Pfaff  <blp@gnu.org>
1191
1192         * var.h: (struct variable) Make `init', `reinit' bool values.
1193         Rearrange fields.
1194
1195 Fri Nov  4 19:43:01 2005  Ben Pfaff  <blp@gnu.org>
1196
1197         * recode.c: Rewrote whole file, as clean-up.
1198
1199 Fri Nov  4 19:37:50 2005  Ben Pfaff  <blp@gnu.org>
1200
1201         * pool.c: Don't make alignment exception for x86.
1202         (pool_alloc) Return null for 0-size blocks.
1203         (pool_alloc_unaligned) New function.
1204         (pool_strndup) Removed.  Changed callers to use pool_clone_unaligned().
1205         (pool_clone_unaligned) New function.
1206         (pool_strdup) Use pool_clone_unaligned().
1207
1208         * var.h: (enum var_type) Give the NUMERIC, ALPHA enum this name.
1209         (struct variable) Use `enum var_type' for `type'.
1210
1211         * vars-atr.c: (var_type_adj) New function.
1212         (var_type_noun) New function.
1213
1214         * vars-prs: (parse_mixed_vars) Fix freeing code.
1215         (parse_mixed_vars_pool) New function.
1216
1217 Wed Nov  2 21:24:48 2005  Ben Pfaff  <blp@gnu.org>
1218
1219         * file-handle-def.c: Needed another #include, to avoid missing
1220         prototype warning.
1221
1222         * file-handle.q: (cmd_file_handle) Declarations must precede
1223         statements.  Free parse data on success as well as on failure, to
1224         avoid memory leak.
1225
1226         * get.c: (parse_write_command) Destroy dict on success, to avoid
1227         memory leak.
1228         
1229         * data-list.c: (cmd_repeating_data) Fix usage of saw_occurs,
1230         saw_length, saw_continued, saw_id, which were boolean but
1231         incorrectly treated as bitmaps as result of a previous
1232         half-finished cleanup.
1233
1234         * weight.c: (struct weight_trns) Unused, so removed.
1235
1236         * Makefile.am: Add range-prs.h to sources.
1237
1238 Wed Nov  2 21:24:15 2005  Ben Pfaff  <blp@gnu.org>
1239
1240         DO IF, LOOP cleanup.
1241
1242         * Makefile.am: Add ctl-stack.c, ctl-stack.h to source files.
1243         Reformat source file list to list one file per file, so that
1244         patches for future changes will be easier to read.
1245
1246         * ctl-stack.c, ctl-stack.h: New files.
1247
1248         * do-if.c: Rewrote whole file.
1249
1250         * do-ifP.h: Removed.
1251
1252         * loop.c: Rewrote whole file.
1253
1254         * glob.c: (global var ctl_stack) Move into ctl-stack.c.
1255
1256         * temporary.c: (cmd_temporary) Use ctl_stack_is_empty().
1257
1258         * vfm.c: (open_active_file) Use ctl_stack_clear().
1259
1260 Wed Nov  2 21:18:13 2005  Ben Pfaff  <blp@gnu.org>
1261
1262         New pool functions.
1263         
1264         * pool.c: (pool_create_at_offset) New function.
1265         (pool_add_subpool) New function.
1266
1267         * pool.h: (pool_create_container) New macro.
1268         
1269         * expressions/parse.c: (expr_parse_pool) New function.
1270         
1271         * autorecode.c: (recode) Use pool_create_container().
1272
1273         * count.c: (cmd_count) Ditto.
1274
1275 Wed Nov  2 19:59:32 2005  Ben Pfaff  <blp@gnu.org>
1276
1277         Clean up transformations, by getting rid of `struct trns_header',
1278         replacing it by `struct transformation' that has a void *
1279         `private' member.  Updated all uses of transformations to match,
1280         which was a lot of code.  Only major related changes listed below.
1281
1282         * compute.c: (cmd_if) Use get_proc_func().
1283         (cmd_compute) Use get_proc_func().
1284         (get_proc_func) New function.
1285
1286         * glob.c: (global var m_trns) Change type to size_t.
1287         (global var n_trns) Ditto.
1288         (global var f_trns) Ditto.
1289         (global var t_trns) Change type to struct transformation *.
1290
1291         * var.h: (struct trns_header) Removed.
1292         (struct transformation) New.
1293         (typedef trns_proc_func) Takes a void * instead of a struct
1294         trns_header *.
1295         (typedef trns_free_func) Ditto.
1296
1297         * vfm.c: (execute_transformations) Takes an array of
1298         transformations instead of trns_headers.
1299         (add_transformation) Change prototype from (trns_header *) to
1300         (trns_proc_func *, trns_free_func *, void *).
1301         (next_transformation) New function.
1302
1303 Sat Oct 29 16:25:36 2005  Ben Pfaff  <blp@gnu.org>
1304
1305         * count.c: Major cleanups.  Rename practically everything.
1306         Rewrite much of the code.  Use pools for memory management.  Use
1307         the new parse_num_range().
1308
1309         * mis-val.c: (cmd_missing_values) Use the new parse_num_range().
1310         (parse_number) Removed.
1311
1312         * missing-values.c: (mv_add_num_range) Don't add out-of-order
1313         ranges, e.g. where low > high.
1314
1315         * pool.c: (pool_2nrealloc) New function.
1316
1317         * range-prs.c: New file.
1318         (parse_num_range) New function.
1319         (parse_number) New function.
1320         
1321 Fri Oct 28 22:47:48 2005  Ben Pfaff  <blp@gnu.org>
1322
1323         Fix up potential overflows in size calculations by replacing
1324         instances of pool_alloc(p, x * sizeof *y) by pool_malloc(p, x,
1325         sizeof *y) everywhere I could find them.  Similarly by
1326         pool_malloc(), pool_realloc().
1327         (Order is important: pool_alloc(p, sizeof *y, x) will divide by 0
1328         if x is 0.)
1329
1330         * pool.c: (pool_nalloc) New function.
1331         (pool_nmalloc) New function.
1332         (pool_nrealloc) New function.
1333
1334 Thu Oct 27 11:16:53 WST 2005 John Darrington <john@darrington.wattle.id.au>
1335
1336         Separated the definition of a file handle object from the stuff 
1337         pertaining to the FILE HANDLE command.
1338
1339         * file-handle-def.[ch]: New files.
1340
1341         * dfm-read.c file-handle.h file-handle.q
1342         
1343 Tue Oct 25 21:56:23 2005  Ben Pfaff  <blp@gnu.org>
1344
1345         Fix up potential overflows in size calculations by replacing
1346         instances of xmalloc(x * sizeof *y) by xnmalloc(x, sizeof *y)
1347         everywhere I could find them.  Similarly by xrealloc(), malloc().
1348         (Order is important: xnmalloc(sizeof *y, x) will divide by 0 if x
1349         is 0.)
1350
1351         * alloc.c: (nmalloc) New function.
1352         (out_of_memory) Removed.  Replaced references by xalloc_die().
1353
1354         * sort.c: (allocate_cases) Fix segfault if memory allocation
1355         fails.
1356
1357         * subclist.c: (subc_list_double_create) Use xnmalloc() instead of
1358         malloc().
1359         (subc_list_double_push) Use xnrealloc() instead of realloc().
1360
1361 Wed Oct 26 08:43:51 WST 2005 John Darrington <john@darrington.wattle.id.au>
1362
1363         Dictionary abstraction part #2
1364
1365         * algorithm.c format.c str.c sysfile-info.c val.h var.h vars-atr.c:
1366           Removed unnecessary #include directives
1367
1368 Mon Oct 24 21:35:08 2005  Ben Pfaff  <blp@gnu.org>
1369
1370         * groff-font.c (font_msg): Use err_vmsg() instead of incorrectly
1371         trying to pass a va_list to tmsg().  Thanks to Jason Stover for
1372         reporting this bug.
1373
1374 Mon Oct 24 21:24:15 2005  Ben Pfaff  <blp@gnu.org>
1375
1376         Work to get rid of GCC 4.0 warnings, part 2.
1377
1378         In many files, change `unsigned char' to `char'.  This often
1379         requires adding casts to <ctype.h> functions.
1380
1381         * data-in.c: (parse_A) Use buf_copy_rpad().
1382
1383         * str.c: (str_copy_buf_trunc) New function.
1384
1385         * value-labels.c: (value_to_string) Fix mistaken use of strncpy(),
1386         by rewriting.
1387
1388 Mon Oct 24 13:42:32 WST 2005 John Darrington <john@darrington.wattle.id.au>
1389
1390         Moved some definitions to make it easier to abstract a dictionary 
1391         from the rest of PSPP.
1392
1393         * format-prs.c lex-def.[ch]:  New files.
1394
1395         * Makefile.am lexer.[ch] dictionary.c vars-atr.c vfm.c algorithm.c 
1396           format.c:  Moved some functions between modules.
1397         
1398 Sun Oct 23 19:28:08 2005  Ben Pfaff  <blp@gnu.org>
1399
1400         Work to get rid of GCC 4.0 warnings, part 1.
1401         
1402         In many files, change count parameters to parse_variables(),
1403         etc. from `int' to `size_t'.  Also change related variables and
1404         struct members.  Also change messages as needed (e.g. %d to %u
1405         with cast to unsigned).  Also change arithmetic as necessary
1406         (e.g. n >= m - 1 to n + 1 >= m). 
1407
1408         * crosstabs.q: (crs_custom_tables) Check for size_t overflow in
1409         multiplication.
1410
1411         * q2c.c: (dump_declarations) Generate code for size_t instead of
1412         int.
1413         
1414 Thu Oct 20 18:18:40 2005  Ben Pfaff  <blp@gnu.org>
1415
1416         * output.c: (outp_read_devices) Fix message.
1417
1418 Sat Sep 17 11:13:13 2005  Ben Pfaff  <blp@gnu.org>
1419
1420         * matrix-data.c: (cmd_matrix_data) Change type of variable whose
1421         address is passed to dict_get_vars() from size_t to int to match
1422         John's change below.
1423
1424         * modify-vars.c: (validate_var_modification) Ditto.
1425
1426 Mon Sep 12 19:26:06 WST 2005 John Darrington <john@darrington.wattle.id.au>
1427
1428         * dictionary.[ch]  Changed cnt from size_t* to int* since that's
1429         what it's called as, and on  x86_64 machines they're different sizes.
1430         
1431         * str.c: (ds_vprintf) Copied va_list args so they can be re-used
1432         
1433 Sun Aug 21 00:12:24 2005  Ben Pfaff  <blp@gnu.org>
1434
1435         * lexer.c: (lex_sbc_only_once) New function.
1436         (lex_sbc_missing) New function.
1437
1438 Sun Aug 21 00:00:47 2005  Ben Pfaff  <blp@gnu.org>
1439
1440         * case.h: (case_str) Make it return `unsigned char'.
1441
1442 Sat Aug 20 23:56:14 2005  Ben Pfaff  <blp@gnu.org>
1443
1444         Revamp SAVE, XSAVE, EXPORT.  Add (or at least parse) all the
1445         subcommands that we didn't support.  Fix bug 13911.  Fix bug
1446         reported by Adam Pierson (COMPRESSED and other subcommands didn't
1447         work on SAVE).  Refactor all related code.
1448         
1449         * command.def: Add XEXPORT command.
1450
1451         * dictionary.c: (dict_delete_scratch_vars) New function.
1452
1453         * get.c: (cmd_get) Fix parsing.
1454         (struct save_trns) Removed.
1455         (cmd_save_internal) Removed.
1456         (cmd_save) Removed.
1457         (do_write_case) Removed.
1458         (save_write_case_func) Removed.
1459         (save_trns_proc) Removed.
1460         (save_trns_free) Removed.
1461         (trim_dictionary) Removed.
1462         (struct export_proc) Removed.
1463         (cmd_export) Rewrote.
1464         (export_write_case_func) Removed.
1465         (export_proc_free) Removed.
1466         (enum writer_type) New enum.
1467         (enum command_type) New enum.
1468         (struct any_writer) New struct.
1469         (any_writer_destroy) New function.
1470         (parse_write_command) New function.
1471         (any_writer_write_case) New function.
1472         (parse_output_proc) New function.
1473         (output_proc) New function.
1474         (cmd_save) Rewrote.
1475         (cmd_xsave) Rewrote.
1476         (struct output_trns) New struct.
1477         (parse_output_trns) New function.
1478         (output_trns_proc) New function.
1479         (output_trns_free) New function.
1480         (cmd_xsave) Rewrote.
1481         (cmd_xexport) New function.
1482         (parse_dict_trim) New function.
1483         (struct mtf_proc) Change `by_cnt' member type to `int'.
1484         (cmd_import) Rewrote.
1485
1486         * pfm-write.c: (struct pfm_writer) Add `digits' member.
1487         (pfm_writer_default_options) New function.
1488         (pfm_open_writer) Add `opts' argument and handle options.
1489         (write_float) Write only as many digits as `digits' member says.
1490         (format_trig_double) Limit base-10 precision to LDBL_DIG.
1491
1492         * pfm-write.h: (enum pfm_type) Moved here from pfm-read.h.
1493         (struct pfm_write_options) New struct.
1494
1495         * sfm-write.c: (sfm_writer_default_options) New function.
1496         (sfm_open_writer) Remove `compress', `omit_long_names' args.  Add
1497         `opts' argument.  Implement options.
1498
1499         * sfm-write.h: (struct sfm_write_options) New struct.
1500
1501         * expressions/helpers.c: (copy_string) Make `old' arg `unsigned
1502         char *' instead of `char *'.
1503         
1504 Sat Aug  6 21:29:15 2005  Ben Pfaff  <blp@gnu.org>
1505
1506         * factor_stats.c: Needed <config.h> included earlier.
1507
1508         * percentiles.c: Needed to include <config.h>.
1509
1510         * val.h: Don't include "config.h".
1511
1512 Sat Aug  6 21:26:27 2005  Ben Pfaff  <blp@gnu.org>
1513
1514         Clean up treatment of missing values by moving all the code into
1515         one place.  All references to the missing value function were
1516         updated, but only major changes are detailed below.
1517
1518         * Makefile.am: Add missing-values.c, missing-values.h to sources.
1519
1520         * apply-dict.c: (cmd_apply_dictionary) Use mv_resize().
1521
1522         * dictionary.c: (dict_create_var) Initialize `miss' member with
1523         mv_init().
1524         (dict_clone_var) Copy `miss' member with mv_copy().
1525         
1526         * get.c: (mtf_merge_dictionary) Use mv_copy().
1527
1528         * missing-values.c: New file.
1529         
1530         * missing-values.h: New file.
1531
1532         * mis-val.c: Rewrite.  New version implements updated semantics.
1533
1534         * pfm-read.c: (read_variables) Rewrite missing value handling.
1535
1536         * pfm-write.c: (write_variables) Rewrite missing value handling.
1537
1538         * sfm-read.c: (read_variables) Rewrite missing value handling.
1539
1540         * sfm-write.c: (write_variable) Rewrite missing value handling.
1541
1542         * sfmP.h: Include "magic.h" to get definition of
1543         second_lowest_value.
1544
1545         * sysfile-info.c: (describe_variable) Rewrite missing value
1546         handling.
1547
1548         * val.h: Include "magic.h" to get definition of
1549         second_lowest_value.
1550
1551         * var.h: Include "missing-values.h".  Drop MISSING_* enums.
1552         (struct variable) Remove `miss_type', `missing'.  Add `miss'.
1553
1554         * vars-atr.c: (is_num_user_missing) Removed--use
1555         mv_is_num_user_missing().
1556         (is_str_user_missing) Removed--use mv_is_str_user_missing().
1557         (is_system_missing) Removed--use mv_is_value_system_missing().
1558         (is_missing) Removed--use mv_is_value_missing().
1559         (is_user_missing) Removed--use mv_is_value_user_missing().
1560         
1561 Sun Jul 31 14:09:57 2005  Ben Pfaff  <blp@gnu.org>
1562
1563         Adopt use of gnulib for portability.
1564
1565         * Make.build: Add $(top_srcdir)/gl and $(top_builddir)/gl to
1566         include path.
1567
1568         * Makefile.am: Remove bool.h, stat.h and change getline.[ch] to
1569         getl.[ch] in pspp_SOURCES.  Remove libmisc, add libgl in
1570         pspp_LDADD.
1571
1572         * In many source files, added an explicit inclusion of gettext.h
1573         and definition of _ macro.  These are no longer in pref.h because
1574         it interfered with definitions in a few gnulib source files.
1575
1576         * In many source files, changed #include "bool.h" to #include
1577         <stdbool.h>, which is provided by gnulib.
1578
1579         * alloc.c: Removed functions defined in gnulib:
1580         (xmalloc) Removed.
1581         (xcalloc) Removed.
1582         (xrealloc) Removed.
1583         (xstrdup) Removed.
1584         (out_of_memory) Redefined as wrapper for xalloc_die().
1585
1586         * alloc.h: Replace prototypes by #include "xalloc.h".
1587
1588         * casefile.c: Use full_read() and full_write() from gnulib instead
1589         of our home-grown versions.
1590         (full_read) Removed.
1591         (full_write) Removed.
1592
1593         * getline.c: Renamed getl.c.
1594
1595         * getline.h: Renamed getl.h, updated all references.
1596
1597         * filename.c: (fn_readlink) Change to wrapper around xreadlink()
1598         from gnulib.
1599
1600         * glob.c: Just #include <time.h> instead of the crazy rigmarole
1601         here before.
1602         (init_glob) Call set_program_name() to initial gnulib progname
1603         module.
1604
1605         * html.c: (postopen) Use getlogin_r(), gethostname() from gnulib.
1606
1607         * permissions.c: Use "stat-macros.h" from gnulib.
1608
1609         * postscript.c: Just #include <time.h> instead of the crazy
1610         rigmarole here before.
1611
1612         * q2c.c: (main) Make generated code #include "gettext.h".
1613
1614         * str.h: Get rid of most explicit declarations of standard
1615         functions, in favor of including gnulib header files.
1616
1617         * expressions/evaluate.c: Ditto.
1618
1619         * expressions/operations.h.pl: Make generated code #include
1620         <stdbool.h>, not "bool.h".
1621
1622 Sat Jul 30 23:13:17 2005  Ben Pfaff  <blp@gnu.org>
1623
1624         * expressions/parse.c: (validate_function_args) Fix two msg() bugs
1625         found by -Wformat.
1626
1627 Sat Jul 30 23:10:01 2005  Ben Pfaff  <blp@gnu.org>
1628
1629         * expressions/evaluate.c: (expr_debug_print_postfix) Don't pass
1630         null pointer to printf for %.*s.
1631
1632 Sat Jul 30 23:05:33 2005  Ben Pfaff  <blp@gnu.org>
1633
1634         * vars-atr.c: (var_is_valid_name) Fix three msg() bugs found by
1635         -Wformat.
1636
1637 Sat Jul 30 22:58:33 2005  Ben Pfaff  <blp@gnu.org>
1638
1639         * rank.q: (parse_rank_function) Fix msg() bug found by -Wformat.
1640
1641 Sat Jul 30 22:56:12 2005  Ben Pfaff  <blp@gnu.org>
1642
1643         * postscript.c: (postopen) Cast `char' to `unsigned char' before
1644         passing to isspace().
1645
1646 Sat Jul 30 22:52:09 2005  Ben Pfaff  <blp@gnu.org>
1647
1648         * pfm-read.c: (read_variables) Fix msg() bug found by -Wformat.
1649
1650 Sat Jul 30 22:50:57 2005  Ben Pfaff  <blp@gnu.org>
1651
1652         * histogram.c: Include <config.h>.
1653
1654 Sat Jul 30 22:48:50 2005  Ben Pfaff  <blp@gnu.org>
1655
1656         * get.c: (cmd_match_files) Fix msg() bug found by -Wformat.
1657
1658 Sat Jul 30 22:46:10 2005  Ben Pfaff  <blp@gnu.org>
1659
1660         * format.c: (check_common_specifier) Fix msg() bug found by
1661         -Wformat.
1662         (check_output_specifier) Ditto.
1663
1664 Sat Jul 30 22:43:57 2005  Ben Pfaff  <blp@gnu.org>
1665
1666         * file-handle.q: (cmd_file_handle) Fix msg() bug found by
1667         -Wformat.
1668
1669 Sat Jul 30 22:41:44 2005  Ben Pfaff  <blp@gnu.org>
1670
1671         * data-in.c: (parse_Z) [WORDS_BIGENDIAN] Don't declare buf[], to
1672         avoid "unused variable" warning.
1673
1674 Sat Jul 30 22:38:46 2005  Ben Pfaff  <blp@gnu.org>
1675
1676         * command.c: (find_word) Cast `char' to `unsigned char' before
1677         passing to isspace().
1678
1679 Sat Jul 30 22:36:29 2005  Ben Pfaff  <blp@gnu.org>
1680
1681         * case.c: (case_compare) Implement as delegating to
1682         case_compare_2dict().
1683
1684 Sat Jul 30 22:34:18 2005  Ben Pfaff  <blp@gnu.org>
1685
1686         * algorithm.c: Inclusion of <alloca.h> is unneeded.
1687
1688 Sat Jul 30 22:01:32 2005  Ben Pfaff  <blp@gnu.org>
1689
1690         * Make.build: Don't append -ansi to AM_CFLAGS for GCC.  Using
1691         -ansi changes the behavior of header files significantly.  It
1692         causes __STRICT_ANSI__ to be defined, and some headers interpret
1693         that as cause to e.g. not use `long long' or __attribute__.  The
1694         former example is bad when off_t is supposed to be `long long',
1695         and the latter prevents -Wformat from working.
1696
1697 Sun Jul 24 20:26:59 2005  Ben Pfaff  <blp@gnu.org>
1698
1699         Get rid of dependency on libgmp by writing our own routine for
1700         floating-point base conversion.
1701
1702         * pfm-write.c: (write_float) Rewrote.
1703         (write_int) Rewrote.
1704         (pow30_nonnegative) New function.
1705         (pow30) New function.
1706         (trig_to_char) New function.
1707         (format_trig_digits) New function.
1708         (recurse_format_trig_int) New function.
1709         (format_trig_int) New function.
1710         (should_round_up) New function.
1711         (try_round_up) New function.
1712         (format_trig_double) New function.
1713
1714 Sun Jul 24 18:49:20 2005  Ben Pfaff  <blp@gnu.org>
1715
1716         * data-in.c: (parse_numeric) Allow "1+23" even for F format, for
1717         compatibility.
1718
1719 Sun Jul 24 18:47:37 2005  Ben Pfaff  <blp@gnu.org>
1720
1721         * pfm-read.c: (read_version_data) Read and ignore author field.
1722
1723 Wed Jul  6 20:44:27 2005  Ben Pfaff  <blp@gnu.org>
1724
1725         * get.c: (mtf_processing) Don't assume that
1726         mtf_compare_BY_values() always returns -1, 0, or 1.  Actually, it
1727         returns a negative, zero, or positive result.  Fixes MATCH FILES
1728         bug on Mac OS X reported by "Marshall DeBerry" <mdb@radix.net>.
1729
1730 Mon Jul  4 18:01:15 2005  Ben Pfaff  <blp@gnu.org>
1731
1732         * flip.c: [HAVE_SYS_TYPES_H] Really include <sys/types.h>.  The
1733         preprocessor test for sys/types.h was accidentally inverted.  This
1734         was bug 12789.
1735
1736 Sun Jul  3 22:47:39 2005  Ben Pfaff  <blp@gnu.org>
1737
1738         * get.c: (cmd_match_files) Fix memory leak on `by' and on
1739         `vfm_source'.
1740
1741         * getline.c: [HAVE_LIBREADLINE] (read_console) Fix memory leak on
1742         `line'.
1743
1744         * vfm.c: (close_active_file) Remove unnecessary test.
1745
1746 Sun Jul  3 21:45:32 2005  Ben Pfaff  <blp@gnu.org>
1747
1748         Fix NDEBUG compile errors.
1749
1750         * hash.h: Needed explicit #include <assert.h>.
1751
1752         * linked-list.c: (ll_next) First arg is UNUSED when NDEBUG is
1753         defined.
1754
1755 Sun Jun 12 23:44:38 2005  Ben Pfaff  <blp@gnu.org>
1756
1757         Implement embedding for PostScript driver.  Fixes bug 12970.
1758
1759         * ascii.c: Fix compiler warnings.
1760
1761         * html.c: Ditto.
1762
1763         * chart.h: Add `file' member.
1764
1765         * output.h: (struct outp_class) initialise_chart, finalise_chart
1766         should take outp_driver *, not outp_class *.  Update all
1767         references.
1768
1769         * plot-chart.c: (chart_create) Fix segfault when there are no
1770         output drivers at all.
1771         (chart_submit) Call d->class->finalise_chart.
1772
1773         * postscript.c: (ps_open_page) Set cp_y to 0.
1774         (ps_submit) New function.
1775         (ps_chart_initialise) Implement.
1776         (ps_chart_finalise) Implement.
1777         (static var postscript_class) Add ps_submit.
1778         (static var epsf_class) Add ps_submit.
1779         
1780
1781 Sun Jun 12 14:54:40 2005  Ben Pfaff  <blp@gnu.org>
1782
1783         Did some more work on bug 12859 and then realized that a *good*
1784         solution would require some fundamental restructuring.  For now,
1785         I'm marking REPEATING DATA unimplemented, and then we can revisit
1786         it post-0.4.0.
1787         
1788         * command.def: Make REPEATING DATA unimplemented.
1789
1790         * data-list.c: (cmd_repeating_data) Assume inline file is 80
1791         characters wide.
1792         (realize_value) Revert previous changes; no longer needed.
1793         Updated all callers.
1794
1795         * error.c: (err_hcf) Set nfile_loc, mfile_loc to 0 after freeing
1796         file_loc, to avoid bad references later.
1797
1798         * str.c: Fix typo.
1799
1800 Tue Jun  7 00:14:09 2005  Ben Pfaff  <blp@gnu.org>
1801
1802         Make some code tolerant of reentry.  Should not be needed if other
1803         code is correct but it is good to be generally tolerant.
1804         
1805         * error.c: (err_hcf) Set file_loc to null after free().
1806
1807         * output.c: (outp_done) Similar changes.
1808
1809         * str.c: (ds_destroy) Ditto.
1810         
1811 Tue Jun  7 00:10:20 2005  Ben Pfaff  <blp@gnu.org>
1812
1813         Continue work on bug 12859, plus some code cleanup.
1814         
1815         * data-list.c: (cmd_repeating_data) Replace `seen' bitmap by
1816         boolean variables.  Don't try to compute starts_end, cont_end for
1817         inline file.  Calculate length only after parsing variable
1818         specifications.  Add proper transformation to list.
1819         (realize_value) If the rpd_num_or_var has no value, return new
1820         DEFAULT_MEMBER argument (for use with inline file).
1821         (repeating_data_trns_proc) Pass default values.
1822
1823         * dfm-read.c: (dfm_close_reader) Only skip data if *not* still
1824         open, and only if we actually started reading data.
1825
1826 Sun Jun  5 18:39:36 2005  Ben Pfaff  <blp@gnu.org>
1827
1828         Fix bug 11894.
1829         
1830         * output.c: (outp_read_devices) Fix message.
1831
1832 Fri May 27 12:34:43 WST 2005 John Darrington <john@darrington.wattle.id.au>
1833         
1834         * sort-prs.[ch] (newfiles), aggregate.c, sort.[ch]: Separated the guts 
1835         of the sort algorithm from the parser for the SORT command.
1836         
1837         * rank.q: Added the parser for the RANK command.
1838         
1839 Thu May 26 12:29:21 2005  Ben Pfaff  <blp@gnu.org>
1840
1841         Fix bug 13192.
1842
1843         * sort.c: (sort_parse_criteria) Only set *saw_direction if
1844         saw_direction is non-null.  Thanks to John Darrington for
1845         reporting this bug.
1846
1847 Tue May 24 21:52:55 2005  Ben Pfaff  <blp@gnu.org>
1848
1849         * get.c: (mtf_processing) Handle case of a lookup table as the
1850         active file.  Thanks to John Darrington for reporting this bug.
1851
1852 Wed May 25 10:27:02 WST 2005 John Darrington <john@darrington.wattle.id.au>
1853         
1854         * alloc.c alloc.h: (xcalloc) changed signature to imitate the
1855         POSIX  calloc function.
1856         
1857         * crosstabs.q get.c vars-prs.c: Updated calls to xcalloc to
1858         reflect new signature.
1859
1860         * sfm-read.c: Now much more robust in the face of badly formed
1861         system files.
1862
1863 Mon May 23 11:57:31 WST 2005 John Darrington <john@darrington.wattle.id.au>
1864
1865         *sfm-read.c: Fixed some bugs regarding long string continuation
1866         records, which the previous fix uncovered.
1867
1868 Sat May 21 12:48:34 WST 2005 John Darrington <john@darrington.wattle.id.au>
1869
1870         * sfm-read.c, sfmP.h:  Allow reading of system files when the 
1871         case_size value in the header is -1.  Also changed some Errors to 
1872         Warnings when reading system files.
1873
1874 Tue May 17 21:00:57 2005  Ben Pfaff  <blp@gnu.org>
1875
1876         * data-list.c: (data_list_trns_free) Don't free the argument
1877         because cancel_transformations() will do that itself.
1878         (data_list_source_destroy) Destroy the argument to
1879         data_list_trns_free(), because it no longer does so itself.
1880
1881 Tue May 17 18:29:35 2005  Ben Pfaff  <blp@gnu.org>
1882
1883         * data-out.c: (format_and_round) Don't output leading `-' if value
1884         rounds to zero.
1885
1886 Tue May 17 00:06:43 2005  Ben Pfaff  <blp@gnu.org>
1887
1888         Fix bug 11119.
1889
1890         * som.c: (output_encodings) If some cell in the table won't fit
1891         with the horizontal or vertical headers, cancel those headers.
1892
1893         * som.h: (struct som_table_class) Add fits_width, fits_length,
1894         set_headers members.
1895
1896         * tab.c: (tabi_fits_width) New function.
1897         (tabi_fits_length) New function.
1898         (tabi_set_headers) New function.
1899         (global var tab_table_class) Add the new functions as appropriate
1900         members.
1901         
1902 Mon May 16 22:34:06 2005  Ben Pfaff  <blp@gnu.org>
1903
1904         Fix rest of bug 13054.
1905
1906         * format.def: Fix EDATE, SDATE, ADATE, JDATE, QYR, MOYR, WKYR,
1907         DATETIME, TIME system/portable file values.
1908
1909 Mon May 16 22:31:15 2005  Ben Pfaff  <blp@gnu.org>
1910
1911         * data-list.c: (parse_free) Use make_input_format().
1912         
1913         * data-out.c: (num_to_string) Use make_output_format().
1914
1915         * dictionary.c: (dict_create_var) Ditto.
1916
1917         * format.c: (global var f8_2) New var.
1918         (make_input_format) New function.
1919         (make_output_format) New function.
1920
1921         * get.c: (cmd_match_files) Use make_output_format().
1922
1923         * list.q: (cmd_list) Ditto.
1924
1925         * matrix-data.c: Ditto.
1926
1927         * sfm-read.c: (parse_format_spec) Check output specifier
1928         thoroughly.
1929
1930         * tab.c: (tab_float) Use make_output_format().
1931
1932 Sun May 15 23:38:10 2005  Ben Pfaff  <blp@gnu.org>
1933
1934         Fix more of bug 13054.
1935         
1936         * format.def: FMT_A should allow 255-character output.  FMT_AHEX
1937         should allow 510-character input and output.
1938
1939         * data-out.c: (num_to_string) Get rid of NEW_STYLE option.
1940         (convert_E) Handle non-finite values.
1941         (try_F) Rewrite.
1942         (format_and_round) New function.
1943         (convert_infinite) New function used by try_F() and convert_E().
1944
1945 Sun May 15 23:36:55 2005  Ben Pfaff  <blp@gnu.org>
1946
1947         Regularize string and buffer function names so that they make some
1948         kind of sense.
1949
1950         * str.c: (mm_reverse) Rename buf_reverse().  Update all
1951         references.
1952         (mm_find_reverse) Rename buf_find_reverse().  Update all
1953         references.
1954         (mm_case_compare) Rename buf_compare_case().  Update all
1955         references.
1956         (st_compare_pad) Rename buf_compare_rpad().  Update all
1957         references.
1958         (str_compare_rpad) New function.
1959         (st_bare_pad_copy) Rename buf_copy_str_rpad().  Update all
1960         references.
1961         (buf_copy_str_lpad) New function.
1962         (st_bare_pad_len_copy) Rename buf_copy_rpad().  Update all
1963         references.
1964         (st_pad_copy) Rename str_copy_rpad().  Update all references.
1965         (st_trim_copy) Rename str_copy_trunc().  Update all references.
1966         (st_uppercase) Renamed str_uppercase().  Update all references.
1967         
1968 Sat May 14 08:22:26 WST 2005 John Darrington <john@darrington.wattle.id.au>
1969
1970         * dfm-read.c: Fixed polarity of test in dfm-close-reader.  Closes 
1971         Bug #13082
1972
1973 Tue May 10 20:08:18 2005  Ben Pfaff  <blp@gnu.org>
1974
1975         * data-in.c: (data_in) Add assertion to check input specifier.
1976
1977         * data-out.c: (data_out) Add assertion to check output specifier.
1978
1979 Tue May 10 19:56:35 2005  Ben Pfaff  <blp@gnu.org>
1980
1981         Start to fix bug 13054.
1982
1983         * format.c: (check_input_specifier) Improve error message.
1984         (check_input_specifier) Check F, COMMA, and DOLLAR formats for
1985         valid decimal places.
1986         (check_output_specifier) Ditto (but different criteria).
1987         (convert_fmt_ItoO) Assert valid input and output specifiers.
1988         Also, if input specifier has *any* decimal places, make the output
1989         specifier 1 place wider.
1990
1991 Mon May  9 07:14:29 WST 2005 John Darrington <john@darrington.wattle.id.au>
1992
1993         * sysfile-info.c: Fixed bug [# 13024 ]
1994
1995 Sun May  8 13:52:12 2005  Ben Pfaff  <blp@gnu.org>
1996
1997         "Fix" bug 13021 by disabling FILE TYPE.  Eventually, we should
1998         actually implement it.
1999
2000         * command.c: (FILE_TYPE_okay) Always return 1.
2001
2002         * command.def: Change FILE TYPE, END FILE TYPE into UNIMPL.
2003
2004         * file-type.c: Add prototypes to get rid of warnings.
2005
2006 Sun May  8 08:08:07 WST 2005 John Darrington <john@darrington.wattle.id.au>
2007
2008         * barchart.c box-whisker.c cartesian.c piechart.c plot-hist.c: Fixed 
2009         more ISO/IEC 9899:1990 conformance issues.
2010
2011 Wed May  4 23:54:02 2005  Ben Pfaff  <blp@gnu.org>
2012
2013         Fix bug 12948.  See also new test in
2014         tests/bugs/match-file-scratch.sh.
2015         
2016         * get.c: (mtf_merge_dictionary) Don't compact dictionary because
2017         that deletes scratch variables that someone else might be using,
2018         and because we can't reassign our sources' value indexes.
2019         Instead, simply don't copy scratch variables into the master
2020         dictionary.
2021
2022         * dictionary.c: (dict_compact_values) Delete variables from the
2023         dictionary passed in, not from default_dict (!).
2024
2025 Tue May  3 22:25:17 2005  Ben Pfaff  <blp@gnu.org>
2026
2027         Improve hash.c comments, error-checking.
2028         
2029         * hash.c: (struct hsh_table) [NDEBUG] Add hash_ordered member.
2030         (hsh_create) size == 0 should *not* return NULL!  Set
2031         hash_ordered.
2032         (hsh_clear) Set hash_ordered.
2033         (locate_matching_entry) Check hash_ordered.
2034         (hsh_rehash) Rename rehash().  Add assertion.  Set hash_ordered.
2035         (hsh_data) Set hash_ordered.  Add const-ness to return value and
2036         update all callers.
2037         (hsh_sort) Ditto.       
2038
2039 Wed May  4 08:50:11 WST 2005 John Darrington <john@darrington.wattle.id.au>
2040
2041         * casefile.c: Removed unnecessary #include <valgrind/valgrind.h>
2042
2043 Tue May  3 19:14:48 WST 2005 John Darrington <john@darrington.wattle.id.au>
2044
2045         * copyleft.c: Updated copyright date.
2046
2047         * Makefile.am: Removed erroneous explicit "-lplot"
2048
2049         * examine.q oneway.q: Made these files conform to ISO/IEC 9899:1990
2050
2051 Tue May  3 16:20:31 WST 2005 John Darrington <john@darrington.wattle.id.au>
2052
2053         * command.c command.def: Added description string for unimplemented commands.
2054
2055         * oneway.q: Sorted the hash tables before shipping out the results. Closes 
2056         bug [#12931].
2057
2058 Mon May  2 23:45:01 2005  Ben Pfaff  <blp@gnu.org>
2059
2060         Code improvements.
2061         
2062         * data-list.c:  (parse_fixed) Use lex_end_of_command().
2063         (parse_free) Ditto.
2064         (cmd_repeating_data) Set cont_end.num in right situations.
2065         (parse_repeating_data) Remove redundant test.
2066
2067 Mon May  2 23:37:19 2005  Ben Pfaff  <blp@gnu.org>
2068
2069         Partial fix for bug 12859.
2070         
2071         * data-list.c: (cmd_data_list) Add transformation properly in
2072         vfm_source == NULL case.
2073
2074 Mon May  2 23:27:28 2005  Ben Pfaff  <blp@gnu.org>
2075
2076         * lexer.c: (lex_error) Improve error messages.
2077
2078 Mon May  2 22:28:17 2005  Ben Pfaff  <blp@gnu.org>
2079
2080         * get.c: (cmd_match_files) Check token type before trying to match
2081         tokid.  Fixes bug 12923.
2082
2083 Mon May  2 22:16:51 2005  Ben Pfaff  <blp@gnu.org>
2084
2085         * flip.c: [HAVE_SYS_TYPES_H] Include <sys/types.h>.  Fixes bug
2086         12789.
2087
2088 Mon May  2 22:02:52 2005  Ben Pfaff  <blp@gnu.org>
2089
2090         * expressions/generate.pl: (get_token) Make use of /g
2091         backward-compatible with Perl 5.6.1.
2092
2093 Sun May  1 23:00:19 2005  Ben Pfaff  <blp@gnu.org>
2094
2095         * var-display.c: (cmd_variable_alignment) Fix memory leak.
2096         (cmd_variable_level) Ditto.
2097
2098 Sun May  1 22:49:04 2005  Ben Pfaff  <blp@gnu.org>
2099
2100         Hash table had buggy deletion function.  The fix required changing
2101         other functions to do probing in the required order.
2102
2103         * hash.c: (locate_matching_entry) Rewrite and change interface.
2104         (hsh_rehash) Rewrite to use locate_matching_entry().
2105         (hsh_probe) Ditto.
2106         (hsh_find) Ditto.
2107         (hsh_delete) Ditto.  Also, fix stupid bugs.
2108
2109 Sun May  1 22:24:58 2005  Ben Pfaff  <blp@gnu.org>
2110
2111         * dictionary.c: (dict_clone) Properly copy vectors.
2112
2113 Sun May  1 22:07:58 2005  Ben Pfaff  <blp@gnu.org>
2114
2115         New implementation of long variable names.  Each variable has a
2116         "normal" name, which may be up to 64 bytes long and which is used
2117         for all normal operations.  Variables may have a "short" name,
2118         which is limited to 8 bytes and used only for system and portable
2119         file input and output.
2120         
2121         Make tokid case-preserving.  Update most uses of tokid to treat it
2122         case-insensitively.
2123
2124         Update many commands to deal with long variable names.
2125
2126         * autorecode.c: (cmd_autorecode) Use strcasecmp() instead of strcmp().
2127
2128         * command.c: (cmd_parse) Ditto.
2129         (match_strings) Use toupper() before comparing characters.
2130         (conflicting_3char_prefixes) Use mm_case_compare() instead of
2131         memcmp().
2132         (cmd_match_words) Ditto.
2133
2134         * compute.c: (lvalue_parse) Use st_trim_copy() instead of
2135         strncpy().
2136
2137         * count.c: (struct cnt_var_info) Change n[] to fit long var name.
2138         Use st_trim_copy() instead of strcpy().
2139
2140         * data-in.c: (parse_enum) Use mm_case_compare() instead of
2141         memcmp().
2142
2143         * data-list.c: (struct dls_var_spec) Change name[] to fit long var
2144         name.
2145         (parse_free) Use st_trim_copy() instead of strcpy().
2146
2147         * descript.c: (struct dsc_var) Change z_name[] to fit long var
2148         name.
2149         (try_name) Use strcasecmp() instead of strcmp().
2150         (generate_z_varname) Use st_trim_copy() instead of strcpy().
2151         (descriptives_compare_dsc_vars) Use strcasecmp() instead of
2152         strcmp().
2153
2154         * dictionary.c: (struct dictionary) Removed `long_name_tab'
2155         member.
2156         (compare_long_names) Removed.
2157         (hash_long_name) Removed.
2158         (dict_create) Don't initialize `long_name_tab' member.
2159         (dict_clone) Copy short names into new dictionary. 
2160         (dict_clear) Don't clear `long_name_tab' member.
2161         (dict_get_varname_block) Removed.
2162         (dict_add_longvar_entry) Removed.
2163         (free_nte) Removed.
2164         (dict_destroy) Don't destroy `long_name_tab' member.
2165         (dict_create_var_from_short) Removed.
2166         (dict_create_var_x) Removed.
2167         (dict_create_var) Get rid of longname handling.
2168         Clear short name.
2169         (dict_clone_var) Get rid of longname parameter and longname
2170         handling.
2171         (dict_lookup_var) Get rid of longname handling.
2172         (dict_reorder_var) New function.
2173         (dict_rename_var) Clear short name.
2174         (dict_rename_vars) Get rid of longname handling.  Clear short
2175         names.
2176         (dict_create_vector) Support long vector names.
2177         (dict_lookup_vector) Use strcasecmp() instead of strcmp().
2178         (quasi_base27) Removed.
2179         (make_short_name) Removed.
2180         (compare_strings) New function.
2181         (hash_string) New function.
2182         (dict_assign_short_names) New function.
2183
2184         * file-handle.q: (get_handle_with_name) Use strcasecmp() instead
2185         of strcmp().
2186         (get_handle_for_filename) Support long handle names.
2187
2188         * file-type.c: (struct col_spec) Make `name' fit long var names.
2189         (cmd_file_type) Use strcasecmp() instead of strcmp().
2190
2191         * flip.c: (make_new_var) Rewrite.
2192         (flip_sink_write) Use st_trim_copy() instead of strncpy().
2193
2194         * format.c: (parse_format_specifier_name) Use mm_case_compare()
2195         instead of memcmp().
2196
2197         * get.c: (cmd_save_internal) Rephrase.
2198         (rename_variables) Drop test for identical variable name.
2199         (struct mtf_proc) Change `first', `last' to fit long var name.
2200
2201         * hash.c: (hsh_hash_case_string) New function for case-insensitive
2202         string hashing.
2203
2204         * lexer.c: (restore_token) Use st_trim_copy() instead of
2205         strncpy().
2206         (lex_get) Don't uppercase string when copying into tokid.
2207         (lex_put_back_id) Use st_trim_copy() instead of
2208         strncpy().
2209
2210         * list.q: (determine_layout) Consider length of variable names in
2211         choosing vertical layout.
2212
2213         * matrix-data.c: (cmd_matrix_data) Use strcasecmp() instead of
2214         strcmp().
2215         (string_to_content_type) Ditto.
2216
2217         * modify-vars.c: (compare_variables_given_ordering) Ditto.
2218         (struct var_renaming) Change `new_name' to fit long var name.
2219         (compare_var_renaming_by_new_name) Use strcasecmp() instead of
2220         strcmp().
2221
2222         * pfm-read.c: (read_variables) Disallow system variables in system
2223         files.
2224         (write_variables) Call dict_assign_short_names() and use
2225         short_name[] members.
2226
2227         * repeat.c: (internal_cmd_do_repeat) Use strcasecmp() instead of
2228         strcmp().
2229
2230         * sfm-read.c: (sfm_open_reader) Rewrite code for long variable
2231         map.  Reorder variables into same order as long variable map.
2232         (read_variables) Set short name.
2233
2234         * sfm-write.c: (sfm_open_writer) Call dict_assign_short_names().
2235         (write_variable) Use st_bare_pad_copy().
2236         (write_longvar_table) Rewrite.
2237
2238         * str.c: (mm_case_compare) New function.
2239
2240         * sysfile-info.c: (compare_vectors_by_name) Use strcasecmp()
2241         instead of strcmp().
2242
2243         * t-test.q: (tts_custom_groups) Remove redundant test.
2244         (tts_custom_pairs) Ditto.
2245
2246         * var.h: (struct variable) Change `name' to fit long var names.
2247         Remove `longname'.  Add `short_name' member.  Reorder some
2248         variables.
2249         (struct name_table_entry) Removed.
2250         (struct vector) Change `name' to fit long vector names.
2251
2252         * vars-atr.c: (var_is_valid_name) Allow long var names.
2253         (compare_var_names) Use strcasecmp() instead of strcmp().
2254         (compare_var_ptr_names) Ditto.
2255         (hash_var_name) Use hsh_hash_case_string().
2256         (hash_var_ptr_name) Ditto.
2257         (var_set_short_name) New function.
2258         (var_clear_short_name) New function.
2259         (var_set_short_name_suffix) New function.
2260
2261         * vars-prs.c: (parse_DATA_LIST_vars) Support long names.
2262         Use strcasecmp() instead of strcmp().
2263         (struct array_var_set) Removed `longname_tab'.
2264         (array_var_set_lookup_var_idx) Drop longname_tab support.
2265         (array_var_set_destroy) Don't destroy `longname_tab'.
2266         (var_set_create_from_array) Don't create `longname_tab'.
2267
2268         * vector.c: (cmd_vector) Use strcasecmp() instead of strcmp().
2269         Support long names.
2270
2271         * expressions/parse.c: (word_matches) Use mm_case_compare()
2272         instead of memcmp().
2273         (compare_strings) New function.
2274         (lookup_function) Use compare_strings() instead of strcmp().
2275         
2276 Sun May  1 22:07:43 2005  Ben Pfaff  <blp@gnu.org>
2277
2278         * algorithm.c: (move_element) New function.
2279
2280 Sun May  1 22:05:35 2005  Ben Pfaff  <blp@gnu.org>
2281
2282         * aggregate.c: (parse_aggregate_functions) Always initialize
2283         destvar.
2284
2285 Sun May  1 22:03:47 2005  Ben Pfaff  <blp@gnu.org>
2286
2287         * aggregate.c: (cmd_aggregate) Use dict_clone_var_assert().
2288
2289         * dictionary.c: (dict_clone) Ditto.
2290         (dict_clone_var_assert) New function.
2291
2292         * get.c: (mtf_merge_dictionary) Use dict_clone_var_assert().
2293
2294 Sun May  1 15:05:54 WST 2005 John Darrington <john@darrington.wattle.id.au>
2295
2296         * error.c: Added a string for the compiler version to the
2297         request_bug_report_and_abort function.
2298
2299         * groff_font.c, font.c: Removed manpage(1) style references from 
2300         comments, because RMS frowns upon them.
2301
2302 Thu Apr 28 18:52:06 2005  Ben Pfaff  <blp@gnu.org>
2303
2304         * expressions/parse.c: Improve previous fix for bug 12858 (LAG).
2305
2306 Fri Apr 29 09:28:00 WST 2005 John Darrington <john@darrington.wattle.id.au>
2307
2308         * expressions/parse.c: Added handler for OP_LAG_Vn and OP_LAG_Vs.  
2309         Fixed bug [#12858] .
2310
2311 Wed Apr 27 12:42:34 WST 2005 John Darrington <john@darrington.wattle.id.au>
2312
2313         * loop.c recode.c repeat.c: Fixed a couple of instances of SHORT_NAME_LEN 
2314         which should be LONG_NAME_LEN
2315
2316 Wed Apr 27 07:43:50 WST 2005 John Darrington <john@darrington.wattle.id.au>
2317
2318         * command.def echo.c:  Added the ECHO command.
2319
2320 Mon Apr 25 22:55:59 2005  Ben Pfaff  <blp@gnu.org>
2321
2322         Finish fixing MATCH FILES (bug 11677).
2323
2324         * get.c: (trim_dictionary) Rewrite in terms of drop_variables(),
2325         keep_variables(), rename_variables().
2326         (drop_variables) New function.
2327         (keep_variables) New function.
2328         (struct mtf_file) Rename `in' to `in_name'.  Add `in_var'.
2329         (cmd_match_files) Deal with in_var.  Use drop_variables(),
2330         keep_variables().  When IN is specified, require BY.  Set master
2331         variables after master dictionary is complete.  Add IN variables
2332         after master dictionary is complete.
2333         (mtf_free_file) Free `in_name'.
2334         (mtf_delete_file_in_place) Set in_var value to 0.
2335         (mtf_read_nonactive_records)  Rephrase.
2336         (mtf_processing) Support IN.  Rephrase.  Fix bugs.
2337         (mtf_merge_dictionary) Don't set master variables; we do that
2338         later now.
2339         (get_master) Don't insist that there's a master variable.
2340         
2341 Mon Apr 25 22:55:22 2005  Ben Pfaff  <blp@gnu.org>
2342
2343         Kluge to make some variable renaming sort of work.
2344         Needs real fix.
2345
2346         * dictionary.c: (dict_rename_var) Call dict_add_longvar_entry().
2347
2348 Mon Apr 25 22:52:28 2005  Ben Pfaff  <blp@gnu.org>
2349
2350         Add functions for comparing sets of variables between cases.
2351         Use the functions.
2352
2353         * case.c: (case_compare) New function.
2354         (case_compare_2dict) New function.
2355         
2356         * aggregate.c: (struct agr_proc) Remove `prev_break' member.  Add
2357         `break_case'.
2358         (cmd_aggregate) Nullify break_case.  Don't call
2359         initialize_aggregate_info().
2360         (agr_destroy) Destroy break_case.
2361         (aggregate_single_case) Rewrite.  Use case_compare().
2362         (dump_aggregate_info) Copy from break_case into output.
2363         (initialize_aggregate_info) Copy break_case from input.
2364
2365         * get.c: (mtf_compare_BY_values) Use case_compare_2dict().
2366
2367         * vfm.c: (equal_splits) Use case_compare().
2368
2369 Sat Apr 23 17:01:04 WST 2005 John Darrington <john@darrington.wattle.id.au>
2370
2371         * dictionary.c vars-prs.c sfm-write.c: Fixed some memory leaks
2372
2373 Sun Apr 17 23:08:15 2005  Ben Pfaff  <blp@gnu.org>
2374
2375         Start work on fixing MATCH FILES.
2376
2377         * get.c: (enum operation) Remove OP_MATCH.
2378         (trim_dictionary) Change return value to bool.  Don't support
2379         OP_MATCH.
2380         (struct mtf_file) Remove `first', `last' members.
2381         (struct mtf_proc) Add `first', `last' members.  Change mtf_case
2382         from `struct ccase *' to `struct ccase'.  Remove `by' member.
2383         (cmd_match_files) Essentially rewrite.
2384         (mtf_free) Don't free `by' member.  Destroy `mtf_case' member.
2385         (mtf_read_nonactive_records) mtf_ parameter is not unused.
2386         (mtf_processing) Ditto.  Also rephrase some code.
2387         (mtf_merge_dictionary) Rewrite for easy comprehension.  
2388
2389 Sun Apr 17 23:06:00 2005  Ben Pfaff  <blp@gnu.org>
2390
2391         * matrix-data.c: (wr_output_data) [DEBUGGING] Fix compilation
2392         error.
2393
2394         * q2c.c: (dump_token) [DEBUGGING] Fix compilation error.
2395         
2396 Thu Apr 14 2005 John Darrington
2397
2398         * var-display.c: New file.
2399
2400         * format.h var.h sfm-read.c sfm-write.c dictionary.c :  Added 
2401           display_width, measure and alignment parameters to variables.
2402
2403         * aggregate.c command.def compute.c count.c data-list.c descript.c
2404           dictionary.c dictionary.h expr-prs.c file-type.c flip.c get.c 
2405           lexer.c lexer.h loop.c modify-vars.c pfm-read.c recode.c repeat.c 
2406           sfm-read.c sfm-write.c sfm-write.h sfmP.h val-labs.c val.h var.h 
2407           vars-prs.c vector.c :  
2408               - Replaced literal constants representing maximum variable name 
2409                 length with macro definitions. 
2410               - Added support for long variable names.
2411               - Changed lexer such that it no longer makes tokens upper
2412                 case, but relies upon case insensitive behaviour of commands.
2413
2414 Mon Apr  4 22:27:34 2005  Ben Pfaff  <blp@gnu.org>
2415
2416         * aggregate.c: (parse_aggregate_functions) If dict_create_var()
2417         fails, don't dereference the resulting null pointer (bug 12427).
2418         Also, fix double free error.
2419
2420 Sat Mar 19 23:06:02 2005  Ben Pfaff  <blp@gnu.org>
2421
2422         * aggregate.c: (parse_aggregate_functions) Fix N_NO_VARS format.
2423         (accumulate_aggregate_info) Set int1 to 1 for SUM.
2424         (dump_aggregate_info) Only make SUM non-missing if there was at
2425         least one variate.
2426
2427 Sat Mar 19 14:48:19 2005  Ben Pfaff  <blp@gnu.org>
2428
2429         * aggregate.c: (dump_aggregate_info) Properly test whether the
2430         destination variable is numeric, when making the result
2431         system-missing for columnwise missing values.
2432
2433 Mon Mar 14 21:52:34 2005  Ben Pfaff  <blp@gnu.org>
2434
2435         * misc.h: Remove GCC specializations.
2436
2437 Mon Mar 14 21:07:23 2005  Ben Pfaff  <blp@gnu.org>
2438
2439         Make sort stable (bug 12313).
2440         
2441         * sort.c: Don't need to include some headers anymore.
2442         (static var min_buffers) New variable.
2443         (static var max_buffers) New variable.
2444         (static var allow_internal_sort) New variable.
2445         (cmd_sort_cases) Add test mode.
2446         (sort_execute) Rephrase.
2447         (do_internal_sort) Don't try internal sorting if
2448         allow_internal_sort is set.
2449         (struct external_sort) Renamed `initial_runs' to `runs' and
2450         updated all references.
2451         (macro MIN_BUFFER_TOTAL_SIZE_RECS) Removed.
2452         (macro MIN_BUFFER_SIZE_BYTES) Removed.
2453         (macro MIN_BUFFER_SIZE_RECS) Removed.
2454         (compare_initial_runs) Removed.
2455         (struct record_run) Add member `idx'.
2456         (write_initial_runs) Pass increasing values to process_case() as
2457         index.
2458         (process_case) Add `idx' parameter and use it to initialize new
2459         `idx' member.
2460         (allocate_cases) Limit allocated buffers to max_buffers.
2461         (compare_record_run) Use new `idx' member for last resort
2462         comparison, for stability.
2463         (end_run) Call casefile_sleep() on irs->casefile, to prevent
2464         running out of file descriptors.
2465         (struct merge_state) Removed.
2466         (merge) Don't need to allocate cases.  Always use MAX_MERGE_ORDER
2467         unless we have fewer runs left.  Always merge consecutive runs,
2468         for stability.  Return the final run.
2469         (mod) Removed.
2470         (choose_merge) New function.
2471         (merge_once) Rewritten.
2472
2473 Mon Mar 14 21:05:42 2005  Ben Pfaff  <blp@gnu.org>
2474
2475         * cmdline.c: (static var testing_mode) Move into
2476         parse_command_line().
2477         
2478 Mon Mar 14 21:05:13 2005  Ben Pfaff  <blp@gnu.org>
2479
2480         * algorithm.c: (remove_range) New function.
2481         (remove_element) New function.
2482
2483         * dictionary.c: (dict_delete_var) Use remove_element().
2484
2485         * flip.c: (cmd_flip) Ditto.
2486
2487 Sun Mar 13 22:52:05 2005  Ben Pfaff  <blp@gnu.org>
2488
2489         * file-handle.q: (struct file_handle) `open_mode' should not be
2490         const.
2491         
2492 Sun Mar 13 22:40:54 2005  Ben Pfaff  <blp@gnu.org>
2493
2494         First phase of making SORT CASES stable (bug 12313).
2495
2496         * sort.c: (struct indexed_case) New structure.
2497         (do_internal_sort) Rewrite to make internal sorting stable.
2498         (compare_case_dblptrs) Removed.
2499         (compare_indexed_cases) New function.
2500
2501 Sun Mar 13 22:38:40 2005  Ben Pfaff  <blp@gnu.org>
2502
2503         Clean-ups.
2504
2505         * casefile.c: (casereader_read_xfer_assert) New function.
2506
2507         * dictionary.c: (dict_compact_case) New function.
2508
2509         * flip.c: (struct flip_pgm) New member idx_to_fv.
2510         (cmd_flip) Initialize idx_to_fv member.
2511         (destroy_flip_pgm) Free idx_to_fv member.
2512         (flip_sink_write) Use struct flip_pgm member instead of case_sink
2513         member.
2514         (flip_sink_write) Ditto.
2515
2516         * vfm.c: (write_case) Use dict_compact_case() instead of
2517         compact_case().
2518         (compact_case) Removed.
2519         (storage_source_create) Removed `dict' parameter.  All references
2520         updated.
2521
2522         * vfm.h: (struct case_source) Removed `value_cnt' member.  All
2523         references removed.
2524         (struct case_sink) Removed `dict', `idx_to_fv' members.  All
2525         references removed.
2526
2527 Sun Mar 13 22:35:55 2005  Ben Pfaff  <blp@gnu.org>
2528
2529         More AGGREGATE fixes.
2530
2531         * aggregate.c: (accumulate_aggregate_info) Implement NMISS and
2532         NUMISS for strings.  Fix FOUT, POUT, FGT, FLT, FIN, FOUT for
2533         strings.
2534         (initialize_aggregate_info) Fix initialization for MIN, MAX for
2535         strings.
2536
2537 Sat Mar 12 23:26:21 2005  Ben Pfaff  <blp@gnu.org>
2538
2539         Start work on testing and debugging AGGREGATE.
2540
2541         * aggregate.c: (cmd_aggregate) Use discrete bool variables instead
2542         of a bit-map.  Require proper subcommand ordering.  Make OUTFILE
2543         subcommand mandatory.
2544         (parse_aggregate_functions) Check that PIN, POUT, FIN, FOUT
2545         functions' arguments are in the correct order and swap them if
2546         not.
2547         (accumulate_aggregate_info) Make SUM include weights.  Add various
2548         string functions.
2549         (dump_aggregate_info) Add various string functions.
2550         (initialize_aggregate_info) Initialize int1 for MIN, MAX.
2551
2552         * sort.c: (sort_parse_criteria) Add parameter for returning
2553         whether any directions were specified.  All callers updated.
2554
2555 Sun Mar 13 14:54:27 WST 2005 John Darrington <john@darrington.wattle.id.au>
2556
2557         * t-test.q: Fixed erroneous logic in compare_group_binary.
2558
2559 Sat Mar 12 13:29:21 2005  Ben Pfaff  <blp@gnu.org>
2560
2561         * split-file.c: (cmd_split_file) Ignore LAYERED and SEPARATE
2562         keywords (bug 11628).
2563
2564 Sat Mar 12 13:17:12 2005  Ben Pfaff  <blp@gnu.org>
2565
2566         * vfm.c: (procedure_with_splits) Fix bug 11492: end_func() must be
2567         called *before* close_active_file().
2568
2569 Sat Mar 12 12:20:57 2005  Ben Pfaff  <blp@gnu.org>
2570
2571         * file-handle.q: (struct file_handle) Change open_mode from
2572         character pointer to 3-char array, for safety.  Updated all
2573         references.
2574
2575 Sat Mar 12 12:15:49 2005  Ben Pfaff  <blp@gnu.org>
2576
2577         Thanks to Ben Kujala <bkujala@oregonchildcare.org> for reporting
2578         these bugs.
2579         
2580         * pfm-read.c: (read_header) Improve error message for many cases
2581         in which the input is not actually a portable file.
2582
2583         * file-handle.q: (fh_open) When we give an error message, actually
2584         return NULL.
2585
2586 Fri Mar 11 11:50:30 2005  Ben Pfaff  <blp@gnu.org>
2587
2588         * format.c: (check_common_specifier) New function for checks
2589         common to check_input_specifier() and check_output_specifier().
2590         (check_input_specifier) Use check_common_specifier().
2591         (check_output_specifier) Use check_common_specifier().
2592         (check_string_specifier) Removed.
2593         (check_specifier_type) New function.
2594         (check_specifier_width) New function.
2595         (get_format_var_width) Fix bug.
2596
2597         * formats.c: (internal_cmd_formats) Only accept numeric variables.
2598
2599         * lexer.c: (check_id) Rename lex_id_to_token(), make public,
2600         update all references.  Make case-insensitive.
2601
2602         * pfm-read.c: Essentially rewrite the whole file.  Now much
2603         cleaner.
2604
2605         * print.c: (check_string_width) New function.
2606         (fixed_parse_compatible) Use check_string_width(),
2607         check_specifier_type().
2608         (dump_fmt_list) Ditto.
2609
2610         * str.c: (st_trim_copy) New function.
2611         (st_uppercase) New function.
2612
2613         * vars-atr.c: (var_is_valid_name) New function.
2614         
2615         * expressions/parse.c: (type_coercion_core) Use
2616         check_specifier_type().
2617         
2618 Fri Mar 11 11:31:24 2005  Ben Pfaff  <blp@gnu.org>
2619
2620         * expressions/evaluate.c: (cmd_debug_evaluate) Fix memory leaks.
2621
2622         * expressions/parse.c: (no_match) Ditto.
2623
2624 Wed Mar  9 09:54:27 2005  Ben Pfaff  <blp@gnu.org>
2625
2626         * Makefile.am: (pspp_LDADD) Add libgsl-extras.a.
2627
2628         * expressions/helpers.c: (struct func_params) Removed.
2629         (generalized_idf) Removed.
2630         (cdf_beta) Removed.
2631         (idf_beta) Removed.
2632         (idf_fdist) Use gslextras_cdf_beta_Pinv() instead of idf_beta().
2633
2634         * expressions/operations.def: Implement IDF.BETA, CDF.BINOM,
2635         CDF.GEOM, CDF.HYPER, CDF.NEGBIN, CDF.POISSON using gsl-extras.
2636         Implement SIG.F, which I had overlooked previously.
2637
2638 Tue Mar  8 12:47:53 WST 2005 John Darrington <john@darrington.wattle.id.au>
2639
2640         * command.c command.def glob.[ch] cmdline.c: Made DEBUG cmds
2641         available only in testing mode.
2642
2643 Sun Mar  6 23:25:40 2005  Ben Pfaff  <blp@gnu.org>
2644
2645         * data-in.c: Use `bool' throughout, where relevant.
2646
2647 Sun Mar  6 19:52:22 2005  Ben Pfaff  <blp@gnu.org>
2648
2649         DATA LIST with free-field formats should not have implied decimal
2650         places (bug 12035).  Also clean up data-in.c a bit.
2651
2652         * data-in.h: (enum) Add DI_IMPLIED_DECIMALS.
2653
2654         * data-in.c: (apply_implied_decimals) New function.
2655         (parse_numeric) Don't adjust exponent if DI_IMPLIED_DECIMALS not
2656         set.  Also, get rid of gotos.
2657         (parse_Z) Use apply_implied_decimals() if the field doesn't
2658         contain a decimal point.
2659         (parse_N) Use apply_implied_decimals().
2660         (parse_IB) Ditto.
2661         (parse_PIB) Ditto.
2662         (parse_P) Ditto.
2663         (parse_PK) Ditto.
2664         (to_roman) Removed.
2665         (parse_enum) New function.
2666         (macro CHAR_IS_ROMAN) Removed.
2667         (macro ROMAN_VALUE) Removed.
2668         (parse_month) Use parse_enum().
2669         (parse_weekday) Use parse_enum().
2670         (parse_DATETIME) Use long for weekday.
2671
2672         * data-list.c: (read_from_data_list_fixed) Use
2673         DI_IMPLIED_DECIMALS.
2674
2675 Sun Mar  6 17:07:20 2005  Ben Pfaff  <blp@gnu.org>
2676
2677         When the lexer sees something like `-5' in the input, it has to
2678         decide whether it's a negative numeric constant token or a '-'
2679         token followed by a positive numeric constant token.  It always
2680         decides on the former, and then the parser can call
2681         lex_negative_to_dash() if it wants the latter.  However, this
2682         doesn't work for the case of `-0', because negative zero is
2683         (portably) indistinguishable from positive zero.  So now we divide
2684         T_NUM into two tokens, T_POS_NUM and T_NEG_NUM, to make the
2685         distinction clear.  This requires a little bit of extra effort,
2686         because there were several references to T_NUM in the code base.
2687         
2688         * lexer.c: (lex_get) Use T_NEG_NUM and T_POS_NUM to distinguish
2689         positive and negative numeric constants.
2690         (lex_double_p) Renamed lex_is_number().  Changed return type to
2691         bool.  Updated all relevant references to T_NUM to instead use
2692         this function.
2693         (lex_double) Renamed lex_number().  All references updated.
2694         (lex_integer_p) Renamed lex_is_integer().  Changed return type to
2695         bool.  All references updated.
2696         (lex_token_representation) Understand T_NEG_NUM and T_POS_NUM.
2697         (lex_negative_to_dash) Ditto.
2698         (dump_token) Ditto.
2699         
2700         * lexer.h: (enum) Add T_POS_NUM, T_NEG_NUM.  Remove T_NUM.
2701
2702 Sun Mar  6 22:09:20 2005  Ben Pfaff  <blp@gnu.org>
2703
2704         * expressions/operations.def: (NUMBER) Use DI_IMPLIED_DECIMALS.
2705
2706 Sun Mar  6 19:33:24 2005  Ben Pfaff  <blp@gnu.org>
2707
2708         * expressions/operations.def: (VEC_ELEM_NUM) Treat user-missing
2709         values as system-missing.
2710
2711         * expressions/parse.c: (parse_vector_element) Fix order of
2712         arguments in call to expr_allocate_binary().
2713
2714 Sun Mar  6 17:51:05 2005  Ben Pfaff  <blp@gnu.org>
2715
2716         * expressions/optimize.c: (optimize_tree) Fix optimization bug for
2717         x**2.
2718
2719         * expressions/parse.c: (type_coercion_core) Set *node to NULL on
2720         failure, as indicated by function comment.
2721         (parse_binary_operators) Always return NULL on type_coercion()
2722         failure.  Should have been doing this anyway, but bug in
2723         type_coercion_core() filtered through.
2724         (parse_add) Fix typo in user message.
2725         (parse_primary) Understand T_NEG_NUM and T_POS_NUM.
2726
2727 Sun Mar  6 10:47:13 2005  Ben Pfaff  <blp@gnu.org>
2728
2729         * expressions/operations.def: Add VALUE function.
2730
2731         * expressions/parse.c: (parse_function) Need an unary composite
2732         node for variables in A TO B, not a variable node.  Use
2733         allocate_unary_variable().
2734         (parse_primary) Use allocate_unary_variable().
2735         (allocate_unary_variable) New function.
2736
2737 Thu Mar  3 23:53:32 2005  Ben Pfaff  <blp@gnu.org>
2738
2739         * expressions/PSPP_expressions.pm: Renamed it back to generate.pl
2740         but fixed the real problem that was preventing the build from a
2741         separate directory.  I liked it my way better ;-)
2742         
2743 Thu Mar  3 23:17:51 2005  Ben Pfaff  <blp@gnu.org>
2744
2745         * expressions/parse.c: (expr_parse) Fix parameter type.  Thanks to
2746         John Darrington <john@darrington.wattle.id.au> for reporting this
2747         bug.
2748
2749 Thu Mar  3 22:10:25 WST 2005 John Darrington <john@darrington.wattle.id.au>
2750
2751         * expressions/Makefile.am expressions/evaluate.h.pl
2752           expressions/evaluate.inc.pl expressions/operations.h.pl
2753           expressions/optimize.inc.pl expressions/parse.inc.p:
2754
2755           Renamed generate.pl to PSPP_expressions.pm and adjusted *.pl
2756           to suit. 
2757
2758           Fixed everything so that it can be built from an arbitrary
2759           directory.
2760         
2761 Thu Mar  3 22:08:35 WST 2005 John Darrington <john@darrington.wattle.id.au>
2762
2763         * Makefile.am : Fixed up CLEANFILES target.
2764
2765 Mon Feb 28 23:49:56 2005  Ben Pfaff  <blp@gnu.org>
2766
2767         * str.h: Changed `struct len_string' to `struct fixed_string', a
2768         more accurate name.  Updated all references.
2769
2770 Mon Feb 28 23:35:30 2005  Ben Pfaff  <blp@gnu.org>
2771
2772         Redo calendar support.  Should now be bug-for-bug compatible.
2773         
2774         * calendar.c: New file.
2775
2776         * calendar.h: New file.
2777
2778         * data-in.c: Use new calendar functions.
2779         (parse_sign) Change sense of return value.
2780         (calendar_error) New function.
2781         (ymd_to_ofs) New function.
2782         (ymd_to_date) New function.
2783         (parse_DATE) Use new function.
2784         (parse_ADATE) Ditto.
2785         (parse_EDATE) Ditto.
2786         (parse_SDATE) Ditto.
2787         (parse_JDATE) Ditto.
2788         (parse_QYR) Ditto.
2789         (parse_MOYR) Ditto.
2790         (parse_WKYR) Ditto.
2791         (parse_TIME) Ditto.
2792         (parse_DTIME) Ditto.
2793         (parse_DATETIME) Ditto.
2794
2795         * data-out.c: (convert_date) Use new calendar functions.
2796
2797         * error.c: (err_vmsg) Changed interface to be more sensible.
2798         Updated all callers.
2799         (dump_message) Don't double new-lines (why did we do this
2800         anyway?).
2801
2802 Mon Feb 28 23:30:25 2005  Ben Pfaff  <blp@gnu.org>
2803
2804         * sfmP.h: (macro flt64) Moved here from pref.h.orig.
2805         (macro FLT64_MAX) Moved here from pref.h.orig.
2806
2807 Mon Feb 28 23:28:01 2005  Ben Pfaff  <blp@gnu.org>
2808
2809         * set.q: Support SET EPOCH.
2810         (static var set_epoch) New var.
2811         (aux_stc_custom_epoch) New function.
2812         (stc_custom_epoch) New function.
2813         (get_epoch) New function.
2814         (stc_custom_pager) [USE_INTERNAL_PAGER] Fix bug.
2815
2816         * format.c: Make it possible just to check whether a specifier is
2817         valid without emitting an error message.
2818         (parse_format_specifier_name) Change interface, update all
2819         callers.
2820         (check_input_specifier) Ditto.
2821         (check_output_specifier) Ditto.
2822         (parse_format_specifier) Ditto.
2823
2824 Mon Feb 28 23:24:08 2005  Ben Pfaff  <blp@gnu.org>
2825
2826         * command.def: Add DEBUG POOL.
2827
2828         * pool.c: (pool_destroy) Fix bug in deleting this pool from its
2829         parent.
2830         (pool_clear) Properly account for size of pool gizmo.
2831         (pool_realloc) Ditto.
2832         (pool_clone) New function.
2833
2834         * pool.h: Mark our allocation functions MALLOC_LIKE.
2835
2836 Mon Feb 28 23:21:26 2005  Ben Pfaff  <blp@gnu.org>
2837
2838         * Makefile.am: Move many definitions into new top-level
2839         Make.build.  Add expressions to SUBDIRS.  Add calendar.c,
2840         calendar.h.  Remove expr-evl.c, expr-opt.c expr-prs.c, expr.h,
2841         exprP.h, expr.def.
2842
2843         * case.c: (case_resize) New function.
2844         (case_swap) New function.
2845
2846         * casefile.c: Include mkfile.h.
2847
2848 Fri Feb 25 21:11:35 WST 2005 John Darrington <john@darrington.wattle.id.au>
2849
2850         * sfm-read.c: Fixed a buglet which caused a crash when trying
2851         to read a non-existent file.
2852
2853 Sun Feb 13 16:11:13 2005  Ben Pfaff  <blp@gnu.org>
2854
2855         Fix bug 11955.
2856
2857         * aggregate.c: (parse_aggregate_functions) Code cleanup.
2858         Important part: get rid of spurious copying of function->format to
2859         destvar->print and destvar->write.
2860
2861 Fri Feb 11 00:08:36 2005  Ben Pfaff  <blp@gnu.org>
2862
2863         Fix bug 11916, which was confusing a variable's `index' member
2864         with the variable's position in a var_set.  Although these are
2865         usually the same, they are not for array `var_set's.
2866         
2867         Took advantage of this bug as an opportunity to clean up and
2868         rewrite parse_var_set_vars().
2869
2870         * vars-prs.c: (parse_vs_variable_idx) New function.
2871         (parse_vs_variable) Reimplement in terms of
2872         parse_vs_variable_idx().
2873         (parse_var_idx_class) New function.
2874         (add_variable) New function.
2875         (add_variables) New function.
2876         (parse_var_set_vars) Rewritten.
2877         (struct var_set) Change `lookup_var' member that returns a
2878         variable into `lookup_var_idx' member that returns an int.
2879         Updated the var set implementations in obvious corresponding ways.
2880         Used compare_var_ptr_names(), hash_var_ptr_name() just added.
2881         
2882 Fri Feb 11 00:06:03 2005  Ben Pfaff  <blp@gnu.org>
2883
2884         Use our global variable compare & hash functions and give them
2885         better names.  Add similar functions for dealing with double
2886         pointers to variables.
2887         
2888         * vars-atr.c: (compare_variables) Renamed compare_var_names().
2889         (hash_variable) Renamed hash_var_name().
2890         (compare_var_ptr_names) New function.
2891         (hash_var_ptr_name) New function.
2892         
2893         * t-test.q: (cmd_t_test) Use global compare_var_names(),
2894         hash_var_name().
2895         (compare_var_name) Removed.
2896         (hash_var_name) Removed.
2897
2898 Fri Feb 11 00:04:39 2005  Ben Pfaff  <blp@gnu.org>
2899
2900         Fix dictionary bug.
2901         
2902         * dictionary.c: (compare_variable_dblptrs) Rename
2903         compare_var_ptrs() and fix it to properly dereference the double
2904         pointers.
2905
2906 Mon Feb  7 09:58:15 WST 2005 John Darrington <john@darrington.wattle.id.au>
2907
2908         crosstabs.q examine.q oneway.q q2c.c:  Added a q2c feature to 
2909         declare subcommands as mandatory.  Closed bug #11843
2910
2911 Sat Feb  5 20:35:10 WST 2005 John Darrington <john@darrington.wattle.id.au>
2912         
2913         * getline.c command.[ch] command.def:  Added (very rudimentary)
2914         support for line  completion when in interactive mode.  Partially 
2915         addresses bug #11693
2916         
2917 Mon Jan 31 09:52:51 WST 2005 John Darrington <john@darrington.wattle.id.au>
2918
2919         * examine.q factor_stats.c oneway.q output.c pfm-read.c: Fixed some
2920         problems revealed by valgrind.
2921
2922
2923 Wed Jan 26 11:44:11 WST 2005 John Darrington <john@darrington.wattle.id.au>
2924
2925         * set.q: Affixed a fix to the previous fix such that we'll be OK now
2926         whether or not PAGER is set.
2927
2928 Wed Jan 26 09:25:54 WST 2005 John Darrington <john@darrington.wattle.id.au>
2929
2930         * set.q: Copied the string produced by getenv("PAGER") thus avoiding
2931         "invalid free" errors.  Hopefully fixes bug #11722
2932
2933         * compute.c expr-prs.c: Check that lvalues are populated before 
2934         attempting to destroy them.  Closes bug #11676
2935
2936 Tue Jan 25 21:01:43 WST 2005 John Darrington <john@darrington.wattle.id.au>
2937
2938         * aggregate.c: Initialised the complete agr_proc structure.
2939         Closes bug #11675
2940
2941
2942 Sun Jan 23 23:02:21 2005  Ben Pfaff  <blp@gnu.org>
2943
2944         * print.c: (print_trns_free) Close the dfm writer if there is one,
2945         fixing a memory leak.
2946
2947 Mon Jan 24 12:24:36 WST 2005 John Darrington <john@darrington.wattle.id.au>
2948
2949         * glob.c oneway.q q2c.c t-test.q vfm.c: Still *more* memory leaks 
2950         fixed.
2951
2952
2953 Fri Jan 21 19:54:14 WST 2005 John Darrington <john@darrington.wattle.id.au>
2954
2955         * linked-list.[ch] Added
2956
2957         * examine.q file-handle.[hq] font.h glob.c groff-font.c postscript.c 
2958           set.q:    Yet more memory leaks
2959
2960 Tue Jan 18 23:12:40 WST 2005 John Darrington <john@darrington.wattle.id.au>
2961
2962         * t-test.q examine.q : More memory leaks fixed.
2963
2964 Tue Jan 18 19:26:59 WST 2005 John Darrington <john@darrington.wattle.id.au>
2965
2966         * examine.q  factor_stats.[ch] get.c pfm-read.c: Plugged numerous
2967         memory leaks.
2968
2969 Mon Jan 10 14:43:45 WST 2005 John Darrington <john@darrington.wattle.id.au>
2970
2971         * ascii.c cartesian.c casefile.c chart.h devind.c 
2972           examine.q frequencies.q
2973           html.c output.h piechart.c plot-chart.c plot-hist.c
2974
2975           Integrated the chart rendering into the output stream
2976           (currently only works for html).
2977           
2978           Removed gratuitous use of ifndef NO_CHARTS, and replaced with
2979           dummy-chart.c for compiling without charts.
2980
2981         * mkfile.[ch] Created.  
2982
2983         * som.[ch] tab.[ch]: Changed name of som_table to som_entity
2984         Added type element so we can tell if it's a chart or a table.
2985
2986         * chart.h examine.q piechart.c plot-chart.c plot-hist.c: changed the 
2987         API of charts to be more like that of tables.
2988
2989 Thu Jan 13 21:00:02 WST 2005 John Darrington <john@darrington.wattle.id.au>
2990
2991         * casefile.c main.c: Moved the SIGINT handler from casefile.c to
2992         main.c. Removed the handler for SIGQUIT.
2993
2994 Mon Jan 10 14:43:45 WST 2005 John Darrington <john@darrington.wattle.id.au>
2995
2996         * casefile.c: Added a signal handler to delete temp files on 
2997         SIGINT and SIGQUIT
2998
2999         * permissions.c Inhibited the PERMISSIONS command when SAFER is on.
3000
3001         * command.def Added a lot more unimplemented commands.
3002
3003         * copyleft.[ch] cmdline.c Moved legal information to copyleft.c
3004
3005 Sat Jan  8 23:58:34 2005  Ben Pfaff  <blp@gnu.org>
3006
3007         * sort.c: (compare_initial_runs) Needed additional level of
3008         dereferencing.
3009         (merge_once) Fix plenty of stupid mistakes.
3010
3011 Sat Jan  8 23:55:27 2005  Ben Pfaff  <blp@gnu.org>
3012
3013         * casefile.c: (casefile_sleep) Need to flush_buffer() after
3014         calling casefile_to_disk() or we will lose the last block in the
3015         file if the casefile started out as disk-based.
3016         (casefile_get_reader) Initialize reader->destructive to 0.
3017         (cmd_debug_casefile) Add new test pattern.
3018         (test_casefile) Define new test pattern to make sure
3019         casefile_sleep() works properly.
3020
3021 Fri Jan  7 08:00:05 WST 2005 John Darrington <john@darrington.wattle.id.au>
3022
3023         * Makefile.am chart.[ch]  histogram.[ch] piechart.c (Modified);
3024           plot-hist.c plot-chart.c (Added) Reorganised these files in an
3025           attempt to seperate the creation and processing of charts from their
3026           actuall renedering.
3027
3028         * examine.q frequencies.q generated charts conditional upon the NO_CHARTS
3029           macro.
3030
3031 Thu Jan  6 18:48:58 WST 2005 John Darrington <john@darrington.wattle.id.au>
3032
3033         * main.c Added a signal handler for SIGFPE
3034
3035         * sort.c Somewhat more robust fix to the previous entry.
3036
3037 Wed Jan  5 21:23:31 2005  Ben Pfaff  <blp@gnu.org>
3038
3039         * sort.c: (merge) Fix assertion for proper Huffman merge pattern:
3040         0 == 1 modulo 1.  See Knuth 5.4.9 (vol. 3, 2nd ed.,
3041         pp. 361).  Thanks to John Darrington <john@cellform.com.au> for
3042         reporting the bug.
3043
3044 Wed Jan  5 22:42:26 WST 2005 John Darrington <john@darrington.wattle.id.au>
3045
3046         * case.h Fixed bug # 11307
3047         
3048 Wed Jan  5 08:30:48 WST 2005 John Darrington <john@darrington.wattle.id.au>
3049
3050         * val-labs.c Fixed bug which caused a crash if VALUE LABELS had
3051         a trailing slash.
3052
3053 Mon Jan  3 17:44:37 2005  Ben Pfaff  <blp@gnu.org>
3054
3055         * pfm-read.c: (read_variables) Remove direct manipulation of
3056         v->aux, which is no longer needed.  Fixes bug 11483.
3057
3058 Sat Jan  1 19:01:16 WST 2005 John Darrington <john@darrington.wattle.id.au>
3059
3060         * data-list.c Fixed a bug in parsing delimiters.
3061
3062         * group.c vars-atr.c Fixed buglet in hash/compare functions for alpha
3063         values.
3064
3065         * percentiles.c Properly handled calculation of Tukey hinges where
3066         the number of data is small.
3067
3068         * oneway.q Used the generic value_to_string function for independent
3069         variable instead of trying to do it ourselves.
3070
3071         * box-whisker.c Fixed a buglet which caused a crash if the number of
3072         data was zero
3073
3074
3075 Fri Dec 31 16:47:45 WST 2004 John Darrington <john@darrington.wattle.id.au>
3076
3077         * examine.q box-whisker.c chart.h Implemented boxplots in EXAMINE
3078
3079         * percentiles.c Fixed some bugs when calculating percentiles when
3080         there's a small number of cases.
3081
3082 Wed Dec 29 08:18:08 WST 2004 John Darrington <john@darrington.wattle.id.au>
3083
3084         * percentiles.[ch] Added. Calculates percentiles and Tukey hinges
3085
3086         * examine.q factor_stats.[ch]  Added calculation of percentiles
3087
3088 Fri Dec 24 15:09:11 WST 2004 John Darrington <john@darrington.wattle.id.au>
3089
3090         * t-test.q Fixed bug #11227 Made t-test work when the independent
3091         variable is alpha
3092
3093 Sat Dec 11 11:43:45 WST 2004 John Darrington <john@darrington.wattle.id.au>
3094
3095         * factor_stats.c Fixed calculation of trimmed mean under various
3096         special conditions.
3097
3098 Sat Dec  4 17:14:45 WST 2004 John Darrington <john@darrington.wattle.id.au>
3099
3100         * histogram.c chart.[ch] factor_stats.c frequencies.q
3101
3102         Added code to calculate sensible histogram ranges and limits.
3103
3104 Thu Dec  2 13:37:43 WST 2004 John Darrington <john@darrington.wattle.id.au>
3105
3106         * chart.h Updated to reflect many API changes.
3107
3108         * cartesian.c chart.c Moved the definitions of chart_write_{xy}scale from 
3109         cartesian.c and into chart.c
3110
3111         * factorstats.[ch] Added the histogram calculations
3112
3113         * casefile.c Removed an unused variable.
3114
3115         * frequencies.q examine.q histogram.c  Reworked the API for 
3116         histograms.
3117
3118         * piechart.c  Revised the API for piecharts.
3119
3120         * var.h  Moved the definitions of freq_tab and freq out of var.h
3121         and into frequencies.q where they belong.
3122         
3123 Tue Nov 30 21:10:20 2004  Ben Pfaff  <blp@gnu.org>
3124
3125         * flip.c: (flip_file) Check for off_t separately from fseeko(),
3126         using AC_TYPE_OFF_T.
3127
3128 Tue Nov 30 08:47:41 2004  Ben Pfaff  <blp@gnu.org>
3129
3130         * flip.c: (flip_file) If fseeko() is not available, use long int
3131         for off_t.  Thanks to "Marshall DeBerry" <mdb@radix.net> for
3132         reporting the problem.
3133
3134 Mon Nov 29 12:20:59 WST 2004 John Darrington <john@darrington.wattle.id.au>
3135
3136         * examine.q factor_stats.[ch] Changed stderr to se_mean to avoid
3137         conflict with stdio.
3138
3139 Sun Nov 21 10:32:41 WST 2004 John Darrington <john@darrington.wattle.id.au>
3140
3141         * var-labs.c (var_to_string) Now returns null if the variable is null
3142
3143         * value-labels.c (value_to_string) Made it return null if either the 
3144         value or the variable is null.
3145
3146         * hash.c (hsh_clear) Fixed a buglet.
3147
3148         * examine.q  factor_stats.[ch] Largely  rewrote, because I'd started 
3149         with  the wrong model.
3150
3151         * casefile.[ch] Added a function to return the casereader.case_idx 
3152         member
3153
3154         * examine.q  Implemented the extreme values results.
3155
3156 John Darrington <john@darrington.wattle.id.au>
3157
3158         * settings.h set.c glob.[ch] frequencies.q q2c.c error.c lexer.[ch] 
3159           output.[ch] getline.c 
3160
3161           Plugged some memory leaks
3162
3163 Mon Nov 15 23:47:40 2004  Ben Pfaff  <blp@gnu.org>
3164
3165         Adopt GSL random number generators, paving the way for providing
3166         the complete suite of random number generators on expressions.
3167         
3168         * Makefile.am: Remove random.c, random.h.
3169
3170         * random.c: Removed.
3171
3172         * random.h: Removed.
3173
3174         * algorithm.c: (algo_default_random) Use GSL functions.
3175
3176         * casefile.c: (test_casefile) Use GSL RNG functions.
3177
3178         * expr-evl.c: (expr_evaluate) Use GSL RNG functions for OP_NORMAL,
3179         OP_UNIFORM.
3180
3181         * sample.c: (cmd_sample) Use GSL RNG functions.
3182         (sample_trns_proc) Ditto.
3183
3184         * set.q: (static var set_seed) Removed.
3185         (static var seed_flag) Removed.
3186         (static var rng) New variable.
3187         (aux_stc_custom_seed) No seed value anymore, don't print anything.
3188         (stc_custom_seed) Use new seed functions.
3189         (seed_is_set) Removed.
3190         (get_rng) New function that composes the entire external
3191         interface.
3192         (set_rng) New function.
3193         (random_seed) New function.
3194
3195 Mon Nov 15 22:08:25 2004  Ben Pfaff  <blp@gnu.org>
3196
3197         * expr-evl.c: (expr_evaluate) Fix XDATE.JDAY formula.  Thanks to
3198         John Darrington <john@darrington.wattle.id.au> for reporting this
3199         bug.
3200
3201 Tue Nov 16 13:19:18 WST 2004 John Darrington <john@darrington.wattle.id.au>
3202
3203         * permissions.c command.def Added the PERMISSIONS command
3204
3205 Mon Nov 15 01:33:32 2004  Ben Pfaff  <blp@gnu.org>
3206
3207         * q2c.c: (dump_header) Don't try to emit #includes at very top of
3208         output file because that will precede #include <config.h>, which
3209         is bad.
3210         (main) Add needed headers to /* (header) */ code.
3211
3212 Mon Nov 15 01:21:36 2004  Ben Pfaff  <blp@gnu.org>
3213
3214         Instead of making system or portable file readers responsible for
3215         dropping and reordering variables, make them read full cases and
3216         let the caller take care of any changes.
3217
3218         * get.c: New "case map" structure to handle this.  Use for GET,
3219         IMPORT, MATCH FILES.  Essentially rewrite the whole file.
3220
3221         * pfm-read.c: (pfm_read_case) Read into provided case.  Signature
3222         changed appropriately.
3223
3224         * sfm-read.c: (sfm_read_case) Ditto.
3225
3226 Mon Nov 15 00:47:45 2004  Ben Pfaff  <blp@gnu.org>
3227
3228         Decided that case_serialize() and case_unserialize() were too
3229         abstract.  Also we need a couple more functions to avoid excessive
3230         copying for data in/out fast paths.
3231
3232         * case.c: (case_serial_size) Removed.
3233         (case_serialize) Rename case_to_values() and make its argument
3234         explicitly an array of union values.
3235         (case_unserialize) Rename case_from_values() and make its argument
3236         explicitly an array of union values.
3237         (case_data_all) New function.
3238         (case_data_all_rw) New function.
3239
3240         * casefile.c: (struct casefile) Change buffer from array of
3241         unsigned char to array of union value for better accuracy.
3242         Redefine buffer_used and buffer_size in terms of values, not
3243         bytes.  Remove case_size because it is now redundant with
3244         value_cnt.  Fix up all references to these members.
3245
3246 Mon Nov 15 00:45:46 2004  Ben Pfaff  <blp@gnu.org>
3247
3248         * barchart.c: (struct subcat) Make `label' member const to silence
3249         GCC warning with -Wwrite-strings.
3250
3251         * cartesian.c: (struct dataset) Ditto.
3252
3253         * case.c: Don't re-define NDEBUG if already defined.
3254         Add lots of comments.
3255
3256         * str.c: Fix includes.
3257
3258         * crosstabs.q: Fix includes.
3259
3260         * examine.q: Fix includes.  Fix GCC warning about unused
3261         variables.
3262         
3263         * frequencies.q: (stat macro) Removed and replaced where used by
3264         its expansion.
3265
3266         * list.q: Fix includes.
3267
3268         * oneway.q: Fix includes.
3269
3270         * piechart.c: Fix includes.  Only define M_PI if not already
3271         defined.
3272
3273         * sfm-read.c: (bswap) New function.
3274         (bswap_int32) Write in terms of bswap.
3275         (bswap_flt64) Ditto.
3276
3277         * str.c: (ds_data) Add external definition here, needed because
3278         str.h has only an `extern inline' version.
3279
3280         * value-labels.c: Fix includes.
3281
3282 Mon Nov 15 00:40:55 2004  Ben Pfaff  <blp@gnu.org>
3283
3284         Instead of providing a system or portable file writer with a raw
3285         case in the format needed for output, provide it with a regular
3286         case.  The writer takes care of any needed translation.
3287
3288         * aggregate.c: Adopt new scheme for AGGREGATE.
3289         (struct agr_proc) sfm_agr_case member removed.
3290         (write_case_to_sfm) Removed because the new interface is easier to
3291         use.
3292
3293         * get.c: Adopt new scheme for SAVE, XSAVE, EXPORT.
3294
3295         * pfm-write.c: Implement new scheme.
3296
3297         * sfm-write.c: Ditto.
3298
3299 Mon Nov 15 00:32:24 2004  Ben Pfaff  <blp@gnu.org>
3300
3301         Instead of treating `struct file_handle' as a class to subclass
3302         into data files, system files, and portable files, instead use it
3303         as a helper that coordinates access.  Now it is opaque, too.
3304
3305         This means that most references to a struct file_handle are now
3306         changed into references to one of struct dfm_reader, struct
3307         dfm_writer, struct sfm_reader, struct sfm_writer, struct
3308         pfm_reader, or struct pfm_writer, according to what's being read
3309         or written.
3310
3311         Most related changes are only worth summarizing briefly.
3312
3313         * dictionary.c: (dict_clear) Destroy aux data in deleted
3314         variables.
3315         (dict_clear_aux) New function.
3316         (dict_create_var) Initialize aux, aux_dtor.
3317         (dict_delete_var) Destroy aux data in deleted variable.
3318
3319         * file-handle.h: (struct fh_ext_class) Removed.
3320         (struct file_handle) Removed.
3321         (fh_init_files) Removed.
3322
3323         * file-handle.q: Changed references to a handle's `private' member
3324         to direct references.
3325         (struct private_file_handle) Renamed file_handle.
3326         Add next, open_cnt, type, open_mode, aux members.
3327         (struct file_handle_list) Removed.
3328         (extern var inline_file) Removed.
3329         (static var file_handles) Changed from file_handle_list * to
3330         file_handle *.
3331         (create_file_handle) Initialize new members.
3332         (fh_close_handle) Removed.
3333         (mode_name) New function.
3334         (fh_open) New function.
3335         (fh_close) New function.
3336         (fh_parse_file_handle) Renamed fh_parse().
3337
3338         * glob.c: (init_glob) Remove fh_init_files() call.
3339         
3340         * aggregate.c: use sfm_writer.
3341         (create_sysfile) Removed because the new interface is simpler.
3342         
3343         * apply-dict.c: Use sfm_reader.
3344
3345         * data-list.c: Use dfm_reader.
3346
3347         * file-type.c: Use dfm_reader.
3348
3349         * get.c: Use sfm_reader, sfm_writer, pfm_reader, pfm_writer.
3350
3351         * inpt-pgm.c: Use dfm_reader.
3352
3353         * print.c: Use dfm_writer.
3354
3355         * sysfile-info: Use sfm_reader.
3356
3357         * dfm-read.c: Adopt new file handle infrastructure.
3358
3359         * dfm-write.c: Ditto.
3360
3361         * pfm-read.c: Ditto.
3362         
3363         * pfm-write.c: Ditto.
3364
3365         * sfm-read.c: Ditto.
3366
3367         * sfm-write.c: Ditto.
3368         
3369 Mon Nov 15 00:31:44 2004  Ben Pfaff  <blp@gnu.org>
3370
3371         Break dictionary functions into separate header file.
3372
3373         * dictionary.h: New file.
3374
3375         * var.h: Moved dict_*() functions to dictionary.h.
3376
3377 Mon Nov 15 00:30:33 2004  Ben Pfaff  <blp@gnu.org>
3378
3379         Get rid of procedure-specific union in struct variable, using
3380         instead a void * pointer and a destructor function.
3381
3382         Most related changes are only worth brief summaries.
3383
3384         * crosstabs.q: Fix includes.  Use new struct var_range in lieu of
3385         old p.crs member in struct variable.
3386         
3387         * frequencies.q: Fix includes.  Use new struct var_freqs in lieu
3388         of old p.frq member in struct variable.
3389
3390         * histogram.c: (draw_histogram) Takes new freq_tab arg because
3391         it's no longer possible to grab this from var->p.frq.
3392
3393         * piechart.c: (draw_piechart) Ditto.
3394
3395         * group.c: (group_proc_get) New function.
3396
3397         * levene.c: Use group_proc_get() in lieu of old p.grp_data member
3398         in struct variable.
3399
3400         * oneway.q: Ditto.
3401
3402         * t-test.q: Ditto.
3403
3404         * main.c: (execute_command) Clear aux data in default_dict after
3405         each command.  (It's debatable whether this should be done.)
3406
3407         * matrix-data.c: Use new struct mxd_var in lieu of old p.mxd
3408         member in struct variable.
3409
3410         * means.q: Get rid of integer mode, which is not included in
3411         recent SPSS and was the only code that wanted per-variable private
3412         data.
3413
3414         * var.h: (struct crosstab_proc) Removed.
3415         (struct frequencies_proc) Removed.
3416         (struct list_proc) Removed.
3417         (struct get_proc) Removed.
3418         (struct means_proc) Removed.
3419         (struct matrix_data_proc) Removed.
3420         (struct match_files_proc) Removed.
3421         (lots of enums) Removed.
3422         (struct variable) Removed members `p', `get'.  Add member
3423         `aux_dtor'.
3424
3425         * vars-atr.c: (var_attach_aux) New function.
3426         (var_detach_aux) New function.
3427         (var_clear_aux) New function.
3428         (var_dtor_free) New function.
3429         (discard_variables) Use NULL instead of inline_file.
3430
3431 Fri Nov 12 10:07:11 WST 2004 John Darrington <john@darrington.wattle.id.au>
3432
3433         * value-labs.c  Fixed the implmentation of value_to_string, so 
3434         that it properly handles alpha values.
3435
3436         * oneway.q  Changed instances where labels were being probed manually, 
3437         to use the canonical {var,value}_to_string functions
3438
3439 Thu Nov 11 21:01:31 WST 2004 John Darrington <john@darrington.wattle.id.au>
3440
3441         * examine.q cartesian.c chart.[ch]   Added normal and detrended normal
3442         plots.  Changed the API of the cartesian plot to be a much lower level
3443         thing.
3444
3445 Sun Nov  7 17:25:04 WST 2004 John Darrington <john@darrington.wattle.id.au>
3446
3447         * examine.q Added some of the parametric calculations
3448
3449         * factor_stats.[ch]  Created
3450         
3451 Sat Nov  6 21:24:31 WST 2004 John Darrington <john@darrington.wattle.id.au>
3452
3453         * examine.q  Changed the definition of factors to be a composite, and
3454         dealt with the consequences.
3455
3456 Sat Nov  6 20:40:38 WST 2004 John Darrington <john@darrington.wattle.id.au>
3457
3458         * examine.q Fixed problem where examine wasn't dealing properly with 
3459         splits
3460
3461 Sat Nov  6 14:49:47 WST 2004 John Darrington <john@darrington.wattle.id.au>
3462
3463         * oneway.q Fixed problem where oneway wasn't dealing properly with 
3464         splits
3465
3466 Thu Nov  4 11:09:01 WST 2004 John Darrington <john@darrington.wattle.id.au>
3467
3468         * q2c.c examine.q  Fixed a bug (feature?) whereby arrays in the
3469         command which had settings didn't get the appropriate code
3470         generated.
3471
3472         * val.h value-labels.[ch] var-labs.c Added v*to_string functions
3473         to convert variables/values to strings.
3474
3475         * examine.q  Added framework for the EXAMINE command.
3476
3477 Mon Nov  1 12:46:17 WST 2004 John Darrington <john@darrington.wattle.id.au>
3478
3479         * q2c.c frequencies.q set.q t-test.q  Fixed the q2c parsing of DBL 
3480         subcommand types.  Changed frequencies.q to use it rather then the 
3481         custom parser.  Dealt with the consequences.  Added a test for NTILES
3482         subcommand of frequencies.
3483
3484 Sat Oct 30 09:16:29 WST 2004 John Darrington <john@darrington.wattle.id.au>
3485
3486         * oneway.q   Fixed up the behaviour when given missing values
3487
3488         * levene.c oneway.q Fixed a buglet with the levene statistic and
3489         incorporated the levene test into the oneway command.
3490
3491         * group.h  t-test.q  Moved the CMP_EQ and CMP_LE symbols out of 
3492         global scope, since they're only relevant to T-TEST
3493
3494 Fri Oct 29 17:39:03 WST 2004 John Darrington <john@darrington.wattle.id.au>
3495
3496         * group.c group.h group_proc.h levene.c oneway.q t-test.q
3497
3498         Made the t-test more consistent
3499         with the way it handles groups.  That is, it now uses a hash instead
3500         of an array of 2.  Also, made the levene.c file independent of the 
3501         implementation of the t-test.  So now levene should be fine for both
3502         t-test and anova.
3503
3504         * Added an oneway.q file for one way anova
3505
3506 Wed Jun  2 22:08:02 2004  Ben Pfaff  <blp@gnu.org>
3507
3508         * descript.c: (cmd_descriptives) Remove harmless but bogus test in
3509         STATISTICS parsing.
3510
3511 Mon May 31 20:45:24 2004  Ben Pfaff  <blp@gnu.org>
3512
3513         Fix memory leaks.
3514
3515         * data-list.c: (cmd_data_list) Free dls->delims on lossage.
3516         (data_list_trns_free) Free dls->delims.
3517
3518         * t-test.q: (tts_custom_pairs) Free vars.
3519         (ssbox_one_sample_init) Fix tab_vline() argument.
3520         (ssbox_independent_samples_init) Ditto.
3521         (trbox_paired_init) Ditto.
3522         (trbox_one_sample_init) Ditto.
3523
3524 Mon May 31 17:19:27 2004  Ben Pfaff  <blp@gnu.org>
3525
3526         Generalize casefiles to the extent that we can use them for
3527         sorting and other kinds of data transformations.  Change cases to
3528         be copy-on-write to improve memory efficiency in common cases.
3529         Every access to a member of a `struct ccase' was changed to be a
3530         call to a case_*() function, especially case_data(), case_num(),
3531         case_str(), or case_data_rw().  Many instances of a local variable
3532         named "case_num" were changed to "case_idx" as a consequence.
3533         Many `struct ccase *' were changed to actual `struct ccase'
3534         because of copying semantics of cases.  In several places there
3535         was a choice between updating debug code to work with the new ADTs
3536         or just deleting it because it was useless; I chose to delete it.
3537  
3538         * Makefile.am: (pspp_SOURCES) Add case.c, case.h.
3539
3540         * case.c: New file.
3541
3542         * case.h: New file.
3543
3544         * aggregate.c: (struct agr_proc) Change type of `sort' to
3545         sort_criteria *.  Add `break_vars', `break_var_cnt' members.
3546         Rename `vars' to `agr_vars', all references updated.  Change
3547         `agr_case' to type `struct ccase'.
3548         (cmd_aggregate) Deal with new members.  Use case_create(),
3549         sort_active_file_in_place(), sort_active_file_to_casefile().
3550         (agr_destroy) Deal with new members.
3551         (aggregate_single_case) Ditto.
3552         (dump_aggregate_info) Ditto.
3553         (initialize_aggregate_info) Ditto.
3554         (agr_to_active_file) Ditto.
3555         (presorted_agr_to_sysfile) Ditto.
3556         (sort_agr_to_sysfile) Removed.
3557
3558         * alloc.c: (out_of_memory) Make non-static.
3559
3560         * alloc.h: Prototype out_of_memory().
3561
3562         * casefile.c: Switched from a linked list in-memory representation
3563         to a two-level array-style representation.  The linked list was
3564         appropriate when we could stick a header onto cases, but that's no
3565         longer the case.  Also, the two-level array will allow for random
3566         in-memory access in case that's ever wanted.  Also added the
3567         concept of a `destructive casereader', one that destroys cases in
3568         the underlying casefile as they are read out.
3569         (macro CASES_PER_BLOCK) New macro.
3570         (struct casefile) New members `value_cnt', `case_list_size',
3571         `case_acct_size', `being_destroyed', `cases'.  Removed `head',
3572         `tail'.
3573         (struct casereader) Removed `cur'.  Added `destructive', `c'.
3574         (global var casefiles) Made static.
3575         (static var case_bytes) New var.
3576         (casefile_create) Takes a value count, not a case size in bytes,
3577         to conform to the case interface.  All callers updated.  Deal with
3578         new and removed members.
3579         (casefile_destroy) Deal with new and removed members.
3580         (casefile_sleep) New function.
3581         (casefile_get_case_size) Removed.
3582         (casefile_get_value_cnt) New function.
3583         (casefile_append) Rewritten to deal with new and removed members.
3584         (casefile_append_xfer) New function.
3585         (write_case_to_disk) Use case_serialize().
3586         (call_posix_fadvise) Removed because posix_fadvise64 segfaults.
3587         Couldn't figure out why.
3588         (casefile_to_disk) Don't call call_posix_fadvise.  Rewritten to
3589         deal with new and removed members.
3590         (merge) Removed.
3591         (merge_sort) Removed.
3592         (casefile_sort) Removed.
3593         (casefile_get_reader) Deal with new and removed members.
3594         (casefile_get_destructive_reader) New function.
3595         (reader_open_file) Make code more readable.  Create case for
3596         reader.
3597         (casereader_get_casefile) New function.
3598         (casereader_read) Deal with new and removed members.  Now returns
3599         a copy of the case, so that the caller is responsible for
3600         destroying the returned case.
3601         (casereader_read_xfer) New function.
3602         (casereader_destroy) Destroy reader's case.
3603         (test_casefile) Second arg is now a value count, all callers
3604         updated.  Now tests destructive readers too.
3605         (get_random_case) Deal with new case ADT.
3606         (write_random_case) Ditto.
3607         (read_and_verify_random_case) Ditto.
3608
3609         * crosstabs.q: Remove debug code.
3610
3611         * descript.q: (calc_descriptives) Deal with new case, casefile
3612         ADTs.
3613
3614         * dfm.c: (cmd_begin_data) There's no storage_source_class anymore.
3615
3616         * do-if.c: Remove unneeded header inclusion.
3617
3618         * expr-prs.c: Remove debug code.
3619
3620         * exprP.h: Remove debug code.
3621
3622         * flip.c: (flip_file) Use fseeko() if available.
3623
3624         * formats.c: Remove debug code.
3625
3626         * get.c: Remove debug code.
3627         (struct mtf_file) Change `input' from `union value *' to `struct
3628         ccase', all references updated.
3629
3630         * levene.c: (levene) Deal with new case, casefile ADTs.
3631
3632         * list.q: Remove debug code.
3633
3634         * loop.c: Remove debug code.
3635         
3636         * matrix-data.c: Remove debug code.
3637
3638         * means.q: Remove debug code.
3639
3640         * mis-val.c: Remove debug code.
3641
3642         * pfm-read.c: Remove debug code.
3643         (pfm_read_code) Change second arg from `union value *' to `struct
3644         ccase *', all references updated.
3645
3646         * recode.c: (string_to_long) Make first arg const.
3647         (convert_to_double) Ditto.
3648
3649         * repeat.c: Remove debug code.
3650
3651         * sample.c: Remove debug code.
3652
3653         * sfm-read.c: Remove debug code.
3654         (sfm_read_case) Change second arg from `union value *' to `struct
3655         ccase *'.
3656
3657         * sort.c: Redone in terms of casefiles.
3658         (enum sort_direction) Moved here from sort.h.
3659         (struct sort_criterion) New structure.
3660         (struct sort_criteria) New structure.
3661         (cmd_sort_cases) Rewritten.
3662         (prepare_to_sort_active_file) New function.
3663         (sort_active_file_in_place) New function.
3664         (sort_active_file_to_casefile) New function.
3665         (parse_sort) Renamed sort_parse_criteria(), rewritten & interface
3666         changed, all callers updated.
3667         (destroy_sort_cases_pgm) Renamed sort_destroy_criteria(),
3668         rewritten & interface changed, all callers updated.
3669         (sort_cases) Renamed sort_execute(), rewritten & interface
3670         changed, all callers updated.
3671         (struct internal_sort) Removed.
3672         (do_internal_sort) Rewritten, interface changed.
3673         (destroy_internal_sort) Removed.
3674         (compare_case_dblptrs) Use sort_criteria instead of sort_case_pgm.
3675         (struct initial_run) Removed; an initial run is now just a
3676         casefile.
3677         (compare_initial_runs) Rewritten.
3678         (struct external_sort) Changed almost completely.
3679         (do_external_sort) Rewritten, interface changed.
3680         (destroy_external_sort) Rewritten.
3681         [HAVE_MKDTEMP] (make_temp_dir) Removed.
3682         [!HAVE_MKDTEMP] (do_mkdir) Removed.
3683         [!HAVE_MKDTEMP] (make_temp_dir) Removed.
3684         (init_external_sort) Removed.
3685         (simulate_error) Removed.
3686         (rmdir_temp_dir) Removed.
3687         (get_temp_file_name) Removed.
3688         (open_temp_file) Removed.
3689         (close_temp_file) Removed.
3690         (remove_temp_file) Removed.
3691         (write_temp_file) Removed.
3692         (read_temp_file) Removed.
3693         (struct record_run) Change `record' from `struct case_lit *' to
3694         `struct ccase'.
3695         (struct initial_run_state) Remove `idx_to_fv', `free_list',
3696         `file_idx', `output_file'.  Add `run', casefile'.  Change
3697         `last_output' from `struct case_list *' to `struct ccase'.
3698         (write_initial_runs) Change interface, rewrite.
3699         (sort_sink_write) Renamed process_case(), changed interfaced,
3700         rewrote.
3701         (destroy_initial_run_state) Rewritten.
3702         (allocate_cases) Rewritten.
3703         (compare_record) Interface changed, rewritten.
3704         (start_run) Rewritten.
3705         (end_run) Rewritten.
3706         (output_record) Rewritten.
3707         (grab_case) Removed.
3708         (release_case) Removed.
3709         (struct merge_case) Change `cases' from double pointer to single
3710         pointer.
3711         (merge) Deal with new case and casefile ADTs.
3712         (struct run) Removed.
3713         (merge_once) Rewritten, interface changed.
3714         (fill_run_buffer) Removed.
3715         (sort_sink_make_source) Removed.
3716         (sort_sink_class) Removed.
3717         (struct sort_source_aux) Removed.
3718         (sort_source_read_helper) Removed.
3719         (sort_source_read) Removed.
3720         (read_sort_output) Removed.
3721         (read_internal_sort_output) Removed.
3722         (read_external_sort_output) Removed.
3723         (sort_source_destroy) Removed.
3724         (sort_source_class) Removed.
3725
3726         * sort.h: (struct sort_cases_pgm) Removed.
3727         (enum sort_direction) Moved to sort.c.
3728
3729         * t-test.q: (calculate) Deal with new case, casefile ADTs.
3730
3731         * tab.c: Remove debug code.
3732
3733         * var-labs.c: Remove debug code.
3734
3735         * var.h: (struct ccase) Removed.
3736         (struct case_list) Removed.
3737
3738         * vars-atr.c: (discard_variables) Use free_case_source().
3739
3740         * vars-prs.c: (parse_vs_variable) Make arg const.
3741         (parse_dict_variable) Ditto.
3742         (parse_variables) Make struct dictionary * arg const.
3743         (parse_var_set_vars) Make struct var_set * arg const.
3744         (struct var_set) Add const to some of the function pointers' args.
3745         (var_set_get_cnt) Make arg const.
3746         (var_set_get_var) Make first arg const.
3747         (var_set_lookup_var) Make first arg const.
3748         (dict_var_set_get_cnt) Make arg const.
3749         (dict_var_set_get_var) Make first arg const.
3750         (dict_var_set_lookup_var) Make first arg const.
3751         (var_set_create_from_dict) Make arg const.  Add cast to aux
3752         assignment.
3753         (struct array_var_set) Add const to var member.
3754         (array_var_set_get_cnt) Make arg const.
3755         (array_var_set_get_var) Make first arg const.
3756         (array_var_set_lookup_var) Make first arg const.
3757         (var_set_create_from_array) Make first arg const.  Insert cast.
3758
3759         * vfm.c: (struct write_case_data) Change trns_case, sink_case
3760         members from `struct ccase *' to `struct ccase'.
3761         (static var lag_queue) Change from double to single pointer.
3762         (procedure) Optimize trivial case.
3763         (internal_procedure) Deal with changed case, case_source ADTs.
3764         (create_trns_case) Changed interface, rewrote.
3765         (open_active_interface) Initialize modified lag queue.
3766         (write_case) Deal with changed case ADT.
3767         (lag_case) Deal with modified lag queue.
3768         (close_active_file) Destroy modified lag queue.
3769         Deal with changed case_source, case_sink ADTs.
3770         (destroy_storage_stream_info) Make null arg into no-op.
3771         (storage_sink_make_source) Set aux in created source.
3772         (storage_source_read) Deal with changed case, casefile ADTs.
3773         (storage_source_create) New function.
3774         (lagged_case) Rewrite.
3775         (free_case_source) New function.
3776         (free_case_sink) Rewrite.
3777         (struct split_aux_data) Changed prev_case from `struct ccase *' to
3778         `struct ccase'.
3779         (procedure_with_splits) Deal with changed prev_case.
3780         (procedure_with_splits_callback) Ditto.
3781         (multipass_split_aux_data) Changed prev_case from `struct ccase *' to
3782         `struct ccase'.
3783         (multipass_procedure_with_splits) Deal with changed prev_case.
3784         (multipass_split_callback) Ditto.
3785         
3786         
3787 Mon May 31 17:19:06 2004  Ben Pfaff  <blp@gnu.org>
3788
3789         The workspace idea didn't work out.
3790
3791         * Makefile.am: (pspp_SOURCES) Remove workspace.c, workspace.h.
3792         
3793         * workspace.c: Removed.
3794
3795         * workspace.h: Removed.
3796
3797 Sun May 30 18:35:19 2004  Ben Pfaff  <blp@gnu.org>
3798
3799         Fully implement arbitrary delimiters on DATA LIST, extending the
3800         half implementation that was already there.
3801
3802         * data-list.c: (struct data_list_pgm) Remove `delim', add
3803         `delims', `delim_cnt'.
3804         (cmd_data_list) Initialize new members.  Parse delimiters and
3805         clean up code a bit.
3806         (cut_field) Extract fields with arbitrary delimiters.  Also, fix
3807         handling of leading commas.
3808         (read_from_data_list_fixed) Expand tabs.  Adapt to new DFM
3809         interfaces.
3810         (read_from_data_list_free) Adapt to new DFM interfaces.
3811         (read_from_data_list_list) Ditto.
3812         (repeating_data_trns_proc) Ditto.
3813
3814         * dfm.c: Split up reader and writer into separate code, because
3815         they do different things.  Use struct string instead of explicit
3816         allocation code, for clarity.
3817         (enum dfm_reader_flags) New enum.
3818         (struct dfm_fhuser_ext) Removed.
3819         (struct dfm_reader_ext) New.
3820         (get_reader) New function, used by just about all the reader
3821         functions.
3822         (dfm_close) Removed.
3823         (close_reader) New function.
3824         (dfm_open_for_reading) Rewrite initialization of dfm_fhuser_ext.
3825         (dfm_open_for_writing) Ditto.
3826         (macro force_line_buffer_expansion) Removed.
3827         (count_tabs) Removed.
3828         (tabs_to_spaces) Removed.
3829         (read_record) Deal with new dfm_reader_ext.  Use struct string
3830         functions.  Don't convert tabs to spaces.
3831         (dfm_eof) New function.
3832         (dfm_get_record) Changed interface, rewrote.
3833         (dfm_expand_tabs) New function.
3834         (dfm_fwd_record) Renamed dfm_forward_record(), updated to new
3835         dfm_reader_ext, rewritten.
3836         (dfm_bkwd_record) Renamed dfm_reread_record(), updated to new
3837         dfm_reader_ext, rewritten.
3838         (dfm_set_record) Removed in favor of dfm_forward_columns().
3839         (dfm_forward_columns) New function.
3840         (dfm_get_cur_col) Renamed dfm_column_start, updated to new
3841         dfm_reader_ext, rewritten.
3842         (static var dfm_r_class) Use close_reader for the destructor.
3843         (struct dfm_writer_ext) New.
3844         (dfm_put_record) Updated to new dfm_writer_ext, rewritten.  Uses
3845         bounce buffer now instead of local allocation.
3846         (close_writer) New function.
3847         (static var dfm_writer_ext) Use close_writer for destructor.
3848         (cmd_begin_data) Adapt to new dfm_reader_ext.
3849
3850         * file-handle.q: Add support for per-file tab width.
3851         (struct private_file_handle) Add tab_width member.
3852         (q2c specifications) Add tabwidth subcommand.
3853         (cmd_file_handle) Put parsed tab width into private_file_handle.
3854         (create_file_handle) Set default tab width.
3855         (handle_get_tab_width) New function.
3856
3857         * file-type.c: (file_type_source_read) Adapt to new DFM interface.
3858
3859         * inpt-pgm.c: (reread_trns_proc) Ditto.
3860
3861         * matrix-data.c: (context) Ditto.
3862         (another_token) Ditto.
3863         (mget_token) Ditto.
3864         (force_eol) Ditto.
3865
3866 Sun May 30 18:33:59 2004  Ben Pfaff  <blp@gnu.org>
3867
3868         * casefile.c: (casefile_destroy) Fix memory leak by freeing
3869         cf->filename.
3870         (casereader_destroy) Don't close file descriptor -1.
3871
3872         * recode.c: (cmd_recode) Fix memory leak.
3873
3874         * set.q: (q2c specifications) Fix typo in user message.
3875
3876         * str.c: (st_bare_pad_len_copy) Change memcpy to memmove to avoid
3877         undefined behavior for overlapping arguments.
3878
3879 Sun May 30 18:31:48 2004  Ben Pfaff  <blp@gnu.org>
3880
3881         * casefile.c: valgrind doesn't implement posix_fadvise() yet, so
3882         don't call it when we're running under valgrind.
3883         (call_posix_fadvise) New function.
3884         (casefile_to_disk) Use call_posix_fadvise().
3885         (reader_open_file) Ditto.
3886         
3887 Sun May 30 18:20:12 2004  Ben Pfaff  <blp@gnu.org>
3888
3889         Update our string ADTs, struct string and struct len_string.  Get
3890         rid of pool support, which was largely unused.  Rename lots of
3891         functions to have more obvious or consistent names.
3892         
3893         * ascii.c: Get rid of ascii_pool.  It was only used for string
3894         allocations.
3895         (ascii_open_global) Don't create ascii_pool.
3896         (ascii_close_driver) Don't destroy ascii_pool.
3897         (ascii_postopen_driver) Don't use pool.
3898         (ascii_close_driver) Destroy strings manually.
3899
3900         * str.c: (ds_create) Remove pool argument, all references updated.
3901         (ds_init) Ditto.
3902         (ds_replace) Remove pool support, make more efficient when we
3903         don't need to reallocate.
3904         (ds_destroy) Remove pool support.
3905         (ds_rpad) New function.
3906         (ds_size) Renamed ds_capacity(), all references updated.
3907         (ds_value) Renamed ds_c_str(), all references updated.
3908         (ds_concat) Renamed ds_puts(), all references updated.
3909         (ds_concat_buffer) Renamed ds_concat(), all references updated.
3910         (ds_putchar) Renamed ds_putc(), all references updated.
3911         (ds_getline) Renamed ds_gets(), all references updated.
3912         (ls_create) Remove pool argument, all references updated.
3913         (ls_create_buffer) Ditto.
3914         (ls_destroy) Removed pool support.
3915         (ls_value) Renamed ls_c_str(), all references updated.
3916
3917         * str.h: (ls_length) [__GNUC__] Add inline version.
3918         (ls_c_str) [__GNUC__] Add inline version.
3919         (ls_end) [__GNUC__] Add inline version.
3920         (struct string) Remove pool member.  Rename `size' to `capacity',
3921         all references updated.
3922
3923         * tab.c: (text_format) Instead of using pool argument to
3924         ls_create_buffer(), call pool_register() on allocated data.
3925
3926 Mon Apr 26 22:40:07 2004  Ben Pfaff  <blp@gnu.org>
3927
3928         We're abusing the current ASCII driver by telling it to allocate a
3929         9999-line, 9999-character page in the tests.  This causes some
3930         systems to curl up and die because it allocates 20 MB of
3931         contiguous RAM.  This change alleviates at least part of the
3932         problem.  It is mostly a stop-gap until the new output system is
3933         ready.
3934         
3935         * ascii.c: (struct line) New structure.
3936         (struct ascii_driver_ext) Remove `page', `page_size', `line_len',
3937         `line_len_size', `n_output' members.  Add `lines', `lines_cap'.
3938         (ascii_preopen_driver) Initialize new members, not old ones.
3939         (ascii_close_driver) Destroy new members, not old ones.
3940         (ascii_open_page) Allocate new members, not old ones.
3941         (expand_line) Allocate room in line.
3942         (draw_line) Use new members.
3943         (ascii_line_horz) Ditto.
3944         (ascii_line_vert) Ditto.
3945         (ascii_line_intersection) Ditto.
3946         (text_draw) Ditto.
3947         (output_lines) Ditto.
3948         (ascii_close_page) Ditto.
3949
3950 Sun Apr 25 23:40:15 2004  Ben Pfaff  <blp@gnu.org>
3951
3952         * matrix.c: Dead code.  Removed.
3953
3954         * matrix.h: Dead code.  Removed.
3955
3956 Fri Apr 16 23:59:51 2004  Ben Pfaff  <blp@gnu.org>
3957
3958         Contrary to what I'd always understood, there is an efficient
3959         algorithm for deletion from a hash table populated via linear
3960         probing.  This change implements it.
3961         
3962         * hash.c: (hsh_rehash) Probe in increasing order.
3963         (hsh_probe) Ditto.
3964         (locate_matching_entry) Ditto.
3965         (hsh_delete) Use Knuth's Algorithm 6.4R for deletion.
3966
3967 Tue Apr 13 19:24:15 2004  Ben Pfaff  <blp@gnu.org>
3968
3969         * moments.c (calc_moments): Adjust calculation of kurtosis to
3970         avoid subtracting huge numbers from huge numbers, on Michael
3971         Kiefte's advice.
3972
3973 Sun Apr 11 14:22:12 2004  Ben Pfaff  <blp@gnu.org>
3974
3975         Rework moments routines for improved numerical stability based on
3976         Michael Kiefte's advice.  Any bugs or remaining numerical problems
3977         are still mine though.
3978
3979         There is now a struct moments1 for use with one-pass moments.  It
3980         uses a provisional means algorithm as an attempt to improve
3981         accuracy of higher moments.  The older struct moments now only
3982         handles two-pass moments.
3983         
3984         * aggregate.c: Use moments1 instead moments.
3985
3986         * descript.c: Revert previous change, which is no longer needed
3987         due to the moments revision.
3988
3989         * moments.c: (calc_moments) New function for calculating variance,
3990         skewness, kurtosis.
3991         (moments_pass_one) Only accumulate weights bigger than zero.
3992         (moments_calculate) Allow calculating the mean on pass one, others
3993         require pass two.  Implement in terms of calc_moments().
3994         (struct moments1) New structure.
3995         (init_moments1) New function.
3996         (moments1_clear) Ditto.
3997         (moments1_create) Ditto.
3998         (moments1_add) Ditto.
3999         (moments1_calculate) Ditto.
4000         (moments1_destroy) Ditto.
4001         (cmd_debug_moments) Deal with `struct moments' or `struct
4002         moments1' as requested by user.
4003
4004 Sun Apr 11 14:21:55 2004  Ben Pfaff  <blp@gnu.org>
4005
4006         * Makefile.am (pspp_SOURCES): Remove debug.c.
4007
4008         * debug.c: Removed.  It was empty anyway.
4009
4010 Fri Apr  9 20:04:49 2004  Ben Pfaff  <blp@gnu.org>
4011
4012         * descript.c (calc_descriptives): Fix assert failure when only
4013         MOMENT_MEAN is needed.
4014
4015 2004-04-09  Michael Kiefte  <mkiefte@dal.ca>
4016
4017         * descript.c: 
4018
4019         fixed problem with parsing in match_statistic() causing
4020         "DESCRIPTIVE STAT=MEAN." to barf.
4021
4022         "MEAN" is now default if "SORT" given without specification.
4023
4024         Fixed infinite loop with "DESCRIPT GIBBERISH=ALL."  Parsing is
4025         generally less forgiving of syntax errors: better to have it do
4026         nothing and type it in again then to not know what it actually did
4027         instead.  
4028
4029         z-score transformation now checks score for user-missing values
4030         and checks std_dev for SYSMIS.
4031
4032 2004-04-06  Michael Kiefte  <mkiefte@dal.ca>
4033
4034         * aggregate.c, crosstabs.q, descript.c, dictionary.c, frequencies.q, levene.c, t-test.q, var.h: 
4035         Changed dict_get_case_weight() to accept an additional int * flag
4036         to complain about system-missing, user-missing, zero, or negative
4037         weights and updated existing functions to pass int * to
4038         dict_get_case_weight().
4039
4040 2004-04-05  jmd  <jmd@gnu.org>
4041
4042         * main.c: Fixed configuration problems with gsl
4043
4044         * t-test.q: Fixed some problems encountered when compiling under Cygwin
4045
4046 2004-04-03  blp  <blp@gnu.org>
4047
4048         * lexer.c, ChangeLog:
4049         Fix infinite loop on comment at end of file, add test.
4050
4051 2004-04-03  jmd  <jmd@gnu.org>
4052
4053         * 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:
4054         Fixed the calculation of percentiles and added --syntax and --algorithm options
4055
4056 Sat Apr  3 11:43:37 2004  Ben Pfaff  <blp@gnu.org>
4057
4058         * lexer.c: (lex_skip_comment) Handle end-of-file correctly (I
4059         hope).
4060
4061 Sat Apr  3 15:00:18 WST 2004 John Darrington <john@darrington.wattle.id.au>
4062
4063         * frequencies.q:  Fixed the calculation of percentiles
4064
4065         * Makefile.am:  Added the --ansi flag and dealt with the
4066         consequences.  Added some entries to PSPP_sources so that
4067         make distcheck would pass
4068
4069         * cmdline.c:   Added the --syntax and --algorithm options
4070
4071         * q2c.c:  Added an implicit /ALGORITHM subcommand to everything.
4072
4073 Fri Apr  2 11:25:22 WAST 2004 John Darrington <john@darrington.wattle.id.au>
4074
4075         * t-test.q, levene.c, levene.h  Converted t-test (incl levene) to 
4076         use the new multipass_split_... mechanism.
4077
4078 Wed Mar 31 22:36:22 2004  Ben Pfaff  <blp@gnu.org>
4079
4080         * frequencies.q: (calc_stats) Use moments data structure and
4081         calc_seskew(), calc_sekurt() functions.
4082
4083         * set.q main.c settings.h Added support for --syntax and --algorithm 
4084         options
4085
4086 Tue Mar 30 22:04:19 2004  Ben Pfaff  <blp@gnu.org>
4087
4088         * vfm.c: Had to get last call to multipass_split_output() inside
4089         open_active_file()/close_active_file() pairing, so introduce new
4090         function.
4091         (internal_procedure) Move procedure() code here, except for calls
4092         to open_active_file() and close_active_file().
4093         (procedure) Wrap open_active_file() and close_active_file() around
4094         internal_procedure().
4095         (multipass_procedure_with_splits) Wrap open_active_file() and
4096         close_active_file() around internal_procedure().
4097
4098 Tue Mar 30 22:01:57 2004  Ben Pfaff  <blp@gnu.org>
4099
4100         * descript.c: (cmd_descriptives) Free `vars' to avoid memory leak.
4101
4102 Mon Mar 29 16:26:40 2004  Ben Pfaff  <blp@gnu.org>
4103
4104         * debug.c: Removed.  Moved cmd_debug_evaluate() into expr-evl.c.
4105
4106         * expr-evl.c: (cmd_debug_evaluate) Moved here from debug.c.
4107
4108 Mon Mar 29 16:03:08 2004  Ben Pfaff  <blp@gnu.org>
4109
4110         * algorithm.c: By default turn off some of the more expensive
4111         assertions.
4112         (expensive_assert) New macro which expands to assert if
4113         EXTRA_CHECKS is defined, to nothing otherwise.
4114         (unique) Use expensive_assert().
4115         (binary_search) Ditto.
4116         (push_heap) Ditto.
4117         (pop_heap) Ditto.
4118         (make_heap) Ditto.
4119         (sort_heap) Ditto.
4120
4121         * command.c: (conflicting_3char_prefixes) Words that are the same
4122         don't cause conflicts when they are abbreviated to the first three
4123         letters.
4124
4125         * expr-evl.c: (CONCAT_func) Fix memory leak by incrementing struct
4126         nonterm_node's n earlier.
4127         (generic_str_func) Ditto.
4128         
4129 Mon Mar 29 15:32:17 2004  Ben Pfaff  <blp@gnu.org>
4130
4131         Add support for multipass procedures.  Rewrite DESCRIPTIVES to
4132         test multipass support, take advantage of new moments
4133         calculation, and to not be such crappy code.  Get rid of q2c
4134         processing for DESCRIPTIVES.
4135
4136         * vfm.c: (struct multipass_split_aux_data) New structure.
4137         (multipass_procedure_with_splits) New function.
4138         (multipass_split_callback) New function.
4139         (multipass_split_output) New function.
4140         * descript.q: Removed.
4141
4142         * descript.c: New file.
4143
4144         * var.h: Removed descriptives enums.
4145         (struct descriptives_proc) Removed.
4146         (struct variable) Removed p.dsc.
4147
4148         * Makefile.am: (q_sources_c) Remove descript.c.
4149         (q_sources_q) Removed descript.q.
4150         
4151 Mon Mar 29 15:31:55 2004  Ben Pfaff  <blp@gnu.org>
4152
4153         New manager for keeping track of used workspace.
4154         
4155         * workspace.c: New file.
4156
4157         * workspace.h: New file.
4158
4159         * Makefile.am: (pspp_SOURCES) Add workspace.c, workspace.h.
4160
4161         * sort.c: (do_internal_sort) Use workspace_malloc().
4162         (destroy_internal_sort) Use workspace_free().
4163
4164 Mon Mar 29 15:31:08 2004  Ben Pfaff  <blp@gnu.org>
4165
4166         New `struct casefile' for managing sets of cases.
4167
4168         * casefile.c: New file.
4169
4170         * casefile.h: New file.
4171
4172         * command.def: Add DEBUG CASEFILE command.
4173
4174         * Makefile.am: (pspp_SOURCES) Add casefile.c, casefile.h.
4175
4176         * sort.c: (sort_cases) Move logic for sending storage file to disk
4177         into do_external_sort().
4178         (struct internal_sort) Use an array of ccase pointers instead of a
4179         case_list.
4180         (do_internal_sort) Rewrite to handle casefiles.
4181         (compare_case_list) Removed.
4182         (compare_cases) New function.
4183         (compare_case_dblptrs) New function.
4184         (read_internal_sort_output) Deal with new struct internal_sort.
4185
4186         * vfm.c: (static var workspace_overflow) Removed.
4187         (struct storage_stream_info) Removed all the members.  Added
4188         struct casefile * member.
4189         (storage_sink_open) Use casefile.
4190         (open_storage_file) Removed.
4191         (write_storage_file) Removed.
4192         (storage_to_disk) Removed.
4193         (destroy_storage_stream_info) Use casefile.
4194         (storage_sink_write) Use casefile.
4195         (storage_sink_make_source) Use casefile.
4196         (storage_source_count) Use casefile.
4197         (storage_source_read) Use casefile.
4198         (storage_source_on_disk) Removed.
4199         (storage_source_get_cases) Removed.
4200         (storage_source_set_cases) Removed.
4201         (storage_source_get_casefile) New function.
4202         
4203 Mon Mar 29 15:30:09 2004  Ben Pfaff  <blp@gnu.org>
4204
4205         New `struct moments' for calculating moments.
4206
4207         * stats.c: Removed.
4208
4209         * stats.h: Removed.
4210
4211         * moments.c: New file.
4212
4213         * moments.h: New file.
4214
4215         * command.def: Add DEBUG MOMENTS command.
4216
4217         * Makefile.am: (pspp_SOURCES) Add moments.c, moments.h.  Remove
4218         stats.c, stats.h.
4219
4220         * aggregate.c: Modify AGGREGATE to use the new moments
4221         calculation, even if not in such a great way.
4222         (struct agr_var) Add `moments' member.
4223         (parse_aggregate_functions) Set `moments' member to null.
4224         (agr_destroy) Destroy `moments' member.
4225         (accumulate_aggregate_info) Use `moments' for standard deviation.
4226         (dump_aggregate_info) Ditto.
4227         (initialize_aggregate_info) Create or clear `moments'.
4228
4229         * misc.h: Add pow2(), pow3(), pow4() functions in place of sqr(),
4230         cube(), pow4() that were in stats.h.  All references updated.
4231
4232         * crosstabs.q: stats.h had chi-square significance functions.  Use
4233         GSL instead.
4234         (display_chisq) Use gsl_cdf_chisq_Q() instead of chisq_sig().
4235
4236         * expr-evl.c: (expr_evaluate) Use moments_of_values() for
4237         OP_CFVAR, OP_MEAN, OP_SD, OP_VARIANCE.
4238                 
4239 Fri Mar 26 14:21:23 2004  Ben Pfaff  <blp@gnu.org>
4240
4241         * dictionary.c: (dict_compact_values) Compacted values need to
4242         start off from 0.
4243
4244 Fri Mar 26 00:54:57 2004  Ben Pfaff  <blp@gnu.org>
4245
4246         * var-labs.c: (cmd_variable_labels) For compatibility, don't allow
4247         `/' at start.  Check return value of parse_variables() for error
4248         return.
4249
4250 Fri Mar 26 00:19:27 2004  Ben Pfaff  <blp@gnu.org>
4251
4252         Revamp expressions: make the code a little nicer, and fix bugs
4253         found in testing.
4254         
4255         * expr-evl.c: (expr_evaluate) Make expression argument const.
4256         Support OP_ADD, OP_SUB, OP_MUL, OP_DIV instead of OP_PLUS, OP_MUL.
4257         OP_POW is missing for arg 2 <= 0.  OP_LOG is natural log, not
4258         base-10 log.  Fix OP_ANY, OP_ANY_STRING, OP_RANGE, OP_RANGE_STRING
4259         off-by-ones.  Add OP_MAX_STRING, OP_MIN_STRING.  Fix OP_TIME_HMS,
4260         OP_DATE_WKYR boundary conditions.  Add OP_CTIME_DAYS,
4261         OP_CTIME_HOURS, OP_CTIME_MINUTES, OP_CTIME_DAYS, OP_CTIME_SECONDS.
4262         Support OP_INDEX_2, OP_INDEX_3, OP_RINDEX_2, OP_RINDEX_3 instead
4263         of OP_INDEX, OP_INDEX_OPT, OP_RINDEX, OP_RINDEX_OPT.  Merge
4264         OP_LPAD_OPT into OP_LPAD, OP_RPAD_OPT into OP_RPAD, OP_LTRIM_OPT
4265         into OP_LTRIM, OP_RTRIM_OPT into OP_RTRIM, OP_NUMBER_OPT into
4266         OP_NUMBER.  Fix OP_RTRIM fragility.  Support OP_SUBSTR_2,
4267         OP_SUBSTR_3 instead of OP_SUBSTR, OP_SUBSTR_OPT.  Remove OP_INV.
4268         Simplify OP_SYSMIS.  Remove OP_STR_MIS.
4269
4270         * expr-opt.c: (optimize_expression) Rewrite.
4271         (macro n0) Removed.
4272         (macro n1) Removed.
4273         (macro n2) Removed.
4274         (macro s0) Removed.
4275         (macro s0l) Removed.
4276         (macro s1) Removed.
4277         (macro s1l) Removed.
4278         (macro s2) Removed.
4279         (macro s2l) Removed.
4280         (macro s) Removed.
4281         (macro sl) Removed.
4282         (eq_num_con) New function.
4283         (optimize_tree) New function.
4284         (macro rnc) Removed.
4285         (macro frnc) Removed.
4286         (str_search) Add const to string params.
4287         (str_rsearch) Ditto.
4288         (evaluate_tree_no_missing) Renamed from evaluate_tree.  Add num[],
4289         str[], str_len[] locals to substitute for most of removed macros.
4290         Support OP_ADD, OP_SUB, OP_MUL, OP_DIV instead of OP_PLUS, OP_MUL.
4291         Removed support for missing values because we're never called with
4292         missing values.  Use set_number() or set_number_errno() instead of
4293         rnc or frnc.  Removed any stuff that caused trouble in testing.
4294         We can re-add it later if it really slows anything.  Fix some
4295         random problems.
4296         (evaluate_tree_with_missing) Not yet supported.  To be added later
4297         if it's important.
4298         (repl_num_con) Removed.
4299         (collapse_node) New function.
4300         (force_repl_num_con) Removed.
4301         (set_number) New function.
4302         (set_number_errno) New function.
4303         (repl_str_con) Removed.
4304         (set_string) New function.
4305         (yrmoda) Tighten boundary conditions.  Adopt 2030 cut-off for
4306         2-digit years.
4307         (dump_node) No special case for OP_AND, OP_OR.
4308
4309         * expr-prs.c: (expr_prs) Honor EXPR_NO_OPTIMIZE bit.  Rewrite.
4310         (expr_get_type) New function.
4311         (type_check) Rewrite.
4312         (type_coercion) New function.
4313         (struct operator) New structure.
4314         (match_operator New function.
4315         (parse_binary_operators) New function.
4316         (parse_inverting_unary_operator) New function.
4317         (parse_or) Rewritten.
4318         (parse_and) Rewritten.
4319         (parse_not) Rewritten.
4320         (parse_rel) Rewritten.
4321         (parse_add) Rewritten.
4322         (parse_mul) Rewritten.
4323         (parse_neg) Rewritten.
4324         (parse_exp) Rewritten.
4325         (parse_sysvar) Add $TRUE, $FALSE system variables.
4326         Get $LENGTH, $WIDTH from get_viewlength(), get_viewwidth().
4327         (parse_primary) Use allocate_var_node(), allocate_num_con(),
4328         allocate_str_con().
4329         (struct function) Remove desc, change `func' prototype.
4330         (unary_func) Remove special cases.
4331         (MISSING_func) Reduce to unary_func() that just returns a boolean.
4332         (SYSMIS_func) Handle SYSMIS((x)) like SYSMIS(x).
4333         (VALUE_func) Use allocate_var_node().
4334         (nary_num_func) Allow MIN and MAX for strings.
4335         Use allocate_var_node().  Properly clean up.
4336         Fix return type.
4337         (generic_str_func) Use local table instead of removed `desc'
4338         member.  Mostly rewrite.
4339         (get_num_args) Revise error message.
4340         (parse_function) Return EXPR_ERROR, not 0 on error.
4341         (macro op) Removed.
4342         (macro varies) Removed.
4343         (ops[]) Use expr.def.
4344         (free_node) Do nothing if node is null.
4345         (allocate_num_con) New function.
4346         (allocate_str_con) New function.
4347         (allocate_var_node) New function.
4348         (allocate_binary_nonterminal) New function.
4349         (append_nonterminal_arg) Removed.
4350         (static var func_tab[]) Revised.
4351         (expr_debug_print_postfix) Make parameter const.
4352         Use printf() instead of debug_printf().
4353
4354         * expr.def: New file.
4355         
4356         * expr.h: Change PXP_* to EXPR_*, all references updated.  Also
4357         use named enum instead of unnamed, all references updated.  Add
4358         EXPR_ANY, EXPR_NO_OPTIMIZE.
4359
4360         * exprP.h: Remove EX_*.  Add DEFINE_OPERATOR.  Use expr.def
4361         instead of defining OP_* directly.
4362         (macro IS_TERMINAL) New macro.
4363         (macro IS_NONTERMINAL) New macro.
4364         (enum OP_NO_FLAGS) New.
4365         
4366 Fri Mar 26 00:18:01 2004  Ben Pfaff  <blp@gnu.org>
4367
4368         * error.c: (err_assert_fail) msg variable needs to be non-const.
4369
4370 Fri Mar 26 00:17:24 2004  Ben Pfaff  <blp@gnu.org>
4371
4372         * debug.c: (cmd_debug_evaluate) Rewrite.
4373
4374 Fri Mar 26 00:15:13 2004  Ben Pfaff  <blp@gnu.org>
4375
4376         Fix some CROSSTABS bit rot stupidity.
4377
4378         * crosstabs.q: Reorder the CELLS subcommands for compatibility.
4379         (internal_cmd_crosstabs) Initializes cells[] correctly.
4380         (float_M_suffix) Rename format_cell_entry(), change prototype,
4381         rewrite.
4382         (display_crosstabulation) Fix cell formatting.
4383
4384 Fri Mar 26 00:14:09 2004  Ben Pfaff  <blp@gnu.org>
4385
4386         Make lex_rest_of_line(), lex_entire_end() not discard lines.  Have
4387         to call lex_discard_line() to do that.
4388
4389         * command.c: (run_command) Call lex_discard_line() after
4390         lex_rest_of_line().
4391
4392         * lexer.c: (lex_entire_end) Change behavior.
4393         (lex_rest_of_line) Change behavior.  Return const char *.
4394         (lex_discard_line) Don't clear getl_buf, don't emit message.
4395
4396         * main.c: (handle_error) Emit message here.
4397
4398         * repeat.c: (internal_cmd_do_repeat) Use lex_discard_line()
4399         instead of lex_entire_line().
4400
4401         * str.c: (mm_find_reverse) Make length params size_t.  Rewrite.
4402
4403         * title.c: (get_title) Call lex_discard_line() after
4404         lex_rest_of_line().
4405         (cmd_file_label) Ditto.
4406         (cmd_document) Deal with const char * return value.
4407
4408 Fri Mar 26 00:10:16 2004  Ben Pfaff  <blp@gnu.org>
4409
4410         Removed REMARK command.
4411
4412         * command.c: (extract_prefix) Removed.
4413         (output_line) Removed.
4414         (cmd_remark) Removed.
4415
4416         * command.def: Remove REMARK.
4417
4418 Fri Mar 26 00:08:38 2004  Ben Pfaff  <blp@gnu.org>
4419
4420         Added abort() after lots of assert(0) invocations to avoid some
4421         compiler warnings.  We really need a NOT_REACHED macro.
4422
4423 Tue Mar 23 08:00:42 WAST 2004 John Darrington <john@darrington.wattle.id.au>
4424
4425         * sort.c: Added missing call to temp_file_close.  Changed error 
4426         messages to warnings.
4427
4428         * set.q: Improved setting of set_view{length,width} to be more tolerant
4429         of buggy OSes.
4430
4431 Sun Mar 21 10:11:14 WST 2004 John Darrington <john@darrington.wattle.id.au>
4432
4433         * val-labs.c: Fixed a bug where PSPP would crash, if VALUE LABELS was
4434         used with incorrect syntax.
4435
4436         * error.c, error.h et al:  Overridden definition of assert for a
4437         custom one.
4438
4439         * test-q.c: Fixed a buglet where it would crash if no /VARIABLES
4440         subcommand was given when it ought to have been.
4441
4442 Sat Mar 20 22:19:08 2004  Ben Pfaff  <blp@gnu.org>
4443
4444         * tab.c: (tab_vline) Fix assertions to respect row_ofs and
4445         col_ofs.
4446         (tab_hline) Ditto.
4447         (tab_box) Ditto.
4448         (tab_joint_text) Ditto.
4449
4450 Sat Mar 20 17:57:23 2004  Ben Pfaff  <blp@gnu.org>
4451
4452         * levene.c: Add #include.
4453
4454         * set.q: (set_viewport) Add `int' argument to make its prototype
4455         correct for signal().
4456
4457 Sat Mar 20 15:35:17 2004  Ben Pfaff  <blp@gnu.org>
4458
4459         * expr-evl.c: (expr_evaluate) Assert that `c' is nonzero before
4460         using it.
4461
4462 Sat Mar 20 15:18:16 2004  Ben Pfaff  <blp@gnu.org>
4463
4464         Changed DFM from open-at-first-access to explicit-open.  Before,
4465         calling dfm_get_record() or dfm_put_record() would automatically
4466         open the file.  Now, you have to call dfm_open_for_reading() or
4467         dfm_open_for_writing() explicitly.  This makes it possible to
4468         check permissions, file existence, etc. earlier.
4469
4470         Also made struct file_handle more opaque, and clean up in general.
4471
4472         * data-list.c: (cmd_data_list) Open handle for reading.
4473
4474         * dfm.c: (struct dfm_fhuser_ext) Add `where', `saw_begin_data'
4475         members.
4476         (open_file_r) Renamed dfm_open_for_reading(), rewrote.
4477         (open_file_w) Renamed dfm_open_for_writing(), rewrote.
4478         (open_inline_file) Removed.
4479         (read_record) For inline_file, if we haven't seen BEGIN DATA, read
4480         it.  Deal with line_number in extension record instead of file
4481         handle.
4482         (dfm_get_record) Rewrote.
4483         (dfm_put_record) Rewrote.
4484         (dfm_push) Assert file is open and one of ours.  Deal with
4485         line_number in extension record instead of file handle.
4486         (dfm_pop) Assert file is open and one of ours.  Deal with
4487         line_number in extension record instead of file handle.
4488         (cmd_begin_data) Use dfm_open_for_reading().  Mark that we saw
4489         BEGIN DATA.     
4490
4491         * file-handle.h: (enum constants RH_RF_*) Removed.
4492         (enum constants FH_MD_*) Removed.
4493         (struct file_handle) Removed `name', `norm_fn', `fn', `where',
4494         `recform', `lrecl', `mode' members.  Public references to
4495         `recform' changed to use handle_get_mode(), references to `lrecl'
4496         changed to use handle_get_record_width().  Added `private' member.
4497         (enum file_handle_mode) New.
4498
4499         * file-handle.q: (struct private_file_handle) New structure.
4500         (struct file_handle_list) New structure.
4501         (static var files) New.
4502         (static var file_handles) Removed.
4503         (init_file_handle) Removed.
4504         (create_file_handle) Removed.
4505         (get_handle_with_name) New function.
4506         (get_handle_for_filename) New function.
4507         (cmd_file_handle) Rewritten.
4508         (hash_file_handle) Removed.
4509         (cmp_file_handle) Removed.
4510         (fh_init_files) Rewritten.
4511         (fh_parse_file_handle) Rewritten.  Allows identifiers as
4512         filenames.
4513         (fh_get_handle_by_name) Renamed handle_get_name(), all references
4514         updated.  Rewritten.
4515         (fh_get_handle_by_filename) Renamed handle_get_filename(), all
4516         references updated.  Rewritten.
4517         (fh_record_width) Renamed handle_get_record_width(), all
4518         references updated.  Rewritten.
4519         (handle_get_mode) New function.
4520
4521         * file-type.c: (cmd_file_type) Open handle for reading.
4522
4523         * filename.c: [unix] (struct file_identity) New structure.
4524         [unix] (fn_get_identity) New function.
4525         [unix] (fn_free_identity) New function.
4526         [unix] (fn_compare_file_identities) New function.
4527         [!unix] (struct file_identity) New structure.
4528         [!unix] (fn_get_identity) New function.
4529         [!unix] (fn_free_identity) New function.
4530         [!unix] (fn_compare_file_identities) New function.
4531
4532         * lexer.c: (static var put) Renamed put_token, all references
4533         updated.
4534         (static var put_tokstr) New.
4535         (static var put_tokval) New.
4536         (lex_init) Initialize put_tokstr().
4537         (restore_token) New function.
4538         (save_token) New function.
4539         (lex_get) Use restore_token().
4540         (lex_put_back) Use save_token().
4541         (lex_put_back_id) New function.
4542         (lex_put_forward) Removed.
4543         (lex_preprocess_line) Set put_token instead of using
4544         lex_put_forward().
4545         (lex_negative_to_dash) Use save_token(), set put_token directly.
4546         (dump_token) Use stderr instead of stdout.
4547
4548         * main.c: (main) Remove call to cmd_init().
4549         
4550         * matrix-data.c: (cmd_matrix_data) Open file for reading.
4551
4552         * pfm-read.c: Use handle_get_filename() instead of trying to use
4553         h->fn directly, all over.
4554
4555         * pfm-write.c: Ditto.
4556
4557         * print.c: (internal_cmd_print) Open handle for writing.
4558         (dump_table) Use handle_get_filename().
4559         (print_trns_proc) Use handle_get_mode().
4560         (cmd_print_space) Use fh_parse_file_handle().
4561         Open handle for writing.
4562         [0] (debug_print) Removed.
4563
4564         * sfm-read.c: Use handle_get_filename() instead of trying to use
4565         h->fn directly, all over.
4566
4567         * sfm-write.c: Ditto.
4568
4569 Sat Mar 20 14:35:48 2004  Ben Pfaff  <blp@gnu.org>
4570
4571         Fix memory leaks.
4572         
4573         * autorecode.c: (arc_free) Free arc->src_values.
4574
4575         * error.c: (msg) Free buf.
4576
4577         * val-labs.c: (do_value_labels) Always free vars.
4578
4579         * vfm.c: (close_active_file) If sink has no make_source then call
4580         its destroy function.
4581
4582 Sat Mar 20 14:00:24 2004  Ben Pfaff  <blp@gnu.org>
4583
4584         Fixed cmd_parse() so that it always skips past a full command
4585         name.  A few special commands for which this would be bad get
4586         special treatment.  This lets us drop code for skipping past the
4587         end of a command name in most cmd_*() functions.  It's not worth
4588         listing all the commands affected.
4589
4590         * command.c: (struct command) Remove `cmd' member, replace by
4591         `name' member, all references updated.  Remove `word', `next',
4592         `skip_entire_name' members.
4593         (macro DEFCMD) Deal with revised `struct command'.
4594         (macro UNIMPL) Ditto.
4595         (macro SPCCMD) New macro for commands whose last word shouldn't be
4596         skipped.
4597         (static array cmd_table[]) Make const, rename `commands', remove
4598         sentinel element.
4599         (macro COMMAND_CNT) New macro.
4600         (split_words) Removed.
4601         (cmd_init) Removed.
4602         (FILE_TYPE_okay) Make parameter const.
4603         (cmd_parse) Improve error messages.
4604         (match_strings) New function.
4605         (next_word) New function.
4606         (enum command_match) New enum.
4607         (conflicting_3char_prefixes) New function.
4608         (conflicting_3char_prefix_command) New function.
4609         (cmd_match_words) New function.
4610         (count_matching_commands) New function.
4611         (get_command_name) New function.
4612         (free_words) New function.
4613         (unknown_command_error) New function.
4614         (figure_out_command) Renamed parse_command_name(), rewritten.
4615
4616         * command.def: Removed @ command.  Marked BEGIN DATA, DOCUMENT,
4617         FILE LABEL, REMARK, SUBTITLE, TITLE as special.  Renamed EVALUATE
4618         to DEBUG EVALUATE.  Added N alias for N OF CASES, SORT alias for
4619         SORT CASES.
4620
4621         * command.h: (macro SPCCMD) New.
4622
4623         * include.c: (cmd_include_at) Removed.
4624         (cmd_include) Allow identifier to be used as filename.
4625
4626         * inpt-pgm.c: (cmd_reread) Use fh_parse_file_handle().
4627
4628         * t-test.q: (cmd_t_test) Command name is now parsed for us.
4629         
4630
4631 Sat Mar 20 13:56:00 2004  Ben Pfaff  <blp@gnu.org>
4632
4633         Start work on better test framework.
4634         
4635         * Makefile.am: (pspp_sources) Add debug.c.
4636         
4637         * debug.c: New file.
4638
4639         * compute.c: (cmd_evaluate) Moved to debug.c, renamed
4640         cmd_debug_evaluate().
4641
4642         * expr-prs.c: (expr_parse) Remove PXP_DUMP support.
4643
4644         * expr.h: (enum constant PXP_DUMP) Removed.
4645
4646 Sat Mar 20 00:05:42 WST 2004 John Darrington <john@darrington.wattle.id.au>
4647
4648         * set.q:  Implemented the SHOW command, and synced it to the existing 
4649         SET cmd.
4650
4651         Added a handler for SIGWINCH so that viewlength and viewwidth follow
4652         changes as the window size is changed.
4653
4654         Added fallback to set viewlength and viewwidth from LINES and COLUMS
4655         environment variables if other methods are not available.
4656
4657         glob.c: Removed a lot of global variables from glob.c and encapsulated 
4658         them in set.q
4659
4660         random.c: Tidied up the way the random seed is set.
4661
4662         str.c: Added a ds_vprintf function.
4663
4664         error.c: Extended dump_message so that messages are always broken at
4665         '\n' characters.
4666         
4667 Thu Mar 18 11:07:14 2004  Ben Pfaff  <blp@gnu.org>
4668
4669         * pfm-write.c: (bufwrite) Write out the correct element for string
4670         variables.  From Andreas Streichardt <streichardt@globalpark.de>.
4671
4672 Mon Mar 15 20:48:03 2004  Ben Pfaff  <blp@gnu.org>
4673
4674         Get rid of static and global (!) vars in matrix-data.c.
4675
4676         * matrix-data.c: (static var nr_data) Removed.
4677         (static var nr_factor_values) Removed.
4678         (static var max_cell_index) Removed.
4679         (static var split_values) Removed.
4680         (struct nr_aux_data) New structure.
4681         (read_matrices_without_rowtype) Use a local struct nr_aux_data in
4682         place of static vars, pass to create_case_source() and procedure()
4683         as aux data.
4684         (nr_read_data_lines) Use struct nr_aux_data * parameter instead of
4685         struct matrix_data_pgm *.
4686         (nr_read_splits) Ditto.
4687         (nr_read_factors) Ditto.
4688         (nr_output_data) Ditto.
4689         (static var wr_content) Removed.
4690         (global var wr_data) Removed.
4691         (global var wr_current) Removed.
4692         (struct wr_aux_data) New structure.
4693         (read_matrices_with_rowtype) Use a local struct wr_aux_data in
4694         place of static vars, pass to create_case_source() and procedure()
4695         as aux data.
4696         (matrix_data_read_with_rowtype) Use struct wr_aux_data * parameter
4697         instead of matrix_data_pgm *.
4698         (wr_read_splits) Ditto.
4699         (wr_output_data) Ditto.
4700         (wr_read_rowtype) Ditto.
4701         (wr_read_factors) Ditto.
4702         (wr_read_indeps) Ditto.
4703         
4704 Mon Mar 15 20:07:29 2004  Ben Pfaff  <blp@gnu.org>
4705
4706         Get rid of static vars in autorecode.c.
4707
4708         * autorecode.c: (struct autorecode_trns) Rename `arc' to `specs',
4709         `n_arc' to `spec_cnt'.  All references updated.
4710         (static var v_src) Removed.
4711         (static var v_dest) Removed.
4712         (static var h_trns) Removed.
4713         (static var nv_src) Removed.
4714         (static var descend) Removed.
4715         (static var print) Removed.
4716         (enum direction) New enum.
4717         (struct autorecode_pgm) New structure.
4718         (cmd_autorecode) Use struct autorecode_pgm instead of static vars.
4719         Move n_dest local var into struct autorecode_pgm for ease of
4720         clean-up.  Use arc_free().
4721         (arc_free) New function.
4722         (recode) Modify to take struct autorecode_pgm * parameter instead
4723         of using statics.  Let the caller clean up.
4724         (autorecode_proc_func) Use struct autorecode_pgm * auxiliary data
4725         instead of statics.  Rearrange code a little.
4726
4727 Mon Mar 15 00:25:02 2004  Ben Pfaff  <blp@gnu.org>
4728
4729         Get rid of static, global vars in recode.c.  Remove debug code.
4730
4731         * recode.c: (static var head) Removed.
4732         (global var v) Removed.
4733         (global var nv) Removed.
4734         (cmd_recode) New local variables head, v, nv.  Initialize and free
4735         v.  Don't call debug_print().
4736         [DEBUGGING] (dump_dest) Removed.
4737         [DEBUGGING] (debug_print) Removed.
4738
4739 Mon Mar 15 00:14:49 2004  Ben Pfaff  <blp@gnu.org>
4740
4741         Get rid of static vars in expr-opt.c.
4742
4743         * expr-opt.c: (static var e) Removed.
4744         (static var nop) Removed.
4745         (static var mop) Removed.
4746         (static var ndbl) Removed.
4747         (static var mdbl) Removed.
4748         (static var nstr) Removed.
4749         (static var mstr) Removed.
4750         (static var nvars) Removed.
4751         (static var mvars) Removed.
4752         (struct expr_dump_state) New structure.
4753         (dump_expression) Use new struct expr_dump_state instead of static
4754         vars and pass to functions we call.
4755         (dump_node) Use struct expr_dump_state * parameter.
4756         (emit) Ditto.
4757         (emit_num_con) Ditto.
4758         (emit_str_con) Ditto.
4759         (emit_var) Ditto.
4760         
4761 Mon Mar 15 00:03:51 2004  Ben Pfaff  <blp@gnu.org>
4762
4763         Get rid of static var in COUNT.
4764
4765         * count.c: (static var head) Move into cmd_count().
4766         (cmd_count) [DEBUGGING] Don't call debug_print.
4767         [DEBUGGING] (debug_print) Removed.
4768
4769 Sun Mar 14 23:56:09 2004  Ben Pfaff  <blp@gnu.org>
4770
4771         Get rid of static vars in VALUE LABELS, ADD VALUE LABELS.
4772
4773         * val-labs.c: (static var v) Removed.
4774         (static var nv) Removed.
4775         [DEBUGGING] (debug_print) Removed.
4776         (verify_val_labs) Add struct variable **, int parameters.
4777         (get_label) Ditto.  Improve error messages, streamline.
4778         (erase_labels) New function for erasing value labels, taking over
4779         part of verify_val_labs()'s function.
4780         (init) Removed.
4781         (done) Removed.
4782         (cmd_value_labels) No need to call init() or done() anymore.
4783         (cmd_add_value_labels) Ditto.
4784         (do_value_labels) Add vars, var_cnt local variables.  Clean up
4785         after them internally.  Call erase_labels() if we should.  Don't
4786         call debug_print().
4787
4788 Sun Mar 14 23:33:53 2004  Ben Pfaff  <blp@gnu.org>
4789
4790         Get rid of static vars in MATCH FILES.
4791         
4792         * get.c: (static var mtf_head) Removed.
4793         (static var mtf_tail) Removed.
4794         (static var mtf_by) Removed.
4795         (static var mtf_n_by) Removed.
4796         (static var mtf_master) Removed.
4797         (static var mtf_seq_num) Removed.
4798         (static var mtf_seq_nums) Removed.
4799         (static var mtf_sink) Removed.
4800         (static var mtf_case) Removed.
4801         (struct mtf_proc) New structure.
4802         (cmd_match_files) Use struct mtf_proc instead of static vars.
4803         (mtf_processing_finish) Ditto.
4804         (mtf_free) Ditto.
4805         (mtf_delete_file_in_place) Ditto.
4806         (mtf_read_nonactive_records) Ditto.
4807         (mtf_compare_BY_values) Ditto.
4808         (mtf_processing) Ditto.
4809         (mtf_merge_dictionary) Ditto.
4810
4811 Sun Mar 14 22:48:12 2004  Ben Pfaff  <blp@gnu.org>
4812
4813         * command.def: Add CASESTOVARS, VARSTOCASES unimplemented commands.
4814
4815         * dictionary.c: (dict_rename_var) Add assertion.
4816         (dict_contains_var) Check by index instead of name.
4817
4818 Sun Mar 14 22:01:02 2004  Ben Pfaff  <blp@gnu.org>
4819
4820         Get rid of compaction_necessary, compaction_nval, compaction_case.
4821         Redo VFM interface.  Replace disk_sink and memory_sink by
4822         storage_sink, disk_source and memory_source by storage_source.
4823
4824         * vfm.h: (struct case_sink) Add `dict', `idx_to_fv', `value_cnt'
4825         members.
4826
4827         * vfm.c: 
4828         (struct write_case_data) Remove `begin_func', `end_func',
4829         `func_aux' members.  Add `aux', `trns_case', `sink_case',
4830         `cases_written', `cases_analyzed' members.
4831         (global var compaction_necessary) Make static.
4832         (global var compaction_nval) Removed.
4833         (global var compaction_case) Removed.
4834         (static var case_count) Removed.
4835         (struct procedure_aux_data) Removed.
4836         (struct split_aux_data) Removed.
4837         (procedure) Remove begin_func, end_func parameters.  Rewrite.
4838         (static var not_canceled) Removed.
4839         (process_active_file) Removed.
4840         (process_active_file_write_case) Removed.
4841         (process_active_file_output_case) Removed.
4842         (prepare_for_writing) Moved into open_active_file().
4843         (arrange_compaction) Ditto.
4844         (setup_lag) Ditto.
4845         (open_active_file) Rewrote.
4846         (write_case) New function.
4847         [DEBUGGING] (index_to_varname) Removed.
4848         (execute_transformations) New function.
4849         (exclude_this_case) Renamed filter_case(), changed interface.
4850         (clear_case) Added struct ccase * parameter to interface.
4851         (close_active_file) Added struct write_case_data * parameter,
4852         rewrote.
4853         (disk_sink_create) Removed.
4854         (disk_sink_destroy) Removed.
4855         (disk_sink_make_source) Removed.
4856         (disk_sink_write) Removed.
4857         (disk_source_count) Removed.
4858         (disk_source_destroy) Removed.
4859         (disk_source_read) Removed.
4860         (global var disk_sink_class) Removed.
4861         (global var disk_source_class) Removed.
4862         (global var memory_sink_class) Removed.
4863         (global var memory_source_class) Removed.
4864         (memory_sink_create) Removed.
4865         (memory_sink_destroy) Removed.
4866         (memory_sink_make_source) Removed.
4867         (memory_sink_write) Removed.
4868         (memory_source_count) Removed.
4869         (memory_source_destroy) Removed.
4870         (memory_source_get_cases) Removed.
4871         (memory_source_read) Removed.
4872         (memory_source_set_cases) Removed.
4873         (struct disk_stream_info) Removed.
4874         (struct memory_sink_info) Removed.
4875         (struct memory_source_info) Removed.
4876         (write_active_file_to_disk) Removed.
4877         (destroy_storage_stream_info) New function.
4878         (global var null_sink_class) New var.
4879         (global var storage_sink_class) New var.
4880         (global var storage_source_class) New var.
4881         (open_storage_file) New function.
4882         (storage_sink_destroy) New function.
4883         (storage_sink_make_source) New function.
4884         (storage_sink_open) New function.
4885         (storage_sink_write) New function.
4886         (storage_source_count) New function.
4887         (storage_source_destroy) New function.
4888         (storage_source_get_cases) New function.
4889         (storage_source_on_disk) New function.
4890         (storage_source_read) New function.
4891         (storage_source_set_cases) New function.
4892         (storage_source_to_disk) New function.
4893         (storage_to_disk) New function.
4894         (struct storage_stream_info) New structure.
4895         (write_storage_file) New function.
4896         (procedure_write_case) Removed.
4897         (create_case_source) Add `struct dictionary *' parameter, all
4898         references updated.
4899         (create_case_sink) Ditto.
4900         (free_case_sink) New function.
4901         (struct split_aux_data) New structure.
4902         (procedure_with_splits) New function implementing what procedure()
4903         used to.
4904         (SPLIT_FILE_proc_func) Removed.
4905         (procedure_with_splits_callback) New function.
4906         (equal_splits) New function.
4907         
4908         * aggregate.c: Pass around a struct instead of using statics.
4909         (static var outfile) Remove.
4910         (enum type) Give it tag `missing_treatment'.
4911         (static var missing) Remove.
4912         (static var sort) Remove.
4913         (static var agr_first) Remove.
4914         (static var agr_next) Remove.
4915         (static var case_count) Remove.
4916         (static var prev_case) Remove.
4917         (static var buf64_1xx) Remove.
4918         (static var buf_1xx) Remove.
4919         (struct agr_proc) New structure incorporating the above.
4920         (cmd_aggregate) Use new struct.  Clean up error handling using
4921         agr_destroy().  Completely rewrite actual implementation of
4922         aggregation.
4923         (create_sysfile) Add struct agr_proc * parameter, modify
4924         accordingly.
4925         (parse_aggregate_functions) Ditto.
4926         (free_aggregate_functions) Ditto.  Rename agr_destroy().
4927         (aggregate_single_case) Add struct agr_proc * parameter, modify
4928         accordingly.
4929         (accumulate_aggregate_info) Ditto.
4930         (dump_aggregate_info) Ditto.
4931         (initialize_aggregate_info) Ditto.
4932         (agr_00x_trns_proc) Removed.
4933         (agr_00x_end_func) Removed.
4934         (agr_10x_trns_proc) Removed.
4935         (agr_10x_trns_free) Removed.
4936         (agr_10x_end_func) Removed.
4937         (agr_11x_read) Removed.
4938         (agr_11x_finish) Removed.
4939         [DEBUGGING] (debug_print) Removed.
4940         (write_case_to_sfm) Add struct agr_proc * parameter, modify
4941         accordingly.
4942         (agr_to_active_file) New function.
4943         (presorted_agr_to_sysfile) New function.
4944         (sort_agr_to_sysfile) New function.
4945
4946         * autorecode.c: (cmd_autorecode) Use procedure_with_splits().
4947
4948         * crosstabs.q: (internal_cmd_crosstabs) Ditto.
4949
4950         * descript.q: (cmd_descriptives) Ditto.
4951
4952         * dfm.c: (cmd_begin_data) Check for storage_source_class.  Adapt
4953         to new procedure() interface.
4954
4955         * command.c: (cmd_execute) Adapt to new procedure() interface.
4956
4957         * dictionary.c: (dict_compact_values) Also delete scratch
4958         variables.
4959         (dict_get_compacted_value_cnt) New function.
4960         (dict_get_compacted_idx_to_fv) New function.
4961
4962         * flip.c: (cmd_flip) Warn about and cancel TEMPORARY.
4963         (cmd_flip) Adapt to new procedure() interface.
4964         (flip_sink_write) Use sink->idx_to_fv.
4965
4966         * frequencies.q: (internal_cmd_frequencies) Use
4967         procedure_with_splits().
4968
4969         * get.c: (cmd_save_internal) Adapt to new procedure() interface.
4970         (static var mtf_sink) New static var.
4971         (static var mtf_case) New static var.
4972         (cmd_match_files) Warn about and cancel TEMPORARY.  Redo the way
4973         we actually implement the matching.
4974         (mtf_delete_file_in_place) Use mtf_case.
4975         (mtf_processing) Use mtf_case and mtf_sink.
4976         (cmd_export) Adapt to new procedure() interface.
4977
4978         * levene.c: (levene) Use procedure_with_splits().
4979
4980         * list.q: (cmd_list) Use procedure_with_splits().
4981
4982         * matrix-data.c: (read_matrices_without_rowtype) Adapt to new
4983         procedure() interface.
4984         (read_matrices_with_rowtype) Ditto.
4985
4986         * modify-vars.c; (cmd_modify_vars) Warn about and cancel
4987         TEMPORARY.  Adapt to new procedure() interface.
4988
4989         * rename-vars.c: Warn about and cancel TEMPORARY.
4990
4991         * sort.c: (cmd_sort_cases) Warn about TEMPORARY.
4992         (sort_cases) Use dict_get_compacted_value_cnt() instead of
4993         compaction_nval.  Adapt to new procedure() interface.  Use
4994         storage_source_to_disk().
4995         (do_internal_sort) Don't try to dump the cases to memory.
4996         (compare_case_lists) Pass null idx_to_fv.
4997         (struct initial_run_state) Add `idx_to_fv' member.  Remove
4998         `case_size' member.
4999         (write_initial_runs) Don't initialize irs->case_size.  Adapt to
5000         new procedure() interface.  Reset irs->idx_to_fv after calling
5001         procedure().
5002         (sort_sink_write) Set irs->idx_to_fv.  Use case_size from struct
5003         sort_cases_pgm.  Pass irs, not struct sort_cases_pgm to
5004         push_heap().
5005         (destroy_initial_run_state) Don't dereference irs after freeing
5006         it.
5007         (allocate_cases) Don't calculate case_size locally.
5008         (compare_record) Add idx_to_fv parameter.
5009         (compare_record_run) Change parameter from struct sort_cases_pgm *
5010         to struct initial_run_state *.  Pass irs->idx_to_fv to
5011         compare_record().
5012         (compare_record_run) Third parameter now a struct
5013         initial_run_state *.
5014         (output_record) No need for out_case anymore.  Pass irs, not
5015         struct sort_cases_pgm to pop_heap().  Use case_size from struct
5016         sort_cases_pgm.
5017         (merge) Use case_size from struct sort_cases_pgm.
5018         (merge_once) Use case_size from struct sort_cases_pgm.
5019         Pass null pointer to compare_record() as idx_to_fv.
5020         (global var sort_sink_class) Make static.
5021
5022         * t-test.q: (cmd_t_test) Use procedure_with_splits().
5023
5024         * temporary.c: Remove debugging crap.
5025
5026 Sat Mar 13 14:19:52 WST 2004 John Darrington <john@darrington.wattle.id.au>
5027
5028         * t-test.q, levene.c: Fixed up the handling of MISSING values
5029         int the T-TEST
5030
5031 Fri Mar 12 16:23:35 WST 2004 John Darrington <john@darrington.wattle.id.au>
5032
5033         * t-test.q, levene.c: Added support for T-TEST /GROUP where only 
5034         one value is given.
5035
5036 Wed Mar 10 23:25:13 2004  Ben Pfaff  <blp@gnu.org>
5037
5038         Change explicit variable name checks into use of
5039         dict_class_from_id().
5040
5041         * dictionary.c: (dict_create_var)  Change explicit variable name
5042         check into use of dict_class_from_id().
5043
5044         * get.c: (trim_dictionary) Ditto.
5045
5046         * sel-if.c: (cmd_filter) Ditto.
5047
5048         * sysfile-info.c: (cmd_display) Ditto.
5049
5050         * vars-prs.c: (parse_DATA_LIST_vars) Ditto.
5051
5052         * vfm.c: (arrange_compaction) Ditto.
5053
5054         * weight.c: (cmd_weight) Ditto.
5055
5056 Wed Mar 10 21:16:34 2004  Ben Pfaff  <blp@gnu.org>
5057
5058         * temporary.c: (cmd_temporary) When TEMPORARY was the first
5059         transformation following the input program, if any, for some
5060         reason we special-cased f_trns.  That's just wrong.  It should
5061         always be set to n_trns.
5062
5063 Tue Mar  9 23:44:40 2004  Ben Pfaff  <blp@gnu.org>
5064
5065         * format.c: (parse_format_specifier_name) Fix brown-bag bug
5066         introduced in last check-in.
5067
5068 Tue Mar  9 23:10:41 2004  Ben Pfaff  <blp@gnu.org>
5069
5070         * format.c: (global array translate_fmt[]) Removed.
5071         (translate_fmt) New function as replacement.
5072         (parse_format_specifier_name) Rewrite.
5073
5074         * pfm-read.c: (convert_format) Use translate_fmt() instead of
5075         translate_fmt[].
5076
5077         * sfm-read.c: (parse_format_spec) Ditto.
5078
5079         * postscript.c: (text) Fix handling of fonts with missing
5080         ligatures.
5081
5082         * sort.c: (struct external_sort) Add temp_name member.
5083         (destroy_external_sort) Free temp_dir, temp_name members.
5084         (init_external_sort) Allocate temp_name.
5085         (get_temp_file_name) Change prototype.
5086         (open_temp_file) Deal with change to get_temp_file_name().
5087         (close_temp_file) Ditto.
5088         (remove_temp_file) Ditto.
5089         (write_temp_file) Ditto.
5090         (read_temp_file) Ditto.
5091         (sort_sink_destroy) Removed.
5092         (sort_sink_class) Change destroy member to null.
5093
5094 Tue Mar  9 22:36:34 2004  Ben Pfaff  <blp@gnu.org>
5095
5096         Eliminate temp_case.
5097
5098         * aggregate.c: (cmd_aggregate) No need to save/restore temp_case
5099         anymore.  Use agr_11x_finish().
5100         (aggregate_single_case) Make first param const.
5101         (accumulate_aggregate_info) Ditto.
5102         (agr_00x_end_func) Use compaction_case, not temp_case.
5103         (agr_11x_func) Break into agr_11x_read(), agr_11x_finish().
5104
5105         * data-list.c: (struct data_list_pgm) Add `case_size' member.
5106         (cmd_data_list) Initialize case_size.
5107         (read_from_data_list_fixed) Add struct ccase * param, use instead
5108         of temp_case.
5109         (read_from_data_list_free) Ditto.
5110         (read_from_data_list_list) Ditto.
5111         (read_one_case) Rename data_list_trns_proc(), all references
5112         updated.  Add argument in calling above functions.  Use c
5113         argument instead of temp_case.
5114         (destroy_dls) Rename data_list_trns_free(), all references
5115         updated.
5116
5117         * expr-evl.c: (expr_evaluate) Make second parameter const.
5118
5119         * file-type.c: (struct file_type_pgm) Add `case_size' member.
5120         (cmd_end_file_type) Initialize `case_size'.
5121         (file_type_source_read) Add struct ccase * parameter.  Use instead
5122         of temp_case.
5123
5124         * flip.c: Rewritten.
5125
5126         * get.c: (struct get_pgm) New structure to keep track of
5127         case_size.
5128         (cmd_get) Initialize case_size.
5129         (cmd_import) Ditto.
5130         (get_source) Deal with struct get_pgm.
5131         (get_source_read) Add struct ccase * parameter, use instead of
5132         temp_case.
5133         (import_source_read) Ditto.
5134
5135         * get.c: Use a null pointer instead of temp_case to represent the
5136         "current case" in a struct mtf_file's input member.
5137         (mtf_processing_finish) Pass null to mtf_processing(), not
5138         temp_case.
5139         (mtf_read_nonactive_records) Don't set iter->input to temp_case.
5140         (mtf_compare_BY_values) Add extra arg, use instead of null input
5141         members.
5142         (mtf_processing) Use c parameter instead of temp_case.  Pass
5143         compaction_case to process_active_file_output_case().
5144         
5145         * glob.c: (global variable temp_case) Removed.
5146
5147         * inpt-pgm.c: (struct input_program_pgm) Add `case_size' member.
5148         (cmd_input_program) Initialize case_size.  Set
5149         vfm_source->value_cnt.
5150         (init_case) Add struct ccase * parameter, use instead of
5151         temp_case.
5152         (clear_case) Ditto.
5153         (input_program_source_read) Ditto.
5154
5155         * matrix-data.c: (matrix_data_read_without_rowtype) Ditto.
5156         (dump_cell_content) Ditto.
5157         (nr_output_data) Ditto.
5158         (read_matrices_without_rowtype) Ditto.
5159         (matrix_data_read_with_rowtype) Ditto.
5160         (wr_read_splits) Ditto.
5161         (wr_output_data) Ditto.
5162
5163         * sort.h: (struct sort_cases_pgm) New member `case_size'.
5164         
5165         * sort.c: (sort_cases) Initialize scp->case_size.
5166         (struct external_sort) Remove `case_size' member.
5167         (write_initial_runs) Only call vfm_sink->class_destroy if
5168         non-null.
5169         (struct sort_source_aux) New structure.
5170         (sort_source_read_helper) New function.
5171         (sort_source_read) Use sort_source_read_helper().
5172         (read_sort_output) Change interface to be more reasonable.
5173         (read_internal_sort_output) Ditto.
5174         (read_external_sort_output) Ditto.
5175
5176         * vars-prs.c: (dict_class_to_name) Pass return value through
5177         gettext.
5178
5179         * vfm.c: (struct procedure_aux_data) Add `trns_case' member.
5180         (procedure) Initialize trns_case.
5181         (procedure) Pass trns_case to vfm_source->class->read().
5182         Free trns_case.
5183         (process_active_file) Start using struct procedure_aux_data.
5184         (process_active_file_write_case) Pass trns_case to
5185         transformations, lag_case(), clear_case().
5186         (process_active_file_output_case) Add struct ccase * parameter.
5187         (create_trns_case) New function.
5188         (make_temp_case) Removed.
5189         (vector_initialization) Removed.
5190         (close_active_file) Only call make_source if non-null, otherwise
5191         set vfm_source to null pointer.  Don't free temp_case.
5192         (disk_source_read) Add struct ccase * parameter, use instead of
5193         temp_case.
5194         (memory_source_read) Ditto.
5195         (lag_case) Add const struct ccase * member.
5196         (procedure_write_case) Use trns_case instead of temp_case.
5197         (clear_case) Add struct ccase * member, use instead of temp_case.
5198         (exclude_this_case) Ditto.
5199         (create_case_source) Add struct dictionary * parameter, use to
5200         initialize source->value_cnt.
5201
5202         * vfm.h: (struct case_source) Add `value_cnt' member.
5203         (struct case_source_class) Add struct ccase * parameter to `read'
5204         member function pointer.
5205         (struct case_sink_class) Make struct ccase * parameter const in
5206         `write' member function pointer.
5207         
5208 Wed Mar  3 20:44:37 2004  Ben Pfaff  <blp@gnu.org>
5209
5210         Fix a lot of "possibly uninitialized variable" warnings.  Some of
5211         them are even real bugs.  A few of them make me wonder how the
5212         code ever worked.
5213
5214         * aggregate.c: (parse_aggregate_functions) Initialize `function.
5215
5216         * ascii.c: (output_lines) Add default case to switch.
5217
5218         * crosstabs.q: Remove static variable `expected' and all
5219         references to it.
5220         (display_crosstabulation) Always calculate expected value.
5221         (calc_chisq) Ditto.
5222         (output_pivot_table) Initialize `cmp'.
5223         (display_crosstabulation) New variable `last_row', which is
5224         initialized.
5225
5226         * data-in.c: (parse_numeric) Always initialize sign.  How did this
5227         work at all?!
5228
5229         * data-list.c: (repeating_data_trns_proc) Always initialize code.
5230         Always set info.ofs.  (How did this work?!)
5231
5232         * expr-opt.c: (optimize_tree) Always initialize `m'.
5233         (evaluate_tree) Always initialize `c'.  (How did this work?)
5234
5235         * frequencies.q: (frq_custom_variables) Always initialize min,
5236         max.
5237         (frq_custom_grouped) Always initialize `dl'.
5238
5239         * groff-font.c: (groff_read_font) Always initialize char_set.
5240
5241         * matrix-data.c: (nr_output_data) Initialize `split'.
5242         (wr_read_splits) Remove shadowing split_cnt declaration.
5243         (wr_output_data) Initialize `split'.
5244
5245         * output.c: (tokener) Skip add character on syntax error.
5246
5247         * pool.c: (pool_strndup) Always set `copy'.  (How did this work?!)
5248
5249         * postscript.c: (read_ps_encodings) Use line.string instead of
5250         uninitialized `bp'.
5251         (write_text) Add default case to switch.
5252         (text) Always initialize multiple variables.  Fix bug with
5253         ligatures.
5254
5255         * print.c: (fixed_parse_fortran) Initialize head.
5256         (alloc_line) Add default case to switch.
5257
5258         * recode.c: (parse_dest_spec) Handle case where nothing matches.
5259         (recode_trns_proc) Move variable declaration inward.  Add default
5260         case to switch.
5261
5262         * sfm-read.c: (read_header) Initialize skip_amt.
5263
5264         * sysfile-info.c: (display_variables) Always initialize pc.
5265
5266         * vars-prs.c: Initialized `included'.
5267
5268 Wed Mar  3 09:30:09 2004  Ben Pfaff  <blp@gnu.org>
5269
5270         * main.c: (main) sigaction()'s sa_flags member was uninitialized.
5271         Just use signal() instead.
5272
5273 Wed Mar  3 09:26:30 2004  Ben Pfaff  <blp@gnu.org>
5274
5275         Get rid of vfm_sink_info and vfm_source_info.
5276         
5277         * aggregate.c: (agr_00x_end_func) Don't increment
5278         sfm_sink_info.ncases.
5279
5280         * sort.c: (do_internal_sort) Get case count from
5281         vfm_source->class->count().
5282         (struct external_sort) Add `case_size' member.
5283         (do_external_sort) Initialize case_size.
5284         (struct initial_run_state) Add `case_size' member.
5285         (write_initial_runs) Initialize case_size.
5286         (sort_sink_write) Use case_size.
5287         (read_external_sort_output) Use case_size.  Get case_cnt from
5288         initial_runs.
5289
5290         * vfm.c: (struct write_case_data) Add underscores to existing arg
5291         names, all references updated.  Renamed `aux' as `func_aux', all
5292         references updated.  Added new `aux' member.
5293         (global var vfm_source_info) Removed.
5294         (global var vfm_sink_info) Removed.
5295         (struct procedure_aux_data) New.
5296         (struct split_aux_data) New.
5297         (procedure) Use `aux' fields for procedure_aux_data,
5298         split_aux_data.
5299         (process_active_file_write_case) Pass case_count + 1 to
5300         transformation procedures, exclude_this_case().
5301         (process_active_file_output_case) Don't increment
5302         vfm_sink_info.ncases.
5303         (prepare_for_writing) Don't initialize vfm_sink_info.  Don't try
5304         to send data to disk early.
5305         (make_temp_case) Don't use vfm_sink_info.case_size.
5306         (close_active_file) Don't initialize vfm_source_info.
5307         (struct disk_stream_info) New, to allow for case_cnt and case_size fields.
5308         (disk_sink_create) Initialize and/or update disk_stream_info.
5309         (disk_sink_write) Ditto.
5310         (disk_sink_destroy) Ditto.
5311         (disk_sink_make_source) Ditto.
5312         (disk_source_read) Ditto.
5313         (disk_source_destroy) Ditto.
5314         (global var disk_source_class) Add disk_source_count().
5315         (disk_source_count) New function.
5316         (struct memory_sink_info) Add `case_cnt', `case_size' members.
5317         (struct memory_source_info) Ditto.
5318         (memory_sink_create) Deal with case_cnt, case_size.
5319         (memory_sink_write) Ditto.
5320         (memory_sink_make_source) Ditto.
5321         (memory_source_read) Ditto.
5322         (memory_source_count) New function.
5323         (memory_source_class) Add memory_source_count().
5324         (procedure_write_case) Don't use vfm_sink_info.ncases.  Do use
5325         proc_aux->cases_written, and pass it to transformation procedures
5326         and exclude_this_case ().
5327         (exclude_this_case) Add case_num parameter.  Pass it to
5328         expr_evaluate().
5329         (SPLIT_FILE_procfunc) Use split_aux->prev_case instead of static
5330         variable.
5331
5332         * vfm.h: (struct case_source_class) Add `count' member.
5333
5334         * vfmP.h: (struct stream_info) Removed.
5335         (global variable vfm_source_info) Removed.
5336         (global variable vfm_sink_info) Removed.
5337         
5338 Tue Mar  2 23:38:17 2004  Ben Pfaff  <blp@gnu.org>
5339
5340         * var.h: (typedef trns_proc_func) New typedef.
5341         (trns_free_func) New typedef.
5342         (struct trns_header) Change `proc' to type trns_proc_func, `free'
5343         to type trns_free_func.  This only changes the actual type of
5344         trns_proc_func, adding a `case_num' parameter.  Updated all
5345         implementations to use the typedefs instead.
5346
5347         * compute.c: (compute_num) Pass case_num to expr_evaluate().
5348         (compute_num_vec) Ditto.
5349         (compute_str) Ditto.
5350         (compute_str_vec) Ditto.
5351
5352         * do-if.c: (do_if_trns_proc) Ditto.
5353
5354         * expr-evl.c: (expr_evaluate) Add new case_num parameter, use for
5355         OP_CASENUM.
5356
5357         * inpt-pgm.c: (input_program_source_read) Maintain case count,
5358         pass to transformation functions.
5359         (reread_trns_proc) Pass case_num arg to expr_evaluate().
5360
5361         * loop.c: (loop_1_trns_proc) Ditto.
5362         (loop_2_trns_proc) Ditto.
5363         (loop_3_trns_proc) Ditto.
5364
5365         * print.c: (print_space_trns_proc) Ditto.
5366
5367         * sel-if.c: (select_if_proc) Ditto.
5368
5369 Tue Mar  2 11:36:52 2004  Ben Pfaff  <blp@gnu.org>
5370
5371         * frequencies.q: (cleanup_freq_tab) Avoid memory leak by
5372         destroying hash table.
5373
5374         * glob.c: (read_active_file) Variable not referenced, removed.
5375         (cancel_input_pgm) Ditto.
5376
5377         * levene.c: Add #include <stdlib.h> needed to call free().
5378
5379         * aggregate.c: (parse_aggregate_functions) Make `function'
5380         variable const.
5381
5382 Tue Mar  2 11:30:56 2004  Ben Pfaff  <blp@gnu.org>
5383
5384         Start working to eliminate VFM dependence on static variables.
5385
5386         * command.c: (cmd_parse) Use case_source_is_class().
5387
5388         * data-list.c: Rewrite to eliminate use of static variables.
5389
5390         * dfm.c: (cmd_begin_data) Use case_source_is_class().
5391
5392         * file-handle.q: (fh_handle_name) Make parameter const.
5393
5394         * file-type.c: Rewrite to eliminate use of static variables.
5395
5396         * flip.c: Rewrite to eliminate use of static variables.
5397
5398         * format.c: (get_format_var_width) New function.
5399
5400         * get.c: Eliminate use of static variables.
5401
5402         * inpt-pgm.c: Eliminate use of static variables.
5403
5404         * matrix-data.c: Eliminate use of static variables.
5405
5406         * set.q: (set_max_workspace) New variable.
5407         (cmd_set) Use SET WORKSPACE to modify set_max_workspace.
5408
5409         * var.h: (struct case_list) Move here from vfmP.h.
5410
5411         * vars-atr.c: (discard_variables) Handle new vfm_source type.
5412
5413         * vfm.c: (vfm_source) Change type from struct case_stream to
5414         struct case_source.
5415         (vfm_sink) Change type from struct case_stream to struct
5416         case_sink.
5417         (static var paging) Rename workspace_overflow, all references
5418         updated.
5419         (procedure) Use new class structures.
5420         (process_active_file) Ditto.
5421         (process_active_file_write_case) Ditto.
5422         (prepare_for_writing) Use set_max_workspace.  Use new class
5423         structures.
5424         (close_active_file) Use new class structures.  Free old sink.
5425         (global var disk_source_file) Removed.
5426         (global var disk_sink_file) Removed.
5427         (disk_stream_init) Removed.
5428         (disk_stream_read) Removed.
5429         (disk_stream_write) Removed.
5430         (disk_stream_mode) Removed.
5431         (disk_stream_destroy_source) Removed.
5432         (disk_stream_destroy_sink) Removed.
5433         (global var vfm_disk_stream) Removed.
5434         (disk_sink_create) New function.
5435         (disk_sink_write) New function.
5436         (disk_sink_destroy) New function.
5437         (disk_sink_make_source) New function.
5438         (disk_sink_class) New static var.
5439         (disk_source_read) New function.
5440         (disk_source_destroy) New function.
5441         (global var vfm_source_class) New var.
5442         (global var memory_source_cases) Removed.
5443         (global var memory_sink_cases) Removed.
5444         (global var memory_sink_max_cases) Removed.
5445         (struct memory_sink_info) New struct.
5446         (memory_stream_init) Removed.
5447         (memory_stream_read) Removed.
5448         (memory_stream_write) Removed.
5449         (memory_stream_mode) Removed.
5450         (memory_stream_destroy_source) Removed.
5451         (memory_stream_destroy_sink) Removed.
5452         (global var vfm_memory_stream) Removed.
5453         (page_to_disk) Renamed write_active_file_to_disk().
5454         (memory_sink_create) New function.
5455         (memory_sink_write) New function.
5456         (memory_sink_destroy) New function.
5457         (memory_sink_make_source) New function.
5458         (memory_sink_class) New static var.
5459         (memory_source_read) New function.
5460         (memory_source_destroy) New function.
5461         (memory_source_get_cases) New function.
5462         (memory_source_set_cases) New function.
5463         (global var vfm_source_class) New var.
5464         (procedure_write_case) Use new class structures.
5465         (create_case_source) New function.
5466         (case_source_is_complex) New function.
5467         (case_source_is_class) New function.
5468         (create_case_sink) New function.
5469
5470         * vfm.h: (global variable reinit_sysmis) Not used, removed.
5471         (global variable reinit_blanks) Not used, removed.
5472         (global variable init_zero) Not used, removed.
5473         (global variable init_blanks) Not used, removed.
5474         (struct case_source) New struct.
5475         (struct case_source_class) New struct.
5476         (struct case_sink) New struct.
5477         (struct case_sink_class) New struct.
5478         (struct case_stream) Removed.
5479
5480         * vfmP.h: (struct case_list) Moved to var.h.
5481
5482 Tue Mar  2 11:28:30 2004  Ben Pfaff  <blp@gnu.org>
5483
5484         * algorithm.c: (count_equal) New function.
5485         (count_if) New function.
5486         (unique) Add assertions.
5487         (partition) Add assertions.
5488         (is_partitioned) New function.
5489         (copy_if) Add assertions.
5490         (remove_equal) Add assertions.
5491         (lexicographical_compare) Rename lexicographical_compare_3way.
5492         (sort) Add assertions.  Rephrase some code.
5493         (is_sorted) New function.
5494
5495 Sun Feb 29 23:24:57 2004  Ben Pfaff  <blp@gnu.org>
5496
5497         Rewrite SORT CASES.
5498
5499         * sort.c: Completely rewrite.
5500
5501         * sort.h: Expose interface via struct sort_cases_pgm, not via
5502         global variables.
5503
5504         * aggregate.c: (sort) New static var.
5505         (cmd_aggregate) Use sort.
5506         (create_sysfile) Ditto.
5507         (aggregate_single_case) Ditto.
5508         (dump_aggregate_info) Ditto.
5509         (agr_00x_end_func) Ditto.
5510         (debug_print) Ditto.
5511
5512         * var.h: (enum SRT_ASCEND) Removed.
5513         (enum SRT_DESCEND) Removed.
5514         (struct sort_cases_proc) Removed.
5515         (struct variable) Remove p.srt member.
5516
5517 Sun Feb 29 23:22:45 2004  Ben Pfaff  <blp@gnu.org>
5518
5519         Get rid of the old, crappy heap structure and replace it by a new,
5520         shiny, C++ STL-like heap structure.
5521         
5522         * Makefile.am: (pspp_SOURCES) Remove heap.c, heap.h.
5523
5524         * algorithm.c: (push_heap) New function.
5525         (heapify) Ditto.
5526         (pop_heap) Ditto.
5527         (make_heap) Ditto.
5528         (sort_heap) Ditto.
5529         (is_heap) Ditto.
5530         
5531         * heap.c: Removed.
5532
5533         * heap.h: Removed.
5534
5535 Sun Feb 29 23:21:53 2004  Ben Pfaff  <blp@gnu.org>
5536
5537         Increase warning level.
5538         
5539         * Makefile.am: (AM_CFLAGS) Remove -Wnouninitialized.
5540
5541 Sat Feb 21 17:38:58 WST 2004 John Darrington <john@darrington.wattle.id.au>
5542
5543         * main.c: Added a signal handler for SIGSEGV requesting a bug report.
5544          
5545 Fri Feb 20 23:22:14 2004  Ben Pfaff  <blp@gnu.org>
5546
5547         * dictionary.c: (dict_create_var) Fix root cause of bug worked
5548         around by previous change log entry.
5549         
5550         * compute.c: (lvalue_finalize) Remove workaround from previous
5551         change log entry.
5552
5553 Fri Feb 20 14:37:41 WAST 2004 John Darrington <john@darrington.wattle.id.au>
5554
5555         * compute.c: Fixed a bug where the Format was not getting set for 
5556           computed variables (thus causing a crash when SAVEing).
5557
5558         * Added a test to stop this bug ever coming back
5559
5560 Wed Feb 18 22:21:35 2004  Ben Pfaff  <blp@gnu.org>
5561
5562         Got rid of approx.h.  In general, replaced all references to
5563         approx_eq() by ==, approx_lt() by <, etc.  Other types of changes
5564         noted below.
5565
5566         * Makefile.am: (pspp_SOURCES) Removed approx.h.
5567
5568         * data-out.c: (try_F) Replaced test for approx_eq(number, 0.0) by
5569         test for mag < EPSILON.
5570
5571         * misc.h: Add definition of EPSILON.
5572
5573 Wed Feb 18 21:32:44 2004  Ben Pfaff  <blp@gnu.org>
5574
5575         * vfm.c: (procedure) Add check to prevent recursive call.
5576
5577 Wed Feb 18 21:48:54 WST 2004 John Darrington <john@darrington.wattle.id.au>
5578
5579         * Moved the declarations relating to values to their own header file
5580           (val.h)
5581
5582         * Added levene.c and levene.h
5583
5584         * vars-atr.c: Changed the signature of compare_values to 
5585         take const * arguments.
5586                 
5587         * t-test.q: Changed the structure of struct t_test_proc 
5588        variables now contain their own group statistics information.
5589        Eventually, t_test_proc might get renamed, because it'd be 
5590        applicable to other commands too.
5591
5592 Mon Feb 16 23:15:51 2004  Ben Pfaff  <blp@gnu.org>
5593
5594         * data-out.c: Clean up.  Changed interface of convert_*() to take
5595         either a `double' or a `const char *' instead of a `const union
5596         value *'.  Update all implementations of those interfaces.
5597         (data_out) Use switch statements instead of a table.
5598         (convert_AHEX) Rewrite.
5599
5600         * format.h: Update comment.
5601
5602 Mon Feb 16 22:14:36 2004  Ben Pfaff  <blp@gnu.org>
5603
5604         * q2c.c: (dump_header) Add an Emacs header line to output files
5605         that makes generated .c files read-only by default, to make it
5606         difficult to accidentally change generated files.
5607
5608 Mon Feb 16 22:12:07 2004  Ben Pfaff  <blp@gnu.org>
5609
5610         * frequencies.q: (compare_freq_numeric_a) Compare by frequency,
5611         not bogus a->v.c <=> b->v.c pointer compare.
5612         (compare_freq_alpha_a) Ditto.
5613         (compare_freq_numeric_d) Ditto.
5614         (compare_freq_alpha_d) Ditto.
5615         
5616 Mon Feb 16 22:00:53 2004  Ben Pfaff  <blp@gnu.org>
5617
5618         Changed data_out() to store string data directly into a `union
5619         value''s s member, not indirectly into c.
5620
5621         * crosstabs.q: (output_pivot_table) Use format_short() instead of
5622         data_out().
5623         (table_value_missing) Ditto.
5624         (float_M_suffix) Ditto.
5625         (format_short) New function.
5626
5627         * data-in.h: (data_in_finite_line) Remove inline definition.
5628
5629         * data-list.c: (destroy_dls_var_spec) New function.
5630         (destroy_dls) Rewrite in terms of destroy_dls_var_spec().
5631         (data_list_source_destroy_source) Avoid cast.
5632         (struct repeating_data_trns) New field `id_value'.  Update
5633         comments.
5634         (cmd_repeating_data) Initialize id_value.  Use new
5635         repeating_data_trns_free() for freeing REPEATING DATA
5636         transformations.
5637         (rpd_parse_record) Rewrite support for record ID to be less bogus.
5638         (repeating_data_trns_free) New function.
5639
5640         * data-out.c: (data_out) Change return type to `void' by replacing
5641         error returns by writing a message into the output buffer.
5642         (convert_A) Read from v->s instead of v->c.
5643         (convert_AHEX) Ditto.
5644
5645         * expr-evl.c: Update comment.
5646         (expr_evaluate) Add assertion in OP_STRING case.
5647
5648         * format.h: (macro MAX_FORMATTED_LEN) New macro.
5649
5650         * list.q: (list_cases) Update for new data_out() semantics.
5651
5652         * print.c: (print_trns_proc) Ditto.
5653
5654         * tab.c: (tab_value) Ditto.
5655         (tab_float) Avoid stupid cast.
5656
5657         * var.h: Update comments.
5658         (macro MAX_STRING) New macro.
5659         (macro MAX_ELEMS_PER_VALUE) New macro.
5660
5661         * vars-atr.c: (compare_values) New function.
5662
5663         * vfm.c: (dump_splits) Update for new data_out() semantics.
5664
5665 Mon Feb 16 21:45:47 2004  Ben Pfaff  <blp@gnu.org>
5666
5667         * crosstabs.q: (struct table_entry) Rename v[] to values[].  All
5668         references updated.
5669         (struct crosstab) Rename v[] to vars[].  All references updated.
5670         (hash_table_entry) Replace the hash algorithm and fix a bug at the
5671         same time, which caused the hash value to depend only on a single
5672         value, not all of the variables' values.
5673         
5674 Mon Feb 16 12:49:53 2004  Ben Pfaff  <blp@gnu.org>
5675
5676         Clean up struct dictionary's value_cnt usage.
5677
5678         * dictionary.c: Add a function comment to each function.
5679         (struct dictionary) Rename value_cnt to next_value_idx, which more
5680         accurately reflects its meaning.  All references updated.
5681         (dict_rename_vars) Add assertion.
5682         (dict_get_value_cnt) Rename dict_get_next_value_idx().  All
5683         references updated.
5684         (dict_get_case_size) New function.
5685
5686         * aggregate.c: (create_sysfile) Use dict_get_case_size().
5687
5688         * get.c: (mtf_read_nonactive_records) Ditto.
5689
5690         * sort.c: (allocate_cases) Ditto.
5691         (write_initial_runs) Ditto.
5692         (merge) Ditto.
5693         (merge_once) Ditto.
5694
5695         * vfm.c: (prepare_for_writing) Ditto.
5696         (setup_lag) Ditto.
5697         (lag_case) Ditto.
5698
5699 Mon Feb 16 00:17:55 2004  Ben Pfaff  <blp@gnu.org>
5700
5701         Make vfm.c slightly less grotesque.
5702
5703         * vfm.c: (filter_var) Removed.
5704         (filter_index) Removed.
5705         (FILTERED macro) Removed.
5706         (exclude_this_case) New function.
5707         (process_active_file_write_case) Use exclude_this_case() instead
5708         of FILTERED and inline tests.
5709         (procedure_write_case) Ditto.
5710         (setup_filter) Removed.
5711         (open_active_file) Don't call setup_filter().
5712         (close_active_file) Call dict_get_filter() instead of checking
5713         filter_var.
5714
5715 Mon Feb 16 00:01:53 2004  Ben Pfaff  <blp@gnu.org>
5716
5717         * var.h: (struct variable) Update comments.
5718
5719 Sun Feb 15 23:14:59 2004  Ben Pfaff  <blp@gnu.org>
5720
5721         New functions dict_create_var_assert(), dict_lookup_var_assert().
5722         Converted several dict_*_var()/assert pairs into a single
5723         dict_*_var_assert().
5724
5725         * dictionary.c: (dict_create_var_assert) New function.
5726         (dict_lookup_var_assert) New function.
5727
5728 Sun Feb 15 23:06:08 2004  Ben Pfaff  <blp@gnu.org>
5729
5730         Got rid of "struct long_vec", envector(), devector(), etc.  Added
5731         two members `init', `reinit' to struct variable as a substitute.
5732         
5733         * Makefile.am: (pspp_SOURCES) Removed cases.c, cases.h.
5734         
5735         * cases.c: Removed.
5736
5737         * cases.h: Removed.
5738
5739         * aggregate.c: (parse_aggregate_functions) destvar doesn't need
5740         init.
5741
5742         * autorecode.c: (cmd_autorecode) destvars don't need init.
5743
5744         * compute.c: (lvalue_finalize) Set reinit.
5745
5746         * data-list.c: (fixed_parse_compatible) Don't need init usually.
5747         (dump_fmt_list) Ditto.
5748         (parse_free) Ditto.
5749
5750         * descript.q: (run_z_pass) Don't need init for z-scores.
5751
5752         * dictionary.c: (dict_create_var) Initialize `init', `reinit'
5753         members.
5754         (dict_clone_var) Copy `reinit' member, initialize `init' member.
5755
5756         * glob.c: (init_glob) Remove vec_init() calls.
5757
5758         * inpt-pgm.c: (cmd_end_input_program) Use `reinit', not `left'.
5759         
5760         * loop.c: (internal_cmd_loop) Don't need to call envector().
5761
5762         * numeric.c: (cmd_numeric) Ditto.
5763         (cmd_string) Ditto.
5764         (cmd_leave) Ditto.  Set `init', `reinit' members.
5765
5766         * recode.c: (cmd_recode) Don't need to call envector().
5767
5768         * repeat.c: (internal_cmd_do_repeat) Ditto.
5769
5770         * var.h: (struct variable) Remove `left'.  Add `init', `reinit'.
5771         (force_create_variable) Removed prototype.
5772         (force_dup_variable) Ditto.
5773
5774         * vector.c: (cmd_vector) Don't need to call envector().
5775
5776         * vfm.c: (reinit_sysmis) Removed.
5777         (reinit_blanks) Removed.
5778         (init_zero) Removed.
5779         (init_blanks) Removed.
5780         (process_active_file_write_case) No need to deal with vectors.
5781         Call clear_temp_case().
5782         (vector_initialization) Rewrite to use `init', `reinit'.
5783         (close_active_file) No need to call vec_clear().
5784         (procedure_write_case) Call clear_temp_case().
5785         (clear_temp_case) New function.
5786
5787 Sun Feb 15 20:50:36 2004  Ben Pfaff  <blp@gnu.org>
5788
5789         * pfm-write.c: (bufwrite) Get rid of nasty cast that also invoked
5790         undefined behavior.
5791
5792 Thu Feb 12 23:35:15 2004  Ben Pfaff  <blp@gnu.org>
5793
5794         Add auxiliary argument to procedure() interface.  Associated small
5795         clean-ups of vfm interface.
5796         
5797         * Updated every caller of procedure() and process_active_file() to
5798         reflect modified interface.  Simple, ordinary changes not listed
5799         otherwise below.
5800
5801         * Updated every function that implements struct case_stream's
5802         `read' function to take a write_case_func and a write_case_data.
5803         Also updated every caller of write_case() to instead call them
5804         through these arguments.  In some cases this meant that the extra
5805         args had to be threaded through a couple of extra levels.  This
5806         wasn't difficult or interesting so the details won't be given.
5807
5808         * data-list.c: (struct repeating_data_trns) Add members
5809         `write_case', `wc_data' as kluge.
5810         (read_one_set_of_repetitions) Rename repeating_data_trns_proc and
5811         make non-static.
5812         (repeating_data_set_write_case) New function.
5813
5814         * data-list.h: New file to declare repeating_data_trns_proc() and
5815         repeating_data_set_write_case().
5816
5817         * inpt-pgm.c: (input_program_source_read) Call
5818         repeating_data_set_write_case() for all the REPEATING DATA
5819         transformations, so that they know where to send their cases.
5820         It's a big kluge.  Also kluge in END CASE.
5821         (end_case_trns_proc) Never called anymore, but we still need it,
5822         so just assert(0).
5823
5824         * sort.c: (read_sort_output) Update to match struct case_stream
5825         `read' member.
5826
5827         * vfm.c: (struct write_case_data) New structure.
5828         (proc_func) Removed.
5829         (virt_proc_func) Removed.
5830         (begin_func) Removed.
5831         (virt_begin_func) Removed.
5832         (end_func) Removed.
5833         (write_case) Removed.
5834         (procedure) Added an auxiliary parameter to each function pointer
5835         argument's prototype.  Added an auxiliary data parameter.
5836         Rewrote.
5837         (process_active_file) Ditto.
5838         (process_active_file_write_case) Pass aux data along.
5839         (close_active_file) Ditto.
5840         (procedure_write_case) Ditto.
5841         (SPLIT_FILE_procfunc) Ditto.
5842
5843         * vfm.h: (typedef write_case_data) New.
5844         (typedef write_case_func) New.
5845         (struct case_stream) Add parameters to `read' member prototype.
5846         
5847 Thu Feb 12 19:24:53 WST 2004 John Darrington <john@darrington.wattle.id.au>
5848
5849         * t-test.q:  Added calculations for independent samples. (But no Levene
5850         test yet!)
5851
5852         * Makefile.am: Moved q_sources_c into own variable 
5853
5854 Wed Feb 11 23:56:51 2004  Ben Pfaff  <blp@gnu.org>
5855
5856         Miscellaneous cleanups.
5857         
5858         * Change unused to UNUSED in many source files to reflect modified
5859         pref.h.  Change use of __WIN32__, __MSDOS, __DJGPP__,
5860         __CYGWIN32__, __unix__, and unix not to assume that they're
5861         defined to a nonzero value.  Change use of __attribute__ to use
5862         NO_RETURN or PRINTF_FORMAT instead.
5863         
5864         * alloc.h: Move definitions for local_alloc(), local_free() here
5865         from ../pref.h.orig and simplify.
5866
5867         * expr-evl.c: Instead of working differently based on PAGED_STACK,
5868         use a pool allocator unconditionally.
5869         (CHECK_STRING_SPACE) Removed.
5870         (ALLOC_STRING_SPACE) Removed.
5871         (expr_evaluate) Use e->pool instead of CHECK_STRING_SPACE and
5872         ALLOC_STRING_SPACE.
5873
5874         * expr-opt.c: (dump_expression) Allocate string pool.
5875
5876         * expr-prs.c: (expr_free) Free string pool.
5877
5878         * pool.c: (pool_destroy) This pool must be removed from its
5879         parent's list of gizmos, not from its own.  Use free_all_gizmos().
5880         (pool_clear) New function.
5881         (free_all_gizmos) New function.
5882         (pool_alloc) Use space in empty block after this one if any.
5883         (pool_release) Only empty out blocks, don't actually free() them.
5884
5885         * print.c: Get rid of PAGED_STACK special case by always
5886         dynamically allocating line buffers.
5887         (struct print_trns) Always include the `line' member.
5888         (internal_cmd_print) Always initialize the `line' member.
5889         (alloc_line) Always allocate memory for `line'.
5890         (print_trns_proc) Always initialize buf from `line' member.
5891         (print_trns_free) Always free `line' memory.
5892
5893         * sort.c: (allocate_file_handles) Special-case MS-DOS for mkdir()
5894         call.
5895         
5896 Wed Feb 11 20:33:18 2004  Ben Pfaff  <blp@gnu.org>
5897
5898         * flip.c: Fixed crash from FLIP when a numeric variable is
5899           specified on NEWNAMES and a large value is used, and a couple of
5900           other minor bugs besides.
5901           (struct varname) Make name a 9-character fixed-size array
5902           instead of a 1-character variable size array.
5903           (make_new_var) Allow digits in variable names.
5904           (flip_stream_write) Limit numeric values to 8 characters and
5905           format system missing and very large and small values more
5906           appropriately.
5907
5908 Thu Feb  5 13:19:06 WAST 2004 John Darrington <john@darrington.wattle.id.au>
5909
5910         * command.c: Fixed test on command return status for the correct 
5911           value,  which had been causing a crash under certain invalid input.
5912
5913 Wed Feb  4 15:34:11 WST 2004 John Darrington <john@darrington.wattle.id.au>
5914
5915         * t-test.q: Added calculations for the one sample variant of the T-TEST
5916
5917 Tue Feb  3 20:09:54 2004  Ben Pfaff  <blp@gnu.org>
5918
5919         * tab.c: (render_strip) Fix bug that sometimes caused joined text
5920           in joined cells to be rendered outside box boundaries.
5921
5922 Tue Feb  3 18:56:45 WST 2004 John Darrington <john@darrington.wattle.id.au>
5923
5924         * random.c (rng_create): Fixed seeding so that it gets reseeded after
5925         SET seed=xx has been called.
5926
5927 Mon Jan 19 14:08:09 2004  Ben Pfaff  <blp@gnu.org> 
5928
5929         * random.c (rng_get_double): Fix always-returning-zero bug in my
5930         preferred way, and at the same time make sure rounding doesn't
5931         bite us.
5932
5933 Thu Jan  1 23:16:41 2004  Ben Pfaff  <blp@gnu.org>
5934
5935         * html.c: (change_attributes) Dead code, removed.
5936         (escape_string) Eliminate code to call change_attributes() that
5937         never actually called it.
5938         (output_tab_table) Get rid of dependence on tab_hit
5939         and struct tab_joined_cell's hit member, which are abominations.
5940
5941         * tab.c: (tab_output_text) Don't call
5942         d->class->text_set_font_by_name if it's a null pointer.
5943         (macro UNROLL_LOOP) Eliminate.
5944         (macro UNROLL_3_LOOPS) Eliminate.
5945         (tabi_render) Rewrite not to use the above macros.
5946
5947 Thu Jan  1 23:09:07 2004  Ben Pfaff  <blp@gnu.org>
5948
5949         Start working on a new output driver system, one that doesn't suck
5950         so much, by adding a "device-independent" output driver.  The idea
5951         is to write out only a single output stream, then use separate
5952         processes to translate them into whatever formats we want.  This
5953         is similar to how "groff" works with its various output drivers
5954         (grops, grotty, grodvi, ...).
5955         
5956         * Makefile.am: (pspp_SOURCES) Add devind.c, devind.h.
5957
5958         * list.q: (write_all_headers) Stub out devind class.
5959         (clean_up) Ditto.
5960         (determine_layout) Ditto.
5961         (list_cases) Ditto.
5962
5963         * output.c: (outp_init) Add devind class.
5964
5965         * devind.c: New file.
5966
5967         * devind.h: New file.
5968
5969 Thu Jan  1 23:08:14 2004  Ben Pfaff  <blp@gnu.org>
5970
5971         * frequencies.q: (hash_value_alpha) Fixed up the previous change
5972         to use the proper string length.
5973
5974 Wed Dec 31 16:27:33 WAST 2003 John Darrington <john@darrington.wattle.id.au>
5975
5976         * Fixed bug where FREQ would crash on alpha values
5977
5978 Tue Dec 30 22:42:57 2003  Ben Pfaff  <blp@gnu.org>
5979
5980         * Removed bletcherous alloca() workarounds for AIX from top of
5981         many files.  AIX can use the alternative alloca() implementation
5982         instead.
5983
5984 Tue Dec 30 22:35:16 2003  Ben Pfaff  <blp@gnu.org>
5985
5986         * ascii.c: (ascii_option) Fix implementation of headers option.
5987
5988 Tue Dec 30 22:32:53 2003  Ben Pfaff  <blp@gnu.org>
5989
5990         * ascii.c: Add a "squeeze" option to the ASCII driver to squeeze
5991         multiple blank lines into one.
5992         (struct ascii_driver_ext) Add squeeze_blank_lines option.
5993         (ascii_preopen_driver) Initialize squeeze_blank_lines.
5994         (static var option_tab) Add squeeze entry.
5995         (ascii_option) Set squeeze_blank_lines.
5996         (output_lines) Implement squeezing blank lines.
5997
5998 Wed Dec 31 07:19:46 WST 2003 John Darrington <john@darrington.wattle.id.au>
5999
6000         * Removed redundant code from output.h
6001
6002 Sat Dec 27 22:17:52 2003  Ben Pfaff  <blp@gnu.org>
6003
6004         Dictionary classes: each variable is "ordinary", "system", or
6005         "scratch".
6006
6007         * var.h: (enum dict_class) New enum.
6008
6009         * vars-prs.c: (dict_class_from_id) New function.
6010         (dict_class_to_name) New function.
6011
6012 Sat Dec 27 22:16:06 2003  Ben Pfaff  <blp@gnu.org>
6013
6014         * var.h: (struct freq_tab_set) Removed (not used).
6015
6016 Sat Dec 27 22:15:21 2003  Ben Pfaff  <blp@gnu.org>
6017
6018         * value-labels.c: (val_labs_destroy) vls needs to be freed too.
6019
6020 Sat Dec 27 22:10:49 2003  Ben Pfaff  <blp@gnu.org>
6021
6022         * stats.c: (hypercube) Rename pow4().  All references updated.
6023
6024 Sat Dec 27 22:05:49 2003  Ben Pfaff  <blp@gnu.org>
6025
6026         * rename-vars.c: (cmd_rename_variables) Rewritten.
6027         (compare_name) Removed.
6028
6029 Sat Dec 27 22:03:51 2003  Ben Pfaff  <blp@gnu.org>
6030
6031         var_set feature, and code taking advantage of it.
6032         
6033         * crosstabs.q: (static var var_dict) Removed.
6034         (static var variables) New variable.
6035         (static var variables_cnt) New variable.
6036         (cmd_crosstabs) Free variables instead of var_dict.
6037         (internal_cmd_crosstabs) Initialize and use variables,
6038         variables_cnt instead of var_dict.
6039         (free_var_dict) Removed.
6040         (crs_custom_tables) Use var_set instead of a copied dictionary.
6041         (crs_custom_variables) Set up variables, variables_cnt instead of
6042         var_dict.
6043         [DEBUGGING] (debug_print) Ditto.
6044
6045         * means.q: (mns_custom_tables) Use var_set instead of a copied
6046         dictionary.
6047
6048         * vars-prs.c: (parse_vs_variable) New function.
6049         (parse_dict_variable) Rewritten.
6050         (parse_variable) Rewritten.
6051         (parse_variables) Renamed parse_var_set_vars(), rewritten.
6052         (parse_variables) New function in terms of parse_var_set_vars().
6053         Now requires its first argument to be non-null.  All references
6054         that passed a null pointer updated to pass default_dict instead.
6055         (macro id_dict) Removed.
6056         (parse_DATA_LIST_vars) Add assertions.
6057         (parse_mixed_vars) Ditto.
6058         (struct var_set) New structure.
6059         (var_set_get_cnt) New function.
6060         (var_set_get_var) New function.
6061         (var_set_lookup_var) New function.
6062         (var_set_destroy) New function.
6063         (dict_var_set_get_cnt) New function.
6064         (dict_var_set_get_var) New function.
6065         (dict_var_set_lookup_var) New function.
6066         (dict_var_set_destroy) New function.
6067         (var_set_create_from_dict) New function.
6068         (struct array_var_set) New structure.
6069         (array_var_set_get_cnt) New function.
6070         (array_var_set_get_var) New function.
6071         (array_var_set_lookup_var) New function.
6072         (array_var_set_destroy) New function.
6073         (var_set_create_from_array) New function.
6074
6075         * q2c.c: (dump_parser) Use parse_variables(default_dict, ...)
6076         instead of parse_variables(NULL, ...) in output code.
6077
6078 Sat Dec 27 21:38:53 2003  Ben Pfaff  <blp@gnu.org>
6079
6080         Change inp_init from a 2-bit vector to an ordinary array.
6081         Initialize it all in cmd_end_input_program() instead of in
6082         create_variable().
6083
6084         * inpt-pgm.c: (enum value_init_type) New enum.
6085         (global var inp_init) Change to `enum value_init_type *', make
6086         static.
6087         (inp_init_size) Removed.
6088         (inp_nval) Change to `size_t', make static.
6089         (cmd_input_program) Don't initialize inp_init or inp_init_size.
6090         (cmd_end_input_program) Initialize inp_init, inp_nval.
6091         (init_case) Rewrite.
6092         (clear_case) Rewrite.
6093
6094         * inpt-pgm.h: Removed.
6095
6096 Sat Dec 27 21:36:38 2003  Ben Pfaff  <blp@gnu.org>
6097
6098         * hash.c: (hsh_hash_bytes) Use Fowler-Noll-Vo hash instead of
6099         Colin Plumb hash.  It is simpler and should better resist
6100         collisions.
6101         (hsh_hash_string) Ditto.
6102
6103 Sat Dec 27 21:34:57 2003  Ben Pfaff  <blp@gnu.org>
6104
6105         * get.c: (export_write_case_func) Remove debug printing code.
6106
6107 Sat Dec 27 21:11:09 2003  Ben Pfaff  <blp@gnu.org>
6108
6109         * get.c: (cmd_save_internal) Rename parameter.  Use &t->h instead
6110         of cast.
6111         (save_write_case_func) Use &trns->h instead of cast.
6112         (cmd_export) Use &t->h instead of cast.
6113
6114 Sat Dec 27 20:57:42 2003  Ben Pfaff  <blp@gnu.org>
6115
6116         Moved vectors into the dictionary.
6117
6118         * var.h: (struct vector) Moved here from vector.h.  `index' member
6119         renamed `idx', `v' renamed `var', `nv' renamed `cnt'.  All
6120         references updated.
6121         
6122         * vector.h: Removed.
6123
6124         * vector.c: (global var vec) Removed.
6125         (global var nvec) Removed.
6126         (cmd_vector) Rewritten.
6127         (find_vector) Removed.
6128
6129         * dictionary.c: (dict_create_vector) New function.
6130         (dict_get_vector) New function, replaces reading global vec[]
6131         array.
6132         (dict_get_vector_cnt) New function, replaces reading global nvec
6133         variable.
6134         (dict_lookup_vector) New function, replaces find_vector().
6135         (dict_clear_vectors) New function.
6136
6137 Sat Dec 27 20:54:01 2003  Ben Pfaff  <blp@gnu.org>
6138
6139         Start to move away from `struct variable' p `union' member to void
6140         * aux member.
6141
6142         * var.h: (struct variable) Add `aux' member.
6143
6144 Sat Dec 27 20:36:25 2003  Ben Pfaff  <blp@gnu.org>
6145
6146         Get rid of struct variable `foo' member.
6147
6148         * frequencies.q: (internal_cmd_frequencies) Use p.frq.used instead
6149         of foo.
6150         (frq_custom_variables) Ditto.
6151         (frq_custom_grouped) Ditto.
6152
6153         * get.c: (struct save_trns) Change `var' member from `int *' to
6154         `struct variable **'.
6155         (cmd_save_internal) Use aux instead of foo.
6156         (save_trns_proc) Use revised `var' member.
6157         (static var mtf_seq_no) Renamed mtf_seq_num.
6158         (static var mtf_seq_nums) New static var.
6159         (cmd_match_files) Initialize mtf_seq_nums.
6160         (mtf_free) Free mtf_seq_nums.
6161         (mtf_processing) Use mtf_seq_nums instead of foo.
6162         (mtf_merge_dictionary) No need to initialize mv->foo.
6163         (cmd_export) Use aux instead of foo.  Use revised `var' member.
6164         (mns_custom_tables) Don't use foo to check for duplicates, that's
6165         what PV_NO_DUPLICATE is for.
6166
6167         * var.h: (struct variable) Remove `foo' member.
6168         (struct frequencies_proc) New member.
6169         
6170 Sat Dec 27 19:46:13 2003  Ben Pfaff  <blp@gnu.org>
6171
6172         Clean up COMPUTE and IF.
6173
6174         * compute.c: More or less rewrite the darn thing.
6175         (struct compute_trns) Rename and reorder and add and delete
6176         members.
6177         (cmd_compute) Rewrite.
6178         (compute_num) Make conditional on test expression.  Now used for
6179         both COMPUTE and IF.
6180         (compute_num_vec) Ditto.
6181         (compute_str) Ditto.
6182         (compute_str_vec) Ditto.
6183         (cmd_if) Rewrite.
6184         (if_num) Removed.
6185         (if_num_vec) Removed.
6186         (if_str) Removed.
6187         (if_str_vec) Removed.
6188         (parse_target_expression) Renamed parse_rvalue_expression(),
6189         rewritten.
6190         (new_trns) Renamed compute_trns_create(), rewritten.
6191         (delete_trns) Removed.
6192         (free_trns) Renamed compute_trns_free(), rewritten.
6193         (struct lvalue) New structure.
6194         (parse_var_or_vec) Renamed lvalue_parse(), rewritten.
6195         (lvalue_get_type) New function.
6196         (lvalue_is_vector) New function.
6197         (lvalue_finalize) New function.
6198         (lvalue_destroy) New function.
6199         
6200 Sat Dec 27 19:44:14 2003  Ben Pfaff  <blp@gnu.org>
6201
6202         * command.def: Disallow MODIFY VARS in input mode, so that
6203         variables can't get dropped and confuse cmd_end_input_program()'s
6204         attempt to fill inp_init[].
6205         
6206         * modify-vars.c: (static var forward_positional_ordering) New
6207         variable.
6208         (struct var_modification) Entirely changed.
6209         (rearrange_dict) Interface changed, rewritten.
6210         (cmd_modify_vars) Deal with modified struct var_modification, much
6211         rewritten.
6212         (struct var_renaming) New structure.
6213         (compare_var_renaming_by_new_name) New function.
6214         (validate_var_modification) New function.
6215
6216         * var.h: (struct modify_vars_proc) Removed.
6217         (struct variable) Removed member p.mfv.
6218
6219 Sat Dec 27 19:40:26 2003  Ben Pfaff  <blp@gnu.org>
6220
6221         Make EVALUATE a valid command whether we're debugging or not, so
6222         that `make check' can succeed regardless of whether debugging is
6223         turned on.
6224         
6225         * command.def: [GLOBAL_DEBUGGING] Drop the #if.
6226
6227         * compute.c: [GLOBAL_DEBUGGING] (cmd_evaluate) Drop the #if.
6228
6229 Sat Dec 27 19:34:40 2003  Ben Pfaff  <blp@gnu.org>
6230
6231         * apply-dict.c: (cmd_apply_dictionary) Replace a ghastly switch
6232         statement by a simple if test.
6233
6234         * dfm.c: (dfm_get_record) Add assertion.
6235
6236 Sat Dec 27 17:51:26 2003  Ben Pfaff  <blp@gnu.org>
6237
6238         For each file x.c, move #include "x.h" to the very top of the
6239         include list, to catch x.h failing to include the proper headers.
6240
6241 Sat Dec 27 17:50:19 2003  Ben Pfaff  <blp@gnu.org>
6242
6243         * algorithm.c: (find) New function.
6244         (remove_equal) New function.
6245         (set_difference) New function.
6246         (adjacent_find_equal) New function.
6247         [TEST_UNIQUE] Removed test case.
6248         (copy_if) Find end test.
6249
6250 Sat Dec 27 17:42:45 2003  Ben Pfaff  <blp@gnu.org>
6251
6252         * dictionary.c: (dict_get_case_weight) New convenience function.
6253
6254         * aggregate.c: (accumulate_aggregate_info) Use
6255         dict_get_case_weight().
6256
6257         * frequencies.q: (calc_general) Ditto.
6258         (calc_integer) Ditto.
6259         (calc) Ditto.
6260
6261         * t-test.q: (groups_calc) Ditto.
6262         (z_calc) Ditto.
6263
6264 Sat Dec 27 17:29:45 2003  Ben Pfaff  <blp@gnu.org>
6265
6266         * glob.c: (global var default_dict) Change from `struct
6267         dictionary' to `struct dictionary *'.  All references changed.
6268         (init_glob) Initialize default_dict with dict_create().
6269
6270 Sat Dec 27 17:06:06 2003  Ben Pfaff  <blp@gnu.org>
6271
6272         struct dictionary now made opaque.  All related functions:
6273
6274         * get.c: (rename_variables) Removed.
6275         (dict_delete_run) Removed.
6276         
6277         * temporary.c: (copy_variable) Removed.
6278         (new_dictionary) Removed.
6279         (save_dictionary) Removed.
6280         (restore_dictionary) Removed.
6281         (free_dictionary) Removed.
6282
6283         * vars-atr.c: (clear_default_dict) Removed.
6284         (find_variable) Removed.
6285         (find_dict_variable) Removed.
6286         (create_variable) Removed.
6287         (delete_variable) Removed.
6288         (common_init_stuff) Removed.
6289         (init_variable) Removed.  Updating of inp_init moved into
6290         cmd_end_input_program().
6291         (replace_variable) Removed.
6292         (rename_variable) Removed.
6293         (clear_variable) Removed.
6294         (dup_variable) Removed.
6295
6296         * vars-prs.c: (is_varname) Removed.
6297         (is_dict_varname) Removed.
6298         (fill_all_vars) Removed.
6299
6300         * vector.c: (find_vector) Removed.
6301
6302         * weight.c: (stop_weighting) Removed.
6303
6304         * dictionary.c: New file.
6305         (dict_create) New, replaces new_dictionary().
6306         (dict_clone) New, replaces save_dictionary() and
6307         restore_dictionary().
6308         (dict_clear) New, replaces clear_default_dict().
6309         (dict_destroy) New, replaces free_dictionary().
6310         (dict_get_var_cnt) New function, replaces references to
6311         dict->nvar.
6312         (dict_get_var) New function, replaces references to dict->var[i].
6313         (dict_get_vars) New function, replaces fill_all_vars().
6314         (dict_create_var) New, replaces create_variable().  Interface
6315         drops `type' parameter, using a zero `width' to designate numeric.
6316         (dict_clone_var) New, replaces dup_variable().
6317         (dict_rename_var) New, replaces rename_variable().
6318         (dict_lookup_var) New, replaces find_variable(),
6319         find_dict_variable(), is_varname().
6320         (dict_contains_var) New function.
6321         (compare_variable_dblptrs) New function.
6322         (dict_delete_var) New function, replaces clear_variable().
6323         (dict_delete_vars) New function, replaces dict_delete_run().
6324         (dict_reorder_vars) New function.
6325         (dict_rename_vars) New function, replaces rename_variables().
6326         (dict_get_weight) New function, replaces reading dict->weight_var.
6327         (dict_set_weight) New function, replaces writing dict->weight_var
6328         or calling stop_weight(dict).
6329         (dict_get_filter) New function, replaces reading dict->filter_var.
6330         (dict_set_filter) New function, replaces writing dict->filter_var.
6331         (dict_get_case_limit) New function, replaces reading dict->N.
6332         (dict_set_case_limit) New function, replaces writing dict->N.
6333         (dict_get_value_cnt) New function, replaces reading dict->nval.
6334         (dict_compact_values) New function, replaces a loop that was
6335         replicated in several places.
6336         (dict_get_split_vars) New function, replaces reading dict->splits.
6337         (dict_get_split_cnt) New function, replaces reading
6338         dict->n_splits.
6339         (dict_set_split_vars) New function, replaces writing dict->splits.
6340         (dict_get_label) New function, replaces reading dict->label.
6341         (dict_set_label) New function, replaces writing dict->label.
6342         (dict_get_documents) New function, replaces reading
6343         dict->documents.
6344         (dict_set_documents) New function, replaces writing
6345         dict->documents.
6346         
6347         All references to above functions updated.
6348         
6349         * aggregate.c: (cmd_aggregate) Copy file label and documents from
6350         old dictionary to new by hand, because dict_create() can't do it
6351         itself.  Use dict_set_documents(), dict_set_split_vars().
6352
6353         * temporary.c: (cancel_temporary) Also set temp_dict to NULL after
6354         calling dict_destroy().
6355
6356         * data-list.c: (dls_var_spec) Remove `type' member, replace by
6357         `width'.
6358         (fixed_parse_compatible) Some slightly nontrivial changes for
6359         dict_create_var().
6360         (dump_fmt_list) Ditto.
6361         (parse_free) Ditto.
6362
6363         * file-type.c: (create_col_var) Ditto.
6364
6365         * get.c: (cmd_get) Use dict_compact_values() instead of a loop.
6366         (trim_dictionary) Use dict_delete_vars(), dict_reorder_vars().
6367         (rename_variables) Use dict_rename_vars().
6368         (mtf_merge_dictionary) Use dict_get_documents(),
6369         dict_set_documents(), dict_compact_values().
6370
6371         * pfm-read.c: (read_variables) Deal with changes to weighting.
6372
6373         * q2c.c: (dump_parser) Use dict_lookup_var() instead of
6374         is_varname() in output code.
6375
6376         * sfm-read.c: (read_header) Use dict_create(), dict_set_label(),
6377         other dictionary functions.
6378
6379         * title.c: (add_document_line) Use dict_get_documents(),
6380         dict_set_documents().
6381
6382         * vars-atr.c: (discard_variables) Use dict_clear(default_dict),
6383         reset default_handle by hand.  dict_clear() will clear vectors so
6384         there's no need for that by hand.
6385
6386         * vfm.c: (close_active_file) Move call to finish_compaction()
6387         earlier, so that we can do the compaction as a single step using
6388         dict_compact_values().  Use dict_clear_vectors().
6389         (finish_compaction) Use dict_delete_var(), dict_compact_values().
6390                 
6391         Some functions don't have replacements:
6392
6393         * vars-atr.c: (force_create_variable) Removed.  All references
6394         updated to dict_create_var() followed by an assertion.
6395         (force_dup_variable) Removed.  All references updated to
6396         dict_clone_var() followed by an assertion.
6397         
6398         * weight.c: (update_weighting) Removed.  No longer necessary, so
6399         all references removed.
6400
6401 Sat Dec 27 16:43:01 2003  Ben Pfaff  <blp@gnu.org>
6402
6403         Clean up AGGREGATE.
6404         
6405         * aggregate.c: Eliminate separation of weighted and unweighted
6406         case.  It made the code too obscure and I doubt it was actually
6407         faster.  Instead, all code uses the "weighted" code, because
6408         that's a generalization of the "unweighted" code.
6409         (FWEIGHT) Removed.
6410         (FOPTIONS) Ditto.
6411         (parse_aggregate_functions) No need to set FWEIGHT.
6412         (accumulate_aggregate_info) Get rid of FWEIGHT cases.
6413         (dump_aggregate_info) Ditto.
6414         (initialize_aggregate_info) No need for special plain_function
6415         that gets rid of FWEIGHT option.
6416
6417         * aggregate.c: Get rid of approximations.
6418         (accumulate_aggregate_info) Don't use approx_gt(), approx_lt(),
6419         approx_in_range().
6420         (aggregate_single_case) Don't use approx_ne().
6421
6422 Sat Dec 27 16:19:36 2003  Ben Pfaff  <blp@gnu.org>
6423
6424         * ascii.c (ascii_line_width): Dead code, removed.
6425
6426         * postscript.c (ps_line_width): Ditto.
6427
6428         * q2c.c (xrealloc): Ditto.
6429
6430         * count.c (internal_cmd_count): Ditto.
6431
6432         * means.q (validate_dependent_endpoint): Ditto.
6433
6434         * set.q: (cmd_gset) Ditto.
6435
6436         * weight.c: [0] (weight_trns_proc) Ditto.
6437
6438 Sat Dec 27 16:18:16 2003  Ben Pfaff  <blp@gnu.org>
6439
6440         Make the code -Wmissing-prototypes clean.
6441
6442         * Makefile.am (version.c): Add #include "version.h".
6443         
6444         * ascii.c: (ascii_open_global) Make static.
6445         (ascii_close_page) Ditto.
6446         (ascii_font_sizes) Ditto.
6447         (ascii_postopen_driver) Ditto.
6448         (ascii_close_driver) Ditto.
6449         (ascii_option) Ditto.
6450         (ascii_open_page) Ditto.
6451         (ascii_line_horz) Ditto.
6452         (ascii_line_vert) Ditto.
6453         (ascii_line_intersection) Ditto.
6454         (ascii_box) Ditto.
6455         (ascii_polyline_begin) Ditto.
6456         (ascii_polyline_point) Ditto.
6457         (ascii_polyline_end) Ditto.
6458         (ascii_text_set_font_by_name) Ditto.
6459         (ascii_text_set_font_by_position) Ditto.
6460         (ascii_text_set_font_by_family) Ditto.
6461         (ascii_text_get_font_name) Ditto.
6462         (ascii_text_get_font_family) Ditto.
6463         (ascii_text_set_size) Ditto.
6464         (ascii_text_get_size) Ditto.
6465         (ascii_text_metrics) Ditto.
6466         (ascii_text_draw) Ditto.
6467         (ascii_close_page) Ditto.
6468
6469         * cmdline.h: New header for parse_command_line().  Used where
6470         needed.
6471
6472         * command.c: Move prototypes for cmd_*() functions to command.h.
6473
6474         * command.h: Prototypes for cmd_*() functions moved here from
6475         command.c.
6476
6477         * crosstabs.q: (gamma_int) Ditto.
6478
6479         * file-handle.h: Add fh_init_files() prototype.
6480         
6481         * getline.c: (welcome) Ditto.
6482
6483         * glob.h: New header for init_glob().  Used where appropriate.
6484
6485         * hash.c: (comparison_helper) Ditto.
6486
6487         * html.c: (html_open_global) Ditto.
6488         (html_close_global) Ditto.
6489         (html_preopen_driver) Ditto.
6490         (html_postopen_driver) Ditto.
6491         (html_close_driver) Ditto.
6492         (html_option) Ditto.
6493         (html_open_page) Ditto.
6494         (html_close_page) Ditto.
6495         (html_submit) Ditto.
6496
6497         * inpt-pgm.c: (input_program_source_read) Ditto.
6498
6499         * output.c: (find_defn_value) Ditto.
6500         (destroy_list) Ditto.
6501
6502         * pfm-read.c: (read_int) Ditto.
6503
6504         * postscript.c: (ps_open_global) Ditto.
6505         (ps_close_global) Ditto.
6506         (ps_font_sizes) Ditto.
6507         (ps_preopen_driver) Ditto.
6508         (ps_postopen_driver) Ditto.
6509         (ps_close_driver) Ditto.
6510         (ps_option) Ditto.
6511         (ps_open_page) Ditto.
6512         (ps_close_page) Ditto.
6513         (ps_line_horz) Ditto.
6514         (ps_line_vert) Ditto.
6515         (ps_line_intersection) Ditto.
6516         (ps_box) Ditto.
6517         (ps_polyline_begin) Ditto.
6518         (ps_polyline_point) Ditto.
6519         (ps_polyline_end) Ditto.
6520         (ps_text_set_font_by_name) Ditto.
6521         (ps_text_set_font_by_position) Ditto.
6522         (ps_text_set_font_family) Ditto.
6523         (ps_text_get_font_name) Ditto.
6524         (ps_text_get_font_family) Ditto.
6525         (ps_text_set_size) Ditto.
6526         (ps_text_get_size) Ditto.
6527         (ps_text_metrics) Ditto.
6528         (ps_text_draw) Ditto.
6529
6530         * q2c.c: (finish_up) Ditto.
6531         (xmalloc) Ditto.
6532         (xstrdup) Ditto.
6533         (get_buffer) Ditto.
6534         (st_lower) Ditto.
6535         (st_upper) Ditto.
6536         (skip_ws) Ditto.
6537         (get_line) Ditto.
6538         (add_symbol) Ditto.
6539         (find_symbol) Ditto.
6540         (lex_get) Ditto.
6541         (force_id) Ditto.
6542         (force_string) Ditto.
6543         (match_id) Ditto.
6544         (match_token) Ditto.
6545         (skip_token) Ditto.
6546         (parse) Ditto.
6547         (parse_setting) Ditto.
6548         (parse_specifier) Ditto.
6549         (parse_specifiers) Ditto.
6550         (parse_subcommand) Ditto.
6551         (dump_specifier_vars) Ditto.
6552         (is_keyword) Ditto.
6553         (make_identifier) Ditto.
6554         (dump_declarations) Ditto.
6555         (dump_specifier_init) Ditto.
6556         (dump_vars_init) Ditto.
6557         (make_match) Ditto.
6558         (dump_specifier_parse) Ditto.
6559         (dump_subcommand) Ditto.
6560         (dump_parser) Ditto.
6561         (dump_header) Ditto.
6562         (dump_free) Ditto.
6563         (recognize_directive) Ditto.
6564
6565         * recode.c: (string_to_long) Ditto.
6566
6567         * repeat.c: (find_DO_REPEAT_substitution) Ditto.
6568
6569         * repeat.h: New header for perform_DO_REPEAT_substitutions, used
6570         where appropriate.
6571
6572         * sort.c: (sort_stream_read) Ditto.
6573         (sort_stream_mode) Ditto.
6574         
6575 Fri Dec 19 23:35:04 2003  Ben Pfaff  <blp@gnu.org>
6576
6577         * algorithm.c (binary_search): Fix comparison.
6578
6579 Fri Dec 19 23:27:45 2003  Ben Pfaff  <blp@gnu.org>
6580
6581         * algorithm.c: (binary_search) Fix assertion.
6582
6583 Fri Dec 19 21:31:48 2003  Ben Pfaff  <blp@gnu.org>
6584
6585         * sysfile-info.c: (compare_vectors_by_name) Rewrite.
6586
6587 Fri Dec 19 21:30:24 2003  Ben Pfaff  <blp@gnu.org>
6588
6589         * sort.c: (compare_case_lists) Rewrite.
6590
6591 Fri Dec 19 16:44:22 2003  Ben Pfaff  <blp@gnu.org>
6592
6593         * quicksort.c: Removed (not used).
6594
6595         * quicksort.h: Removed (not used).
6596
6597         * sort.c: Removed blp_quicksort() prototype.
6598
6599 Fri Dec 19 16:42:13 2003  Ben Pfaff  <blp@gnu.org>
6600
6601         * postscript.c: (int_2_compare) Rewrite.
6602         (compare_line) Rewrite.
6603
6604 Fri Dec 19 16:38:35 2003  Ben Pfaff  <blp@gnu.org>
6605
6606         * matrix-data.c (compare_factors) Use lexicographical_compare()
6607         algorithm.
6608         (compare_doubles) New function.
6609         
6610         * algorithm.c: (lexicographical_compare) New algorithm.
6611
6612 Fri Dec 19 16:23:45 2003  Ben Pfaff  <blp@gnu.org>
6613
6614         * matrix-data.c (compare_variables_by_mxd_vartype): Rewrite.
6615
6616 Fri Dec 19 15:54:45 2003  Ben Pfaff  <blp@gnu.org>
6617
6618         * expr-prs.c: (cmp_func) Removed.
6619         (parse_function) Use binary_search() algorithm.
6620         (compare_functions) New function.
6621         (init_func_tab) Use sort() algorithm.
6622
6623         * algorithm.c: (binary_search) New algorithm.
6624
6625 Fri Dec 19 15:50:45 2003  Ben Pfaff  <blp@gnu.org>
6626
6627         * descript.q: (display) Use sort() algorithm instead of qsort().
6628         (compare_func) Removed.
6629         (descriptives_compare_variables) New function.
6630
6631 Fri Dec 19 15:08:38 2003  Ben Pfaff  <blp@gnu.org>
6632
6633         Get rid of AVL trees.  Hashes are more appropriate for everything
6634         PSPP does.
6635
6636         * Makefile.am: (pspp_SOURCES) Remove avl.c, avl.h.
6637         
6638         * avl.c: Removed.
6639
6640         * avl.h: Removed.
6641
6642 Fri Dec 19 14:33:31 2003  Ben Pfaff  <blp@gnu.org>
6643
6644         Much code can be clarified by using C++ STL-like algorithms.  Not
6645         all uses of these algorithms are listed below, only the ones where
6646         the change to an algorithm was the only change of interest.
6647         
6648         * Makefile.am: (pspp_SOURCES) Add algorithm.c, algorithm.h.
6649         
6650         * algorithm.c: New file.
6651
6652         * algorithm.h: New file.
6653
6654         * modify-vars.c: (static var forward) Removed.
6655         (static var positional) Removed.
6656         (compare_variables) Removed.
6657         (struct ordering) New.
6658         (cmd_modify_vars) Use sort() algorithm.
6659         (compare_variables_given_ordering) New function.
6660         (rearrange_dict) Use sort() algorithm.
6661
6662         * sysfile-info.c: (cmd_display) Use sort() algorithm.
6663         (cmp_var_by_name) Removed.
6664
6665 Fri Dec 19 14:26:17 2003  Ben Pfaff  <blp@gnu.org>
6666
6667         Make file handles use a hash table.
6668         
6669         * file-handle.q: (files) Change to hash table, make static.
6670         (cmd_file_handle) Use hash table functions.
6671         (fh_get_handle_by_filename) Ditto.
6672         (fh_get_handle_by_name) Ditto.
6673         (hash_file_handle) New function.
6674         (cmp_file_handle) Rewrite.
6675         (fh_init_files) Use hash table functions.
6676
6677 Fri Dec 19 14:24:38 2003  Ben Pfaff  <blp@gnu.org>
6678
6679         Clean up FREQUENCIES.
6680         
6681         * Makefile.am: (pspp_SOURCES) Remove frequencies.g.
6682
6683         * frequencies.q: Remove a lot of old #if'd out code at the end.
6684         (internal_cmd_frequencies) Use calc() instead of calc_no_weight()
6685         or calc_weight().  Initialize percentile_values.
6686         (calc) New function based on calc_weight() from frequencies.g.
6687         (precalc) Use hash functions.
6688         (static var comparison_func) Removed.
6689         (static var comparison_param) Removed.
6690         (comparison_helper) Removed.
6691         (get_freq_comparator) New function.
6692         (not_missing) New function.
6693         (add_freq) Removed.
6694         (postprocess_freq_tab) Use hash table functions, algorithms,
6695         get_freq_comparator().  Rewrite.
6696         (cleanup_freq_tab) Rephrase.
6697         (add_percentile) Clean up spacing.
6698         (hash_value_numeric) New function.
6699         (hash_value_alpha) New function.
6700         (compare_value_numeric_a) Rewrite.
6701         (compare_value_alpha_a) Rewrite.
6702         (compare_value_numeric_d) Rewrite.
6703         (compare_value_alpha_d) Rewrite.
6704         (compare_freq_numeric_a) Rewrite.
6705         (compare_freq_alpha_a) Rewrite.
6706         (compare_freq_numeric_d) Rewrite.
6707         (compare_freq_alpha_d) Rewrite.
6708         (calc_stats) Clean up mode, percentiles, max.
6709         (dump_statistics) Clean up spacing.
6710         
6711         * frequencies.g: Removed.
6712
6713         * var.h: (struct freq_tab) Change `data' to hash table.
6714
6715 Fri Dec 19 14:15:46 2003  Ben Pfaff  <blp@gnu.org>
6716
6717         * file-handle.h: Remove declaration of global variable `files',
6718         which wasn't used anywhere.
6719
6720         * postscript.c: (add_encoding) Remove superfluous cast.
6721         (line) Ditto.
6722
6723         * sfm-read.c: [linux] (bswap_int32) Drop ntohl() non-portable
6724         version.
6725
6726         * temporary.c: [0] (display_tree) Removed.
6727
6728 Fri Dec 19 14:13:04 2003  Ben Pfaff  <blp@gnu.org>
6729
6730         Implement a new random number generator based on the alleged RC4
6731         algorithm.
6732
6733         * expr-evl.c: (expr_evaluate) Use rng_get_double_normal() instead
6734         of rand_normal().
6735
6736         * random.c: [!HAVE_GOOD_RANDOM] (real_rand) Removed.
6737         [!HAVE_GOOD_RANDOM] (real_srand) Removed.
6738         (macro k) Removed.
6739         (static var V[]) Removed.
6740         (static var Y) Removed.
6741         (static var X2) Removed.
6742         (setup_randomize) Removed.
6743         (shuffle) Removed.
6744         (rand_uniform) Removed.
6745         (rand_normal) Removed.
6746         (struct rng) New structure.
6747         (rng_create) New function.
6748         (rng_destroy) New function.
6749         (swap_byte) New static function.
6750         (rng_seed) New function.
6751         (rng_get_bytes) New function.
6752         (rng_get_int) New function.
6753         (rng_get_unsigned) New function.
6754         (rng_get_double) New function.
6755         (rng_get_double_normal) New function.
6756         (pspp_rng) New function.
6757
6758         * random.h: Sync up to random.c.
6759
6760         * sample.c: (struct sample_trns) Make `frac' unsigned and a
6761         fraction of UINT_MAX, not 65536.
6762         (cmd_sample) Use rng_get_unsigned(), rng_get_double(), UINT_MAX
6763         fraction.
6764
6765         * vfm.c: (open_active_file) No need to call setup_randomize() any
6766         longer.
6767
6768 Fri Dec 19 12:05:56 2003  Ben Pfaff  <blp@gnu.org>
6769
6770         Change dictionary name indexes to use hash tables instead of AVL
6771         trees.
6772
6773         * crosstabs.q: (free_var_dict) Use hash tables.
6774         (crs_custom_tables) Ditto.
6775         (calc_general) Ditto.
6776         (compare_table_entry) Rewrite.
6777         (enum_var_values) Reorder parameters.  All references updated.
6778         Rewrite.
6779
6780         * get.c: (rename_variable) Use hash tables.
6781         (mtf_merge_dictionary) Ditto.
6782
6783         * glob.c: (init_glob) Use hash tables.
6784         (cmp_variable) Removed.
6785
6786         * means.q: (mns_custom_tables) Use hash tables.
6787
6788         * modify-vars.c: (rearrange_dict) Use hash tables.
6789
6790         * rename-vars.c: (cmd_rename_variables) Use hash tables.
6791
6792         * sfm-read.c: (read_header) Use hash tables.
6793         (read_variables) Ditto.
6794
6795         * temporary.c: (new_dictionary) Use hash tables.
6796         (save_dictionary) Ditto.
6797         (restore_dictionary) Ditto.
6798
6799         * var.h: (struct dictionary) Change AVL tree `var_by_name' into
6800         hash table `name_tab'.
6801
6802         * vars-atr.c: [DEBUGGING] (dump_one_var_node) Removed.
6803         [DEBUGGING] (dump_var_tree) Removed.
6804         (find_variable) Use hash tables.
6805         (find_dict_variable) Ditto.
6806         (common_init_stuff) Ditto.
6807         (rename_variable) Ditto.
6808         (clear_variable) Ditto.  Also, remove debug code.
6809         (dup_variable) Use hash tables.
6810
6811         * vars-prs.c: (fill_all_vars) Use hash tables.
6812         (is_dict_varname) Ditto.
6813         (parse_dict_variable) Ditto.
6814         
6815 Fri Dec 19 11:46:23 2003  Ben Pfaff  <blp@gnu.org>
6816
6817         Change value labels to use hash tables instead of AVL trees, and
6818         change value labels into an ADT.
6819
6820         * Makefile.am: (pspp_SOURCES) Add value-labels.c, value-labels.h.
6821         
6822         * value-labels.c: New file.
6823
6824         * value-labels.h: New file.
6825
6826         * apply-dict.c: (cmd_apply_dictionary) Use value label ADT.
6827         Get rid of a stupid use of goto.
6828
6829         * autorecode.c: (compare_alpha_value) Rewrite.
6830         (hash_alpha_value) Ditto.
6831         (compare_numeric_value) Rewrite.
6832         (hash_numeric_value) Ditto.
6833
6834         * frequencies.q: (dump_full) Use value label ADT.
6835
6836         * pfm-read.c: (read_value_label) Use value label ADT.
6837
6838         * pfm-write.c: (write_value_labels) Use value label ADT.
6839
6840         * sfm-read.c: (read_variables) Use value label ADT.
6841         (read_value_labels) Rewrite.
6842
6843         * sfm-write.c: (write_value_labels) Rewrite.
6844
6845         * sysfile-info.c: (cmd_sysfile_info) Use value label ADT.
6846         (display_variables) Ditto.
6847         (describe_variable) Ditto.
6848
6849         * t-test.q: (print_t_groups) Use value label ADT.
6850
6851         * temporary.c: (copy_variable) Use value label ADT.
6852         (free_dictionary) Ditto.
6853
6854         * val-labs.c: (verify_val_labs) Use value label ADT.
6855         (get_label) Ditto.
6856         (debug_print) Ditto.
6857         (val_lab_cmp) Removed.
6858         (inc_ref_count) Removed.
6859         (copy_value_labels) Removed.
6860
6861         * var.h: (struct value_label) Removed.
6862         (struct variable) Change AVL tree `val_lab' into hash table
6863         `val_labs'.
6864
6865         * vars-atr.c: (init_variable) Use value label ADT.
6866         (clear_variable) Ditto.
6867         (free_value_label) Removed.
6868         (free_val_lab) Removed.
6869         (get_val_lab) Removed.
6870         (compare_variables) New function.
6871         (hash_variable) New function.
6872
6873         * vfm.c: (dump_splits) Use value label ADT.
6874
6875 Fri Dec 19 11:18:11 2003  Ben Pfaff  <blp@gnu.org>
6876
6877         Add to the hash table interface.
6878
6879         * hash.c: (hsh_hash_bytes) Add assertion.
6880         (hsh_hash_string) Ditto.
6881         (hsh_clear) Ditto.
6882         (hsh_rehash) Ditto.
6883         (hsh_probe) Ditto.
6884         (hsh_create) Ditto.  Also make minimum `size'.
6885         (hsh_destroy) Rephrase.
6886         (sort_nulls_last) Removed.
6887         (not_null) New function.
6888         (hsh_data) Ditto.
6889         (comparison_helper) Ditto.
6890         (hsh_sort) Rewritten.
6891         (hsh_data_copy) New function.
6892         (hsh_sort_copy) Ditto.
6893         (hsh_insert) Ditto.
6894         (hsh_replace) Ditto.
6895         (hsh_hash_double) Ditto.
6896         (hsh_delete) Fix stupid bug.
6897         
6898 Thu Dec 18 12:27:03 WAST 2003 John Darrington <john@darrington.wattle.id.au>
6899         * added a calculation of the mode to FREQUENCIES
6900
6901 Wed Dec 17 12:53:01 WAST 2003 John Darrington <john@darrington.wattle.id.au>
6902
6903         * moved (un)defs of DEBUGGING to config.h
6904
6905 Mon Dec 15 21:35:59 2003  Ben Pfaff  <blp@gnu.org>
6906
6907         * groff-font.c: (add_kern) Fix indentation.
6908         (add_kern) Use & instead of % to take power-of-2 modulus.
6909         (font_get_kern_adjust) Likewise.
6910
6911 Fri Dec 12 23:54:37 2003  Ben Pfaff  <blp@gnu.org>
6912
6913         * autorecode.c: (recode) Replace stupid use of memcpy() by
6914         memberwise copy.
6915         (hash_alpha_value) Use hsh_hash_bytes().  Get rid of nasty casts.
6916         (hash_numeric_value) Ditto.
6917         (autorecode_proc_func) pool_strdup() was wrong here because the
6918         source string was not null-terminated.  Use new pool_strndup()
6919         instead.
6920
6921         * crosstabs.q: (enum_var_values) Remove superfluous and bizarre
6922         use of hsh_iterator_init().
6923
6924         * data-in.c: (parse_N) Initialize i->v->f.
6925
6926         * flip.c: (cmd_flip) Use memmove(), not memcpy(), to copy
6927         overlapping arrays.
6928
6929         * groff-font.c: Use power-of-2 hash table sizes, not prime.
6930         (groff_read_font) Don't call hsh_next_prime().  Don't call
6931         fclose(NULL).
6932         (static var hash) Remove `size_p', `max_used' members.
6933         (font_char_name_to_index) Don't call hsh_next_prime().  Use
6934         hsh_hash_string() instead of hashpjw(), & instead of %.
6935         (default_font) Don't call hsh_next_prime().
6936
6937         * pool.c: (pool_strndup) New function.
6938         (pool_strdup) Reimplement in terms of pool_strndup.
6939
6940         * postscript.c: (hash_font_entry) Use hsh_hash_string().  Get rid
6941         of nasty casts.
6942         (hash_ps_encoding) Use hsh_hash_string().
6943         (hash_ps_combo) Use hsh_hash_string(), hsh_hash_int().
6944         (hash_filename2font) Use hsh_hash_string().
6945
6946         * som.c: Add #include <stdlib.h>.
6947
6948         * tab.c: (tab_destroy) Don't set t->container after freeing `t'
6949         (by destroying its pool).
6950         
6951 Fri Dec 12 23:18:59 2003  Ben Pfaff  <blp@gnu.org>
6952
6953         Miscellaneous hash table code cleanup:
6954         
6955         * hash.h: (struct hsh_table) Moved into hash.c.
6956         (hsh_count) Ditto, and transformed into function.
6957         (hsh_compare_func) New typedef, used for defining otherwise-long
6958         function types here and in hash.c
6959         (hsh_hash_func) Ditto.
6960         (hsh_free_func) Ditto.
6961         
6962         * hash.c: (struct hsh_table) Renamed `n' to `used', `m' to `size',
6963         `table' to `entries'.  Removed `mp'.  All references updated.
6964         (hsh_clear) Don't shrink entries array; if the hash was this big
6965         once, it probably will be again.
6966         (hsh_rehash) Made static.
6967         (force_hsh_insert) Renamed hsh_force_insert.
6968         (force_hsh_find) Renamed hsh_force_find.
6969
6970         Made hash table sizes powers of 2, because that's fine with any
6971         reasonable hash function and because taking a power-of-2 modulus
6972         is faster than any other:
6973         
6974         (hsh_prime_tab) Removed;
6975         (hsh_next_prime) Ditto.
6976         (next_power_of_2) New function.
6977         (hsh_create) Use next_power_of_2.
6978         (hsh_rehash) Use & instead of %.
6979
6980         Cleaned up hsh_sort:
6981         
6982         (internal_comparison_fn) Removed.
6983         (sort_nulls_last) New function.
6984         (hsh_sort) Removed second parameter, switched to using the new
6985         quicksort() function from quicksort.h to avoid using nasty need
6986         for static variables with qsort().  All references updated.
6987
6988         Changed the hash functions offered, because there are better hash
6989         functions than the ones we had, and cleaned up the names to boot:
6990         
6991         * hash.c: (hashpjw_d) Removed.
6992         (hashpjw) Ditto.
6993         (hsh_hash_bytes) New function.
6994         (hsh_hash_string) New function.
6995         (hsh_hash_int) New function.
6996
6997         Improved the hash table iteration interface:
6998         
6999         * hash.h: (hsh_iterator_init) Removed.
7000         (struct hsh_iterator) Removed `init' member, change `next' to
7001         size_t.
7002
7003         * hash.c: (hsh_foreach) Removed.  All references updated to use
7004         hsh_first/hsh_next instead.
7005         (hsh_first) New function.  Notably, unlike hsh_foreach() it does
7006         not treat a null pointer as an empty hash table.
7007         (hsh_next) New function.
7008
7009         Made deletion possible, though slow:
7010
7011         * hash.c: (locate_matching_entry) New function.
7012         (hsh_find) Use locate_matching_entry().
7013         (hsh_delete) New function also using locate_matching_entry().
7014         (hsh_force_delete) New function.
7015
7016 Fri Dec 12 23:16:10 2003  Ben Pfaff  <blp@gnu.org>
7017
7018         * quicksort.c: New file implementing a sort routine with a
7019         interface better than qsort() because it passes a user-provided
7020         parameter to the sort routine.
7021
7022         * Makefile.am: Add quicksort.c, quicksort.h.
7023
7024 Fri Dec 12 13:31:58 2003  Ben Pfaff  <blp@gnu.org>
7025
7026         * All source files: Get rid of nasty special cases for Checker,
7027         which is pretty obsolete now.
7028
7029 Thu Dec 11 21:38:24 WST 2003 John Darrington <john@darrington.wattle.id.au>
7030
7031         * Fixed a bug apparent when using the FREQUENCIES command with the
7032         html driver.  The html driver was incorrectly trying to display 
7033         empty cells.
7034
7035 Sun Jan  2 21:40:13 2000  Ben Pfaff  <blp@gnu.org>
7036
7037         * Makefile.am: Reorganized.  Put locale dir in version.c instead
7038         of passing it to each compile command.  Only put local gmp libs in
7039         LD_ADD if not installed on system.  Remove `boast' target.
7040
7041         * All source files: struct and union typedefs eliminated.
7042         `sizeof type' replaced by `sizeof object' where practical.  Moved
7043         `unused' qualifiers from start to end of declarations for gcc
7044         2.7.2 compatibility.  Change `while (1)' to `for (;;)'.  Made
7045         assertions on pointers strictly compliant.  Removed _ prefixes on
7046         some function parameter names.
7047
7048         * alloc.c: New source file, containing these external linkage
7049         functions removed from common.c: xmalloc, xcalloc, xrealloc,
7050         xstrdup.
7051
7052         * arena.c: Removed.
7053         
7054         * arena.h: Removed.
7055
7056         * ascii.c: Migrated from arenas to pools.
7057         (struct ascii_driver_ext) ops[], box[], fonts[] changed from
7058         c_string to len_string.  All references changed.
7059         (ascii_option) Signature changed to comply to new output.c
7060         interface.
7061         (count_fancy_chars) Removed.
7062         (delineate) Removed support for rich text.
7063         (ascii_text_metrics) Ditto.
7064         (text_draw) Ditto.
7065         (output_shorts) Change `box', `off', `on' from c_string to
7066         len_string.  Change `remaining' from int to size_t.
7067         (ascii_close_page) Make page numbering less haphazard.
7068
7069         * autorecode.c: Migrate from arenas to pools.
7070
7071         * avl.c: Migrate from arenas to pools.  Synch from libavl 1.4.0.
7072
7073         * bitvector.h: New file containing these macros from misc.h:
7074         SET_BIT, CLEAR_BIT, SET_BIT_TO, TEST_BIT, BIT_INDEX.
7075
7076         * command.c: (struct command) cmd1, cmd2, cmd3 members changed to
7077         word[3].  ncmd removed.
7078         (var empty_string) Removed.
7079         (var cmd_table) Declaration updated.
7080         (var cmdtab) Removed.
7081         (cmp_command) Removed.
7082         (split_words) Rewritten to use strtok_r().
7083         (init_cmd_parser) Renamed cmd_init().  Rewritten.
7084         (find_command) Removed.
7085         (FILE_TYPE_okay) Rewritten.
7086         (cmd_parse) Rewritten.  Semantics of the return value of command
7087         handlers has changed: they must now return one of the new CMD_*
7088         enumerals, rather than a magic value.  This meant that all
7089         commands had to be modified, and they were.
7090         (figure_out_command) New function.
7091
7092         * command.def: Add CORRELATIONS, PEARSON CORRELATIONS.  Add
7093         #defines for INIT, INPU, etc.
7094
7095         * command.h: New CMD_* enum series.
7096         (cur_proc) Make const char *, not char *.
7097         (cmd_init) Prototype.
7098         (cmd_parse) Ditto.
7099
7100         * common.c: Removed.
7101
7102         * common.h: Removed.
7103
7104         * correlations.q: New file.
7105
7106         * crosstabs.q: Migrate from arenas to pools.  Migrate to new-style
7107         q2c.
7108         (custom_tables) Renamed crs_custom_tables().
7109         (custom_variables) Renamed crs_custom_variables().
7110         (calc_integer) Add in some `const' qualifiers.
7111         (table_value_missing) Change from a_string to len_string.
7112         (float_M_suffix) Change from a_string to len_string.
7113
7114         * data-in.c: Rewritten.  All references to
7115         parse_string_as_format() changed to data_in().
7116
7117         * data-in.h: New file.
7118
7119         * data-list.c: Change DLS_* from #define's to enums.  Move from
7120         rpd_msg() to tmsg().
7121         (RPD_ERR) New #define.
7122         (do_reading) Change dfm_push_cust() to dfm_push(), pop_cust() to
7123         dfm_pop().
7124         (read_from_data_list_fixed) Change from old
7125         parse_string_as_format() to new data_in().
7126         (read_from_data_list_free) Ditto.
7127         (read_from_data_list_list) Ditto.
7128         (cmd_repeating_data) Modify approach to checking for end of
7129         command.
7130         (rpd_msg) Removed.
7131         (rpd_parse_record) Change from old parse_string_as_format() to new
7132         data_in().  Change from old convert_format_to_string() to new
7133         data_out().
7134         (read_one_set_of_repetitions) Change dfm_push_cust() to
7135         dfm_push(), pop_cust() to dfm_pop().
7136
7137         * data-out.c: Rewritten.  All references to
7138         convert_format_to_string() changed to data_out().
7139
7140         * descript.q: Migrate to new q2c.
7141         (cmd_descriptives) Removed.
7142         (internal_cmd_descriptives) Renamed cmd_descriptives ().
7143         (custom_variables) Renamed dsc_custom_variables().
7144
7145         * dfm.c: (struct dfm_fhuser_ext) `ln' removed.  All references
7146         removed.
7147         (open_file_r) Initialize h->where.line_number.  Migrate to new
7148         struct string.
7149         (open_file_w) Initialize h->where.line_number.
7150         (read_record) Change from ext->ln to h->where.line_number.
7151         Migrate to struct string.
7152         (dfm_put_record) Rephrased.
7153         (dfm_push_cust) Renamed dfm_push(), rewritten.
7154         (dfm_pop) New function.
7155
7156         * error.c: All references updated.
7157         (glob var error_count) Renamed err_err_count.
7158         (glob var warning_count) Renamed err_warning_count.
7159         (glob var error_already_flagged) Renamed err_already_flagged.
7160         (glob var verbosity) Renamed err_verbosity.
7161         (glob var cust_fn) Removed.
7162         (glob var cust_ln) Removed.
7163         (static var file_loc) New.
7164         (static var nfile_loc) New.
7165         (static var mfile_loc) New.
7166         (tmsg) New function.
7167         (push_cust) Removed.
7168         (pop_cust) Removed.
7169         (msg) Rewritten.
7170         (static var terminating) Removed.
7171         (failure) Renamed err_failure().
7172         (hcf) Renamed err_hcf().
7173         (err_push_file_locator) New function.
7174         (err_pop_file_locator) New function.
7175         (err_location) New function.
7176         (check_error_count) Renamed err_check_count().
7177         (vmsg) Renamed err_vmsg().  Interface changed.
7178         (verbose_msg) Removed.
7179         (err_cond_fail) New function.
7180         (error_break) Renamed err_break().
7181
7182         * error.h: All references updated.
7183         (enum MSG_CLASS_COUNT) Renamed ERR_CLASS_COUNT.
7184         (enum ERR_CLASS_MASK, ERR_VERBOSITY_SHIFT, ERR_VERBOSITY_MASK)
7185         New.
7186         (struct file_locator) New.
7187         (struct error) New.
7188         (macro verbose_msg) Removed.
7189         (macro cond_fail) Removed.
7190
7191         * expr-opt.c: (evaluate_tree) sizeof(char) == 1.
7192
7193         * expr-prs.c: Reorganized.  All references updated.
7194         (exprtypename) Renamed expr_type_name().
7195         (typename) Renamed type_name().
7196         (free_expression) Renamed expr_free().
7197         (parse_expression) Renamed expr_parse().  Uses new type_check()
7198         function.
7199         (init_functab) Renamed init_func_tab().
7200         (type_check) New function.
7201         (parse_or) Rewritten to use new allocate_nonterminal() and
7202         append_nonterminal_arg() functions.
7203         (parse_and) Ditto.
7204         (parse_not) Ditto.
7205         (parse_rel) Ditto.  Also simplified logic.
7206         (parse_add) Ditto.
7207         (parse_mul) Ditto.
7208         (parse_neg) Ditto.
7209         (parse_exp) Ditto.
7210         (SYSMIS_func) Ditto.
7211         (VALUE_func) Rephrased.
7212         (CONCAT_func) Fix memory leak by replacing free by free_node on
7213         lossage.
7214         (generic_str_func) Ditto.
7215         (parse_function) Ditto.  Also rephrasings.  Uses bsearch() to find
7216         function.
7217         (allocate_nonterminal) New function.
7218         (append_nonterminal_arg) New function.
7219         (static func_tab[]) Now at file level.
7220         (cmp_func) Moved.
7221         (init_func_tab) Moved.  Now just uses qsort() to sort func_tab[].
7222
7223         * expr.h: (enum series OP_*) Moved to exprP.h.
7224         (OP_* defines) Ditto.
7225         (struct op_desc) Ditto.
7226         (global ops[]) Ditto.
7227         (struct num_con_node) Ditto.
7228         (struct str_con_node) Ditto.
7229         (struct var_node) Ditto.
7230         (struct lag_node) Ditto.
7231         (struct casenum_node) Ditto.
7232         (struct nonterm_node) Ditto.
7233         (union any_node) Members renamed.
7234         (struct sys_node) Removed.
7235         (struct val_node) Removed.
7236         (operator typedef) Removed.
7237         (typedef exprtype) Removed.
7238         (enum series EX_*) Moved to exprP.h.
7239         (struct expression) Ditto.  Also renamed a lot of the members.
7240         (PXP_* defines) Changed to enums.
7241         (free_node prototype) Moved to exprP.h.
7242
7243         * file-handle.h: (struct file_handle) New member `where'.
7244
7245         * file-handle.q: Migrated to new q2c format.
7246         (prepend_current_directory) Removed (dead code).
7247         (cmd_file_handle) Incorporated all of internal_cmd_file_handle().
7248         (fh_get_handle_by_filename) Removed dead code.
7249         Set new `where' member.
7250
7251         * file-type.c: (file_type_source_read) References to
7252         parse_string_as_format() changed to data_in().
7253         dfm_push_cust()/pop_cust() changed to dfm_push()/dfm_pop().
7254
7255         * filename.c: All references updated.
7256         (init_filename) Renamed fn_init().
7257         (expand_line) Removed.
7258         (macro EXPAND_LINE) Removed.
7259         (interp_vars) Renamed fn_interp_vars().  Now uses st_*() instead
7260         of custom functions.
7261         (gnu_getcwd) Renamed fn_get_cwd(), rewritten.
7262         (tilde_expand) Renamed fn_tilde_expand(), uses ds_*().
7263         (normalize_filename) Renamed fn_normalize().
7264         (search_path) Renamed fn_search_path(), rewritten.
7265         (prepend_dir) Renamed fn_prepend_dir().
7266         (blp_getenv) Renamed fn_getenv().
7267         (blp_dirname) Renamed fn_dirname().
7268         (fn_basename) New function, not used.
7269         (absolute_filename_p) Renamed fn_absolute_p().
7270         (is_special_filename) Renamed fn_special_p().
7271         (file_exists) Renamed fn_exists_p().
7272         (readlink_malloc) Renamed fn_readlink().
7273         (getenv_default) Renamed fn_getenv_default().
7274         (open_file) Renamed fn_open().
7275         (close_file) Renamed fn_close().
7276         (open_file_ext) Renamed fn_open_ext().
7277         (close_file_ext) Renamed fn_close_ext().
7278
7279         * font.h: Migrate from arenas to pools.
7280
7281         * format.c: (parse_format_specifier_name) Deal with ds_* strings.
7282
7283         * frequencies.g: Migrate from arenas to pools.
7284
7285         * frequencies.q: Migrate to new q2c version.  Migrate from arenas
7286         to pools.
7287
7288         * getline.c: All references updated.
7289         (global getl_buf) Changed from char * to struct string.
7290         (static getl_include_path) Ditto.
7291         (global getl_buf_len) Removed.
7292         (global getl_buf_size) Removed.
7293         (getl_include_path) Deal with new getl_buf, getl_include_path.
7294         (getl_uninitialize) New function.
7295         (getl_get_current_directory) Rewritten.
7296         (getl_clear_include_path) Rewritten.
7297         (getl_add_include_dir) Rewritten.
7298         (getl_add_file) Assertion fixed.
7299         (getl_add_virtual_file) Change initial value of `remaining_loops'
7300         from 2 to 1.
7301         (welcome) Rewritten.
7302         (handle_line_buffer) Make static.  Change logic to make
7303         getl_add_virtual_file() change sensible.  Use ds_*() strings.
7304         (getl_read_line) Use ds_*() strings.  Implement SET ECHO.
7305         (getl_close_file) Moved.
7306         (getl_location) New function.
7307
7308         * getline.h: All references updated.
7309         (macro curln) Removed.
7310         (macro curfn) Removed.
7311         (macro am_interactive) Renamed getl_am_interactive.
7312         (macro am_reading_script) Renamed getl_reading_script.
7313
7314         * glob.c: (global fmt_parse_ignore_error) Removed.
7315         (init_glob) Use locale_dir not LOCALEDIR.  Use feholdexcept() on
7316         systems that support it (C99).  Turn off SET ECHO by default.  No
7317         necessary julcal initialization anymore.
7318
7319         * groff-font.c: Migrate from arenas to pools.
7320         (groff_read_font) Use err_push_file_locator().
7321         (groff_read_DESC) Ditto.
7322         (font_msg) Use tmsg().
7323
7324         * hash.c: (hsh_sort) Fix debug code.
7325         [GLOBAL_DEBUGGING] Include stdio.h.
7326
7327         * hash.h: (macro force_hsh_insert) Rephrase.
7328
7329         * heap.c: Rewritten.
7330         
7331         * heap.h: Rewritten.
7332
7333         * html.c: (html_option) Change from outp_value to struct string.
7334         (postopen) Change from curfn to getl_location().
7335         (escape_string) Remove rich-text code.  Signature changed.
7336         (output_tab_table) Switch from a_string to struct len_string.
7337         Remove rich text support.
7338
7339         * lexer.c: All references updated.  Largely rewritten.  Major
7340         changes listed below.  Removed tagged quote support.  Adapted to
7341         struct string tokstr.
7342         (global tokstr) Changed to struct string.
7343         (global tokstr_size) Removed.
7344         (global tokstr_len) Removed.
7345         (global tokid) New.
7346         (global tokint) Removed.
7347         (global toklongstr) Removed.
7348         (C* defines) Removed.
7349         (static tbl[]) Removed.
7350         (static id[]) Removed.
7351         (static une[]) Removed.
7352         (discard_line) Renamed lex_discard_line().
7353         (get_entire_line) Renamed lex_entire_line().
7354         (get_rest_of_line) Renamed lex_rest_of_line().
7355         (get_dotted_rest_of_line) Merged into lex_rest_of_line().
7356         (make_hexit) Removed.
7357         (syntax_error) Renamed lex_error().  Return value removed.
7358         (get_token_representation) Renamed lex_token_representation().
7359         (putback) Renamed lex_put_back().
7360         (putfwd) Renamed lex_put_forward().
7361         (convert_negative_to_dash) Renamed lex_negative_to_dash().
7362         (set_prog) Renamed lex_set_prog().
7363         (init_lex) Renamed lex_init().
7364         (reset_eof) Renamed lex_reset_eof().
7365         (lookahead) Renamed lex_look_ahead().
7366         (check_id) Rewritten.
7367         (yylex) Renamed lex_get(), rewritten.
7368         (lex_end_of_command) New function.  Many commands were rephrased
7369         using this.
7370         (lex_integer_p) New function.  Replaces compare of tokint against
7371         NOT_LONG.
7372         (lex_integer) New function.  Replaces tokint.
7373         (match_tok) Renamed lex_match().
7374         (match_id) Renamed lex_match_id().
7375         (match_int) Renamed lex_match_int().
7376         (force_match_id) Renamed lex_force_match_id(), added return value.
7377         (force_match) Renamed lex_force_match(), added return value.
7378         (force_string) Renamed lex_force_string(), added return value.
7379         (force_int) Renamed lex_force_int(), added return value.
7380         (lex_id_match_len) New function.
7381         (id_match) Renamed lex_id_match(), rewritten.
7382         (get_line) Renamed lex_get_line().
7383         (preprocess_line) Renamed lex_preprocess_line().
7384         (tokname) Renamed lex_token_name().
7385         (bin_value_func) Removed.
7386         (oct_value_func) Removed.
7387         (hex_value_func) Removed.
7388         (unexpected_eof) New function.
7389         (convert_numeric_string_to_char_string) New function.
7390         (parse_string) Rewritten, signature changed.
7391         (add_tokstr_char) Removed.
7392         (add_tokstr_unsigned) Removed.
7393         (add_tokstr_string) Removed.
7394         (parse_tagged_quote) Removed.
7395         (skip_comment) Renamed lex_skip_comment().
7396
7397         * lexer.h: All references updated.
7398         (macro is_id1) Renamed CHAR_IS_ID1.
7399         (macro is_idn) Renamed CHAR_IS_IDN.
7400         (token names ID, NUM, STRING, STOP, ... WITH, EXP) Renamed with
7401         prefix T_: T_ID, T_NUM, T_STRING, T_STOP, ... T_WITH, T_EXP.
7402         (macro get_token) Removed.
7403         (macro id_match) Removed.
7404         (macro force_match_id) Removed.
7405         (macro force_match) Removed.
7406         (macro force_string) Removed.
7407         (macro force_int) Removed.
7408         (macro force_num) Removed.
7409         (macro force_id) Removed.
7410
7411         * lexerP.h: Removed.
7412
7413         * list.q: Migrated to new q2c format.
7414         (write_line) Deal with struct len_string.
7415         (write_varname) Ditto.
7416         (write_fallback_headers) Ditto.
7417
7418         * magic.c: New file, incorporating the following global variables
7419         previously in other files: endian, second_lowest_value.  And both
7420         of those are conditional on #define's.
7421
7422         * magic.h: New file, incorporating the following global variable
7423         declarations: endian, second_lowest_value, and the following macro
7424         declarations: NOT_DOUBLE, NOT_LONG, NOT_INT.
7425
7426         * main.c: Added declarations of pgmname, finished, curdate,
7427         start_interactive.
7428         (main) Call new parse_script() function.
7429         (parse_script) New function.
7430         (execute_command) New function.
7431         (dump_token) Removed.
7432         (handle_error) New function.
7433
7434         * matrix.c: New file.
7435
7436         * matrix.h: New file.
7437
7438         * matrix-data.c: Migrated from arenas to pools.
7439         (mget_token) Change from parse_string_as_format() to data_in().
7440
7441         * means.q: Migrate to new q2c.
7442         (custom_tables) Renamed mns_custom_tables().
7443         (custom_crossbreak) Renamed mns_custom_crossbreak().
7444         (custom_variables) Renamed mns_custom_variables().
7445
7446         * mis-val.c: (static var width) Changed from `int' to `size_t'.
7447         (parse_varnames) Prototype.
7448         (parse_numeric) Rephrasings.
7449         (parse_alpha) Adapt to new struct string tokstr.
7450
7451         * misc.c: (intlog10) Rewritten.
7452         (spacing) Removed.
7453         (ansi_rand) Renamed real_rand(), moved into random.c.
7454         (ansi_srand) Renamed real_srand(), moved into random.c.
7455         (setup_randomize) Moved to random.c.
7456         (rand_uniform) Ditto.
7457         (rand_normal) Ditto.
7458         (rand_simple) Ditto.
7459         (get_config_line) Removed.
7460         (reverse) Removed (dead code).
7461
7462         * misc.h: (macro SET_BIT) Moved to bitvector.h.
7463         (macro CLEAR_BIT) Ditto.
7464         (macro TEST_BIT) Ditto.
7465         (macro SET_BIT_TO) Ditto.
7466         (macro BIT_INDEX) Ditto.
7467
7468         * output.c: (outp_read_devices) Move to err_push_file_locator()
7469         from push_cust().  Use struct string.
7470         (expand_op_tokstr) Removed.
7471         (static var op_tokstr) Changed to struct string.
7472         (static var op_tokstr_size) Removed.
7473         (tokener) Rephrasings.  Use struct string.
7474         (parse_options) Use struct string.
7475         (destroy_driver) Fix assertion.
7476         (outp_get_paper_size) Move to err_push_file_locator().
7477         [0] Removed dead code.
7478         (outp_string_width) Move to len_string.
7479
7480         * output.h: Comment fixes.
7481         (TAG_* enum series) Removed.
7482         (struct outp_value) Removed.
7483         (enum OUTP_T_FANCY) Removed.
7484         (struct outp_text) `s' changed from a_string to len_string.
7485         (struct outp_class) `option' change arg 3 from outp_value to
7486         struct string.
7487
7488         * pfm-read.c: (corrupt_msg) Rewritten.
7489
7490         * pfm-write.c: (bufwrite) Fix assertion.
7491
7492         * pool.c: New file, reference version.
7493
7494         * pool.h: New file, reference version.
7495
7496         * postscript.c: (ps_font_sizes) Fix assertion.
7497         (ps_option) Change arg 3 from outp_value to struct string.
7498         Adapt to struct string.
7499         (macro output_line) Removed.
7500         (macro add_string) Removed.
7501         (output_encodings) Adapted to struct string.  Moved to
7502         err_push_file_locator().
7503         (find_encoding_file) Fix assertion.
7504         (read_ps_encodings) Move to err_push_file_locator().
7505         (postopen) Use getl_location() instead of curfn.
7506         (out_text_plain) Move to len_string.
7507         (text) Ditto.  Remove rich text support.
7508
7509         * print.c: (cmd_print) Remove now-unneeded resource cleanup code.
7510         (cmd_print_eject) Ditto.
7511         (cmd_write) Ditto.
7512         (internal_cmd_print) Now cleans up after itself.  Uses
7513         fh_parse_file_handle() now.
7514         (cmd_print_space) Use PXP_NUMERIC to type-check.
7515
7516         * q2c.c: Overhauled.  Removed _("") i18n support.  All references
7517         updated.  All output functions updated to handle structures rather
7518         than local or static variables.  Adapt to new PSPP lex_*()
7519         functions.
7520         (macro _) Removed.
7521         (macro N_) Removed.
7522         (macro MAX_N_SBC) Removed.
7523         (global bare) Removed.
7524         (enum STRING) Renamed T_STRING.
7525         (enum ID) Renamed T_ID.
7526         (get_buffer) Buffer size increased.
7527         (strlower) Renamed st_lower(), rephrased.
7528         (strupper) Renamed st_upper(), rephrased.
7529         (skip_ws) New function.
7530         (get_line) Don't special-case any types of lines (like those
7531         beginning with ! or $, for instance).
7532         (get_token) Renamed lex_get().  Rephrased.
7533         (static var `prefix') New.
7534         (parse) New function.
7535         (parse_setting) Minor rephrasing.
7536         (dump_specifier_vars) Ditto.
7537         (make_identifier) Put null terminator on identifier, duh.
7538         (dump_vars) Renamed dump_declarations().  Never indent.  Never
7539         static.  Output changed entirely.
7540         (dump_specifier_init) Rephrase.
7541         (dump_vars_init) No index variable needed.  Other modifications.
7542         (dump_parser) Don't parse command name.  Do dump functions instead
7543         of just code fragments.
7544         (dump_free) Dump function instead of code fragment.
7545         (recognize_directive) New function.
7546         (main) Use recognize_directive().  Don't rely on magic $ line
7547         beginning: instead, parse comments.  Update list of headers.
7548
7549         * random.c: New file, containing the following functions:
7550         real_rand(), real_srand(), setup_randomize, shuffle, rand_uniform,
7551         rand_normal, rand_simple.
7552
7553         * random.h: New file.
7554
7555         * recode.c: (cmd_recode) Merge internal_cmd_recode() into this
7556         function.  `max_src_width', `max_dst_width' changed to size_t.
7557         (internal_cmd_recode) Removed.
7558         (parse_dest_spec) Merge similar cases.
7559         (parse_src_spec) Add assertion.
7560
7561         * repeat.c: (recognize_keyword) New function.
7562         (internal_cmd_do_repeat) Parse and handle PRINT keyword on END
7563         REPEAT.  Improve recognition of END REPEAT (use
7564         recognize_keyword()).  Move from curfn to getl_location().  Use
7565         struct string.
7566                 
7567         (perform_DO_REPEAT_substitutions) Adapt to struct string.
7568
7569         * set.q: Adapt to new q2c.
7570         (cmd_set) Range-check some values better.
7571         (custom_blanks) Renamed stc_custom_blanks().
7572         (custom_length) Renamed stc_custom_length().
7573         (custom_results) Renamed stc_custom_results().
7574         (custom_seed) Renamed stc_custom_seed().
7575         (custom_width) Renamed stc_custom_width().
7576         (custom_format) Renamed stc_custom_format().
7577         (custom_journal) Renamed stc_custom_journal().
7578         (custom_color) Renamed stc_custom_color().
7579         (custom_listing) Renamed stc_custom_listing().
7580         (custom_disk) Renamed stc_custom_disk().
7581         (custom_log) Renamed stc_custom_log().
7582         (custom_rcolor) Renamed stc_custom_rcolor().
7583         (custom_viewlength) Renamed stc_custom_viewlength().
7584         (custom_workdev) Renamed stc_custom_workdev().
7585
7586         * settings.h: Not necessary to include format.h any longer.
7587
7588         * sfm-read.h: (macro bswap_int32) Moved here from sfmP.h.
7589         (corrupt_msg) Rewritten.
7590
7591         * sort.c: Adapt to rewritten heap ADT.
7592
7593         * str.c: (aa_strcpy) Removed.
7594         (ab_strcpy) Removed.
7595         (ac_strcpy) Removed.
7596         (ba_strcpy) Removed.
7597         (bb_strcpy) Removed.
7598         (ca_strcpy) Removed.
7599         (aa_strdup) Removed.
7600         (aa_strdupcpy) Removed.
7601         (ba_strdup) Removed.
7602         (sa_strdup) Removed.
7603         (memrev) Renamed mm_reverse().
7604         (memrmem) Renamed mm_find_reverse().
7605         (cmp_str) Renamed st_compare_pad().
7606         (strmaxcpy) Removed.
7607         (strbarepadcpy) Renamed st_bare_pad_copy(), signature changed.
7608         (strbarepadlencpy) Renamed st_bare_pad_len_copy(), signature
7609         changed.
7610         (strpadcpy) Renamed st_pad_copy(), signature changed.
7611         (blpstrset) Removed.
7612         (ds_create) New function.
7613         (ds_init) New function.
7614         (ds_replace) New function.
7615         (ds_destroy) New function.
7616         (ds_clear) New function.
7617         (ds_extend) New function.
7618         (ds_shrink) New function.
7619         (ds_truncate) New function.
7620         (ds_length) New function.
7621         (ds_size) New function.
7622         (ds_value) New function.
7623         (ds_end) New function.
7624         (ds_concat) New function.
7625         (ds_concat_buffer) New function.
7626         (ds_printf) New function.
7627         (ds_putchar) New function.
7628         (ds_getline) New function.
7629         (ds_get_config_line) New function derived from the old
7630         misc.c:get_config_line().
7631         (ls_create) New function.
7632         (ls_create_buffer) New function.
7633         (ls_init) New function.
7634         (ls_shallow_copy) New function.
7635         (ls_destroy) New function.
7636         (ls_null) New function.
7637         (ls_null_p) New function.
7638         (ls_empty_p) New function.
7639         (ls_length) New function.
7640         (ls_value) New function.
7641         (ls_end) New function.
7642
7643         * str.h: Reformatted.
7644         (struct a_string) Removed.
7645         (struct b_string) Removed.
7646         (struct c_string) Removed.
7647         (struct len_string) New.
7648         (struct string) New.
7649         (macro as_streq) Removed.
7650         (macro bs_streq) Removed.
7651         (macro cs_streq) Removed.
7652         (macro sa_streq) Removed.
7653         (macro sb_streq) Removed.
7654         [__GNUC__] (inline function ds_putchar) New function.
7655         [__GNUC__] (inline function ds_length) New function.
7656         [__GNUC__] (inline function ds_value) New function.
7657         [__GNUC__] (inline function ds_end) New function.
7658
7659         * sysfile-info.c: (cmd_sysfile_info) Rephrased.
7660         (display_vectors) Fix missing i18n.
7661
7662         * t-test.q: Migrate to new q2c.
7663
7664         * tab.c: Migrate from arenas to pools.
7665         (tab_create) Use struct len_string.
7666         (tab_realloc) Ditto.
7667         (text_format) Ditto.
7668         (tab_joint_text) Ditto.
7669         (tab_natural_width) Remove rich text support.
7670         (tab_natural_height) Ditto.
7671         (tab_output_text) Handle TAT_FIX.
7672         (tab_raw) Change arg from a_string to len_string.
7673         (tabi_driver) Fix assertion.  Use struct len_string.
7674         (render_strip) Use struct len_string.  Remove rich text support.
7675         Add `const' qualifiers.
7676
7677         * tab.h: (enum TAB_RICH) Remove.
7678         (enums TAB_COL_NONE, TAB_COL_DONE) New.  Where appropriate,
7679         SOM_COL_* updated to read TAB_COL_*.
7680         (struct tab_table) Change arena to pool.  Change a_string to
7681         len_string.
7682
7683         * temporary.c: (restore_dictionary) Rewrite Checker code.
7684
7685         * var.h: (macros MAX_SHORT_STRING, MIN_LONG_STRING, SYSMIS,
7686         LOWEST, HIGHEST) Moved here from common.h.
7687         (typedef any_trns) Removed.  All references changed to `struct
7688         trns_header'.
7689
7690         * vars-atr.c: (force_create_variable) Fix assertion.
7691         (force_dup_variable) Fix assertion.
7692         
7693 Thu Jun  3 18:40:42 1999  Ben Pfaff  <blp@gnu.org>
7694
7695         Using alphanumeric variables in functions under AGGREGATE
7696         segfaulted.  Fixed.  Thanks to Dr. Dirk Melcher
7697         <BZN-mdksh@t-online.de> for reporting this bug.
7698         
7699         * aggregate.c: (parse_aggregate_functions) When setting the
7700         FSTRING bit, also allocate memory for the `string' member of
7701         agr_next.
7702         (free_aggregate_functions) Free iter->string.  Don't use the
7703         non-function bits when indexing the array of functions.
7704         [DEBUGGING] (debug_print) Don't use the non-function bits when
7705         indexing the array of functions.        
7706
7707 Sun May 30 00:00:54 1999  Ben Pfaff  <blp@gnu.org>
7708
7709         Under certain circumstances, the final case would be omitted from
7710         the results of an AGGREGATE operation.  Fixed.  Thanks to Dr. Dirk
7711         Melcher <BZN-mdksh@t-online.de> for reporting this bug.
7712         
7713         * aggregate.c (agr_00x_end_func): Increment number of cases in
7714         sink before writing case.  For streams that keep track of how many
7715         cases there are based on this value, this means that the last case
7716         will be read in on the next stream read.
7717
7718 Sat May 29 22:03:31 1999  Ben Pfaff  <blp@gnu.org>
7719
7720         Undefined behavior was invoked by referencing a freed pointer.
7721         
7722         * vfm.c (memory_stream_write): Free pointer *after* checking for
7723         non-null status.
7724
7725 Sat May 29 22:02:22 1999  Ben Pfaff  <blp@gnu.org>
7726
7727         A wrong record size was displayed when paging the active file to
7728         disk.
7729         
7730         * vfm.c: (memory_stream_write) Fix off-by-one error.
7731
7732 Sat May 29 21:50:26 1999  Ben Pfaff  <blp@gnu.org>
7733
7734         Not having enough temporary space for sorting caused a core dump.
7735         Fixed.
7736         
7737         * sort.c: (allocate_cases) Initialize i.
7738
7739 Sat May 29 21:40:54 1999  Ben Pfaff  <blp@gnu.org>
7740
7741         Syntax errors in function descriptions on AGGREGATE caused core
7742         dumps.  Fixed.
7743         
7744         * aggregate.c (cmd_aggregate): Don't free agr_dict after calling
7745         free_aggregate_functions(), since that function already frees
7746         agr_dict.
7747         
7748 Sat May 29 21:06:10 1999  Ben Pfaff  <blp@gnu.org>
7749
7750         A null pointer was dereferenced, causing a core dump, when
7751         PERCENTILES was specified on FREQUENCIES.  This fixes the problem,
7752         but PSPP still doesn't calculate percentiles.  Thanks to Regnor
7753         Jernsletten <rjernsle@eunet.no> for reporting this problem.
7754         
7755         * arena.c: (arena_malloc) If the arena hasn't been initialized
7756         already, initialize it.
7757
7758 Sat May 29 20:47:29 1999  Ben Pfaff  <blp@gnu.org>
7759
7760         * Makefile.cygwin: New file supplied by Hankin <hankin@dunno.com>
7761         for compilation with Cygnus Windows B20.  Not used by other
7762         systems.
7763
7764 Sat May 29 20:36:04 1999  Ben Pfaff  <blp@gnu.org>
7765
7766         SORT always sorted in ascending order.  Fixed.  Thanks to Dr. Dirk
7767         Melcher <BZN-mdksh@t-online.de> for reporting this bug.
7768
7769         * sort.c: (compare_case_lists) Reverse sense of comparison if
7770         sorting in descending order.
7771         (compare_record) Ditto.
7772
7773 Tue Mar  9 13:18:54 1999  Ben Pfaff  <blp@gnu.org>
7774
7775         SPLIT FILE with a string variable caused a core dump.  Fixed.
7776
7777         * vfm.c: If the variable is a string then make a temporary value
7778         struct pointing to it.  The underlying problem is a lot bigger
7779         than this (see TODO) but this is a stopgap for the simple case at
7780         least.
7781         
7782 Tue Mar  9 13:15:53 1999  Ben Pfaff  <blp@gnu.org>
7783
7784         Nested INCLUDEs didn't work.  Fixed.
7785
7786         * getline.c: (getl_include) Set first_line to NULL in allocated
7787         structure.
7788
7789 Tue Mar  9 13:13:46 1999  Ben Pfaff  <blp@gnu.org>
7790
7791         The MATCH FILES procedure set the values of variables not present
7792         to 0.  It should have been SYSMIS.  This is now fixed.
7793
7794         * get.c: (mtf_delete_file_in_place) Replace 0.0 by SYSMIS.
7795
7796 Tue Mar  9 12:52:23 1999  Ben Pfaff  <blp@gnu.org>
7797
7798         The REMARK command was too aggressive about skipping lines.  It
7799         didn't like being the last command in a file.
7800
7801         * command.c: (cmd_remark) Call get_entire_line() instead of
7802         get_line().
7803
7804 Tue Mar  9 12:48:05 1999  Ben Pfaff  <blp@gnu.org>
7805
7806         Comment parsing wasn't consistent with the rest of the code in its
7807         idea of where one command ends and another starts.  This meant
7808         that sometimes commands would be mysteriously ignored.  Thanks to
7809         Dr. Dirk Melcher <BZN-mdksh@t-online.de> for reporting this bug.
7810          
7811         * command.c: (parse_cmd) Hand off comment parsing to new function
7812         skip_comment() in lexer.c.
7813         * lexer.c: (skip_comment) New function.
7814
7815 Wed Jan 20 20:22:07 1999  Ben Pfaff  <blp@gnu.org>
7816
7817         The TABLE subcommand on MATCH FILES worked only erratically at
7818         best.  This fixes it.  Thanks to Dr. Dirk Melcher
7819         <BZN-mdksh@t-online.de> for reporting this bug.
7820
7821         * get.c: (mtf_compare_BY_values) When comparing string values, a
7822         difference of 1 is still a difference :-)
7823         (mtf_processing) Inverted TABLE reading logic fixed.  Also don't
7824         advance TABLE files automatically when matched.  Comment fixes.
7825
7826 Tue Jan 19 22:32:31 1999  Ben Pfaff  <blp@gnu.org>
7827
7828         VARIABLE LABELS rejected a slash before the first variable
7829         specification, contradicting the documentation.  Thanks to Walter
7830         M. Gray <graywm@northernc.on.ca> for reporting this bug.
7831
7832         * var-labs.c: (cmd_variable_labels) Ignore a leading slash in
7833         command specification.
7834
7835 Tue Jan 19 22:29:54 1999  Ben Pfaff  <blp@gnu.org>
7836
7837         Because of an incorrect optimization in memory allocation,
7838         CROSSTABS sometimes segfaulted when asked to output multiple
7839         tables.  Thanks to Walter M. Gray <graywm@northernc.on.ca> for
7840         reporting this bug.
7841
7842         * crosstabs.q: (postcalc) New variables maxcols, maxcells, which
7843         are passed to output_pivot_table() for its use.
7844         (output_pivot_table) Instead of assuming the number of columns is
7845         constant, keep track with maxcols.  In general mode, use maxcells
7846         to determine whether more matrix cells need to be allocated.    
7847
7848 Tue Jan 19 22:27:46 1999  Ben Pfaff  <blp@gnu.org>
7849
7850         CROSSTABS didn't display value labels for column and row
7851         variables.  Thanks to Walter M. Gray <graywm@northernc.on.ca> for
7852         reporting this bug.
7853
7854         * crosstabs.q: (table_value_missing) If the specified value has a
7855         value label for this variable, then show it instead of the raw
7856         value.
7857         (display_dimensions) Delegate display of value_labels to
7858         table_value_missing.
7859
7860 Mon Jan 18 20:04:06 1999  Ben Pfaff  <blp@gnu.org>
7861
7862         WRITE didn't write line ends.  Fixed.  Thanks to Dr. Dirk Melcher
7863         <BZN-mdksh@t-online.de> for reporting this bug.
7864
7865         * print.c: (print_trns_proc) Write (CR/)LF if PRINT is used _or_
7866         if the file isn't declared as binary.
7867
7868 Mon Jan 18 19:56:45 1999  Ben Pfaff  <blp@gnu.org>
7869
7870         MATCH FILES corrupted memory and dumped core on some syntax
7871         errors.  Fixed.
7872
7873         * get.c: (cmd_match_files) Set file->handle to NULL before
7874         jumping to lossage.
7875         (mtf_free_file) Don't free a null dictionary.   
7876
7877 Mon Jan 18 19:27:57 1999  Ben Pfaff  <blp@gnu.org>
7878
7879         MATCH FILES should set numeric values not available to the
7880         system-missing value, not to 0.  Thanks to Dr. Dirk Melcher
7881         <BZN-mdksh@t-online.de> for reporting this bug.
7882
7883         * get.c: (mtf_processing) Set unused records to system-missing,
7884         not 0.
7885
7886 Mon Jan 18 15:06:46 1999  Ben Pfaff  <blp@gnu.org>
7887
7888         KEEP didn't work properly on the SAVE procedure.  Fixed.  Thanks
7889         to Ralf Geschke <ralf@kuerbis.org> for reporting this bug.
7890
7891         * temporary.c: (save_dictionary) Initialize var_by_name AVL tree
7892         in newly created dictionary, and add each copied variable to the
7893         tree.
7894  
7895 Mon Jan 18 15:04:48 1999  Ben Pfaff  <blp@gnu.org>
7896
7897         Memory leak fix.
7898         
7899         * get.c: (trim_dictionary) Free variable list for KEEP after
7900         finishing with it.
7901
7902 Mon Jan 18 12:57:36 1999  Ben Pfaff  <blp@gnu.org>
7903
7904         Some systems didn't like the way open_file was coded.  Thanks to
7905         Hankin <hankin@rogue.consultco.com> for pointing this out.
7906
7907         * filename.c: (open_file) Don't try to store stdin, stdout,
7908         stderr as part of an array, because that doesn't always work.
7909
7910 Mon Jan 18 12:53:27 1999  Ben Pfaff  <blp@gnu.org>
7911
7912         The SAVE procedure didn't save long string variables properly.
7913         Fixed by this patch.  Thanks to Hankin
7914         <hankin@rogue.consultco.com> for this patch.
7915         
7916         * sfm-write.c: (write_variable) Fix off-by-one error in writing
7917         out variable pad records.
7918
7919 Tue Jan  5 14:29:27 1999  Ben Pfaff  <blp@gnu.org>
7920
7921         Previously, if PRINT SPACE were given a negative argument, it
7922         would report an error, then spin in an (almost) infinite loop.
7923         This fixes that behavior.
7924
7925         * print.c: (print_space_trns_proc) After reporting a negative
7926         argument, set number of lines to print to 1.
7927
7928 Tue Jan  5 13:59:55 1999  Ben Pfaff  <blp@gnu.org>
7929
7930         SPSS 8.0 outputs some new record types in its system files, and it
7931         allows longer value labels.  Accept these system files.
7932
7933         * sfm-read.c: (sfm_read_dictionary) Ignore record type 7 subtype
7934         11 emitted by SPSS 8.0.
7935         
7936 Tue Jan  5 13:55:50 1999  Ben Pfaff  <blp@gnu.org>
7937
7938         The LIST procedure was too conservative in allocating space for
7939         buffers, which caused a bug that only showed up with very long
7940         output variables.  Thanks to Hankin <hankin@dunno.com> for this
7941         bug report.
7942
7943         * list.q: (determine_layout) Allocate 1022 bytes instead of 256.
7944
7945 Tue Jan  5 13:34:34 1999  Ben Pfaff  <blp@gnu.org>
7946
7947         Typo meant string format specifiers weren't checked properly.  I
7948         think that Hankin <hankin@dunno.com> sent me this report, but I'm
7949         willing to be corrected on this point.
7950  
7951         * format.c: (check_string_specifier) Fix obvious typo.  
7952
7953 Tue Jan  5 12:50:42 1999  Ben Pfaff  <blp@gnu.org>
7954
7955         Using $CASENUM in an expression didn't work.  Here's a fix.
7956         Thanks to Dirk Melcher <BZN-mdksh@t-online.de> for reporting this
7957         bug.
7958          
7959         * expr-evl.c: (evaluate_expression) Add OP_CASENUM case.
7960
7961         * expr-opt.c: (dump_node) OP_CASENUM is acceptable.
7962
7963 Tue Jan  5 12:47:48 1999  Ben Pfaff  <blp@gnu.org>
7964
7965         The changes in 0.2.1 to fix DATA LIST FREE parsing broke some
7966         other behavior, *sigh*.  This patch hopefully fixes that.  This
7967         time I've actually tested it.
7968
7969         Thanks to Hankin <hankin@dunno.com> for reporting this bug.
7970
7971         * data-list.c: (read_from_data_list_free,
7972         read_from_data_list_list) Call parse_string_as_format() directly
7973         without mucking around with the field width.
7974
7975 Tue Jan  5 12:31:19 1999  Ben Pfaff  <blp@gnu.org>
7976
7977         Occasionally, you may encounter a script that wants to be
7978         interpreted in interactive mode.  Make -i emulate this behavior to
7979         allow such scripts to be executed with PSPP.
7980
7981         Thanks to Hankin <hankin@dunno.com> for reporting this behavior.
7982
7983         * cmdline.c: (pre_syntax_message[]) Update -i description.
7984
7985         * lexer.c: (preprocess_line) When getl_interactive is 2 (i.e.,
7986         when -i is given on the command line) don't treat unindented lines
7987         as starting a new command.
7988
7989 Tue Jan  5 12:30:10 1999  Ben Pfaff  <blp@gnu.org>
7990
7991         In conjunction with egcs 1.1.1, Checker emits some bogus warnings,
7992         mostly caused by local initialized aggregates.  After egcs is
7993         fixed upstream these can be removed, but for now they're not a big
7994         deal.
7995         
7996         * ascii.c: (ascii_postopen_driver) Checker chokes on local
7997         initialized arrays.  Avoid this.
7998
7999         * sfm-write.c: (sfm_write_dictionary) Don't use a local
8000         initialized struct.
8001
8002 Tue Jan  5 12:07:24 1999  Ben Pfaff  <blp@gnu.org>
8003
8004         egcs 1.1.1 has some new warnings relative to gcc 2.8.1, which the
8005         following changes avoid.  Currently I compile sources with egcs
8006         1.1.1 and gcc 2.7.2.3 before sending them out.
8007
8008         * apply-dict.c: (apply_dict) Use new avl_traverser_init() macro.
8009         
8010         * ascii.c: (option_tab[]) Initialize all struct members.
8011
8012         * avl.h: (avl_traverser_init) New macro.
8013         
8014         * command.c: (DEFCMD, UNIMPL macros, cmd_table[]) Initialize all
8015         struct members.
8016
8017         * crosstabs.q: (enum_var_values) Use new hsh_iterator_init()
8018         macro.
8019
8020         * hash.c: Comment fix.
8021
8022         * hash.h: (hsh_iterator_init) New macro.
8023
8024         * html.c: (option_tab[]) Initialize all struct members.
8025
8026         * pfm-write.c: (write_value_labels) Use new avl_traverser_init()
8027         macro.
8028
8029         * postscript.c: (option_tab[]) Initialize all struct members.
8030         (output_encodings, preclose, dump_lines) Use new
8031         hsh_iterator_init() macro.
8032
8033         * sfm-write.c: (write_value_labels) Use new avl_traverser_init()
8034         macro.
8035
8036         * sysfile-info.c: (describe_variable) Use new avl_traverser_init()
8037         macro.
8038
8039 Thu Nov 19 12:32:45 1998  Ben Pfaff  <blp@gnu.org>
8040
8041         * data-in.c: Examined each of the parsing functions to make sure
8042         that they wouldn't dump core if they were passed a string of the
8043         wrong length, since now the DATA LIST FREE/LIST routines don't
8044         check for field width before passing it to the data parser.
8045         (parse_RBHEX, parse_AHEX) Reject odd length input.
8046         (parse_string_as_format) Reject input that's too short or too
8047         long.
8048
8049         * data-list.c: Before, the DATA LIST FREE/LIST routines would pad
8050         a field to its entire declared output width then pass it to the
8051         data-in parsing routines.  This contradicted the documented
8052         behavior.  This is fixed in these changes.  Thanks to Mark H. Wood
8053         <mwood@IUPUI.Edu>.  In addition, this fixes a few more details of
8054         free-format parsing that differed from SPSS.
8055         (cut_field) Commas and spaces are treated identically.  Returns
8056         the proper column instead of a fixed 1 value.
8057         (parse_field) Removed.
8058         (read_from_data_list_free, read_from_data_list_list) Call
8059         parse_string_as_format directly instead of parse_field.
8060
8061         * heap.c: (heap_delete) Stylistic fixes.
8062
8063 Sun Aug  9 11:12:13 1998  Ben Pfaff  <blp@gnu.org>
8064
8065         * loop.c: (loop_2_trns_proc) Formatting fix.
8066
8067         * sel-if.c: (cmd_filter) Set FILTER_before_TEMPORARY.
8068
8069         * var.h: (glob var FILTER_before_TEMPORARY) New global var.
8070
8071         * vfm.c: (macro FILTERED) New.
8072         (static var filter_var) New.
8073         (process_active_file_write_case) Use FILTERED.
8074         (setup_filter) Set filter_var.
8075         (close_active_file) Delete the filter if not
8076         FILTER_before_TEMPORARY.
8077         (procedure_write_case) Use FILTERED.
8078
8079 Sat Aug  8 00:20:14 1998  Ben Pfaff  <blp@gnu.org>
8080
8081         * crosstabs.q: Changed /PIVOT={ON,OFF} to /FORMAT={PIVOT,NOPIVOT}.
8082
8083         * data-in.c: (parse_day_count) Message fix.
8084         (parse_month) Style fix.
8085
8086         * data-list.c: (struct data_list_pgm) New member eof.
8087         (cmd_data_list) Init eof to 0.
8088         (do_reading) Implement the /END subcommand and read-past-eof
8089         checking.
8090
8091         * do-if.c: Include stdio.h when debugging.
8092         (cmd_else_if) Make sure the command is .-terminated.
8093
8094         * glob.c: (init_glob) Capitalize the command prompt.
8095
8096         * inpt-pgm.c: (end_case_trns_proc) Debugging message.
8097         (end_file_trns_proc) Debugging message.
8098
8099         * loop.c: (internal_cmd_loop) Make it work when there's no loop
8100         index!
8101         (loop_2_trns_proc) Enable MXLOOPS (why was this disabled?)
8102
8103         * main.c: (dump_token) Make kwtab[] const.
8104
8105         * set.q: Spelling, comment fixes.
8106
8107         * sysfile-info.c: (cmd_display) DISPLAY VECTORS not DISPLAY
8108         VECTOR.
8109
8110         * vars-prs.c: (fill_all_vars) Style fix.
8111
8112         * vfm.c: (index_to_varname) Return const.
8113
8114 Tue Aug  4 23:49:23 1998  Ben Pfaff  <blp@gnu.org>
8115
8116         * Changes in many source files for partial -ansi -pedantic and
8117         no-debugging compliance: Remove trailing common in enum
8118         declarations; add `unused' attributes; insert some appropriate
8119         casts.
8120
8121         * cmdline.c: (parse_command_line) Add new --testing-mode flag.
8122
8123         * command.c: (shell) Make static.
8124         (run_command) Make static.
8125
8126         * data-list.c: (dump_fixed_table) Remove use of local_strdup().
8127
8128         * dfm.c: (cmd_begin_data) I18n fix.
8129
8130         * error.c: (verbose_msg) Define if __STRICT_ANSI__.
8131
8132         * error.h: (macro verbose_msg) Define if __STRICT_ANSI__.
8133
8134         * expr-opt.c: (evaluate_tree) Don't initialize local arrays if
8135         __STRICT_ANSI__.
8136
8137         * file-handle.q: Don't prepend the source file directory name to
8138         the data file name.  (Ongoing issue.)
8139         (prepend_current_directory) Comment out.
8140         (internal_cmd_file_handle) Don't call prepend_current_directory().
8141         (fh_get_handle_by_filename) Ditto.
8142
8143         * filename.c: Append zero byte to readlink() return value.
8144
8145         * getline.c: (getl_read_line) I18n fix.
8146
8147         * lexer.h: Don't use gcc features if __STRICT_ANSI__.
8148
8149         * misc.h: Don't use gcc features if __STRICT_ANSI__.
8150
8151         * pfm-write.c: (bufwrite) Don't try to increment a void * pointer
8152         directly.
8153
8154         * postscript.c: (output_encodings) Don't use local_strdup().
8155         (postopen) Ditto.
8156
8157         * print.c: Don't use gcc features if __STRICT_ANSI__.
8158
8159         * q2c.c: (dump_vars) Don't put a , at the end of the last enum.
8160
8161         * recode.c: (parse_src_spec) Fully brace nested if's.
8162
8163         * set.q: (global var set_testing_mode) New var.
8164
8165 Wed Jul 29 22:01:44 1998  Ben Pfaff  <blp@gnu.org>
8166
8167         * ascii.c: Add some more `unused' attributes that only come into
8168         play when NDEBUG is defined.
8169         (ascii_close_page) Set s_len when reallocating s.
8170         
8171         * crosstabs.q: (delete_missing) New function.
8172         (output_pivot_table) Call delete_missing() if /MISSING=REPORT.
8173         (make_summary_table) Create summary table reallocable.
8174
8175         * postscript.c: Add more `unused' attributes as above.
8176
8177         * tab.c: (tab_create) [GLOBAL_DEBUGGING] Set reallocable member.
8178         (tab_realloc) [GLOBAL_DEBUGGING] Assert that table is reallocable.
8179          
8180         * tab.h: (struct tab_table) [GLOBAL_DEBUGGING] New `reallocable'
8181         member.
8182
8183         * var.h: (macro force_dup_variable) [!GLOBAL_DEBUGGING] Remove
8184         gratuitous space between parameter definition.
8185
8186         * vars-atr.c: Changed some assert(0)'s to abort()'s to prevent
8187         complaints about running off the end of functions with NDEBUG
8188         enabled.
8189
8190 Sun Jul  5 00:17:25 1998  Ben Pfaff  <blp@gnu.org>
8191
8192         * Several source files: Removed some PORTME notes when reflection
8193         revealed that ANSI forbids that sort of breakage.  Also, added
8194         lots of `unused' qualifiers here and there.
8195
8196         * aggregate.c: (accumulate_aggregate_info) Remove local var
8197         weighting that turned out not to be used.
8198
8199         * avl.c: Update to version 1.1.0.  Add unused specifier.
8200         (avl_destroy) Initialize ab to 0.  Comment fixes.  Cast return
8201         value to void *.
8202         (avl_probe) Replace some instances of 1 with +1 where appropriate.
8203         (avl_find) Cast return value to void *.
8204         (avl_delete) q doesn't need to be initialized at the beginning of
8205         the function.  Replace some instances of 1 with +1.
8206         (force_avl_delete) Renamed avl_force_delete, all references changed.
8207         (compare_ints) `param' marked unused.
8208         (print_int) `param' marked unused.
8209         (recurse_tree) Replace some instances of 1 with +1.
8210
8211         * avl.h: Update to version 1.1.0.  Only declares avl function
8212         types if not already declared.
8213         (AVL_MAX_HEIGHT) Only define if not already defined.
8214         (struct avl_node) New unused member char pad[2].
8215         [GLOBAL_DEBUGGING] Change conditionalization to NDEBUG instead.
8216         (force_avl_insert) Renamed avl_force_insert.
8217         (force_avl_delete) Renamed avl_force_delete.
8218
8219         * crosstabs.q: (struct table_entry) Put `freq' into a union with
8220         new member `data'.
8221         (struct crosstab) Add new member `ofs'.
8222         (glob var int_tab) Removed.
8223         (custom_tables) In integer mode, assign v[i] properly through the
8224         indirect var_dict.
8225         (custom_variables) Now p.crs.max == max + 1.
8226         [DEBUGGING] (debug_print) p.crs.min and p.crs.max are now ints.
8227         (precalc) Implement integer mode.
8228         (calc_integer) Implement integer mode.
8229         (compare_table_entry) Remove unused local variable `comparing'.
8230         (make_summary_table) Implement integer mode.
8231         (macro ns_rows) Implemented as static variable now.
8232         (several variables) Made static, from global.
8233         (output_pivot_table) Use table_value_missing() for column heads.
8234         Remove several unused local variables.  Implement integer mode
8235         table summing.  Count up ns_rows.
8236         (crosstabs_dim) Make columns wider when /MISSING=REPORT requested.
8237         (find_pivot_extent) Moved into find_pivot_extent_general; now just
8238         calls that function or find_pivot_extent_integer.
8239         (find_pivot_extent_integer) New function.
8240         (enum_var_values) Implemented for integer mode.
8241         (table_value_missing) New function.
8242         (display_dimensions) Call table_value_missing() for heads.
8243         (float_M_suffix) New function.
8244         (display_crosstabulation) Call table_value_missing() for row
8245         heads.  Handle missing values in /MISSING=REPORT mode.
8246         (calc_fisher) Remove unused var N.
8247         (calc_r) Remove unused var fact.
8248
8249         * data-list.c: (dump_fixed_table) Fix table dimensioning.
8250         (read_one_set_of_repetitions) Remove unused vars var_spec, column.
8251
8252         * data-out.c: (insert_commas) Remove unused var cp.
8253         (convert_CCx) Remove unused vars save_set_decimal,
8254         save_set_grouping.
8255
8256         * descript.q: (dump_z_table) Fix table dimensioning.
8257         (pre_calc) Remove unused var j.
8258         (display) Remove unused vars title, s.  Fix table dimensioning.
8259
8260         * expr-evl.c: Comment fixes.
8261
8262         * frequencies.q: (full_dim) New function.
8263         (dump_full) Fix table dimensioning.
8264         (condensed_dim) New function.
8265         (dump_condensed) Fix table dimensioning.
8266
8267         * get.c: (cmd_match_files) Remove unused var n_val.  Remove unused
8268         label winnage.
8269
8270         * html.c: (html_close_drive) Remove unused var i.
8271         (postopen) Remove unused vars title, curfn_len, cp.
8272         (preclose) Remove unused vars this, x.
8273
8274         * lexer.c: Comment fixes.
8275
8276         * matrix-data.c: (cmd_matrix_data) Remove unused var index.
8277
8278         * means.q: (custom_tables) Remove unused var m_dim.
8279
8280         * mis-val.c: Format fix.
8281
8282         * modify-vars.c: (cmd_modify_vars) Remove unused var new_dict.
8283
8284         * output.c: (outp_get_paper_size) Remove unused var cp.
8285
8286         * pfm-read.c: (read_float) Remove unused var save, unused label
8287         underflow.
8288         (read_variables) Remove unused vars cp, j.
8289         (read_value_label) Remove unused var j.
8290
8291         * pfm-write.c: (bufwrite) Remove unused var i.
8292
8293         * postscript.c: (ps_postopen_drive) Remove unused vars dev_info,
8294         fn.
8295         (output_encodings) Remove unused vars char_cp, n_output.
8296         (read_ps_encodings) Remove unused var ep.
8297         (postopen) Remove unused var title.
8298         (preclose) Remove unused var fp.
8299         (ps_open_page) Remove unused vars true, false, orientation,
8300         mirror_horz, mirror_vert, width, length.
8301         (ps_text_metrics) Remove unused var x.
8302
8303         * q2c.c: (find_symbol) Remove unused var y.
8304         (parse_setting) Remove unused parameter sbc, all references
8305         changed.
8306         (dump_parser) Remove unused var cp.
8307         (dump_free) Remove unused var i.
8308
8309         * set.q: (static vars args, n) Removed.
8310         (internal_cmd_gset) Removed.
8311
8312         * sfm-read.c: (sfm_read_dictionary) Removed unused var i.
8313         (read_machine_flt64_info) Removed unused var file_endian.
8314         (read_documents) Removed unused var i.
8315         (read_compressed_data) Removed unused parameter dict, all
8316         references changed.
8317
8318         * sfm-write.c: (bufwrite) Removed unused var i.
8319         (sfm_write_case) Removed unused var i.
8320
8321         * sort.c: (merge_once) Remove unused var t.
8322         (write_separate) #if 0 out as dead code.
8323
8324         * split-file.c: (cmd_split_file) Remove unused var i.
8325
8326         * sysfile-info.c: (sysfile_info_dim) New function.
8327         (cmd_sysfile_info) Fix table dimensioning.
8328         (variables_dim) New function.
8329         (display_variables) Fix table dimensioning.
8330         (describe_variable) Remove unused var prev_r.
8331
8332         * t-test.q: (z_postcalc) Removed.
8333         (pairs_calc) Remove unused var bad_weight.
8334         (postcalc) Remove unused vars dfn, dfd.
8335
8336         * tab.c: (tab_create) Set t->dim to NULL.
8337         (tab_dim) Make sure t->dim is NULL first.
8338         (tab_natural_width) Remove parameter `clamp'.
8339         (tab_value) Remove duplicate assertion for table.
8340         (tab_raw) New function.
8341         (nowrap_dim) New function.
8342         (wrap_dim) New function.
8343         (tab_output_text) Fix table dimensioning.
8344
8345         * tab.h: (tab_raw) New macro.
8346
8347         * val-labs.c: (get_label) Remove unused var type.
8348         (copy_value_labels) Remove unused var trav.
8349
8350         * var.h: (struct crosstab_proc) Completely changed.
8351
8352         * vars-prs.c: (parse_dict_variable) Remove unused var v.
8353
8354         * vfm.c: (open_active_file) Remove unused vars i, lp.
8355
8356         * weight.c: (weight_trns_proc) #if 0 out as dead code.
8357         
8358 Tue Jun  2 23:37:21 1998  Ben Pfaff  <blp@gnu.org>
8359
8360         * Makefile.am: Add apply-dict.c, flip.c.
8361
8362         * apply-dict.c: New file.
8363         
8364         * command.c: (struct command) Make cmd[] larger for CLEAR
8365         TRANSFORMATIONS command name.
8366         (parse_cmd) Make sure we're in a valid state before using it as an
8367         index.  Discard variables and reset state on invalid transitions.
8368         (cmd_clear_transformations) New function.
8369
8370         * command.def: Add APPLY DICTIONARY, CLEAR TRANSFORMATIONS, FLIP.
8371         Add unimplemented PRESERVE, RESTORE.
8372
8373         * file-handle.h: Include stddef.h.
8374
8375         * flip.c: New file.
8376         
8377         * pfm-read.c: (parse_value) Pad value label values with spaces,
8378         not nulls.
8379
8380         * sfm-read.c: (struct sfm_fhuser_ext) Add reference count.
8381         (sfm_close) Decrement reference count, make sure it's zero.
8382         (sfm_maybe_close) New function.
8383         (sfm_read_dictionary) Handle reference counts.
8384
8385         * vars-atr.c: (clear_default_dict) New function.
8386         (discard_variables) Use clear_default_dict().
8387
8388 Sun May 31 00:58:05 1998  Ben Pfaff  <blp@gnu.org>
8389
8390         * Makefile.am: Add pfm-write.c.
8391         (LDADD) Add the libgmp2 libraries.
8392
8393         * command.def: Define EXPORT.
8394
8395         * get.c: (cmd_export) New function.
8396         (export_write_case_func) New function.
8397
8398         * pfm-read.c: (static spss2ascii[]) Make it const.
8399
8400         * pfm-write.c: New file.
8401
8402         * sfm-write.c: Formatting, comment fixes.
8403
8404         * var.h: Comment fix.
8405
8406 Fri May 29 21:44:12 1998  Ben Pfaff  <blp@gnu.org>
8407
8408         * Makefile.am: Add pfm.h, pfm-read.c.
8409
8410         * command.def: IMPORT is now implemented.
8411
8412         * format.c: (glob var translate_fmt[]) New var.
8413
8414         * get.c: (enum GTSV_NONE) Renamed GTSV_OPT_NONE.
8415         (cmd_import) New function.
8416         (import_source_read) New function.
8417         (glob var import_source) New var.
8418
8419         * pfm-read.c: New file.
8420
8421         * pfm.h: New file.
8422         
8423         * sfm-read.c: (parse_format_spec) Local variable translate_fmt[]
8424         moved in format.c.
8425         (dump_dictionary) Disabled printing a couple of items.
8426
8427 Mon May 25 12:42:37 1998  Ben Pfaff  <blp@gnu.org>
8428
8429         * crosstabs.q: (postcalc) Call make_summary_table().
8430         (make_summary_table) New function.
8431         (insert_summary) New function.
8432         (display_dimensions) Remove some unnecessary arguments, all
8433         references changed.
8434         (output_pivot_table) Fix lots of problems with the risk table
8435         setup.
8436         (submit) Don't display an empty table.
8437         (display_risk) Fix order of arguments to calc_risk().
8438
8439         * glob.c: Always include assert.h and stdlib.h.
8440
8441         * output.h: (enum OUTP_T_JUST_FULL) Removed, all references
8442         removed.
8443
8444         * tab.c: (tab_create) Cosmetic changes.
8445
8446         * tab.h: (enum TAB_JUSTIFY) Removed, all references removed.
8447
8448 Sun May 24 22:39:23 1998  Ben Pfaff  <blp@gnu.org>
8449
8450         * tab.def: Removed.
8451
8452         * crosstabs.q: (output_pivot_table) Headers drawing and submission
8453         code simplified, moved into new function submit().
8454         (submit) New function.
8455         (crosstabs_dim) New function.
8456         (display_directional) Substitute variable names for %s where
8457         appropriate.
8458         (somers_d_v[], somers_d_ase[], somers_d_t[]) New static vars.
8459         (calc_symmetric) Initialize parameters only if non-NULL.
8460         Calculate Somers' d.
8461         (calc_directional) Calculate Somers' d (or copy it, really).
8462         Calculate eta.
8463
8464         * output.c: (outp_string_width) New function.
8465
8466         * postscript.c: (postopen) Calculate font widths based on the
8467         width of the zero '0' character, not the width of the space
8468         character.  Set paper-width and paper-length based on points, not
8469         device units.
8470         (ps_open_page) Fix page setup string for landscape mode.
8471
8472         * som.h: (struct som_dimension) Removed.
8473         (struct som_table_class) height, width members take int * not
8474         som_dimesion * now.
8475
8476         * tab.c: Many functions now have added parameter validation.
8477         (tab_height, tab_width) These functions were removed and merged
8478         into a single function tab_resize(), and all references changed.
8479         (tab_dim) Rewritten since the interface changed; reduced from
8480         hundreds of lines to two.  All callers were changed.  Currently
8481         most of them just use tab_natural_dimensions as their callback and
8482         await detailed translation of functionality.
8483         (tab_natural_width) New function.
8484         (tab_natural_height) New function.
8485         (tab_natural_dimensions) New function.  This is a callback
8486         function, not something that you'd want to call directly.
8487         (tab_nat_dim) Removed.
8488         (tabi_table) Allocates t->w and t->h.
8489         (tabi_driver) Inlined sum_columns()'s functionality.  Calls the
8490         dimensions callback.
8491         (evaluate_dimensions) Removed.
8492         (sum_columns) Removed.
8493
8494         * tab.h: (enum TAL_1THIN) Removed.
8495         (enum series t_*) Removed.
8496         (struct tab_table) Members trh, trv changed to unsigned char *
8497         from int *.  Member dim changed to a function pointer from a
8498         unsigned char *.  Member max_stack_height removed.  New members
8499         hr_tot, vr_tot.
8500         (macros tab_l, tab_r, tab_t, tab_b) New.
8501
8502 Sat May 23 23:22:13 1998  Ben Pfaff  <blp@gnu.org>
8503
8504         * ascii.c: (delineate) Assign last_space_nchars before skipping
8505         spaces, to fix right justification.
8506
8507         * crosstabs.q: (static vars risk, direct) New vars.
8508         (static var pearson_r) Removed.
8509         (glob var chisq_fisher) Made static.
8510         (static vars row_tot[], col_tot[]) Don't include grand total
8511         anymore.
8512         (static var grand_total) Renamed W, all references changed.
8513         (output_pivot_table) Only make `table' if num_cells != 0.  Make
8514         risk and directional tables.  Deal with grand total no longer part
8515         of col_tot[].  Free rows and cols after we're done with them.
8516         (display_risk) New function.
8517         (display_directional) New function.
8518         (clac_r) Rewritten so that it stores all its results into its
8519         arguments, so it can be used for Spearman's correlation too.
8520         (calc_symmetric) Added a t[] argument, all references changed.
8521         Calculates ASEs for tau-b, tau-c, gamma.  Calculates Spearman's r,
8522         Pearson's r, Cohen's kappa.
8523         (calc_risk) New function.
8524         (calc_directional) New function.
8525
8526         * som.c: (som_submit) Improved debugging code.
8527
8528         * stats.c: (hypercube) New function.
8529         (cube) New function.
8530         (sqr) New function.
8531         (normal_sig) Went back to old implementation, which actually
8532         worked.
8533
8534         * stats.h: (macros square, cube, hypercube) Removed.  The
8535         equivalent functions in stats.c are inlined here; all references
8536         to square changed to sqr.
8537
8538 Fri May 22 00:03:41 1998  Ben Pfaff  <blp@gnu.org>
8539
8540         * crosstabs.q: (N_SYMMETRIC) New define.
8541         (postcalc) Disable debug printing.
8542         (static vars chisq_fisher, pearson_r) New.
8543         (output_pivot_table) Add support for symmetric measures.  Add
8544         chi-square output of exact sigs.
8545         (display_chisq) Rewritten.
8546         (display_symmetric) New function.
8547         (gamma_int) New function.
8548         (Pr) New function.
8549         (swap) New function.
8550         (calc_fisher) New function.
8551         (calc_chisq) Check boundary conditions better. Calculate Yates,
8552         Fisher, Mantel-Haenszel tests.
8553         (calc_r) New function.
8554         (calc_symmetric) New function.
8555
8556         * stats.c: (normal_sig) Rewritten with new algorithm.  Renamed
8557         from calc_normal.
8558         (chisq_sig) Better boundary conditions.  Renamed from
8559         calc_significance.
8560
8561         * tab.h: (struct tab_table) New member cf.
8562
8563         * tab.c: (tab_create) Set cf.
8564         (tab_width) New function.
8565         (tab_realloc) Handle cf.
8566         (tab_vline) Handle cf.
8567         (tab_hline) Handle cf.
8568         (tab_box) Handle cf.
8569         (tab_value) Handle cf.
8570         (tab_float) Handle cf.
8571         (tab_text) Handle cf.
8572         (tab_joint_text) Handle cf.
8573         (tab_offset) Handle cf.
8574         (tab_next_row) Handle cf.
8575         (evaluate_dimensions) Handle cf.
8576         (render_strip) Handle cf.
8577
8578 Wed May 20 00:03:59 1998  Ben Pfaff  <blp@gnu.org>
8579
8580         * crosstabs.q: (postcalc) New vars row_tot, col_tot, pass them to
8581         output_pivot_table().
8582         (output_pivot_table) Moved lots of local variables outside and
8583         made them static.  Add beginnings of chi-square statistic
8584         support.  Now column and row totals aren't in the main matrix.
8585         Always zero out any leftover rows & columns after we're done with
8586         the table entries.  Move all output stuff into
8587         display_dimensions(), display_crosstabs(), display_chisq().
8588         (display_dimensions) New function.
8589         (display_crosstabulation) New function.
8590         (display_chisq) New function.
8591         (calc_chisq) Implemented Pearson and likelihood-ratio chisquares.
8592
8593         * frequencies.q: (dump_full, dump_condensed) Remove tab_null()
8594         references, simplify logic.
8595
8596         * postscript.c: Remove scale, translate-x, translate-y,
8597         mirror-horz, mirror-vert, rotate-180 options.
8598         (struct ps_driver_ext) Remove scale, translate_x, translate_y.
8599         All references deleted.
8600         (macro YT) New macro.
8601         (array option_tab[]) Removed options.
8602         (ps_option) Removed options.
8603         (ps_open_page) Write page setup explicitly to output file, without
8604         using now-deleted BP function.
8605         (macro dump_line) Use YT().
8606         (macro dump_thick_line) Use YT().
8607         (draw_headers) Use YT().
8608         (switch_font) Reorder arguments to SF function.
8609         (write_text) Use YT().
8610
8611         * sfm-read.c: (sfm_read_case) Don't attempt to read variables that
8612         have get.fv == -1.
8613
8614         * sysfile-info.c: (describe_variables) Don't use tab_nulls().
8615
8616         * tab.c: (tab_create) Initialize t->ct to zeros.  Remove
8617         null-debugging code.
8618         (tab_realloc) Remove null-debugging code.  Initialize new regions
8619         of t->ct to zeros.
8620         (tab_vline) Support offsets.
8621         (tab_hline) Support offsets.
8622         (tab_box) Support offsets.
8623         (tab_null) Removed.
8624         (tab_nulls) Removed.
8625         (tab_row) Removed.
8626         (tab_col) Removed.
8627         (evaluate_dimensions) Remove null-debugging code.  Understand
8628         TAB_EMPTY attribute.  Assert that text.s.s is always non-NULL if
8629         TAB_EMPTY not present.
8630
8631         * tab.h: New cell attribute TAB_EMPTY.
8632         (macros tab_nr, tab_nc, tab_row, tab_col) New.
8633
8634         * vars-atr.c: (init_variable) Set get.fv to -1 so that GET doesn't
8635         try to read them from system files.
8636
8637         * vfm.c: (dump_splits) Don't call tab_null().   
8638
8639 Sat May 16 19:36:55 1998  Ben Pfaff  <blp@gnu.org>
8640
8641         * crosstabs.q: (struct crosstab) Added `missing' member.
8642         (custom_tables) Init missing.
8643         (calc_general) Handle missing values.
8644         (calc_chisq) New function.
8645         (output_pivot_table) Start work on chi-square output.  Update for
8646         new tab offset support functions.  Shorten statistic names.
8647
8648         * Several files: add in more `const's to placate gcc's warnings.
8649
8650         * tab.h: (struct tab_table) Add col_ofs, row_ofs members.  Comment
8651         fixes.
8652
8653         * tab.c: (tab_height, tab_realloc, tab_vline, tab_hline, tab_box,
8654         tab_null, tab_nulls, tab_value, tab_float, tab_text,
8655         tab_joint_text) Add col_ofs and row_ofs support.
8656         (tab_offset) New function.
8657         (tab_next_row) New function.
8658         (tab_row) New function.
8659         (tab_col) New function.
8660         (tabi_table) Add col_ofs and row_ofs support.
8661
8662         * vars-atr.c: (is_system_missing) New function.
8663
8664 Tue May 12 16:14:30 1998  Ben Pfaff  <blp@gnu.org>
8665
8666         * crosstabs.q: Expanded subcommand names RESID --> RESIDUAL, etc.
8667         (static var no_cells) Removed.
8668         (static var num_cells) New.
8669         (static var expected) New.
8670         (static var cells[]) New.
8671         (internal_cmd_crosstabs) Deal with new variables.
8672         (postcalc) Removed most of the meat and put it in new function
8673         output_pivot_table().
8674         (output_pivot_table) Calculates and outputs an entire pivot table.
8675
8676         * postscript.c: (postopen) Fix problems with free()ing addresses
8677         not obtained from malloc().
8678
8679         * som.c: (som_submit) Add assertion.
8680
8681         * sysfile-info.c: (describe_variable) Use new tab_nulls()
8682         function.
8683
8684         * tab.c: (static var tab_names[]) New.
8685         (tab_realloc) -1 for nc or nr indicates no change.
8686         (tab_nulls) New function.
8687         (tab_dim) Use tab_names[].
8688         (tabi_cumulate) Don't include bottom or right headers.  Furrfu.
8689         (evaluate_dimensions) Don't terminate on uninited cells, just put
8690         an X in them and emit a notice.  Use tab_names[].
8691
8692         * tab.h: Move bits into tab.def.
8693
8694         * tab.def: New.  Don't try to declare tab_table_class because then
8695         som.h has to be included.       
8696         
8697 Thu May  7 22:55:04 1998  Ben Pfaff  <blp@gnu.org>
8698
8699         * command.def: New file, contains all the command definitions
8700         previously included bodily in command.c.
8701
8702         * format.def: New file, contains all of the format definitions
8703         previously split across format.h, format.c, and sfm-write.c.
8704
8705         * lexer.h: Renamed from tokens.h in order to match corresponding
8706         .c file name.
8707
8708         * lexerP.h: Moved some rarely used functions exported by lexer.c
8709         into here.
8710
8711         * Makefile.am: Commemorate renamed files.
8712         (EXTRA_DIST) Add command.def, format.def.
8713
8714         * command.c: [0] (walk_cmdtable_func) Removed.
8715
8716         * crosstabs.q: (postcalc) Made it work and print out matrices
8717         proving it.
8718         (enum_column_values) Renamed enum_var_values, generalized for any
8719         variable.
8720
8721         * format.h: (struct fmt_desc) New member `spss'.
8722
8723         * q2c.c: (main) Generated code includes lexer.h instead of
8724         tokens.h.
8725
8726         * sfm-write.c: (write_format_spec) Use new spss member of fmt_spec
8727         instead of an independent translation table.
8728
8729 Tue May  5 13:19:03 1998  Ben Pfaff  <blp@gnu.org>
8730
8731         * Lots of source files: Added const to declarations.
8732
8733         * aggregate.c: (parse_aggregate_function) Rename inner i to j.
8734         
8735         * arena.c: (arena_clear) Set prev pointer to null when done.
8736
8737         * ascii.c: (ascii_option) Rename index as indx.
8738
8739         * avl.c: This is now a separate library called libavl.
8740         (xmalloc) Make static.
8741         (avl_probe) Step A7 can use the cache instead of an explicit
8742         compare.
8743         (avl_delete) Don't maintain a q pointer because it's always
8744         available in the pointer stack.  Comment fix.
8745
8746         * avl.h: This is now a separate library called libavl.
8747
8748         * command.c: (cmd_table[]) Remove spurious trailing "".
8749
8750         * common.h: Only include random() fix if this system needs it.
8751
8752         * crosstabs.q: Include alloca headers.
8753         (n_sorted_tab) New global var.
8754         (postcalc) Mostly rewritten.
8755         (find_pivot_extent) Rewritten.
8756         (enum_column_values) Rewritten.
8757
8758         * data-out.c: (convert_F) Rename inner n as n_spaces.
8759
8760         * error.c: (dump_message) Don't have an outer var i.
8761
8762         * file-handle.q: (static var f) Removed.  All references removed.
8763         (internal_cmd_file_handle) Uses a local variable instead of f.
8764
8765         * get.c: (trim_dictionary) Change scope of i, i1, i2.
8766         (cmd_match_files) Don't strcpy tokstr into sbc (why was this ever
8767         done?)
8768
8769         * getline.h: Declare getl_history as extern.  Reported by
8770         palme@uni-wuppertal.de (Hubert Palme).
8771
8772         * postscript.c: (postopen) Some large mods for constness.
8773
8774         * recode.c: Remove spurious copyrights since PSPP is owned by FSF
8775         anyway.
8776
8777 Fri Apr 24 12:52:47 1998  Ben Pfaff  <blp@gnu.org>
8778
8779         * Makefile.am: Rename BUILT_SOURCES to q_sources, all references
8780         changed.  Add avl.c, avl.h to pspp_SOURCES.  Remove avllib from
8781         LDADD.
8782
8783         * avl.c, avl.h: New files.  These form a clean-room
8784         reimplementation of avllib.  Iterative algorithms are used in
8785         place of recursive ones, so there is no resemblance in the code.
8786
8787         * Lots of headers: Don't include other headers by default.
8788
8789         * Lots of source files: Explicitly include all needed headers.
8790
8791         * arena.c: (arena_clear) New function.
8792
8793         * crosstabs.q: (ROW_VAR, COL_VAR) New enums.
8794         (static var ar) Removed.
8795         (staitc vars ar_tc, ar_col) New.
8796         (cmd_crosstabs) Destroy the arenas.
8797         (internal_cmd_crosstabs) Create the arenas.
8798         (precalc) Don't need a free function for the hash.
8799         (calc_general) Make sure to zero out the trailer on the key data
8800         before inserting.
8801         (print_table_entries) Updated.
8802         (postcalc) Worked on actually implementing.
8803         (find_pivot_extent) New function.
8804         (compare_value) New function.
8805         (enum_column_values) New function.
8806
8807         * data-in.c: (parse_month) Make local array `static const'.
8808         
8809         * data-out.c: (convert_date) Make local array `static const'.
8810         (convert_WKDAY) Same.
8811         (convert_MONTH) Same.
8812
8813         * frequencies.q: (postprocess_freq_tab) avl_walk_inorder() has
8814         been renamed to avl_walk().
8815         
8816         * hash.c: Rewritten more efficiently.
8817
8818         * hash.h: Add attribute const to hsh_next_prime declaration.
8819
8820         * lexer.c: (id_match) Make arguments const.
8821
8822         * postscript.c: (ps_postopen_driver) Make default fonts the
8823         Helvetica family.
8824
8825         * q2c.c: (main) Generated code needs stdlib.h.
8826
8827         * sfm-write.c: (write_value_labels) An avl_traverser needs to be
8828         initialized to 0 now, not to NULL.  All other references to
8829         avl_traverser were updated in the same way.
8830
8831         * tokens.h: Macro version of id_match updated to use const
8832         properly.
8833
8834         * val-labs.c: (inc_ref_count) New function.
8835         (copy_value_labels) Simply through use of new avl_copy() function.
8836
8837 Wed Apr 15 13:01:58 1998  Ben Pfaff  <blp@gnu.org>
8838
8839         * crosstabs.q: Probably doesn't compile.  New PIVOT subcommand.
8840         (postcalc) Worked on this.
8841
8842         * postscript.c: (OPO_DOUBLE_LINE) New enum.
8843         (struct ps_driver_ext) New line_width_thick member.
8844         (ps_preopen_drive) Init line_width_thick.
8845         (option_tab[]) Add line-* options.
8846         (ps_option) Parse line-* options.
8847         (postopen) Add line_width_thick support.  Strip leading spaces on
8848         prologue output lines.
8849         (ps_open_page) Include line_width_thick in output.
8850         (macro dump_thick_line) New.
8851         (dump_fancy_line) Support thick lines as well as double lines.
8852
8853 Tue Apr 14 00:50:08 1998  Ben Pfaff  <blp@gnu.org>
8854
8855         * Makefile.am: Add crosstabs.c to BUILT_SOURCES.  Add crosstabs.q
8856         to pspp_SOURCES.  Add crosstabs.q to EXTRA_DIST.
8857
8858         * Many source files: Rename `options' to `pv_opts' as appropriate.
8859
8860         * command.c: (static var cmd_table[]) Add CROSSTABS command.
8861
8862         * common.c: (xcalloc) New function.
8863
8864         * crosstabs.q: New file.  Not finished yet, though.
8865                 
8866         * data-list.c: Comment fix.
8867
8868         * error.c: Remove some old Checker cruft.
8869
8870         * frequencies.q: (dump_full) Cumulate valid percent instead of
8871         regular percent.
8872
8873         * getline.c: Comment fix.
8874
8875         * hash.c: Comment fixes.
8876
8877         * hash.h: (struct hsh_table) Make hash functions return unsigned
8878         instead of int to avoid problems with taking the modulo of
8879         negative return values.  All references changed.
8880
8881         * misc.c: (intlog10) Make its table static const instead of auto.
8882
8883         * sfm-read.c: (read_header) Make `prefix' static const instead of
8884         auto.
8885
8886         * var.h: (union value) Add member `hash'.
8887         (struct variable) Rename prv_index as `foo'--all references
8888         changed.  Reorder.
8889         (typedef pv_opts) Removed.  All references changed.
8890
8891         * vars-prs.c: (parse_variables) Message fixes.
8892         
8893 Mon Mar  9 15:35:08 1998  Ben Pfaff  <blp@gnu.org>
8894
8895         * get.c: (cmd_match_files) Don't reverse the order of FILEs as
8896         they are being inserted.  Don't check for BY variables of
8897         different types.  Discard variables if the active file isn't
8898         included in the merge.
8899         (mtf_processing) Essentially rewritten.
8900         (mtf_merge_dictionary) Check for master/slave variables of
8901         different types/widths.
8902
8903         * vfm.c: (static var not_canceled) New var.
8904         (process_active_file) Don't call vfm_source->read() if
8905         there's no vfm-source.  Initialize not_canceled.
8906         (process_active_file_write_case) Honor and update not_canceled.
8907         (prepare_for_writing) Rollback changes from yesterday, they were
8908         wrong.
8909         (close_active_file) Don't destroy vfm_source unless it exists.
8910         
8911 Mon Mar  9 00:56:16 1998  Ben Pfaff  <blp@gnu.org>
8912
8913         * Lots of source files: Added { } around nested if/else constructs
8914         to avoid new gcc 2.8 warnings.
8915
8916         * data-in.c: (parse_Z) Declare `int' type explicitly.
8917         (convert_Z) Ditto.
8918
8919         * get.c: (struct mtf_file) Add prev, next_min, by, input members.
8920         (cmd_match_files) Initialize mtf_by_values.  Manage by, input,
8921         prev members.  Put TABLEs at the end of the chain and FILEs at the
8922         beginning.  Don't allow the active file in STATE_INIT.  Use proper
8923         `seen' value for the active file.  Fill out the by members and
8924         make sure they're of consistent type.  Do the actual merge
8925         operation.
8926         (mtf_processing_finish) New function.
8927         (var_type_description) New function.
8928         (mtf_free_file) New function.
8929         (mtf_free) Rewritten.
8930         (mtf_delete_file_in_place) New function.
8931         (mtf_read_nonactive_records) New function.
8932         (mtf_compare_BY_values) New function.
8933         (static var mtf_seq_no) New var.
8934         (mtf_processing) New function.
8935         (mtf_merge_dictionary) Assign nval members for the system file
8936         dictionary.  Assign fv values for its variables.  Point each slave
8937         variable to the corresponding master variable.
8938
8939         * hash.c: Include str.h.
8940
8941         * mis-val.c: (copy_missing_values) src arg is const.
8942
8943         * misc.c: (spacing) Make `max' var explicitly int.
8944
8945         * sfm-read.c: (dump_dictionary) Message reformatting.
8946         (sfm_read_case) Add assertion.
8947
8948         * sort.c: Esthetic fixes.
8949
8950         * var.h: (struct match_files_proc) New struct.
8951         (struct variable) Add private data match_files_proc.
8952
8953         * vars-atr.c: (delete_variable) Implement.  Add argument for the
8954         dictionary that owning the variable.
8955         (dup_variable) Add assertion.
8956
8957         * vfm.c: Comment fixes, hopefully the comments are correct now.
8958         (process_active_file) New function.
8959         (process_active_file_write_case) New function.
8960         (process_active_file_output_case) New function.
8961         (prepare_for_writing) Use temp_dict->nval for vfm_info, not
8962         default_dict.nval.
8963         (write_case) Renamed procedure_write_case().  Now write_case is a
8964         pointer to a function.  Style fixes.
8965         
8966 1998-03-05  Ben Pfaff  <blp@gnu.org>
8967
8968         * Makefile.am: (q2c) Link with libmisc.
8969         (version.c) Define default_config_path, include_path,
8970         groff_font_path.
8971
8972         * ascii.c: (ascii_postopen_driver) When the default newline string
8973         is requested, open file in text mode.  Suggested by
8974         palme@uni-wuppertal.de (Hubert Palme).
8975         (static vars line_buf, line_p) Change from char * to unsigned char
8976         *.
8977         (ascii_close_page) char * to unsigned char *.
8978
8979         * cmdline.c: (parse_command_line) Implement -r option by
8980         prepending ~/.pspp/rc to the list of files to process.
8981
8982         * command.c: (cmd_remark) Reset getl_prompt to the standard prompt
8983         before pulling in a final line.
8984         (null_func, null_int_func) Removed (dead code).
8985
8986         * descript.q: (display) Calculate width of variable name column
8987         properly.  Calculate number of valid cases properly.  Reported by
8988         palme@uni-wuppertal.de (Hubert Palme).
8989
8990         * filename.c: (init_filename) Use default_config_path instead of
8991         now obsolete CONFIG_PATH.
8992
8993         * getline.c: (getl_initialize) Use include_path instead of now
8994         obsolete INCLUDE_PATH.
8995         (getl_add_file) New argument `where'.  All references changed.
8996
8997         * groff.c: (find_font_file) Use groff_font_path instead of now
8998         obsolete GROFF_FONT_PATH.
8999         
9000         * postscript.c: (find_ps_file) Use groff_font_path instead of now
9001         obsolete GROFF_FONT_PATH.  Copy through temporary variable to
9002         avoid problems with constness.
9003
9004         * str.h: (macro cs_streq) New macro.
9005
9006         * version.h: (glob var default_config_path, include_path,
9007         groff_font_path) New vars.
9008         
9009 1998-02-23  Ben Pfaff  <blp@gnu.org>
9010
9011         * Many source files: Change verbose_msg() priority levels and
9012         messages.
9013
9014         * aggregate.c: Include debug-print.h.
9015
9016         * cmdline.c: (parse_command_line) Add --safer/-s and --command/-c
9017         options.
9018         (static var pre_syntax_message) Document --safer/-s and
9019         --command/-c.
9020
9021         * command.c: (cmd_erase, cmd_host) Disable if set_safer is set.
9022
9023         * dfm.c: (open_inline_file) [__CHECKER__] Zero out ext->file,
9024         because it's not used but it's still copied.
9025         (open_file_r) Remove gratuitous debug message.
9026
9027         * filename.c: (safety_violation) New function.
9028         (open_file) Remove gratuitous debug messages.  Don't allow pipe
9029         files if set_safer is set.
9030
9031         * get.c: Turn off debugging.
9032
9033         * getline.c: (getl_add_virtual_file) New function.
9034         (getl_read_line) Add verbose_msg() call for opening new syntax
9035         file.
9036         (getl_perform_delayed_reset) Add a return value describing whether
9037         any action was taken.  Call reset_eof().
9038
9039         * getline.h: Comment fix.
9040
9041         * groff-font.c: (groff_read_font) Use `goto next_iteration' in
9042         place of incorrect `continue'.  Use strtok_r() instead of
9043         strtok().  Always check strtok_r() return value.
9044         (groff_read_DESC) Use strtok_r() instead of strtok().
9045
9046         * lexer.c: (reset_eof) New function.
9047
9048         * main.c: (parse) Get a token after performing a delayed reset
9049         action; allow empty syntax files.
9050
9051         * postscript.c: (output_encodings) Use strtok_r() instead of
9052         strtok().
9053
9054         * q2c.c: (dump_parser) Use strtok_r() instead of strtok().
9055
9056         * set.q: Comment fixes.
9057         (glob var set_safer) New var.
9058         (internal_cmd_set) Support SAFER.
9059
9060         * str.h: [!HAVE_STRTOK_R] Declare strtok_r() prototype.
9061
9062         * temporary.c: (free_dictionary) Set d->splits to NULL after
9063         freeing.
9064
9065         * vars-atr.c: (clear_variable) Decrement dict->n_splits if
9066         variable deleted, not if it *isn't* deleted.
9067
9068 1998-02-16  Ben Pfaff  <blp@gnu.org>
9069
9070         * command.c: (array cmd_table[]) Add MATCH FILES.
9071
9072         * common.c: Comment fixes.
9073
9074         * data-list.c, dfm.c, error.c, filename.c, list.q, matrix-data.c,
9075         modify-vars.c, postscript.c, sfm-read.c, sfm-write.c, tab.c:
9076         Include alloca.h.  Problem reported by palme@uni-wuppertal.de
9077         (Hubert Palme).
9078
9079         * expr-opt.c: Include str.h.  Problem reported by
9080         palme@uni-wuppertal.de (Hubert Palme).
9081
9082         * get.c: (cmd_get) [DEBUGGING] Update v->p.get to v->get.
9083         (static var mtf_by) Change from char ** to variable **.
9084         (static var mtf_master) New var.
9085         (mtf_merge_dictionary) New function.
9086         (cmd_match_files) Init mtf_master.  Parse mtf_by according to new
9087         var type.  Reorder tests properly.  Initialize file->dict.  Detect
9088         TABLE= without BY=.  Read file dictionaries and merge them.  Give
9089         subcommand name with IN, LAST, FIRST error messages.  Create IN,
9090         LAST, FIRST variables.  Comment fixes.
9091         (mtf_free) Don't free default_dict.  Free mtf_master.
9092
9093         * getline.c: Define getl_mode.  Change getl_buf_size to size_t
9094         from int.
9095         (handle_line_buffer) Cast int to size_t in comparison to avoid
9096         warning.
9097
9098         * getline.h: Declare getl_mode extern.
9099
9100         * groff-font.c: (groff_read_font) Type-fix calls to getline.
9101         (groff_read_DESC) Make line_size a size_t.
9102         (match_tok) Parenthesize name to avoid macro expansion.
9103
9104         * mis-val.c: (copy_missing_values) New function.
9105
9106         * postscript.c: (postopen) Make buf_size a size_t.
9107
9108         * sfm-read.c: (dump_dictionary) Make global from static.  Print
9109         variable info in parts for easier debugging with Checker.
9110
9111         * temporary.c: (copy_variable) Use copy_value_labels().
9112         (new_dictionary) New arg: whether to copy file label, documents.
9113
9114         * val-labs.c: (copy_value_labels) New function.
9115
9116         * var.h: (enums MISSING_*) Add MISSING_COUNT.
9117
9118         * vars-atr.c: [GLOBAL_DEBUGGING] (force_dup_variable) New
9119         function.
9120         (dup_variable) Set prv_index, get.fv, get.nv.
9121
9122 Fri Feb 13 15:38:36 1998  Ben Pfaff  <blp@gnu.org>
9123
9124         * Makefile.am: (pspp_SOURCE) Add htmlP.h.
9125
9126         * Many source files: For ANSI-compliance, add empty statement
9127         after label.  Reported by palme@uni-wuppertal.de (Hubert Palme)
9128         and Micah Altman <maltman@www-vdc.fas.harvard.edu>.
9129
9130         * data-in.c: (parse_numeric) Some header files break on
9131         -DBL_MIN_10_EXP because they get a --; add () for safety.
9132         Reported by palme@uni-wuppertal.de (Hubert Palme).
9133
9134         * dfm.c: Idea by Dr Eberhard W Lisse <el@linux.lisse.na>.
9135         (struct dfm_fhuser_ext) Change `file' from FILE * to file_ext.
9136         (dfm_close) Use close_file_ext.
9137         (open_inline_file) Set file.file to NULL, not file.
9138         (open_file_r, open_file_w) Initialize file.file; fill in file_ext
9139         struct and use open_file_ext().
9140         (read_record) Use file.file.
9141
9142         * file-handle.q: (prepend_current_directory) Pass through special
9143         filenames.
9144
9145         * filename.c: Only include unistd.h if HAVE_UNISTD_H.
9146         (normalize_filename) Pass through special filenames.
9147         (open_file, close_file) Accept pipe| and |pipe syntaxes as
9148         equivalent.
9149         (dirname) Rename blp_dirname() because of name conflict on some
9150         OS.  All references changed.  Reported by palme@uni-wuppertal.de
9151         (Hubert Palme).
9152         (is_special_filename) New function.
9153
9154         * get.c: (GTSV_OPT*) Add GTSV_OPT_MATCH_FILES.
9155         (trim_dictionary) Conditionalize some of the options on whether
9156         GTSV_OPT_MATCH_FILES is in *options.
9157         (rename_variables) Don't allow variables to be renamed as scratch
9158         variables.
9159         (MTF_*) New enum series.
9160         (struct mtf_file) New struct.
9161         (static vars mtf_head, mtf_tail, mtf_by, mtf_n_by, mtf_free) New
9162         vars.
9163         (cmd_match_files, mtf_free) New functions.
9164
9165         * lexer.c: (match_int) Needed parentheses around name to escape
9166         macro expansion.  Reported by Micah Altman
9167         <maltman@www-vdc.fas.harvard.edu>.
9168
9169         * print.c: Needed to include alloca.h.  Reported by Micah Altman
9170         <maltman@www-vdc.fas.harvard.edu>.
9171
9172         * recode.c: (convert_to_double) Parenthesize -DBL_MIN_10_EXP to
9173         -(DBL_MIN_10_EXP).  Reported by palme@uni-wuppertal.de (Hubert
9174         Palme).
9175         
9176         * str.h: Include stdarg.h.  Reported by palme@uni-wuppertal.de
9177         (Hubert Palme) and Micah Altman <maltman@www-vdc.fas.harvard.edu>.
9178
9179 Thu Feb  5 00:18:21 1998  Ben Pfaff  <blp@gnu.org>
9180
9181         * html.c: (struct html_driver_ext) Move into htmlP.h.
9182         (html_preopen_driver) Initialize cp_x, cp_y.
9183         (html_submit) Implement as call to output_tab_table().
9184         (change_attributes) New function.
9185         (escape_string) New function.
9186         (output_tab_table) New function.
9187
9188         * list.q: (write_all_headers) Add code for writing headers for the
9189         html driver.
9190         (clean_up) Write out the html close-table tag.
9191         (determine_layout) Ignore html driver.
9192         (list_cases) Write html data.
9193
9194         * som.c: (som_submit) Move more of the code into output_table().
9195
9196         * tab.c: (static var hit) Make a global var and rename tab_hit.
9197         (static var tab_table_class) Make a global var.
9198
9199         * htmlP.h: New file.
9200
9201 Tue Feb  3 16:12:18 1998  Ben Pfaff  <blp@gnu.org>
9202
9203         * dump-sysfile.c: Removed.
9204
9205         * html.c: (preclose) Change comment in emitted code.
9206
9207         * matrix-data.c: Debugging off by default.  Comment fixes.
9208         (static var container) New var.
9209         (cmd_matrix_data) Create and destroy container.  Initialize
9210         is_per_factor[] to 0s.  Move code into new function
9211         string_to_content_type().  Require split values to be present in
9212         the data when ROWTYPE_ is explicit.  Call specific function, not
9213         general read_matrices().
9214         (string_to_content_type) New function.
9215         (context) Exclude all whitespace, not just spaces.
9216         (mget_token) A dot is a number.  Add assertion.
9217         (static var data) Renamed nr_data.
9218         (static var factor_values) Renamed nr_factor_values.
9219         (read_matrices) Renamed read_matrices_without_rowtype().  Handle
9220         only specific case.  Close data_file before exit.
9221         (fill_matrix) New function.
9222         (read_data_lines) Renamed nr_read_data_lines().  Remove debug
9223         printing.  Style fixes.  Message fixes.  Move code into
9224         fill_matrix().
9225         (read_matrices_without_rowtype) Rename
9226         matrix_data_read_without_rowtype().  Fix off-by-one error on
9227         loops.  Allocate nr_data[] memory from arena.
9228         (read_matrices_with_rowtype) Removed.
9229         (read_splits) Renamed nr_read_splits().  Style fixes.
9230         (read_factors) Renamed nr_read_factors().
9231         (dump_cell_content) Comment fixes.  Arguments changed.  Change
9232         debug printing.  All references changed.
9233         (output_data) Renamed nr_output_data().
9234         (static var wr_content) New var.
9235         (struct factor_data) New struct.
9236         (static var wr_data) New var.
9237         (static var wr_current) New var.
9238         (matrix_data_source_destroy_source) Removed.
9239         (read_matrices_with_rowtype) New function.
9240         (matrix_data_read_with_rowtype) New function.
9241         (wr_read_splits) New function.
9242         (compare_factors) New function.
9243         (wr_output_data) New function.
9244         (wr_read_rowtype) New function.
9245         (wr_read_factors) New function.
9246         (wr_read_indeps) New function.
9247         (glob var matrix_data_source) Make destroy_source member NULL as
9248         well.
9249
9250 Fri Jan 23 00:09:08 1998  Ben Pfaff  <blp@gnu.org>
9251
9252         * lexer.c: (syntax_error) Give better error message when at end of
9253         file.
9254
9255         * matrix-data.c: (var content_names[]) Fix PROX spelling.  Change
9256         N_SCALAR to output as plain N.
9257         (mdump_token) Change output format.
9258         (context) Fix message output interaction with spaces in input.
9259         (another_token) New function.
9260         (force_eol) Improved error message.
9261         (static var max_cell_index) New var.
9262         (read_matrices) Init `cells'.  factor_values is now per-cell.
9263         Init max_cell_index.
9264         (read_data_lines) Replace `compare' local with new `compare' arg.
9265         Debugging messages changed.  Only read factors if per_factor.
9266         Propagate error return from read_factors(), force_eol().
9267         Copy N_SCALAR values across the N vector.
9268         (read_matrices_without_rowtype) Don't init `cells'.  Don't need to
9269         check parentheses manually since we now have is_per_factor[].
9270         Call read_data_lines() with new args.  Check for end of data after
9271         looping, using another_token().
9272         (read_factors) Arguments changed.  Use max_cell_index to determine
9273         whether to read or compare factors.  Message fixes.
9274         (dump_cell_content) New function.
9275         (output_data) Completely rewritten because content types were
9276         supported to be nested inside factor values, not vice versa.
9277         
9278 Thu Jan 22 00:26:38 1998  Ben Pfaff  <blp@gnu.org>
9279
9280         * lexer.c: (syntax_error) Support formatted varargs messages.
9281
9282         * matrix-data.c: Turn debugging on by default.
9283         (static content_type[]) New array.
9284         (static content_names[]) New array.
9285         (static rowtype_, varname_) New vars.
9286         (static is_per_factor[]) New array.
9287         (static split_values) Moved declaration.
9288         (static n_continuous, first_continuous) New var.
9289         (cmd_matrix_data) Don't init split_values.  Assign ROWTYPE_ to
9290         rowtype_.  Simplify SPLIT code.  Init is_per_factor[].  Assign
9291         VARNAME_ to varname_.  Initialize first_continuous, n_continuous.
9292         Check for continuous variables.
9293         [DEBUGGING] (debug_print) Remove content_names[].
9294         (mdump_token) New macro.
9295         (mget_token_dump) New function.
9296         (mdump_token) New function.
9297         (context) New function.
9298         (mget_token) Fix messages.
9299         (static var data, split_values, factor_values) New vars.
9300         (read_matrices) Manage split_values, factor_values.
9301         (read_data_lines) New function.
9302         (read_matrices_without_rowtype) Implemented.
9303         (read_splits) Message fixes.  Uses `just_read'.
9304         (read_factors) New function.
9305         (output_data) New function.
9306         (matrix_data_source_destroy_source) Close the file handle.
9307         (glob var matrix_source) Change name from "DATA LIST" to "MATRIX
9308         DATA".
9309
9310         * str.c: (strpadcmp) Removed.
9311
9312         * vfm.c: (dump_splits) Initialize i; fix test for end of splits.
9313
9314 Sun Jan 18 00:30:59 1998  Ben Pfaff  <blp@gnu.org>
9315
9316         * Lots of source files: Add cast to unsigned character to calls to
9317         tolower() and toupper().
9318
9319         * aggregate.c: Set default_dict.splits to NULL.
9320
9321         * command.c: (static variable tab[]) Add MATRIX DATA.
9322
9323         * data-in.c: Add debugging defines.  Formatting fixes.
9324
9325         * expr-opt.c: Formatting fixes.
9326
9327         * lexer.c: (syntax_error) Message fixes.
9328
9329         * matrix-data.c: New enum series.
9330         (static vars fmt, section, diag, explicit_rowtype, signle_split,
9331         split_values, n_factors, factors, cells, pop_n, contents,
9332         n_contents) New vars.
9333         (cmd_matrix_data) Finished implementation.
9334         (compare_variables_by_mxd_vartype) New function.
9335         [DEBUGGING] (debug_print) New function.
9336         (static vars mtoken, mtokstr, mtoklen, mtokval) New vars.
9337         (read_matrices) New function.
9338         (read_matrices_without_rowtype) New function.
9339         (read_matrices_with_rowtype) New function.
9340         (read_splits) New function.
9341         (mget_token) New function.
9342         (force_eol) New function.
9343         [0] (test_tokenizer) New function.
9344         (matrix_data_source_destroy_source) New function.
9345         (glob var matrix_data_source) New var.
9346
9347         * misc.h: Include ieeefp.h if present.
9348
9349         * split-file.h: (cmd_split_file) Changes corresponding to struct
9350         dictionary changes.
9351
9352         * str.h: Fix memmem prototype.
9353
9354         * temporary.c: (save_dictionary, restore_dictionary,
9355         free_dictionary) Changes corresponding to struct dictionary
9356         changes.
9357
9358         * var.h: (MXD_* enums) New enum series.
9359         (struct matrix_data_proc) New struct.
9360         (struct split) Removed.
9361         (struct dictionary) Changed `splits' member from `split *' to
9362         `variable **'.
9363         (macro force_create_variable) New macro.  Replaced lots of
9364         create_variable()/assert() calls with calls to this macro.
9365
9366         * vars-atr.c: (discard_variables) Changed assertion.
9367         [GLOBAL_DEBUGGING] (force_create_variable) New function
9368         called by the macro of the same name.
9369         (clear_variable) Changes to delete splits from the dictionary
9370         corresponding to struct dictionary changes.
9371
9372         * vars-prs.c: (parse_variables) [GLOBAL_DEBUGGING] Check for
9373         corrupted variable `index' values in the dictionary passed in
9374         every time this function is called.
9375
9376         * vfm.c: (dump_splits, SPLIT_FILE_procfunc) Changes corresponding
9377         to struct dictionary changes.
9378
9379 Tue Jan 13 23:45:02 1998  Ben Pfaff  <blp@gnu.org>
9380
9381         * Makefile.am: (pspp_SOURCES) Add matrix-data.c.
9382
9383         * command.c: New includes.
9384         (static array cmd_table[]) Add ERASE, HOST, NEW FILE.
9385         (cmd_erase) New function.
9386         [unix] (shell) New function.
9387         (run_command) New function.
9388         (cmd_host) New function.
9389         (cmd_new_file) New function.
9390
9391         * expr-prs.c: (parse_primary) Message fix.
9392
9393         * inpt-pgm.c: Formatting fix.
9394         (cmd_reread) Implement the FILE subcommand.
9395
9396         * matrix-data.c: New file.
9397
9398         * q2c.c: (dump_header) Change output commenting style.
9399
9400         * weight.c: Comment fix.
9401
9402 Tue Jan 13 00:53:39 1998  Ben Pfaff  <blp@gnu.org>
9403
9404         * aggregate.c: (buf64_10x) Renamed buf64_1xx, all references
9405         changed.
9406         (buf_10x) Renamed buf_1xx, all references changed.
9407         (cmd_aggregate) Implemented cases 010, 011, 110, and 111 (all
9408         cases now implemented).
9409         (create_sysfile) New function.
9410         (agr_11x_func) New function.
9411
9412         * data-in.c: (parse_numeric) Work properly if there's an
9413         explicitly coded decimal point in the data and decimal places are
9414         specified on DATA LIST.  Bug reported by Dr Eberhard W Lisse
9415         <el@linux.lisse.na>.
9416
9417         * get.c: (cmd_get, cmd_save_internal) Allow extraneous slash
9418         before file specification on GET, SAVE, XSAVE.  Bug reported by Dr
9419         Eberhard W Lisse <el@linux.lisse.na>.
9420
9421         * q2c.c: [!HAVE_STRERROR] Include misc/strerror.c, not
9422         strerror.c.  Bug reported by Alexandre Oliva
9423         <oliva@dcc.unicamp.br>.
9424
9425         * sort.c: Include sort.h.  Comment fixes.  A few esthetic fixes.
9426         (static var separate_case_tab) New var.
9427         (cmd_sort_cases) Cancel temporary transformations here.  Free
9428         v_sort before return.
9429         (sort_cases) Run an EXECUTE procedure if SEPARATE is nonzero and
9430         we're reading from a sort stream.  Don't cancel temporary
9431         transformations.  Offload internal sorting to do_internal_sort().
9432         (do_internal_sort) New function.  Handles internal sorting even
9433         when SEPARATE is nonzero.  Doesn't free v_sort.
9434         (do_external_sort) Take new arg SEPARATE.  Only destroy `x' if
9435         it's non-NULL.
9436         (write_initial_runs) Take new arg SEPARATE.  Only destroy the old
9437         sink if SEPARATE is zero.
9438         (read_output_cases) Renamed read_sort_output(), all references
9439         changed.  Now uses separate_case_tab when it exists.
9440         (write_separate) New function.
9441
9442         * vfm.c: (page_to_disk) Destroy memory_source_cases, not
9443         memory_sink_cases.  Don't redundantly call
9444         vfm_source->destroy_source().
9445         (memory_stream_mode) After switching over, set memory_sink_cases
9446         to NULL.
9447
9448 Sat Jan 10 23:35:51 1998  Ben Pfaff  <blp@gnu.org>
9449
9450         * aggregate.c: (struct agr_var) Expand dbl[] array from 2 to 3
9451         elements.
9452         (static var prev_case) New, moved out of aggregate_single_case()
9453         local scope.
9454         (static var buf64_10x, buf_10x) New.
9455         (cmd_aggregate) Initialize prev_case.  Comment fixes.  Implement
9456         the 000, 001, 100, and 101 cases.  Free prev_case.
9457         (parse_aggregate_functions) Disallow scratch variables.
9458         (free_aggregate_functions) Only free agr_dict if non-null.  Use
9459         iter->function to determine numeric/string type, not
9460         iter->src->type.
9461         (aggregate_single_case) Don't manage prev_case.  Initialize
9462         aggregate info after dumping it.
9463         (accumulate_aggregate_info) Fix sum, weighted sum, mean, weighted
9464         mean, stddev, weighted stddev definitions.
9465         (dump_aggregate_info) Implemented.
9466         (initialize_aggregate_info) Renamed from
9467         initialize_aggregate_functions().  Initializes dbl[2].
9468         (agr_00x_trns_proc, agr_00x_end_func, write_case_to_sfm,
9469         agr_10x_trns_proc, agr_10x_trns_free, agr_10x_end_func) New.
9470
9471         * cases.c: (alloc_val) Removed.
9472
9473         * get.c: (cmd_save_internal) Initialize new `dict' member.
9474
9475         * sfm-write.c: (sfm_write_dictionary, write_header,
9476         write_variable, write_value_labels, write_documents) Reorganize,
9477         simplify for new parameter structure.
9478         (write_variable) Only one variable * argument now.
9479
9480         * sfm.h: (struct sfm_write_info) Removed `pri', `sec', and
9481         replaced by new `dict' member.
9482
9483         * temporary.c: (new_dictionary) Initialize n_documents.
9484
9485         * vars-atr.c: (dup_variable) Allocate `value's from dict into
9486         v->fv manually.
9487         (init_variable, replace_variable) Eliminate usage of alloc_val().
9488
9489         * vars-prs.c: (parse_DATA_LIST_vars) Accept PV_NO_SCRATCH option.
9490
9491         * vfm.c: (arrange_compaction) Allow `temporary' value of 2 to
9492         signal that AGGREGATE is to be used for forming final cases.
9493         (close_active_file) Call end_func before stopping lagging.  Cancel
9494         temporary after finishing compaction.
9495         (write_case) Comment fixes.  Cleaned up.
9496         (compact_case) Let AGGREGATE handle compaction when `temporary' is
9497         2.
9498
9499 Sat Jan 10 02:10:47 1998  Ben Pfaff  <blp@gnu.org>
9500
9501         * Makefile.am: (BUILT_SOURCES) Add means.c.
9502         (pspp_SOURCES) Add means.c.
9503         (EXTRA_DIST) Add means.q.
9504
9505         * command.c: (array cmd_table[]) Add MEANS.
9506
9507         * common.h: Esthetic fixes.  Comment fixes.  Test for
9508         MAX_SHORT_STRING greater than 8.
9509         (macros LOWEST, HIGHEST) New.
9510
9511         * data-in.c, data-list.c, recode.c: Comment fixes.
9512
9513         * means.q: New file, base version.
9514
9515         * mis-val.c: (parse_num_or_range, parse_numeric) Replace -DBL_MAX
9516         with LOWEST, DBL_MAX with HIGHEST.
9517
9518         * q2c.c: (dump_vars) Add an enum to array types giving the number
9519         of values for the enum.
9520
9521         * sfm-read.c: (sfm_read_dictionary, read_machine_flt64_info)
9522         Replace second_lowest_value with second_lowest_flt64.
9523
9524         * sfm-write.c: (write_variable, write_rec_7_34) Replace
9525         second_lowest_value with second_lowest_flt64.
9526
9527         * t-test.q: Comment fix.
9528
9529         * temporary.c: (restore_dictionary) Esthetic fix.
9530
9531         * tokens.h: (force_match_id, force_match, force_string, force_int,
9532         force_num, force_id) Replace msg() with syntax_error().
9533
9534         * var.h: (struct means_proc) New.
9535         (struct variable) Add mns member to `p' union.
9536
9537         * vars-prs.c: (parse_variable, parse_dict_variable,
9538         parse_variables, parse_DATA_LIST_vars) Replace msg() with
9539         syntax_error().
9540
9541 Thu Jan  8 22:28:41 1998  Ben Pfaff  <blp@gnu.org>
9542
9543         * Makefile.am: (pspp_SOURCES) Add tab.h.
9544
9545         * Most source files: Added a cast to unsigned char in usages of
9546         the ctype is*() functions.  Replaced `end of command expected'
9547         calls to msg() with calls to syntax_error().
9548
9549         * frequencies.q: (dump_condensed) Fix tab_dim() column reference.
9550
9551         * lexer.c: (hex_val) Removed (was dead code).
9552         (idmatch) Parenthesize function name to avoid macro expansion.
9553
9554         * postscript.c: Comment fixes.
9555         (ps_preopen_driver) Change default font size to 10pt.
9556
9557         * sfm-read.c: (read_variables) Byteswap sv.print, sv.write as
9558         int32s.
9559         (parse_format_spec) Change system-file format spec argument type
9560         to int32.  Parse the format spec with bitwise operators.
9561
9562         * sfmP.h: (struct sysfile_format) Removed.
9563         (struct sysfile_variable) Changed print, write members from
9564         sysfile_format to int32.
9565
9566         * tokens.h: Esthetic fixes.
9567         [__GNUC__] (macro id_match) New macro to hopefully speed up
9568         identifier matching.
9569         (macros match_id, match_tok, match_int) Implemented in
9570         compiler-independent manner; no longer GNU C only.
9571
9572         * vfm.h: Include time.h.
9573
9574 Mon Jan  5 11:06:15 1998  Ben Pfaff  <blp@gnu.org>
9575
9576         * data-list.c: (dump_fixed_table) Change tab_dim().
9577
9578         * dump-sysfile.c: (open_sysfile) Fix mmap() call.
9579
9580         * error.c: Include command.h.
9581
9582         * frequencies.g: Formatting fixes.
9583
9584         * frequencies.q: Add tab_dim() calls.  Make the total cell a
9585         joined cell.
9586
9587         * glob.c: Include command.h.
9588
9589         * sfm-read.c: (struct sfm_fhuser_ext) New members sysmis, highest,
9590         lowest.
9591         (sfm_read_dictionary) Initialize sysmis, highest, lowest.
9592         (sfm_read_machine_flt64_info) Update sysmis, highest, lowest.
9593         (read_variables) Byteswap sv.type; byteswap sv.print, sv.write as
9594         the other elements (is this right?).
9595         (read_variables) Use lowest, highest members.
9596         (parse_format_spec) New arg `vv' for more stringent checking.
9597         (dump_dictionary) Byteswaps nonexplicit data.
9598         (sfm_read_case) Byteswap numeric data.
9599
9600         * som.c: Initialize table_num to 1.
9601         (render_segments) Remember to increment y_index after each table
9602         segment.
9603
9604         * sysfile-info.c: (cmd_sysfile_info) Change tab_dim().  Don't call
9605         avl_count() on a NULL tree.  No title for the second table.
9606         (cmd_display) Handle DISPLAY VECTORS by calling display_vectors().
9607         Handle AS_SCRATCH as AS_NAMES.  Warn if no variables.  Re-enable;
9608         fix call to display_variables().
9609         (display_variables) Default to 4 columns, not 3.  Set up headers.
9610         Column title is Variable, not Name.  Fix index column.
9611         Add joint text.  Add tab_dim().  Handle value labels properly.
9612         Handle DISPLAY LABELS properly.  Draw boxes correctly.
9613         (describe_variable) Value labels don't need titles.  Don't clear
9614         nonexistent index column.
9615         (compare_vectors_by_name) New function.
9616         (display_vectors) New function.
9617
9618         * tab.c: (tab_height) Add assertion.
9619         (tab_null) Add debug code.
9620         (evaluate_dimensions) Add debug code.
9621
9622         * var.h: (struct variable) get_proc data is sometimes used
9623         simultaneously with other per-procedure info, therefore it was
9624         removed from the union.  All references changed.        
9625
9626 Sun Jan  4 18:13:33 1998  Ben Pfaff  <blp@gnu.org>
9627
9628         * ascii.c: (ascii_close_page) Put title on second line of headers
9629         if there is no subtitle.
9630
9631         * command.c: (glob var cur_proc) Move definition here, from
9632         common.c.
9633         (cmd_remark) Emit blank line before remarks.
9634
9635         * command.h: (glob var cur_proc) Move declaration here, from
9636         common.h.
9637
9638         * data-list.c: (dump_fixed_table) Fix messages.
9639         (dump_free_table) Call tab_nat_dim().
9640
9641         * descript.q: (dump_z_table) Modify tab_dim() call.
9642
9643         * frequencies.q: (dump_condensed, dump_statistics) Add tab_dim()
9644         call.
9645         (dump_statistics) Don't output header.
9646
9647         * groff-font.c: Minor format fix.
9648
9649         * html.c: Comment fix.
9650
9651         * list.q: (write_varname) Indent after advancing page.
9652
9653         * output.h: Minor reordering.
9654
9655         * postscript.c: Comment fixes.  Many places, '\n' was replaced by
9656         a reference to eol[].
9657         (struct ps_driver_ext) New member eol[].
9658         (ps_preopen_driver) Initialize eol[].
9659         (ps_postopen_driver) Fix sense of text for text_opt, line_opt
9660         defaults.  Handle headers.  Fix test for minimum page length.
9661         (static var option_tab[]) Add `line-ends'.
9662         (ps_option) Handle line-ends to change eol[].
9663         (postopen) Scale prop_em_width and fixed_width properly.  Set the
9664         prologue title to outp_title if applicable.  Replace the prologue
9665         line ends with eol[].  Call draw_headers() if headers are enabled.
9666         (text_width) New function.
9667         (out_text_plain) New function.
9668         (draw_headers) New function.
9669
9670         * print.c: (dump_table) Call tab_nat_dim().
9671
9672         * som.c: (som_blank_line) Only advance a line if not at the top of
9673         a page.
9674         (som_submit) Move several informational table calls here.
9675         Increment subtable_num if SOMF_NO_TITLE not set.
9676         (output_table) Advance a line if SOMF_NO_SPACING not set.
9677         (render_columns, render_segments, render_simple) Handle spacing
9678         between tables.  Handle table titles.  Remove debug output.
9679
9680         * som.h: (SOMF_*) New enum series.
9681         (struct som_table_class) New member `flags'.
9682
9683         * sysfile-info.c: (cmd_sysfile_info) Calls tab_nat_dim().  No
9684         headers or spacing.
9685         (display_variables) Calls tab_nat_dim().
9686         (describe_variable) Remove restriction on number of value labels.
9687         Make value labels separated by thin lines.
9688
9689         * tab.c: (tab_create) Default `flags' to none.
9690         (tab_float) New arg `w'.  All references changed.
9691         (tab_nat_dim) New function.
9692         (tab_output_text) No title or spacing.
9693         (tab_flags) New function.
9694         (tabi_flags) New function.
9695         (tabi_title) New function.
9696         (strip_height) Removed.
9697         (tabi_render) Skip title when necessary.
9698         (static var tab_tab_class) Add tabi_flags, tabi_title.
9699         (evaluate_dimensions) Disable display of column, row size.
9700         (sum_columns) Add title height to top header.
9701         (render_strip) Moved within file.
9702
9703         * tab.h: (struct tab_table) New member `flags'.
9704
9705         * vfm.c: (dump_splits) Calls tab_nat_dim().  No title.
9706
9707 Sat Jan  3 16:55:44 1998  Ben Pfaff  <blp@gnu.org>
9708
9709         * Most source files: Add `const' attribute in all appropriate
9710         places.
9711         
9712         * sysfile-info.c: (cmd_sysfile_info) Add tab_dim() call, add a
9713         column to the variables table for use by describe_variable().
9714         (cmd_display) Disable for the present.
9715         (display_documents) Don't wrap documents.
9716         (display_variables) Table has four columns now.
9717         (describe_variable) Table has four columns now.  Don't use a
9718         subtable, use joined cells instead.
9719
9720         * tab.c: (tab_create) Don't set `join'.
9721         (tab_realloc) ct array is not made up of a_string's.
9722         Reallocate trh, hrh, h arrays, initialize trh array.  Initialize
9723         cell contents on GLOBAL_DEBUGGING, not DEBUGGING.
9724         (text_format) New function.
9725         (tab_title) Rewritten, uses text_format().
9726         (tab_text) Rewritten, uses text_format().
9727         (tab_joint_text) New function.
9728         (tab_join) Removed.
9729         (static var hit) New variable.
9730         (render_strip) New args r1, r2.  Implement joined cells that fit
9731         on a single page.
9732         (tabi_render) Increment hit.  Pass new args to render_strip().
9733         (evaluate_dimensions) [GLOBAL_DEBUGGING] Check for uninitialized
9734         cells.  For t_naw and t_nah, ignore joined cells and null cells in
9735         calculations.
9736         
9737         * tab.h: (struct tab_join_rect) Removed.
9738         (struct tab_table) Removed `join'.
9739         (TAB_JOIN_MAIN) Removed.
9740         (struct tab_joined_cell) New struct.
9741         (TAT_NOWRAP) New enum.
9742
9743 Fri Jan  2 01:39:58 1998  Ben Pfaff  <blp@gnu.org>
9744
9745         * ascii.c: (ascii_postopen) Replace ASCII_* macros with their
9746         expansions.
9747         (ascii_postopen_driver) Fix initialization of *_spacing so that
9748         the TAL_0 bit doesn't count.
9749
9750         * data-list.c: (dump_fixed_table) Use natural width for Format
9751         column.
9752
9753         * glob.c: (rerange) Removed.
9754         (get_date) Formatting fixes.  Internationalization fix.
9755
9756         * html.c: (html_postopen_driver) Replace HTML_DEFAULT_OUTPUT_FILE
9757         with "pspp.html".
9758
9759         * postscript.c: (ps_postopen_driver) Replace
9760         PS_DEFAULT_OUTPUT_FILE with "pspp.ps".
9761
9762         * som.c: (som_submit) Don't eject page before every table.
9763         (output_table) Fix order of arguments on call to area().
9764         (render_columns) Fix calculation of max_len.
9765         
9766         * tab.c: (tabi_cumulate) Minor change to increase elegance.
9767         (render_strip) New function.
9768         (strip_height) New function.
9769         (tabi_render) Rewrite as calls to render_strip().
9770
9771         * tab.h: (TAT_* enums) Removed TAT_RICH, all references removed.
9772         Renumbered TAT_PRINTF, TAT_TITLE, TAT_FIX to correspond better
9773         with the TAB_* and OUTP_T_* constants.
9774         
9775 Thu Jan  1 11:53:52 1998  Ben Pfaff  <blp@gnu.org>
9776
9777         * Makefile.am: Formatting fixes.
9778
9779         * ascii.c: (ascii_postopen_driver) Initialize *_line_spacing[],
9780         *_line_width[].
9781
9782         * data-list.c: (dump_fixed_table) Add tab_dim() call.
9783
9784         * descript.q: (dump_z_table, display) Add tab_dim() calls.
9785
9786         * dump-sysfile.c: (glob var length) Make type off_t.
9787         (usage) Fix arguments.
9788         (main) Return 0.
9789
9790         * output.h: (OUTP_T_*) Change constants' value to match tab.h.
9791         Now right-justification is the default so many references had to
9792         change.
9793         (struct outp_class) Removed line_width, all references changed.
9794         (OUTP_DEV_*) Add OUTP_DEV_DISABLED.
9795         (struct outp_driver) Add elements horiz_line_width,
9796         vert_line_width, horiz_line_spacing, vert_line_spacing.  Remove
9797         som element.
9798
9799         * postscript.c: (outp_encodings) Formatting fixes.  Fix garbage
9800         collection.
9801         (postopen) Initialize all the informational members of
9802         outp_driver.
9803
9804         * som.c: (som_blank_line) New function, renamed from blank_line(),
9805         all references changed.
9806         (som_submit) Disables drivers whose pages can't be opened.
9807         (render_columns, render_simple, render_segments) Add debug output.
9808         (render_columns) Fix loop range.
9809         (render_simple) Don't try to render the headers, they're taken
9810         care of automatically.  Advance cp_y past the table when done.
9811         (render_segments) Fix loop ranges.
9812
9813         * tab.c: Initialize new members of tab_table.
9814         (tab_vline) Handle trv[]; don't set style for spacing-only lines.
9815         (tab_hline) Handle trh[]; don't set style for spacing-only lines.
9816         (tab_box) Handle trh[], trv[]; don't set style for spacing-only
9817         lines.
9818         (set_expr) Removed.
9819         (tab_dim) New function.
9820         (tab_col_width) Removed.
9821         (tab_row_height) Removed.
9822         (tab_output_text) Call tab_dim().
9823         (tabi_driver) Call evaluate_dimensions(), sum_columns().
9824         (tabi_area) Implemented.
9825         (tabi_cumulate) Implemented.
9826         (tabi_render) Partially implemented, but broken.
9827         (var tab_table_class) Made static.
9828         (evaluate_dimensions) New function.
9829         (sum_columns) New function.
9830
9831         * tab.h: (enum t_*) Now start at t_end.  New: t_ptw, t_nr, t_nc,
9832         t_nah, t_naw, t_neg, t_xch, t_dup, t_lbl, t_jnz, t_sac, t_sar,
9833         t_scr, t_srr, t_sentinel.  Removed: t_nat.
9834         (struct tab_table) New: wl, wr, ht, hb, trh, hrh, trv, wrv, dim,
9835         max_stack_height, w, h.  Removed: ce, re.
9836         (macro blank_line) Removed.
9837         (glob var zero_length) Removed.
9838
9839 Fri Dec 26 15:44:31 1997  Ben Pfaff  <blp@gnu.org>
9840
9841         * Most source files: include some of the new include files broken
9842         out of var.h.
9843         
9844         * Makefile.am: (pspp_SOURCES) Add all the new source files to the
9845         list.
9846
9847         * aggregate.c: (glob var outfile) Make static.
9848
9849         * command.c: (glob var pgm_state) Move here.
9850
9851         * common.c: (glob vars endian, second_lowest_value, pgmname,
9852         finished, curdate, cur_proc, start_interactive, history_file) Move
9853         here.
9854
9855         * descript.q: (structs dsc_z_score, descriptives_trns) Move here.
9856
9857         * file-handle.q: (glob vars files, inline_file) Move here.
9858
9859         * glob.c: Lost lots of glob vars, detailed in individual file
9860         entries.
9861         (init_glob) set_printer, set_screen were obsolete, deleted.
9862         set_cprompt has fewer spaces because pspp has fewer letters than
9863         fiasco.
9864
9865         * inpt-pgm.c: (glob vars inp_init, inp_init_size) Move here.
9866         (inp_nval) Made static.
9867
9868         * lexer.c: (glob vars token, tokval, tokstr, tokstr_size,
9869         tokstr_len, toklongstr, tokint) Move here.
9870
9871         * misc.c: Lost several vars and functions.
9872
9873         * set.q: (all the set_* variables) Move here.
9874
9875         * str.c: (strmaxcpy, strbarepadcpy, strbarepadlencpy, strpadcpy,
9876         blpstrset, strpadcmp, memrev, memrmem, cmp_str) Move here from
9877         misc.c.
9878
9879         * tab.c: (set_expr, tab_col_width, tab_row_height) New functions.
9880
9881         * tab.h: (enum series t_*) New enums.
9882         (struct tab_table) Use arena struct tag.  New members ce, re.
9883
9884         * tokens.h: Comment fixes.
9885
9886         * var.h: Move lots of enums and variables and functions and
9887         structures to other files.  Use and declare a lot more union and
9888         struct tags.  Comment fixes.  
9889
9890         * vector.c: (glob vars vec, nvec) Move here.
9891
9892         * vfm.c: (glob vars reinit_sysmis, reinit_blanks, init_zero,
9893         init_blanks, last_vfm_invocation) Move here.
9894
9895         * cases.h: New file.
9896         (struct long_vec) Move here.
9897         (vec_init, vec_clear, vec_insert, vec_delete, devector, envector)
9898         Move here.
9899
9900         * command.h: New file.
9901         (STATE_* enums) Move here.
9902         (glob var pgm_state) Move here.
9903
9904         * format.c: New file.
9905         (glob var formats) Move here.
9906         (parse_format_specifier_name, fmt_to_string,
9907         check_input_specifier, check_output_specifier,
9908         check_string_specifier, convert_fmt_ItoO, parse_format_specifier)
9909         Move here.
9910
9911         * format.h: New file.  Move functions now in format.c here.
9912         (FMT_* enums) Move here.
9913         (struct fmt_desc) Move here.
9914         (FCAT_* enums) Move here.
9915         (struct fmt_spec) Move here.
9916         (glob vars formats, fmt_parse_ignore_error) Move here.
9917
9918         * inpt-pgm.h: New file.
9919         (INP_* enums) Move here, make #defines into enums.
9920         (glob vars inp_init, inp_init_size) Move here.
9921
9922         * sort.h: New file.
9923         (glob vars v_sort, nv_sort) Move here.
9924         (sort_cases, read_sort_output) Move here.
9925
9926         * vector.h: New file.
9927         (struct vector) Move here, add struct tag.
9928         (glob vars vec, nvec) Move here.
9929         (find_vector) Move here.
9930
9931         * New file.
9932         (glob vars last_vfm_invocation, temp_case, reinit_sysmis,
9933         reinit_blanks, init_zero, init_blanks) Move here.
9934         (struct case_stream) Move here.
9935         (glob vars vfm_source, vfm_sink, vfm_memory_stream,
9936         vfm_disk_stream, sort_stream, data_list_source,
9937         input_program_source, file_type_source, get_source, n_lag) Move
9938         here.
9939         (procedure, write_case, lagged_case, compact_case, page_to_disk)
9940         Move here.
9941                 
9942 Wed Dec 24 22:40:42 1997  Ben Pfaff  <blp@gnu.org>
9943
9944         * Makefile.am: (pspp_SOURCES) Added html.c, som.c, som.h.
9945         (LDADD) Add libdcdflib.
9946
9947         * ascii.c: Comment and formatting fixes.  Almost every external
9948         function had an assert added, checking driver_open and page_open.
9949         (ascii_init_driver) Broken into ascii_preopen_driver,
9950         ascii_postopen_driver, ascii_close_driver.  Manages driver_open.
9951         (ascii_open_page) Sets page_open.
9952         (ascii_close_page) Clears page_open.
9953
9954         * html.c: Comment and formatting fixes.  Almost every external
9955         function had an assert added, checking driver_open and page_open.
9956         (html_init_driver) Broken into html_preopen_driver,
9957         html_postopen_driver, html_close_driver.  Manages driver_open.
9958         (html_open_page) Sets page_open.
9959         (html_close_page) Clears page_open.
9960         (html_submit) Disabled.
9961
9962         * lexer.c: (parse_string) Remove debugging printf.
9963
9964         * list.q: (determine_layout) Open a page if one is not yet open.
9965
9966         * output.c: Comment fixes.
9967         (add_class) Set the class member of the new list element.
9968         (parse_options) Don't handle device type.
9969         (colon_tokenize) New function.
9970         (configure_driver) New four-field format with a field for device
9971         type.  Now initialize driver_open, page_open, next, and prev
9972         fields.  Use new colon_tokenize() function.  Don't do a memory
9973         copy to replace a driver, it doesn't work; instead delete the old
9974         driver and insert a new one.
9975         (destroy_driver) Don't call som_destroy_driver().  Close the page
9976         if it's open.  Find the class in the list of classes and decrement
9977         that reference count.  Remove the driver from the global driver
9978         list.
9979         (outp_iterate_enabled_drivers) Renamed outp_drivers().  All
9980         references changed.  Rewritten.  Don't return a driver that's not
9981         enabled.
9982         (outp_eject_page) All references to som_internal_eject_page()
9983         changed to use this.  Sets cp_x to 0 as well as cp_y.
9984
9985         * output.h: (OUTP_I_* enums) Removed.
9986         (struct som_submission_form) Removed.
9987         (struct outp_class) init_driver broken into preopen_driver,
9988         postopen_driver, and close_driver.  submit changed to take a
9989         som_table argument.
9990
9991         * postscript.c: Comment and formatting fixes.  Almost every
9992         external function had an assert added, checking driver_open and
9993         page_open.
9994         (ps_init_driver) Broken into ps_preopen_driver,
9995         ps_postopen_driver, ps_close_driver.  Manages driver_open.
9996         (ps_open_page) Sets page_open.
9997         (ps_close_page) Clears page_open.
9998
9999         * som.c: New file, base implementation.
10000         
10001         * som.h: (struct som_table) Add struct tag.
10002         (enum SOM_COL_ACROSS) Removed.
10003         (SOM_ROWS, SOM_COLUMNS) New enums.
10004         (struct som_table_class) Add member `cumulate'.  Remove `segment';
10005         change `render' arguments.
10006         (struct som_point, struct som_rect) Removed.
10007         (som_submit_table) Fixed typo, should have been som_submit.
10008
10009         * sysfile-info: (describe_variable) Don't try to insert a
10010         subtable; just destroy it for now.
10011
10012         * t-test.q: Include dcdflib/cdflib.h instead of cdflib.h.  Fix
10013         references to value labels.
10014
10015         * tab.c: (tab_destroy) New function.
10016         (tab_columns) Change argument.
10017         [0] (tab_submit) Remove dead code.
10018         (tab_title) Allocate string from the table's arena.
10019         (tab_output_text) Only free the buffer if we allocated it.
10020         (tab_submit) New function.
10021         (static vars t, d) New static vars.
10022         (tabi_table, tabi_driver, tabi_count, tabi_area, tabi_columns,
10023         tabi_headers, tabi_cumulate, tabi_render) New functions.
10024         (glob var tab_table_class) New global var.
10025
10026         * tab.h: (struct tab_join_rect) Don't use a som_rect; directly
10027         encapsulate the rectangle.  All references changed.
10028         
10029 Sun Dec 21 16:18:58 1997  Ben Pfaff  <blp@gnu.org>
10030
10031         * All header files updated to use struct tags in addition to
10032         typedefs for all structures.  Don't use word `struct' in struct
10033         tags.
10034         
10035         * Makefile.am: (pspp_SOURCES) Remove html.c.
10036         (INCLUDES) Replace the lib/* includes with a single lib/ include;
10037         all references updated.
10038
10039         * command.c: (parse_cmd) Remove call to som_check_workspace.
10040         (output_line) Update to new som.
10041
10042         * data-in.c: (parse_numeric) A single dot is not an error; it is
10043         the system-missing value.
10044
10045         * data-list.c: (dump_fixed_table, dump_free_table) Update to new
10046         som.
10047
10048         * data-out.c: Added `const' as appropriate to many prototypes.
10049         (convert_E, convert_F, convert_CCx) Take double argument instead
10050         of value * argument.
10051         (convert_format_to_string) Call changed functions appropriately.
10052         Instead of modifying the caller's value for FCAT_SHIFT_DECIMAL,
10053         make a local copy of the value.
10054
10055         * descript.q: Remove custom_variables() prototype now provided by
10056         q2c.  
10057         (custom_variables) Don't increment sbc_variables, the caller does
10058         this.
10059         (dump_z_table, display) Update to new som.
10060
10061         * error.c: (vmsg) Add const to prototype.  Remove code to handle
10062         `too many errors' condition.
10063         (check_error_count) New function.
10064         (msg) Add const to prototype.
10065
10066         * filename.c: (open_file) Rewrite for elegance.
10067
10068         * frequencies.q: Remove custom_*() prototypes now provided by q2c.
10069         (dump_full, dump_condensed, dump_statistics) Update for new som.
10070
10071         * list.q: Don't include somP.h.  Change all references to
10072         som_driver_ext to refer to the new members of som_driver.  Change
10073         som_internal_eject_page() references to outp_eject_page().
10074
10075         * main.c: (parse) Rewrite for elegance.  Add call to
10076         check_error_count().
10077
10078         * output.c: (add_class, outp_list_classes, outp_configure_driver)
10079         Rewrite or revise for new outp_driver_class_list structure.
10080         (outp_iterate_enabled_drivers) Fix comparison between disabled
10081         devices and current device type.
10082         (outp_eject_page) New function.
10083
10084         * output.h: Comment fixes.
10085         (struct outp_driver) New members driver_open, page_open, cp_x,
10086         cp_y, font_height, prop_em_width, fixed_width.  Deleted members
10087         ref_count, next.
10088         (struct outp_driver_class_list) New struct.
10089         (outp_class_list) Changed to type outp_driver_class_list; all
10090         references updated.
10091
10092         * print.c: (dump_table, print_trns_proc) Updated for new som.
10093
10094         * q2c.c: (dump_vars) Simplify array subcommand code.  Declare
10095         prototypes for custom subcommands.
10096         (dump_subcommand) Always include the `else'.
10097         (dump_parser) Fix comments in output code.
10098
10099         * set.q: Reordered functions.
10100
10101         * som-frnt.c, som-high.c, som-low.c, somP.h: Removed.
10102         
10103         * som.h: Rewritten from scratch.
10104
10105         * str.h: Remove dead code.
10106
10107         * tab.c, tab.h: New files, base implementation.
10108
10109         * sysfile-info.c: (cmd_sysfile_info, describe_variable) Update to
10110         new som.
10111
10112         * t-test.q: New code from John Williams
10113         <johnr.williams@stonebow.otago.ac.nz>.  Include math.h, cdflib.h.
10114         Many many new static vars and defines.
10115         (precalc, postcalc, g_postcalc, z_postcalc, t_pairs, t_groups,
10116         groups_calc, pairs_calc, z_dev_calc, z_calc) New functions.
10117         (struct value_list) New struct.
10118         (variance, covariance, pooled_variance, oneway, pearson_r, f_sig,
10119         t_crt, t_sig, print_t_groups) New functions.
10120         (cmd_t_test) Implemented.
10121
10122         * temporary.c: (cancel_temporary) Only free the temp_dict if it's
10123         non-NULL.
10124
10125         * vfm.c: (dump_splits) Update to new som.
10126
10127 Thu Dec  4 23:02:22 1997  Ben Pfaff  <blp@gnu.org>
10128
10129         * Makefile.am: (fiasco_SOURCES) Add html.c.
10130
10131         * aggregate.c: Base source.
10132
10133         * ascii.c: (postopen, preclose) Reformat.
10134
10135         * data-out.c, expr-evl.c: Comment fixes.
10136         
10137         * filename.c: (open_file) When opening a file for writing, use
10138         line buffering instead of full buffering for better interactive
10139         performance.  Suggested by Valerio Aimale
10140         <valerio@svpop.com.dist.unige.it>.  Also, recognize special file
10141         names `stdin', `stdout', `stderr'.
10142
10143         * groff-font.c: Comment fixes.
10144
10145         * html.c: New file; base version.
10146
10147         * list.q: (write_all_headers, clean_up, determine_layout,
10148         list_cases) Ignore `special' devices for now.  Needs to be fixed
10149         later.
10150
10151         * output.c: (outp_init) Add html driver to list; reverse list
10152         order.
10153
10154         * output.h: (struct outp_class_struct) New members `special',
10155         `submit'; comment fixes.  All references changed.
10156
10157         * postscript.c: (ps_init_driver) Make defaults for text_opt,
10158         line_opt depend on whether the OUTP_DEV_SCREEN bit is set on the
10159         device.
10160         (postopen) Comment fix.
10161         (preclose) Comment fixes, formatting fixes.  Change x->file.file
10162         references to more proper f->file.
10163
10164         * som-high.c: (som_submit_table) Special classes use their own
10165         renderers.
10166
10167         * som.h: Comment fixes.
10168
10169         * temporary.c: (new_dictionary) Don't try to xstrdup() a NULL
10170         string.
10171         
10172 Tue Dec  2 14:36:07 1997  Ben Pfaff  <blp@gnu.org>
10173
10174         * Makefile.am: (fiasco_SOURCES) Add aggregate.c back in.
10175
10176         * aggregate.c: Still working on this.
10177
10178         * command.c: (cmd_table[]) Add AGGREGATE back in.
10179         (split_words) Make '-' a legal word separator as well as ' '.
10180
10181         * main.c: Comment fixes.
10182
10183         * q2c.c: (dump_parser) Don't require the procedure's full name to
10184         be present, in the generated source.
10185
10186         * t-test.q: Change name to `t-test' from `t test'.  Let PAIRS be
10187         multiply specified and let it be default; let MISSING, CRITERIA,
10188         FORMAT be multiply specified.
10189         (cmd_t_test) Parse command name.  [DEBUGGING] Call debug_print().
10190         (custom_groups) Fix defaults.
10191         (custom_pairs) Check whether this is a PAIRS subcommand before
10192         attempting to parse.  Better garbage collection.  Proper storage
10193         allocation.
10194         [DEBUGGING] (debug_print) New function.
10195
10196         * temporary.c: Comment fixes.
10197         (copy_variable) Don't copy variable name and index.
10198         (save_dictionary) Copy variable name and index by hand.
10199
10200         * vars-atr.c: Comment fixes.
10201         (create_variable) New dictionary argument.  All references
10202         changed.
10203         (common_init_stuff) New dictionary argument.  All references
10204         changed.
10205         (init_variable) New dictionary argument.  All references changed.
10206         (dup_variable) New function.
10207
10208         * vars-prs.c: (parse_variables) If there are any errors, we always
10209         return 0.  Previously, it was possible for some types of errors to
10210         be ignored.
10211         
10212 Sat Nov 22 01:20:59 1997  Ben Pfaff  <blp@gnu.org>
10213
10214         * Makefile.am: (fiasco_SOURCES) For 0.1.5 release, remove
10215         aggregate.c.
10216
10217         * command.c: (cmd_table[]) Comment out AGGREGATE; add T TEST.
10218
10219         * list.q, t-test.q: Remove ALL option from VARLIST declaration in
10220         grammar rules.
10221
10222         * q2c.c: Comment fixes.
10223         (SBC_* enums) Remove SBC_VARLIST_ALL; all references removed.
10224         
10225         * t-test.q: (cmd_list) Rename cmd_t_test.
10226
10227         * temporary.c: (new_dictionary) Don't declare as static.
10228         
10229 Fri Nov 21 00:03:06 1997  Ben Pfaff  <blp@gnu.org>
10230
10231         * aggregate.c: Changes, still not finished.
10232
10233         * file-handle.q, frequencies.q, list.q, set.q: Comment fixes.
10234
10235         * q2c.c: Comment fixes.  Now its output is internationalized.
10236         (get_token) Fix parsing of escapes within literal strings.
10237         (main) Fix bad #line directives in output.
10238
10239         * t-test.q: Base implementation.
10240
10241         * temporary.c: (new_dictionary) New function.
10242         (restore_dictionary) [__CHECKER__] Change fill character to *
10243         (from @).
10244         
10245 Sun Nov 16 01:29:57 1997  Ben Pfaff  <blp@gnu.org>
10246
10247         * Makefile.am: (BUILT_SOURCES, fiasco_SOURCES) Add t-test.c
10248
10249         * aggregate.c: Changes, still not finished.
10250
10251         * descript.q, list.q: Comment fixes.
10252
10253         * q2c.c: Almost completely rewritten.
10254
10255         * t-test.q: New file, not complete.
10256
10257 Fri Nov 14 00:14:48 1997  Ben Pfaff  <blp@gnu.org>
10258
10259         * aggregate.c: Changes, still not finished.
10260
10261         * sort.c: (sort_cases) Call cancel_temporary() instead of doing it
10262         by hand.
10263
10264         * temporary.c: (cancel_temporary) New function.
10265
10266         * vars-atr.c: (discard_variables) Call cancel_temporary() instead
10267         of doing it by hand.
10268
10269         * vfm.c: (close_active_file) After restoring a TEMPORARY
10270         dictionary, set temp_dict to NULL.  Cancel TEMPORARY through
10271         cancel_temporary().
10272         (SPLIT_FILE_procfunc) Comment fix.
10273
10274 Tue Oct 28 16:08:45 1997  Ben Pfaff  <blp@gnu.org>
10275
10276         * Makefile.am: (fiasco_SOURCES) Add aggregate.c.
10277
10278         * aggregate.c: New file, not finished yet.
10279
10280         * command.c: (cmd_table) Add AGGREGATE.
10281
10282         * common.h: (pgm_state) Move declaration to var.h.
10283
10284         * lexer.c: (bin_value_func, oct_value_func, hex_value_func) i18n
10285         fixes.
10286         (parse_string) Message fix.
10287
10288         * recode.c: Comment fix.
10289
10290         * sfm-read.c: (read_variables) Code esthetic fixes.
10291         (write_header) Default date is `Jan', not `JAN'.
10292
10293         * sfmP.h: (bswap_int32) [!__linux__] Fix off-by-one errors.
10294
10295         * sort.c: (cmd_sort_cases) Farm the work out to new function
10296         parse_sort_variables().
10297         (parse_sort_variables) New function.
10298         (sort_cases) New function.  Cancels temporary transformations,
10299         which sorting didn't do previously.
10300         (cmd_sort_cases) Better garbage collection on error.  Uses
10301         do_external_sort().
10302         (write_initial_runs, merge_once) Improved code esthetics.
10303         (sort_stream_read) Reduced to one call to read_output_cases().
10304         (read_output_cases) New function.
10305
10306         * var-labs.c: (cmd_variable_labels) Re-enabled truncation of
10307         variable labels to 120 characters.
10308
10309         * var.h: Comment fixes.
10310         (glob var pgm_state) From common.h.
10311
10312         * vars-atr.c: (discard_variables) Set pgm_state to STATE_INIT.
10313
10314         * vars-prs.c: (parse_DATA_LIST_vars) Support PV_SINGLE in
10315         options.  Set *names to NULL on error.
10316
10317         * vfm.c: (memory_stream_init) Assert compaction_nval != 0.
10318
10319 Thu Oct  9 09:59:49 1997  Ben Pfaff  <blp@gnu.org>
10320
10321         * sfm-write.c, vfm.c: [HAVE_UNISTD] #include <unistd.h>, needed by
10322         SunOS4.  From Alexandre Oliva <oliva@dcc.unicamp.br>.
10323
10324 Wed Oct  8 18:55:24 1997  Ben Pfaff  <blp@gnu.org>
10325
10326         * vfm.c: (page_to_disk) Added missing local variables.
10327
10328 Tue Oct  7 20:23:17 1997  Ben Pfaff  <blp@gnu.org>
10329
10330         * get.c: Comment fix.
10331
10332         * sort.c: (cmd_sort_cases) Attempt to perform internal sort if the
10333         source is anything other than a disk stream, not just if it's in a
10334         memory stream.  Call page_to_disk() before external sort.
10335         (allocate_cases) Message fix.
10336
10337         * vfm.c: (prepare_for_writing) Warn user when paging workspace to
10338         disk.
10339         (page_to_disk) New function.
10340
10341 Sun Oct  5 15:56:14 1997  Ben Pfaff  <blp@gnu.org>
10342
10343         * Makefile.am: (INCLUDES) Include .. instead of $(top_srcdir).
10344
10345         * common.h: (macro strerror) Remove.  From Alexandre Oliva
10346         <oliva@dcc.unicamp.br>.
10347
10348         * get.c: (dict_delete_run) The number of variables to delete is
10349         not necessarily the number of variables that need to be shifted
10350         up.
10351         (trim_dictionary) Don't set *options to 0.  Fix bug that caused
10352         too many variables to be deleted.
10353
10354         * postscript.c: Comment fix.
10355
10356         * q2c.c: Include strerror.c.  From Alexandre Oliva
10357         <oliva@dcc.unicamp.br>.
10358
10359         * set.q: #undef ON and OFF.  From Alexandre Oliva
10360         <oliva@dcc.unicamp.br>.
10361
10362         * sfm-read.c: (sfm_read_dictionary) Don't set the file class too
10363         early, otherwise errors cause a bad free().
10364
10365         * str.h: (macro nvsprintf) s/FORMATS/FORMAT/ typo.  From Alexandre
10366         Oliva <oliva@dcc.unicamp.br>.
10367
10368         * temporary.c: (save_dictionary) Don't allocate memory if
10369         n_documents is 0.
10370
10371         * vfm.c: (memory_stream_write) Message fix.
10372
10373 Sat Oct  4 16:20:43 1997  Ben Pfaff  <blp@gnu.org>
10374
10375         * command.c: (static var cmd_table[]) Define REPEATING DATA
10376         command.
10377
10378         * common.h: Added support for broken systems that are missing
10379         EXIT_SUCCESS, EXIT_FAILURE, RAND_MAX, and/or strerror().
10380
10381         * Many source files: Replace syntax error messages via msg() with
10382         call to syntax_error().
10383
10384         * data-list.c: (dump_fixed_table) Add support for dumping table
10385         for REPEATING DATA as well as DATA LIST FIXED.
10386         (cmd_repeating_data) Allows and requires `/' between subcommands.
10387         Does proper thing with allowing rpd.starts_end to stay 0.  Allows
10388         CONTINUED specifications to be omitted.  Forces CONTINUED to be
10389         specified if ID is.  Calculates starts_end, cont_end from logical
10390         record length as reported by fhp.  Calls dump_fixed_table() if
10391         requested.  Fixed length of record copied by memcpy.
10392         (parse_num_or_var) Sets `num' to 0, not NOT_INT, for variables.
10393         Message fix.
10394         (realize_value) Returns sensible value for out-of-range variable
10395         values.
10396         (rpd_parse_record) New argument `ofs'.  Fixed confusion between
10397         length of occurrences and length of line.  Added warning for
10398         fields that exceed the line length.  Fixed infinite loop.
10399         (read_one_set_of_repetitions) Numerous minor changes for more
10400         complete SPSS compliance.  Message fixes.
10401
10402         * dfm.c: (dfm_close) If the file being closed is the inline file,
10403         read all the remaining data before closing it.
10404         (dfm_get_record) Don't close the file on lossage, as either it
10405         has been closed already or it doesn't belong to us.
10406
10407         * error.c: (puts_stdout) New function.
10408         (vmsg) Use puts_stdout instead of puts.
10409
10410         * file-handle.q: (fh_record_width) New function.
10411
10412         * inpt-pgm.c: (init_case) Fixed buffer overrun when inp_nval % 4
10413         == 0.
10414         (clear_case) Ditto.
10415         (input_program_source_read) Made an old kluge an approved method.
10416
10417         * lexer.c: (syntax_error) New function.
10418
10419         * misc.c: [BROKEN_RAND] (ansi_rand, ansi_srand; static var next)
10420         New.
10421
10422         * output.c: (oupt_get_paper_size) Message fix.
10423
10424         * q2c.c: Numerous fixes to formatting of generated code made to
10425         conform to GNU coding standards.  Uses syntax_error() in generated
10426         code.  Other miscellaneous generated message fixes.  Added support
10427         for broken systems that are missing EXIT_SUCCESS, EXIT_FAILURE,
10428         RAND_MAX, and/or strerror().
10429
10430 Sat Oct  4 02:09:56 1997  Ben Pfaff  <blp@gnu.org>
10431
10432         * data-in.c: Comment fixes.
10433
10434         * data-list.c: (struct repeating_data_trns) New member `id_spec'.
10435         (find_variable_input_spec) New function.
10436         (cmd_repeating_data) Initializes id_spec.
10437         (rpd_parse_record) Implemented.
10438         (read_one_set_of_repetitions) Returns -3 by default in order to
10439         kluge out some potential bugs.
10440
10441         * data-out.c: Comment fixes.
10442
10443         * file-type.c: (internal_cmd_record_type) Message fix.
10444
10445         * inpt-pgm.c: (input_program_source_read) Special temporary kluge
10446         for handling -3 return value.
10447
10448 Sat Sep 20 23:58:15 1997  Ben Pfaff  <blp@gnu.org>
10449
10450         * data-list.c: Comment fixes.
10451         (struct dls_var_spec) Reordered members.
10452         (read_from_data_list_fixed) Restructured.
10453         (struct repeating_data_trns) Reordered members.  Renamed `starts'
10454         as `starts_beg', `ends' as `starts_end'.
10455         (cmd_repeating_data) Calculates length of repeated data if
10456         necessary and possible.
10457         (parse_num_or_var) Don't allow string variables.
10458         (realize_value) New function.
10459         (rpd_msg) New function.
10460         (rpd_parse_record) New function.  Currently stubbed out.
10461         (read_one_set_of_repetitions) Implemented.
10462
10463         * inpt-pgm.c: (input_program_source_read) Comment fix.
10464
10465 Thu Sep 18 21:34:57 1997  Ben Pfaff  <blp@gnu.org>
10466
10467         * command.c: (cmd_end_repeat_p) Removed.
10468         (init_cmd_parser) Doesn't set cmd_end_repeat_p.
10469         (parse_cmd_name) Removed.
10470
10471         * data-list.c: Comment fixes.
10472         (data_list_pgm) Removed `eof' member.
10473         (static var first) New var.
10474         (cmd_data_list) Sets `first'.  Ensures that DATA LIST uses the
10475         FILE TYPE file inside FILE TYPE structures.
10476         (append_var_spec) Appends to *first, not dls.spec.
10477         (parse_fixed) Message fixes.
10478         (struct rpd_num_or_var) New.
10479         (struct repeating_data_trns) New.
10480         (static var rpd) New.
10481         (cmd_repeating_data) New function.
10482         (parse_num_or_var) New function.
10483         (parse_repeating_data) New function.
10484         (read_one_set_of_repetitions) New function.
10485
10486         * file-type.c: (cmd_file_type) Message fixes.  Always
10487         default_handle to FILE TYPE file handle.
10488         (internal_cmd_record_type) Message fixes.
10489
10490 Wed Aug 20 14:22:03 1997  Ben Pfaff  <blp@gnu.org>
10491
10492         * repeat.c: Comment fix.  Disable debugging.
10493
10494         * temporary.c: (restore_dictionary) Sets splits to NULL and
10495         n_splits to 0 before destroying the variables because now doing
10496         this tries to remove split variables.
10497
10498         * vars-atr.c: (discard_variables) Asserts that n_splits is 0 after
10499         destroying the dictionary.
10500         (clear_variable) Removes a variable from splits after destroying
10501         it.
10502
10503 Mon Aug 18 18:06:55 1997  Ben Pfaff  <blp@gnu.org>
10504
10505         * cmdline.c: (set_compat) Removed.
10506         (pick_compat) Removed.
10507         (parse_command_line) Removed -c option.
10508         (pre_syntax_message) Removed -c option.
10509         (usage) Remove compatibility code.
10510
10511         * common.h: (macros VER_PC, VER_WND, VER_X) Removed.
10512         (glob var compat) Removed.
10513
10514         * compute.c: (type_check) Fixed messages about type mismatches.
10515
10516         * data-list.c: (cmd_data_list) Removed compatibility code.
10517         (fixed_parse_compatible) Calls convert_negative_to_dash().
10518         Fixed bug where it only set the variable in fx.spec if it created
10519         the variable itself.
10520         (dump_fmt_list) Spelling fix.
10521         (cut_field) Removed compatibility code.
10522
10523         * dfm.c: (cmd_begin_data) Don't require a command terminator on
10524         BEGIN DATA command.
10525
10526         * expr-evl.c: (evaluate_expression) Implement LAG.
10527
10528         * expr-prs.c: (parse_add) Calls convert_negative_to_dash().
10529         (parse_neg) Calls convert_negative_to_dash().
10530         (LAG_func) Increases n_lag to the lag requested.  Fixed assignment
10531         bug.
10532
10533         * expr.h: (struct expression_struct) Removed member max_lag.
10534
10535         * file-type.c: (parse_col_spec) Calls convert_negative_to_dash().
10536         (internal_cmd_record_type) Removed special handling to produce
10537         negative numbers from dash tokens.
10538
10539         * getline.c: (static var DO_REPEAT_level) New var.
10540         (getl_add_DO_REPEAT_file) Increments DO_REPEAT_level.
10541         (handle_line_buffer) Copies the line into getl_buf; doesn't call
10542         copy_with_DO_REPEAT_substitutions().
10543         (getl_read_line) Maintains value of getl_mode.  Calls
10544         perform_DO_REPEAT_substitutions() whenever DO_REPEAT_level is
10545         positive.
10546         (getl_close_file) Decrements DO_REPEAT_level when appropriate.
10547
10548         * getline.h: (getl_mode) New glob var.
10549
10550         * glob.c: Comment fixes.
10551         (init_glob) Restructured.  Sets set_seed.
10552         (init_compat_dependent) Removed.  All references removed.
10553         (get_date) Format changed from MM/DD/YY to DD MMM YYYY.
10554         (__htonl, __htons) Removed.  (What were these for?)
10555
10556         * lexer.c: (static var tbl) Dash set to class CNUM.
10557         (make_hexit) New function from data-out.c.
10558         (get_token_representation) Rewritten.
10559         (convert_negative_to_dash) New function.
10560         (lex_init_compat_dependent) Removed.
10561         (yylex) A dash is parsed as part of a number if it is followed by
10562         a digit.  The ASCII representation of a number is copied to
10563         tokstr.  String parsing farmed out to parse_string().  Comment
10564         fixes.
10565         (bin_value_func, oct_value_func, hex_value_func, parse_string) New
10566         functions.
10567         (preprocess_line) Line processing depends on interactive/batch
10568         mode, not on compatibility mode.  Removed PC+ compatibility code.
10569
10570         * loop.c: (loop_3_trns_proc) Comment fix.
10571
10572         * main.c: Remove dead code.
10573         (main) Remove call to init_compat_dependent().
10574
10575         * misc.c: (convert_fmt_ItoO) Make E format conversion more
10576         conformant.
10577
10578         * print.c: (parse_string_argument) Calls
10579         convert_negative_to_dash().
10580         (fixed_parse_compatible) Calls convert_negative_to_dash().
10581
10582         * repeat.c: (RPT_* defines) Removed.
10583         (struct rpt_numeric) Removed.
10584         (struct repeat_entry) New member type, changed `replacement' from
10585         char * to char **.
10586         (clean_up) Deallocation adapted to new repeat_entry.
10587         (internal_cmd_do_repeat) `type' defaults to 0.  Remove lookahead()
10588         usage.  Creates vars for `type' of 1.
10589         (parse_ids) Sets type of 1.  Adapted to new repeat_entry.
10590         (store_numeric) Rewritten, new interface.
10591         (parse_numbers) Rewritten.
10592         (parse_strings) Rewritten.
10593         (find_DO_REPEAT_substitution) New function.
10594         (perform_DO_REPEAT_substitutions) New function.
10595         (copy_with_DO_REPEAT_substitutions) Removed.
10596         (debug_print) Rewritten.
10597
10598         * set.q: Comment fix.
10599         (custom_results) Removed compatibility code.
10600         (internal_cmd_set) Removed SET EMULATION subcommand.  Removed
10601         compatibility code.
10602
10603         * sysfile-info.c: (cmd_display) Removed compatibility code.
10604
10605         * tokens.h: Comment fixes.
10606         (token types enum) Removed `toktype' typedef name for this int
10607         type.  Removed SUBST.  Restructured.
10608
10609         * vars-atr.c: (discard_variables) Sets n_lag to 0.
10610
10611         * vars-prs.c: Comment fix.
10612
10613         * vfm.c: Comment fixes.
10614         (glob var n_lag) New var.
10615         (static vars lag_count, lag_head, lag_queue) New vars.
10616         (procedure) Removed argument nlag.
10617         (setup_lag) New function.
10618         (close_active_file) Discards lagging state.
10619         (lag_case) New function.
10620         (lagged_case) New function.
10621         (write_case) Lags a case if lagging.
10622
10623         * weight.c: (cmd_weight) Removed compatibility code.
10624         
10625 Sun Aug 17 22:34:40 1997  Ben Pfaff  <blp@gnu.org>
10626
10627         * getline.h: (struct getl_script) New members loop_index, macros.
10628
10629         * getline.c: (getl_add_file) Sets first_line field to NULL.
10630         (getl_add_DO_REPEAT_file) New function.
10631         (handle_line_buffer) When the current line's length is negative,
10632         set the filename and line number.  Increment line number after
10633         reading line.  Pass the line to
10634         copy_with_DO_REPEAT_substitutions() for processing.
10635         (getl_close_file) Free DO REPEAT lines before freeing the
10636         filename, and just set the filename to NULL when doing this,
10637         because otherwise the filename gets freed twice.
10638
10639         * glob.c: (glob var queuing) Removed.  All references removed.
10640
10641         * lexer.c: Comment fixes.
10642         (get_token_representation) New function.
10643
10644         * repeat.c: Comment fixes.
10645         (struct repeat_entry) Replaced type and v union members with a
10646         simple string.
10647         (append_record) New function.
10648         (internal_cmd_do_repeat) Started reforming it for the new
10649         repeat_entry struct.  Properly records filename changes in the
10650         getl_line_buf.  Fixed improper use of = for ==.  Fixed sense of
10651         strncasecmp() result usage.  Uses append_record() to simplify.
10652         Properly discards END REPEAT line.  Calls getl_add_DO_REPEAT_file
10653         to add in the file.
10654
10655         (copy_with_DO_REPEAT_substitutions) Started coding.
10656
10657         [DEBUGGING] (debug_print_lines) New function.
10658
10659         * set.q: (custom_results, internal_cmd_set) s/VER_PCP40/VER_PC/;
10660
10661         * tokens.h: (macro is_id1, is_idn) New macros.
10662
10663 Sat Aug 16 10:57:41 1997  Ben Pfaff  <blp@gnu.org>
10664
10665         * cmdline.c: (static var pre_syntax_message) Changed `win'
10666         compatibility mode to `wnd'.
10667
10668         * data-list.c: (fixed_parse_spss) Renamed
10669         fixed_parse_compatible().
10670
10671         * glob.c: (init_glob) Excise unused code for
10672         program_invocation_short_name.
10673
10674         * lexer.c: (preprocess_line) Leading indentors are ignored in Wnd
10675         as well as in X.
10676
10677         * print.c: (fixed_parse_spss) Renamed fixed_parse_compatible().
10678
10679         * set.q: `win' compatibility renamed `wnd'.
10680
10681 Thu Aug 14 22:11:12 1997  Ben Pfaff  <blp@gnu.org>
10682
10683         * filename.c: [__WIN32__] Change the included Windows header files
10684         (again).
10685         (absolute_filename_p) [__MSDOS__] A filename with a colon as the
10686         second character is absolute.
10687         (dirname) Fix logic error.  Don't printf() the results.
10688         (prepend_dir) Don't printf() the results.
10689
10690         * getline.c: (handle_line_buffer) New function.
10691         (getl_read_line) Reads line with handle_line_buffer() when
10692         appropriate.
10693         (getl_close_file) Discard line buffer data.
10694
10695         * getline.h: Comment fixes.
10696         (struct getl_line_list) New struct.
10697         (getl_script_struct) Added line buffer members.  These are hooks
10698         for use by DO REPEAT to allow it to insert virtual source code
10699         into the program.
10700
10701         * glob.c: (init_glob) [__DJGPP__ || (__WIN32__ && __BORLANDC__)]
10702         Override Borland C++ stupidity that claims Windows has a console
10703         window size of 0x3.
10704
10705         * repeat.c: This is in the process of being restructured from
10706         using a token-buffering approach to the DO REPEAT facility to
10707         using the more flexible approach of a line-buffering approach in
10708         conjunction with the getline module.  Comment fixes.
10709         (struct tok_struct) Removed.
10710         (static vars queue_index, queue_head, queue) Removed.
10711         (static vars line_buf_head, line_buf_tail) New vars.
10712         (internal_cmd_do_repeat) Instead of queuing tokens, queue lines.
10713         Not complete.
10714         (pull_queue, destroy_queue) Removed.
10715         [DEBUGGING] (debug_print_tokens) Removed.
10716
10717 Tue Aug  5 13:57:58 1997  Ben Pfaff  <blp@gnu.org>
10718
10719         * file-handle.q: (prepend_current_directory) New function.
10720         (internal_cmd_file_handle, fh_get_handle_by_filename) Prepends
10721         current directory before normalizing filename.
10722
10723         * filename.c: (gnu_getcwd) New function.
10724         (absolute_filename_p) New function.
10725         (search_path) New argument, PREPEND.  All references changed to
10726         pass NULL except those explicitly mentioned.  Uses
10727         absolute_filename_p().  Prepends PREPEND before trying the
10728         filename.
10729         (dirname, prepend_dir) New functions.
10730
10731         * getline.c: (getl_get_current_directory) New function.
10732         (getl_include) Passes getl_get_current_directory() as PREPEND arg
10733         to search_path().
10734                 
10735 Sun Aug  3 11:42:36 1997  Ben Pfaff  <blp@gnu.org>
10736
10737         * In several source files, the term `script' was replaced with
10738         `syntax file' inside error messages.  Usage of the term `script'
10739         in the sense of a syntax file is now deprecated.
10740
10741         * cmdline.c: (static vars pre_syntax_message, post_syntax_message)
10742         Updated messages.
10743
10744         * dump-sysfile.c: (usage) Update message.
10745
10746         * getline.c: (getl_read_line) Ignore lines beginning with `#!'.
10747
10748         * getline.h: (glob var getl_include_path) Declare extern.
10749
10750         * list.q: Define EXTERN as extern before #including somP.h.
10751
10752         * var.h: Remove declaration of `disptype' variable.
10753
10754         * vfm.c: (close_active_file) After switching the data sink to a
10755         data source, set vfm_sink to NULL, because it doesn't exist any
10756         more.
10757
10758 Thu Jul 17 21:41:44 1997  Ben Pfaff  <blp@gnu.org>
10759
10760         * glob.c: [__BORLANDC__] Include math.h.  Define _matherr() and
10761         _matherrl() to ignore all math errors.
10762
10763         * sfm-read.c: (read_value_labels) When reading the labels from
10764         disk, read the little parts separately instead of as a struct;
10765         this avoids alignment problems.
10766
10767         * sfm-write.c: (struct sfm_fhuser_ext) New member `elem_type'.
10768         (sfm_write_dictionary) Sets elem_type and frees it on lossage.
10769         (write_header) Allocates and initializes elem_type.
10770         (sfm_write_case) Uses elem_type to determine how to handle each
10771         flt64 element.
10772         (sfm_close) Frees elem_type.
10773
10774         * sfmP.h: Comment fix.
10775         [__BORLANDC__] Uses #pragma -a to adjust structure member
10776         alignment.
10777         
10778 Thu Jul 17 01:55:12 1997  Ben Pfaff  <blp@gnu.org>
10779
10780         * Makefile.am: (fiasco_SOURCES) Remove display.c.
10781
10782         * common.c: Fix typo.
10783
10784         * dfm.c: (read_record) Remove strncasecmp() emulation and fix the
10785         sense of the condition.
10786
10787         * expr-evl.c: (macro ALLOC_STRING_SPACE) [!PAGED_STACK] Add
10788         line-continuation backslash.
10789
10790         * filename.c: [__WIN32__] Include <windef.h> before <winbase.h>.
10791
10792         * frequencies.q: (custom_grouped, add_percentile) Don't use a
10793         non-constant expression as an argument to sizeof.
10794
10795         * glob.c: [__WIN32__ && __BORLANDC__] When including <conio.h>,
10796         undefine gettext macro because that's a conio function.
10797
10798         * hash.h: (hsh_prime_tab declaration) Remove.
10799
10800         * list.q: (write_fallback_headers) Move `leader' allocation out of
10801         main loop.  Change to local_alloc() allocation.
10802
10803         * output.h: Formatting fixes.  Put __attribute__ in right place on
10804         function prototypes.
10805
10806         * sfm-read.c: (read_machine_flt64_info, read_variables) Change
10807         incorrect `SECOND_LOWEST_VALUE' references to proper
10808         `second_lowest_value'.
10809
10810         * som-frnt.c: (EXTERN macro) Define as `extern' instead of null
10811         value.  This way 2 out of 3 of the som files define the vars
10812         extern, the correct way, that actually works under BC++.
10813         (som_set_float) Don't use nonconstant initializers for a struct.
10814
10815         * som-high.c: Add the standard alloca() header.
10816         (replicate_table) Add prototype.
10817
10818         Merged DISPLAY routine.
10819         * sysfile-info.c: (AS_*) New enum series.
10820         (cmd_sysfile_info) Gutted.  Calls describe_variable() to do the
10821         dirty work.
10822         (cmd_display, display_macros, display_documents,
10823         display_variables) Stolen from defunct display.c.
10824         (describe_variable) New function.
10825
10826         * temporary.c: [0] (display_tree) New debug function.
10827         (copy_variable) Performs shallow copy of value labels instead of
10828         deep copy; i.e., just copys the AVL tree and increments the
10829         reference counts.
10830
10831         * val-labs.c: Comment fixes.
10832         (do_value_labels) Optionally skip leading forward slash.
10833         (get_label) Creates only a single value label instead of many
10834         copies of one, and sets the reference count.
10835
10836         * display.c: Removed.
10837
10838         * dump-sysfile.c: New file, not yet complete.
10839
10840 Fri Jul 11 23:02:18 1997  Ben Pfaff  <blp@gnu.org>
10841
10842         For lots of source files I added more verbose_msg's.  These aren't
10843         listed below as they have tested as being benign.  In some cases
10844         these replaced debug_printf() calls.
10845
10846         * output.c: (outp_read_devices) Message fix.
10847
10848         * postscript.c: (output_encodings) Message fix.  Reports errors on
10849         fclose().
10850         (postopen) Message fix.
10851         
10852 Fri Jul 11 14:09:40 1997  Ben Pfaff  <blp@gnu.org>
10853
10854         * dfm.c: (dfm_close) Don't call fclose() for a NULL FILE.
10855
10856         * filename.c: (close_file_ext) Set f->file to NULL *after* closing
10857         it.
10858
10859         * main.c: Remove <malloc.h> #include.
10860
10861         * mis-val.c: (parse_numeric) Set .f member for each missing[]
10862         instead of trying to just set the missing[] itself, which is a
10863         gcc-specific idiom.
10864
10865         * sfm-read.c: (read_variables) Same.
10866
10867         * str.h: Add memmem() prototype.
10868
10869         * val-labs.c, var-labs.c: Replace <malloc.h> with <stdlib.h>.
10870
10871 Thu Jul 10 22:13:53 1997  Ben Pfaff  <blp@gnu.org>
10872
10873         * Makefile.am: (q2c) Don't include any libraries in the link.
10874
10875         * dfm.c: (force_line_buffer_extension) New macro.
10876         (count_tabs) New function.
10877         (tabs_To_spaces) New function.
10878         (read_record) Calls tabs_to_spaces() on the line being processed.
10879
10880         * q2c.c: Disabled i18n for this proglet so that libintl.a doesn't
10881         have to be compiled twice (once for CC, once for LOCAL_CC).
10882  
10883 Sun Jul  6 19:14:33 1997  Ben Pfaff  <blp@gnu.org>
10884
10885         * Makefile.am: (INCLUDES) Add intl directory; fix directories.
10886         (LDADD) Add @INTLLIBS@.
10887         (q2c) Add LIBS, @INTLLIBS@ to link step.
10888
10889         * inpt-pgm.c: Turn off debugging.
10890
10891         * postscript.c: (postopen) Format fix.  local_free() blocks
10892         returned by local_alloc(); don't free() them.
10893
10894 Sat Jul  5 23:44:51 1997  Ben Pfaff  <blp@gnu.org>
10895
10896         * data-in.c: (parse_string_as_format) Comment fix.  Fix check for
10897         string length.
10898
10899         * data-list.c: (read_from_data_list_fixed) Pass proper value for
10900         LEN arg, not simply the full string length.
10901
10902         * sort.c: (allocate_file_handles) Check SPSS compatible temp file
10903         directories before generic temp file directories.
10904
10905         * vfm.c: Disable debugging.
10906
10907 Fri Jul  4 13:26:41 1997  Ben Pfaff  <blp@gnu.org>
10908
10909         * get.c: Comment fix.
10910         (cmd_save_internal) Always passes GTSV_OPT_SAVE option.
10911
10912 Wed Jun 25 22:52:28 1997  Ben Pfaff  <blp@gnu.org>
10913
10914         * expr-prs.c: (debug_print_postfix) Conditionally included on
10915         GLOBAL_DEBUGGING.  Removed out_header() reference.
10916
10917         * exprP.h: Removed #undef GLOBAL_DEBUGGING.
10918
10919 Sun Jun 22 22:00:28 1997  Ben Pfaff  <blp@gnu.org>
10920
10921         * ascii.c: Removed obsolete ascii_close_page() prototype.
10922
10923         * command.c: (output_line) Comment fix.
10924
10925         * data-in.c: Formatting fix.
10926         (parse_string_as_format) Now the `fc' argument is used only for
10927         the purpose of error messages; it is not an index into the string
10928         passed.  All references changed.
10929
10930         * data-list.c: Comment fix.
10931         (cut_field) Comment fix.  Now returns the column number of the
10932         position of the field cut out on success.
10933         (parse_field) Added `column' argument.  Puts the column numbers in
10934         the error message.
10935         (read_from_data_list_free, read_from_data_list_list) Record the
10936         column number returned by cut_field(), pass it to parse_field().
10937
10938         * dfm.c: Comment fix.
10939
10940         * do-ifP.h: Comment fix.
10941
10942         * expr-prs.c: (SYSMIS_func) Implemented string-type arguments for
10943         the SYSMIS function.
10944
10945         * expr.h, exprP.h: Comment fix.
10946
10947         * glob.c: (init_glob) Only calls setlocale() and family if
10948         ENABLE_NLS set.
10949
10950         * hash.h: Comment fix.
10951
10952         * include.c: Comment fix.
10953
10954         * output.c: Comment fix.
10955
10956         * postscript.c: (ps_line_intersection) Simplified assertion.
10957
10958         * repeat.c: Comment fix.
10959
10960         * vars-atr.c: Comment fix.
10961
10962         * vars-prs.c: Comment fix.
10963
10964         * vfm.c: (vector_initialization) [DEBUGGING] Fixed undefined
10965         behavior with usage of postincrement.
10966         (memory_stream_read) Discards cases as it goes. 
10967
10968 Sun Jun 15 16:45:17 1997  Ben Pfaff  <blp@gnu.org>
10969
10970         * Makefile.am: Cleans q2c, not just distcleans it.  Distcleans
10971         foo.
10972
10973         * Most source files: Includes debug-print.h, related comment
10974         fixes.
10975
10976         * cases.c: (alloc_val) Removed complex allocation code.  Merely
10977         increments default_dict.nval and returns the former value.
10978         (envector, devector) Removed references to lv member of struct
10979         variable.
10980
10981         * common.h: (macro VME) Replaced complex definition with simple
10982         one.
10983
10984         * data-list.c: (cmd_data_list) Sets vfm_source instead of
10985         read_active_file and cancel_input_pgm.
10986         (read_from_data_list, cancel_data_list) Removed.
10987         (data_list_source_read, data_list_source_destroy_source) New
10988         functions.
10989         (glob var data_list_source) New var.
10990
10991         * dfm.c: (open_file_r, open_file_w) Simplified debug output.
10992         (cmd_begin_data) Improved criteria for an input program accessing
10993         the inline file.  Still not perfect.
10994
10995         * do-if.c: (do_if_trns_proc) Simplified debug output.
10996
10997         * expr-prs.c: Comment fixes.
10998         [DEBUGGING] (debug_print_postfix) Simplified debug output.
10999
11000         * file-handle.q: (fh_close_handle) Simplified debug output.
11001
11002         * file-type.c: Comment fixes.
11003         (cmd_file_type) Sets vfm_source instead of read_active_file and
11004         cancel_input_pgm.
11005         (cmd_end_file_type) On failure, discards variables in place of
11006         just canceling the input program.
11007         (read_from_file_type) Renamed file_type_source_read.
11008         (cancel_file_type) Renamed file_type_source_destroy_source.
11009         (glob var file_type_source) New var.
11010
11011         * get.c: (GTSV_* enum series) New enums GTSV_OPT_SAVE, GTSV_NONE.
11012         (cmd_get) Initializes options to GTSV_NONE before passing to
11013         trim_dictionary().  Removed `lv' reference.  Sets vfm_source
11014         instead of read_active_file and cancel_input_pgm.
11015         (cmd_save_internal) Initializes options before passing to
11016         trim_dictionary().  Local var `nval' removed.
11017         (dict_delete_run) Comment fixes.
11018         (trim_dictionary) Comment fixes.  Disallows scratch variables if
11019         GTSV_OPT_SAVE set in options.
11020         (read_from_get) Renamed get_source_read.
11021         (cancel_get) Renamed get_source_destroy_source.
11022         (glob var get_source) New var.
11023
11024         * inpt-pgm.c: (cmd_input_program) Sets vfm_source instead of
11025         read_active_file and cancel_input_pgm.
11026         (read_from_input_program) Renamed input_program_source_read.
11027         Simplified debug output.
11028         (cancel_input_program) Renamed
11029         input_program_source_destroy_source.
11030         (glob var input_program_source) New var.
11031
11032         * loop.c: (loop_1_trns_proc) Simplified debug output.
11033
11034         * main.c: (dump_token) Made eof output more explicit.
11035
11036         * sfm-read.c: (read_variables, dump_dictionary) Removed `lv'
11037         references.
11038
11039         * sort.c: (cmd_sort_cases) Disallows scratch variables.  Removed
11040         code for always-memory or always-disk cases.  malloc's case-list
11041         based on vfm_source_info.ncases.  Explicit support for
11042         memory_stream via memory_source_cases.
11043         (do_external_sort) Sets vfm_source instead of read_active_file and
11044         cancel_input_pgm.
11045         (allocate_file_handles) The temporary directory permissions are
11046         set to 0700 instead of 0777.
11047         (allocate_cases) Formatting fixes.  Simplified debug output.
11048         (output_record) Compacts the case if necessary before writing it
11049         out.
11050         (close_handle, open_handle_w) Simplified debug output.
11051         (write_initial_runs) Destroys vfm_sink, then sets it to
11052         sort_stream.  Writes records to memory based on
11053         vfm_sink_info.case_size.
11054         (write_to_sort_cases) Renamed sort_stream_write().
11055         (merge) Simplified error handling.  Simplified debug output.
11056         Formatting fixes.
11057         (read_from_external_sort) Renamed sort_stream_read().
11058         Reads records based on vfm_source_info.case_size.
11059         (sort_stream_write) Writes records to memory based on
11060         vfm_sink_info.case_size.
11061         (sort_stream_mode) New function.
11062         (glob var sort_stream) New variable.
11063
11064         * temporary.c: (cmd_temporary) Simplified debug output.
11065         (copy_variable) Removed references to `lv'.
11066
11067         * title.c: (get_title) Simplified debug output.
11068
11069         * var.h: Comment fixes.
11070         (struct get_proc) Removed member `lv'.
11071         (struct variable) Removed member `lv'.  Comment fixes.
11072         (glob vars read_active_file, write_active_file, cancel_input_pgm)
11073         Removed.
11074         (struct case_stream) New.
11075
11076         * vars-atr.c: (discard_variables) Changed cancel_input_pgm,
11077         read_active_file references to use vfm_source.
11078         (init_variable, replace_variable) Removed references to `lv'.
11079
11080         * vfm.c: Comment fixes.
11081         (glob var vfm_source, vfm_sink, vfm_source_info, vfm_sink_info)
11082         New variables.
11083         (static var queue, qh, qt, n_lag) Removed.  All references
11084         removed.
11085         (glob var compaction_necessary, compaction_nval, compaction_case,
11086         paging) New variables.
11087         (record_case) Removed.
11088         (procedure) Comment fixes.  Calls vfm_source->read() instead of
11089         read_active_file().
11090         (lag) Removed.
11091         (prepare_for_writing, arrange_compaction, make_temp_case,
11092         vector_initialization, setup_filter) New function.
11093         (open_active_file) Most of the code moved into the abovementioned
11094         new functions.  Now sets temp_dict to &default_dict if there is no
11095         temporary dictionary, for convenience.  New debug output.
11096         (close_active_file) Deals with changing the sink to the source.
11097         Calls finish_compaction().  Frees compaction_case.  Mostly
11098         rewritten.
11099         (glob vars disk_source_file, disk_sink_file) New vars.
11100         (destroy_active_file, read_from_memory) Removed.
11101         (disk_stream_init, disk_stream_read, disk_stream_write,
11102         disk_stream_mode, disk_stream_destroy_source,
11103         disk_stream_destroy_sink) New functions.
11104         (glob var vfm_disk_stream) New var.
11105         (glob vars memory_source_cases, memory_sink_cases,
11106         memory_sink_iter, memory_sink_max_cases) New vars.
11107         (memory_stream_init, memory_stream_read, memory_stream_write,
11108         memory_stream_mode, memory_stream_destroy_source,
11109         memory_stream_destroy_sink) New functions.
11110         (glob var vfm_memory_stream) New var.
11111         (write_case) Local var `i' renamed `cur_trns'; local var `retval'
11112         named `more_cases'.  Simplified debug output.  Otherwise mostly
11113         rewritten.
11114         (record_case) Moved into the stream drivers.  Removed.
11115         (transform) Removed (was dead code).
11116         (SPLIT_FILE_procfunc) s/vfm_replacement/vfm_sink_info/.  In the
11117         common case that the splits don't change, we don't need to copy
11118         the case into prev_case again--pointless.
11119         (compact_case) New function.
11120         (finish_compaction) New function.
11121
11122         * vfmP.h: Comment fixes.
11123         (DEV_* enum series) Removed. 
11124         (struct storage) Renamed `stream_info'.  Removed variant record.
11125         Removed `device' member.
11126
11127         * debug-print.h: New file.
11128         
11129 Sun Jun  8 01:12:38 1997  Ben Pfaff  <blp@gnu.org>
11130
11131         * autorecode.c: Turned off debugging.
11132
11133         * data-list.c: (destroy_dls) Closes the associated file handle.
11134
11135         * descript.q: (custom_variables) Added PV_NO_SCRATCH to
11136         parse_variables() options.
11137
11138         * dfm.c: (open_file_r) Removed gratuituous argument to msg() call.
11139
11140         * display.c: (display_variables) Really fixed null cell bug.
11141
11142         * file-handle.q: (fh_close_handle) Changed debugging message.
11143
11144         * frequencies.q: (custom_variables) Added PV_NO_SCRATCH to
11145         parse_variables() options.
11146
11147         * list.q: Added PV_NO_SCRATCH in q2c varlist options.
11148         (cmd_list) Fails if no variables specified.
11149         (determine_layout) Writes blank lines manually.
11150
11151         * loop.c: (loop_1_trns_proc) Made debugging code only print
11152         messages if debugging.
11153
11154         * q2c.c: (dump_subcommand) Appends sbc->message to SBC_VARLIST
11155         parse_variables() arguments.
11156         (main) Parses optional parenthesized options to varlist
11157         subcommands into sbc->message.
11158
11159         * sfm-read.c: Format fix.
11160
11161         * var.h: (FV_*) New enum series.
11162         (PV_*) New enum PV_NO_SCRATCH.
11163
11164         * vars-prs.c: (find_var) Removed.
11165         (fill_all_vars) Takes FV_* enum instead of boolean third
11166         argument.  Rewritten to deal with scratch as well as system
11167         variables.
11168         (parse_variables) Error message on scratch variable if
11169         PV_NO_SCRATCH set.
11170
11171         * vfm.c: (static var virt_begin_func) New var.
11172         (procedure) Sets up virt_begin_func.
11173         (SPLIT_FILE_procfunc) For the first case, calls virt_begin_func()
11174         after dump_splits().  For succeeding groups changes, calls
11175         virt_begin_func() instead of begin_func().      
11176
11177 Fri Jun  6 22:42:23 1997  Ben Pfaff  <blp@gnu.org>
11178
11179         * count.c, data-out.c, file-handle.q, list.q, loop.c: Turned off
11180         debugging.
11181
11182         * dfm.c: Added some debugging messages, disabled by default.
11183         (open_file_r) Fixed error message.
11184         (read_record) On eof on inline_file, instead of calling
11185         fh_close_handle(), simply jump to eof label like a normal file.
11186         Message fixes.
11187
11188         * display.c: Thin lines between rows for certain kinds of
11189         listing.  Fixed `null cell' bug.
11190
11191         * error.c: (failure) Flush stdout, stderr before failing.
11192
11193         * file-handle.q: (fh_close_handle) Added debugging message.
11194
11195         * frequencies.q: (dump_full) Bottom line extends across entire
11196         table width.  Changed title formatting.
11197         (dump_condensed) Changed title formatting.
11198         (dump_statistics) Fixed title formatting.
11199
11200         * glob.c: (init_glob) Moved initialization of cur_proc out of #if.
11201         Sets default value of set_format.
11202
11203         * list.q: (cmd_list) Calls blank_line() before determine_layout().
11204         Passes write_all_headers() to procedure() as pre-group func.
11205         (write_all_headers) New function.
11206         (determine_layout) Removed calls to write_header().
11207         Calls blank_line() before and after write_fallback_headers().
11208
11209         * recode.c: (recode_trns_free) Only attempts to free head->map if
11210         non-NULL.
11211
11212         * sfm-read.c: (read_variables) Allows `#' at beginning of system
11213         file variable names but gives a warning.  Sets `left' based on
11214         first character being/not being `#'.  On lossage frees dict->var.
11215
11216         * som-high.c: (som_draw_title) Simplified title formatting.
11217
11218         * vfm.c: (dump_splits) Fixed and changed splits formatting.
11219
11220 Thu Jun  5 22:51:15 1997  Ben Pfaff  <blp@gnu.org>
11221
11222         * autorecode.c: (cmd_autorecode) Sets h_trans to NULL at
11223         beginning.  Frees v_src, v_dest on successful exit.  Frees
11224         h_trans[*], h_trans on lossage.
11225         (recode) Frees h_trans[*], h_trans.
11226
11227         * dfm.c: (dfm_close) Formatting change.
11228         (open_inline_file) Now passed a dfm_fhuser_ext to initialize; no
11229         longer allocates its own in inline_file.
11230         (open_file_r) Passes the local dfm_fhuser_ext to
11231         open_inline_file().
11232         (open_file_w) Message fix. 
11233         (read_record) Buffer reallocation strategy changed.  Frees
11234         ext->line even in inline_file to prevent leaks.
11235         (dfm_put_record) Fixed bug where `ext' was cached before the file
11236         was opened and thus it would be NULL when the file really was
11237         open.
11238         (cmd_begin_data) Sets up inline_file basics itself, then calls
11239         open_inline_file() for the dfm_fhuser_ext.  Formatting fix.
11240
11241         * list.q: (write_line) Formatting fix.
11242         (clean_up) Minor strategy change.  Sets proportional font after
11243         finishing cleanup.
11244         (determine_layout) Sets fixed font before writing regular headers,
11245         or after writing fallback headers.
11246
11247         * modify-vars.c: (cmd_modify_vars) Frees variable lists for DROP
11248         and KEEP vars after using them.
11249
11250         * postscript.c: (ps_init_driver) Frees x->family.
11251         (postopen) When loading fonts, free the temporary font name buffer
11252         after using it.
11253         (ps_text_set_font_by_position) Free temporary font name buffer
11254         after using it.
11255         (text) Fixed code that calculated `lig' so that `lig' always gets
11256         initialized.  Formatting fix.
11257
11258         * som-low.c: (get_cell_size, som_get_table_size) `prop_height' ->
11259         `font_height'.
11260         [GLOBAL_DEBUGGIGN] (check_table) Use arena_alloc() to allocate
11261         cells, not xmalloc(), so that the cells will get destroyed
11262         automatically.
11263
11264         * sysfile-info.c: (cmd_sysfile_info) Frees the dictionary after
11265         using it.
11266
11267 Tue Jun  3 23:33:22 1997  Ben Pfaff  <blp@gnu.org>
11268
11269         * ascii.c: (ascii_text_draw) Always sets metrics for strings that
11270         are drawn.
11271
11272         * dfm.c: Comment fix.
11273
11274         * list.q: Comment fixes.  Include somP.h.  Removed static vars
11275         table, n_columns, n_rows, part.  New struct list_ext.  New static
11276         var line_buf.
11277         (n_lines_remaining, n_chars_width, write_line) New functions.
11278         (cmd_list, list_cases) Rewritten.
11279         (begin_row, end_row, flush_table) Removed.
11280         (write_header, clean_up, write_varname, write_fallback_headers,
11281         determine_layout) New functions.
11282
11283         * output.c: (outp_iterate_enabled_drivers) Minor reformat.
11284
11285         * output.h: Comment fix.
11286
11287         * postscript.c: Comment fix.
11288         (struct ps_driver_ext) Removed prop_size, fixed_size members;
11289         added font_size.  All references changed.
11290         (ps_init_driver) Initializes font_size.  Simplified space checking
11291         code.
11292         (static var option_tab[]) Removed prop-size, fixed-size; added
11293         font-size.
11294         (ps_option) Handles font_size.
11295
11296         * som-high.c: Moved prototypes into somP.h.
11297         (som_init_driver) New function.
11298         (som_submit_table) Moved some code into new function
11299         som_init_driver().
11300         (build_target) Moved some code into new function
11301         som_internal_eject_page().
11302         (som_eject_page) Uses som_internal_eject_page().
11303         (som_internal_eject_page) New function.
11304
11305         * som-low.c: Moved prototypes into somP.h.
11306
11307         * som.h: Formatting fixes.
11308
11309         * somP.h: (struct som_driver_ext) Removed em_width;
11310         added prop_em_width, fixed_width.
11311
11312 Mon Jun  2 14:25:25 1997  Ben Pfaff  <blp@gnu.org>
11313
11314         * Makefile.am: Added `localedir' definition.  Added
11315         -DLOCALEDIR="..." to DEFS.  Added -I. to INCLUDES.
11316
11317         * ascii.c: (macro draw_line) Fixed capitalization.
11318
11319         * ascii.c, autorecode.c, cases.c, cmdline.c, command.c, common.c,
11320         compute.c, count.c, data-in.c, data-list.c, data-out.c,
11321         descript.q, dfm.c, display.c, do-if.c, error.c, expr-evl.c,
11322         expr-opt.c, expr-prs.c, file-handle.q, file-type.c, filename.c,
11323         formats.c, frequencies.q, get.c, getline.c, glob.c, groff-font.c,
11324         hash.c, heap.c, include.c, inpt-pgm.c, lexer.c, list.q, loop.c,
11325         main.c, mis-val.c, misc.c, modify-vars.c, numeric.c, output.c,
11326         postscript.c, print.c, q2c.c, recode.c, rename-vars.c, repeat.c,
11327         sample.c, sel-if.c, sfm-read.c, sfm-write.c, sfmP.h, som-frnt.c,
11328         som-high.c, som-low.c, sort.c, split-file.c, sysfile-info.c,
11329         temporary.c, title.c, tokens.h, val-labs.c, var-labs.c,
11330         vars-atr.c, vars-prs.c, vector.c, vfm.c, weight.c: Marked strings
11331         for internationlization.
11332
11333         * glob.c: [HAVE_LOCALE_H] Includes locale.h.
11334
11335 Sun Jun  1 23:31:18 1997  Ben Pfaff  <blp@gnu.org>
11336
11337         * do-if.c, sort.c, val-labs.c: Comment fixes.
11338
11339         * glob.c: (init_glob) Uncommented, updated i18n support.
11340         
11341         * arena.c, ascii.c, data-in.c, descript.q, error.c, expr-evl.c,
11342         expr-opt.c, expr-prs.c, filename.c, frequencies.q, groff-font.c,
11343         output.c, postscript.c, sfm-read.c, som-high.c, vars-prs.c: Made
11344         the declarations of macros taking arguments a lot nicer.
11345
11346 Sun Jun  1 17:22:04 1997  Ben Pfaff  <blp@gnu.org>
11347
11348         * error.h: Removed CE, CW aliases for SE, SW.
11349
11350         * q2c.c: Removed explicit streq() definition since it's duplicated
11351         in str.h.
11352         
11353         * approx.h, error.h, font.h, hash.h, misc.h, output.h, somP.h,
11354         stats.h, str.h, tokens.h: Made the declarations of macros taking
11355         arguments a lot nicer-looking of <pinard@iro.umontreal.ca>.
11356         Comment fixes.
11357
11358 Sun Jun  1 12:02:06 1997  Ben Pfaff  <blp@gnu.org>
11359
11360         * cmdline.c: Comment fixes.
11361         (pick_compat) Changed return type to int.  Now, instead of setting
11362         glob var `compat' to the emulation, returns the emulation.  All
11363         references changed.
11364         (parse_command_line) Added terminating null to end of
11365         `long_options' array definition.
11366         (pre_syntax_message) Fixes.
11367         (usage) Shows the default emulation in the syntax message by
11368         calling pick_compat().
11369
11370         * getline.c: (getl_add_include_dir) Separates paths with
11371         PATH_DELIMITER, not DIR_SEPARATOR.
11372
11373         * glob.c: (init_glob) Fixed references to DEFAULT_VER_PCP40,
11374         DEFAULT_VER_WIN61, DEFAULT_VER_X40.
11375
11376         * output.c: (outp_configure_macro) Make earlier definitions for a
11377         particular key override later ones for the same key.
11378         
11379 Fri May 30 19:40:49 1997  Ben Pfaff  <blp@gnu.org>
11380
11381         * ascii.c: Comment fixes.
11382
11383         * output.c: (outp_get_paper_size)
11384         s/STAT_OUTPUT_INIT_FILE/STAT_OUTPUT_PAPERSIZE_FILE/.
11385         
11386 Sun May 25 22:34:07 1997  Ben Pfaff  <blp@gnu.org>
11387
11388         * ascii.c, postscript.c, sfm-read.c, sfm-write.c, sort.c: Include
11389         <errno.h>.  GNU libc 2 enforces this!
11390
11391         * command.c: (parse_cmd) Fixed problem with `else' clause being
11392         paired with wrong `if'.  Comment fix.
11393
11394 Fri May  9 16:53:52 1997  Ben Pfaff  <blp@gnu.org>
11395
11396         * getline.c: [!HAVE_LIBREADLINE] (read_console) Changed
11397         blp_getline() to getline().
11398
11399         * output.c: (outp_eval_dimension) Changed the fix from last time;
11400         there was no variable `a'.
11401
11402         * q2c.c: (get_line) Fixed boundary condition overrun bug.
11403
11404 Mon May  5 21:58:22 1997  Ben Pfaff  <blp@gnu.org>
11405
11406         * output.c: (outp_evaluate_dimension) Fixed handling of negative
11407         numbers having fractional parts.  Added case of a fraction without
11408         a whole-number part.
11409
11410 Fri May  2 22:08:05 1997  Ben Pfaff  <blp@gnu.org>
11411
11412         * ascii.c: (ascii_text_get_font_position) Removed.
11413
11414         * expr.h, exprP.h: Disabled debugging.
11415
11416         * groff-font.c, postscript.c: Changed `groff' to `Groff' in
11417         several places.
11418
11419         * output.h: (struct outp_class_struct) Removed
11420         text_get_font_position method.  All references deleted.
11421
11422         * postscript.c: Big change here.  Fontmaps were completely
11423         eliminated because of a change in philosophy.  Comment fixes.
11424         (struct ps_fontmap, ps2dit_map, font_family, dit2family_map)
11425         Removed.
11426         (struct ps_driver_ext) `position', `fontmap', `prop_name',
11427         `fixed_name' members removed.  New members `prop_family',
11428         `fixed_family'.  `family' member changed to type char *.
11429         (static var ps_fontmaps) Removed.
11430         () Removed.
11431         (ps_init_driver) Removed obsolete references, updated.
11432         Initializes `translate_x', `translate_y', `scale'.  Doesn't read
11433         fontmap, of course.  Refers to font names through internal_name
11434         rather than subversive means.  Frees proper items.
11435         (static var option_tab[]) Removed `fontmap-file' option; renamed
11436         `fixed-font', `prop-font'.
11437         (ps_option) Corresponds to option_tab[].
11438         (read_fontmap, release_fontmap, ps_to_dit, compare_ps2dit,
11439         hash_ps2dit, compare_dit2family, hash_dit2family, compare_family,
11440         hash_family) Removed.
11441         (postopen) Generates font names from family names.  Gets
11442         PostScript font name properly.  New prologue file comment `!!!'
11443         style.
11444         (ps_open_page) Adds translate_x, translate_y to BP prologue
11445         function; gives SF argument floating-point format.
11446         (ps_text_set_font_by_name) Doesn't try to map PostScript->Groff
11447         font name.  Doesn't change font family.
11448         (ps_text_set_font_by_position) Generates Groff font name from font
11449         family name instead of through table lookup.
11450         (ps_text_set_font_by_family) Renamed `ps_text_set_font_family',
11451         all references changed.  Reduced to simple string assignment.
11452         (ps_get_font_name) Removed.
11453         (ps_get_font_family) Reduced to string return.
11454         (text) Doesn't save `position' since it no longer exists.  Ugly
11455         kluge to save font family--fix soon?
11456         (load_font) Removed PostScript name argument.
11457         
11458 Thu May  1 14:58:59 1997  Ben Pfaff  <blp@gnu.org>
11459
11460         * postscript.c: Comment fix.
11461         (ps_open_page) Puts scale factor in PostScript output.
11462         
11463 Sat Apr 26 11:49:32 1997  Ben Pfaff  <blp@gnu.org>
11464
11465         * Makefile.am: Distcleans q2c.
11466
11467 Wed Apr 23 21:33:48 1997  Ben Pfaff  <blp@gnu.org>
11468
11469         * ascii.c: (delineate) Sets text size even if width is zero.
11470
11471         * command.c: Comment fix.
11472         (static var cmd_table[]) Re-enabled EVALUATE command.
11473         (parse_cmd) Lotsa comment fixes.  Fixed infinite loop in parsing
11474         of comments in script files.  Now more liberal on criteria for
11475         performing a state transition--if *anything* happened correctly,
11476         not just if *everything* happened correctly.
11477
11478         * data-out.c: (convert_F) Comment fix.  Why in the fsck does
11479         Checker segfault on formatting large numbers and why in the fsck
11480         hadn't I noticed this before?
11481
11482         * expr.h, exprP.h: No longer turn off GLOBAL_DEBUGGING.
11483
11484         * list.q: (cmd_list) Commented out the actual output routine
11485         because of various problems.  Probably will abandon the idea of
11486         using the general `crushed tables' for the LIST procedure.
11487
11488         * temporary.c: (restore_dictionary) Sets var_by_name to NULL after
11489         clearing it.  Allocates a new var_by_name dictionary before trying
11490         to add members to it.
11491
11492         * vars-atr.c: [DEBUGGING] (dump_one_var_node) Removed argument
11493         `sib'.  Changed type of `node' argument.
11494         [DEBUGGING] (dump_var_tree) Replaced avlwalk() with
11495         avl_walk_inorder().
11496         (clear_variable) Only dumps the var tree if var_by_name non-NULL.
11497         [DEBUGGING] Only deletes the variable from var_by_name if that var
11498         non-NULL.
11499
11500 Fri Apr 18 16:48:41 1997  Ben Pfaff  <blp@gnu.org>
11501
11502         * Makefile.am: Added include files to SOURCES.  Added
11503         frequencies.q to EXTRA_DIST.  Removed include/ from INCLUDES.  Now
11504         includes rules for q2c.  Added `boast' target.
11505
11506 Fri Apr 18 15:42:22 1997  Ben Pfaff  <blp@gnu.org>
11507
11508         * Makefile.am: Maintainer-clean Makefile.in.
11509         
11510         * Makefile.am: Fixed redundant EXTRA_DIST line.
11511
11512         * ascii.c: Comment fixes.
11513         (ascii_line_vert) Fixed overly aggressive range check.
11514
11515         * display.c: Removed dead code.
11516
11517         * list.q: Turn debugging on.
11518         (flush_table) New debug code.
11519
11520         * sfm-read.c: (read_value_labels) malloc's the structure before
11521         trying to assign to its members.
11522
11523         * sfm-write.c: Comment fix.
11524
11525         * som-high.c: (som_submit_table) Sets som.t and som.d on each call
11526         to output_table().
11527         (output_table) No arguments anymore--gets them through `som'
11528         global.  New debug code.  In crushed tables, now sets `htv' as
11529         well as `hv' to avoid bad confusion later.
11530         (dump_crush_page) New debug code.
11531
11532         * som-low.c: (som_dump_crush_page) New debug code.
11533
11534 Thu Mar 27 01:11:29 1997  Ben Pfaff  <blp@gnu.org>
11535
11536         All source files: Broke long lines into multiple lines.
11537         
11538         * ascii.c: (ascii_close_page) Uses host_system var in place of
11539         HOST_SYSTEM constant.
11540
11541         * cmdline.c: (var syntax_message[]) Broke into
11542         pre_syntax_message[] and post_syntax_message[].
11543         (usage) Outputs both parts, separated by driver list.
11544
11545         * error.h: Fixed broken formatting.
11546
11547         * expr-opt.c: (str_search, str_rsearch) New functions.
11548
11549         * misc.c: (blp_getdelim) Removed.  All references changed to
11550         `getdelim'.
11551         (str_search, str_rsearch) Removed.
11552         (memrmem) New function.
11553
11554         * misc.h: (blp_getline) Removed.  All reference changed to
11555         `getline'.
11556
11557         * stat.h: New file.
11558
11559         * filename.c: Includes "stat.h", not <sys/stat.h>.
11560         (blp_getenv) Uses host_system var instead of HOST_SYSTEM constant.
11561
11562         * output.c: (outp_list_classes) Changed output formatting.
11563
11564         * sfm-write.c: (write_header) Uses host_system var instead of
11565         HOST_SYSTEM constant.
11566         (write_rec_7_34) Extracts version numbers from the version string.
11567         Untested.
11568
11569         * sort.c: Includes "stat.h", not <sys/stat.h>.
11570
11571         * str.c: (strcasecmp) Removed.
11572
11573         * title.c: (cmd_document) Uses host_system var instead of
11574         HOST_SYSTEM constant.
11575
11576         * version.c: Generated on-the-fly by the Makefile instead of being
11577         static.
11578
11579         * str.h: Comment fixes.  Doesn't substitute for missing memmove or
11580         memcpy.
11581         [!HAVE_STRNCASECMP] Declares strncasecmp().
11582
11583         * version.h: Removed stray character.  Comment fixes.
11584         (vars host_system, build_system) New vars.
11585
11586 Mon Mar 24 21:47:31 1997  Ben Pfaff  <blp@gnu.org>
11587
11588         * Most source files: Changed formatting of copyright notice; fixed
11589         FSF address; reformatted to better conform to GNU standards;
11590         comment fixes.  Added markups to prevent GNU indent from messing
11591         up my beautiful formatting :-).
11592         
11593         * q2c.c: (get_line) Ignores lines that begin with `/* *INDENT' so
11594         that GNU indent markups can be passed through without problems.
11595
11596 Wed Feb 19 21:30:31 1997  Ben Pfaff  <blp@gnu.org>
11597
11598         * get.c: Turned off debugging.
11599
11600         * glob.c: (init_glob) Turned on save-file compression by default.
11601
11602         * sfm-write.c: (sfm_write_case) Fixed bug which resulted in less
11603         compression than was possible in save files.
11604
11605 Sun Feb 16 20:57:20 1997  Ben Pfaff  <blp@gnu.org>
11606
11607         * data-out.c: (convert_F) Comment fixes.  Debug message fixes.
11608
11609         * frequencies.q: Removed Fiasco extensions.  Updated calculation
11610         algorithms.  Polished output format. 
11611         (struct frq_info_struct) Removed members `max_degree', `min_n',
11612         all references removed.
11613         (macro frq_extensions) Removed.
11614         (static vars min_n, max_degree) Removed, all references removed.
11615         (internal_cmd_frequencies) Doesn't handle extensions.  Doesn't
11616         calculate `min_n', `max_degree'.
11617         (postcalc) Passes new arg to dump_statistics().
11618         (dump_full) Honor NOLABEL option.  Buggy?  Adds variable name
11619         title.
11620         (dump_condensed) Adds variable name title.
11621         (sum_freqs) Removed.
11622         (calc_stats) Updated calculation algorithm.
11623         (dump_statistics) Removed warning for too-few observations.
11624         Changed table formatting.  Adds variable name title if passed new
11625         arg is nonzero.
11626
11627         * output.h: Comment fix.
11628
11629         * recode.c, sample.c, sort.c: Disabled debug code.
11630
11631         * som-frnt.c: (som_set_value, som_set_float, som_set_text)
11632         Improved debug code.
11633
11634         * var.h: (enum series frq_*) Removed Fiasco extensions.
11635
11636 Sat Feb 15 21:26:53 1997  Ben Pfaff  <blp@gnu.org>
11637
11638         * command.c: Added PROCESS IF to command table.
11639
11640         * Lots & lots of places, removed checks for NULLs preceding calls
11641         to free_expression(), which itself checks.
11642
11643         * descript.q: Removed Fiasco extensions.  Removed optimizations
11644         for non-weighted active files.  Implemented some options.
11645         Finished polishing output format.  Comment fixes.  Merged
11646         `descript.g'.
11647         (static vars n_glob_miss_list, n_glob_valid, n_glob_missing,
11648         max_degree, min_n) Removed.
11649         (macro dsc_extensions) Removed.
11650         (struct dsc_info_struct) Removed `min_n' member, all references
11651         fixed.
11652         (internal_cmd_descriptives) Removed calculation of min_n,
11653         max_degree.  Only deals with one `calc' routine instead of two
11654         flavors.
11655         (precalc) Eliminated redundancy.  Updated for changes to
11656         descriptives_proc structure.
11657         (calc) Moved here from `descript.g'.  Rewritten to calculate
11658         statistics via `moments about the mean' rather than by summing,
11659         summing squares, summing cubes, and so on.
11660         (postcalc) Rewritten for new-style statistical calculation.
11661         (display) Removed support for displaying variables across rows.
11662         No longer crushes the descriptives table.  Removed ancient code.
11663         Added display of N, by variable and listwise.
11664
11665         * descript.g: Removed; merged into `descript.q'.
11666
11667         * expr-evl.c: (evaluate_expression) Now returns a double.  For
11668         numeric results, it returns the result as well as storing it in
11669         the passed `value' structure if non-NULL.  For string results it
11670         just returns 0.0 and it must be passed non-NULL.  Many references
11671         to this function were optimized by use of this change, especially
11672         but not exclusively in `compute.c'.
11673
11674         * frequencies.g: Comment fix.
11675
11676         * glob.c: (glob var process_if_expr) New global var.
11677
11678         * postscript.c: (static var option_tab[]) Corrected entry for
11679         `fixed_size'.
11680         (postopen) Sets x->size to x->prop_size.
11681         (ps_text_set_font_by_name) Sets font size as well as typeface for
11682         PROP and FIXED fonts.
11683         
11684         * sel-if.c: (cmd_process_if) New function.
11685
11686         * sfm-write.c: (struct sfm_fhuser_ext) New member `n_cases'.
11687         (sfm_write_dictionary) Sets `n_cases' to 0.
11688         (sfm_write_case) Increments `n_cases'.
11689         (sfm_close) Attempts to seek the system file back to the header
11690         and write the number of cases in its proper slot.
11691
11692         * som-frnt.c: (som_insert_table) Masks off expansion options since
11693         only SOPT_X_NORM seems to work sensibly.
11694
11695         * som-low.c: (get_cell_size) Fixed bug when a table cell was sized
11696         with a `fixed' value of 2.
11697
11698         * sort.c: (cmd_sort_cases) Cancels PROCESS IF.
11699
11700         * sysfile-info.c: (cmd_sysfile_info) Doesn't display more than 10
11701         value labels; uses SOPT_NONE instead of SOPT_X_BOTH.
11702
11703         * var.h: (enum series dsc_*) Removed Fiasco extensions.
11704         (struct descriptives_proc) Removed `miss_noweight'; new members
11705         `X_bar', `M2', `M3', `M4', `min', `max'.
11706
11707         * vars-atr.c: (discard_variables) Cancels PROCESS IF.
11708
11709         * vfm.c: (close_active_file) Cancels PROCESS IF.
11710         (write_case) Doesn't process cases unselected by PROCESS IF.
11711
11712 Fri Feb 14 23:32:58 1997  Ben Pfaff  <blp@gnu.org>
11713
11714         * glob.c: (glob var err) Removed.
11715
11716         * sysfile-info.c: (cmd_sysfile_info) When adjusting table size,
11717         doesn't have to take into account number of value labels since
11718         they're in a subtable anyway.  Also, doesn't display more than 10
11719         value labels since we can't yet break pages in subtables.
11720
11721 Tue Feb  4 15:15:50 1997  Ben Pfaff  <blp@gnu.org>
11722
11723         * som-frnt.c: (som_change_table_size) Simple change for elegance
11724         that shouldn't change behavior.
11725         (som_set_value) Comment fix.
11726
11727         * som-high.c: (som_submit_table) Message fix.
11728
11729 Wed Jan 22 21:54:00 1997  Ben Pfaff  <blp@gnu.org>
11730
11731         * command.c: Added SYSFILE INFO to command table.
11732
11733         * file-handle.q: (fh_handle_filename) New function.
11734
11735         * get.c: (save_trns_proc) Fixed a bug in padding of output data
11736         with spaces.
11737
11738         * main.c: (parse) New return value for command functions, -3.
11739
11740         * misc.h: Comment fix.
11741
11742         * output.h: Comment fixes.
11743         (macro COMPONENTS) Removed.
11744
11745         * postscript.c: (write_text) Modified literal_chars[] so that `('
11746         and ')' are not written to the output in strings as literals.
11747
11748         * sfm-read.c: (sfm_read_dictionary) New argument.
11749         (read_header) New argument.  Sets the information structure's
11750         values from the header information.  
11751         (read_variables) [__CHECKER__] Redefines isalnum()--some sort of
11752         bizarre Checker problem, I guess.
11753         (read_variables) Proper cleanup on lossage.
11754
11755         * sfm.h: (struct sfm_read_info) New struct for use by
11756         sfm_read_dictionary().
11757
11758         * som-frnt.c: (som_create_table) New argument CREATE_FLAGS,
11759         currently used just for tables that can be dynamically resized and
11760         thus have to be allocated with arena_malloc() instead of
11761         arena_alloc().  All references changed.
11762         (som_change_table_size) New function.
11763         (som_insert_table) Bugfix: now inserts `cell', not `c'!
11764
11765         * som-high.c: [GLOBAL_DEBUGGING] (check_table) Moved to som-low.c.
11766         (som_submit_table) [GLOBAL_DEBUGGING] Doesn't call check_table()
11767         any more.
11768
11769         * som-low.c: (draw_cell) Calls draw_table_cell() for SCON_TABLE
11770         cells.
11771         (draw_intersection) Now takes an argument specifying the table in
11772         question.  All references changed.
11773         (draw_table_cell) New function.
11774         (som_get_table_size) [GLOBAL_DEBUGGING] Calls check_table().
11775         (som_get_table_size) Many nice new explanatory comments.
11776         [GLOBAL_DEBUGGING] (check_table) Moved here from som-high.c.
11777
11778         * som.h: New enum series SOM_CREATE_* for use as create flags with
11779         som_create_table().
11780
11781         * str.h: Moved a comment here from TODO.
11782
11783         * sysfile-info.c: New file.  Reference implementation.
11784
11785 Sun Jan 19 14:22:11 1997  Ben Pfaff  <blp@gnu.org>
11786
11787         * command.c: Added RENAME VARIABLES to table of commands.
11788
11789         * data-in.c: (dls_error) Sets `cust_field'.
11790         (parse_N) Message fix.
11791         (parse_day_count) New function.
11792         (to_roman) Never outputs VX as a `short form' of V.
11793         (parse_month) Fixed parsing of Roman numerals.
11794         (parse_trailer) Message fix.
11795         (parse_DATE, parse_ADATE, parse_EDATE, parse_SDATE, parse_JDATE,
11796         parse_QYR, parse_MOYR, parse_WKYR, parse_DTIME) Issue a message if
11797         the date is invalid.
11798         (parse_SDATE) Fixed swapped day, year.
11799         (parse_JDATE) Fixed bug for dates in 1582.
11800         (parse_DTIME) Allows days not between 1 and 31.
11801         (parse_numeric) Makes local copy of f.type for easier usage.
11802         FMT_DOLLAR fixed.
11803
11804         * data-out.c: (convert_F) When outputting as scientific, properly
11805         sets f.type as fp->type.
11806         (insert_commas) Fixed operator precedence problem with setting of
11807         nitems.  Changed strcpy to memcpy (no null terminator). 
11808         (convert_date) Fixed FMT_JDATE: added 1900 to year.
11809         (convert_CCx) Essentially rewritten, but now it works.
11810
11811         * display.c: (cmd_display) Added DISPLAY FILE LABEL (undocumented
11812         feature of Fiasco).
11813         (display_documents) Implemented.
11814
11815         * error.c: (glob var cust_field) New var.
11816         (vmsg) Displays cust_field as part of message classes DE and DW.
11817
11818         * formats.c: (debug_print) Fixed to compile under updated
11819         dictionary format.
11820
11821         * get.c: (cmd_get, cmd_save_internal) Close file handle on
11822         failure.
11823
11824         * misc.c: (parse_format_specifier) Formatting fix.
11825
11826         * modify-vars.c: (struct var_modification) Renamed `n_reorder' as
11827         `n_rename' for clarity.
11828         (cmd_modify_vars) Initializes `forward' and `positional' at
11829         appropriate times.  Frees lists of vars to rename on failure.
11830         Comment fix.  Frees memory on success.  
11831         (rearrange_dict) Simplified `for' loop condition.
11832
11833         * rename-vars.c: New file (reference implementation).
11834         
11835         * set.q: (internal_cmd_set) Fixed `emu' test condition.
11836
11837         * sfm-read.c: (read_header) File label is created only if file
11838         label in file is not blank.
11839         (read_variables) Initializes `dict' local variable.
11840         (read_documents) Proper behavior on lossage.
11841
11842         * sfm-write.c: (write_header) Doesn't blank out the file label
11843         (why was this here to begin with?!)
11844
11845         * temporary.c: (save_dictionary) File label is copied only if
11846         non-NULL.  Doesn't try to xstrdup() dictionary documents.
11847         Adapted so as to not irritate Checker.
11848         (free_dictionary) Only destroys var_by_name if non-NULL.
11849
11850         * title.c: (cmd_file_label) Doesn't skip FILE, LABEL tokens.
11851         (cmd_document) Doesn't skip DOCUMENT token.  Adds some header
11852         lines to the document, indents the document.  Also, it works now.
11853         (add_document_line) New function.
11854
11855         * var.h: (struct dictionary) Reordering.
11856
11857         * vars-prs.c: (parse_variables) On lossage, only local_free()'s
11858         bits if it was allocated to begin with.
11859
11860 Thu Jan 16 13:08:57 1997  Ben Pfaff  <blp@gnu.org>
11861
11862         * command.c: Added MODIFY VARS to list of commands.
11863
11864         * configure.in: Updated custom macros for autoconf 2.12.  Removed
11865         mmap reference; fixed termcap library reference.
11866
11867         * display.c: (display_variables) Fixed a few bugs although it's
11868         still not well written.
11869
11870         * error.c: [!__CHECKER__] (chkr_disp_call_chain) New function.
11871         (induce_segfault) Calls chkr_disp_call_chain() instead of
11872         inducing an actual SIGSEGV.
11873
11874         * expr-opt.c: (evaluate_tree) Swapped order of arguments to
11875         str_search() and str_rsearch().  Fixed tests for matches on
11876         OP_INDEX and OP_RINDEX.
11877
11878         * filename.c: (good_getcwd) Removed as the new libc for Checker
11879         doesn't contain this bug, apparently.
11880
11881         * misc.c: (str_search, str_rsearch) Changed order of arguments for
11882         consistency with GNU memmem.
11883         (blp_getdelim) Changed `len' from `int' to `size_t'.
11884
11885         * modify-vars.c: Reference implementation.
11886
11887         * som-frnt.c: (zero_length) New global var.
11888         (som_create_table) Message fix.
11889
11890         * som.h: Added gcc attributions to som_set_text(),
11891         som_output_text() prototypes.  blank_line() refers to
11892         zero_length[] instead of a literal null string to suppress gcc
11893         warnings.
11894
11895         * sort.c: (do_external_sort) Fixed fencepost error on lossage.
11896         (allocate_cases) Decrements x_max so the last element of x[] can
11897         be used by the algorithm.
11898
11899         * var.h: Changed minor details of `variable' declaration.  
11900         (struct modify_vars_proc) New struct.
11901         (struct variable) Added field p.mfv.
11902
11903         * vars-atr.c: Comment fix.
11904
11905         * vars-prs.c: (fill_all_vars) More optimal implementation.
11906
11907         * vfm.c: (dump_splits) Sets the last byte of temp_buf to a null
11908         character, which it shouldn't have to do but printf() seems to
11909         read the null byte even though I supply a maximum length...
11910
11911 Fri Jan 10 20:22:08 1997  Ben Pfaff  <blp@gnu.org>
11912
11913         * command.c: Removed command alias X for QUIT.
11914         (parse_cmd) Fixed comment parsing.
11915
11916         * dfm.c: (struct dfm_fhuser_ext) Fields `len', `size' are now of
11917         type size_t.
11918         (read_record) Fixed references to len, size.
11919         (dfm_get_record) Restructured.
11920
11921         * file-handle.h: (struct file_handle) Field `lrecl' now of type
11922         size_t.
11923
11924         * file-handle.q: (internal_cmd_file_handle) Checks for nonpositive
11925         record length.
11926
11927         * modify-vars.c: New file.  Not complete.
11928         
11929         * set.q: (set_ccx) Fixed operator precedence problem regarding ^
11930         and ==.
11931
11932         * sfm-read.c: (bswap_flt64, read_header, write_variable) Fixed
11933         problems caused by int/size_t differences.
11934
11935         * sort.c: (output_record, merge_once) Cast `size_t's to `int's in
11936         appropriate spots.
11937
11938         * str.c: (strcasecmp) Fixed bug that cropped up when the strings
11939         being compared were of equal length.
11940
11941 Thu Jan  2 19:08:23 1997  Ben Pfaff  <blp@gnu.org>
11942
11943         * command.c: Added DOCUMENT, DROP DOCUMENTS, FILE LABEL.
11944
11945         * lexer.c: (get_dotted_rest_of_line) New function.
11946
11947         * sel-if.c: (cmd_filter) Cannot choose string or scratch variables
11948         as filters.
11949
11950         * sfm-read.c: (sfm_read_dictionary) Calls read_documents() to read
11951         type 6 records.  Frees the dictionary properly.
11952         (read_header) Initializes the dictionary instead of letting
11953         read_variables() do it.  Sets the dictionary file label from the
11954         system file.
11955         (read_documents) New function.
11956
11957         * sfm-write.c: (sfm_write_dictionary) Calls write_documents() to
11958         write type 6 record if appropriate.
11959         (write_header) Writes file label from dictionary.
11960         (write_documents) New function.
11961
11962         * temporary.c: (save_dictionary, restore_dictionary,
11963         free_dictionary) Properly handle new fields in dictionary struct.
11964
11965         * title.c: (get_title) Returns after failure().
11966         (cmd_file_label, cmd_document, cmd_drop_documents) New functions
11967         for new commands FILE LABEL, DOCUMENT, DROP DOCUMENTS.  Untested.
11968
11969         * var.h: (struct dictionary) New fields `label', `n_documents',
11970         `documents'.
11971
11972 Wed Jan  1 22:08:10 1997  Ben Pfaff  <blp@gnu.org>
11973
11974         * command.c: Added FILTER to list of commands.
11975
11976         * frequencies.g: [WEIGHTING] Removed test for weighting!=-1 since
11977         it's always true.
11978
11979         * get.c: (cmd_save_internal) Removed weighting code since it's now
11980         handled by sfm-write.c.  Properly commented out debug code.
11981
11982         * glob.c: (glob var weighting) Removed.
11983
11984         * sel-if.c: Comment fixes.
11985         (cmd_filter) New function.
11986
11987         * sfm-read.c: (struct sfm_fhuser_ext) New field `weight_index'.
11988         (sfm_read_dictionary) Sets weighting variable direct in the
11989         created dictionary now.  (Apparently we previously didn't support
11990         weighting on GET?)
11991         (read_header) Sets weight_index field in sfm_fhuser_ext from
11992         header read from disk.
11993
11994         * sfm-write.c: (sfm_write_dictionary) Comment fix.
11995         (write_header) Now sets the weighting in the header from the
11996         passed primary dictionary instead of from the sfm_write_info.
11997
11998         * sfm.h: (struct sfm_write_info) Removed field `weight'.
11999
12000         * som-high.c: (dump_crush_table) Fixed a couple of assertions that
12001         broke on boundary conditions.
12002
12003         * var.h: (struct dictionary) New fields `weight_var',
12004         `weight_index', and `filter_var'.
12005         (glob var weighting) Removed.  This is now part of struct
12006         dictionary.  All references changed; the less mechanical changes
12007         are described above.
12008
12009         * vars-atr.c: (find_dict_variable) New function.
12010
12011         * vfm.c: (static var filter_index) New variable.
12012         (open_active_file) Initializes filter_index from default_dict.
12013         (write_case) Calls proc_func() only if the filter variable is
12014         nonzero; this implements FILTER behavior.
12015
12016         * weight.c: (static var weight_varname) Removed.
12017         (cmd_weight) Modified default_dict instead of glob vars.
12018         (update_weighting) Changed the signature to modify a dictionary
12019         instead of glob vars.  Now returns the weighting variable.
12020         (get_weighting_variable) Removed; its function is absorbed by
12021         update_weighting().
12022         (stop_weighting) Operates on a dictionary now.
12023
12024 Wed Jan  1 17:00:59 1997  Ben Pfaff  <blp@gnu.org>
12025
12026         * sort.c: Removed debugging info from messages.
12027         (do_external_sort) Cleans up after itself by deleting the
12028         temporary directory on failure.  (On success it is deleted by the
12029         input program.)
12030         (allocate_cases) Removed debug code.  Added clean up code.
12031         (output_record) Removed debug code.
12032         (merge) Added code to close all the input files that are currently
12033         open.  This is a likely location for bugs, because I'm not sure
12034         about boundary conditions.  Removed an unnecesary heap_delete().
12035         (merge_once) Removed input file "optimization" that in fact
12036         screwed up the rest of the code.  Message and comment fixes.
12037
12038 Sun Dec 29 21:36:48 1996  Ben Pfaff  <blp@gnu.org>
12039
12040         * error.c: [__CHECKER__] (induce_segfault) Flushes output streams.
12041
12042         * heap.c: (heap_delete) New argument.
12043
12044         * sort.c: Finished implementation of external sort.
12045
12046         * vfm.c: (read_from_disk) Returns after a disk error.
12047
12048 Sun Dec 22 23:10:39 1996  Ben Pfaff  <blp@gnu.org>
12049
12050         * sort.c: (static var state) Removed.
12051         (static vars max_handles, tmp_basename, tmp_extname,
12052         huffman_queue) New variables.
12053         (do_external_sort) Moved most code to new functions.
12054         Creates huffman_queue.
12055         (allocate_file_handles, allocate_cases) New functions.
12056         (static vars run_no, run_length, file_index, case_count) New
12057         variables. 
12058         (output_record) Returns success.  Now really writes to the output
12059         file.
12060         (begin_run, end_run) New functions.
12061         (write_initial_runs) Returns success.  Initializes run_no to -1.
12062         Calls begin_run(), end_run() at appropriate times.  Outputs debug
12063         messages.
12064         (write_to_sort_cases) Calls begin_run(), end_run() at appropriate
12065         times.
12066         (merge) New function.
12067
12068         * heap.c, heap.h: New files.  Hopefully in near-final form.
12069
12070 Sat Dec 21 21:51:04 1996  Ben Pfaff  <blp@gnu.org>
12071
12072         * glob.c: Added write_active_file to global vars.
12073
12074         * sort.c: Several new miscellaneous static variables.
12075         (cmd_sort_cases) Big comment fix.
12076         (perform_case_2) Renamed `do_external_sort' and completely
12077         rewritten.
12078         (case_2_proc_func) Removed.
12079         (output_record, write_initial_runs, write_to_sort_cases,
12080         compare_record) New functions.
12081
12082         * vfm.c: [DEBUGGING] (index_to_varname) Excised bit rot.
12083
12084 Tue Dec 17 18:57:59 1996  Ben Pfaff  <blp@gnu.org>
12085
12086         * sort.c: (perform_case_2) Changed the method for allocation of
12087         lots of memory--now allocates one case at a time in hopes that
12088         more cases can be allocated with heavily fragmented memory.
12089
12090         * var.h: (write_active_file) New global var.
12091
12092         * vfm.c: (procedure, close_active_file, write_case,
12093         SPLIT_FILE_procfunc) Now allow beginfunc, procfunc, and endfunc
12094         arguments to procedure() to be NULL.  All references to
12095         procedure() that made use of dummy functions were changed to NULL
12096         functions.
12097         (open_active_file) If write_active_file is non-NULL, the output
12098         device becomes DEV_PGM (a new enum).
12099         (close_active_file) Sets write_active_file to NULL.
12100         (read_from_memory) Comment fix.
12101         (record_case) Calls write_active_file() when the output device is
12102         DEV_PGM.
12103
12104 Sun Dec 15 15:32:16 1996  Ben Pfaff  <blp@gnu.org>
12105
12106         * sort.c: New file.
12107
12108         * autorecode.c: (cmd_autorecode) Fixed parsing of options.
12109         Fixed checking for duplicate varnames.
12110         (recode) xmalloc()'s the transformation instead of arena_alloc()'ing
12111         it.
12112         (autorecode_trns_free) Destroys hash tables for each recoding
12113         specification.
12114         (autorecode_proc_func) Compares NULL to *vpp instead of vpp.
12115
12116         * command.c: Added SORT CASES to cmd_table.
12117         (null_func, null_int_func) Prototyped.
12118
12119         * descript.g: (calc_weight, calc_noweight) Computes own case
12120         number now.
12121         
12122         * frequencies.q: (dump_statistics) Fixed problem with
12123         too-few-cases warning message.
12124
12125         * get.c: (cmd_save_internal) Handles weighting properly.
12126
12127         * hash.c: (hsh_dump) Output format changed.
12128         (force_hsh_insert) Actually works now, prototype changed.
12129
12130         * list.q: (static var case_num) New variable.
12131         (cmd_list) Initializes case_num.
12132         (list_cases) Increments case_num.
12133
12134         * var.h: Added definitions for SORT CASES.  Comment fixes.
12135
12136         * vfm.c: Some definitions moved to new file vfmP.h.  Comment
12137         fixes.  `active' renamed vfm_active, `rep' renamed
12138         vfm_replacement, all references changed.
12139         (procedure) The procfunc no longer receives a case number.  All
12140         references changed.
12141         (write_case) Subtle reordering.
12142         (SPLIT_FILE_procfunc) Counts cases differently.  Slightly less
12143         redundant.
12144
12145         * weight.c: (get_weighting_variable) New function.
12146
12147         * vfmP.h: New file with definitions from vfm.c.
12148
12149 Sat Dec 14 10:35:30 1996  Ben Pfaff  <blp@gnu.org>
12150
12151         * command.c: (FILE_TYPE_okay) Commented out some tests because
12152         they're clumsy and not yet needed.
12153
12154         * var.h: Most *_trns structures moved to their respective source
12155         files.  Some were moved into a new file, do-ifP.h.  Comment fixes.
12156         (union any_trns) Changed to a typedef for trns_header.
12157         (struct input_program_pgm) Removed.
12158
12159         * vars-prs.c: (parse_variables) Only local_free()'s bits if it
12160         was allocated in the first place.
12161
12162 Fri Dec 13 21:30:53 1996  Ben Pfaff  <blp@gnu.org>
12163
12164         * autorecode.c: New file.
12165         
12166         * command.c: Added AUTORECODE to command table; re-enabled SET.
12167
12168         * data-out.c: (convert_F) Handles infinities and NaNs properly.
12169
12170         * error.c: (vmsg) Comment fixes.
12171
12172         * hash.c: Comment fix.
12173         (hashpjw_d) New function.
12174         (hashpjw) Reimplemented as call to more general function
12175         hashpjw_d().
12176         (internal_comparison_fn) Initializes pointers properly.
12177         (hsh_sort) [GLOBAL_DEBUGGING] New debugging code.
12178         (force_hsh_insert, force_hsh_find) New debugging wrapper
12179         functions.
12180
12181         * main.c: (main) Message fix.
12182
12183         * output.c: (outp_read_devices) Message fix.
12184
12185         * set.q: Comment fixes.
12186         (custom_results) Implemented Wnd/X form of subcommand.
12187         (set_routing) New function.
12188         (internal_cmd_set) Implemented ERRORS, MESSAGES.
12189
12190         * settings.h: (SET_ROUTE_*) New enum series.
12191         (set_results) Renamed set_results_file, all references changed.
12192         (set_messages) Removed.
12193         (glob vars set_errors, set_messages, set_results) New vars.
12194
12195         * title.c: (get_title) Remembers to xstrdup() the result of
12196         get_rest_of_line().
12197
12198         * var.h: (arc_item, arc_spec, autorecode_trns) New structures for
12199         use by AUTORECODE.
12200         (union any_trns) New element `arc'.
12201
12202 Fri Dec  6 23:53:47 1996  Ben Pfaff  <blp@gnu.org>
12203
12204         * command.c: (output_line) Removed references to set_screen.
12205
12206         * error.c: (static var terminating) New var.
12207         (hcf) Sets terminating to 1.
12208         (vmsg) If terminating is nonzero, does not attempt to call hcf().
12209         This prevents an infinite loop if an error occurs within hcf().
12210
12211         * expr-evl.c: (evaluate_expression) [__CHECKER__] Replaced case
12212         statement circumlocution with `case 42000' trick.
12213         (evaluate_expression) New support for OP_STR_MIS.
12214
12215         * expr-opt.c: (evaluate_expression) [__CHECKER__] Replaced case
12216         statement circumlocution with `case 42000' trick.
12217         (dump_node) Handles OP_STR_MIS.
12218
12219         * expr-prs.c: (MISSING_func, SYSMIS_func) Rewrote to handle string
12220         variables exceptions.
12221         (parse_function) Message fix.
12222         (ops[]) Added OP_STR_MIS.
12223
12224         * expr.h: Added OP_STR_MIS to OP_* enum.  Comment fixes.
12225
12226         * exprP.h: [__CHECKER__] Removed case statement circumlocution.
12227
12228         * glob.c: Removed set_scrnfile glob var.
12229         (init_glob) set_errorbreak set to 0 by default.
12230
12231         * groff-font.c: Changed included files.
12232         (groff_read_font) Initializes font_arena local var correctly.
12233         (default_font) New function.
12234
12235         * output.c: Comment fixes.
12236         (glob var disabled_devices) New variable.
12237         [GLOBAL_DEBUGGING] (static var iterating_driver_list) New
12238         variable.
12239         [GLOBAL_DEBUGGING] (reentrancy) New function.
12240         [GLOBAL_DEBUGGING] (outp_read_devices, outp_done, find_driver,
12241         outp_iterate_enabled_drivers) Calls to reentrancy().
12242         (destroy_list) New function.
12243         (outp_done) Moved code to destroy_list().
12244         (parse_options) Parses `listing', `screen', `printer' options
12245         internally.
12246         (configure_driver) Sets new `device' member of driver.
12247         (outp_iterate_enabled_drivers, outp_enable_device) New functions.
12248
12249         * output.h: Comment fixes.  New enum series OUTP_DEV_*.
12250         (struct outp_driver_struct) New member `device'.
12251
12252         * postscript.c: (find_encoding_file) Doesn't display its own error
12253         messages.
12254         (default_encoding) New function.
12255         (switch_font) Calls default_encoding() if no encoding can be
12256         found.
12257         (text) Makes up a character metric if none exists for the desired
12258         character.
12259         (load_font) Properly copies a fallback filename.  Calls
12260         default_font() for a font if none at all are known.
12261
12262         * set.q: Comment fixes.  Removed OUTPUT subcommand.
12263         (custom_listing) Calls outp_enable_device() to enable/disable
12264         listing device.
12265         (turn_screen_on) Removed.
12266         (internal_cmd_set) Calls outp_enable_device() to enable/disable
12267         screen, printer devices.
12268
12269         * settings.h: Comment fixes.
12270         (glob vars set_output, set_printer, set_screen, set_scrnfile)
12271         Removed.
12272
12273         * som-high.c: (som_submit_table, som_eject_page) Use
12274         outp_iterate_enabled_drivers() instead of iterating
12275         outp_driver_list directly.
12276
12277 Wed Dec  4 21:34:17 1996  Ben Pfaff  <blp@gnu.org>
12278
12279         * data-in.c: (parse_EDATE, parse_SDATE) New functions.
12280         (parse_string_as_format) Handles new formats.
12281         (parse_numeric) Now handles DOT and PCT formats.
12282
12283         * data-out.c: (convert_E, convert_F, insert_commas) Handle DOT
12284         format now.
12285         (convert_date) Handle EDATE and SDATE formats.
12286         (convert_CCx) Now if there's not room for the currency characters,
12287         converts it as F format if it's positive instead of giving up
12288         quickly.  Also fixed save-and-restore bug with decimal point
12289         characters.  
12290         (convert_format_to_string) Handles new formats.
12291
12292         * misc.c: (formats[]) Added new formats.
12293         (convert_fmt_ItoO) Supports new formats.
12294
12295         * sfm-read.c: (parse_format_spec) Supports new formats.  Better
12296         data checking.  New argument, all references changed.
12297
12298         * sfm-write.c: (write_format_spec) Supports new formats.
12299
12300         * var.h: New formats FMT_DOT, FMT_PCT, FMT_EDATE, FMT_SDATE.
12301         Comment fixes.
12302
12303 Sun Dec  1 17:19:00 1996  Ben Pfaff  <blp@gnu.org>
12304
12305         * cmdline.c: Comment fixes.
12306         (parse_command_line) Changed return type to void.
12307
12308         * data-in.c: (parse_string_as_format) Added FMT_CCA...FMT_CCE to
12309         switch.
12310         (parse_numeric) Handles international numbers (comma as decimal
12311         point).  Some reformatting.
12312
12313         * data-list.c: (parse_free) Default output format is now
12314         set_format instead of hard-coded F8.2.
12315         (read_from_data_list_list) Emits error message on undefined data
12316         only if set_undefined is nonzero.
12317
12318         * data-out.c: (convert_E) Changes decimal point from period to
12319         comma if appropriate.  Restructured.  Better comments.
12320         (convert_F) Changes decimal point from period to comma if
12321         appropriate.
12322         (insert_commas) Major bug with handling of negative values fixed.
12323         Also, inserts periods instead of commas if appropriate.
12324         (convert_CCx) New function.
12325         (convert_format_to_string) Added FMT_CCA...FMT_CCE to switch.
12326         (num_to_string) Changed `.' to set_decimal.
12327
12328         * dfm.c: Comment fixes.
12329         (dfm_close) Frees ext->line even in inline_file.
12330         (open_inline_file) New function.
12331         (open_file_r) When opening the inline file: now properly
12332         recognizes `BEGIN DATA.' line, and calls open_inline_file() to
12333         finish up.
12334         (read_record) Calls fh_close_handle() instead of dfm_close() to
12335         close the inline file.  Makes a copy of the line getl_buf to avoid
12336         interlock problems.
12337         (dfm_get_record) Restructured.  Now checks the return value of
12338         open_file_r().
12339         (cmd_begin_data) Moved open code into open_inline_file().  Relaxed
12340         checking for use of inline file.  No longer tries to close inline
12341         file.
12342
12343         * error.c: (glob var error_already_flagged) New var.
12344         (vmsg) Message change.  Now checks max number of errors/warnings,
12345         acts on it.
12346
12347         * file-handle.q: (fh_handle_name) Now allows closing of
12348         inline_file.
12349         (fh_init_files) Reformatted.
12350
12351         * get.c: (trim_dictionary) Checks SCOMP option instead of COMP.
12352
12353         * getline.c: (getl_include) Fixed bug that popped up when called
12354         when file queue was empty.
12355         (read_console) Resets error_count, warning_count,
12356         error_already_flagged to zero.
12357
12358         * glob.c: Many changes to update list of variables.
12359         (init_compat_dependent) Now this function is called whenever
12360         `compat' changes.  It now sets set_seed only if it hasn't
12361         previously been referenced.  It now calls
12362         lex_init_compat_dependent().
12363
12364         * include.c: (cmd_include_at) Frees temporary buffer instead of
12365         line buffer.  
12366         (cmd_include) Doesn't make copy of include file name.
12367
12368         * lexer.c: Comment fixes.
12369         (init_lex) Moved some code into new function
12370         lex_init_compat_dependent().
12371         (lex_init_compat_dependent) New function.
12372         (hex_val) Simplified.
12373         (preprocess_line) Uses set_endcmd instead of hardcoding `.'.
12374
12375         * main.c: Comment fixes.
12376         (main) Reformatted.
12377
12378         * misc.c: (formats[]) Added FMT_CCA...FMT_CCE.
12379         (check_input_specifier) Disallows FMT_CCA...FMT_CCE.
12380         (convert_fmt_ItoO) Detects FMT_CCA...FMT_CCE.
12381         (setup_randomize) Sets set_seed_used.
12382
12383         * set.q: Comment fixes.
12384         (custom_results) Conditionalizes on `compat'.
12385         (custom_log) Calls custom_journal().
12386         (set_ccx) New function.
12387         (cmd_set) Calls init_compat_dependent() when `compat' changes.
12388         Calls set_ccx() to handle CCA...CCE.  Sets set_grouping
12389         when set_decimal changes.  Range-checks values for MITERATE,
12390         MNEST.  Message fixes.
12391
12392         * settings.h: Comment fixes.
12393         (struct set_cust_currency) New struct.
12394         (set_cc[], set_grouping, set_seed_used) New global vars.
12395
12396         * var.h: (FMT_CCA...FMT_CCE) New output formats.
12397         (FCAT_OUTPUT_ONLY) New FCAT_* constant.
12398
12399 Thu Nov 28 23:14:07 1996  Ben Pfaff  <blp@gnu.org>
12400
12401         * glob.c: Revised variables to correspond to settings.h.
12402         (init_glob) Initializes variables from settings.h properly.
12403
12404         * set.q: Began long-overdue major revision to correspond to new
12405         philosophy.  Most code changed. 
12406
12407         * settings.h: Mostly changed; reorganized, reordered, large new
12408         comment.
12409
12410 Thu Nov 28 19:46:10 1996  Ben Pfaff  <blp@gnu.org>
12411
12412         * get.c: (cmd_save_internal) No longer forces compression off.
12413
12414         * sfm-read.c: (read_compressed_data) If eof is reached when
12415         reading a new instruction octet, only signal error if we're in the
12416         middle of a case.
12417
12418         * sfm-write.c: (COMPRESSION_BIAS) New #define.
12419         (struct sfm_fhuser_ext) New member `end'.
12420         (write_header) Refers to COMPRESSION_BIAS instead of magic 100.0.
12421         (ensure_buf_space) New function.
12422         (sfm_write_case) Reimplemented in order to support compression.
12423         (sfm_close) Writes out the remaining contents of the compression
12424         buffer if any.
12425
12426 Wed Nov 27 23:18:35 1996  Ben Pfaff  <blp@gnu.org>
12427
12428         * command.c: Defined SAVE and XSAVE commands in command table.
12429
12430         * common.h: second_lowest_value is of type flt64, not double.
12431
12432         * file-handle.h: Comment fix.
12433
12434         * get.c: Comment fixes.
12435         (static var `trns') New.
12436         (save_write_case_func, save_trns_proc, save_trns_free, null_func,
12437         cmd_save_internal, cmd_save, cmd_xsave) New functions.
12438         (dict_delete_run) Clears the variables and frees them now.
12439         (trim_dictionary) Sets default for compression.
12440         On KEEP subcommand, frees deleted variables as well as clearing
12441         them.  Finally got the sense of the test for deleting all
12442         variables correct.
12443         [DEBUGGING] (dump_dict_variables) Message fix.
12444
12445         * glob.c: (init_glob) set_compression set to 1 by default.
12446
12447         * list.q: Properly #includes config.h.
12448
12449         * misc.h: New macro REM_RND_UP.
12450
12451         * settings.h: Comment fix.
12452
12453         * sfm-read.c: (structs sysfile_header, sysfile_format,
12454         sysfile_variable; inline function bswap_int32) Moved to new file
12455         sfmP.h.
12456         (corrupt_msg) [__CHECKER__] No longer induces segfault.
12457         (sfm_read_dictionary) Fixed bug caused by failing to initialize
12458         var_by_index.
12459         (read_machine_flt64_info) Fixed some problems caused by confusion
12460         between flt64 and double types.
12461         (read_header) Message fix.
12462         (read_variables) Fixed set of cases in which we byte-swap sv.print
12463         and sv.write.  Fixed confusion of flt64 and double.
12464
12465         * sfm.h: (struct sfm_write_info) New.
12466
12467         * som-high.c: (som_draw_title) Properly frees `s'.
12468
12469         * temporary.c: (save_dictionary) Comment fix.
12470
12471         * var.h: Comment fixes.  New FMT_* enum, FMT_NUMBER_OF_FORMATS.
12472         (struct trns_header) Formatting fix.
12473         (struct save_trns) New.
12474
12475         * vars-atr.c: (discard_variables) Comment fix.
12476
12477         * sfm-write.c: New file, baseline release.
12478
12479         * sfmP.h: New file, baseline release.
12480
12481 Sun Nov 24 14:53:53 1996  Ben Pfaff  <blp@gnu.org>
12482
12483         * cmdline.c: (parse_command_line) `--version' output updated.
12484         (glob var syntax_message[]) Added my e-mail address.
12485
12486         * file-handle.q, lexer.c, vfm.c: Changed many instances of
12487         `illegal' to `invalid'.
12488
12489         * sfm-read.c: (struct sfm_fhuser_ext) New fields used as
12490         uncompression buffer.
12491         (sfm_close) Frees decompression buffer.
12492         (sfm_read_dictionary) Initializes decompression buffer.
12493         (buffer_input, read_compressed_data) New functions.
12494         (sfm_read_case) Restructured; now calls read_compressed_data() to
12495         handle compressed system file data.
12496
12497         * var.h: Comment fix.
12498
12499 Mon Nov 11 15:34:09 1996  Ben Pfaff  <blp@gnu.org>
12500
12501         * dfm.c: (dfm_close) Does not set h->{ext,class} because the
12502         caller handles it.
12503          
12504         * get.c: New comments.  New static var `get_file'.
12505         (cmd_get) Now fully implemented.  Calls discard_variables();
12506         initializes fv and lv for all variables; new debug code; sets
12507         up the dictionary; sets up the input program.
12508         (read_from_get, cancel_get) New functions.
12509
12510         * sfm-read.c: Comment fixes.
12511         (sfm_close) New static function.
12512         (sfm_read_dictionary) Properly sets up the class of the
12513         file_handle.  No longer cares what size the data is in records of
12514         type 7.  Also, on failure, properly cleans up the file_handle and
12515         free()s some stuff.
12516         (read_variables) No longer thinks it knows `nval' of the
12517         dictionary.  Now sets p.get.fv, etc., instead of speculatively
12518         setting fv itself.
12519         (read_value_labels) Fixed off-by-one error in indexing of
12520         var_by_index[].
12521         (sfm_read_case) New function.
12522         (sfm_r_class) New static var.
12523
12524         * var.h: (get_proc) New struct.
12525         (struct variable) New member p.get.
12526
12527 Thu Nov  7 20:52:28 1996  Ben Pfaff  <blp@gnu.org>
12528
12529         * get.c: Removed GTSV_OPT_MAP because of a misinterpretation of
12530         the manual's meaning.
12531         (rename_variables) New function.
12532         (trim_variables) Doesn't try to parse MAP any more.  Removed debug
12533         code.  Now properly reorders the dictionary on the KEEP keyword.
12534
12535         * sfm-read.c: (read_value_labels) Fixed some bugs regarding
12536         garbage collection.
12537
12538         * vars-atr.c: (clear_variable) New argument `dictionary *'.
12539         (rename_variable) New function.
12540         (free_val_lab) Reformatted.
12541
12542 Thu Nov  7 17:29:16 1996  Ben Pfaff  <blp@gnu.org>
12543
12544         * var.h: Reindented entire file.  Comment fixes.
12545         (glob vars var, var_by_name, nvar, N, nval, n_splits, splits)
12546         Removed.
12547         (glob var default_dict) New.
12548         (struct indirect_dictionary) Removed.
12549
12550         * Many other source files were changed to add `default_dict.'
12551         before all references to the dictionary of the active file.
12552         
12553         * vars-atr.c: (make_indirect_dictionary) Removed.
12554
12555         * glob.c: Reindented all variable declarations.  Updated for
12556         changed var.h.  Comment fixes.
12557
12558         * temporary.c: (restore_dictionary, save_dictionary) Simplified
12559         because now we can mainly copy dictionary structs.
12560
12561         * vars-prs.c: (is_dict_varname, parse_dict_variable,
12562         parse_variables) Takes dictionary instead of indirect_dictionary
12563         first argument.
12564         (parse_variables) Instead of calling make_indirect_dictionary,
12565         just sets DICT to &default_dict if DICT is NULL.  Of course, lots
12566         of `*dict.' references had to be changed to `dict->'.  Removed
12567         debug code.
12568
12569 Thu Nov  7 15:48:52 1996  Ben Pfaff  <blp@gnu.org>
12570
12571         * get.c: Added GTSV_OPT_* series of enums.
12572         (trim_dictionary, dict_delete_run) New functions.
12573         [DEBUGGING] (dump_dict_variables) New function.
12574         (cmd_get) Calls trim_dictionary() to get dictionary fully set-up.
12575         [DEBUGGING] Calls dump_dict_variables() to display results.
12576
12577         * glob.c: (cmp_variable) Now a public function declared in var.h.
12578
12579         * sfm-read.c: Turned off debug code.  Comment fixes.
12580         (read_machine_int32_info, read_machine_flt64_info) New functions
12581         to parse type 7 records.
12582         (sfm_read_dictionary) Properly byteswaps several fields now.
12583         Calls read_machine_*_info() to parse type 7 subtypes 3 and 4
12584         records.  [DEBUGGING] Dumps dictionary.
12585         (read_variables) Sets `index' field of variables created properly.
12586         Constructs avl tree of variables in dictionary.  [DEBUGGING] No
12587         longer dumps dictionary.
12588         (read_value_labels) Properly byteswaps fields.  [DEBUGGING] New
12589         debug code.
12590         [DEBUGGING] (dump_dictionary) No longer stubbed out.
12591
12592         * temporary.c: (restore_dictionary) Destroys `var_by_name' glob
12593         var before destroying any variables just to save a little time.
12594
12595         * var.h: (struct variable) Reordered in order to make name[] the
12596         first member; this makes pointers to `variable' pointers to the
12597         variable name, simplifying avl trees, etc.
12598         (struct indirect_dictionary) New struct.
12599
12600         * vars-atr.c: (find_variable) Rewritten for efficiency.
12601         (make_indirect_dictionary, is_dict_varname, parse_dict_variable)
12602         New functions.
12603         (is_varname) Rewritten for efficiency.
12604         (parse_variables) New argument, which is a `dictionary *'.  All
12605         references changed.  This function now reads variable names from
12606         the dictionary passed, or from the default dictionary if NULL.
12607
12608 Tue Nov  5 18:34:59 1996  Ben Pfaff  <blp@gnu.org>
12609
12610         * misc.h: Added new macro DIV_RND_UP to perform integer division,
12611         rounding up.  Changed many references to ROUND_UP to use this
12612         instead.
12613
12614         * sfm-read.c: Includes avl.h.
12615         (corrupt_msg) Induces a segfault under Checker.
12616         (macro assertive_bufread) New.  Many references to bufread() now
12617         use this instead.
12618         (sfm_read_dictionary) Split up into several functions.  Added code
12619         to read dictionary records following the the type 2 records.  Not
12620         quite complete.  New variable `var_by_index'.
12621         (read_header, read_variables) New functions extracted from
12622         sfm_read_dictionary().
12623         (read_value_labels) New function.
12624         (bufread) Checks ferror() if fread() doesn't return the expected
12625         value; if ferror() is zero it's just EOF.
12626         (dump_dictionary) Stubbed out.
12627
12628         * BTW: The source code now exceeds 50000 lines!
12629         
12630 Mon Nov  4 22:03:28 1996  Ben Pfaff  <blp@gnu.org>
12631
12632         * command.c: Added GET to cmd_table[].
12633
12634         * list.q: Removed reference to alloca headers.
12635         (cmd_list) Gave prototype.
12636
12637         * sfm-read.c: Added DEBUGGING comments.
12638         (sfm_read_dictionary) Checks bias correctly.  Sets
12639         dict->var_by_name to NULL.  Calculates long_string_count
12640         correctly.  realloc's dict->var[] array to minimum size.
12641         [DEBUGGING] Calls dump_dictionary.
12642         [DEBUGGING] (dump_dictionary) New function.
12643
12644         * temporary.c: (save_dictionary) Sets var_by_name to NULL.
12645         (restore_dictionary) If the dictionary contains a non-NULL
12646         var_by_name, uses that instead of generating one.
12647         (free_dictionary) Destroys var_by_name.
12648
12649         * var.h: (struct dictionary) Added field `var_by_name'.
12650
12651         * get.c: New file, not complete.
12652
12653 Sun Nov  3 12:24:36 1996  Ben Pfaff  <blp@gnu.org>
12654
12655         * mis-val.c: New enums MV_NOR_*.  New struct num_or_range.
12656         (parse_num_or_range) New function.
12657         (parse_numeric) Reimplemented in order to support LOW THRU <n> and
12658         <n> THRU HIGH missing values.
12659
12660         * output.h: [__GNUC__>1 && __OPTIMIZE__] (width, height) Made
12661         __attribute__((const)).
12662
12663         * q2c.c: (get_token) Merged isdigit || isalpha into isalnum.
12664
12665         * sfm-read.c: Finished reference implementation.
12666
12667         * sfm.h: Includes var.h.
12668
12669         * var.h: Comment fixes.
12670         (struct `variable') Reordered some fields.
12671
12672         * vars-atr.c: (is_num_user_missing) Added support for MISSING_*
12673         constants added previously.
12674
12675 Wed Oct 30 17:13:08 1996  Ben Pfaff  <blp@gnu.org>
12676
12677         * common.h: Comment fixes.  Added declaration of
12678         `second_lowest_value' as variable or macro.  Made `compat_type',
12679         `pgm_state_type' into anonymous enums.
12680
12681         * display.c: Comment fix.
12682
12683         * glob.c: [ENDIAN==UNKNOWN] Added definition for `endian' global
12684         var.
12685         [!defined SECOND_LOWEST_VALUE] Added definition for
12686         `second_lowest_value' global var.
12687         (compat, pgm_state global vars) Changed types to `int'.
12688         (init_glob) Initializes `second_lowest_value'.
12689
12690         * sfm-read.c: Continued work, not complete.
12691
12692         * var.h: Added new MISSING_* constants to handle LOWEST and
12693         HIGHEST.
12694
12695 Sat Oct 26 23:06:06 1996  Ben Pfaff  <blp@gnu.org>
12696
12697         * sfm-read.c: New file, not complete.
12698
12699         * cases.c: (vec_insert) Changed vector expansion algorithm.
12700         (vec_delete) Fixed bug that screwed up deletion sometimes, it was
12701         mucking up the RECODE transformation in particular.
12702         (envector) Harmless change in notation.
12703
12704         dfm is now fairly well tested again.  
12705         * dfm.c: (dfm_get_record) Only returns ext->ptr if ext is
12706         non-NULL--duh.
12707         (cmd_begin_data) if(ext->line) replaced by if(ext && ext->line).
12708
12709         * recode.c: Comment fix.
12710
12711         * sfm.h: Interface should be fairly final now, or at least for a
12712         day or so...
12713
12714         * vfm.c: [DEBUGGING] (index_to_varname) New function.
12715         (open_active_file) [DEBUGGING] Translates ccase indices into
12716         variable names now to make it easier to understand what's really
12717         going on.
12718
12719 Sat Oct 26 20:46:31 1996  Ben Pfaff  <blp@gnu.org>
12720
12721         * data-in.c: Comment fix.
12722
12723         * data-list.c: Includes dfm.h.
12724         (do_reading) Uses new function dfm_push_cust().
12725
12726         * data-out.c: (convert_time, convert_WKDAY, convert_MONTH) Added
12727         `return 1;' at end.
12728
12729         * file-handle.h: Completely changed.  Some parts split off into
12730         new file dfm.h.  Implemented in file-handle.q.
12731         (enum FH_*) Removed.
12732         (struct fh_ext_class) New struct.
12733         (struct file_handle) Retained only these fields: name, norm_fn,
12734         fn, recform, lrecl, mode.  New fields class, ext.
12735         (get_handle_by_name, get_handle_by_filename, parse_file_handle,
12736         close_handle, handle_name) Added `fh_' prefix to name, all
12737         references changed.
12738
12739         * dfm.h: New file, implemented in dfm.c.
12740         (get_record, put_record, fwd_record, bkwd_record, set_record,
12741         get_cur_col) Functions moved from file-handle.h, now prefixed with
12742         `dfm_'.
12743         (dfm_push_cust) New function.
12744
12745         * sfm.h: New file.  Incomplete.
12746
12747         * dfm.c: All functions adjusted/rewritten for new dfm/fhp
12748         interface.  Functions reordered, comments changed.  Not well
12749         tested, probably full of bugs.
12750         (struct dfm_fhuser_ext) New struct.
12751         (dfm_close) New function.
12752         (open_file_r) Pickier about finding `BEGIN DATA.' line.
12753         (open_file_w) User messages changed.
12754         (get_record) Comment fixed.
12755         (read_record) Increments ext->ln even for inline_file.  Calls
12756         dfm_close() for inline_file when `END DATA.' encountered.
12757         (dfm_get_record) Experimental restructuring.
12758         (dfm_push_cust) New function.
12759         (cmd_begin_data) Detects whether the inline file was fully read by
12760         checking whether it is still open; detects whether it was read at
12761         all by checking whether the line number is greater than zero.
12762
12763         * file-handle.q: All functions adjust/rewritten for new dfm/fhp
12764         interface.  Functions reordered, comments changed.  Not well
12765         tested, probably full of bugs.
12766         (init_file_handle) Removed initializers for obsolete fields, added
12767         new fields.
12768         (fh_close_handle) Much simpler, now mainly calls the class
12769         function.
12770         (fh_init_files) Renamed inline file internal filename.
12771
12772         * file-type.c: Includes dfm.h.
12773         (read_from_file_type) Doesn't use dfm internal state anymore.
12774
12775         * inpt-pgm.c, print.c: Include dfm.h.
12776
12777         * recode.c: (internal_cmd_recode) Casts strlen() return value to
12778         int in comparison with other int.
12779
12780         * som-high.c: (build_target) Fixed operator precedence problem in
12781         if statement (& versus ==).
12782
12783 Sat Oct 26 10:39:25 1996  Ben Pfaff  <blp@gnu.org>
12784
12785         * dfm.c: (read_record) Can now read fixed-length records; not
12786         tested.
12787         (put_record) Can now write fixed-length records; not tested.
12788
12789         * file-handle.h: FH_* defines changed to enums.  New enum series
12790         FH_RF_*, FH_MD_*.
12791         (struct file_handle) New members recform, lrecl, mode.
12792
12793         * file-handle.q: Parser changed.
12794         (internal_cmd_file_handle) Added support for new /RECFORM, /MODE,
12795         /LRECL subcommands.  These are compatible with Windows.
12796         (init_file_handle) Initializes recform, mode fields.
12797
12798         * q2c.c: (get_line) When outputting `!' comment lines, now
12799         increments the output file line number so that `#line' directives
12800         are correct.
12801         (make_identifier) New function that converts an arbitrary string
12802         into a valid C identifier.
12803         (dump_vars) Calls make_identifier() in two places in order to
12804         suppress some errors for bad identifiers.
12805         (make_match) Allows TRUE as synonym for YES and FALSE as synonym
12806         for NO.  Allows numbers to be prefixed by underscores to make them
12807         acceptable C identifiers but still to be parsed as numbers by the
12808         Fiasco lexer.
12809
12810 Thu Oct 24 20:13:42 1996  Ben Pfaff  <blp@gnu.org>
12811
12812         * command.c: Re-enabled RECODE, SAMPLE, SELECT IF.
12813         
12814         * dfm.c: Comment fixes. (get_record) Gives error if file handle
12815         was opened for writing.
12816         (open_file_w) New function.
12817         (read_record) Uses strncasecmp if available.  Improved error
12818         messages, comments.
12819         (put_record) New function.
12820
12821         * file-handle.h: Moved function comments into dfm.c and
12822         file-handle.q.  Comment fixes.  Removed declarations of
12823         tilde_expand() and normalize_filename().
12824         (struct file_handle) Changed `open' from boolean to enumerated
12825         field to allow for three states--closed, open for reading, open
12826         for writing--all references changed.
12827
12828         * file-handle.q: Includes filename.h.
12829
12830         * print.c: (CMD_* enums) Renamed PRT_* and moved into var.h; all
12831         references changed.
12832         (alloc_line) Makes allowance for line terminator characters in
12833         calculations.
12834         (print_trns_proc) Now handles OUTFILE, WRITE differences.
12835         (print_space_trns_proc) Handles OUTFILE differences.
12836
12837         * recode.c, sample.c: Comment fixes.
12838
12839         * var.h: (struct print_trns) Changed boolean field `eject' to
12840         bitmapped field `options'; all references changed.  New enums
12841         PRT_* for use with this field.
12842
12843         * exception.h, test-exception.c: Removed.
12844
12845 Thu Oct 24 17:47:14 1996  Ben Pfaff  <blp@gnu.org>
12846
12847         * ascii.c: (delineate) Turned off debug output.
12848
12849         * common.c: [Checker and Linux] (__assert_fail, __eprintf) Moved
12850         to error.c.
12851
12852         * data-in.c: (parse_string_as_format) Sets the entire string value
12853         to spaces, not just the short string part of it.  Is this correct
12854         now? 
12855
12856         * data-out.c: (convert_date) Fixed DATETIME format problems with
12857         decimal places, removed debug code.
12858
12859         * dfm.c: (open_file_r) Fixed bug where an error would occur in the
12860         middle of parsing BEGIN DATA that would cause the lexer to read
12861         from a wild pointer `prog'; now calls new function
12862         preprocess_line() in lexer.c.
12863
12864         * error.c: [__CHECKER__] (hcf) Calls induce_segfault() on improper
12865         termination.
12866         [Checker and Linux] (__assert_fail, _eprintf) Moved from common.c.
12867         Now call induce_segfault() to induce the segfault.
12868         (induce_segfault) New function.
12869
12870         * expr-opt.c: Comment fix.
12871         (parse_sysvar) New function.
12872         (parse_primary) Added system variable support--calls
12873         parse_sysvar().
12874         (global var ops) Added OP_CASENUM operator.
12875
12876         * expr.h: Comment fixes.
12877         (OP_* enum) added OP_CASENUM operator.
12878         (struct casenum_node) New struct.
12879         (union any_union_union) New member `cas' of type `casenum_node'.
12880
12881         * glob.c: (global var last_vfm_invocation) New var.
12882         (init_glob) Initializes last_vfm_invocation.
12883
12884         * lexer.c: (lookahead) Fixed reversed condition on if statement.
12885
12886         * getline.c: (get_line) Split into get_line() and preprocess_line().
12887         (preprocess_line) New function.
12888
12889         * var.h: Declares last_vfm_invocation.
12890
12891         * vfm.c: (procedure) Sets last_vfm_invocation.
12892
12893 Wed Oct 23 21:53:43 1996  Ben Pfaff  <blp@gnu.org>
12894
12895         * command.c: (parse_cmd) Fixed bad assertion related to
12896         lookahead().
12897
12898         * data-in.c: (parse_month) Implemented to parse months according
12899         to full interpretation of standard.
12900         (to_roman) New function.
12901         (parse_wk_delimiter) Bug fix (forgot to skip `WK' in string).
12902         (parse_weekday) Bug fix (forgot to skip all the day name).
12903
12904         * data-list.c: (read_from_data_list_fixed) Fixed bug that screwed
12905         up parsing of multirecord data items.  Also fixed user message.
12906
12907         * data-out.c: Comment fix.
12908         (year2, year4, convert_date, convert_time, convert_WKDAY,
12909         convert_MONTH) New functions to support time & date output.
12910         (convert_format_to_string) Calls new time & date output routines.
12911
12912         * expr-prs.c: (nary_num_func) Found a bug, but didn't fix it yet.
12913
12914         * lexer.c: (lookahead) Noted a previously unnoticed caveat in
12915         comment.
12916
12917         * main.c: [DEBUGGING] (dump_token) Updated to handle getline.h.
12918
12919         * misc.c: (global var formats) Fixed declarations of DATETIME,
12920         TIME, DTIME.
12921
12922         * postscript.c: (text) Fixed a pair of bugs in the reallocation of
12923         the output_char buffer.
12924
12925         * vars-prs.c: (parse_DATA_LIST_vars) Fixed a failure to free
12926         memory bug.  Fixed user messages.
12927
12928 Tue Oct 22 17:27:04 1996  Ben Pfaff  <blp@gnu.org>
12929
12930         * Removed #pragma argsused from lots of places.
12931         
12932         * data-in.c: Implemented zoned decimal and time-date formats.
12933         Untested.  This is a huge chunk of code--maybe 1000 lines and 50
12934         new functions.
12935
12936         * data-out.c: Implemented zoned decimal format.
12937
12938         * expr.h: Moved yrmoda() declaration here from exprP.h.
12939
12940         * misc.c: (global var formats) Minor fixes--added
12941         FCAT_SHIFT_DECIMAL to formats N and Z.
12942         (convert_fmt_ItoO) Added support for format Z.
12943
12944         * som-frnt.c: (som_set_value) Fixed bug regarding string values.
12945
12946 Mon Oct 21 20:39:59 1996  Ben Pfaff  <blp@gnu.org>
12947
12948         * command.c: (parse_cmd) [GLOBAL_DEBUGGING] Inserted call to
12949         som_check_workspace() that is activated between commands.
12950
12951         * data-list.c: (dump_fixed_table, dump_free_table) Finished these
12952         for good, I hope.
12953
12954         * list.q: (begin_row) Changed title expansion style from
12955         SOPT_X_VERT to SOPT_X_SHSP.
12956
12957         * som-frnt.c: Now includes `somP.h'.
12958         (som_push_workspace, som_pop_workspace) New functions that, taken
12959         together, form a solution to the recursive table building problem
12960         mentioned yesterday.  Surrounded every table output routine
12961         throughout the program with calls to these functions.
12962         [GLOBAL_DEBUGGING] (som_check_workspace) New function.
12963         (som_create_table) Checks that there's an active workspace.
12964         (som_destroy_all_tables, som_crush) Removed.
12965
12966         * som-high.c: (global var som_preserve_tables) Removed, all
12967         references deleted.
12968         (som_submit_table) Checks that there's an active workspace.
12969         (dump_columnated_table) Doesn't columnate tables that would have
12970         just one row per column.
12971         (dump_crush_page, som_dump_crush_page) Removed debugging code.
12972         (som_dump_crush_page) Moved row number labels from left side of
12973         tables to right side.
12974         (som_get_table_size) Added support for SOPT_X_SHSP.
12975
12976         * som.h: New cell expansion type SOPT_X_SHSP.
12977
12978         * somP.h: (global vars arena_stack, n_arena_stack, m_arena_stack)
12979         New vars.
12980         (global var curtab_arena) Moved from som-frnt.c.
12981
12982 Sun Oct 20 13:45:28 1996  Ben Pfaff  <blp@gnu.org>
12983
12984         * ascii.c: [GLOBAL_DEBUGGING] (SUPPRESS_WARNINGS) New debug option
12985         that causes bad location warnings to be suppressed.
12986         (delineate) Saves current font when calling draw_text(); fixed
12987         handling of NULLs when backing up.  Also fixed line-wrapping bug.
12988
12989         * command.c: Re-enabled `LEAVE', `NUMERIC', `PRINT', `PRINT EJECT',
12990         `PRINT FORMATS', `PRINT SPACE', `STRING', `TITLE', `WRITE'.
12991
12992         * common.c: Added code to cause assertion failure to dump core
12993         when run under Checker.
12994
12995         * data-list.c: (dump_fixed_table) Fixed some inconsistencies, but
12996         there are still bugs.
12997
12998         * glob.c: (__eprintf) Removed.
12999
13000         * list.q: Inserted som_preserve_tables kluge that prevents tables
13001         from being thrown away due to recursive table building through
13002         som_output_line being called from a transformation during the LIST
13003         procedure invocation.  This is a general problem that must be
13004         solved in a better way since it applies to all procedures in
13005         general.
13006         (begin_row) Changed title options to SOM_X_VERT from SOM_X_BOTH.
13007         (flush_table) Removed SOM_TOPT_PRESERVE from submission options.
13008
13009         * numeric.c: Fixed several errors in the form of msg() calls.
13010
13011         * print.c: Updated for use of som.
13012         (dump_table) Reimplemented.
13013         (print_trns_proc) Calls som_eject_page() instead of eject_page().
13014         Calls som_output_text() instead of outs_line().
13015
13016         * som-frnt.c: (som_destroy_all_tables) Sets som_preserve_tables to
13017         0.
13018         (som_output_text) Function moved from som-low.c.  Interface
13019         changed.
13020
13021         * som-high.c: (som_preserve_tables) New global public variable
13022         declared in som.h.
13023         (som_submit_table) Destroys the tables only if som_preserve_tables
13024         is 0.
13025         (paginate_horizontally) Bugfix: sets som.mpw even if there's only
13026         one subrow per row.  Now labels subrows if there's more than one
13027         subrow per row.
13028         (dump_crush_table) Added wishlist comment.
13029         (som_eject_page) New public function declared in som.h.
13030
13031         * som-low.c: (som_dump_crush_page) Draws row labels if there's
13032         more than one subrow per row.
13033         (som_output_text) Moved to som-frnt.c.
13034
13035         * som.h: (SOM_TOPT_PRESERVE) Removed.
13036
13037         * title.c: (get_title) Changed interface.
13038         (cmd_title) Changed `title' to `outp_title'.
13039         (cmd_subtitle) Changed `subtitle' to `outp_subtitle'.
13040
13041 Sun Oct 20 09:04:15 1996  Ben Pfaff  <blp@gnu.org>
13042
13043         * list.q: (flush_table) Conforms to new partial options in
13044         som_submission_form.
13045
13046         * som-high.c: (paginate_horizontally) Changed form of subrow
13047         number labels.
13048         (build_target) Omits spacing before table if
13049         SOM_TOPT_PARTIAL_OMIT_TOP is selected.
13050         (dump_crush_page) Changed interface.  Only trims bottom rule if
13051         SOM_TOPT_PARTIAL_OMIT_BTM is not selected.
13052         (dump_crush_table) Handles partial tables.
13053         (output_row_label) New function.
13054         (som_dump_crush_page) Emits subrow number labels.  Draws vertical
13055         rule on the right edge of narrow subrows.
13056
13057         * som.h: Changed SOM_SUB_PARTIAL_* series of submission type
13058         constants to a series of SOM_TOPT_PARTIAL_* submission options.
13059         All references updated.
13060
13061 Fri Oct 18 19:46:49 1996  Ben Pfaff  <blp@gnu.org>
13062
13063         * misc.c: Comment fix.
13064
13065         * som-high.c: (examine_table) Treats crushed tables separates for
13066         purpose of determining header size.
13067         (paginate_horizontally) Allots space for line numbers in crushed
13068         tables with lots of subrows per row.  Calculates the `maximum page
13069         width', the width of the widest horizontal page.
13070         (build_target) Removed trim argument; all references changed.
13071         Stricter assertions.  (dump_crush_page) New function.
13072         (dump_crush_table) Reimplemented.
13073
13074         * som-low.c: (som_dump_page) Uses new RULE_ROW &c. constants.
13075         (som_dump_crush_page) Reimplemented, interface changed.
13076
13077         * somP.h: Many many new helper macros for use with crushed tables.
13078         (global var som) Removed `tv', `cum_y' members; all references
13079         removed.  New members `mpw', `digit_space'.
13080
13081 Sun Sep 29 19:37:03 1996  Ben Pfaff  <blp@gnu.org>
13082
13083         * arena.c: (arena_alloc) [!DISCRETE_BLOCKS] Removed `size'
13084         variable, changed to constant 1024.
13085         (arena_ca_strdup) Changed `sizeof(a_string)' to
13086         `sizeof(c_string)'.
13087         (arena_ca_strdup) [!DISCRETE_BLOCKS] Changed bad cast from
13088         `(c_string *)' to `(char *)'; this fixed some offset problems.
13089
13090         * filename.c: (readlink_malloc) Changed initial allocation from
13091         100 bytes to 128.
13092         (good_getcwd) Changed from xmalloc() to local_alloc(); removed
13093         comment.
13094
13095         * postscript.c: (read_fontmap) Fixed leak by changing &owner to
13096         &fm->owner in several places.
13097
13098         * som-high.c: (output_table) Changed interface to rest of world.
13099         (examine_crush_table) Removed.  Crushed tables are re-broken now,
13100         in preparation for rewrite.
13101
13102         * som.h: Comment fix.
13103
13104 Sat Sep 28 21:28:07 1996  Ben Pfaff  <blp@gnu.org>
13105
13106         * ascii.c: (ascii_init_driver) Disposes of x->file.filename and x
13107         itself in the cleanup stage.
13108
13109         * descript.q: (display) At least temporarily, changed the table
13110         format to a crushed table.
13111
13112         * list.q: (begin_row) At least temporarily, added horizontal lines
13113         between cases.
13114
13115         * som-high.c: (examine_crush_table) Sets som.hh to the width of
13116         the horizontal "headers," that is, to the width of the far left
13117         and far right rules.
13118         (justify_pagination) Sets som.th to the width of the widest row
13119         in the crushed table.  Fixed inner loop off-by-one error.
13120
13121         * som-low.c: (som_dump_crush_page) Added code to draw horizontal
13122         rules.
13123
13124         * somP.h: Comment fix.
13125
13126 Fri Sep 27 20:08:39 1996  Ben Pfaff  <blp@gnu.org>
13127
13128         * filename.c: (open_file_ext) Now, doesn't set f->file to NULL
13129         before closing it; also, opens the constructed filename `s'
13130         instead of f->filename.
13131
13132         * postscript.c: Moved initialization of x->loaded, x->prop,
13133         x->fixed, x->current, also the add_encoding() calls, into
13134         postopen().
13135         (preclose) Destroys x->combos; sets x->loaded, x->combos to NULL;
13136         sets x->last_font to NULL; sets x->next_combo to zero.
13137
13138         * som-high.c: (crushed_row_height) Moved definition farther up.
13139         (som_submit_table) Doesn't calculate line width, font size until
13140         after calling open_page(), to accomodate changes to PostScript
13141         driver.
13142         (vert_headers) Removed; equivalent functionality moved to
13143         examine_table(), examine_crush_table().
13144         (justify_pagination) Replaced with different algorithm.
13145         (dump_crush_table) Bugfix that caused tables to fail to be clipped
13146         at the bottom of the page.
13147
13148 Thu Sep 26 22:20:26 1996  Ben Pfaff  <blp@gnu.org>
13149
13150         * command.c: Added cmd_list back into cmd_table.
13151
13152         * freq.c, frequencies.q, repeat.c, list.q, vars-atr.c, vfm.c:
13153         Comment fix: `#define DEBUGGING' --> `#define DEBUGGING 1'.
13154
13155         * list.q: (flush_table) Updated to new som_submission_form format.
13156
13157         * som-frnt.c: Comment fix.
13158
13159         * som-high.c: Changed `#endif' to `#undef EXTERN'.
13160         (output_table) Calls som_get_table_size() directly; handles
13161         crushed tables.
13162         (examine_crush_table) New function; calls vert_headers().
13163         (examine_table) Moved some code into new function, vert_headers().
13164         (justify_pagination) New function.
13165         (dump_plain_table) Removed `static' from `cy'.
13166         (dump_crush_table) New function.
13167
13168         * som-low.c: (som_dump_crush_page) New function.
13169
13170         * som.h: Comment fixes.
13171         (enum SOM_TOPT_CRUSH) New.
13172         (SOM_SUB_PARTIAL_BEG, SOM_SUB_PARTIAL_MID, SOM_SUB_PARTIAL_END)
13173         Temporarily set to zero to make do with LIST procedure.
13174
13175         * somP.h: Re-ordering.
13176
13177 Wed Sep 25 19:36:11 1996  Ben Pfaff  <blp@gnu.org>
13178
13179         * som.c: Split into som-frnt.c, som-high.c, som-low.c.
13180
13181         * somP.h: New file for use by som-high.c, som-low.c.
13182
13183         * q2c.c: Added definition for VME.
13184         (get_line) Now dumps `!' comment lines to the output file
13185         verbatim.
13186
13187         * crosstabs.q, descript.q, file-handle.q, frequencies.q, list.q,
13188         set.q: Changed format of `!' comment lines.
13189
13190 Tue Sep 24 18:39:09 1996  Ben Pfaff  <blp@gnu.org>
13191
13192         * All source files: Added copyright notice.
13193
13194         * common.c: (xmalloc, xrealloc, xstrdup) Cast size_t's to unsigned
13195         longs in msg() calls.
13196
13197         * con32s.c: (xmalloc, xrealloc) Updated from common.c.
13198
13199         * q2c.c: (xmalloc, xrealloc, xstrdup) Updated from common.c.
13200
13201 Sat Sep 21 23:16:31 1996  Ben Pfaff  <blp@gnu.org>
13202
13203         * output.c: (outp_read_devices) Changed criteria for
13204         distinguishing different types of lines.
13205
13206 Fri Sep 20 22:52:28 1996  Ben Pfaff  <blp@gnu.org>
13207
13208         * cmdline.c: Changed syntax message.
13209
13210         * filename.c: (good_getcwd) Bug fix (?).
13211         (normalize_filename) [__BORLANDC__] Uses _fullpath() library
13212         function.
13213         (search_path) Appends DIR_SEPARATOR to directory name only if it
13214         does not already end with one.
13215
13216         * glob.c: Checks STAT_PAGER envvar before PAGER.
13217
13218         * output.c: Checks environment variables instead of just local
13219         macros.
13220
13221 Tue Sep 10 21:39:00 1996  Ben Pfaff  <blp@gnu.org>
13222
13223         * arena.c: (arena_destroy) Swatted a subtle bug that cropped up
13224         when the pointer passed to the function was within the arena
13225         itself, so that it couldn't properly be set to NULL _after the
13226         arena was freed_.
13227
13228         * command.c: Re-enabled DISPLAY.
13229
13230         * display.c: Rewritten to handle tables.  Untested.
13231
13232         * filename.c: (search_path) Fixed memory leak.
13233
13234         * frequencies.q: (cmd_frequencies) Frees v_variables.
13235         (postcalc) Calls cleanup_freq_tab() after displaying statistics.
13236         (cleanup_freq_tab) New function to garbage collect.
13237         (dump_full) Elegantized.
13238
13239         * main.c: New comment.
13240
13241         * output.h: New tag for tagged quotes: TAG_NEWLINE.
13242
13243         * postscript.c: Comment fix.
13244         (release_fontmap, free_font_entry) New functions.
13245         (ps_init_driver) Sets free_font_entry() as the freefunc for
13246         hashtable `loaded'.  Calls release_fontmap() when destroying a
13247         driver; also frees the output filename; also frees the
13248         ps_driver_ext block.
13249         (free_ps_encoding) Frees the filename as well as the encoding
13250         block.
13251         (output_encodings) Frees the line buffer and pops the msg-filename
13252         stack.
13253         (read_fontmap) Frees the fontmap filename and the line buffer.
13254         (postopen, preclose) Misc. garbage collection fixes.
13255         (ps_open_page) Destroys the `combos' hash table; sets `last_font'
13256         to NULL; this fixes some output problems.
13257         (text) Handles TAG_NEWLINE.  Untested.
13258
13259         * som.c: (cell_byte_size) Merged SCON_VALUE and SCON_TEXT cases.
13260         (som_set_string) Removed.  All references changed to
13261         `som_set_text'.
13262         (som_set_text) Rewritten.  New interface.  More general.
13263
13264         * som.h: Minor format changes.
13265         (struct som_value_cell) Removed; all references changed to
13266         `som_text_cell'.
13267         (enums SOT_*) Changed.
13268
13269 Mon Sep  9 21:43:13 1996  Ben Pfaff  <blp@gnu.org>
13270
13271         * command.c: Re-enabled SPLIT FILE.
13272
13273         * postscript.c: Comment fix.
13274
13275         * som.h: Added `SOT_NONE'.
13276
13277         * split-file.h: (cmd_split_file) Removed superfluous parenthesis.
13278
13279         * vfm.c: (dump_splits) Reimplemented.
13280
13281 Sat Sep  7 22:35:12 1996  Ben Pfaff  <blp@gnu.org>
13282
13283         * Compiled the project under gcc 2.7.2, which gave some new
13284         warnings.  This led to many additions of casts from unsigned to
13285         int sprinkled throughout the code.
13286         
13287         * arena.c: Many uses of `unsigned' changed to `size_t'.
13288
13289         * command.c: Added END FILE, END REPEAT to command table.
13290         (var cmd_end_repeat) Renamed cmd_end_repeat_p.
13291         (find_command, FILE_TYPE_okay) Not commented out anymore.
13292         (parse_cmd) Calls FILE_TYPE_okay again.
13293         (output_line) Added calls to som_output_text() to put the line
13294         in the output files.
13295
13296         * common.c: (macro VME) Format changes.
13297         (xstrdup) Asserts that its argument is not NULL.
13298         
13299         * data-list.c: Implemented dump_fixed_table().
13300         
13301         * inpt-pgm.c: Formatting changes.  Comment changes.
13302         (end_case_proc) Renamed end_case_trns_proc.
13303         (cmd_end_file, end_file_trns_proc) New functions.
13304
13305         * misc.c: Many uses of `int' and `unsigned' changed to `size_t'.
13306
13307         * misc.h: (local_strdup) New macro corresponding to strdup() but
13308         allocating its data through local_alloc() if possible--that is, if
13309         GNU C is in use.
13310
13311         * postscript.c: Comment changes.
13312         (quote_ps_name, quote_ps_string, output_encodings) New functions.
13313         (output_line, add_string) New macros supporting
13314         output_encodings().
13315         (postopen) Fixed contents of ${fixed-font} and ${prop-font}
13316         substitution vars.  Calls output_encodings() when a line
13317         consisting of `!encodings' is encountered.
13318         (preclose) Some code moved into quote_ps_string().
13319         (dump_line) Changed into macro supporting dump_fancy_line().
13320         (switch_font) Now outputs DSC "%%IncludeResource: font (...)"
13321         command when appropriate.
13322         (write_text) Fixed `literal_char' array (I think it's fixed, at
13323         least.)
13324         (text) Fixed bug when width was zero.  Now exits immediately on
13325         zero height_left.  Now, when executing `goto restart;', checks
13326         that cp<end, so that we don't read beyond end-of-string.  Also,
13327         outputs the correct code to the output file by outputting the code
13328         from the metric instead of the internal metric index.
13329
13330         * repeat.c: (cmd_end_repeat) New function.
13331
13332         * som.c: (var som) `headers' renamed `options' and semantics
13333         changed.  All references changed.
13334         (draw_title) `if(px!=-1 || px!=-1)' --> `if(px!=-1 || py!=-1)'.
13335         (build_target) Only inserts spacing if SOM_TOPT_SPACING not
13336         selected.
13337         (som_text_table) Removed.
13338         (som_output_text) New function.
13339
13340         * som.h: (struct som_submission_form) Removed `header', `reuse',
13341         replaced with bitmapped field `options'.
13342         (SOM_TOPT_*) New enum set for som_submission_form.options.
13343         (SOT_*) New enum set for som_output_text().
13344
13345         * temporary.c: (copy_variable) When copying the var label, only
13346         calls xstrdup() if it's non-NULL.
13347
13348         * var.h: (enum type `vartype') Removed; all references changed to
13349         `int'.
13350
13351         * vars-atr.c: (init_variable) Changed local var `nbytes' from
13352         `int' to `size_t'.
13353
13354 Thu Sep  5 22:05:56 1996  Ben Pfaff  <blp@gnu.org>
13355
13356         * font.h: Comment changes.
13357
13358         * groff-font.c: (groff_read_font) Initializes `name' field to
13359         NULL.  Handles `encoding' field.
13360
13361         * hash.c: (hsh_dump) [GLOBAL_DEBUGGING] Output formatting changes.
13362
13363         * postscript.c: (struct font_entry) Removed `position' field.
13364         (struct ps_font_combo) New struct.
13365         (struct ps_driver_ext) Removed field `next_position'.  New fields
13366         `combos', `next_combo'.  `last_font' field changed from
13367         `font_entry *' to `ps_font_combo *'.
13368         (ps_init_driver) Reformatted; handles new fields.  When
13369         OPO_AUTO_ENCODE is set, adds the two default fonts' encodings to
13370         the encoding list.
13371         (get_encoding, find_encoding_file) New functions.
13372         (add_encoding) Some code moved out into find_encoding_file().
13373         (postopen) Changed value for ${title}.
13374         (preclose) Sets `loaded' field to NULL after destroying the hash
13375         table.
13376         (ps_open_page) Added comment.  Inits the `combos' and `next_combo'
13377         fields.
13378         (ps_text_set_font_by_position) Figures out the current family if
13379         not known.
13380         (compare_ps_combo, hash_ps_combo, free_ps_combo) New functions.
13381         (switch_font) Implemented.
13382         (write_text) Calls switch_font() more often.  Format changes.
13383         #undefs its macros after they're no longer useful.
13384         (text) Changed `continue' at one point to a jump to the top of the
13385         loop because we don't want `separate' reset to 0 at that point.
13386         (load_font) No longer sets `position' in the font_entry created.
13387
13388 Wed Sep  4 21:45:35 1996  Ben Pfaff  <blp@gnu.org>
13389
13390         * font.h: (struct font_desc) New member `encoding', which is not
13391         properly handled yet.
13392
13393         * glob.c: (init_glob) Some new i18n code, which is probably
13394         screwed up.
13395
13396         * output.c: (outp_read_devices, outp_get_paper_size) Changed
13397         `size' local from `int' to `size_t'.
13398
13399         * postscript.c: New driver configuration parameter `auto-encode'.
13400         New enums OPO_AUTO_ENCODE, ODA_COUNT.
13401         (struct font_entry) New member `position'.
13402         (struct ps_driver_ext) Reordered.  New hash table member
13403         `encodings'; new members `next_position', `next_encoding',
13404         `last_font'.  Members `current', `prop', `fixed' changed from type
13405         `font_desc *' to `font_entry *'; all references changed.
13406         (struct ps_encoding) New struct.
13407         (read_ps_encodings, compare_ps_encoding, hash_ps_encoding,
13408         free_ps_encoding, add_encoding) New functions.
13409         (ps_init_driver) Added OPO_AUTO_ENCODE to default
13410         x->output_options.  Initializes new members of ps_driver_ext.
13411         Changed default value for prologue_fn, encoding_fn.  Calls
13412         read_ps_encodings after loading default fonts.
13413         (option_tab[], ps_option) Handle new configuration parameter.
13414         (switch_font) New function.
13415         (struct output_char) `font' member changed from `font_desc *' to
13416         `font_entry *'.  New member `separate'.
13417         (read_fontmap) Changed `size' from `int' to `size_t'.
13418         (output_line, put_number) New macros for write_text().
13419         (write_text) Optimizes text output by consolidating multiple
13420         calls to PostScript `show' operator.
13421         (text) Keeps track of when text arguments can't be consolidated by
13422         write_text(), and marks those spots in the output stream.
13423         (load_font) Sets `position' of the allocated font_entry to -1, cuz
13424         the font hasn't been switched to by switch_font(), which is where
13425         the position is important--the PostScript is what cares about the
13426         position.
13427
13428 Sat Aug 31 23:52:38 1996  Ben Pfaff  <blp@gnu.org>
13429
13430         * hash.c: (hsh_destroy) Ignores NULL argument.  Doesn't try to
13431         call a NULL free_func.
13432         (hsh_rehash) Elegantized.
13433         (hsh_probe) Fix bug that manifested when the table was expanded
13434         and thus had to change location in memory.  Good thing
13435         too--otherwise could have been much more subtle.
13436         (hsh_find) [GLOBAL_DEBUGGING] Not stubbed out anymore.
13437         (hsh_foreach) New function for hash table iteration.
13438
13439         * hash.h: (struct hsh_iterator) New.
13440
13441         * lexer.c: (parse_tagged_quote) Font and family name strings in
13442         tags are now null-terminated.
13443
13444         * output.c: (outp_evaluate_dimension) Fixed over-aggressive unit
13445         parsing.
13446         (internal_get_paper_size, outp_get_paper_size) Fixed; now work as
13447         documented.  (Never before tested?)
13448
13449         * output.h: Comment changes.
13450
13451         * postscript.c: New driver options `optimize-text-size',
13452         `optimize-line-size', `max-fonts-simult'.  New enum set for
13453         specing cached line types.  Comment fixes.
13454         (struct line_form) New struct.
13455         (struct ps_driver_struct) New members `text_opt', `line_opt',
13456         `max_fonts', `lines'.
13457         (ps_init_driver) Initializes new members of ps_driver_struct.
13458         (user option type enum set) New member `nonneg_int_arg'.
13459         (static var option_tab[]) Supports new options.
13460         (ps_option) Handles new options.
13461         (find_ps_file) Made static.  No longer calls hsh_dump().
13462         (ps_get_var) Made static.
13463         (preclose) Dumps out proper DSC trailer.
13464         (ps_open_page) Elegantized.
13465         (ps_close_page) Calls dump_lines() if appropriate.
13466         (ps_line_horz, ps_line_vert, ps_line_intersection) Reduced to
13467         wrappers around line().
13468         (int_2_compare, compare_line, dump_line, dump_fancy_line,
13469         dump_lines, hash_line, free_line, line) New functions for support
13470         of line caching.
13471         (write_text, text) Made static.
13472         (text) Added to font support, not finished.
13473
13474 Thu Aug 29 21:36:41 1996  Ben Pfaff  <blp@gnu.org>
13475
13476         * font.h: (struct font_desc) New members ascent, descent.
13477
13478         * groff-font.c: (groff_read_font) Calculates font ascent and
13479         descent from the ascent and descent of the `d' and `p' characters,
13480         respectively, as per a suggestion on comp.fonts.
13481
13482         * postscript.c: (ps_open_page, ps_close_page, ps_line_horz,
13483         ps_line_vert, ps_line_intersection) Rewritten to deal with changed
13484         prologue.
13485         (write_text) Handles text right-justification and centering (not
13486         full justification).  Still very inefficient.  (One output line
13487         per character?!)
13488         (struct output_char) Added fields for font and font size.
13489         (text) Many bugfixes.
13490
13491 Sat Aug 24 23:26:00 1996  Ben Pfaff  <blp@gnu.org>
13492
13493         * cmdline.c: (usage) Calls outp_list_classes().
13494
13495         * font.h: Comment fix.
13496
13497         * groff-font.c: New exported global var `space_index'.
13498         (groff_init) New function to initialize `space_index'.
13499         (hash_kern) Casts result to unsigned.
13500         (font_name_to_index) Renamed font_char_name_to_index.  All
13501         references changed.  Also, now returns the value of `space_index'
13502         when passed an ASCII space character as an argument.  Fixed
13503         handling of nulls.
13504         (font_get_kern_adjust) Changed i from `int' to `unsigned'.
13505         Handles passed NULL pointers properly.
13506
13507         * lexer.c: (parse_tagged_quote) Comment fix.  Better range
13508         checking.
13509
13510         * output.c: (outp_list_drivers) Removed.  Removed all references.
13511         
13512         * output.h: Comment fixes.
13513
13514         * postscript.c: (ps_open_global) Calls groff_init().
13515         (output_char) New structure.
13516         (write_text) New function.
13517         (text) No longer stubbed out!  Now the output is correct--with a
13518         few exceptions, one of them being that the page has to be held
13519         upside down into a mirror.
13520
13521 Sun Aug 11 21:31:22 1996  Ben Pfaff  <blp@gnu.org>
13522
13523         * font.h: Comment fix.
13524         
13525         * font.c: (name_to_index) Renamed font_name_to_index, made extern.
13526         All callers changed.
13527         (number_to_index) Renamed font_number_to_index, made extern.  All
13528         callers changed.
13529         (font_get_kern_adjust, font_get_char_metrics) New functions.
13530
13531         * output.h: New constant OUTP_T_INTERNAL_DRAW.
13532
13533         * postscript.c: Changed default line width back to 1/2 point.
13534         (ps_line_horz, ps_line_vert, ps_line_intersection) Now lines are
13535         in the center of the space allotted for them, not just a fixed
13536         offset from the edge of the space; this fixes some bugs.
13537         (ps_line_intersection) Now supports all command line styles.
13538         (ps_text_get_size) Bug fix in computation of em width.
13539         (text) New function, the meat behind ps_text_metrics and
13540         ps_text_draw.  Not complete.
13541         (ps_text_metrics, ps_text_draw) Removed the stub taken from
13542         ascii.c; call text().
13543
13544 Sat Aug 10 23:28:17 1996  Ben Pfaff  <blp@gnu.org>
13545
13546         * arena.c: (arena_free) Assert that the argument is non-NULL.
13547         
13548         * groff-font.c: (add_kern) Calls arena_free() for old_kern if and
13549         only if old_kern is non-NULL.
13550
13551         * postscript.c: (ps_init_driver) Changed default line width to 1
13552         point.
13553         (postopen) New prologue variables.
13554         (ps_line_horz, ps_line_vert, ps_line_intersection) Implements some
13555         more of the common line styles properly, but not all.
13556         (ps_text_metrics) Fixed problem with this stubbed out version that
13557         kept it from taking font sizes into account.
13558
13559 Thu Aug  8 22:31:11 1996  Ben Pfaff  <blp@gnu.org>
13560
13561         * arena.c: (arena_malloc) Bug fix.
13562         (arena_dump) [GLOBAL_DEBUGGING] New function.
13563
13564         * ascii.c: Comment fix.
13565         (count_fancy_chars, delineate) Now static functions.
13566         
13567         * filename.c: (interp_vars) Bug fixes.
13568
13569         * font.h: Comment fixes.
13570
13571         * glob.c: (init_glob) Sets set_viewwidth, set_viewlength at
13572         beginning in case we have an error message to display before
13573         initializing the display.
13574
13575         * groff-font.c: Comment fix.  Changed rehash threshold from 2/3
13576         full to 1/2 full.
13577         (groff_read_font) Bug fixes.
13578         (name_to_index) Increments hash.used.  Sets `name' field of hash
13579         entry properly.
13580         (add_kern) Sets kern_max_used after rehashing.  Other bug fixes.
13581
13582         * hash.c: Return type changed.
13583
13584         * postscript.c: Continued development.  Now marks lines on the
13585         paper, but very buggy.
13586
13587 Sat Aug  3 20:50:35 1996  Ben Pfaff  <blp@gnu.org>
13588
13589         * Changed comments in many source files from `/* xxx /* yyy */' to
13590         `/* xxx */ /* yyy */' for cleanliness.
13591
13592         * arena.c: (arena_sd_strdup) New function.
13593         
13594         * ascii.c: (struct ascii_driver_ext) New member `file'.
13595         (ascii_init_driver) Fills out member `file' for initing; uses
13596         close_file_ext for closing drivers.
13597         (ascii_option) Changed %.*s back to %s because the a_string's are
13598         always null-terminated.
13599         (postopen, preclose) New functions.
13600         (ascii_open_page) Uses new style of open_file_ext.
13601         (ascii_option, commit_line_buf, output_lines) Use ext->file.file
13602         instead of this->output.
13603         (__assert_fail) Removed.
13604
13605         * cmdline.c: Changed syntax_message[].
13606
13607         * error.c: #include's <readline/history.h> only if the history
13608         library is available, not if just the readline library is
13609         available.
13610
13611         * filename.c: (expand_line) Removed alloca() support.
13612         (interp_vars) No longer tilde-expands argument.  Limit on output
13613         length removed.
13614         (tilde_expand) Now treats argument as path rather than filename.
13615         [!unix] Now is a no-op function.
13616         (search_path) Better verbose message formatting.
13617         (open_file, close_file) Comment fixes.
13618         (close_file) [!unix] Doesn't bother with pipes.
13619         (open_file_ext) Completely rewritten, interface revamped.
13620         (close_file_ext) New function.
13621
13622         * font.h: Comment changes.
13623
13624         * frequencies.q: Removed AIX alloca support since it doesn't use
13625         alloca.
13626
13627         * hash.c: Comment changes & additions.
13628         (hsh_create) Initializes entire table instead of first M entries.
13629         (hsh_probe) Stupid bug fixed.  Now it works.
13630         (hsh_dump) [GLOBAL_DEBUGGING] New function.
13631
13632         * main.c: (parse) Detects EOF properly in token-eating loop.
13633         Should the STOP token have its value changed to 0?
13634
13635         * misc.c: (blp_getdelim) [HAVE_GETDELIM] Now it's a macro.
13636         (blp_getline) Now it's a macro.
13637
13638         * output.h: (struct outp_driver) Removed members output, filename.
13639         
13640         * output.c: (outp_init) [!NO_POSTSCRIPT] Installs PostScript
13641         drivers in driver table.
13642         (outp_read_devices) Frees buf.  Warns if there are no active
13643         output drivers.
13644         (outp_configure_clear) Sets outp_configure_vec to NULL after
13645         deleting its elements.
13646         (configure_driver, destroy_driver) Removed references to output,
13647         filename members of outp_driver.
13648         (outp_evaluate_dimension, internal_get_paper_size,
13649         outp_get_paper_size) New functions.
13650
13651         * postscript.c: Continued development.  Now links but doesn't make
13652         any marks on the page.  Lotsa bugs I suppose.
13653
13654         * str.c: (strcasecmp) [!HAVE_STRCASECMP] New function.
13655
13656         * str.h: Comment changes.
13657
13658 Sat Jul 27 22:32:38 1996  Ben Pfaff  <blp@gnu.org>
13659
13660         * Removed dependencies on non-nested comments in several files.
13661         Also removed references to (unix || __unix__) in #if's since
13662         prefh.orig makes those two equivalent.
13663         
13664         * ascii.c: (ascii_open_global) Creates ascii_arena.
13665         (ascii_close_global) Destroys ascii_arena.
13666         (ascii_init_driver) Doesn't create ascii_arena.
13667         (ascii_copy_driver) Removed.
13668         (ascii_option) Possible bugfix regarding %s vs. %.*s with a_string's.
13669         (outp_class ascii_class) Removed ascii_copy_driver reference.
13670
13671         * frequencies.q: Now can display all statistics except median.
13672         Still not finished.
13673
13674         * output.c: Handles outp_class.ref_count so output class
13675         destructors are called properly.
13676         (add_class) Sets ref_count to 0.
13677         (configure_driver) Initializes class if ref_count++ is 0.
13678         (destroy_driver) Destructs class if --ref_count is 0.  Frees the
13679         class output file name.
13680         
13681         * output.h: (struct outp_class) Removed copy_driver, inited.
13682         Added ref_count.
13683
13684         * postscript.c: Completely replaced but not finished.
13685         
13686 Tue Jul 23 21:48:36 1996  Ben Pfaff  <blp@gnu.org>
13687
13688         * approx.h: #includes <float.h>.
13689
13690         * arena.h, arena.c: Many functions changed to take an arena **
13691         instead of an arena *, for consistency.  All callers changed.
13692         (arena_alloc) Now creates a new arena if passed *A that is NULL.
13693         (arena_destroy) Sets *A to NULL.
13694         
13695         * ascii.c: (delineate) Implements OUTP_T_VERT correctly.  Removed
13696         assertion that `width' be positive.
13697
13698         * command.c: Removed #if's from cmd_table.
13699         (walk_cmdtable_func) [0] New function (debug code).
13700         (init_cmd_parser) [0] Dumps out cmd_table (debug code).
13701         (parse_cmd) Doesn't return failure for unimplemented commands.
13702
13703         * common.h: (SYSMIS) Changed from DBL_MAX to -DBL_MAX.
13704         (SYSCODE) New constant macro.
13705
13706         * descript.q: Checks for positive n_variables before performing
13707         analysis.
13708
13709         * file-handle.q: (get_handle_by_filename) Bug fix: passes &f to
13710         avl_find instead of &fp as arg 2.
13711
13712         * frequencies.g, frequencies.q: Continued updating; now compiles &
13713         works again, but not complete.
13714
13715         * main.c: Changes to user messages.
13716
13717         * misc.c: (reverse) [0] New function.
13718
13719         * settings.h: Comment removed.  #includes "common.h".
13720
13721         * som.c: (som_set_null) New function.
13722         (som_set_value, som_set_string, som_set_text) More detailing
13723         assertions.
13724         (som_set_float) Implemented function.
13725         (dump_columnated_table) Bug fix regarding page breaks.
13726         (draw_cell) Bug fix regarding text that spilled out of a cell.
13727         (draw_intersection, draw_horz_rule, draw_vert_rule) No longer draw
13728         null lines.
13729         (get_cell_size) Support SCON_EMPTY cells.
13730         (get_table_size) When calculating rules' widths and heights, mask
13731         out SLIN_SPACING bit.  Added SOPT_X_HLTL support.
13732         
13733         * som.h: (som_any_cell) New option SOPT_X_HTLT.  Removed
13734         SOPT_X_SHADE.
13735         (struct som_submission_form) New member `header'; all users
13736         changed.
13737
13738         * val-labs.c: (get_label) User messages changed.
13739
13740         * var.h: Changed FREQUENCIES structures.
13741
13742         * vars-atr.c: (is_num_user_missing, is_str_user_missing) Made
13743         inline.
13744         
13745 Fri Jul 19 19:11:13 1996  Ben Pfaff  <blp@gnu.org>
13746
13747         * approx.h: Definition of EPSILON now depends on system's
13748         DBL_EPSILON.  Removed GNU C specific code.
13749         (cmpapx) Renamed approx_compare.
13750
13751         * frequencies.g, frequencies.q: Continued updating; still doesn't
13752         compile.
13753
13754         * groff-font.c: (name_to_index) Fix bug that kept it from
13755         compiling.
13756
13757         * hash.c, hash.h: Completed work.
13758
13759         * var.h: Changes to freq_tab, frequencies_proc.
13760         
13761 Wed Jul 17 21:23:36 1996  Ben Pfaff  <blp@gnu.org>
13762
13763         New hashing code.
13764         * hash.c, hash.h: New files.  Not completed.
13765         * Makefile.am: Added hash.c to source file list.
13766         * font.h: (struct font_desc) New member kern_size_p.
13767         * groff-font.c: Uses hash.h.
13768         (hashpjw) Moved to hash.c.
13769         (next_prime_power) Rewrote, renamed hsh_next_prime, moved to
13770         hash.c.
13771         (static var hash) New member size_p.
13772         * var.h: Includes hash.h.
13773         (struct freq_tab) Changed AVL_TREE to hash_tab.
13774
13775         * vars-prs.c: Comment, formatting fixes.
13776
13777         * frequencies.g, frequencies.q: Continued updating.  Not yet
13778         working.
13779
13780         * formats.c: Bug fix.
13781
13782 Tue Jul 16 22:10:04 1996  Ben Pfaff  <blp@gnu.org>
13783
13784         Increasing parallelism between DESCRIPTIVES and FREQUENCIES.
13785         * descript.g: Comment fixes.
13786         * descript.q: Comment fixes.  Moved some declarations into var.h.
13787         Made dsc_info a static table.  Updated FIXMEs.
13788         (internal_cmd_descriptives) Beautified.
13789         
13790         * frequencies.q: Started updating into working order.
13791         * frequencies.g: New file analogous to descript.g.
13792         * var.h: Comment fixes.  Added structures for FREQUENCIES.
13793         
13794         * som.c: Removed vestiges of crushing and partial table support.
13795
13796 Sun Jul 14 15:45:31 1996  Ben Pfaff  <blp@gnu.org>
13797
13798         * Many more changes to som.c especially, but these will not be
13799         documented as I have resolved to remove them.  This patchlevel is
13800         being released solely so that I can fall back to it if I decide
13801         that removing the changes is not a good idea.
13802
13803 Sat Jul 13 09:58:44 1996  Ben Pfaff  <blp@gnu.org>
13804
13805         * som.c: (global var som) New member `cum_y'.
13806         (build_target) Properly handles titles for partial tables.
13807         (dump_partial_beg, dump_partial_mid, dump_partial_end)
13808         Merged into single new function dump_partial().  Fixed problem
13809         with titles on partial tables.
13810         (dump_table) Calls dump_partial() for all parts of partial tables.
13811         (dump_page) Criteria for drawing title changed.
13812         
13813 Fri Jul 12 22:03:36 1996  Ben Pfaff  <blp@gnu.org>
13814
13815         * command.c: (cmd_table) Added LIST, WEIGHT.
13816
13817         * command.c: (cmd_remark) No longer frees `s' since it's not
13818         dynamically allocated.
13819         
13820         * data-out.c: (convert_f) Now correctly handles the case where
13821         abs(v->f)<1 but v->f rounds to a value of 1.00 given the specified
13822         number of decimals.
13823         (som_destroy_all_tables) Removed argument.  All callers changed.
13824         (som_vline, som_hline) Argument validity checking corrected.
13825         (som_set_value) Implemented half-heartedly.
13826         (replicate_table) Copies tables piece-by-piece when using Checker.
13827
13828         * som.h: New line style SLIN_1THIN, currently equivalent to
13829         SLIN_0.  New enum set SOM_SUB_*.
13830         (struct som_submission_form) Removed `seq_no'.  Added `type'.
13831         
13832         * list.q: Newly working file; uses partial tables.
13833         
13834         * som.c: (som_reduce_table) Renamed som_set_table_height().
13835         (som_crush) Removed argument `group'.
13836         (global var som) Removed `nt', `seq_no'.  Added `type'.
13837         (som_submit_table) Arguments changed.
13838         (output_table) Removed partial table code.
13839         (build_target) New arg; partial table support added.  All callers
13840         changed.
13841         (dump_plain_table) Removed partial table code.
13842         (dump_partial_beg, dump_partial_mid, dump_partial_end) New functions.
13843         (dump_table) Supports partial tables.
13844         (dump_page) New argument to allow not drawing top and/or bottom
13845         headers.  All callers changed.  Supports partial tables.
13846
13847 Sat Jul  6 22:22:25 1996  Ben Pfaff  <blp@gnu.org>
13848
13849         * data-out.c: Changed `#include <approx.h>' to `#include
13850         "approx.h".
13851         (convert_F) Comment fix.  Now won't print `-.000', etc.
13852
13853         * descript.q: Now Z-scores work, although there appears to
13854         be a bug (which might actually be in data-out.c:convert_F()).
13855         (descriptives_trns_proc, descriptives_trns_free) New functions.
13856         (run_z_pass) Implemented.
13857         
13858         * var.h: Comment fixes.
13859         (dsc_z_score, descriptives_trns) New structs.
13860         (descriptives_trns) Added to any_trns as `dsc'.
13861
13862         * error.c, error.h: New error class, IS (Installation Script
13863         error), used in those instances where the error is in the
13864         installation, but there is a script file or installation file that
13865         can be usefully referred to.
13866         
13867         * output.c: Change many IE classes to IS classes.
13868
13869         * cases.c, command.c, common.c, crosstabs.q, expr-evl.c,
13870         frequencies.q, list.q, vars-prs.c, vfm.c: Removed reference to
13871         HAVE_MALLOC_H because Borland C++ alloca() is broken, so why
13872         include the corresponding header?
13873         
13874         * glob.c: (init_glob) Don't malloc term_buffer under Checker.
13875         Don't bail out if termcap can't be read.
13876
13877         * som.c: (som_destroy_table) Removed.
13878         (som_reduce_table, som_destroy_all_tables) New functions.
13879         (som_crush) New function, not implemented.
13880         
13881         * som.h: New table option STAB_CRUSH.  Comment fix.  New struct
13882         som_submission_form.  Function prototypes revised.
13883
13884         Outputting huge tables (1000s of rows) a few rows at a time
13885         is supported, though untested.  May even break everything.
13886         Actually, the code doesn't even compile right now.
13887         * som.c: (struct som) New fields htv, nt, seq_no.
13888         (som_submit_table) Multiple arguments changed to a single
13889         pointer to struct submission_form.  Only increments subtable_num
13890         if seq_no is zero.  Only destroys table if it's not going to
13891         be reused.
13892         (replicate_table) New function.
13893         (output_table) Comment fix.
13894         (examine_table) Changed inline code to code calling
13895         replicate_table().  Calculates htv.  Supports partial tables.
13896         (draw_title) Removed comment.
13897         (build_target) Only allows for title on first part of partial
13898         tables.
13899         (dump_plain_table) Only resets table chunk number on first part
13900         of partial tables; FIXME: doesn't work quite right.  Supports
13901         partial tables.
13902         (dump_page) Titles only on first part of partial tables.
13903
13904 Fri Jul  5 20:16:19 1996  Ben Pfaff  <blp@gnu.org>
13905
13906         * Thanks to an unreliable IDE hard drive, I have spent the last
13907         day reconstructing my Debian GNU/Linux installation and redoing
13908         the previous day's changes--somehow I managed to save every file
13909         except for output.c and output.h.  So the following changes could
13910         really be considered independent of the output.c, output.h changes
13911         from Jul 4.
13912
13913         * output.h, output.c: Moved the outp_configure_vec global var,
13914         outp_names struct, and enum set OUTP_S_* from output.h to output.c.
13915         outp_configure_vec is now static.
13916         
13917 Thu Jul  4 20:20:24 1996  Ben Pfaff  <blp@gnu.org>
13918
13919         * The entire philosophy behind configuration of the output drivers
13920         changed.  Now there is a termcap-type configuration where drivers
13921         to be read are determined beforehand, rather than parsing the
13922         entire output init file and storing it in memory & deciding what
13923         to actually use later.  Faster & more memory-efficient at the same
13924         time, cool.
13925         
13926         * output.c: Comment fix.  Removed outp_init_drivers global var.
13927         Removed all references to synonyms.  New structure outp_defn.  New
13928         global vars outp_macros, outp_configure_vec.
13929         (search_name, delete_name, add_name, check_configure_vec,
13930         expand_name, find_defn_value) New static functions.
13931         (outp_configure_clear, outp_configure_add, outp_configure_macro,
13932         outp_read_devices) New extern functions.
13933         (outp_init) Much functionality moved into outp_read_devices.
13934         (outp_read_devices) Format of output init file changed; name of
13935         file is `devices' rather than `output' to avoid Makefile
13936         conflicts.
13937         (outp_clear) Renamed outp_done.
13938         (outp_list_classes) Bug fix, cleaned up.
13939         (outp_list_drivers) Not implemented anymore.
13940         (outp_configure_driver) Now a static function; simplified; now
13941         interpolates macros; supports new structure.
13942         (outp_enable_driver, match_synonym) Removed; all references
13943         removed.
13944         (find_driver) First argument removed.
13945         
13946         * output.h: Global var outp_init_drivers removed; new structure
13947         outp_names; new enum set OUTP_S_*; new global var
13948         outp_configure_vec; function prototypes for output.c exports
13949         updated.
13950         
13951         * main.c: (main) Calls outp_read_devices() after parsing the
13952         command line.
13953         
13954         * cmdline.c: (parse_command_line) New option -v --verbose;
13955         --version changed to -V.  --device option changed syntax to just
13956         take a single device name.  Accepts key=value declaration of
13957         output init file macros.  Syntax message updated.
13958
13959         * filename.c: (expand_line) New function.
13960         (interp_environ_vars) Renamed interp_vars; no longer uses
13961         fixed-size buffer.
13962         (blp_getenv) Allows $ARCH and $VER pseudo-environment-vars to be
13963         overridden by real environment vars.
13964         (search_path) Uses verbose_msg() instead of #ifdef'd printf().
13965         * filename.h: interp_environ_vars() renamed interp_vars().
13966         
13967         * error.c, error.h: Added extern variable `verbosity', message
13968         class MM.
13969         
13970         * error.c: (vmsg) Support message class MM.
13971         (verbose_msg) New function.
13972
13973         * descript.q: (generate_z_varname) Bug fix in generation of
13974         Z-score varnames.
13975         (dump_z_table) Bug fix in column headers.
13976         
13977         * ascii.c: (ascii_init_driver) Changed minimum number of lines per
13978         page from 29 to 15.  Don't set a default for ops[OPS_INIT,
13979         OPS_DONE].  Writes the uninit string when the driver is closed.
13980         (ascii_open_page) Write the init string before the first page.
13981         (output_shorts) Form of main loop changed from `while' to `for'.
13982         Bug fix with overstrikes: the character is printed *after* the
13983         backspace.  Eliminated a lot of `& 0xff' modifiers.
13984         (advance_to_left_margin) New function.
13985         (return_carriage, output_lines) Handle left margin.
13986
13987 Thu Jul  4 00:35:59 1996  Ben Pfaff  <blp@gnu.org>
13988
13989         * ascii.c: New option `carriage-return-style'.
13990
13991         * ascii.c: (count_fancy_chars) New function.
13992         (delineate, text_metrics) Use new function; bug fixes regarding
13993         rich text strings.
13994         (text_draw) Bug fix with rich text.
13995         (output_string, output_shorts) Reordered.
13996         (output_shorts) Now handles boxchars and some overstrike font
13997         changes.
13998         (output_char, return_carriage) New functions.
13999         (output_lines) Now handles overstriking and font changes properly;
14000         some code moved to output_shorts.
14001
14002 Tue Jul  2 22:13:23 1996  Ben Pfaff  <blp@gnu.org>
14003
14004         [GLOBAL_DEBUGGING]
14005         * ascii.c: New member `debug' in ascii_driver_ext.
14006         (ascii_init_driver, delineate) Uses new member.
14007
14008         Now you can set a vertical height on writing text.
14009         * ascii.c: (delineate) Keeps track of vertical position.
14010         (text_draw) No longer considers fully justified text an internal
14011         error.
14012         
14013         * output.h: New flag OUTP_T_VERT; other OUTP_T_ values changed.
14014
14015         Tables' titles are drawn; they can have variable height.
14016         * som.c: `som' struct has new member, title_height.
14017         (draw_title) New argument.  Moved within file.  All caller
14018         changed.
14019         (build_target) New argument, amount of space needed for first row.
14020         Calculates height of title, takes that into account.  All callers
14021         changed.
14022         (dump_plain_table, dump_columnated_table) Took calculation of y1,
14023         y2 out of loop.
14024         (dump_columnated_table) [GLOBAL_DEBUGGING] Debugging code
14025         improved.
14026         (dump_columnated_table) Organized for readability.
14027         (dump_page) Makes use of som.title_height.
14028
14029         * som.c: Many comment bug fixes.
14030
14031         * descript.q: (try_name, generate_z_name) Bug fix regarding
14032         generation of Z-score variable names.
14033         * var.h: Removed num from descriptives_proc; all referents removed.
14034
14035 Mon Jul  1 22:13:39 1996  Ben Pfaff  <blp@gnu.org>
14036
14037         * ascii.c: (ascii_line_horz, ascii_line_vert,
14038         ascii_line_intersection) Added debugging code.
14039
14040         Added a descriptive line above each table to describe it.
14041         * command.c: (parse_cmd) Calls som_new_series.
14042         
14043         * som.c: New static vars table_num, subtable_num.  New `som'
14044         member `title'.
14045         (dump_page) New arguments.
14046         (som_submit_table) Handle new variables.
14047         
14048         * som.c, som.h: (som_submit_table) New arguments.  All callers
14049         changed.
14050         (som_new_series) New function.
14051         (build_target) Makes room for extra line.
14052         (draw_title) New function.
14053         (dump_page) Calls draw_title.  Bug fix: doesn't always set
14054         som.ext->cp to 0.
14055         
14056         Columnation of tables support.
14057         * som.h: Deleted fr, lr, ri from som_table.  Reorganized.
14058         
14059         * som.c: Deleted references to fr, lr, ri.
14060         (som_columnate) Bux fix: sets group member of table.
14061         (som_add_options) Function removed.
14062         (dump_table) Split into three functions; extensively reworked.
14063         
14064         * descript.q: (dump_z_table) Better output table formatting; added
14065         title support to correspond to som.h changes.
14066         (display) Title support.
14067
14068         * output.h: Added OUTP_T_NONE.
14069         
14070 Mon Jul  1 13:00:00 1996  Ben Pfaff  <blp@gnu.org>
14071
14072         * descript.q: Improved handling of Z scores; still not perfect.
14073         
14074         * output.h, ascii.c: Added hook for getting em width of current
14075         font.
14076         
14077         * som.c: Uses new em-width hook.  Added debugging code to
14078         several functions.
14079         (som_columnate) New argument.
14080         (som_add_options) Removed.
14081
14082 Jun 29 17:40:47 1996  Ben Pfaff  <blp@gnu.org>
14083
14084         * som.h, som.c, output.c, output.h, ascii.c: Updated to work with
14085         rules as a property of the table instead of as a property of the
14086         cells.
14087         
14088         * ascii.c: Added `header' to table of options.
14089         
14090         * descript.q: Added even shorter statistic names; modified to work
14091         with new som interface.
14092         
14093         * misc.c (blp_getdelim): Bug fix.
14094         
14095         * version.c: includes 'conf.h'.
14096         
14097 ----------------------------------------------------------------------
14098 Local Variables:
14099 mode: change-log
14100 version-control: never
14101 End: