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