Fix DESCRIPTIVES memory leak.
[pspp-builds.git] / src / ChangeLog
1 Tue Mar 30 22:01:57 2004  Ben Pfaff  <blp@gnu.org>
2
3         * descript.c: (cmd_descriptives) Free `vars' to avoid memory leak.
4
5 Mon Mar 29 16:26:40 2004  Ben Pfaff  <blp@gnu.org>
6
7         * debug.c: Removed.  Moved cmd_debug_evaluate() into expr-evl.c.
8
9         * expr-evl.c: (cmd_debug_evaluate) Moved here from debug.c.
10
11 Mon Mar 29 16:03:08 2004  Ben Pfaff  <blp@gnu.org>
12
13         * algorithm.c: By default turn off some of the more expensive
14         assertions.
15         (expensive_assert) New macro which expands to assert if
16         EXTRA_CHECKS is defined, to nothing otherwise.
17         (unique) Use expensive_assert().
18         (binary_search) Ditto.
19         (push_heap) Ditto.
20         (pop_heap) Ditto.
21         (make_heap) Ditto.
22         (sort_heap) Ditto.
23
24         * command.c: (conflicting_3char_prefixes) Words that are the same
25         don't cause conflicts when they are abbreviated to the first three
26         letters.
27
28         * expr-evl.c: (CONCAT_func) Fix memory leak by incrementing struct
29         nonterm_node's n earlier.
30         (generic_str_func) Ditto.
31         
32 Mon Mar 29 15:32:17 2004  Ben Pfaff  <blp@gnu.org>
33
34         Add support for multipass procedures.  Rewrite DESCRIPTIVES to
35         test multipass support, take advantage of new moments
36         calculation, and to not be such crappy code.  Get rid of q2c
37         processing for DESCRIPTIVES.
38
39         * vfm.c: (struct multipass_split_aux_data) New structure.
40         (multipass_procedure_with_splits) New function.
41         (multipass_split_callback) New function.
42         (multipass_split_output) New function.
43         * descript.q: Removed.
44
45         * descript.c: New file.
46
47         * var.h: Removed descriptives enums.
48         (struct descriptives_proc) Removed.
49         (struct variable) Removed p.dsc.
50
51         * Makefile.am: (q_sources_c) Remove descript.c.
52         (q_sources_q) Removed descript.q.
53         
54 Mon Mar 29 15:31:55 2004  Ben Pfaff  <blp@gnu.org>
55
56         New manager for keeping track of used workspace.
57         
58         * workspace.c: New file.
59
60         * workspace.h: New file.
61
62         * Makefile.am: (pspp_SOURCES) Add workspace.c, workspace.h.
63
64         * sort.c: (do_internal_sort) Use workspace_malloc().
65         (destroy_internal_sort) Use workspace_free().
66
67 Mon Mar 29 15:31:08 2004  Ben Pfaff  <blp@gnu.org>
68
69         New `struct casefile' for managing sets of cases.
70
71         * casefile.c: New file.
72
73         * casefile.h: New file.
74
75         * command.def: Add DEBUG CASEFILE command.
76
77         * Makefile.am: (pspp_SOURCES) Add casefile.c, casefile.h.
78
79         * sort.c: (sort_cases) Move logic for sending storage file to disk
80         into do_external_sort().
81         (struct internal_sort) Use an array of ccase pointers instead of a
82         case_list.
83         (do_internal_sort) Rewrite to handle casefiles.
84         (compare_case_list) Removed.
85         (compare_cases) New function.
86         (compare_case_dblptrs) New function.
87         (read_internal_sort_output) Deal with new struct internal_sort.
88
89         * vfm.c: (static var workspace_overflow) Removed.
90         (struct storage_stream_info) Removed all the members.  Added
91         struct casefile * member.
92         (storage_sink_open) Use casefile.
93         (open_storage_file) Removed.
94         (write_storage_file) Removed.
95         (storage_to_disk) Removed.
96         (destroy_storage_stream_info) Use casefile.
97         (storage_sink_write) Use casefile.
98         (storage_sink_make_source) Use casefile.
99         (storage_source_count) Use casefile.
100         (storage_source_read) Use casefile.
101         (storage_source_on_disk) Removed.
102         (storage_source_get_cases) Removed.
103         (storage_source_set_cases) Removed.
104         (storage_source_get_casefile) New function.
105         
106 Mon Mar 29 15:30:09 2004  Ben Pfaff  <blp@gnu.org>
107
108         New `struct moments' for calculating moments.
109
110         * stats.c: Removed.
111
112         * stats.h: Removed.
113
114         * moments.c: New file.
115
116         * moments.h: New file.
117
118         * command.def: Add DEBUG MOMENTS command.
119
120         * Makefile.am: (pspp_SOURCES) Add moments.c, moments.h.  Remove
121         stats.c, stats.h.
122
123         * aggregate.c: Modify AGGREGATE to use the new moments
124         calculation, even if not in such a great way.
125         (struct agr_var) Add `moments' member.
126         (parse_aggregate_functions) Set `moments' member to null.
127         (agr_destroy) Destroy `moments' member.
128         (accumulate_aggregate_info) Use `moments' for standard deviation.
129         (dump_aggregate_info) Ditto.
130         (initialize_aggregate_info) Create or clear `moments'.
131
132         * misc.h: Add pow2(), pow3(), pow4() functions in place of sqr(),
133         cube(), pow4() that were in stats.h.  All references updated.
134
135         * crosstabs.q: stats.h had chi-square significance functions.  Use
136         GSL instead.
137         (display_chisq) Use gsl_cdf_chisq_Q() instead of chisq_sig().
138
139         * expr-evl.c: (expr_evaluate) Use moments_of_values() for
140         OP_CFVAR, OP_MEAN, OP_SD, OP_VARIANCE.
141                 
142 Fri Mar 26 14:21:23 2004  Ben Pfaff  <blp@gnu.org>
143
144         * dictionary.c: (dict_compact_values) Compacted values need to
145         start off from 0.
146
147 Fri Mar 26 00:54:57 2004  Ben Pfaff  <blp@gnu.org>
148
149         * var-labs.c: (cmd_variable_labels) For compatibility, don't allow
150         `/' at start.  Check return value of parse_variables() for error
151         return.
152
153 Fri Mar 26 00:19:27 2004  Ben Pfaff  <blp@gnu.org>
154
155         Revamp expressions: make the code a little nicer, and fix bugs
156         found in testing.
157         
158         * expr-evl.c: (expr_evaluate) Make expression argument const.
159         Support OP_ADD, OP_SUB, OP_MUL, OP_DIV instead of OP_PLUS, OP_MUL.
160         OP_POW is missing for arg 2 <= 0.  OP_LOG is natural log, not
161         base-10 log.  Fix OP_ANY, OP_ANY_STRING, OP_RANGE, OP_RANGE_STRING
162         off-by-ones.  Add OP_MAX_STRING, OP_MIN_STRING.  Fix OP_TIME_HMS,
163         OP_DATE_WKYR boundary conditions.  Add OP_CTIME_DAYS,
164         OP_CTIME_HOURS, OP_CTIME_MINUTES, OP_CTIME_DAYS, OP_CTIME_SECONDS.
165         Support OP_INDEX_2, OP_INDEX_3, OP_RINDEX_2, OP_RINDEX_3 instead
166         of OP_INDEX, OP_INDEX_OPT, OP_RINDEX, OP_RINDEX_OPT.  Merge
167         OP_LPAD_OPT into OP_LPAD, OP_RPAD_OPT into OP_RPAD, OP_LTRIM_OPT
168         into OP_LTRIM, OP_RTRIM_OPT into OP_RTRIM, OP_NUMBER_OPT into
169         OP_NUMBER.  Fix OP_RTRIM fragility.  Support OP_SUBSTR_2,
170         OP_SUBSTR_3 instead of OP_SUBSTR, OP_SUBSTR_OPT.  Remove OP_INV.
171         Simplify OP_SYSMIS.  Remove OP_STR_MIS.
172
173         * expr-opt.c: (optimize_expression) Rewrite.
174         (macro n0) Removed.
175         (macro n1) Removed.
176         (macro n2) Removed.
177         (macro s0) Removed.
178         (macro s0l) Removed.
179         (macro s1) Removed.
180         (macro s1l) Removed.
181         (macro s2) Removed.
182         (macro s2l) Removed.
183         (macro s) Removed.
184         (macro sl) Removed.
185         (eq_num_con) New function.
186         (optimize_tree) New function.
187         (macro rnc) Removed.
188         (macro frnc) Removed.
189         (str_search) Add const to string params.
190         (str_rsearch) Ditto.
191         (evaluate_tree_no_missing) Renamed from evaluate_tree.  Add num[],
192         str[], str_len[] locals to substitute for most of removed macros.
193         Support OP_ADD, OP_SUB, OP_MUL, OP_DIV instead of OP_PLUS, OP_MUL.
194         Removed support for missing values because we're never called with
195         missing values.  Use set_number() or set_number_errno() instead of
196         rnc or frnc.  Removed any stuff that caused trouble in testing.
197         We can re-add it later if it really slows anything.  Fix some
198         random problems.
199         (evaluate_tree_with_missing) Not yet supported.  To be added later
200         if it's important.
201         (repl_num_con) Removed.
202         (collapse_node) New function.
203         (force_repl_num_con) Removed.
204         (set_number) New function.
205         (set_number_errno) New function.
206         (repl_str_con) Removed.
207         (set_string) New function.
208         (yrmoda) Tighten boundary conditions.  Adopt 2030 cut-off for
209         2-digit years.
210         (dump_node) No special case for OP_AND, OP_OR.
211
212         * expr-prs.c: (expr_prs) Honor EXPR_NO_OPTIMIZE bit.  Rewrite.
213         (expr_get_type) New function.
214         (type_check) Rewrite.
215         (type_coercion) New function.
216         (struct operator) New structure.
217         (match_operator New function.
218         (parse_binary_operators) New function.
219         (parse_inverting_unary_operator) New function.
220         (parse_or) Rewritten.
221         (parse_and) Rewritten.
222         (parse_not) Rewritten.
223         (parse_rel) Rewritten.
224         (parse_add) Rewritten.
225         (parse_mul) Rewritten.
226         (parse_neg) Rewritten.
227         (parse_exp) Rewritten.
228         (parse_sysvar) Add $TRUE, $FALSE system variables.
229         Get $LENGTH, $WIDTH from get_viewlength(), get_viewwidth().
230         (parse_primary) Use allocate_var_node(), allocate_num_con(),
231         allocate_str_con().
232         (struct function) Remove desc, change `func' prototype.
233         (unary_func) Remove special cases.
234         (MISSING_func) Reduce to unary_func() that just returns a boolean.
235         (SYSMIS_func) Handle SYSMIS((x)) like SYSMIS(x).
236         (VALUE_func) Use allocate_var_node().
237         (nary_num_func) Allow MIN and MAX for strings.
238         Use allocate_var_node().  Properly clean up.
239         Fix return type.
240         (generic_str_func) Use local table instead of removed `desc'
241         member.  Mostly rewrite.
242         (get_num_args) Revise error message.
243         (parse_function) Return EXPR_ERROR, not 0 on error.
244         (macro op) Removed.
245         (macro varies) Removed.
246         (ops[]) Use expr.def.
247         (free_node) Do nothing if node is null.
248         (allocate_num_con) New function.
249         (allocate_str_con) New function.
250         (allocate_var_node) New function.
251         (allocate_binary_nonterminal) New function.
252         (append_nonterminal_arg) Removed.
253         (static var func_tab[]) Revised.
254         (expr_debug_print_postfix) Make parameter const.
255         Use printf() instead of debug_printf().
256
257         * expr.def: New file.
258         
259         * expr.h: Change PXP_* to EXPR_*, all references updated.  Also
260         use named enum instead of unnamed, all references updated.  Add
261         EXPR_ANY, EXPR_NO_OPTIMIZE.
262
263         * exprP.h: Remove EX_*.  Add DEFINE_OPERATOR.  Use expr.def
264         instead of defining OP_* directly.
265         (macro IS_TERMINAL) New macro.
266         (macro IS_NONTERMINAL) New macro.
267         (enum OP_NO_FLAGS) New.
268         
269 Fri Mar 26 00:18:01 2004  Ben Pfaff  <blp@gnu.org>
270
271         * error.c: (err_assert_fail) msg variable needs to be non-const.
272
273 Fri Mar 26 00:17:24 2004  Ben Pfaff  <blp@gnu.org>
274
275         * debug.c: (cmd_debug_evaluate) Rewrite.
276
277 Fri Mar 26 00:15:13 2004  Ben Pfaff  <blp@gnu.org>
278
279         Fix some CROSSTABS bit rot stupidity.
280
281         * crosstabs.q: Reorder the CELLS subcommands for compatibility.
282         (internal_cmd_crosstabs) Initializes cells[] correctly.
283         (float_M_suffix) Rename format_cell_entry(), change prototype,
284         rewrite.
285         (display_crosstabulation) Fix cell formatting.
286
287 Fri Mar 26 00:14:09 2004  Ben Pfaff  <blp@gnu.org>
288
289         Make lex_rest_of_line(), lex_entire_end() not discard lines.  Have
290         to call lex_discard_line() to do that.
291
292         * command.c: (run_command) Call lex_discard_line() after
293         lex_rest_of_line().
294
295         * lexer.c: (lex_entire_end) Change behavior.
296         (lex_rest_of_line) Change behavior.  Return const char *.
297         (lex_discard_line) Don't clear getl_buf, don't emit message.
298
299         * main.c: (handle_error) Emit message here.
300
301         * repeat.c: (internal_cmd_do_repeat) Use lex_discard_line()
302         instead of lex_entire_line().
303
304         * str.c: (mm_find_reverse) Make length params size_t.  Rewrite.
305
306         * title.c: (get_title) Call lex_discard_line() after
307         lex_rest_of_line().
308         (cmd_file_label) Ditto.
309         (cmd_document) Deal with const char * return value.
310
311 Fri Mar 26 00:10:16 2004  Ben Pfaff  <blp@gnu.org>
312
313         Removed REMARK command.
314
315         * command.c: (extract_prefix) Removed.
316         (output_line) Removed.
317         (cmd_remark) Removed.
318
319         * command.def: Remove REMARK.
320
321 Fri Mar 26 00:08:38 2004  Ben Pfaff  <blp@gnu.org>
322
323         Added abort() after lots of assert(0) invocations to avoid some
324         compiler warnings.  We really need a NOT_REACHED macro.
325
326 Tue Mar 23 08:00:42 WAST 2004 John Darrington <john@darrington.wattle.id.au>
327
328         * sort.c: Added missing call to temp_file_close.  Changed error 
329         messages to warnings.
330
331         * set.q: Improved setting of set_view{length,width} to be more tolerant
332         of buggy OSes.
333
334 Sun Mar 21 10:11:14 WST 2004 John Darrington <john@darrington.wattle.id.au>
335
336         * val-labs.c: Fixed a bug where PSPP would crash, if VALUE LABELS was
337         used with incorrect syntax.
338
339         * error.c, error.h et al:  Overridden definition of assert for a
340         custom one.
341
342         * test-q.c: Fixed a buglet where it would crash if no /VARIABLES
343         subcommand was given when it ought to have been.
344
345 Sat Mar 20 22:19:08 2004  Ben Pfaff  <blp@gnu.org>
346
347         * tab.c: (tab_vline) Fix assertions to respect row_ofs and
348         col_ofs.
349         (tab_hline) Ditto.
350         (tab_box) Ditto.
351         (tab_joint_text) Ditto.
352
353 Sat Mar 20 17:57:23 2004  Ben Pfaff  <blp@gnu.org>
354
355         * levene.c: Add #include.
356
357         * set.q: (set_viewport) Add `int' argument to make its prototype
358         correct for signal().
359
360 Sat Mar 20 15:35:17 2004  Ben Pfaff  <blp@gnu.org>
361
362         * expr-evl.c: (expr_evaluate) Assert that `c' is nonzero before
363         using it.
364
365 Sat Mar 20 15:18:16 2004  Ben Pfaff  <blp@gnu.org>
366
367         Changed DFM from open-at-first-access to explicit-open.  Before,
368         calling dfm_get_record() or dfm_put_record() would automatically
369         open the file.  Now, you have to call dfm_open_for_reading() or
370         dfm_open_for_writing() explicitly.  This makes it possible to
371         check permissions, file existence, etc. earlier.
372
373         Also made struct file_handle more opaque, and clean up in general.
374
375         * data-list.c: (cmd_data_list) Open handle for reading.
376
377         * dfm.c: (struct dfm_fhuser_ext) Add `where', `saw_begin_data'
378         members.
379         (open_file_r) Renamed dfm_open_for_reading(), rewrote.
380         (open_file_w) Renamed dfm_open_for_writing(), rewrote.
381         (open_inline_file) Removed.
382         (read_record) For inline_file, if we haven't seen BEGIN DATA, read
383         it.  Deal with line_number in extension record instead of file
384         handle.
385         (dfm_get_record) Rewrote.
386         (dfm_put_record) Rewrote.
387         (dfm_push) Assert file is open and one of ours.  Deal with
388         line_number in extension record instead of file handle.
389         (dfm_pop) Assert file is open and one of ours.  Deal with
390         line_number in extension record instead of file handle.
391         (cmd_begin_data) Use dfm_open_for_reading().  Mark that we saw
392         BEGIN DATA.     
393
394         * file-handle.h: (enum constants RH_RF_*) Removed.
395         (enum constants FH_MD_*) Removed.
396         (struct file_handle) Removed `name', `norm_fn', `fn', `where',
397         `recform', `lrecl', `mode' members.  Public references to
398         `recform' changed to use handle_get_mode(), references to `lrecl'
399         changed to use handle_get_record_width().  Added `private' member.
400         (enum file_handle_mode) New.
401
402         * file-handle.q: (struct private_file_handle) New structure.
403         (struct file_handle_list) New structure.
404         (static var files) New.
405         (static var file_handles) Removed.
406         (init_file_handle) Removed.
407         (create_file_handle) Removed.
408         (get_handle_with_name) New function.
409         (get_handle_for_filename) New function.
410         (cmd_file_handle) Rewritten.
411         (hash_file_handle) Removed.
412         (cmp_file_handle) Removed.
413         (fh_init_files) Rewritten.
414         (fh_parse_file_handle) Rewritten.  Allows identifiers as
415         filenames.
416         (fh_get_handle_by_name) Renamed handle_get_name(), all references
417         updated.  Rewritten.
418         (fh_get_handle_by_filename) Renamed handle_get_filename(), all
419         references updated.  Rewritten.
420         (fh_record_width) Renamed handle_get_record_width(), all
421         references updated.  Rewritten.
422         (handle_get_mode) New function.
423
424         * file-type.c: (cmd_file_type) Open handle for reading.
425
426         * filename.c: [unix] (struct file_identity) New structure.
427         [unix] (fn_get_identity) New function.
428         [unix] (fn_free_identity) New function.
429         [unix] (fn_compare_file_identities) New function.
430         [!unix] (struct file_identity) New structure.
431         [!unix] (fn_get_identity) New function.
432         [!unix] (fn_free_identity) New function.
433         [!unix] (fn_compare_file_identities) New function.
434
435         * lexer.c: (static var put) Renamed put_token, all references
436         updated.
437         (static var put_tokstr) New.
438         (static var put_tokval) New.
439         (lex_init) Initialize put_tokstr().
440         (restore_token) New function.
441         (save_token) New function.
442         (lex_get) Use restore_token().
443         (lex_put_back) Use save_token().
444         (lex_put_back_id) New function.
445         (lex_put_forward) Removed.
446         (lex_preprocess_line) Set put_token instead of using
447         lex_put_forward().
448         (lex_negative_to_dash) Use save_token(), set put_token directly.
449         (dump_token) Use stderr instead of stdout.
450
451         * main.c: (main) Remove call to cmd_init().
452         
453         * matrix-data.c: (cmd_matrix_data) Open file for reading.
454
455         * pfm-read.c: Use handle_get_filename() instead of trying to use
456         h->fn directly, all over.
457
458         * pfm-write.c: Ditto.
459
460         * print.c: (internal_cmd_print) Open handle for writing.
461         (dump_table) Use handle_get_filename().
462         (print_trns_proc) Use handle_get_mode().
463         (cmd_print_space) Use fh_parse_file_handle().
464         Open handle for writing.
465         [0] (debug_print) Removed.
466
467         * sfm-read.c: Use handle_get_filename() instead of trying to use
468         h->fn directly, all over.
469
470         * sfm-write.c: Ditto.
471
472 Sat Mar 20 14:35:48 2004  Ben Pfaff  <blp@gnu.org>
473
474         Fix memory leaks.
475         
476         * autorecode.c: (arc_free) Free arc->src_values.
477
478         * error.c: (msg) Free buf.
479
480         * val-labs.c: (do_value_labels) Always free vars.
481
482         * vfm.c: (close_active_file) If sink has no make_source then call
483         its destroy function.
484
485 Sat Mar 20 14:00:24 2004  Ben Pfaff  <blp@gnu.org>
486
487         Fixed cmd_parse() so that it always skips past a full command
488         name.  A few special commands for which this would be bad get
489         special treatment.  This lets us drop code for skipping past the
490         end of a command name in most cmd_*() functions.  It's not worth
491         listing all the commands affected.
492
493         * command.c: (struct command) Remove `cmd' member, replace by
494         `name' member, all references updated.  Remove `word', `next',
495         `skip_entire_name' members.
496         (macro DEFCMD) Deal with revised `struct command'.
497         (macro UNIMPL) Ditto.
498         (macro SPCCMD) New macro for commands whose last word shouldn't be
499         skipped.
500         (static array cmd_table[]) Make const, rename `commands', remove
501         sentinel element.
502         (macro COMMAND_CNT) New macro.
503         (split_words) Removed.
504         (cmd_init) Removed.
505         (FILE_TYPE_okay) Make parameter const.
506         (cmd_parse) Improve error messages.
507         (match_strings) New function.
508         (next_word) New function.
509         (enum command_match) New enum.
510         (conflicting_3char_prefixes) New function.
511         (conflicting_3char_prefix_command) New function.
512         (cmd_match_words) New function.
513         (count_matching_commands) New function.
514         (get_command_name) New function.
515         (free_words) New function.
516         (unknown_command_error) New function.
517         (figure_out_command) Renamed parse_command_name(), rewritten.
518
519         * command.def: Removed @ command.  Marked BEGIN DATA, DOCUMENT,
520         FILE LABEL, REMARK, SUBTITLE, TITLE as special.  Renamed EVALUATE
521         to DEBUG EVALUATE.  Added N alias for N OF CASES, SORT alias for
522         SORT CASES.
523
524         * command.h: (macro SPCCMD) New.
525
526         * include.c: (cmd_include_at) Removed.
527         (cmd_include) Allow identifier to be used as filename.
528
529         * inpt-pgm.c: (cmd_reread) Use fh_parse_file_handle().
530
531         * t-test.q: (cmd_t_test) Command name is now parsed for us.
532         
533
534 Sat Mar 20 13:56:00 2004  Ben Pfaff  <blp@gnu.org>
535
536         Start work on better test framework.
537         
538         * Makefile.am: (pspp_sources) Add debug.c.
539         
540         * debug.c: New file.
541
542         * compute.c: (cmd_evaluate) Moved to debug.c, renamed
543         cmd_debug_evaluate().
544
545         * expr-prs.c: (expr_parse) Remove PXP_DUMP support.
546
547         * expr.h: (enum constant PXP_DUMP) Removed.
548
549 Sat Mar 20 00:05:42 WST 2004 John Darrington <john@darrington.wattle.id.au>
550
551         * set.q:  Implemented the SHOW command, and synced it to the existing 
552         SET cmd.
553
554         Added a handler for SIGWINCH so that viewlength and viewwidth follow
555         changes as the window size is changed.
556
557         Added fallback to set viewlength and viewwidth from LINES and COLUMS
558         environment variables if other methods are not available.
559
560         glob.c: Removed a lot of global variables from glob.c and encapsulated 
561         them in set.q
562
563         random.c: Tidied up the way the random seed is set.
564
565         str.c: Added a ds_vprintf function.
566
567         error.c: Extended dump_message so that messages are always broken at
568         '\n' characters.
569         
570 Thu Mar 18 11:07:14 2004  Ben Pfaff  <blp@gnu.org>
571
572         * pfm-write.c: (bufwrite) Write out the correct element for string
573         variables.  From Andreas Streichardt <streichardt@globalpark.de>.
574
575 Mon Mar 15 20:48:03 2004  Ben Pfaff  <blp@gnu.org>
576
577         Get rid of static and global (!) vars in matrix-data.c.
578
579         * matrix-data.c: (static var nr_data) Removed.
580         (static var nr_factor_values) Removed.
581         (static var max_cell_index) Removed.
582         (static var split_values) Removed.
583         (struct nr_aux_data) New structure.
584         (read_matrices_without_rowtype) Use a local struct nr_aux_data in
585         place of static vars, pass to create_case_source() and procedure()
586         as aux data.
587         (nr_read_data_lines) Use struct nr_aux_data * parameter instead of
588         struct matrix_data_pgm *.
589         (nr_read_splits) Ditto.
590         (nr_read_factors) Ditto.
591         (nr_output_data) Ditto.
592         (static var wr_content) Removed.
593         (global var wr_data) Removed.
594         (global var wr_current) Removed.
595         (struct wr_aux_data) New structure.
596         (read_matrices_with_rowtype) Use a local struct wr_aux_data in
597         place of static vars, pass to create_case_source() and procedure()
598         as aux data.
599         (matrix_data_read_with_rowtype) Use struct wr_aux_data * parameter
600         instead of matrix_data_pgm *.
601         (wr_read_splits) Ditto.
602         (wr_output_data) Ditto.
603         (wr_read_rowtype) Ditto.
604         (wr_read_factors) Ditto.
605         (wr_read_indeps) Ditto.
606         
607 Mon Mar 15 20:07:29 2004  Ben Pfaff  <blp@gnu.org>
608
609         Get rid of static vars in autorecode.c.
610
611         * autorecode.c: (struct autorecode_trns) Rename `arc' to `specs',
612         `n_arc' to `spec_cnt'.  All references updated.
613         (static var v_src) Removed.
614         (static var v_dest) Removed.
615         (static var h_trns) Removed.
616         (static var nv_src) Removed.
617         (static var descend) Removed.
618         (static var print) Removed.
619         (enum direction) New enum.
620         (struct autorecode_pgm) New structure.
621         (cmd_autorecode) Use struct autorecode_pgm instead of static vars.
622         Move n_dest local var into struct autorecode_pgm for ease of
623         clean-up.  Use arc_free().
624         (arc_free) New function.
625         (recode) Modify to take struct autorecode_pgm * parameter instead
626         of using statics.  Let the caller clean up.
627         (autorecode_proc_func) Use struct autorecode_pgm * auxiliary data
628         instead of statics.  Rearrange code a little.
629
630 Mon Mar 15 00:25:02 2004  Ben Pfaff  <blp@gnu.org>
631
632         Get rid of static, global vars in recode.c.  Remove debug code.
633
634         * recode.c: (static var head) Removed.
635         (global var v) Removed.
636         (global var nv) Removed.
637         (cmd_recode) New local variables head, v, nv.  Initialize and free
638         v.  Don't call debug_print().
639         [DEBUGGING] (dump_dest) Removed.
640         [DEBUGGING] (debug_print) Removed.
641
642 Mon Mar 15 00:14:49 2004  Ben Pfaff  <blp@gnu.org>
643
644         Get rid of static vars in expr-opt.c.
645
646         * expr-opt.c: (static var e) Removed.
647         (static var nop) Removed.
648         (static var mop) Removed.
649         (static var ndbl) Removed.
650         (static var mdbl) Removed.
651         (static var nstr) Removed.
652         (static var mstr) Removed.
653         (static var nvars) Removed.
654         (static var mvars) Removed.
655         (struct expr_dump_state) New structure.
656         (dump_expression) Use new struct expr_dump_state instead of static
657         vars and pass to functions we call.
658         (dump_node) Use struct expr_dump_state * parameter.
659         (emit) Ditto.
660         (emit_num_con) Ditto.
661         (emit_str_con) Ditto.
662         (emit_var) Ditto.
663         
664 Mon Mar 15 00:03:51 2004  Ben Pfaff  <blp@gnu.org>
665
666         Get rid of static var in COUNT.
667
668         * count.c: (static var head) Move into cmd_count().
669         (cmd_count) [DEBUGGING] Don't call debug_print.
670         [DEBUGGING] (debug_print) Removed.
671
672 Sun Mar 14 23:56:09 2004  Ben Pfaff  <blp@gnu.org>
673
674         Get rid of static vars in VALUE LABELS, ADD VALUE LABELS.
675
676         * val-labs.c: (static var v) Removed.
677         (static var nv) Removed.
678         [DEBUGGING] (debug_print) Removed.
679         (verify_val_labs) Add struct variable **, int parameters.
680         (get_label) Ditto.  Improve error messages, streamline.
681         (erase_labels) New function for erasing value labels, taking over
682         part of verify_val_labs()'s function.
683         (init) Removed.
684         (done) Removed.
685         (cmd_value_labels) No need to call init() or done() anymore.
686         (cmd_add_value_labels) Ditto.
687         (do_value_labels) Add vars, var_cnt local variables.  Clean up
688         after them internally.  Call erase_labels() if we should.  Don't
689         call debug_print().
690
691 Sun Mar 14 23:33:53 2004  Ben Pfaff  <blp@gnu.org>
692
693         Get rid of static vars in MATCH FILES.
694         
695         * get.c: (static var mtf_head) Removed.
696         (static var mtf_tail) Removed.
697         (static var mtf_by) Removed.
698         (static var mtf_n_by) Removed.
699         (static var mtf_master) Removed.
700         (static var mtf_seq_num) Removed.
701         (static var mtf_seq_nums) Removed.
702         (static var mtf_sink) Removed.
703         (static var mtf_case) Removed.
704         (struct mtf_proc) New structure.
705         (cmd_match_files) Use struct mtf_proc instead of static vars.
706         (mtf_processing_finish) Ditto.
707         (mtf_free) Ditto.
708         (mtf_delete_file_in_place) Ditto.
709         (mtf_read_nonactive_records) Ditto.
710         (mtf_compare_BY_values) Ditto.
711         (mtf_processing) Ditto.
712         (mtf_merge_dictionary) Ditto.
713
714 Sun Mar 14 22:48:12 2004  Ben Pfaff  <blp@gnu.org>
715
716         * command.def: Add CASESTOVARS, VARSTOCASES unimplemented commands.
717
718         * dictionary.c: (dict_rename_var) Add assertion.
719         (dict_contains_var) Check by index instead of name.
720
721 Sun Mar 14 22:01:02 2004  Ben Pfaff  <blp@gnu.org>
722
723         Get rid of compaction_necessary, compaction_nval, compaction_case.
724         Redo VFM interface.  Replace disk_sink and memory_sink by
725         storage_sink, disk_source and memory_source by storage_source.
726
727         * vfm.h: (struct case_sink) Add `dict', `idx_to_fv', `value_cnt'
728         members.
729
730         * vfm.c: 
731         (struct write_case_data) Remove `begin_func', `end_func',
732         `func_aux' members.  Add `aux', `trns_case', `sink_case',
733         `cases_written', `cases_analyzed' members.
734         (global var compaction_necessary) Make static.
735         (global var compaction_nval) Removed.
736         (global var compaction_case) Removed.
737         (static var case_count) Removed.
738         (struct procedure_aux_data) Removed.
739         (struct split_aux_data) Removed.
740         (procedure) Remove begin_func, end_func parameters.  Rewrite.
741         (static var not_canceled) Removed.
742         (process_active_file) Removed.
743         (process_active_file_write_case) Removed.
744         (process_active_file_output_case) Removed.
745         (prepare_for_writing) Moved into open_active_file().
746         (arrange_compaction) Ditto.
747         (setup_lag) Ditto.
748         (open_active_file) Rewrote.
749         (write_case) New function.
750         [DEBUGGING] (index_to_varname) Removed.
751         (execute_transformations) New function.
752         (exclude_this_case) Renamed filter_case(), changed interface.
753         (clear_case) Added struct ccase * parameter to interface.
754         (close_active_file) Added struct write_case_data * parameter,
755         rewrote.
756         (disk_sink_create) Removed.
757         (disk_sink_destroy) Removed.
758         (disk_sink_make_source) Removed.
759         (disk_sink_write) Removed.
760         (disk_source_count) Removed.
761         (disk_source_destroy) Removed.
762         (disk_source_read) Removed.
763         (global var disk_sink_class) Removed.
764         (global var disk_source_class) Removed.
765         (global var memory_sink_class) Removed.
766         (global var memory_source_class) Removed.
767         (memory_sink_create) Removed.
768         (memory_sink_destroy) Removed.
769         (memory_sink_make_source) Removed.
770         (memory_sink_write) Removed.
771         (memory_source_count) Removed.
772         (memory_source_destroy) Removed.
773         (memory_source_get_cases) Removed.
774         (memory_source_read) Removed.
775         (memory_source_set_cases) Removed.
776         (struct disk_stream_info) Removed.
777         (struct memory_sink_info) Removed.
778         (struct memory_source_info) Removed.
779         (write_active_file_to_disk) Removed.
780         (destroy_storage_stream_info) New function.
781         (global var null_sink_class) New var.
782         (global var storage_sink_class) New var.
783         (global var storage_source_class) New var.
784         (open_storage_file) New function.
785         (storage_sink_destroy) New function.
786         (storage_sink_make_source) New function.
787         (storage_sink_open) New function.
788         (storage_sink_write) New function.
789         (storage_source_count) New function.
790         (storage_source_destroy) New function.
791         (storage_source_get_cases) New function.
792         (storage_source_on_disk) New function.
793         (storage_source_read) New function.
794         (storage_source_set_cases) New function.
795         (storage_source_to_disk) New function.
796         (storage_to_disk) New function.
797         (struct storage_stream_info) New structure.
798         (write_storage_file) New function.
799         (procedure_write_case) Removed.
800         (create_case_source) Add `struct dictionary *' parameter, all
801         references updated.
802         (create_case_sink) Ditto.
803         (free_case_sink) New function.
804         (struct split_aux_data) New structure.
805         (procedure_with_splits) New function implementing what procedure()
806         used to.
807         (SPLIT_FILE_proc_func) Removed.
808         (procedure_with_splits_callback) New function.
809         (equal_splits) New function.
810         
811         * aggregate.c: Pass around a struct instead of using statics.
812         (static var outfile) Remove.
813         (enum type) Give it tag `missing_treatment'.
814         (static var missing) Remove.
815         (static var sort) Remove.
816         (static var agr_first) Remove.
817         (static var agr_next) Remove.
818         (static var case_count) Remove.
819         (static var prev_case) Remove.
820         (static var buf64_1xx) Remove.
821         (static var buf_1xx) Remove.
822         (struct agr_proc) New structure incorporating the above.
823         (cmd_aggregate) Use new struct.  Clean up error handling using
824         agr_destroy().  Completely rewrite actual implementation of
825         aggregation.
826         (create_sysfile) Add struct agr_proc * parameter, modify
827         accordingly.
828         (parse_aggregate_functions) Ditto.
829         (free_aggregate_functions) Ditto.  Rename agr_destroy().
830         (aggregate_single_case) Add struct agr_proc * parameter, modify
831         accordingly.
832         (accumulate_aggregate_info) Ditto.
833         (dump_aggregate_info) Ditto.
834         (initialize_aggregate_info) Ditto.
835         (agr_00x_trns_proc) Removed.
836         (agr_00x_end_func) Removed.
837         (agr_10x_trns_proc) Removed.
838         (agr_10x_trns_free) Removed.
839         (agr_10x_end_func) Removed.
840         (agr_11x_read) Removed.
841         (agr_11x_finish) Removed.
842         [DEBUGGING] (debug_print) Removed.
843         (write_case_to_sfm) Add struct agr_proc * parameter, modify
844         accordingly.
845         (agr_to_active_file) New function.
846         (presorted_agr_to_sysfile) New function.
847         (sort_agr_to_sysfile) New function.
848
849         * autorecode.c: (cmd_autorecode) Use procedure_with_splits().
850
851         * crosstabs.q: (internal_cmd_crosstabs) Ditto.
852
853         * descript.q: (cmd_descriptives) Ditto.
854
855         * dfm.c: (cmd_begin_data) Check for storage_source_class.  Adapt
856         to new procedure() interface.
857
858         * command.c: (cmd_execute) Adapt to new procedure() interface.
859
860         * dictionary.c: (dict_compact_values) Also delete scratch
861         variables.
862         (dict_get_compacted_value_cnt) New function.
863         (dict_get_compacted_idx_to_fv) New function.
864
865         * flip.c: (cmd_flip) Warn about and cancel TEMPORARY.
866         (cmd_flip) Adapt to new procedure() interface.
867         (flip_sink_write) Use sink->idx_to_fv.
868
869         * frequencies.q: (internal_cmd_frequencies) Use
870         procedure_with_splits().
871
872         * get.c: (cmd_save_internal) Adapt to new procedure() interface.
873         (static var mtf_sink) New static var.
874         (static var mtf_case) New static var.
875         (cmd_match_files) Warn about and cancel TEMPORARY.  Redo the way
876         we actually implement the matching.
877         (mtf_delete_file_in_place) Use mtf_case.
878         (mtf_processing) Use mtf_case and mtf_sink.
879         (cmd_export) Adapt to new procedure() interface.
880
881         * levene.c: (levene) Use procedure_with_splits().
882
883         * list.q: (cmd_list) Use procedure_with_splits().
884
885         * matrix-data.c: (read_matrices_without_rowtype) Adapt to new
886         procedure() interface.
887         (read_matrices_with_rowtype) Ditto.
888
889         * modify-vars.c; (cmd_modify_vars) Warn about and cancel
890         TEMPORARY.  Adapt to new procedure() interface.
891
892         * rename-vars.c: Warn about and cancel TEMPORARY.
893
894         * sort.c: (cmd_sort_cases) Warn about TEMPORARY.
895         (sort_cases) Use dict_get_compacted_value_cnt() instead of
896         compaction_nval.  Adapt to new procedure() interface.  Use
897         storage_source_to_disk().
898         (do_internal_sort) Don't try to dump the cases to memory.
899         (compare_case_lists) Pass null idx_to_fv.
900         (struct initial_run_state) Add `idx_to_fv' member.  Remove
901         `case_size' member.
902         (write_initial_runs) Don't initialize irs->case_size.  Adapt to
903         new procedure() interface.  Reset irs->idx_to_fv after calling
904         procedure().
905         (sort_sink_write) Set irs->idx_to_fv.  Use case_size from struct
906         sort_cases_pgm.  Pass irs, not struct sort_cases_pgm to
907         push_heap().
908         (destroy_initial_run_state) Don't dereference irs after freeing
909         it.
910         (allocate_cases) Don't calculate case_size locally.
911         (compare_record) Add idx_to_fv parameter.
912         (compare_record_run) Change parameter from struct sort_cases_pgm *
913         to struct initial_run_state *.  Pass irs->idx_to_fv to
914         compare_record().
915         (compare_record_run) Third parameter now a struct
916         initial_run_state *.
917         (output_record) No need for out_case anymore.  Pass irs, not
918         struct sort_cases_pgm to pop_heap().  Use case_size from struct
919         sort_cases_pgm.
920         (merge) Use case_size from struct sort_cases_pgm.
921         (merge_once) Use case_size from struct sort_cases_pgm.
922         Pass null pointer to compare_record() as idx_to_fv.
923         (global var sort_sink_class) Make static.
924
925         * t-test.q: (cmd_t_test) Use procedure_with_splits().
926
927         * temporary.c: Remove debugging crap.
928
929 Sat Mar 13 14:19:52 WST 2004 John Darrington <john@darrington.wattle.id.au>
930
931         * t-test.q, levene.c: Fixed up the handling of MISSING values
932         int the T-TEST
933
934 Fri Mar 12 16:23:35 WST 2004 John Darrington <john@darrington.wattle.id.au>
935
936         * t-test.q, levene.c: Added support for T-TEST /GROUP where only 
937         one value is given.
938
939 Wed Mar 10 23:25:13 2004  Ben Pfaff  <blp@gnu.org>
940
941         Change explicit variable name checks into use of
942         dict_class_from_id().
943
944         * dictionary.c: (dict_create_var)  Change explicit variable name
945         check into use of dict_class_from_id().
946
947         * get.c: (trim_dictionary) Ditto.
948
949         * sel-if.c: (cmd_filter) Ditto.
950
951         * sysfile-info.c: (cmd_display) Ditto.
952
953         * vars-prs.c: (parse_DATA_LIST_vars) Ditto.
954
955         * vfm.c: (arrange_compaction) Ditto.
956
957         * weight.c: (cmd_weight) Ditto.
958
959 Wed Mar 10 21:16:34 2004  Ben Pfaff  <blp@gnu.org>
960
961         * temporary.c: (cmd_temporary) When TEMPORARY was the first
962         transformation following the input program, if any, for some
963         reason we special-cased f_trns.  That's just wrong.  It should
964         always be set to n_trns.
965
966 Tue Mar  9 23:44:40 2004  Ben Pfaff  <blp@gnu.org>
967
968         * format.c: (parse_format_specifier_name) Fix brown-bag bug
969         introduced in last check-in.
970
971 Tue Mar  9 23:10:41 2004  Ben Pfaff  <blp@gnu.org>
972
973         * format.c: (global array translate_fmt[]) Removed.
974         (translate_fmt) New function as replacement.
975         (parse_format_specifier_name) Rewrite.
976
977         * pfm-read.c: (convert_format) Use translate_fmt() instead of
978         translate_fmt[].
979
980         * sfm-read.c: (parse_format_spec) Ditto.
981
982         * postscript.c: (text) Fix handling of fonts with missing
983         ligatures.
984
985         * sort.c: (struct external_sort) Add temp_name member.
986         (destroy_external_sort) Free temp_dir, temp_name members.
987         (init_external_sort) Allocate temp_name.
988         (get_temp_file_name) Change prototype.
989         (open_temp_file) Deal with change to get_temp_file_name().
990         (close_temp_file) Ditto.
991         (remove_temp_file) Ditto.
992         (write_temp_file) Ditto.
993         (read_temp_file) Ditto.
994         (sort_sink_destroy) Removed.
995         (sort_sink_class) Change destroy member to null.
996
997 Tue Mar  9 22:36:34 2004  Ben Pfaff  <blp@gnu.org>
998
999         Eliminate temp_case.
1000
1001         * aggregate.c: (cmd_aggregate) No need to save/restore temp_case
1002         anymore.  Use agr_11x_finish().
1003         (aggregate_single_case) Make first param const.
1004         (accumulate_aggregate_info) Ditto.
1005         (agr_00x_end_func) Use compaction_case, not temp_case.
1006         (agr_11x_func) Break into agr_11x_read(), agr_11x_finish().
1007
1008         * data-list.c: (struct data_list_pgm) Add `case_size' member.
1009         (cmd_data_list) Initialize case_size.
1010         (read_from_data_list_fixed) Add struct ccase * param, use instead
1011         of temp_case.
1012         (read_from_data_list_free) Ditto.
1013         (read_from_data_list_list) Ditto.
1014         (read_one_case) Rename data_list_trns_proc(), all references
1015         updated.  Add argument in calling above functions.  Use c
1016         argument instead of temp_case.
1017         (destroy_dls) Rename data_list_trns_free(), all references
1018         updated.
1019
1020         * expr-evl.c: (expr_evaluate) Make second parameter const.
1021
1022         * file-type.c: (struct file_type_pgm) Add `case_size' member.
1023         (cmd_end_file_type) Initialize `case_size'.
1024         (file_type_source_read) Add struct ccase * parameter.  Use instead
1025         of temp_case.
1026
1027         * flip.c: Rewritten.
1028
1029         * get.c: (struct get_pgm) New structure to keep track of
1030         case_size.
1031         (cmd_get) Initialize case_size.
1032         (cmd_import) Ditto.
1033         (get_source) Deal with struct get_pgm.
1034         (get_source_read) Add struct ccase * parameter, use instead of
1035         temp_case.
1036         (import_source_read) Ditto.
1037
1038         * get.c: Use a null pointer instead of temp_case to represent the
1039         "current case" in a struct mtf_file's input member.
1040         (mtf_processing_finish) Pass null to mtf_processing(), not
1041         temp_case.
1042         (mtf_read_nonactive_records) Don't set iter->input to temp_case.
1043         (mtf_compare_BY_values) Add extra arg, use instead of null input
1044         members.
1045         (mtf_processing) Use c parameter instead of temp_case.  Pass
1046         compaction_case to process_active_file_output_case().
1047         
1048         * glob.c: (global variable temp_case) Removed.
1049
1050         * inpt-pgm.c: (struct input_program_pgm) Add `case_size' member.
1051         (cmd_input_program) Initialize case_size.  Set
1052         vfm_source->value_cnt.
1053         (init_case) Add struct ccase * parameter, use instead of
1054         temp_case.
1055         (clear_case) Ditto.
1056         (input_program_source_read) Ditto.
1057
1058         * matrix-data.c: (matrix_data_read_without_rowtype) Ditto.
1059         (dump_cell_content) Ditto.
1060         (nr_output_data) Ditto.
1061         (read_matrices_without_rowtype) Ditto.
1062         (matrix_data_read_with_rowtype) Ditto.
1063         (wr_read_splits) Ditto.
1064         (wr_output_data) Ditto.
1065
1066         * sort.h: (struct sort_cases_pgm) New member `case_size'.
1067         
1068         * sort.c: (sort_cases) Initialize scp->case_size.
1069         (struct external_sort) Remove `case_size' member.
1070         (write_initial_runs) Only call vfm_sink->class_destroy if
1071         non-null.
1072         (struct sort_source_aux) New structure.
1073         (sort_source_read_helper) New function.
1074         (sort_source_read) Use sort_source_read_helper().
1075         (read_sort_output) Change interface to be more reasonable.
1076         (read_internal_sort_output) Ditto.
1077         (read_external_sort_output) Ditto.
1078
1079         * vars-prs.c: (dict_class_to_name) Pass return value through
1080         gettext.
1081
1082         * vfm.c: (struct procedure_aux_data) Add `trns_case' member.
1083         (procedure) Initialize trns_case.
1084         (procedure) Pass trns_case to vfm_source->class->read().
1085         Free trns_case.
1086         (process_active_file) Start using struct procedure_aux_data.
1087         (process_active_file_write_case) Pass trns_case to
1088         transformations, lag_case(), clear_case().
1089         (process_active_file_output_case) Add struct ccase * parameter.
1090         (create_trns_case) New function.
1091         (make_temp_case) Removed.
1092         (vector_initialization) Removed.
1093         (close_active_file) Only call make_source if non-null, otherwise
1094         set vfm_source to null pointer.  Don't free temp_case.
1095         (disk_source_read) Add struct ccase * parameter, use instead of
1096         temp_case.
1097         (memory_source_read) Ditto.
1098         (lag_case) Add const struct ccase * member.
1099         (procedure_write_case) Use trns_case instead of temp_case.
1100         (clear_case) Add struct ccase * member, use instead of temp_case.
1101         (exclude_this_case) Ditto.
1102         (create_case_source) Add struct dictionary * parameter, use to
1103         initialize source->value_cnt.
1104
1105         * vfm.h: (struct case_source) Add `value_cnt' member.
1106         (struct case_source_class) Add struct ccase * parameter to `read'
1107         member function pointer.
1108         (struct case_sink_class) Make struct ccase * parameter const in
1109         `write' member function pointer.
1110         
1111 Wed Mar  3 20:44:37 2004  Ben Pfaff  <blp@gnu.org>
1112
1113         Fix a lot of "possibly uninitialized variable" warnings.  Some of
1114         them are even real bugs.  A few of them make me wonder how the
1115         code ever worked.
1116
1117         * aggregate.c: (parse_aggregate_functions) Initialize `function.
1118
1119         * ascii.c: (output_lines) Add default case to switch.
1120
1121         * crosstabs.q: Remove static variable `expected' and all
1122         references to it.
1123         (display_crosstabulation) Always calculate expected value.
1124         (calc_chisq) Ditto.
1125         (output_pivot_table) Initialize `cmp'.
1126         (display_crosstabulation) New variable `last_row', which is
1127         initialized.
1128
1129         * data-in.c: (parse_numeric) Always initialize sign.  How did this
1130         work at all?!
1131
1132         * data-list.c: (repeating_data_trns_proc) Always initialize code.
1133         Always set info.ofs.  (How did this work?!)
1134
1135         * expr-opt.c: (optimize_tree) Always initialize `m'.
1136         (evaluate_tree) Always initialize `c'.  (How did this work?)
1137
1138         * frequencies.q: (frq_custom_variables) Always initialize min,
1139         max.
1140         (frq_custom_grouped) Always initialize `dl'.
1141
1142         * groff-font.c: (groff_read_font) Always initialize char_set.
1143
1144         * matrix-data.c: (nr_output_data) Initialize `split'.
1145         (wr_read_splits) Remove shadowing split_cnt declaration.
1146         (wr_output_data) Initialize `split'.
1147
1148         * output.c: (tokener) Skip add character on syntax error.
1149
1150         * pool.c: (pool_strndup) Always set `copy'.  (How did this work?!)
1151
1152         * postscript.c: (read_ps_encodings) Use line.string instead of
1153         uninitialized `bp'.
1154         (write_text) Add default case to switch.
1155         (text) Always initialize multiple variables.  Fix bug with
1156         ligatures.
1157
1158         * print.c: (fixed_parse_fortran) Initialize head.
1159         (alloc_line) Add default case to switch.
1160
1161         * recode.c: (parse_dest_spec) Handle case where nothing matches.
1162         (recode_trns_proc) Move variable declaration inward.  Add default
1163         case to switch.
1164
1165         * sfm-read.c: (read_header) Initialize skip_amt.
1166
1167         * sysfile-info.c: (display_variables) Always initialize pc.
1168
1169         * vars-prs.c: Initialized `included'.
1170
1171 Wed Mar  3 09:30:09 2004  Ben Pfaff  <blp@gnu.org>
1172
1173         * main.c: (main) sigaction()'s sa_flags member was uninitialized.
1174         Just use signal() instead.
1175
1176 Wed Mar  3 09:26:30 2004  Ben Pfaff  <blp@gnu.org>
1177
1178         Get rid of vfm_sink_info and vfm_source_info.
1179         
1180         * aggregate.c: (agr_00x_end_func) Don't increment
1181         sfm_sink_info.ncases.
1182
1183         * sort.c: (do_internal_sort) Get case count from
1184         vfm_source->class->count().
1185         (struct external_sort) Add `case_size' member.
1186         (do_external_sort) Initialize case_size.
1187         (struct initial_run_state) Add `case_size' member.
1188         (write_initial_runs) Initialize case_size.
1189         (sort_sink_write) Use case_size.
1190         (read_external_sort_output) Use case_size.  Get case_cnt from
1191         initial_runs.
1192
1193         * vfm.c: (struct write_case_data) Add underscores to existing arg
1194         names, all references updated.  Renamed `aux' as `func_aux', all
1195         references updated.  Added new `aux' member.
1196         (global var vfm_source_info) Removed.
1197         (global var vfm_sink_info) Removed.
1198         (struct procedure_aux_data) New.
1199         (struct split_aux_data) New.
1200         (procedure) Use `aux' fields for procedure_aux_data,
1201         split_aux_data.
1202         (process_active_file_write_case) Pass case_count + 1 to
1203         transformation procedures, exclude_this_case().
1204         (process_active_file_output_case) Don't increment
1205         vfm_sink_info.ncases.
1206         (prepare_for_writing) Don't initialize vfm_sink_info.  Don't try
1207         to send data to disk early.
1208         (make_temp_case) Don't use vfm_sink_info.case_size.
1209         (close_active_file) Don't initialize vfm_source_info.
1210         (struct disk_stream_info) New, to allow for case_cnt and case_size fields.
1211         (disk_sink_create) Initialize and/or update disk_stream_info.
1212         (disk_sink_write) Ditto.
1213         (disk_sink_destroy) Ditto.
1214         (disk_sink_make_source) Ditto.
1215         (disk_source_read) Ditto.
1216         (disk_source_destroy) Ditto.
1217         (global var disk_source_class) Add disk_source_count().
1218         (disk_source_count) New function.
1219         (struct memory_sink_info) Add `case_cnt', `case_size' members.
1220         (struct memory_source_info) Ditto.
1221         (memory_sink_create) Deal with case_cnt, case_size.
1222         (memory_sink_write) Ditto.
1223         (memory_sink_make_source) Ditto.
1224         (memory_source_read) Ditto.
1225         (memory_source_count) New function.
1226         (memory_source_class) Add memory_source_count().
1227         (procedure_write_case) Don't use vfm_sink_info.ncases.  Do use
1228         proc_aux->cases_written, and pass it to transformation procedures
1229         and exclude_this_case ().
1230         (exclude_this_case) Add case_num parameter.  Pass it to
1231         expr_evaluate().
1232         (SPLIT_FILE_procfunc) Use split_aux->prev_case instead of static
1233         variable.
1234
1235         * vfm.h: (struct case_source_class) Add `count' member.
1236
1237         * vfmP.h: (struct stream_info) Removed.
1238         (global variable vfm_source_info) Removed.
1239         (global variable vfm_sink_info) Removed.
1240         
1241 Tue Mar  2 23:38:17 2004  Ben Pfaff  <blp@gnu.org>
1242
1243         * var.h: (typedef trns_proc_func) New typedef.
1244         (trns_free_func) New typedef.
1245         (struct trns_header) Change `proc' to type trns_proc_func, `free'
1246         to type trns_free_func.  This only changes the actual type of
1247         trns_proc_func, adding a `case_num' parameter.  Updated all
1248         implementations to use the typedefs instead.
1249
1250         * compute.c: (compute_num) Pass case_num to expr_evaluate().
1251         (compute_num_vec) Ditto.
1252         (compute_str) Ditto.
1253         (compute_str_vec) Ditto.
1254
1255         * do-if.c: (do_if_trns_proc) Ditto.
1256
1257         * expr-evl.c: (expr_evaluate) Add new case_num parameter, use for
1258         OP_CASENUM.
1259
1260         * inpt-pgm.c: (input_program_source_read) Maintain case count,
1261         pass to transformation functions.
1262         (reread_trns_proc) Pass case_num arg to expr_evaluate().
1263
1264         * loop.c: (loop_1_trns_proc) Ditto.
1265         (loop_2_trns_proc) Ditto.
1266         (loop_3_trns_proc) Ditto.
1267
1268         * print.c: (print_space_trns_proc) Ditto.
1269
1270         * sel-if.c: (select_if_proc) Ditto.
1271
1272 Tue Mar  2 11:36:52 2004  Ben Pfaff  <blp@gnu.org>
1273
1274         * frequencies.q: (cleanup_freq_tab) Avoid memory leak by
1275         destroying hash table.
1276
1277         * glob.c: (read_active_file) Variable not referenced, removed.
1278         (cancel_input_pgm) Ditto.
1279
1280         * levene.c: Add #include <stdlib.h> needed to call free().
1281
1282         * aggregate.c: (parse_aggregate_functions) Make `function'
1283         variable const.
1284
1285 Tue Mar  2 11:30:56 2004  Ben Pfaff  <blp@gnu.org>
1286
1287         Start working to eliminate VFM dependence on static variables.
1288
1289         * command.c: (cmd_parse) Use case_source_is_class().
1290
1291         * data-list.c: Rewrite to eliminate use of static variables.
1292
1293         * dfm.c: (cmd_begin_data) Use case_source_is_class().
1294
1295         * file-handle.q: (fh_handle_name) Make parameter const.
1296
1297         * file-type.c: Rewrite to eliminate use of static variables.
1298
1299         * flip.c: Rewrite to eliminate use of static variables.
1300
1301         * format.c: (get_format_var_width) New function.
1302
1303         * get.c: Eliminate use of static variables.
1304
1305         * inpt-pgm.c: Eliminate use of static variables.
1306
1307         * matrix-data.c: Eliminate use of static variables.
1308
1309         * set.q: (set_max_workspace) New variable.
1310         (cmd_set) Use SET WORKSPACE to modify set_max_workspace.
1311
1312         * var.h: (struct case_list) Move here from vfmP.h.
1313
1314         * vars-atr.c: (discard_variables) Handle new vfm_source type.
1315
1316         * vfm.c: (vfm_source) Change type from struct case_stream to
1317         struct case_source.
1318         (vfm_sink) Change type from struct case_stream to struct
1319         case_sink.
1320         (static var paging) Rename workspace_overflow, all references
1321         updated.
1322         (procedure) Use new class structures.
1323         (process_active_file) Ditto.
1324         (process_active_file_write_case) Ditto.
1325         (prepare_for_writing) Use set_max_workspace.  Use new class
1326         structures.
1327         (close_active_file) Use new class structures.  Free old sink.
1328         (global var disk_source_file) Removed.
1329         (global var disk_sink_file) Removed.
1330         (disk_stream_init) Removed.
1331         (disk_stream_read) Removed.
1332         (disk_stream_write) Removed.
1333         (disk_stream_mode) Removed.
1334         (disk_stream_destroy_source) Removed.
1335         (disk_stream_destroy_sink) Removed.
1336         (global var vfm_disk_stream) Removed.
1337         (disk_sink_create) New function.
1338         (disk_sink_write) New function.
1339         (disk_sink_destroy) New function.
1340         (disk_sink_make_source) New function.
1341         (disk_sink_class) New static var.
1342         (disk_source_read) New function.
1343         (disk_source_destroy) New function.
1344         (global var vfm_source_class) New var.
1345         (global var memory_source_cases) Removed.
1346         (global var memory_sink_cases) Removed.
1347         (global var memory_sink_max_cases) Removed.
1348         (struct memory_sink_info) New struct.
1349         (memory_stream_init) Removed.
1350         (memory_stream_read) Removed.
1351         (memory_stream_write) Removed.
1352         (memory_stream_mode) Removed.
1353         (memory_stream_destroy_source) Removed.
1354         (memory_stream_destroy_sink) Removed.
1355         (global var vfm_memory_stream) Removed.
1356         (page_to_disk) Renamed write_active_file_to_disk().
1357         (memory_sink_create) New function.
1358         (memory_sink_write) New function.
1359         (memory_sink_destroy) New function.
1360         (memory_sink_make_source) New function.
1361         (memory_sink_class) New static var.
1362         (memory_source_read) New function.
1363         (memory_source_destroy) New function.
1364         (memory_source_get_cases) New function.
1365         (memory_source_set_cases) New function.
1366         (global var vfm_source_class) New var.
1367         (procedure_write_case) Use new class structures.
1368         (create_case_source) New function.
1369         (case_source_is_complex) New function.
1370         (case_source_is_class) New function.
1371         (create_case_sink) New function.
1372
1373         * vfm.h: (global variable reinit_sysmis) Not used, removed.
1374         (global variable reinit_blanks) Not used, removed.
1375         (global variable init_zero) Not used, removed.
1376         (global variable init_blanks) Not used, removed.
1377         (struct case_source) New struct.
1378         (struct case_source_class) New struct.
1379         (struct case_sink) New struct.
1380         (struct case_sink_class) New struct.
1381         (struct case_stream) Removed.
1382
1383         * vfmP.h: (struct case_list) Moved to var.h.
1384
1385 Tue Mar  2 11:28:30 2004  Ben Pfaff  <blp@gnu.org>
1386
1387         * algorithm.c: (count_equal) New function.
1388         (count_if) New function.
1389         (unique) Add assertions.
1390         (partition) Add assertions.
1391         (is_partitioned) New function.
1392         (copy_if) Add assertions.
1393         (remove_equal) Add assertions.
1394         (lexicographical_compare) Rename lexicographical_compare_3way.
1395         (sort) Add assertions.  Rephrase some code.
1396         (is_sorted) New function.
1397
1398 Sun Feb 29 23:24:57 2004  Ben Pfaff  <blp@gnu.org>
1399
1400         Rewrite SORT CASES.
1401
1402         * sort.c: Completely rewrite.
1403
1404         * sort.h: Expose interface via struct sort_cases_pgm, not via
1405         global variables.
1406
1407         * aggregate.c: (sort) New static var.
1408         (cmd_aggregate) Use sort.
1409         (create_sysfile) Ditto.
1410         (aggregate_single_case) Ditto.
1411         (dump_aggregate_info) Ditto.
1412         (agr_00x_end_func) Ditto.
1413         (debug_print) Ditto.
1414
1415         * var.h: (enum SRT_ASCEND) Removed.
1416         (enum SRT_DESCEND) Removed.
1417         (struct sort_cases_proc) Removed.
1418         (struct variable) Remove p.srt member.
1419
1420 Sun Feb 29 23:22:45 2004  Ben Pfaff  <blp@gnu.org>
1421
1422         Get rid of the old, crappy heap structure and replace it by a new,
1423         shiny, C++ STL-like heap structure.
1424         
1425         * Makefile.am: (pspp_SOURCES) Remove heap.c, heap.h.
1426
1427         * algorithm.c: (push_heap) New function.
1428         (heapify) Ditto.
1429         (pop_heap) Ditto.
1430         (make_heap) Ditto.
1431         (sort_heap) Ditto.
1432         (is_heap) Ditto.
1433         
1434         * heap.c: Removed.
1435
1436         * heap.h: Removed.
1437
1438 Sun Feb 29 23:21:53 2004  Ben Pfaff  <blp@gnu.org>
1439
1440         Increase warning level.
1441         
1442         * Makefile.am: (AM_CFLAGS) Remove -Wnouninitialized.
1443
1444 Sat Feb 21 17:38:58 WST 2004 John Darrington <john@darrington.wattle.id.au>
1445
1446         * main.c: Added a signal handler for SIGSEGV requesting a bug report.
1447          
1448 Fri Feb 20 23:22:14 2004  Ben Pfaff  <blp@gnu.org>
1449
1450         * dictionary.c: (dict_create_var) Fix root cause of bug worked
1451         around by previous change log entry.
1452         
1453         * compute.c: (lvalue_finalize) Remove workaround from previous
1454         change log entry.
1455
1456 Fri Feb 20 14:37:41 WAST 2004 John Darrington <john@darrington.wattle.id.au>
1457
1458         * compute.c: Fixed a bug where the Format was not getting set for 
1459           computed variables (thus causing a crash when SAVEing).
1460
1461         * Added a test to stop this bug ever coming back
1462
1463 Wed Feb 18 22:21:35 2004  Ben Pfaff  <blp@gnu.org>
1464
1465         Got rid of approx.h.  In general, replaced all references to
1466         approx_eq() by ==, approx_lt() by <, etc.  Other types of changes
1467         noted below.
1468
1469         * Makefile.am: (pspp_SOURCES) Removed approx.h.
1470
1471         * data-out.c: (try_F) Replaced test for approx_eq(number, 0.0) by
1472         test for mag < EPSILON.
1473
1474         * misc.h: Add definition of EPSILON.
1475
1476 Wed Feb 18 21:32:44 2004  Ben Pfaff  <blp@gnu.org>
1477
1478         * vfm.c: (procedure) Add check to prevent recursive call.
1479
1480 Wed Feb 18 21:48:54 WST 2004 John Darrington <john@darrington.wattle.id.au>
1481
1482         * Moved the declarations relating to values to their own header file
1483           (val.h)
1484
1485         * Added levene.c and levene.h
1486
1487         * vars-atr.c: Changed the signature of compare_values to 
1488         take const * arguments.
1489                 
1490         * t-test.q: Changed the structure of struct t_test_proc 
1491        variables now contain their own group statistics information.
1492        Eventually, t_test_proc might get renamed, because it'd be 
1493        applicable to other commands too.
1494
1495 Mon Feb 16 23:15:51 2004  Ben Pfaff  <blp@gnu.org>
1496
1497         * data-out.c: Clean up.  Changed interface of convert_*() to take
1498         either a `double' or a `const char *' instead of a `const union
1499         value *'.  Update all implementations of those interfaces.
1500         (data_out) Use switch statements instead of a table.
1501         (convert_AHEX) Rewrite.
1502
1503         * format.h: Update comment.
1504
1505 Mon Feb 16 22:14:36 2004  Ben Pfaff  <blp@gnu.org>
1506
1507         * q2c.c: (dump_header) Add an Emacs header line to output files
1508         that makes generated .c files read-only by default, to make it
1509         difficult to accidentally change generated files.
1510
1511 Mon Feb 16 22:12:07 2004  Ben Pfaff  <blp@gnu.org>
1512
1513         * frequencies.q: (compare_freq_numeric_a) Compare by frequency,
1514         not bogus a->v.c <=> b->v.c pointer compare.
1515         (compare_freq_alpha_a) Ditto.
1516         (compare_freq_numeric_d) Ditto.
1517         (compare_freq_alpha_d) Ditto.
1518         
1519 Mon Feb 16 22:00:53 2004  Ben Pfaff  <blp@gnu.org>
1520
1521         Changed data_out() to store string data directly into a `union
1522         value''s s member, not indirectly into c.
1523
1524         * crosstabs.q: (output_pivot_table) Use format_short() instead of
1525         data_out().
1526         (table_value_missing) Ditto.
1527         (float_M_suffix) Ditto.
1528         (format_short) New function.
1529
1530         * data-in.h: (data_in_finite_line) Remove inline definition.
1531
1532         * data-list.c: (destroy_dls_var_spec) New function.
1533         (destroy_dls) Rewrite in terms of destroy_dls_var_spec().
1534         (data_list_source_destroy_source) Avoid cast.
1535         (struct repeating_data_trns) New field `id_value'.  Update
1536         comments.
1537         (cmd_repeating_data) Initialize id_value.  Use new
1538         repeating_data_trns_free() for freeing REPEATING DATA
1539         transformations.
1540         (rpd_parse_record) Rewrite support for record ID to be less bogus.
1541         (repeating_data_trns_free) New function.
1542
1543         * data-out.c: (data_out) Change return type to `void' by replacing
1544         error returns by writing a message into the output buffer.
1545         (convert_A) Read from v->s instead of v->c.
1546         (convert_AHEX) Ditto.
1547
1548         * expr-evl.c: Update comment.
1549         (expr_evaluate) Add assertion in OP_STRING case.
1550
1551         * format.h: (macro MAX_FORMATTED_LEN) New macro.
1552
1553         * list.q: (list_cases) Update for new data_out() semantics.
1554
1555         * print.c: (print_trns_proc) Ditto.
1556
1557         * tab.c: (tab_value) Ditto.
1558         (tab_float) Avoid stupid cast.
1559
1560         * var.h: Update comments.
1561         (macro MAX_STRING) New macro.
1562         (macro MAX_ELEMS_PER_VALUE) New macro.
1563
1564         * vars-atr.c: (compare_values) New function.
1565
1566         * vfm.c: (dump_splits) Update for new data_out() semantics.
1567
1568 Mon Feb 16 21:45:47 2004  Ben Pfaff  <blp@gnu.org>
1569
1570         * crosstabs.q: (struct table_entry) Rename v[] to values[].  All
1571         references updated.
1572         (struct crosstab) Rename v[] to vars[].  All references updated.
1573         (hash_table_entry) Replace the hash algorithm and fix a bug at the
1574         same time, which caused the hash value to depend only on a single
1575         value, not all of the variables' values.
1576         
1577 Mon Feb 16 12:49:53 2004  Ben Pfaff  <blp@gnu.org>
1578
1579         Clean up struct dictionary's value_cnt usage.
1580
1581         * dictionary.c: Add a function comment to each function.
1582         (struct dictionary) Rename value_cnt to next_value_idx, which more
1583         accurately reflects its meaning.  All references updated.
1584         (dict_rename_vars) Add assertion.
1585         (dict_get_value_cnt) Rename dict_get_next_value_idx().  All
1586         references updated.
1587         (dict_get_case_size) New function.
1588
1589         * aggregate.c: (create_sysfile) Use dict_get_case_size().
1590
1591         * get.c: (mtf_read_nonactive_records) Ditto.
1592
1593         * sort.c: (allocate_cases) Ditto.
1594         (write_initial_runs) Ditto.
1595         (merge) Ditto.
1596         (merge_once) Ditto.
1597
1598         * vfm.c: (prepare_for_writing) Ditto.
1599         (setup_lag) Ditto.
1600         (lag_case) Ditto.
1601
1602 Mon Feb 16 00:17:55 2004  Ben Pfaff  <blp@gnu.org>
1603
1604         Make vfm.c slightly less grotesque.
1605
1606         * vfm.c: (filter_var) Removed.
1607         (filter_index) Removed.
1608         (FILTERED macro) Removed.
1609         (exclude_this_case) New function.
1610         (process_active_file_write_case) Use exclude_this_case() instead
1611         of FILTERED and inline tests.
1612         (procedure_write_case) Ditto.
1613         (setup_filter) Removed.
1614         (open_active_file) Don't call setup_filter().
1615         (close_active_file) Call dict_get_filter() instead of checking
1616         filter_var.
1617
1618 Mon Feb 16 00:01:53 2004  Ben Pfaff  <blp@gnu.org>
1619
1620         * var.h: (struct variable) Update comments.
1621
1622 Sun Feb 15 23:14:59 2004  Ben Pfaff  <blp@gnu.org>
1623
1624         New functions dict_create_var_assert(), dict_lookup_var_assert().
1625         Converted several dict_*_var()/assert pairs into a single
1626         dict_*_var_assert().
1627
1628         * dictionary.c: (dict_create_var_assert) New function.
1629         (dict_lookup_var_assert) New function.
1630
1631 Sun Feb 15 23:06:08 2004  Ben Pfaff  <blp@gnu.org>
1632
1633         Got rid of "struct long_vec", envector(), devector(), etc.  Added
1634         two members `init', `reinit' to struct variable as a substitute.
1635         
1636         * Makefile.am: (pspp_SOURCES) Removed cases.c, cases.h.
1637         
1638         * cases.c: Removed.
1639
1640         * cases.h: Removed.
1641
1642         * aggregate.c: (parse_aggregate_functions) destvar doesn't need
1643         init.
1644
1645         * autorecode.c: (cmd_autorecode) destvars don't need init.
1646
1647         * compute.c: (lvalue_finalize) Set reinit.
1648
1649         * data-list.c: (fixed_parse_compatible) Don't need init usually.
1650         (dump_fmt_list) Ditto.
1651         (parse_free) Ditto.
1652
1653         * descript.q: (run_z_pass) Don't need init for z-scores.
1654
1655         * dictionary.c: (dict_create_var) Initialize `init', `reinit'
1656         members.
1657         (dict_clone_var) Copy `reinit' member, initialize `init' member.
1658
1659         * glob.c: (init_glob) Remove vec_init() calls.
1660
1661         * inpt-pgm.c: (cmd_end_input_program) Use `reinit', not `left'.
1662         
1663         * loop.c: (internal_cmd_loop) Don't need to call envector().
1664
1665         * numeric.c: (cmd_numeric) Ditto.
1666         (cmd_string) Ditto.
1667         (cmd_leave) Ditto.  Set `init', `reinit' members.
1668
1669         * recode.c: (cmd_recode) Don't need to call envector().
1670
1671         * repeat.c: (internal_cmd_do_repeat) Ditto.
1672
1673         * var.h: (struct variable) Remove `left'.  Add `init', `reinit'.
1674         (force_create_variable) Removed prototype.
1675         (force_dup_variable) Ditto.
1676
1677         * vector.c: (cmd_vector) Don't need to call envector().
1678
1679         * vfm.c: (reinit_sysmis) Removed.
1680         (reinit_blanks) Removed.
1681         (init_zero) Removed.
1682         (init_blanks) Removed.
1683         (process_active_file_write_case) No need to deal with vectors.
1684         Call clear_temp_case().
1685         (vector_initialization) Rewrite to use `init', `reinit'.
1686         (close_active_file) No need to call vec_clear().
1687         (procedure_write_case) Call clear_temp_case().
1688         (clear_temp_case) New function.
1689
1690 Sun Feb 15 20:50:36 2004  Ben Pfaff  <blp@gnu.org>
1691
1692         * pfm-write.c: (bufwrite) Get rid of nasty cast that also invoked
1693         undefined behavior.
1694
1695 Thu Feb 12 23:35:15 2004  Ben Pfaff  <blp@gnu.org>
1696
1697         Add auxiliary argument to procedure() interface.  Associated small
1698         clean-ups of vfm interface.
1699         
1700         * Updated every caller of procedure() and process_active_file() to
1701         reflect modified interface.  Simple, ordinary changes not listed
1702         otherwise below.
1703
1704         * Updated every function that implements struct case_stream's
1705         `read' function to take a write_case_func and a write_case_data.
1706         Also updated every caller of write_case() to instead call them
1707         through these arguments.  In some cases this meant that the extra
1708         args had to be threaded through a couple of extra levels.  This
1709         wasn't difficult or interesting so the details won't be given.
1710
1711         * data-list.c: (struct repeating_data_trns) Add members
1712         `write_case', `wc_data' as kluge.
1713         (read_one_set_of_repetitions) Rename repeating_data_trns_proc and
1714         make non-static.
1715         (repeating_data_set_write_case) New function.
1716
1717         * data-list.h: New file to declare repeating_data_trns_proc() and
1718         repeating_data_set_write_case().
1719
1720         * inpt-pgm.c: (input_program_source_read) Call
1721         repeating_data_set_write_case() for all the REPEATING DATA
1722         transformations, so that they know where to send their cases.
1723         It's a big kluge.  Also kluge in END CASE.
1724         (end_case_trns_proc) Never called anymore, but we still need it,
1725         so just assert(0).
1726
1727         * sort.c: (read_sort_output) Update to match struct case_stream
1728         `read' member.
1729
1730         * vfm.c: (struct write_case_data) New structure.
1731         (proc_func) Removed.
1732         (virt_proc_func) Removed.
1733         (begin_func) Removed.
1734         (virt_begin_func) Removed.
1735         (end_func) Removed.
1736         (write_case) Removed.
1737         (procedure) Added an auxiliary parameter to each function pointer
1738         argument's prototype.  Added an auxiliary data parameter.
1739         Rewrote.
1740         (process_active_file) Ditto.
1741         (process_active_file_write_case) Pass aux data along.
1742         (close_active_file) Ditto.
1743         (procedure_write_case) Ditto.
1744         (SPLIT_FILE_procfunc) Ditto.
1745
1746         * vfm.h: (typedef write_case_data) New.
1747         (typedef write_case_func) New.
1748         (struct case_stream) Add parameters to `read' member prototype.
1749         
1750 Thu Feb 12 19:24:53 WST 2004 John Darrington <john@darrington.wattle.id.au>
1751
1752         * t-test.q:  Added calculations for independent samples. (But no Levene
1753         test yet!)
1754
1755         * Makefile.am: Moved q_sources_c into own variable 
1756
1757 Wed Feb 11 23:56:51 2004  Ben Pfaff  <blp@gnu.org>
1758
1759         Miscellaneous cleanups.
1760         
1761         * Change unused to UNUSED in many source files to reflect modified
1762         pref.h.  Change use of __WIN32__, __MSDOS, __DJGPP__,
1763         __CYGWIN32__, __unix__, and unix not to assume that they're
1764         defined to a nonzero value.  Change use of __attribute__ to use
1765         NO_RETURN or PRINTF_FORMAT instead.
1766         
1767         * alloc.h: Move definitions for local_alloc(), local_free() here
1768         from ../pref.h.orig and simplify.
1769
1770         * expr-evl.c: Instead of working differently based on PAGED_STACK,
1771         use a pool allocator unconditionally.
1772         (CHECK_STRING_SPACE) Removed.
1773         (ALLOC_STRING_SPACE) Removed.
1774         (expr_evaluate) Use e->pool instead of CHECK_STRING_SPACE and
1775         ALLOC_STRING_SPACE.
1776
1777         * expr-opt.c: (dump_expression) Allocate string pool.
1778
1779         * expr-prs.c: (expr_free) Free string pool.
1780
1781         * pool.c: (pool_destroy) This pool must be removed from its
1782         parent's list of gizmos, not from its own.  Use free_all_gizmos().
1783         (pool_clear) New function.
1784         (free_all_gizmos) New function.
1785         (pool_alloc) Use space in empty block after this one if any.
1786         (pool_release) Only empty out blocks, don't actually free() them.
1787
1788         * print.c: Get rid of PAGED_STACK special case by always
1789         dynamically allocating line buffers.
1790         (struct print_trns) Always include the `line' member.
1791         (internal_cmd_print) Always initialize the `line' member.
1792         (alloc_line) Always allocate memory for `line'.
1793         (print_trns_proc) Always initialize buf from `line' member.
1794         (print_trns_free) Always free `line' memory.
1795
1796         * sort.c: (allocate_file_handles) Special-case MS-DOS for mkdir()
1797         call.
1798         
1799 Wed Feb 11 20:33:18 2004  Ben Pfaff  <blp@gnu.org>
1800
1801         * flip.c: Fixed crash from FLIP when a numeric variable is
1802           specified on NEWNAMES and a large value is used, and a couple of
1803           other minor bugs besides.
1804           (struct varname) Make name a 9-character fixed-size array
1805           instead of a 1-character variable size array.
1806           (make_new_var) Allow digits in variable names.
1807           (flip_stream_write) Limit numeric values to 8 characters and
1808           format system missing and very large and small values more
1809           appropriately.
1810
1811 Thu Feb  5 13:19:06 WAST 2004 John Darrington <john@darrington.wattle.id.au>
1812
1813         * command.c: Fixed test on command return status for the correct 
1814           value,  which had been causing a crash under certain invalid input.
1815
1816 Wed Feb  4 15:34:11 WST 2004 John Darrington <john@darrington.wattle.id.au>
1817
1818         * t-test.q: Added calculations for the one sample variant of the T-TEST
1819
1820 Tue Feb  3 20:09:54 2004  Ben Pfaff  <blp@gnu.org>
1821
1822         * tab.c: (render_strip) Fix bug that sometimes caused joined text
1823           in joined cells to be rendered outside box boundaries.
1824
1825 Tue Feb  3 18:56:45 WST 2004 John Darrington <john@darrington.wattle.id.au>
1826
1827         * random.c (rng_create): Fixed seeding so that it gets reseeded after
1828         SET seed=xx has been called.
1829
1830 Mon Jan 19 14:08:09 2004  Ben Pfaff  <blp@gnu.org> 
1831
1832         * random.c (rng_get_double): Fix always-returning-zero bug in my
1833         preferred way, and at the same time make sure rounding doesn't
1834         bite us.
1835
1836 Thu Jan  1 23:16:41 2004  Ben Pfaff  <blp@gnu.org>
1837
1838         * html.c: (change_attributes) Dead code, removed.
1839         (escape_string) Eliminate code to call change_attributes() that
1840         never actually called it.
1841         (output_tab_table) Get rid of dependence on tab_hit
1842         and struct tab_joined_cell's hit member, which are abominations.
1843
1844         * tab.c: (tab_output_text) Don't call
1845         d->class->text_set_font_by_name if it's a null pointer.
1846         (macro UNROLL_LOOP) Eliminate.
1847         (macro UNROLL_3_LOOPS) Eliminate.
1848         (tabi_render) Rewrite not to use the above macros.
1849
1850 Thu Jan  1 23:09:07 2004  Ben Pfaff  <blp@gnu.org>
1851
1852         Start working on a new output driver system, one that doesn't suck
1853         so much, by adding a "device-independent" output driver.  The idea
1854         is to write out only a single output stream, then use separate
1855         processes to translate them into whatever formats we want.  This
1856         is similar to how "groff" works with its various output drivers
1857         (grops, grotty, grodvi, ...).
1858         
1859         * Makefile.am: (pspp_SOURCES) Add devind.c, devind.h.
1860
1861         * list.q: (write_all_headers) Stub out devind class.
1862         (clean_up) Ditto.
1863         (determine_layout) Ditto.
1864         (list_cases) Ditto.
1865
1866         * output.c: (outp_init) Add devind class.
1867
1868         * devind.c: New file.
1869
1870         * devind.h: New file.
1871
1872 Thu Jan  1 23:08:14 2004  Ben Pfaff  <blp@gnu.org>
1873
1874         * frequencies.q: (hash_value_alpha) Fixed up the previous change
1875         to use the proper string length.
1876
1877 Wed Dec 31 16:27:33 WAST 2003 John Darrington <john@darrington.wattle.id.au>
1878
1879         * Fixed bug where FREQ would crash on alpha values
1880
1881 Tue Dec 30 22:42:57 2003  Ben Pfaff  <blp@gnu.org>
1882
1883         * Removed bletcherous alloca() workarounds for AIX from top of
1884         many files.  AIX can use the alternative alloca() implementation
1885         instead.
1886
1887 Tue Dec 30 22:35:16 2003  Ben Pfaff  <blp@gnu.org>
1888
1889         * ascii.c: (ascii_option) Fix implementation of headers option.
1890
1891 Tue Dec 30 22:32:53 2003  Ben Pfaff  <blp@gnu.org>
1892
1893         * ascii.c: Add a "squeeze" option to the ASCII driver to squeeze
1894         multiple blank lines into one.
1895         (struct ascii_driver_ext) Add squeeze_blank_lines option.
1896         (ascii_preopen_driver) Initialize squeeze_blank_lines.
1897         (static var option_tab) Add squeeze entry.
1898         (ascii_option) Set squeeze_blank_lines.
1899         (output_lines) Implement squeezing blank lines.
1900
1901 Wed Dec 31 07:19:46 WST 2003 John Darrington <john@darrington.wattle.id.au>
1902
1903         * Removed redundant code from output.h
1904
1905 Sat Dec 27 22:17:52 2003  Ben Pfaff  <blp@gnu.org>
1906
1907         Dictionary classes: each variable is "ordinary", "system", or
1908         "scratch".
1909
1910         * var.h: (enum dict_class) New enum.
1911
1912         * vars-prs.c: (dict_class_from_id) New function.
1913         (dict_class_to_name) New function.
1914
1915 Sat Dec 27 22:16:06 2003  Ben Pfaff  <blp@gnu.org>
1916
1917         * var.h: (struct freq_tab_set) Removed (not used).
1918
1919 Sat Dec 27 22:15:21 2003  Ben Pfaff  <blp@gnu.org>
1920
1921         * value-labels.c: (val_labs_destroy) vls needs to be freed too.
1922
1923 Sat Dec 27 22:10:49 2003  Ben Pfaff  <blp@gnu.org>
1924
1925         * stats.c: (hypercube) Rename pow4().  All references updated.
1926
1927 Sat Dec 27 22:05:49 2003  Ben Pfaff  <blp@gnu.org>
1928
1929         * rename-vars.c: (cmd_rename_variables) Rewritten.
1930         (compare_name) Removed.
1931
1932 Sat Dec 27 22:03:51 2003  Ben Pfaff  <blp@gnu.org>
1933
1934         var_set feature, and code taking advantage of it.
1935         
1936         * crosstabs.q: (static var var_dict) Removed.
1937         (static var variables) New variable.
1938         (static var variables_cnt) New variable.
1939         (cmd_crosstabs) Free variables instead of var_dict.
1940         (internal_cmd_crosstabs) Initialize and use variables,
1941         variables_cnt instead of var_dict.
1942         (free_var_dict) Removed.
1943         (crs_custom_tables) Use var_set instead of a copied dictionary.
1944         (crs_custom_variables) Set up variables, variables_cnt instead of
1945         var_dict.
1946         [DEBUGGING] (debug_print) Ditto.
1947
1948         * means.q: (mns_custom_tables) Use var_set instead of a copied
1949         dictionary.
1950
1951         * vars-prs.c: (parse_vs_variable) New function.
1952         (parse_dict_variable) Rewritten.
1953         (parse_variable) Rewritten.
1954         (parse_variables) Renamed parse_var_set_vars(), rewritten.
1955         (parse_variables) New function in terms of parse_var_set_vars().
1956         Now requires its first argument to be non-null.  All references
1957         that passed a null pointer updated to pass default_dict instead.
1958         (macro id_dict) Removed.
1959         (parse_DATA_LIST_vars) Add assertions.
1960         (parse_mixed_vars) Ditto.
1961         (struct var_set) New structure.
1962         (var_set_get_cnt) New function.
1963         (var_set_get_var) New function.
1964         (var_set_lookup_var) New function.
1965         (var_set_destroy) New function.
1966         (dict_var_set_get_cnt) New function.
1967         (dict_var_set_get_var) New function.
1968         (dict_var_set_lookup_var) New function.
1969         (dict_var_set_destroy) New function.
1970         (var_set_create_from_dict) New function.
1971         (struct array_var_set) New structure.
1972         (array_var_set_get_cnt) New function.
1973         (array_var_set_get_var) New function.
1974         (array_var_set_lookup_var) New function.
1975         (array_var_set_destroy) New function.
1976         (var_set_create_from_array) New function.
1977
1978         * q2c.c: (dump_parser) Use parse_variables(default_dict, ...)
1979         instead of parse_variables(NULL, ...) in output code.
1980
1981 Sat Dec 27 21:38:53 2003  Ben Pfaff  <blp@gnu.org>
1982
1983         Change inp_init from a 2-bit vector to an ordinary array.
1984         Initialize it all in cmd_end_input_program() instead of in
1985         create_variable().
1986
1987         * inpt-pgm.c: (enum value_init_type) New enum.
1988         (global var inp_init) Change to `enum value_init_type *', make
1989         static.
1990         (inp_init_size) Removed.
1991         (inp_nval) Change to `size_t', make static.
1992         (cmd_input_program) Don't initialize inp_init or inp_init_size.
1993         (cmd_end_input_program) Initialize inp_init, inp_nval.
1994         (init_case) Rewrite.
1995         (clear_case) Rewrite.
1996
1997         * inpt-pgm.h: Removed.
1998
1999 Sat Dec 27 21:36:38 2003  Ben Pfaff  <blp@gnu.org>
2000
2001         * hash.c: (hsh_hash_bytes) Use Fowler-Noll-Vo hash instead of
2002         Colin Plumb hash.  It is simpler and should better resist
2003         collisions.
2004         (hsh_hash_string) Ditto.
2005
2006 Sat Dec 27 21:34:57 2003  Ben Pfaff  <blp@gnu.org>
2007
2008         * get.c: (export_write_case_func) Remove debug printing code.
2009
2010 Sat Dec 27 21:11:09 2003  Ben Pfaff  <blp@gnu.org>
2011
2012         * get.c: (cmd_save_internal) Rename parameter.  Use &t->h instead
2013         of cast.
2014         (save_write_case_func) Use &trns->h instead of cast.
2015         (cmd_export) Use &t->h instead of cast.
2016
2017 Sat Dec 27 20:57:42 2003  Ben Pfaff  <blp@gnu.org>
2018
2019         Moved vectors into the dictionary.
2020
2021         * var.h: (struct vector) Moved here from vector.h.  `index' member
2022         renamed `idx', `v' renamed `var', `nv' renamed `cnt'.  All
2023         references updated.
2024         
2025         * vector.h: Removed.
2026
2027         * vector.c: (global var vec) Removed.
2028         (global var nvec) Removed.
2029         (cmd_vector) Rewritten.
2030         (find_vector) Removed.
2031
2032         * dictionary.c: (dict_create_vector) New function.
2033         (dict_get_vector) New function, replaces reading global vec[]
2034         array.
2035         (dict_get_vector_cnt) New function, replaces reading global nvec
2036         variable.
2037         (dict_lookup_vector) New function, replaces find_vector().
2038         (dict_clear_vectors) New function.
2039
2040 Sat Dec 27 20:54:01 2003  Ben Pfaff  <blp@gnu.org>
2041
2042         Start to move away from `struct variable' p `union' member to void
2043         * aux member.
2044
2045         * var.h: (struct variable) Add `aux' member.
2046
2047 Sat Dec 27 20:36:25 2003  Ben Pfaff  <blp@gnu.org>
2048
2049         Get rid of struct variable `foo' member.
2050
2051         * frequencies.q: (internal_cmd_frequencies) Use p.frq.used instead
2052         of foo.
2053         (frq_custom_variables) Ditto.
2054         (frq_custom_grouped) Ditto.
2055
2056         * get.c: (struct save_trns) Change `var' member from `int *' to
2057         `struct variable **'.
2058         (cmd_save_internal) Use aux instead of foo.
2059         (save_trns_proc) Use revised `var' member.
2060         (static var mtf_seq_no) Renamed mtf_seq_num.
2061         (static var mtf_seq_nums) New static var.
2062         (cmd_match_files) Initialize mtf_seq_nums.
2063         (mtf_free) Free mtf_seq_nums.
2064         (mtf_processing) Use mtf_seq_nums instead of foo.
2065         (mtf_merge_dictionary) No need to initialize mv->foo.
2066         (cmd_export) Use aux instead of foo.  Use revised `var' member.
2067         (mns_custom_tables) Don't use foo to check for duplicates, that's
2068         what PV_NO_DUPLICATE is for.
2069
2070         * var.h: (struct variable) Remove `foo' member.
2071         (struct frequencies_proc) New member.
2072         
2073 Sat Dec 27 19:46:13 2003  Ben Pfaff  <blp@gnu.org>
2074
2075         Clean up COMPUTE and IF.
2076
2077         * compute.c: More or less rewrite the darn thing.
2078         (struct compute_trns) Rename and reorder and add and delete
2079         members.
2080         (cmd_compute) Rewrite.
2081         (compute_num) Make conditional on test expression.  Now used for
2082         both COMPUTE and IF.
2083         (compute_num_vec) Ditto.
2084         (compute_str) Ditto.
2085         (compute_str_vec) Ditto.
2086         (cmd_if) Rewrite.
2087         (if_num) Removed.
2088         (if_num_vec) Removed.
2089         (if_str) Removed.
2090         (if_str_vec) Removed.
2091         (parse_target_expression) Renamed parse_rvalue_expression(),
2092         rewritten.
2093         (new_trns) Renamed compute_trns_create(), rewritten.
2094         (delete_trns) Removed.
2095         (free_trns) Renamed compute_trns_free(), rewritten.
2096         (struct lvalue) New structure.
2097         (parse_var_or_vec) Renamed lvalue_parse(), rewritten.
2098         (lvalue_get_type) New function.
2099         (lvalue_is_vector) New function.
2100         (lvalue_finalize) New function.
2101         (lvalue_destroy) New function.
2102         
2103 Sat Dec 27 19:44:14 2003  Ben Pfaff  <blp@gnu.org>
2104
2105         * command.def: Disallow MODIFY VARS in input mode, so that
2106         variables can't get dropped and confuse cmd_end_input_program()'s
2107         attempt to fill inp_init[].
2108         
2109         * modify-vars.c: (static var forward_positional_ordering) New
2110         variable.
2111         (struct var_modification) Entirely changed.
2112         (rearrange_dict) Interface changed, rewritten.
2113         (cmd_modify_vars) Deal with modified struct var_modification, much
2114         rewritten.
2115         (struct var_renaming) New structure.
2116         (compare_var_renaming_by_new_name) New function.
2117         (validate_var_modification) New function.
2118
2119         * var.h: (struct modify_vars_proc) Removed.
2120         (struct variable) Removed member p.mfv.
2121
2122 Sat Dec 27 19:40:26 2003  Ben Pfaff  <blp@gnu.org>
2123
2124         Make EVALUATE a valid command whether we're debugging or not, so
2125         that `make check' can succeed regardless of whether debugging is
2126         turned on.
2127         
2128         * command.def: [GLOBAL_DEBUGGING] Drop the #if.
2129
2130         * compute.c: [GLOBAL_DEBUGGING] (cmd_evaluate) Drop the #if.
2131
2132 Sat Dec 27 19:34:40 2003  Ben Pfaff  <blp@gnu.org>
2133
2134         * apply-dict.c: (cmd_apply_dictionary) Replace a ghastly switch
2135         statement by a simple if test.
2136
2137         * dfm.c: (dfm_get_record) Add assertion.
2138
2139 Sat Dec 27 17:51:26 2003  Ben Pfaff  <blp@gnu.org>
2140
2141         For each file x.c, move #include "x.h" to the very top of the
2142         include list, to catch x.h failing to include the proper headers.
2143
2144 Sat Dec 27 17:50:19 2003  Ben Pfaff  <blp@gnu.org>
2145
2146         * algorithm.c: (find) New function.
2147         (remove_equal) New function.
2148         (set_difference) New function.
2149         (adjacent_find_equal) New function.
2150         [TEST_UNIQUE] Removed test case.
2151         (copy_if) Find end test.
2152
2153 Sat Dec 27 17:42:45 2003  Ben Pfaff  <blp@gnu.org>
2154
2155         * dictionary.c: (dict_get_case_weight) New convenience function.
2156
2157         * aggregate.c: (accumulate_aggregate_info) Use
2158         dict_get_case_weight().
2159
2160         * frequencies.q: (calc_general) Ditto.
2161         (calc_integer) Ditto.
2162         (calc) Ditto.
2163
2164         * t-test.q: (groups_calc) Ditto.
2165         (z_calc) Ditto.
2166
2167 Sat Dec 27 17:29:45 2003  Ben Pfaff  <blp@gnu.org>
2168
2169         * glob.c: (global var default_dict) Change from `struct
2170         dictionary' to `struct dictionary *'.  All references changed.
2171         (init_glob) Initialize default_dict with dict_create().
2172
2173 Sat Dec 27 17:06:06 2003  Ben Pfaff  <blp@gnu.org>
2174
2175         struct dictionary now made opaque.  All related functions:
2176
2177         * get.c: (rename_variables) Removed.
2178         (dict_delete_run) Removed.
2179         
2180         * temporary.c: (copy_variable) Removed.
2181         (new_dictionary) Removed.
2182         (save_dictionary) Removed.
2183         (restore_dictionary) Removed.
2184         (free_dictionary) Removed.
2185
2186         * vars-atr.c: (clear_default_dict) Removed.
2187         (find_variable) Removed.
2188         (find_dict_variable) Removed.
2189         (create_variable) Removed.
2190         (delete_variable) Removed.
2191         (common_init_stuff) Removed.
2192         (init_variable) Removed.  Updating of inp_init moved into
2193         cmd_end_input_program().
2194         (replace_variable) Removed.
2195         (rename_variable) Removed.
2196         (clear_variable) Removed.
2197         (dup_variable) Removed.
2198
2199         * vars-prs.c: (is_varname) Removed.
2200         (is_dict_varname) Removed.
2201         (fill_all_vars) Removed.
2202
2203         * vector.c: (find_vector) Removed.
2204
2205         * weight.c: (stop_weighting) Removed.
2206
2207         * dictionary.c: New file.
2208         (dict_create) New, replaces new_dictionary().
2209         (dict_clone) New, replaces save_dictionary() and
2210         restore_dictionary().
2211         (dict_clear) New, replaces clear_default_dict().
2212         (dict_destroy) New, replaces free_dictionary().
2213         (dict_get_var_cnt) New function, replaces references to
2214         dict->nvar.
2215         (dict_get_var) New function, replaces references to dict->var[i].
2216         (dict_get_vars) New function, replaces fill_all_vars().
2217         (dict_create_var) New, replaces create_variable().  Interface
2218         drops `type' parameter, using a zero `width' to designate numeric.
2219         (dict_clone_var) New, replaces dup_variable().
2220         (dict_rename_var) New, replaces rename_variable().
2221         (dict_lookup_var) New, replaces find_variable(),
2222         find_dict_variable(), is_varname().
2223         (dict_contains_var) New function.
2224         (compare_variable_dblptrs) New function.
2225         (dict_delete_var) New function, replaces clear_variable().
2226         (dict_delete_vars) New function, replaces dict_delete_run().
2227         (dict_reorder_vars) New function.
2228         (dict_rename_vars) New function, replaces rename_variables().
2229         (dict_get_weight) New function, replaces reading dict->weight_var.
2230         (dict_set_weight) New function, replaces writing dict->weight_var
2231         or calling stop_weight(dict).
2232         (dict_get_filter) New function, replaces reading dict->filter_var.
2233         (dict_set_filter) New function, replaces writing dict->filter_var.
2234         (dict_get_case_limit) New function, replaces reading dict->N.
2235         (dict_set_case_limit) New function, replaces writing dict->N.
2236         (dict_get_value_cnt) New function, replaces reading dict->nval.
2237         (dict_compact_values) New function, replaces a loop that was
2238         replicated in several places.
2239         (dict_get_split_vars) New function, replaces reading dict->splits.
2240         (dict_get_split_cnt) New function, replaces reading
2241         dict->n_splits.
2242         (dict_set_split_vars) New function, replaces writing dict->splits.
2243         (dict_get_label) New function, replaces reading dict->label.
2244         (dict_set_label) New function, replaces writing dict->label.
2245         (dict_get_documents) New function, replaces reading
2246         dict->documents.
2247         (dict_set_documents) New function, replaces writing
2248         dict->documents.
2249         
2250         All references to above functions updated.
2251         
2252         * aggregate.c: (cmd_aggregate) Copy file label and documents from
2253         old dictionary to new by hand, because dict_create() can't do it
2254         itself.  Use dict_set_documents(), dict_set_split_vars().
2255
2256         * temporary.c: (cancel_temporary) Also set temp_dict to NULL after
2257         calling dict_destroy().
2258
2259         * data-list.c: (dls_var_spec) Remove `type' member, replace by
2260         `width'.
2261         (fixed_parse_compatible) Some slightly nontrivial changes for
2262         dict_create_var().
2263         (dump_fmt_list) Ditto.
2264         (parse_free) Ditto.
2265
2266         * file-type.c: (create_col_var) Ditto.
2267
2268         * get.c: (cmd_get) Use dict_compact_values() instead of a loop.
2269         (trim_dictionary) Use dict_delete_vars(), dict_reorder_vars().
2270         (rename_variables) Use dict_rename_vars().
2271         (mtf_merge_dictionary) Use dict_get_documents(),
2272         dict_set_documents(), dict_compact_values().
2273
2274         * pfm-read.c: (read_variables) Deal with changes to weighting.
2275
2276         * q2c.c: (dump_parser) Use dict_lookup_var() instead of
2277         is_varname() in output code.
2278
2279         * sfm-read.c: (read_header) Use dict_create(), dict_set_label(),
2280         other dictionary functions.
2281
2282         * title.c: (add_document_line) Use dict_get_documents(),
2283         dict_set_documents().
2284
2285         * vars-atr.c: (discard_variables) Use dict_clear(default_dict),
2286         reset default_handle by hand.  dict_clear() will clear vectors so
2287         there's no need for that by hand.
2288
2289         * vfm.c: (close_active_file) Move call to finish_compaction()
2290         earlier, so that we can do the compaction as a single step using
2291         dict_compact_values().  Use dict_clear_vectors().
2292         (finish_compaction) Use dict_delete_var(), dict_compact_values().
2293                 
2294         Some functions don't have replacements:
2295
2296         * vars-atr.c: (force_create_variable) Removed.  All references
2297         updated to dict_create_var() followed by an assertion.
2298         (force_dup_variable) Removed.  All references updated to
2299         dict_clone_var() followed by an assertion.
2300         
2301         * weight.c: (update_weighting) Removed.  No longer necessary, so
2302         all references removed.
2303
2304 Sat Dec 27 16:43:01 2003  Ben Pfaff  <blp@gnu.org>
2305
2306         Clean up AGGREGATE.
2307         
2308         * aggregate.c: Eliminate separation of weighted and unweighted
2309         case.  It made the code too obscure and I doubt it was actually
2310         faster.  Instead, all code uses the "weighted" code, because
2311         that's a generalization of the "unweighted" code.
2312         (FWEIGHT) Removed.
2313         (FOPTIONS) Ditto.
2314         (parse_aggregate_functions) No need to set FWEIGHT.
2315         (accumulate_aggregate_info) Get rid of FWEIGHT cases.
2316         (dump_aggregate_info) Ditto.
2317         (initialize_aggregate_info) No need for special plain_function
2318         that gets rid of FWEIGHT option.
2319
2320         * aggregate.c: Get rid of approximations.
2321         (accumulate_aggregate_info) Don't use approx_gt(), approx_lt(),
2322         approx_in_range().
2323         (aggregate_single_case) Don't use approx_ne().
2324
2325 Sat Dec 27 16:19:36 2003  Ben Pfaff  <blp@gnu.org>
2326
2327         * ascii.c (ascii_line_width): Dead code, removed.
2328
2329         * postscript.c (ps_line_width): Ditto.
2330
2331         * q2c.c (xrealloc): Ditto.
2332
2333         * count.c (internal_cmd_count): Ditto.
2334
2335         * means.q (validate_dependent_endpoint): Ditto.
2336
2337         * set.q: (cmd_gset) Ditto.
2338
2339         * weight.c: [0] (weight_trns_proc) Ditto.
2340
2341 Sat Dec 27 16:18:16 2003  Ben Pfaff  <blp@gnu.org>
2342
2343         Make the code -Wmissing-prototypes clean.
2344
2345         * Makefile.am (version.c): Add #include "version.h".
2346         
2347         * ascii.c: (ascii_open_global) Make static.
2348         (ascii_close_page) Ditto.
2349         (ascii_font_sizes) Ditto.
2350         (ascii_postopen_driver) Ditto.
2351         (ascii_close_driver) Ditto.
2352         (ascii_option) Ditto.
2353         (ascii_open_page) Ditto.
2354         (ascii_line_horz) Ditto.
2355         (ascii_line_vert) Ditto.
2356         (ascii_line_intersection) Ditto.
2357         (ascii_box) Ditto.
2358         (ascii_polyline_begin) Ditto.
2359         (ascii_polyline_point) Ditto.
2360         (ascii_polyline_end) Ditto.
2361         (ascii_text_set_font_by_name) Ditto.
2362         (ascii_text_set_font_by_position) Ditto.
2363         (ascii_text_set_font_by_family) Ditto.
2364         (ascii_text_get_font_name) Ditto.
2365         (ascii_text_get_font_family) Ditto.
2366         (ascii_text_set_size) Ditto.
2367         (ascii_text_get_size) Ditto.
2368         (ascii_text_metrics) Ditto.
2369         (ascii_text_draw) Ditto.
2370         (ascii_close_page) Ditto.
2371
2372         * cmdline.h: New header for parse_command_line().  Used where
2373         needed.
2374
2375         * command.c: Move prototypes for cmd_*() functions to command.h.
2376
2377         * command.h: Prototypes for cmd_*() functions moved here from
2378         command.c.
2379
2380         * crosstabs.q: (gamma_int) Ditto.
2381
2382         * file-handle.h: Add fh_init_files() prototype.
2383         
2384         * getline.c: (welcome) Ditto.
2385
2386         * glob.h: New header for init_glob().  Used where appropriate.
2387
2388         * hash.c: (comparison_helper) Ditto.
2389
2390         * html.c: (html_open_global) Ditto.
2391         (html_close_global) Ditto.
2392         (html_preopen_driver) Ditto.
2393         (html_postopen_driver) Ditto.
2394         (html_close_driver) Ditto.
2395         (html_option) Ditto.
2396         (html_open_page) Ditto.
2397         (html_close_page) Ditto.
2398         (html_submit) Ditto.
2399
2400         * inpt-pgm.c: (input_program_source_read) Ditto.
2401
2402         * output.c: (find_defn_value) Ditto.
2403         (destroy_list) Ditto.
2404
2405         * pfm-read.c: (read_int) Ditto.
2406
2407         * postscript.c: (ps_open_global) Ditto.
2408         (ps_close_global) Ditto.
2409         (ps_font_sizes) Ditto.
2410         (ps_preopen_driver) Ditto.
2411         (ps_postopen_driver) Ditto.
2412         (ps_close_driver) Ditto.
2413         (ps_option) Ditto.
2414         (ps_open_page) Ditto.
2415         (ps_close_page) Ditto.
2416         (ps_line_horz) Ditto.
2417         (ps_line_vert) Ditto.
2418         (ps_line_intersection) Ditto.
2419         (ps_box) Ditto.
2420         (ps_polyline_begin) Ditto.
2421         (ps_polyline_point) Ditto.
2422         (ps_polyline_end) Ditto.
2423         (ps_text_set_font_by_name) Ditto.
2424         (ps_text_set_font_by_position) Ditto.
2425         (ps_text_set_font_family) Ditto.
2426         (ps_text_get_font_name) Ditto.
2427         (ps_text_get_font_family) Ditto.
2428         (ps_text_set_size) Ditto.
2429         (ps_text_get_size) Ditto.
2430         (ps_text_metrics) Ditto.
2431         (ps_text_draw) Ditto.
2432
2433         * q2c.c: (finish_up) Ditto.
2434         (xmalloc) Ditto.
2435         (xstrdup) Ditto.
2436         (get_buffer) Ditto.
2437         (st_lower) Ditto.
2438         (st_upper) Ditto.
2439         (skip_ws) Ditto.
2440         (get_line) Ditto.
2441         (add_symbol) Ditto.
2442         (find_symbol) Ditto.
2443         (lex_get) Ditto.
2444         (force_id) Ditto.
2445         (force_string) Ditto.
2446         (match_id) Ditto.
2447         (match_token) Ditto.
2448         (skip_token) Ditto.
2449         (parse) Ditto.
2450         (parse_setting) Ditto.
2451         (parse_specifier) Ditto.
2452         (parse_specifiers) Ditto.
2453         (parse_subcommand) Ditto.
2454         (dump_specifier_vars) Ditto.
2455         (is_keyword) Ditto.
2456         (make_identifier) Ditto.
2457         (dump_declarations) Ditto.
2458         (dump_specifier_init) Ditto.
2459         (dump_vars_init) Ditto.
2460         (make_match) Ditto.
2461         (dump_specifier_parse) Ditto.
2462         (dump_subcommand) Ditto.
2463         (dump_parser) Ditto.
2464         (dump_header) Ditto.
2465         (dump_free) Ditto.
2466         (recognize_directive) Ditto.
2467
2468         * recode.c: (string_to_long) Ditto.
2469
2470         * repeat.c: (find_DO_REPEAT_substitution) Ditto.
2471
2472         * repeat.h: New header for perform_DO_REPEAT_substitutions, used
2473         where appropriate.
2474
2475         * sort.c: (sort_stream_read) Ditto.
2476         (sort_stream_mode) Ditto.
2477         
2478 Fri Dec 19 23:35:04 2003  Ben Pfaff  <blp@gnu.org>
2479
2480         * algorithm.c (binary_search): Fix comparison.
2481
2482 Fri Dec 19 23:27:45 2003  Ben Pfaff  <blp@gnu.org>
2483
2484         * algorithm.c: (binary_search) Fix assertion.
2485
2486 Fri Dec 19 21:31:48 2003  Ben Pfaff  <blp@gnu.org>
2487
2488         * sysfile-info.c: (compare_vectors_by_name) Rewrite.
2489
2490 Fri Dec 19 21:30:24 2003  Ben Pfaff  <blp@gnu.org>
2491
2492         * sort.c: (compare_case_lists) Rewrite.
2493
2494 Fri Dec 19 16:44:22 2003  Ben Pfaff  <blp@gnu.org>
2495
2496         * quicksort.c: Removed (not used).
2497
2498         * quicksort.h: Removed (not used).
2499
2500         * sort.c: Removed blp_quicksort() prototype.
2501
2502 Fri Dec 19 16:42:13 2003  Ben Pfaff  <blp@gnu.org>
2503
2504         * postscript.c: (int_2_compare) Rewrite.
2505         (compare_line) Rewrite.
2506
2507 Fri Dec 19 16:38:35 2003  Ben Pfaff  <blp@gnu.org>
2508
2509         * matrix-data.c (compare_factors) Use lexicographical_compare()
2510         algorithm.
2511         (compare_doubles) New function.
2512         
2513         * algorithm.c: (lexicographical_compare) New algorithm.
2514
2515 Fri Dec 19 16:23:45 2003  Ben Pfaff  <blp@gnu.org>
2516
2517         * matrix-data.c (compare_variables_by_mxd_vartype): Rewrite.
2518
2519 Fri Dec 19 15:54:45 2003  Ben Pfaff  <blp@gnu.org>
2520
2521         * expr-prs.c: (cmp_func) Removed.
2522         (parse_function) Use binary_search() algorithm.
2523         (compare_functions) New function.
2524         (init_func_tab) Use sort() algorithm.
2525
2526         * algorithm.c: (binary_search) New algorithm.
2527
2528 Fri Dec 19 15:50:45 2003  Ben Pfaff  <blp@gnu.org>
2529
2530         * descript.q: (display) Use sort() algorithm instead of qsort().
2531         (compare_func) Removed.
2532         (descriptives_compare_variables) New function.
2533
2534 Fri Dec 19 15:08:38 2003  Ben Pfaff  <blp@gnu.org>
2535
2536         Get rid of AVL trees.  Hashes are more appropriate for everything
2537         PSPP does.
2538
2539         * Makefile.am: (pspp_SOURCES) Remove avl.c, avl.h.
2540         
2541         * avl.c: Removed.
2542
2543         * avl.h: Removed.
2544
2545 Fri Dec 19 14:33:31 2003  Ben Pfaff  <blp@gnu.org>
2546
2547         Much code can be clarified by using C++ STL-like algorithms.  Not
2548         all uses of these algorithms are listed below, only the ones where
2549         the change to an algorithm was the only change of interest.
2550         
2551         * Makefile.am: (pspp_SOURCES) Add algorithm.c, algorithm.h.
2552         
2553         * algorithm.c: New file.
2554
2555         * algorithm.h: New file.
2556
2557         * modify-vars.c: (static var forward) Removed.
2558         (static var positional) Removed.
2559         (compare_variables) Removed.
2560         (struct ordering) New.
2561         (cmd_modify_vars) Use sort() algorithm.
2562         (compare_variables_given_ordering) New function.
2563         (rearrange_dict) Use sort() algorithm.
2564
2565         * sysfile-info.c: (cmd_display) Use sort() algorithm.
2566         (cmp_var_by_name) Removed.
2567
2568 Fri Dec 19 14:26:17 2003  Ben Pfaff  <blp@gnu.org>
2569
2570         Make file handles use a hash table.
2571         
2572         * file-handle.q: (files) Change to hash table, make static.
2573         (cmd_file_handle) Use hash table functions.
2574         (fh_get_handle_by_filename) Ditto.
2575         (fh_get_handle_by_name) Ditto.
2576         (hash_file_handle) New function.
2577         (cmp_file_handle) Rewrite.
2578         (fh_init_files) Use hash table functions.
2579
2580 Fri Dec 19 14:24:38 2003  Ben Pfaff  <blp@gnu.org>
2581
2582         Clean up FREQUENCIES.
2583         
2584         * Makefile.am: (pspp_SOURCES) Remove frequencies.g.
2585
2586         * frequencies.q: Remove a lot of old #if'd out code at the end.
2587         (internal_cmd_frequencies) Use calc() instead of calc_no_weight()
2588         or calc_weight().  Initialize percentile_values.
2589         (calc) New function based on calc_weight() from frequencies.g.
2590         (precalc) Use hash functions.
2591         (static var comparison_func) Removed.
2592         (static var comparison_param) Removed.
2593         (comparison_helper) Removed.
2594         (get_freq_comparator) New function.
2595         (not_missing) New function.
2596         (add_freq) Removed.
2597         (postprocess_freq_tab) Use hash table functions, algorithms,
2598         get_freq_comparator().  Rewrite.
2599         (cleanup_freq_tab) Rephrase.
2600         (add_percentile) Clean up spacing.
2601         (hash_value_numeric) New function.
2602         (hash_value_alpha) New function.
2603         (compare_value_numeric_a) Rewrite.
2604         (compare_value_alpha_a) Rewrite.
2605         (compare_value_numeric_d) Rewrite.
2606         (compare_value_alpha_d) Rewrite.
2607         (compare_freq_numeric_a) Rewrite.
2608         (compare_freq_alpha_a) Rewrite.
2609         (compare_freq_numeric_d) Rewrite.
2610         (compare_freq_alpha_d) Rewrite.
2611         (calc_stats) Clean up mode, percentiles, max.
2612         (dump_statistics) Clean up spacing.
2613         
2614         * frequencies.g: Removed.
2615
2616         * var.h: (struct freq_tab) Change `data' to hash table.
2617
2618 Fri Dec 19 14:15:46 2003  Ben Pfaff  <blp@gnu.org>
2619
2620         * file-handle.h: Remove declaration of global variable `files',
2621         which wasn't used anywhere.
2622
2623         * postscript.c: (add_encoding) Remove superfluous cast.
2624         (line) Ditto.
2625
2626         * sfm-read.c: [linux] (bswap_int32) Drop ntohl() non-portable
2627         version.
2628
2629         * temporary.c: [0] (display_tree) Removed.
2630
2631 Fri Dec 19 14:13:04 2003  Ben Pfaff  <blp@gnu.org>
2632
2633         Implement a new random number generator based on the alleged RC4
2634         algorithm.
2635
2636         * expr-evl.c: (expr_evaluate) Use rng_get_double_normal() instead
2637         of rand_normal().
2638
2639         * random.c: [!HAVE_GOOD_RANDOM] (real_rand) Removed.
2640         [!HAVE_GOOD_RANDOM] (real_srand) Removed.
2641         (macro k) Removed.
2642         (static var V[]) Removed.
2643         (static var Y) Removed.
2644         (static var X2) Removed.
2645         (setup_randomize) Removed.
2646         (shuffle) Removed.
2647         (rand_uniform) Removed.
2648         (rand_normal) Removed.
2649         (struct rng) New structure.
2650         (rng_create) New function.
2651         (rng_destroy) New function.
2652         (swap_byte) New static function.
2653         (rng_seed) New function.
2654         (rng_get_bytes) New function.
2655         (rng_get_int) New function.
2656         (rng_get_unsigned) New function.
2657         (rng_get_double) New function.
2658         (rng_get_double_normal) New function.
2659         (pspp_rng) New function.
2660
2661         * random.h: Sync up to random.c.
2662
2663         * sample.c: (struct sample_trns) Make `frac' unsigned and a
2664         fraction of UINT_MAX, not 65536.
2665         (cmd_sample) Use rng_get_unsigned(), rng_get_double(), UINT_MAX
2666         fraction.
2667
2668         * vfm.c: (open_active_file) No need to call setup_randomize() any
2669         longer.
2670
2671 Fri Dec 19 12:05:56 2003  Ben Pfaff  <blp@gnu.org>
2672
2673         Change dictionary name indexes to use hash tables instead of AVL
2674         trees.
2675
2676         * crosstabs.q: (free_var_dict) Use hash tables.
2677         (crs_custom_tables) Ditto.
2678         (calc_general) Ditto.
2679         (compare_table_entry) Rewrite.
2680         (enum_var_values) Reorder parameters.  All references updated.
2681         Rewrite.
2682
2683         * get.c: (rename_variable) Use hash tables.
2684         (mtf_merge_dictionary) Ditto.
2685
2686         * glob.c: (init_glob) Use hash tables.
2687         (cmp_variable) Removed.
2688
2689         * means.q: (mns_custom_tables) Use hash tables.
2690
2691         * modify-vars.c: (rearrange_dict) Use hash tables.
2692
2693         * rename-vars.c: (cmd_rename_variables) Use hash tables.
2694
2695         * sfm-read.c: (read_header) Use hash tables.
2696         (read_variables) Ditto.
2697
2698         * temporary.c: (new_dictionary) Use hash tables.
2699         (save_dictionary) Ditto.
2700         (restore_dictionary) Ditto.
2701
2702         * var.h: (struct dictionary) Change AVL tree `var_by_name' into
2703         hash table `name_tab'.
2704
2705         * vars-atr.c: [DEBUGGING] (dump_one_var_node) Removed.
2706         [DEBUGGING] (dump_var_tree) Removed.
2707         (find_variable) Use hash tables.
2708         (find_dict_variable) Ditto.
2709         (common_init_stuff) Ditto.
2710         (rename_variable) Ditto.
2711         (clear_variable) Ditto.  Also, remove debug code.
2712         (dup_variable) Use hash tables.
2713
2714         * vars-prs.c: (fill_all_vars) Use hash tables.
2715         (is_dict_varname) Ditto.
2716         (parse_dict_variable) Ditto.
2717         
2718 Fri Dec 19 11:46:23 2003  Ben Pfaff  <blp@gnu.org>
2719
2720         Change value labels to use hash tables instead of AVL trees, and
2721         change value labels into an ADT.
2722
2723         * Makefile.am: (pspp_SOURCES) Add value-labels.c, value-labels.h.
2724         
2725         * value-labels.c: New file.
2726
2727         * value-labels.h: New file.
2728
2729         * apply-dict.c: (cmd_apply_dictionary) Use value label ADT.
2730         Get rid of a stupid use of goto.
2731
2732         * autorecode.c: (compare_alpha_value) Rewrite.
2733         (hash_alpha_value) Ditto.
2734         (compare_numeric_value) Rewrite.
2735         (hash_numeric_value) Ditto.
2736
2737         * frequencies.q: (dump_full) Use value label ADT.
2738
2739         * pfm-read.c: (read_value_label) Use value label ADT.
2740
2741         * pfm-write.c: (write_value_labels) Use value label ADT.
2742
2743         * sfm-read.c: (read_variables) Use value label ADT.
2744         (read_value_labels) Rewrite.
2745
2746         * sfm-write.c: (write_value_labels) Rewrite.
2747
2748         * sysfile-info.c: (cmd_sysfile_info) Use value label ADT.
2749         (display_variables) Ditto.
2750         (describe_variable) Ditto.
2751
2752         * t-test.q: (print_t_groups) Use value label ADT.
2753
2754         * temporary.c: (copy_variable) Use value label ADT.
2755         (free_dictionary) Ditto.
2756
2757         * val-labs.c: (verify_val_labs) Use value label ADT.
2758         (get_label) Ditto.
2759         (debug_print) Ditto.
2760         (val_lab_cmp) Removed.
2761         (inc_ref_count) Removed.
2762         (copy_value_labels) Removed.
2763
2764         * var.h: (struct value_label) Removed.
2765         (struct variable) Change AVL tree `val_lab' into hash table
2766         `val_labs'.
2767
2768         * vars-atr.c: (init_variable) Use value label ADT.
2769         (clear_variable) Ditto.
2770         (free_value_label) Removed.
2771         (free_val_lab) Removed.
2772         (get_val_lab) Removed.
2773         (compare_variables) New function.
2774         (hash_variable) New function.
2775
2776         * vfm.c: (dump_splits) Use value label ADT.
2777
2778 Fri Dec 19 11:18:11 2003  Ben Pfaff  <blp@gnu.org>
2779
2780         Add to the hash table interface.
2781
2782         * hash.c: (hsh_hash_bytes) Add assertion.
2783         (hsh_hash_string) Ditto.
2784         (hsh_clear) Ditto.
2785         (hsh_rehash) Ditto.
2786         (hsh_probe) Ditto.
2787         (hsh_create) Ditto.  Also make minimum `size'.
2788         (hsh_destroy) Rephrase.
2789         (sort_nulls_last) Removed.
2790         (not_null) New function.
2791         (hsh_data) Ditto.
2792         (comparison_helper) Ditto.
2793         (hsh_sort) Rewritten.
2794         (hsh_data_copy) New function.
2795         (hsh_sort_copy) Ditto.
2796         (hsh_insert) Ditto.
2797         (hsh_replace) Ditto.
2798         (hsh_hash_double) Ditto.
2799         (hsh_delete) Fix stupid bug.
2800         
2801 Thu Dec 18 12:27:03 WAST 2003 John Darrington <john@darrington.wattle.id.au>
2802         * added a calculation of the mode to FREQUENCIES
2803
2804 Wed Dec 17 12:53:01 WAST 2003 John Darrington <john@darrington.wattle.id.au>
2805
2806         * moved (un)defs of DEBUGGING to config.h
2807
2808 Mon Dec 15 21:35:59 2003  Ben Pfaff  <blp@gnu.org>
2809
2810         * groff-font.c: (add_kern) Fix indentation.
2811         (add_kern) Use & instead of % to take power-of-2 modulus.
2812         (font_get_kern_adjust) Likewise.
2813
2814 Fri Dec 12 23:54:37 2003  Ben Pfaff  <blp@gnu.org>
2815
2816         * autorecode.c: (recode) Replace stupid use of memcpy() by
2817         memberwise copy.
2818         (hash_alpha_value) Use hsh_hash_bytes().  Get rid of nasty casts.
2819         (hash_numeric_value) Ditto.
2820         (autorecode_proc_func) pool_strdup() was wrong here because the
2821         source string was not null-terminated.  Use new pool_strndup()
2822         instead.
2823
2824         * crosstabs.q: (enum_var_values) Remove superfluous and bizarre
2825         use of hsh_iterator_init().
2826
2827         * data-in.c: (parse_N) Initialize i->v->f.
2828
2829         * flip.c: (cmd_flip) Use memmove(), not memcpy(), to copy
2830         overlapping arrays.
2831
2832         * groff-font.c: Use power-of-2 hash table sizes, not prime.
2833         (groff_read_font) Don't call hsh_next_prime().  Don't call
2834         fclose(NULL).
2835         (static var hash) Remove `size_p', `max_used' members.
2836         (font_char_name_to_index) Don't call hsh_next_prime().  Use
2837         hsh_hash_string() instead of hashpjw(), & instead of %.
2838         (default_font) Don't call hsh_next_prime().
2839
2840         * pool.c: (pool_strndup) New function.
2841         (pool_strdup) Reimplement in terms of pool_strndup.
2842
2843         * postscript.c: (hash_font_entry) Use hsh_hash_string().  Get rid
2844         of nasty casts.
2845         (hash_ps_encoding) Use hsh_hash_string().
2846         (hash_ps_combo) Use hsh_hash_string(), hsh_hash_int().
2847         (hash_filename2font) Use hsh_hash_string().
2848
2849         * som.c: Add #include <stdlib.h>.
2850
2851         * tab.c: (tab_destroy) Don't set t->container after freeing `t'
2852         (by destroying its pool).
2853         
2854 Fri Dec 12 23:18:59 2003  Ben Pfaff  <blp@gnu.org>
2855
2856         Miscellaneous hash table code cleanup:
2857         
2858         * hash.h: (struct hsh_table) Moved into hash.c.
2859         (hsh_count) Ditto, and transformed into function.
2860         (hsh_compare_func) New typedef, used for defining otherwise-long
2861         function types here and in hash.c
2862         (hsh_hash_func) Ditto.
2863         (hsh_free_func) Ditto.
2864         
2865         * hash.c: (struct hsh_table) Renamed `n' to `used', `m' to `size',
2866         `table' to `entries'.  Removed `mp'.  All references updated.
2867         (hsh_clear) Don't shrink entries array; if the hash was this big
2868         once, it probably will be again.
2869         (hsh_rehash) Made static.
2870         (force_hsh_insert) Renamed hsh_force_insert.
2871         (force_hsh_find) Renamed hsh_force_find.
2872
2873         Made hash table sizes powers of 2, because that's fine with any
2874         reasonable hash function and because taking a power-of-2 modulus
2875         is faster than any other:
2876         
2877         (hsh_prime_tab) Removed;
2878         (hsh_next_prime) Ditto.
2879         (next_power_of_2) New function.
2880         (hsh_create) Use next_power_of_2.
2881         (hsh_rehash) Use & instead of %.
2882
2883         Cleaned up hsh_sort:
2884         
2885         (internal_comparison_fn) Removed.
2886         (sort_nulls_last) New function.
2887         (hsh_sort) Removed second parameter, switched to using the new
2888         quicksort() function from quicksort.h to avoid using nasty need
2889         for static variables with qsort().  All references updated.
2890
2891         Changed the hash functions offered, because there are better hash
2892         functions than the ones we had, and cleaned up the names to boot:
2893         
2894         * hash.c: (hashpjw_d) Removed.
2895         (hashpjw) Ditto.
2896         (hsh_hash_bytes) New function.
2897         (hsh_hash_string) New function.
2898         (hsh_hash_int) New function.
2899
2900         Improved the hash table iteration interface:
2901         
2902         * hash.h: (hsh_iterator_init) Removed.
2903         (struct hsh_iterator) Removed `init' member, change `next' to
2904         size_t.
2905
2906         * hash.c: (hsh_foreach) Removed.  All references updated to use
2907         hsh_first/hsh_next instead.
2908         (hsh_first) New function.  Notably, unlike hsh_foreach() it does
2909         not treat a null pointer as an empty hash table.
2910         (hsh_next) New function.
2911
2912         Made deletion possible, though slow:
2913
2914         * hash.c: (locate_matching_entry) New function.
2915         (hsh_find) Use locate_matching_entry().
2916         (hsh_delete) New function also using locate_matching_entry().
2917         (hsh_force_delete) New function.
2918
2919 Fri Dec 12 23:16:10 2003  Ben Pfaff  <blp@gnu.org>
2920
2921         * quicksort.c: New file implementing a sort routine with a
2922         interface better than qsort() because it passes a user-provided
2923         parameter to the sort routine.
2924
2925         * Makefile.am: Add quicksort.c, quicksort.h.
2926
2927 Fri Dec 12 13:31:58 2003  Ben Pfaff  <blp@gnu.org>
2928
2929         * All source files: Get rid of nasty special cases for Checker,
2930         which is pretty obsolete now.
2931
2932 Thu Dec 11 21:38:24 WST 2003 John Darrington <john@darrington.wattle.id.au>
2933
2934         * Fixed a bug apparent when using the FREQUENCIES command with the
2935         html driver.  The html driver was incorrectly trying to display 
2936         empty cells.
2937
2938 Sun Jan  2 21:40:13 2000  Ben Pfaff  <blp@gnu.org>
2939
2940         * Makefile.am: Reorganized.  Put locale dir in version.c instead
2941         of passing it to each compile command.  Only put local gmp libs in
2942         LD_ADD if not installed on system.  Remove `boast' target.
2943
2944         * All source files: struct and union typedefs eliminated.
2945         `sizeof type' replaced by `sizeof object' where practical.  Moved
2946         `unused' qualifiers from start to end of declarations for gcc
2947         2.7.2 compatibility.  Change `while (1)' to `for (;;)'.  Made
2948         assertions on pointers strictly compliant.  Removed _ prefixes on
2949         some function parameter names.
2950
2951         * alloc.c: New source file, containing these external linkage
2952         functions removed from common.c: xmalloc, xcalloc, xrealloc,
2953         xstrdup.
2954
2955         * arena.c: Removed.
2956         
2957         * arena.h: Removed.
2958
2959         * ascii.c: Migrated from arenas to pools.
2960         (struct ascii_driver_ext) ops[], box[], fonts[] changed from
2961         c_string to len_string.  All references changed.
2962         (ascii_option) Signature changed to comply to new output.c
2963         interface.
2964         (count_fancy_chars) Removed.
2965         (delineate) Removed support for rich text.
2966         (ascii_text_metrics) Ditto.
2967         (text_draw) Ditto.
2968         (output_shorts) Change `box', `off', `on' from c_string to
2969         len_string.  Change `remaining' from int to size_t.
2970         (ascii_close_page) Make page numbering less haphazard.
2971
2972         * autorecode.c: Migrate from arenas to pools.
2973
2974         * avl.c: Migrate from arenas to pools.  Synch from libavl 1.4.0.
2975
2976         * bitvector.h: New file containing these macros from misc.h:
2977         SET_BIT, CLEAR_BIT, SET_BIT_TO, TEST_BIT, BIT_INDEX.
2978
2979         * command.c: (struct command) cmd1, cmd2, cmd3 members changed to
2980         word[3].  ncmd removed.
2981         (var empty_string) Removed.
2982         (var cmd_table) Declaration updated.
2983         (var cmdtab) Removed.
2984         (cmp_command) Removed.
2985         (split_words) Rewritten to use strtok_r().
2986         (init_cmd_parser) Renamed cmd_init().  Rewritten.
2987         (find_command) Removed.
2988         (FILE_TYPE_okay) Rewritten.
2989         (cmd_parse) Rewritten.  Semantics of the return value of command
2990         handlers has changed: they must now return one of the new CMD_*
2991         enumerals, rather than a magic value.  This meant that all
2992         commands had to be modified, and they were.
2993         (figure_out_command) New function.
2994
2995         * command.def: Add CORRELATIONS, PEARSON CORRELATIONS.  Add
2996         #defines for INIT, INPU, etc.
2997
2998         * command.h: New CMD_* enum series.
2999         (cur_proc) Make const char *, not char *.
3000         (cmd_init) Prototype.
3001         (cmd_parse) Ditto.
3002
3003         * common.c: Removed.
3004
3005         * common.h: Removed.
3006
3007         * correlations.q: New file.
3008
3009         * crosstabs.q: Migrate from arenas to pools.  Migrate to new-style
3010         q2c.
3011         (custom_tables) Renamed crs_custom_tables().
3012         (custom_variables) Renamed crs_custom_variables().
3013         (calc_integer) Add in some `const' qualifiers.
3014         (table_value_missing) Change from a_string to len_string.
3015         (float_M_suffix) Change from a_string to len_string.
3016
3017         * data-in.c: Rewritten.  All references to
3018         parse_string_as_format() changed to data_in().
3019
3020         * data-in.h: New file.
3021
3022         * data-list.c: Change DLS_* from #define's to enums.  Move from
3023         rpd_msg() to tmsg().
3024         (RPD_ERR) New #define.
3025         (do_reading) Change dfm_push_cust() to dfm_push(), pop_cust() to
3026         dfm_pop().
3027         (read_from_data_list_fixed) Change from old
3028         parse_string_as_format() to new data_in().
3029         (read_from_data_list_free) Ditto.
3030         (read_from_data_list_list) Ditto.
3031         (cmd_repeating_data) Modify approach to checking for end of
3032         command.
3033         (rpd_msg) Removed.
3034         (rpd_parse_record) Change from old parse_string_as_format() to new
3035         data_in().  Change from old convert_format_to_string() to new
3036         data_out().
3037         (read_one_set_of_repetitions) Change dfm_push_cust() to
3038         dfm_push(), pop_cust() to dfm_pop().
3039
3040         * data-out.c: Rewritten.  All references to
3041         convert_format_to_string() changed to data_out().
3042
3043         * descript.q: Migrate to new q2c.
3044         (cmd_descriptives) Removed.
3045         (internal_cmd_descriptives) Renamed cmd_descriptives ().
3046         (custom_variables) Renamed dsc_custom_variables().
3047
3048         * dfm.c: (struct dfm_fhuser_ext) `ln' removed.  All references
3049         removed.
3050         (open_file_r) Initialize h->where.line_number.  Migrate to new
3051         struct string.
3052         (open_file_w) Initialize h->where.line_number.
3053         (read_record) Change from ext->ln to h->where.line_number.
3054         Migrate to struct string.
3055         (dfm_put_record) Rephrased.
3056         (dfm_push_cust) Renamed dfm_push(), rewritten.
3057         (dfm_pop) New function.
3058
3059         * error.c: All references updated.
3060         (glob var error_count) Renamed err_err_count.
3061         (glob var warning_count) Renamed err_warning_count.
3062         (glob var error_already_flagged) Renamed err_already_flagged.
3063         (glob var verbosity) Renamed err_verbosity.
3064         (glob var cust_fn) Removed.
3065         (glob var cust_ln) Removed.
3066         (static var file_loc) New.
3067         (static var nfile_loc) New.
3068         (static var mfile_loc) New.
3069         (tmsg) New function.
3070         (push_cust) Removed.
3071         (pop_cust) Removed.
3072         (msg) Rewritten.
3073         (static var terminating) Removed.
3074         (failure) Renamed err_failure().
3075         (hcf) Renamed err_hcf().
3076         (err_push_file_locator) New function.
3077         (err_pop_file_locator) New function.
3078         (err_location) New function.
3079         (check_error_count) Renamed err_check_count().
3080         (vmsg) Renamed err_vmsg().  Interface changed.
3081         (verbose_msg) Removed.
3082         (err_cond_fail) New function.
3083         (error_break) Renamed err_break().
3084
3085         * error.h: All references updated.
3086         (enum MSG_CLASS_COUNT) Renamed ERR_CLASS_COUNT.
3087         (enum ERR_CLASS_MASK, ERR_VERBOSITY_SHIFT, ERR_VERBOSITY_MASK)
3088         New.
3089         (struct file_locator) New.
3090         (struct error) New.
3091         (macro verbose_msg) Removed.
3092         (macro cond_fail) Removed.
3093
3094         * expr-opt.c: (evaluate_tree) sizeof(char) == 1.
3095
3096         * expr-prs.c: Reorganized.  All references updated.
3097         (exprtypename) Renamed expr_type_name().
3098         (typename) Renamed type_name().
3099         (free_expression) Renamed expr_free().
3100         (parse_expression) Renamed expr_parse().  Uses new type_check()
3101         function.
3102         (init_functab) Renamed init_func_tab().
3103         (type_check) New function.
3104         (parse_or) Rewritten to use new allocate_nonterminal() and
3105         append_nonterminal_arg() functions.
3106         (parse_and) Ditto.
3107         (parse_not) Ditto.
3108         (parse_rel) Ditto.  Also simplified logic.
3109         (parse_add) Ditto.
3110         (parse_mul) Ditto.
3111         (parse_neg) Ditto.
3112         (parse_exp) Ditto.
3113         (SYSMIS_func) Ditto.
3114         (VALUE_func) Rephrased.
3115         (CONCAT_func) Fix memory leak by replacing free by free_node on
3116         lossage.
3117         (generic_str_func) Ditto.
3118         (parse_function) Ditto.  Also rephrasings.  Uses bsearch() to find
3119         function.
3120         (allocate_nonterminal) New function.
3121         (append_nonterminal_arg) New function.
3122         (static func_tab[]) Now at file level.
3123         (cmp_func) Moved.
3124         (init_func_tab) Moved.  Now just uses qsort() to sort func_tab[].
3125
3126         * expr.h: (enum series OP_*) Moved to exprP.h.
3127         (OP_* defines) Ditto.
3128         (struct op_desc) Ditto.
3129         (global ops[]) Ditto.
3130         (struct num_con_node) Ditto.
3131         (struct str_con_node) Ditto.
3132         (struct var_node) Ditto.
3133         (struct lag_node) Ditto.
3134         (struct casenum_node) Ditto.
3135         (struct nonterm_node) Ditto.
3136         (union any_node) Members renamed.
3137         (struct sys_node) Removed.
3138         (struct val_node) Removed.
3139         (operator typedef) Removed.
3140         (typedef exprtype) Removed.
3141         (enum series EX_*) Moved to exprP.h.
3142         (struct expression) Ditto.  Also renamed a lot of the members.
3143         (PXP_* defines) Changed to enums.
3144         (free_node prototype) Moved to exprP.h.
3145
3146         * file-handle.h: (struct file_handle) New member `where'.
3147
3148         * file-handle.q: Migrated to new q2c format.
3149         (prepend_current_directory) Removed (dead code).
3150         (cmd_file_handle) Incorporated all of internal_cmd_file_handle().
3151         (fh_get_handle_by_filename) Removed dead code.
3152         Set new `where' member.
3153
3154         * file-type.c: (file_type_source_read) References to
3155         parse_string_as_format() changed to data_in().
3156         dfm_push_cust()/pop_cust() changed to dfm_push()/dfm_pop().
3157
3158         * filename.c: All references updated.
3159         (init_filename) Renamed fn_init().
3160         (expand_line) Removed.
3161         (macro EXPAND_LINE) Removed.
3162         (interp_vars) Renamed fn_interp_vars().  Now uses st_*() instead
3163         of custom functions.
3164         (gnu_getcwd) Renamed fn_get_cwd(), rewritten.
3165         (tilde_expand) Renamed fn_tilde_expand(), uses ds_*().
3166         (normalize_filename) Renamed fn_normalize().
3167         (search_path) Renamed fn_search_path(), rewritten.
3168         (prepend_dir) Renamed fn_prepend_dir().
3169         (blp_getenv) Renamed fn_getenv().
3170         (blp_dirname) Renamed fn_dirname().
3171         (fn_basename) New function, not used.
3172         (absolute_filename_p) Renamed fn_absolute_p().
3173         (is_special_filename) Renamed fn_special_p().
3174         (file_exists) Renamed fn_exists_p().
3175         (readlink_malloc) Renamed fn_readlink().
3176         (getenv_default) Renamed fn_getenv_default().
3177         (open_file) Renamed fn_open().
3178         (close_file) Renamed fn_close().
3179         (open_file_ext) Renamed fn_open_ext().
3180         (close_file_ext) Renamed fn_close_ext().
3181
3182         * font.h: Migrate from arenas to pools.
3183
3184         * format.c: (parse_format_specifier_name) Deal with ds_* strings.
3185
3186         * frequencies.g: Migrate from arenas to pools.
3187
3188         * frequencies.q: Migrate to new q2c version.  Migrate from arenas
3189         to pools.
3190
3191         * getline.c: All references updated.
3192         (global getl_buf) Changed from char * to struct string.
3193         (static getl_include_path) Ditto.
3194         (global getl_buf_len) Removed.
3195         (global getl_buf_size) Removed.
3196         (getl_include_path) Deal with new getl_buf, getl_include_path.
3197         (getl_uninitialize) New function.
3198         (getl_get_current_directory) Rewritten.
3199         (getl_clear_include_path) Rewritten.
3200         (getl_add_include_dir) Rewritten.
3201         (getl_add_file) Assertion fixed.
3202         (getl_add_virtual_file) Change initial value of `remaining_loops'
3203         from 2 to 1.
3204         (welcome) Rewritten.
3205         (handle_line_buffer) Make static.  Change logic to make
3206         getl_add_virtual_file() change sensible.  Use ds_*() strings.
3207         (getl_read_line) Use ds_*() strings.  Implement SET ECHO.
3208         (getl_close_file) Moved.
3209         (getl_location) New function.
3210
3211         * getline.h: All references updated.
3212         (macro curln) Removed.
3213         (macro curfn) Removed.
3214         (macro am_interactive) Renamed getl_am_interactive.
3215         (macro am_reading_script) Renamed getl_reading_script.
3216
3217         * glob.c: (global fmt_parse_ignore_error) Removed.
3218         (init_glob) Use locale_dir not LOCALEDIR.  Use feholdexcept() on
3219         systems that support it (C99).  Turn off SET ECHO by default.  No
3220         necessary julcal initialization anymore.
3221
3222         * groff-font.c: Migrate from arenas to pools.
3223         (groff_read_font) Use err_push_file_locator().
3224         (groff_read_DESC) Ditto.
3225         (font_msg) Use tmsg().
3226
3227         * hash.c: (hsh_sort) Fix debug code.
3228         [GLOBAL_DEBUGGING] Include stdio.h.
3229
3230         * hash.h: (macro force_hsh_insert) Rephrase.
3231
3232         * heap.c: Rewritten.
3233         
3234         * heap.h: Rewritten.
3235
3236         * html.c: (html_option) Change from outp_value to struct string.
3237         (postopen) Change from curfn to getl_location().
3238         (escape_string) Remove rich-text code.  Signature changed.
3239         (output_tab_table) Switch from a_string to struct len_string.
3240         Remove rich text support.
3241
3242         * lexer.c: All references updated.  Largely rewritten.  Major
3243         changes listed below.  Removed tagged quote support.  Adapted to
3244         struct string tokstr.
3245         (global tokstr) Changed to struct string.
3246         (global tokstr_size) Removed.
3247         (global tokstr_len) Removed.
3248         (global tokid) New.
3249         (global tokint) Removed.
3250         (global toklongstr) Removed.
3251         (C* defines) Removed.
3252         (static tbl[]) Removed.
3253         (static id[]) Removed.
3254         (static une[]) Removed.
3255         (discard_line) Renamed lex_discard_line().
3256         (get_entire_line) Renamed lex_entire_line().
3257         (get_rest_of_line) Renamed lex_rest_of_line().
3258         (get_dotted_rest_of_line) Merged into lex_rest_of_line().
3259         (make_hexit) Removed.
3260         (syntax_error) Renamed lex_error().  Return value removed.
3261         (get_token_representation) Renamed lex_token_representation().
3262         (putback) Renamed lex_put_back().
3263         (putfwd) Renamed lex_put_forward().
3264         (convert_negative_to_dash) Renamed lex_negative_to_dash().
3265         (set_prog) Renamed lex_set_prog().
3266         (init_lex) Renamed lex_init().
3267         (reset_eof) Renamed lex_reset_eof().
3268         (lookahead) Renamed lex_look_ahead().
3269         (check_id) Rewritten.
3270         (yylex) Renamed lex_get(), rewritten.
3271         (lex_end_of_command) New function.  Many commands were rephrased
3272         using this.
3273         (lex_integer_p) New function.  Replaces compare of tokint against
3274         NOT_LONG.
3275         (lex_integer) New function.  Replaces tokint.
3276         (match_tok) Renamed lex_match().
3277         (match_id) Renamed lex_match_id().
3278         (match_int) Renamed lex_match_int().
3279         (force_match_id) Renamed lex_force_match_id(), added return value.
3280         (force_match) Renamed lex_force_match(), added return value.
3281         (force_string) Renamed lex_force_string(), added return value.
3282         (force_int) Renamed lex_force_int(), added return value.
3283         (lex_id_match_len) New function.
3284         (id_match) Renamed lex_id_match(), rewritten.
3285         (get_line) Renamed lex_get_line().
3286         (preprocess_line) Renamed lex_preprocess_line().
3287         (tokname) Renamed lex_token_name().
3288         (bin_value_func) Removed.
3289         (oct_value_func) Removed.
3290         (hex_value_func) Removed.
3291         (unexpected_eof) New function.
3292         (convert_numeric_string_to_char_string) New function.
3293         (parse_string) Rewritten, signature changed.
3294         (add_tokstr_char) Removed.
3295         (add_tokstr_unsigned) Removed.
3296         (add_tokstr_string) Removed.
3297         (parse_tagged_quote) Removed.
3298         (skip_comment) Renamed lex_skip_comment().
3299
3300         * lexer.h: All references updated.
3301         (macro is_id1) Renamed CHAR_IS_ID1.
3302         (macro is_idn) Renamed CHAR_IS_IDN.
3303         (token names ID, NUM, STRING, STOP, ... WITH, EXP) Renamed with
3304         prefix T_: T_ID, T_NUM, T_STRING, T_STOP, ... T_WITH, T_EXP.
3305         (macro get_token) Removed.
3306         (macro id_match) Removed.
3307         (macro force_match_id) Removed.
3308         (macro force_match) Removed.
3309         (macro force_string) Removed.
3310         (macro force_int) Removed.
3311         (macro force_num) Removed.
3312         (macro force_id) Removed.
3313
3314         * lexerP.h: Removed.
3315
3316         * list.q: Migrated to new q2c format.
3317         (write_line) Deal with struct len_string.
3318         (write_varname) Ditto.
3319         (write_fallback_headers) Ditto.
3320
3321         * magic.c: New file, incorporating the following global variables
3322         previously in other files: endian, second_lowest_value.  And both
3323         of those are conditional on #define's.
3324
3325         * magic.h: New file, incorporating the following global variable
3326         declarations: endian, second_lowest_value, and the following macro
3327         declarations: NOT_DOUBLE, NOT_LONG, NOT_INT.
3328
3329         * main.c: Added declarations of pgmname, finished, curdate,
3330         start_interactive.
3331         (main) Call new parse_script() function.
3332         (parse_script) New function.
3333         (execute_command) New function.
3334         (dump_token) Removed.
3335         (handle_error) New function.
3336
3337         * matrix.c: New file.
3338
3339         * matrix.h: New file.
3340
3341         * matrix-data.c: Migrated from arenas to pools.
3342         (mget_token) Change from parse_string_as_format() to data_in().
3343
3344         * means.q: Migrate to new q2c.
3345         (custom_tables) Renamed mns_custom_tables().
3346         (custom_crossbreak) Renamed mns_custom_crossbreak().
3347         (custom_variables) Renamed mns_custom_variables().
3348
3349         * mis-val.c: (static var width) Changed from `int' to `size_t'.
3350         (parse_varnames) Prototype.
3351         (parse_numeric) Rephrasings.
3352         (parse_alpha) Adapt to new struct string tokstr.
3353
3354         * misc.c: (intlog10) Rewritten.
3355         (spacing) Removed.
3356         (ansi_rand) Renamed real_rand(), moved into random.c.
3357         (ansi_srand) Renamed real_srand(), moved into random.c.
3358         (setup_randomize) Moved to random.c.
3359         (rand_uniform) Ditto.
3360         (rand_normal) Ditto.
3361         (rand_simple) Ditto.
3362         (get_config_line) Removed.
3363         (reverse) Removed (dead code).
3364
3365         * misc.h: (macro SET_BIT) Moved to bitvector.h.
3366         (macro CLEAR_BIT) Ditto.
3367         (macro TEST_BIT) Ditto.
3368         (macro SET_BIT_TO) Ditto.
3369         (macro BIT_INDEX) Ditto.
3370
3371         * output.c: (outp_read_devices) Move to err_push_file_locator()
3372         from push_cust().  Use struct string.
3373         (expand_op_tokstr) Removed.
3374         (static var op_tokstr) Changed to struct string.
3375         (static var op_tokstr_size) Removed.
3376         (tokener) Rephrasings.  Use struct string.
3377         (parse_options) Use struct string.
3378         (destroy_driver) Fix assertion.
3379         (outp_get_paper_size) Move to err_push_file_locator().
3380         [0] Removed dead code.
3381         (outp_string_width) Move to len_string.
3382
3383         * output.h: Comment fixes.
3384         (TAG_* enum series) Removed.
3385         (struct outp_value) Removed.
3386         (enum OUTP_T_FANCY) Removed.
3387         (struct outp_text) `s' changed from a_string to len_string.
3388         (struct outp_class) `option' change arg 3 from outp_value to
3389         struct string.
3390
3391         * pfm-read.c: (corrupt_msg) Rewritten.
3392
3393         * pfm-write.c: (bufwrite) Fix assertion.
3394
3395         * pool.c: New file, reference version.
3396
3397         * pool.h: New file, reference version.
3398
3399         * postscript.c: (ps_font_sizes) Fix assertion.
3400         (ps_option) Change arg 3 from outp_value to struct string.
3401         Adapt to struct string.
3402         (macro output_line) Removed.
3403         (macro add_string) Removed.
3404         (output_encodings) Adapted to struct string.  Moved to
3405         err_push_file_locator().
3406         (find_encoding_file) Fix assertion.
3407         (read_ps_encodings) Move to err_push_file_locator().
3408         (postopen) Use getl_location() instead of curfn.
3409         (out_text_plain) Move to len_string.
3410         (text) Ditto.  Remove rich text support.
3411
3412         * print.c: (cmd_print) Remove now-unneeded resource cleanup code.
3413         (cmd_print_eject) Ditto.
3414         (cmd_write) Ditto.
3415         (internal_cmd_print) Now cleans up after itself.  Uses
3416         fh_parse_file_handle() now.
3417         (cmd_print_space) Use PXP_NUMERIC to type-check.
3418
3419         * q2c.c: Overhauled.  Removed _("") i18n support.  All references
3420         updated.  All output functions updated to handle structures rather
3421         than local or static variables.  Adapt to new PSPP lex_*()
3422         functions.
3423         (macro _) Removed.
3424         (macro N_) Removed.
3425         (macro MAX_N_SBC) Removed.
3426         (global bare) Removed.
3427         (enum STRING) Renamed T_STRING.
3428         (enum ID) Renamed T_ID.
3429         (get_buffer) Buffer size increased.
3430         (strlower) Renamed st_lower(), rephrased.
3431         (strupper) Renamed st_upper(), rephrased.
3432         (skip_ws) New function.
3433         (get_line) Don't special-case any types of lines (like those
3434         beginning with ! or $, for instance).
3435         (get_token) Renamed lex_get().  Rephrased.
3436         (static var `prefix') New.
3437         (parse) New function.
3438         (parse_setting) Minor rephrasing.
3439         (dump_specifier_vars) Ditto.
3440         (make_identifier) Put null terminator on identifier, duh.
3441         (dump_vars) Renamed dump_declarations().  Never indent.  Never
3442         static.  Output changed entirely.
3443         (dump_specifier_init) Rephrase.
3444         (dump_vars_init) No index variable needed.  Other modifications.
3445         (dump_parser) Don't parse command name.  Do dump functions instead
3446         of just code fragments.
3447         (dump_free) Dump function instead of code fragment.
3448         (recognize_directive) New function.
3449         (main) Use recognize_directive().  Don't rely on magic $ line
3450         beginning: instead, parse comments.  Update list of headers.
3451
3452         * random.c: New file, containing the following functions:
3453         real_rand(), real_srand(), setup_randomize, shuffle, rand_uniform,
3454         rand_normal, rand_simple.
3455
3456         * random.h: New file.
3457
3458         * recode.c: (cmd_recode) Merge internal_cmd_recode() into this
3459         function.  `max_src_width', `max_dst_width' changed to size_t.
3460         (internal_cmd_recode) Removed.
3461         (parse_dest_spec) Merge similar cases.
3462         (parse_src_spec) Add assertion.
3463
3464         * repeat.c: (recognize_keyword) New function.
3465         (internal_cmd_do_repeat) Parse and handle PRINT keyword on END
3466         REPEAT.  Improve recognition of END REPEAT (use
3467         recognize_keyword()).  Move from curfn to getl_location().  Use
3468         struct string.
3469                 
3470         (perform_DO_REPEAT_substitutions) Adapt to struct string.
3471
3472         * set.q: Adapt to new q2c.
3473         (cmd_set) Range-check some values better.
3474         (custom_blanks) Renamed stc_custom_blanks().
3475         (custom_length) Renamed stc_custom_length().
3476         (custom_results) Renamed stc_custom_results().
3477         (custom_seed) Renamed stc_custom_seed().
3478         (custom_width) Renamed stc_custom_width().
3479         (custom_format) Renamed stc_custom_format().
3480         (custom_journal) Renamed stc_custom_journal().
3481         (custom_color) Renamed stc_custom_color().
3482         (custom_listing) Renamed stc_custom_listing().
3483         (custom_disk) Renamed stc_custom_disk().
3484         (custom_log) Renamed stc_custom_log().
3485         (custom_rcolor) Renamed stc_custom_rcolor().
3486         (custom_viewlength) Renamed stc_custom_viewlength().
3487         (custom_workdev) Renamed stc_custom_workdev().
3488
3489         * settings.h: Not necessary to include format.h any longer.
3490
3491         * sfm-read.h: (macro bswap_int32) Moved here from sfmP.h.
3492         (corrupt_msg) Rewritten.
3493
3494         * sort.c: Adapt to rewritten heap ADT.
3495
3496         * str.c: (aa_strcpy) Removed.
3497         (ab_strcpy) Removed.
3498         (ac_strcpy) Removed.
3499         (ba_strcpy) Removed.
3500         (bb_strcpy) Removed.
3501         (ca_strcpy) Removed.
3502         (aa_strdup) Removed.
3503         (aa_strdupcpy) Removed.
3504         (ba_strdup) Removed.
3505         (sa_strdup) Removed.
3506         (memrev) Renamed mm_reverse().
3507         (memrmem) Renamed mm_find_reverse().
3508         (cmp_str) Renamed st_compare_pad().
3509         (strmaxcpy) Removed.
3510         (strbarepadcpy) Renamed st_bare_pad_copy(), signature changed.
3511         (strbarepadlencpy) Renamed st_bare_pad_len_copy(), signature
3512         changed.
3513         (strpadcpy) Renamed st_pad_copy(), signature changed.
3514         (blpstrset) Removed.
3515         (ds_create) New function.
3516         (ds_init) New function.
3517         (ds_replace) New function.
3518         (ds_destroy) New function.
3519         (ds_clear) New function.
3520         (ds_extend) New function.
3521         (ds_shrink) New function.
3522         (ds_truncate) New function.
3523         (ds_length) New function.
3524         (ds_size) New function.
3525         (ds_value) New function.
3526         (ds_end) New function.
3527         (ds_concat) New function.
3528         (ds_concat_buffer) New function.
3529         (ds_printf) New function.
3530         (ds_putchar) New function.
3531         (ds_getline) New function.
3532         (ds_get_config_line) New function derived from the old
3533         misc.c:get_config_line().
3534         (ls_create) New function.
3535         (ls_create_buffer) New function.
3536         (ls_init) New function.
3537         (ls_shallow_copy) New function.
3538         (ls_destroy) New function.
3539         (ls_null) New function.
3540         (ls_null_p) New function.
3541         (ls_empty_p) New function.
3542         (ls_length) New function.
3543         (ls_value) New function.
3544         (ls_end) New function.
3545
3546         * str.h: Reformatted.
3547         (struct a_string) Removed.
3548         (struct b_string) Removed.
3549         (struct c_string) Removed.
3550         (struct len_string) New.
3551         (struct string) New.
3552         (macro as_streq) Removed.
3553         (macro bs_streq) Removed.
3554         (macro cs_streq) Removed.
3555         (macro sa_streq) Removed.
3556         (macro sb_streq) Removed.
3557         [__GNUC__] (inline function ds_putchar) New function.
3558         [__GNUC__] (inline function ds_length) New function.
3559         [__GNUC__] (inline function ds_value) New function.
3560         [__GNUC__] (inline function ds_end) New function.
3561
3562         * sysfile-info.c: (cmd_sysfile_info) Rephrased.
3563         (display_vectors) Fix missing i18n.
3564
3565         * t-test.q: Migrate to new q2c.
3566
3567         * tab.c: Migrate from arenas to pools.
3568         (tab_create) Use struct len_string.
3569         (tab_realloc) Ditto.
3570         (text_format) Ditto.
3571         (tab_joint_text) Ditto.
3572         (tab_natural_width) Remove rich text support.
3573         (tab_natural_height) Ditto.
3574         (tab_output_text) Handle TAT_FIX.
3575         (tab_raw) Change arg from a_string to len_string.
3576         (tabi_driver) Fix assertion.  Use struct len_string.
3577         (render_strip) Use struct len_string.  Remove rich text support.
3578         Add `const' qualifiers.
3579
3580         * tab.h: (enum TAB_RICH) Remove.
3581         (enums TAB_COL_NONE, TAB_COL_DONE) New.  Where appropriate,
3582         SOM_COL_* updated to read TAB_COL_*.
3583         (struct tab_table) Change arena to pool.  Change a_string to
3584         len_string.
3585
3586         * temporary.c: (restore_dictionary) Rewrite Checker code.
3587
3588         * var.h: (macros MAX_SHORT_STRING, MIN_LONG_STRING, SYSMIS,
3589         LOWEST, HIGHEST) Moved here from common.h.
3590         (typedef any_trns) Removed.  All references changed to `struct
3591         trns_header'.
3592
3593         * vars-atr.c: (force_create_variable) Fix assertion.
3594         (force_dup_variable) Fix assertion.
3595         
3596 Thu Jun  3 18:40:42 1999  Ben Pfaff  <blp@gnu.org>
3597
3598         Using alphanumeric variables in functions under AGGREGATE
3599         segfaulted.  Fixed.  Thanks to Dr. Dirk Melcher
3600         <BZN-mdksh@t-online.de> for reporting this bug.
3601         
3602         * aggregate.c: (parse_aggregate_functions) When setting the
3603         FSTRING bit, also allocate memory for the `string' member of
3604         agr_next.
3605         (free_aggregate_functions) Free iter->string.  Don't use the
3606         non-function bits when indexing the array of functions.
3607         [DEBUGGING] (debug_print) Don't use the non-function bits when
3608         indexing the array of functions.        
3609
3610 Sun May 30 00:00:54 1999  Ben Pfaff  <blp@gnu.org>
3611
3612         Under certain circumstances, the final case would be omitted from
3613         the results of an AGGREGATE operation.  Fixed.  Thanks to Dr. Dirk
3614         Melcher <BZN-mdksh@t-online.de> for reporting this bug.
3615         
3616         * aggregate.c (agr_00x_end_func): Increment number of cases in
3617         sink before writing case.  For streams that keep track of how many
3618         cases there are based on this value, this means that the last case
3619         will be read in on the next stream read.
3620
3621 Sat May 29 22:03:31 1999  Ben Pfaff  <blp@gnu.org>
3622
3623         Undefined behavior was invoked by referencing a freed pointer.
3624         
3625         * vfm.c (memory_stream_write): Free pointer *after* checking for
3626         non-null status.
3627
3628 Sat May 29 22:02:22 1999  Ben Pfaff  <blp@gnu.org>
3629
3630         A wrong record size was displayed when paging the active file to
3631         disk.
3632         
3633         * vfm.c: (memory_stream_write) Fix off-by-one error.
3634
3635 Sat May 29 21:50:26 1999  Ben Pfaff  <blp@gnu.org>
3636
3637         Not having enough temporary space for sorting caused a core dump.
3638         Fixed.
3639         
3640         * sort.c: (allocate_cases) Initialize i.
3641
3642 Sat May 29 21:40:54 1999  Ben Pfaff  <blp@gnu.org>
3643
3644         Syntax errors in function descriptions on AGGREGATE caused core
3645         dumps.  Fixed.
3646         
3647         * aggregate.c (cmd_aggregate): Don't free agr_dict after calling
3648         free_aggregate_functions(), since that function already frees
3649         agr_dict.
3650         
3651 Sat May 29 21:06:10 1999  Ben Pfaff  <blp@gnu.org>
3652
3653         A null pointer was dereferenced, causing a core dump, when
3654         PERCENTILES was specified on FREQUENCIES.  This fixes the problem,
3655         but PSPP still doesn't calculate percentiles.  Thanks to Regnor
3656         Jernsletten <rjernsle@eunet.no> for reporting this problem.
3657         
3658         * arena.c: (arena_malloc) If the arena hasn't been initialized
3659         already, initialize it.
3660
3661 Sat May 29 20:47:29 1999  Ben Pfaff  <blp@gnu.org>
3662
3663         * Makefile.cygwin: New file supplied by Hankin <hankin@dunno.com>
3664         for compilation with Cygnus Windows B20.  Not used by other
3665         systems.
3666
3667 Sat May 29 20:36:04 1999  Ben Pfaff  <blp@gnu.org>
3668
3669         SORT always sorted in ascending order.  Fixed.  Thanks to Dr. Dirk
3670         Melcher <BZN-mdksh@t-online.de> for reporting this bug.
3671
3672         * sort.c: (compare_case_lists) Reverse sense of comparison if
3673         sorting in descending order.
3674         (compare_record) Ditto.
3675
3676 Tue Mar  9 13:18:54 1999  Ben Pfaff  <blp@gnu.org>
3677
3678         SPLIT FILE with a string variable caused a core dump.  Fixed.
3679
3680         * vfm.c: If the variable is a string then make a temporary value
3681         struct pointing to it.  The underlying problem is a lot bigger
3682         than this (see TODO) but this is a stopgap for the simple case at
3683         least.
3684         
3685 Tue Mar  9 13:15:53 1999  Ben Pfaff  <blp@gnu.org>
3686
3687         Nested INCLUDEs didn't work.  Fixed.
3688
3689         * getline.c: (getl_include) Set first_line to NULL in allocated
3690         structure.
3691
3692 Tue Mar  9 13:13:46 1999  Ben Pfaff  <blp@gnu.org>
3693
3694         The MATCH FILES procedure set the values of variables not present
3695         to 0.  It should have been SYSMIS.  This is now fixed.
3696
3697         * get.c: (mtf_delete_file_in_place) Replace 0.0 by SYSMIS.
3698
3699 Tue Mar  9 12:52:23 1999  Ben Pfaff  <blp@gnu.org>
3700
3701         The REMARK command was too aggressive about skipping lines.  It
3702         didn't like being the last command in a file.
3703
3704         * command.c: (cmd_remark) Call get_entire_line() instead of
3705         get_line().
3706
3707 Tue Mar  9 12:48:05 1999  Ben Pfaff  <blp@gnu.org>
3708
3709         Comment parsing wasn't consistent with the rest of the code in its
3710         idea of where one command ends and another starts.  This meant
3711         that sometimes commands would be mysteriously ignored.  Thanks to
3712         Dr. Dirk Melcher <BZN-mdksh@t-online.de> for reporting this bug.
3713          
3714         * command.c: (parse_cmd) Hand off comment parsing to new function
3715         skip_comment() in lexer.c.
3716         * lexer.c: (skip_comment) New function.
3717
3718 Wed Jan 20 20:22:07 1999  Ben Pfaff  <blp@gnu.org>
3719
3720         The TABLE subcommand on MATCH FILES worked only erratically at
3721         best.  This fixes it.  Thanks to Dr. Dirk Melcher
3722         <BZN-mdksh@t-online.de> for reporting this bug.
3723
3724         * get.c: (mtf_compare_BY_values) When comparing string values, a
3725         difference of 1 is still a difference :-)
3726         (mtf_processing) Inverted TABLE reading logic fixed.  Also don't
3727         advance TABLE files automatically when matched.  Comment fixes.
3728
3729 Tue Jan 19 22:32:31 1999  Ben Pfaff  <blp@gnu.org>
3730
3731         VARIABLE LABELS rejected a slash before the first variable
3732         specification, contradicting the documentation.  Thanks to Walter
3733         M. Gray <graywm@northernc.on.ca> for reporting this bug.
3734
3735         * var-labs.c: (cmd_variable_labels) Ignore a leading slash in
3736         command specification.
3737
3738 Tue Jan 19 22:29:54 1999  Ben Pfaff  <blp@gnu.org>
3739
3740         Because of an incorrect optimization in memory allocation,
3741         CROSSTABS sometimes segfaulted when asked to output multiple
3742         tables.  Thanks to Walter M. Gray <graywm@northernc.on.ca> for
3743         reporting this bug.
3744
3745         * crosstabs.q: (postcalc) New variables maxcols, maxcells, which
3746         are passed to output_pivot_table() for its use.
3747         (output_pivot_table) Instead of assuming the number of columns is
3748         constant, keep track with maxcols.  In general mode, use maxcells
3749         to determine whether more matrix cells need to be allocated.    
3750
3751 Tue Jan 19 22:27:46 1999  Ben Pfaff  <blp@gnu.org>
3752
3753         CROSSTABS didn't display value labels for column and row
3754         variables.  Thanks to Walter M. Gray <graywm@northernc.on.ca> for
3755         reporting this bug.
3756
3757         * crosstabs.q: (table_value_missing) If the specified value has a
3758         value label for this variable, then show it instead of the raw
3759         value.
3760         (display_dimensions) Delegate display of value_labels to
3761         table_value_missing.
3762
3763 Mon Jan 18 20:04:06 1999  Ben Pfaff  <blp@gnu.org>
3764
3765         WRITE didn't write line ends.  Fixed.  Thanks to Dr. Dirk Melcher
3766         <BZN-mdksh@t-online.de> for reporting this bug.
3767
3768         * print.c: (print_trns_proc) Write (CR/)LF if PRINT is used _or_
3769         if the file isn't declared as binary.
3770
3771 Mon Jan 18 19:56:45 1999  Ben Pfaff  <blp@gnu.org>
3772
3773         MATCH FILES corrupted memory and dumped core on some syntax
3774         errors.  Fixed.
3775
3776         * get.c: (cmd_match_files) Set file->handle to NULL before
3777         jumping to lossage.
3778         (mtf_free_file) Don't free a null dictionary.   
3779
3780 Mon Jan 18 19:27:57 1999  Ben Pfaff  <blp@gnu.org>
3781
3782         MATCH FILES should set numeric values not available to the
3783         system-missing value, not to 0.  Thanks to Dr. Dirk Melcher
3784         <BZN-mdksh@t-online.de> for reporting this bug.
3785
3786         * get.c: (mtf_processing) Set unused records to system-missing,
3787         not 0.
3788
3789 Mon Jan 18 15:06:46 1999  Ben Pfaff  <blp@gnu.org>
3790
3791         KEEP didn't work properly on the SAVE procedure.  Fixed.  Thanks
3792         to Ralf Geschke <ralf@kuerbis.org> for reporting this bug.
3793
3794         * temporary.c: (save_dictionary) Initialize var_by_name AVL tree
3795         in newly created dictionary, and add each copied variable to the
3796         tree.
3797  
3798 Mon Jan 18 15:04:48 1999  Ben Pfaff  <blp@gnu.org>
3799
3800         Memory leak fix.
3801         
3802         * get.c: (trim_dictionary) Free variable list for KEEP after
3803         finishing with it.
3804
3805 Mon Jan 18 12:57:36 1999  Ben Pfaff  <blp@gnu.org>
3806
3807         Some systems didn't like the way open_file was coded.  Thanks to
3808         Hankin <hankin@rogue.consultco.com> for pointing this out.
3809
3810         * filename.c: (open_file) Don't try to store stdin, stdout,
3811         stderr as part of an array, because that doesn't always work.
3812
3813 Mon Jan 18 12:53:27 1999  Ben Pfaff  <blp@gnu.org>
3814
3815         The SAVE procedure didn't save long string variables properly.
3816         Fixed by this patch.  Thanks to Hankin
3817         <hankin@rogue.consultco.com> for this patch.
3818         
3819         * sfm-write.c: (write_variable) Fix off-by-one error in writing
3820         out variable pad records.
3821
3822 Tue Jan  5 14:29:27 1999  Ben Pfaff  <blp@gnu.org>
3823
3824         Previously, if PRINT SPACE were given a negative argument, it
3825         would report an error, then spin in an (almost) infinite loop.
3826         This fixes that behavior.
3827
3828         * print.c: (print_space_trns_proc) After reporting a negative
3829         argument, set number of lines to print to 1.
3830
3831 Tue Jan  5 13:59:55 1999  Ben Pfaff  <blp@gnu.org>
3832
3833         SPSS 8.0 outputs some new record types in its system files, and it
3834         allows longer value labels.  Accept these system files.
3835
3836         * sfm-read.c: (sfm_read_dictionary) Ignore record type 7 subtype
3837         11 emitted by SPSS 8.0.
3838         
3839 Tue Jan  5 13:55:50 1999  Ben Pfaff  <blp@gnu.org>
3840
3841         The LIST procedure was too conservative in allocating space for
3842         buffers, which caused a bug that only showed up with very long
3843         output variables.  Thanks to Hankin <hankin@dunno.com> for this
3844         bug report.
3845
3846         * list.q: (determine_layout) Allocate 1022 bytes instead of 256.
3847
3848 Tue Jan  5 13:34:34 1999  Ben Pfaff  <blp@gnu.org>
3849
3850         Typo meant string format specifiers weren't checked properly.  I
3851         think that Hankin <hankin@dunno.com> sent me this report, but I'm
3852         willing to be corrected on this point.
3853  
3854         * format.c: (check_string_specifier) Fix obvious typo.  
3855
3856 Tue Jan  5 12:50:42 1999  Ben Pfaff  <blp@gnu.org>
3857
3858         Using $CASENUM in an expression didn't work.  Here's a fix.
3859         Thanks to Dirk Melcher <BZN-mdksh@t-online.de> for reporting this
3860         bug.
3861          
3862         * expr-evl.c: (evaluate_expression) Add OP_CASENUM case.
3863
3864         * expr-opt.c: (dump_node) OP_CASENUM is acceptable.
3865
3866 Tue Jan  5 12:47:48 1999  Ben Pfaff  <blp@gnu.org>
3867
3868         The changes in 0.2.1 to fix DATA LIST FREE parsing broke some
3869         other behavior, *sigh*.  This patch hopefully fixes that.  This
3870         time I've actually tested it.
3871
3872         Thanks to Hankin <hankin@dunno.com> for reporting this bug.
3873
3874         * data-list.c: (read_from_data_list_free,
3875         read_from_data_list_list) Call parse_string_as_format() directly
3876         without mucking around with the field width.
3877
3878 Tue Jan  5 12:31:19 1999  Ben Pfaff  <blp@gnu.org>
3879
3880         Occasionally, you may encounter a script that wants to be
3881         interpreted in interactive mode.  Make -i emulate this behavior to
3882         allow such scripts to be executed with PSPP.
3883
3884         Thanks to Hankin <hankin@dunno.com> for reporting this behavior.
3885
3886         * cmdline.c: (pre_syntax_message[]) Update -i description.
3887
3888         * lexer.c: (preprocess_line) When getl_interactive is 2 (i.e.,
3889         when -i is given on the command line) don't treat unindented lines
3890         as starting a new command.
3891
3892 Tue Jan  5 12:30:10 1999  Ben Pfaff  <blp@gnu.org>
3893
3894         In conjunction with egcs 1.1.1, Checker emits some bogus warnings,
3895         mostly caused by local initialized aggregates.  After egcs is
3896         fixed upstream these can be removed, but for now they're not a big
3897         deal.
3898         
3899         * ascii.c: (ascii_postopen_driver) Checker chokes on local
3900         initialized arrays.  Avoid this.
3901
3902         * sfm-write.c: (sfm_write_dictionary) Don't use a local
3903         initialized struct.
3904
3905 Tue Jan  5 12:07:24 1999  Ben Pfaff  <blp@gnu.org>
3906
3907         egcs 1.1.1 has some new warnings relative to gcc 2.8.1, which the
3908         following changes avoid.  Currently I compile sources with egcs
3909         1.1.1 and gcc 2.7.2.3 before sending them out.
3910
3911         * apply-dict.c: (apply_dict) Use new avl_traverser_init() macro.
3912         
3913         * ascii.c: (option_tab[]) Initialize all struct members.
3914
3915         * avl.h: (avl_traverser_init) New macro.
3916         
3917         * command.c: (DEFCMD, UNIMPL macros, cmd_table[]) Initialize all
3918         struct members.
3919
3920         * crosstabs.q: (enum_var_values) Use new hsh_iterator_init()
3921         macro.
3922
3923         * hash.c: Comment fix.
3924
3925         * hash.h: (hsh_iterator_init) New macro.
3926
3927         * html.c: (option_tab[]) Initialize all struct members.
3928
3929         * pfm-write.c: (write_value_labels) Use new avl_traverser_init()
3930         macro.
3931
3932         * postscript.c: (option_tab[]) Initialize all struct members.
3933         (output_encodings, preclose, dump_lines) Use new
3934         hsh_iterator_init() macro.
3935
3936         * sfm-write.c: (write_value_labels) Use new avl_traverser_init()
3937         macro.
3938
3939         * sysfile-info.c: (describe_variable) Use new avl_traverser_init()
3940         macro.
3941
3942 Thu Nov 19 12:32:45 1998  Ben Pfaff  <blp@gnu.org>
3943
3944         * data-in.c: Examined each of the parsing functions to make sure
3945         that they wouldn't dump core if they were passed a string of the
3946         wrong length, since now the DATA LIST FREE/LIST routines don't
3947         check for field width before passing it to the data parser.
3948         (parse_RBHEX, parse_AHEX) Reject odd length input.
3949         (parse_string_as_format) Reject input that's too short or too
3950         long.
3951
3952         * data-list.c: Before, the DATA LIST FREE/LIST routines would pad
3953         a field to its entire declared output width then pass it to the
3954         data-in parsing routines.  This contradicted the documented
3955         behavior.  This is fixed in these changes.  Thanks to Mark H. Wood
3956         <mwood@IUPUI.Edu>.  In addition, this fixes a few more details of
3957         free-format parsing that differed from SPSS.
3958         (cut_field) Commas and spaces are treated identically.  Returns
3959         the proper column instead of a fixed 1 value.
3960         (parse_field) Removed.
3961         (read_from_data_list_free, read_from_data_list_list) Call
3962         parse_string_as_format directly instead of parse_field.
3963
3964         * heap.c: (heap_delete) Stylistic fixes.
3965
3966 Sun Aug  9 11:12:13 1998  Ben Pfaff  <blp@gnu.org>
3967
3968         * loop.c: (loop_2_trns_proc) Formatting fix.
3969
3970         * sel-if.c: (cmd_filter) Set FILTER_before_TEMPORARY.
3971
3972         * var.h: (glob var FILTER_before_TEMPORARY) New global var.
3973
3974         * vfm.c: (macro FILTERED) New.
3975         (static var filter_var) New.
3976         (process_active_file_write_case) Use FILTERED.
3977         (setup_filter) Set filter_var.
3978         (close_active_file) Delete the filter if not
3979         FILTER_before_TEMPORARY.
3980         (procedure_write_case) Use FILTERED.
3981
3982 Sat Aug  8 00:20:14 1998  Ben Pfaff  <blp@gnu.org>
3983
3984         * crosstabs.q: Changed /PIVOT={ON,OFF} to /FORMAT={PIVOT,NOPIVOT}.
3985
3986         * data-in.c: (parse_day_count) Message fix.
3987         (parse_month) Style fix.
3988
3989         * data-list.c: (struct data_list_pgm) New member eof.
3990         (cmd_data_list) Init eof to 0.
3991         (do_reading) Implement the /END subcommand and read-past-eof
3992         checking.
3993
3994         * do-if.c: Include stdio.h when debugging.
3995         (cmd_else_if) Make sure the command is .-terminated.
3996
3997         * glob.c: (init_glob) Capitalize the command prompt.
3998
3999         * inpt-pgm.c: (end_case_trns_proc) Debugging message.
4000         (end_file_trns_proc) Debugging message.
4001
4002         * loop.c: (internal_cmd_loop) Make it work when there's no loop
4003         index!
4004         (loop_2_trns_proc) Enable MXLOOPS (why was this disabled?)
4005
4006         * main.c: (dump_token) Make kwtab[] const.
4007
4008         * set.q: Spelling, comment fixes.
4009
4010         * sysfile-info.c: (cmd_display) DISPLAY VECTORS not DISPLAY
4011         VECTOR.
4012
4013         * vars-prs.c: (fill_all_vars) Style fix.
4014
4015         * vfm.c: (index_to_varname) Return const.
4016
4017 Tue Aug  4 23:49:23 1998  Ben Pfaff  <blp@gnu.org>
4018
4019         * Changes in many source files for partial -ansi -pedantic and
4020         no-debugging compliance: Remove trailing common in enum
4021         declarations; add `unused' attributes; insert some appropriate
4022         casts.
4023
4024         * cmdline.c: (parse_command_line) Add new --testing-mode flag.
4025
4026         * command.c: (shell) Make static.
4027         (run_command) Make static.
4028
4029         * data-list.c: (dump_fixed_table) Remove use of local_strdup().
4030
4031         * dfm.c: (cmd_begin_data) I18n fix.
4032
4033         * error.c: (verbose_msg) Define if __STRICT_ANSI__.
4034
4035         * error.h: (macro verbose_msg) Define if __STRICT_ANSI__.
4036
4037         * expr-opt.c: (evaluate_tree) Don't initialize local arrays if
4038         __STRICT_ANSI__.
4039
4040         * file-handle.q: Don't prepend the source file directory name to
4041         the data file name.  (Ongoing issue.)
4042         (prepend_current_directory) Comment out.
4043         (internal_cmd_file_handle) Don't call prepend_current_directory().
4044         (fh_get_handle_by_filename) Ditto.
4045
4046         * filename.c: Append zero byte to readlink() return value.
4047
4048         * getline.c: (getl_read_line) I18n fix.
4049
4050         * lexer.h: Don't use gcc features if __STRICT_ANSI__.
4051
4052         * misc.h: Don't use gcc features if __STRICT_ANSI__.
4053
4054         * pfm-write.c: (bufwrite) Don't try to increment a void * pointer
4055         directly.
4056
4057         * postscript.c: (output_encodings) Don't use local_strdup().
4058         (postopen) Ditto.
4059
4060         * print.c: Don't use gcc features if __STRICT_ANSI__.
4061
4062         * q2c.c: (dump_vars) Don't put a , at the end of the last enum.
4063
4064         * recode.c: (parse_src_spec) Fully brace nested if's.
4065
4066         * set.q: (global var set_testing_mode) New var.
4067
4068 Wed Jul 29 22:01:44 1998  Ben Pfaff  <blp@gnu.org>
4069
4070         * ascii.c: Add some more `unused' attributes that only come into
4071         play when NDEBUG is defined.
4072         (ascii_close_page) Set s_len when reallocating s.
4073         
4074         * crosstabs.q: (delete_missing) New function.
4075         (output_pivot_table) Call delete_missing() if /MISSING=REPORT.
4076         (make_summary_table) Create summary table reallocable.
4077
4078         * postscript.c: Add more `unused' attributes as above.
4079
4080         * tab.c: (tab_create) [GLOBAL_DEBUGGING] Set reallocable member.
4081         (tab_realloc) [GLOBAL_DEBUGGING] Assert that table is reallocable.
4082          
4083         * tab.h: (struct tab_table) [GLOBAL_DEBUGGING] New `reallocable'
4084         member.
4085
4086         * var.h: (macro force_dup_variable) [!GLOBAL_DEBUGGING] Remove
4087         gratuitous space between parameter definition.
4088
4089         * vars-atr.c: Changed some assert(0)'s to abort()'s to prevent
4090         complaints about running off the end of functions with NDEBUG
4091         enabled.
4092
4093 Sun Jul  5 00:17:25 1998  Ben Pfaff  <blp@gnu.org>
4094
4095         * Several source files: Removed some PORTME notes when reflection
4096         revealed that ANSI forbids that sort of breakage.  Also, added
4097         lots of `unused' qualifiers here and there.
4098
4099         * aggregate.c: (accumulate_aggregate_info) Remove local var
4100         weighting that turned out not to be used.
4101
4102         * avl.c: Update to version 1.1.0.  Add unused specifier.
4103         (avl_destroy) Initialize ab to 0.  Comment fixes.  Cast return
4104         value to void *.
4105         (avl_probe) Replace some instances of 1 with +1 where appropriate.
4106         (avl_find) Cast return value to void *.
4107         (avl_delete) q doesn't need to be initialized at the beginning of
4108         the function.  Replace some instances of 1 with +1.
4109         (force_avl_delete) Renamed avl_force_delete, all references changed.
4110         (compare_ints) `param' marked unused.
4111         (print_int) `param' marked unused.
4112         (recurse_tree) Replace some instances of 1 with +1.
4113
4114         * avl.h: Update to version 1.1.0.  Only declares avl function
4115         types if not already declared.
4116         (AVL_MAX_HEIGHT) Only define if not already defined.
4117         (struct avl_node) New unused member char pad[2].
4118         [GLOBAL_DEBUGGING] Change conditionalization to NDEBUG instead.
4119         (force_avl_insert) Renamed avl_force_insert.
4120         (force_avl_delete) Renamed avl_force_delete.
4121
4122         * crosstabs.q: (struct table_entry) Put `freq' into a union with
4123         new member `data'.
4124         (struct crosstab) Add new member `ofs'.
4125         (glob var int_tab) Removed.
4126         (custom_tables) In integer mode, assign v[i] properly through the
4127         indirect var_dict.
4128         (custom_variables) Now p.crs.max == max + 1.
4129         [DEBUGGING] (debug_print) p.crs.min and p.crs.max are now ints.
4130         (precalc) Implement integer mode.
4131         (calc_integer) Implement integer mode.
4132         (compare_table_entry) Remove unused local variable `comparing'.
4133         (make_summary_table) Implement integer mode.
4134         (macro ns_rows) Implemented as static variable now.
4135         (several variables) Made static, from global.
4136         (output_pivot_table) Use table_value_missing() for column heads.
4137         Remove several unused local variables.  Implement integer mode
4138         table summing.  Count up ns_rows.
4139         (crosstabs_dim) Make columns wider when /MISSING=REPORT requested.
4140         (find_pivot_extent) Moved into find_pivot_extent_general; now just
4141         calls that function or find_pivot_extent_integer.
4142         (find_pivot_extent_integer) New function.
4143         (enum_var_values) Implemented for integer mode.
4144         (table_value_missing) New function.
4145         (display_dimensions) Call table_value_missing() for heads.
4146         (float_M_suffix) New function.
4147         (display_crosstabulation) Call table_value_missing() for row
4148         heads.  Handle missing values in /MISSING=REPORT mode.
4149         (calc_fisher) Remove unused var N.
4150         (calc_r) Remove unused var fact.
4151
4152         * data-list.c: (dump_fixed_table) Fix table dimensioning.
4153         (read_one_set_of_repetitions) Remove unused vars var_spec, column.
4154
4155         * data-out.c: (insert_commas) Remove unused var cp.
4156         (convert_CCx) Remove unused vars save_set_decimal,
4157         save_set_grouping.
4158
4159         * descript.q: (dump_z_table) Fix table dimensioning.
4160         (pre_calc) Remove unused var j.
4161         (display) Remove unused vars title, s.  Fix table dimensioning.
4162
4163         * expr-evl.c: Comment fixes.
4164
4165         * frequencies.q: (full_dim) New function.
4166         (dump_full) Fix table dimensioning.
4167         (condensed_dim) New function.
4168         (dump_condensed) Fix table dimensioning.
4169
4170         * get.c: (cmd_match_files) Remove unused var n_val.  Remove unused
4171         label winnage.
4172
4173         * html.c: (html_close_drive) Remove unused var i.
4174         (postopen) Remove unused vars title, curfn_len, cp.
4175         (preclose) Remove unused vars this, x.
4176
4177         * lexer.c: Comment fixes.
4178
4179         * matrix-data.c: (cmd_matrix_data) Remove unused var index.
4180
4181         * means.q: (custom_tables) Remove unused var m_dim.
4182
4183         * mis-val.c: Format fix.
4184
4185         * modify-vars.c: (cmd_modify_vars) Remove unused var new_dict.
4186
4187         * output.c: (outp_get_paper_size) Remove unused var cp.
4188
4189         * pfm-read.c: (read_float) Remove unused var save, unused label
4190         underflow.
4191         (read_variables) Remove unused vars cp, j.
4192         (read_value_label) Remove unused var j.
4193
4194         * pfm-write.c: (bufwrite) Remove unused var i.
4195
4196         * postscript.c: (ps_postopen_drive) Remove unused vars dev_info,
4197         fn.
4198         (output_encodings) Remove unused vars char_cp, n_output.
4199         (read_ps_encodings) Remove unused var ep.
4200         (postopen) Remove unused var title.
4201         (preclose) Remove unused var fp.
4202         (ps_open_page) Remove unused vars true, false, orientation,
4203         mirror_horz, mirror_vert, width, length.
4204         (ps_text_metrics) Remove unused var x.
4205
4206         * q2c.c: (find_symbol) Remove unused var y.
4207         (parse_setting) Remove unused parameter sbc, all references
4208         changed.
4209         (dump_parser) Remove unused var cp.
4210         (dump_free) Remove unused var i.
4211
4212         * set.q: (static vars args, n) Removed.
4213         (internal_cmd_gset) Removed.
4214
4215         * sfm-read.c: (sfm_read_dictionary) Removed unused var i.
4216         (read_machine_flt64_info) Removed unused var file_endian.
4217         (read_documents) Removed unused var i.
4218         (read_compressed_data) Removed unused parameter dict, all
4219         references changed.
4220
4221         * sfm-write.c: (bufwrite) Removed unused var i.
4222         (sfm_write_case) Removed unused var i.
4223
4224         * sort.c: (merge_once) Remove unused var t.
4225         (write_separate) #if 0 out as dead code.
4226
4227         * split-file.c: (cmd_split_file) Remove unused var i.
4228
4229         * sysfile-info.c: (sysfile_info_dim) New function.
4230         (cmd_sysfile_info) Fix table dimensioning.
4231         (variables_dim) New function.
4232         (display_variables) Fix table dimensioning.
4233         (describe_variable) Remove unused var prev_r.
4234
4235         * t-test.q: (z_postcalc) Removed.
4236         (pairs_calc) Remove unused var bad_weight.
4237         (postcalc) Remove unused vars dfn, dfd.
4238
4239         * tab.c: (tab_create) Set t->dim to NULL.
4240         (tab_dim) Make sure t->dim is NULL first.
4241         (tab_natural_width) Remove parameter `clamp'.
4242         (tab_value) Remove duplicate assertion for table.
4243         (tab_raw) New function.
4244         (nowrap_dim) New function.
4245         (wrap_dim) New function.
4246         (tab_output_text) Fix table dimensioning.
4247
4248         * tab.h: (tab_raw) New macro.
4249
4250         * val-labs.c: (get_label) Remove unused var type.
4251         (copy_value_labels) Remove unused var trav.
4252
4253         * var.h: (struct crosstab_proc) Completely changed.
4254
4255         * vars-prs.c: (parse_dict_variable) Remove unused var v.
4256
4257         * vfm.c: (open_active_file) Remove unused vars i, lp.
4258
4259         * weight.c: (weight_trns_proc) #if 0 out as dead code.
4260         
4261 Tue Jun  2 23:37:21 1998  Ben Pfaff  <blp@gnu.org>
4262
4263         * Makefile.am: Add apply-dict.c, flip.c.
4264
4265         * apply-dict.c: New file.
4266         
4267         * command.c: (struct command) Make cmd[] larger for CLEAR
4268         TRANSFORMATIONS command name.
4269         (parse_cmd) Make sure we're in a valid state before using it as an
4270         index.  Discard variables and reset state on invalid transitions.
4271         (cmd_clear_transformations) New function.
4272
4273         * command.def: Add APPLY DICTIONARY, CLEAR TRANSFORMATIONS, FLIP.
4274         Add unimplemented PRESERVE, RESTORE.
4275
4276         * file-handle.h: Include stddef.h.
4277
4278         * flip.c: New file.
4279         
4280         * pfm-read.c: (parse_value) Pad value label values with spaces,
4281         not nulls.
4282
4283         * sfm-read.c: (struct sfm_fhuser_ext) Add reference count.
4284         (sfm_close) Decrement reference count, make sure it's zero.
4285         (sfm_maybe_close) New function.
4286         (sfm_read_dictionary) Handle reference counts.
4287
4288         * vars-atr.c: (clear_default_dict) New function.
4289         (discard_variables) Use clear_default_dict().
4290
4291 Sun May 31 00:58:05 1998  Ben Pfaff  <blp@gnu.org>
4292
4293         * Makefile.am: Add pfm-write.c.
4294         (LDADD) Add the libgmp2 libraries.
4295
4296         * command.def: Define EXPORT.
4297
4298         * get.c: (cmd_export) New function.
4299         (export_write_case_func) New function.
4300
4301         * pfm-read.c: (static spss2ascii[]) Make it const.
4302
4303         * pfm-write.c: New file.
4304
4305         * sfm-write.c: Formatting, comment fixes.
4306
4307         * var.h: Comment fix.
4308
4309 Fri May 29 21:44:12 1998  Ben Pfaff  <blp@gnu.org>
4310
4311         * Makefile.am: Add pfm.h, pfm-read.c.
4312
4313         * command.def: IMPORT is now implemented.
4314
4315         * format.c: (glob var translate_fmt[]) New var.
4316
4317         * get.c: (enum GTSV_NONE) Renamed GTSV_OPT_NONE.
4318         (cmd_import) New function.
4319         (import_source_read) New function.
4320         (glob var import_source) New var.
4321
4322         * pfm-read.c: New file.
4323
4324         * pfm.h: New file.
4325         
4326         * sfm-read.c: (parse_format_spec) Local variable translate_fmt[]
4327         moved in format.c.
4328         (dump_dictionary) Disabled printing a couple of items.
4329
4330 Mon May 25 12:42:37 1998  Ben Pfaff  <blp@gnu.org>
4331
4332         * crosstabs.q: (postcalc) Call make_summary_table().
4333         (make_summary_table) New function.
4334         (insert_summary) New function.
4335         (display_dimensions) Remove some unnecessary arguments, all
4336         references changed.
4337         (output_pivot_table) Fix lots of problems with the risk table
4338         setup.
4339         (submit) Don't display an empty table.
4340         (display_risk) Fix order of arguments to calc_risk().
4341
4342         * glob.c: Always include assert.h and stdlib.h.
4343
4344         * output.h: (enum OUTP_T_JUST_FULL) Removed, all references
4345         removed.
4346
4347         * tab.c: (tab_create) Cosmetic changes.
4348
4349         * tab.h: (enum TAB_JUSTIFY) Removed, all references removed.
4350
4351 Sun May 24 22:39:23 1998  Ben Pfaff  <blp@gnu.org>
4352
4353         * tab.def: Removed.
4354
4355         * crosstabs.q: (output_pivot_table) Headers drawing and submission
4356         code simplified, moved into new function submit().
4357         (submit) New function.
4358         (crosstabs_dim) New function.
4359         (display_directional) Substitute variable names for %s where
4360         appropriate.
4361         (somers_d_v[], somers_d_ase[], somers_d_t[]) New static vars.
4362         (calc_symmetric) Initialize parameters only if non-NULL.
4363         Calculate Somers' d.
4364         (calc_directional) Calculate Somers' d (or copy it, really).
4365         Calculate eta.
4366
4367         * output.c: (outp_string_width) New function.
4368
4369         * postscript.c: (postopen) Calculate font widths based on the
4370         width of the zero '0' character, not the width of the space
4371         character.  Set paper-width and paper-length based on points, not
4372         device units.
4373         (ps_open_page) Fix page setup string for landscape mode.
4374
4375         * som.h: (struct som_dimension) Removed.
4376         (struct som_table_class) height, width members take int * not
4377         som_dimesion * now.
4378
4379         * tab.c: Many functions now have added parameter validation.
4380         (tab_height, tab_width) These functions were removed and merged
4381         into a single function tab_resize(), and all references changed.
4382         (tab_dim) Rewritten since the interface changed; reduced from
4383         hundreds of lines to two.  All callers were changed.  Currently
4384         most of them just use tab_natural_dimensions as their callback and
4385         await detailed translation of functionality.
4386         (tab_natural_width) New function.
4387         (tab_natural_height) New function.
4388         (tab_natural_dimensions) New function.  This is a callback
4389         function, not something that you'd want to call directly.
4390         (tab_nat_dim) Removed.
4391         (tabi_table) Allocates t->w and t->h.
4392         (tabi_driver) Inlined sum_columns()'s functionality.  Calls the
4393         dimensions callback.
4394         (evaluate_dimensions) Removed.
4395         (sum_columns) Removed.
4396
4397         * tab.h: (enum TAL_1THIN) Removed.
4398         (enum series t_*) Removed.
4399         (struct tab_table) Members trh, trv changed to unsigned char *
4400         from int *.  Member dim changed to a function pointer from a
4401         unsigned char *.  Member max_stack_height removed.  New members
4402         hr_tot, vr_tot.
4403         (macros tab_l, tab_r, tab_t, tab_b) New.
4404
4405 Sat May 23 23:22:13 1998  Ben Pfaff  <blp@gnu.org>
4406
4407         * ascii.c: (delineate) Assign last_space_nchars before skipping
4408         spaces, to fix right justification.
4409
4410         * crosstabs.q: (static vars risk, direct) New vars.
4411         (static var pearson_r) Removed.
4412         (glob var chisq_fisher) Made static.
4413         (static vars row_tot[], col_tot[]) Don't include grand total
4414         anymore.
4415         (static var grand_total) Renamed W, all references changed.
4416         (output_pivot_table) Only make `table' if num_cells != 0.  Make
4417         risk and directional tables.  Deal with grand total no longer part
4418         of col_tot[].  Free rows and cols after we're done with them.
4419         (display_risk) New function.
4420         (display_directional) New function.
4421         (clac_r) Rewritten so that it stores all its results into its
4422         arguments, so it can be used for Spearman's correlation too.
4423         (calc_symmetric) Added a t[] argument, all references changed.
4424         Calculates ASEs for tau-b, tau-c, gamma.  Calculates Spearman's r,
4425         Pearson's r, Cohen's kappa.
4426         (calc_risk) New function.
4427         (calc_directional) New function.
4428
4429         * som.c: (som_submit) Improved debugging code.
4430
4431         * stats.c: (hypercube) New function.
4432         (cube) New function.
4433         (sqr) New function.
4434         (normal_sig) Went back to old implementation, which actually
4435         worked.
4436
4437         * stats.h: (macros square, cube, hypercube) Removed.  The
4438         equivalent functions in stats.c are inlined here; all references
4439         to square changed to sqr.
4440
4441 Fri May 22 00:03:41 1998  Ben Pfaff  <blp@gnu.org>
4442
4443         * crosstabs.q: (N_SYMMETRIC) New define.
4444         (postcalc) Disable debug printing.
4445         (static vars chisq_fisher, pearson_r) New.
4446         (output_pivot_table) Add support for symmetric measures.  Add
4447         chi-square output of exact sigs.
4448         (display_chisq) Rewritten.
4449         (display_symmetric) New function.
4450         (gamma_int) New function.
4451         (Pr) New function.
4452         (swap) New function.
4453         (calc_fisher) New function.
4454         (calc_chisq) Check boundary conditions better. Calculate Yates,
4455         Fisher, Mantel-Haenszel tests.
4456         (calc_r) New function.
4457         (calc_symmetric) New function.
4458
4459         * stats.c: (normal_sig) Rewritten with new algorithm.  Renamed
4460         from calc_normal.
4461         (chisq_sig) Better boundary conditions.  Renamed from
4462         calc_significance.
4463
4464         * tab.h: (struct tab_table) New member cf.
4465
4466         * tab.c: (tab_create) Set cf.
4467         (tab_width) New function.
4468         (tab_realloc) Handle cf.
4469         (tab_vline) Handle cf.
4470         (tab_hline) Handle cf.
4471         (tab_box) Handle cf.
4472         (tab_value) Handle cf.
4473         (tab_float) Handle cf.
4474         (tab_text) Handle cf.
4475         (tab_joint_text) Handle cf.
4476         (tab_offset) Handle cf.
4477         (tab_next_row) Handle cf.
4478         (evaluate_dimensions) Handle cf.
4479         (render_strip) Handle cf.
4480
4481 Wed May 20 00:03:59 1998  Ben Pfaff  <blp@gnu.org>
4482
4483         * crosstabs.q: (postcalc) New vars row_tot, col_tot, pass them to
4484         output_pivot_table().
4485         (output_pivot_table) Moved lots of local variables outside and
4486         made them static.  Add beginnings of chi-square statistic
4487         support.  Now column and row totals aren't in the main matrix.
4488         Always zero out any leftover rows & columns after we're done with
4489         the table entries.  Move all output stuff into
4490         display_dimensions(), display_crosstabs(), display_chisq().
4491         (display_dimensions) New function.
4492         (display_crosstabulation) New function.
4493         (display_chisq) New function.
4494         (calc_chisq) Implemented Pearson and likelihood-ratio chisquares.
4495
4496         * frequencies.q: (dump_full, dump_condensed) Remove tab_null()
4497         references, simplify logic.
4498
4499         * postscript.c: Remove scale, translate-x, translate-y,
4500         mirror-horz, mirror-vert, rotate-180 options.
4501         (struct ps_driver_ext) Remove scale, translate_x, translate_y.
4502         All references deleted.
4503         (macro YT) New macro.
4504         (array option_tab[]) Removed options.
4505         (ps_option) Removed options.
4506         (ps_open_page) Write page setup explicitly to output file, without
4507         using now-deleted BP function.
4508         (macro dump_line) Use YT().
4509         (macro dump_thick_line) Use YT().
4510         (draw_headers) Use YT().
4511         (switch_font) Reorder arguments to SF function.
4512         (write_text) Use YT().
4513
4514         * sfm-read.c: (sfm_read_case) Don't attempt to read variables that
4515         have get.fv == -1.
4516
4517         * sysfile-info.c: (describe_variables) Don't use tab_nulls().
4518
4519         * tab.c: (tab_create) Initialize t->ct to zeros.  Remove
4520         null-debugging code.
4521         (tab_realloc) Remove null-debugging code.  Initialize new regions
4522         of t->ct to zeros.
4523         (tab_vline) Support offsets.
4524         (tab_hline) Support offsets.
4525         (tab_box) Support offsets.
4526         (tab_null) Removed.
4527         (tab_nulls) Removed.
4528         (tab_row) Removed.
4529         (tab_col) Removed.
4530         (evaluate_dimensions) Remove null-debugging code.  Understand
4531         TAB_EMPTY attribute.  Assert that text.s.s is always non-NULL if
4532         TAB_EMPTY not present.
4533
4534         * tab.h: New cell attribute TAB_EMPTY.
4535         (macros tab_nr, tab_nc, tab_row, tab_col) New.
4536
4537         * vars-atr.c: (init_variable) Set get.fv to -1 so that GET doesn't
4538         try to read them from system files.
4539
4540         * vfm.c: (dump_splits) Don't call tab_null().   
4541
4542 Sat May 16 19:36:55 1998  Ben Pfaff  <blp@gnu.org>
4543
4544         * crosstabs.q: (struct crosstab) Added `missing' member.
4545         (custom_tables) Init missing.
4546         (calc_general) Handle missing values.
4547         (calc_chisq) New function.
4548         (output_pivot_table) Start work on chi-square output.  Update for
4549         new tab offset support functions.  Shorten statistic names.
4550
4551         * Several files: add in more `const's to placate gcc's warnings.
4552
4553         * tab.h: (struct tab_table) Add col_ofs, row_ofs members.  Comment
4554         fixes.
4555
4556         * tab.c: (tab_height, tab_realloc, tab_vline, tab_hline, tab_box,
4557         tab_null, tab_nulls, tab_value, tab_float, tab_text,
4558         tab_joint_text) Add col_ofs and row_ofs support.
4559         (tab_offset) New function.
4560         (tab_next_row) New function.
4561         (tab_row) New function.
4562         (tab_col) New function.
4563         (tabi_table) Add col_ofs and row_ofs support.
4564
4565         * vars-atr.c: (is_system_missing) New function.
4566
4567 Tue May 12 16:14:30 1998  Ben Pfaff  <blp@gnu.org>
4568
4569         * crosstabs.q: Expanded subcommand names RESID --> RESIDUAL, etc.
4570         (static var no_cells) Removed.
4571         (static var num_cells) New.
4572         (static var expected) New.
4573         (static var cells[]) New.
4574         (internal_cmd_crosstabs) Deal with new variables.
4575         (postcalc) Removed most of the meat and put it in new function
4576         output_pivot_table().
4577         (output_pivot_table) Calculates and outputs an entire pivot table.
4578
4579         * postscript.c: (postopen) Fix problems with free()ing addresses
4580         not obtained from malloc().
4581
4582         * som.c: (som_submit) Add assertion.
4583
4584         * sysfile-info.c: (describe_variable) Use new tab_nulls()
4585         function.
4586
4587         * tab.c: (static var tab_names[]) New.
4588         (tab_realloc) -1 for nc or nr indicates no change.
4589         (tab_nulls) New function.
4590         (tab_dim) Use tab_names[].
4591         (tabi_cumulate) Don't include bottom or right headers.  Furrfu.
4592         (evaluate_dimensions) Don't terminate on uninited cells, just put
4593         an X in them and emit a notice.  Use tab_names[].
4594
4595         * tab.h: Move bits into tab.def.
4596
4597         * tab.def: New.  Don't try to declare tab_table_class because then
4598         som.h has to be included.       
4599         
4600 Thu May  7 22:55:04 1998  Ben Pfaff  <blp@gnu.org>
4601
4602         * command.def: New file, contains all the command definitions
4603         previously included bodily in command.c.
4604
4605         * format.def: New file, contains all of the format definitions
4606         previously split across format.h, format.c, and sfm-write.c.
4607
4608         * lexer.h: Renamed from tokens.h in order to match corresponding
4609         .c file name.
4610
4611         * lexerP.h: Moved some rarely used functions exported by lexer.c
4612         into here.
4613
4614         * Makefile.am: Commemorate renamed files.
4615         (EXTRA_DIST) Add command.def, format.def.
4616
4617         * command.c: [0] (walk_cmdtable_func) Removed.
4618
4619         * crosstabs.q: (postcalc) Made it work and print out matrices
4620         proving it.
4621         (enum_column_values) Renamed enum_var_values, generalized for any
4622         variable.
4623
4624         * format.h: (struct fmt_desc) New member `spss'.
4625
4626         * q2c.c: (main) Generated code includes lexer.h instead of
4627         tokens.h.
4628
4629         * sfm-write.c: (write_format_spec) Use new spss member of fmt_spec
4630         instead of an independent translation table.
4631
4632 Tue May  5 13:19:03 1998  Ben Pfaff  <blp@gnu.org>
4633
4634         * Lots of source files: Added const to declarations.
4635
4636         * aggregate.c: (parse_aggregate_function) Rename inner i to j.
4637         
4638         * arena.c: (arena_clear) Set prev pointer to null when done.
4639
4640         * ascii.c: (ascii_option) Rename index as indx.
4641
4642         * avl.c: This is now a separate library called libavl.
4643         (xmalloc) Make static.
4644         (avl_probe) Step A7 can use the cache instead of an explicit
4645         compare.
4646         (avl_delete) Don't maintain a q pointer because it's always
4647         available in the pointer stack.  Comment fix.
4648
4649         * avl.h: This is now a separate library called libavl.
4650
4651         * command.c: (cmd_table[]) Remove spurious trailing "".
4652
4653         * common.h: Only include random() fix if this system needs it.
4654
4655         * crosstabs.q: Include alloca headers.
4656         (n_sorted_tab) New global var.
4657         (postcalc) Mostly rewritten.
4658         (find_pivot_extent) Rewritten.
4659         (enum_column_values) Rewritten.
4660
4661         * data-out.c: (convert_F) Rename inner n as n_spaces.
4662
4663         * error.c: (dump_message) Don't have an outer var i.
4664
4665         * file-handle.q: (static var f) Removed.  All references removed.
4666         (internal_cmd_file_handle) Uses a local variable instead of f.
4667
4668         * get.c: (trim_dictionary) Change scope of i, i1, i2.
4669         (cmd_match_files) Don't strcpy tokstr into sbc (why was this ever
4670         done?)
4671
4672         * getline.h: Declare getl_history as extern.  Reported by
4673         palme@uni-wuppertal.de (Hubert Palme).
4674
4675         * postscript.c: (postopen) Some large mods for constness.
4676
4677         * recode.c: Remove spurious copyrights since PSPP is owned by FSF
4678         anyway.
4679
4680 Fri Apr 24 12:52:47 1998  Ben Pfaff  <blp@gnu.org>
4681
4682         * Makefile.am: Rename BUILT_SOURCES to q_sources, all references
4683         changed.  Add avl.c, avl.h to pspp_SOURCES.  Remove avllib from
4684         LDADD.
4685
4686         * avl.c, avl.h: New files.  These form a clean-room
4687         reimplementation of avllib.  Iterative algorithms are used in
4688         place of recursive ones, so there is no resemblance in the code.
4689
4690         * Lots of headers: Don't include other headers by default.
4691
4692         * Lots of source files: Explicitly include all needed headers.
4693
4694         * arena.c: (arena_clear) New function.
4695
4696         * crosstabs.q: (ROW_VAR, COL_VAR) New enums.
4697         (static var ar) Removed.
4698         (staitc vars ar_tc, ar_col) New.
4699         (cmd_crosstabs) Destroy the arenas.
4700         (internal_cmd_crosstabs) Create the arenas.
4701         (precalc) Don't need a free function for the hash.
4702         (calc_general) Make sure to zero out the trailer on the key data
4703         before inserting.
4704         (print_table_entries) Updated.
4705         (postcalc) Worked on actually implementing.
4706         (find_pivot_extent) New function.
4707         (compare_value) New function.
4708         (enum_column_values) New function.
4709
4710         * data-in.c: (parse_month) Make local array `static const'.
4711         
4712         * data-out.c: (convert_date) Make local array `static const'.
4713         (convert_WKDAY) Same.
4714         (convert_MONTH) Same.
4715
4716         * frequencies.q: (postprocess_freq_tab) avl_walk_inorder() has
4717         been renamed to avl_walk().
4718         
4719         * hash.c: Rewritten more efficiently.
4720
4721         * hash.h: Add attribute const to hsh_next_prime declaration.
4722
4723         * lexer.c: (id_match) Make arguments const.
4724
4725         * postscript.c: (ps_postopen_driver) Make default fonts the
4726         Helvetica family.
4727
4728         * q2c.c: (main) Generated code needs stdlib.h.
4729
4730         * sfm-write.c: (write_value_labels) An avl_traverser needs to be
4731         initialized to 0 now, not to NULL.  All other references to
4732         avl_traverser were updated in the same way.
4733
4734         * tokens.h: Macro version of id_match updated to use const
4735         properly.
4736
4737         * val-labs.c: (inc_ref_count) New function.
4738         (copy_value_labels) Simply through use of new avl_copy() function.
4739
4740 Wed Apr 15 13:01:58 1998  Ben Pfaff  <blp@gnu.org>
4741
4742         * crosstabs.q: Probably doesn't compile.  New PIVOT subcommand.
4743         (postcalc) Worked on this.
4744
4745         * postscript.c: (OPO_DOUBLE_LINE) New enum.
4746         (struct ps_driver_ext) New line_width_thick member.
4747         (ps_preopen_drive) Init line_width_thick.
4748         (option_tab[]) Add line-* options.
4749         (ps_option) Parse line-* options.
4750         (postopen) Add line_width_thick support.  Strip leading spaces on
4751         prologue output lines.
4752         (ps_open_page) Include line_width_thick in output.
4753         (macro dump_thick_line) New.
4754         (dump_fancy_line) Support thick lines as well as double lines.
4755
4756 Tue Apr 14 00:50:08 1998  Ben Pfaff  <blp@gnu.org>
4757
4758         * Makefile.am: Add crosstabs.c to BUILT_SOURCES.  Add crosstabs.q
4759         to pspp_SOURCES.  Add crosstabs.q to EXTRA_DIST.
4760
4761         * Many source files: Rename `options' to `pv_opts' as appropriate.
4762
4763         * command.c: (static var cmd_table[]) Add CROSSTABS command.
4764
4765         * common.c: (xcalloc) New function.
4766
4767         * crosstabs.q: New file.  Not finished yet, though.
4768                 
4769         * data-list.c: Comment fix.
4770
4771         * error.c: Remove some old Checker cruft.
4772
4773         * frequencies.q: (dump_full) Cumulate valid percent instead of
4774         regular percent.
4775
4776         * getline.c: Comment fix.
4777
4778         * hash.c: Comment fixes.
4779
4780         * hash.h: (struct hsh_table) Make hash functions return unsigned
4781         instead of int to avoid problems with taking the modulo of
4782         negative return values.  All references changed.
4783
4784         * misc.c: (intlog10) Make its table static const instead of auto.
4785
4786         * sfm-read.c: (read_header) Make `prefix' static const instead of
4787         auto.
4788
4789         * var.h: (union value) Add member `hash'.
4790         (struct variable) Rename prv_index as `foo'--all references
4791         changed.  Reorder.
4792         (typedef pv_opts) Removed.  All references changed.
4793
4794         * vars-prs.c: (parse_variables) Message fixes.
4795         
4796 Mon Mar  9 15:35:08 1998  Ben Pfaff  <blp@gnu.org>
4797
4798         * get.c: (cmd_match_files) Don't reverse the order of FILEs as
4799         they are being inserted.  Don't check for BY variables of
4800         different types.  Discard variables if the active file isn't
4801         included in the merge.
4802         (mtf_processing) Essentially rewritten.
4803         (mtf_merge_dictionary) Check for master/slave variables of
4804         different types/widths.
4805
4806         * vfm.c: (static var not_canceled) New var.
4807         (process_active_file) Don't call vfm_source->read() if
4808         there's no vfm-source.  Initialize not_canceled.
4809         (process_active_file_write_case) Honor and update not_canceled.
4810         (prepare_for_writing) Rollback changes from yesterday, they were
4811         wrong.
4812         (close_active_file) Don't destroy vfm_source unless it exists.
4813         
4814 Mon Mar  9 00:56:16 1998  Ben Pfaff  <blp@gnu.org>
4815
4816         * Lots of source files: Added { } around nested if/else constructs
4817         to avoid new gcc 2.8 warnings.
4818
4819         * data-in.c: (parse_Z) Declare `int' type explicitly.
4820         (convert_Z) Ditto.
4821
4822         * get.c: (struct mtf_file) Add prev, next_min, by, input members.
4823         (cmd_match_files) Initialize mtf_by_values.  Manage by, input,
4824         prev members.  Put TABLEs at the end of the chain and FILEs at the
4825         beginning.  Don't allow the active file in STATE_INIT.  Use proper
4826         `seen' value for the active file.  Fill out the by members and
4827         make sure they're of consistent type.  Do the actual merge
4828         operation.
4829         (mtf_processing_finish) New function.
4830         (var_type_description) New function.
4831         (mtf_free_file) New function.
4832         (mtf_free) Rewritten.
4833         (mtf_delete_file_in_place) New function.
4834         (mtf_read_nonactive_records) New function.
4835         (mtf_compare_BY_values) New function.
4836         (static var mtf_seq_no) New var.
4837         (mtf_processing) New function.
4838         (mtf_merge_dictionary) Assign nval members for the system file
4839         dictionary.  Assign fv values for its variables.  Point each slave
4840         variable to the corresponding master variable.
4841
4842         * hash.c: Include str.h.
4843
4844         * mis-val.c: (copy_missing_values) src arg is const.
4845
4846         * misc.c: (spacing) Make `max' var explicitly int.
4847
4848         * sfm-read.c: (dump_dictionary) Message reformatting.
4849         (sfm_read_case) Add assertion.
4850
4851         * sort.c: Esthetic fixes.
4852
4853         * var.h: (struct match_files_proc) New struct.
4854         (struct variable) Add private data match_files_proc.
4855
4856         * vars-atr.c: (delete_variable) Implement.  Add argument for the
4857         dictionary that owning the variable.
4858         (dup_variable) Add assertion.
4859
4860         * vfm.c: Comment fixes, hopefully the comments are correct now.
4861         (process_active_file) New function.
4862         (process_active_file_write_case) New function.
4863         (process_active_file_output_case) New function.
4864         (prepare_for_writing) Use temp_dict->nval for vfm_info, not
4865         default_dict.nval.
4866         (write_case) Renamed procedure_write_case().  Now write_case is a
4867         pointer to a function.  Style fixes.
4868         
4869 1998-03-05  Ben Pfaff  <blp@gnu.org>
4870
4871         * Makefile.am: (q2c) Link with libmisc.
4872         (version.c) Define default_config_path, include_path,
4873         groff_font_path.
4874
4875         * ascii.c: (ascii_postopen_driver) When the default newline string
4876         is requested, open file in text mode.  Suggested by
4877         palme@uni-wuppertal.de (Hubert Palme).
4878         (static vars line_buf, line_p) Change from char * to unsigned char
4879         *.
4880         (ascii_close_page) char * to unsigned char *.
4881
4882         * cmdline.c: (parse_command_line) Implement -r option by
4883         prepending ~/.pspp/rc to the list of files to process.
4884
4885         * command.c: (cmd_remark) Reset getl_prompt to the standard prompt
4886         before pulling in a final line.
4887         (null_func, null_int_func) Removed (dead code).
4888
4889         * descript.q: (display) Calculate width of variable name column
4890         properly.  Calculate number of valid cases properly.  Reported by
4891         palme@uni-wuppertal.de (Hubert Palme).
4892
4893         * filename.c: (init_filename) Use default_config_path instead of
4894         now obsolete CONFIG_PATH.
4895
4896         * getline.c: (getl_initialize) Use include_path instead of now
4897         obsolete INCLUDE_PATH.
4898         (getl_add_file) New argument `where'.  All references changed.
4899
4900         * groff.c: (find_font_file) Use groff_font_path instead of now
4901         obsolete GROFF_FONT_PATH.
4902         
4903         * postscript.c: (find_ps_file) Use groff_font_path instead of now
4904         obsolete GROFF_FONT_PATH.  Copy through temporary variable to
4905         avoid problems with constness.
4906
4907         * str.h: (macro cs_streq) New macro.
4908
4909         * version.h: (glob var default_config_path, include_path,
4910         groff_font_path) New vars.
4911         
4912 1998-02-23  Ben Pfaff  <blp@gnu.org>
4913
4914         * Many source files: Change verbose_msg() priority levels and
4915         messages.
4916
4917         * aggregate.c: Include debug-print.h.
4918
4919         * cmdline.c: (parse_command_line) Add --safer/-s and --command/-c
4920         options.
4921         (static var pre_syntax_message) Document --safer/-s and
4922         --command/-c.
4923
4924         * command.c: (cmd_erase, cmd_host) Disable if set_safer is set.
4925
4926         * dfm.c: (open_inline_file) [__CHECKER__] Zero out ext->file,
4927         because it's not used but it's still copied.
4928         (open_file_r) Remove gratuitous debug message.
4929
4930         * filename.c: (safety_violation) New function.
4931         (open_file) Remove gratuitous debug messages.  Don't allow pipe
4932         files if set_safer is set.
4933
4934         * get.c: Turn off debugging.
4935
4936         * getline.c: (getl_add_virtual_file) New function.
4937         (getl_read_line) Add verbose_msg() call for opening new syntax
4938         file.
4939         (getl_perform_delayed_reset) Add a return value describing whether
4940         any action was taken.  Call reset_eof().
4941
4942         * getline.h: Comment fix.
4943
4944         * groff-font.c: (groff_read_font) Use `goto next_iteration' in
4945         place of incorrect `continue'.  Use strtok_r() instead of
4946         strtok().  Always check strtok_r() return value.
4947         (groff_read_DESC) Use strtok_r() instead of strtok().
4948
4949         * lexer.c: (reset_eof) New function.
4950
4951         * main.c: (parse) Get a token after performing a delayed reset
4952         action; allow empty syntax files.
4953
4954         * postscript.c: (output_encodings) Use strtok_r() instead of
4955         strtok().
4956
4957         * q2c.c: (dump_parser) Use strtok_r() instead of strtok().
4958
4959         * set.q: Comment fixes.
4960         (glob var set_safer) New var.
4961         (internal_cmd_set) Support SAFER.
4962
4963         * str.h: [!HAVE_STRTOK_R] Declare strtok_r() prototype.
4964
4965         * temporary.c: (free_dictionary) Set d->splits to NULL after
4966         freeing.
4967
4968         * vars-atr.c: (clear_variable) Decrement dict->n_splits if
4969         variable deleted, not if it *isn't* deleted.
4970
4971 1998-02-16  Ben Pfaff  <blp@gnu.org>
4972
4973         * command.c: (array cmd_table[]) Add MATCH FILES.
4974
4975         * common.c: Comment fixes.
4976
4977         * data-list.c, dfm.c, error.c, filename.c, list.q, matrix-data.c,
4978         modify-vars.c, postscript.c, sfm-read.c, sfm-write.c, tab.c:
4979         Include alloca.h.  Problem reported by palme@uni-wuppertal.de
4980         (Hubert Palme).
4981
4982         * expr-opt.c: Include str.h.  Problem reported by
4983         palme@uni-wuppertal.de (Hubert Palme).
4984
4985         * get.c: (cmd_get) [DEBUGGING] Update v->p.get to v->get.
4986         (static var mtf_by) Change from char ** to variable **.
4987         (static var mtf_master) New var.
4988         (mtf_merge_dictionary) New function.
4989         (cmd_match_files) Init mtf_master.  Parse mtf_by according to new
4990         var type.  Reorder tests properly.  Initialize file->dict.  Detect
4991         TABLE= without BY=.  Read file dictionaries and merge them.  Give
4992         subcommand name with IN, LAST, FIRST error messages.  Create IN,
4993         LAST, FIRST variables.  Comment fixes.
4994         (mtf_free) Don't free default_dict.  Free mtf_master.
4995
4996         * getline.c: Define getl_mode.  Change getl_buf_size to size_t
4997         from int.
4998         (handle_line_buffer) Cast int to size_t in comparison to avoid
4999         warning.
5000
5001         * getline.h: Declare getl_mode extern.
5002
5003         * groff-font.c: (groff_read_font) Type-fix calls to getline.
5004         (groff_read_DESC) Make line_size a size_t.
5005         (match_tok) Parenthesize name to avoid macro expansion.
5006
5007         * mis-val.c: (copy_missing_values) New function.
5008
5009         * postscript.c: (postopen) Make buf_size a size_t.
5010
5011         * sfm-read.c: (dump_dictionary) Make global from static.  Print
5012         variable info in parts for easier debugging with Checker.
5013
5014         * temporary.c: (copy_variable) Use copy_value_labels().
5015         (new_dictionary) New arg: whether to copy file label, documents.
5016
5017         * val-labs.c: (copy_value_labels) New function.
5018
5019         * var.h: (enums MISSING_*) Add MISSING_COUNT.
5020
5021         * vars-atr.c: [GLOBAL_DEBUGGING] (force_dup_variable) New
5022         function.
5023         (dup_variable) Set prv_index, get.fv, get.nv.
5024
5025 Fri Feb 13 15:38:36 1998  Ben Pfaff  <blp@gnu.org>
5026
5027         * Makefile.am: (pspp_SOURCE) Add htmlP.h.
5028
5029         * Many source files: For ANSI-compliance, add empty statement
5030         after label.  Reported by palme@uni-wuppertal.de (Hubert Palme)
5031         and Micah Altman <maltman@www-vdc.fas.harvard.edu>.
5032
5033         * data-in.c: (parse_numeric) Some header files break on
5034         -DBL_MIN_10_EXP because they get a --; add () for safety.
5035         Reported by palme@uni-wuppertal.de (Hubert Palme).
5036
5037         * dfm.c: Idea by Dr Eberhard W Lisse <el@linux.lisse.na>.
5038         (struct dfm_fhuser_ext) Change `file' from FILE * to file_ext.
5039         (dfm_close) Use close_file_ext.
5040         (open_inline_file) Set file.file to NULL, not file.
5041         (open_file_r, open_file_w) Initialize file.file; fill in file_ext
5042         struct and use open_file_ext().
5043         (read_record) Use file.file.
5044
5045         * file-handle.q: (prepend_current_directory) Pass through special
5046         filenames.
5047
5048         * filename.c: Only include unistd.h if HAVE_UNISTD_H.
5049         (normalize_filename) Pass through special filenames.
5050         (open_file, close_file) Accept pipe| and |pipe syntaxes as
5051         equivalent.
5052         (dirname) Rename blp_dirname() because of name conflict on some
5053         OS.  All references changed.  Reported by palme@uni-wuppertal.de
5054         (Hubert Palme).
5055         (is_special_filename) New function.
5056
5057         * get.c: (GTSV_OPT*) Add GTSV_OPT_MATCH_FILES.
5058         (trim_dictionary) Conditionalize some of the options on whether
5059         GTSV_OPT_MATCH_FILES is in *options.
5060         (rename_variables) Don't allow variables to be renamed as scratch
5061         variables.
5062         (MTF_*) New enum series.
5063         (struct mtf_file) New struct.
5064         (static vars mtf_head, mtf_tail, mtf_by, mtf_n_by, mtf_free) New
5065         vars.
5066         (cmd_match_files, mtf_free) New functions.
5067
5068         * lexer.c: (match_int) Needed parentheses around name to escape
5069         macro expansion.  Reported by Micah Altman
5070         <maltman@www-vdc.fas.harvard.edu>.
5071
5072         * print.c: Needed to include alloca.h.  Reported by Micah Altman
5073         <maltman@www-vdc.fas.harvard.edu>.
5074
5075         * recode.c: (convert_to_double) Parenthesize -DBL_MIN_10_EXP to
5076         -(DBL_MIN_10_EXP).  Reported by palme@uni-wuppertal.de (Hubert
5077         Palme).
5078         
5079         * str.h: Include stdarg.h.  Reported by palme@uni-wuppertal.de
5080         (Hubert Palme) and Micah Altman <maltman@www-vdc.fas.harvard.edu>.
5081
5082 Thu Feb  5 00:18:21 1998  Ben Pfaff  <blp@gnu.org>
5083
5084         * html.c: (struct html_driver_ext) Move into htmlP.h.
5085         (html_preopen_driver) Initialize cp_x, cp_y.
5086         (html_submit) Implement as call to output_tab_table().
5087         (change_attributes) New function.
5088         (escape_string) New function.
5089         (output_tab_table) New function.
5090
5091         * list.q: (write_all_headers) Add code for writing headers for the
5092         html driver.
5093         (clean_up) Write out the html close-table tag.
5094         (determine_layout) Ignore html driver.
5095         (list_cases) Write html data.
5096
5097         * som.c: (som_submit) Move more of the code into output_table().
5098
5099         * tab.c: (static var hit) Make a global var and rename tab_hit.
5100         (static var tab_table_class) Make a global var.
5101
5102         * htmlP.h: New file.
5103
5104 Tue Feb  3 16:12:18 1998  Ben Pfaff  <blp@gnu.org>
5105
5106         * dump-sysfile.c: Removed.
5107
5108         * html.c: (preclose) Change comment in emitted code.
5109
5110         * matrix-data.c: Debugging off by default.  Comment fixes.
5111         (static var container) New var.
5112         (cmd_matrix_data) Create and destroy container.  Initialize
5113         is_per_factor[] to 0s.  Move code into new function
5114         string_to_content_type().  Require split values to be present in
5115         the data when ROWTYPE_ is explicit.  Call specific function, not
5116         general read_matrices().
5117         (string_to_content_type) New function.
5118         (context) Exclude all whitespace, not just spaces.
5119         (mget_token) A dot is a number.  Add assertion.
5120         (static var data) Renamed nr_data.
5121         (static var factor_values) Renamed nr_factor_values.
5122         (read_matrices) Renamed read_matrices_without_rowtype().  Handle
5123         only specific case.  Close data_file before exit.
5124         (fill_matrix) New function.
5125         (read_data_lines) Renamed nr_read_data_lines().  Remove debug
5126         printing.  Style fixes.  Message fixes.  Move code into
5127         fill_matrix().
5128         (read_matrices_without_rowtype) Rename
5129         matrix_data_read_without_rowtype().  Fix off-by-one error on
5130         loops.  Allocate nr_data[] memory from arena.
5131         (read_matrices_with_rowtype) Removed.
5132         (read_splits) Renamed nr_read_splits().  Style fixes.
5133         (read_factors) Renamed nr_read_factors().
5134         (dump_cell_content) Comment fixes.  Arguments changed.  Change
5135         debug printing.  All references changed.
5136         (output_data) Renamed nr_output_data().
5137         (static var wr_content) New var.
5138         (struct factor_data) New struct.
5139         (static var wr_data) New var.
5140         (static var wr_current) New var.
5141         (matrix_data_source_destroy_source) Removed.
5142         (read_matrices_with_rowtype) New function.
5143         (matrix_data_read_with_rowtype) New function.
5144         (wr_read_splits) New function.
5145         (compare_factors) New function.
5146         (wr_output_data) New function.
5147         (wr_read_rowtype) New function.
5148         (wr_read_factors) New function.
5149         (wr_read_indeps) New function.
5150         (glob var matrix_data_source) Make destroy_source member NULL as
5151         well.
5152
5153 Fri Jan 23 00:09:08 1998  Ben Pfaff  <blp@gnu.org>
5154
5155         * lexer.c: (syntax_error) Give better error message when at end of
5156         file.
5157
5158         * matrix-data.c: (var content_names[]) Fix PROX spelling.  Change
5159         N_SCALAR to output as plain N.
5160         (mdump_token) Change output format.
5161         (context) Fix message output interaction with spaces in input.
5162         (another_token) New function.
5163         (force_eol) Improved error message.
5164         (static var max_cell_index) New var.
5165         (read_matrices) Init `cells'.  factor_values is now per-cell.
5166         Init max_cell_index.
5167         (read_data_lines) Replace `compare' local with new `compare' arg.
5168         Debugging messages changed.  Only read factors if per_factor.
5169         Propagate error return from read_factors(), force_eol().
5170         Copy N_SCALAR values across the N vector.
5171         (read_matrices_without_rowtype) Don't init `cells'.  Don't need to
5172         check parentheses manually since we now have is_per_factor[].
5173         Call read_data_lines() with new args.  Check for end of data after
5174         looping, using another_token().
5175         (read_factors) Arguments changed.  Use max_cell_index to determine
5176         whether to read or compare factors.  Message fixes.
5177         (dump_cell_content) New function.
5178         (output_data) Completely rewritten because content types were
5179         supported to be nested inside factor values, not vice versa.
5180         
5181 Thu Jan 22 00:26:38 1998  Ben Pfaff  <blp@gnu.org>
5182
5183         * lexer.c: (syntax_error) Support formatted varargs messages.
5184
5185         * matrix-data.c: Turn debugging on by default.
5186         (static content_type[]) New array.
5187         (static content_names[]) New array.
5188         (static rowtype_, varname_) New vars.
5189         (static is_per_factor[]) New array.
5190         (static split_values) Moved declaration.
5191         (static n_continuous, first_continuous) New var.
5192         (cmd_matrix_data) Don't init split_values.  Assign ROWTYPE_ to
5193         rowtype_.  Simplify SPLIT code.  Init is_per_factor[].  Assign
5194         VARNAME_ to varname_.  Initialize first_continuous, n_continuous.
5195         Check for continuous variables.
5196         [DEBUGGING] (debug_print) Remove content_names[].
5197         (mdump_token) New macro.
5198         (mget_token_dump) New function.
5199         (mdump_token) New function.
5200         (context) New function.
5201         (mget_token) Fix messages.
5202         (static var data, split_values, factor_values) New vars.
5203         (read_matrices) Manage split_values, factor_values.
5204         (read_data_lines) New function.
5205         (read_matrices_without_rowtype) Implemented.
5206         (read_splits) Message fixes.  Uses `just_read'.
5207         (read_factors) New function.
5208         (output_data) New function.
5209         (matrix_data_source_destroy_source) Close the file handle.
5210         (glob var matrix_source) Change name from "DATA LIST" to "MATRIX
5211         DATA".
5212
5213         * str.c: (strpadcmp) Removed.
5214
5215         * vfm.c: (dump_splits) Initialize i; fix test for end of splits.
5216
5217 Sun Jan 18 00:30:59 1998  Ben Pfaff  <blp@gnu.org>
5218
5219         * Lots of source files: Add cast to unsigned character to calls to
5220         tolower() and toupper().
5221
5222         * aggregate.c: Set default_dict.splits to NULL.
5223
5224         * command.c: (static variable tab[]) Add MATRIX DATA.
5225
5226         * data-in.c: Add debugging defines.  Formatting fixes.
5227
5228         * expr-opt.c: Formatting fixes.
5229
5230         * lexer.c: (syntax_error) Message fixes.
5231
5232         * matrix-data.c: New enum series.
5233         (static vars fmt, section, diag, explicit_rowtype, signle_split,
5234         split_values, n_factors, factors, cells, pop_n, contents,
5235         n_contents) New vars.
5236         (cmd_matrix_data) Finished implementation.
5237         (compare_variables_by_mxd_vartype) New function.
5238         [DEBUGGING] (debug_print) New function.
5239         (static vars mtoken, mtokstr, mtoklen, mtokval) New vars.
5240         (read_matrices) New function.
5241         (read_matrices_without_rowtype) New function.
5242         (read_matrices_with_rowtype) New function.
5243         (read_splits) New function.
5244         (mget_token) New function.
5245         (force_eol) New function.
5246         [0] (test_tokenizer) New function.
5247         (matrix_data_source_destroy_source) New function.
5248         (glob var matrix_data_source) New var.
5249
5250         * misc.h: Include ieeefp.h if present.
5251
5252         * split-file.h: (cmd_split_file) Changes corresponding to struct
5253         dictionary changes.
5254
5255         * str.h: Fix memmem prototype.
5256
5257         * temporary.c: (save_dictionary, restore_dictionary,
5258         free_dictionary) Changes corresponding to struct dictionary
5259         changes.
5260
5261         * var.h: (MXD_* enums) New enum series.
5262         (struct matrix_data_proc) New struct.
5263         (struct split) Removed.
5264         (struct dictionary) Changed `splits' member from `split *' to
5265         `variable **'.
5266         (macro force_create_variable) New macro.  Replaced lots of
5267         create_variable()/assert() calls with calls to this macro.
5268
5269         * vars-atr.c: (discard_variables) Changed assertion.
5270         [GLOBAL_DEBUGGING] (force_create_variable) New function
5271         called by the macro of the same name.
5272         (clear_variable) Changes to delete splits from the dictionary
5273         corresponding to struct dictionary changes.
5274
5275         * vars-prs.c: (parse_variables) [GLOBAL_DEBUGGING] Check for
5276         corrupted variable `index' values in the dictionary passed in
5277         every time this function is called.
5278
5279         * vfm.c: (dump_splits, SPLIT_FILE_procfunc) Changes corresponding
5280         to struct dictionary changes.
5281
5282 Tue Jan 13 23:45:02 1998  Ben Pfaff  <blp@gnu.org>
5283
5284         * Makefile.am: (pspp_SOURCES) Add matrix-data.c.
5285
5286         * command.c: New includes.
5287         (static array cmd_table[]) Add ERASE, HOST, NEW FILE.
5288         (cmd_erase) New function.
5289         [unix] (shell) New function.
5290         (run_command) New function.
5291         (cmd_host) New function.
5292         (cmd_new_file) New function.
5293
5294         * expr-prs.c: (parse_primary) Message fix.
5295
5296         * inpt-pgm.c: Formatting fix.
5297         (cmd_reread) Implement the FILE subcommand.
5298
5299         * matrix-data.c: New file.
5300
5301         * q2c.c: (dump_header) Change output commenting style.
5302
5303         * weight.c: Comment fix.
5304
5305 Tue Jan 13 00:53:39 1998  Ben Pfaff  <blp@gnu.org>
5306
5307         * aggregate.c: (buf64_10x) Renamed buf64_1xx, all references
5308         changed.
5309         (buf_10x) Renamed buf_1xx, all references changed.
5310         (cmd_aggregate) Implemented cases 010, 011, 110, and 111 (all
5311         cases now implemented).
5312         (create_sysfile) New function.
5313         (agr_11x_func) New function.
5314
5315         * data-in.c: (parse_numeric) Work properly if there's an
5316         explicitly coded decimal point in the data and decimal places are
5317         specified on DATA LIST.  Bug reported by Dr Eberhard W Lisse
5318         <el@linux.lisse.na>.
5319
5320         * get.c: (cmd_get, cmd_save_internal) Allow extraneous slash
5321         before file specification on GET, SAVE, XSAVE.  Bug reported by Dr
5322         Eberhard W Lisse <el@linux.lisse.na>.
5323
5324         * q2c.c: [!HAVE_STRERROR] Include misc/strerror.c, not
5325         strerror.c.  Bug reported by Alexandre Oliva
5326         <oliva@dcc.unicamp.br>.
5327
5328         * sort.c: Include sort.h.  Comment fixes.  A few esthetic fixes.
5329         (static var separate_case_tab) New var.
5330         (cmd_sort_cases) Cancel temporary transformations here.  Free
5331         v_sort before return.
5332         (sort_cases) Run an EXECUTE procedure if SEPARATE is nonzero and
5333         we're reading from a sort stream.  Don't cancel temporary
5334         transformations.  Offload internal sorting to do_internal_sort().
5335         (do_internal_sort) New function.  Handles internal sorting even
5336         when SEPARATE is nonzero.  Doesn't free v_sort.
5337         (do_external_sort) Take new arg SEPARATE.  Only destroy `x' if
5338         it's non-NULL.
5339         (write_initial_runs) Take new arg SEPARATE.  Only destroy the old
5340         sink if SEPARATE is zero.
5341         (read_output_cases) Renamed read_sort_output(), all references
5342         changed.  Now uses separate_case_tab when it exists.
5343         (write_separate) New function.
5344
5345         * vfm.c: (page_to_disk) Destroy memory_source_cases, not
5346         memory_sink_cases.  Don't redundantly call
5347         vfm_source->destroy_source().
5348         (memory_stream_mode) After switching over, set memory_sink_cases
5349         to NULL.
5350
5351 Sat Jan 10 23:35:51 1998  Ben Pfaff  <blp@gnu.org>
5352
5353         * aggregate.c: (struct agr_var) Expand dbl[] array from 2 to 3
5354         elements.
5355         (static var prev_case) New, moved out of aggregate_single_case()
5356         local scope.
5357         (static var buf64_10x, buf_10x) New.
5358         (cmd_aggregate) Initialize prev_case.  Comment fixes.  Implement
5359         the 000, 001, 100, and 101 cases.  Free prev_case.
5360         (parse_aggregate_functions) Disallow scratch variables.
5361         (free_aggregate_functions) Only free agr_dict if non-null.  Use
5362         iter->function to determine numeric/string type, not
5363         iter->src->type.
5364         (aggregate_single_case) Don't manage prev_case.  Initialize
5365         aggregate info after dumping it.
5366         (accumulate_aggregate_info) Fix sum, weighted sum, mean, weighted
5367         mean, stddev, weighted stddev definitions.
5368         (dump_aggregate_info) Implemented.
5369         (initialize_aggregate_info) Renamed from
5370         initialize_aggregate_functions().  Initializes dbl[2].
5371         (agr_00x_trns_proc, agr_00x_end_func, write_case_to_sfm,
5372         agr_10x_trns_proc, agr_10x_trns_free, agr_10x_end_func) New.
5373
5374         * cases.c: (alloc_val) Removed.
5375
5376         * get.c: (cmd_save_internal) Initialize new `dict' member.
5377
5378         * sfm-write.c: (sfm_write_dictionary, write_header,
5379         write_variable, write_value_labels, write_documents) Reorganize,
5380         simplify for new parameter structure.
5381         (write_variable) Only one variable * argument now.
5382
5383         * sfm.h: (struct sfm_write_info) Removed `pri', `sec', and
5384         replaced by new `dict' member.
5385
5386         * temporary.c: (new_dictionary) Initialize n_documents.
5387
5388         * vars-atr.c: (dup_variable) Allocate `value's from dict into
5389         v->fv manually.
5390         (init_variable, replace_variable) Eliminate usage of alloc_val().
5391
5392         * vars-prs.c: (parse_DATA_LIST_vars) Accept PV_NO_SCRATCH option.
5393
5394         * vfm.c: (arrange_compaction) Allow `temporary' value of 2 to
5395         signal that AGGREGATE is to be used for forming final cases.
5396         (close_active_file) Call end_func before stopping lagging.  Cancel
5397         temporary after finishing compaction.
5398         (write_case) Comment fixes.  Cleaned up.
5399         (compact_case) Let AGGREGATE handle compaction when `temporary' is
5400         2.
5401
5402 Sat Jan 10 02:10:47 1998  Ben Pfaff  <blp@gnu.org>
5403
5404         * Makefile.am: (BUILT_SOURCES) Add means.c.
5405         (pspp_SOURCES) Add means.c.
5406         (EXTRA_DIST) Add means.q.
5407
5408         * command.c: (array cmd_table[]) Add MEANS.
5409
5410         * common.h: Esthetic fixes.  Comment fixes.  Test for
5411         MAX_SHORT_STRING greater than 8.
5412         (macros LOWEST, HIGHEST) New.
5413
5414         * data-in.c, data-list.c, recode.c: Comment fixes.
5415
5416         * means.q: New file, base version.
5417
5418         * mis-val.c: (parse_num_or_range, parse_numeric) Replace -DBL_MAX
5419         with LOWEST, DBL_MAX with HIGHEST.
5420
5421         * q2c.c: (dump_vars) Add an enum to array types giving the number
5422         of values for the enum.
5423
5424         * sfm-read.c: (sfm_read_dictionary, read_machine_flt64_info)
5425         Replace second_lowest_value with second_lowest_flt64.
5426
5427         * sfm-write.c: (write_variable, write_rec_7_34) Replace
5428         second_lowest_value with second_lowest_flt64.
5429
5430         * t-test.q: Comment fix.
5431
5432         * temporary.c: (restore_dictionary) Esthetic fix.
5433
5434         * tokens.h: (force_match_id, force_match, force_string, force_int,
5435         force_num, force_id) Replace msg() with syntax_error().
5436
5437         * var.h: (struct means_proc) New.
5438         (struct variable) Add mns member to `p' union.
5439
5440         * vars-prs.c: (parse_variable, parse_dict_variable,
5441         parse_variables, parse_DATA_LIST_vars) Replace msg() with
5442         syntax_error().
5443
5444 Thu Jan  8 22:28:41 1998  Ben Pfaff  <blp@gnu.org>
5445
5446         * Makefile.am: (pspp_SOURCES) Add tab.h.
5447
5448         * Most source files: Added a cast to unsigned char in usages of
5449         the ctype is*() functions.  Replaced `end of command expected'
5450         calls to msg() with calls to syntax_error().
5451
5452         * frequencies.q: (dump_condensed) Fix tab_dim() column reference.
5453
5454         * lexer.c: (hex_val) Removed (was dead code).
5455         (idmatch) Parenthesize function name to avoid macro expansion.
5456
5457         * postscript.c: Comment fixes.
5458         (ps_preopen_driver) Change default font size to 10pt.
5459
5460         * sfm-read.c: (read_variables) Byteswap sv.print, sv.write as
5461         int32s.
5462         (parse_format_spec) Change system-file format spec argument type
5463         to int32.  Parse the format spec with bitwise operators.
5464
5465         * sfmP.h: (struct sysfile_format) Removed.
5466         (struct sysfile_variable) Changed print, write members from
5467         sysfile_format to int32.
5468
5469         * tokens.h: Esthetic fixes.
5470         [__GNUC__] (macro id_match) New macro to hopefully speed up
5471         identifier matching.
5472         (macros match_id, match_tok, match_int) Implemented in
5473         compiler-independent manner; no longer GNU C only.
5474
5475         * vfm.h: Include time.h.
5476
5477 Mon Jan  5 11:06:15 1998  Ben Pfaff  <blp@gnu.org>
5478
5479         * data-list.c: (dump_fixed_table) Change tab_dim().
5480
5481         * dump-sysfile.c: (open_sysfile) Fix mmap() call.
5482
5483         * error.c: Include command.h.
5484
5485         * frequencies.g: Formatting fixes.
5486
5487         * frequencies.q: Add tab_dim() calls.  Make the total cell a
5488         joined cell.
5489
5490         * glob.c: Include command.h.
5491
5492         * sfm-read.c: (struct sfm_fhuser_ext) New members sysmis, highest,
5493         lowest.
5494         (sfm_read_dictionary) Initialize sysmis, highest, lowest.
5495         (sfm_read_machine_flt64_info) Update sysmis, highest, lowest.
5496         (read_variables) Byteswap sv.type; byteswap sv.print, sv.write as
5497         the other elements (is this right?).
5498         (read_variables) Use lowest, highest members.
5499         (parse_format_spec) New arg `vv' for more stringent checking.
5500         (dump_dictionary) Byteswaps nonexplicit data.
5501         (sfm_read_case) Byteswap numeric data.
5502
5503         * som.c: Initialize table_num to 1.
5504         (render_segments) Remember to increment y_index after each table
5505         segment.
5506
5507         * sysfile-info.c: (cmd_sysfile_info) Change tab_dim().  Don't call
5508         avl_count() on a NULL tree.  No title for the second table.
5509         (cmd_display) Handle DISPLAY VECTORS by calling display_vectors().
5510         Handle AS_SCRATCH as AS_NAMES.  Warn if no variables.  Re-enable;
5511         fix call to display_variables().
5512         (display_variables) Default to 4 columns, not 3.  Set up headers.
5513         Column title is Variable, not Name.  Fix index column.
5514         Add joint text.  Add tab_dim().  Handle value labels properly.
5515         Handle DISPLAY LABELS properly.  Draw boxes correctly.
5516         (describe_variable) Value labels don't need titles.  Don't clear
5517         nonexistent index column.
5518         (compare_vectors_by_name) New function.
5519         (display_vectors) New function.
5520
5521         * tab.c: (tab_height) Add assertion.
5522         (tab_null) Add debug code.
5523         (evaluate_dimensions) Add debug code.
5524
5525         * var.h: (struct variable) get_proc data is sometimes used
5526         simultaneously with other per-procedure info, therefore it was
5527         removed from the union.  All references changed.        
5528
5529 Sun Jan  4 18:13:33 1998  Ben Pfaff  <blp@gnu.org>
5530
5531         * ascii.c: (ascii_close_page) Put title on second line of headers
5532         if there is no subtitle.
5533
5534         * command.c: (glob var cur_proc) Move definition here, from
5535         common.c.
5536         (cmd_remark) Emit blank line before remarks.
5537
5538         * command.h: (glob var cur_proc) Move declaration here, from
5539         common.h.
5540
5541         * data-list.c: (dump_fixed_table) Fix messages.
5542         (dump_free_table) Call tab_nat_dim().
5543
5544         * descript.q: (dump_z_table) Modify tab_dim() call.
5545
5546         * frequencies.q: (dump_condensed, dump_statistics) Add tab_dim()
5547         call.
5548         (dump_statistics) Don't output header.
5549
5550         * groff-font.c: Minor format fix.
5551
5552         * html.c: Comment fix.
5553
5554         * list.q: (write_varname) Indent after advancing page.
5555
5556         * output.h: Minor reordering.
5557
5558         * postscript.c: Comment fixes.  Many places, '\n' was replaced by
5559         a reference to eol[].
5560         (struct ps_driver_ext) New member eol[].
5561         (ps_preopen_driver) Initialize eol[].
5562         (ps_postopen_driver) Fix sense of text for text_opt, line_opt
5563         defaults.  Handle headers.  Fix test for minimum page length.
5564         (static var option_tab[]) Add `line-ends'.
5565         (ps_option) Handle line-ends to change eol[].
5566         (postopen) Scale prop_em_width and fixed_width properly.  Set the
5567         prologue title to outp_title if applicable.  Replace the prologue
5568         line ends with eol[].  Call draw_headers() if headers are enabled.
5569         (text_width) New function.
5570         (out_text_plain) New function.
5571         (draw_headers) New function.
5572
5573         * print.c: (dump_table) Call tab_nat_dim().
5574
5575         * som.c: (som_blank_line) Only advance a line if not at the top of
5576         a page.
5577         (som_submit) Move several informational table calls here.
5578         Increment subtable_num if SOMF_NO_TITLE not set.
5579         (output_table) Advance a line if SOMF_NO_SPACING not set.
5580         (render_columns, render_segments, render_simple) Handle spacing
5581         between tables.  Handle table titles.  Remove debug output.
5582
5583         * som.h: (SOMF_*) New enum series.
5584         (struct som_table_class) New member `flags'.
5585
5586         * sysfile-info.c: (cmd_sysfile_info) Calls tab_nat_dim().  No
5587         headers or spacing.
5588         (display_variables) Calls tab_nat_dim().
5589         (describe_variable) Remove restriction on number of value labels.
5590         Make value labels separated by thin lines.
5591
5592         * tab.c: (tab_create) Default `flags' to none.
5593         (tab_float) New arg `w'.  All references changed.
5594         (tab_nat_dim) New function.
5595         (tab_output_text) No title or spacing.
5596         (tab_flags) New function.
5597         (tabi_flags) New function.
5598         (tabi_title) New function.
5599         (strip_height) Removed.
5600         (tabi_render) Skip title when necessary.
5601         (static var tab_tab_class) Add tabi_flags, tabi_title.
5602         (evaluate_dimensions) Disable display of column, row size.
5603         (sum_columns) Add title height to top header.
5604         (render_strip) Moved within file.
5605
5606         * tab.h: (struct tab_table) New member `flags'.
5607
5608         * vfm.c: (dump_splits) Calls tab_nat_dim().  No title.
5609
5610 Sat Jan  3 16:55:44 1998  Ben Pfaff  <blp@gnu.org>
5611
5612         * Most source files: Add `const' attribute in all appropriate
5613         places.
5614         
5615         * sysfile-info.c: (cmd_sysfile_info) Add tab_dim() call, add a
5616         column to the variables table for use by describe_variable().
5617         (cmd_display) Disable for the present.
5618         (display_documents) Don't wrap documents.
5619         (display_variables) Table has four columns now.
5620         (describe_variable) Table has four columns now.  Don't use a
5621         subtable, use joined cells instead.
5622
5623         * tab.c: (tab_create) Don't set `join'.
5624         (tab_realloc) ct array is not made up of a_string's.
5625         Reallocate trh, hrh, h arrays, initialize trh array.  Initialize
5626         cell contents on GLOBAL_DEBUGGING, not DEBUGGING.
5627         (text_format) New function.
5628         (tab_title) Rewritten, uses text_format().
5629         (tab_text) Rewritten, uses text_format().
5630         (tab_joint_text) New function.
5631         (tab_join) Removed.
5632         (static var hit) New variable.
5633         (render_strip) New args r1, r2.  Implement joined cells that fit
5634         on a single page.
5635         (tabi_render) Increment hit.  Pass new args to render_strip().
5636         (evaluate_dimensions) [GLOBAL_DEBUGGING] Check for uninitialized
5637         cells.  For t_naw and t_nah, ignore joined cells and null cells in
5638         calculations.
5639         
5640         * tab.h: (struct tab_join_rect) Removed.
5641         (struct tab_table) Removed `join'.
5642         (TAB_JOIN_MAIN) Removed.
5643         (struct tab_joined_cell) New struct.
5644         (TAT_NOWRAP) New enum.
5645
5646 Fri Jan  2 01:39:58 1998  Ben Pfaff  <blp@gnu.org>
5647
5648         * ascii.c: (ascii_postopen) Replace ASCII_* macros with their
5649         expansions.
5650         (ascii_postopen_driver) Fix initialization of *_spacing so that
5651         the TAL_0 bit doesn't count.
5652
5653         * data-list.c: (dump_fixed_table) Use natural width for Format
5654         column.
5655
5656         * glob.c: (rerange) Removed.
5657         (get_date) Formatting fixes.  Internationalization fix.
5658
5659         * html.c: (html_postopen_driver) Replace HTML_DEFAULT_OUTPUT_FILE
5660         with "pspp.html".
5661
5662         * postscript.c: (ps_postopen_driver) Replace
5663         PS_DEFAULT_OUTPUT_FILE with "pspp.ps".
5664
5665         * som.c: (som_submit) Don't eject page before every table.
5666         (output_table) Fix order of arguments on call to area().
5667         (render_columns) Fix calculation of max_len.
5668         
5669         * tab.c: (tabi_cumulate) Minor change to increase elegance.
5670         (render_strip) New function.
5671         (strip_height) New function.
5672         (tabi_render) Rewrite as calls to render_strip().
5673
5674         * tab.h: (TAT_* enums) Removed TAT_RICH, all references removed.
5675         Renumbered TAT_PRINTF, TAT_TITLE, TAT_FIX to correspond better
5676         with the TAB_* and OUTP_T_* constants.
5677         
5678 Thu Jan  1 11:53:52 1998  Ben Pfaff  <blp@gnu.org>
5679
5680         * Makefile.am: Formatting fixes.
5681
5682         * ascii.c: (ascii_postopen_driver) Initialize *_line_spacing[],
5683         *_line_width[].
5684
5685         * data-list.c: (dump_fixed_table) Add tab_dim() call.
5686
5687         * descript.q: (dump_z_table, display) Add tab_dim() calls.
5688
5689         * dump-sysfile.c: (glob var length) Make type off_t.
5690         (usage) Fix arguments.
5691         (main) Return 0.
5692
5693         * output.h: (OUTP_T_*) Change constants' value to match tab.h.
5694         Now right-justification is the default so many references had to
5695         change.
5696         (struct outp_class) Removed line_width, all references changed.
5697         (OUTP_DEV_*) Add OUTP_DEV_DISABLED.
5698         (struct outp_driver) Add elements horiz_line_width,
5699         vert_line_width, horiz_line_spacing, vert_line_spacing.  Remove
5700         som element.
5701
5702         * postscript.c: (outp_encodings) Formatting fixes.  Fix garbage
5703         collection.
5704         (postopen) Initialize all the informational members of
5705         outp_driver.
5706
5707         * som.c: (som_blank_line) New function, renamed from blank_line(),
5708         all references changed.
5709         (som_submit) Disables drivers whose pages can't be opened.
5710         (render_columns, render_simple, render_segments) Add debug output.
5711         (render_columns) Fix loop range.
5712         (render_simple) Don't try to render the headers, they're taken
5713         care of automatically.  Advance cp_y past the table when done.
5714         (render_segments) Fix loop ranges.
5715
5716         * tab.c: Initialize new members of tab_table.
5717         (tab_vline) Handle trv[]; don't set style for spacing-only lines.
5718         (tab_hline) Handle trh[]; don't set style for spacing-only lines.
5719         (tab_box) Handle trh[], trv[]; don't set style for spacing-only
5720         lines.
5721         (set_expr) Removed.
5722         (tab_dim) New function.
5723         (tab_col_width) Removed.
5724         (tab_row_height) Removed.
5725         (tab_output_text) Call tab_dim().
5726         (tabi_driver) Call evaluate_dimensions(), sum_columns().
5727         (tabi_area) Implemented.
5728         (tabi_cumulate) Implemented.
5729         (tabi_render) Partially implemented, but broken.
5730         (var tab_table_class) Made static.
5731         (evaluate_dimensions) New function.
5732         (sum_columns) New function.
5733
5734         * tab.h: (enum t_*) Now start at t_end.  New: t_ptw, t_nr, t_nc,
5735         t_nah, t_naw, t_neg, t_xch, t_dup, t_lbl, t_jnz, t_sac, t_sar,
5736         t_scr, t_srr, t_sentinel.  Removed: t_nat.
5737         (struct tab_table) New: wl, wr, ht, hb, trh, hrh, trv, wrv, dim,
5738         max_stack_height, w, h.  Removed: ce, re.
5739         (macro blank_line) Removed.
5740         (glob var zero_length) Removed.
5741
5742 Fri Dec 26 15:44:31 1997  Ben Pfaff  <blp@gnu.org>
5743
5744         * Most source files: include some of the new include files broken
5745         out of var.h.
5746         
5747         * Makefile.am: (pspp_SOURCES) Add all the new source files to the
5748         list.
5749
5750         * aggregate.c: (glob var outfile) Make static.
5751
5752         * command.c: (glob var pgm_state) Move here.
5753
5754         * common.c: (glob vars endian, second_lowest_value, pgmname,
5755         finished, curdate, cur_proc, start_interactive, history_file) Move
5756         here.
5757
5758         * descript.q: (structs dsc_z_score, descriptives_trns) Move here.
5759
5760         * file-handle.q: (glob vars files, inline_file) Move here.
5761
5762         * glob.c: Lost lots of glob vars, detailed in individual file
5763         entries.
5764         (init_glob) set_printer, set_screen were obsolete, deleted.
5765         set_cprompt has fewer spaces because pspp has fewer letters than
5766         fiasco.
5767
5768         * inpt-pgm.c: (glob vars inp_init, inp_init_size) Move here.
5769         (inp_nval) Made static.
5770
5771         * lexer.c: (glob vars token, tokval, tokstr, tokstr_size,
5772         tokstr_len, toklongstr, tokint) Move here.
5773
5774         * misc.c: Lost several vars and functions.
5775
5776         * set.q: (all the set_* variables) Move here.
5777
5778         * str.c: (strmaxcpy, strbarepadcpy, strbarepadlencpy, strpadcpy,
5779         blpstrset, strpadcmp, memrev, memrmem, cmp_str) Move here from
5780         misc.c.
5781
5782         * tab.c: (set_expr, tab_col_width, tab_row_height) New functions.
5783
5784         * tab.h: (enum series t_*) New enums.
5785         (struct tab_table) Use arena struct tag.  New members ce, re.
5786
5787         * tokens.h: Comment fixes.
5788
5789         * var.h: Move lots of enums and variables and functions and
5790         structures to other files.  Use and declare a lot more union and
5791         struct tags.  Comment fixes.  
5792
5793         * vector.c: (glob vars vec, nvec) Move here.
5794
5795         * vfm.c: (glob vars reinit_sysmis, reinit_blanks, init_zero,
5796         init_blanks, last_vfm_invocation) Move here.
5797
5798         * cases.h: New file.
5799         (struct long_vec) Move here.
5800         (vec_init, vec_clear, vec_insert, vec_delete, devector, envector)
5801         Move here.
5802
5803         * command.h: New file.
5804         (STATE_* enums) Move here.
5805         (glob var pgm_state) Move here.
5806
5807         * format.c: New file.
5808         (glob var formats) Move here.
5809         (parse_format_specifier_name, fmt_to_string,
5810         check_input_specifier, check_output_specifier,
5811         check_string_specifier, convert_fmt_ItoO, parse_format_specifier)
5812         Move here.
5813
5814         * format.h: New file.  Move functions now in format.c here.
5815         (FMT_* enums) Move here.
5816         (struct fmt_desc) Move here.
5817         (FCAT_* enums) Move here.
5818         (struct fmt_spec) Move here.
5819         (glob vars formats, fmt_parse_ignore_error) Move here.
5820
5821         * inpt-pgm.h: New file.
5822         (INP_* enums) Move here, make #defines into enums.
5823         (glob vars inp_init, inp_init_size) Move here.
5824
5825         * sort.h: New file.
5826         (glob vars v_sort, nv_sort) Move here.
5827         (sort_cases, read_sort_output) Move here.
5828
5829         * vector.h: New file.
5830         (struct vector) Move here, add struct tag.
5831         (glob vars vec, nvec) Move here.
5832         (find_vector) Move here.
5833
5834         * New file.
5835         (glob vars last_vfm_invocation, temp_case, reinit_sysmis,
5836         reinit_blanks, init_zero, init_blanks) Move here.
5837         (struct case_stream) Move here.
5838         (glob vars vfm_source, vfm_sink, vfm_memory_stream,
5839         vfm_disk_stream, sort_stream, data_list_source,
5840         input_program_source, file_type_source, get_source, n_lag) Move
5841         here.
5842         (procedure, write_case, lagged_case, compact_case, page_to_disk)
5843         Move here.
5844                 
5845 Wed Dec 24 22:40:42 1997  Ben Pfaff  <blp@gnu.org>
5846
5847         * Makefile.am: (pspp_SOURCES) Added html.c, som.c, som.h.
5848         (LDADD) Add libdcdflib.
5849
5850         * ascii.c: Comment and formatting fixes.  Almost every external
5851         function had an assert added, checking driver_open and page_open.
5852         (ascii_init_driver) Broken into ascii_preopen_driver,
5853         ascii_postopen_driver, ascii_close_driver.  Manages driver_open.
5854         (ascii_open_page) Sets page_open.
5855         (ascii_close_page) Clears page_open.
5856
5857         * html.c: Comment and formatting fixes.  Almost every external
5858         function had an assert added, checking driver_open and page_open.
5859         (html_init_driver) Broken into html_preopen_driver,
5860         html_postopen_driver, html_close_driver.  Manages driver_open.
5861         (html_open_page) Sets page_open.
5862         (html_close_page) Clears page_open.
5863         (html_submit) Disabled.
5864
5865         * lexer.c: (parse_string) Remove debugging printf.
5866
5867         * list.q: (determine_layout) Open a page if one is not yet open.
5868
5869         * output.c: Comment fixes.
5870         (add_class) Set the class member of the new list element.
5871         (parse_options) Don't handle device type.
5872         (colon_tokenize) New function.
5873         (configure_driver) New four-field format with a field for device
5874         type.  Now initialize driver_open, page_open, next, and prev
5875         fields.  Use new colon_tokenize() function.  Don't do a memory
5876         copy to replace a driver, it doesn't work; instead delete the old
5877         driver and insert a new one.
5878         (destroy_driver) Don't call som_destroy_driver().  Close the page
5879         if it's open.  Find the class in the list of classes and decrement
5880         that reference count.  Remove the driver from the global driver
5881         list.
5882         (outp_iterate_enabled_drivers) Renamed outp_drivers().  All
5883         references changed.  Rewritten.  Don't return a driver that's not
5884         enabled.
5885         (outp_eject_page) All references to som_internal_eject_page()
5886         changed to use this.  Sets cp_x to 0 as well as cp_y.
5887
5888         * output.h: (OUTP_I_* enums) Removed.
5889         (struct som_submission_form) Removed.
5890         (struct outp_class) init_driver broken into preopen_driver,
5891         postopen_driver, and close_driver.  submit changed to take a
5892         som_table argument.
5893
5894         * postscript.c: Comment and formatting fixes.  Almost every
5895         external function had an assert added, checking driver_open and
5896         page_open.
5897         (ps_init_driver) Broken into ps_preopen_driver,
5898         ps_postopen_driver, ps_close_driver.  Manages driver_open.
5899         (ps_open_page) Sets page_open.
5900         (ps_close_page) Clears page_open.
5901
5902         * som.c: New file, base implementation.
5903         
5904         * som.h: (struct som_table) Add struct tag.
5905         (enum SOM_COL_ACROSS) Removed.
5906         (SOM_ROWS, SOM_COLUMNS) New enums.
5907         (struct som_table_class) Add member `cumulate'.  Remove `segment';
5908         change `render' arguments.
5909         (struct som_point, struct som_rect) Removed.
5910         (som_submit_table) Fixed typo, should have been som_submit.
5911
5912         * sysfile-info: (describe_variable) Don't try to insert a
5913         subtable; just destroy it for now.
5914
5915         * t-test.q: Include dcdflib/cdflib.h instead of cdflib.h.  Fix
5916         references to value labels.
5917
5918         * tab.c: (tab_destroy) New function.
5919         (tab_columns) Change argument.
5920         [0] (tab_submit) Remove dead code.
5921         (tab_title) Allocate string from the table's arena.
5922         (tab_output_text) Only free the buffer if we allocated it.
5923         (tab_submit) New function.
5924         (static vars t, d) New static vars.
5925         (tabi_table, tabi_driver, tabi_count, tabi_area, tabi_columns,
5926         tabi_headers, tabi_cumulate, tabi_render) New functions.
5927         (glob var tab_table_class) New global var.
5928
5929         * tab.h: (struct tab_join_rect) Don't use a som_rect; directly
5930         encapsulate the rectangle.  All references changed.
5931         
5932 Sun Dec 21 16:18:58 1997  Ben Pfaff  <blp@gnu.org>
5933
5934         * All header files updated to use struct tags in addition to
5935         typedefs for all structures.  Don't use word `struct' in struct
5936         tags.
5937         
5938         * Makefile.am: (pspp_SOURCES) Remove html.c.
5939         (INCLUDES) Replace the lib/* includes with a single lib/ include;
5940         all references updated.
5941
5942         * command.c: (parse_cmd) Remove call to som_check_workspace.
5943         (output_line) Update to new som.
5944
5945         * data-in.c: (parse_numeric) A single dot is not an error; it is
5946         the system-missing value.
5947
5948         * data-list.c: (dump_fixed_table, dump_free_table) Update to new
5949         som.
5950
5951         * data-out.c: Added `const' as appropriate to many prototypes.
5952         (convert_E, convert_F, convert_CCx) Take double argument instead
5953         of value * argument.
5954         (convert_format_to_string) Call changed functions appropriately.
5955         Instead of modifying the caller's value for FCAT_SHIFT_DECIMAL,
5956         make a local copy of the value.
5957
5958         * descript.q: Remove custom_variables() prototype now provided by
5959         q2c.  
5960         (custom_variables) Don't increment sbc_variables, the caller does
5961         this.
5962         (dump_z_table, display) Update to new som.
5963
5964         * error.c: (vmsg) Add const to prototype.  Remove code to handle
5965         `too many errors' condition.
5966         (check_error_count) New function.
5967         (msg) Add const to prototype.
5968
5969         * filename.c: (open_file) Rewrite for elegance.
5970
5971         * frequencies.q: Remove custom_*() prototypes now provided by q2c.
5972         (dump_full, dump_condensed, dump_statistics) Update for new som.
5973
5974         * list.q: Don't include somP.h.  Change all references to
5975         som_driver_ext to refer to the new members of som_driver.  Change
5976         som_internal_eject_page() references to outp_eject_page().
5977
5978         * main.c: (parse) Rewrite for elegance.  Add call to
5979         check_error_count().
5980
5981         * output.c: (add_class, outp_list_classes, outp_configure_driver)
5982         Rewrite or revise for new outp_driver_class_list structure.
5983         (outp_iterate_enabled_drivers) Fix comparison between disabled
5984         devices and current device type.
5985         (outp_eject_page) New function.
5986
5987         * output.h: Comment fixes.
5988         (struct outp_driver) New members driver_open, page_open, cp_x,
5989         cp_y, font_height, prop_em_width, fixed_width.  Deleted members
5990         ref_count, next.
5991         (struct outp_driver_class_list) New struct.
5992         (outp_class_list) Changed to type outp_driver_class_list; all
5993         references updated.
5994
5995         * print.c: (dump_table, print_trns_proc) Updated for new som.
5996
5997         * q2c.c: (dump_vars) Simplify array subcommand code.  Declare
5998         prototypes for custom subcommands.
5999         (dump_subcommand) Always include the `else'.
6000         (dump_parser) Fix comments in output code.
6001
6002         * set.q: Reordered functions.
6003
6004         * som-frnt.c, som-high.c, som-low.c, somP.h: Removed.
6005         
6006         * som.h: Rewritten from scratch.
6007
6008         * str.h: Remove dead code.
6009
6010         * tab.c, tab.h: New files, base implementation.
6011
6012         * sysfile-info.c: (cmd_sysfile_info, describe_variable) Update to
6013         new som.
6014
6015         * t-test.q: New code from John Williams
6016         <johnr.williams@stonebow.otago.ac.nz>.  Include math.h, cdflib.h.
6017         Many many new static vars and defines.
6018         (precalc, postcalc, g_postcalc, z_postcalc, t_pairs, t_groups,
6019         groups_calc, pairs_calc, z_dev_calc, z_calc) New functions.
6020         (struct value_list) New struct.
6021         (variance, covariance, pooled_variance, oneway, pearson_r, f_sig,
6022         t_crt, t_sig, print_t_groups) New functions.
6023         (cmd_t_test) Implemented.
6024
6025         * temporary.c: (cancel_temporary) Only free the temp_dict if it's
6026         non-NULL.
6027
6028         * vfm.c: (dump_splits) Update to new som.
6029
6030 Thu Dec  4 23:02:22 1997  Ben Pfaff  <blp@gnu.org>
6031
6032         * Makefile.am: (fiasco_SOURCES) Add html.c.
6033
6034         * aggregate.c: Base source.
6035
6036         * ascii.c: (postopen, preclose) Reformat.
6037
6038         * data-out.c, expr-evl.c: Comment fixes.
6039         
6040         * filename.c: (open_file) When opening a file for writing, use
6041         line buffering instead of full buffering for better interactive
6042         performance.  Suggested by Valerio Aimale
6043         <valerio@svpop.com.dist.unige.it>.  Also, recognize special file
6044         names `stdin', `stdout', `stderr'.
6045
6046         * groff-font.c: Comment fixes.
6047
6048         * html.c: New file; base version.
6049
6050         * list.q: (write_all_headers, clean_up, determine_layout,
6051         list_cases) Ignore `special' devices for now.  Needs to be fixed
6052         later.
6053
6054         * output.c: (outp_init) Add html driver to list; reverse list
6055         order.
6056
6057         * output.h: (struct outp_class_struct) New members `special',
6058         `submit'; comment fixes.  All references changed.
6059
6060         * postscript.c: (ps_init_driver) Make defaults for text_opt,
6061         line_opt depend on whether the OUTP_DEV_SCREEN bit is set on the
6062         device.
6063         (postopen) Comment fix.
6064         (preclose) Comment fixes, formatting fixes.  Change x->file.file
6065         references to more proper f->file.
6066
6067         * som-high.c: (som_submit_table) Special classes use their own
6068         renderers.
6069
6070         * som.h: Comment fixes.
6071
6072         * temporary.c: (new_dictionary) Don't try to xstrdup() a NULL
6073         string.
6074         
6075 Tue Dec  2 14:36:07 1997  Ben Pfaff  <blp@gnu.org>
6076
6077         * Makefile.am: (fiasco_SOURCES) Add aggregate.c back in.
6078
6079         * aggregate.c: Still working on this.
6080
6081         * command.c: (cmd_table[]) Add AGGREGATE back in.
6082         (split_words) Make '-' a legal word separator as well as ' '.
6083
6084         * main.c: Comment fixes.
6085
6086         * q2c.c: (dump_parser) Don't require the procedure's full name to
6087         be present, in the generated source.
6088
6089         * t-test.q: Change name to `t-test' from `t test'.  Let PAIRS be
6090         multiply specified and let it be default; let MISSING, CRITERIA,
6091         FORMAT be multiply specified.
6092         (cmd_t_test) Parse command name.  [DEBUGGING] Call debug_print().
6093         (custom_groups) Fix defaults.
6094         (custom_pairs) Check whether this is a PAIRS subcommand before
6095         attempting to parse.  Better garbage collection.  Proper storage
6096         allocation.
6097         [DEBUGGING] (debug_print) New function.
6098
6099         * temporary.c: Comment fixes.
6100         (copy_variable) Don't copy variable name and index.
6101         (save_dictionary) Copy variable name and index by hand.
6102
6103         * vars-atr.c: Comment fixes.
6104         (create_variable) New dictionary argument.  All references
6105         changed.
6106         (common_init_stuff) New dictionary argument.  All references
6107         changed.
6108         (init_variable) New dictionary argument.  All references changed.
6109         (dup_variable) New function.
6110
6111         * vars-prs.c: (parse_variables) If there are any errors, we always
6112         return 0.  Previously, it was possible for some types of errors to
6113         be ignored.
6114         
6115 Sat Nov 22 01:20:59 1997  Ben Pfaff  <blp@gnu.org>
6116
6117         * Makefile.am: (fiasco_SOURCES) For 0.1.5 release, remove
6118         aggregate.c.
6119
6120         * command.c: (cmd_table[]) Comment out AGGREGATE; add T TEST.
6121
6122         * list.q, t-test.q: Remove ALL option from VARLIST declaration in
6123         grammar rules.
6124
6125         * q2c.c: Comment fixes.
6126         (SBC_* enums) Remove SBC_VARLIST_ALL; all references removed.
6127         
6128         * t-test.q: (cmd_list) Rename cmd_t_test.
6129
6130         * temporary.c: (new_dictionary) Don't declare as static.
6131         
6132 Fri Nov 21 00:03:06 1997  Ben Pfaff  <blp@gnu.org>
6133
6134         * aggregate.c: Changes, still not finished.
6135
6136         * file-handle.q, frequencies.q, list.q, set.q: Comment fixes.
6137
6138         * q2c.c: Comment fixes.  Now its output is internationalized.
6139         (get_token) Fix parsing of escapes within literal strings.
6140         (main) Fix bad #line directives in output.
6141
6142         * t-test.q: Base implementation.
6143
6144         * temporary.c: (new_dictionary) New function.
6145         (restore_dictionary) [__CHECKER__] Change fill character to *
6146         (from @).
6147         
6148 Sun Nov 16 01:29:57 1997  Ben Pfaff  <blp@gnu.org>
6149
6150         * Makefile.am: (BUILT_SOURCES, fiasco_SOURCES) Add t-test.c
6151
6152         * aggregate.c: Changes, still not finished.
6153
6154         * descript.q, list.q: Comment fixes.
6155
6156         * q2c.c: Almost completely rewritten.
6157
6158         * t-test.q: New file, not complete.
6159
6160 Fri Nov 14 00:14:48 1997  Ben Pfaff  <blp@gnu.org>
6161
6162         * aggregate.c: Changes, still not finished.
6163
6164         * sort.c: (sort_cases) Call cancel_temporary() instead of doing it
6165         by hand.
6166
6167         * temporary.c: (cancel_temporary) New function.
6168
6169         * vars-atr.c: (discard_variables) Call cancel_temporary() instead
6170         of doing it by hand.
6171
6172         * vfm.c: (close_active_file) After restoring a TEMPORARY
6173         dictionary, set temp_dict to NULL.  Cancel TEMPORARY through
6174         cancel_temporary().
6175         (SPLIT_FILE_procfunc) Comment fix.
6176
6177 Tue Oct 28 16:08:45 1997  Ben Pfaff  <blp@gnu.org>
6178
6179         * Makefile.am: (fiasco_SOURCES) Add aggregate.c.
6180
6181         * aggregate.c: New file, not finished yet.
6182
6183         * command.c: (cmd_table) Add AGGREGATE.
6184
6185         * common.h: (pgm_state) Move declaration to var.h.
6186
6187         * lexer.c: (bin_value_func, oct_value_func, hex_value_func) i18n
6188         fixes.
6189         (parse_string) Message fix.
6190
6191         * recode.c: Comment fix.
6192
6193         * sfm-read.c: (read_variables) Code esthetic fixes.
6194         (write_header) Default date is `Jan', not `JAN'.
6195
6196         * sfmP.h: (bswap_int32) [!__linux__] Fix off-by-one errors.
6197
6198         * sort.c: (cmd_sort_cases) Farm the work out to new function
6199         parse_sort_variables().
6200         (parse_sort_variables) New function.
6201         (sort_cases) New function.  Cancels temporary transformations,
6202         which sorting didn't do previously.
6203         (cmd_sort_cases) Better garbage collection on error.  Uses
6204         do_external_sort().
6205         (write_initial_runs, merge_once) Improved code esthetics.
6206         (sort_stream_read) Reduced to one call to read_output_cases().
6207         (read_output_cases) New function.
6208
6209         * var-labs.c: (cmd_variable_labels) Re-enabled truncation of
6210         variable labels to 120 characters.
6211
6212         * var.h: Comment fixes.
6213         (glob var pgm_state) From common.h.
6214
6215         * vars-atr.c: (discard_variables) Set pgm_state to STATE_INIT.
6216
6217         * vars-prs.c: (parse_DATA_LIST_vars) Support PV_SINGLE in
6218         options.  Set *names to NULL on error.
6219
6220         * vfm.c: (memory_stream_init) Assert compaction_nval != 0.
6221
6222 Thu Oct  9 09:59:49 1997  Ben Pfaff  <blp@gnu.org>
6223
6224         * sfm-write.c, vfm.c: [HAVE_UNISTD] #include <unistd.h>, needed by
6225         SunOS4.  From Alexandre Oliva <oliva@dcc.unicamp.br>.
6226
6227 Wed Oct  8 18:55:24 1997  Ben Pfaff  <blp@gnu.org>
6228
6229         * vfm.c: (page_to_disk) Added missing local variables.
6230
6231 Tue Oct  7 20:23:17 1997  Ben Pfaff  <blp@gnu.org>
6232
6233         * get.c: Comment fix.
6234
6235         * sort.c: (cmd_sort_cases) Attempt to perform internal sort if the
6236         source is anything other than a disk stream, not just if it's in a
6237         memory stream.  Call page_to_disk() before external sort.
6238         (allocate_cases) Message fix.
6239
6240         * vfm.c: (prepare_for_writing) Warn user when paging workspace to
6241         disk.
6242         (page_to_disk) New function.
6243
6244 Sun Oct  5 15:56:14 1997  Ben Pfaff  <blp@gnu.org>
6245
6246         * Makefile.am: (INCLUDES) Include .. instead of $(top_srcdir).
6247
6248         * common.h: (macro strerror) Remove.  From Alexandre Oliva
6249         <oliva@dcc.unicamp.br>.
6250
6251         * get.c: (dict_delete_run) The number of variables to delete is
6252         not necessarily the number of variables that need to be shifted
6253         up.
6254         (trim_dictionary) Don't set *options to 0.  Fix bug that caused
6255         too many variables to be deleted.
6256
6257         * postscript.c: Comment fix.
6258
6259         * q2c.c: Include strerror.c.  From Alexandre Oliva
6260         <oliva@dcc.unicamp.br>.
6261
6262         * set.q: #undef ON and OFF.  From Alexandre Oliva
6263         <oliva@dcc.unicamp.br>.
6264
6265         * sfm-read.c: (sfm_read_dictionary) Don't set the file class too
6266         early, otherwise errors cause a bad free().
6267
6268         * str.h: (macro nvsprintf) s/FORMATS/FORMAT/ typo.  From Alexandre
6269         Oliva <oliva@dcc.unicamp.br>.
6270
6271         * temporary.c: (save_dictionary) Don't allocate memory if
6272         n_documents is 0.
6273
6274         * vfm.c: (memory_stream_write) Message fix.
6275
6276 Sat Oct  4 16:20:43 1997  Ben Pfaff  <blp@gnu.org>
6277
6278         * command.c: (static var cmd_table[]) Define REPEATING DATA
6279         command.
6280
6281         * common.h: Added support for broken systems that are missing
6282         EXIT_SUCCESS, EXIT_FAILURE, RAND_MAX, and/or strerror().
6283
6284         * Many source files: Replace syntax error messages via msg() with
6285         call to syntax_error().
6286
6287         * data-list.c: (dump_fixed_table) Add support for dumping table
6288         for REPEATING DATA as well as DATA LIST FIXED.
6289         (cmd_repeating_data) Allows and requires `/' between subcommands.
6290         Does proper thing with allowing rpd.starts_end to stay 0.  Allows
6291         CONTINUED specifications to be omitted.  Forces CONTINUED to be
6292         specified if ID is.  Calculates starts_end, cont_end from logical
6293         record length as reported by fhp.  Calls dump_fixed_table() if
6294         requested.  Fixed length of record copied by memcpy.
6295         (parse_num_or_var) Sets `num' to 0, not NOT_INT, for variables.
6296         Message fix.
6297         (realize_value) Returns sensible value for out-of-range variable
6298         values.
6299         (rpd_parse_record) New argument `ofs'.  Fixed confusion between
6300         length of occurrences and length of line.  Added warning for
6301         fields that exceed the line length.  Fixed infinite loop.
6302         (read_one_set_of_repetitions) Numerous minor changes for more
6303         complete SPSS compliance.  Message fixes.
6304
6305         * dfm.c: (dfm_close) If the file being closed is the inline file,
6306         read all the remaining data before closing it.
6307         (dfm_get_record) Don't close the file on lossage, as either it
6308         has been closed already or it doesn't belong to us.
6309
6310         * error.c: (puts_stdout) New function.
6311         (vmsg) Use puts_stdout instead of puts.
6312
6313         * file-handle.q: (fh_record_width) New function.
6314
6315         * inpt-pgm.c: (init_case) Fixed buffer overrun when inp_nval % 4
6316         == 0.
6317         (clear_case) Ditto.
6318         (input_program_source_read) Made an old kluge an approved method.
6319
6320         * lexer.c: (syntax_error) New function.
6321
6322         * misc.c: [BROKEN_RAND] (ansi_rand, ansi_srand; static var next)
6323         New.
6324
6325         * output.c: (oupt_get_paper_size) Message fix.
6326
6327         * q2c.c: Numerous fixes to formatting of generated code made to
6328         conform to GNU coding standards.  Uses syntax_error() in generated
6329         code.  Other miscellaneous generated message fixes.  Added support
6330         for broken systems that are missing EXIT_SUCCESS, EXIT_FAILURE,
6331         RAND_MAX, and/or strerror().
6332
6333 Sat Oct  4 02:09:56 1997  Ben Pfaff  <blp@gnu.org>
6334
6335         * data-in.c: Comment fixes.
6336
6337         * data-list.c: (struct repeating_data_trns) New member `id_spec'.
6338         (find_variable_input_spec) New function.
6339         (cmd_repeating_data) Initializes id_spec.
6340         (rpd_parse_record) Implemented.
6341         (read_one_set_of_repetitions) Returns -3 by default in order to
6342         kluge out some potential bugs.
6343
6344         * data-out.c: Comment fixes.
6345
6346         * file-type.c: (internal_cmd_record_type) Message fix.
6347
6348         * inpt-pgm.c: (input_program_source_read) Special temporary kluge
6349         for handling -3 return value.
6350
6351 Sat Sep 20 23:58:15 1997  Ben Pfaff  <blp@gnu.org>
6352
6353         * data-list.c: Comment fixes.
6354         (struct dls_var_spec) Reordered members.
6355         (read_from_data_list_fixed) Restructured.
6356         (struct repeating_data_trns) Reordered members.  Renamed `starts'
6357         as `starts_beg', `ends' as `starts_end'.
6358         (cmd_repeating_data) Calculates length of repeated data if
6359         necessary and possible.
6360         (parse_num_or_var) Don't allow string variables.
6361         (realize_value) New function.
6362         (rpd_msg) New function.
6363         (rpd_parse_record) New function.  Currently stubbed out.
6364         (read_one_set_of_repetitions) Implemented.
6365
6366         * inpt-pgm.c: (input_program_source_read) Comment fix.
6367
6368 Thu Sep 18 21:34:57 1997  Ben Pfaff  <blp@gnu.org>
6369
6370         * command.c: (cmd_end_repeat_p) Removed.
6371         (init_cmd_parser) Doesn't set cmd_end_repeat_p.
6372         (parse_cmd_name) Removed.
6373
6374         * data-list.c: Comment fixes.
6375         (data_list_pgm) Removed `eof' member.
6376         (static var first) New var.
6377         (cmd_data_list) Sets `first'.  Ensures that DATA LIST uses the
6378         FILE TYPE file inside FILE TYPE structures.
6379         (append_var_spec) Appends to *first, not dls.spec.
6380         (parse_fixed) Message fixes.
6381         (struct rpd_num_or_var) New.
6382         (struct repeating_data_trns) New.
6383         (static var rpd) New.
6384         (cmd_repeating_data) New function.
6385         (parse_num_or_var) New function.
6386         (parse_repeating_data) New function.
6387         (read_one_set_of_repetitions) New function.
6388
6389         * file-type.c: (cmd_file_type) Message fixes.  Always
6390         default_handle to FILE TYPE file handle.
6391         (internal_cmd_record_type) Message fixes.
6392
6393 Wed Aug 20 14:22:03 1997  Ben Pfaff  <blp@gnu.org>
6394
6395         * repeat.c: Comment fix.  Disable debugging.
6396
6397         * temporary.c: (restore_dictionary) Sets splits to NULL and
6398         n_splits to 0 before destroying the variables because now doing
6399         this tries to remove split variables.
6400
6401         * vars-atr.c: (discard_variables) Asserts that n_splits is 0 after
6402         destroying the dictionary.
6403         (clear_variable) Removes a variable from splits after destroying
6404         it.
6405
6406 Mon Aug 18 18:06:55 1997  Ben Pfaff  <blp@gnu.org>
6407
6408         * cmdline.c: (set_compat) Removed.
6409         (pick_compat) Removed.
6410         (parse_command_line) Removed -c option.
6411         (pre_syntax_message) Removed -c option.
6412         (usage) Remove compatibility code.
6413
6414         * common.h: (macros VER_PC, VER_WND, VER_X) Removed.
6415         (glob var compat) Removed.
6416
6417         * compute.c: (type_check) Fixed messages about type mismatches.
6418
6419         * data-list.c: (cmd_data_list) Removed compatibility code.
6420         (fixed_parse_compatible) Calls convert_negative_to_dash().
6421         Fixed bug where it only set the variable in fx.spec if it created
6422         the variable itself.
6423         (dump_fmt_list) Spelling fix.
6424         (cut_field) Removed compatibility code.
6425
6426         * dfm.c: (cmd_begin_data) Don't require a command terminator on
6427         BEGIN DATA command.
6428
6429         * expr-evl.c: (evaluate_expression) Implement LAG.
6430
6431         * expr-prs.c: (parse_add) Calls convert_negative_to_dash().
6432         (parse_neg) Calls convert_negative_to_dash().
6433         (LAG_func) Increases n_lag to the lag requested.  Fixed assignment
6434         bug.
6435
6436         * expr.h: (struct expression_struct) Removed member max_lag.
6437
6438         * file-type.c: (parse_col_spec) Calls convert_negative_to_dash().
6439         (internal_cmd_record_type) Removed special handling to produce
6440         negative numbers from dash tokens.
6441
6442         * getline.c: (static var DO_REPEAT_level) New var.
6443         (getl_add_DO_REPEAT_file) Increments DO_REPEAT_level.
6444         (handle_line_buffer) Copies the line into getl_buf; doesn't call
6445         copy_with_DO_REPEAT_substitutions().
6446         (getl_read_line) Maintains value of getl_mode.  Calls
6447         perform_DO_REPEAT_substitutions() whenever DO_REPEAT_level is
6448         positive.
6449         (getl_close_file) Decrements DO_REPEAT_level when appropriate.
6450
6451         * getline.h: (getl_mode) New glob var.
6452
6453         * glob.c: Comment fixes.
6454         (init_glob) Restructured.  Sets set_seed.
6455         (init_compat_dependent) Removed.  All references removed.
6456         (get_date) Format changed from MM/DD/YY to DD MMM YYYY.
6457         (__htonl, __htons) Removed.  (What were these for?)
6458
6459         * lexer.c: (static var tbl) Dash set to class CNUM.
6460         (make_hexit) New function from data-out.c.
6461         (get_token_representation) Rewritten.
6462         (convert_negative_to_dash) New function.
6463         (lex_init_compat_dependent) Removed.
6464         (yylex) A dash is parsed as part of a number if it is followed by
6465         a digit.  The ASCII representation of a number is copied to
6466         tokstr.  String parsing farmed out to parse_string().  Comment
6467         fixes.
6468         (bin_value_func, oct_value_func, hex_value_func, parse_string) New
6469         functions.
6470         (preprocess_line) Line processing depends on interactive/batch
6471         mode, not on compatibility mode.  Removed PC+ compatibility code.
6472
6473         * loop.c: (loop_3_trns_proc) Comment fix.
6474
6475         * main.c: Remove dead code.
6476         (main) Remove call to init_compat_dependent().
6477
6478         * misc.c: (convert_fmt_ItoO) Make E format conversion more
6479         conformant.
6480
6481         * print.c: (parse_string_argument) Calls
6482         convert_negative_to_dash().
6483         (fixed_parse_compatible) Calls convert_negative_to_dash().
6484
6485         * repeat.c: (RPT_* defines) Removed.
6486         (struct rpt_numeric) Removed.
6487         (struct repeat_entry) New member type, changed `replacement' from
6488         char * to char **.
6489         (clean_up) Deallocation adapted to new repeat_entry.
6490         (internal_cmd_do_repeat) `type' defaults to 0.  Remove lookahead()
6491         usage.  Creates vars for `type' of 1.
6492         (parse_ids) Sets type of 1.  Adapted to new repeat_entry.
6493         (store_numeric) Rewritten, new interface.
6494         (parse_numbers) Rewritten.
6495         (parse_strings) Rewritten.
6496         (find_DO_REPEAT_substitution) New function.
6497         (perform_DO_REPEAT_substitutions) New function.
6498         (copy_with_DO_REPEAT_substitutions) Removed.
6499         (debug_print) Rewritten.
6500
6501         * set.q: Comment fix.
6502         (custom_results) Removed compatibility code.
6503         (internal_cmd_set) Removed SET EMULATION subcommand.  Removed
6504         compatibility code.
6505
6506         * sysfile-info.c: (cmd_display) Removed compatibility code.
6507
6508         * tokens.h: Comment fixes.
6509         (token types enum) Removed `toktype' typedef name for this int
6510         type.  Removed SUBST.  Restructured.
6511
6512         * vars-atr.c: (discard_variables) Sets n_lag to 0.
6513
6514         * vars-prs.c: Comment fix.
6515
6516         * vfm.c: Comment fixes.
6517         (glob var n_lag) New var.
6518         (static vars lag_count, lag_head, lag_queue) New vars.
6519         (procedure) Removed argument nlag.
6520         (setup_lag) New function.
6521         (close_active_file) Discards lagging state.
6522         (lag_case) New function.
6523         (lagged_case) New function.
6524         (write_case) Lags a case if lagging.
6525
6526         * weight.c: (cmd_weight) Removed compatibility code.
6527         
6528 Sun Aug 17 22:34:40 1997  Ben Pfaff  <blp@gnu.org>
6529
6530         * getline.h: (struct getl_script) New members loop_index, macros.
6531
6532         * getline.c: (getl_add_file) Sets first_line field to NULL.
6533         (getl_add_DO_REPEAT_file) New function.
6534         (handle_line_buffer) When the current line's length is negative,
6535         set the filename and line number.  Increment line number after
6536         reading line.  Pass the line to
6537         copy_with_DO_REPEAT_substitutions() for processing.
6538         (getl_close_file) Free DO REPEAT lines before freeing the
6539         filename, and just set the filename to NULL when doing this,
6540         because otherwise the filename gets freed twice.
6541
6542         * glob.c: (glob var queuing) Removed.  All references removed.
6543
6544         * lexer.c: Comment fixes.
6545         (get_token_representation) New function.
6546
6547         * repeat.c: Comment fixes.
6548         (struct repeat_entry) Replaced type and v union members with a
6549         simple string.
6550         (append_record) New function.
6551         (internal_cmd_do_repeat) Started reforming it for the new
6552         repeat_entry struct.  Properly records filename changes in the
6553         getl_line_buf.  Fixed improper use of = for ==.  Fixed sense of
6554         strncasecmp() result usage.  Uses append_record() to simplify.
6555         Properly discards END REPEAT line.  Calls getl_add_DO_REPEAT_file
6556         to add in the file.
6557
6558         (copy_with_DO_REPEAT_substitutions) Started coding.
6559
6560         [DEBUGGING] (debug_print_lines) New function.
6561
6562         * set.q: (custom_results, internal_cmd_set) s/VER_PCP40/VER_PC/;
6563
6564         * tokens.h: (macro is_id1, is_idn) New macros.
6565
6566 Sat Aug 16 10:57:41 1997  Ben Pfaff  <blp@gnu.org>
6567
6568         * cmdline.c: (static var pre_syntax_message) Changed `win'
6569         compatibility mode to `wnd'.
6570
6571         * data-list.c: (fixed_parse_spss) Renamed
6572         fixed_parse_compatible().
6573
6574         * glob.c: (init_glob) Excise unused code for
6575         program_invocation_short_name.
6576
6577         * lexer.c: (preprocess_line) Leading indentors are ignored in Wnd
6578         as well as in X.
6579
6580         * print.c: (fixed_parse_spss) Renamed fixed_parse_compatible().
6581
6582         * set.q: `win' compatibility renamed `wnd'.
6583
6584 Thu Aug 14 22:11:12 1997  Ben Pfaff  <blp@gnu.org>
6585
6586         * filename.c: [__WIN32__] Change the included Windows header files
6587         (again).
6588         (absolute_filename_p) [__MSDOS__] A filename with a colon as the
6589         second character is absolute.
6590         (dirname) Fix logic error.  Don't printf() the results.
6591         (prepend_dir) Don't printf() the results.
6592
6593         * getline.c: (handle_line_buffer) New function.
6594         (getl_read_line) Reads line with handle_line_buffer() when
6595         appropriate.
6596         (getl_close_file) Discard line buffer data.
6597
6598         * getline.h: Comment fixes.
6599         (struct getl_line_list) New struct.
6600         (getl_script_struct) Added line buffer members.  These are hooks
6601         for use by DO REPEAT to allow it to insert virtual source code
6602         into the program.
6603
6604         * glob.c: (init_glob) [__DJGPP__ || (__WIN32__ && __BORLANDC__)]
6605         Override Borland C++ stupidity that claims Windows has a console
6606         window size of 0x3.
6607
6608         * repeat.c: This is in the process of being restructured from
6609         using a token-buffering approach to the DO REPEAT facility to
6610         using the more flexible approach of a line-buffering approach in
6611         conjunction with the getline module.  Comment fixes.
6612         (struct tok_struct) Removed.
6613         (static vars queue_index, queue_head, queue) Removed.
6614         (static vars line_buf_head, line_buf_tail) New vars.
6615         (internal_cmd_do_repeat) Instead of queuing tokens, queue lines.
6616         Not complete.
6617         (pull_queue, destroy_queue) Removed.
6618         [DEBUGGING] (debug_print_tokens) Removed.
6619
6620 Tue Aug  5 13:57:58 1997  Ben Pfaff  <blp@gnu.org>
6621
6622         * file-handle.q: (prepend_current_directory) New function.
6623         (internal_cmd_file_handle, fh_get_handle_by_filename) Prepends
6624         current directory before normalizing filename.
6625
6626         * filename.c: (gnu_getcwd) New function.
6627         (absolute_filename_p) New function.
6628         (search_path) New argument, PREPEND.  All references changed to
6629         pass NULL except those explicitly mentioned.  Uses
6630         absolute_filename_p().  Prepends PREPEND before trying the
6631         filename.
6632         (dirname, prepend_dir) New functions.
6633
6634         * getline.c: (getl_get_current_directory) New function.
6635         (getl_include) Passes getl_get_current_directory() as PREPEND arg
6636         to search_path().
6637                 
6638 Sun Aug  3 11:42:36 1997  Ben Pfaff  <blp@gnu.org>
6639
6640         * In several source files, the term `script' was replaced with
6641         `syntax file' inside error messages.  Usage of the term `script'
6642         in the sense of a syntax file is now deprecated.
6643
6644         * cmdline.c: (static vars pre_syntax_message, post_syntax_message)
6645         Updated messages.
6646
6647         * dump-sysfile.c: (usage) Update message.
6648
6649         * getline.c: (getl_read_line) Ignore lines beginning with `#!'.
6650
6651         * getline.h: (glob var getl_include_path) Declare extern.
6652
6653         * list.q: Define EXTERN as extern before #including somP.h.
6654
6655         * var.h: Remove declaration of `disptype' variable.
6656
6657         * vfm.c: (close_active_file) After switching the data sink to a
6658         data source, set vfm_sink to NULL, because it doesn't exist any
6659         more.
6660
6661 Thu Jul 17 21:41:44 1997  Ben Pfaff  <blp@gnu.org>
6662
6663         * glob.c: [__BORLANDC__] Include math.h.  Define _matherr() and
6664         _matherrl() to ignore all math errors.
6665
6666         * sfm-read.c: (read_value_labels) When reading the labels from
6667         disk, read the little parts separately instead of as a struct;
6668         this avoids alignment problems.
6669
6670         * sfm-write.c: (struct sfm_fhuser_ext) New member `elem_type'.
6671         (sfm_write_dictionary) Sets elem_type and frees it on lossage.
6672         (write_header) Allocates and initializes elem_type.
6673         (sfm_write_case) Uses elem_type to determine how to handle each
6674         flt64 element.
6675         (sfm_close) Frees elem_type.
6676
6677         * sfmP.h: Comment fix.
6678         [__BORLANDC__] Uses #pragma -a to adjust structure member
6679         alignment.
6680         
6681 Thu Jul 17 01:55:12 1997  Ben Pfaff  <blp@gnu.org>
6682
6683         * Makefile.am: (fiasco_SOURCES) Remove display.c.
6684
6685         * common.c: Fix typo.
6686
6687         * dfm.c: (read_record) Remove strncasecmp() emulation and fix the
6688         sense of the condition.
6689
6690         * expr-evl.c: (macro ALLOC_STRING_SPACE) [!PAGED_STACK] Add
6691         line-continuation backslash.
6692
6693         * filename.c: [__WIN32__] Include <windef.h> before <winbase.h>.
6694
6695         * frequencies.q: (custom_grouped, add_percentile) Don't use a
6696         non-constant expression as an argument to sizeof.
6697
6698         * glob.c: [__WIN32__ && __BORLANDC__] When including <conio.h>,
6699         undefine gettext macro because that's a conio function.
6700
6701         * hash.h: (hsh_prime_tab declaration) Remove.
6702
6703         * list.q: (write_fallback_headers) Move `leader' allocation out of
6704         main loop.  Change to local_alloc() allocation.
6705
6706         * output.h: Formatting fixes.  Put __attribute__ in right place on
6707         function prototypes.
6708
6709         * sfm-read.c: (read_machine_flt64_info, read_variables) Change
6710         incorrect `SECOND_LOWEST_VALUE' references to proper
6711         `second_lowest_value'.
6712
6713         * som-frnt.c: (EXTERN macro) Define as `extern' instead of null
6714         value.  This way 2 out of 3 of the som files define the vars
6715         extern, the correct way, that actually works under BC++.
6716         (som_set_float) Don't use nonconstant initializers for a struct.
6717
6718         * som-high.c: Add the standard alloca() header.
6719         (replicate_table) Add prototype.
6720
6721         Merged DISPLAY routine.
6722         * sysfile-info.c: (AS_*) New enum series.
6723         (cmd_sysfile_info) Gutted.  Calls describe_variable() to do the
6724         dirty work.
6725         (cmd_display, display_macros, display_documents,
6726         display_variables) Stolen from defunct display.c.
6727         (describe_variable) New function.
6728
6729         * temporary.c: [0] (display_tree) New debug function.
6730         (copy_variable) Performs shallow copy of value labels instead of
6731         deep copy; i.e., just copys the AVL tree and increments the
6732         reference counts.
6733
6734         * val-labs.c: Comment fixes.
6735         (do_value_labels) Optionally skip leading forward slash.
6736         (get_label) Creates only a single value label instead of many
6737         copies of one, and sets the reference count.
6738
6739         * display.c: Removed.
6740
6741         * dump-sysfile.c: New file, not yet complete.
6742
6743 Fri Jul 11 23:02:18 1997  Ben Pfaff  <blp@gnu.org>
6744
6745         For lots of source files I added more verbose_msg's.  These aren't
6746         listed below as they have tested as being benign.  In some cases
6747         these replaced debug_printf() calls.
6748
6749         * output.c: (outp_read_devices) Message fix.
6750
6751         * postscript.c: (output_encodings) Message fix.  Reports errors on
6752         fclose().
6753         (postopen) Message fix.
6754         
6755 Fri Jul 11 14:09:40 1997  Ben Pfaff  <blp@gnu.org>
6756
6757         * dfm.c: (dfm_close) Don't call fclose() for a NULL FILE.
6758
6759         * filename.c: (close_file_ext) Set f->file to NULL *after* closing
6760         it.
6761
6762         * main.c: Remove <malloc.h> #include.
6763
6764         * mis-val.c: (parse_numeric) Set .f member for each missing[]
6765         instead of trying to just set the missing[] itself, which is a
6766         gcc-specific idiom.
6767
6768         * sfm-read.c: (read_variables) Same.
6769
6770         * str.h: Add memmem() prototype.
6771
6772         * val-labs.c, var-labs.c: Replace <malloc.h> with <stdlib.h>.
6773
6774 Thu Jul 10 22:13:53 1997  Ben Pfaff  <blp@gnu.org>
6775
6776         * Makefile.am: (q2c) Don't include any libraries in the link.
6777
6778         * dfm.c: (force_line_buffer_extension) New macro.
6779         (count_tabs) New function.
6780         (tabs_To_spaces) New function.
6781         (read_record) Calls tabs_to_spaces() on the line being processed.
6782
6783         * q2c.c: Disabled i18n for this proglet so that libintl.a doesn't
6784         have to be compiled twice (once for CC, once for LOCAL_CC).
6785  
6786 Sun Jul  6 19:14:33 1997  Ben Pfaff  <blp@gnu.org>
6787
6788         * Makefile.am: (INCLUDES) Add intl directory; fix directories.
6789         (LDADD) Add @INTLLIBS@.
6790         (q2c) Add LIBS, @INTLLIBS@ to link step.
6791
6792         * inpt-pgm.c: Turn off debugging.
6793
6794         * postscript.c: (postopen) Format fix.  local_free() blocks
6795         returned by local_alloc(); don't free() them.
6796
6797 Sat Jul  5 23:44:51 1997  Ben Pfaff  <blp@gnu.org>
6798
6799         * data-in.c: (parse_string_as_format) Comment fix.  Fix check for
6800         string length.
6801
6802         * data-list.c: (read_from_data_list_fixed) Pass proper value for
6803         LEN arg, not simply the full string length.
6804
6805         * sort.c: (allocate_file_handles) Check SPSS compatible temp file
6806         directories before generic temp file directories.
6807
6808         * vfm.c: Disable debugging.
6809
6810 Fri Jul  4 13:26:41 1997  Ben Pfaff  <blp@gnu.org>
6811
6812         * get.c: Comment fix.
6813         (cmd_save_internal) Always passes GTSV_OPT_SAVE option.
6814
6815 Wed Jun 25 22:52:28 1997  Ben Pfaff  <blp@gnu.org>
6816
6817         * expr-prs.c: (debug_print_postfix) Conditionally included on
6818         GLOBAL_DEBUGGING.  Removed out_header() reference.
6819
6820         * exprP.h: Removed #undef GLOBAL_DEBUGGING.
6821
6822 Sun Jun 22 22:00:28 1997  Ben Pfaff  <blp@gnu.org>
6823
6824         * ascii.c: Removed obsolete ascii_close_page() prototype.
6825
6826         * command.c: (output_line) Comment fix.
6827
6828         * data-in.c: Formatting fix.
6829         (parse_string_as_format) Now the `fc' argument is used only for
6830         the purpose of error messages; it is not an index into the string
6831         passed.  All references changed.
6832
6833         * data-list.c: Comment fix.
6834         (cut_field) Comment fix.  Now returns the column number of the
6835         position of the field cut out on success.
6836         (parse_field) Added `column' argument.  Puts the column numbers in
6837         the error message.
6838         (read_from_data_list_free, read_from_data_list_list) Record the
6839         column number returned by cut_field(), pass it to parse_field().
6840
6841         * dfm.c: Comment fix.
6842
6843         * do-ifP.h: Comment fix.
6844
6845         * expr-prs.c: (SYSMIS_func) Implemented string-type arguments for
6846         the SYSMIS function.
6847
6848         * expr.h, exprP.h: Comment fix.
6849
6850         * glob.c: (init_glob) Only calls setlocale() and family if
6851         ENABLE_NLS set.
6852
6853         * hash.h: Comment fix.
6854
6855         * include.c: Comment fix.
6856
6857         * output.c: Comment fix.
6858
6859         * postscript.c: (ps_line_intersection) Simplified assertion.
6860
6861         * repeat.c: Comment fix.
6862
6863         * vars-atr.c: Comment fix.
6864
6865         * vars-prs.c: Comment fix.
6866
6867         * vfm.c: (vector_initialization) [DEBUGGING] Fixed undefined
6868         behavior with usage of postincrement.
6869         (memory_stream_read) Discards cases as it goes. 
6870
6871 Sun Jun 15 16:45:17 1997  Ben Pfaff  <blp@gnu.org>
6872
6873         * Makefile.am: Cleans q2c, not just distcleans it.  Distcleans
6874         foo.
6875
6876         * Most source files: Includes debug-print.h, related comment
6877         fixes.
6878
6879         * cases.c: (alloc_val) Removed complex allocation code.  Merely
6880         increments default_dict.nval and returns the former value.
6881         (envector, devector) Removed references to lv member of struct
6882         variable.
6883
6884         * common.h: (macro VME) Replaced complex definition with simple
6885         one.
6886
6887         * data-list.c: (cmd_data_list) Sets vfm_source instead of
6888         read_active_file and cancel_input_pgm.
6889         (read_from_data_list, cancel_data_list) Removed.
6890         (data_list_source_read, data_list_source_destroy_source) New
6891         functions.
6892         (glob var data_list_source) New var.
6893
6894         * dfm.c: (open_file_r, open_file_w) Simplified debug output.
6895         (cmd_begin_data) Improved criteria for an input program accessing
6896         the inline file.  Still not perfect.
6897
6898         * do-if.c: (do_if_trns_proc) Simplified debug output.
6899
6900         * expr-prs.c: Comment fixes.
6901         [DEBUGGING] (debug_print_postfix) Simplified debug output.
6902
6903         * file-handle.q: (fh_close_handle) Simplified debug output.
6904
6905         * file-type.c: Comment fixes.
6906         (cmd_file_type) Sets vfm_source instead of read_active_file and
6907         cancel_input_pgm.
6908         (cmd_end_file_type) On failure, discards variables in place of
6909         just canceling the input program.
6910         (read_from_file_type) Renamed file_type_source_read.
6911         (cancel_file_type) Renamed file_type_source_destroy_source.
6912         (glob var file_type_source) New var.
6913
6914         * get.c: (GTSV_* enum series) New enums GTSV_OPT_SAVE, GTSV_NONE.
6915         (cmd_get) Initializes options to GTSV_NONE before passing to
6916         trim_dictionary().  Removed `lv' reference.  Sets vfm_source
6917         instead of read_active_file and cancel_input_pgm.
6918         (cmd_save_internal) Initializes options before passing to
6919         trim_dictionary().  Local var `nval' removed.
6920         (dict_delete_run) Comment fixes.
6921         (trim_dictionary) Comment fixes.  Disallows scratch variables if
6922         GTSV_OPT_SAVE set in options.
6923         (read_from_get) Renamed get_source_read.
6924         (cancel_get) Renamed get_source_destroy_source.
6925         (glob var get_source) New var.
6926
6927         * inpt-pgm.c: (cmd_input_program) Sets vfm_source instead of
6928         read_active_file and cancel_input_pgm.
6929         (read_from_input_program) Renamed input_program_source_read.
6930         Simplified debug output.
6931         (cancel_input_program) Renamed
6932         input_program_source_destroy_source.
6933         (glob var input_program_source) New var.
6934
6935         * loop.c: (loop_1_trns_proc) Simplified debug output.
6936
6937         * main.c: (dump_token) Made eof output more explicit.
6938
6939         * sfm-read.c: (read_variables, dump_dictionary) Removed `lv'
6940         references.
6941
6942         * sort.c: (cmd_sort_cases) Disallows scratch variables.  Removed
6943         code for always-memory or always-disk cases.  malloc's case-list
6944         based on vfm_source_info.ncases.  Explicit support for
6945         memory_stream via memory_source_cases.
6946         (do_external_sort) Sets vfm_source instead of read_active_file and
6947         cancel_input_pgm.
6948         (allocate_file_handles) The temporary directory permissions are
6949         set to 0700 instead of 0777.
6950         (allocate_cases) Formatting fixes.  Simplified debug output.
6951         (output_record) Compacts the case if necessary before writing it
6952         out.
6953         (close_handle, open_handle_w) Simplified debug output.
6954         (write_initial_runs) Destroys vfm_sink, then sets it to
6955         sort_stream.  Writes records to memory based on
6956         vfm_sink_info.case_size.
6957         (write_to_sort_cases) Renamed sort_stream_write().
6958         (merge) Simplified error handling.  Simplified debug output.
6959         Formatting fixes.
6960         (read_from_external_sort) Renamed sort_stream_read().
6961         Reads records based on vfm_source_info.case_size.
6962         (sort_stream_write) Writes records to memory based on
6963         vfm_sink_info.case_size.
6964         (sort_stream_mode) New function.
6965         (glob var sort_stream) New variable.
6966
6967         * temporary.c: (cmd_temporary) Simplified debug output.
6968         (copy_variable) Removed references to `lv'.
6969
6970         * title.c: (get_title) Simplified debug output.
6971
6972         * var.h: Comment fixes.
6973         (struct get_proc) Removed member `lv'.
6974         (struct variable) Removed member `lv'.  Comment fixes.
6975         (glob vars read_active_file, write_active_file, cancel_input_pgm)
6976         Removed.
6977         (struct case_stream) New.
6978
6979         * vars-atr.c: (discard_variables) Changed cancel_input_pgm,
6980         read_active_file references to use vfm_source.
6981         (init_variable, replace_variable) Removed references to `lv'.
6982
6983         * vfm.c: Comment fixes.
6984         (glob var vfm_source, vfm_sink, vfm_source_info, vfm_sink_info)
6985         New variables.
6986         (static var queue, qh, qt, n_lag) Removed.  All references
6987         removed.
6988         (glob var compaction_necessary, compaction_nval, compaction_case,
6989         paging) New variables.
6990         (record_case) Removed.
6991         (procedure) Comment fixes.  Calls vfm_source->read() instead of
6992         read_active_file().
6993         (lag) Removed.
6994         (prepare_for_writing, arrange_compaction, make_temp_case,
6995         vector_initialization, setup_filter) New function.
6996         (open_active_file) Most of the code moved into the abovementioned
6997         new functions.  Now sets temp_dict to &default_dict if there is no
6998         temporary dictionary, for convenience.  New debug output.
6999         (close_active_file) Deals with changing the sink to the source.
7000         Calls finish_compaction().  Frees compaction_case.  Mostly
7001         rewritten.
7002         (glob vars disk_source_file, disk_sink_file) New vars.
7003         (destroy_active_file, read_from_memory) Removed.
7004         (disk_stream_init, disk_stream_read, disk_stream_write,
7005         disk_stream_mode, disk_stream_destroy_source,
7006         disk_stream_destroy_sink) New functions.
7007         (glob var vfm_disk_stream) New var.
7008         (glob vars memory_source_cases, memory_sink_cases,
7009         memory_sink_iter, memory_sink_max_cases) New vars.
7010         (memory_stream_init, memory_stream_read, memory_stream_write,
7011         memory_stream_mode, memory_stream_destroy_source,
7012         memory_stream_destroy_sink) New functions.
7013         (glob var vfm_memory_stream) New var.
7014         (write_case) Local var `i' renamed `cur_trns'; local var `retval'
7015         named `more_cases'.  Simplified debug output.  Otherwise mostly
7016         rewritten.
7017         (record_case) Moved into the stream drivers.  Removed.
7018         (transform) Removed (was dead code).
7019         (SPLIT_FILE_procfunc) s/vfm_replacement/vfm_sink_info/.  In the
7020         common case that the splits don't change, we don't need to copy
7021         the case into prev_case again--pointless.
7022         (compact_case) New function.
7023         (finish_compaction) New function.
7024
7025         * vfmP.h: Comment fixes.
7026         (DEV_* enum series) Removed. 
7027         (struct storage) Renamed `stream_info'.  Removed variant record.
7028         Removed `device' member.
7029
7030         * debug-print.h: New file.
7031         
7032 Sun Jun  8 01:12:38 1997  Ben Pfaff  <blp@gnu.org>
7033
7034         * autorecode.c: Turned off debugging.
7035
7036         * data-list.c: (destroy_dls) Closes the associated file handle.
7037
7038         * descript.q: (custom_variables) Added PV_NO_SCRATCH to
7039         parse_variables() options.
7040
7041         * dfm.c: (open_file_r) Removed gratuituous argument to msg() call.
7042
7043         * display.c: (display_variables) Really fixed null cell bug.
7044
7045         * file-handle.q: (fh_close_handle) Changed debugging message.
7046
7047         * frequencies.q: (custom_variables) Added PV_NO_SCRATCH to
7048         parse_variables() options.
7049
7050         * list.q: Added PV_NO_SCRATCH in q2c varlist options.
7051         (cmd_list) Fails if no variables specified.
7052         (determine_layout) Writes blank lines manually.
7053
7054         * loop.c: (loop_1_trns_proc) Made debugging code only print
7055         messages if debugging.
7056
7057         * q2c.c: (dump_subcommand) Appends sbc->message to SBC_VARLIST
7058         parse_variables() arguments.
7059         (main) Parses optional parenthesized options to varlist
7060         subcommands into sbc->message.
7061
7062         * sfm-read.c: Format fix.
7063
7064         * var.h: (FV_*) New enum series.
7065         (PV_*) New enum PV_NO_SCRATCH.
7066
7067         * vars-prs.c: (find_var) Removed.
7068         (fill_all_vars) Takes FV_* enum instead of boolean third
7069         argument.  Rewritten to deal with scratch as well as system
7070         variables.
7071         (parse_variables) Error message on scratch variable if
7072         PV_NO_SCRATCH set.
7073
7074         * vfm.c: (static var virt_begin_func) New var.
7075         (procedure) Sets up virt_begin_func.
7076         (SPLIT_FILE_procfunc) For the first case, calls virt_begin_func()
7077         after dump_splits().  For succeeding groups changes, calls
7078         virt_begin_func() instead of begin_func().      
7079
7080 Fri Jun  6 22:42:23 1997  Ben Pfaff  <blp@gnu.org>
7081
7082         * count.c, data-out.c, file-handle.q, list.q, loop.c: Turned off
7083         debugging.
7084
7085         * dfm.c: Added some debugging messages, disabled by default.
7086         (open_file_r) Fixed error message.
7087         (read_record) On eof on inline_file, instead of calling
7088         fh_close_handle(), simply jump to eof label like a normal file.
7089         Message fixes.
7090
7091         * display.c: Thin lines between rows for certain kinds of
7092         listing.  Fixed `null cell' bug.
7093
7094         * error.c: (failure) Flush stdout, stderr before failing.
7095
7096         * file-handle.q: (fh_close_handle) Added debugging message.
7097
7098         * frequencies.q: (dump_full) Bottom line extends across entire
7099         table width.  Changed title formatting.
7100         (dump_condensed) Changed title formatting.
7101         (dump_statistics) Fixed title formatting.
7102
7103         * glob.c: (init_glob) Moved initialization of cur_proc out of #if.
7104         Sets default value of set_format.
7105
7106         * list.q: (cmd_list) Calls blank_line() before determine_layout().
7107         Passes write_all_headers() to procedure() as pre-group func.
7108         (write_all_headers) New function.
7109         (determine_layout) Removed calls to write_header().
7110         Calls blank_line() before and after write_fallback_headers().
7111
7112         * recode.c: (recode_trns_free) Only attempts to free head->map if
7113         non-NULL.
7114
7115         * sfm-read.c: (read_variables) Allows `#' at beginning of system
7116         file variable names but gives a warning.  Sets `left' based on
7117         first character being/not being `#'.  On lossage frees dict->var.
7118
7119         * som-high.c: (som_draw_title) Simplified title formatting.
7120
7121         * vfm.c: (dump_splits) Fixed and changed splits formatting.
7122
7123 Thu Jun  5 22:51:15 1997  Ben Pfaff  <blp@gnu.org>
7124
7125         * autorecode.c: (cmd_autorecode) Sets h_trans to NULL at
7126         beginning.  Frees v_src, v_dest on successful exit.  Frees
7127         h_trans[*], h_trans on lossage.
7128         (recode) Frees h_trans[*], h_trans.
7129
7130         * dfm.c: (dfm_close) Formatting change.
7131         (open_inline_file) Now passed a dfm_fhuser_ext to initialize; no
7132         longer allocates its own in inline_file.
7133         (open_file_r) Passes the local dfm_fhuser_ext to
7134         open_inline_file().
7135         (open_file_w) Message fix. 
7136         (read_record) Buffer reallocation strategy changed.  Frees
7137         ext->line even in inline_file to prevent leaks.
7138         (dfm_put_record) Fixed bug where `ext' was cached before the file
7139         was opened and thus it would be NULL when the file really was
7140         open.
7141         (cmd_begin_data) Sets up inline_file basics itself, then calls
7142         open_inline_file() for the dfm_fhuser_ext.  Formatting fix.
7143
7144         * list.q: (write_line) Formatting fix.
7145         (clean_up) Minor strategy change.  Sets proportional font after
7146         finishing cleanup.
7147         (determine_layout) Sets fixed font before writing regular headers,
7148         or after writing fallback headers.
7149
7150         * modify-vars.c: (cmd_modify_vars) Frees variable lists for DROP
7151         and KEEP vars after using them.
7152
7153         * postscript.c: (ps_init_driver) Frees x->family.
7154         (postopen) When loading fonts, free the temporary font name buffer
7155         after using it.
7156         (ps_text_set_font_by_position) Free temporary font name buffer
7157         after using it.
7158         (text) Fixed code that calculated `lig' so that `lig' always gets
7159         initialized.  Formatting fix.
7160
7161         * som-low.c: (get_cell_size, som_get_table_size) `prop_height' ->
7162         `font_height'.
7163         [GLOBAL_DEBUGGIGN] (check_table) Use arena_alloc() to allocate
7164         cells, not xmalloc(), so that the cells will get destroyed
7165         automatically.
7166
7167         * sysfile-info.c: (cmd_sysfile_info) Frees the dictionary after
7168         using it.
7169
7170 Tue Jun  3 23:33:22 1997  Ben Pfaff  <blp@gnu.org>
7171
7172         * ascii.c: (ascii_text_draw) Always sets metrics for strings that
7173         are drawn.
7174
7175         * dfm.c: Comment fix.
7176
7177         * list.q: Comment fixes.  Include somP.h.  Removed static vars
7178         table, n_columns, n_rows, part.  New struct list_ext.  New static
7179         var line_buf.
7180         (n_lines_remaining, n_chars_width, write_line) New functions.
7181         (cmd_list, list_cases) Rewritten.
7182         (begin_row, end_row, flush_table) Removed.
7183         (write_header, clean_up, write_varname, write_fallback_headers,
7184         determine_layout) New functions.
7185
7186         * output.c: (outp_iterate_enabled_drivers) Minor reformat.
7187
7188         * output.h: Comment fix.
7189
7190         * postscript.c: Comment fix.
7191         (struct ps_driver_ext) Removed prop_size, fixed_size members;
7192         added font_size.  All references changed.
7193         (ps_init_driver) Initializes font_size.  Simplified space checking
7194         code.
7195         (static var option_tab[]) Removed prop-size, fixed-size; added
7196         font-size.
7197         (ps_option) Handles font_size.
7198
7199         * som-high.c: Moved prototypes into somP.h.
7200         (som_init_driver) New function.
7201         (som_submit_table) Moved some code into new function
7202         som_init_driver().
7203         (build_target) Moved some code into new function
7204         som_internal_eject_page().
7205         (som_eject_page) Uses som_internal_eject_page().
7206         (som_internal_eject_page) New function.
7207
7208         * som-low.c: Moved prototypes into somP.h.
7209
7210         * som.h: Formatting fixes.
7211
7212         * somP.h: (struct som_driver_ext) Removed em_width;
7213         added prop_em_width, fixed_width.
7214
7215 Mon Jun  2 14:25:25 1997  Ben Pfaff  <blp@gnu.org>
7216
7217         * Makefile.am: Added `localedir' definition.  Added
7218         -DLOCALEDIR="..." to DEFS.  Added -I. to INCLUDES.
7219
7220         * ascii.c: (macro draw_line) Fixed capitalization.
7221
7222         * ascii.c, autorecode.c, cases.c, cmdline.c, command.c, common.c,
7223         compute.c, count.c, data-in.c, data-list.c, data-out.c,
7224         descript.q, dfm.c, display.c, do-if.c, error.c, expr-evl.c,
7225         expr-opt.c, expr-prs.c, file-handle.q, file-type.c, filename.c,
7226         formats.c, frequencies.q, get.c, getline.c, glob.c, groff-font.c,
7227         hash.c, heap.c, include.c, inpt-pgm.c, lexer.c, list.q, loop.c,
7228         main.c, mis-val.c, misc.c, modify-vars.c, numeric.c, output.c,
7229         postscript.c, print.c, q2c.c, recode.c, rename-vars.c, repeat.c,
7230         sample.c, sel-if.c, sfm-read.c, sfm-write.c, sfmP.h, som-frnt.c,
7231         som-high.c, som-low.c, sort.c, split-file.c, sysfile-info.c,
7232         temporary.c, title.c, tokens.h, val-labs.c, var-labs.c,
7233         vars-atr.c, vars-prs.c, vector.c, vfm.c, weight.c: Marked strings
7234         for internationlization.
7235
7236         * glob.c: [HAVE_LOCALE_H] Includes locale.h.
7237
7238 Sun Jun  1 23:31:18 1997  Ben Pfaff  <blp@gnu.org>
7239
7240         * do-if.c, sort.c, val-labs.c: Comment fixes.
7241
7242         * glob.c: (init_glob) Uncommented, updated i18n support.
7243         
7244         * arena.c, ascii.c, data-in.c, descript.q, error.c, expr-evl.c,
7245         expr-opt.c, expr-prs.c, filename.c, frequencies.q, groff-font.c,
7246         output.c, postscript.c, sfm-read.c, som-high.c, vars-prs.c: Made
7247         the declarations of macros taking arguments a lot nicer.
7248
7249 Sun Jun  1 17:22:04 1997  Ben Pfaff  <blp@gnu.org>
7250
7251         * error.h: Removed CE, CW aliases for SE, SW.
7252
7253         * q2c.c: Removed explicit streq() definition since it's duplicated
7254         in str.h.
7255         
7256         * approx.h, error.h, font.h, hash.h, misc.h, output.h, somP.h,
7257         stats.h, str.h, tokens.h: Made the declarations of macros taking
7258         arguments a lot nicer-looking of <pinard@iro.umontreal.ca>.
7259         Comment fixes.
7260
7261 Sun Jun  1 12:02:06 1997  Ben Pfaff  <blp@gnu.org>
7262
7263         * cmdline.c: Comment fixes.
7264         (pick_compat) Changed return type to int.  Now, instead of setting
7265         glob var `compat' to the emulation, returns the emulation.  All
7266         references changed.
7267         (parse_command_line) Added terminating null to end of
7268         `long_options' array definition.
7269         (pre_syntax_message) Fixes.
7270         (usage) Shows the default emulation in the syntax message by
7271         calling pick_compat().
7272
7273         * getline.c: (getl_add_include_dir) Separates paths with
7274         PATH_DELIMITER, not DIR_SEPARATOR.
7275
7276         * glob.c: (init_glob) Fixed references to DEFAULT_VER_PCP40,
7277         DEFAULT_VER_WIN61, DEFAULT_VER_X40.
7278
7279         * output.c: (outp_configure_macro) Make earlier definitions for a
7280         particular key override later ones for the same key.
7281         
7282 Fri May 30 19:40:49 1997  Ben Pfaff  <blp@gnu.org>
7283
7284         * ascii.c: Comment fixes.
7285
7286         * output.c: (outp_get_paper_size)
7287         s/STAT_OUTPUT_INIT_FILE/STAT_OUTPUT_PAPERSIZE_FILE/.
7288         
7289 Sun May 25 22:34:07 1997  Ben Pfaff  <blp@gnu.org>
7290
7291         * ascii.c, postscript.c, sfm-read.c, sfm-write.c, sort.c: Include
7292         <errno.h>.  GNU libc 2 enforces this!
7293
7294         * command.c: (parse_cmd) Fixed problem with `else' clause being
7295         paired with wrong `if'.  Comment fix.
7296
7297 Fri May  9 16:53:52 1997  Ben Pfaff  <blp@gnu.org>
7298
7299         * getline.c: [!HAVE_LIBREADLINE] (read_console) Changed
7300         blp_getline() to getline().
7301
7302         * output.c: (outp_eval_dimension) Changed the fix from last time;
7303         there was no variable `a'.
7304
7305         * q2c.c: (get_line) Fixed boundary condition overrun bug.
7306
7307 Mon May  5 21:58:22 1997  Ben Pfaff  <blp@gnu.org>
7308
7309         * output.c: (outp_evaluate_dimension) Fixed handling of negative
7310         numbers having fractional parts.  Added case of a fraction without
7311         a whole-number part.
7312
7313 Fri May  2 22:08:05 1997  Ben Pfaff  <blp@gnu.org>
7314
7315         * ascii.c: (ascii_text_get_font_position) Removed.
7316
7317         * expr.h, exprP.h: Disabled debugging.
7318
7319         * groff-font.c, postscript.c: Changed `groff' to `Groff' in
7320         several places.
7321
7322         * output.h: (struct outp_class_struct) Removed
7323         text_get_font_position method.  All references deleted.
7324
7325         * postscript.c: Big change here.  Fontmaps were completely
7326         eliminated because of a change in philosophy.  Comment fixes.
7327         (struct ps_fontmap, ps2dit_map, font_family, dit2family_map)
7328         Removed.
7329         (struct ps_driver_ext) `position', `fontmap', `prop_name',
7330         `fixed_name' members removed.  New members `prop_family',
7331         `fixed_family'.  `family' member changed to type char *.
7332         (static var ps_fontmaps) Removed.
7333         () Removed.
7334         (ps_init_driver) Removed obsolete references, updated.
7335         Initializes `translate_x', `translate_y', `scale'.  Doesn't read
7336         fontmap, of course.  Refers to font names through internal_name
7337         rather than subversive means.  Frees proper items.
7338         (static var option_tab[]) Removed `fontmap-file' option; renamed
7339         `fixed-font', `prop-font'.
7340         (ps_option) Corresponds to option_tab[].
7341         (read_fontmap, release_fontmap, ps_to_dit, compare_ps2dit,
7342         hash_ps2dit, compare_dit2family, hash_dit2family, compare_family,
7343         hash_family) Removed.
7344         (postopen) Generates font names from family names.  Gets
7345         PostScript font name properly.  New prologue file comment `!!!'
7346         style.
7347         (ps_open_page) Adds translate_x, translate_y to BP prologue
7348         function; gives SF argument floating-point format.
7349         (ps_text_set_font_by_name) Doesn't try to map PostScript->Groff
7350         font name.  Doesn't change font family.
7351         (ps_text_set_font_by_position) Generates Groff font name from font
7352         family name instead of through table lookup.
7353         (ps_text_set_font_by_family) Renamed `ps_text_set_font_family',
7354         all references changed.  Reduced to simple string assignment.
7355         (ps_get_font_name) Removed.
7356         (ps_get_font_family) Reduced to string return.
7357         (text) Doesn't save `position' since it no longer exists.  Ugly
7358         kluge to save font family--fix soon?
7359         (load_font) Removed PostScript name argument.
7360         
7361 Thu May  1 14:58:59 1997  Ben Pfaff  <blp@gnu.org>
7362
7363         * postscript.c: Comment fix.
7364         (ps_open_page) Puts scale factor in PostScript output.
7365         
7366 Sat Apr 26 11:49:32 1997  Ben Pfaff  <blp@gnu.org>
7367
7368         * Makefile.am: Distcleans q2c.
7369
7370 Wed Apr 23 21:33:48 1997  Ben Pfaff  <blp@gnu.org>
7371
7372         * ascii.c: (delineate) Sets text size even if width is zero.
7373
7374         * command.c: Comment fix.
7375         (static var cmd_table[]) Re-enabled EVALUATE command.
7376         (parse_cmd) Lotsa comment fixes.  Fixed infinite loop in parsing
7377         of comments in script files.  Now more liberal on criteria for
7378         performing a state transition--if *anything* happened correctly,
7379         not just if *everything* happened correctly.
7380
7381         * data-out.c: (convert_F) Comment fix.  Why in the fsck does
7382         Checker segfault on formatting large numbers and why in the fsck
7383         hadn't I noticed this before?
7384
7385         * expr.h, exprP.h: No longer turn off GLOBAL_DEBUGGING.
7386
7387         * list.q: (cmd_list) Commented out the actual output routine
7388         because of various problems.  Probably will abandon the idea of
7389         using the general `crushed tables' for the LIST procedure.
7390
7391         * temporary.c: (restore_dictionary) Sets var_by_name to NULL after
7392         clearing it.  Allocates a new var_by_name dictionary before trying
7393         to add members to it.
7394
7395         * vars-atr.c: [DEBUGGING] (dump_one_var_node) Removed argument
7396         `sib'.  Changed type of `node' argument.
7397         [DEBUGGING] (dump_var_tree) Replaced avlwalk() with
7398         avl_walk_inorder().
7399         (clear_variable) Only dumps the var tree if var_by_name non-NULL.
7400         [DEBUGGING] Only deletes the variable from var_by_name if that var
7401         non-NULL.
7402
7403 Fri Apr 18 16:48:41 1997  Ben Pfaff  <blp@gnu.org>
7404
7405         * Makefile.am: Added include files to SOURCES.  Added
7406         frequencies.q to EXTRA_DIST.  Removed include/ from INCLUDES.  Now
7407         includes rules for q2c.  Added `boast' target.
7408
7409 Fri Apr 18 15:42:22 1997  Ben Pfaff  <blp@gnu.org>
7410
7411         * Makefile.am: Maintainer-clean Makefile.in.
7412         
7413         * Makefile.am: Fixed redundant EXTRA_DIST line.
7414
7415         * ascii.c: Comment fixes.
7416         (ascii_line_vert) Fixed overly aggressive range check.
7417
7418         * display.c: Removed dead code.
7419
7420         * list.q: Turn debugging on.
7421         (flush_table) New debug code.
7422
7423         * sfm-read.c: (read_value_labels) malloc's the structure before
7424         trying to assign to its members.
7425
7426         * sfm-write.c: Comment fix.
7427
7428         * som-high.c: (som_submit_table) Sets som.t and som.d on each call
7429         to output_table().
7430         (output_table) No arguments anymore--gets them through `som'
7431         global.  New debug code.  In crushed tables, now sets `htv' as
7432         well as `hv' to avoid bad confusion later.
7433         (dump_crush_page) New debug code.
7434
7435         * som-low.c: (som_dump_crush_page) New debug code.
7436
7437 Thu Mar 27 01:11:29 1997  Ben Pfaff  <blp@gnu.org>
7438
7439         All source files: Broke long lines into multiple lines.
7440         
7441         * ascii.c: (ascii_close_page) Uses host_system var in place of
7442         HOST_SYSTEM constant.
7443
7444         * cmdline.c: (var syntax_message[]) Broke into
7445         pre_syntax_message[] and post_syntax_message[].
7446         (usage) Outputs both parts, separated by driver list.
7447
7448         * error.h: Fixed broken formatting.
7449
7450         * expr-opt.c: (str_search, str_rsearch) New functions.
7451
7452         * misc.c: (blp_getdelim) Removed.  All references changed to
7453         `getdelim'.
7454         (str_search, str_rsearch) Removed.
7455         (memrmem) New function.
7456
7457         * misc.h: (blp_getline) Removed.  All reference changed to
7458         `getline'.
7459
7460         * stat.h: New file.
7461
7462         * filename.c: Includes "stat.h", not <sys/stat.h>.
7463         (blp_getenv) Uses host_system var instead of HOST_SYSTEM constant.
7464
7465         * output.c: (outp_list_classes) Changed output formatting.
7466
7467         * sfm-write.c: (write_header) Uses host_system var instead of
7468         HOST_SYSTEM constant.
7469         (write_rec_7_34) Extracts version numbers from the version string.
7470         Untested.
7471
7472         * sort.c: Includes "stat.h", not <sys/stat.h>.
7473
7474         * str.c: (strcasecmp) Removed.
7475
7476         * title.c: (cmd_document) Uses host_system var instead of
7477         HOST_SYSTEM constant.
7478
7479         * version.c: Generated on-the-fly by the Makefile instead of being
7480         static.
7481
7482         * str.h: Comment fixes.  Doesn't substitute for missing memmove or
7483         memcpy.
7484         [!HAVE_STRNCASECMP] Declares strncasecmp().
7485
7486         * version.h: Removed stray character.  Comment fixes.
7487         (vars host_system, build_system) New vars.
7488
7489 Mon Mar 24 21:47:31 1997  Ben Pfaff  <blp@gnu.org>
7490
7491         * Most source files: Changed formatting of copyright notice; fixed
7492         FSF address; reformatted to better conform to GNU standards;
7493         comment fixes.  Added markups to prevent GNU indent from messing
7494         up my beautiful formatting :-).
7495         
7496         * q2c.c: (get_line) Ignores lines that begin with `/* *INDENT' so
7497         that GNU indent markups can be passed through without problems.
7498
7499 Wed Feb 19 21:30:31 1997  Ben Pfaff  <blp@gnu.org>
7500
7501         * get.c: Turned off debugging.
7502
7503         * glob.c: (init_glob) Turned on save-file compression by default.
7504
7505         * sfm-write.c: (sfm_write_case) Fixed bug which resulted in less
7506         compression than was possible in save files.
7507
7508 Sun Feb 16 20:57:20 1997  Ben Pfaff  <blp@gnu.org>
7509
7510         * data-out.c: (convert_F) Comment fixes.  Debug message fixes.
7511
7512         * frequencies.q: Removed Fiasco extensions.  Updated calculation
7513         algorithms.  Polished output format. 
7514         (struct frq_info_struct) Removed members `max_degree', `min_n',
7515         all references removed.
7516         (macro frq_extensions) Removed.
7517         (static vars min_n, max_degree) Removed, all references removed.
7518         (internal_cmd_frequencies) Doesn't handle extensions.  Doesn't
7519         calculate `min_n', `max_degree'.
7520         (postcalc) Passes new arg to dump_statistics().
7521         (dump_full) Honor NOLABEL option.  Buggy?  Adds variable name
7522         title.
7523         (dump_condensed) Adds variable name title.
7524         (sum_freqs) Removed.
7525         (calc_stats) Updated calculation algorithm.
7526         (dump_statistics) Removed warning for too-few observations.
7527         Changed table formatting.  Adds variable name title if passed new
7528         arg is nonzero.
7529
7530         * output.h: Comment fix.
7531
7532         * recode.c, sample.c, sort.c: Disabled debug code.
7533
7534         * som-frnt.c: (som_set_value, som_set_float, som_set_text)
7535         Improved debug code.
7536
7537         * var.h: (enum series frq_*) Removed Fiasco extensions.
7538
7539 Sat Feb 15 21:26:53 1997  Ben Pfaff  <blp@gnu.org>
7540
7541         * command.c: Added PROCESS IF to command table.
7542
7543         * Lots & lots of places, removed checks for NULLs preceding calls
7544         to free_expression(), which itself checks.
7545
7546         * descript.q: Removed Fiasco extensions.  Removed optimizations
7547         for non-weighted active files.  Implemented some options.
7548         Finished polishing output format.  Comment fixes.  Merged
7549         `descript.g'.
7550         (static vars n_glob_miss_list, n_glob_valid, n_glob_missing,
7551         max_degree, min_n) Removed.
7552         (macro dsc_extensions) Removed.
7553         (struct dsc_info_struct) Removed `min_n' member, all references
7554         fixed.
7555         (internal_cmd_descriptives) Removed calculation of min_n,
7556         max_degree.  Only deals with one `calc' routine instead of two
7557         flavors.
7558         (precalc) Eliminated redundancy.  Updated for changes to
7559         descriptives_proc structure.
7560         (calc) Moved here from `descript.g'.  Rewritten to calculate
7561         statistics via `moments about the mean' rather than by summing,
7562         summing squares, summing cubes, and so on.
7563         (postcalc) Rewritten for new-style statistical calculation.
7564         (display) Removed support for displaying variables across rows.
7565         No longer crushes the descriptives table.  Removed ancient code.
7566         Added display of N, by variable and listwise.
7567
7568         * descript.g: Removed; merged into `descript.q'.
7569
7570         * expr-evl.c: (evaluate_expression) Now returns a double.  For
7571         numeric results, it returns the result as well as storing it in
7572         the passed `value' structure if non-NULL.  For string results it
7573         just returns 0.0 and it must be passed non-NULL.  Many references
7574         to this function were optimized by use of this change, especially
7575         but not exclusively in `compute.c'.
7576
7577         * frequencies.g: Comment fix.
7578
7579         * glob.c: (glob var process_if_expr) New global var.
7580
7581         * postscript.c: (static var option_tab[]) Corrected entry for
7582         `fixed_size'.
7583         (postopen) Sets x->size to x->prop_size.
7584         (ps_text_set_font_by_name) Sets font size as well as typeface for
7585         PROP and FIXED fonts.
7586         
7587         * sel-if.c: (cmd_process_if) New function.
7588
7589         * sfm-write.c: (struct sfm_fhuser_ext) New member `n_cases'.
7590         (sfm_write_dictionary) Sets `n_cases' to 0.
7591         (sfm_write_case) Increments `n_cases'.
7592         (sfm_close) Attempts to seek the system file back to the header
7593         and write the number of cases in its proper slot.
7594
7595         * som-frnt.c: (som_insert_table) Masks off expansion options since
7596         only SOPT_X_NORM seems to work sensibly.
7597
7598         * som-low.c: (get_cell_size) Fixed bug when a table cell was sized
7599         with a `fixed' value of 2.
7600
7601         * sort.c: (cmd_sort_cases) Cancels PROCESS IF.
7602
7603         * sysfile-info.c: (cmd_sysfile_info) Doesn't display more than 10
7604         value labels; uses SOPT_NONE instead of SOPT_X_BOTH.
7605
7606         * var.h: (enum series dsc_*) Removed Fiasco extensions.
7607         (struct descriptives_proc) Removed `miss_noweight'; new members
7608         `X_bar', `M2', `M3', `M4', `min', `max'.
7609
7610         * vars-atr.c: (discard_variables) Cancels PROCESS IF.
7611
7612         * vfm.c: (close_active_file) Cancels PROCESS IF.
7613         (write_case) Doesn't process cases unselected by PROCESS IF.
7614
7615 Fri Feb 14 23:32:58 1997  Ben Pfaff  <blp@gnu.org>
7616
7617         * glob.c: (glob var err) Removed.
7618
7619         * sysfile-info.c: (cmd_sysfile_info) When adjusting table size,
7620         doesn't have to take into account number of value labels since
7621         they're in a subtable anyway.  Also, doesn't display more than 10
7622         value labels since we can't yet break pages in subtables.
7623
7624 Tue Feb  4 15:15:50 1997  Ben Pfaff  <blp@gnu.org>
7625
7626         * som-frnt.c: (som_change_table_size) Simple change for elegance
7627         that shouldn't change behavior.
7628         (som_set_value) Comment fix.
7629
7630         * som-high.c: (som_submit_table) Message fix.
7631
7632 Wed Jan 22 21:54:00 1997  Ben Pfaff  <blp@gnu.org>
7633
7634         * command.c: Added SYSFILE INFO to command table.
7635
7636         * file-handle.q: (fh_handle_filename) New function.
7637
7638         * get.c: (save_trns_proc) Fixed a bug in padding of output data
7639         with spaces.
7640
7641         * main.c: (parse) New return value for command functions, -3.
7642
7643         * misc.h: Comment fix.
7644
7645         * output.h: Comment fixes.
7646         (macro COMPONENTS) Removed.
7647
7648         * postscript.c: (write_text) Modified literal_chars[] so that `('
7649         and ')' are not written to the output in strings as literals.
7650
7651         * sfm-read.c: (sfm_read_dictionary) New argument.
7652         (read_header) New argument.  Sets the information structure's
7653         values from the header information.  
7654         (read_variables) [__CHECKER__] Redefines isalnum()--some sort of
7655         bizarre Checker problem, I guess.
7656         (read_variables) Proper cleanup on lossage.
7657
7658         * sfm.h: (struct sfm_read_info) New struct for use by
7659         sfm_read_dictionary().
7660
7661         * som-frnt.c: (som_create_table) New argument CREATE_FLAGS,
7662         currently used just for tables that can be dynamically resized and
7663         thus have to be allocated with arena_malloc() instead of
7664         arena_alloc().  All references changed.
7665         (som_change_table_size) New function.
7666         (som_insert_table) Bugfix: now inserts `cell', not `c'!
7667
7668         * som-high.c: [GLOBAL_DEBUGGING] (check_table) Moved to som-low.c.
7669         (som_submit_table) [GLOBAL_DEBUGGING] Doesn't call check_table()
7670         any more.
7671
7672         * som-low.c: (draw_cell) Calls draw_table_cell() for SCON_TABLE
7673         cells.
7674         (draw_intersection) Now takes an argument specifying the table in
7675         question.  All references changed.
7676         (draw_table_cell) New function.
7677         (som_get_table_size) [GLOBAL_DEBUGGING] Calls check_table().
7678         (som_get_table_size) Many nice new explanatory comments.
7679         [GLOBAL_DEBUGGING] (check_table) Moved here from som-high.c.
7680
7681         * som.h: New enum series SOM_CREATE_* for use as create flags with
7682         som_create_table().
7683
7684         * str.h: Moved a comment here from TODO.
7685
7686         * sysfile-info.c: New file.  Reference implementation.
7687
7688 Sun Jan 19 14:22:11 1997  Ben Pfaff  <blp@gnu.org>
7689
7690         * command.c: Added RENAME VARIABLES to table of commands.
7691
7692         * data-in.c: (dls_error) Sets `cust_field'.
7693         (parse_N) Message fix.
7694         (parse_day_count) New function.
7695         (to_roman) Never outputs VX as a `short form' of V.
7696         (parse_month) Fixed parsing of Roman numerals.
7697         (parse_trailer) Message fix.
7698         (parse_DATE, parse_ADATE, parse_EDATE, parse_SDATE, parse_JDATE,
7699         parse_QYR, parse_MOYR, parse_WKYR, parse_DTIME) Issue a message if
7700         the date is invalid.
7701         (parse_SDATE) Fixed swapped day, year.
7702         (parse_JDATE) Fixed bug for dates in 1582.
7703         (parse_DTIME) Allows days not between 1 and 31.
7704         (parse_numeric) Makes local copy of f.type for easier usage.
7705         FMT_DOLLAR fixed.
7706
7707         * data-out.c: (convert_F) When outputting as scientific, properly
7708         sets f.type as fp->type.
7709         (insert_commas) Fixed operator precedence problem with setting of
7710         nitems.  Changed strcpy to memcpy (no null terminator). 
7711         (convert_date) Fixed FMT_JDATE: added 1900 to year.
7712         (convert_CCx) Essentially rewritten, but now it works.
7713
7714         * display.c: (cmd_display) Added DISPLAY FILE LABEL (undocumented
7715         feature of Fiasco).
7716         (display_documents) Implemented.
7717
7718         * error.c: (glob var cust_field) New var.
7719         (vmsg) Displays cust_field as part of message classes DE and DW.
7720
7721         * formats.c: (debug_print) Fixed to compile under updated
7722         dictionary format.
7723
7724         * get.c: (cmd_get, cmd_save_internal) Close file handle on
7725         failure.
7726
7727         * misc.c: (parse_format_specifier) Formatting fix.
7728
7729         * modify-vars.c: (struct var_modification) Renamed `n_reorder' as
7730         `n_rename' for clarity.
7731         (cmd_modify_vars) Initializes `forward' and `positional' at
7732         appropriate times.  Frees lists of vars to rename on failure.
7733         Comment fix.  Frees memory on success.  
7734         (rearrange_dict) Simplified `for' loop condition.
7735
7736         * rename-vars.c: New file (reference implementation).
7737         
7738         * set.q: (internal_cmd_set) Fixed `emu' test condition.
7739
7740         * sfm-read.c: (read_header) File label is created only if file
7741         label in file is not blank.
7742         (read_variables) Initializes `dict' local variable.
7743         (read_documents) Proper behavior on lossage.
7744
7745         * sfm-write.c: (write_header) Doesn't blank out the file label
7746         (why was this here to begin with?!)
7747
7748         * temporary.c: (save_dictionary) File label is copied only if
7749         non-NULL.  Doesn't try to xstrdup() dictionary documents.
7750         Adapted so as to not irritate Checker.
7751         (free_dictionary) Only destroys var_by_name if non-NULL.
7752
7753         * title.c: (cmd_file_label) Doesn't skip FILE, LABEL tokens.
7754         (cmd_document) Doesn't skip DOCUMENT token.  Adds some header
7755         lines to the document, indents the document.  Also, it works now.
7756         (add_document_line) New function.
7757
7758         * var.h: (struct dictionary) Reordering.
7759
7760         * vars-prs.c: (parse_variables) On lossage, only local_free()'s
7761         bits if it was allocated to begin with.
7762
7763 Thu Jan 16 13:08:57 1997  Ben Pfaff  <blp@gnu.org>
7764
7765         * command.c: Added MODIFY VARS to list of commands.
7766
7767         * configure.in: Updated custom macros for autoconf 2.12.  Removed
7768         mmap reference; fixed termcap library reference.
7769
7770         * display.c: (display_variables) Fixed a few bugs although it's
7771         still not well written.
7772
7773         * error.c: [!__CHECKER__] (chkr_disp_call_chain) New function.
7774         (induce_segfault) Calls chkr_disp_call_chain() instead of
7775         inducing an actual SIGSEGV.
7776
7777         * expr-opt.c: (evaluate_tree) Swapped order of arguments to
7778         str_search() and str_rsearch().  Fixed tests for matches on
7779         OP_INDEX and OP_RINDEX.
7780
7781         * filename.c: (good_getcwd) Removed as the new libc for Checker
7782         doesn't contain this bug, apparently.
7783
7784         * misc.c: (str_search, str_rsearch) Changed order of arguments for
7785         consistency with GNU memmem.
7786         (blp_getdelim) Changed `len' from `int' to `size_t'.
7787
7788         * modify-vars.c: Reference implementation.
7789
7790         * som-frnt.c: (zero_length) New global var.
7791         (som_create_table) Message fix.
7792
7793         * som.h: Added gcc attributions to som_set_text(),
7794         som_output_text() prototypes.  blank_line() refers to
7795         zero_length[] instead of a literal null string to suppress gcc
7796         warnings.
7797
7798         * sort.c: (do_external_sort) Fixed fencepost error on lossage.
7799         (allocate_cases) Decrements x_max so the last element of x[] can
7800         be used by the algorithm.
7801
7802         * var.h: Changed minor details of `variable' declaration.  
7803         (struct modify_vars_proc) New struct.
7804         (struct variable) Added field p.mfv.
7805
7806         * vars-atr.c: Comment fix.
7807
7808         * vars-prs.c: (fill_all_vars) More optimal implementation.
7809
7810         * vfm.c: (dump_splits) Sets the last byte of temp_buf to a null
7811         character, which it shouldn't have to do but printf() seems to
7812         read the null byte even though I supply a maximum length...
7813
7814 Fri Jan 10 20:22:08 1997  Ben Pfaff  <blp@gnu.org>
7815
7816         * command.c: Removed command alias X for QUIT.
7817         (parse_cmd) Fixed comment parsing.
7818
7819         * dfm.c: (struct dfm_fhuser_ext) Fields `len', `size' are now of
7820         type size_t.
7821         (read_record) Fixed references to len, size.
7822         (dfm_get_record) Restructured.
7823
7824         * file-handle.h: (struct file_handle) Field `lrecl' now of type
7825         size_t.
7826
7827         * file-handle.q: (internal_cmd_file_handle) Checks for nonpositive
7828         record length.
7829
7830         * modify-vars.c: New file.  Not complete.
7831         
7832         * set.q: (set_ccx) Fixed operator precedence problem regarding ^
7833         and ==.
7834
7835         * sfm-read.c: (bswap_flt64, read_header, write_variable) Fixed
7836         problems caused by int/size_t differences.
7837
7838         * sort.c: (output_record, merge_once) Cast `size_t's to `int's in
7839         appropriate spots.
7840
7841         * str.c: (strcasecmp) Fixed bug that cropped up when the strings
7842         being compared were of equal length.
7843
7844 Thu Jan  2 19:08:23 1997  Ben Pfaff  <blp@gnu.org>
7845
7846         * command.c: Added DOCUMENT, DROP DOCUMENTS, FILE LABEL.
7847
7848         * lexer.c: (get_dotted_rest_of_line) New function.
7849
7850         * sel-if.c: (cmd_filter) Cannot choose string or scratch variables
7851         as filters.
7852
7853         * sfm-read.c: (sfm_read_dictionary) Calls read_documents() to read
7854         type 6 records.  Frees the dictionary properly.
7855         (read_header) Initializes the dictionary instead of letting
7856         read_variables() do it.  Sets the dictionary file label from the
7857         system file.
7858         (read_documents) New function.
7859
7860         * sfm-write.c: (sfm_write_dictionary) Calls write_documents() to
7861         write type 6 record if appropriate.
7862         (write_header) Writes file label from dictionary.
7863         (write_documents) New function.
7864
7865         * temporary.c: (save_dictionary, restore_dictionary,
7866         free_dictionary) Properly handle new fields in dictionary struct.
7867
7868         * title.c: (get_title) Returns after failure().
7869         (cmd_file_label, cmd_document, cmd_drop_documents) New functions
7870         for new commands FILE LABEL, DOCUMENT, DROP DOCUMENTS.  Untested.
7871
7872         * var.h: (struct dictionary) New fields `label', `n_documents',
7873         `documents'.
7874
7875 Wed Jan  1 22:08:10 1997  Ben Pfaff  <blp@gnu.org>
7876
7877         * command.c: Added FILTER to list of commands.
7878
7879         * frequencies.g: [WEIGHTING] Removed test for weighting!=-1 since
7880         it's always true.
7881
7882         * get.c: (cmd_save_internal) Removed weighting code since it's now
7883         handled by sfm-write.c.  Properly commented out debug code.
7884
7885         * glob.c: (glob var weighting) Removed.
7886
7887         * sel-if.c: Comment fixes.
7888         (cmd_filter) New function.
7889
7890         * sfm-read.c: (struct sfm_fhuser_ext) New field `weight_index'.
7891         (sfm_read_dictionary) Sets weighting variable direct in the
7892         created dictionary now.  (Apparently we previously didn't support
7893         weighting on GET?)
7894         (read_header) Sets weight_index field in sfm_fhuser_ext from
7895         header read from disk.
7896
7897         * sfm-write.c: (sfm_write_dictionary) Comment fix.
7898         (write_header) Now sets the weighting in the header from the
7899         passed primary dictionary instead of from the sfm_write_info.
7900
7901         * sfm.h: (struct sfm_write_info) Removed field `weight'.
7902
7903         * som-high.c: (dump_crush_table) Fixed a couple of assertions that
7904         broke on boundary conditions.
7905
7906         * var.h: (struct dictionary) New fields `weight_var',
7907         `weight_index', and `filter_var'.
7908         (glob var weighting) Removed.  This is now part of struct
7909         dictionary.  All references changed; the less mechanical changes
7910         are described above.
7911
7912         * vars-atr.c: (find_dict_variable) New function.
7913
7914         * vfm.c: (static var filter_index) New variable.
7915         (open_active_file) Initializes filter_index from default_dict.
7916         (write_case) Calls proc_func() only if the filter variable is
7917         nonzero; this implements FILTER behavior.
7918
7919         * weight.c: (static var weight_varname) Removed.
7920         (cmd_weight) Modified default_dict instead of glob vars.
7921         (update_weighting) Changed the signature to modify a dictionary
7922         instead of glob vars.  Now returns the weighting variable.
7923         (get_weighting_variable) Removed; its function is absorbed by
7924         update_weighting().
7925         (stop_weighting) Operates on a dictionary now.
7926
7927 Wed Jan  1 17:00:59 1997  Ben Pfaff  <blp@gnu.org>
7928
7929         * sort.c: Removed debugging info from messages.
7930         (do_external_sort) Cleans up after itself by deleting the
7931         temporary directory on failure.  (On success it is deleted by the
7932         input program.)
7933         (allocate_cases) Removed debug code.  Added clean up code.
7934         (output_record) Removed debug code.
7935         (merge) Added code to close all the input files that are currently
7936         open.  This is a likely location for bugs, because I'm not sure
7937         about boundary conditions.  Removed an unnecesary heap_delete().
7938         (merge_once) Removed input file "optimization" that in fact
7939         screwed up the rest of the code.  Message and comment fixes.
7940
7941 Sun Dec 29 21:36:48 1996  Ben Pfaff  <blp@gnu.org>
7942
7943         * error.c: [__CHECKER__] (induce_segfault) Flushes output streams.
7944
7945         * heap.c: (heap_delete) New argument.
7946
7947         * sort.c: Finished implementation of external sort.
7948
7949         * vfm.c: (read_from_disk) Returns after a disk error.
7950
7951 Sun Dec 22 23:10:39 1996  Ben Pfaff  <blp@gnu.org>
7952
7953         * sort.c: (static var state) Removed.
7954         (static vars max_handles, tmp_basename, tmp_extname,
7955         huffman_queue) New variables.
7956         (do_external_sort) Moved most code to new functions.
7957         Creates huffman_queue.
7958         (allocate_file_handles, allocate_cases) New functions.
7959         (static vars run_no, run_length, file_index, case_count) New
7960         variables. 
7961         (output_record) Returns success.  Now really writes to the output
7962         file.
7963         (begin_run, end_run) New functions.
7964         (write_initial_runs) Returns success.  Initializes run_no to -1.
7965         Calls begin_run(), end_run() at appropriate times.  Outputs debug
7966         messages.
7967         (write_to_sort_cases) Calls begin_run(), end_run() at appropriate
7968         times.
7969         (merge) New function.
7970
7971         * heap.c, heap.h: New files.  Hopefully in near-final form.
7972
7973 Sat Dec 21 21:51:04 1996  Ben Pfaff  <blp@gnu.org>
7974
7975         * glob.c: Added write_active_file to global vars.
7976
7977         * sort.c: Several new miscellaneous static variables.
7978         (cmd_sort_cases) Big comment fix.
7979         (perform_case_2) Renamed `do_external_sort' and completely
7980         rewritten.
7981         (case_2_proc_func) Removed.
7982         (output_record, write_initial_runs, write_to_sort_cases,
7983         compare_record) New functions.
7984
7985         * vfm.c: [DEBUGGING] (index_to_varname) Excised bit rot.
7986
7987 Tue Dec 17 18:57:59 1996  Ben Pfaff  <blp@gnu.org>
7988
7989         * sort.c: (perform_case_2) Changed the method for allocation of
7990         lots of memory--now allocates one case at a time in hopes that
7991         more cases can be allocated with heavily fragmented memory.
7992
7993         * var.h: (write_active_file) New global var.
7994
7995         * vfm.c: (procedure, close_active_file, write_case,
7996         SPLIT_FILE_procfunc) Now allow beginfunc, procfunc, and endfunc
7997         arguments to procedure() to be NULL.  All references to
7998         procedure() that made use of dummy functions were changed to NULL
7999         functions.
8000         (open_active_file) If write_active_file is non-NULL, the output
8001         device becomes DEV_PGM (a new enum).
8002         (close_active_file) Sets write_active_file to NULL.
8003         (read_from_memory) Comment fix.
8004         (record_case) Calls write_active_file() when the output device is
8005         DEV_PGM.
8006
8007 Sun Dec 15 15:32:16 1996  Ben Pfaff  <blp@gnu.org>
8008
8009         * sort.c: New file.
8010
8011         * autorecode.c: (cmd_autorecode) Fixed parsing of options.
8012         Fixed checking for duplicate varnames.
8013         (recode) xmalloc()'s the transformation instead of arena_alloc()'ing
8014         it.
8015         (autorecode_trns_free) Destroys hash tables for each recoding
8016         specification.
8017         (autorecode_proc_func) Compares NULL to *vpp instead of vpp.
8018
8019         * command.c: Added SORT CASES to cmd_table.
8020         (null_func, null_int_func) Prototyped.
8021
8022         * descript.g: (calc_weight, calc_noweight) Computes own case
8023         number now.
8024         
8025         * frequencies.q: (dump_statistics) Fixed problem with
8026         too-few-cases warning message.
8027
8028         * get.c: (cmd_save_internal) Handles weighting properly.
8029
8030         * hash.c: (hsh_dump) Output format changed.
8031         (force_hsh_insert) Actually works now, prototype changed.
8032
8033         * list.q: (static var case_num) New variable.
8034         (cmd_list) Initializes case_num.
8035         (list_cases) Increments case_num.
8036
8037         * var.h: Added definitions for SORT CASES.  Comment fixes.
8038
8039         * vfm.c: Some definitions moved to new file vfmP.h.  Comment
8040         fixes.  `active' renamed vfm_active, `rep' renamed
8041         vfm_replacement, all references changed.
8042         (procedure) The procfunc no longer receives a case number.  All
8043         references changed.
8044         (write_case) Subtle reordering.
8045         (SPLIT_FILE_procfunc) Counts cases differently.  Slightly less
8046         redundant.
8047
8048         * weight.c: (get_weighting_variable) New function.
8049
8050         * vfmP.h: New file with definitions from vfm.c.
8051
8052 Sat Dec 14 10:35:30 1996  Ben Pfaff  <blp@gnu.org>
8053
8054         * command.c: (FILE_TYPE_okay) Commented out some tests because
8055         they're clumsy and not yet needed.
8056
8057         * var.h: Most *_trns structures moved to their respective source
8058         files.  Some were moved into a new file, do-ifP.h.  Comment fixes.
8059         (union any_trns) Changed to a typedef for trns_header.
8060         (struct input_program_pgm) Removed.
8061
8062         * vars-prs.c: (parse_variables) Only local_free()'s bits if it
8063         was allocated in the first place.
8064
8065 Fri Dec 13 21:30:53 1996  Ben Pfaff  <blp@gnu.org>
8066
8067         * autorecode.c: New file.
8068         
8069         * command.c: Added AUTORECODE to command table; re-enabled SET.
8070
8071         * data-out.c: (convert_F) Handles infinities and NaNs properly.
8072
8073         * error.c: (vmsg) Comment fixes.
8074
8075         * hash.c: Comment fix.
8076         (hashpjw_d) New function.
8077         (hashpjw) Reimplemented as call to more general function
8078         hashpjw_d().
8079         (internal_comparison_fn) Initializes pointers properly.
8080         (hsh_sort) [GLOBAL_DEBUGGING] New debugging code.
8081         (force_hsh_insert, force_hsh_find) New debugging wrapper
8082         functions.
8083
8084         * main.c: (main) Message fix.
8085
8086         * output.c: (outp_read_devices) Message fix.
8087
8088         * set.q: Comment fixes.
8089         (custom_results) Implemented Wnd/X form of subcommand.
8090         (set_routing) New function.
8091         (internal_cmd_set) Implemented ERRORS, MESSAGES.
8092
8093         * settings.h: (SET_ROUTE_*) New enum series.
8094         (set_results) Renamed set_results_file, all references changed.
8095         (set_messages) Removed.
8096         (glob vars set_errors, set_messages, set_results) New vars.
8097
8098         * title.c: (get_title) Remembers to xstrdup() the result of
8099         get_rest_of_line().
8100
8101         * var.h: (arc_item, arc_spec, autorecode_trns) New structures for
8102         use by AUTORECODE.
8103         (union any_trns) New element `arc'.
8104
8105 Fri Dec  6 23:53:47 1996  Ben Pfaff  <blp@gnu.org>
8106
8107         * command.c: (output_line) Removed references to set_screen.
8108
8109         * error.c: (static var terminating) New var.
8110         (hcf) Sets terminating to 1.
8111         (vmsg) If terminating is nonzero, does not attempt to call hcf().
8112         This prevents an infinite loop if an error occurs within hcf().
8113
8114         * expr-evl.c: (evaluate_expression) [__CHECKER__] Replaced case
8115         statement circumlocution with `case 42000' trick.
8116         (evaluate_expression) New support for OP_STR_MIS.
8117
8118         * expr-opt.c: (evaluate_expression) [__CHECKER__] Replaced case
8119         statement circumlocution with `case 42000' trick.
8120         (dump_node) Handles OP_STR_MIS.
8121
8122         * expr-prs.c: (MISSING_func, SYSMIS_func) Rewrote to handle string
8123         variables exceptions.
8124         (parse_function) Message fix.
8125         (ops[]) Added OP_STR_MIS.
8126
8127         * expr.h: Added OP_STR_MIS to OP_* enum.  Comment fixes.
8128
8129         * exprP.h: [__CHECKER__] Removed case statement circumlocution.
8130
8131         * glob.c: Removed set_scrnfile glob var.
8132         (init_glob) set_errorbreak set to 0 by default.
8133
8134         * groff-font.c: Changed included files.
8135         (groff_read_font) Initializes font_arena local var correctly.
8136         (default_font) New function.
8137
8138         * output.c: Comment fixes.
8139         (glob var disabled_devices) New variable.
8140         [GLOBAL_DEBUGGING] (static var iterating_driver_list) New
8141         variable.
8142         [GLOBAL_DEBUGGING] (reentrancy) New function.
8143         [GLOBAL_DEBUGGING] (outp_read_devices, outp_done, find_driver,
8144         outp_iterate_enabled_drivers) Calls to reentrancy().
8145         (destroy_list) New function.
8146         (outp_done) Moved code to destroy_list().
8147         (parse_options) Parses `listing', `screen', `printer' options
8148         internally.
8149         (configure_driver) Sets new `device' member of driver.
8150         (outp_iterate_enabled_drivers, outp_enable_device) New functions.
8151
8152         * output.h: Comment fixes.  New enum series OUTP_DEV_*.
8153         (struct outp_driver_struct) New member `device'.
8154
8155         * postscript.c: (find_encoding_file) Doesn't display its own error
8156         messages.
8157         (default_encoding) New function.
8158         (switch_font) Calls default_encoding() if no encoding can be
8159         found.
8160         (text) Makes up a character metric if none exists for the desired
8161         character.
8162         (load_font) Properly copies a fallback filename.  Calls
8163         default_font() for a font if none at all are known.
8164
8165         * set.q: Comment fixes.  Removed OUTPUT subcommand.
8166         (custom_listing) Calls outp_enable_device() to enable/disable
8167         listing device.
8168         (turn_screen_on) Removed.
8169         (internal_cmd_set) Calls outp_enable_device() to enable/disable
8170         screen, printer devices.
8171
8172         * settings.h: Comment fixes.
8173         (glob vars set_output, set_printer, set_screen, set_scrnfile)
8174         Removed.
8175
8176         * som-high.c: (som_submit_table, som_eject_page) Use
8177         outp_iterate_enabled_drivers() instead of iterating
8178         outp_driver_list directly.
8179
8180 Wed Dec  4 21:34:17 1996  Ben Pfaff  <blp@gnu.org>
8181
8182         * data-in.c: (parse_EDATE, parse_SDATE) New functions.
8183         (parse_string_as_format) Handles new formats.
8184         (parse_numeric) Now handles DOT and PCT formats.
8185
8186         * data-out.c: (convert_E, convert_F, insert_commas) Handle DOT
8187         format now.
8188         (convert_date) Handle EDATE and SDATE formats.
8189         (convert_CCx) Now if there's not room for the currency characters,
8190         converts it as F format if it's positive instead of giving up
8191         quickly.  Also fixed save-and-restore bug with decimal point
8192         characters.  
8193         (convert_format_to_string) Handles new formats.
8194
8195         * misc.c: (formats[]) Added new formats.
8196         (convert_fmt_ItoO) Supports new formats.
8197
8198         * sfm-read.c: (parse_format_spec) Supports new formats.  Better
8199         data checking.  New argument, all references changed.
8200
8201         * sfm-write.c: (write_format_spec) Supports new formats.
8202
8203         * var.h: New formats FMT_DOT, FMT_PCT, FMT_EDATE, FMT_SDATE.
8204         Comment fixes.
8205
8206 Sun Dec  1 17:19:00 1996  Ben Pfaff  <blp@gnu.org>
8207
8208         * cmdline.c: Comment fixes.
8209         (parse_command_line) Changed return type to void.
8210
8211         * data-in.c: (parse_string_as_format) Added FMT_CCA...FMT_CCE to
8212         switch.
8213         (parse_numeric) Handles international numbers (comma as decimal
8214         point).  Some reformatting.
8215
8216         * data-list.c: (parse_free) Default output format is now
8217         set_format instead of hard-coded F8.2.
8218         (read_from_data_list_list) Emits error message on undefined data
8219         only if set_undefined is nonzero.
8220
8221         * data-out.c: (convert_E) Changes decimal point from period to
8222         comma if appropriate.  Restructured.  Better comments.
8223         (convert_F) Changes decimal point from period to comma if
8224         appropriate.
8225         (insert_commas) Major bug with handling of negative values fixed.
8226         Also, inserts periods instead of commas if appropriate.
8227         (convert_CCx) New function.
8228         (convert_format_to_string) Added FMT_CCA...FMT_CCE to switch.
8229         (num_to_string) Changed `.' to set_decimal.
8230
8231         * dfm.c: Comment fixes.
8232         (dfm_close) Frees ext->line even in inline_file.
8233         (open_inline_file) New function.
8234         (open_file_r) When opening the inline file: now properly
8235         recognizes `BEGIN DATA.' line, and calls open_inline_file() to
8236         finish up.
8237         (read_record) Calls fh_close_handle() instead of dfm_close() to
8238         close the inline file.  Makes a copy of the line getl_buf to avoid
8239         interlock problems.
8240         (dfm_get_record) Restructured.  Now checks the return value of
8241         open_file_r().
8242         (cmd_begin_data) Moved open code into open_inline_file().  Relaxed
8243         checking for use of inline file.  No longer tries to close inline
8244         file.
8245
8246         * error.c: (glob var error_already_flagged) New var.
8247         (vmsg) Message change.  Now checks max number of errors/warnings,
8248         acts on it.
8249
8250         * file-handle.q: (fh_handle_name) Now allows closing of
8251         inline_file.
8252         (fh_init_files) Reformatted.
8253
8254         * get.c: (trim_dictionary) Checks SCOMP option instead of COMP.
8255
8256         * getline.c: (getl_include) Fixed bug that popped up when called
8257         when file queue was empty.
8258         (read_console) Resets error_count, warning_count,
8259         error_already_flagged to zero.
8260
8261         * glob.c: Many changes to update list of variables.
8262         (init_compat_dependent) Now this function is called whenever
8263         `compat' changes.  It now sets set_seed only if it hasn't
8264         previously been referenced.  It now calls
8265         lex_init_compat_dependent().
8266
8267         * include.c: (cmd_include_at) Frees temporary buffer instead of
8268         line buffer.  
8269         (cmd_include) Doesn't make copy of include file name.
8270
8271         * lexer.c: Comment fixes.
8272         (init_lex) Moved some code into new function
8273         lex_init_compat_dependent().
8274         (lex_init_compat_dependent) New function.
8275         (hex_val) Simplified.
8276         (preprocess_line) Uses set_endcmd instead of hardcoding `.'.
8277
8278         * main.c: Comment fixes.
8279         (main) Reformatted.
8280
8281         * misc.c: (formats[]) Added FMT_CCA...FMT_CCE.
8282         (check_input_specifier) Disallows FMT_CCA...FMT_CCE.
8283         (convert_fmt_ItoO) Detects FMT_CCA...FMT_CCE.
8284         (setup_randomize) Sets set_seed_used.
8285
8286         * set.q: Comment fixes.
8287         (custom_results) Conditionalizes on `compat'.
8288         (custom_log) Calls custom_journal().
8289         (set_ccx) New function.
8290         (cmd_set) Calls init_compat_dependent() when `compat' changes.
8291         Calls set_ccx() to handle CCA...CCE.  Sets set_grouping
8292         when set_decimal changes.  Range-checks values for MITERATE,
8293         MNEST.  Message fixes.
8294
8295         * settings.h: Comment fixes.
8296         (struct set_cust_currency) New struct.
8297         (set_cc[], set_grouping, set_seed_used) New global vars.
8298
8299         * var.h: (FMT_CCA...FMT_CCE) New output formats.
8300         (FCAT_OUTPUT_ONLY) New FCAT_* constant.
8301
8302 Thu Nov 28 23:14:07 1996  Ben Pfaff  <blp@gnu.org>
8303
8304         * glob.c: Revised variables to correspond to settings.h.
8305         (init_glob) Initializes variables from settings.h properly.
8306
8307         * set.q: Began long-overdue major revision to correspond to new
8308         philosophy.  Most code changed. 
8309
8310         * settings.h: Mostly changed; reorganized, reordered, large new
8311         comment.
8312
8313 Thu Nov 28 19:46:10 1996  Ben Pfaff  <blp@gnu.org>
8314
8315         * get.c: (cmd_save_internal) No longer forces compression off.
8316
8317         * sfm-read.c: (read_compressed_data) If eof is reached when
8318         reading a new instruction octet, only signal error if we're in the
8319         middle of a case.
8320
8321         * sfm-write.c: (COMPRESSION_BIAS) New #define.
8322         (struct sfm_fhuser_ext) New member `end'.
8323         (write_header) Refers to COMPRESSION_BIAS instead of magic 100.0.
8324         (ensure_buf_space) New function.
8325         (sfm_write_case) Reimplemented in order to support compression.
8326         (sfm_close) Writes out the remaining contents of the compression
8327         buffer if any.
8328
8329 Wed Nov 27 23:18:35 1996  Ben Pfaff  <blp@gnu.org>
8330
8331         * command.c: Defined SAVE and XSAVE commands in command table.
8332
8333         * common.h: second_lowest_value is of type flt64, not double.
8334
8335         * file-handle.h: Comment fix.
8336
8337         * get.c: Comment fixes.
8338         (static var `trns') New.
8339         (save_write_case_func, save_trns_proc, save_trns_free, null_func,
8340         cmd_save_internal, cmd_save, cmd_xsave) New functions.
8341         (dict_delete_run) Clears the variables and frees them now.
8342         (trim_dictionary) Sets default for compression.
8343         On KEEP subcommand, frees deleted variables as well as clearing
8344         them.  Finally got the sense of the test for deleting all
8345         variables correct.
8346         [DEBUGGING] (dump_dict_variables) Message fix.
8347
8348         * glob.c: (init_glob) set_compression set to 1 by default.
8349
8350         * list.q: Properly #includes config.h.
8351
8352         * misc.h: New macro REM_RND_UP.
8353
8354         * settings.h: Comment fix.
8355
8356         * sfm-read.c: (structs sysfile_header, sysfile_format,
8357         sysfile_variable; inline function bswap_int32) Moved to new file
8358         sfmP.h.
8359         (corrupt_msg) [__CHECKER__] No longer induces segfault.
8360         (sfm_read_dictionary) Fixed bug caused by failing to initialize
8361         var_by_index.
8362         (read_machine_flt64_info) Fixed some problems caused by confusion
8363         between flt64 and double types.
8364         (read_header) Message fix.
8365         (read_variables) Fixed set of cases in which we byte-swap sv.print
8366         and sv.write.  Fixed confusion of flt64 and double.
8367
8368         * sfm.h: (struct sfm_write_info) New.
8369
8370         * som-high.c: (som_draw_title) Properly frees `s'.
8371
8372         * temporary.c: (save_dictionary) Comment fix.
8373
8374         * var.h: Comment fixes.  New FMT_* enum, FMT_NUMBER_OF_FORMATS.
8375         (struct trns_header) Formatting fix.
8376         (struct save_trns) New.
8377
8378         * vars-atr.c: (discard_variables) Comment fix.
8379
8380         * sfm-write.c: New file, baseline release.
8381
8382         * sfmP.h: New file, baseline release.
8383
8384 Sun Nov 24 14:53:53 1996  Ben Pfaff  <blp@gnu.org>
8385
8386         * cmdline.c: (parse_command_line) `--version' output updated.
8387         (glob var syntax_message[]) Added my e-mail address.
8388
8389         * file-handle.q, lexer.c, vfm.c: Changed many instances of
8390         `illegal' to `invalid'.
8391
8392         * sfm-read.c: (struct sfm_fhuser_ext) New fields used as
8393         uncompression buffer.
8394         (sfm_close) Frees decompression buffer.
8395         (sfm_read_dictionary) Initializes decompression buffer.
8396         (buffer_input, read_compressed_data) New functions.
8397         (sfm_read_case) Restructured; now calls read_compressed_data() to
8398         handle compressed system file data.
8399
8400         * var.h: Comment fix.
8401
8402 Mon Nov 11 15:34:09 1996  Ben Pfaff  <blp@gnu.org>
8403
8404         * dfm.c: (dfm_close) Does not set h->{ext,class} because the
8405         caller handles it.
8406          
8407         * get.c: New comments.  New static var `get_file'.
8408         (cmd_get) Now fully implemented.  Calls discard_variables();
8409         initializes fv and lv for all variables; new debug code; sets
8410         up the dictionary; sets up the input program.
8411         (read_from_get, cancel_get) New functions.
8412
8413         * sfm-read.c: Comment fixes.
8414         (sfm_close) New static function.
8415         (sfm_read_dictionary) Properly sets up the class of the
8416         file_handle.  No longer cares what size the data is in records of
8417         type 7.  Also, on failure, properly cleans up the file_handle and
8418         free()s some stuff.
8419         (read_variables) No longer thinks it knows `nval' of the
8420         dictionary.  Now sets p.get.fv, etc., instead of speculatively
8421         setting fv itself.
8422         (read_value_labels) Fixed off-by-one error in indexing of
8423         var_by_index[].
8424         (sfm_read_case) New function.
8425         (sfm_r_class) New static var.
8426
8427         * var.h: (get_proc) New struct.
8428         (struct variable) New member p.get.
8429
8430 Thu Nov  7 20:52:28 1996  Ben Pfaff  <blp@gnu.org>
8431
8432         * get.c: Removed GTSV_OPT_MAP because of a misinterpretation of
8433         the manual's meaning.
8434         (rename_variables) New function.
8435         (trim_variables) Doesn't try to parse MAP any more.  Removed debug
8436         code.  Now properly reorders the dictionary on the KEEP keyword.
8437
8438         * sfm-read.c: (read_value_labels) Fixed some bugs regarding
8439         garbage collection.
8440
8441         * vars-atr.c: (clear_variable) New argument `dictionary *'.
8442         (rename_variable) New function.
8443         (free_val_lab) Reformatted.
8444
8445 Thu Nov  7 17:29:16 1996  Ben Pfaff  <blp@gnu.org>
8446
8447         * var.h: Reindented entire file.  Comment fixes.
8448         (glob vars var, var_by_name, nvar, N, nval, n_splits, splits)
8449         Removed.
8450         (glob var default_dict) New.
8451         (struct indirect_dictionary) Removed.
8452
8453         * Many other source files were changed to add `default_dict.'
8454         before all references to the dictionary of the active file.
8455         
8456         * vars-atr.c: (make_indirect_dictionary) Removed.
8457
8458         * glob.c: Reindented all variable declarations.  Updated for
8459         changed var.h.  Comment fixes.
8460
8461         * temporary.c: (restore_dictionary, save_dictionary) Simplified
8462         because now we can mainly copy dictionary structs.
8463
8464         * vars-prs.c: (is_dict_varname, parse_dict_variable,
8465         parse_variables) Takes dictionary instead of indirect_dictionary
8466         first argument.
8467         (parse_variables) Instead of calling make_indirect_dictionary,
8468         just sets DICT to &default_dict if DICT is NULL.  Of course, lots
8469         of `*dict.' references had to be changed to `dict->'.  Removed
8470         debug code.
8471
8472 Thu Nov  7 15:48:52 1996  Ben Pfaff  <blp@gnu.org>
8473
8474         * get.c: Added GTSV_OPT_* series of enums.
8475         (trim_dictionary, dict_delete_run) New functions.
8476         [DEBUGGING] (dump_dict_variables) New function.
8477         (cmd_get) Calls trim_dictionary() to get dictionary fully set-up.
8478         [DEBUGGING] Calls dump_dict_variables() to display results.
8479
8480         * glob.c: (cmp_variable) Now a public function declared in var.h.
8481
8482         * sfm-read.c: Turned off debug code.  Comment fixes.
8483         (read_machine_int32_info, read_machine_flt64_info) New functions
8484         to parse type 7 records.
8485         (sfm_read_dictionary) Properly byteswaps several fields now.
8486         Calls read_machine_*_info() to parse type 7 subtypes 3 and 4
8487         records.  [DEBUGGING] Dumps dictionary.
8488         (read_variables) Sets `index' field of variables created properly.
8489         Constructs avl tree of variables in dictionary.  [DEBUGGING] No
8490         longer dumps dictionary.
8491         (read_value_labels) Properly byteswaps fields.  [DEBUGGING] New
8492         debug code.
8493         [DEBUGGING] (dump_dictionary) No longer stubbed out.
8494
8495         * temporary.c: (restore_dictionary) Destroys `var_by_name' glob
8496         var before destroying any variables just to save a little time.
8497
8498         * var.h: (struct variable) Reordered in order to make name[] the
8499         first member; this makes pointers to `variable' pointers to the
8500         variable name, simplifying avl trees, etc.
8501         (struct indirect_dictionary) New struct.
8502
8503         * vars-atr.c: (find_variable) Rewritten for efficiency.
8504         (make_indirect_dictionary, is_dict_varname, parse_dict_variable)
8505         New functions.
8506         (is_varname) Rewritten for efficiency.
8507         (parse_variables) New argument, which is a `dictionary *'.  All
8508         references changed.  This function now reads variable names from
8509         the dictionary passed, or from the default dictionary if NULL.
8510
8511 Tue Nov  5 18:34:59 1996  Ben Pfaff  <blp@gnu.org>
8512
8513         * misc.h: Added new macro DIV_RND_UP to perform integer division,
8514         rounding up.  Changed many references to ROUND_UP to use this
8515         instead.
8516
8517         * sfm-read.c: Includes avl.h.
8518         (corrupt_msg) Induces a segfault under Checker.
8519         (macro assertive_bufread) New.  Many references to bufread() now
8520         use this instead.
8521         (sfm_read_dictionary) Split up into several functions.  Added code
8522         to read dictionary records following the the type 2 records.  Not
8523         quite complete.  New variable `var_by_index'.
8524         (read_header, read_variables) New functions extracted from
8525         sfm_read_dictionary().
8526         (read_value_labels) New function.
8527         (bufread) Checks ferror() if fread() doesn't return the expected
8528         value; if ferror() is zero it's just EOF.
8529         (dump_dictionary) Stubbed out.
8530
8531         * BTW: The source code now exceeds 50000 lines!
8532         
8533 Mon Nov  4 22:03:28 1996  Ben Pfaff  <blp@gnu.org>
8534
8535         * command.c: Added GET to cmd_table[].
8536
8537         * list.q: Removed reference to alloca headers.
8538         (cmd_list) Gave prototype.
8539
8540         * sfm-read.c: Added DEBUGGING comments.
8541         (sfm_read_dictionary) Checks bias correctly.  Sets
8542         dict->var_by_name to NULL.  Calculates long_string_count
8543         correctly.  realloc's dict->var[] array to minimum size.
8544         [DEBUGGING] Calls dump_dictionary.
8545         [DEBUGGING] (dump_dictionary) New function.
8546
8547         * temporary.c: (save_dictionary) Sets var_by_name to NULL.
8548         (restore_dictionary) If the dictionary contains a non-NULL
8549         var_by_name, uses that instead of generating one.
8550         (free_dictionary) Destroys var_by_name.
8551
8552         * var.h: (struct dictionary) Added field `var_by_name'.
8553
8554         * get.c: New file, not complete.
8555
8556 Sun Nov  3 12:24:36 1996  Ben Pfaff  <blp@gnu.org>
8557
8558         * mis-val.c: New enums MV_NOR_*.  New struct num_or_range.
8559         (parse_num_or_range) New function.
8560         (parse_numeric) Reimplemented in order to support LOW THRU <n> and
8561         <n> THRU HIGH missing values.
8562
8563         * output.h: [__GNUC__>1 && __OPTIMIZE__] (width, height) Made
8564         __attribute__((const)).
8565
8566         * q2c.c: (get_token) Merged isdigit || isalpha into isalnum.
8567
8568         * sfm-read.c: Finished reference implementation.
8569
8570         * sfm.h: Includes var.h.
8571
8572         * var.h: Comment fixes.
8573         (struct `variable') Reordered some fields.
8574
8575         * vars-atr.c: (is_num_user_missing) Added support for MISSING_*
8576         constants added previously.
8577
8578 Wed Oct 30 17:13:08 1996  Ben Pfaff  <blp@gnu.org>
8579
8580         * common.h: Comment fixes.  Added declaration of
8581         `second_lowest_value' as variable or macro.  Made `compat_type',
8582         `pgm_state_type' into anonymous enums.
8583
8584         * display.c: Comment fix.
8585
8586         * glob.c: [ENDIAN==UNKNOWN] Added definition for `endian' global
8587         var.
8588         [!defined SECOND_LOWEST_VALUE] Added definition for
8589         `second_lowest_value' global var.
8590         (compat, pgm_state global vars) Changed types to `int'.
8591         (init_glob) Initializes `second_lowest_value'.
8592
8593         * sfm-read.c: Continued work, not complete.
8594
8595         * var.h: Added new MISSING_* constants to handle LOWEST and
8596         HIGHEST.
8597
8598 Sat Oct 26 23:06:06 1996  Ben Pfaff  <blp@gnu.org>
8599
8600         * sfm-read.c: New file, not complete.
8601
8602         * cases.c: (vec_insert) Changed vector expansion algorithm.
8603         (vec_delete) Fixed bug that screwed up deletion sometimes, it was
8604         mucking up the RECODE transformation in particular.
8605         (envector) Harmless change in notation.
8606
8607         dfm is now fairly well tested again.  
8608         * dfm.c: (dfm_get_record) Only returns ext->ptr if ext is
8609         non-NULL--duh.
8610         (cmd_begin_data) if(ext->line) replaced by if(ext && ext->line).
8611
8612         * recode.c: Comment fix.
8613
8614         * sfm.h: Interface should be fairly final now, or at least for a
8615         day or so...
8616
8617         * vfm.c: [DEBUGGING] (index_to_varname) New function.
8618         (open_active_file) [DEBUGGING] Translates ccase indices into
8619         variable names now to make it easier to understand what's really
8620         going on.
8621
8622 Sat Oct 26 20:46:31 1996  Ben Pfaff  <blp@gnu.org>
8623
8624         * data-in.c: Comment fix.
8625
8626         * data-list.c: Includes dfm.h.
8627         (do_reading) Uses new function dfm_push_cust().
8628
8629         * data-out.c: (convert_time, convert_WKDAY, convert_MONTH) Added
8630         `return 1;' at end.
8631
8632         * file-handle.h: Completely changed.  Some parts split off into
8633         new file dfm.h.  Implemented in file-handle.q.
8634         (enum FH_*) Removed.
8635         (struct fh_ext_class) New struct.
8636         (struct file_handle) Retained only these fields: name, norm_fn,
8637         fn, recform, lrecl, mode.  New fields class, ext.
8638         (get_handle_by_name, get_handle_by_filename, parse_file_handle,
8639         close_handle, handle_name) Added `fh_' prefix to name, all
8640         references changed.
8641
8642         * dfm.h: New file, implemented in dfm.c.
8643         (get_record, put_record, fwd_record, bkwd_record, set_record,
8644         get_cur_col) Functions moved from file-handle.h, now prefixed with
8645         `dfm_'.
8646         (dfm_push_cust) New function.
8647
8648         * sfm.h: New file.  Incomplete.
8649
8650         * dfm.c: All functions adjusted/rewritten for new dfm/fhp
8651         interface.  Functions reordered, comments changed.  Not well
8652         tested, probably full of bugs.
8653         (struct dfm_fhuser_ext) New struct.
8654         (dfm_close) New function.
8655         (open_file_r) Pickier about finding `BEGIN DATA.' line.
8656         (open_file_w) User messages changed.
8657         (get_record) Comment fixed.
8658         (read_record) Increments ext->ln even for inline_file.  Calls
8659         dfm_close() for inline_file when `END DATA.' encountered.
8660         (dfm_get_record) Experimental restructuring.
8661         (dfm_push_cust) New function.
8662         (cmd_begin_data) Detects whether the inline file was fully read by
8663         checking whether it is still open; detects whether it was read at
8664         all by checking whether the line number is greater than zero.
8665
8666         * file-handle.q: All functions adjust/rewritten for new dfm/fhp
8667         interface.  Functions reordered, comments changed.  Not well
8668         tested, probably full of bugs.
8669         (init_file_handle) Removed initializers for obsolete fields, added
8670         new fields.
8671         (fh_close_handle) Much simpler, now mainly calls the class
8672         function.
8673         (fh_init_files) Renamed inline file internal filename.
8674
8675         * file-type.c: Includes dfm.h.
8676         (read_from_file_type) Doesn't use dfm internal state anymore.
8677
8678         * inpt-pgm.c, print.c: Include dfm.h.
8679
8680         * recode.c: (internal_cmd_recode) Casts strlen() return value to
8681         int in comparison with other int.
8682
8683         * som-high.c: (build_target) Fixed operator precedence problem in
8684         if statement (& versus ==).
8685
8686 Sat Oct 26 10:39:25 1996  Ben Pfaff  <blp@gnu.org>
8687
8688         * dfm.c: (read_record) Can now read fixed-length records; not
8689         tested.
8690         (put_record) Can now write fixed-length records; not tested.
8691
8692         * file-handle.h: FH_* defines changed to enums.  New enum series
8693         FH_RF_*, FH_MD_*.
8694         (struct file_handle) New members recform, lrecl, mode.
8695
8696         * file-handle.q: Parser changed.
8697         (internal_cmd_file_handle) Added support for new /RECFORM, /MODE,
8698         /LRECL subcommands.  These are compatible with Windows.
8699         (init_file_handle) Initializes recform, mode fields.
8700
8701         * q2c.c: (get_line) When outputting `!' comment lines, now
8702         increments the output file line number so that `#line' directives
8703         are correct.
8704         (make_identifier) New function that converts an arbitrary string
8705         into a valid C identifier.
8706         (dump_vars) Calls make_identifier() in two places in order to
8707         suppress some errors for bad identifiers.
8708         (make_match) Allows TRUE as synonym for YES and FALSE as synonym
8709         for NO.  Allows numbers to be prefixed by underscores to make them
8710         acceptable C identifiers but still to be parsed as numbers by the
8711         Fiasco lexer.
8712
8713 Thu Oct 24 20:13:42 1996  Ben Pfaff  <blp@gnu.org>
8714
8715         * command.c: Re-enabled RECODE, SAMPLE, SELECT IF.
8716         
8717         * dfm.c: Comment fixes. (get_record) Gives error if file handle
8718         was opened for writing.
8719         (open_file_w) New function.
8720         (read_record) Uses strncasecmp if available.  Improved error
8721         messages, comments.
8722         (put_record) New function.
8723
8724         * file-handle.h: Moved function comments into dfm.c and
8725         file-handle.q.  Comment fixes.  Removed declarations of
8726         tilde_expand() and normalize_filename().
8727         (struct file_handle) Changed `open' from boolean to enumerated
8728         field to allow for three states--closed, open for reading, open
8729         for writing--all references changed.
8730
8731         * file-handle.q: Includes filename.h.
8732
8733         * print.c: (CMD_* enums) Renamed PRT_* and moved into var.h; all
8734         references changed.
8735         (alloc_line) Makes allowance for line terminator characters in
8736         calculations.
8737         (print_trns_proc) Now handles OUTFILE, WRITE differences.
8738         (print_space_trns_proc) Handles OUTFILE differences.
8739
8740         * recode.c, sample.c: Comment fixes.
8741
8742         * var.h: (struct print_trns) Changed boolean field `eject' to
8743         bitmapped field `options'; all references changed.  New enums
8744         PRT_* for use with this field.
8745
8746         * exception.h, test-exception.c: Removed.
8747
8748 Thu Oct 24 17:47:14 1996  Ben Pfaff  <blp@gnu.org>
8749
8750         * ascii.c: (delineate) Turned off debug output.
8751
8752         * common.c: [Checker and Linux] (__assert_fail, __eprintf) Moved
8753         to error.c.
8754
8755         * data-in.c: (parse_string_as_format) Sets the entire string value
8756         to spaces, not just the short string part of it.  Is this correct
8757         now? 
8758
8759         * data-out.c: (convert_date) Fixed DATETIME format problems with
8760         decimal places, removed debug code.
8761
8762         * dfm.c: (open_file_r) Fixed bug where an error would occur in the
8763         middle of parsing BEGIN DATA that would cause the lexer to read
8764         from a wild pointer `prog'; now calls new function
8765         preprocess_line() in lexer.c.
8766
8767         * error.c: [__CHECKER__] (hcf) Calls induce_segfault() on improper
8768         termination.
8769         [Checker and Linux] (__assert_fail, _eprintf) Moved from common.c.
8770         Now call induce_segfault() to induce the segfault.
8771         (induce_segfault) New function.
8772
8773         * expr-opt.c: Comment fix.
8774         (parse_sysvar) New function.
8775         (parse_primary) Added system variable support--calls
8776         parse_sysvar().
8777         (global var ops) Added OP_CASENUM operator.
8778
8779         * expr.h: Comment fixes.
8780         (OP_* enum) added OP_CASENUM operator.
8781         (struct casenum_node) New struct.
8782         (union any_union_union) New member `cas' of type `casenum_node'.
8783
8784         * glob.c: (global var last_vfm_invocation) New var.
8785         (init_glob) Initializes last_vfm_invocation.
8786
8787         * lexer.c: (lookahead) Fixed reversed condition on if statement.
8788
8789         * getline.c: (get_line) Split into get_line() and preprocess_line().
8790         (preprocess_line) New function.
8791
8792         * var.h: Declares last_vfm_invocation.
8793
8794         * vfm.c: (procedure) Sets last_vfm_invocation.
8795
8796 Wed Oct 23 21:53:43 1996  Ben Pfaff  <blp@gnu.org>
8797
8798         * command.c: (parse_cmd) Fixed bad assertion related to
8799         lookahead().
8800
8801         * data-in.c: (parse_month) Implemented to parse months according
8802         to full interpretation of standard.
8803         (to_roman) New function.
8804         (parse_wk_delimiter) Bug fix (forgot to skip `WK' in string).
8805         (parse_weekday) Bug fix (forgot to skip all the day name).
8806
8807         * data-list.c: (read_from_data_list_fixed) Fixed bug that screwed
8808         up parsing of multirecord data items.  Also fixed user message.
8809
8810         * data-out.c: Comment fix.
8811         (year2, year4, convert_date, convert_time, convert_WKDAY,
8812         convert_MONTH) New functions to support time & date output.
8813         (convert_format_to_string) Calls new time & date output routines.
8814
8815         * expr-prs.c: (nary_num_func) Found a bug, but didn't fix it yet.
8816
8817         * lexer.c: (lookahead) Noted a previously unnoticed caveat in
8818         comment.
8819
8820         * main.c: [DEBUGGING] (dump_token) Updated to handle getline.h.
8821
8822         * misc.c: (global var formats) Fixed declarations of DATETIME,
8823         TIME, DTIME.
8824
8825         * postscript.c: (text) Fixed a pair of bugs in the reallocation of
8826         the output_char buffer.
8827
8828         * vars-prs.c: (parse_DATA_LIST_vars) Fixed a failure to free
8829         memory bug.  Fixed user messages.
8830
8831 Tue Oct 22 17:27:04 1996  Ben Pfaff  <blp@gnu.org>
8832
8833         * Removed #pragma argsused from lots of places.
8834         
8835         * data-in.c: Implemented zoned decimal and time-date formats.
8836         Untested.  This is a huge chunk of code--maybe 1000 lines and 50
8837         new functions.
8838
8839         * data-out.c: Implemented zoned decimal format.
8840
8841         * expr.h: Moved yrmoda() declaration here from exprP.h.
8842
8843         * misc.c: (global var formats) Minor fixes--added
8844         FCAT_SHIFT_DECIMAL to formats N and Z.
8845         (convert_fmt_ItoO) Added support for format Z.
8846
8847         * som-frnt.c: (som_set_value) Fixed bug regarding string values.
8848
8849 Mon Oct 21 20:39:59 1996  Ben Pfaff  <blp@gnu.org>
8850
8851         * command.c: (parse_cmd) [GLOBAL_DEBUGGING] Inserted call to
8852         som_check_workspace() that is activated between commands.
8853
8854         * data-list.c: (dump_fixed_table, dump_free_table) Finished these
8855         for good, I hope.
8856
8857         * list.q: (begin_row) Changed title expansion style from
8858         SOPT_X_VERT to SOPT_X_SHSP.
8859
8860         * som-frnt.c: Now includes `somP.h'.
8861         (som_push_workspace, som_pop_workspace) New functions that, taken
8862         together, form a solution to the recursive table building problem
8863         mentioned yesterday.  Surrounded every table output routine
8864         throughout the program with calls to these functions.
8865         [GLOBAL_DEBUGGING] (som_check_workspace) New function.
8866         (som_create_table) Checks that there's an active workspace.
8867         (som_destroy_all_tables, som_crush) Removed.
8868
8869         * som-high.c: (global var som_preserve_tables) Removed, all
8870         references deleted.
8871         (som_submit_table) Checks that there's an active workspace.
8872         (dump_columnated_table) Doesn't columnate tables that would have
8873         just one row per column.
8874         (dump_crush_page, som_dump_crush_page) Removed debugging code.
8875         (som_dump_crush_page) Moved row number labels from left side of
8876         tables to right side.
8877         (som_get_table_size) Added support for SOPT_X_SHSP.
8878
8879         * som.h: New cell expansion type SOPT_X_SHSP.
8880
8881         * somP.h: (global vars arena_stack, n_arena_stack, m_arena_stack)
8882         New vars.
8883         (global var curtab_arena) Moved from som-frnt.c.
8884
8885 Sun Oct 20 13:45:28 1996  Ben Pfaff  <blp@gnu.org>
8886
8887         * ascii.c: [GLOBAL_DEBUGGING] (SUPPRESS_WARNINGS) New debug option
8888         that causes bad location warnings to be suppressed.
8889         (delineate) Saves current font when calling draw_text(); fixed
8890         handling of NULLs when backing up.  Also fixed line-wrapping bug.
8891
8892         * command.c: Re-enabled `LEAVE', `NUMERIC', `PRINT', `PRINT EJECT',
8893         `PRINT FORMATS', `PRINT SPACE', `STRING', `TITLE', `WRITE'.
8894
8895         * common.c: Added code to cause assertion failure to dump core
8896         when run under Checker.
8897
8898         * data-list.c: (dump_fixed_table) Fixed some inconsistencies, but
8899         there are still bugs.
8900
8901         * glob.c: (__eprintf) Removed.
8902
8903         * list.q: Inserted som_preserve_tables kluge that prevents tables
8904         from being thrown away due to recursive table building through
8905         som_output_line being called from a transformation during the LIST
8906         procedure invocation.  This is a general problem that must be
8907         solved in a better way since it applies to all procedures in
8908         general.
8909         (begin_row) Changed title options to SOM_X_VERT from SOM_X_BOTH.
8910         (flush_table) Removed SOM_TOPT_PRESERVE from submission options.
8911
8912         * numeric.c: Fixed several errors in the form of msg() calls.
8913
8914         * print.c: Updated for use of som.
8915         (dump_table) Reimplemented.
8916         (print_trns_proc) Calls som_eject_page() instead of eject_page().
8917         Calls som_output_text() instead of outs_line().
8918
8919         * som-frnt.c: (som_destroy_all_tables) Sets som_preserve_tables to
8920         0.
8921         (som_output_text) Function moved from som-low.c.  Interface
8922         changed.
8923
8924         * som-high.c: (som_preserve_tables) New global public variable
8925         declared in som.h.
8926         (som_submit_table) Destroys the tables only if som_preserve_tables
8927         is 0.
8928         (paginate_horizontally) Bugfix: sets som.mpw even if there's only
8929         one subrow per row.  Now labels subrows if there's more than one
8930         subrow per row.
8931         (dump_crush_table) Added wishlist comment.
8932         (som_eject_page) New public function declared in som.h.
8933
8934         * som-low.c: (som_dump_crush_page) Draws row labels if there's
8935         more than one subrow per row.
8936         (som_output_text) Moved to som-frnt.c.
8937
8938         * som.h: (SOM_TOPT_PRESERVE) Removed.
8939
8940         * title.c: (get_title) Changed interface.
8941         (cmd_title) Changed `title' to `outp_title'.
8942         (cmd_subtitle) Changed `subtitle' to `outp_subtitle'.
8943
8944 Sun Oct 20 09:04:15 1996  Ben Pfaff  <blp@gnu.org>
8945
8946         * list.q: (flush_table) Conforms to new partial options in
8947         som_submission_form.
8948
8949         * som-high.c: (paginate_horizontally) Changed form of subrow
8950         number labels.
8951         (build_target) Omits spacing before table if
8952         SOM_TOPT_PARTIAL_OMIT_TOP is selected.
8953         (dump_crush_page) Changed interface.  Only trims bottom rule if
8954         SOM_TOPT_PARTIAL_OMIT_BTM is not selected.
8955         (dump_crush_table) Handles partial tables.
8956         (output_row_label) New function.
8957         (som_dump_crush_page) Emits subrow number labels.  Draws vertical
8958         rule on the right edge of narrow subrows.
8959
8960         * som.h: Changed SOM_SUB_PARTIAL_* series of submission type
8961         constants to a series of SOM_TOPT_PARTIAL_* submission options.
8962         All references updated.
8963
8964 Fri Oct 18 19:46:49 1996  Ben Pfaff  <blp@gnu.org>
8965
8966         * misc.c: Comment fix.
8967
8968         * som-high.c: (examine_table) Treats crushed tables separates for
8969         purpose of determining header size.
8970         (paginate_horizontally) Allots space for line numbers in crushed
8971         tables with lots of subrows per row.  Calculates the `maximum page
8972         width', the width of the widest horizontal page.
8973         (build_target) Removed trim argument; all references changed.
8974         Stricter assertions.  (dump_crush_page) New function.
8975         (dump_crush_table) Reimplemented.
8976
8977         * som-low.c: (som_dump_page) Uses new RULE_ROW &c. constants.
8978         (som_dump_crush_page) Reimplemented, interface changed.
8979
8980         * somP.h: Many many new helper macros for use with crushed tables.
8981         (global var som) Removed `tv', `cum_y' members; all references
8982         removed.  New members `mpw', `digit_space'.
8983
8984 Sun Sep 29 19:37:03 1996  Ben Pfaff  <blp@gnu.org>
8985
8986         * arena.c: (arena_alloc) [!DISCRETE_BLOCKS] Removed `size'
8987         variable, changed to constant 1024.
8988         (arena_ca_strdup) Changed `sizeof(a_string)' to
8989         `sizeof(c_string)'.
8990         (arena_ca_strdup) [!DISCRETE_BLOCKS] Changed bad cast from
8991         `(c_string *)' to `(char *)'; this fixed some offset problems.
8992
8993         * filename.c: (readlink_malloc) Changed initial allocation from
8994         100 bytes to 128.
8995         (good_getcwd) Changed from xmalloc() to local_alloc(); removed
8996         comment.
8997
8998         * postscript.c: (read_fontmap) Fixed leak by changing &owner to
8999         &fm->owner in several places.
9000
9001         * som-high.c: (output_table) Changed interface to rest of world.
9002         (examine_crush_table) Removed.  Crushed tables are re-broken now,
9003         in preparation for rewrite.
9004
9005         * som.h: Comment fix.
9006
9007 Sat Sep 28 21:28:07 1996  Ben Pfaff  <blp@gnu.org>
9008
9009         * ascii.c: (ascii_init_driver) Disposes of x->file.filename and x
9010         itself in the cleanup stage.
9011
9012         * descript.q: (display) At least temporarily, changed the table
9013         format to a crushed table.
9014
9015         * list.q: (begin_row) At least temporarily, added horizontal lines
9016         between cases.
9017
9018         * som-high.c: (examine_crush_table) Sets som.hh to the width of
9019         the horizontal "headers," that is, to the width of the far left
9020         and far right rules.
9021         (justify_pagination) Sets som.th to the width of the widest row
9022         in the crushed table.  Fixed inner loop off-by-one error.
9023
9024         * som-low.c: (som_dump_crush_page) Added code to draw horizontal
9025         rules.
9026
9027         * somP.h: Comment fix.
9028
9029 Fri Sep 27 20:08:39 1996  Ben Pfaff  <blp@gnu.org>
9030
9031         * filename.c: (open_file_ext) Now, doesn't set f->file to NULL
9032         before closing it; also, opens the constructed filename `s'
9033         instead of f->filename.
9034
9035         * postscript.c: Moved initialization of x->loaded, x->prop,
9036         x->fixed, x->current, also the add_encoding() calls, into
9037         postopen().
9038         (preclose) Destroys x->combos; sets x->loaded, x->combos to NULL;
9039         sets x->last_font to NULL; sets x->next_combo to zero.
9040
9041         * som-high.c: (crushed_row_height) Moved definition farther up.
9042         (som_submit_table) Doesn't calculate line width, font size until
9043         after calling open_page(), to accomodate changes to PostScript
9044         driver.
9045         (vert_headers) Removed; equivalent functionality moved to
9046         examine_table(), examine_crush_table().
9047         (justify_pagination) Replaced with different algorithm.
9048         (dump_crush_table) Bugfix that caused tables to fail to be clipped
9049         at the bottom of the page.
9050
9051 Thu Sep 26 22:20:26 1996  Ben Pfaff  <blp@gnu.org>
9052
9053         * command.c: Added cmd_list back into cmd_table.
9054
9055         * freq.c, frequencies.q, repeat.c, list.q, vars-atr.c, vfm.c:
9056         Comment fix: `#define DEBUGGING' --> `#define DEBUGGING 1'.
9057
9058         * list.q: (flush_table) Updated to new som_submission_form format.
9059
9060         * som-frnt.c: Comment fix.
9061
9062         * som-high.c: Changed `#endif' to `#undef EXTERN'.
9063         (output_table) Calls som_get_table_size() directly; handles
9064         crushed tables.
9065         (examine_crush_table) New function; calls vert_headers().
9066         (examine_table) Moved some code into new function, vert_headers().
9067         (justify_pagination) New function.
9068         (dump_plain_table) Removed `static' from `cy'.
9069         (dump_crush_table) New function.
9070
9071         * som-low.c: (som_dump_crush_page) New function.
9072
9073         * som.h: Comment fixes.
9074         (enum SOM_TOPT_CRUSH) New.
9075         (SOM_SUB_PARTIAL_BEG, SOM_SUB_PARTIAL_MID, SOM_SUB_PARTIAL_END)
9076         Temporarily set to zero to make do with LIST procedure.
9077
9078         * somP.h: Re-ordering.
9079
9080 Wed Sep 25 19:36:11 1996  Ben Pfaff  <blp@gnu.org>
9081
9082         * som.c: Split into som-frnt.c, som-high.c, som-low.c.
9083
9084         * somP.h: New file for use by som-high.c, som-low.c.
9085
9086         * q2c.c: Added definition for VME.
9087         (get_line) Now dumps `!' comment lines to the output file
9088         verbatim.
9089
9090         * crosstabs.q, descript.q, file-handle.q, frequencies.q, list.q,
9091         set.q: Changed format of `!' comment lines.
9092
9093 Tue Sep 24 18:39:09 1996  Ben Pfaff  <blp@gnu.org>
9094
9095         * All source files: Added copyright notice.
9096
9097         * common.c: (xmalloc, xrealloc, xstrdup) Cast size_t's to unsigned
9098         longs in msg() calls.
9099
9100         * con32s.c: (xmalloc, xrealloc) Updated from common.c.
9101
9102         * q2c.c: (xmalloc, xrealloc, xstrdup) Updated from common.c.
9103
9104 Sat Sep 21 23:16:31 1996  Ben Pfaff  <blp@gnu.org>
9105
9106         * output.c: (outp_read_devices) Changed criteria for
9107         distinguishing different types of lines.
9108
9109 Fri Sep 20 22:52:28 1996  Ben Pfaff  <blp@gnu.org>
9110
9111         * cmdline.c: Changed syntax message.
9112
9113         * filename.c: (good_getcwd) Bug fix (?).
9114         (normalize_filename) [__BORLANDC__] Uses _fullpath() library
9115         function.
9116         (search_path) Appends DIR_SEPARATOR to directory name only if it
9117         does not already end with one.
9118
9119         * glob.c: Checks STAT_PAGER envvar before PAGER.
9120
9121         * output.c: Checks environment variables instead of just local
9122         macros.
9123
9124 Tue Sep 10 21:39:00 1996  Ben Pfaff  <blp@gnu.org>
9125
9126         * arena.c: (arena_destroy) Swatted a subtle bug that cropped up
9127         when the pointer passed to the function was within the arena
9128         itself, so that it couldn't properly be set to NULL _after the
9129         arena was freed_.
9130
9131         * command.c: Re-enabled DISPLAY.
9132
9133         * display.c: Rewritten to handle tables.  Untested.
9134
9135         * filename.c: (search_path) Fixed memory leak.
9136
9137         * frequencies.q: (cmd_frequencies) Frees v_variables.
9138         (postcalc) Calls cleanup_freq_tab() after displaying statistics.
9139         (cleanup_freq_tab) New function to garbage collect.
9140         (dump_full) Elegantized.
9141
9142         * main.c: New comment.
9143
9144         * output.h: New tag for tagged quotes: TAG_NEWLINE.
9145
9146         * postscript.c: Comment fix.
9147         (release_fontmap, free_font_entry) New functions.
9148         (ps_init_driver) Sets free_font_entry() as the freefunc for
9149         hashtable `loaded'.  Calls release_fontmap() when destroying a
9150         driver; also frees the output filename; also frees the
9151         ps_driver_ext block.
9152         (free_ps_encoding) Frees the filename as well as the encoding
9153         block.
9154         (output_encodings) Frees the line buffer and pops the msg-filename
9155         stack.
9156         (read_fontmap) Frees the fontmap filename and the line buffer.
9157         (postopen, preclose) Misc. garbage collection fixes.
9158         (ps_open_page) Destroys the `combos' hash table; sets `last_font'
9159         to NULL; this fixes some output problems.
9160         (text) Handles TAG_NEWLINE.  Untested.
9161
9162         * som.c: (cell_byte_size) Merged SCON_VALUE and SCON_TEXT cases.
9163         (som_set_string) Removed.  All references changed to
9164         `som_set_text'.
9165         (som_set_text) Rewritten.  New interface.  More general.
9166
9167         * som.h: Minor format changes.
9168         (struct som_value_cell) Removed; all references changed to
9169         `som_text_cell'.
9170         (enums SOT_*) Changed.
9171
9172 Mon Sep  9 21:43:13 1996  Ben Pfaff  <blp@gnu.org>
9173
9174         * command.c: Re-enabled SPLIT FILE.
9175
9176         * postscript.c: Comment fix.
9177
9178         * som.h: Added `SOT_NONE'.
9179
9180         * split-file.h: (cmd_split_file) Removed superfluous parenthesis.
9181
9182         * vfm.c: (dump_splits) Reimplemented.
9183
9184 Sat Sep  7 22:35:12 1996  Ben Pfaff  <blp@gnu.org>
9185
9186         * Compiled the project under gcc 2.7.2, which gave some new
9187         warnings.  This led to many additions of casts from unsigned to
9188         int sprinkled throughout the code.
9189         
9190         * arena.c: Many uses of `unsigned' changed to `size_t'.
9191
9192         * command.c: Added END FILE, END REPEAT to command table.
9193         (var cmd_end_repeat) Renamed cmd_end_repeat_p.
9194         (find_command, FILE_TYPE_okay) Not commented out anymore.
9195         (parse_cmd) Calls FILE_TYPE_okay again.
9196         (output_line) Added calls to som_output_text() to put the line
9197         in the output files.
9198
9199         * common.c: (macro VME) Format changes.
9200         (xstrdup) Asserts that its argument is not NULL.
9201         
9202         * data-list.c: Implemented dump_fixed_table().
9203         
9204         * inpt-pgm.c: Formatting changes.  Comment changes.
9205         (end_case_proc) Renamed end_case_trns_proc.
9206         (cmd_end_file, end_file_trns_proc) New functions.
9207
9208         * misc.c: Many uses of `int' and `unsigned' changed to `size_t'.
9209
9210         * misc.h: (local_strdup) New macro corresponding to strdup() but
9211         allocating its data through local_alloc() if possible--that is, if
9212         GNU C is in use.
9213
9214         * postscript.c: Comment changes.
9215         (quote_ps_name, quote_ps_string, output_encodings) New functions.
9216         (output_line, add_string) New macros supporting
9217         output_encodings().
9218         (postopen) Fixed contents of ${fixed-font} and ${prop-font}
9219         substitution vars.  Calls output_encodings() when a line
9220         consisting of `!encodings' is encountered.
9221         (preclose) Some code moved into quote_ps_string().
9222         (dump_line) Changed into macro supporting dump_fancy_line().
9223         (switch_font) Now outputs DSC "%%IncludeResource: font (...)"
9224         command when appropriate.
9225         (write_text) Fixed `literal_char' array (I think it's fixed, at
9226         least.)
9227         (text) Fixed bug when width was zero.  Now exits immediately on
9228         zero height_left.  Now, when executing `goto restart;', checks
9229         that cp<end, so that we don't read beyond end-of-string.  Also,
9230         outputs the correct code to the output file by outputting the code
9231         from the metric instead of the internal metric index.
9232
9233         * repeat.c: (cmd_end_repeat) New function.
9234
9235         * som.c: (var som) `headers' renamed `options' and semantics
9236         changed.  All references changed.
9237         (draw_title) `if(px!=-1 || px!=-1)' --> `if(px!=-1 || py!=-1)'.
9238         (build_target) Only inserts spacing if SOM_TOPT_SPACING not
9239         selected.
9240         (som_text_table) Removed.
9241         (som_output_text) New function.
9242
9243         * som.h: (struct som_submission_form) Removed `header', `reuse',
9244         replaced with bitmapped field `options'.
9245         (SOM_TOPT_*) New enum set for som_submission_form.options.
9246         (SOT_*) New enum set for som_output_text().
9247
9248         * temporary.c: (copy_variable) When copying the var label, only
9249         calls xstrdup() if it's non-NULL.
9250
9251         * var.h: (enum type `vartype') Removed; all references changed to
9252         `int'.
9253
9254         * vars-atr.c: (init_variable) Changed local var `nbytes' from
9255         `int' to `size_t'.
9256
9257 Thu Sep  5 22:05:56 1996  Ben Pfaff  <blp@gnu.org>
9258
9259         * font.h: Comment changes.
9260
9261         * groff-font.c: (groff_read_font) Initializes `name' field to
9262         NULL.  Handles `encoding' field.
9263
9264         * hash.c: (hsh_dump) [GLOBAL_DEBUGGING] Output formatting changes.
9265
9266         * postscript.c: (struct font_entry) Removed `position' field.
9267         (struct ps_font_combo) New struct.
9268         (struct ps_driver_ext) Removed field `next_position'.  New fields
9269         `combos', `next_combo'.  `last_font' field changed from
9270         `font_entry *' to `ps_font_combo *'.
9271         (ps_init_driver) Reformatted; handles new fields.  When
9272         OPO_AUTO_ENCODE is set, adds the two default fonts' encodings to
9273         the encoding list.
9274         (get_encoding, find_encoding_file) New functions.
9275         (add_encoding) Some code moved out into find_encoding_file().
9276         (postopen) Changed value for ${title}.
9277         (preclose) Sets `loaded' field to NULL after destroying the hash
9278         table.
9279         (ps_open_page) Added comment.  Inits the `combos' and `next_combo'
9280         fields.
9281         (ps_text_set_font_by_position) Figures out the current family if
9282         not known.
9283         (compare_ps_combo, hash_ps_combo, free_ps_combo) New functions.
9284         (switch_font) Implemented.
9285         (write_text) Calls switch_font() more often.  Format changes.
9286         #undefs its macros after they're no longer useful.
9287         (text) Changed `continue' at one point to a jump to the top of the
9288         loop because we don't want `separate' reset to 0 at that point.
9289         (load_font) No longer sets `position' in the font_entry created.
9290
9291 Wed Sep  4 21:45:35 1996  Ben Pfaff  <blp@gnu.org>
9292
9293         * font.h: (struct font_desc) New member `encoding', which is not
9294         properly handled yet.
9295
9296         * glob.c: (init_glob) Some new i18n code, which is probably
9297         screwed up.
9298
9299         * output.c: (outp_read_devices, outp_get_paper_size) Changed
9300         `size' local from `int' to `size_t'.
9301
9302         * postscript.c: New driver configuration parameter `auto-encode'.
9303         New enums OPO_AUTO_ENCODE, ODA_COUNT.
9304         (struct font_entry) New member `position'.
9305         (struct ps_driver_ext) Reordered.  New hash table member
9306         `encodings'; new members `next_position', `next_encoding',
9307         `last_font'.  Members `current', `prop', `fixed' changed from type
9308         `font_desc *' to `font_entry *'; all references changed.
9309         (struct ps_encoding) New struct.
9310         (read_ps_encodings, compare_ps_encoding, hash_ps_encoding,
9311         free_ps_encoding, add_encoding) New functions.
9312         (ps_init_driver) Added OPO_AUTO_ENCODE to default
9313         x->output_options.  Initializes new members of ps_driver_ext.
9314         Changed default value for prologue_fn, encoding_fn.  Calls
9315         read_ps_encodings after loading default fonts.
9316         (option_tab[], ps_option) Handle new configuration parameter.
9317         (switch_font) New function.
9318         (struct output_char) `font' member changed from `font_desc *' to
9319         `font_entry *'.  New member `separate'.
9320         (read_fontmap) Changed `size' from `int' to `size_t'.
9321         (output_line, put_number) New macros for write_text().
9322         (write_text) Optimizes text output by consolidating multiple
9323         calls to PostScript `show' operator.
9324         (text) Keeps track of when text arguments can't be consolidated by
9325         write_text(), and marks those spots in the output stream.
9326         (load_font) Sets `position' of the allocated font_entry to -1, cuz
9327         the font hasn't been switched to by switch_font(), which is where
9328         the position is important--the PostScript is what cares about the
9329         position.
9330
9331 Sat Aug 31 23:52:38 1996  Ben Pfaff  <blp@gnu.org>
9332
9333         * hash.c: (hsh_destroy) Ignores NULL argument.  Doesn't try to
9334         call a NULL free_func.
9335         (hsh_rehash) Elegantized.
9336         (hsh_probe) Fix bug that manifested when the table was expanded
9337         and thus had to change location in memory.  Good thing
9338         too--otherwise could have been much more subtle.
9339         (hsh_find) [GLOBAL_DEBUGGING] Not stubbed out anymore.
9340         (hsh_foreach) New function for hash table iteration.
9341
9342         * hash.h: (struct hsh_iterator) New.
9343
9344         * lexer.c: (parse_tagged_quote) Font and family name strings in
9345         tags are now null-terminated.
9346
9347         * output.c: (outp_evaluate_dimension) Fixed over-aggressive unit
9348         parsing.
9349         (internal_get_paper_size, outp_get_paper_size) Fixed; now work as
9350         documented.  (Never before tested?)
9351
9352         * output.h: Comment changes.
9353
9354         * postscript.c: New driver options `optimize-text-size',
9355         `optimize-line-size', `max-fonts-simult'.  New enum set for
9356         specing cached line types.  Comment fixes.
9357         (struct line_form) New struct.
9358         (struct ps_driver_struct) New members `text_opt', `line_opt',
9359         `max_fonts', `lines'.
9360         (ps_init_driver) Initializes new members of ps_driver_struct.
9361         (user option type enum set) New member `nonneg_int_arg'.
9362         (static var option_tab[]) Supports new options.
9363         (ps_option) Handles new options.
9364         (find_ps_file) Made static.  No longer calls hsh_dump().
9365         (ps_get_var) Made static.
9366         (preclose) Dumps out proper DSC trailer.
9367         (ps_open_page) Elegantized.
9368         (ps_close_page) Calls dump_lines() if appropriate.
9369         (ps_line_horz, ps_line_vert, ps_line_intersection) Reduced to
9370         wrappers around line().
9371         (int_2_compare, compare_line, dump_line, dump_fancy_line,
9372         dump_lines, hash_line, free_line, line) New functions for support
9373         of line caching.
9374         (write_text, text) Made static.
9375         (text) Added to font support, not finished.
9376
9377 Thu Aug 29 21:36:41 1996  Ben Pfaff  <blp@gnu.org>
9378
9379         * font.h: (struct font_desc) New members ascent, descent.
9380
9381         * groff-font.c: (groff_read_font) Calculates font ascent and
9382         descent from the ascent and descent of the `d' and `p' characters,
9383         respectively, as per a suggestion on comp.fonts.
9384
9385         * postscript.c: (ps_open_page, ps_close_page, ps_line_horz,
9386         ps_line_vert, ps_line_intersection) Rewritten to deal with changed
9387         prologue.
9388         (write_text) Handles text right-justification and centering (not
9389         full justification).  Still very inefficient.  (One output line
9390         per character?!)
9391         (struct output_char) Added fields for font and font size.
9392         (text) Many bugfixes.
9393
9394 Sat Aug 24 23:26:00 1996  Ben Pfaff  <blp@gnu.org>
9395
9396         * cmdline.c: (usage) Calls outp_list_classes().
9397
9398         * font.h: Comment fix.
9399
9400         * groff-font.c: New exported global var `space_index'.
9401         (groff_init) New function to initialize `space_index'.
9402         (hash_kern) Casts result to unsigned.
9403         (font_name_to_index) Renamed font_char_name_to_index.  All
9404         references changed.  Also, now returns the value of `space_index'
9405         when passed an ASCII space character as an argument.  Fixed
9406         handling of nulls.
9407         (font_get_kern_adjust) Changed i from `int' to `unsigned'.
9408         Handles passed NULL pointers properly.
9409
9410         * lexer.c: (parse_tagged_quote) Comment fix.  Better range
9411         checking.
9412
9413         * output.c: (outp_list_drivers) Removed.  Removed all references.
9414         
9415         * output.h: Comment fixes.
9416
9417         * postscript.c: (ps_open_global) Calls groff_init().
9418         (output_char) New structure.
9419         (write_text) New function.
9420         (text) No longer stubbed out!  Now the output is correct--with a
9421         few exceptions, one of them being that the page has to be held
9422         upside down into a mirror.
9423
9424 Sun Aug 11 21:31:22 1996  Ben Pfaff  <blp@gnu.org>
9425
9426         * font.h: Comment fix.
9427         
9428         * font.c: (name_to_index) Renamed font_name_to_index, made extern.
9429         All callers changed.
9430         (number_to_index) Renamed font_number_to_index, made extern.  All
9431         callers changed.
9432         (font_get_kern_adjust, font_get_char_metrics) New functions.
9433
9434         * output.h: New constant OUTP_T_INTERNAL_DRAW.
9435
9436         * postscript.c: Changed default line width back to 1/2 point.
9437         (ps_line_horz, ps_line_vert, ps_line_intersection) Now lines are
9438         in the center of the space allotted for them, not just a fixed
9439         offset from the edge of the space; this fixes some bugs.
9440         (ps_line_intersection) Now supports all command line styles.
9441         (ps_text_get_size) Bug fix in computation of em width.
9442         (text) New function, the meat behind ps_text_metrics and
9443         ps_text_draw.  Not complete.
9444         (ps_text_metrics, ps_text_draw) Removed the stub taken from
9445         ascii.c; call text().
9446
9447 Sat Aug 10 23:28:17 1996  Ben Pfaff  <blp@gnu.org>
9448
9449         * arena.c: (arena_free) Assert that the argument is non-NULL.
9450         
9451         * groff-font.c: (add_kern) Calls arena_free() for old_kern if and
9452         only if old_kern is non-NULL.
9453
9454         * postscript.c: (ps_init_driver) Changed default line width to 1
9455         point.
9456         (postopen) New prologue variables.
9457         (ps_line_horz, ps_line_vert, ps_line_intersection) Implements some
9458         more of the common line styles properly, but not all.
9459         (ps_text_metrics) Fixed problem with this stubbed out version that
9460         kept it from taking font sizes into account.
9461
9462 Thu Aug  8 22:31:11 1996  Ben Pfaff  <blp@gnu.org>
9463
9464         * arena.c: (arena_malloc) Bug fix.
9465         (arena_dump) [GLOBAL_DEBUGGING] New function.
9466
9467         * ascii.c: Comment fix.
9468         (count_fancy_chars, delineate) Now static functions.
9469         
9470         * filename.c: (interp_vars) Bug fixes.
9471
9472         * font.h: Comment fixes.
9473
9474         * glob.c: (init_glob) Sets set_viewwidth, set_viewlength at
9475         beginning in case we have an error message to display before
9476         initializing the display.
9477
9478         * groff-font.c: Comment fix.  Changed rehash threshold from 2/3
9479         full to 1/2 full.
9480         (groff_read_font) Bug fixes.
9481         (name_to_index) Increments hash.used.  Sets `name' field of hash
9482         entry properly.
9483         (add_kern) Sets kern_max_used after rehashing.  Other bug fixes.
9484
9485         * hash.c: Return type changed.
9486
9487         * postscript.c: Continued development.  Now marks lines on the
9488         paper, but very buggy.
9489
9490 Sat Aug  3 20:50:35 1996  Ben Pfaff  <blp@gnu.org>
9491
9492         * Changed comments in many source files from `/* xxx /* yyy */' to
9493         `/* xxx */ /* yyy */' for cleanliness.
9494
9495         * arena.c: (arena_sd_strdup) New function.
9496         
9497         * ascii.c: (struct ascii_driver_ext) New member `file'.
9498         (ascii_init_driver) Fills out member `file' for initing; uses
9499         close_file_ext for closing drivers.
9500         (ascii_option) Changed %.*s back to %s because the a_string's are
9501         always null-terminated.
9502         (postopen, preclose) New functions.
9503         (ascii_open_page) Uses new style of open_file_ext.
9504         (ascii_option, commit_line_buf, output_lines) Use ext->file.file
9505         instead of this->output.
9506         (__assert_fail) Removed.
9507
9508         * cmdline.c: Changed syntax_message[].
9509
9510         * error.c: #include's <readline/history.h> only if the history
9511         library is available, not if just the readline library is
9512         available.
9513
9514         * filename.c: (expand_line) Removed alloca() support.
9515         (interp_vars) No longer tilde-expands argument.  Limit on output
9516         length removed.
9517         (tilde_expand) Now treats argument as path rather than filename.
9518         [!unix] Now is a no-op function.
9519         (search_path) Better verbose message formatting.
9520         (open_file, close_file) Comment fixes.
9521         (close_file) [!unix] Doesn't bother with pipes.
9522         (open_file_ext) Completely rewritten, interface revamped.
9523         (close_file_ext) New function.
9524
9525         * font.h: Comment changes.
9526
9527         * frequencies.q: Removed AIX alloca support since it doesn't use
9528         alloca.
9529
9530         * hash.c: Comment changes & additions.
9531         (hsh_create) Initializes entire table instead of first M entries.
9532         (hsh_probe) Stupid bug fixed.  Now it works.
9533         (hsh_dump) [GLOBAL_DEBUGGING] New function.
9534
9535         * main.c: (parse) Detects EOF properly in token-eating loop.
9536         Should the STOP token have its value changed to 0?
9537
9538         * misc.c: (blp_getdelim) [HAVE_GETDELIM] Now it's a macro.
9539         (blp_getline) Now it's a macro.
9540
9541         * output.h: (struct outp_driver) Removed members output, filename.
9542         
9543         * output.c: (outp_init) [!NO_POSTSCRIPT] Installs PostScript
9544         drivers in driver table.
9545         (outp_read_devices) Frees buf.  Warns if there are no active
9546         output drivers.
9547         (outp_configure_clear) Sets outp_configure_vec to NULL after
9548         deleting its elements.
9549         (configure_driver, destroy_driver) Removed references to output,
9550         filename members of outp_driver.
9551         (outp_evaluate_dimension, internal_get_paper_size,
9552         outp_get_paper_size) New functions.
9553
9554         * postscript.c: Continued development.  Now links but doesn't make
9555         any marks on the page.  Lotsa bugs I suppose.
9556
9557         * str.c: (strcasecmp) [!HAVE_STRCASECMP] New function.
9558
9559         * str.h: Comment changes.
9560
9561 Sat Jul 27 22:32:38 1996  Ben Pfaff  <blp@gnu.org>
9562
9563         * Removed dependencies on non-nested comments in several files.
9564         Also removed references to (unix || __unix__) in #if's since
9565         prefh.orig makes those two equivalent.
9566         
9567         * ascii.c: (ascii_open_global) Creates ascii_arena.
9568         (ascii_close_global) Destroys ascii_arena.
9569         (ascii_init_driver) Doesn't create ascii_arena.
9570         (ascii_copy_driver) Removed.
9571         (ascii_option) Possible bugfix regarding %s vs. %.*s with a_string's.
9572         (outp_class ascii_class) Removed ascii_copy_driver reference.
9573
9574         * frequencies.q: Now can display all statistics except median.
9575         Still not finished.
9576
9577         * output.c: Handles outp_class.ref_count so output class
9578         destructors are called properly.
9579         (add_class) Sets ref_count to 0.
9580         (configure_driver) Initializes class if ref_count++ is 0.
9581         (destroy_driver) Destructs class if --ref_count is 0.  Frees the
9582         class output file name.
9583         
9584         * output.h: (struct outp_class) Removed copy_driver, inited.
9585         Added ref_count.
9586
9587         * postscript.c: Completely replaced but not finished.
9588         
9589 Tue Jul 23 21:48:36 1996  Ben Pfaff  <blp@gnu.org>
9590
9591         * approx.h: #includes <float.h>.
9592
9593         * arena.h, arena.c: Many functions changed to take an arena **
9594         instead of an arena *, for consistency.  All callers changed.
9595         (arena_alloc) Now creates a new arena if passed *A that is NULL.
9596         (arena_destroy) Sets *A to NULL.
9597         
9598         * ascii.c: (delineate) Implements OUTP_T_VERT correctly.  Removed
9599         assertion that `width' be positive.
9600
9601         * command.c: Removed #if's from cmd_table.
9602         (walk_cmdtable_func) [0] New function (debug code).
9603         (init_cmd_parser) [0] Dumps out cmd_table (debug code).
9604         (parse_cmd) Doesn't return failure for unimplemented commands.
9605
9606         * common.h: (SYSMIS) Changed from DBL_MAX to -DBL_MAX.
9607         (SYSCODE) New constant macro.
9608
9609         * descript.q: Checks for positive n_variables before performing
9610         analysis.
9611
9612         * file-handle.q: (get_handle_by_filename) Bug fix: passes &f to
9613         avl_find instead of &fp as arg 2.
9614
9615         * frequencies.g, frequencies.q: Continued updating; now compiles &
9616         works again, but not complete.
9617
9618         * main.c: Changes to user messages.
9619
9620         * misc.c: (reverse) [0] New function.
9621
9622         * settings.h: Comment removed.  #includes "common.h".
9623
9624         * som.c: (som_set_null) New function.
9625         (som_set_value, som_set_string, som_set_text) More detailing
9626         assertions.
9627         (som_set_float) Implemented function.
9628         (dump_columnated_table) Bug fix regarding page breaks.
9629         (draw_cell) Bug fix regarding text that spilled out of a cell.
9630         (draw_intersection, draw_horz_rule, draw_vert_rule) No longer draw
9631         null lines.
9632         (get_cell_size) Support SCON_EMPTY cells.
9633         (get_table_size) When calculating rules' widths and heights, mask
9634         out SLIN_SPACING bit.  Added SOPT_X_HLTL support.
9635         
9636         * som.h: (som_any_cell) New option SOPT_X_HTLT.  Removed
9637         SOPT_X_SHADE.
9638         (struct som_submission_form) New member `header'; all users
9639         changed.
9640
9641         * val-labs.c: (get_label) User messages changed.
9642
9643         * var.h: Changed FREQUENCIES structures.
9644
9645         * vars-atr.c: (is_num_user_missing, is_str_user_missing) Made
9646         inline.
9647         
9648 Fri Jul 19 19:11:13 1996  Ben Pfaff  <blp@gnu.org>
9649
9650         * approx.h: Definition of EPSILON now depends on system's
9651         DBL_EPSILON.  Removed GNU C specific code.
9652         (cmpapx) Renamed approx_compare.
9653
9654         * frequencies.g, frequencies.q: Continued updating; still doesn't
9655         compile.
9656
9657         * groff-font.c: (name_to_index) Fix bug that kept it from
9658         compiling.
9659
9660         * hash.c, hash.h: Completed work.
9661
9662         * var.h: Changes to freq_tab, frequencies_proc.
9663         
9664 Wed Jul 17 21:23:36 1996  Ben Pfaff  <blp@gnu.org>
9665
9666         New hashing code.
9667         * hash.c, hash.h: New files.  Not completed.
9668         * Makefile.am: Added hash.c to source file list.
9669         * font.h: (struct font_desc) New member kern_size_p.
9670         * groff-font.c: Uses hash.h.
9671         (hashpjw) Moved to hash.c.
9672         (next_prime_power) Rewrote, renamed hsh_next_prime, moved to
9673         hash.c.
9674         (static var hash) New member size_p.
9675         * var.h: Includes hash.h.
9676         (struct freq_tab) Changed AVL_TREE to hash_tab.
9677
9678         * vars-prs.c: Comment, formatting fixes.
9679
9680         * frequencies.g, frequencies.q: Continued updating.  Not yet
9681         working.
9682
9683         * formats.c: Bug fix.
9684
9685 Tue Jul 16 22:10:04 1996  Ben Pfaff  <blp@gnu.org>
9686
9687         Increasing parallelism between DESCRIPTIVES and FREQUENCIES.
9688         * descript.g: Comment fixes.
9689         * descript.q: Comment fixes.  Moved some declarations into var.h.
9690         Made dsc_info a static table.  Updated FIXMEs.
9691         (internal_cmd_descriptives) Beautified.
9692         
9693         * frequencies.q: Started updating into working order.
9694         * frequencies.g: New file analogous to descript.g.
9695         * var.h: Comment fixes.  Added structures for FREQUENCIES.
9696         
9697         * som.c: Removed vestiges of crushing and partial table support.
9698
9699 Sun Jul 14 15:45:31 1996  Ben Pfaff  <blp@gnu.org>
9700
9701         * Many more changes to som.c especially, but these will not be
9702         documented as I have resolved to remove them.  This patchlevel is
9703         being released solely so that I can fall back to it if I decide
9704         that removing the changes is not a good idea.
9705
9706 Sat Jul 13 09:58:44 1996  Ben Pfaff  <blp@gnu.org>
9707
9708         * som.c: (global var som) New member `cum_y'.
9709         (build_target) Properly handles titles for partial tables.
9710         (dump_partial_beg, dump_partial_mid, dump_partial_end)
9711         Merged into single new function dump_partial().  Fixed problem
9712         with titles on partial tables.
9713         (dump_table) Calls dump_partial() for all parts of partial tables.
9714         (dump_page) Criteria for drawing title changed.
9715         
9716 Fri Jul 12 22:03:36 1996  Ben Pfaff  <blp@gnu.org>
9717
9718         * command.c: (cmd_table) Added LIST, WEIGHT.
9719
9720         * command.c: (cmd_remark) No longer frees `s' since it's not
9721         dynamically allocated.
9722         
9723         * data-out.c: (convert_f) Now correctly handles the case where
9724         abs(v->f)<1 but v->f rounds to a value of 1.00 given the specified
9725         number of decimals.
9726         (som_destroy_all_tables) Removed argument.  All callers changed.
9727         (som_vline, som_hline) Argument validity checking corrected.
9728         (som_set_value) Implemented half-heartedly.
9729         (replicate_table) Copies tables piece-by-piece when using Checker.
9730
9731         * som.h: New line style SLIN_1THIN, currently equivalent to
9732         SLIN_0.  New enum set SOM_SUB_*.
9733         (struct som_submission_form) Removed `seq_no'.  Added `type'.
9734         
9735         * list.q: Newly working file; uses partial tables.
9736         
9737         * som.c: (som_reduce_table) Renamed som_set_table_height().
9738         (som_crush) Removed argument `group'.
9739         (global var som) Removed `nt', `seq_no'.  Added `type'.
9740         (som_submit_table) Arguments changed.
9741         (output_table) Removed partial table code.
9742         (build_target) New arg; partial table support added.  All callers
9743         changed.
9744         (dump_plain_table) Removed partial table code.
9745         (dump_partial_beg, dump_partial_mid, dump_partial_end) New functions.
9746         (dump_table) Supports partial tables.
9747         (dump_page) New argument to allow not drawing top and/or bottom
9748         headers.  All callers changed.  Supports partial tables.
9749
9750 Sat Jul  6 22:22:25 1996  Ben Pfaff  <blp@gnu.org>
9751
9752         * data-out.c: Changed `#include <approx.h>' to `#include
9753         "approx.h".
9754         (convert_F) Comment fix.  Now won't print `-.000', etc.
9755
9756         * descript.q: Now Z-scores work, although there appears to
9757         be a bug (which might actually be in data-out.c:convert_F()).
9758         (descriptives_trns_proc, descriptives_trns_free) New functions.
9759         (run_z_pass) Implemented.
9760         
9761         * var.h: Comment fixes.
9762         (dsc_z_score, descriptives_trns) New structs.
9763         (descriptives_trns) Added to any_trns as `dsc'.
9764
9765         * error.c, error.h: New error class, IS (Installation Script
9766         error), used in those instances where the error is in the
9767         installation, but there is a script file or installation file that
9768         can be usefully referred to.
9769         
9770         * output.c: Change many IE classes to IS classes.
9771
9772         * cases.c, command.c, common.c, crosstabs.q, expr-evl.c,
9773         frequencies.q, list.q, vars-prs.c, vfm.c: Removed reference to
9774         HAVE_MALLOC_H because Borland C++ alloca() is broken, so why
9775         include the corresponding header?
9776         
9777         * glob.c: (init_glob) Don't malloc term_buffer under Checker.
9778         Don't bail out if termcap can't be read.
9779
9780         * som.c: (som_destroy_table) Removed.
9781         (som_reduce_table, som_destroy_all_tables) New functions.
9782         (som_crush) New function, not implemented.
9783         
9784         * som.h: New table option STAB_CRUSH.  Comment fix.  New struct
9785         som_submission_form.  Function prototypes revised.
9786
9787         Outputting huge tables (1000s of rows) a few rows at a time
9788         is supported, though untested.  May even break everything.
9789         Actually, the code doesn't even compile right now.
9790         * som.c: (struct som) New fields htv, nt, seq_no.
9791         (som_submit_table) Multiple arguments changed to a single
9792         pointer to struct submission_form.  Only increments subtable_num
9793         if seq_no is zero.  Only destroys table if it's not going to
9794         be reused.
9795         (replicate_table) New function.
9796         (output_table) Comment fix.
9797         (examine_table) Changed inline code to code calling
9798         replicate_table().  Calculates htv.  Supports partial tables.
9799         (draw_title) Removed comment.
9800         (build_target) Only allows for title on first part of partial
9801         tables.
9802         (dump_plain_table) Only resets table chunk number on first part
9803         of partial tables; FIXME: doesn't work quite right.  Supports
9804         partial tables.
9805         (dump_page) Titles only on first part of partial tables.
9806
9807 Fri Jul  5 20:16:19 1996  Ben Pfaff  <blp@gnu.org>
9808
9809         * Thanks to an unreliable IDE hard drive, I have spent the last
9810         day reconstructing my Debian GNU/Linux installation and redoing
9811         the previous day's changes--somehow I managed to save every file
9812         except for output.c and output.h.  So the following changes could
9813         really be considered independent of the output.c, output.h changes
9814         from Jul 4.
9815
9816         * output.h, output.c: Moved the outp_configure_vec global var,
9817         outp_names struct, and enum set OUTP_S_* from output.h to output.c.
9818         outp_configure_vec is now static.
9819         
9820 Thu Jul  4 20:20:24 1996  Ben Pfaff  <blp@gnu.org>
9821
9822         * The entire philosophy behind configuration of the output drivers
9823         changed.  Now there is a termcap-type configuration where drivers
9824         to be read are determined beforehand, rather than parsing the
9825         entire output init file and storing it in memory & deciding what
9826         to actually use later.  Faster & more memory-efficient at the same
9827         time, cool.
9828         
9829         * output.c: Comment fix.  Removed outp_init_drivers global var.
9830         Removed all references to synonyms.  New structure outp_defn.  New
9831         global vars outp_macros, outp_configure_vec.
9832         (search_name, delete_name, add_name, check_configure_vec,
9833         expand_name, find_defn_value) New static functions.
9834         (outp_configure_clear, outp_configure_add, outp_configure_macro,
9835         outp_read_devices) New extern functions.
9836         (outp_init) Much functionality moved into outp_read_devices.
9837         (outp_read_devices) Format of output init file changed; name of
9838         file is `devices' rather than `output' to avoid Makefile
9839         conflicts.
9840         (outp_clear) Renamed outp_done.
9841         (outp_list_classes) Bug fix, cleaned up.
9842         (outp_list_drivers) Not implemented anymore.
9843         (outp_configure_driver) Now a static function; simplified; now
9844         interpolates macros; supports new structure.
9845         (outp_enable_driver, match_synonym) Removed; all references
9846         removed.
9847         (find_driver) First argument removed.
9848         
9849         * output.h: Global var outp_init_drivers removed; new structure
9850         outp_names; new enum set OUTP_S_*; new global var
9851         outp_configure_vec; function prototypes for output.c exports
9852         updated.
9853         
9854         * main.c: (main) Calls outp_read_devices() after parsing the
9855         command line.
9856         
9857         * cmdline.c: (parse_command_line) New option -v --verbose;
9858         --version changed to -V.  --device option changed syntax to just
9859         take a single device name.  Accepts key=value declaration of
9860         output init file macros.  Syntax message updated.
9861
9862         * filename.c: (expand_line) New function.
9863         (interp_environ_vars) Renamed interp_vars; no longer uses
9864         fixed-size buffer.
9865         (blp_getenv) Allows $ARCH and $VER pseudo-environment-vars to be
9866         overridden by real environment vars.
9867         (search_path) Uses verbose_msg() instead of #ifdef'd printf().
9868         * filename.h: interp_environ_vars() renamed interp_vars().
9869         
9870         * error.c, error.h: Added extern variable `verbosity', message
9871         class MM.
9872         
9873         * error.c: (vmsg) Support message class MM.
9874         (verbose_msg) New function.
9875
9876         * descript.q: (generate_z_varname) Bug fix in generation of
9877         Z-score varnames.
9878         (dump_z_table) Bug fix in column headers.
9879         
9880         * ascii.c: (ascii_init_driver) Changed minimum number of lines per
9881         page from 29 to 15.  Don't set a default for ops[OPS_INIT,
9882         OPS_DONE].  Writes the uninit string when the driver is closed.
9883         (ascii_open_page) Write the init string before the first page.
9884         (output_shorts) Form of main loop changed from `while' to `for'.
9885         Bug fix with overstrikes: the character is printed *after* the
9886         backspace.  Eliminated a lot of `& 0xff' modifiers.
9887         (advance_to_left_margin) New function.
9888         (return_carriage, output_lines) Handle left margin.
9889
9890 Thu Jul  4 00:35:59 1996  Ben Pfaff  <blp@gnu.org>
9891
9892         * ascii.c: New option `carriage-return-style'.
9893
9894         * ascii.c: (count_fancy_chars) New function.
9895         (delineate, text_metrics) Use new function; bug fixes regarding
9896         rich text strings.
9897         (text_draw) Bug fix with rich text.
9898         (output_string, output_shorts) Reordered.
9899         (output_shorts) Now handles boxchars and some overstrike font
9900         changes.
9901         (output_char, return_carriage) New functions.
9902         (output_lines) Now handles overstriking and font changes properly;
9903         some code moved to output_shorts.
9904
9905 Tue Jul  2 22:13:23 1996  Ben Pfaff  <blp@gnu.org>
9906
9907         [GLOBAL_DEBUGGING]
9908         * ascii.c: New member `debug' in ascii_driver_ext.
9909         (ascii_init_driver, delineate) Uses new member.
9910
9911         Now you can set a vertical height on writing text.
9912         * ascii.c: (delineate) Keeps track of vertical position.
9913         (text_draw) No longer considers fully justified text an internal
9914         error.
9915         
9916         * output.h: New flag OUTP_T_VERT; other OUTP_T_ values changed.
9917
9918         Tables' titles are drawn; they can have variable height.
9919         * som.c: `som' struct has new member, title_height.
9920         (draw_title) New argument.  Moved within file.  All caller
9921         changed.
9922         (build_target) New argument, amount of space needed for first row.
9923         Calculates height of title, takes that into account.  All callers
9924         changed.
9925         (dump_plain_table, dump_columnated_table) Took calculation of y1,
9926         y2 out of loop.
9927         (dump_columnated_table) [GLOBAL_DEBUGGING] Debugging code
9928         improved.
9929         (dump_columnated_table) Organized for readability.
9930         (dump_page) Makes use of som.title_height.
9931
9932         * som.c: Many comment bug fixes.
9933
9934         * descript.q: (try_name, generate_z_name) Bug fix regarding
9935         generation of Z-score variable names.
9936         * var.h: Removed num from descriptives_proc; all referents removed.
9937
9938 Mon Jul  1 22:13:39 1996  Ben Pfaff  <blp@gnu.org>
9939
9940         * ascii.c: (ascii_line_horz, ascii_line_vert,
9941         ascii_line_intersection) Added debugging code.
9942
9943         Added a descriptive line above each table to describe it.
9944         * command.c: (parse_cmd) Calls som_new_series.
9945         
9946         * som.c: New static vars table_num, subtable_num.  New `som'
9947         member `title'.
9948         (dump_page) New arguments.
9949         (som_submit_table) Handle new variables.
9950         
9951         * som.c, som.h: (som_submit_table) New arguments.  All callers
9952         changed.
9953         (som_new_series) New function.
9954         (build_target) Makes room for extra line.
9955         (draw_title) New function.
9956         (dump_page) Calls draw_title.  Bug fix: doesn't always set
9957         som.ext->cp to 0.
9958         
9959         Columnation of tables support.
9960         * som.h: Deleted fr, lr, ri from som_table.  Reorganized.
9961         
9962         * som.c: Deleted references to fr, lr, ri.
9963         (som_columnate) Bux fix: sets group member of table.
9964         (som_add_options) Function removed.
9965         (dump_table) Split into three functions; extensively reworked.
9966         
9967         * descript.q: (dump_z_table) Better output table formatting; added
9968         title support to correspond to som.h changes.
9969         (display) Title support.
9970
9971         * output.h: Added OUTP_T_NONE.
9972         
9973 Mon Jul  1 13:00:00 1996  Ben Pfaff  <blp@gnu.org>
9974
9975         * descript.q: Improved handling of Z scores; still not perfect.
9976         
9977         * output.h, ascii.c: Added hook for getting em width of current
9978         font.
9979         
9980         * som.c: Uses new em-width hook.  Added debugging code to
9981         several functions.
9982         (som_columnate) New argument.
9983         (som_add_options) Removed.
9984
9985 Jun 29 17:40:47 1996  Ben Pfaff  <blp@gnu.org>
9986
9987         * som.h, som.c, output.c, output.h, ascii.c: Updated to work with
9988         rules as a property of the table instead of as a property of the
9989         cells.
9990         
9991         * ascii.c: Added `header' to table of options.
9992         
9993         * descript.q: Added even shorter statistic names; modified to work
9994         with new som interface.
9995         
9996         * misc.c (blp_getdelim): Bug fix.
9997         
9998         * version.c: includes 'conf.h'.
9999         
10000 ----------------------------------------------------------------------
10001 Local Variables:
10002 mode: change-log
10003 version-control: never
10004 End: