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