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