Partial fix for PR 12859.
[pspp-builds.git] / src / ChangeLog
1 Mon May  2 23:45:01 2005  Ben Pfaff  <blp@gnu.org>
2
3         Code improvements.
4         
5         * data-list.c:  (parse_fixed) Use lex_end_of_command().
6         (parse_free) Ditto.
7         (cmd_repeating_data) Set cont_end.num in right situations.
8         (parse_repeating_data) Remove redundant test.
9
10 Mon May  2 23:37:19 2005  Ben Pfaff  <blp@gnu.org>
11
12         Partial fix for PR 12859.
13         
14         * data-list.c: (cmd_data_list) Add transformation properly in
15         vfm_source == NULL case.
16
17 Mon May  2 23:27:28 2005  Ben Pfaff  <blp@gnu.org>
18
19         * lexer.c: (lex_error) Improve error messages.
20
21 Mon May  2 22:28:17 2005  Ben Pfaff  <blp@gnu.org>
22
23         * get.c: (cmd_match_files) Check token type before trying to match
24         tokid.  Fixes PR 12923.
25
26 Mon May  2 22:16:51 2005  Ben Pfaff  <blp@gnu.org>
27
28         * flip.c: [HAVE_SYS_TYPES_H] Include <sys/types.h>.  Fixes PR
29         12789.
30
31 Mon May  2 22:02:52 2005  Ben Pfaff  <blp@gnu.org>
32
33         * expressions/generate.pl: (get_token) Make use of /g
34         backward-compatible with Perl 5.6.1.
35
36 Sun May  1 23:00:19 2005  Ben Pfaff  <blp@gnu.org>
37
38         * var-display.c: (cmd_variable_alignment) Fix memory leak.
39         (cmd_variable_level) Ditto.
40
41 Sun May  1 22:49:04 2005  Ben Pfaff  <blp@gnu.org>
42
43         Hash table had buggy deletion function.  The fix required changing
44         other functions to do probing in the required order.
45
46         * hash.c: (locate_matching_entry) Rewrite and change interface.
47         (hsh_rehash) Rewrite to use locate_matching_entry().
48         (hsh_probe) Ditto.
49         (hsh_find) Ditto.
50         (hsh_delete) Ditto.  Also, fix stupid bugs.
51
52 Sun May  1 22:24:58 2005  Ben Pfaff  <blp@gnu.org>
53
54         * dictionary.c: (dict_clone) Properly copy vectors.
55
56 Sun May  1 22:07:58 2005  Ben Pfaff  <blp@gnu.org>
57
58         New implementation of long variable names.  Each variable has a
59         "normal" name, which may be up to 64 bytes long and which is used
60         for all normal operations.  Variables may have a "short" name,
61         which is limited to 8 bytes and used only for system and portable
62         file input and output.
63         
64         Make tokid case-preserving.  Update most uses of tokid to treat it
65         case-insensitively.
66
67         Update many commands to deal with long variable names.
68
69         * autorecode.c: (cmd_autorecode) Use strcasecmp() instead of strcmp().
70
71         * command.c: (cmd_parse) Ditto.
72         (match_strings) Use toupper() before comparing characters.
73         (conflicting_3char_prefixes) Use mm_case_compare() instead of
74         memcmp().
75         (cmd_match_words) Ditto.
76
77         * compute.c: (lvalue_parse) Use st_trim_copy() instead of
78         strncpy().
79
80         * count.c: (struct cnt_var_info) Change n[] to fit long var name.
81         Use st_trim_copy() instead of strcpy().
82
83         * data-in.c: (parse_enum) Use mm_case_compare() instead of
84         memcmp().
85
86         * data-list.c: (struct dls_var_spec) Change name[] to fit long var
87         name.
88         (parse_free) Use st_trim_copy() instead of strcpy().
89
90         * descript.c: (struct dsc_var) Change z_name[] to fit long var
91         name.
92         (try_name) Use strcasecmp() instead of strcmp().
93         (generate_z_varname) Use st_trim_copy() instead of strcpy().
94         (descriptives_compare_dsc_vars) Use strcasecmp() instead of
95         strcmp().
96
97         * dictionary.c: (struct dictionary) Removed `long_name_tab'
98         member.
99         (compare_long_names) Removed.
100         (hash_long_name) Removed.
101         (dict_create) Don't initialize `long_name_tab' member.
102         (dict_clone) Copy short names into new dictionary. 
103         (dict_clear) Don't clear `long_name_tab' member.
104         (dict_get_varname_block) Removed.
105         (dict_add_longvar_entry) Removed.
106         (free_nte) Removed.
107         (dict_destroy) Don't destroy `long_name_tab' member.
108         (dict_create_var_from_short) Removed.
109         (dict_create_var_x) Removed.
110         (dict_create_var) Get rid of longname handling.
111         Clear short name.
112         (dict_clone_var) Get rid of longname parameter and longname
113         handling.
114         (dict_lookup_var) Get rid of longname handling.
115         (dict_reorder_var) New function.
116         (dict_rename_var) Clear short name.
117         (dict_rename_vars) Get rid of longname handling.  Clear short
118         names.
119         (dict_create_vector) Support long vector names.
120         (dict_lookup_vector) Use strcasecmp() instead of strcmp().
121         (quasi_base27) Removed.
122         (make_short_name) Removed.
123         (compare_strings) New function.
124         (hash_string) New function.
125         (dict_assign_short_names) New function.
126
127         * file-handle.q: (get_handle_with_name) Use strcasecmp() instead
128         of strcmp().
129         (get_handle_for_filename) Support long handle names.
130
131         * file-type.c: (struct col_spec) Make `name' fit long var names.
132         (cmd_file_type) Use strcasecmp() instead of strcmp().
133
134         * flip.c: (make_new_var) Rewrite.
135         (flip_sink_write) Use st_trim_copy() instead of strncpy().
136
137         * format.c: (parse_format_specifier_name) Use mm_case_compare()
138         instead of memcmp().
139
140         * get.c: (cmd_save_internal) Rephrase.
141         (rename_variables) Drop test for identical variable name.
142         (struct mtf_proc) Change `first', `last' to fit long var name.
143
144         * hash.c: (hsh_hash_case_string) New function for case-insensitive
145         string hashing.
146
147         * lexer.c: (restore_token) Use st_trim_copy() instead of
148         strncpy().
149         (lex_get) Don't uppercase string when copying into tokid.
150         (lex_put_back_id) Use st_trim_copy() instead of
151         strncpy().
152
153         * list.q: (determine_layout) Consider length of variable names in
154         choosing vertical layout.
155
156         * matrix-data.c: (cmd_matrix_data) Use strcasecmp() instead of
157         strcmp().
158         (string_to_content_type) Ditto.
159
160         * modify-vars.c: (compare_variables_given_ordering) Ditto.
161         (struct var_renaming) Change `new_name' to fit long var name.
162         (compare_var_renaming_by_new_name) Use strcasecmp() instead of
163         strcmp().
164
165         * pfm-read.c: (read_variables) Disallow system variables in system
166         files.
167         (write_variables) Call dict_assign_short_names() and use
168         short_name[] members.
169
170         * repeat.c: (internal_cmd_do_repeat) Use strcasecmp() instead of
171         strcmp().
172
173         * sfm-read.c: (sfm_open_reader) Rewrite code for long variable
174         map.  Reorder variables into same order as long variable map.
175         (read_variables) Set short name.
176
177         * sfm-write.c: (sfm_open_writer) Call dict_assign_short_names().
178         (write_variable) Use st_bare_pad_copy().
179         (write_longvar_table) Rewrite.
180
181         * str.c: (mm_case_compare) New function.
182
183         * sysfile-info.c: (compare_vectors_by_name) Use strcasecmp()
184         instead of strcmp().
185
186         * t-test.q: (tts_custom_groups) Remove redundant test.
187         (tts_custom_pairs) Ditto.
188
189         * var.h: (struct variable) Change `name' to fit long var names.
190         Remove `longname'.  Add `short_name' member.  Reorder some
191         variables.
192         (struct name_table_entry) Removed.
193         (struct vector) Change `name' to fit long vector names.
194
195         * vars-atr.c: (var_is_valid_name) Allow long var names.
196         (compare_var_names) Use strcasecmp() instead of strcmp().
197         (compare_var_ptr_names) Ditto.
198         (hash_var_name) Use hsh_hash_case_string().
199         (hash_var_ptr_name) Ditto.
200         (var_set_short_name) New function.
201         (var_clear_short_name) New function.
202         (var_set_short_name_suffix) New function.
203
204         * vars-prs.c: (parse_DATA_LIST_vars) Support long names.
205         Use strcasecmp() instead of strcmp().
206         (struct array_var_set) Removed `longname_tab'.
207         (array_var_set_lookup_var_idx) Drop longname_tab support.
208         (array_var_set_destroy) Don't destroy `longname_tab'.
209         (var_set_create_from_array) Don't create `longname_tab'.
210
211         * vector.c: (cmd_vector) Use strcasecmp() instead of strcmp().
212         Support long names.
213
214         * expressions/parse.c: (word_matches) Use mm_case_compare()
215         instead of memcmp().
216         (compare_strings) New function.
217         (lookup_function) Use compare_strings() instead of strcmp().
218         
219 Sun May  1 22:07:43 2005  Ben Pfaff  <blp@gnu.org>
220
221         * algorithm.c: (move_element) New function.
222
223 Sun May  1 22:05:35 2005  Ben Pfaff  <blp@gnu.org>
224
225         * aggregate.c: (parse_aggregate_functions) Always initialize
226         destvar.
227
228 Sun May  1 22:03:47 2005  Ben Pfaff  <blp@gnu.org>
229
230         * aggregate.c: (cmd_aggregate) Use dict_clone_var_assert().
231
232         * dictionary.c: (dict_clone) Ditto.
233         (dict_clone_var_assert) New function.
234
235         * get.c: (mtf_merge_dictionary) Use dict_clone_var_assert().
236
237 Sun May  1 15:05:54 WST 2005 John Darrington <john@darrington.wattle.id.au>
238
239         * error.c: Added a string for the compiler version to the
240         request_bug_report_and_abort function.
241
242         * groff_font.c, font.c: Removed manpage(1) style references from 
243         comments, because RMS frowns upon them.
244
245 Thu Apr 28 18:52:06 2005  Ben Pfaff  <blp@gnu.org>
246
247         * expressions/parse.c: Improve previous fix for PR 12858 (LAG).
248
249 Fri Apr 29 09:28:00 WST 2005 John Darrington <john@darrington.wattle.id.au>
250
251         * expressions/parse.c: Added handler for OP_LAG_Vn and OP_LAG_Vs.  
252         Fixed bug [#12858] .
253
254 Wed Apr 27 12:42:34 WST 2005 John Darrington <john@darrington.wattle.id.au>
255
256         * loop.c recode.c repeat.c: Fixed a couple of instances of SHORT_NAME_LEN 
257         which should be LONG_NAME_LEN
258
259 Wed Apr 27 07:43:50 WST 2005 John Darrington <john@darrington.wattle.id.au>
260
261         * command.def echo.c:  Added the ECHO command.
262
263 Mon Apr 25 22:55:59 2005  Ben Pfaff  <blp@gnu.org>
264
265         Finish fixing MATCH FILES (PR 11677).
266
267         * get.c: (trim_dictionary) Rewrite in terms of drop_variables(),
268         keep_variables(), rename_variables().
269         (drop_variables) New function.
270         (keep_variables) New function.
271         (struct mtf_file) Rename `in' to `in_name'.  Add `in_var'.
272         (cmd_match_files) Deal with in_var.  Use drop_variables(),
273         keep_variables().  When IN is specified, require BY.  Set master
274         variables after master dictionary is complete.  Add IN variables
275         after master dictionary is complete.
276         (mtf_free_file) Free `in_name'.
277         (mtf_delete_file_in_place) Set in_var value to 0.
278         (mtf_read_nonactive_records)  Rephrase.
279         (mtf_processing) Support IN.  Rephrase.  Fix bugs.
280         (mtf_merge_dictionary) Don't set master variables; we do that
281         later now.
282         (get_master) Don't insist that there's a master variable.
283         
284 Mon Apr 25 22:55:22 2005  Ben Pfaff  <blp@gnu.org>
285
286         Kluge to make some variable renaming sort of work.
287         Needs real fix.
288
289         * dictionary.c: (dict_rename_var) Call dict_add_longvar_entry().
290
291 Mon Apr 25 22:52:28 2005  Ben Pfaff  <blp@gnu.org>
292
293         Add functions for comparing sets of variables between cases.
294         Use the functions.
295
296         * case.c: (case_compare) New function.
297         (case_compare_2dict) New function.
298         
299         * aggregate.c: (struct agr_proc) Remove `prev_break' member.  Add
300         `break_case'.
301         (cmd_aggregate) Nullify break_case.  Don't call
302         initialize_aggregate_info().
303         (agr_destroy) Destroy break_case.
304         (aggregate_single_case) Rewrite.  Use case_compare().
305         (dump_aggregate_info) Copy from break_case into output.
306         (initialize_aggregate_info) Copy break_case from input.
307
308         * get.c: (mtf_compare_BY_values) Use case_compare_2dict().
309
310         * vfm.c: (equal_splits) Use case_compare().
311
312 Sat Apr 23 17:01:04 WST 2005 John Darrington <john@darrington.wattle.id.au>
313
314         * dictionary.c vars-prs.c sfm-write.c: Fixed some memory leaks
315
316 Sun Apr 17 23:08:15 2005  Ben Pfaff  <blp@gnu.org>
317
318         Start work on fixing MATCH FILES.
319
320         * get.c: (enum operation) Remove OP_MATCH.
321         (trim_dictionary) Change return value to bool.  Don't support
322         OP_MATCH.
323         (struct mtf_file) Remove `first', `last' members.
324         (struct mtf_proc) Add `first', `last' members.  Change mtf_case
325         from `struct ccase *' to `struct ccase'.  Remove `by' member.
326         (cmd_match_files) Essentially rewrite.
327         (mtf_free) Don't free `by' member.  Destroy `mtf_case' member.
328         (mtf_read_nonactive_records) mtf_ parameter is not unused.
329         (mtf_processing) Ditto.  Also rephrase some code.
330         (mtf_merge_dictionary) Rewrite for easy comprehension.  
331
332 Sun Apr 17 23:06:00 2005  Ben Pfaff  <blp@gnu.org>
333
334         * matrix-data.c: (wr_output_data) [DEBUGGING] Fix compilation
335         error.
336
337         * q2c.c: (dump_token) [DEBUGGING] Fix compilation error.
338         
339 Thu Apr 14 2005 John Darrington
340
341         * var-display.c: New file.
342
343         * format.h var.h sfm-read.c sfm-write.c dictionary.c :  Added 
344           display_width, measure and alignment parameters to variables.
345
346         * aggregate.c command.def compute.c count.c data-list.c descript.c
347           dictionary.c dictionary.h expr-prs.c file-type.c flip.c get.c 
348           lexer.c lexer.h loop.c modify-vars.c pfm-read.c recode.c repeat.c 
349           sfm-read.c sfm-write.c sfm-write.h sfmP.h val-labs.c val.h var.h 
350           vars-prs.c vector.c :  
351               - Replaced literal constants representing maximum variable name 
352                 length with macro definitions. 
353               - Added support for long variable names.
354               - Changed lexer such that it no longer makes tokens upper
355                 case, but relies upon case insensitive behaviour of commands.
356
357 Mon Apr  4 22:27:34 2005  Ben Pfaff  <blp@gnu.org>
358
359         * aggregate.c: (parse_aggregate_functions) If dict_create_var()
360         fails, don't dereference the resulting null pointer (PR 12427).
361         Also, fix double free error.
362
363 Sat Mar 19 23:06:02 2005  Ben Pfaff  <blp@gnu.org>
364
365         * aggregate.c: (parse_aggregate_functions) Fix N_NO_VARS format.
366         (accumulate_aggregate_info) Set int1 to 1 for SUM.
367         (dump_aggregate_info) Only make SUM non-missing if there was at
368         least one variate.
369
370 Sat Mar 19 14:48:19 2005  Ben Pfaff  <blp@gnu.org>
371
372         * aggregate.c: (dump_aggregate_info) Properly test whether the
373         destination variable is numeric, when making the result
374         system-missing for columnwise missing values.
375
376 Mon Mar 14 21:52:34 2005  Ben Pfaff  <blp@gnu.org>
377
378         * misc.h: Remove GCC specializations.
379
380 Mon Mar 14 21:07:23 2005  Ben Pfaff  <blp@gnu.org>
381
382         Make sort stable (PR 12313).
383         
384         * sort.c: Don't need to include some headers anymore.
385         (static var min_buffers) New variable.
386         (static var max_buffers) New variable.
387         (static var allow_internal_sort) New variable.
388         (cmd_sort_cases) Add test mode.
389         (sort_execute) Rephrase.
390         (do_internal_sort) Don't try internal sorting if
391         allow_internal_sort is set.
392         (struct external_sort) Renamed `initial_runs' to `runs' and
393         updated all references.
394         (macro MIN_BUFFER_TOTAL_SIZE_RECS) Removed.
395         (macro MIN_BUFFER_SIZE_BYTES) Removed.
396         (macro MIN_BUFFER_SIZE_RECS) Removed.
397         (compare_initial_runs) Removed.
398         (struct record_run) Add member `idx'.
399         (write_initial_runs) Pass increasing values to process_case() as
400         index.
401         (process_case) Add `idx' parameter and use it to initialize new
402         `idx' member.
403         (allocate_cases) Limit allocated buffers to max_buffers.
404         (compare_record_run) Use new `idx' member for last resort
405         comparison, for stability.
406         (end_run) Call casefile_sleep() on irs->casefile, to prevent
407         running out of file descriptors.
408         (struct merge_state) Removed.
409         (merge) Don't need to allocate cases.  Always use MAX_MERGE_ORDER
410         unless we have fewer runs left.  Always merge consecutive runs,
411         for stability.  Return the final run.
412         (mod) Removed.
413         (choose_merge) New function.
414         (merge_once) Rewritten.
415
416 Mon Mar 14 21:05:42 2005  Ben Pfaff  <blp@gnu.org>
417
418         * cmdline.c: (static var testing_mode) Move into
419         parse_command_line().
420         
421 Mon Mar 14 21:05:13 2005  Ben Pfaff  <blp@gnu.org>
422
423         * algorithm.c: (remove_range) New function.
424         (remove_element) New function.
425
426         * dictionary.c: (dict_delete_var) Use remove_element().
427
428         * flip.c: (cmd_flip) Ditto.
429
430 Sun Mar 13 22:52:05 2005  Ben Pfaff  <blp@gnu.org>
431
432         * file-handle.q: (struct file_handle) `open_mode' should not be
433         const.
434         
435 Sun Mar 13 22:40:54 2005  Ben Pfaff  <blp@gnu.org>
436
437         First phase of making SORT CASES stable (PR 12313).
438
439         * sort.c: (struct indexed_case) New structure.
440         (do_internal_sort) Rewrite to make internal sorting stable.
441         (compare_case_dblptrs) Removed.
442         (compare_indexed_cases) New function.
443
444 Sun Mar 13 22:38:40 2005  Ben Pfaff  <blp@gnu.org>
445
446         Clean-ups.
447
448         * casefile.c: (casereader_read_xfer_assert) New function.
449
450         * dictionary.c: (dict_compact_case) New function.
451
452         * flip.c: (struct flip_pgm) New member idx_to_fv.
453         (cmd_flip) Initialize idx_to_fv member.
454         (destroy_flip_pgm) Free idx_to_fv member.
455         (flip_sink_write) Use struct flip_pgm member instead of case_sink
456         member.
457         (flip_sink_write) Ditto.
458
459         * vfm.c: (write_case) Use dict_compact_case() instead of
460         compact_case().
461         (compact_case) Removed.
462         (storage_source_create) Removed `dict' parameter.  All references
463         updated.
464
465         * vfm.h: (struct case_source) Removed `value_cnt' member.  All
466         references removed.
467         (struct case_sink) Removed `dict', `idx_to_fv' members.  All
468         references removed.
469
470 Sun Mar 13 22:35:55 2005  Ben Pfaff  <blp@gnu.org>
471
472         More AGGREGATE fixes.
473
474         * aggregate.c: (accumulate_aggregate_info) Implement NMISS and
475         NUMISS for strings.  Fix FOUT, POUT, FGT, FLT, FIN, FOUT for
476         strings.
477         (initialize_aggregate_info) Fix initialization for MIN, MAX for
478         strings.
479
480 Sat Mar 12 23:26:21 2005  Ben Pfaff  <blp@gnu.org>
481
482         Start work on testing and debugging AGGREGATE.
483
484         * aggregate.c: (cmd_aggregate) Use discrete bool variables instead
485         of a bit-map.  Require proper subcommand ordering.  Make OUTFILE
486         subcommand mandatory.
487         (parse_aggregate_functions) Check that PIN, POUT, FIN, FOUT
488         functions' arguments are in the correct order and swap them if
489         not.
490         (accumulate_aggregate_info) Make SUM include weights.  Add various
491         string functions.
492         (dump_aggregate_info) Add various string functions.
493         (initialize_aggregate_info) Initialize int1 for MIN, MAX.
494
495         * sort.c: (sort_parse_criteria) Add parameter for returning
496         whether any directions were specified.  All callers updated.
497
498 Sun Mar 13 14:54:27 WST 2005 John Darrington <john@darrington.wattle.id.au>
499
500         * t-test.q: Fixed erroneous logic in compare_group_binary.
501
502 Sat Mar 12 13:29:21 2005  Ben Pfaff  <blp@gnu.org>
503
504         * split-file.c: (cmd_split_file) Ignore LAYERED and SEPARATE
505         keywords (PR 11628).
506
507 Sat Mar 12 13:17:12 2005  Ben Pfaff  <blp@gnu.org>
508
509         * vfm.c: (procedure_with_splits) Fix PR 11492: end_func() must be
510         called *before* close_active_file().
511
512 Sat Mar 12 12:20:57 2005  Ben Pfaff  <blp@gnu.org>
513
514         * file-handle.q: (struct file_handle) Change open_mode from
515         character pointer to 3-char array, for safety.  Updated all
516         references.
517
518 Sat Mar 12 12:15:49 2005  Ben Pfaff  <blp@gnu.org>
519
520         Thanks to Ben Kujala <bkujala@oregonchildcare.org> for reporting
521         these bugs.
522         
523         * pfm-read.c: (read_header) Improve error message for many cases
524         in which the input is not actually a portable file.
525
526         * file-handle.q: (fh_open) When we give an error message, actually
527         return NULL.
528
529 Fri Mar 11 11:50:30 2005  Ben Pfaff  <blp@gnu.org>
530
531         * format.c: (check_common_specifier) New function for checks
532         common to check_input_specifier() and check_output_specifier().
533         (check_input_specifier) Use check_common_specifier().
534         (check_output_specifier) Use check_common_specifier().
535         (check_string_specifier) Removed.
536         (check_specifier_type) New function.
537         (check_specifier_width) New function.
538         (get_format_var_width) Fix bug.
539
540         * formats.c: (internal_cmd_formats) Only accept numeric variables.
541
542         * lexer.c: (check_id) Rename lex_id_to_token(), make public,
543         update all references.  Make case-insensitive.
544
545         * pfm-read.c: Essentially rewrite the whole file.  Now much
546         cleaner.
547
548         * print.c: (check_string_width) New function.
549         (fixed_parse_compatible) Use check_string_width(),
550         check_specifier_type().
551         (dump_fmt_list) Ditto.
552
553         * str.c: (st_trim_copy) New function.
554         (st_uppercase) New function.
555
556         * vars-atr.c: (var_is_valid_name) New function.
557         
558         * expressions/parse.c: (type_coercion_core) Use
559         check_specifier_type().
560         
561 Fri Mar 11 11:31:24 2005  Ben Pfaff  <blp@gnu.org>
562
563         * expressions/evaluate.c: (cmd_debug_evaluate) Fix memory leaks.
564
565         * expressions/parse.c: (no_match) Ditto.
566
567 Wed Mar  9 09:54:27 2005  Ben Pfaff  <blp@gnu.org>
568
569         * Makefile.am: (pspp_LDADD) Add libgsl-extras.a.
570
571         * expressions/helpers.c: (struct func_params) Removed.
572         (generalized_idf) Removed.
573         (cdf_beta) Removed.
574         (idf_beta) Removed.
575         (idf_fdist) Use gslextras_cdf_beta_Pinv() instead of idf_beta().
576
577         * expressions/operations.def: Implement IDF.BETA, CDF.BINOM,
578         CDF.GEOM, CDF.HYPER, CDF.NEGBIN, CDF.POISSON using gsl-extras.
579         Implement SIG.F, which I had overlooked previously.
580
581 Tue Mar  8 12:47:53 WST 2005 John Darrington <john@darrington.wattle.id.au>
582
583         * command.c command.def glob.[ch] cmdline.c: Made DEBUG cmds
584         available only in testing mode.
585
586 Sun Mar  6 23:25:40 2005  Ben Pfaff  <blp@gnu.org>
587
588         * data-in.c: Use `bool' throughout, where relevant.
589
590 Sun Mar  6 19:52:22 2005  Ben Pfaff  <blp@gnu.org>
591
592         DATA LIST with free-field formats should not have implied decimal
593         places (PR 12035).  Also clean up data-in.c a bit.
594
595         * data-in.h: (enum) Add DI_IMPLIED_DECIMALS.
596
597         * data-in.c: (apply_implied_decimals) New function.
598         (parse_numeric) Don't adjust exponent if DI_IMPLIED_DECIMALS not
599         set.  Also, get rid of gotos.
600         (parse_Z) Use apply_implied_decimals() if the field doesn't
601         contain a decimal point.
602         (parse_N) Use apply_implied_decimals().
603         (parse_IB) Ditto.
604         (parse_PIB) Ditto.
605         (parse_P) Ditto.
606         (parse_PK) Ditto.
607         (to_roman) Removed.
608         (parse_enum) New function.
609         (macro CHAR_IS_ROMAN) Removed.
610         (macro ROMAN_VALUE) Removed.
611         (parse_month) Use parse_enum().
612         (parse_weekday) Use parse_enum().
613         (parse_DATETIME) Use long for weekday.
614
615         * data-list.c: (read_from_data_list_fixed) Use
616         DI_IMPLIED_DECIMALS.
617
618 Sun Mar  6 17:07:20 2005  Ben Pfaff  <blp@gnu.org>
619
620         When the lexer sees something like `-5' in the input, it has to
621         decide whether it's a negative numeric constant token or a '-'
622         token followed by a positive numeric constant token.  It always
623         decides on the former, and then the parser can call
624         lex_negative_to_dash() if it wants the latter.  However, this
625         doesn't work for the case of `-0', because negative zero is
626         (portably) indistinguishable from positive zero.  So now we divide
627         T_NUM into two tokens, T_POS_NUM and T_NEG_NUM, to make the
628         distinction clear.  This requires a little bit of extra effort,
629         because there were several references to T_NUM in the code base.
630         
631         * lexer.c: (lex_get) Use T_NEG_NUM and T_POS_NUM to distinguish
632         positive and negative numeric constants.
633         (lex_double_p) Renamed lex_is_number().  Changed return type to
634         bool.  Updated all relevant references to T_NUM to instead use
635         this function.
636         (lex_double) Renamed lex_number().  All references updated.
637         (lex_integer_p) Renamed lex_is_integer().  Changed return type to
638         bool.  All references updated.
639         (lex_token_representation) Understand T_NEG_NUM and T_POS_NUM.
640         (lex_negative_to_dash) Ditto.
641         (dump_token) Ditto.
642         
643         * lexer.h: (enum) Add T_POS_NUM, T_NEG_NUM.  Remove T_NUM.
644
645 Sun Mar  6 22:09:20 2005  Ben Pfaff  <blp@gnu.org>
646
647         * expressions/operations.def: (NUMBER) Use DI_IMPLIED_DECIMALS.
648
649 Sun Mar  6 19:33:24 2005  Ben Pfaff  <blp@gnu.org>
650
651         * expressions/operations.def: (VEC_ELEM_NUM) Treat user-missing
652         values as system-missing.
653
654         * expressions/parse.c: (parse_vector_element) Fix order of
655         arguments in call to expr_allocate_binary().
656
657 Sun Mar  6 17:51:05 2005  Ben Pfaff  <blp@gnu.org>
658
659         * expressions/optimize.c: (optimize_tree) Fix optimization bug for
660         x**2.
661
662         * expressions/parse.c: (type_coercion_core) Set *node to NULL on
663         failure, as indicated by function comment.
664         (parse_binary_operators) Always return NULL on type_coercion()
665         failure.  Should have been doing this anyway, but bug in
666         type_coercion_core() filtered through.
667         (parse_add) Fix typo in user message.
668         (parse_primary) Understand T_NEG_NUM and T_POS_NUM.
669
670 Sun Mar  6 10:47:13 2005  Ben Pfaff  <blp@gnu.org>
671
672         * expressions/operations.def: Add VALUE function.
673
674         * expressions/parse.c: (parse_function) Need an unary composite
675         node for variables in A TO B, not a variable node.  Use
676         allocate_unary_variable().
677         (parse_primary) Use allocate_unary_variable().
678         (allocate_unary_variable) New function.
679
680 Thu Mar  3 23:53:32 2005  Ben Pfaff  <blp@gnu.org>
681
682         * expressions/PSPP_expressions.pm: Renamed it back to generate.pl
683         but fixed the real problem that was preventing the build from a
684         separate directory.  I liked it my way better ;-)
685         
686 Thu Mar  3 23:17:51 2005  Ben Pfaff  <blp@gnu.org>
687
688         * expressions/parse.c: (expr_parse) Fix parameter type.  Thanks to
689         John Darrington <john@darrington.wattle.id.au> for reporting this
690         bug.
691
692 Thu Mar  3 22:10:25 WST 2005 John Darrington <john@darrington.wattle.id.au>
693
694         * expressions/Makefile.am expressions/evaluate.h.pl
695           expressions/evaluate.inc.pl expressions/operations.h.pl
696           expressions/optimize.inc.pl expressions/parse.inc.p:
697
698           Renamed generate.pl to PSPP_expressions.pm and adjusted *.pl
699           to suit. 
700
701           Fixed everything so that it can be built from an arbitrary
702           directory.
703         
704 Thu Mar  3 22:08:35 WST 2005 John Darrington <john@darrington.wattle.id.au>
705
706         * Makefile.am : Fixed up CLEANFILES target.
707
708 Mon Feb 28 23:49:56 2005  Ben Pfaff  <blp@gnu.org>
709
710         * str.h: Changed `struct len_string' to `struct fixed_string', a
711         more accurate name.  Updated all references.
712
713 Mon Feb 28 23:35:30 2005  Ben Pfaff  <blp@gnu.org>
714
715         Redo calendar support.  Should now be bug-for-bug compatible.
716         
717         * calendar.c: New file.
718
719         * calendar.h: New file.
720
721         * data-in.c: Use new calendar functions.
722         (parse_sign) Change sense of return value.
723         (calendar_error) New function.
724         (ymd_to_ofs) New function.
725         (ymd_to_date) New function.
726         (parse_DATE) Use new function.
727         (parse_ADATE) Ditto.
728         (parse_EDATE) Ditto.
729         (parse_SDATE) Ditto.
730         (parse_JDATE) Ditto.
731         (parse_QYR) Ditto.
732         (parse_MOYR) Ditto.
733         (parse_WKYR) Ditto.
734         (parse_TIME) Ditto.
735         (parse_DTIME) Ditto.
736         (parse_DATETIME) Ditto.
737
738         * data-out.c: (convert_date) Use new calendar functions.
739
740         * error.c: (err_vmsg) Changed interface to be more sensible.
741         Updated all callers.
742         (dump_message) Don't double new-lines (why did we do this
743         anyway?).
744
745 Mon Feb 28 23:30:25 2005  Ben Pfaff  <blp@gnu.org>
746
747         * sfmP.h: (macro flt64) Moved here from pref.h.orig.
748         (macro FLT64_MAX) Moved here from pref.h.orig.
749
750 Mon Feb 28 23:28:01 2005  Ben Pfaff  <blp@gnu.org>
751
752         * set.q: Support SET EPOCH.
753         (static var set_epoch) New var.
754         (aux_stc_custom_epoch) New function.
755         (stc_custom_epoch) New function.
756         (get_epoch) New function.
757         (stc_custom_pager) [USE_INTERNAL_PAGER] Fix bug.
758
759         * format.c: Make it possible just to check whether a specifier is
760         valid without emitting an error message.
761         (parse_format_specifier_name) Change interface, update all
762         callers.
763         (check_input_specifier) Ditto.
764         (check_output_specifier) Ditto.
765         (parse_format_specifier) Ditto.
766
767 Mon Feb 28 23:24:08 2005  Ben Pfaff  <blp@gnu.org>
768
769         * command.def: Add DEBUG POOL.
770
771         * pool.c: (pool_destroy) Fix bug in deleting this pool from its
772         parent.
773         (pool_clear) Properly account for size of pool gizmo.
774         (pool_realloc) Ditto.
775         (pool_clone) New function.
776
777         * pool.h: Mark our allocation functions MALLOC_LIKE.
778
779 Mon Feb 28 23:21:26 2005  Ben Pfaff  <blp@gnu.org>
780
781         * Makefile.am: Move many definitions into new top-level
782         Make.build.  Add expressions to SUBDIRS.  Add calendar.c,
783         calendar.h.  Remove expr-evl.c, expr-opt.c expr-prs.c, expr.h,
784         exprP.h, expr.def.
785
786         * case.c: (case_resize) New function.
787         (case_swap) New function.
788
789         * casefile.c: Include mkfile.h.
790
791 Fri Feb 25 21:11:35 WST 2005 John Darrington <john@darrington.wattle.id.au>
792
793         * sfm-read.c: Fixed a buglet which caused a crash when trying
794         to read a non-existent file.
795
796 Sun Feb 13 16:11:13 2005  Ben Pfaff  <blp@gnu.org>
797
798         Fix PR 11955.
799
800         * aggregate.c: (parse_aggregate_functions) Code cleanup.
801         Important part: get rid of spurious copying of function->format to
802         destvar->print and destvar->write.
803
804 Fri Feb 11 00:08:36 2005  Ben Pfaff  <blp@gnu.org>
805
806         Fix PR 11916, which was confusing a variable's `index' member
807         with the variable's position in a var_set.  Although these are
808         usually the same, they are not for array `var_set's.
809         
810         Took advantage of this bug as an opportunity to clean up and
811         rewrite parse_var_set_vars().
812
813         * vars-prs.c: (parse_vs_variable_idx) New function.
814         (parse_vs_variable) Reimplement in terms of
815         parse_vs_variable_idx().
816         (parse_var_idx_class) New function.
817         (add_variable) New function.
818         (add_variables) New function.
819         (parse_var_set_vars) Rewritten.
820         (struct var_set) Change `lookup_var' member that returns a
821         variable into `lookup_var_idx' member that returns an int.
822         Updated the var set implementations in obvious corresponding ways.
823         Used compare_var_ptr_names(), hash_var_ptr_name() just added.
824         
825 Fri Feb 11 00:06:03 2005  Ben Pfaff  <blp@gnu.org>
826
827         Use our global variable compare & hash functions and give them
828         better names.  Add similar functions for dealing with double
829         pointers to variables.
830         
831         * vars-atr.c: (compare_variables) Renamed compare_var_names().
832         (hash_variable) Renamed hash_var_name().
833         (compare_var_ptr_names) New function.
834         (hash_var_ptr_name) New function.
835         
836         * t-test.q: (cmd_t_test) Use global compare_var_names(),
837         hash_var_name().
838         (compare_var_name) Removed.
839         (hash_var_name) Removed.
840
841 Fri Feb 11 00:04:39 2005  Ben Pfaff  <blp@gnu.org>
842
843         Fix dictionary bug.
844         
845         * dictionary.c: (compare_variable_dblptrs) Rename
846         compare_var_ptrs() and fix it to properly dereference the double
847         pointers.
848
849 Mon Feb  7 09:58:15 WST 2005 John Darrington <john@darrington.wattle.id.au>
850
851         crosstabs.q examine.q oneway.q q2c.c:  Added a q2c feature to 
852         declare subcommands as mandatory.  Closed bug #11843
853
854 Sat Feb  5 20:35:10 WST 2005 John Darrington <john@darrington.wattle.id.au>
855         
856         * getline.c command.[ch] command.def:  Added (very rudimentary)
857         support for line  completion when in interactive mode.  Partially 
858         addresses bug #11693
859         
860 Mon Jan 31 09:52:51 WST 2005 John Darrington <john@darrington.wattle.id.au>
861
862         * examine.q factor_stats.c oneway.q output.c pfm-read.c: Fixed some
863         problems revealed by valgrind.
864
865
866 Wed Jan 26 11:44:11 WST 2005 John Darrington <john@darrington.wattle.id.au>
867
868         * set.q: Affixed a fix to the previous fix such that we'll be OK now
869         whether or not PAGER is set.
870
871 Wed Jan 26 09:25:54 WST 2005 John Darrington <john@darrington.wattle.id.au>
872
873         * set.q: Copied the string produced by getenv("PAGER") thus avoiding
874         "invalid free" errors.  Hopefully fixes bug #11722
875
876         * compute.c expr-prs.c: Check that lvalues are populated before 
877         attempting to destroy them.  Closes bug #11676
878
879 Tue Jan 25 21:01:43 WST 2005 John Darrington <john@darrington.wattle.id.au>
880
881         * aggregate.c: Initialised the complete agr_proc structure.
882         Closes bug #11675
883
884
885 Sun Jan 23 23:02:21 2005  Ben Pfaff  <blp@gnu.org>
886
887         * print.c: (print_trns_free) Close the dfm writer if there is one,
888         fixing a memory leak.
889
890 Mon Jan 24 12:24:36 WST 2005 John Darrington <john@darrington.wattle.id.au>
891
892         * glob.c oneway.q q2c.c t-test.q vfm.c: Still *more* memory leaks 
893         fixed.
894
895
896 Fri Jan 21 19:54:14 WST 2005 John Darrington <john@darrington.wattle.id.au>
897
898         * linked-list.[ch] Added
899
900         * examine.q file-handle.[hq] font.h glob.c groff-font.c postscript.c 
901           set.q:    Yet more memory leaks
902
903 Tue Jan 18 23:12:40 WST 2005 John Darrington <john@darrington.wattle.id.au>
904
905         * t-test.q examine.q : More memory leaks fixed.
906
907 Tue Jan 18 19:26:59 WST 2005 John Darrington <john@darrington.wattle.id.au>
908
909         * examine.q  factor_stats.[ch] get.c pfm-read.c: Plugged numerous
910         memory leaks.
911
912 Mon Jan 10 14:43:45 WST 2005 John Darrington <john@darrington.wattle.id.au>
913
914         * ascii.c cartesian.c casefile.c chart.h devind.c 
915           examine.q frequencies.q
916           html.c output.h piechart.c plot-chart.c plot-hist.c
917
918           Integrated the chart rendering into the output stream
919           (currently only works for html).
920           
921           Removed gratuitous use of ifndef NO_CHARTS, and replaced with
922           dummy-chart.c for compiling without charts.
923
924         * mkfile.[ch] Created.  
925
926         * som.[ch] tab.[ch]: Changed name of som_table to som_entity
927         Added type element so we can tell if it's a chart or a table.
928
929         * chart.h examine.q piechart.c plot-chart.c plot-hist.c: changed the 
930         API of charts to be more like that of tables.
931
932 Thu Jan 13 21:00:02 WST 2005 John Darrington <john@darrington.wattle.id.au>
933
934         * casefile.c main.c: Moved the SIGINT handler from casefile.c to
935         main.c. Removed the handler for SIGQUIT.
936
937 Mon Jan 10 14:43:45 WST 2005 John Darrington <john@darrington.wattle.id.au>
938
939         * casefile.c: Added a signal handler to delete temp files on 
940         SIGINT and SIGQUIT
941
942         * permissions.c Inhibited the PERMISSIONS command when SAFER is on.
943
944         * command.def Added a lot more unimplemented commands.
945
946         * copyleft.[ch] cmdline.c Moved legal information to copyleft.c
947
948 Sat Jan  8 23:58:34 2005  Ben Pfaff  <blp@gnu.org>
949
950         * sort.c: (compare_initial_runs) Needed additional level of
951         dereferencing.
952         (merge_once) Fix plenty of stupid mistakes.
953
954 Sat Jan  8 23:55:27 2005  Ben Pfaff  <blp@gnu.org>
955
956         * casefile.c: (casefile_sleep) Need to flush_buffer() after
957         calling casefile_to_disk() or we will lose the last block in the
958         file if the casefile started out as disk-based.
959         (casefile_get_reader) Initialize reader->destructive to 0.
960         (cmd_debug_casefile) Add new test pattern.
961         (test_casefile) Define new test pattern to make sure
962         casefile_sleep() works properly.
963
964 Fri Jan  7 08:00:05 WST 2005 John Darrington <john@darrington.wattle.id.au>
965
966         * Makefile.am chart.[ch]  histogram.[ch] piechart.c (Modified);
967           plot-hist.c plot-chart.c (Added) Reorganised these files in an
968           attempt to seperate the creation and processing of charts from their
969           actuall renedering.
970
971         * examine.q frequencies.q generated charts conditional upon the NO_CHARTS
972           macro.
973
974 Thu Jan  6 18:48:58 WST 2005 John Darrington <john@darrington.wattle.id.au>
975
976         * main.c Added a signal handler for SIGFPE
977
978         * sort.c Somewhat more robust fix to the previous entry.
979
980 Wed Jan  5 21:23:31 2005  Ben Pfaff  <blp@gnu.org>
981
982         * sort.c: (merge) Fix assertion for proper Huffman merge pattern:
983         0 == 1 modulo 1.  See Knuth 5.4.9 (vol. 3, 2nd ed.,
984         pp. 361).  Thanks to John Darrington <john@cellform.com.au> for
985         reporting the bug.
986
987 Wed Jan  5 22:42:26 WST 2005 John Darrington <john@darrington.wattle.id.au>
988
989         * case.h Fixed bug # 11307
990         
991 Wed Jan  5 08:30:48 WST 2005 John Darrington <john@darrington.wattle.id.au>
992
993         * val-labs.c Fixed bug which caused a crash if VALUE LABELS had
994         a trailing slash.
995
996 Mon Jan  3 17:44:37 2005  Ben Pfaff  <blp@gnu.org>
997
998         * pfm-read.c: (read_variables) Remove direct manipulation of
999         v->aux, which is no longer needed.  Fixes PR 11483.
1000
1001 Sat Jan  1 19:01:16 WST 2005 John Darrington <john@darrington.wattle.id.au>
1002
1003         * data-list.c Fixed a bug in parsing delimiters.
1004
1005         * group.c vars-atr.c Fixed buglet in hash/compare functions for alpha
1006         values.
1007
1008         * percentiles.c Properly handled calculation of Tukey hinges where
1009         the number of data is small.
1010
1011         * oneway.q Used the generic value_to_string function for independent
1012         variable instead of trying to do it ourselves.
1013
1014         * box-whisker.c Fixed a buglet which caused a crash if the number of
1015         data was zero
1016
1017
1018 Fri Dec 31 16:47:45 WST 2004 John Darrington <john@darrington.wattle.id.au>
1019
1020         * examine.q box-whisker.c chart.h Implemented boxplots in EXAMINE
1021
1022         * percentiles.c Fixed some bugs when calculating percentiles when
1023         there's a small number of cases.
1024
1025 Wed Dec 29 08:18:08 WST 2004 John Darrington <john@darrington.wattle.id.au>
1026
1027         * percentiles.[ch] Added. Calculates percentiles and Tukey hinges
1028
1029         * examine.q factor_stats.[ch]  Added calculation of percentiles
1030
1031 Fri Dec 24 15:09:11 WST 2004 John Darrington <john@darrington.wattle.id.au>
1032
1033         * t-test.q Fixed bug #11227 Made t-test work when the independent
1034         variable is alpha
1035
1036 Sat Dec 11 11:43:45 WST 2004 John Darrington <john@darrington.wattle.id.au>
1037
1038         * factor_stats.c Fixed calculation of trimmed mean under various
1039         special conditions.
1040
1041 Sat Dec  4 17:14:45 WST 2004 John Darrington <john@darrington.wattle.id.au>
1042
1043         * histogram.c chart.[ch] factor_stats.c frequencies.q
1044
1045         Added code to calculate sensible histogram ranges and limits.
1046
1047 Thu Dec  2 13:37:43 WST 2004 John Darrington <john@darrington.wattle.id.au>
1048
1049         * chart.h Updated to reflect many API changes.
1050
1051         * cartesian.c chart.c Moved the definitions of chart_write_{xy}scale from 
1052         cartesian.c and into chart.c
1053
1054         * factorstats.[ch] Added the histogram calculations
1055
1056         * casefile.c Removed an unused variable.
1057
1058         * frequencies.q examine.q histogram.c  Reworked the API for 
1059         histograms.
1060
1061         * piechart.c  Revised the API for piecharts.
1062
1063         * var.h  Moved the definitions of freq_tab and freq out of var.h
1064         and into frequencies.q where they belong.
1065         
1066 Tue Nov 30 21:10:20 2004  Ben Pfaff  <blp@gnu.org>
1067
1068         * flip.c: (flip_file) Check for off_t separately from fseeko(),
1069         using AC_TYPE_OFF_T.
1070
1071 Tue Nov 30 08:47:41 2004  Ben Pfaff  <blp@gnu.org>
1072
1073         * flip.c: (flip_file) If fseeko() is not available, use long int
1074         for off_t.  Thanks to "Marshall DeBerry" <mdb@radix.net> for
1075         reporting the problem.
1076
1077 Mon Nov 29 12:20:59 WST 2004 John Darrington <john@darrington.wattle.id.au>
1078
1079         * examine.q factor_stats.[ch] Changed stderr to se_mean to avoid
1080         conflict with stdio.
1081
1082 Sun Nov 21 10:32:41 WST 2004 John Darrington <john@darrington.wattle.id.au>
1083
1084         * var-labs.c (var_to_string) Now returns null if the variable is null
1085
1086         * value-labels.c (value_to_string) Made it return null if either the 
1087         value or the variable is null.
1088
1089         * hash.c (hsh_clear) Fixed a buglet.
1090
1091         * examine.q  factor_stats.[ch] Largely  rewrote, because I'd started 
1092         with  the wrong model.
1093
1094         * casefile.[ch] Added a function to return the casereader.case_idx 
1095         member
1096
1097         * examine.q  Implemented the extreme values results.
1098
1099 John Darrington <john@darrington.wattle.id.au>
1100
1101         * settings.h set.c glob.[ch] frequencies.q q2c.c error.c lexer.[ch] 
1102           output.[ch] getline.c 
1103
1104           Plugged some memory leaks
1105
1106 Mon Nov 15 23:47:40 2004  Ben Pfaff  <blp@gnu.org>
1107
1108         Adopt GSL random number generators, paving the way for providing
1109         the complete suite of random number generators on expressions.
1110         
1111         * Makefile.am: Remove random.c, random.h.
1112
1113         * random.c: Removed.
1114
1115         * random.h: Removed.
1116
1117         * algorithm.c: (algo_default_random) Use GSL functions.
1118
1119         * casefile.c: (test_casefile) Use GSL RNG functions.
1120
1121         * expr-evl.c: (expr_evaluate) Use GSL RNG functions for OP_NORMAL,
1122         OP_UNIFORM.
1123
1124         * sample.c: (cmd_sample) Use GSL RNG functions.
1125         (sample_trns_proc) Ditto.
1126
1127         * set.q: (static var set_seed) Removed.
1128         (static var seed_flag) Removed.
1129         (static var rng) New variable.
1130         (aux_stc_custom_seed) No seed value anymore, don't print anything.
1131         (stc_custom_seed) Use new seed functions.
1132         (seed_is_set) Removed.
1133         (get_rng) New function that composes the entire external
1134         interface.
1135         (set_rng) New function.
1136         (random_seed) New function.
1137
1138 Mon Nov 15 22:08:25 2004  Ben Pfaff  <blp@gnu.org>
1139
1140         * expr-evl.c: (expr_evaluate) Fix XDATE.JDAY formula.  Thanks to
1141         John Darrington <john@darrington.wattle.id.au> for reporting this
1142         bug.
1143
1144 Tue Nov 16 13:19:18 WST 2004 John Darrington <john@darrington.wattle.id.au>
1145
1146         * permissions.c command.def Added the PERMISSIONS command
1147
1148 Mon Nov 15 01:33:32 2004  Ben Pfaff  <blp@gnu.org>
1149
1150         * q2c.c: (dump_header) Don't try to emit #includes at very top of
1151         output file because that will precede #include <config.h>, which
1152         is bad.
1153         (main) Add needed headers to /* (header) */ code.
1154
1155 Mon Nov 15 01:21:36 2004  Ben Pfaff  <blp@gnu.org>
1156
1157         Instead of making system or portable file readers responsible for
1158         dropping and reordering variables, make them read full cases and
1159         let the caller take care of any changes.
1160
1161         * get.c: New "case map" structure to handle this.  Use for GET,
1162         IMPORT, MATCH FILES.  Essentially rewrite the whole file.
1163
1164         * pfm-read.c: (pfm_read_case) Read into provided case.  Signature
1165         changed appropriately.
1166
1167         * sfm-read.c: (sfm_read_case) Ditto.
1168
1169 Mon Nov 15 00:47:45 2004  Ben Pfaff  <blp@gnu.org>
1170
1171         Decided that case_serialize() and case_unserialize() were too
1172         abstract.  Also we need a couple more functions to avoid excessive
1173         copying for data in/out fast paths.
1174
1175         * case.c: (case_serial_size) Removed.
1176         (case_serialize) Rename case_to_values() and make its argument
1177         explicitly an array of union values.
1178         (case_unserialize) Rename case_from_values() and make its argument
1179         explicitly an array of union values.
1180         (case_data_all) New function.
1181         (case_data_all_rw) New function.
1182
1183         * casefile.c: (struct casefile) Change buffer from array of
1184         unsigned char to array of union value for better accuracy.
1185         Redefine buffer_used and buffer_size in terms of values, not
1186         bytes.  Remove case_size because it is now redundant with
1187         value_cnt.  Fix up all references to these members.
1188
1189 Mon Nov 15 00:45:46 2004  Ben Pfaff  <blp@gnu.org>
1190
1191         * barchart.c: (struct subcat) Make `label' member const to silence
1192         GCC warning with -Wwrite-strings.
1193
1194         * cartesian.c: (struct dataset) Ditto.
1195
1196         * case.c: Don't re-define NDEBUG if already defined.
1197         Add lots of comments.
1198
1199         * str.c: Fix includes.
1200
1201         * crosstabs.q: Fix includes.
1202
1203         * examine.q: Fix includes.  Fix GCC warning about unused
1204         variables.
1205         
1206         * frequencies.q: (stat macro) Removed and replaced where used by
1207         its expansion.
1208
1209         * list.q: Fix includes.
1210
1211         * oneway.q: Fix includes.
1212
1213         * piechart.c: Fix includes.  Only define M_PI if not already
1214         defined.
1215
1216         * sfm-read.c: (bswap) New function.
1217         (bswap_int32) Write in terms of bswap.
1218         (bswap_flt64) Ditto.
1219
1220         * str.c: (ds_data) Add external definition here, needed because
1221         str.h has only an `extern inline' version.
1222
1223         * value-labels.c: Fix includes.
1224
1225 Mon Nov 15 00:40:55 2004  Ben Pfaff  <blp@gnu.org>
1226
1227         Instead of providing a system or portable file writer with a raw
1228         case in the format needed for output, provide it with a regular
1229         case.  The writer takes care of any needed translation.
1230
1231         * aggregate.c: Adopt new scheme for AGGREGATE.
1232         (struct agr_proc) sfm_agr_case member removed.
1233         (write_case_to_sfm) Removed because the new interface is easier to
1234         use.
1235
1236         * get.c: Adopt new scheme for SAVE, XSAVE, EXPORT.
1237
1238         * pfm-write.c: Implement new scheme.
1239
1240         * sfm-write.c: Ditto.
1241
1242 Mon Nov 15 00:32:24 2004  Ben Pfaff  <blp@gnu.org>
1243
1244         Instead of treating `struct file_handle' as a class to subclass
1245         into data files, system files, and portable files, instead use it
1246         as a helper that coordinates access.  Now it is opaque, too.
1247
1248         This means that most references to a struct file_handle are now
1249         changed into references to one of struct dfm_reader, struct
1250         dfm_writer, struct sfm_reader, struct sfm_writer, struct
1251         pfm_reader, or struct pfm_writer, according to what's being read
1252         or written.
1253
1254         Most related changes are only worth summarizing briefly.
1255
1256         * dictionary.c: (dict_clear) Destroy aux data in deleted
1257         variables.
1258         (dict_clear_aux) New function.
1259         (dict_create_var) Initialize aux, aux_dtor.
1260         (dict_delete_var) Destroy aux data in deleted variable.
1261
1262         * file-handle.h: (struct fh_ext_class) Removed.
1263         (struct file_handle) Removed.
1264         (fh_init_files) Removed.
1265
1266         * file-handle.q: Changed references to a handle's `private' member
1267         to direct references.
1268         (struct private_file_handle) Renamed file_handle.
1269         Add next, open_cnt, type, open_mode, aux members.
1270         (struct file_handle_list) Removed.
1271         (extern var inline_file) Removed.
1272         (static var file_handles) Changed from file_handle_list * to
1273         file_handle *.
1274         (create_file_handle) Initialize new members.
1275         (fh_close_handle) Removed.
1276         (mode_name) New function.
1277         (fh_open) New function.
1278         (fh_close) New function.
1279         (fh_parse_file_handle) Renamed fh_parse().
1280
1281         * glob.c: (init_glob) Remove fh_init_files() call.
1282         
1283         * aggregate.c: use sfm_writer.
1284         (create_sysfile) Removed because the new interface is simpler.
1285         
1286         * apply-dict.c: Use sfm_reader.
1287
1288         * data-list.c: Use dfm_reader.
1289
1290         * file-type.c: Use dfm_reader.
1291
1292         * get.c: Use sfm_reader, sfm_writer, pfm_reader, pfm_writer.
1293
1294         * inpt-pgm.c: Use dfm_reader.
1295
1296         * print.c: Use dfm_writer.
1297
1298         * sysfile-info: Use sfm_reader.
1299
1300         * dfm-read.c: Adopt new file handle infrastructure.
1301
1302         * dfm-write.c: Ditto.
1303
1304         * pfm-read.c: Ditto.
1305         
1306         * pfm-write.c: Ditto.
1307
1308         * sfm-read.c: Ditto.
1309
1310         * sfm-write.c: Ditto.
1311         
1312 Mon Nov 15 00:31:44 2004  Ben Pfaff  <blp@gnu.org>
1313
1314         Break dictionary functions into separate header file.
1315
1316         * dictionary.h: New file.
1317
1318         * var.h: Moved dict_*() functions to dictionary.h.
1319
1320 Mon Nov 15 00:30:33 2004  Ben Pfaff  <blp@gnu.org>
1321
1322         Get rid of procedure-specific union in struct variable, using
1323         instead a void * pointer and a destructor function.
1324
1325         Most related changes are only worth brief summaries.
1326
1327         * crosstabs.q: Fix includes.  Use new struct var_range in lieu of
1328         old p.crs member in struct variable.
1329         
1330         * frequencies.q: Fix includes.  Use new struct var_freqs in lieu
1331         of old p.frq member in struct variable.
1332
1333         * histogram.c: (draw_histogram) Takes new freq_tab arg because
1334         it's no longer possible to grab this from var->p.frq.
1335
1336         * piechart.c: (draw_piechart) Ditto.
1337
1338         * group.c: (group_proc_get) New function.
1339
1340         * levene.c: Use group_proc_get() in lieu of old p.grp_data member
1341         in struct variable.
1342
1343         * oneway.q: Ditto.
1344
1345         * t-test.q: Ditto.
1346
1347         * main.c: (execute_command) Clear aux data in default_dict after
1348         each command.  (It's debatable whether this should be done.)
1349
1350         * matrix-data.c: Use new struct mxd_var in lieu of old p.mxd
1351         member in struct variable.
1352
1353         * means.q: Get rid of integer mode, which is not included in
1354         recent SPSS and was the only code that wanted per-variable private
1355         data.
1356
1357         * var.h: (struct crosstab_proc) Removed.
1358         (struct frequencies_proc) Removed.
1359         (struct list_proc) Removed.
1360         (struct get_proc) Removed.
1361         (struct means_proc) Removed.
1362         (struct matrix_data_proc) Removed.
1363         (struct match_files_proc) Removed.
1364         (lots of enums) Removed.
1365         (struct variable) Removed members `p', `get'.  Add member
1366         `aux_dtor'.
1367
1368         * vars-atr.c: (var_attach_aux) New function.
1369         (var_detach_aux) New function.
1370         (var_clear_aux) New function.
1371         (var_dtor_free) New function.
1372         (discard_variables) Use NULL instead of inline_file.
1373
1374 Fri Nov 12 10:07:11 WST 2004 John Darrington <john@darrington.wattle.id.au>
1375
1376         * value-labs.c  Fixed the implmentation of value_to_string, so 
1377         that it properly handles alpha values.
1378
1379         * oneway.q  Changed instances where labels were being probed manually, 
1380         to use the canonical {var,value}_to_string functions
1381
1382 Thu Nov 11 21:01:31 WST 2004 John Darrington <john@darrington.wattle.id.au>
1383
1384         * examine.q cartesian.c chart.[ch]   Added normal and detrended normal
1385         plots.  Changed the API of the cartesian plot to be a much lower level
1386         thing.
1387
1388 Sun Nov  7 17:25:04 WST 2004 John Darrington <john@darrington.wattle.id.au>
1389
1390         * examine.q Added some of the parametric calculations
1391
1392         * factor_stats.[ch]  Created
1393         
1394 Sat Nov  6 21:24:31 WST 2004 John Darrington <john@darrington.wattle.id.au>
1395
1396         * examine.q  Changed the definition of factors to be a composite, and
1397         dealt with the consequences.
1398
1399 Sat Nov  6 20:40:38 WST 2004 John Darrington <john@darrington.wattle.id.au>
1400
1401         * examine.q Fixed problem where examine wasn't dealing properly with 
1402         splits
1403
1404 Sat Nov  6 14:49:47 WST 2004 John Darrington <john@darrington.wattle.id.au>
1405
1406         * oneway.q Fixed problem where oneway wasn't dealing properly with 
1407         splits
1408
1409 Thu Nov  4 11:09:01 WST 2004 John Darrington <john@darrington.wattle.id.au>
1410
1411         * q2c.c examine.q  Fixed a bug (feature?) whereby arrays in the
1412         command which had settings didn't get the appropriate code
1413         generated.
1414
1415         * val.h value-labels.[ch] var-labs.c Added v*to_string functions
1416         to convert variables/values to strings.
1417
1418         * examine.q  Added framework for the EXAMINE command.
1419
1420 Mon Nov  1 12:46:17 WST 2004 John Darrington <john@darrington.wattle.id.au>
1421
1422         * q2c.c frequencies.q set.q t-test.q  Fixed the q2c parsing of DBL 
1423         subcommand types.  Changed frequencies.q to use it rather then the 
1424         custom parser.  Dealt with the consequences.  Added a test for NTILES
1425         subcommand of frequencies.
1426
1427 Sat Oct 30 09:16:29 WST 2004 John Darrington <john@darrington.wattle.id.au>
1428
1429         * oneway.q   Fixed up the behaviour when given missing values
1430
1431         * levene.c oneway.q Fixed a buglet with the levene statistic and
1432         incorporated the levene test into the oneway command.
1433
1434         * group.h  t-test.q  Moved the CMP_EQ and CMP_LE symbols out of 
1435         global scope, since they're only relevant to T-TEST
1436
1437 Fri Oct 29 17:39:03 WST 2004 John Darrington <john@darrington.wattle.id.au>
1438
1439         * group.c group.h group_proc.h levene.c oneway.q t-test.q
1440
1441         Made the t-test more consistent
1442         with the way it handles groups.  That is, it now uses a hash instead
1443         of an array of 2.  Also, made the levene.c file independent of the 
1444         implementation of the t-test.  So now levene should be fine for both
1445         t-test and anova.
1446
1447         * Added an oneway.q file for one way anova
1448
1449 Wed Jun  2 22:08:02 2004  Ben Pfaff  <blp@gnu.org>
1450
1451         * descript.c: (cmd_descriptives) Remove harmless but bogus test in
1452         STATISTICS parsing.
1453
1454 Mon May 31 20:45:24 2004  Ben Pfaff  <blp@gnu.org>
1455
1456         Fix memory leaks.
1457
1458         * data-list.c: (cmd_data_list) Free dls->delims on lossage.
1459         (data_list_trns_free) Free dls->delims.
1460
1461         * t-test.q: (tts_custom_pairs) Free vars.
1462         (ssbox_one_sample_init) Fix tab_vline() argument.
1463         (ssbox_independent_samples_init) Ditto.
1464         (trbox_paired_init) Ditto.
1465         (trbox_one_sample_init) Ditto.
1466
1467 Mon May 31 17:19:27 2004  Ben Pfaff  <blp@gnu.org>
1468
1469         Generalize casefiles to the extent that we can use them for
1470         sorting and other kinds of data transformations.  Change cases to
1471         be copy-on-write to improve memory efficiency in common cases.
1472         Every access to a member of a `struct ccase' was changed to be a
1473         call to a case_*() function, especially case_data(), case_num(),
1474         case_str(), or case_data_rw().  Many instances of a local variable
1475         named "case_num" were changed to "case_idx" as a consequence.
1476         Many `struct ccase *' were changed to actual `struct ccase'
1477         because of copying semantics of cases.  In several places there
1478         was a choice between updating debug code to work with the new ADTs
1479         or just deleting it because it was useless; I chose to delete it.
1480  
1481         * Makefile.am: (pspp_SOURCES) Add case.c, case.h.
1482
1483         * case.c: New file.
1484
1485         * case.h: New file.
1486
1487         * aggregate.c: (struct agr_proc) Change type of `sort' to
1488         sort_criteria *.  Add `break_vars', `break_var_cnt' members.
1489         Rename `vars' to `agr_vars', all references updated.  Change
1490         `agr_case' to type `struct ccase'.
1491         (cmd_aggregate) Deal with new members.  Use case_create(),
1492         sort_active_file_in_place(), sort_active_file_to_casefile().
1493         (agr_destroy) Deal with new members.
1494         (aggregate_single_case) Ditto.
1495         (dump_aggregate_info) Ditto.
1496         (initialize_aggregate_info) Ditto.
1497         (agr_to_active_file) Ditto.
1498         (presorted_agr_to_sysfile) Ditto.
1499         (sort_agr_to_sysfile) Removed.
1500
1501         * alloc.c: (out_of_memory) Make non-static.
1502
1503         * alloc.h: Prototype out_of_memory().
1504
1505         * casefile.c: Switched from a linked list in-memory representation
1506         to a two-level array-style representation.  The linked list was
1507         appropriate when we could stick a header onto cases, but that's no
1508         longer the case.  Also, the two-level array will allow for random
1509         in-memory access in case that's ever wanted.  Also added the
1510         concept of a `destructive casereader', one that destroys cases in
1511         the underlying casefile as they are read out.
1512         (macro CASES_PER_BLOCK) New macro.
1513         (struct casefile) New members `value_cnt', `case_list_size',
1514         `case_acct_size', `being_destroyed', `cases'.  Removed `head',
1515         `tail'.
1516         (struct casereader) Removed `cur'.  Added `destructive', `c'.
1517         (global var casefiles) Made static.
1518         (static var case_bytes) New var.
1519         (casefile_create) Takes a value count, not a case size in bytes,
1520         to conform to the case interface.  All callers updated.  Deal with
1521         new and removed members.
1522         (casefile_destroy) Deal with new and removed members.
1523         (casefile_sleep) New function.
1524         (casefile_get_case_size) Removed.
1525         (casefile_get_value_cnt) New function.
1526         (casefile_append) Rewritten to deal with new and removed members.
1527         (casefile_append_xfer) New function.
1528         (write_case_to_disk) Use case_serialize().
1529         (call_posix_fadvise) Removed because posix_fadvise64 segfaults.
1530         Couldn't figure out why.
1531         (casefile_to_disk) Don't call call_posix_fadvise.  Rewritten to
1532         deal with new and removed members.
1533         (merge) Removed.
1534         (merge_sort) Removed.
1535         (casefile_sort) Removed.
1536         (casefile_get_reader) Deal with new and removed members.
1537         (casefile_get_destructive_reader) New function.
1538         (reader_open_file) Make code more readable.  Create case for
1539         reader.
1540         (casereader_get_casefile) New function.
1541         (casereader_read) Deal with new and removed members.  Now returns
1542         a copy of the case, so that the caller is responsible for
1543         destroying the returned case.
1544         (casereader_read_xfer) New function.
1545         (casereader_destroy) Destroy reader's case.
1546         (test_casefile) Second arg is now a value count, all callers
1547         updated.  Now tests destructive readers too.
1548         (get_random_case) Deal with new case ADT.
1549         (write_random_case) Ditto.
1550         (read_and_verify_random_case) Ditto.
1551
1552         * crosstabs.q: Remove debug code.
1553
1554         * descript.q: (calc_descriptives) Deal with new case, casefile
1555         ADTs.
1556
1557         * dfm.c: (cmd_begin_data) There's no storage_source_class anymore.
1558
1559         * do-if.c: Remove unneeded header inclusion.
1560
1561         * expr-prs.c: Remove debug code.
1562
1563         * exprP.h: Remove debug code.
1564
1565         * flip.c: (flip_file) Use fseeko() if available.
1566
1567         * formats.c: Remove debug code.
1568
1569         * get.c: Remove debug code.
1570         (struct mtf_file) Change `input' from `union value *' to `struct
1571         ccase', all references updated.
1572
1573         * levene.c: (levene) Deal with new case, casefile ADTs.
1574
1575         * list.q: Remove debug code.
1576
1577         * loop.c: Remove debug code.
1578         
1579         * matrix-data.c: Remove debug code.
1580
1581         * means.q: Remove debug code.
1582
1583         * mis-val.c: Remove debug code.
1584
1585         * pfm-read.c: Remove debug code.
1586         (pfm_read_code) Change second arg from `union value *' to `struct
1587         ccase *', all references updated.
1588
1589         * recode.c: (string_to_long) Make first arg const.
1590         (convert_to_double) Ditto.
1591
1592         * repeat.c: Remove debug code.
1593
1594         * sample.c: Remove debug code.
1595
1596         * sfm-read.c: Remove debug code.
1597         (sfm_read_case) Change second arg from `union value *' to `struct
1598         ccase *'.
1599
1600         * sort.c: Redone in terms of casefiles.
1601         (enum sort_direction) Moved here from sort.h.
1602         (struct sort_criterion) New structure.
1603         (struct sort_criteria) New structure.
1604         (cmd_sort_cases) Rewritten.
1605         (prepare_to_sort_active_file) New function.
1606         (sort_active_file_in_place) New function.
1607         (sort_active_file_to_casefile) New function.
1608         (parse_sort) Renamed sort_parse_criteria(), rewritten & interface
1609         changed, all callers updated.
1610         (destroy_sort_cases_pgm) Renamed sort_destroy_criteria(),
1611         rewritten & interface changed, all callers updated.
1612         (sort_cases) Renamed sort_execute(), rewritten & interface
1613         changed, all callers updated.
1614         (struct internal_sort) Removed.
1615         (do_internal_sort) Rewritten, interface changed.
1616         (destroy_internal_sort) Removed.
1617         (compare_case_dblptrs) Use sort_criteria instead of sort_case_pgm.
1618         (struct initial_run) Removed; an initial run is now just a
1619         casefile.
1620         (compare_initial_runs) Rewritten.
1621         (struct external_sort) Changed almost completely.
1622         (do_external_sort) Rewritten, interface changed.
1623         (destroy_external_sort) Rewritten.
1624         [HAVE_MKDTEMP] (make_temp_dir) Removed.
1625         [!HAVE_MKDTEMP] (do_mkdir) Removed.
1626         [!HAVE_MKDTEMP] (make_temp_dir) Removed.
1627         (init_external_sort) Removed.
1628         (simulate_error) Removed.
1629         (rmdir_temp_dir) Removed.
1630         (get_temp_file_name) Removed.
1631         (open_temp_file) Removed.
1632         (close_temp_file) Removed.
1633         (remove_temp_file) Removed.
1634         (write_temp_file) Removed.
1635         (read_temp_file) Removed.
1636         (struct record_run) Change `record' from `struct case_lit *' to
1637         `struct ccase'.
1638         (struct initial_run_state) Remove `idx_to_fv', `free_list',
1639         `file_idx', `output_file'.  Add `run', casefile'.  Change
1640         `last_output' from `struct case_list *' to `struct ccase'.
1641         (write_initial_runs) Change interface, rewrite.
1642         (sort_sink_write) Renamed process_case(), changed interfaced,
1643         rewrote.
1644         (destroy_initial_run_state) Rewritten.
1645         (allocate_cases) Rewritten.
1646         (compare_record) Interface changed, rewritten.
1647         (start_run) Rewritten.
1648         (end_run) Rewritten.
1649         (output_record) Rewritten.
1650         (grab_case) Removed.
1651         (release_case) Removed.
1652         (struct merge_case) Change `cases' from double pointer to single
1653         pointer.
1654         (merge) Deal with new case and casefile ADTs.
1655         (struct run) Removed.
1656         (merge_once) Rewritten, interface changed.
1657         (fill_run_buffer) Removed.
1658         (sort_sink_make_source) Removed.
1659         (sort_sink_class) Removed.
1660         (struct sort_source_aux) Removed.
1661         (sort_source_read_helper) Removed.
1662         (sort_source_read) Removed.
1663         (read_sort_output) Removed.
1664         (read_internal_sort_output) Removed.
1665         (read_external_sort_output) Removed.
1666         (sort_source_destroy) Removed.
1667         (sort_source_class) Removed.
1668
1669         * sort.h: (struct sort_cases_pgm) Removed.
1670         (enum sort_direction) Moved to sort.c.
1671
1672         * t-test.q: (calculate) Deal with new case, casefile ADTs.
1673
1674         * tab.c: Remove debug code.
1675
1676         * var-labs.c: Remove debug code.
1677
1678         * var.h: (struct ccase) Removed.
1679         (struct case_list) Removed.
1680
1681         * vars-atr.c: (discard_variables) Use free_case_source().
1682
1683         * vars-prs.c: (parse_vs_variable) Make arg const.
1684         (parse_dict_variable) Ditto.
1685         (parse_variables) Make struct dictionary * arg const.
1686         (parse_var_set_vars) Make struct var_set * arg const.
1687         (struct var_set) Add const to some of the function pointers' args.
1688         (var_set_get_cnt) Make arg const.
1689         (var_set_get_var) Make first arg const.
1690         (var_set_lookup_var) Make first arg const.
1691         (dict_var_set_get_cnt) Make arg const.
1692         (dict_var_set_get_var) Make first arg const.
1693         (dict_var_set_lookup_var) Make first arg const.
1694         (var_set_create_from_dict) Make arg const.  Add cast to aux
1695         assignment.
1696         (struct array_var_set) Add const to var member.
1697         (array_var_set_get_cnt) Make arg const.
1698         (array_var_set_get_var) Make first arg const.
1699         (array_var_set_lookup_var) Make first arg const.
1700         (var_set_create_from_array) Make first arg const.  Insert cast.
1701
1702         * vfm.c: (struct write_case_data) Change trns_case, sink_case
1703         members from `struct ccase *' to `struct ccase'.
1704         (static var lag_queue) Change from double to single pointer.
1705         (procedure) Optimize trivial case.
1706         (internal_procedure) Deal with changed case, case_source ADTs.
1707         (create_trns_case) Changed interface, rewrote.
1708         (open_active_interface) Initialize modified lag queue.
1709         (write_case) Deal with changed case ADT.
1710         (lag_case) Deal with modified lag queue.
1711         (close_active_file) Destroy modified lag queue.
1712         Deal with changed case_source, case_sink ADTs.
1713         (destroy_storage_stream_info) Make null arg into no-op.
1714         (storage_sink_make_source) Set aux in created source.
1715         (storage_source_read) Deal with changed case, casefile ADTs.
1716         (storage_source_create) New function.
1717         (lagged_case) Rewrite.
1718         (free_case_source) New function.
1719         (free_case_sink) Rewrite.
1720         (struct split_aux_data) Changed prev_case from `struct ccase *' to
1721         `struct ccase'.
1722         (procedure_with_splits) Deal with changed prev_case.
1723         (procedure_with_splits_callback) Ditto.
1724         (multipass_split_aux_data) Changed prev_case from `struct ccase *' to
1725         `struct ccase'.
1726         (multipass_procedure_with_splits) Deal with changed prev_case.
1727         (multipass_split_callback) Ditto.
1728         
1729         
1730 Mon May 31 17:19:06 2004  Ben Pfaff  <blp@gnu.org>
1731
1732         The workspace idea didn't work out.
1733
1734         * Makefile.am: (pspp_SOURCES) Remove workspace.c, workspace.h.
1735         
1736         * workspace.c: Removed.
1737
1738         * workspace.h: Removed.
1739
1740 Sun May 30 18:35:19 2004  Ben Pfaff  <blp@gnu.org>
1741
1742         Fully implement arbitrary delimiters on DATA LIST, extending the
1743         half implementation that was already there.
1744
1745         * data-list.c: (struct data_list_pgm) Remove `delim', add
1746         `delims', `delim_cnt'.
1747         (cmd_data_list) Initialize new members.  Parse delimiters and
1748         clean up code a bit.
1749         (cut_field) Extract fields with arbitrary delimiters.  Also, fix
1750         handling of leading commas.
1751         (read_from_data_list_fixed) Expand tabs.  Adapt to new DFM
1752         interfaces.
1753         (read_from_data_list_free) Adapt to new DFM interfaces.
1754         (read_from_data_list_list) Ditto.
1755         (repeating_data_trns_proc) Ditto.
1756
1757         * dfm.c: Split up reader and writer into separate code, because
1758         they do different things.  Use struct string instead of explicit
1759         allocation code, for clarity.
1760         (enum dfm_reader_flags) New enum.
1761         (struct dfm_fhuser_ext) Removed.
1762         (struct dfm_reader_ext) New.
1763         (get_reader) New function, used by just about all the reader
1764         functions.
1765         (dfm_close) Removed.
1766         (close_reader) New function.
1767         (dfm_open_for_reading) Rewrite initialization of dfm_fhuser_ext.
1768         (dfm_open_for_writing) Ditto.
1769         (macro force_line_buffer_expansion) Removed.
1770         (count_tabs) Removed.
1771         (tabs_to_spaces) Removed.
1772         (read_record) Deal with new dfm_reader_ext.  Use struct string
1773         functions.  Don't convert tabs to spaces.
1774         (dfm_eof) New function.
1775         (dfm_get_record) Changed interface, rewrote.
1776         (dfm_expand_tabs) New function.
1777         (dfm_fwd_record) Renamed dfm_forward_record(), updated to new
1778         dfm_reader_ext, rewritten.
1779         (dfm_bkwd_record) Renamed dfm_reread_record(), updated to new
1780         dfm_reader_ext, rewritten.
1781         (dfm_set_record) Removed in favor of dfm_forward_columns().
1782         (dfm_forward_columns) New function.
1783         (dfm_get_cur_col) Renamed dfm_column_start, updated to new
1784         dfm_reader_ext, rewritten.
1785         (static var dfm_r_class) Use close_reader for the destructor.
1786         (struct dfm_writer_ext) New.
1787         (dfm_put_record) Updated to new dfm_writer_ext, rewritten.  Uses
1788         bounce buffer now instead of local allocation.
1789         (close_writer) New function.
1790         (static var dfm_writer_ext) Use close_writer for destructor.
1791         (cmd_begin_data) Adapt to new dfm_reader_ext.
1792
1793         * file-handle.q: Add support for per-file tab width.
1794         (struct private_file_handle) Add tab_width member.
1795         (q2c specifications) Add tabwidth subcommand.
1796         (cmd_file_handle) Put parsed tab width into private_file_handle.
1797         (create_file_handle) Set default tab width.
1798         (handle_get_tab_width) New function.
1799
1800         * file-type.c: (file_type_source_read) Adapt to new DFM interface.
1801
1802         * inpt-pgm.c: (reread_trns_proc) Ditto.
1803
1804         * matrix-data.c: (context) Ditto.
1805         (another_token) Ditto.
1806         (mget_token) Ditto.
1807         (force_eol) Ditto.
1808
1809 Sun May 30 18:33:59 2004  Ben Pfaff  <blp@gnu.org>
1810
1811         * casefile.c: (casefile_destroy) Fix memory leak by freeing
1812         cf->filename.
1813         (casereader_destroy) Don't close file descriptor -1.
1814
1815         * recode.c: (cmd_recode) Fix memory leak.
1816
1817         * set.q: (q2c specifications) Fix typo in user message.
1818
1819         * str.c: (st_bare_pad_len_copy) Change memcpy to memmove to avoid
1820         undefined behavior for overlapping arguments.
1821
1822 Sun May 30 18:31:48 2004  Ben Pfaff  <blp@gnu.org>
1823
1824         * casefile.c: valgrind doesn't implement posix_fadvise() yet, so
1825         don't call it when we're running under valgrind.
1826         (call_posix_fadvise) New function.
1827         (casefile_to_disk) Use call_posix_fadvise().
1828         (reader_open_file) Ditto.
1829         
1830 Sun May 30 18:20:12 2004  Ben Pfaff  <blp@gnu.org>
1831
1832         Update our string ADTs, struct string and struct len_string.  Get
1833         rid of pool support, which was largely unused.  Rename lots of
1834         functions to have more obvious or consistent names.
1835         
1836         * ascii.c: Get rid of ascii_pool.  It was only used for string
1837         allocations.
1838         (ascii_open_global) Don't create ascii_pool.
1839         (ascii_close_driver) Don't destroy ascii_pool.
1840         (ascii_postopen_driver) Don't use pool.
1841         (ascii_close_driver) Destroy strings manually.
1842
1843         * str.c: (ds_create) Remove pool argument, all references updated.
1844         (ds_init) Ditto.
1845         (ds_replace) Remove pool support, make more efficient when we
1846         don't need to reallocate.
1847         (ds_destroy) Remove pool support.
1848         (ds_rpad) New function.
1849         (ds_size) Renamed ds_capacity(), all references updated.
1850         (ds_value) Renamed ds_c_str(), all references updated.
1851         (ds_concat) Renamed ds_puts(), all references updated.
1852         (ds_concat_buffer) Renamed ds_concat(), all references updated.
1853         (ds_putchar) Renamed ds_putc(), all references updated.
1854         (ds_getline) Renamed ds_gets(), all references updated.
1855         (ls_create) Remove pool argument, all references updated.
1856         (ls_create_buffer) Ditto.
1857         (ls_destroy) Removed pool support.
1858         (ls_value) Renamed ls_c_str(), all references updated.
1859
1860         * str.h: (ls_length) [__GNUC__] Add inline version.
1861         (ls_c_str) [__GNUC__] Add inline version.
1862         (ls_end) [__GNUC__] Add inline version.
1863         (struct string) Remove pool member.  Rename `size' to `capacity',
1864         all references updated.
1865
1866         * tab.c: (text_format) Instead of using pool argument to
1867         ls_create_buffer(), call pool_register() on allocated data.
1868
1869 Mon Apr 26 22:40:07 2004  Ben Pfaff  <blp@gnu.org>
1870
1871         We're abusing the current ASCII driver by telling it to allocate a
1872         9999-line, 9999-character page in the tests.  This causes some
1873         systems to curl up and die because it allocates 20 MB of
1874         contiguous RAM.  This change alleviates at least part of the
1875         problem.  It is mostly a stop-gap until the new output system is
1876         ready.
1877         
1878         * ascii.c: (struct line) New structure.
1879         (struct ascii_driver_ext) Remove `page', `page_size', `line_len',
1880         `line_len_size', `n_output' members.  Add `lines', `lines_cap'.
1881         (ascii_preopen_driver) Initialize new members, not old ones.
1882         (ascii_close_driver) Destroy new members, not old ones.
1883         (ascii_open_page) Allocate new members, not old ones.
1884         (expand_line) Allocate room in line.
1885         (draw_line) Use new members.
1886         (ascii_line_horz) Ditto.
1887         (ascii_line_vert) Ditto.
1888         (ascii_line_intersection) Ditto.
1889         (text_draw) Ditto.
1890         (output_lines) Ditto.
1891         (ascii_close_page) Ditto.
1892
1893 Sun Apr 25 23:40:15 2004  Ben Pfaff  <blp@gnu.org>
1894
1895         * matrix.c: Dead code.  Removed.
1896
1897         * matrix.h: Dead code.  Removed.
1898
1899 Fri Apr 16 23:59:51 2004  Ben Pfaff  <blp@gnu.org>
1900
1901         Contrary to what I'd always understood, there is an efficient
1902         algorithm for deletion from a hash table populated via linear
1903         probing.  This change implements it.
1904         
1905         * hash.c: (hsh_rehash) Probe in increasing order.
1906         (hsh_probe) Ditto.
1907         (locate_matching_entry) Ditto.
1908         (hsh_delete) Use Knuth's Algorithm 6.4R for deletion.
1909
1910 Tue Apr 13 19:24:15 2004  Ben Pfaff  <blp@gnu.org>
1911
1912         * moments.c (calc_moments): Adjust calculation of kurtosis to
1913         avoid subtracting huge numbers from huge numbers, on Michael
1914         Kiefte's advice.
1915
1916 Sun Apr 11 14:22:12 2004  Ben Pfaff  <blp@gnu.org>
1917
1918         Rework moments routines for improved numerical stability based on
1919         Michael Kiefte's advice.  Any bugs or remaining numerical problems
1920         are still mine though.
1921
1922         There is now a struct moments1 for use with one-pass moments.  It
1923         uses a provisional means algorithm as an attempt to improve
1924         accuracy of higher moments.  The older struct moments now only
1925         handles two-pass moments.
1926         
1927         * aggregate.c: Use moments1 instead moments.
1928
1929         * descript.c: Revert previous change, which is no longer needed
1930         due to the moments revision.
1931
1932         * moments.c: (calc_moments) New function for calculating variance,
1933         skewness, kurtosis.
1934         (moments_pass_one) Only accumulate weights bigger than zero.
1935         (moments_calculate) Allow calculating the mean on pass one, others
1936         require pass two.  Implement in terms of calc_moments().
1937         (struct moments1) New structure.
1938         (init_moments1) New function.
1939         (moments1_clear) Ditto.
1940         (moments1_create) Ditto.
1941         (moments1_add) Ditto.
1942         (moments1_calculate) Ditto.
1943         (moments1_destroy) Ditto.
1944         (cmd_debug_moments) Deal with `struct moments' or `struct
1945         moments1' as requested by user.
1946
1947 Sun Apr 11 14:21:55 2004  Ben Pfaff  <blp@gnu.org>
1948
1949         * Makefile.am (pspp_SOURCES): Remove debug.c.
1950
1951         * debug.c: Removed.  It was empty anyway.
1952
1953 Fri Apr  9 20:04:49 2004  Ben Pfaff  <blp@gnu.org>
1954
1955         * descript.c (calc_descriptives): Fix assert failure when only
1956         MOMENT_MEAN is needed.
1957
1958 2004-04-09  Michael Kiefte  <mkiefte@dal.ca>
1959
1960         * descript.c: 
1961
1962         fixed problem with parsing in match_statistic() causing
1963         "DESCRIPTIVE STAT=MEAN." to barf.
1964
1965         "MEAN" is now default if "SORT" given without specification.
1966
1967         Fixed infinite loop with "DESCRIPT GIBBERISH=ALL."  Parsing is
1968         generally less forgiving of syntax errors: better to have it do
1969         nothing and type it in again then to not know what it actually did
1970         instead.  
1971
1972         z-score transformation now checks score for user-missing values
1973         and checks std_dev for SYSMIS.
1974
1975 2004-04-06  Michael Kiefte  <mkiefte@dal.ca>
1976
1977         * aggregate.c, crosstabs.q, descript.c, dictionary.c, frequencies.q, levene.c, t-test.q, var.h: 
1978         Changed dict_get_case_weight() to accept an additional int * flag
1979         to complain about system-missing, user-missing, zero, or negative
1980         weights and updated existing functions to pass int * to
1981         dict_get_case_weight().
1982
1983 2004-04-05  jmd  <jmd@gnu.org>
1984
1985         * main.c: Fixed configuration problems with gsl
1986
1987         * t-test.q: Fixed some problems encountered when compiling under Cygwin
1988
1989 2004-04-03  blp  <blp@gnu.org>
1990
1991         * lexer.c, ChangeLog:
1992         Fix infinite loop on comment at end of file, add test.
1993
1994 2004-04-03  jmd  <jmd@gnu.org>
1995
1996         * 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:
1997         Fixed the calculation of percentiles and added --syntax and --algorithm options
1998
1999 Sat Apr  3 11:43:37 2004  Ben Pfaff  <blp@gnu.org>
2000
2001         * lexer.c: (lex_skip_comment) Handle end-of-file correctly (I
2002         hope).
2003
2004 Sat Apr  3 15:00:18 WST 2004 John Darrington <john@darrington.wattle.id.au>
2005
2006         * frequencies.q:  Fixed the calculation of percentiles
2007
2008         * Makefile.am:  Added the --ansi flag and dealt with the
2009         consequences.  Added some entries to PSPP_sources so that
2010         make distcheck would pass
2011
2012         * cmdline.c:   Added the --syntax and --algorithm options
2013
2014         * q2c.c:  Added an implicit /ALGORITHM subcommand to everything.
2015
2016 Fri Apr  2 11:25:22 WAST 2004 John Darrington <john@darrington.wattle.id.au>
2017
2018         * t-test.q, levene.c, levene.h  Converted t-test (incl levene) to 
2019         use the new multipass_split_... mechanism.
2020
2021 Wed Mar 31 22:36:22 2004  Ben Pfaff  <blp@gnu.org>
2022
2023         * frequencies.q: (calc_stats) Use moments data structure and
2024         calc_seskew(), calc_sekurt() functions.
2025
2026         * set.q main.c settings.h Added support for --syntax and --algorithm 
2027         options
2028
2029 Tue Mar 30 22:04:19 2004  Ben Pfaff  <blp@gnu.org>
2030
2031         * vfm.c: Had to get last call to multipass_split_output() inside
2032         open_active_file()/close_active_file() pairing, so introduce new
2033         function.
2034         (internal_procedure) Move procedure() code here, except for calls
2035         to open_active_file() and close_active_file().
2036         (procedure) Wrap open_active_file() and close_active_file() around
2037         internal_procedure().
2038         (multipass_procedure_with_splits) Wrap open_active_file() and
2039         close_active_file() around internal_procedure().
2040
2041 Tue Mar 30 22:01:57 2004  Ben Pfaff  <blp@gnu.org>
2042
2043         * descript.c: (cmd_descriptives) Free `vars' to avoid memory leak.
2044
2045 Mon Mar 29 16:26:40 2004  Ben Pfaff  <blp@gnu.org>
2046
2047         * debug.c: Removed.  Moved cmd_debug_evaluate() into expr-evl.c.
2048
2049         * expr-evl.c: (cmd_debug_evaluate) Moved here from debug.c.
2050
2051 Mon Mar 29 16:03:08 2004  Ben Pfaff  <blp@gnu.org>
2052
2053         * algorithm.c: By default turn off some of the more expensive
2054         assertions.
2055         (expensive_assert) New macro which expands to assert if
2056         EXTRA_CHECKS is defined, to nothing otherwise.
2057         (unique) Use expensive_assert().
2058         (binary_search) Ditto.
2059         (push_heap) Ditto.
2060         (pop_heap) Ditto.
2061         (make_heap) Ditto.
2062         (sort_heap) Ditto.
2063
2064         * command.c: (conflicting_3char_prefixes) Words that are the same
2065         don't cause conflicts when they are abbreviated to the first three
2066         letters.
2067
2068         * expr-evl.c: (CONCAT_func) Fix memory leak by incrementing struct
2069         nonterm_node's n earlier.
2070         (generic_str_func) Ditto.
2071         
2072 Mon Mar 29 15:32:17 2004  Ben Pfaff  <blp@gnu.org>
2073
2074         Add support for multipass procedures.  Rewrite DESCRIPTIVES to
2075         test multipass support, take advantage of new moments
2076         calculation, and to not be such crappy code.  Get rid of q2c
2077         processing for DESCRIPTIVES.
2078
2079         * vfm.c: (struct multipass_split_aux_data) New structure.
2080         (multipass_procedure_with_splits) New function.
2081         (multipass_split_callback) New function.
2082         (multipass_split_output) New function.
2083         * descript.q: Removed.
2084
2085         * descript.c: New file.
2086
2087         * var.h: Removed descriptives enums.
2088         (struct descriptives_proc) Removed.
2089         (struct variable) Removed p.dsc.
2090
2091         * Makefile.am: (q_sources_c) Remove descript.c.
2092         (q_sources_q) Removed descript.q.
2093         
2094 Mon Mar 29 15:31:55 2004  Ben Pfaff  <blp@gnu.org>
2095
2096         New manager for keeping track of used workspace.
2097         
2098         * workspace.c: New file.
2099
2100         * workspace.h: New file.
2101
2102         * Makefile.am: (pspp_SOURCES) Add workspace.c, workspace.h.
2103
2104         * sort.c: (do_internal_sort) Use workspace_malloc().
2105         (destroy_internal_sort) Use workspace_free().
2106
2107 Mon Mar 29 15:31:08 2004  Ben Pfaff  <blp@gnu.org>
2108
2109         New `struct casefile' for managing sets of cases.
2110
2111         * casefile.c: New file.
2112
2113         * casefile.h: New file.
2114
2115         * command.def: Add DEBUG CASEFILE command.
2116
2117         * Makefile.am: (pspp_SOURCES) Add casefile.c, casefile.h.
2118
2119         * sort.c: (sort_cases) Move logic for sending storage file to disk
2120         into do_external_sort().
2121         (struct internal_sort) Use an array of ccase pointers instead of a
2122         case_list.
2123         (do_internal_sort) Rewrite to handle casefiles.
2124         (compare_case_list) Removed.
2125         (compare_cases) New function.
2126         (compare_case_dblptrs) New function.
2127         (read_internal_sort_output) Deal with new struct internal_sort.
2128
2129         * vfm.c: (static var workspace_overflow) Removed.
2130         (struct storage_stream_info) Removed all the members.  Added
2131         struct casefile * member.
2132         (storage_sink_open) Use casefile.
2133         (open_storage_file) Removed.
2134         (write_storage_file) Removed.
2135         (storage_to_disk) Removed.
2136         (destroy_storage_stream_info) Use casefile.
2137         (storage_sink_write) Use casefile.
2138         (storage_sink_make_source) Use casefile.
2139         (storage_source_count) Use casefile.
2140         (storage_source_read) Use casefile.
2141         (storage_source_on_disk) Removed.
2142         (storage_source_get_cases) Removed.
2143         (storage_source_set_cases) Removed.
2144         (storage_source_get_casefile) New function.
2145         
2146 Mon Mar 29 15:30:09 2004  Ben Pfaff  <blp@gnu.org>
2147
2148         New `struct moments' for calculating moments.
2149
2150         * stats.c: Removed.
2151
2152         * stats.h: Removed.
2153
2154         * moments.c: New file.
2155
2156         * moments.h: New file.
2157
2158         * command.def: Add DEBUG MOMENTS command.
2159
2160         * Makefile.am: (pspp_SOURCES) Add moments.c, moments.h.  Remove
2161         stats.c, stats.h.
2162
2163         * aggregate.c: Modify AGGREGATE to use the new moments
2164         calculation, even if not in such a great way.
2165         (struct agr_var) Add `moments' member.
2166         (parse_aggregate_functions) Set `moments' member to null.
2167         (agr_destroy) Destroy `moments' member.
2168         (accumulate_aggregate_info) Use `moments' for standard deviation.
2169         (dump_aggregate_info) Ditto.
2170         (initialize_aggregate_info) Create or clear `moments'.
2171
2172         * misc.h: Add pow2(), pow3(), pow4() functions in place of sqr(),
2173         cube(), pow4() that were in stats.h.  All references updated.
2174
2175         * crosstabs.q: stats.h had chi-square significance functions.  Use
2176         GSL instead.
2177         (display_chisq) Use gsl_cdf_chisq_Q() instead of chisq_sig().
2178
2179         * expr-evl.c: (expr_evaluate) Use moments_of_values() for
2180         OP_CFVAR, OP_MEAN, OP_SD, OP_VARIANCE.
2181                 
2182 Fri Mar 26 14:21:23 2004  Ben Pfaff  <blp@gnu.org>
2183
2184         * dictionary.c: (dict_compact_values) Compacted values need to
2185         start off from 0.
2186
2187 Fri Mar 26 00:54:57 2004  Ben Pfaff  <blp@gnu.org>
2188
2189         * var-labs.c: (cmd_variable_labels) For compatibility, don't allow
2190         `/' at start.  Check return value of parse_variables() for error
2191         return.
2192
2193 Fri Mar 26 00:19:27 2004  Ben Pfaff  <blp@gnu.org>
2194
2195         Revamp expressions: make the code a little nicer, and fix bugs
2196         found in testing.
2197         
2198         * expr-evl.c: (expr_evaluate) Make expression argument const.
2199         Support OP_ADD, OP_SUB, OP_MUL, OP_DIV instead of OP_PLUS, OP_MUL.
2200         OP_POW is missing for arg 2 <= 0.  OP_LOG is natural log, not
2201         base-10 log.  Fix OP_ANY, OP_ANY_STRING, OP_RANGE, OP_RANGE_STRING
2202         off-by-ones.  Add OP_MAX_STRING, OP_MIN_STRING.  Fix OP_TIME_HMS,
2203         OP_DATE_WKYR boundary conditions.  Add OP_CTIME_DAYS,
2204         OP_CTIME_HOURS, OP_CTIME_MINUTES, OP_CTIME_DAYS, OP_CTIME_SECONDS.
2205         Support OP_INDEX_2, OP_INDEX_3, OP_RINDEX_2, OP_RINDEX_3 instead
2206         of OP_INDEX, OP_INDEX_OPT, OP_RINDEX, OP_RINDEX_OPT.  Merge
2207         OP_LPAD_OPT into OP_LPAD, OP_RPAD_OPT into OP_RPAD, OP_LTRIM_OPT
2208         into OP_LTRIM, OP_RTRIM_OPT into OP_RTRIM, OP_NUMBER_OPT into
2209         OP_NUMBER.  Fix OP_RTRIM fragility.  Support OP_SUBSTR_2,
2210         OP_SUBSTR_3 instead of OP_SUBSTR, OP_SUBSTR_OPT.  Remove OP_INV.
2211         Simplify OP_SYSMIS.  Remove OP_STR_MIS.
2212
2213         * expr-opt.c: (optimize_expression) Rewrite.
2214         (macro n0) Removed.
2215         (macro n1) Removed.
2216         (macro n2) Removed.
2217         (macro s0) Removed.
2218         (macro s0l) Removed.
2219         (macro s1) Removed.
2220         (macro s1l) Removed.
2221         (macro s2) Removed.
2222         (macro s2l) Removed.
2223         (macro s) Removed.
2224         (macro sl) Removed.
2225         (eq_num_con) New function.
2226         (optimize_tree) New function.
2227         (macro rnc) Removed.
2228         (macro frnc) Removed.
2229         (str_search) Add const to string params.
2230         (str_rsearch) Ditto.
2231         (evaluate_tree_no_missing) Renamed from evaluate_tree.  Add num[],
2232         str[], str_len[] locals to substitute for most of removed macros.
2233         Support OP_ADD, OP_SUB, OP_MUL, OP_DIV instead of OP_PLUS, OP_MUL.
2234         Removed support for missing values because we're never called with
2235         missing values.  Use set_number() or set_number_errno() instead of
2236         rnc or frnc.  Removed any stuff that caused trouble in testing.
2237         We can re-add it later if it really slows anything.  Fix some
2238         random problems.
2239         (evaluate_tree_with_missing) Not yet supported.  To be added later
2240         if it's important.
2241         (repl_num_con) Removed.
2242         (collapse_node) New function.
2243         (force_repl_num_con) Removed.
2244         (set_number) New function.
2245         (set_number_errno) New function.
2246         (repl_str_con) Removed.
2247         (set_string) New function.
2248         (yrmoda) Tighten boundary conditions.  Adopt 2030 cut-off for
2249         2-digit years.
2250         (dump_node) No special case for OP_AND, OP_OR.
2251
2252         * expr-prs.c: (expr_prs) Honor EXPR_NO_OPTIMIZE bit.  Rewrite.
2253         (expr_get_type) New function.
2254         (type_check) Rewrite.
2255         (type_coercion) New function.
2256         (struct operator) New structure.
2257         (match_operator New function.
2258         (parse_binary_operators) New function.
2259         (parse_inverting_unary_operator) New function.
2260         (parse_or) Rewritten.
2261         (parse_and) Rewritten.
2262         (parse_not) Rewritten.
2263         (parse_rel) Rewritten.
2264         (parse_add) Rewritten.
2265         (parse_mul) Rewritten.
2266         (parse_neg) Rewritten.
2267         (parse_exp) Rewritten.
2268         (parse_sysvar) Add $TRUE, $FALSE system variables.
2269         Get $LENGTH, $WIDTH from get_viewlength(), get_viewwidth().
2270         (parse_primary) Use allocate_var_node(), allocate_num_con(),
2271         allocate_str_con().
2272         (struct function) Remove desc, change `func' prototype.
2273         (unary_func) Remove special cases.
2274         (MISSING_func) Reduce to unary_func() that just returns a boolean.
2275         (SYSMIS_func) Handle SYSMIS((x)) like SYSMIS(x).
2276         (VALUE_func) Use allocate_var_node().
2277         (nary_num_func) Allow MIN and MAX for strings.
2278         Use allocate_var_node().  Properly clean up.
2279         Fix return type.
2280         (generic_str_func) Use local table instead of removed `desc'
2281         member.  Mostly rewrite.
2282         (get_num_args) Revise error message.
2283         (parse_function) Return EXPR_ERROR, not 0 on error.
2284         (macro op) Removed.
2285         (macro varies) Removed.
2286         (ops[]) Use expr.def.
2287         (free_node) Do nothing if node is null.
2288         (allocate_num_con) New function.
2289         (allocate_str_con) New function.
2290         (allocate_var_node) New function.
2291         (allocate_binary_nonterminal) New function.
2292         (append_nonterminal_arg) Removed.
2293         (static var func_tab[]) Revised.
2294         (expr_debug_print_postfix) Make parameter const.
2295         Use printf() instead of debug_printf().
2296
2297         * expr.def: New file.
2298         
2299         * expr.h: Change PXP_* to EXPR_*, all references updated.  Also
2300         use named enum instead of unnamed, all references updated.  Add
2301         EXPR_ANY, EXPR_NO_OPTIMIZE.
2302
2303         * exprP.h: Remove EX_*.  Add DEFINE_OPERATOR.  Use expr.def
2304         instead of defining OP_* directly.
2305         (macro IS_TERMINAL) New macro.
2306         (macro IS_NONTERMINAL) New macro.
2307         (enum OP_NO_FLAGS) New.
2308         
2309 Fri Mar 26 00:18:01 2004  Ben Pfaff  <blp@gnu.org>
2310
2311         * error.c: (err_assert_fail) msg variable needs to be non-const.
2312
2313 Fri Mar 26 00:17:24 2004  Ben Pfaff  <blp@gnu.org>
2314
2315         * debug.c: (cmd_debug_evaluate) Rewrite.
2316
2317 Fri Mar 26 00:15:13 2004  Ben Pfaff  <blp@gnu.org>
2318
2319         Fix some CROSSTABS bit rot stupidity.
2320
2321         * crosstabs.q: Reorder the CELLS subcommands for compatibility.
2322         (internal_cmd_crosstabs) Initializes cells[] correctly.
2323         (float_M_suffix) Rename format_cell_entry(), change prototype,
2324         rewrite.
2325         (display_crosstabulation) Fix cell formatting.
2326
2327 Fri Mar 26 00:14:09 2004  Ben Pfaff  <blp@gnu.org>
2328
2329         Make lex_rest_of_line(), lex_entire_end() not discard lines.  Have
2330         to call lex_discard_line() to do that.
2331
2332         * command.c: (run_command) Call lex_discard_line() after
2333         lex_rest_of_line().
2334
2335         * lexer.c: (lex_entire_end) Change behavior.
2336         (lex_rest_of_line) Change behavior.  Return const char *.
2337         (lex_discard_line) Don't clear getl_buf, don't emit message.
2338
2339         * main.c: (handle_error) Emit message here.
2340
2341         * repeat.c: (internal_cmd_do_repeat) Use lex_discard_line()
2342         instead of lex_entire_line().
2343
2344         * str.c: (mm_find_reverse) Make length params size_t.  Rewrite.
2345
2346         * title.c: (get_title) Call lex_discard_line() after
2347         lex_rest_of_line().
2348         (cmd_file_label) Ditto.
2349         (cmd_document) Deal with const char * return value.
2350
2351 Fri Mar 26 00:10:16 2004  Ben Pfaff  <blp@gnu.org>
2352
2353         Removed REMARK command.
2354
2355         * command.c: (extract_prefix) Removed.
2356         (output_line) Removed.
2357         (cmd_remark) Removed.
2358
2359         * command.def: Remove REMARK.
2360
2361 Fri Mar 26 00:08:38 2004  Ben Pfaff  <blp@gnu.org>
2362
2363         Added abort() after lots of assert(0) invocations to avoid some
2364         compiler warnings.  We really need a NOT_REACHED macro.
2365
2366 Tue Mar 23 08:00:42 WAST 2004 John Darrington <john@darrington.wattle.id.au>
2367
2368         * sort.c: Added missing call to temp_file_close.  Changed error 
2369         messages to warnings.
2370
2371         * set.q: Improved setting of set_view{length,width} to be more tolerant
2372         of buggy OSes.
2373
2374 Sun Mar 21 10:11:14 WST 2004 John Darrington <john@darrington.wattle.id.au>
2375
2376         * val-labs.c: Fixed a bug where PSPP would crash, if VALUE LABELS was
2377         used with incorrect syntax.
2378
2379         * error.c, error.h et al:  Overridden definition of assert for a
2380         custom one.
2381
2382         * test-q.c: Fixed a buglet where it would crash if no /VARIABLES
2383         subcommand was given when it ought to have been.
2384
2385 Sat Mar 20 22:19:08 2004  Ben Pfaff  <blp@gnu.org>
2386
2387         * tab.c: (tab_vline) Fix assertions to respect row_ofs and
2388         col_ofs.
2389         (tab_hline) Ditto.
2390         (tab_box) Ditto.
2391         (tab_joint_text) Ditto.
2392
2393 Sat Mar 20 17:57:23 2004  Ben Pfaff  <blp@gnu.org>
2394
2395         * levene.c: Add #include.
2396
2397         * set.q: (set_viewport) Add `int' argument to make its prototype
2398         correct for signal().
2399
2400 Sat Mar 20 15:35:17 2004  Ben Pfaff  <blp@gnu.org>
2401
2402         * expr-evl.c: (expr_evaluate) Assert that `c' is nonzero before
2403         using it.
2404
2405 Sat Mar 20 15:18:16 2004  Ben Pfaff  <blp@gnu.org>
2406
2407         Changed DFM from open-at-first-access to explicit-open.  Before,
2408         calling dfm_get_record() or dfm_put_record() would automatically
2409         open the file.  Now, you have to call dfm_open_for_reading() or
2410         dfm_open_for_writing() explicitly.  This makes it possible to
2411         check permissions, file existence, etc. earlier.
2412
2413         Also made struct file_handle more opaque, and clean up in general.
2414
2415         * data-list.c: (cmd_data_list) Open handle for reading.
2416
2417         * dfm.c: (struct dfm_fhuser_ext) Add `where', `saw_begin_data'
2418         members.
2419         (open_file_r) Renamed dfm_open_for_reading(), rewrote.
2420         (open_file_w) Renamed dfm_open_for_writing(), rewrote.
2421         (open_inline_file) Removed.
2422         (read_record) For inline_file, if we haven't seen BEGIN DATA, read
2423         it.  Deal with line_number in extension record instead of file
2424         handle.
2425         (dfm_get_record) Rewrote.
2426         (dfm_put_record) Rewrote.
2427         (dfm_push) Assert file is open and one of ours.  Deal with
2428         line_number in extension record instead of file handle.
2429         (dfm_pop) Assert file is open and one of ours.  Deal with
2430         line_number in extension record instead of file handle.
2431         (cmd_begin_data) Use dfm_open_for_reading().  Mark that we saw
2432         BEGIN DATA.     
2433
2434         * file-handle.h: (enum constants RH_RF_*) Removed.
2435         (enum constants FH_MD_*) Removed.
2436         (struct file_handle) Removed `name', `norm_fn', `fn', `where',
2437         `recform', `lrecl', `mode' members.  Public references to
2438         `recform' changed to use handle_get_mode(), references to `lrecl'
2439         changed to use handle_get_record_width().  Added `private' member.
2440         (enum file_handle_mode) New.
2441
2442         * file-handle.q: (struct private_file_handle) New structure.
2443         (struct file_handle_list) New structure.
2444         (static var files) New.
2445         (static var file_handles) Removed.
2446         (init_file_handle) Removed.
2447         (create_file_handle) Removed.
2448         (get_handle_with_name) New function.
2449         (get_handle_for_filename) New function.
2450         (cmd_file_handle) Rewritten.
2451         (hash_file_handle) Removed.
2452         (cmp_file_handle) Removed.
2453         (fh_init_files) Rewritten.
2454         (fh_parse_file_handle) Rewritten.  Allows identifiers as
2455         filenames.
2456         (fh_get_handle_by_name) Renamed handle_get_name(), all references
2457         updated.  Rewritten.
2458         (fh_get_handle_by_filename) Renamed handle_get_filename(), all
2459         references updated.  Rewritten.
2460         (fh_record_width) Renamed handle_get_record_width(), all
2461         references updated.  Rewritten.
2462         (handle_get_mode) New function.
2463
2464         * file-type.c: (cmd_file_type) Open handle for reading.
2465
2466         * filename.c: [unix] (struct file_identity) New structure.
2467         [unix] (fn_get_identity) New function.
2468         [unix] (fn_free_identity) New function.
2469         [unix] (fn_compare_file_identities) New function.
2470         [!unix] (struct file_identity) New structure.
2471         [!unix] (fn_get_identity) New function.
2472         [!unix] (fn_free_identity) New function.
2473         [!unix] (fn_compare_file_identities) New function.
2474
2475         * lexer.c: (static var put) Renamed put_token, all references
2476         updated.
2477         (static var put_tokstr) New.
2478         (static var put_tokval) New.
2479         (lex_init) Initialize put_tokstr().
2480         (restore_token) New function.
2481         (save_token) New function.
2482         (lex_get) Use restore_token().
2483         (lex_put_back) Use save_token().
2484         (lex_put_back_id) New function.
2485         (lex_put_forward) Removed.
2486         (lex_preprocess_line) Set put_token instead of using
2487         lex_put_forward().
2488         (lex_negative_to_dash) Use save_token(), set put_token directly.
2489         (dump_token) Use stderr instead of stdout.
2490
2491         * main.c: (main) Remove call to cmd_init().
2492         
2493         * matrix-data.c: (cmd_matrix_data) Open file for reading.
2494
2495         * pfm-read.c: Use handle_get_filename() instead of trying to use
2496         h->fn directly, all over.
2497
2498         * pfm-write.c: Ditto.
2499
2500         * print.c: (internal_cmd_print) Open handle for writing.
2501         (dump_table) Use handle_get_filename().
2502         (print_trns_proc) Use handle_get_mode().
2503         (cmd_print_space) Use fh_parse_file_handle().
2504         Open handle for writing.
2505         [0] (debug_print) Removed.
2506
2507         * sfm-read.c: Use handle_get_filename() instead of trying to use
2508         h->fn directly, all over.
2509
2510         * sfm-write.c: Ditto.
2511
2512 Sat Mar 20 14:35:48 2004  Ben Pfaff  <blp@gnu.org>
2513
2514         Fix memory leaks.
2515         
2516         * autorecode.c: (arc_free) Free arc->src_values.
2517
2518         * error.c: (msg) Free buf.
2519
2520         * val-labs.c: (do_value_labels) Always free vars.
2521
2522         * vfm.c: (close_active_file) If sink has no make_source then call
2523         its destroy function.
2524
2525 Sat Mar 20 14:00:24 2004  Ben Pfaff  <blp@gnu.org>
2526
2527         Fixed cmd_parse() so that it always skips past a full command
2528         name.  A few special commands for which this would be bad get
2529         special treatment.  This lets us drop code for skipping past the
2530         end of a command name in most cmd_*() functions.  It's not worth
2531         listing all the commands affected.
2532
2533         * command.c: (struct command) Remove `cmd' member, replace by
2534         `name' member, all references updated.  Remove `word', `next',
2535         `skip_entire_name' members.
2536         (macro DEFCMD) Deal with revised `struct command'.
2537         (macro UNIMPL) Ditto.
2538         (macro SPCCMD) New macro for commands whose last word shouldn't be
2539         skipped.
2540         (static array cmd_table[]) Make const, rename `commands', remove
2541         sentinel element.
2542         (macro COMMAND_CNT) New macro.
2543         (split_words) Removed.
2544         (cmd_init) Removed.
2545         (FILE_TYPE_okay) Make parameter const.
2546         (cmd_parse) Improve error messages.
2547         (match_strings) New function.
2548         (next_word) New function.
2549         (enum command_match) New enum.
2550         (conflicting_3char_prefixes) New function.
2551         (conflicting_3char_prefix_command) New function.
2552         (cmd_match_words) New function.
2553         (count_matching_commands) New function.
2554         (get_command_name) New function.
2555         (free_words) New function.
2556         (unknown_command_error) New function.
2557         (figure_out_command) Renamed parse_command_name(), rewritten.
2558
2559         * command.def: Removed @ command.  Marked BEGIN DATA, DOCUMENT,
2560         FILE LABEL, REMARK, SUBTITLE, TITLE as special.  Renamed EVALUATE
2561         to DEBUG EVALUATE.  Added N alias for N OF CASES, SORT alias for
2562         SORT CASES.
2563
2564         * command.h: (macro SPCCMD) New.
2565
2566         * include.c: (cmd_include_at) Removed.
2567         (cmd_include) Allow identifier to be used as filename.
2568
2569         * inpt-pgm.c: (cmd_reread) Use fh_parse_file_handle().
2570
2571         * t-test.q: (cmd_t_test) Command name is now parsed for us.
2572         
2573
2574 Sat Mar 20 13:56:00 2004  Ben Pfaff  <blp@gnu.org>
2575
2576         Start work on better test framework.
2577         
2578         * Makefile.am: (pspp_sources) Add debug.c.
2579         
2580         * debug.c: New file.
2581
2582         * compute.c: (cmd_evaluate) Moved to debug.c, renamed
2583         cmd_debug_evaluate().
2584
2585         * expr-prs.c: (expr_parse) Remove PXP_DUMP support.
2586
2587         * expr.h: (enum constant PXP_DUMP) Removed.
2588
2589 Sat Mar 20 00:05:42 WST 2004 John Darrington <john@darrington.wattle.id.au>
2590
2591         * set.q:  Implemented the SHOW command, and synced it to the existing 
2592         SET cmd.
2593
2594         Added a handler for SIGWINCH so that viewlength and viewwidth follow
2595         changes as the window size is changed.
2596
2597         Added fallback to set viewlength and viewwidth from LINES and COLUMS
2598         environment variables if other methods are not available.
2599
2600         glob.c: Removed a lot of global variables from glob.c and encapsulated 
2601         them in set.q
2602
2603         random.c: Tidied up the way the random seed is set.
2604
2605         str.c: Added a ds_vprintf function.
2606
2607         error.c: Extended dump_message so that messages are always broken at
2608         '\n' characters.
2609         
2610 Thu Mar 18 11:07:14 2004  Ben Pfaff  <blp@gnu.org>
2611
2612         * pfm-write.c: (bufwrite) Write out the correct element for string
2613         variables.  From Andreas Streichardt <streichardt@globalpark.de>.
2614
2615 Mon Mar 15 20:48:03 2004  Ben Pfaff  <blp@gnu.org>
2616
2617         Get rid of static and global (!) vars in matrix-data.c.
2618
2619         * matrix-data.c: (static var nr_data) Removed.
2620         (static var nr_factor_values) Removed.
2621         (static var max_cell_index) Removed.
2622         (static var split_values) Removed.
2623         (struct nr_aux_data) New structure.
2624         (read_matrices_without_rowtype) Use a local struct nr_aux_data in
2625         place of static vars, pass to create_case_source() and procedure()
2626         as aux data.
2627         (nr_read_data_lines) Use struct nr_aux_data * parameter instead of
2628         struct matrix_data_pgm *.
2629         (nr_read_splits) Ditto.
2630         (nr_read_factors) Ditto.
2631         (nr_output_data) Ditto.
2632         (static var wr_content) Removed.
2633         (global var wr_data) Removed.
2634         (global var wr_current) Removed.
2635         (struct wr_aux_data) New structure.
2636         (read_matrices_with_rowtype) Use a local struct wr_aux_data in
2637         place of static vars, pass to create_case_source() and procedure()
2638         as aux data.
2639         (matrix_data_read_with_rowtype) Use struct wr_aux_data * parameter
2640         instead of matrix_data_pgm *.
2641         (wr_read_splits) Ditto.
2642         (wr_output_data) Ditto.
2643         (wr_read_rowtype) Ditto.
2644         (wr_read_factors) Ditto.
2645         (wr_read_indeps) Ditto.
2646         
2647 Mon Mar 15 20:07:29 2004  Ben Pfaff  <blp@gnu.org>
2648
2649         Get rid of static vars in autorecode.c.
2650
2651         * autorecode.c: (struct autorecode_trns) Rename `arc' to `specs',
2652         `n_arc' to `spec_cnt'.  All references updated.
2653         (static var v_src) Removed.
2654         (static var v_dest) Removed.
2655         (static var h_trns) Removed.
2656         (static var nv_src) Removed.
2657         (static var descend) Removed.
2658         (static var print) Removed.
2659         (enum direction) New enum.
2660         (struct autorecode_pgm) New structure.
2661         (cmd_autorecode) Use struct autorecode_pgm instead of static vars.
2662         Move n_dest local var into struct autorecode_pgm for ease of
2663         clean-up.  Use arc_free().
2664         (arc_free) New function.
2665         (recode) Modify to take struct autorecode_pgm * parameter instead
2666         of using statics.  Let the caller clean up.
2667         (autorecode_proc_func) Use struct autorecode_pgm * auxiliary data
2668         instead of statics.  Rearrange code a little.
2669
2670 Mon Mar 15 00:25:02 2004  Ben Pfaff  <blp@gnu.org>
2671
2672         Get rid of static, global vars in recode.c.  Remove debug code.
2673
2674         * recode.c: (static var head) Removed.
2675         (global var v) Removed.
2676         (global var nv) Removed.
2677         (cmd_recode) New local variables head, v, nv.  Initialize and free
2678         v.  Don't call debug_print().
2679         [DEBUGGING] (dump_dest) Removed.
2680         [DEBUGGING] (debug_print) Removed.
2681
2682 Mon Mar 15 00:14:49 2004  Ben Pfaff  <blp@gnu.org>
2683
2684         Get rid of static vars in expr-opt.c.
2685
2686         * expr-opt.c: (static var e) Removed.
2687         (static var nop) Removed.
2688         (static var mop) Removed.
2689         (static var ndbl) Removed.
2690         (static var mdbl) Removed.
2691         (static var nstr) Removed.
2692         (static var mstr) Removed.
2693         (static var nvars) Removed.
2694         (static var mvars) Removed.
2695         (struct expr_dump_state) New structure.
2696         (dump_expression) Use new struct expr_dump_state instead of static
2697         vars and pass to functions we call.
2698         (dump_node) Use struct expr_dump_state * parameter.
2699         (emit) Ditto.
2700         (emit_num_con) Ditto.
2701         (emit_str_con) Ditto.
2702         (emit_var) Ditto.
2703         
2704 Mon Mar 15 00:03:51 2004  Ben Pfaff  <blp@gnu.org>
2705
2706         Get rid of static var in COUNT.
2707
2708         * count.c: (static var head) Move into cmd_count().
2709         (cmd_count) [DEBUGGING] Don't call debug_print.
2710         [DEBUGGING] (debug_print) Removed.
2711
2712 Sun Mar 14 23:56:09 2004  Ben Pfaff  <blp@gnu.org>
2713
2714         Get rid of static vars in VALUE LABELS, ADD VALUE LABELS.
2715
2716         * val-labs.c: (static var v) Removed.
2717         (static var nv) Removed.
2718         [DEBUGGING] (debug_print) Removed.
2719         (verify_val_labs) Add struct variable **, int parameters.
2720         (get_label) Ditto.  Improve error messages, streamline.
2721         (erase_labels) New function for erasing value labels, taking over
2722         part of verify_val_labs()'s function.
2723         (init) Removed.
2724         (done) Removed.
2725         (cmd_value_labels) No need to call init() or done() anymore.
2726         (cmd_add_value_labels) Ditto.
2727         (do_value_labels) Add vars, var_cnt local variables.  Clean up
2728         after them internally.  Call erase_labels() if we should.  Don't
2729         call debug_print().
2730
2731 Sun Mar 14 23:33:53 2004  Ben Pfaff  <blp@gnu.org>
2732
2733         Get rid of static vars in MATCH FILES.
2734         
2735         * get.c: (static var mtf_head) Removed.
2736         (static var mtf_tail) Removed.
2737         (static var mtf_by) Removed.
2738         (static var mtf_n_by) Removed.
2739         (static var mtf_master) Removed.
2740         (static var mtf_seq_num) Removed.
2741         (static var mtf_seq_nums) Removed.
2742         (static var mtf_sink) Removed.
2743         (static var mtf_case) Removed.
2744         (struct mtf_proc) New structure.
2745         (cmd_match_files) Use struct mtf_proc instead of static vars.
2746         (mtf_processing_finish) Ditto.
2747         (mtf_free) Ditto.
2748         (mtf_delete_file_in_place) Ditto.
2749         (mtf_read_nonactive_records) Ditto.
2750         (mtf_compare_BY_values) Ditto.
2751         (mtf_processing) Ditto.
2752         (mtf_merge_dictionary) Ditto.
2753
2754 Sun Mar 14 22:48:12 2004  Ben Pfaff  <blp@gnu.org>
2755
2756         * command.def: Add CASESTOVARS, VARSTOCASES unimplemented commands.
2757
2758         * dictionary.c: (dict_rename_var) Add assertion.
2759         (dict_contains_var) Check by index instead of name.
2760
2761 Sun Mar 14 22:01:02 2004  Ben Pfaff  <blp@gnu.org>
2762
2763         Get rid of compaction_necessary, compaction_nval, compaction_case.
2764         Redo VFM interface.  Replace disk_sink and memory_sink by
2765         storage_sink, disk_source and memory_source by storage_source.
2766
2767         * vfm.h: (struct case_sink) Add `dict', `idx_to_fv', `value_cnt'
2768         members.
2769
2770         * vfm.c: 
2771         (struct write_case_data) Remove `begin_func', `end_func',
2772         `func_aux' members.  Add `aux', `trns_case', `sink_case',
2773         `cases_written', `cases_analyzed' members.
2774         (global var compaction_necessary) Make static.
2775         (global var compaction_nval) Removed.
2776         (global var compaction_case) Removed.
2777         (static var case_count) Removed.
2778         (struct procedure_aux_data) Removed.
2779         (struct split_aux_data) Removed.
2780         (procedure) Remove begin_func, end_func parameters.  Rewrite.
2781         (static var not_canceled) Removed.
2782         (process_active_file) Removed.
2783         (process_active_file_write_case) Removed.
2784         (process_active_file_output_case) Removed.
2785         (prepare_for_writing) Moved into open_active_file().
2786         (arrange_compaction) Ditto.
2787         (setup_lag) Ditto.
2788         (open_active_file) Rewrote.
2789         (write_case) New function.
2790         [DEBUGGING] (index_to_varname) Removed.
2791         (execute_transformations) New function.
2792         (exclude_this_case) Renamed filter_case(), changed interface.
2793         (clear_case) Added struct ccase * parameter to interface.
2794         (close_active_file) Added struct write_case_data * parameter,
2795         rewrote.
2796         (disk_sink_create) Removed.
2797         (disk_sink_destroy) Removed.
2798         (disk_sink_make_source) Removed.
2799         (disk_sink_write) Removed.
2800         (disk_source_count) Removed.
2801         (disk_source_destroy) Removed.
2802         (disk_source_read) Removed.
2803         (global var disk_sink_class) Removed.
2804         (global var disk_source_class) Removed.
2805         (global var memory_sink_class) Removed.
2806         (global var memory_source_class) Removed.
2807         (memory_sink_create) Removed.
2808         (memory_sink_destroy) Removed.
2809         (memory_sink_make_source) Removed.
2810         (memory_sink_write) Removed.
2811         (memory_source_count) Removed.
2812         (memory_source_destroy) Removed.
2813         (memory_source_get_cases) Removed.
2814         (memory_source_read) Removed.
2815         (memory_source_set_cases) Removed.
2816         (struct disk_stream_info) Removed.
2817         (struct memory_sink_info) Removed.
2818         (struct memory_source_info) Removed.
2819         (write_active_file_to_disk) Removed.
2820         (destroy_storage_stream_info) New function.
2821         (global var null_sink_class) New var.
2822         (global var storage_sink_class) New var.
2823         (global var storage_source_class) New var.
2824         (open_storage_file) New function.
2825         (storage_sink_destroy) New function.
2826         (storage_sink_make_source) New function.
2827         (storage_sink_open) New function.
2828         (storage_sink_write) New function.
2829         (storage_source_count) New function.
2830         (storage_source_destroy) New function.
2831         (storage_source_get_cases) New function.
2832         (storage_source_on_disk) New function.
2833         (storage_source_read) New function.
2834         (storage_source_set_cases) New function.
2835         (storage_source_to_disk) New function.
2836         (storage_to_disk) New function.
2837         (struct storage_stream_info) New structure.
2838         (write_storage_file) New function.
2839         (procedure_write_case) Removed.
2840         (create_case_source) Add `struct dictionary *' parameter, all
2841         references updated.
2842         (create_case_sink) Ditto.
2843         (free_case_sink) New function.
2844         (struct split_aux_data) New structure.
2845         (procedure_with_splits) New function implementing what procedure()
2846         used to.
2847         (SPLIT_FILE_proc_func) Removed.
2848         (procedure_with_splits_callback) New function.
2849         (equal_splits) New function.
2850         
2851         * aggregate.c: Pass around a struct instead of using statics.
2852         (static var outfile) Remove.
2853         (enum type) Give it tag `missing_treatment'.
2854         (static var missing) Remove.
2855         (static var sort) Remove.
2856         (static var agr_first) Remove.
2857         (static var agr_next) Remove.
2858         (static var case_count) Remove.
2859         (static var prev_case) Remove.
2860         (static var buf64_1xx) Remove.
2861         (static var buf_1xx) Remove.
2862         (struct agr_proc) New structure incorporating the above.
2863         (cmd_aggregate) Use new struct.  Clean up error handling using
2864         agr_destroy().  Completely rewrite actual implementation of
2865         aggregation.
2866         (create_sysfile) Add struct agr_proc * parameter, modify
2867         accordingly.
2868         (parse_aggregate_functions) Ditto.
2869         (free_aggregate_functions) Ditto.  Rename agr_destroy().
2870         (aggregate_single_case) Add struct agr_proc * parameter, modify
2871         accordingly.
2872         (accumulate_aggregate_info) Ditto.
2873         (dump_aggregate_info) Ditto.
2874         (initialize_aggregate_info) Ditto.
2875         (agr_00x_trns_proc) Removed.
2876         (agr_00x_end_func) Removed.
2877         (agr_10x_trns_proc) Removed.
2878         (agr_10x_trns_free) Removed.
2879         (agr_10x_end_func) Removed.
2880         (agr_11x_read) Removed.
2881         (agr_11x_finish) Removed.
2882         [DEBUGGING] (debug_print) Removed.
2883         (write_case_to_sfm) Add struct agr_proc * parameter, modify
2884         accordingly.
2885         (agr_to_active_file) New function.
2886         (presorted_agr_to_sysfile) New function.
2887         (sort_agr_to_sysfile) New function.
2888
2889         * autorecode.c: (cmd_autorecode) Use procedure_with_splits().
2890
2891         * crosstabs.q: (internal_cmd_crosstabs) Ditto.
2892
2893         * descript.q: (cmd_descriptives) Ditto.
2894
2895         * dfm.c: (cmd_begin_data) Check for storage_source_class.  Adapt
2896         to new procedure() interface.
2897
2898         * command.c: (cmd_execute) Adapt to new procedure() interface.
2899
2900         * dictionary.c: (dict_compact_values) Also delete scratch
2901         variables.
2902         (dict_get_compacted_value_cnt) New function.
2903         (dict_get_compacted_idx_to_fv) New function.
2904
2905         * flip.c: (cmd_flip) Warn about and cancel TEMPORARY.
2906         (cmd_flip) Adapt to new procedure() interface.
2907         (flip_sink_write) Use sink->idx_to_fv.
2908
2909         * frequencies.q: (internal_cmd_frequencies) Use
2910         procedure_with_splits().
2911
2912         * get.c: (cmd_save_internal) Adapt to new procedure() interface.
2913         (static var mtf_sink) New static var.
2914         (static var mtf_case) New static var.
2915         (cmd_match_files) Warn about and cancel TEMPORARY.  Redo the way
2916         we actually implement the matching.
2917         (mtf_delete_file_in_place) Use mtf_case.
2918         (mtf_processing) Use mtf_case and mtf_sink.
2919         (cmd_export) Adapt to new procedure() interface.
2920
2921         * levene.c: (levene) Use procedure_with_splits().
2922
2923         * list.q: (cmd_list) Use procedure_with_splits().
2924
2925         * matrix-data.c: (read_matrices_without_rowtype) Adapt to new
2926         procedure() interface.
2927         (read_matrices_with_rowtype) Ditto.
2928
2929         * modify-vars.c; (cmd_modify_vars) Warn about and cancel
2930         TEMPORARY.  Adapt to new procedure() interface.
2931
2932         * rename-vars.c: Warn about and cancel TEMPORARY.
2933
2934         * sort.c: (cmd_sort_cases) Warn about TEMPORARY.
2935         (sort_cases) Use dict_get_compacted_value_cnt() instead of
2936         compaction_nval.  Adapt to new procedure() interface.  Use
2937         storage_source_to_disk().
2938         (do_internal_sort) Don't try to dump the cases to memory.
2939         (compare_case_lists) Pass null idx_to_fv.
2940         (struct initial_run_state) Add `idx_to_fv' member.  Remove
2941         `case_size' member.
2942         (write_initial_runs) Don't initialize irs->case_size.  Adapt to
2943         new procedure() interface.  Reset irs->idx_to_fv after calling
2944         procedure().
2945         (sort_sink_write) Set irs->idx_to_fv.  Use case_size from struct
2946         sort_cases_pgm.  Pass irs, not struct sort_cases_pgm to
2947         push_heap().
2948         (destroy_initial_run_state) Don't dereference irs after freeing
2949         it.
2950         (allocate_cases) Don't calculate case_size locally.
2951         (compare_record) Add idx_to_fv parameter.
2952         (compare_record_run) Change parameter from struct sort_cases_pgm *
2953         to struct initial_run_state *.  Pass irs->idx_to_fv to
2954         compare_record().
2955         (compare_record_run) Third parameter now a struct
2956         initial_run_state *.
2957         (output_record) No need for out_case anymore.  Pass irs, not
2958         struct sort_cases_pgm to pop_heap().  Use case_size from struct
2959         sort_cases_pgm.
2960         (merge) Use case_size from struct sort_cases_pgm.
2961         (merge_once) Use case_size from struct sort_cases_pgm.
2962         Pass null pointer to compare_record() as idx_to_fv.
2963         (global var sort_sink_class) Make static.
2964
2965         * t-test.q: (cmd_t_test) Use procedure_with_splits().
2966
2967         * temporary.c: Remove debugging crap.
2968
2969 Sat Mar 13 14:19:52 WST 2004 John Darrington <john@darrington.wattle.id.au>
2970
2971         * t-test.q, levene.c: Fixed up the handling of MISSING values
2972         int the T-TEST
2973
2974 Fri Mar 12 16:23:35 WST 2004 John Darrington <john@darrington.wattle.id.au>
2975
2976         * t-test.q, levene.c: Added support for T-TEST /GROUP where only 
2977         one value is given.
2978
2979 Wed Mar 10 23:25:13 2004  Ben Pfaff  <blp@gnu.org>
2980
2981         Change explicit variable name checks into use of
2982         dict_class_from_id().
2983
2984         * dictionary.c: (dict_create_var)  Change explicit variable name
2985         check into use of dict_class_from_id().
2986
2987         * get.c: (trim_dictionary) Ditto.
2988
2989         * sel-if.c: (cmd_filter) Ditto.
2990
2991         * sysfile-info.c: (cmd_display) Ditto.
2992
2993         * vars-prs.c: (parse_DATA_LIST_vars) Ditto.
2994
2995         * vfm.c: (arrange_compaction) Ditto.
2996
2997         * weight.c: (cmd_weight) Ditto.
2998
2999 Wed Mar 10 21:16:34 2004  Ben Pfaff  <blp@gnu.org>
3000
3001         * temporary.c: (cmd_temporary) When TEMPORARY was the first
3002         transformation following the input program, if any, for some
3003         reason we special-cased f_trns.  That's just wrong.  It should
3004         always be set to n_trns.
3005
3006 Tue Mar  9 23:44:40 2004  Ben Pfaff  <blp@gnu.org>
3007
3008         * format.c: (parse_format_specifier_name) Fix brown-bag bug
3009         introduced in last check-in.
3010
3011 Tue Mar  9 23:10:41 2004  Ben Pfaff  <blp@gnu.org>
3012
3013         * format.c: (global array translate_fmt[]) Removed.
3014         (translate_fmt) New function as replacement.
3015         (parse_format_specifier_name) Rewrite.
3016
3017         * pfm-read.c: (convert_format) Use translate_fmt() instead of
3018         translate_fmt[].
3019
3020         * sfm-read.c: (parse_format_spec) Ditto.
3021
3022         * postscript.c: (text) Fix handling of fonts with missing
3023         ligatures.
3024
3025         * sort.c: (struct external_sort) Add temp_name member.
3026         (destroy_external_sort) Free temp_dir, temp_name members.
3027         (init_external_sort) Allocate temp_name.
3028         (get_temp_file_name) Change prototype.
3029         (open_temp_file) Deal with change to get_temp_file_name().
3030         (close_temp_file) Ditto.
3031         (remove_temp_file) Ditto.
3032         (write_temp_file) Ditto.
3033         (read_temp_file) Ditto.
3034         (sort_sink_destroy) Removed.
3035         (sort_sink_class) Change destroy member to null.
3036
3037 Tue Mar  9 22:36:34 2004  Ben Pfaff  <blp@gnu.org>
3038
3039         Eliminate temp_case.
3040
3041         * aggregate.c: (cmd_aggregate) No need to save/restore temp_case
3042         anymore.  Use agr_11x_finish().
3043         (aggregate_single_case) Make first param const.
3044         (accumulate_aggregate_info) Ditto.
3045         (agr_00x_end_func) Use compaction_case, not temp_case.
3046         (agr_11x_func) Break into agr_11x_read(), agr_11x_finish().
3047
3048         * data-list.c: (struct data_list_pgm) Add `case_size' member.
3049         (cmd_data_list) Initialize case_size.
3050         (read_from_data_list_fixed) Add struct ccase * param, use instead
3051         of temp_case.
3052         (read_from_data_list_free) Ditto.
3053         (read_from_data_list_list) Ditto.
3054         (read_one_case) Rename data_list_trns_proc(), all references
3055         updated.  Add argument in calling above functions.  Use c
3056         argument instead of temp_case.
3057         (destroy_dls) Rename data_list_trns_free(), all references
3058         updated.
3059
3060         * expr-evl.c: (expr_evaluate) Make second parameter const.
3061
3062         * file-type.c: (struct file_type_pgm) Add `case_size' member.
3063         (cmd_end_file_type) Initialize `case_size'.
3064         (file_type_source_read) Add struct ccase * parameter.  Use instead
3065         of temp_case.
3066
3067         * flip.c: Rewritten.
3068
3069         * get.c: (struct get_pgm) New structure to keep track of
3070         case_size.
3071         (cmd_get) Initialize case_size.
3072         (cmd_import) Ditto.
3073         (get_source) Deal with struct get_pgm.
3074         (get_source_read) Add struct ccase * parameter, use instead of
3075         temp_case.
3076         (import_source_read) Ditto.
3077
3078         * get.c: Use a null pointer instead of temp_case to represent the
3079         "current case" in a struct mtf_file's input member.
3080         (mtf_processing_finish) Pass null to mtf_processing(), not
3081         temp_case.
3082         (mtf_read_nonactive_records) Don't set iter->input to temp_case.
3083         (mtf_compare_BY_values) Add extra arg, use instead of null input
3084         members.
3085         (mtf_processing) Use c parameter instead of temp_case.  Pass
3086         compaction_case to process_active_file_output_case().
3087         
3088         * glob.c: (global variable temp_case) Removed.
3089
3090         * inpt-pgm.c: (struct input_program_pgm) Add `case_size' member.
3091         (cmd_input_program) Initialize case_size.  Set
3092         vfm_source->value_cnt.
3093         (init_case) Add struct ccase * parameter, use instead of
3094         temp_case.
3095         (clear_case) Ditto.
3096         (input_program_source_read) Ditto.
3097
3098         * matrix-data.c: (matrix_data_read_without_rowtype) Ditto.
3099         (dump_cell_content) Ditto.
3100         (nr_output_data) Ditto.
3101         (read_matrices_without_rowtype) Ditto.
3102         (matrix_data_read_with_rowtype) Ditto.
3103         (wr_read_splits) Ditto.
3104         (wr_output_data) Ditto.
3105
3106         * sort.h: (struct sort_cases_pgm) New member `case_size'.
3107         
3108         * sort.c: (sort_cases) Initialize scp->case_size.
3109         (struct external_sort) Remove `case_size' member.
3110         (write_initial_runs) Only call vfm_sink->class_destroy if
3111         non-null.
3112         (struct sort_source_aux) New structure.
3113         (sort_source_read_helper) New function.
3114         (sort_source_read) Use sort_source_read_helper().
3115         (read_sort_output) Change interface to be more reasonable.
3116         (read_internal_sort_output) Ditto.
3117         (read_external_sort_output) Ditto.
3118
3119         * vars-prs.c: (dict_class_to_name) Pass return value through
3120         gettext.
3121
3122         * vfm.c: (struct procedure_aux_data) Add `trns_case' member.
3123         (procedure) Initialize trns_case.
3124         (procedure) Pass trns_case to vfm_source->class->read().
3125         Free trns_case.
3126         (process_active_file) Start using struct procedure_aux_data.
3127         (process_active_file_write_case) Pass trns_case to
3128         transformations, lag_case(), clear_case().
3129         (process_active_file_output_case) Add struct ccase * parameter.
3130         (create_trns_case) New function.
3131         (make_temp_case) Removed.
3132         (vector_initialization) Removed.
3133         (close_active_file) Only call make_source if non-null, otherwise
3134         set vfm_source to null pointer.  Don't free temp_case.
3135         (disk_source_read) Add struct ccase * parameter, use instead of
3136         temp_case.
3137         (memory_source_read) Ditto.
3138         (lag_case) Add const struct ccase * member.
3139         (procedure_write_case) Use trns_case instead of temp_case.
3140         (clear_case) Add struct ccase * member, use instead of temp_case.
3141         (exclude_this_case) Ditto.
3142         (create_case_source) Add struct dictionary * parameter, use to
3143         initialize source->value_cnt.
3144
3145         * vfm.h: (struct case_source) Add `value_cnt' member.
3146         (struct case_source_class) Add struct ccase * parameter to `read'
3147         member function pointer.
3148         (struct case_sink_class) Make struct ccase * parameter const in
3149         `write' member function pointer.
3150         
3151 Wed Mar  3 20:44:37 2004  Ben Pfaff  <blp@gnu.org>
3152
3153         Fix a lot of "possibly uninitialized variable" warnings.  Some of
3154         them are even real bugs.  A few of them make me wonder how the
3155         code ever worked.
3156
3157         * aggregate.c: (parse_aggregate_functions) Initialize `function.
3158
3159         * ascii.c: (output_lines) Add default case to switch.
3160
3161         * crosstabs.q: Remove static variable `expected' and all
3162         references to it.
3163         (display_crosstabulation) Always calculate expected value.
3164         (calc_chisq) Ditto.
3165         (output_pivot_table) Initialize `cmp'.
3166         (display_crosstabulation) New variable `last_row', which is
3167         initialized.
3168
3169         * data-in.c: (parse_numeric) Always initialize sign.  How did this
3170         work at all?!
3171
3172         * data-list.c: (repeating_data_trns_proc) Always initialize code.
3173         Always set info.ofs.  (How did this work?!)
3174
3175         * expr-opt.c: (optimize_tree) Always initialize `m'.
3176         (evaluate_tree) Always initialize `c'.  (How did this work?)
3177
3178         * frequencies.q: (frq_custom_variables) Always initialize min,
3179         max.
3180         (frq_custom_grouped) Always initialize `dl'.
3181
3182         * groff-font.c: (groff_read_font) Always initialize char_set.
3183
3184         * matrix-data.c: (nr_output_data) Initialize `split'.
3185         (wr_read_splits) Remove shadowing split_cnt declaration.
3186         (wr_output_data) Initialize `split'.
3187
3188         * output.c: (tokener) Skip add character on syntax error.
3189
3190         * pool.c: (pool_strndup) Always set `copy'.  (How did this work?!)
3191
3192         * postscript.c: (read_ps_encodings) Use line.string instead of
3193         uninitialized `bp'.
3194         (write_text) Add default case to switch.
3195         (text) Always initialize multiple variables.  Fix bug with
3196         ligatures.
3197
3198         * print.c: (fixed_parse_fortran) Initialize head.
3199         (alloc_line) Add default case to switch.
3200
3201         * recode.c: (parse_dest_spec) Handle case where nothing matches.
3202         (recode_trns_proc) Move variable declaration inward.  Add default
3203         case to switch.
3204
3205         * sfm-read.c: (read_header) Initialize skip_amt.
3206
3207         * sysfile-info.c: (display_variables) Always initialize pc.
3208
3209         * vars-prs.c: Initialized `included'.
3210
3211 Wed Mar  3 09:30:09 2004  Ben Pfaff  <blp@gnu.org>
3212
3213         * main.c: (main) sigaction()'s sa_flags member was uninitialized.
3214         Just use signal() instead.
3215
3216 Wed Mar  3 09:26:30 2004  Ben Pfaff  <blp@gnu.org>
3217
3218         Get rid of vfm_sink_info and vfm_source_info.
3219         
3220         * aggregate.c: (agr_00x_end_func) Don't increment
3221         sfm_sink_info.ncases.
3222
3223         * sort.c: (do_internal_sort) Get case count from
3224         vfm_source->class->count().
3225         (struct external_sort) Add `case_size' member.
3226         (do_external_sort) Initialize case_size.
3227         (struct initial_run_state) Add `case_size' member.
3228         (write_initial_runs) Initialize case_size.
3229         (sort_sink_write) Use case_size.
3230         (read_external_sort_output) Use case_size.  Get case_cnt from
3231         initial_runs.
3232
3233         * vfm.c: (struct write_case_data) Add underscores to existing arg
3234         names, all references updated.  Renamed `aux' as `func_aux', all
3235         references updated.  Added new `aux' member.
3236         (global var vfm_source_info) Removed.
3237         (global var vfm_sink_info) Removed.
3238         (struct procedure_aux_data) New.
3239         (struct split_aux_data) New.
3240         (procedure) Use `aux' fields for procedure_aux_data,
3241         split_aux_data.
3242         (process_active_file_write_case) Pass case_count + 1 to
3243         transformation procedures, exclude_this_case().
3244         (process_active_file_output_case) Don't increment
3245         vfm_sink_info.ncases.
3246         (prepare_for_writing) Don't initialize vfm_sink_info.  Don't try
3247         to send data to disk early.
3248         (make_temp_case) Don't use vfm_sink_info.case_size.
3249         (close_active_file) Don't initialize vfm_source_info.
3250         (struct disk_stream_info) New, to allow for case_cnt and case_size fields.
3251         (disk_sink_create) Initialize and/or update disk_stream_info.
3252         (disk_sink_write) Ditto.
3253         (disk_sink_destroy) Ditto.
3254         (disk_sink_make_source) Ditto.
3255         (disk_source_read) Ditto.
3256         (disk_source_destroy) Ditto.
3257         (global var disk_source_class) Add disk_source_count().
3258         (disk_source_count) New function.
3259         (struct memory_sink_info) Add `case_cnt', `case_size' members.
3260         (struct memory_source_info) Ditto.
3261         (memory_sink_create) Deal with case_cnt, case_size.
3262         (memory_sink_write) Ditto.
3263         (memory_sink_make_source) Ditto.
3264         (memory_source_read) Ditto.
3265         (memory_source_count) New function.
3266         (memory_source_class) Add memory_source_count().
3267         (procedure_write_case) Don't use vfm_sink_info.ncases.  Do use
3268         proc_aux->cases_written, and pass it to transformation procedures
3269         and exclude_this_case ().
3270         (exclude_this_case) Add case_num parameter.  Pass it to
3271         expr_evaluate().
3272         (SPLIT_FILE_procfunc) Use split_aux->prev_case instead of static
3273         variable.
3274
3275         * vfm.h: (struct case_source_class) Add `count' member.
3276
3277         * vfmP.h: (struct stream_info) Removed.
3278         (global variable vfm_source_info) Removed.
3279         (global variable vfm_sink_info) Removed.
3280         
3281 Tue Mar  2 23:38:17 2004  Ben Pfaff  <blp@gnu.org>
3282
3283         * var.h: (typedef trns_proc_func) New typedef.
3284         (trns_free_func) New typedef.
3285         (struct trns_header) Change `proc' to type trns_proc_func, `free'
3286         to type trns_free_func.  This only changes the actual type of
3287         trns_proc_func, adding a `case_num' parameter.  Updated all
3288         implementations to use the typedefs instead.
3289
3290         * compute.c: (compute_num) Pass case_num to expr_evaluate().
3291         (compute_num_vec) Ditto.
3292         (compute_str) Ditto.
3293         (compute_str_vec) Ditto.
3294
3295         * do-if.c: (do_if_trns_proc) Ditto.
3296
3297         * expr-evl.c: (expr_evaluate) Add new case_num parameter, use for
3298         OP_CASENUM.
3299
3300         * inpt-pgm.c: (input_program_source_read) Maintain case count,
3301         pass to transformation functions.
3302         (reread_trns_proc) Pass case_num arg to expr_evaluate().
3303
3304         * loop.c: (loop_1_trns_proc) Ditto.
3305         (loop_2_trns_proc) Ditto.
3306         (loop_3_trns_proc) Ditto.
3307
3308         * print.c: (print_space_trns_proc) Ditto.
3309
3310         * sel-if.c: (select_if_proc) Ditto.
3311
3312 Tue Mar  2 11:36:52 2004  Ben Pfaff  <blp@gnu.org>
3313
3314         * frequencies.q: (cleanup_freq_tab) Avoid memory leak by
3315         destroying hash table.
3316
3317         * glob.c: (read_active_file) Variable not referenced, removed.
3318         (cancel_input_pgm) Ditto.
3319
3320         * levene.c: Add #include <stdlib.h> needed to call free().
3321
3322         * aggregate.c: (parse_aggregate_functions) Make `function'
3323         variable const.
3324
3325 Tue Mar  2 11:30:56 2004  Ben Pfaff  <blp@gnu.org>
3326
3327         Start working to eliminate VFM dependence on static variables.
3328
3329         * command.c: (cmd_parse) Use case_source_is_class().
3330
3331         * data-list.c: Rewrite to eliminate use of static variables.
3332
3333         * dfm.c: (cmd_begin_data) Use case_source_is_class().
3334
3335         * file-handle.q: (fh_handle_name) Make parameter const.
3336
3337         * file-type.c: Rewrite to eliminate use of static variables.
3338
3339         * flip.c: Rewrite to eliminate use of static variables.
3340
3341         * format.c: (get_format_var_width) New function.
3342
3343         * get.c: Eliminate use of static variables.
3344
3345         * inpt-pgm.c: Eliminate use of static variables.
3346
3347         * matrix-data.c: Eliminate use of static variables.
3348
3349         * set.q: (set_max_workspace) New variable.
3350         (cmd_set) Use SET WORKSPACE to modify set_max_workspace.
3351
3352         * var.h: (struct case_list) Move here from vfmP.h.
3353
3354         * vars-atr.c: (discard_variables) Handle new vfm_source type.
3355
3356         * vfm.c: (vfm_source) Change type from struct case_stream to
3357         struct case_source.
3358         (vfm_sink) Change type from struct case_stream to struct
3359         case_sink.
3360         (static var paging) Rename workspace_overflow, all references
3361         updated.
3362         (procedure) Use new class structures.
3363         (process_active_file) Ditto.
3364         (process_active_file_write_case) Ditto.
3365         (prepare_for_writing) Use set_max_workspace.  Use new class
3366         structures.
3367         (close_active_file) Use new class structures.  Free old sink.
3368         (global var disk_source_file) Removed.
3369         (global var disk_sink_file) Removed.
3370         (disk_stream_init) Removed.
3371         (disk_stream_read) Removed.
3372         (disk_stream_write) Removed.
3373         (disk_stream_mode) Removed.
3374         (disk_stream_destroy_source) Removed.
3375         (disk_stream_destroy_sink) Removed.
3376         (global var vfm_disk_stream) Removed.
3377         (disk_sink_create) New function.
3378         (disk_sink_write) New function.
3379         (disk_sink_destroy) New function.
3380         (disk_sink_make_source) New function.
3381         (disk_sink_class) New static var.
3382         (disk_source_read) New function.
3383         (disk_source_destroy) New function.
3384         (global var vfm_source_class) New var.
3385         (global var memory_source_cases) Removed.
3386         (global var memory_sink_cases) Removed.
3387         (global var memory_sink_max_cases) Removed.
3388         (struct memory_sink_info) New struct.
3389         (memory_stream_init) Removed.
3390         (memory_stream_read) Removed.
3391         (memory_stream_write) Removed.
3392         (memory_stream_mode) Removed.
3393         (memory_stream_destroy_source) Removed.
3394         (memory_stream_destroy_sink) Removed.
3395         (global var vfm_memory_stream) Removed.
3396         (page_to_disk) Renamed write_active_file_to_disk().
3397         (memory_sink_create) New function.
3398         (memory_sink_write) New function.
3399         (memory_sink_destroy) New function.
3400         (memory_sink_make_source) New function.
3401         (memory_sink_class) New static var.
3402         (memory_source_read) New function.
3403         (memory_source_destroy) New function.
3404         (memory_source_get_cases) New function.
3405         (memory_source_set_cases) New function.
3406         (global var vfm_source_class) New var.
3407         (procedure_write_case) Use new class structures.
3408         (create_case_source) New function.
3409         (case_source_is_complex) New function.
3410         (case_source_is_class) New function.
3411         (create_case_sink) New function.
3412
3413         * vfm.h: (global variable reinit_sysmis) Not used, removed.
3414         (global variable reinit_blanks) Not used, removed.
3415         (global variable init_zero) Not used, removed.
3416         (global variable init_blanks) Not used, removed.
3417         (struct case_source) New struct.
3418         (struct case_source_class) New struct.
3419         (struct case_sink) New struct.
3420         (struct case_sink_class) New struct.
3421         (struct case_stream) Removed.
3422
3423         * vfmP.h: (struct case_list) Moved to var.h.
3424
3425 Tue Mar  2 11:28:30 2004  Ben Pfaff  <blp@gnu.org>
3426
3427         * algorithm.c: (count_equal) New function.
3428         (count_if) New function.
3429         (unique) Add assertions.
3430         (partition) Add assertions.
3431         (is_partitioned) New function.
3432         (copy_if) Add assertions.
3433         (remove_equal) Add assertions.
3434         (lexicographical_compare) Rename lexicographical_compare_3way.
3435         (sort) Add assertions.  Rephrase some code.
3436         (is_sorted) New function.
3437
3438 Sun Feb 29 23:24:57 2004  Ben Pfaff  <blp@gnu.org>
3439
3440         Rewrite SORT CASES.
3441
3442         * sort.c: Completely rewrite.
3443
3444         * sort.h: Expose interface via struct sort_cases_pgm, not via
3445         global variables.
3446
3447         * aggregate.c: (sort) New static var.
3448         (cmd_aggregate) Use sort.
3449         (create_sysfile) Ditto.
3450         (aggregate_single_case) Ditto.
3451         (dump_aggregate_info) Ditto.
3452         (agr_00x_end_func) Ditto.
3453         (debug_print) Ditto.
3454
3455         * var.h: (enum SRT_ASCEND) Removed.
3456         (enum SRT_DESCEND) Removed.
3457         (struct sort_cases_proc) Removed.
3458         (struct variable) Remove p.srt member.
3459
3460 Sun Feb 29 23:22:45 2004  Ben Pfaff  <blp@gnu.org>
3461
3462         Get rid of the old, crappy heap structure and replace it by a new,
3463         shiny, C++ STL-like heap structure.
3464         
3465         * Makefile.am: (pspp_SOURCES) Remove heap.c, heap.h.
3466
3467         * algorithm.c: (push_heap) New function.
3468         (heapify) Ditto.
3469         (pop_heap) Ditto.
3470         (make_heap) Ditto.
3471         (sort_heap) Ditto.
3472         (is_heap) Ditto.
3473         
3474         * heap.c: Removed.
3475
3476         * heap.h: Removed.
3477
3478 Sun Feb 29 23:21:53 2004  Ben Pfaff  <blp@gnu.org>
3479
3480         Increase warning level.
3481         
3482         * Makefile.am: (AM_CFLAGS) Remove -Wnouninitialized.
3483
3484 Sat Feb 21 17:38:58 WST 2004 John Darrington <john@darrington.wattle.id.au>
3485
3486         * main.c: Added a signal handler for SIGSEGV requesting a bug report.
3487          
3488 Fri Feb 20 23:22:14 2004  Ben Pfaff  <blp@gnu.org>
3489
3490         * dictionary.c: (dict_create_var) Fix root cause of bug worked
3491         around by previous change log entry.
3492         
3493         * compute.c: (lvalue_finalize) Remove workaround from previous
3494         change log entry.
3495
3496 Fri Feb 20 14:37:41 WAST 2004 John Darrington <john@darrington.wattle.id.au>
3497
3498         * compute.c: Fixed a bug where the Format was not getting set for 
3499           computed variables (thus causing a crash when SAVEing).
3500
3501         * Added a test to stop this bug ever coming back
3502
3503 Wed Feb 18 22:21:35 2004  Ben Pfaff  <blp@gnu.org>
3504
3505         Got rid of approx.h.  In general, replaced all references to
3506         approx_eq() by ==, approx_lt() by <, etc.  Other types of changes
3507         noted below.
3508
3509         * Makefile.am: (pspp_SOURCES) Removed approx.h.
3510
3511         * data-out.c: (try_F) Replaced test for approx_eq(number, 0.0) by
3512         test for mag < EPSILON.
3513
3514         * misc.h: Add definition of EPSILON.
3515
3516 Wed Feb 18 21:32:44 2004  Ben Pfaff  <blp@gnu.org>
3517
3518         * vfm.c: (procedure) Add check to prevent recursive call.
3519
3520 Wed Feb 18 21:48:54 WST 2004 John Darrington <john@darrington.wattle.id.au>
3521
3522         * Moved the declarations relating to values to their own header file
3523           (val.h)
3524
3525         * Added levene.c and levene.h
3526
3527         * vars-atr.c: Changed the signature of compare_values to 
3528         take const * arguments.
3529                 
3530         * t-test.q: Changed the structure of struct t_test_proc 
3531        variables now contain their own group statistics information.
3532        Eventually, t_test_proc might get renamed, because it'd be 
3533        applicable to other commands too.
3534
3535 Mon Feb 16 23:15:51 2004  Ben Pfaff  <blp@gnu.org>
3536
3537         * data-out.c: Clean up.  Changed interface of convert_*() to take
3538         either a `double' or a `const char *' instead of a `const union
3539         value *'.  Update all implementations of those interfaces.
3540         (data_out) Use switch statements instead of a table.
3541         (convert_AHEX) Rewrite.
3542
3543         * format.h: Update comment.
3544
3545 Mon Feb 16 22:14:36 2004  Ben Pfaff  <blp@gnu.org>
3546
3547         * q2c.c: (dump_header) Add an Emacs header line to output files
3548         that makes generated .c files read-only by default, to make it
3549         difficult to accidentally change generated files.
3550
3551 Mon Feb 16 22:12:07 2004  Ben Pfaff  <blp@gnu.org>
3552
3553         * frequencies.q: (compare_freq_numeric_a) Compare by frequency,
3554         not bogus a->v.c <=> b->v.c pointer compare.
3555         (compare_freq_alpha_a) Ditto.
3556         (compare_freq_numeric_d) Ditto.
3557         (compare_freq_alpha_d) Ditto.
3558         
3559 Mon Feb 16 22:00:53 2004  Ben Pfaff  <blp@gnu.org>
3560
3561         Changed data_out() to store string data directly into a `union
3562         value''s s member, not indirectly into c.
3563
3564         * crosstabs.q: (output_pivot_table) Use format_short() instead of
3565         data_out().
3566         (table_value_missing) Ditto.
3567         (float_M_suffix) Ditto.
3568         (format_short) New function.
3569
3570         * data-in.h: (data_in_finite_line) Remove inline definition.
3571
3572         * data-list.c: (destroy_dls_var_spec) New function.
3573         (destroy_dls) Rewrite in terms of destroy_dls_var_spec().
3574         (data_list_source_destroy_source) Avoid cast.
3575         (struct repeating_data_trns) New field `id_value'.  Update
3576         comments.
3577         (cmd_repeating_data) Initialize id_value.  Use new
3578         repeating_data_trns_free() for freeing REPEATING DATA
3579         transformations.
3580         (rpd_parse_record) Rewrite support for record ID to be less bogus.
3581         (repeating_data_trns_free) New function.
3582
3583         * data-out.c: (data_out) Change return type to `void' by replacing
3584         error returns by writing a message into the output buffer.
3585         (convert_A) Read from v->s instead of v->c.
3586         (convert_AHEX) Ditto.
3587
3588         * expr-evl.c: Update comment.
3589         (expr_evaluate) Add assertion in OP_STRING case.
3590
3591         * format.h: (macro MAX_FORMATTED_LEN) New macro.
3592
3593         * list.q: (list_cases) Update for new data_out() semantics.
3594
3595         * print.c: (print_trns_proc) Ditto.
3596
3597         * tab.c: (tab_value) Ditto.
3598         (tab_float) Avoid stupid cast.
3599
3600         * var.h: Update comments.
3601         (macro MAX_STRING) New macro.
3602         (macro MAX_ELEMS_PER_VALUE) New macro.
3603
3604         * vars-atr.c: (compare_values) New function.
3605
3606         * vfm.c: (dump_splits) Update for new data_out() semantics.
3607
3608 Mon Feb 16 21:45:47 2004  Ben Pfaff  <blp@gnu.org>
3609
3610         * crosstabs.q: (struct table_entry) Rename v[] to values[].  All
3611         references updated.
3612         (struct crosstab) Rename v[] to vars[].  All references updated.
3613         (hash_table_entry) Replace the hash algorithm and fix a bug at the
3614         same time, which caused the hash value to depend only on a single
3615         value, not all of the variables' values.
3616         
3617 Mon Feb 16 12:49:53 2004  Ben Pfaff  <blp@gnu.org>
3618
3619         Clean up struct dictionary's value_cnt usage.
3620
3621         * dictionary.c: Add a function comment to each function.
3622         (struct dictionary) Rename value_cnt to next_value_idx, which more
3623         accurately reflects its meaning.  All references updated.
3624         (dict_rename_vars) Add assertion.
3625         (dict_get_value_cnt) Rename dict_get_next_value_idx().  All
3626         references updated.
3627         (dict_get_case_size) New function.
3628
3629         * aggregate.c: (create_sysfile) Use dict_get_case_size().
3630
3631         * get.c: (mtf_read_nonactive_records) Ditto.
3632
3633         * sort.c: (allocate_cases) Ditto.
3634         (write_initial_runs) Ditto.
3635         (merge) Ditto.
3636         (merge_once) Ditto.
3637
3638         * vfm.c: (prepare_for_writing) Ditto.
3639         (setup_lag) Ditto.
3640         (lag_case) Ditto.
3641
3642 Mon Feb 16 00:17:55 2004  Ben Pfaff  <blp@gnu.org>
3643
3644         Make vfm.c slightly less grotesque.
3645
3646         * vfm.c: (filter_var) Removed.
3647         (filter_index) Removed.
3648         (FILTERED macro) Removed.
3649         (exclude_this_case) New function.
3650         (process_active_file_write_case) Use exclude_this_case() instead
3651         of FILTERED and inline tests.
3652         (procedure_write_case) Ditto.
3653         (setup_filter) Removed.
3654         (open_active_file) Don't call setup_filter().
3655         (close_active_file) Call dict_get_filter() instead of checking
3656         filter_var.
3657
3658 Mon Feb 16 00:01:53 2004  Ben Pfaff  <blp@gnu.org>
3659
3660         * var.h: (struct variable) Update comments.
3661
3662 Sun Feb 15 23:14:59 2004  Ben Pfaff  <blp@gnu.org>
3663
3664         New functions dict_create_var_assert(), dict_lookup_var_assert().
3665         Converted several dict_*_var()/assert pairs into a single
3666         dict_*_var_assert().
3667
3668         * dictionary.c: (dict_create_var_assert) New function.
3669         (dict_lookup_var_assert) New function.
3670
3671 Sun Feb 15 23:06:08 2004  Ben Pfaff  <blp@gnu.org>
3672
3673         Got rid of "struct long_vec", envector(), devector(), etc.  Added
3674         two members `init', `reinit' to struct variable as a substitute.
3675         
3676         * Makefile.am: (pspp_SOURCES) Removed cases.c, cases.h.
3677         
3678         * cases.c: Removed.
3679
3680         * cases.h: Removed.
3681
3682         * aggregate.c: (parse_aggregate_functions) destvar doesn't need
3683         init.
3684
3685         * autorecode.c: (cmd_autorecode) destvars don't need init.
3686
3687         * compute.c: (lvalue_finalize) Set reinit.
3688
3689         * data-list.c: (fixed_parse_compatible) Don't need init usually.
3690         (dump_fmt_list) Ditto.
3691         (parse_free) Ditto.
3692
3693         * descript.q: (run_z_pass) Don't need init for z-scores.
3694
3695         * dictionary.c: (dict_create_var) Initialize `init', `reinit'
3696         members.
3697         (dict_clone_var) Copy `reinit' member, initialize `init' member.
3698
3699         * glob.c: (init_glob) Remove vec_init() calls.
3700
3701         * inpt-pgm.c: (cmd_end_input_program) Use `reinit', not `left'.
3702         
3703         * loop.c: (internal_cmd_loop) Don't need to call envector().
3704
3705         * numeric.c: (cmd_numeric) Ditto.
3706         (cmd_string) Ditto.
3707         (cmd_leave) Ditto.  Set `init', `reinit' members.
3708
3709         * recode.c: (cmd_recode) Don't need to call envector().
3710
3711         * repeat.c: (internal_cmd_do_repeat) Ditto.
3712
3713         * var.h: (struct variable) Remove `left'.  Add `init', `reinit'.
3714         (force_create_variable) Removed prototype.
3715         (force_dup_variable) Ditto.
3716
3717         * vector.c: (cmd_vector) Don't need to call envector().
3718
3719         * vfm.c: (reinit_sysmis) Removed.
3720         (reinit_blanks) Removed.
3721         (init_zero) Removed.
3722         (init_blanks) Removed.
3723         (process_active_file_write_case) No need to deal with vectors.
3724         Call clear_temp_case().
3725         (vector_initialization) Rewrite to use `init', `reinit'.
3726         (close_active_file) No need to call vec_clear().
3727         (procedure_write_case) Call clear_temp_case().
3728         (clear_temp_case) New function.
3729
3730 Sun Feb 15 20:50:36 2004  Ben Pfaff  <blp@gnu.org>
3731
3732         * pfm-write.c: (bufwrite) Get rid of nasty cast that also invoked
3733         undefined behavior.
3734
3735 Thu Feb 12 23:35:15 2004  Ben Pfaff  <blp@gnu.org>
3736
3737         Add auxiliary argument to procedure() interface.  Associated small
3738         clean-ups of vfm interface.
3739         
3740         * Updated every caller of procedure() and process_active_file() to
3741         reflect modified interface.  Simple, ordinary changes not listed
3742         otherwise below.
3743
3744         * Updated every function that implements struct case_stream's
3745         `read' function to take a write_case_func and a write_case_data.
3746         Also updated every caller of write_case() to instead call them
3747         through these arguments.  In some cases this meant that the extra
3748         args had to be threaded through a couple of extra levels.  This
3749         wasn't difficult or interesting so the details won't be given.
3750
3751         * data-list.c: (struct repeating_data_trns) Add members
3752         `write_case', `wc_data' as kluge.
3753         (read_one_set_of_repetitions) Rename repeating_data_trns_proc and
3754         make non-static.
3755         (repeating_data_set_write_case) New function.
3756
3757         * data-list.h: New file to declare repeating_data_trns_proc() and
3758         repeating_data_set_write_case().
3759
3760         * inpt-pgm.c: (input_program_source_read) Call
3761         repeating_data_set_write_case() for all the REPEATING DATA
3762         transformations, so that they know where to send their cases.
3763         It's a big kluge.  Also kluge in END CASE.
3764         (end_case_trns_proc) Never called anymore, but we still need it,
3765         so just assert(0).
3766
3767         * sort.c: (read_sort_output) Update to match struct case_stream
3768         `read' member.
3769
3770         * vfm.c: (struct write_case_data) New structure.
3771         (proc_func) Removed.
3772         (virt_proc_func) Removed.
3773         (begin_func) Removed.
3774         (virt_begin_func) Removed.
3775         (end_func) Removed.
3776         (write_case) Removed.
3777         (procedure) Added an auxiliary parameter to each function pointer
3778         argument's prototype.  Added an auxiliary data parameter.
3779         Rewrote.
3780         (process_active_file) Ditto.
3781         (process_active_file_write_case) Pass aux data along.
3782         (close_active_file) Ditto.
3783         (procedure_write_case) Ditto.
3784         (SPLIT_FILE_procfunc) Ditto.
3785
3786         * vfm.h: (typedef write_case_data) New.
3787         (typedef write_case_func) New.
3788         (struct case_stream) Add parameters to `read' member prototype.
3789         
3790 Thu Feb 12 19:24:53 WST 2004 John Darrington <john@darrington.wattle.id.au>
3791
3792         * t-test.q:  Added calculations for independent samples. (But no Levene
3793         test yet!)
3794
3795         * Makefile.am: Moved q_sources_c into own variable 
3796
3797 Wed Feb 11 23:56:51 2004  Ben Pfaff  <blp@gnu.org>
3798
3799         Miscellaneous cleanups.
3800         
3801         * Change unused to UNUSED in many source files to reflect modified
3802         pref.h.  Change use of __WIN32__, __MSDOS, __DJGPP__,
3803         __CYGWIN32__, __unix__, and unix not to assume that they're
3804         defined to a nonzero value.  Change use of __attribute__ to use
3805         NO_RETURN or PRINTF_FORMAT instead.
3806         
3807         * alloc.h: Move definitions for local_alloc(), local_free() here
3808         from ../pref.h.orig and simplify.
3809
3810         * expr-evl.c: Instead of working differently based on PAGED_STACK,
3811         use a pool allocator unconditionally.
3812         (CHECK_STRING_SPACE) Removed.
3813         (ALLOC_STRING_SPACE) Removed.
3814         (expr_evaluate) Use e->pool instead of CHECK_STRING_SPACE and
3815         ALLOC_STRING_SPACE.
3816
3817         * expr-opt.c: (dump_expression) Allocate string pool.
3818
3819         * expr-prs.c: (expr_free) Free string pool.
3820
3821         * pool.c: (pool_destroy) This pool must be removed from its
3822         parent's list of gizmos, not from its own.  Use free_all_gizmos().
3823         (pool_clear) New function.
3824         (free_all_gizmos) New function.
3825         (pool_alloc) Use space in empty block after this one if any.
3826         (pool_release) Only empty out blocks, don't actually free() them.
3827
3828         * print.c: Get rid of PAGED_STACK special case by always
3829         dynamically allocating line buffers.
3830         (struct print_trns) Always include the `line' member.
3831         (internal_cmd_print) Always initialize the `line' member.
3832         (alloc_line) Always allocate memory for `line'.
3833         (print_trns_proc) Always initialize buf from `line' member.
3834         (print_trns_free) Always free `line' memory.
3835
3836         * sort.c: (allocate_file_handles) Special-case MS-DOS for mkdir()
3837         call.
3838         
3839 Wed Feb 11 20:33:18 2004  Ben Pfaff  <blp@gnu.org>
3840
3841         * flip.c: Fixed crash from FLIP when a numeric variable is
3842           specified on NEWNAMES and a large value is used, and a couple of
3843           other minor bugs besides.
3844           (struct varname) Make name a 9-character fixed-size array
3845           instead of a 1-character variable size array.
3846           (make_new_var) Allow digits in variable names.
3847           (flip_stream_write) Limit numeric values to 8 characters and
3848           format system missing and very large and small values more
3849           appropriately.
3850
3851 Thu Feb  5 13:19:06 WAST 2004 John Darrington <john@darrington.wattle.id.au>
3852
3853         * command.c: Fixed test on command return status for the correct 
3854           value,  which had been causing a crash under certain invalid input.
3855
3856 Wed Feb  4 15:34:11 WST 2004 John Darrington <john@darrington.wattle.id.au>
3857
3858         * t-test.q: Added calculations for the one sample variant of the T-TEST
3859
3860 Tue Feb  3 20:09:54 2004  Ben Pfaff  <blp@gnu.org>
3861
3862         * tab.c: (render_strip) Fix bug that sometimes caused joined text
3863           in joined cells to be rendered outside box boundaries.
3864
3865 Tue Feb  3 18:56:45 WST 2004 John Darrington <john@darrington.wattle.id.au>
3866
3867         * random.c (rng_create): Fixed seeding so that it gets reseeded after
3868         SET seed=xx has been called.
3869
3870 Mon Jan 19 14:08:09 2004  Ben Pfaff  <blp@gnu.org> 
3871
3872         * random.c (rng_get_double): Fix always-returning-zero bug in my
3873         preferred way, and at the same time make sure rounding doesn't
3874         bite us.
3875
3876 Thu Jan  1 23:16:41 2004  Ben Pfaff  <blp@gnu.org>
3877
3878         * html.c: (change_attributes) Dead code, removed.
3879         (escape_string) Eliminate code to call change_attributes() that
3880         never actually called it.
3881         (output_tab_table) Get rid of dependence on tab_hit
3882         and struct tab_joined_cell's hit member, which are abominations.
3883
3884         * tab.c: (tab_output_text) Don't call
3885         d->class->text_set_font_by_name if it's a null pointer.
3886         (macro UNROLL_LOOP) Eliminate.
3887         (macro UNROLL_3_LOOPS) Eliminate.
3888         (tabi_render) Rewrite not to use the above macros.
3889
3890 Thu Jan  1 23:09:07 2004  Ben Pfaff  <blp@gnu.org>
3891
3892         Start working on a new output driver system, one that doesn't suck
3893         so much, by adding a "device-independent" output driver.  The idea
3894         is to write out only a single output stream, then use separate
3895         processes to translate them into whatever formats we want.  This
3896         is similar to how "groff" works with its various output drivers
3897         (grops, grotty, grodvi, ...).
3898         
3899         * Makefile.am: (pspp_SOURCES) Add devind.c, devind.h.
3900
3901         * list.q: (write_all_headers) Stub out devind class.
3902         (clean_up) Ditto.
3903         (determine_layout) Ditto.
3904         (list_cases) Ditto.
3905
3906         * output.c: (outp_init) Add devind class.
3907
3908         * devind.c: New file.
3909
3910         * devind.h: New file.
3911
3912 Thu Jan  1 23:08:14 2004  Ben Pfaff  <blp@gnu.org>
3913
3914         * frequencies.q: (hash_value_alpha) Fixed up the previous change
3915         to use the proper string length.
3916
3917 Wed Dec 31 16:27:33 WAST 2003 John Darrington <john@darrington.wattle.id.au>
3918
3919         * Fixed bug where FREQ would crash on alpha values
3920
3921 Tue Dec 30 22:42:57 2003  Ben Pfaff  <blp@gnu.org>
3922
3923         * Removed bletcherous alloca() workarounds for AIX from top of
3924         many files.  AIX can use the alternative alloca() implementation
3925         instead.
3926
3927 Tue Dec 30 22:35:16 2003  Ben Pfaff  <blp@gnu.org>
3928
3929         * ascii.c: (ascii_option) Fix implementation of headers option.
3930
3931 Tue Dec 30 22:32:53 2003  Ben Pfaff  <blp@gnu.org>
3932
3933         * ascii.c: Add a "squeeze" option to the ASCII driver to squeeze
3934         multiple blank lines into one.
3935         (struct ascii_driver_ext) Add squeeze_blank_lines option.
3936         (ascii_preopen_driver) Initialize squeeze_blank_lines.
3937         (static var option_tab) Add squeeze entry.
3938         (ascii_option) Set squeeze_blank_lines.
3939         (output_lines) Implement squeezing blank lines.
3940
3941 Wed Dec 31 07:19:46 WST 2003 John Darrington <john@darrington.wattle.id.au>
3942
3943         * Removed redundant code from output.h
3944
3945 Sat Dec 27 22:17:52 2003  Ben Pfaff  <blp@gnu.org>
3946
3947         Dictionary classes: each variable is "ordinary", "system", or
3948         "scratch".
3949
3950         * var.h: (enum dict_class) New enum.
3951
3952         * vars-prs.c: (dict_class_from_id) New function.
3953         (dict_class_to_name) New function.
3954
3955 Sat Dec 27 22:16:06 2003  Ben Pfaff  <blp@gnu.org>
3956
3957         * var.h: (struct freq_tab_set) Removed (not used).
3958
3959 Sat Dec 27 22:15:21 2003  Ben Pfaff  <blp@gnu.org>
3960
3961         * value-labels.c: (val_labs_destroy) vls needs to be freed too.
3962
3963 Sat Dec 27 22:10:49 2003  Ben Pfaff  <blp@gnu.org>
3964
3965         * stats.c: (hypercube) Rename pow4().  All references updated.
3966
3967 Sat Dec 27 22:05:49 2003  Ben Pfaff  <blp@gnu.org>
3968
3969         * rename-vars.c: (cmd_rename_variables) Rewritten.
3970         (compare_name) Removed.
3971
3972 Sat Dec 27 22:03:51 2003  Ben Pfaff  <blp@gnu.org>
3973
3974         var_set feature, and code taking advantage of it.
3975         
3976         * crosstabs.q: (static var var_dict) Removed.
3977         (static var variables) New variable.
3978         (static var variables_cnt) New variable.
3979         (cmd_crosstabs) Free variables instead of var_dict.
3980         (internal_cmd_crosstabs) Initialize and use variables,
3981         variables_cnt instead of var_dict.
3982         (free_var_dict) Removed.
3983         (crs_custom_tables) Use var_set instead of a copied dictionary.
3984         (crs_custom_variables) Set up variables, variables_cnt instead of
3985         var_dict.
3986         [DEBUGGING] (debug_print) Ditto.
3987
3988         * means.q: (mns_custom_tables) Use var_set instead of a copied
3989         dictionary.
3990
3991         * vars-prs.c: (parse_vs_variable) New function.
3992         (parse_dict_variable) Rewritten.
3993         (parse_variable) Rewritten.
3994         (parse_variables) Renamed parse_var_set_vars(), rewritten.
3995         (parse_variables) New function in terms of parse_var_set_vars().
3996         Now requires its first argument to be non-null.  All references
3997         that passed a null pointer updated to pass default_dict instead.
3998         (macro id_dict) Removed.
3999         (parse_DATA_LIST_vars) Add assertions.
4000         (parse_mixed_vars) Ditto.
4001         (struct var_set) New structure.
4002         (var_set_get_cnt) New function.
4003         (var_set_get_var) New function.
4004         (var_set_lookup_var) New function.
4005         (var_set_destroy) New function.
4006         (dict_var_set_get_cnt) New function.
4007         (dict_var_set_get_var) New function.
4008         (dict_var_set_lookup_var) New function.
4009         (dict_var_set_destroy) New function.
4010         (var_set_create_from_dict) New function.
4011         (struct array_var_set) New structure.
4012         (array_var_set_get_cnt) New function.
4013         (array_var_set_get_var) New function.
4014         (array_var_set_lookup_var) New function.
4015         (array_var_set_destroy) New function.
4016         (var_set_create_from_array) New function.
4017
4018         * q2c.c: (dump_parser) Use parse_variables(default_dict, ...)
4019         instead of parse_variables(NULL, ...) in output code.
4020
4021 Sat Dec 27 21:38:53 2003  Ben Pfaff  <blp@gnu.org>
4022
4023         Change inp_init from a 2-bit vector to an ordinary array.
4024         Initialize it all in cmd_end_input_program() instead of in
4025         create_variable().
4026
4027         * inpt-pgm.c: (enum value_init_type) New enum.
4028         (global var inp_init) Change to `enum value_init_type *', make
4029         static.
4030         (inp_init_size) Removed.
4031         (inp_nval) Change to `size_t', make static.
4032         (cmd_input_program) Don't initialize inp_init or inp_init_size.
4033         (cmd_end_input_program) Initialize inp_init, inp_nval.
4034         (init_case) Rewrite.
4035         (clear_case) Rewrite.
4036
4037         * inpt-pgm.h: Removed.
4038
4039 Sat Dec 27 21:36:38 2003  Ben Pfaff  <blp@gnu.org>
4040
4041         * hash.c: (hsh_hash_bytes) Use Fowler-Noll-Vo hash instead of
4042         Colin Plumb hash.  It is simpler and should better resist
4043         collisions.
4044         (hsh_hash_string) Ditto.
4045
4046 Sat Dec 27 21:34:57 2003  Ben Pfaff  <blp@gnu.org>
4047
4048         * get.c: (export_write_case_func) Remove debug printing code.
4049
4050 Sat Dec 27 21:11:09 2003  Ben Pfaff  <blp@gnu.org>
4051
4052         * get.c: (cmd_save_internal) Rename parameter.  Use &t->h instead
4053         of cast.
4054         (save_write_case_func) Use &trns->h instead of cast.
4055         (cmd_export) Use &t->h instead of cast.
4056
4057 Sat Dec 27 20:57:42 2003  Ben Pfaff  <blp@gnu.org>
4058
4059         Moved vectors into the dictionary.
4060
4061         * var.h: (struct vector) Moved here from vector.h.  `index' member
4062         renamed `idx', `v' renamed `var', `nv' renamed `cnt'.  All
4063         references updated.
4064         
4065         * vector.h: Removed.
4066
4067         * vector.c: (global var vec) Removed.
4068         (global var nvec) Removed.
4069         (cmd_vector) Rewritten.
4070         (find_vector) Removed.
4071
4072         * dictionary.c: (dict_create_vector) New function.
4073         (dict_get_vector) New function, replaces reading global vec[]
4074         array.
4075         (dict_get_vector_cnt) New function, replaces reading global nvec
4076         variable.
4077         (dict_lookup_vector) New function, replaces find_vector().
4078         (dict_clear_vectors) New function.
4079
4080 Sat Dec 27 20:54:01 2003  Ben Pfaff  <blp@gnu.org>
4081
4082         Start to move away from `struct variable' p `union' member to void
4083         * aux member.
4084
4085         * var.h: (struct variable) Add `aux' member.
4086
4087 Sat Dec 27 20:36:25 2003  Ben Pfaff  <blp@gnu.org>
4088
4089         Get rid of struct variable `foo' member.
4090
4091         * frequencies.q: (internal_cmd_frequencies) Use p.frq.used instead
4092         of foo.
4093         (frq_custom_variables) Ditto.
4094         (frq_custom_grouped) Ditto.
4095
4096         * get.c: (struct save_trns) Change `var' member from `int *' to
4097         `struct variable **'.
4098         (cmd_save_internal) Use aux instead of foo.
4099         (save_trns_proc) Use revised `var' member.
4100         (static var mtf_seq_no) Renamed mtf_seq_num.
4101         (static var mtf_seq_nums) New static var.
4102         (cmd_match_files) Initialize mtf_seq_nums.
4103         (mtf_free) Free mtf_seq_nums.
4104         (mtf_processing) Use mtf_seq_nums instead of foo.
4105         (mtf_merge_dictionary) No need to initialize mv->foo.
4106         (cmd_export) Use aux instead of foo.  Use revised `var' member.
4107         (mns_custom_tables) Don't use foo to check for duplicates, that's
4108         what PV_NO_DUPLICATE is for.
4109
4110         * var.h: (struct variable) Remove `foo' member.
4111         (struct frequencies_proc) New member.
4112         
4113 Sat Dec 27 19:46:13 2003  Ben Pfaff  <blp@gnu.org>
4114
4115         Clean up COMPUTE and IF.
4116
4117         * compute.c: More or less rewrite the darn thing.
4118         (struct compute_trns) Rename and reorder and add and delete
4119         members.
4120         (cmd_compute) Rewrite.
4121         (compute_num) Make conditional on test expression.  Now used for
4122         both COMPUTE and IF.
4123         (compute_num_vec) Ditto.
4124         (compute_str) Ditto.
4125         (compute_str_vec) Ditto.
4126         (cmd_if) Rewrite.
4127         (if_num) Removed.
4128         (if_num_vec) Removed.
4129         (if_str) Removed.
4130         (if_str_vec) Removed.
4131         (parse_target_expression) Renamed parse_rvalue_expression(),
4132         rewritten.
4133         (new_trns) Renamed compute_trns_create(), rewritten.
4134         (delete_trns) Removed.
4135         (free_trns) Renamed compute_trns_free(), rewritten.
4136         (struct lvalue) New structure.
4137         (parse_var_or_vec) Renamed lvalue_parse(), rewritten.
4138         (lvalue_get_type) New function.
4139         (lvalue_is_vector) New function.
4140         (lvalue_finalize) New function.
4141         (lvalue_destroy) New function.
4142         
4143 Sat Dec 27 19:44:14 2003  Ben Pfaff  <blp@gnu.org>
4144
4145         * command.def: Disallow MODIFY VARS in input mode, so that
4146         variables can't get dropped and confuse cmd_end_input_program()'s
4147         attempt to fill inp_init[].
4148         
4149         * modify-vars.c: (static var forward_positional_ordering) New
4150         variable.
4151         (struct var_modification) Entirely changed.
4152         (rearrange_dict) Interface changed, rewritten.
4153         (cmd_modify_vars) Deal with modified struct var_modification, much
4154         rewritten.
4155         (struct var_renaming) New structure.
4156         (compare_var_renaming_by_new_name) New function.
4157         (validate_var_modification) New function.
4158
4159         * var.h: (struct modify_vars_proc) Removed.
4160         (struct variable) Removed member p.mfv.
4161
4162 Sat Dec 27 19:40:26 2003  Ben Pfaff  <blp@gnu.org>
4163
4164         Make EVALUATE a valid command whether we're debugging or not, so
4165         that `make check' can succeed regardless of whether debugging is
4166         turned on.
4167         
4168         * command.def: [GLOBAL_DEBUGGING] Drop the #if.
4169
4170         * compute.c: [GLOBAL_DEBUGGING] (cmd_evaluate) Drop the #if.
4171
4172 Sat Dec 27 19:34:40 2003  Ben Pfaff  <blp@gnu.org>
4173
4174         * apply-dict.c: (cmd_apply_dictionary) Replace a ghastly switch
4175         statement by a simple if test.
4176
4177         * dfm.c: (dfm_get_record) Add assertion.
4178
4179 Sat Dec 27 17:51:26 2003  Ben Pfaff  <blp@gnu.org>
4180
4181         For each file x.c, move #include "x.h" to the very top of the
4182         include list, to catch x.h failing to include the proper headers.
4183
4184 Sat Dec 27 17:50:19 2003  Ben Pfaff  <blp@gnu.org>
4185
4186         * algorithm.c: (find) New function.
4187         (remove_equal) New function.
4188         (set_difference) New function.
4189         (adjacent_find_equal) New function.
4190         [TEST_UNIQUE] Removed test case.
4191         (copy_if) Find end test.
4192
4193 Sat Dec 27 17:42:45 2003  Ben Pfaff  <blp@gnu.org>
4194
4195         * dictionary.c: (dict_get_case_weight) New convenience function.
4196
4197         * aggregate.c: (accumulate_aggregate_info) Use
4198         dict_get_case_weight().
4199
4200         * frequencies.q: (calc_general) Ditto.
4201         (calc_integer) Ditto.
4202         (calc) Ditto.
4203
4204         * t-test.q: (groups_calc) Ditto.
4205         (z_calc) Ditto.
4206
4207 Sat Dec 27 17:29:45 2003  Ben Pfaff  <blp@gnu.org>
4208
4209         * glob.c: (global var default_dict) Change from `struct
4210         dictionary' to `struct dictionary *'.  All references changed.
4211         (init_glob) Initialize default_dict with dict_create().
4212
4213 Sat Dec 27 17:06:06 2003  Ben Pfaff  <blp@gnu.org>
4214
4215         struct dictionary now made opaque.  All related functions:
4216
4217         * get.c: (rename_variables) Removed.
4218         (dict_delete_run) Removed.
4219         
4220         * temporary.c: (copy_variable) Removed.
4221         (new_dictionary) Removed.
4222         (save_dictionary) Removed.
4223         (restore_dictionary) Removed.
4224         (free_dictionary) Removed.
4225
4226         * vars-atr.c: (clear_default_dict) Removed.
4227         (find_variable) Removed.
4228         (find_dict_variable) Removed.
4229         (create_variable) Removed.
4230         (delete_variable) Removed.
4231         (common_init_stuff) Removed.
4232         (init_variable) Removed.  Updating of inp_init moved into
4233         cmd_end_input_program().
4234         (replace_variable) Removed.
4235         (rename_variable) Removed.
4236         (clear_variable) Removed.
4237         (dup_variable) Removed.
4238
4239         * vars-prs.c: (is_varname) Removed.
4240         (is_dict_varname) Removed.
4241         (fill_all_vars) Removed.
4242
4243         * vector.c: (find_vector) Removed.
4244
4245         * weight.c: (stop_weighting) Removed.
4246
4247         * dictionary.c: New file.
4248         (dict_create) New, replaces new_dictionary().
4249         (dict_clone) New, replaces save_dictionary() and
4250         restore_dictionary().
4251         (dict_clear) New, replaces clear_default_dict().
4252         (dict_destroy) New, replaces free_dictionary().
4253         (dict_get_var_cnt) New function, replaces references to
4254         dict->nvar.
4255         (dict_get_var) New function, replaces references to dict->var[i].
4256         (dict_get_vars) New function, replaces fill_all_vars().
4257         (dict_create_var) New, replaces create_variable().  Interface
4258         drops `type' parameter, using a zero `width' to designate numeric.
4259         (dict_clone_var) New, replaces dup_variable().
4260         (dict_rename_var) New, replaces rename_variable().
4261         (dict_lookup_var) New, replaces find_variable(),
4262         find_dict_variable(), is_varname().
4263         (dict_contains_var) New function.
4264         (compare_variable_dblptrs) New function.
4265         (dict_delete_var) New function, replaces clear_variable().
4266         (dict_delete_vars) New function, replaces dict_delete_run().
4267         (dict_reorder_vars) New function.
4268         (dict_rename_vars) New function, replaces rename_variables().
4269         (dict_get_weight) New function, replaces reading dict->weight_var.
4270         (dict_set_weight) New function, replaces writing dict->weight_var
4271         or calling stop_weight(dict).
4272         (dict_get_filter) New function, replaces reading dict->filter_var.
4273         (dict_set_filter) New function, replaces writing dict->filter_var.
4274         (dict_get_case_limit) New function, replaces reading dict->N.
4275         (dict_set_case_limit) New function, replaces writing dict->N.
4276         (dict_get_value_cnt) New function, replaces reading dict->nval.
4277         (dict_compact_values) New function, replaces a loop that was
4278         replicated in several places.
4279         (dict_get_split_vars) New function, replaces reading dict->splits.
4280         (dict_get_split_cnt) New function, replaces reading
4281         dict->n_splits.
4282         (dict_set_split_vars) New function, replaces writing dict->splits.
4283         (dict_get_label) New function, replaces reading dict->label.
4284         (dict_set_label) New function, replaces writing dict->label.
4285         (dict_get_documents) New function, replaces reading
4286         dict->documents.
4287         (dict_set_documents) New function, replaces writing
4288         dict->documents.
4289         
4290         All references to above functions updated.
4291         
4292         * aggregate.c: (cmd_aggregate) Copy file label and documents from
4293         old dictionary to new by hand, because dict_create() can't do it
4294         itself.  Use dict_set_documents(), dict_set_split_vars().
4295
4296         * temporary.c: (cancel_temporary) Also set temp_dict to NULL after
4297         calling dict_destroy().
4298
4299         * data-list.c: (dls_var_spec) Remove `type' member, replace by
4300         `width'.
4301         (fixed_parse_compatible) Some slightly nontrivial changes for
4302         dict_create_var().
4303         (dump_fmt_list) Ditto.
4304         (parse_free) Ditto.
4305
4306         * file-type.c: (create_col_var) Ditto.
4307
4308         * get.c: (cmd_get) Use dict_compact_values() instead of a loop.
4309         (trim_dictionary) Use dict_delete_vars(), dict_reorder_vars().
4310         (rename_variables) Use dict_rename_vars().
4311         (mtf_merge_dictionary) Use dict_get_documents(),
4312         dict_set_documents(), dict_compact_values().
4313
4314         * pfm-read.c: (read_variables) Deal with changes to weighting.
4315
4316         * q2c.c: (dump_parser) Use dict_lookup_var() instead of
4317         is_varname() in output code.
4318
4319         * sfm-read.c: (read_header) Use dict_create(), dict_set_label(),
4320         other dictionary functions.
4321
4322         * title.c: (add_document_line) Use dict_get_documents(),
4323         dict_set_documents().
4324
4325         * vars-atr.c: (discard_variables) Use dict_clear(default_dict),
4326         reset default_handle by hand.  dict_clear() will clear vectors so
4327         there's no need for that by hand.
4328
4329         * vfm.c: (close_active_file) Move call to finish_compaction()
4330         earlier, so that we can do the compaction as a single step using
4331         dict_compact_values().  Use dict_clear_vectors().
4332         (finish_compaction) Use dict_delete_var(), dict_compact_values().
4333                 
4334         Some functions don't have replacements:
4335
4336         * vars-atr.c: (force_create_variable) Removed.  All references
4337         updated to dict_create_var() followed by an assertion.
4338         (force_dup_variable) Removed.  All references updated to
4339         dict_clone_var() followed by an assertion.
4340         
4341         * weight.c: (update_weighting) Removed.  No longer necessary, so
4342         all references removed.
4343
4344 Sat Dec 27 16:43:01 2003  Ben Pfaff  <blp@gnu.org>
4345
4346         Clean up AGGREGATE.
4347         
4348         * aggregate.c: Eliminate separation of weighted and unweighted
4349         case.  It made the code too obscure and I doubt it was actually
4350         faster.  Instead, all code uses the "weighted" code, because
4351         that's a generalization of the "unweighted" code.
4352         (FWEIGHT) Removed.
4353         (FOPTIONS) Ditto.
4354         (parse_aggregate_functions) No need to set FWEIGHT.
4355         (accumulate_aggregate_info) Get rid of FWEIGHT cases.
4356         (dump_aggregate_info) Ditto.
4357         (initialize_aggregate_info) No need for special plain_function
4358         that gets rid of FWEIGHT option.
4359
4360         * aggregate.c: Get rid of approximations.
4361         (accumulate_aggregate_info) Don't use approx_gt(), approx_lt(),
4362         approx_in_range().
4363         (aggregate_single_case) Don't use approx_ne().
4364
4365 Sat Dec 27 16:19:36 2003  Ben Pfaff  <blp@gnu.org>
4366
4367         * ascii.c (ascii_line_width): Dead code, removed.
4368
4369         * postscript.c (ps_line_width): Ditto.
4370
4371         * q2c.c (xrealloc): Ditto.
4372
4373         * count.c (internal_cmd_count): Ditto.
4374
4375         * means.q (validate_dependent_endpoint): Ditto.
4376
4377         * set.q: (cmd_gset) Ditto.
4378
4379         * weight.c: [0] (weight_trns_proc) Ditto.
4380
4381 Sat Dec 27 16:18:16 2003  Ben Pfaff  <blp@gnu.org>
4382
4383         Make the code -Wmissing-prototypes clean.
4384
4385         * Makefile.am (version.c): Add #include "version.h".
4386         
4387         * ascii.c: (ascii_open_global) Make static.
4388         (ascii_close_page) Ditto.
4389         (ascii_font_sizes) Ditto.
4390         (ascii_postopen_driver) Ditto.
4391         (ascii_close_driver) Ditto.
4392         (ascii_option) Ditto.
4393         (ascii_open_page) Ditto.
4394         (ascii_line_horz) Ditto.
4395         (ascii_line_vert) Ditto.
4396         (ascii_line_intersection) Ditto.
4397         (ascii_box) Ditto.
4398         (ascii_polyline_begin) Ditto.
4399         (ascii_polyline_point) Ditto.
4400         (ascii_polyline_end) Ditto.
4401         (ascii_text_set_font_by_name) Ditto.
4402         (ascii_text_set_font_by_position) Ditto.
4403         (ascii_text_set_font_by_family) Ditto.
4404         (ascii_text_get_font_name) Ditto.
4405         (ascii_text_get_font_family) Ditto.
4406         (ascii_text_set_size) Ditto.
4407         (ascii_text_get_size) Ditto.
4408         (ascii_text_metrics) Ditto.
4409         (ascii_text_draw) Ditto.
4410         (ascii_close_page) Ditto.
4411
4412         * cmdline.h: New header for parse_command_line().  Used where
4413         needed.
4414
4415         * command.c: Move prototypes for cmd_*() functions to command.h.
4416
4417         * command.h: Prototypes for cmd_*() functions moved here from
4418         command.c.
4419
4420         * crosstabs.q: (gamma_int) Ditto.
4421
4422         * file-handle.h: Add fh_init_files() prototype.
4423         
4424         * getline.c: (welcome) Ditto.
4425
4426         * glob.h: New header for init_glob().  Used where appropriate.
4427
4428         * hash.c: (comparison_helper) Ditto.
4429
4430         * html.c: (html_open_global) Ditto.
4431         (html_close_global) Ditto.
4432         (html_preopen_driver) Ditto.
4433         (html_postopen_driver) Ditto.
4434         (html_close_driver) Ditto.
4435         (html_option) Ditto.
4436         (html_open_page) Ditto.
4437         (html_close_page) Ditto.
4438         (html_submit) Ditto.
4439
4440         * inpt-pgm.c: (input_program_source_read) Ditto.
4441
4442         * output.c: (find_defn_value) Ditto.
4443         (destroy_list) Ditto.
4444
4445         * pfm-read.c: (read_int) Ditto.
4446
4447         * postscript.c: (ps_open_global) Ditto.
4448         (ps_close_global) Ditto.
4449         (ps_font_sizes) Ditto.
4450         (ps_preopen_driver) Ditto.
4451         (ps_postopen_driver) Ditto.
4452         (ps_close_driver) Ditto.
4453         (ps_option) Ditto.
4454         (ps_open_page) Ditto.
4455         (ps_close_page) Ditto.
4456         (ps_line_horz) Ditto.
4457         (ps_line_vert) Ditto.
4458         (ps_line_intersection) Ditto.
4459         (ps_box) Ditto.
4460         (ps_polyline_begin) Ditto.
4461         (ps_polyline_point) Ditto.
4462         (ps_polyline_end) Ditto.
4463         (ps_text_set_font_by_name) Ditto.
4464         (ps_text_set_font_by_position) Ditto.
4465         (ps_text_set_font_family) Ditto.
4466         (ps_text_get_font_name) Ditto.
4467         (ps_text_get_font_family) Ditto.
4468         (ps_text_set_size) Ditto.
4469         (ps_text_get_size) Ditto.
4470         (ps_text_metrics) Ditto.
4471         (ps_text_draw) Ditto.
4472
4473         * q2c.c: (finish_up) Ditto.
4474         (xmalloc) Ditto.
4475         (xstrdup) Ditto.
4476         (get_buffer) Ditto.
4477         (st_lower) Ditto.
4478         (st_upper) Ditto.
4479         (skip_ws) Ditto.
4480         (get_line) Ditto.
4481         (add_symbol) Ditto.
4482         (find_symbol) Ditto.
4483         (lex_get) Ditto.
4484         (force_id) Ditto.
4485         (force_string) Ditto.
4486         (match_id) Ditto.
4487         (match_token) Ditto.
4488         (skip_token) Ditto.
4489         (parse) Ditto.
4490         (parse_setting) Ditto.
4491         (parse_specifier) Ditto.
4492         (parse_specifiers) Ditto.
4493         (parse_subcommand) Ditto.
4494         (dump_specifier_vars) Ditto.
4495         (is_keyword) Ditto.
4496         (make_identifier) Ditto.
4497         (dump_declarations) Ditto.
4498         (dump_specifier_init) Ditto.
4499         (dump_vars_init) Ditto.
4500         (make_match) Ditto.
4501         (dump_specifier_parse) Ditto.
4502         (dump_subcommand) Ditto.
4503         (dump_parser) Ditto.
4504         (dump_header) Ditto.
4505         (dump_free) Ditto.
4506         (recognize_directive) Ditto.
4507
4508         * recode.c: (string_to_long) Ditto.
4509
4510         * repeat.c: (find_DO_REPEAT_substitution) Ditto.
4511
4512         * repeat.h: New header for perform_DO_REPEAT_substitutions, used
4513         where appropriate.
4514
4515         * sort.c: (sort_stream_read) Ditto.
4516         (sort_stream_mode) Ditto.
4517         
4518 Fri Dec 19 23:35:04 2003  Ben Pfaff  <blp@gnu.org>
4519
4520         * algorithm.c (binary_search): Fix comparison.
4521
4522 Fri Dec 19 23:27:45 2003  Ben Pfaff  <blp@gnu.org>
4523
4524         * algorithm.c: (binary_search) Fix assertion.
4525
4526 Fri Dec 19 21:31:48 2003  Ben Pfaff  <blp@gnu.org>
4527
4528         * sysfile-info.c: (compare_vectors_by_name) Rewrite.
4529
4530 Fri Dec 19 21:30:24 2003  Ben Pfaff  <blp@gnu.org>
4531
4532         * sort.c: (compare_case_lists) Rewrite.
4533
4534 Fri Dec 19 16:44:22 2003  Ben Pfaff  <blp@gnu.org>
4535
4536         * quicksort.c: Removed (not used).
4537
4538         * quicksort.h: Removed (not used).
4539
4540         * sort.c: Removed blp_quicksort() prototype.
4541
4542 Fri Dec 19 16:42:13 2003  Ben Pfaff  <blp@gnu.org>
4543
4544         * postscript.c: (int_2_compare) Rewrite.
4545         (compare_line) Rewrite.
4546
4547 Fri Dec 19 16:38:35 2003  Ben Pfaff  <blp@gnu.org>
4548
4549         * matrix-data.c (compare_factors) Use lexicographical_compare()
4550         algorithm.
4551         (compare_doubles) New function.
4552         
4553         * algorithm.c: (lexicographical_compare) New algorithm.
4554
4555 Fri Dec 19 16:23:45 2003  Ben Pfaff  <blp@gnu.org>
4556
4557         * matrix-data.c (compare_variables_by_mxd_vartype): Rewrite.
4558
4559 Fri Dec 19 15:54:45 2003  Ben Pfaff  <blp@gnu.org>
4560
4561         * expr-prs.c: (cmp_func) Removed.
4562         (parse_function) Use binary_search() algorithm.
4563         (compare_functions) New function.
4564         (init_func_tab) Use sort() algorithm.
4565
4566         * algorithm.c: (binary_search) New algorithm.
4567
4568 Fri Dec 19 15:50:45 2003  Ben Pfaff  <blp@gnu.org>
4569
4570         * descript.q: (display) Use sort() algorithm instead of qsort().
4571         (compare_func) Removed.
4572         (descriptives_compare_variables) New function.
4573
4574 Fri Dec 19 15:08:38 2003  Ben Pfaff  <blp@gnu.org>
4575
4576         Get rid of AVL trees.  Hashes are more appropriate for everything
4577         PSPP does.
4578
4579         * Makefile.am: (pspp_SOURCES) Remove avl.c, avl.h.
4580         
4581         * avl.c: Removed.
4582
4583         * avl.h: Removed.
4584
4585 Fri Dec 19 14:33:31 2003  Ben Pfaff  <blp@gnu.org>
4586
4587         Much code can be clarified by using C++ STL-like algorithms.  Not
4588         all uses of these algorithms are listed below, only the ones where
4589         the change to an algorithm was the only change of interest.
4590         
4591         * Makefile.am: (pspp_SOURCES) Add algorithm.c, algorithm.h.
4592         
4593         * algorithm.c: New file.
4594
4595         * algorithm.h: New file.
4596
4597         * modify-vars.c: (static var forward) Removed.
4598         (static var positional) Removed.
4599         (compare_variables) Removed.
4600         (struct ordering) New.
4601         (cmd_modify_vars) Use sort() algorithm.
4602         (compare_variables_given_ordering) New function.
4603         (rearrange_dict) Use sort() algorithm.
4604
4605         * sysfile-info.c: (cmd_display) Use sort() algorithm.
4606         (cmp_var_by_name) Removed.
4607
4608 Fri Dec 19 14:26:17 2003  Ben Pfaff  <blp@gnu.org>
4609
4610         Make file handles use a hash table.
4611         
4612         * file-handle.q: (files) Change to hash table, make static.
4613         (cmd_file_handle) Use hash table functions.
4614         (fh_get_handle_by_filename) Ditto.
4615         (fh_get_handle_by_name) Ditto.
4616         (hash_file_handle) New function.
4617         (cmp_file_handle) Rewrite.
4618         (fh_init_files) Use hash table functions.
4619
4620 Fri Dec 19 14:24:38 2003  Ben Pfaff  <blp@gnu.org>
4621
4622         Clean up FREQUENCIES.
4623         
4624         * Makefile.am: (pspp_SOURCES) Remove frequencies.g.
4625
4626         * frequencies.q: Remove a lot of old #if'd out code at the end.
4627         (internal_cmd_frequencies) Use calc() instead of calc_no_weight()
4628         or calc_weight().  Initialize percentile_values.
4629         (calc) New function based on calc_weight() from frequencies.g.
4630         (precalc) Use hash functions.
4631         (static var comparison_func) Removed.
4632         (static var comparison_param) Removed.
4633         (comparison_helper) Removed.
4634         (get_freq_comparator) New function.
4635         (not_missing) New function.
4636         (add_freq) Removed.
4637         (postprocess_freq_tab) Use hash table functions, algorithms,
4638         get_freq_comparator().  Rewrite.
4639         (cleanup_freq_tab) Rephrase.
4640         (add_percentile) Clean up spacing.
4641         (hash_value_numeric) New function.
4642         (hash_value_alpha) New function.
4643         (compare_value_numeric_a) Rewrite.
4644         (compare_value_alpha_a) Rewrite.
4645         (compare_value_numeric_d) Rewrite.
4646         (compare_value_alpha_d) Rewrite.
4647         (compare_freq_numeric_a) Rewrite.
4648         (compare_freq_alpha_a) Rewrite.
4649         (compare_freq_numeric_d) Rewrite.
4650         (compare_freq_alpha_d) Rewrite.
4651         (calc_stats) Clean up mode, percentiles, max.
4652         (dump_statistics) Clean up spacing.
4653         
4654         * frequencies.g: Removed.
4655
4656         * var.h: (struct freq_tab) Change `data' to hash table.
4657
4658 Fri Dec 19 14:15:46 2003  Ben Pfaff  <blp@gnu.org>
4659
4660         * file-handle.h: Remove declaration of global variable `files',
4661         which wasn't used anywhere.
4662
4663         * postscript.c: (add_encoding) Remove superfluous cast.
4664         (line) Ditto.
4665
4666         * sfm-read.c: [linux] (bswap_int32) Drop ntohl() non-portable
4667         version.
4668
4669         * temporary.c: [0] (display_tree) Removed.
4670
4671 Fri Dec 19 14:13:04 2003  Ben Pfaff  <blp@gnu.org>
4672
4673         Implement a new random number generator based on the alleged RC4
4674         algorithm.
4675
4676         * expr-evl.c: (expr_evaluate) Use rng_get_double_normal() instead
4677         of rand_normal().
4678
4679         * random.c: [!HAVE_GOOD_RANDOM] (real_rand) Removed.
4680         [!HAVE_GOOD_RANDOM] (real_srand) Removed.
4681         (macro k) Removed.
4682         (static var V[]) Removed.
4683         (static var Y) Removed.
4684         (static var X2) Removed.
4685         (setup_randomize) Removed.
4686         (shuffle) Removed.
4687         (rand_uniform) Removed.
4688         (rand_normal) Removed.
4689         (struct rng) New structure.
4690         (rng_create) New function.
4691         (rng_destroy) New function.
4692         (swap_byte) New static function.
4693         (rng_seed) New function.
4694         (rng_get_bytes) New function.
4695         (rng_get_int) New function.
4696         (rng_get_unsigned) New function.
4697         (rng_get_double) New function.
4698         (rng_get_double_normal) New function.
4699         (pspp_rng) New function.
4700
4701         * random.h: Sync up to random.c.
4702
4703         * sample.c: (struct sample_trns) Make `frac' unsigned and a
4704         fraction of UINT_MAX, not 65536.
4705         (cmd_sample) Use rng_get_unsigned(), rng_get_double(), UINT_MAX
4706         fraction.
4707
4708         * vfm.c: (open_active_file) No need to call setup_randomize() any
4709         longer.
4710
4711 Fri Dec 19 12:05:56 2003  Ben Pfaff  <blp@gnu.org>
4712
4713         Change dictionary name indexes to use hash tables instead of AVL
4714         trees.
4715
4716         * crosstabs.q: (free_var_dict) Use hash tables.
4717         (crs_custom_tables) Ditto.
4718         (calc_general) Ditto.
4719         (compare_table_entry) Rewrite.
4720         (enum_var_values) Reorder parameters.  All references updated.
4721         Rewrite.
4722
4723         * get.c: (rename_variable) Use hash tables.
4724         (mtf_merge_dictionary) Ditto.
4725
4726         * glob.c: (init_glob) Use hash tables.
4727         (cmp_variable) Removed.
4728
4729         * means.q: (mns_custom_tables) Use hash tables.
4730
4731         * modify-vars.c: (rearrange_dict) Use hash tables.
4732
4733         * rename-vars.c: (cmd_rename_variables) Use hash tables.
4734
4735         * sfm-read.c: (read_header) Use hash tables.
4736         (read_variables) Ditto.
4737
4738         * temporary.c: (new_dictionary) Use hash tables.
4739         (save_dictionary) Ditto.
4740         (restore_dictionary) Ditto.
4741
4742         * var.h: (struct dictionary) Change AVL tree `var_by_name' into
4743         hash table `name_tab'.
4744
4745         * vars-atr.c: [DEBUGGING] (dump_one_var_node) Removed.
4746         [DEBUGGING] (dump_var_tree) Removed.
4747         (find_variable) Use hash tables.
4748         (find_dict_variable) Ditto.
4749         (common_init_stuff) Ditto.
4750         (rename_variable) Ditto.
4751         (clear_variable) Ditto.  Also, remove debug code.
4752         (dup_variable) Use hash tables.
4753
4754         * vars-prs.c: (fill_all_vars) Use hash tables.
4755         (is_dict_varname) Ditto.
4756         (parse_dict_variable) Ditto.
4757         
4758 Fri Dec 19 11:46:23 2003  Ben Pfaff  <blp@gnu.org>
4759
4760         Change value labels to use hash tables instead of AVL trees, and
4761         change value labels into an ADT.
4762
4763         * Makefile.am: (pspp_SOURCES) Add value-labels.c, value-labels.h.
4764         
4765         * value-labels.c: New file.
4766
4767         * value-labels.h: New file.
4768
4769         * apply-dict.c: (cmd_apply_dictionary) Use value label ADT.
4770         Get rid of a stupid use of goto.
4771
4772         * autorecode.c: (compare_alpha_value) Rewrite.
4773         (hash_alpha_value) Ditto.
4774         (compare_numeric_value) Rewrite.
4775         (hash_numeric_value) Ditto.
4776
4777         * frequencies.q: (dump_full) Use value label ADT.
4778
4779         * pfm-read.c: (read_value_label) Use value label ADT.
4780
4781         * pfm-write.c: (write_value_labels) Use value label ADT.
4782
4783         * sfm-read.c: (read_variables) Use value label ADT.
4784         (read_value_labels) Rewrite.
4785
4786         * sfm-write.c: (write_value_labels) Rewrite.
4787
4788         * sysfile-info.c: (cmd_sysfile_info) Use value label ADT.
4789         (display_variables) Ditto.
4790         (describe_variable) Ditto.
4791
4792         * t-test.q: (print_t_groups) Use value label ADT.
4793
4794         * temporary.c: (copy_variable) Use value label ADT.
4795         (free_dictionary) Ditto.
4796
4797         * val-labs.c: (verify_val_labs) Use value label ADT.
4798         (get_label) Ditto.
4799         (debug_print) Ditto.
4800         (val_lab_cmp) Removed.
4801         (inc_ref_count) Removed.
4802         (copy_value_labels) Removed.
4803
4804         * var.h: (struct value_label) Removed.
4805         (struct variable) Change AVL tree `val_lab' into hash table
4806         `val_labs'.
4807
4808         * vars-atr.c: (init_variable) Use value label ADT.
4809         (clear_variable) Ditto.
4810         (free_value_label) Removed.
4811         (free_val_lab) Removed.
4812         (get_val_lab) Removed.
4813         (compare_variables) New function.
4814         (hash_variable) New function.
4815
4816         * vfm.c: (dump_splits) Use value label ADT.
4817
4818 Fri Dec 19 11:18:11 2003  Ben Pfaff  <blp@gnu.org>
4819
4820         Add to the hash table interface.
4821
4822         * hash.c: (hsh_hash_bytes) Add assertion.
4823         (hsh_hash_string) Ditto.
4824         (hsh_clear) Ditto.
4825         (hsh_rehash) Ditto.
4826         (hsh_probe) Ditto.
4827         (hsh_create) Ditto.  Also make minimum `size'.
4828         (hsh_destroy) Rephrase.
4829         (sort_nulls_last) Removed.
4830         (not_null) New function.
4831         (hsh_data) Ditto.
4832         (comparison_helper) Ditto.
4833         (hsh_sort) Rewritten.
4834         (hsh_data_copy) New function.
4835         (hsh_sort_copy) Ditto.
4836         (hsh_insert) Ditto.
4837         (hsh_replace) Ditto.
4838         (hsh_hash_double) Ditto.
4839         (hsh_delete) Fix stupid bug.
4840         
4841 Thu Dec 18 12:27:03 WAST 2003 John Darrington <john@darrington.wattle.id.au>
4842         * added a calculation of the mode to FREQUENCIES
4843
4844 Wed Dec 17 12:53:01 WAST 2003 John Darrington <john@darrington.wattle.id.au>
4845
4846         * moved (un)defs of DEBUGGING to config.h
4847
4848 Mon Dec 15 21:35:59 2003  Ben Pfaff  <blp@gnu.org>
4849
4850         * groff-font.c: (add_kern) Fix indentation.
4851         (add_kern) Use & instead of % to take power-of-2 modulus.
4852         (font_get_kern_adjust) Likewise.
4853
4854 Fri Dec 12 23:54:37 2003  Ben Pfaff  <blp@gnu.org>
4855
4856         * autorecode.c: (recode) Replace stupid use of memcpy() by
4857         memberwise copy.
4858         (hash_alpha_value) Use hsh_hash_bytes().  Get rid of nasty casts.
4859         (hash_numeric_value) Ditto.
4860         (autorecode_proc_func) pool_strdup() was wrong here because the
4861         source string was not null-terminated.  Use new pool_strndup()
4862         instead.
4863
4864         * crosstabs.q: (enum_var_values) Remove superfluous and bizarre
4865         use of hsh_iterator_init().
4866
4867         * data-in.c: (parse_N) Initialize i->v->f.
4868
4869         * flip.c: (cmd_flip) Use memmove(), not memcpy(), to copy
4870         overlapping arrays.
4871
4872         * groff-font.c: Use power-of-2 hash table sizes, not prime.
4873         (groff_read_font) Don't call hsh_next_prime().  Don't call
4874         fclose(NULL).
4875         (static var hash) Remove `size_p', `max_used' members.
4876         (font_char_name_to_index) Don't call hsh_next_prime().  Use
4877         hsh_hash_string() instead of hashpjw(), & instead of %.
4878         (default_font) Don't call hsh_next_prime().
4879
4880         * pool.c: (pool_strndup) New function.
4881         (pool_strdup) Reimplement in terms of pool_strndup.
4882
4883         * postscript.c: (hash_font_entry) Use hsh_hash_string().  Get rid
4884         of nasty casts.
4885         (hash_ps_encoding) Use hsh_hash_string().
4886         (hash_ps_combo) Use hsh_hash_string(), hsh_hash_int().
4887         (hash_filename2font) Use hsh_hash_string().
4888
4889         * som.c: Add #include <stdlib.h>.
4890
4891         * tab.c: (tab_destroy) Don't set t->container after freeing `t'
4892         (by destroying its pool).
4893         
4894 Fri Dec 12 23:18:59 2003  Ben Pfaff  <blp@gnu.org>
4895
4896         Miscellaneous hash table code cleanup:
4897         
4898         * hash.h: (struct hsh_table) Moved into hash.c.
4899         (hsh_count) Ditto, and transformed into function.
4900         (hsh_compare_func) New typedef, used for defining otherwise-long
4901         function types here and in hash.c
4902         (hsh_hash_func) Ditto.
4903         (hsh_free_func) Ditto.
4904         
4905         * hash.c: (struct hsh_table) Renamed `n' to `used', `m' to `size',
4906         `table' to `entries'.  Removed `mp'.  All references updated.
4907         (hsh_clear) Don't shrink entries array; if the hash was this big
4908         once, it probably will be again.
4909         (hsh_rehash) Made static.
4910         (force_hsh_insert) Renamed hsh_force_insert.
4911         (force_hsh_find) Renamed hsh_force_find.
4912
4913         Made hash table sizes powers of 2, because that's fine with any
4914         reasonable hash function and because taking a power-of-2 modulus
4915         is faster than any other:
4916         
4917         (hsh_prime_tab) Removed;
4918         (hsh_next_prime) Ditto.
4919         (next_power_of_2) New function.
4920         (hsh_create) Use next_power_of_2.
4921         (hsh_rehash) Use & instead of %.
4922
4923         Cleaned up hsh_sort:
4924         
4925         (internal_comparison_fn) Removed.
4926         (sort_nulls_last) New function.
4927         (hsh_sort) Removed second parameter, switched to using the new
4928         quicksort() function from quicksort.h to avoid using nasty need
4929         for static variables with qsort().  All references updated.
4930
4931         Changed the hash functions offered, because there are better hash
4932         functions than the ones we had, and cleaned up the names to boot:
4933         
4934         * hash.c: (hashpjw_d) Removed.
4935         (hashpjw) Ditto.
4936         (hsh_hash_bytes) New function.
4937         (hsh_hash_string) New function.
4938         (hsh_hash_int) New function.
4939
4940         Improved the hash table iteration interface:
4941         
4942         * hash.h: (hsh_iterator_init) Removed.
4943         (struct hsh_iterator) Removed `init' member, change `next' to
4944         size_t.
4945
4946         * hash.c: (hsh_foreach) Removed.  All references updated to use
4947         hsh_first/hsh_next instead.
4948         (hsh_first) New function.  Notably, unlike hsh_foreach() it does
4949         not treat a null pointer as an empty hash table.
4950         (hsh_next) New function.
4951
4952         Made deletion possible, though slow:
4953
4954         * hash.c: (locate_matching_entry) New function.
4955         (hsh_find) Use locate_matching_entry().
4956         (hsh_delete) New function also using locate_matching_entry().
4957         (hsh_force_delete) New function.
4958
4959 Fri Dec 12 23:16:10 2003  Ben Pfaff  <blp@gnu.org>
4960
4961         * quicksort.c: New file implementing a sort routine with a
4962         interface better than qsort() because it passes a user-provided
4963         parameter to the sort routine.
4964
4965         * Makefile.am: Add quicksort.c, quicksort.h.
4966
4967 Fri Dec 12 13:31:58 2003  Ben Pfaff  <blp@gnu.org>
4968
4969         * All source files: Get rid of nasty special cases for Checker,
4970         which is pretty obsolete now.
4971
4972 Thu Dec 11 21:38:24 WST 2003 John Darrington <john@darrington.wattle.id.au>
4973
4974         * Fixed a bug apparent when using the FREQUENCIES command with the
4975         html driver.  The html driver was incorrectly trying to display 
4976         empty cells.
4977
4978 Sun Jan  2 21:40:13 2000  Ben Pfaff  <blp@gnu.org>
4979
4980         * Makefile.am: Reorganized.  Put locale dir in version.c instead
4981         of passing it to each compile command.  Only put local gmp libs in
4982         LD_ADD if not installed on system.  Remove `boast' target.
4983
4984         * All source files: struct and union typedefs eliminated.
4985         `sizeof type' replaced by `sizeof object' where practical.  Moved
4986         `unused' qualifiers from start to end of declarations for gcc
4987         2.7.2 compatibility.  Change `while (1)' to `for (;;)'.  Made
4988         assertions on pointers strictly compliant.  Removed _ prefixes on
4989         some function parameter names.
4990
4991         * alloc.c: New source file, containing these external linkage
4992         functions removed from common.c: xmalloc, xcalloc, xrealloc,
4993         xstrdup.
4994
4995         * arena.c: Removed.
4996         
4997         * arena.h: Removed.
4998
4999         * ascii.c: Migrated from arenas to pools.
5000         (struct ascii_driver_ext) ops[], box[], fonts[] changed from
5001         c_string to len_string.  All references changed.
5002         (ascii_option) Signature changed to comply to new output.c
5003         interface.
5004         (count_fancy_chars) Removed.
5005         (delineate) Removed support for rich text.
5006         (ascii_text_metrics) Ditto.
5007         (text_draw) Ditto.
5008         (output_shorts) Change `box', `off', `on' from c_string to
5009         len_string.  Change `remaining' from int to size_t.
5010         (ascii_close_page) Make page numbering less haphazard.
5011
5012         * autorecode.c: Migrate from arenas to pools.
5013
5014         * avl.c: Migrate from arenas to pools.  Synch from libavl 1.4.0.
5015
5016         * bitvector.h: New file containing these macros from misc.h:
5017         SET_BIT, CLEAR_BIT, SET_BIT_TO, TEST_BIT, BIT_INDEX.
5018
5019         * command.c: (struct command) cmd1, cmd2, cmd3 members changed to
5020         word[3].  ncmd removed.
5021         (var empty_string) Removed.
5022         (var cmd_table) Declaration updated.
5023         (var cmdtab) Removed.
5024         (cmp_command) Removed.
5025         (split_words) Rewritten to use strtok_r().
5026         (init_cmd_parser) Renamed cmd_init().  Rewritten.
5027         (find_command) Removed.
5028         (FILE_TYPE_okay) Rewritten.
5029         (cmd_parse) Rewritten.  Semantics of the return value of command
5030         handlers has changed: they must now return one of the new CMD_*
5031         enumerals, rather than a magic value.  This meant that all
5032         commands had to be modified, and they were.
5033         (figure_out_command) New function.
5034
5035         * command.def: Add CORRELATIONS, PEARSON CORRELATIONS.  Add
5036         #defines for INIT, INPU, etc.
5037
5038         * command.h: New CMD_* enum series.
5039         (cur_proc) Make const char *, not char *.
5040         (cmd_init) Prototype.
5041         (cmd_parse) Ditto.
5042
5043         * common.c: Removed.
5044
5045         * common.h: Removed.
5046
5047         * correlations.q: New file.
5048
5049         * crosstabs.q: Migrate from arenas to pools.  Migrate to new-style
5050         q2c.
5051         (custom_tables) Renamed crs_custom_tables().
5052         (custom_variables) Renamed crs_custom_variables().
5053         (calc_integer) Add in some `const' qualifiers.
5054         (table_value_missing) Change from a_string to len_string.
5055         (float_M_suffix) Change from a_string to len_string.
5056
5057         * data-in.c: Rewritten.  All references to
5058         parse_string_as_format() changed to data_in().
5059
5060         * data-in.h: New file.
5061
5062         * data-list.c: Change DLS_* from #define's to enums.  Move from
5063         rpd_msg() to tmsg().
5064         (RPD_ERR) New #define.
5065         (do_reading) Change dfm_push_cust() to dfm_push(), pop_cust() to
5066         dfm_pop().
5067         (read_from_data_list_fixed) Change from old
5068         parse_string_as_format() to new data_in().
5069         (read_from_data_list_free) Ditto.
5070         (read_from_data_list_list) Ditto.
5071         (cmd_repeating_data) Modify approach to checking for end of
5072         command.
5073         (rpd_msg) Removed.
5074         (rpd_parse_record) Change from old parse_string_as_format() to new
5075         data_in().  Change from old convert_format_to_string() to new
5076         data_out().
5077         (read_one_set_of_repetitions) Change dfm_push_cust() to
5078         dfm_push(), pop_cust() to dfm_pop().
5079
5080         * data-out.c: Rewritten.  All references to
5081         convert_format_to_string() changed to data_out().
5082
5083         * descript.q: Migrate to new q2c.
5084         (cmd_descriptives) Removed.
5085         (internal_cmd_descriptives) Renamed cmd_descriptives ().
5086         (custom_variables) Renamed dsc_custom_variables().
5087
5088         * dfm.c: (struct dfm_fhuser_ext) `ln' removed.  All references
5089         removed.
5090         (open_file_r) Initialize h->where.line_number.  Migrate to new
5091         struct string.
5092         (open_file_w) Initialize h->where.line_number.
5093         (read_record) Change from ext->ln to h->where.line_number.
5094         Migrate to struct string.
5095         (dfm_put_record) Rephrased.
5096         (dfm_push_cust) Renamed dfm_push(), rewritten.
5097         (dfm_pop) New function.
5098
5099         * error.c: All references updated.
5100         (glob var error_count) Renamed err_err_count.
5101         (glob var warning_count) Renamed err_warning_count.
5102         (glob var error_already_flagged) Renamed err_already_flagged.
5103         (glob var verbosity) Renamed err_verbosity.
5104         (glob var cust_fn) Removed.
5105         (glob var cust_ln) Removed.
5106         (static var file_loc) New.
5107         (static var nfile_loc) New.
5108         (static var mfile_loc) New.
5109         (tmsg) New function.
5110         (push_cust) Removed.
5111         (pop_cust) Removed.
5112         (msg) Rewritten.
5113         (static var terminating) Removed.
5114         (failure) Renamed err_failure().
5115         (hcf) Renamed err_hcf().
5116         (err_push_file_locator) New function.
5117         (err_pop_file_locator) New function.
5118         (err_location) New function.
5119         (check_error_count) Renamed err_check_count().
5120         (vmsg) Renamed err_vmsg().  Interface changed.
5121         (verbose_msg) Removed.
5122         (err_cond_fail) New function.
5123         (error_break) Renamed err_break().
5124
5125         * error.h: All references updated.
5126         (enum MSG_CLASS_COUNT) Renamed ERR_CLASS_COUNT.
5127         (enum ERR_CLASS_MASK, ERR_VERBOSITY_SHIFT, ERR_VERBOSITY_MASK)
5128         New.
5129         (struct file_locator) New.
5130         (struct error) New.
5131         (macro verbose_msg) Removed.
5132         (macro cond_fail) Removed.
5133
5134         * expr-opt.c: (evaluate_tree) sizeof(char) == 1.
5135
5136         * expr-prs.c: Reorganized.  All references updated.
5137         (exprtypename) Renamed expr_type_name().
5138         (typename) Renamed type_name().
5139         (free_expression) Renamed expr_free().
5140         (parse_expression) Renamed expr_parse().  Uses new type_check()
5141         function.
5142         (init_functab) Renamed init_func_tab().
5143         (type_check) New function.
5144         (parse_or) Rewritten to use new allocate_nonterminal() and
5145         append_nonterminal_arg() functions.
5146         (parse_and) Ditto.
5147         (parse_not) Ditto.
5148         (parse_rel) Ditto.  Also simplified logic.
5149         (parse_add) Ditto.
5150         (parse_mul) Ditto.
5151         (parse_neg) Ditto.
5152         (parse_exp) Ditto.
5153         (SYSMIS_func) Ditto.
5154         (VALUE_func) Rephrased.
5155         (CONCAT_func) Fix memory leak by replacing free by free_node on
5156         lossage.
5157         (generic_str_func) Ditto.
5158         (parse_function) Ditto.  Also rephrasings.  Uses bsearch() to find
5159         function.
5160         (allocate_nonterminal) New function.
5161         (append_nonterminal_arg) New function.
5162         (static func_tab[]) Now at file level.
5163         (cmp_func) Moved.
5164         (init_func_tab) Moved.  Now just uses qsort() to sort func_tab[].
5165
5166         * expr.h: (enum series OP_*) Moved to exprP.h.
5167         (OP_* defines) Ditto.
5168         (struct op_desc) Ditto.
5169         (global ops[]) Ditto.
5170         (struct num_con_node) Ditto.
5171         (struct str_con_node) Ditto.
5172         (struct var_node) Ditto.
5173         (struct lag_node) Ditto.
5174         (struct casenum_node) Ditto.
5175         (struct nonterm_node) Ditto.
5176         (union any_node) Members renamed.
5177         (struct sys_node) Removed.
5178         (struct val_node) Removed.
5179         (operator typedef) Removed.
5180         (typedef exprtype) Removed.
5181         (enum series EX_*) Moved to exprP.h.
5182         (struct expression) Ditto.  Also renamed a lot of the members.
5183         (PXP_* defines) Changed to enums.
5184         (free_node prototype) Moved to exprP.h.
5185
5186         * file-handle.h: (struct file_handle) New member `where'.
5187
5188         * file-handle.q: Migrated to new q2c format.
5189         (prepend_current_directory) Removed (dead code).
5190         (cmd_file_handle) Incorporated all of internal_cmd_file_handle().
5191         (fh_get_handle_by_filename) Removed dead code.
5192         Set new `where' member.
5193
5194         * file-type.c: (file_type_source_read) References to
5195         parse_string_as_format() changed to data_in().
5196         dfm_push_cust()/pop_cust() changed to dfm_push()/dfm_pop().
5197
5198         * filename.c: All references updated.
5199         (init_filename) Renamed fn_init().
5200         (expand_line) Removed.
5201         (macro EXPAND_LINE) Removed.
5202         (interp_vars) Renamed fn_interp_vars().  Now uses st_*() instead
5203         of custom functions.
5204         (gnu_getcwd) Renamed fn_get_cwd(), rewritten.
5205         (tilde_expand) Renamed fn_tilde_expand(), uses ds_*().
5206         (normalize_filename) Renamed fn_normalize().
5207         (search_path) Renamed fn_search_path(), rewritten.
5208         (prepend_dir) Renamed fn_prepend_dir().
5209         (blp_getenv) Renamed fn_getenv().
5210         (blp_dirname) Renamed fn_dirname().
5211         (fn_basename) New function, not used.
5212         (absolute_filename_p) Renamed fn_absolute_p().
5213         (is_special_filename) Renamed fn_special_p().
5214         (file_exists) Renamed fn_exists_p().
5215         (readlink_malloc) Renamed fn_readlink().
5216         (getenv_default) Renamed fn_getenv_default().
5217         (open_file) Renamed fn_open().
5218         (close_file) Renamed fn_close().
5219         (open_file_ext) Renamed fn_open_ext().
5220         (close_file_ext) Renamed fn_close_ext().
5221
5222         * font.h: Migrate from arenas to pools.
5223
5224         * format.c: (parse_format_specifier_name) Deal with ds_* strings.
5225
5226         * frequencies.g: Migrate from arenas to pools.
5227
5228         * frequencies.q: Migrate to new q2c version.  Migrate from arenas
5229         to pools.
5230
5231         * getline.c: All references updated.
5232         (global getl_buf) Changed from char * to struct string.
5233         (static getl_include_path) Ditto.
5234         (global getl_buf_len) Removed.
5235         (global getl_buf_size) Removed.
5236         (getl_include_path) Deal with new getl_buf, getl_include_path.
5237         (getl_uninitialize) New function.
5238         (getl_get_current_directory) Rewritten.
5239         (getl_clear_include_path) Rewritten.
5240         (getl_add_include_dir) Rewritten.
5241         (getl_add_file) Assertion fixed.
5242         (getl_add_virtual_file) Change initial value of `remaining_loops'
5243         from 2 to 1.
5244         (welcome) Rewritten.
5245         (handle_line_buffer) Make static.  Change logic to make
5246         getl_add_virtual_file() change sensible.  Use ds_*() strings.
5247         (getl_read_line) Use ds_*() strings.  Implement SET ECHO.
5248         (getl_close_file) Moved.
5249         (getl_location) New function.
5250
5251         * getline.h: All references updated.
5252         (macro curln) Removed.
5253         (macro curfn) Removed.
5254         (macro am_interactive) Renamed getl_am_interactive.
5255         (macro am_reading_script) Renamed getl_reading_script.
5256
5257         * glob.c: (global fmt_parse_ignore_error) Removed.
5258         (init_glob) Use locale_dir not LOCALEDIR.  Use feholdexcept() on
5259         systems that support it (C99).  Turn off SET ECHO by default.  No
5260         necessary julcal initialization anymore.
5261
5262         * groff-font.c: Migrate from arenas to pools.
5263         (groff_read_font) Use err_push_file_locator().
5264         (groff_read_DESC) Ditto.
5265         (font_msg) Use tmsg().
5266
5267         * hash.c: (hsh_sort) Fix debug code.
5268         [GLOBAL_DEBUGGING] Include stdio.h.
5269
5270         * hash.h: (macro force_hsh_insert) Rephrase.
5271
5272         * heap.c: Rewritten.
5273         
5274         * heap.h: Rewritten.
5275
5276         * html.c: (html_option) Change from outp_value to struct string.
5277         (postopen) Change from curfn to getl_location().
5278         (escape_string) Remove rich-text code.  Signature changed.
5279         (output_tab_table) Switch from a_string to struct len_string.
5280         Remove rich text support.
5281
5282         * lexer.c: All references updated.  Largely rewritten.  Major
5283         changes listed below.  Removed tagged quote support.  Adapted to
5284         struct string tokstr.
5285         (global tokstr) Changed to struct string.
5286         (global tokstr_size) Removed.
5287         (global tokstr_len) Removed.
5288         (global tokid) New.
5289         (global tokint) Removed.
5290         (global toklongstr) Removed.
5291         (C* defines) Removed.
5292         (static tbl[]) Removed.
5293         (static id[]) Removed.
5294         (static une[]) Removed.
5295         (discard_line) Renamed lex_discard_line().
5296         (get_entire_line) Renamed lex_entire_line().
5297         (get_rest_of_line) Renamed lex_rest_of_line().
5298         (get_dotted_rest_of_line) Merged into lex_rest_of_line().
5299         (make_hexit) Removed.
5300         (syntax_error) Renamed lex_error().  Return value removed.
5301         (get_token_representation) Renamed lex_token_representation().
5302         (putback) Renamed lex_put_back().
5303         (putfwd) Renamed lex_put_forward().
5304         (convert_negative_to_dash) Renamed lex_negative_to_dash().
5305         (set_prog) Renamed lex_set_prog().
5306         (init_lex) Renamed lex_init().
5307         (reset_eof) Renamed lex_reset_eof().
5308         (lookahead) Renamed lex_look_ahead().
5309         (check_id) Rewritten.
5310         (yylex) Renamed lex_get(), rewritten.
5311         (lex_end_of_command) New function.  Many commands were rephrased
5312         using this.
5313         (lex_integer_p) New function.  Replaces compare of tokint against
5314         NOT_LONG.
5315         (lex_integer) New function.  Replaces tokint.
5316         (match_tok) Renamed lex_match().
5317         (match_id) Renamed lex_match_id().
5318         (match_int) Renamed lex_match_int().
5319         (force_match_id) Renamed lex_force_match_id(), added return value.
5320         (force_match) Renamed lex_force_match(), added return value.
5321         (force_string) Renamed lex_force_string(), added return value.
5322         (force_int) Renamed lex_force_int(), added return value.
5323         (lex_id_match_len) New function.
5324         (id_match) Renamed lex_id_match(), rewritten.
5325         (get_line) Renamed lex_get_line().
5326         (preprocess_line) Renamed lex_preprocess_line().
5327         (tokname) Renamed lex_token_name().
5328         (bin_value_func) Removed.
5329         (oct_value_func) Removed.
5330         (hex_value_func) Removed.
5331         (unexpected_eof) New function.
5332         (convert_numeric_string_to_char_string) New function.
5333         (parse_string) Rewritten, signature changed.
5334         (add_tokstr_char) Removed.
5335         (add_tokstr_unsigned) Removed.
5336         (add_tokstr_string) Removed.
5337         (parse_tagged_quote) Removed.
5338         (skip_comment) Renamed lex_skip_comment().
5339
5340         * lexer.h: All references updated.
5341         (macro is_id1) Renamed CHAR_IS_ID1.
5342         (macro is_idn) Renamed CHAR_IS_IDN.
5343         (token names ID, NUM, STRING, STOP, ... WITH, EXP) Renamed with
5344         prefix T_: T_ID, T_NUM, T_STRING, T_STOP, ... T_WITH, T_EXP.
5345         (macro get_token) Removed.
5346         (macro id_match) Removed.
5347         (macro force_match_id) Removed.
5348         (macro force_match) Removed.
5349         (macro force_string) Removed.
5350         (macro force_int) Removed.
5351         (macro force_num) Removed.
5352         (macro force_id) Removed.
5353
5354         * lexerP.h: Removed.
5355
5356         * list.q: Migrated to new q2c format.
5357         (write_line) Deal with struct len_string.
5358         (write_varname) Ditto.
5359         (write_fallback_headers) Ditto.
5360
5361         * magic.c: New file, incorporating the following global variables
5362         previously in other files: endian, second_lowest_value.  And both
5363         of those are conditional on #define's.
5364
5365         * magic.h: New file, incorporating the following global variable
5366         declarations: endian, second_lowest_value, and the following macro
5367         declarations: NOT_DOUBLE, NOT_LONG, NOT_INT.
5368
5369         * main.c: Added declarations of pgmname, finished, curdate,
5370         start_interactive.
5371         (main) Call new parse_script() function.
5372         (parse_script) New function.
5373         (execute_command) New function.
5374         (dump_token) Removed.
5375         (handle_error) New function.
5376
5377         * matrix.c: New file.
5378
5379         * matrix.h: New file.
5380
5381         * matrix-data.c: Migrated from arenas to pools.
5382         (mget_token) Change from parse_string_as_format() to data_in().
5383
5384         * means.q: Migrate to new q2c.
5385         (custom_tables) Renamed mns_custom_tables().
5386         (custom_crossbreak) Renamed mns_custom_crossbreak().
5387         (custom_variables) Renamed mns_custom_variables().
5388
5389         * mis-val.c: (static var width) Changed from `int' to `size_t'.
5390         (parse_varnames) Prototype.
5391         (parse_numeric) Rephrasings.
5392         (parse_alpha) Adapt to new struct string tokstr.
5393
5394         * misc.c: (intlog10) Rewritten.
5395         (spacing) Removed.
5396         (ansi_rand) Renamed real_rand(), moved into random.c.
5397         (ansi_srand) Renamed real_srand(), moved into random.c.
5398         (setup_randomize) Moved to random.c.
5399         (rand_uniform) Ditto.
5400         (rand_normal) Ditto.
5401         (rand_simple) Ditto.
5402         (get_config_line) Removed.
5403         (reverse) Removed (dead code).
5404
5405         * misc.h: (macro SET_BIT) Moved to bitvector.h.
5406         (macro CLEAR_BIT) Ditto.
5407         (macro TEST_BIT) Ditto.
5408         (macro SET_BIT_TO) Ditto.
5409         (macro BIT_INDEX) Ditto.
5410
5411         * output.c: (outp_read_devices) Move to err_push_file_locator()
5412         from push_cust().  Use struct string.
5413         (expand_op_tokstr) Removed.
5414         (static var op_tokstr) Changed to struct string.
5415         (static var op_tokstr_size) Removed.
5416         (tokener) Rephrasings.  Use struct string.
5417         (parse_options) Use struct string.
5418         (destroy_driver) Fix assertion.
5419         (outp_get_paper_size) Move to err_push_file_locator().
5420         [0] Removed dead code.
5421         (outp_string_width) Move to len_string.
5422
5423         * output.h: Comment fixes.
5424         (TAG_* enum series) Removed.
5425         (struct outp_value) Removed.
5426         (enum OUTP_T_FANCY) Removed.
5427         (struct outp_text) `s' changed from a_string to len_string.
5428         (struct outp_class) `option' change arg 3 from outp_value to
5429         struct string.
5430
5431         * pfm-read.c: (corrupt_msg) Rewritten.
5432
5433         * pfm-write.c: (bufwrite) Fix assertion.
5434
5435         * pool.c: New file, reference version.
5436
5437         * pool.h: New file, reference version.
5438
5439         * postscript.c: (ps_font_sizes) Fix assertion.
5440         (ps_option) Change arg 3 from outp_value to struct string.
5441         Adapt to struct string.
5442         (macro output_line) Removed.
5443         (macro add_string) Removed.
5444         (output_encodings) Adapted to struct string.  Moved to
5445         err_push_file_locator().
5446         (find_encoding_file) Fix assertion.
5447         (read_ps_encodings) Move to err_push_file_locator().
5448         (postopen) Use getl_location() instead of curfn.
5449         (out_text_plain) Move to len_string.
5450         (text) Ditto.  Remove rich text support.
5451
5452         * print.c: (cmd_print) Remove now-unneeded resource cleanup code.
5453         (cmd_print_eject) Ditto.
5454         (cmd_write) Ditto.
5455         (internal_cmd_print) Now cleans up after itself.  Uses
5456         fh_parse_file_handle() now.
5457         (cmd_print_space) Use PXP_NUMERIC to type-check.
5458
5459         * q2c.c: Overhauled.  Removed _("") i18n support.  All references
5460         updated.  All output functions updated to handle structures rather
5461         than local or static variables.  Adapt to new PSPP lex_*()
5462         functions.
5463         (macro _) Removed.
5464         (macro N_) Removed.
5465         (macro MAX_N_SBC) Removed.
5466         (global bare) Removed.
5467         (enum STRING) Renamed T_STRING.
5468         (enum ID) Renamed T_ID.
5469         (get_buffer) Buffer size increased.
5470         (strlower) Renamed st_lower(), rephrased.
5471         (strupper) Renamed st_upper(), rephrased.
5472         (skip_ws) New function.
5473         (get_line) Don't special-case any types of lines (like those
5474         beginning with ! or $, for instance).
5475         (get_token) Renamed lex_get().  Rephrased.
5476         (static var `prefix') New.
5477         (parse) New function.
5478         (parse_setting) Minor rephrasing.
5479         (dump_specifier_vars) Ditto.
5480         (make_identifier) Put null terminator on identifier, duh.
5481         (dump_vars) Renamed dump_declarations().  Never indent.  Never
5482         static.  Output changed entirely.
5483         (dump_specifier_init) Rephrase.
5484         (dump_vars_init) No index variable needed.  Other modifications.
5485         (dump_parser) Don't parse command name.  Do dump functions instead
5486         of just code fragments.
5487         (dump_free) Dump function instead of code fragment.
5488         (recognize_directive) New function.
5489         (main) Use recognize_directive().  Don't rely on magic $ line
5490         beginning: instead, parse comments.  Update list of headers.
5491
5492         * random.c: New file, containing the following functions:
5493         real_rand(), real_srand(), setup_randomize, shuffle, rand_uniform,
5494         rand_normal, rand_simple.
5495
5496         * random.h: New file.
5497
5498         * recode.c: (cmd_recode) Merge internal_cmd_recode() into this
5499         function.  `max_src_width', `max_dst_width' changed to size_t.
5500         (internal_cmd_recode) Removed.
5501         (parse_dest_spec) Merge similar cases.
5502         (parse_src_spec) Add assertion.
5503
5504         * repeat.c: (recognize_keyword) New function.
5505         (internal_cmd_do_repeat) Parse and handle PRINT keyword on END
5506         REPEAT.  Improve recognition of END REPEAT (use
5507         recognize_keyword()).  Move from curfn to getl_location().  Use
5508         struct string.
5509                 
5510         (perform_DO_REPEAT_substitutions) Adapt to struct string.
5511
5512         * set.q: Adapt to new q2c.
5513         (cmd_set) Range-check some values better.
5514         (custom_blanks) Renamed stc_custom_blanks().
5515         (custom_length) Renamed stc_custom_length().
5516         (custom_results) Renamed stc_custom_results().
5517         (custom_seed) Renamed stc_custom_seed().
5518         (custom_width) Renamed stc_custom_width().
5519         (custom_format) Renamed stc_custom_format().
5520         (custom_journal) Renamed stc_custom_journal().
5521         (custom_color) Renamed stc_custom_color().
5522         (custom_listing) Renamed stc_custom_listing().
5523         (custom_disk) Renamed stc_custom_disk().
5524         (custom_log) Renamed stc_custom_log().
5525         (custom_rcolor) Renamed stc_custom_rcolor().
5526         (custom_viewlength) Renamed stc_custom_viewlength().
5527         (custom_workdev) Renamed stc_custom_workdev().
5528
5529         * settings.h: Not necessary to include format.h any longer.
5530
5531         * sfm-read.h: (macro bswap_int32) Moved here from sfmP.h.
5532         (corrupt_msg) Rewritten.
5533
5534         * sort.c: Adapt to rewritten heap ADT.
5535
5536         * str.c: (aa_strcpy) Removed.
5537         (ab_strcpy) Removed.
5538         (ac_strcpy) Removed.
5539         (ba_strcpy) Removed.
5540         (bb_strcpy) Removed.
5541         (ca_strcpy) Removed.
5542         (aa_strdup) Removed.
5543         (aa_strdupcpy) Removed.
5544         (ba_strdup) Removed.
5545         (sa_strdup) Removed.
5546         (memrev) Renamed mm_reverse().
5547         (memrmem) Renamed mm_find_reverse().
5548         (cmp_str) Renamed st_compare_pad().
5549         (strmaxcpy) Removed.
5550         (strbarepadcpy) Renamed st_bare_pad_copy(), signature changed.
5551         (strbarepadlencpy) Renamed st_bare_pad_len_copy(), signature
5552         changed.
5553         (strpadcpy) Renamed st_pad_copy(), signature changed.
5554         (blpstrset) Removed.
5555         (ds_create) New function.
5556         (ds_init) New function.
5557         (ds_replace) New function.
5558         (ds_destroy) New function.
5559         (ds_clear) New function.
5560         (ds_extend) New function.
5561         (ds_shrink) New function.
5562         (ds_truncate) New function.
5563         (ds_length) New function.
5564         (ds_size) New function.
5565         (ds_value) New function.
5566         (ds_end) New function.
5567         (ds_concat) New function.
5568         (ds_concat_buffer) New function.
5569         (ds_printf) New function.
5570         (ds_putchar) New function.
5571         (ds_getline) New function.
5572         (ds_get_config_line) New function derived from the old
5573         misc.c:get_config_line().
5574         (ls_create) New function.
5575         (ls_create_buffer) New function.
5576         (ls_init) New function.
5577         (ls_shallow_copy) New function.
5578         (ls_destroy) New function.
5579         (ls_null) New function.
5580         (ls_null_p) New function.
5581         (ls_empty_p) New function.
5582         (ls_length) New function.
5583         (ls_value) New function.
5584         (ls_end) New function.
5585
5586         * str.h: Reformatted.
5587         (struct a_string) Removed.
5588         (struct b_string) Removed.
5589         (struct c_string) Removed.
5590         (struct len_string) New.
5591         (struct string) New.
5592         (macro as_streq) Removed.
5593         (macro bs_streq) Removed.
5594         (macro cs_streq) Removed.
5595         (macro sa_streq) Removed.
5596         (macro sb_streq) Removed.
5597         [__GNUC__] (inline function ds_putchar) New function.
5598         [__GNUC__] (inline function ds_length) New function.
5599         [__GNUC__] (inline function ds_value) New function.
5600         [__GNUC__] (inline function ds_end) New function.
5601
5602         * sysfile-info.c: (cmd_sysfile_info) Rephrased.
5603         (display_vectors) Fix missing i18n.
5604
5605         * t-test.q: Migrate to new q2c.
5606
5607         * tab.c: Migrate from arenas to pools.
5608         (tab_create) Use struct len_string.
5609         (tab_realloc) Ditto.
5610         (text_format) Ditto.
5611         (tab_joint_text) Ditto.
5612         (tab_natural_width) Remove rich text support.
5613         (tab_natural_height) Ditto.
5614         (tab_output_text) Handle TAT_FIX.
5615         (tab_raw) Change arg from a_string to len_string.
5616         (tabi_driver) Fix assertion.  Use struct len_string.
5617         (render_strip) Use struct len_string.  Remove rich text support.
5618         Add `const' qualifiers.
5619
5620         * tab.h: (enum TAB_RICH) Remove.
5621         (enums TAB_COL_NONE, TAB_COL_DONE) New.  Where appropriate,
5622         SOM_COL_* updated to read TAB_COL_*.
5623         (struct tab_table) Change arena to pool.  Change a_string to
5624         len_string.
5625
5626         * temporary.c: (restore_dictionary) Rewrite Checker code.
5627
5628         * var.h: (macros MAX_SHORT_STRING, MIN_LONG_STRING, SYSMIS,
5629         LOWEST, HIGHEST) Moved here from common.h.
5630         (typedef any_trns) Removed.  All references changed to `struct
5631         trns_header'.
5632
5633         * vars-atr.c: (force_create_variable) Fix assertion.
5634         (force_dup_variable) Fix assertion.
5635         
5636 Thu Jun  3 18:40:42 1999  Ben Pfaff  <blp@gnu.org>
5637
5638         Using alphanumeric variables in functions under AGGREGATE
5639         segfaulted.  Fixed.  Thanks to Dr. Dirk Melcher
5640         <BZN-mdksh@t-online.de> for reporting this bug.
5641         
5642         * aggregate.c: (parse_aggregate_functions) When setting the
5643         FSTRING bit, also allocate memory for the `string' member of
5644         agr_next.
5645         (free_aggregate_functions) Free iter->string.  Don't use the
5646         non-function bits when indexing the array of functions.
5647         [DEBUGGING] (debug_print) Don't use the non-function bits when
5648         indexing the array of functions.        
5649
5650 Sun May 30 00:00:54 1999  Ben Pfaff  <blp@gnu.org>
5651
5652         Under certain circumstances, the final case would be omitted from
5653         the results of an AGGREGATE operation.  Fixed.  Thanks to Dr. Dirk
5654         Melcher <BZN-mdksh@t-online.de> for reporting this bug.
5655         
5656         * aggregate.c (agr_00x_end_func): Increment number of cases in
5657         sink before writing case.  For streams that keep track of how many
5658         cases there are based on this value, this means that the last case
5659         will be read in on the next stream read.
5660
5661 Sat May 29 22:03:31 1999  Ben Pfaff  <blp@gnu.org>
5662
5663         Undefined behavior was invoked by referencing a freed pointer.
5664         
5665         * vfm.c (memory_stream_write): Free pointer *after* checking for
5666         non-null status.
5667
5668 Sat May 29 22:02:22 1999  Ben Pfaff  <blp@gnu.org>
5669
5670         A wrong record size was displayed when paging the active file to
5671         disk.
5672         
5673         * vfm.c: (memory_stream_write) Fix off-by-one error.
5674
5675 Sat May 29 21:50:26 1999  Ben Pfaff  <blp@gnu.org>
5676
5677         Not having enough temporary space for sorting caused a core dump.
5678         Fixed.
5679         
5680         * sort.c: (allocate_cases) Initialize i.
5681
5682 Sat May 29 21:40:54 1999  Ben Pfaff  <blp@gnu.org>
5683
5684         Syntax errors in function descriptions on AGGREGATE caused core
5685         dumps.  Fixed.
5686         
5687         * aggregate.c (cmd_aggregate): Don't free agr_dict after calling
5688         free_aggregate_functions(), since that function already frees
5689         agr_dict.
5690         
5691 Sat May 29 21:06:10 1999  Ben Pfaff  <blp@gnu.org>
5692
5693         A null pointer was dereferenced, causing a core dump, when
5694         PERCENTILES was specified on FREQUENCIES.  This fixes the problem,
5695         but PSPP still doesn't calculate percentiles.  Thanks to Regnor
5696         Jernsletten <rjernsle@eunet.no> for reporting this problem.
5697         
5698         * arena.c: (arena_malloc) If the arena hasn't been initialized
5699         already, initialize it.
5700
5701 Sat May 29 20:47:29 1999  Ben Pfaff  <blp@gnu.org>
5702
5703         * Makefile.cygwin: New file supplied by Hankin <hankin@dunno.com>
5704         for compilation with Cygnus Windows B20.  Not used by other
5705         systems.
5706
5707 Sat May 29 20:36:04 1999  Ben Pfaff  <blp@gnu.org>
5708
5709         SORT always sorted in ascending order.  Fixed.  Thanks to Dr. Dirk
5710         Melcher <BZN-mdksh@t-online.de> for reporting this bug.
5711
5712         * sort.c: (compare_case_lists) Reverse sense of comparison if
5713         sorting in descending order.
5714         (compare_record) Ditto.
5715
5716 Tue Mar  9 13:18:54 1999  Ben Pfaff  <blp@gnu.org>
5717
5718         SPLIT FILE with a string variable caused a core dump.  Fixed.
5719
5720         * vfm.c: If the variable is a string then make a temporary value
5721         struct pointing to it.  The underlying problem is a lot bigger
5722         than this (see TODO) but this is a stopgap for the simple case at
5723         least.
5724         
5725 Tue Mar  9 13:15:53 1999  Ben Pfaff  <blp@gnu.org>
5726
5727         Nested INCLUDEs didn't work.  Fixed.
5728
5729         * getline.c: (getl_include) Set first_line to NULL in allocated
5730         structure.
5731
5732 Tue Mar  9 13:13:46 1999  Ben Pfaff  <blp@gnu.org>
5733
5734         The MATCH FILES procedure set the values of variables not present
5735         to 0.  It should have been SYSMIS.  This is now fixed.
5736
5737         * get.c: (mtf_delete_file_in_place) Replace 0.0 by SYSMIS.
5738
5739 Tue Mar  9 12:52:23 1999  Ben Pfaff  <blp@gnu.org>
5740
5741         The REMARK command was too aggressive about skipping lines.  It
5742         didn't like being the last command in a file.
5743
5744         * command.c: (cmd_remark) Call get_entire_line() instead of
5745         get_line().
5746
5747 Tue Mar  9 12:48:05 1999  Ben Pfaff  <blp@gnu.org>
5748
5749         Comment parsing wasn't consistent with the rest of the code in its
5750         idea of where one command ends and another starts.  This meant
5751         that sometimes commands would be mysteriously ignored.  Thanks to
5752         Dr. Dirk Melcher <BZN-mdksh@t-online.de> for reporting this bug.
5753          
5754         * command.c: (parse_cmd) Hand off comment parsing to new function
5755         skip_comment() in lexer.c.
5756         * lexer.c: (skip_comment) New function.
5757
5758 Wed Jan 20 20:22:07 1999  Ben Pfaff  <blp@gnu.org>
5759
5760         The TABLE subcommand on MATCH FILES worked only erratically at
5761         best.  This fixes it.  Thanks to Dr. Dirk Melcher
5762         <BZN-mdksh@t-online.de> for reporting this bug.
5763
5764         * get.c: (mtf_compare_BY_values) When comparing string values, a
5765         difference of 1 is still a difference :-)
5766         (mtf_processing) Inverted TABLE reading logic fixed.  Also don't
5767         advance TABLE files automatically when matched.  Comment fixes.
5768
5769 Tue Jan 19 22:32:31 1999  Ben Pfaff  <blp@gnu.org>
5770
5771         VARIABLE LABELS rejected a slash before the first variable
5772         specification, contradicting the documentation.  Thanks to Walter
5773         M. Gray <graywm@northernc.on.ca> for reporting this bug.
5774
5775         * var-labs.c: (cmd_variable_labels) Ignore a leading slash in
5776         command specification.
5777
5778 Tue Jan 19 22:29:54 1999  Ben Pfaff  <blp@gnu.org>
5779
5780         Because of an incorrect optimization in memory allocation,
5781         CROSSTABS sometimes segfaulted when asked to output multiple
5782         tables.  Thanks to Walter M. Gray <graywm@northernc.on.ca> for
5783         reporting this bug.
5784
5785         * crosstabs.q: (postcalc) New variables maxcols, maxcells, which
5786         are passed to output_pivot_table() for its use.
5787         (output_pivot_table) Instead of assuming the number of columns is
5788         constant, keep track with maxcols.  In general mode, use maxcells
5789         to determine whether more matrix cells need to be allocated.    
5790
5791 Tue Jan 19 22:27:46 1999  Ben Pfaff  <blp@gnu.org>
5792
5793         CROSSTABS didn't display value labels for column and row
5794         variables.  Thanks to Walter M. Gray <graywm@northernc.on.ca> for
5795         reporting this bug.
5796
5797         * crosstabs.q: (table_value_missing) If the specified value has a
5798         value label for this variable, then show it instead of the raw
5799         value.
5800         (display_dimensions) Delegate display of value_labels to
5801         table_value_missing.
5802
5803 Mon Jan 18 20:04:06 1999  Ben Pfaff  <blp@gnu.org>
5804
5805         WRITE didn't write line ends.  Fixed.  Thanks to Dr. Dirk Melcher
5806         <BZN-mdksh@t-online.de> for reporting this bug.
5807
5808         * print.c: (print_trns_proc) Write (CR/)LF if PRINT is used _or_
5809         if the file isn't declared as binary.
5810
5811 Mon Jan 18 19:56:45 1999  Ben Pfaff  <blp@gnu.org>
5812
5813         MATCH FILES corrupted memory and dumped core on some syntax
5814         errors.  Fixed.
5815
5816         * get.c: (cmd_match_files) Set file->handle to NULL before
5817         jumping to lossage.
5818         (mtf_free_file) Don't free a null dictionary.   
5819
5820 Mon Jan 18 19:27:57 1999  Ben Pfaff  <blp@gnu.org>
5821
5822         MATCH FILES should set numeric values not available to the
5823         system-missing value, not to 0.  Thanks to Dr. Dirk Melcher
5824         <BZN-mdksh@t-online.de> for reporting this bug.
5825
5826         * get.c: (mtf_processing) Set unused records to system-missing,
5827         not 0.
5828
5829 Mon Jan 18 15:06:46 1999  Ben Pfaff  <blp@gnu.org>
5830
5831         KEEP didn't work properly on the SAVE procedure.  Fixed.  Thanks
5832         to Ralf Geschke <ralf@kuerbis.org> for reporting this bug.
5833
5834         * temporary.c: (save_dictionary) Initialize var_by_name AVL tree
5835         in newly created dictionary, and add each copied variable to the
5836         tree.
5837  
5838 Mon Jan 18 15:04:48 1999  Ben Pfaff  <blp@gnu.org>
5839
5840         Memory leak fix.
5841         
5842         * get.c: (trim_dictionary) Free variable list for KEEP after
5843         finishing with it.
5844
5845 Mon Jan 18 12:57:36 1999  Ben Pfaff  <blp@gnu.org>
5846
5847         Some systems didn't like the way open_file was coded.  Thanks to
5848         Hankin <hankin@rogue.consultco.com> for pointing this out.
5849
5850         * filename.c: (open_file) Don't try to store stdin, stdout,
5851         stderr as part of an array, because that doesn't always work.
5852
5853 Mon Jan 18 12:53:27 1999  Ben Pfaff  <blp@gnu.org>
5854
5855         The SAVE procedure didn't save long string variables properly.
5856         Fixed by this patch.  Thanks to Hankin
5857         <hankin@rogue.consultco.com> for this patch.
5858         
5859         * sfm-write.c: (write_variable) Fix off-by-one error in writing
5860         out variable pad records.
5861
5862 Tue Jan  5 14:29:27 1999  Ben Pfaff  <blp@gnu.org>
5863
5864         Previously, if PRINT SPACE were given a negative argument, it
5865         would report an error, then spin in an (almost) infinite loop.
5866         This fixes that behavior.
5867
5868         * print.c: (print_space_trns_proc) After reporting a negative
5869         argument, set number of lines to print to 1.
5870
5871 Tue Jan  5 13:59:55 1999  Ben Pfaff  <blp@gnu.org>
5872
5873         SPSS 8.0 outputs some new record types in its system files, and it
5874         allows longer value labels.  Accept these system files.
5875
5876         * sfm-read.c: (sfm_read_dictionary) Ignore record type 7 subtype
5877         11 emitted by SPSS 8.0.
5878         
5879 Tue Jan  5 13:55:50 1999  Ben Pfaff  <blp@gnu.org>
5880
5881         The LIST procedure was too conservative in allocating space for
5882         buffers, which caused a bug that only showed up with very long
5883         output variables.  Thanks to Hankin <hankin@dunno.com> for this
5884         bug report.
5885
5886         * list.q: (determine_layout) Allocate 1022 bytes instead of 256.
5887
5888 Tue Jan  5 13:34:34 1999  Ben Pfaff  <blp@gnu.org>
5889
5890         Typo meant string format specifiers weren't checked properly.  I
5891         think that Hankin <hankin@dunno.com> sent me this report, but I'm
5892         willing to be corrected on this point.
5893  
5894         * format.c: (check_string_specifier) Fix obvious typo.  
5895
5896 Tue Jan  5 12:50:42 1999  Ben Pfaff  <blp@gnu.org>
5897
5898         Using $CASENUM in an expression didn't work.  Here's a fix.
5899         Thanks to Dirk Melcher <BZN-mdksh@t-online.de> for reporting this
5900         bug.
5901          
5902         * expr-evl.c: (evaluate_expression) Add OP_CASENUM case.
5903
5904         * expr-opt.c: (dump_node) OP_CASENUM is acceptable.
5905
5906 Tue Jan  5 12:47:48 1999  Ben Pfaff  <blp@gnu.org>
5907
5908         The changes in 0.2.1 to fix DATA LIST FREE parsing broke some
5909         other behavior, *sigh*.  This patch hopefully fixes that.  This
5910         time I've actually tested it.
5911
5912         Thanks to Hankin <hankin@dunno.com> for reporting this bug.
5913
5914         * data-list.c: (read_from_data_list_free,
5915         read_from_data_list_list) Call parse_string_as_format() directly
5916         without mucking around with the field width.
5917
5918 Tue Jan  5 12:31:19 1999  Ben Pfaff  <blp@gnu.org>
5919
5920         Occasionally, you may encounter a script that wants to be
5921         interpreted in interactive mode.  Make -i emulate this behavior to
5922         allow such scripts to be executed with PSPP.
5923
5924         Thanks to Hankin <hankin@dunno.com> for reporting this behavior.
5925
5926         * cmdline.c: (pre_syntax_message[]) Update -i description.
5927
5928         * lexer.c: (preprocess_line) When getl_interactive is 2 (i.e.,
5929         when -i is given on the command line) don't treat unindented lines
5930         as starting a new command.
5931
5932 Tue Jan  5 12:30:10 1999  Ben Pfaff  <blp@gnu.org>
5933
5934         In conjunction with egcs 1.1.1, Checker emits some bogus warnings,
5935         mostly caused by local initialized aggregates.  After egcs is
5936         fixed upstream these can be removed, but for now they're not a big
5937         deal.
5938         
5939         * ascii.c: (ascii_postopen_driver) Checker chokes on local
5940         initialized arrays.  Avoid this.
5941
5942         * sfm-write.c: (sfm_write_dictionary) Don't use a local
5943         initialized struct.
5944
5945 Tue Jan  5 12:07:24 1999  Ben Pfaff  <blp@gnu.org>
5946
5947         egcs 1.1.1 has some new warnings relative to gcc 2.8.1, which the
5948         following changes avoid.  Currently I compile sources with egcs
5949         1.1.1 and gcc 2.7.2.3 before sending them out.
5950
5951         * apply-dict.c: (apply_dict) Use new avl_traverser_init() macro.
5952         
5953         * ascii.c: (option_tab[]) Initialize all struct members.
5954
5955         * avl.h: (avl_traverser_init) New macro.
5956         
5957         * command.c: (DEFCMD, UNIMPL macros, cmd_table[]) Initialize all
5958         struct members.
5959
5960         * crosstabs.q: (enum_var_values) Use new hsh_iterator_init()
5961         macro.
5962
5963         * hash.c: Comment fix.
5964
5965         * hash.h: (hsh_iterator_init) New macro.
5966
5967         * html.c: (option_tab[]) Initialize all struct members.
5968
5969         * pfm-write.c: (write_value_labels) Use new avl_traverser_init()
5970         macro.
5971
5972         * postscript.c: (option_tab[]) Initialize all struct members.
5973         (output_encodings, preclose, dump_lines) Use new
5974         hsh_iterator_init() macro.
5975
5976         * sfm-write.c: (write_value_labels) Use new avl_traverser_init()
5977         macro.
5978
5979         * sysfile-info.c: (describe_variable) Use new avl_traverser_init()
5980         macro.
5981
5982 Thu Nov 19 12:32:45 1998  Ben Pfaff  <blp@gnu.org>
5983
5984         * data-in.c: Examined each of the parsing functions to make sure
5985         that they wouldn't dump core if they were passed a string of the
5986         wrong length, since now the DATA LIST FREE/LIST routines don't
5987         check for field width before passing it to the data parser.
5988         (parse_RBHEX, parse_AHEX) Reject odd length input.
5989         (parse_string_as_format) Reject input that's too short or too
5990         long.
5991
5992         * data-list.c: Before, the DATA LIST FREE/LIST routines would pad
5993         a field to its entire declared output width then pass it to the
5994         data-in parsing routines.  This contradicted the documented
5995         behavior.  This is fixed in these changes.  Thanks to Mark H. Wood
5996         <mwood@IUPUI.Edu>.  In addition, this fixes a few more details of
5997         free-format parsing that differed from SPSS.
5998         (cut_field) Commas and spaces are treated identically.  Returns
5999         the proper column instead of a fixed 1 value.
6000         (parse_field) Removed.
6001         (read_from_data_list_free, read_from_data_list_list) Call
6002         parse_string_as_format directly instead of parse_field.
6003
6004         * heap.c: (heap_delete) Stylistic fixes.
6005
6006 Sun Aug  9 11:12:13 1998  Ben Pfaff  <blp@gnu.org>
6007
6008         * loop.c: (loop_2_trns_proc) Formatting fix.
6009
6010         * sel-if.c: (cmd_filter) Set FILTER_before_TEMPORARY.
6011
6012         * var.h: (glob var FILTER_before_TEMPORARY) New global var.
6013
6014         * vfm.c: (macro FILTERED) New.
6015         (static var filter_var) New.
6016         (process_active_file_write_case) Use FILTERED.
6017         (setup_filter) Set filter_var.
6018         (close_active_file) Delete the filter if not
6019         FILTER_before_TEMPORARY.
6020         (procedure_write_case) Use FILTERED.
6021
6022 Sat Aug  8 00:20:14 1998  Ben Pfaff  <blp@gnu.org>
6023
6024         * crosstabs.q: Changed /PIVOT={ON,OFF} to /FORMAT={PIVOT,NOPIVOT}.
6025
6026         * data-in.c: (parse_day_count) Message fix.
6027         (parse_month) Style fix.
6028
6029         * data-list.c: (struct data_list_pgm) New member eof.
6030         (cmd_data_list) Init eof to 0.
6031         (do_reading) Implement the /END subcommand and read-past-eof
6032         checking.
6033
6034         * do-if.c: Include stdio.h when debugging.
6035         (cmd_else_if) Make sure the command is .-terminated.
6036
6037         * glob.c: (init_glob) Capitalize the command prompt.
6038
6039         * inpt-pgm.c: (end_case_trns_proc) Debugging message.
6040         (end_file_trns_proc) Debugging message.
6041
6042         * loop.c: (internal_cmd_loop) Make it work when there's no loop
6043         index!
6044         (loop_2_trns_proc) Enable MXLOOPS (why was this disabled?)
6045
6046         * main.c: (dump_token) Make kwtab[] const.
6047
6048         * set.q: Spelling, comment fixes.
6049
6050         * sysfile-info.c: (cmd_display) DISPLAY VECTORS not DISPLAY
6051         VECTOR.
6052
6053         * vars-prs.c: (fill_all_vars) Style fix.
6054
6055         * vfm.c: (index_to_varname) Return const.
6056
6057 Tue Aug  4 23:49:23 1998  Ben Pfaff  <blp@gnu.org>
6058
6059         * Changes in many source files for partial -ansi -pedantic and
6060         no-debugging compliance: Remove trailing common in enum
6061         declarations; add `unused' attributes; insert some appropriate
6062         casts.
6063
6064         * cmdline.c: (parse_command_line) Add new --testing-mode flag.
6065
6066         * command.c: (shell) Make static.
6067         (run_command) Make static.
6068
6069         * data-list.c: (dump_fixed_table) Remove use of local_strdup().
6070
6071         * dfm.c: (cmd_begin_data) I18n fix.
6072
6073         * error.c: (verbose_msg) Define if __STRICT_ANSI__.
6074
6075         * error.h: (macro verbose_msg) Define if __STRICT_ANSI__.
6076
6077         * expr-opt.c: (evaluate_tree) Don't initialize local arrays if
6078         __STRICT_ANSI__.
6079
6080         * file-handle.q: Don't prepend the source file directory name to
6081         the data file name.  (Ongoing issue.)
6082         (prepend_current_directory) Comment out.
6083         (internal_cmd_file_handle) Don't call prepend_current_directory().
6084         (fh_get_handle_by_filename) Ditto.
6085
6086         * filename.c: Append zero byte to readlink() return value.
6087
6088         * getline.c: (getl_read_line) I18n fix.
6089
6090         * lexer.h: Don't use gcc features if __STRICT_ANSI__.
6091
6092         * misc.h: Don't use gcc features if __STRICT_ANSI__.
6093
6094         * pfm-write.c: (bufwrite) Don't try to increment a void * pointer
6095         directly.
6096
6097         * postscript.c: (output_encodings) Don't use local_strdup().
6098         (postopen) Ditto.
6099
6100         * print.c: Don't use gcc features if __STRICT_ANSI__.
6101
6102         * q2c.c: (dump_vars) Don't put a , at the end of the last enum.
6103
6104         * recode.c: (parse_src_spec) Fully brace nested if's.
6105
6106         * set.q: (global var set_testing_mode) New var.
6107
6108 Wed Jul 29 22:01:44 1998  Ben Pfaff  <blp@gnu.org>
6109
6110         * ascii.c: Add some more `unused' attributes that only come into
6111         play when NDEBUG is defined.
6112         (ascii_close_page) Set s_len when reallocating s.
6113         
6114         * crosstabs.q: (delete_missing) New function.
6115         (output_pivot_table) Call delete_missing() if /MISSING=REPORT.
6116         (make_summary_table) Create summary table reallocable.
6117
6118         * postscript.c: Add more `unused' attributes as above.
6119
6120         * tab.c: (tab_create) [GLOBAL_DEBUGGING] Set reallocable member.
6121         (tab_realloc) [GLOBAL_DEBUGGING] Assert that table is reallocable.
6122          
6123         * tab.h: (struct tab_table) [GLOBAL_DEBUGGING] New `reallocable'
6124         member.
6125
6126         * var.h: (macro force_dup_variable) [!GLOBAL_DEBUGGING] Remove
6127         gratuitous space between parameter definition.
6128
6129         * vars-atr.c: Changed some assert(0)'s to abort()'s to prevent
6130         complaints about running off the end of functions with NDEBUG
6131         enabled.
6132
6133 Sun Jul  5 00:17:25 1998  Ben Pfaff  <blp@gnu.org>
6134
6135         * Several source files: Removed some PORTME notes when reflection
6136         revealed that ANSI forbids that sort of breakage.  Also, added
6137         lots of `unused' qualifiers here and there.
6138
6139         * aggregate.c: (accumulate_aggregate_info) Remove local var
6140         weighting that turned out not to be used.
6141
6142         * avl.c: Update to version 1.1.0.  Add unused specifier.
6143         (avl_destroy) Initialize ab to 0.  Comment fixes.  Cast return
6144         value to void *.
6145         (avl_probe) Replace some instances of 1 with +1 where appropriate.
6146         (avl_find) Cast return value to void *.
6147         (avl_delete) q doesn't need to be initialized at the beginning of
6148         the function.  Replace some instances of 1 with +1.
6149         (force_avl_delete) Renamed avl_force_delete, all references changed.
6150         (compare_ints) `param' marked unused.
6151         (print_int) `param' marked unused.
6152         (recurse_tree) Replace some instances of 1 with +1.
6153
6154         * avl.h: Update to version 1.1.0.  Only declares avl function
6155         types if not already declared.
6156         (AVL_MAX_HEIGHT) Only define if not already defined.
6157         (struct avl_node) New unused member char pad[2].
6158         [GLOBAL_DEBUGGING] Change conditionalization to NDEBUG instead.
6159         (force_avl_insert) Renamed avl_force_insert.
6160         (force_avl_delete) Renamed avl_force_delete.
6161
6162         * crosstabs.q: (struct table_entry) Put `freq' into a union with
6163         new member `data'.
6164         (struct crosstab) Add new member `ofs'.
6165         (glob var int_tab) Removed.
6166         (custom_tables) In integer mode, assign v[i] properly through the
6167         indirect var_dict.
6168         (custom_variables) Now p.crs.max == max + 1.
6169         [DEBUGGING] (debug_print) p.crs.min and p.crs.max are now ints.
6170         (precalc) Implement integer mode.
6171         (calc_integer) Implement integer mode.
6172         (compare_table_entry) Remove unused local variable `comparing'.
6173         (make_summary_table) Implement integer mode.
6174         (macro ns_rows) Implemented as static variable now.
6175         (several variables) Made static, from global.
6176         (output_pivot_table) Use table_value_missing() for column heads.
6177         Remove several unused local variables.  Implement integer mode
6178         table summing.  Count up ns_rows.
6179         (crosstabs_dim) Make columns wider when /MISSING=REPORT requested.
6180         (find_pivot_extent) Moved into find_pivot_extent_general; now just
6181         calls that function or find_pivot_extent_integer.
6182         (find_pivot_extent_integer) New function.
6183         (enum_var_values) Implemented for integer mode.
6184         (table_value_missing) New function.
6185         (display_dimensions) Call table_value_missing() for heads.
6186         (float_M_suffix) New function.
6187         (display_crosstabulation) Call table_value_missing() for row
6188         heads.  Handle missing values in /MISSING=REPORT mode.
6189         (calc_fisher) Remove unused var N.
6190         (calc_r) Remove unused var fact.
6191
6192         * data-list.c: (dump_fixed_table) Fix table dimensioning.
6193         (read_one_set_of_repetitions) Remove unused vars var_spec, column.
6194
6195         * data-out.c: (insert_commas) Remove unused var cp.
6196         (convert_CCx) Remove unused vars save_set_decimal,
6197         save_set_grouping.
6198
6199         * descript.q: (dump_z_table) Fix table dimensioning.
6200         (pre_calc) Remove unused var j.
6201         (display) Remove unused vars title, s.  Fix table dimensioning.
6202
6203         * expr-evl.c: Comment fixes.
6204
6205         * frequencies.q: (full_dim) New function.
6206         (dump_full) Fix table dimensioning.
6207         (condensed_dim) New function.
6208         (dump_condensed) Fix table dimensioning.
6209
6210         * get.c: (cmd_match_files) Remove unused var n_val.  Remove unused
6211         label winnage.
6212
6213         * html.c: (html_close_drive) Remove unused var i.
6214         (postopen) Remove unused vars title, curfn_len, cp.
6215         (preclose) Remove unused vars this, x.
6216
6217         * lexer.c: Comment fixes.
6218
6219         * matrix-data.c: (cmd_matrix_data) Remove unused var index.
6220
6221         * means.q: (custom_tables) Remove unused var m_dim.
6222
6223         * mis-val.c: Format fix.
6224
6225         * modify-vars.c: (cmd_modify_vars) Remove unused var new_dict.
6226
6227         * output.c: (outp_get_paper_size) Remove unused var cp.
6228
6229         * pfm-read.c: (read_float) Remove unused var save, unused label
6230         underflow.
6231         (read_variables) Remove unused vars cp, j.
6232         (read_value_label) Remove unused var j.
6233
6234         * pfm-write.c: (bufwrite) Remove unused var i.
6235
6236         * postscript.c: (ps_postopen_drive) Remove unused vars dev_info,
6237         fn.
6238         (output_encodings) Remove unused vars char_cp, n_output.
6239         (read_ps_encodings) Remove unused var ep.
6240         (postopen) Remove unused var title.
6241         (preclose) Remove unused var fp.
6242         (ps_open_page) Remove unused vars true, false, orientation,
6243         mirror_horz, mirror_vert, width, length.
6244         (ps_text_metrics) Remove unused var x.
6245
6246         * q2c.c: (find_symbol) Remove unused var y.
6247         (parse_setting) Remove unused parameter sbc, all references
6248         changed.
6249         (dump_parser) Remove unused var cp.
6250         (dump_free) Remove unused var i.
6251
6252         * set.q: (static vars args, n) Removed.
6253         (internal_cmd_gset) Removed.
6254
6255         * sfm-read.c: (sfm_read_dictionary) Removed unused var i.
6256         (read_machine_flt64_info) Removed unused var file_endian.
6257         (read_documents) Removed unused var i.
6258         (read_compressed_data) Removed unused parameter dict, all
6259         references changed.
6260
6261         * sfm-write.c: (bufwrite) Removed unused var i.
6262         (sfm_write_case) Removed unused var i.
6263
6264         * sort.c: (merge_once) Remove unused var t.
6265         (write_separate) #if 0 out as dead code.
6266
6267         * split-file.c: (cmd_split_file) Remove unused var i.
6268
6269         * sysfile-info.c: (sysfile_info_dim) New function.
6270         (cmd_sysfile_info) Fix table dimensioning.
6271         (variables_dim) New function.
6272         (display_variables) Fix table dimensioning.
6273         (describe_variable) Remove unused var prev_r.
6274
6275         * t-test.q: (z_postcalc) Removed.
6276         (pairs_calc) Remove unused var bad_weight.
6277         (postcalc) Remove unused vars dfn, dfd.
6278
6279         * tab.c: (tab_create) Set t->dim to NULL.
6280         (tab_dim) Make sure t->dim is NULL first.
6281         (tab_natural_width) Remove parameter `clamp'.
6282         (tab_value) Remove duplicate assertion for table.
6283         (tab_raw) New function.
6284         (nowrap_dim) New function.
6285         (wrap_dim) New function.
6286         (tab_output_text) Fix table dimensioning.
6287
6288         * tab.h: (tab_raw) New macro.
6289
6290         * val-labs.c: (get_label) Remove unused var type.
6291         (copy_value_labels) Remove unused var trav.
6292
6293         * var.h: (struct crosstab_proc) Completely changed.
6294
6295         * vars-prs.c: (parse_dict_variable) Remove unused var v.
6296
6297         * vfm.c: (open_active_file) Remove unused vars i, lp.
6298
6299         * weight.c: (weight_trns_proc) #if 0 out as dead code.
6300         
6301 Tue Jun  2 23:37:21 1998  Ben Pfaff  <blp@gnu.org>
6302
6303         * Makefile.am: Add apply-dict.c, flip.c.
6304
6305         * apply-dict.c: New file.
6306         
6307         * command.c: (struct command) Make cmd[] larger for CLEAR
6308         TRANSFORMATIONS command name.
6309         (parse_cmd) Make sure we're in a valid state before using it as an
6310         index.  Discard variables and reset state on invalid transitions.
6311         (cmd_clear_transformations) New function.
6312
6313         * command.def: Add APPLY DICTIONARY, CLEAR TRANSFORMATIONS, FLIP.
6314         Add unimplemented PRESERVE, RESTORE.
6315
6316         * file-handle.h: Include stddef.h.
6317
6318         * flip.c: New file.
6319         
6320         * pfm-read.c: (parse_value) Pad value label values with spaces,
6321         not nulls.
6322
6323         * sfm-read.c: (struct sfm_fhuser_ext) Add reference count.
6324         (sfm_close) Decrement reference count, make sure it's zero.
6325         (sfm_maybe_close) New function.
6326         (sfm_read_dictionary) Handle reference counts.
6327
6328         * vars-atr.c: (clear_default_dict) New function.
6329         (discard_variables) Use clear_default_dict().
6330
6331 Sun May 31 00:58:05 1998  Ben Pfaff  <blp@gnu.org>
6332
6333         * Makefile.am: Add pfm-write.c.
6334         (LDADD) Add the libgmp2 libraries.
6335
6336         * command.def: Define EXPORT.
6337
6338         * get.c: (cmd_export) New function.
6339         (export_write_case_func) New function.
6340
6341         * pfm-read.c: (static spss2ascii[]) Make it const.
6342
6343         * pfm-write.c: New file.
6344
6345         * sfm-write.c: Formatting, comment fixes.
6346
6347         * var.h: Comment fix.
6348
6349 Fri May 29 21:44:12 1998  Ben Pfaff  <blp@gnu.org>
6350
6351         * Makefile.am: Add pfm.h, pfm-read.c.
6352
6353         * command.def: IMPORT is now implemented.
6354
6355         * format.c: (glob var translate_fmt[]) New var.
6356
6357         * get.c: (enum GTSV_NONE) Renamed GTSV_OPT_NONE.
6358         (cmd_import) New function.
6359         (import_source_read) New function.
6360         (glob var import_source) New var.
6361
6362         * pfm-read.c: New file.
6363
6364         * pfm.h: New file.
6365         
6366         * sfm-read.c: (parse_format_spec) Local variable translate_fmt[]
6367         moved in format.c.
6368         (dump_dictionary) Disabled printing a couple of items.
6369
6370 Mon May 25 12:42:37 1998  Ben Pfaff  <blp@gnu.org>
6371
6372         * crosstabs.q: (postcalc) Call make_summary_table().
6373         (make_summary_table) New function.
6374         (insert_summary) New function.
6375         (display_dimensions) Remove some unnecessary arguments, all
6376         references changed.
6377         (output_pivot_table) Fix lots of problems with the risk table
6378         setup.
6379         (submit) Don't display an empty table.
6380         (display_risk) Fix order of arguments to calc_risk().
6381
6382         * glob.c: Always include assert.h and stdlib.h.
6383
6384         * output.h: (enum OUTP_T_JUST_FULL) Removed, all references
6385         removed.
6386
6387         * tab.c: (tab_create) Cosmetic changes.
6388
6389         * tab.h: (enum TAB_JUSTIFY) Removed, all references removed.
6390
6391 Sun May 24 22:39:23 1998  Ben Pfaff  <blp@gnu.org>
6392
6393         * tab.def: Removed.
6394
6395         * crosstabs.q: (output_pivot_table) Headers drawing and submission
6396         code simplified, moved into new function submit().
6397         (submit) New function.
6398         (crosstabs_dim) New function.
6399         (display_directional) Substitute variable names for %s where
6400         appropriate.
6401         (somers_d_v[], somers_d_ase[], somers_d_t[]) New static vars.
6402         (calc_symmetric) Initialize parameters only if non-NULL.
6403         Calculate Somers' d.
6404         (calc_directional) Calculate Somers' d (or copy it, really).
6405         Calculate eta.
6406
6407         * output.c: (outp_string_width) New function.
6408
6409         * postscript.c: (postopen) Calculate font widths based on the
6410         width of the zero '0' character, not the width of the space
6411         character.  Set paper-width and paper-length based on points, not
6412         device units.
6413         (ps_open_page) Fix page setup string for landscape mode.
6414
6415         * som.h: (struct som_dimension) Removed.
6416         (struct som_table_class) height, width members take int * not
6417         som_dimesion * now.
6418
6419         * tab.c: Many functions now have added parameter validation.
6420         (tab_height, tab_width) These functions were removed and merged
6421         into a single function tab_resize(), and all references changed.
6422         (tab_dim) Rewritten since the interface changed; reduced from
6423         hundreds of lines to two.  All callers were changed.  Currently
6424         most of them just use tab_natural_dimensions as their callback and
6425         await detailed translation of functionality.
6426         (tab_natural_width) New function.
6427         (tab_natural_height) New function.
6428         (tab_natural_dimensions) New function.  This is a callback
6429         function, not something that you'd want to call directly.
6430         (tab_nat_dim) Removed.
6431         (tabi_table) Allocates t->w and t->h.
6432         (tabi_driver) Inlined sum_columns()'s functionality.  Calls the
6433         dimensions callback.
6434         (evaluate_dimensions) Removed.
6435         (sum_columns) Removed.
6436
6437         * tab.h: (enum TAL_1THIN) Removed.
6438         (enum series t_*) Removed.
6439         (struct tab_table) Members trh, trv changed to unsigned char *
6440         from int *.  Member dim changed to a function pointer from a
6441         unsigned char *.  Member max_stack_height removed.  New members
6442         hr_tot, vr_tot.
6443         (macros tab_l, tab_r, tab_t, tab_b) New.
6444
6445 Sat May 23 23:22:13 1998  Ben Pfaff  <blp@gnu.org>
6446
6447         * ascii.c: (delineate) Assign last_space_nchars before skipping
6448         spaces, to fix right justification.
6449
6450         * crosstabs.q: (static vars risk, direct) New vars.
6451         (static var pearson_r) Removed.
6452         (glob var chisq_fisher) Made static.
6453         (static vars row_tot[], col_tot[]) Don't include grand total
6454         anymore.
6455         (static var grand_total) Renamed W, all references changed.
6456         (output_pivot_table) Only make `table' if num_cells != 0.  Make
6457         risk and directional tables.  Deal with grand total no longer part
6458         of col_tot[].  Free rows and cols after we're done with them.
6459         (display_risk) New function.
6460         (display_directional) New function.
6461         (clac_r) Rewritten so that it stores all its results into its
6462         arguments, so it can be used for Spearman's correlation too.
6463         (calc_symmetric) Added a t[] argument, all references changed.
6464         Calculates ASEs for tau-b, tau-c, gamma.  Calculates Spearman's r,
6465         Pearson's r, Cohen's kappa.
6466         (calc_risk) New function.
6467         (calc_directional) New function.
6468
6469         * som.c: (som_submit) Improved debugging code.
6470
6471         * stats.c: (hypercube) New function.
6472         (cube) New function.
6473         (sqr) New function.
6474         (normal_sig) Went back to old implementation, which actually
6475         worked.
6476
6477         * stats.h: (macros square, cube, hypercube) Removed.  The
6478         equivalent functions in stats.c are inlined here; all references
6479         to square changed to sqr.
6480
6481 Fri May 22 00:03:41 1998  Ben Pfaff  <blp@gnu.org>
6482
6483         * crosstabs.q: (N_SYMMETRIC) New define.
6484         (postcalc) Disable debug printing.
6485         (static vars chisq_fisher, pearson_r) New.
6486         (output_pivot_table) Add support for symmetric measures.  Add
6487         chi-square output of exact sigs.
6488         (display_chisq) Rewritten.
6489         (display_symmetric) New function.
6490         (gamma_int) New function.
6491         (Pr) New function.
6492         (swap) New function.
6493         (calc_fisher) New function.
6494         (calc_chisq) Check boundary conditions better. Calculate Yates,
6495         Fisher, Mantel-Haenszel tests.
6496         (calc_r) New function.
6497         (calc_symmetric) New function.
6498
6499         * stats.c: (normal_sig) Rewritten with new algorithm.  Renamed
6500         from calc_normal.
6501         (chisq_sig) Better boundary conditions.  Renamed from
6502         calc_significance.
6503
6504         * tab.h: (struct tab_table) New member cf.
6505
6506         * tab.c: (tab_create) Set cf.
6507         (tab_width) New function.
6508         (tab_realloc) Handle cf.
6509         (tab_vline) Handle cf.
6510         (tab_hline) Handle cf.
6511         (tab_box) Handle cf.
6512         (tab_value) Handle cf.
6513         (tab_float) Handle cf.
6514         (tab_text) Handle cf.
6515         (tab_joint_text) Handle cf.
6516         (tab_offset) Handle cf.
6517         (tab_next_row) Handle cf.
6518         (evaluate_dimensions) Handle cf.
6519         (render_strip) Handle cf.
6520
6521 Wed May 20 00:03:59 1998  Ben Pfaff  <blp@gnu.org>
6522
6523         * crosstabs.q: (postcalc) New vars row_tot, col_tot, pass them to
6524         output_pivot_table().
6525         (output_pivot_table) Moved lots of local variables outside and
6526         made them static.  Add beginnings of chi-square statistic
6527         support.  Now column and row totals aren't in the main matrix.
6528         Always zero out any leftover rows & columns after we're done with
6529         the table entries.  Move all output stuff into
6530         display_dimensions(), display_crosstabs(), display_chisq().
6531         (display_dimensions) New function.
6532         (display_crosstabulation) New function.
6533         (display_chisq) New function.
6534         (calc_chisq) Implemented Pearson and likelihood-ratio chisquares.
6535
6536         * frequencies.q: (dump_full, dump_condensed) Remove tab_null()
6537         references, simplify logic.
6538
6539         * postscript.c: Remove scale, translate-x, translate-y,
6540         mirror-horz, mirror-vert, rotate-180 options.
6541         (struct ps_driver_ext) Remove scale, translate_x, translate_y.
6542         All references deleted.
6543         (macro YT) New macro.
6544         (array option_tab[]) Removed options.
6545         (ps_option) Removed options.
6546         (ps_open_page) Write page setup explicitly to output file, without
6547         using now-deleted BP function.
6548         (macro dump_line) Use YT().
6549         (macro dump_thick_line) Use YT().
6550         (draw_headers) Use YT().
6551         (switch_font) Reorder arguments to SF function.
6552         (write_text) Use YT().
6553
6554         * sfm-read.c: (sfm_read_case) Don't attempt to read variables that
6555         have get.fv == -1.
6556
6557         * sysfile-info.c: (describe_variables) Don't use tab_nulls().
6558
6559         * tab.c: (tab_create) Initialize t->ct to zeros.  Remove
6560         null-debugging code.
6561         (tab_realloc) Remove null-debugging code.  Initialize new regions
6562         of t->ct to zeros.
6563         (tab_vline) Support offsets.
6564         (tab_hline) Support offsets.
6565         (tab_box) Support offsets.
6566         (tab_null) Removed.
6567         (tab_nulls) Removed.
6568         (tab_row) Removed.
6569         (tab_col) Removed.
6570         (evaluate_dimensions) Remove null-debugging code.  Understand
6571         TAB_EMPTY attribute.  Assert that text.s.s is always non-NULL if
6572         TAB_EMPTY not present.
6573
6574         * tab.h: New cell attribute TAB_EMPTY.
6575         (macros tab_nr, tab_nc, tab_row, tab_col) New.
6576
6577         * vars-atr.c: (init_variable) Set get.fv to -1 so that GET doesn't
6578         try to read them from system files.
6579
6580         * vfm.c: (dump_splits) Don't call tab_null().   
6581
6582 Sat May 16 19:36:55 1998  Ben Pfaff  <blp@gnu.org>
6583
6584         * crosstabs.q: (struct crosstab) Added `missing' member.
6585         (custom_tables) Init missing.
6586         (calc_general) Handle missing values.
6587         (calc_chisq) New function.
6588         (output_pivot_table) Start work on chi-square output.  Update for
6589         new tab offset support functions.  Shorten statistic names.
6590
6591         * Several files: add in more `const's to placate gcc's warnings.
6592
6593         * tab.h: (struct tab_table) Add col_ofs, row_ofs members.  Comment
6594         fixes.
6595
6596         * tab.c: (tab_height, tab_realloc, tab_vline, tab_hline, tab_box,
6597         tab_null, tab_nulls, tab_value, tab_float, tab_text,
6598         tab_joint_text) Add col_ofs and row_ofs support.
6599         (tab_offset) New function.
6600         (tab_next_row) New function.
6601         (tab_row) New function.
6602         (tab_col) New function.
6603         (tabi_table) Add col_ofs and row_ofs support.
6604
6605         * vars-atr.c: (is_system_missing) New function.
6606
6607 Tue May 12 16:14:30 1998  Ben Pfaff  <blp@gnu.org>
6608
6609         * crosstabs.q: Expanded subcommand names RESID --> RESIDUAL, etc.
6610         (static var no_cells) Removed.
6611         (static var num_cells) New.
6612         (static var expected) New.
6613         (static var cells[]) New.
6614         (internal_cmd_crosstabs) Deal with new variables.
6615         (postcalc) Removed most of the meat and put it in new function
6616         output_pivot_table().
6617         (output_pivot_table) Calculates and outputs an entire pivot table.
6618
6619         * postscript.c: (postopen) Fix problems with free()ing addresses
6620         not obtained from malloc().
6621
6622         * som.c: (som_submit) Add assertion.
6623
6624         * sysfile-info.c: (describe_variable) Use new tab_nulls()
6625         function.
6626
6627         * tab.c: (static var tab_names[]) New.
6628         (tab_realloc) -1 for nc or nr indicates no change.
6629         (tab_nulls) New function.
6630         (tab_dim) Use tab_names[].
6631         (tabi_cumulate) Don't include bottom or right headers.  Furrfu.
6632         (evaluate_dimensions) Don't terminate on uninited cells, just put
6633         an X in them and emit a notice.  Use tab_names[].
6634
6635         * tab.h: Move bits into tab.def.
6636
6637         * tab.def: New.  Don't try to declare tab_table_class because then
6638         som.h has to be included.       
6639         
6640 Thu May  7 22:55:04 1998  Ben Pfaff  <blp@gnu.org>
6641
6642         * command.def: New file, contains all the command definitions
6643         previously included bodily in command.c.
6644
6645         * format.def: New file, contains all of the format definitions
6646         previously split across format.h, format.c, and sfm-write.c.
6647
6648         * lexer.h: Renamed from tokens.h in order to match corresponding
6649         .c file name.
6650
6651         * lexerP.h: Moved some rarely used functions exported by lexer.c
6652         into here.
6653
6654         * Makefile.am: Commemorate renamed files.
6655         (EXTRA_DIST) Add command.def, format.def.
6656
6657         * command.c: [0] (walk_cmdtable_func) Removed.
6658
6659         * crosstabs.q: (postcalc) Made it work and print out matrices
6660         proving it.
6661         (enum_column_values) Renamed enum_var_values, generalized for any
6662         variable.
6663
6664         * format.h: (struct fmt_desc) New member `spss'.
6665
6666         * q2c.c: (main) Generated code includes lexer.h instead of
6667         tokens.h.
6668
6669         * sfm-write.c: (write_format_spec) Use new spss member of fmt_spec
6670         instead of an independent translation table.
6671
6672 Tue May  5 13:19:03 1998  Ben Pfaff  <blp@gnu.org>
6673
6674         * Lots of source files: Added const to declarations.
6675
6676         * aggregate.c: (parse_aggregate_function) Rename inner i to j.
6677         
6678         * arena.c: (arena_clear) Set prev pointer to null when done.
6679
6680         * ascii.c: (ascii_option) Rename index as indx.
6681
6682         * avl.c: This is now a separate library called libavl.
6683         (xmalloc) Make static.
6684         (avl_probe) Step A7 can use the cache instead of an explicit
6685         compare.
6686         (avl_delete) Don't maintain a q pointer because it's always
6687         available in the pointer stack.  Comment fix.
6688
6689         * avl.h: This is now a separate library called libavl.
6690
6691         * command.c: (cmd_table[]) Remove spurious trailing "".
6692
6693         * common.h: Only include random() fix if this system needs it.
6694
6695         * crosstabs.q: Include alloca headers.
6696         (n_sorted_tab) New global var.
6697         (postcalc) Mostly rewritten.
6698         (find_pivot_extent) Rewritten.
6699         (enum_column_values) Rewritten.
6700
6701         * data-out.c: (convert_F) Rename inner n as n_spaces.
6702
6703         * error.c: (dump_message) Don't have an outer var i.
6704
6705         * file-handle.q: (static var f) Removed.  All references removed.
6706         (internal_cmd_file_handle) Uses a local variable instead of f.
6707
6708         * get.c: (trim_dictionary) Change scope of i, i1, i2.
6709         (cmd_match_files) Don't strcpy tokstr into sbc (why was this ever
6710         done?)
6711
6712         * getline.h: Declare getl_history as extern.  Reported by
6713         palme@uni-wuppertal.de (Hubert Palme).
6714
6715         * postscript.c: (postopen) Some large mods for constness.
6716
6717         * recode.c: Remove spurious copyrights since PSPP is owned by FSF
6718         anyway.
6719
6720 Fri Apr 24 12:52:47 1998  Ben Pfaff  <blp@gnu.org>
6721
6722         * Makefile.am: Rename BUILT_SOURCES to q_sources, all references
6723         changed.  Add avl.c, avl.h to pspp_SOURCES.  Remove avllib from
6724         LDADD.
6725
6726         * avl.c, avl.h: New files.  These form a clean-room
6727         reimplementation of avllib.  Iterative algorithms are used in
6728         place of recursive ones, so there is no resemblance in the code.
6729
6730         * Lots of headers: Don't include other headers by default.
6731
6732         * Lots of source files: Explicitly include all needed headers.
6733
6734         * arena.c: (arena_clear) New function.
6735
6736         * crosstabs.q: (ROW_VAR, COL_VAR) New enums.
6737         (static var ar) Removed.
6738         (staitc vars ar_tc, ar_col) New.
6739         (cmd_crosstabs) Destroy the arenas.
6740         (internal_cmd_crosstabs) Create the arenas.
6741         (precalc) Don't need a free function for the hash.
6742         (calc_general) Make sure to zero out the trailer on the key data
6743         before inserting.
6744         (print_table_entries) Updated.
6745         (postcalc) Worked on actually implementing.
6746         (find_pivot_extent) New function.
6747         (compare_value) New function.
6748         (enum_column_values) New function.
6749
6750         * data-in.c: (parse_month) Make local array `static const'.
6751         
6752         * data-out.c: (convert_date) Make local array `static const'.
6753         (convert_WKDAY) Same.
6754         (convert_MONTH) Same.
6755
6756         * frequencies.q: (postprocess_freq_tab) avl_walk_inorder() has
6757         been renamed to avl_walk().
6758         
6759         * hash.c: Rewritten more efficiently.
6760
6761         * hash.h: Add attribute const to hsh_next_prime declaration.
6762
6763         * lexer.c: (id_match) Make arguments const.
6764
6765         * postscript.c: (ps_postopen_driver) Make default fonts the
6766         Helvetica family.
6767
6768         * q2c.c: (main) Generated code needs stdlib.h.
6769
6770         * sfm-write.c: (write_value_labels) An avl_traverser needs to be
6771         initialized to 0 now, not to NULL.  All other references to
6772         avl_traverser were updated in the same way.
6773
6774         * tokens.h: Macro version of id_match updated to use const
6775         properly.
6776
6777         * val-labs.c: (inc_ref_count) New function.
6778         (copy_value_labels) Simply through use of new avl_copy() function.
6779
6780 Wed Apr 15 13:01:58 1998  Ben Pfaff  <blp@gnu.org>
6781
6782         * crosstabs.q: Probably doesn't compile.  New PIVOT subcommand.
6783         (postcalc) Worked on this.
6784
6785         * postscript.c: (OPO_DOUBLE_LINE) New enum.
6786         (struct ps_driver_ext) New line_width_thick member.
6787         (ps_preopen_drive) Init line_width_thick.
6788         (option_tab[]) Add line-* options.
6789         (ps_option) Parse line-* options.
6790         (postopen) Add line_width_thick support.  Strip leading spaces on
6791         prologue output lines.
6792         (ps_open_page) Include line_width_thick in output.
6793         (macro dump_thick_line) New.
6794         (dump_fancy_line) Support thick lines as well as double lines.
6795
6796 Tue Apr 14 00:50:08 1998  Ben Pfaff  <blp@gnu.org>
6797
6798         * Makefile.am: Add crosstabs.c to BUILT_SOURCES.  Add crosstabs.q
6799         to pspp_SOURCES.  Add crosstabs.q to EXTRA_DIST.
6800
6801         * Many source files: Rename `options' to `pv_opts' as appropriate.
6802
6803         * command.c: (static var cmd_table[]) Add CROSSTABS command.
6804
6805         * common.c: (xcalloc) New function.
6806
6807         * crosstabs.q: New file.  Not finished yet, though.
6808                 
6809         * data-list.c: Comment fix.
6810
6811         * error.c: Remove some old Checker cruft.
6812
6813         * frequencies.q: (dump_full) Cumulate valid percent instead of
6814         regular percent.
6815
6816         * getline.c: Comment fix.
6817
6818         * hash.c: Comment fixes.
6819
6820         * hash.h: (struct hsh_table) Make hash functions return unsigned
6821         instead of int to avoid problems with taking the modulo of
6822         negative return values.  All references changed.
6823
6824         * misc.c: (intlog10) Make its table static const instead of auto.
6825
6826         * sfm-read.c: (read_header) Make `prefix' static const instead of
6827         auto.
6828
6829         * var.h: (union value) Add member `hash'.
6830         (struct variable) Rename prv_index as `foo'--all references
6831         changed.  Reorder.
6832         (typedef pv_opts) Removed.  All references changed.
6833
6834         * vars-prs.c: (parse_variables) Message fixes.
6835         
6836 Mon Mar  9 15:35:08 1998  Ben Pfaff  <blp@gnu.org>
6837
6838         * get.c: (cmd_match_files) Don't reverse the order of FILEs as
6839         they are being inserted.  Don't check for BY variables of
6840         different types.  Discard variables if the active file isn't
6841         included in the merge.
6842         (mtf_processing) Essentially rewritten.
6843         (mtf_merge_dictionary) Check for master/slave variables of
6844         different types/widths.
6845
6846         * vfm.c: (static var not_canceled) New var.
6847         (process_active_file) Don't call vfm_source->read() if
6848         there's no vfm-source.  Initialize not_canceled.
6849         (process_active_file_write_case) Honor and update not_canceled.
6850         (prepare_for_writing) Rollback changes from yesterday, they were
6851         wrong.
6852         (close_active_file) Don't destroy vfm_source unless it exists.
6853         
6854 Mon Mar  9 00:56:16 1998  Ben Pfaff  <blp@gnu.org>
6855
6856         * Lots of source files: Added { } around nested if/else constructs
6857         to avoid new gcc 2.8 warnings.
6858
6859         * data-in.c: (parse_Z) Declare `int' type explicitly.
6860         (convert_Z) Ditto.
6861
6862         * get.c: (struct mtf_file) Add prev, next_min, by, input members.
6863         (cmd_match_files) Initialize mtf_by_values.  Manage by, input,
6864         prev members.  Put TABLEs at the end of the chain and FILEs at the
6865         beginning.  Don't allow the active file in STATE_INIT.  Use proper
6866         `seen' value for the active file.  Fill out the by members and
6867         make sure they're of consistent type.  Do the actual merge
6868         operation.
6869         (mtf_processing_finish) New function.
6870         (var_type_description) New function.
6871         (mtf_free_file) New function.
6872         (mtf_free) Rewritten.
6873         (mtf_delete_file_in_place) New function.
6874         (mtf_read_nonactive_records) New function.
6875         (mtf_compare_BY_values) New function.
6876         (static var mtf_seq_no) New var.
6877         (mtf_processing) New function.
6878         (mtf_merge_dictionary) Assign nval members for the system file
6879         dictionary.  Assign fv values for its variables.  Point each slave
6880         variable to the corresponding master variable.
6881
6882         * hash.c: Include str.h.
6883
6884         * mis-val.c: (copy_missing_values) src arg is const.
6885
6886         * misc.c: (spacing) Make `max' var explicitly int.
6887
6888         * sfm-read.c: (dump_dictionary) Message reformatting.
6889         (sfm_read_case) Add assertion.
6890
6891         * sort.c: Esthetic fixes.
6892
6893         * var.h: (struct match_files_proc) New struct.
6894         (struct variable) Add private data match_files_proc.
6895
6896         * vars-atr.c: (delete_variable) Implement.  Add argument for the
6897         dictionary that owning the variable.
6898         (dup_variable) Add assertion.
6899
6900         * vfm.c: Comment fixes, hopefully the comments are correct now.
6901         (process_active_file) New function.
6902         (process_active_file_write_case) New function.
6903         (process_active_file_output_case) New function.
6904         (prepare_for_writing) Use temp_dict->nval for vfm_info, not
6905         default_dict.nval.
6906         (write_case) Renamed procedure_write_case().  Now write_case is a
6907         pointer to a function.  Style fixes.
6908         
6909 1998-03-05  Ben Pfaff  <blp@gnu.org>
6910
6911         * Makefile.am: (q2c) Link with libmisc.
6912         (version.c) Define default_config_path, include_path,
6913         groff_font_path.
6914
6915         * ascii.c: (ascii_postopen_driver) When the default newline string
6916         is requested, open file in text mode.  Suggested by
6917         palme@uni-wuppertal.de (Hubert Palme).
6918         (static vars line_buf, line_p) Change from char * to unsigned char
6919         *.
6920         (ascii_close_page) char * to unsigned char *.
6921
6922         * cmdline.c: (parse_command_line) Implement -r option by
6923         prepending ~/.pspp/rc to the list of files to process.
6924
6925         * command.c: (cmd_remark) Reset getl_prompt to the standard prompt
6926         before pulling in a final line.
6927         (null_func, null_int_func) Removed (dead code).
6928
6929         * descript.q: (display) Calculate width of variable name column
6930         properly.  Calculate number of valid cases properly.  Reported by
6931         palme@uni-wuppertal.de (Hubert Palme).
6932
6933         * filename.c: (init_filename) Use default_config_path instead of
6934         now obsolete CONFIG_PATH.
6935
6936         * getline.c: (getl_initialize) Use include_path instead of now
6937         obsolete INCLUDE_PATH.
6938         (getl_add_file) New argument `where'.  All references changed.
6939
6940         * groff.c: (find_font_file) Use groff_font_path instead of now
6941         obsolete GROFF_FONT_PATH.
6942         
6943         * postscript.c: (find_ps_file) Use groff_font_path instead of now
6944         obsolete GROFF_FONT_PATH.  Copy through temporary variable to
6945         avoid problems with constness.
6946
6947         * str.h: (macro cs_streq) New macro.
6948
6949         * version.h: (glob var default_config_path, include_path,
6950         groff_font_path) New vars.
6951         
6952 1998-02-23  Ben Pfaff  <blp@gnu.org>
6953
6954         * Many source files: Change verbose_msg() priority levels and
6955         messages.
6956
6957         * aggregate.c: Include debug-print.h.
6958
6959         * cmdline.c: (parse_command_line) Add --safer/-s and --command/-c
6960         options.
6961         (static var pre_syntax_message) Document --safer/-s and
6962         --command/-c.
6963
6964         * command.c: (cmd_erase, cmd_host) Disable if set_safer is set.
6965
6966         * dfm.c: (open_inline_file) [__CHECKER__] Zero out ext->file,
6967         because it's not used but it's still copied.
6968         (open_file_r) Remove gratuitous debug message.
6969
6970         * filename.c: (safety_violation) New function.
6971         (open_file) Remove gratuitous debug messages.  Don't allow pipe
6972         files if set_safer is set.
6973
6974         * get.c: Turn off debugging.
6975
6976         * getline.c: (getl_add_virtual_file) New function.
6977         (getl_read_line) Add verbose_msg() call for opening new syntax
6978         file.
6979         (getl_perform_delayed_reset) Add a return value describing whether
6980         any action was taken.  Call reset_eof().
6981
6982         * getline.h: Comment fix.
6983
6984         * groff-font.c: (groff_read_font) Use `goto next_iteration' in
6985         place of incorrect `continue'.  Use strtok_r() instead of
6986         strtok().  Always check strtok_r() return value.
6987         (groff_read_DESC) Use strtok_r() instead of strtok().
6988
6989         * lexer.c: (reset_eof) New function.
6990
6991         * main.c: (parse) Get a token after performing a delayed reset
6992         action; allow empty syntax files.
6993
6994         * postscript.c: (output_encodings) Use strtok_r() instead of
6995         strtok().
6996
6997         * q2c.c: (dump_parser) Use strtok_r() instead of strtok().
6998
6999         * set.q: Comment fixes.
7000         (glob var set_safer) New var.
7001         (internal_cmd_set) Support SAFER.
7002
7003         * str.h: [!HAVE_STRTOK_R] Declare strtok_r() prototype.
7004
7005         * temporary.c: (free_dictionary) Set d->splits to NULL after
7006         freeing.
7007
7008         * vars-atr.c: (clear_variable) Decrement dict->n_splits if
7009         variable deleted, not if it *isn't* deleted.
7010
7011 1998-02-16  Ben Pfaff  <blp@gnu.org>
7012
7013         * command.c: (array cmd_table[]) Add MATCH FILES.
7014
7015         * common.c: Comment fixes.
7016
7017         * data-list.c, dfm.c, error.c, filename.c, list.q, matrix-data.c,
7018         modify-vars.c, postscript.c, sfm-read.c, sfm-write.c, tab.c:
7019         Include alloca.h.  Problem reported by palme@uni-wuppertal.de
7020         (Hubert Palme).
7021
7022         * expr-opt.c: Include str.h.  Problem reported by
7023         palme@uni-wuppertal.de (Hubert Palme).
7024
7025         * get.c: (cmd_get) [DEBUGGING] Update v->p.get to v->get.
7026         (static var mtf_by) Change from char ** to variable **.
7027         (static var mtf_master) New var.
7028         (mtf_merge_dictionary) New function.
7029         (cmd_match_files) Init mtf_master.  Parse mtf_by according to new
7030         var type.  Reorder tests properly.  Initialize file->dict.  Detect
7031         TABLE= without BY=.  Read file dictionaries and merge them.  Give
7032         subcommand name with IN, LAST, FIRST error messages.  Create IN,
7033         LAST, FIRST variables.  Comment fixes.
7034         (mtf_free) Don't free default_dict.  Free mtf_master.
7035
7036         * getline.c: Define getl_mode.  Change getl_buf_size to size_t
7037         from int.
7038         (handle_line_buffer) Cast int to size_t in comparison to avoid
7039         warning.
7040
7041         * getline.h: Declare getl_mode extern.
7042
7043         * groff-font.c: (groff_read_font) Type-fix calls to getline.
7044         (groff_read_DESC) Make line_size a size_t.
7045         (match_tok) Parenthesize name to avoid macro expansion.
7046
7047         * mis-val.c: (copy_missing_values) New function.
7048
7049         * postscript.c: (postopen) Make buf_size a size_t.
7050
7051         * sfm-read.c: (dump_dictionary) Make global from static.  Print
7052         variable info in parts for easier debugging with Checker.
7053
7054         * temporary.c: (copy_variable) Use copy_value_labels().
7055         (new_dictionary) New arg: whether to copy file label, documents.
7056
7057         * val-labs.c: (copy_value_labels) New function.
7058
7059         * var.h: (enums MISSING_*) Add MISSING_COUNT.
7060
7061         * vars-atr.c: [GLOBAL_DEBUGGING] (force_dup_variable) New
7062         function.
7063         (dup_variable) Set prv_index, get.fv, get.nv.
7064
7065 Fri Feb 13 15:38:36 1998  Ben Pfaff  <blp@gnu.org>
7066
7067         * Makefile.am: (pspp_SOURCE) Add htmlP.h.
7068
7069         * Many source files: For ANSI-compliance, add empty statement
7070         after label.  Reported by palme@uni-wuppertal.de (Hubert Palme)
7071         and Micah Altman <maltman@www-vdc.fas.harvard.edu>.
7072
7073         * data-in.c: (parse_numeric) Some header files break on
7074         -DBL_MIN_10_EXP because they get a --; add () for safety.
7075         Reported by palme@uni-wuppertal.de (Hubert Palme).
7076
7077         * dfm.c: Idea by Dr Eberhard W Lisse <el@linux.lisse.na>.
7078         (struct dfm_fhuser_ext) Change `file' from FILE * to file_ext.
7079         (dfm_close) Use close_file_ext.
7080         (open_inline_file) Set file.file to NULL, not file.
7081         (open_file_r, open_file_w) Initialize file.file; fill in file_ext
7082         struct and use open_file_ext().
7083         (read_record) Use file.file.
7084
7085         * file-handle.q: (prepend_current_directory) Pass through special
7086         filenames.
7087
7088         * filename.c: Only include unistd.h if HAVE_UNISTD_H.
7089         (normalize_filename) Pass through special filenames.
7090         (open_file, close_file) Accept pipe| and |pipe syntaxes as
7091         equivalent.
7092         (dirname) Rename blp_dirname() because of name conflict on some
7093         OS.  All references changed.  Reported by palme@uni-wuppertal.de
7094         (Hubert Palme).
7095         (is_special_filename) New function.
7096
7097         * get.c: (GTSV_OPT*) Add GTSV_OPT_MATCH_FILES.
7098         (trim_dictionary) Conditionalize some of the options on whether
7099         GTSV_OPT_MATCH_FILES is in *options.
7100         (rename_variables) Don't allow variables to be renamed as scratch
7101         variables.
7102         (MTF_*) New enum series.
7103         (struct mtf_file) New struct.
7104         (static vars mtf_head, mtf_tail, mtf_by, mtf_n_by, mtf_free) New
7105         vars.
7106         (cmd_match_files, mtf_free) New functions.
7107
7108         * lexer.c: (match_int) Needed parentheses around name to escape
7109         macro expansion.  Reported by Micah Altman
7110         <maltman@www-vdc.fas.harvard.edu>.
7111
7112         * print.c: Needed to include alloca.h.  Reported by Micah Altman
7113         <maltman@www-vdc.fas.harvard.edu>.
7114
7115         * recode.c: (convert_to_double) Parenthesize -DBL_MIN_10_EXP to
7116         -(DBL_MIN_10_EXP).  Reported by palme@uni-wuppertal.de (Hubert
7117         Palme).
7118         
7119         * str.h: Include stdarg.h.  Reported by palme@uni-wuppertal.de
7120         (Hubert Palme) and Micah Altman <maltman@www-vdc.fas.harvard.edu>.
7121
7122 Thu Feb  5 00:18:21 1998  Ben Pfaff  <blp@gnu.org>
7123
7124         * html.c: (struct html_driver_ext) Move into htmlP.h.
7125         (html_preopen_driver) Initialize cp_x, cp_y.
7126         (html_submit) Implement as call to output_tab_table().
7127         (change_attributes) New function.
7128         (escape_string) New function.
7129         (output_tab_table) New function.
7130
7131         * list.q: (write_all_headers) Add code for writing headers for the
7132         html driver.
7133         (clean_up) Write out the html close-table tag.
7134         (determine_layout) Ignore html driver.
7135         (list_cases) Write html data.
7136
7137         * som.c: (som_submit) Move more of the code into output_table().
7138
7139         * tab.c: (static var hit) Make a global var and rename tab_hit.
7140         (static var tab_table_class) Make a global var.
7141
7142         * htmlP.h: New file.
7143
7144 Tue Feb  3 16:12:18 1998  Ben Pfaff  <blp@gnu.org>
7145
7146         * dump-sysfile.c: Removed.
7147
7148         * html.c: (preclose) Change comment in emitted code.
7149
7150         * matrix-data.c: Debugging off by default.  Comment fixes.
7151         (static var container) New var.
7152         (cmd_matrix_data) Create and destroy container.  Initialize
7153         is_per_factor[] to 0s.  Move code into new function
7154         string_to_content_type().  Require split values to be present in
7155         the data when ROWTYPE_ is explicit.  Call specific function, not
7156         general read_matrices().
7157         (string_to_content_type) New function.
7158         (context) Exclude all whitespace, not just spaces.
7159         (mget_token) A dot is a number.  Add assertion.
7160         (static var data) Renamed nr_data.
7161         (static var factor_values) Renamed nr_factor_values.
7162         (read_matrices) Renamed read_matrices_without_rowtype().  Handle
7163         only specific case.  Close data_file before exit.
7164         (fill_matrix) New function.
7165         (read_data_lines) Renamed nr_read_data_lines().  Remove debug
7166         printing.  Style fixes.  Message fixes.  Move code into
7167         fill_matrix().
7168         (read_matrices_without_rowtype) Rename
7169         matrix_data_read_without_rowtype().  Fix off-by-one error on
7170         loops.  Allocate nr_data[] memory from arena.
7171         (read_matrices_with_rowtype) Removed.
7172         (read_splits) Renamed nr_read_splits().  Style fixes.
7173         (read_factors) Renamed nr_read_factors().
7174         (dump_cell_content) Comment fixes.  Arguments changed.  Change
7175         debug printing.  All references changed.
7176         (output_data) Renamed nr_output_data().
7177         (static var wr_content) New var.
7178         (struct factor_data) New struct.
7179         (static var wr_data) New var.
7180         (static var wr_current) New var.
7181         (matrix_data_source_destroy_source) Removed.
7182         (read_matrices_with_rowtype) New function.
7183         (matrix_data_read_with_rowtype) New function.
7184         (wr_read_splits) New function.
7185         (compare_factors) New function.
7186         (wr_output_data) New function.
7187         (wr_read_rowtype) New function.
7188         (wr_read_factors) New function.
7189         (wr_read_indeps) New function.
7190         (glob var matrix_data_source) Make destroy_source member NULL as
7191         well.
7192
7193 Fri Jan 23 00:09:08 1998  Ben Pfaff  <blp@gnu.org>
7194
7195         * lexer.c: (syntax_error) Give better error message when at end of
7196         file.
7197
7198         * matrix-data.c: (var content_names[]) Fix PROX spelling.  Change
7199         N_SCALAR to output as plain N.
7200         (mdump_token) Change output format.
7201         (context) Fix message output interaction with spaces in input.
7202         (another_token) New function.
7203         (force_eol) Improved error message.
7204         (static var max_cell_index) New var.
7205         (read_matrices) Init `cells'.  factor_values is now per-cell.
7206         Init max_cell_index.
7207         (read_data_lines) Replace `compare' local with new `compare' arg.
7208         Debugging messages changed.  Only read factors if per_factor.
7209         Propagate error return from read_factors(), force_eol().
7210         Copy N_SCALAR values across the N vector.
7211         (read_matrices_without_rowtype) Don't init `cells'.  Don't need to
7212         check parentheses manually since we now have is_per_factor[].
7213         Call read_data_lines() with new args.  Check for end of data after
7214         looping, using another_token().
7215         (read_factors) Arguments changed.  Use max_cell_index to determine
7216         whether to read or compare factors.  Message fixes.
7217         (dump_cell_content) New function.
7218         (output_data) Completely rewritten because content types were
7219         supported to be nested inside factor values, not vice versa.
7220         
7221 Thu Jan 22 00:26:38 1998  Ben Pfaff  <blp@gnu.org>
7222
7223         * lexer.c: (syntax_error) Support formatted varargs messages.
7224
7225         * matrix-data.c: Turn debugging on by default.
7226         (static content_type[]) New array.
7227         (static content_names[]) New array.
7228         (static rowtype_, varname_) New vars.
7229         (static is_per_factor[]) New array.
7230         (static split_values) Moved declaration.
7231         (static n_continuous, first_continuous) New var.
7232         (cmd_matrix_data) Don't init split_values.  Assign ROWTYPE_ to
7233         rowtype_.  Simplify SPLIT code.  Init is_per_factor[].  Assign
7234         VARNAME_ to varname_.  Initialize first_continuous, n_continuous.
7235         Check for continuous variables.
7236         [DEBUGGING] (debug_print) Remove content_names[].
7237         (mdump_token) New macro.
7238         (mget_token_dump) New function.
7239         (mdump_token) New function.
7240         (context) New function.
7241         (mget_token) Fix messages.
7242         (static var data, split_values, factor_values) New vars.
7243         (read_matrices) Manage split_values, factor_values.
7244         (read_data_lines) New function.
7245         (read_matrices_without_rowtype) Implemented.
7246         (read_splits) Message fixes.  Uses `just_read'.
7247         (read_factors) New function.
7248         (output_data) New function.
7249         (matrix_data_source_destroy_source) Close the file handle.
7250         (glob var matrix_source) Change name from "DATA LIST" to "MATRIX
7251         DATA".
7252
7253         * str.c: (strpadcmp) Removed.
7254
7255         * vfm.c: (dump_splits) Initialize i; fix test for end of splits.
7256
7257 Sun Jan 18 00:30:59 1998  Ben Pfaff  <blp@gnu.org>
7258
7259         * Lots of source files: Add cast to unsigned character to calls to
7260         tolower() and toupper().
7261
7262         * aggregate.c: Set default_dict.splits to NULL.
7263
7264         * command.c: (static variable tab[]) Add MATRIX DATA.
7265
7266         * data-in.c: Add debugging defines.  Formatting fixes.
7267
7268         * expr-opt.c: Formatting fixes.
7269
7270         * lexer.c: (syntax_error) Message fixes.
7271
7272         * matrix-data.c: New enum series.
7273         (static vars fmt, section, diag, explicit_rowtype, signle_split,
7274         split_values, n_factors, factors, cells, pop_n, contents,
7275         n_contents) New vars.
7276         (cmd_matrix_data) Finished implementation.
7277         (compare_variables_by_mxd_vartype) New function.
7278         [DEBUGGING] (debug_print) New function.
7279         (static vars mtoken, mtokstr, mtoklen, mtokval) New vars.
7280         (read_matrices) New function.
7281         (read_matrices_without_rowtype) New function.
7282         (read_matrices_with_rowtype) New function.
7283         (read_splits) New function.
7284         (mget_token) New function.
7285         (force_eol) New function.
7286         [0] (test_tokenizer) New function.
7287         (matrix_data_source_destroy_source) New function.
7288         (glob var matrix_data_source) New var.
7289
7290         * misc.h: Include ieeefp.h if present.
7291
7292         * split-file.h: (cmd_split_file) Changes corresponding to struct
7293         dictionary changes.
7294
7295         * str.h: Fix memmem prototype.
7296
7297         * temporary.c: (save_dictionary, restore_dictionary,
7298         free_dictionary) Changes corresponding to struct dictionary
7299         changes.
7300
7301         * var.h: (MXD_* enums) New enum series.
7302         (struct matrix_data_proc) New struct.
7303         (struct split) Removed.
7304         (struct dictionary) Changed `splits' member from `split *' to
7305         `variable **'.
7306         (macro force_create_variable) New macro.  Replaced lots of
7307         create_variable()/assert() calls with calls to this macro.
7308
7309         * vars-atr.c: (discard_variables) Changed assertion.
7310         [GLOBAL_DEBUGGING] (force_create_variable) New function
7311         called by the macro of the same name.
7312         (clear_variable) Changes to delete splits from the dictionary
7313         corresponding to struct dictionary changes.
7314
7315         * vars-prs.c: (parse_variables) [GLOBAL_DEBUGGING] Check for
7316         corrupted variable `index' values in the dictionary passed in
7317         every time this function is called.
7318
7319         * vfm.c: (dump_splits, SPLIT_FILE_procfunc) Changes corresponding
7320         to struct dictionary changes.
7321
7322 Tue Jan 13 23:45:02 1998  Ben Pfaff  <blp@gnu.org>
7323
7324         * Makefile.am: (pspp_SOURCES) Add matrix-data.c.
7325
7326         * command.c: New includes.
7327         (static array cmd_table[]) Add ERASE, HOST, NEW FILE.
7328         (cmd_erase) New function.
7329         [unix] (shell) New function.
7330         (run_command) New function.
7331         (cmd_host) New function.
7332         (cmd_new_file) New function.
7333
7334         * expr-prs.c: (parse_primary) Message fix.
7335
7336         * inpt-pgm.c: Formatting fix.
7337         (cmd_reread) Implement the FILE subcommand.
7338
7339         * matrix-data.c: New file.
7340
7341         * q2c.c: (dump_header) Change output commenting style.
7342
7343         * weight.c: Comment fix.
7344
7345 Tue Jan 13 00:53:39 1998  Ben Pfaff  <blp@gnu.org>
7346
7347         * aggregate.c: (buf64_10x) Renamed buf64_1xx, all references
7348         changed.
7349         (buf_10x) Renamed buf_1xx, all references changed.
7350         (cmd_aggregate) Implemented cases 010, 011, 110, and 111 (all
7351         cases now implemented).
7352         (create_sysfile) New function.
7353         (agr_11x_func) New function.
7354
7355         * data-in.c: (parse_numeric) Work properly if there's an
7356         explicitly coded decimal point in the data and decimal places are
7357         specified on DATA LIST.  Bug reported by Dr Eberhard W Lisse
7358         <el@linux.lisse.na>.
7359
7360         * get.c: (cmd_get, cmd_save_internal) Allow extraneous slash
7361         before file specification on GET, SAVE, XSAVE.  Bug reported by Dr
7362         Eberhard W Lisse <el@linux.lisse.na>.
7363
7364         * q2c.c: [!HAVE_STRERROR] Include misc/strerror.c, not
7365         strerror.c.  Bug reported by Alexandre Oliva
7366         <oliva@dcc.unicamp.br>.
7367
7368         * sort.c: Include sort.h.  Comment fixes.  A few esthetic fixes.
7369         (static var separate_case_tab) New var.
7370         (cmd_sort_cases) Cancel temporary transformations here.  Free
7371         v_sort before return.
7372         (sort_cases) Run an EXECUTE procedure if SEPARATE is nonzero and
7373         we're reading from a sort stream.  Don't cancel temporary
7374         transformations.  Offload internal sorting to do_internal_sort().
7375         (do_internal_sort) New function.  Handles internal sorting even
7376         when SEPARATE is nonzero.  Doesn't free v_sort.
7377         (do_external_sort) Take new arg SEPARATE.  Only destroy `x' if
7378         it's non-NULL.
7379         (write_initial_runs) Take new arg SEPARATE.  Only destroy the old
7380         sink if SEPARATE is zero.
7381         (read_output_cases) Renamed read_sort_output(), all references
7382         changed.  Now uses separate_case_tab when it exists.
7383         (write_separate) New function.
7384
7385         * vfm.c: (page_to_disk) Destroy memory_source_cases, not
7386         memory_sink_cases.  Don't redundantly call
7387         vfm_source->destroy_source().
7388         (memory_stream_mode) After switching over, set memory_sink_cases
7389         to NULL.
7390
7391 Sat Jan 10 23:35:51 1998  Ben Pfaff  <blp@gnu.org>
7392
7393         * aggregate.c: (struct agr_var) Expand dbl[] array from 2 to 3
7394         elements.
7395         (static var prev_case) New, moved out of aggregate_single_case()
7396         local scope.
7397         (static var buf64_10x, buf_10x) New.
7398         (cmd_aggregate) Initialize prev_case.  Comment fixes.  Implement
7399         the 000, 001, 100, and 101 cases.  Free prev_case.
7400         (parse_aggregate_functions) Disallow scratch variables.
7401         (free_aggregate_functions) Only free agr_dict if non-null.  Use
7402         iter->function to determine numeric/string type, not
7403         iter->src->type.
7404         (aggregate_single_case) Don't manage prev_case.  Initialize
7405         aggregate info after dumping it.
7406         (accumulate_aggregate_info) Fix sum, weighted sum, mean, weighted
7407         mean, stddev, weighted stddev definitions.
7408         (dump_aggregate_info) Implemented.
7409         (initialize_aggregate_info) Renamed from
7410         initialize_aggregate_functions().  Initializes dbl[2].
7411         (agr_00x_trns_proc, agr_00x_end_func, write_case_to_sfm,
7412         agr_10x_trns_proc, agr_10x_trns_free, agr_10x_end_func) New.
7413
7414         * cases.c: (alloc_val) Removed.
7415
7416         * get.c: (cmd_save_internal) Initialize new `dict' member.
7417
7418         * sfm-write.c: (sfm_write_dictionary, write_header,
7419         write_variable, write_value_labels, write_documents) Reorganize,
7420         simplify for new parameter structure.
7421         (write_variable) Only one variable * argument now.
7422
7423         * sfm.h: (struct sfm_write_info) Removed `pri', `sec', and
7424         replaced by new `dict' member.
7425
7426         * temporary.c: (new_dictionary) Initialize n_documents.
7427
7428         * vars-atr.c: (dup_variable) Allocate `value's from dict into
7429         v->fv manually.
7430         (init_variable, replace_variable) Eliminate usage of alloc_val().
7431
7432         * vars-prs.c: (parse_DATA_LIST_vars) Accept PV_NO_SCRATCH option.
7433
7434         * vfm.c: (arrange_compaction) Allow `temporary' value of 2 to
7435         signal that AGGREGATE is to be used for forming final cases.
7436         (close_active_file) Call end_func before stopping lagging.  Cancel
7437         temporary after finishing compaction.
7438         (write_case) Comment fixes.  Cleaned up.
7439         (compact_case) Let AGGREGATE handle compaction when `temporary' is
7440         2.
7441
7442 Sat Jan 10 02:10:47 1998  Ben Pfaff  <blp@gnu.org>
7443
7444         * Makefile.am: (BUILT_SOURCES) Add means.c.
7445         (pspp_SOURCES) Add means.c.
7446         (EXTRA_DIST) Add means.q.
7447
7448         * command.c: (array cmd_table[]) Add MEANS.
7449
7450         * common.h: Esthetic fixes.  Comment fixes.  Test for
7451         MAX_SHORT_STRING greater than 8.
7452         (macros LOWEST, HIGHEST) New.
7453
7454         * data-in.c, data-list.c, recode.c: Comment fixes.
7455
7456         * means.q: New file, base version.
7457
7458         * mis-val.c: (parse_num_or_range, parse_numeric) Replace -DBL_MAX
7459         with LOWEST, DBL_MAX with HIGHEST.
7460
7461         * q2c.c: (dump_vars) Add an enum to array types giving the number
7462         of values for the enum.
7463
7464         * sfm-read.c: (sfm_read_dictionary, read_machine_flt64_info)
7465         Replace second_lowest_value with second_lowest_flt64.
7466
7467         * sfm-write.c: (write_variable, write_rec_7_34) Replace
7468         second_lowest_value with second_lowest_flt64.
7469
7470         * t-test.q: Comment fix.
7471
7472         * temporary.c: (restore_dictionary) Esthetic fix.
7473
7474         * tokens.h: (force_match_id, force_match, force_string, force_int,
7475         force_num, force_id) Replace msg() with syntax_error().
7476
7477         * var.h: (struct means_proc) New.
7478         (struct variable) Add mns member to `p' union.
7479
7480         * vars-prs.c: (parse_variable, parse_dict_variable,
7481         parse_variables, parse_DATA_LIST_vars) Replace msg() with
7482         syntax_error().
7483
7484 Thu Jan  8 22:28:41 1998  Ben Pfaff  <blp@gnu.org>
7485
7486         * Makefile.am: (pspp_SOURCES) Add tab.h.
7487
7488         * Most source files: Added a cast to unsigned char in usages of
7489         the ctype is*() functions.  Replaced `end of command expected'
7490         calls to msg() with calls to syntax_error().
7491
7492         * frequencies.q: (dump_condensed) Fix tab_dim() column reference.
7493
7494         * lexer.c: (hex_val) Removed (was dead code).
7495         (idmatch) Parenthesize function name to avoid macro expansion.
7496
7497         * postscript.c: Comment fixes.
7498         (ps_preopen_driver) Change default font size to 10pt.
7499
7500         * sfm-read.c: (read_variables) Byteswap sv.print, sv.write as
7501         int32s.
7502         (parse_format_spec) Change system-file format spec argument type
7503         to int32.  Parse the format spec with bitwise operators.
7504
7505         * sfmP.h: (struct sysfile_format) Removed.
7506         (struct sysfile_variable) Changed print, write members from
7507         sysfile_format to int32.
7508
7509         * tokens.h: Esthetic fixes.
7510         [__GNUC__] (macro id_match) New macro to hopefully speed up
7511         identifier matching.
7512         (macros match_id, match_tok, match_int) Implemented in
7513         compiler-independent manner; no longer GNU C only.
7514
7515         * vfm.h: Include time.h.
7516
7517 Mon Jan  5 11:06:15 1998  Ben Pfaff  <blp@gnu.org>
7518
7519         * data-list.c: (dump_fixed_table) Change tab_dim().
7520
7521         * dump-sysfile.c: (open_sysfile) Fix mmap() call.
7522
7523         * error.c: Include command.h.
7524
7525         * frequencies.g: Formatting fixes.
7526
7527         * frequencies.q: Add tab_dim() calls.  Make the total cell a
7528         joined cell.
7529
7530         * glob.c: Include command.h.
7531
7532         * sfm-read.c: (struct sfm_fhuser_ext) New members sysmis, highest,
7533         lowest.
7534         (sfm_read_dictionary) Initialize sysmis, highest, lowest.
7535         (sfm_read_machine_flt64_info) Update sysmis, highest, lowest.
7536         (read_variables) Byteswap sv.type; byteswap sv.print, sv.write as
7537         the other elements (is this right?).
7538         (read_variables) Use lowest, highest members.
7539         (parse_format_spec) New arg `vv' for more stringent checking.
7540         (dump_dictionary) Byteswaps nonexplicit data.
7541         (sfm_read_case) Byteswap numeric data.
7542
7543         * som.c: Initialize table_num to 1.
7544         (render_segments) Remember to increment y_index after each table
7545         segment.
7546
7547         * sysfile-info.c: (cmd_sysfile_info) Change tab_dim().  Don't call
7548         avl_count() on a NULL tree.  No title for the second table.
7549         (cmd_display) Handle DISPLAY VECTORS by calling display_vectors().
7550         Handle AS_SCRATCH as AS_NAMES.  Warn if no variables.  Re-enable;
7551         fix call to display_variables().
7552         (display_variables) Default to 4 columns, not 3.  Set up headers.
7553         Column title is Variable, not Name.  Fix index column.
7554         Add joint text.  Add tab_dim().  Handle value labels properly.
7555         Handle DISPLAY LABELS properly.  Draw boxes correctly.
7556         (describe_variable) Value labels don't need titles.  Don't clear
7557         nonexistent index column.
7558         (compare_vectors_by_name) New function.
7559         (display_vectors) New function.
7560
7561         * tab.c: (tab_height) Add assertion.
7562         (tab_null) Add debug code.
7563         (evaluate_dimensions) Add debug code.
7564
7565         * var.h: (struct variable) get_proc data is sometimes used
7566         simultaneously with other per-procedure info, therefore it was
7567         removed from the union.  All references changed.        
7568
7569 Sun Jan  4 18:13:33 1998  Ben Pfaff  <blp@gnu.org>
7570
7571         * ascii.c: (ascii_close_page) Put title on second line of headers
7572         if there is no subtitle.
7573
7574         * command.c: (glob var cur_proc) Move definition here, from
7575         common.c.
7576         (cmd_remark) Emit blank line before remarks.
7577
7578         * command.h: (glob var cur_proc) Move declaration here, from
7579         common.h.
7580
7581         * data-list.c: (dump_fixed_table) Fix messages.
7582         (dump_free_table) Call tab_nat_dim().
7583
7584         * descript.q: (dump_z_table) Modify tab_dim() call.
7585
7586         * frequencies.q: (dump_condensed, dump_statistics) Add tab_dim()
7587         call.
7588         (dump_statistics) Don't output header.
7589
7590         * groff-font.c: Minor format fix.
7591
7592         * html.c: Comment fix.
7593
7594         * list.q: (write_varname) Indent after advancing page.
7595
7596         * output.h: Minor reordering.
7597
7598         * postscript.c: Comment fixes.  Many places, '\n' was replaced by
7599         a reference to eol[].
7600         (struct ps_driver_ext) New member eol[].
7601         (ps_preopen_driver) Initialize eol[].
7602         (ps_postopen_driver) Fix sense of text for text_opt, line_opt
7603         defaults.  Handle headers.  Fix test for minimum page length.
7604         (static var option_tab[]) Add `line-ends'.
7605         (ps_option) Handle line-ends to change eol[].
7606         (postopen) Scale prop_em_width and fixed_width properly.  Set the
7607         prologue title to outp_title if applicable.  Replace the prologue
7608         line ends with eol[].  Call draw_headers() if headers are enabled.
7609         (text_width) New function.
7610         (out_text_plain) New function.
7611         (draw_headers) New function.
7612
7613         * print.c: (dump_table) Call tab_nat_dim().
7614
7615         * som.c: (som_blank_line) Only advance a line if not at the top of
7616         a page.
7617         (som_submit) Move several informational table calls here.
7618         Increment subtable_num if SOMF_NO_TITLE not set.
7619         (output_table) Advance a line if SOMF_NO_SPACING not set.
7620         (render_columns, render_segments, render_simple) Handle spacing
7621         between tables.  Handle table titles.  Remove debug output.
7622
7623         * som.h: (SOMF_*) New enum series.
7624         (struct som_table_class) New member `flags'.
7625
7626         * sysfile-info.c: (cmd_sysfile_info) Calls tab_nat_dim().  No
7627         headers or spacing.
7628         (display_variables) Calls tab_nat_dim().
7629         (describe_variable) Remove restriction on number of value labels.
7630         Make value labels separated by thin lines.
7631
7632         * tab.c: (tab_create) Default `flags' to none.
7633         (tab_float) New arg `w'.  All references changed.
7634         (tab_nat_dim) New function.
7635         (tab_output_text) No title or spacing.
7636         (tab_flags) New function.
7637         (tabi_flags) New function.
7638         (tabi_title) New function.
7639         (strip_height) Removed.
7640         (tabi_render) Skip title when necessary.
7641         (static var tab_tab_class) Add tabi_flags, tabi_title.
7642         (evaluate_dimensions) Disable display of column, row size.
7643         (sum_columns) Add title height to top header.
7644         (render_strip) Moved within file.
7645
7646         * tab.h: (struct tab_table) New member `flags'.
7647
7648         * vfm.c: (dump_splits) Calls tab_nat_dim().  No title.
7649
7650 Sat Jan  3 16:55:44 1998  Ben Pfaff  <blp@gnu.org>
7651
7652         * Most source files: Add `const' attribute in all appropriate
7653         places.
7654         
7655         * sysfile-info.c: (cmd_sysfile_info) Add tab_dim() call, add a
7656         column to the variables table for use by describe_variable().
7657         (cmd_display) Disable for the present.
7658         (display_documents) Don't wrap documents.
7659         (display_variables) Table has four columns now.
7660         (describe_variable) Table has four columns now.  Don't use a
7661         subtable, use joined cells instead.
7662
7663         * tab.c: (tab_create) Don't set `join'.
7664         (tab_realloc) ct array is not made up of a_string's.
7665         Reallocate trh, hrh, h arrays, initialize trh array.  Initialize
7666         cell contents on GLOBAL_DEBUGGING, not DEBUGGING.
7667         (text_format) New function.
7668         (tab_title) Rewritten, uses text_format().
7669         (tab_text) Rewritten, uses text_format().
7670         (tab_joint_text) New function.
7671         (tab_join) Removed.
7672         (static var hit) New variable.
7673         (render_strip) New args r1, r2.  Implement joined cells that fit
7674         on a single page.
7675         (tabi_render) Increment hit.  Pass new args to render_strip().
7676         (evaluate_dimensions) [GLOBAL_DEBUGGING] Check for uninitialized
7677         cells.  For t_naw and t_nah, ignore joined cells and null cells in
7678         calculations.
7679         
7680         * tab.h: (struct tab_join_rect) Removed.
7681         (struct tab_table) Removed `join'.
7682         (TAB_JOIN_MAIN) Removed.
7683         (struct tab_joined_cell) New struct.
7684         (TAT_NOWRAP) New enum.
7685
7686 Fri Jan  2 01:39:58 1998  Ben Pfaff  <blp@gnu.org>
7687
7688         * ascii.c: (ascii_postopen) Replace ASCII_* macros with their
7689         expansions.
7690         (ascii_postopen_driver) Fix initialization of *_spacing so that
7691         the TAL_0 bit doesn't count.
7692
7693         * data-list.c: (dump_fixed_table) Use natural width for Format
7694         column.
7695
7696         * glob.c: (rerange) Removed.
7697         (get_date) Formatting fixes.  Internationalization fix.
7698
7699         * html.c: (html_postopen_driver) Replace HTML_DEFAULT_OUTPUT_FILE
7700         with "pspp.html".
7701
7702         * postscript.c: (ps_postopen_driver) Replace
7703         PS_DEFAULT_OUTPUT_FILE with "pspp.ps".
7704
7705         * som.c: (som_submit) Don't eject page before every table.
7706         (output_table) Fix order of arguments on call to area().
7707         (render_columns) Fix calculation of max_len.
7708         
7709         * tab.c: (tabi_cumulate) Minor change to increase elegance.
7710         (render_strip) New function.
7711         (strip_height) New function.
7712         (tabi_render) Rewrite as calls to render_strip().
7713
7714         * tab.h: (TAT_* enums) Removed TAT_RICH, all references removed.
7715         Renumbered TAT_PRINTF, TAT_TITLE, TAT_FIX to correspond better
7716         with the TAB_* and OUTP_T_* constants.
7717         
7718 Thu Jan  1 11:53:52 1998  Ben Pfaff  <blp@gnu.org>
7719
7720         * Makefile.am: Formatting fixes.
7721
7722         * ascii.c: (ascii_postopen_driver) Initialize *_line_spacing[],
7723         *_line_width[].
7724
7725         * data-list.c: (dump_fixed_table) Add tab_dim() call.
7726
7727         * descript.q: (dump_z_table, display) Add tab_dim() calls.
7728
7729         * dump-sysfile.c: (glob var length) Make type off_t.
7730         (usage) Fix arguments.
7731         (main) Return 0.
7732
7733         * output.h: (OUTP_T_*) Change constants' value to match tab.h.
7734         Now right-justification is the default so many references had to
7735         change.
7736         (struct outp_class) Removed line_width, all references changed.
7737         (OUTP_DEV_*) Add OUTP_DEV_DISABLED.
7738         (struct outp_driver) Add elements horiz_line_width,
7739         vert_line_width, horiz_line_spacing, vert_line_spacing.  Remove
7740         som element.
7741
7742         * postscript.c: (outp_encodings) Formatting fixes.  Fix garbage
7743         collection.
7744         (postopen) Initialize all the informational members of
7745         outp_driver.
7746
7747         * som.c: (som_blank_line) New function, renamed from blank_line(),
7748         all references changed.
7749         (som_submit) Disables drivers whose pages can't be opened.
7750         (render_columns, render_simple, render_segments) Add debug output.
7751         (render_columns) Fix loop range.
7752         (render_simple) Don't try to render the headers, they're taken
7753         care of automatically.  Advance cp_y past the table when done.
7754         (render_segments) Fix loop ranges.
7755
7756         * tab.c: Initialize new members of tab_table.
7757         (tab_vline) Handle trv[]; don't set style for spacing-only lines.
7758         (tab_hline) Handle trh[]; don't set style for spacing-only lines.
7759         (tab_box) Handle trh[], trv[]; don't set style for spacing-only
7760         lines.
7761         (set_expr) Removed.
7762         (tab_dim) New function.
7763         (tab_col_width) Removed.
7764         (tab_row_height) Removed.
7765         (tab_output_text) Call tab_dim().
7766         (tabi_driver) Call evaluate_dimensions(), sum_columns().
7767         (tabi_area) Implemented.
7768         (tabi_cumulate) Implemented.
7769         (tabi_render) Partially implemented, but broken.
7770         (var tab_table_class) Made static.
7771         (evaluate_dimensions) New function.
7772         (sum_columns) New function.
7773
7774         * tab.h: (enum t_*) Now start at t_end.  New: t_ptw, t_nr, t_nc,
7775         t_nah, t_naw, t_neg, t_xch, t_dup, t_lbl, t_jnz, t_sac, t_sar,
7776         t_scr, t_srr, t_sentinel.  Removed: t_nat.
7777         (struct tab_table) New: wl, wr, ht, hb, trh, hrh, trv, wrv, dim,
7778         max_stack_height, w, h.  Removed: ce, re.
7779         (macro blank_line) Removed.
7780         (glob var zero_length) Removed.
7781
7782 Fri Dec 26 15:44:31 1997  Ben Pfaff  <blp@gnu.org>
7783
7784         * Most source files: include some of the new include files broken
7785         out of var.h.
7786         
7787         * Makefile.am: (pspp_SOURCES) Add all the new source files to the
7788         list.
7789
7790         * aggregate.c: (glob var outfile) Make static.
7791
7792         * command.c: (glob var pgm_state) Move here.
7793
7794         * common.c: (glob vars endian, second_lowest_value, pgmname,
7795         finished, curdate, cur_proc, start_interactive, history_file) Move
7796         here.
7797
7798         * descript.q: (structs dsc_z_score, descriptives_trns) Move here.
7799
7800         * file-handle.q: (glob vars files, inline_file) Move here.
7801
7802         * glob.c: Lost lots of glob vars, detailed in individual file
7803         entries.
7804         (init_glob) set_printer, set_screen were obsolete, deleted.
7805         set_cprompt has fewer spaces because pspp has fewer letters than
7806         fiasco.
7807
7808         * inpt-pgm.c: (glob vars inp_init, inp_init_size) Move here.
7809         (inp_nval) Made static.
7810
7811         * lexer.c: (glob vars token, tokval, tokstr, tokstr_size,
7812         tokstr_len, toklongstr, tokint) Move here.
7813
7814         * misc.c: Lost several vars and functions.
7815
7816         * set.q: (all the set_* variables) Move here.
7817
7818         * str.c: (strmaxcpy, strbarepadcpy, strbarepadlencpy, strpadcpy,
7819         blpstrset, strpadcmp, memrev, memrmem, cmp_str) Move here from
7820         misc.c.
7821
7822         * tab.c: (set_expr, tab_col_width, tab_row_height) New functions.
7823
7824         * tab.h: (enum series t_*) New enums.
7825         (struct tab_table) Use arena struct tag.  New members ce, re.
7826
7827         * tokens.h: Comment fixes.
7828
7829         * var.h: Move lots of enums and variables and functions and
7830         structures to other files.  Use and declare a lot more union and
7831         struct tags.  Comment fixes.  
7832
7833         * vector.c: (glob vars vec, nvec) Move here.
7834
7835         * vfm.c: (glob vars reinit_sysmis, reinit_blanks, init_zero,
7836         init_blanks, last_vfm_invocation) Move here.
7837
7838         * cases.h: New file.
7839         (struct long_vec) Move here.
7840         (vec_init, vec_clear, vec_insert, vec_delete, devector, envector)
7841         Move here.
7842
7843         * command.h: New file.
7844         (STATE_* enums) Move here.
7845         (glob var pgm_state) Move here.
7846
7847         * format.c: New file.
7848         (glob var formats) Move here.
7849         (parse_format_specifier_name, fmt_to_string,
7850         check_input_specifier, check_output_specifier,
7851         check_string_specifier, convert_fmt_ItoO, parse_format_specifier)
7852         Move here.
7853
7854         * format.h: New file.  Move functions now in format.c here.
7855         (FMT_* enums) Move here.
7856         (struct fmt_desc) Move here.
7857         (FCAT_* enums) Move here.
7858         (struct fmt_spec) Move here.
7859         (glob vars formats, fmt_parse_ignore_error) Move here.
7860
7861         * inpt-pgm.h: New file.
7862         (INP_* enums) Move here, make #defines into enums.
7863         (glob vars inp_init, inp_init_size) Move here.
7864
7865         * sort.h: New file.
7866         (glob vars v_sort, nv_sort) Move here.
7867         (sort_cases, read_sort_output) Move here.
7868
7869         * vector.h: New file.
7870         (struct vector) Move here, add struct tag.
7871         (glob vars vec, nvec) Move here.
7872         (find_vector) Move here.
7873
7874         * New file.
7875         (glob vars last_vfm_invocation, temp_case, reinit_sysmis,
7876         reinit_blanks, init_zero, init_blanks) Move here.
7877         (struct case_stream) Move here.
7878         (glob vars vfm_source, vfm_sink, vfm_memory_stream,
7879         vfm_disk_stream, sort_stream, data_list_source,
7880         input_program_source, file_type_source, get_source, n_lag) Move
7881         here.
7882         (procedure, write_case, lagged_case, compact_case, page_to_disk)
7883         Move here.
7884                 
7885 Wed Dec 24 22:40:42 1997  Ben Pfaff  <blp@gnu.org>
7886
7887         * Makefile.am: (pspp_SOURCES) Added html.c, som.c, som.h.
7888         (LDADD) Add libdcdflib.
7889
7890         * ascii.c: Comment and formatting fixes.  Almost every external
7891         function had an assert added, checking driver_open and page_open.
7892         (ascii_init_driver) Broken into ascii_preopen_driver,
7893         ascii_postopen_driver, ascii_close_driver.  Manages driver_open.
7894         (ascii_open_page) Sets page_open.
7895         (ascii_close_page) Clears page_open.
7896
7897         * html.c: Comment and formatting fixes.  Almost every external
7898         function had an assert added, checking driver_open and page_open.
7899         (html_init_driver) Broken into html_preopen_driver,
7900         html_postopen_driver, html_close_driver.  Manages driver_open.
7901         (html_open_page) Sets page_open.
7902         (html_close_page) Clears page_open.
7903         (html_submit) Disabled.
7904
7905         * lexer.c: (parse_string) Remove debugging printf.
7906
7907         * list.q: (determine_layout) Open a page if one is not yet open.
7908
7909         * output.c: Comment fixes.
7910         (add_class) Set the class member of the new list element.
7911         (parse_options) Don't handle device type.
7912         (colon_tokenize) New function.
7913         (configure_driver) New four-field format with a field for device
7914         type.  Now initialize driver_open, page_open, next, and prev
7915         fields.  Use new colon_tokenize() function.  Don't do a memory
7916         copy to replace a driver, it doesn't work; instead delete the old
7917         driver and insert a new one.
7918         (destroy_driver) Don't call som_destroy_driver().  Close the page
7919         if it's open.  Find the class in the list of classes and decrement
7920         that reference count.  Remove the driver from the global driver
7921         list.
7922         (outp_iterate_enabled_drivers) Renamed outp_drivers().  All
7923         references changed.  Rewritten.  Don't return a driver that's not
7924         enabled.
7925         (outp_eject_page) All references to som_internal_eject_page()
7926         changed to use this.  Sets cp_x to 0 as well as cp_y.
7927
7928         * output.h: (OUTP_I_* enums) Removed.
7929         (struct som_submission_form) Removed.
7930         (struct outp_class) init_driver broken into preopen_driver,
7931         postopen_driver, and close_driver.  submit changed to take a
7932         som_table argument.
7933
7934         * postscript.c: Comment and formatting fixes.  Almost every
7935         external function had an assert added, checking driver_open and
7936         page_open.
7937         (ps_init_driver) Broken into ps_preopen_driver,
7938         ps_postopen_driver, ps_close_driver.  Manages driver_open.
7939         (ps_open_page) Sets page_open.
7940         (ps_close_page) Clears page_open.
7941
7942         * som.c: New file, base implementation.
7943         
7944         * som.h: (struct som_table) Add struct tag.
7945         (enum SOM_COL_ACROSS) Removed.
7946         (SOM_ROWS, SOM_COLUMNS) New enums.
7947         (struct som_table_class) Add member `cumulate'.  Remove `segment';
7948         change `render' arguments.
7949         (struct som_point, struct som_rect) Removed.
7950         (som_submit_table) Fixed typo, should have been som_submit.
7951
7952         * sysfile-info: (describe_variable) Don't try to insert a
7953         subtable; just destroy it for now.
7954
7955         * t-test.q: Include dcdflib/cdflib.h instead of cdflib.h.  Fix
7956         references to value labels.
7957
7958         * tab.c: (tab_destroy) New function.
7959         (tab_columns) Change argument.
7960         [0] (tab_submit) Remove dead code.
7961         (tab_title) Allocate string from the table's arena.
7962         (tab_output_text) Only free the buffer if we allocated it.
7963         (tab_submit) New function.
7964         (static vars t, d) New static vars.
7965         (tabi_table, tabi_driver, tabi_count, tabi_area, tabi_columns,
7966         tabi_headers, tabi_cumulate, tabi_render) New functions.
7967         (glob var tab_table_class) New global var.
7968
7969         * tab.h: (struct tab_join_rect) Don't use a som_rect; directly
7970         encapsulate the rectangle.  All references changed.
7971         
7972 Sun Dec 21 16:18:58 1997  Ben Pfaff  <blp@gnu.org>
7973
7974         * All header files updated to use struct tags in addition to
7975         typedefs for all structures.  Don't use word `struct' in struct
7976         tags.
7977         
7978         * Makefile.am: (pspp_SOURCES) Remove html.c.
7979         (INCLUDES) Replace the lib/* includes with a single lib/ include;
7980         all references updated.
7981
7982         * command.c: (parse_cmd) Remove call to som_check_workspace.
7983         (output_line) Update to new som.
7984
7985         * data-in.c: (parse_numeric) A single dot is not an error; it is
7986         the system-missing value.
7987
7988         * data-list.c: (dump_fixed_table, dump_free_table) Update to new
7989         som.
7990
7991         * data-out.c: Added `const' as appropriate to many prototypes.
7992         (convert_E, convert_F, convert_CCx) Take double argument instead
7993         of value * argument.
7994         (convert_format_to_string) Call changed functions appropriately.
7995         Instead of modifying the caller's value for FCAT_SHIFT_DECIMAL,
7996         make a local copy of the value.
7997
7998         * descript.q: Remove custom_variables() prototype now provided by
7999         q2c.  
8000         (custom_variables) Don't increment sbc_variables, the caller does
8001         this.
8002         (dump_z_table, display) Update to new som.
8003
8004         * error.c: (vmsg) Add const to prototype.  Remove code to handle
8005         `too many errors' condition.
8006         (check_error_count) New function.
8007         (msg) Add const to prototype.
8008
8009         * filename.c: (open_file) Rewrite for elegance.
8010
8011         * frequencies.q: Remove custom_*() prototypes now provided by q2c.
8012         (dump_full, dump_condensed, dump_statistics) Update for new som.
8013
8014         * list.q: Don't include somP.h.  Change all references to
8015         som_driver_ext to refer to the new members of som_driver.  Change
8016         som_internal_eject_page() references to outp_eject_page().
8017
8018         * main.c: (parse) Rewrite for elegance.  Add call to
8019         check_error_count().
8020
8021         * output.c: (add_class, outp_list_classes, outp_configure_driver)
8022         Rewrite or revise for new outp_driver_class_list structure.
8023         (outp_iterate_enabled_drivers) Fix comparison between disabled
8024         devices and current device type.
8025         (outp_eject_page) New function.
8026
8027         * output.h: Comment fixes.
8028         (struct outp_driver) New members driver_open, page_open, cp_x,
8029         cp_y, font_height, prop_em_width, fixed_width.  Deleted members
8030         ref_count, next.
8031         (struct outp_driver_class_list) New struct.
8032         (outp_class_list) Changed to type outp_driver_class_list; all
8033         references updated.
8034
8035         * print.c: (dump_table, print_trns_proc) Updated for new som.
8036
8037         * q2c.c: (dump_vars) Simplify array subcommand code.  Declare
8038         prototypes for custom subcommands.
8039         (dump_subcommand) Always include the `else'.
8040         (dump_parser) Fix comments in output code.
8041
8042         * set.q: Reordered functions.
8043
8044         * som-frnt.c, som-high.c, som-low.c, somP.h: Removed.
8045         
8046         * som.h: Rewritten from scratch.
8047
8048         * str.h: Remove dead code.
8049
8050         * tab.c, tab.h: New files, base implementation.
8051
8052         * sysfile-info.c: (cmd_sysfile_info, describe_variable) Update to
8053         new som.
8054
8055         * t-test.q: New code from John Williams
8056         <johnr.williams@stonebow.otago.ac.nz>.  Include math.h, cdflib.h.
8057         Many many new static vars and defines.
8058         (precalc, postcalc, g_postcalc, z_postcalc, t_pairs, t_groups,
8059         groups_calc, pairs_calc, z_dev_calc, z_calc) New functions.
8060         (struct value_list) New struct.
8061         (variance, covariance, pooled_variance, oneway, pearson_r, f_sig,
8062         t_crt, t_sig, print_t_groups) New functions.
8063         (cmd_t_test) Implemented.
8064
8065         * temporary.c: (cancel_temporary) Only free the temp_dict if it's
8066         non-NULL.
8067
8068         * vfm.c: (dump_splits) Update to new som.
8069
8070 Thu Dec  4 23:02:22 1997  Ben Pfaff  <blp@gnu.org>
8071
8072         * Makefile.am: (fiasco_SOURCES) Add html.c.
8073
8074         * aggregate.c: Base source.
8075
8076         * ascii.c: (postopen, preclose) Reformat.
8077
8078         * data-out.c, expr-evl.c: Comment fixes.
8079         
8080         * filename.c: (open_file) When opening a file for writing, use
8081         line buffering instead of full buffering for better interactive
8082         performance.  Suggested by Valerio Aimale
8083         <valerio@svpop.com.dist.unige.it>.  Also, recognize special file
8084         names `stdin', `stdout', `stderr'.
8085
8086         * groff-font.c: Comment fixes.
8087
8088         * html.c: New file; base version.
8089
8090         * list.q: (write_all_headers, clean_up, determine_layout,
8091         list_cases) Ignore `special' devices for now.  Needs to be fixed
8092         later.
8093
8094         * output.c: (outp_init) Add html driver to list; reverse list
8095         order.
8096
8097         * output.h: (struct outp_class_struct) New members `special',
8098         `submit'; comment fixes.  All references changed.
8099
8100         * postscript.c: (ps_init_driver) Make defaults for text_opt,
8101         line_opt depend on whether the OUTP_DEV_SCREEN bit is set on the
8102         device.
8103         (postopen) Comment fix.
8104         (preclose) Comment fixes, formatting fixes.  Change x->file.file
8105         references to more proper f->file.
8106
8107         * som-high.c: (som_submit_table) Special classes use their own
8108         renderers.
8109
8110         * som.h: Comment fixes.
8111
8112         * temporary.c: (new_dictionary) Don't try to xstrdup() a NULL
8113         string.
8114         
8115 Tue Dec  2 14:36:07 1997  Ben Pfaff  <blp@gnu.org>
8116
8117         * Makefile.am: (fiasco_SOURCES) Add aggregate.c back in.
8118
8119         * aggregate.c: Still working on this.
8120
8121         * command.c: (cmd_table[]) Add AGGREGATE back in.
8122         (split_words) Make '-' a legal word separator as well as ' '.
8123
8124         * main.c: Comment fixes.
8125
8126         * q2c.c: (dump_parser) Don't require the procedure's full name to
8127         be present, in the generated source.
8128
8129         * t-test.q: Change name to `t-test' from `t test'.  Let PAIRS be
8130         multiply specified and let it be default; let MISSING, CRITERIA,
8131         FORMAT be multiply specified.
8132         (cmd_t_test) Parse command name.  [DEBUGGING] Call debug_print().
8133         (custom_groups) Fix defaults.
8134         (custom_pairs) Check whether this is a PAIRS subcommand before
8135         attempting to parse.  Better garbage collection.  Proper storage
8136         allocation.
8137         [DEBUGGING] (debug_print) New function.
8138
8139         * temporary.c: Comment fixes.
8140         (copy_variable) Don't copy variable name and index.
8141         (save_dictionary) Copy variable name and index by hand.
8142
8143         * vars-atr.c: Comment fixes.
8144         (create_variable) New dictionary argument.  All references
8145         changed.
8146         (common_init_stuff) New dictionary argument.  All references
8147         changed.
8148         (init_variable) New dictionary argument.  All references changed.
8149         (dup_variable) New function.
8150
8151         * vars-prs.c: (parse_variables) If there are any errors, we always
8152         return 0.  Previously, it was possible for some types of errors to
8153         be ignored.
8154         
8155 Sat Nov 22 01:20:59 1997  Ben Pfaff  <blp@gnu.org>
8156
8157         * Makefile.am: (fiasco_SOURCES) For 0.1.5 release, remove
8158         aggregate.c.
8159
8160         * command.c: (cmd_table[]) Comment out AGGREGATE; add T TEST.
8161
8162         * list.q, t-test.q: Remove ALL option from VARLIST declaration in
8163         grammar rules.
8164
8165         * q2c.c: Comment fixes.
8166         (SBC_* enums) Remove SBC_VARLIST_ALL; all references removed.
8167         
8168         * t-test.q: (cmd_list) Rename cmd_t_test.
8169
8170         * temporary.c: (new_dictionary) Don't declare as static.
8171         
8172 Fri Nov 21 00:03:06 1997  Ben Pfaff  <blp@gnu.org>
8173
8174         * aggregate.c: Changes, still not finished.
8175
8176         * file-handle.q, frequencies.q, list.q, set.q: Comment fixes.
8177
8178         * q2c.c: Comment fixes.  Now its output is internationalized.
8179         (get_token) Fix parsing of escapes within literal strings.
8180         (main) Fix bad #line directives in output.
8181
8182         * t-test.q: Base implementation.
8183
8184         * temporary.c: (new_dictionary) New function.
8185         (restore_dictionary) [__CHECKER__] Change fill character to *
8186         (from @).
8187         
8188 Sun Nov 16 01:29:57 1997  Ben Pfaff  <blp@gnu.org>
8189
8190         * Makefile.am: (BUILT_SOURCES, fiasco_SOURCES) Add t-test.c
8191
8192         * aggregate.c: Changes, still not finished.
8193
8194         * descript.q, list.q: Comment fixes.
8195
8196         * q2c.c: Almost completely rewritten.
8197
8198         * t-test.q: New file, not complete.
8199
8200 Fri Nov 14 00:14:48 1997  Ben Pfaff  <blp@gnu.org>
8201
8202         * aggregate.c: Changes, still not finished.
8203
8204         * sort.c: (sort_cases) Call cancel_temporary() instead of doing it
8205         by hand.
8206
8207         * temporary.c: (cancel_temporary) New function.
8208
8209         * vars-atr.c: (discard_variables) Call cancel_temporary() instead
8210         of doing it by hand.
8211
8212         * vfm.c: (close_active_file) After restoring a TEMPORARY
8213         dictionary, set temp_dict to NULL.  Cancel TEMPORARY through
8214         cancel_temporary().
8215         (SPLIT_FILE_procfunc) Comment fix.
8216
8217 Tue Oct 28 16:08:45 1997  Ben Pfaff  <blp@gnu.org>
8218
8219         * Makefile.am: (fiasco_SOURCES) Add aggregate.c.
8220
8221         * aggregate.c: New file, not finished yet.
8222
8223         * command.c: (cmd_table) Add AGGREGATE.
8224
8225         * common.h: (pgm_state) Move declaration to var.h.
8226
8227         * lexer.c: (bin_value_func, oct_value_func, hex_value_func) i18n
8228         fixes.
8229         (parse_string) Message fix.
8230
8231         * recode.c: Comment fix.
8232
8233         * sfm-read.c: (read_variables) Code esthetic fixes.
8234         (write_header) Default date is `Jan', not `JAN'.
8235
8236         * sfmP.h: (bswap_int32) [!__linux__] Fix off-by-one errors.
8237
8238         * sort.c: (cmd_sort_cases) Farm the work out to new function
8239         parse_sort_variables().
8240         (parse_sort_variables) New function.
8241         (sort_cases) New function.  Cancels temporary transformations,
8242         which sorting didn't do previously.
8243         (cmd_sort_cases) Better garbage collection on error.  Uses
8244         do_external_sort().
8245         (write_initial_runs, merge_once) Improved code esthetics.
8246         (sort_stream_read) Reduced to one call to read_output_cases().
8247         (read_output_cases) New function.
8248
8249         * var-labs.c: (cmd_variable_labels) Re-enabled truncation of
8250         variable labels to 120 characters.
8251
8252         * var.h: Comment fixes.
8253         (glob var pgm_state) From common.h.
8254
8255         * vars-atr.c: (discard_variables) Set pgm_state to STATE_INIT.
8256
8257         * vars-prs.c: (parse_DATA_LIST_vars) Support PV_SINGLE in
8258         options.  Set *names to NULL on error.
8259
8260         * vfm.c: (memory_stream_init) Assert compaction_nval != 0.
8261
8262 Thu Oct  9 09:59:49 1997  Ben Pfaff  <blp@gnu.org>
8263
8264         * sfm-write.c, vfm.c: [HAVE_UNISTD] #include <unistd.h>, needed by
8265         SunOS4.  From Alexandre Oliva <oliva@dcc.unicamp.br>.
8266
8267 Wed Oct  8 18:55:24 1997  Ben Pfaff  <blp@gnu.org>
8268
8269         * vfm.c: (page_to_disk) Added missing local variables.
8270
8271 Tue Oct  7 20:23:17 1997  Ben Pfaff  <blp@gnu.org>
8272
8273         * get.c: Comment fix.
8274
8275         * sort.c: (cmd_sort_cases) Attempt to perform internal sort if the
8276         source is anything other than a disk stream, not just if it's in a
8277         memory stream.  Call page_to_disk() before external sort.
8278         (allocate_cases) Message fix.
8279
8280         * vfm.c: (prepare_for_writing) Warn user when paging workspace to
8281         disk.
8282         (page_to_disk) New function.
8283
8284 Sun Oct  5 15:56:14 1997  Ben Pfaff  <blp@gnu.org>
8285
8286         * Makefile.am: (INCLUDES) Include .. instead of $(top_srcdir).
8287
8288         * common.h: (macro strerror) Remove.  From Alexandre Oliva
8289         <oliva@dcc.unicamp.br>.
8290
8291         * get.c: (dict_delete_run) The number of variables to delete is
8292         not necessarily the number of variables that need to be shifted
8293         up.
8294         (trim_dictionary) Don't set *options to 0.  Fix bug that caused
8295         too many variables to be deleted.
8296
8297         * postscript.c: Comment fix.
8298
8299         * q2c.c: Include strerror.c.  From Alexandre Oliva
8300         <oliva@dcc.unicamp.br>.
8301
8302         * set.q: #undef ON and OFF.  From Alexandre Oliva
8303         <oliva@dcc.unicamp.br>.
8304
8305         * sfm-read.c: (sfm_read_dictionary) Don't set the file class too
8306         early, otherwise errors cause a bad free().
8307
8308         * str.h: (macro nvsprintf) s/FORMATS/FORMAT/ typo.  From Alexandre
8309         Oliva <oliva@dcc.unicamp.br>.
8310
8311         * temporary.c: (save_dictionary) Don't allocate memory if
8312         n_documents is 0.
8313
8314         * vfm.c: (memory_stream_write) Message fix.
8315
8316 Sat Oct  4 16:20:43 1997  Ben Pfaff  <blp@gnu.org>
8317
8318         * command.c: (static var cmd_table[]) Define REPEATING DATA
8319         command.
8320
8321         * common.h: Added support for broken systems that are missing
8322         EXIT_SUCCESS, EXIT_FAILURE, RAND_MAX, and/or strerror().
8323
8324         * Many source files: Replace syntax error messages via msg() with
8325         call to syntax_error().
8326
8327         * data-list.c: (dump_fixed_table) Add support for dumping table
8328         for REPEATING DATA as well as DATA LIST FIXED.
8329         (cmd_repeating_data) Allows and requires `/' between subcommands.
8330         Does proper thing with allowing rpd.starts_end to stay 0.  Allows
8331         CONTINUED specifications to be omitted.  Forces CONTINUED to be
8332         specified if ID is.  Calculates starts_end, cont_end from logical
8333         record length as reported by fhp.  Calls dump_fixed_table() if
8334         requested.  Fixed length of record copied by memcpy.
8335         (parse_num_or_var) Sets `num' to 0, not NOT_INT, for variables.
8336         Message fix.
8337         (realize_value) Returns sensible value for out-of-range variable
8338         values.
8339         (rpd_parse_record) New argument `ofs'.  Fixed confusion between
8340         length of occurrences and length of line.  Added warning for
8341         fields that exceed the line length.  Fixed infinite loop.
8342         (read_one_set_of_repetitions) Numerous minor changes for more
8343         complete SPSS compliance.  Message fixes.
8344
8345         * dfm.c: (dfm_close) If the file being closed is the inline file,
8346         read all the remaining data before closing it.
8347         (dfm_get_record) Don't close the file on lossage, as either it
8348         has been closed already or it doesn't belong to us.
8349
8350         * error.c: (puts_stdout) New function.
8351         (vmsg) Use puts_stdout instead of puts.
8352
8353         * file-handle.q: (fh_record_width) New function.
8354
8355         * inpt-pgm.c: (init_case) Fixed buffer overrun when inp_nval % 4
8356         == 0.
8357         (clear_case) Ditto.
8358         (input_program_source_read) Made an old kluge an approved method.
8359
8360         * lexer.c: (syntax_error) New function.
8361
8362         * misc.c: [BROKEN_RAND] (ansi_rand, ansi_srand; static var next)
8363         New.
8364
8365         * output.c: (oupt_get_paper_size) Message fix.
8366
8367         * q2c.c: Numerous fixes to formatting of generated code made to
8368         conform to GNU coding standards.  Uses syntax_error() in generated
8369         code.  Other miscellaneous generated message fixes.  Added support
8370         for broken systems that are missing EXIT_SUCCESS, EXIT_FAILURE,
8371         RAND_MAX, and/or strerror().
8372
8373 Sat Oct  4 02:09:56 1997  Ben Pfaff  <blp@gnu.org>
8374
8375         * data-in.c: Comment fixes.
8376
8377         * data-list.c: (struct repeating_data_trns) New member `id_spec'.
8378         (find_variable_input_spec) New function.
8379         (cmd_repeating_data) Initializes id_spec.
8380         (rpd_parse_record) Implemented.
8381         (read_one_set_of_repetitions) Returns -3 by default in order to
8382         kluge out some potential bugs.
8383
8384         * data-out.c: Comment fixes.
8385
8386         * file-type.c: (internal_cmd_record_type) Message fix.
8387
8388         * inpt-pgm.c: (input_program_source_read) Special temporary kluge
8389         for handling -3 return value.
8390
8391 Sat Sep 20 23:58:15 1997  Ben Pfaff  <blp@gnu.org>
8392
8393         * data-list.c: Comment fixes.
8394         (struct dls_var_spec) Reordered members.
8395         (read_from_data_list_fixed) Restructured.
8396         (struct repeating_data_trns) Reordered members.  Renamed `starts'
8397         as `starts_beg', `ends' as `starts_end'.
8398         (cmd_repeating_data) Calculates length of repeated data if
8399         necessary and possible.
8400         (parse_num_or_var) Don't allow string variables.
8401         (realize_value) New function.
8402         (rpd_msg) New function.
8403         (rpd_parse_record) New function.  Currently stubbed out.
8404         (read_one_set_of_repetitions) Implemented.
8405
8406         * inpt-pgm.c: (input_program_source_read) Comment fix.
8407
8408 Thu Sep 18 21:34:57 1997  Ben Pfaff  <blp@gnu.org>
8409
8410         * command.c: (cmd_end_repeat_p) Removed.
8411         (init_cmd_parser) Doesn't set cmd_end_repeat_p.
8412         (parse_cmd_name) Removed.
8413
8414         * data-list.c: Comment fixes.
8415         (data_list_pgm) Removed `eof' member.
8416         (static var first) New var.
8417         (cmd_data_list) Sets `first'.  Ensures that DATA LIST uses the
8418         FILE TYPE file inside FILE TYPE structures.
8419         (append_var_spec) Appends to *first, not dls.spec.
8420         (parse_fixed) Message fixes.
8421         (struct rpd_num_or_var) New.
8422         (struct repeating_data_trns) New.
8423         (static var rpd) New.
8424         (cmd_repeating_data) New function.
8425         (parse_num_or_var) New function.
8426         (parse_repeating_data) New function.
8427         (read_one_set_of_repetitions) New function.
8428
8429         * file-type.c: (cmd_file_type) Message fixes.  Always
8430         default_handle to FILE TYPE file handle.
8431         (internal_cmd_record_type) Message fixes.
8432
8433 Wed Aug 20 14:22:03 1997  Ben Pfaff  <blp@gnu.org>
8434
8435         * repeat.c: Comment fix.  Disable debugging.
8436
8437         * temporary.c: (restore_dictionary) Sets splits to NULL and
8438         n_splits to 0 before destroying the variables because now doing
8439         this tries to remove split variables.
8440
8441         * vars-atr.c: (discard_variables) Asserts that n_splits is 0 after
8442         destroying the dictionary.
8443         (clear_variable) Removes a variable from splits after destroying
8444         it.
8445
8446 Mon Aug 18 18:06:55 1997  Ben Pfaff  <blp@gnu.org>
8447
8448         * cmdline.c: (set_compat) Removed.
8449         (pick_compat) Removed.
8450         (parse_command_line) Removed -c option.
8451         (pre_syntax_message) Removed -c option.
8452         (usage) Remove compatibility code.
8453
8454         * common.h: (macros VER_PC, VER_WND, VER_X) Removed.
8455         (glob var compat) Removed.
8456
8457         * compute.c: (type_check) Fixed messages about type mismatches.
8458
8459         * data-list.c: (cmd_data_list) Removed compatibility code.
8460         (fixed_parse_compatible) Calls convert_negative_to_dash().
8461         Fixed bug where it only set the variable in fx.spec if it created
8462         the variable itself.
8463         (dump_fmt_list) Spelling fix.
8464         (cut_field) Removed compatibility code.
8465
8466         * dfm.c: (cmd_begin_data) Don't require a command terminator on
8467         BEGIN DATA command.
8468
8469         * expr-evl.c: (evaluate_expression) Implement LAG.
8470
8471         * expr-prs.c: (parse_add) Calls convert_negative_to_dash().
8472         (parse_neg) Calls convert_negative_to_dash().
8473         (LAG_func) Increases n_lag to the lag requested.  Fixed assignment
8474         bug.
8475
8476         * expr.h: (struct expression_struct) Removed member max_lag.
8477
8478         * file-type.c: (parse_col_spec) Calls convert_negative_to_dash().
8479         (internal_cmd_record_type) Removed special handling to produce
8480         negative numbers from dash tokens.
8481
8482         * getline.c: (static var DO_REPEAT_level) New var.
8483         (getl_add_DO_REPEAT_file) Increments DO_REPEAT_level.
8484         (handle_line_buffer) Copies the line into getl_buf; doesn't call
8485         copy_with_DO_REPEAT_substitutions().
8486         (getl_read_line) Maintains value of getl_mode.  Calls
8487         perform_DO_REPEAT_substitutions() whenever DO_REPEAT_level is
8488         positive.
8489         (getl_close_file) Decrements DO_REPEAT_level when appropriate.
8490
8491         * getline.h: (getl_mode) New glob var.
8492
8493         * glob.c: Comment fixes.
8494         (init_glob) Restructured.  Sets set_seed.
8495         (init_compat_dependent) Removed.  All references removed.
8496         (get_date) Format changed from MM/DD/YY to DD MMM YYYY.
8497         (__htonl, __htons) Removed.  (What were these for?)
8498
8499         * lexer.c: (static var tbl) Dash set to class CNUM.
8500         (make_hexit) New function from data-out.c.
8501         (get_token_representation) Rewritten.
8502         (convert_negative_to_dash) New function.
8503         (lex_init_compat_dependent) Removed.
8504         (yylex) A dash is parsed as part of a number if it is followed by
8505         a digit.  The ASCII representation of a number is copied to
8506         tokstr.  String parsing farmed out to parse_string().  Comment
8507         fixes.
8508         (bin_value_func, oct_value_func, hex_value_func, parse_string) New
8509         functions.
8510         (preprocess_line) Line processing depends on interactive/batch
8511         mode, not on compatibility mode.  Removed PC+ compatibility code.
8512
8513         * loop.c: (loop_3_trns_proc) Comment fix.
8514
8515         * main.c: Remove dead code.
8516         (main) Remove call to init_compat_dependent().
8517
8518         * misc.c: (convert_fmt_ItoO) Make E format conversion more
8519         conformant.
8520
8521         * print.c: (parse_string_argument) Calls
8522         convert_negative_to_dash().
8523         (fixed_parse_compatible) Calls convert_negative_to_dash().
8524
8525         * repeat.c: (RPT_* defines) Removed.
8526         (struct rpt_numeric) Removed.
8527         (struct repeat_entry) New member type, changed `replacement' from
8528         char * to char **.
8529         (clean_up) Deallocation adapted to new repeat_entry.
8530         (internal_cmd_do_repeat) `type' defaults to 0.  Remove lookahead()
8531         usage.  Creates vars for `type' of 1.
8532         (parse_ids) Sets type of 1.  Adapted to new repeat_entry.
8533         (store_numeric) Rewritten, new interface.
8534         (parse_numbers) Rewritten.
8535         (parse_strings) Rewritten.
8536         (find_DO_REPEAT_substitution) New function.
8537         (perform_DO_REPEAT_substitutions) New function.
8538         (copy_with_DO_REPEAT_substitutions) Removed.
8539         (debug_print) Rewritten.
8540
8541         * set.q: Comment fix.
8542         (custom_results) Removed compatibility code.
8543         (internal_cmd_set) Removed SET EMULATION subcommand.  Removed
8544         compatibility code.
8545
8546         * sysfile-info.c: (cmd_display) Removed compatibility code.
8547
8548         * tokens.h: Comment fixes.
8549         (token types enum) Removed `toktype' typedef name for this int
8550         type.  Removed SUBST.  Restructured.
8551
8552         * vars-atr.c: (discard_variables) Sets n_lag to 0.
8553
8554         * vars-prs.c: Comment fix.
8555
8556         * vfm.c: Comment fixes.
8557         (glob var n_lag) New var.
8558         (static vars lag_count, lag_head, lag_queue) New vars.
8559         (procedure) Removed argument nlag.
8560         (setup_lag) New function.
8561         (close_active_file) Discards lagging state.
8562         (lag_case) New function.
8563         (lagged_case) New function.
8564         (write_case) Lags a case if lagging.
8565
8566         * weight.c: (cmd_weight) Removed compatibility code.
8567         
8568 Sun Aug 17 22:34:40 1997  Ben Pfaff  <blp@gnu.org>
8569
8570         * getline.h: (struct getl_script) New members loop_index, macros.
8571
8572         * getline.c: (getl_add_file) Sets first_line field to NULL.
8573         (getl_add_DO_REPEAT_file) New function.
8574         (handle_line_buffer) When the current line's length is negative,
8575         set the filename and line number.  Increment line number after
8576         reading line.  Pass the line to
8577         copy_with_DO_REPEAT_substitutions() for processing.
8578         (getl_close_file) Free DO REPEAT lines before freeing the
8579         filename, and just set the filename to NULL when doing this,
8580         because otherwise the filename gets freed twice.
8581
8582         * glob.c: (glob var queuing) Removed.  All references removed.
8583
8584         * lexer.c: Comment fixes.
8585         (get_token_representation) New function.
8586
8587         * repeat.c: Comment fixes.
8588         (struct repeat_entry) Replaced type and v union members with a
8589         simple string.
8590         (append_record) New function.
8591         (internal_cmd_do_repeat) Started reforming it for the new
8592         repeat_entry struct.  Properly records filename changes in the
8593         getl_line_buf.  Fixed improper use of = for ==.  Fixed sense of
8594         strncasecmp() result usage.  Uses append_record() to simplify.
8595         Properly discards END REPEAT line.  Calls getl_add_DO_REPEAT_file
8596         to add in the file.
8597
8598         (copy_with_DO_REPEAT_substitutions) Started coding.
8599
8600         [DEBUGGING] (debug_print_lines) New function.
8601
8602         * set.q: (custom_results, internal_cmd_set) s/VER_PCP40/VER_PC/;
8603
8604         * tokens.h: (macro is_id1, is_idn) New macros.
8605
8606 Sat Aug 16 10:57:41 1997  Ben Pfaff  <blp@gnu.org>
8607
8608         * cmdline.c: (static var pre_syntax_message) Changed `win'
8609         compatibility mode to `wnd'.
8610
8611         * data-list.c: (fixed_parse_spss) Renamed
8612         fixed_parse_compatible().
8613
8614         * glob.c: (init_glob) Excise unused code for
8615         program_invocation_short_name.
8616
8617         * lexer.c: (preprocess_line) Leading indentors are ignored in Wnd
8618         as well as in X.
8619
8620         * print.c: (fixed_parse_spss) Renamed fixed_parse_compatible().
8621
8622         * set.q: `win' compatibility renamed `wnd'.
8623
8624 Thu Aug 14 22:11:12 1997  Ben Pfaff  <blp@gnu.org>
8625
8626         * filename.c: [__WIN32__] Change the included Windows header files
8627         (again).
8628         (absolute_filename_p) [__MSDOS__] A filename with a colon as the
8629         second character is absolute.
8630         (dirname) Fix logic error.  Don't printf() the results.
8631         (prepend_dir) Don't printf() the results.
8632
8633         * getline.c: (handle_line_buffer) New function.
8634         (getl_read_line) Reads line with handle_line_buffer() when
8635         appropriate.
8636         (getl_close_file) Discard line buffer data.
8637
8638         * getline.h: Comment fixes.
8639         (struct getl_line_list) New struct.
8640         (getl_script_struct) Added line buffer members.  These are hooks
8641         for use by DO REPEAT to allow it to insert virtual source code
8642         into the program.
8643
8644         * glob.c: (init_glob) [__DJGPP__ || (__WIN32__ && __BORLANDC__)]
8645         Override Borland C++ stupidity that claims Windows has a console
8646         window size of 0x3.
8647
8648         * repeat.c: This is in the process of being restructured from
8649         using a token-buffering approach to the DO REPEAT facility to
8650         using the more flexible approach of a line-buffering approach in
8651         conjunction with the getline module.  Comment fixes.
8652         (struct tok_struct) Removed.
8653         (static vars queue_index, queue_head, queue) Removed.
8654         (static vars line_buf_head, line_buf_tail) New vars.
8655         (internal_cmd_do_repeat) Instead of queuing tokens, queue lines.
8656         Not complete.
8657         (pull_queue, destroy_queue) Removed.
8658         [DEBUGGING] (debug_print_tokens) Removed.
8659
8660 Tue Aug  5 13:57:58 1997  Ben Pfaff  <blp@gnu.org>
8661
8662         * file-handle.q: (prepend_current_directory) New function.
8663         (internal_cmd_file_handle, fh_get_handle_by_filename) Prepends
8664         current directory before normalizing filename.
8665
8666         * filename.c: (gnu_getcwd) New function.
8667         (absolute_filename_p) New function.
8668         (search_path) New argument, PREPEND.  All references changed to
8669         pass NULL except those explicitly mentioned.  Uses
8670         absolute_filename_p().  Prepends PREPEND before trying the
8671         filename.
8672         (dirname, prepend_dir) New functions.
8673
8674         * getline.c: (getl_get_current_directory) New function.
8675         (getl_include) Passes getl_get_current_directory() as PREPEND arg
8676         to search_path().
8677                 
8678 Sun Aug  3 11:42:36 1997  Ben Pfaff  <blp@gnu.org>
8679
8680         * In several source files, the term `script' was replaced with
8681         `syntax file' inside error messages.  Usage of the term `script'
8682         in the sense of a syntax file is now deprecated.
8683
8684         * cmdline.c: (static vars pre_syntax_message, post_syntax_message)
8685         Updated messages.
8686
8687         * dump-sysfile.c: (usage) Update message.
8688
8689         * getline.c: (getl_read_line) Ignore lines beginning with `#!'.
8690
8691         * getline.h: (glob var getl_include_path) Declare extern.
8692
8693         * list.q: Define EXTERN as extern before #including somP.h.
8694
8695         * var.h: Remove declaration of `disptype' variable.
8696
8697         * vfm.c: (close_active_file) After switching the data sink to a
8698         data source, set vfm_sink to NULL, because it doesn't exist any
8699         more.
8700
8701 Thu Jul 17 21:41:44 1997  Ben Pfaff  <blp@gnu.org>
8702
8703         * glob.c: [__BORLANDC__] Include math.h.  Define _matherr() and
8704         _matherrl() to ignore all math errors.
8705
8706         * sfm-read.c: (read_value_labels) When reading the labels from
8707         disk, read the little parts separately instead of as a struct;
8708         this avoids alignment problems.
8709
8710         * sfm-write.c: (struct sfm_fhuser_ext) New member `elem_type'.
8711         (sfm_write_dictionary) Sets elem_type and frees it on lossage.
8712         (write_header) Allocates and initializes elem_type.
8713         (sfm_write_case) Uses elem_type to determine how to handle each
8714         flt64 element.
8715         (sfm_close) Frees elem_type.
8716
8717         * sfmP.h: Comment fix.
8718         [__BORLANDC__] Uses #pragma -a to adjust structure member
8719         alignment.
8720         
8721 Thu Jul 17 01:55:12 1997  Ben Pfaff  <blp@gnu.org>
8722
8723         * Makefile.am: (fiasco_SOURCES) Remove display.c.
8724
8725         * common.c: Fix typo.
8726
8727         * dfm.c: (read_record) Remove strncasecmp() emulation and fix the
8728         sense of the condition.
8729
8730         * expr-evl.c: (macro ALLOC_STRING_SPACE) [!PAGED_STACK] Add
8731         line-continuation backslash.
8732
8733         * filename.c: [__WIN32__] Include <windef.h> before <winbase.h>.
8734
8735         * frequencies.q: (custom_grouped, add_percentile) Don't use a
8736         non-constant expression as an argument to sizeof.
8737
8738         * glob.c: [__WIN32__ && __BORLANDC__] When including <conio.h>,
8739         undefine gettext macro because that's a conio function.
8740
8741         * hash.h: (hsh_prime_tab declaration) Remove.
8742
8743         * list.q: (write_fallback_headers) Move `leader' allocation out of
8744         main loop.  Change to local_alloc() allocation.
8745
8746         * output.h: Formatting fixes.  Put __attribute__ in right place on
8747         function prototypes.
8748
8749         * sfm-read.c: (read_machine_flt64_info, read_variables) Change
8750         incorrect `SECOND_LOWEST_VALUE' references to proper
8751         `second_lowest_value'.
8752
8753         * som-frnt.c: (EXTERN macro) Define as `extern' instead of null
8754         value.  This way 2 out of 3 of the som files define the vars
8755         extern, the correct way, that actually works under BC++.
8756         (som_set_float) Don't use nonconstant initializers for a struct.
8757
8758         * som-high.c: Add the standard alloca() header.
8759         (replicate_table) Add prototype.
8760
8761         Merged DISPLAY routine.
8762         * sysfile-info.c: (AS_*) New enum series.
8763         (cmd_sysfile_info) Gutted.  Calls describe_variable() to do the
8764         dirty work.
8765         (cmd_display, display_macros, display_documents,
8766         display_variables) Stolen from defunct display.c.
8767         (describe_variable) New function.
8768
8769         * temporary.c: [0] (display_tree) New debug function.
8770         (copy_variable) Performs shallow copy of value labels instead of
8771         deep copy; i.e., just copys the AVL tree and increments the
8772         reference counts.
8773
8774         * val-labs.c: Comment fixes.
8775         (do_value_labels) Optionally skip leading forward slash.
8776         (get_label) Creates only a single value label instead of many
8777         copies of one, and sets the reference count.
8778
8779         * display.c: Removed.
8780
8781         * dump-sysfile.c: New file, not yet complete.
8782
8783 Fri Jul 11 23:02:18 1997  Ben Pfaff  <blp@gnu.org>
8784
8785         For lots of source files I added more verbose_msg's.  These aren't
8786         listed below as they have tested as being benign.  In some cases
8787         these replaced debug_printf() calls.
8788
8789         * output.c: (outp_read_devices) Message fix.
8790
8791         * postscript.c: (output_encodings) Message fix.  Reports errors on
8792         fclose().
8793         (postopen) Message fix.
8794         
8795 Fri Jul 11 14:09:40 1997  Ben Pfaff  <blp@gnu.org>
8796
8797         * dfm.c: (dfm_close) Don't call fclose() for a NULL FILE.
8798
8799         * filename.c: (close_file_ext) Set f->file to NULL *after* closing
8800         it.
8801
8802         * main.c: Remove <malloc.h> #include.
8803
8804         * mis-val.c: (parse_numeric) Set .f member for each missing[]
8805         instead of trying to just set the missing[] itself, which is a
8806         gcc-specific idiom.
8807
8808         * sfm-read.c: (read_variables) Same.
8809
8810         * str.h: Add memmem() prototype.
8811
8812         * val-labs.c, var-labs.c: Replace <malloc.h> with <stdlib.h>.
8813
8814 Thu Jul 10 22:13:53 1997  Ben Pfaff  <blp@gnu.org>
8815
8816         * Makefile.am: (q2c) Don't include any libraries in the link.
8817
8818         * dfm.c: (force_line_buffer_extension) New macro.
8819         (count_tabs) New function.
8820         (tabs_To_spaces) New function.
8821         (read_record) Calls tabs_to_spaces() on the line being processed.
8822
8823         * q2c.c: Disabled i18n for this proglet so that libintl.a doesn't
8824         have to be compiled twice (once for CC, once for LOCAL_CC).
8825  
8826 Sun Jul  6 19:14:33 1997  Ben Pfaff  <blp@gnu.org>
8827
8828         * Makefile.am: (INCLUDES) Add intl directory; fix directories.
8829         (LDADD) Add @INTLLIBS@.
8830         (q2c) Add LIBS, @INTLLIBS@ to link step.
8831
8832         * inpt-pgm.c: Turn off debugging.
8833
8834         * postscript.c: (postopen) Format fix.  local_free() blocks
8835         returned by local_alloc(); don't free() them.
8836
8837 Sat Jul  5 23:44:51 1997  Ben Pfaff  <blp@gnu.org>
8838
8839         * data-in.c: (parse_string_as_format) Comment fix.  Fix check for
8840         string length.
8841
8842         * data-list.c: (read_from_data_list_fixed) Pass proper value for
8843         LEN arg, not simply the full string length.
8844
8845         * sort.c: (allocate_file_handles) Check SPSS compatible temp file
8846         directories before generic temp file directories.
8847
8848         * vfm.c: Disable debugging.
8849
8850 Fri Jul  4 13:26:41 1997  Ben Pfaff  <blp@gnu.org>
8851
8852         * get.c: Comment fix.
8853         (cmd_save_internal) Always passes GTSV_OPT_SAVE option.
8854
8855 Wed Jun 25 22:52:28 1997  Ben Pfaff  <blp@gnu.org>
8856
8857         * expr-prs.c: (debug_print_postfix) Conditionally included on
8858         GLOBAL_DEBUGGING.  Removed out_header() reference.
8859
8860         * exprP.h: Removed #undef GLOBAL_DEBUGGING.
8861
8862 Sun Jun 22 22:00:28 1997  Ben Pfaff  <blp@gnu.org>
8863
8864         * ascii.c: Removed obsolete ascii_close_page() prototype.
8865
8866         * command.c: (output_line) Comment fix.
8867
8868         * data-in.c: Formatting fix.
8869         (parse_string_as_format) Now the `fc' argument is used only for
8870         the purpose of error messages; it is not an index into the string
8871         passed.  All references changed.
8872
8873         * data-list.c: Comment fix.
8874         (cut_field) Comment fix.  Now returns the column number of the
8875         position of the field cut out on success.
8876         (parse_field) Added `column' argument.  Puts the column numbers in
8877         the error message.
8878         (read_from_data_list_free, read_from_data_list_list) Record the
8879         column number returned by cut_field(), pass it to parse_field().
8880
8881         * dfm.c: Comment fix.
8882
8883         * do-ifP.h: Comment fix.
8884
8885         * expr-prs.c: (SYSMIS_func) Implemented string-type arguments for
8886         the SYSMIS function.
8887
8888         * expr.h, exprP.h: Comment fix.
8889
8890         * glob.c: (init_glob) Only calls setlocale() and family if
8891         ENABLE_NLS set.
8892
8893         * hash.h: Comment fix.
8894
8895         * include.c: Comment fix.
8896
8897         * output.c: Comment fix.
8898
8899         * postscript.c: (ps_line_intersection) Simplified assertion.
8900
8901         * repeat.c: Comment fix.
8902
8903         * vars-atr.c: Comment fix.
8904
8905         * vars-prs.c: Comment fix.
8906
8907         * vfm.c: (vector_initialization) [DEBUGGING] Fixed undefined
8908         behavior with usage of postincrement.
8909         (memory_stream_read) Discards cases as it goes. 
8910
8911 Sun Jun 15 16:45:17 1997  Ben Pfaff  <blp@gnu.org>
8912
8913         * Makefile.am: Cleans q2c, not just distcleans it.  Distcleans
8914         foo.
8915
8916         * Most source files: Includes debug-print.h, related comment
8917         fixes.
8918
8919         * cases.c: (alloc_val) Removed complex allocation code.  Merely
8920         increments default_dict.nval and returns the former value.
8921         (envector, devector) Removed references to lv member of struct
8922         variable.
8923
8924         * common.h: (macro VME) Replaced complex definition with simple
8925         one.
8926
8927         * data-list.c: (cmd_data_list) Sets vfm_source instead of
8928         read_active_file and cancel_input_pgm.
8929         (read_from_data_list, cancel_data_list) Removed.
8930         (data_list_source_read, data_list_source_destroy_source) New
8931         functions.
8932         (glob var data_list_source) New var.
8933
8934         * dfm.c: (open_file_r, open_file_w) Simplified debug output.
8935         (cmd_begin_data) Improved criteria for an input program accessing
8936         the inline file.  Still not perfect.
8937
8938         * do-if.c: (do_if_trns_proc) Simplified debug output.
8939
8940         * expr-prs.c: Comment fixes.
8941         [DEBUGGING] (debug_print_postfix) Simplified debug output.
8942
8943         * file-handle.q: (fh_close_handle) Simplified debug output.
8944
8945         * file-type.c: Comment fixes.
8946         (cmd_file_type) Sets vfm_source instead of read_active_file and
8947         cancel_input_pgm.
8948         (cmd_end_file_type) On failure, discards variables in place of
8949         just canceling the input program.
8950         (read_from_file_type) Renamed file_type_source_read.
8951         (cancel_file_type) Renamed file_type_source_destroy_source.
8952         (glob var file_type_source) New var.
8953
8954         * get.c: (GTSV_* enum series) New enums GTSV_OPT_SAVE, GTSV_NONE.
8955         (cmd_get) Initializes options to GTSV_NONE before passing to
8956         trim_dictionary().  Removed `lv' reference.  Sets vfm_source
8957         instead of read_active_file and cancel_input_pgm.
8958         (cmd_save_internal) Initializes options before passing to
8959         trim_dictionary().  Local var `nval' removed.
8960         (dict_delete_run) Comment fixes.
8961         (trim_dictionary) Comment fixes.  Disallows scratch variables if
8962         GTSV_OPT_SAVE set in options.
8963         (read_from_get) Renamed get_source_read.
8964         (cancel_get) Renamed get_source_destroy_source.
8965         (glob var get_source) New var.
8966
8967         * inpt-pgm.c: (cmd_input_program) Sets vfm_source instead of
8968         read_active_file and cancel_input_pgm.
8969         (read_from_input_program) Renamed input_program_source_read.
8970         Simplified debug output.
8971         (cancel_input_program) Renamed
8972         input_program_source_destroy_source.
8973         (glob var input_program_source) New var.
8974
8975         * loop.c: (loop_1_trns_proc) Simplified debug output.
8976
8977         * main.c: (dump_token) Made eof output more explicit.
8978
8979         * sfm-read.c: (read_variables, dump_dictionary) Removed `lv'
8980         references.
8981
8982         * sort.c: (cmd_sort_cases) Disallows scratch variables.  Removed
8983         code for always-memory or always-disk cases.  malloc's case-list
8984         based on vfm_source_info.ncases.  Explicit support for
8985         memory_stream via memory_source_cases.
8986         (do_external_sort) Sets vfm_source instead of read_active_file and
8987         cancel_input_pgm.
8988         (allocate_file_handles) The temporary directory permissions are
8989         set to 0700 instead of 0777.
8990         (allocate_cases) Formatting fixes.  Simplified debug output.
8991         (output_record) Compacts the case if necessary before writing it
8992         out.
8993         (close_handle, open_handle_w) Simplified debug output.
8994         (write_initial_runs) Destroys vfm_sink, then sets it to
8995         sort_stream.  Writes records to memory based on
8996         vfm_sink_info.case_size.
8997         (write_to_sort_cases) Renamed sort_stream_write().
8998         (merge) Simplified error handling.  Simplified debug output.
8999         Formatting fixes.
9000         (read_from_external_sort) Renamed sort_stream_read().
9001         Reads records based on vfm_source_info.case_size.
9002         (sort_stream_write) Writes records to memory based on
9003         vfm_sink_info.case_size.
9004         (sort_stream_mode) New function.
9005         (glob var sort_stream) New variable.
9006
9007         * temporary.c: (cmd_temporary) Simplified debug output.
9008         (copy_variable) Removed references to `lv'.
9009
9010         * title.c: (get_title) Simplified debug output.
9011
9012         * var.h: Comment fixes.
9013         (struct get_proc) Removed member `lv'.
9014         (struct variable) Removed member `lv'.  Comment fixes.
9015         (glob vars read_active_file, write_active_file, cancel_input_pgm)
9016         Removed.
9017         (struct case_stream) New.
9018
9019         * vars-atr.c: (discard_variables) Changed cancel_input_pgm,
9020         read_active_file references to use vfm_source.
9021         (init_variable, replace_variable) Removed references to `lv'.
9022
9023         * vfm.c: Comment fixes.
9024         (glob var vfm_source, vfm_sink, vfm_source_info, vfm_sink_info)
9025         New variables.
9026         (static var queue, qh, qt, n_lag) Removed.  All references
9027         removed.
9028         (glob var compaction_necessary, compaction_nval, compaction_case,
9029         paging) New variables.
9030         (record_case) Removed.
9031         (procedure) Comment fixes.  Calls vfm_source->read() instead of
9032         read_active_file().
9033         (lag) Removed.
9034         (prepare_for_writing, arrange_compaction, make_temp_case,
9035         vector_initialization, setup_filter) New function.
9036         (open_active_file) Most of the code moved into the abovementioned
9037         new functions.  Now sets temp_dict to &default_dict if there is no
9038         temporary dictionary, for convenience.  New debug output.
9039         (close_active_file) Deals with changing the sink to the source.
9040         Calls finish_compaction().  Frees compaction_case.  Mostly
9041         rewritten.
9042         (glob vars disk_source_file, disk_sink_file) New vars.
9043         (destroy_active_file, read_from_memory) Removed.
9044         (disk_stream_init, disk_stream_read, disk_stream_write,
9045         disk_stream_mode, disk_stream_destroy_source,
9046         disk_stream_destroy_sink) New functions.
9047         (glob var vfm_disk_stream) New var.
9048         (glob vars memory_source_cases, memory_sink_cases,
9049         memory_sink_iter, memory_sink_max_cases) New vars.
9050         (memory_stream_init, memory_stream_read, memory_stream_write,
9051         memory_stream_mode, memory_stream_destroy_source,
9052         memory_stream_destroy_sink) New functions.
9053         (glob var vfm_memory_stream) New var.
9054         (write_case) Local var `i' renamed `cur_trns'; local var `retval'
9055         named `more_cases'.  Simplified debug output.  Otherwise mostly
9056         rewritten.
9057         (record_case) Moved into the stream drivers.  Removed.
9058         (transform) Removed (was dead code).
9059         (SPLIT_FILE_procfunc) s/vfm_replacement/vfm_sink_info/.  In the
9060         common case that the splits don't change, we don't need to copy
9061         the case into prev_case again--pointless.
9062         (compact_case) New function.
9063         (finish_compaction) New function.
9064
9065         * vfmP.h: Comment fixes.
9066         (DEV_* enum series) Removed. 
9067         (struct storage) Renamed `stream_info'.  Removed variant record.
9068         Removed `device' member.
9069
9070         * debug-print.h: New file.
9071         
9072 Sun Jun  8 01:12:38 1997  Ben Pfaff  <blp@gnu.org>
9073
9074         * autorecode.c: Turned off debugging.
9075
9076         * data-list.c: (destroy_dls) Closes the associated file handle.
9077
9078         * descript.q: (custom_variables) Added PV_NO_SCRATCH to
9079         parse_variables() options.
9080
9081         * dfm.c: (open_file_r) Removed gratuituous argument to msg() call.
9082
9083         * display.c: (display_variables) Really fixed null cell bug.
9084
9085         * file-handle.q: (fh_close_handle) Changed debugging message.
9086
9087         * frequencies.q: (custom_variables) Added PV_NO_SCRATCH to
9088         parse_variables() options.
9089
9090         * list.q: Added PV_NO_SCRATCH in q2c varlist options.
9091         (cmd_list) Fails if no variables specified.
9092         (determine_layout) Writes blank lines manually.
9093
9094         * loop.c: (loop_1_trns_proc) Made debugging code only print
9095         messages if debugging.
9096
9097         * q2c.c: (dump_subcommand) Appends sbc->message to SBC_VARLIST
9098         parse_variables() arguments.
9099         (main) Parses optional parenthesized options to varlist
9100         subcommands into sbc->message.
9101
9102         * sfm-read.c: Format fix.
9103
9104         * var.h: (FV_*) New enum series.
9105         (PV_*) New enum PV_NO_SCRATCH.
9106
9107         * vars-prs.c: (find_var) Removed.
9108         (fill_all_vars) Takes FV_* enum instead of boolean third
9109         argument.  Rewritten to deal with scratch as well as system
9110         variables.
9111         (parse_variables) Error message on scratch variable if
9112         PV_NO_SCRATCH set.
9113
9114         * vfm.c: (static var virt_begin_func) New var.
9115         (procedure) Sets up virt_begin_func.
9116         (SPLIT_FILE_procfunc) For the first case, calls virt_begin_func()
9117         after dump_splits().  For succeeding groups changes, calls
9118         virt_begin_func() instead of begin_func().      
9119
9120 Fri Jun  6 22:42:23 1997  Ben Pfaff  <blp@gnu.org>
9121
9122         * count.c, data-out.c, file-handle.q, list.q, loop.c: Turned off
9123         debugging.
9124
9125         * dfm.c: Added some debugging messages, disabled by default.
9126         (open_file_r) Fixed error message.
9127         (read_record) On eof on inline_file, instead of calling
9128         fh_close_handle(), simply jump to eof label like a normal file.
9129         Message fixes.
9130
9131         * display.c: Thin lines between rows for certain kinds of
9132         listing.  Fixed `null cell' bug.
9133
9134         * error.c: (failure) Flush stdout, stderr before failing.
9135
9136         * file-handle.q: (fh_close_handle) Added debugging message.
9137
9138         * frequencies.q: (dump_full) Bottom line extends across entire
9139         table width.  Changed title formatting.
9140         (dump_condensed) Changed title formatting.
9141         (dump_statistics) Fixed title formatting.
9142
9143         * glob.c: (init_glob) Moved initialization of cur_proc out of #if.
9144         Sets default value of set_format.
9145
9146         * list.q: (cmd_list) Calls blank_line() before determine_layout().
9147         Passes write_all_headers() to procedure() as pre-group func.
9148         (write_all_headers) New function.
9149         (determine_layout) Removed calls to write_header().
9150         Calls blank_line() before and after write_fallback_headers().
9151
9152         * recode.c: (recode_trns_free) Only attempts to free head->map if
9153         non-NULL.
9154
9155         * sfm-read.c: (read_variables) Allows `#' at beginning of system
9156         file variable names but gives a warning.  Sets `left' based on
9157         first character being/not being `#'.  On lossage frees dict->var.
9158
9159         * som-high.c: (som_draw_title) Simplified title formatting.
9160
9161         * vfm.c: (dump_splits) Fixed and changed splits formatting.
9162
9163 Thu Jun  5 22:51:15 1997  Ben Pfaff  <blp@gnu.org>
9164
9165         * autorecode.c: (cmd_autorecode) Sets h_trans to NULL at
9166         beginning.  Frees v_src, v_dest on successful exit.  Frees
9167         h_trans[*], h_trans on lossage.
9168         (recode) Frees h_trans[*], h_trans.
9169
9170         * dfm.c: (dfm_close) Formatting change.
9171         (open_inline_file) Now passed a dfm_fhuser_ext to initialize; no
9172         longer allocates its own in inline_file.
9173         (open_file_r) Passes the local dfm_fhuser_ext to
9174         open_inline_file().
9175         (open_file_w) Message fix. 
9176         (read_record) Buffer reallocation strategy changed.  Frees
9177         ext->line even in inline_file to prevent leaks.
9178         (dfm_put_record) Fixed bug where `ext' was cached before the file
9179         was opened and thus it would be NULL when the file really was
9180         open.
9181         (cmd_begin_data) Sets up inline_file basics itself, then calls
9182         open_inline_file() for the dfm_fhuser_ext.  Formatting fix.
9183
9184         * list.q: (write_line) Formatting fix.
9185         (clean_up) Minor strategy change.  Sets proportional font after
9186         finishing cleanup.
9187         (determine_layout) Sets fixed font before writing regular headers,
9188         or after writing fallback headers.
9189
9190         * modify-vars.c: (cmd_modify_vars) Frees variable lists for DROP
9191         and KEEP vars after using them.
9192
9193         * postscript.c: (ps_init_driver) Frees x->family.
9194         (postopen) When loading fonts, free the temporary font name buffer
9195         after using it.
9196         (ps_text_set_font_by_position) Free temporary font name buffer
9197         after using it.
9198         (text) Fixed code that calculated `lig' so that `lig' always gets
9199         initialized.  Formatting fix.
9200
9201         * som-low.c: (get_cell_size, som_get_table_size) `prop_height' ->
9202         `font_height'.
9203         [GLOBAL_DEBUGGIGN] (check_table) Use arena_alloc() to allocate
9204         cells, not xmalloc(), so that the cells will get destroyed
9205         automatically.
9206
9207         * sysfile-info.c: (cmd_sysfile_info) Frees the dictionary after
9208         using it.
9209
9210 Tue Jun  3 23:33:22 1997  Ben Pfaff  <blp@gnu.org>
9211
9212         * ascii.c: (ascii_text_draw) Always sets metrics for strings that
9213         are drawn.
9214
9215         * dfm.c: Comment fix.
9216
9217         * list.q: Comment fixes.  Include somP.h.  Removed static vars
9218         table, n_columns, n_rows, part.  New struct list_ext.  New static
9219         var line_buf.
9220         (n_lines_remaining, n_chars_width, write_line) New functions.
9221         (cmd_list, list_cases) Rewritten.
9222         (begin_row, end_row, flush_table) Removed.
9223         (write_header, clean_up, write_varname, write_fallback_headers,
9224         determine_layout) New functions.
9225
9226         * output.c: (outp_iterate_enabled_drivers) Minor reformat.
9227
9228         * output.h: Comment fix.
9229
9230         * postscript.c: Comment fix.
9231         (struct ps_driver_ext) Removed prop_size, fixed_size members;
9232         added font_size.  All references changed.
9233         (ps_init_driver) Initializes font_size.  Simplified space checking
9234         code.
9235         (static var option_tab[]) Removed prop-size, fixed-size; added
9236         font-size.
9237         (ps_option) Handles font_size.
9238
9239         * som-high.c: Moved prototypes into somP.h.
9240         (som_init_driver) New function.
9241         (som_submit_table) Moved some code into new function
9242         som_init_driver().
9243         (build_target) Moved some code into new function
9244         som_internal_eject_page().
9245         (som_eject_page) Uses som_internal_eject_page().
9246         (som_internal_eject_page) New function.
9247
9248         * som-low.c: Moved prototypes into somP.h.
9249
9250         * som.h: Formatting fixes.
9251
9252         * somP.h: (struct som_driver_ext) Removed em_width;
9253         added prop_em_width, fixed_width.
9254
9255 Mon Jun  2 14:25:25 1997  Ben Pfaff  <blp@gnu.org>
9256
9257         * Makefile.am: Added `localedir' definition.  Added
9258         -DLOCALEDIR="..." to DEFS.  Added -I. to INCLUDES.
9259
9260         * ascii.c: (macro draw_line) Fixed capitalization.
9261
9262         * ascii.c, autorecode.c, cases.c, cmdline.c, command.c, common.c,
9263         compute.c, count.c, data-in.c, data-list.c, data-out.c,
9264         descript.q, dfm.c, display.c, do-if.c, error.c, expr-evl.c,
9265         expr-opt.c, expr-prs.c, file-handle.q, file-type.c, filename.c,
9266         formats.c, frequencies.q, get.c, getline.c, glob.c, groff-font.c,
9267         hash.c, heap.c, include.c, inpt-pgm.c, lexer.c, list.q, loop.c,
9268         main.c, mis-val.c, misc.c, modify-vars.c, numeric.c, output.c,
9269         postscript.c, print.c, q2c.c, recode.c, rename-vars.c, repeat.c,
9270         sample.c, sel-if.c, sfm-read.c, sfm-write.c, sfmP.h, som-frnt.c,
9271         som-high.c, som-low.c, sort.c, split-file.c, sysfile-info.c,
9272         temporary.c, title.c, tokens.h, val-labs.c, var-labs.c,
9273         vars-atr.c, vars-prs.c, vector.c, vfm.c, weight.c: Marked strings
9274         for internationlization.
9275
9276         * glob.c: [HAVE_LOCALE_H] Includes locale.h.
9277
9278 Sun Jun  1 23:31:18 1997  Ben Pfaff  <blp@gnu.org>
9279
9280         * do-if.c, sort.c, val-labs.c: Comment fixes.
9281
9282         * glob.c: (init_glob) Uncommented, updated i18n support.
9283         
9284         * arena.c, ascii.c, data-in.c, descript.q, error.c, expr-evl.c,
9285         expr-opt.c, expr-prs.c, filename.c, frequencies.q, groff-font.c,
9286         output.c, postscript.c, sfm-read.c, som-high.c, vars-prs.c: Made
9287         the declarations of macros taking arguments a lot nicer.
9288
9289 Sun Jun  1 17:22:04 1997  Ben Pfaff  <blp@gnu.org>
9290
9291         * error.h: Removed CE, CW aliases for SE, SW.
9292
9293         * q2c.c: Removed explicit streq() definition since it's duplicated
9294         in str.h.
9295         
9296         * approx.h, error.h, font.h, hash.h, misc.h, output.h, somP.h,
9297         stats.h, str.h, tokens.h: Made the declarations of macros taking
9298         arguments a lot nicer-looking of <pinard@iro.umontreal.ca>.
9299         Comment fixes.
9300
9301 Sun Jun  1 12:02:06 1997  Ben Pfaff  <blp@gnu.org>
9302
9303         * cmdline.c: Comment fixes.
9304         (pick_compat) Changed return type to int.  Now, instead of setting
9305         glob var `compat' to the emulation, returns the emulation.  All
9306         references changed.
9307         (parse_command_line) Added terminating null to end of
9308         `long_options' array definition.
9309         (pre_syntax_message) Fixes.
9310         (usage) Shows the default emulation in the syntax message by
9311         calling pick_compat().
9312
9313         * getline.c: (getl_add_include_dir) Separates paths with
9314         PATH_DELIMITER, not DIR_SEPARATOR.
9315
9316         * glob.c: (init_glob) Fixed references to DEFAULT_VER_PCP40,
9317         DEFAULT_VER_WIN61, DEFAULT_VER_X40.
9318
9319         * output.c: (outp_configure_macro) Make earlier definitions for a
9320         particular key override later ones for the same key.
9321         
9322 Fri May 30 19:40:49 1997  Ben Pfaff  <blp@gnu.org>
9323
9324         * ascii.c: Comment fixes.
9325
9326         * output.c: (outp_get_paper_size)
9327         s/STAT_OUTPUT_INIT_FILE/STAT_OUTPUT_PAPERSIZE_FILE/.
9328         
9329 Sun May 25 22:34:07 1997  Ben Pfaff  <blp@gnu.org>
9330
9331         * ascii.c, postscript.c, sfm-read.c, sfm-write.c, sort.c: Include
9332         <errno.h>.  GNU libc 2 enforces this!
9333
9334         * command.c: (parse_cmd) Fixed problem with `else' clause being
9335         paired with wrong `if'.  Comment fix.
9336
9337 Fri May  9 16:53:52 1997  Ben Pfaff  <blp@gnu.org>
9338
9339         * getline.c: [!HAVE_LIBREADLINE] (read_console) Changed
9340         blp_getline() to getline().
9341
9342         * output.c: (outp_eval_dimension) Changed the fix from last time;
9343         there was no variable `a'.
9344
9345         * q2c.c: (get_line) Fixed boundary condition overrun bug.
9346
9347 Mon May  5 21:58:22 1997  Ben Pfaff  <blp@gnu.org>
9348
9349         * output.c: (outp_evaluate_dimension) Fixed handling of negative
9350         numbers having fractional parts.  Added case of a fraction without
9351         a whole-number part.
9352
9353 Fri May  2 22:08:05 1997  Ben Pfaff  <blp@gnu.org>
9354
9355         * ascii.c: (ascii_text_get_font_position) Removed.
9356
9357         * expr.h, exprP.h: Disabled debugging.
9358
9359         * groff-font.c, postscript.c: Changed `groff' to `Groff' in
9360         several places.
9361
9362         * output.h: (struct outp_class_struct) Removed
9363         text_get_font_position method.  All references deleted.
9364
9365         * postscript.c: Big change here.  Fontmaps were completely
9366         eliminated because of a change in philosophy.  Comment fixes.
9367         (struct ps_fontmap, ps2dit_map, font_family, dit2family_map)
9368         Removed.
9369         (struct ps_driver_ext) `position', `fontmap', `prop_name',
9370         `fixed_name' members removed.  New members `prop_family',
9371         `fixed_family'.  `family' member changed to type char *.
9372         (static var ps_fontmaps) Removed.
9373         () Removed.
9374         (ps_init_driver) Removed obsolete references, updated.
9375         Initializes `translate_x', `translate_y', `scale'.  Doesn't read
9376         fontmap, of course.  Refers to font names through internal_name
9377         rather than subversive means.  Frees proper items.
9378         (static var option_tab[]) Removed `fontmap-file' option; renamed
9379         `fixed-font', `prop-font'.
9380         (ps_option) Corresponds to option_tab[].
9381         (read_fontmap, release_fontmap, ps_to_dit, compare_ps2dit,
9382         hash_ps2dit, compare_dit2family, hash_dit2family, compare_family,
9383         hash_family) Removed.
9384         (postopen) Generates font names from family names.  Gets
9385         PostScript font name properly.  New prologue file comment `!!!'
9386         style.
9387         (ps_open_page) Adds translate_x, translate_y to BP prologue
9388         function; gives SF argument floating-point format.
9389         (ps_text_set_font_by_name) Doesn't try to map PostScript->Groff
9390         font name.  Doesn't change font family.
9391         (ps_text_set_font_by_position) Generates Groff font name from font
9392         family name instead of through table lookup.
9393         (ps_text_set_font_by_family) Renamed `ps_text_set_font_family',
9394         all references changed.  Reduced to simple string assignment.
9395         (ps_get_font_name) Removed.
9396         (ps_get_font_family) Reduced to string return.
9397         (text) Doesn't save `position' since it no longer exists.  Ugly
9398         kluge to save font family--fix soon?
9399         (load_font) Removed PostScript name argument.
9400         
9401 Thu May  1 14:58:59 1997  Ben Pfaff  <blp@gnu.org>
9402
9403         * postscript.c: Comment fix.
9404         (ps_open_page) Puts scale factor in PostScript output.
9405         
9406 Sat Apr 26 11:49:32 1997  Ben Pfaff  <blp@gnu.org>
9407
9408         * Makefile.am: Distcleans q2c.
9409
9410 Wed Apr 23 21:33:48 1997  Ben Pfaff  <blp@gnu.org>
9411
9412         * ascii.c: (delineate) Sets text size even if width is zero.
9413
9414         * command.c: Comment fix.
9415         (static var cmd_table[]) Re-enabled EVALUATE command.
9416         (parse_cmd) Lotsa comment fixes.  Fixed infinite loop in parsing
9417         of comments in script files.  Now more liberal on criteria for
9418         performing a state transition--if *anything* happened correctly,
9419         not just if *everything* happened correctly.
9420
9421         * data-out.c: (convert_F) Comment fix.  Why in the fsck does
9422         Checker segfault on formatting large numbers and why in the fsck
9423         hadn't I noticed this before?
9424
9425         * expr.h, exprP.h: No longer turn off GLOBAL_DEBUGGING.
9426
9427         * list.q: (cmd_list) Commented out the actual output routine
9428         because of various problems.  Probably will abandon the idea of
9429         using the general `crushed tables' for the LIST procedure.
9430
9431         * temporary.c: (restore_dictionary) Sets var_by_name to NULL after
9432         clearing it.  Allocates a new var_by_name dictionary before trying
9433         to add members to it.
9434
9435         * vars-atr.c: [DEBUGGING] (dump_one_var_node) Removed argument
9436         `sib'.  Changed type of `node' argument.
9437         [DEBUGGING] (dump_var_tree) Replaced avlwalk() with
9438         avl_walk_inorder().
9439         (clear_variable) Only dumps the var tree if var_by_name non-NULL.
9440         [DEBUGGING] Only deletes the variable from var_by_name if that var
9441         non-NULL.
9442
9443 Fri Apr 18 16:48:41 1997  Ben Pfaff  <blp@gnu.org>
9444
9445         * Makefile.am: Added include files to SOURCES.  Added
9446         frequencies.q to EXTRA_DIST.  Removed include/ from INCLUDES.  Now
9447         includes rules for q2c.  Added `boast' target.
9448
9449 Fri Apr 18 15:42:22 1997  Ben Pfaff  <blp@gnu.org>
9450
9451         * Makefile.am: Maintainer-clean Makefile.in.
9452         
9453         * Makefile.am: Fixed redundant EXTRA_DIST line.
9454
9455         * ascii.c: Comment fixes.
9456         (ascii_line_vert) Fixed overly aggressive range check.
9457
9458         * display.c: Removed dead code.
9459
9460         * list.q: Turn debugging on.
9461         (flush_table) New debug code.
9462
9463         * sfm-read.c: (read_value_labels) malloc's the structure before
9464         trying to assign to its members.
9465
9466         * sfm-write.c: Comment fix.
9467
9468         * som-high.c: (som_submit_table) Sets som.t and som.d on each call
9469         to output_table().
9470         (output_table) No arguments anymore--gets them through `som'
9471         global.  New debug code.  In crushed tables, now sets `htv' as
9472         well as `hv' to avoid bad confusion later.
9473         (dump_crush_page) New debug code.
9474
9475         * som-low.c: (som_dump_crush_page) New debug code.
9476
9477 Thu Mar 27 01:11:29 1997  Ben Pfaff  <blp@gnu.org>
9478
9479         All source files: Broke long lines into multiple lines.
9480         
9481         * ascii.c: (ascii_close_page) Uses host_system var in place of
9482         HOST_SYSTEM constant.
9483
9484         * cmdline.c: (var syntax_message[]) Broke into
9485         pre_syntax_message[] and post_syntax_message[].
9486         (usage) Outputs both parts, separated by driver list.
9487
9488         * error.h: Fixed broken formatting.
9489
9490         * expr-opt.c: (str_search, str_rsearch) New functions.
9491
9492         * misc.c: (blp_getdelim) Removed.  All references changed to
9493         `getdelim'.
9494         (str_search, str_rsearch) Removed.
9495         (memrmem) New function.
9496
9497         * misc.h: (blp_getline) Removed.  All reference changed to
9498         `getline'.
9499
9500         * stat.h: New file.
9501
9502         * filename.c: Includes "stat.h", not <sys/stat.h>.
9503         (blp_getenv) Uses host_system var instead of HOST_SYSTEM constant.
9504
9505         * output.c: (outp_list_classes) Changed output formatting.
9506
9507         * sfm-write.c: (write_header) Uses host_system var instead of
9508         HOST_SYSTEM constant.
9509         (write_rec_7_34) Extracts version numbers from the version string.
9510         Untested.
9511
9512         * sort.c: Includes "stat.h", not <sys/stat.h>.
9513
9514         * str.c: (strcasecmp) Removed.
9515
9516         * title.c: (cmd_document) Uses host_system var instead of
9517         HOST_SYSTEM constant.
9518
9519         * version.c: Generated on-the-fly by the Makefile instead of being
9520         static.
9521
9522         * str.h: Comment fixes.  Doesn't substitute for missing memmove or
9523         memcpy.
9524         [!HAVE_STRNCASECMP] Declares strncasecmp().
9525
9526         * version.h: Removed stray character.  Comment fixes.
9527         (vars host_system, build_system) New vars.
9528
9529 Mon Mar 24 21:47:31 1997  Ben Pfaff  <blp@gnu.org>
9530
9531         * Most source files: Changed formatting of copyright notice; fixed
9532         FSF address; reformatted to better conform to GNU standards;
9533         comment fixes.  Added markups to prevent GNU indent from messing
9534         up my beautiful formatting :-).
9535         
9536         * q2c.c: (get_line) Ignores lines that begin with `/* *INDENT' so
9537         that GNU indent markups can be passed through without problems.
9538
9539 Wed Feb 19 21:30:31 1997  Ben Pfaff  <blp@gnu.org>
9540
9541         * get.c: Turned off debugging.
9542
9543         * glob.c: (init_glob) Turned on save-file compression by default.
9544
9545         * sfm-write.c: (sfm_write_case) Fixed bug which resulted in less
9546         compression than was possible in save files.
9547
9548 Sun Feb 16 20:57:20 1997  Ben Pfaff  <blp@gnu.org>
9549
9550         * data-out.c: (convert_F) Comment fixes.  Debug message fixes.
9551
9552         * frequencies.q: Removed Fiasco extensions.  Updated calculation
9553         algorithms.  Polished output format. 
9554         (struct frq_info_struct) Removed members `max_degree', `min_n',
9555         all references removed.
9556         (macro frq_extensions) Removed.
9557         (static vars min_n, max_degree) Removed, all references removed.
9558         (internal_cmd_frequencies) Doesn't handle extensions.  Doesn't
9559         calculate `min_n', `max_degree'.
9560         (postcalc) Passes new arg to dump_statistics().
9561         (dump_full) Honor NOLABEL option.  Buggy?  Adds variable name
9562         title.
9563         (dump_condensed) Adds variable name title.
9564         (sum_freqs) Removed.
9565         (calc_stats) Updated calculation algorithm.
9566         (dump_statistics) Removed warning for too-few observations.
9567         Changed table formatting.  Adds variable name title if passed new
9568         arg is nonzero.
9569
9570         * output.h: Comment fix.
9571
9572         * recode.c, sample.c, sort.c: Disabled debug code.
9573
9574         * som-frnt.c: (som_set_value, som_set_float, som_set_text)
9575         Improved debug code.
9576
9577         * var.h: (enum series frq_*) Removed Fiasco extensions.
9578
9579 Sat Feb 15 21:26:53 1997  Ben Pfaff  <blp@gnu.org>
9580
9581         * command.c: Added PROCESS IF to command table.
9582
9583         * Lots & lots of places, removed checks for NULLs preceding calls
9584         to free_expression(), which itself checks.
9585
9586         * descript.q: Removed Fiasco extensions.  Removed optimizations
9587         for non-weighted active files.  Implemented some options.
9588         Finished polishing output format.  Comment fixes.  Merged
9589         `descript.g'.
9590         (static vars n_glob_miss_list, n_glob_valid, n_glob_missing,
9591         max_degree, min_n) Removed.
9592         (macro dsc_extensions) Removed.
9593         (struct dsc_info_struct) Removed `min_n' member, all references
9594         fixed.
9595         (internal_cmd_descriptives) Removed calculation of min_n,
9596         max_degree.  Only deals with one `calc' routine instead of two
9597         flavors.
9598         (precalc) Eliminated redundancy.  Updated for changes to
9599         descriptives_proc structure.
9600         (calc) Moved here from `descript.g'.  Rewritten to calculate
9601         statistics via `moments about the mean' rather than by summing,
9602         summing squares, summing cubes, and so on.
9603         (postcalc) Rewritten for new-style statistical calculation.
9604         (display) Removed support for displaying variables across rows.
9605         No longer crushes the descriptives table.  Removed ancient code.
9606         Added display of N, by variable and listwise.
9607
9608         * descript.g: Removed; merged into `descript.q'.
9609
9610         * expr-evl.c: (evaluate_expression) Now returns a double.  For
9611         numeric results, it returns the result as well as storing it in
9612         the passed `value' structure if non-NULL.  For string results it
9613         just returns 0.0 and it must be passed non-NULL.  Many references
9614         to this function were optimized by use of this change, especially
9615         but not exclusively in `compute.c'.
9616
9617         * frequencies.g: Comment fix.
9618
9619         * glob.c: (glob var process_if_expr) New global var.
9620
9621         * postscript.c: (static var option_tab[]) Corrected entry for
9622         `fixed_size'.
9623         (postopen) Sets x->size to x->prop_size.
9624         (ps_text_set_font_by_name) Sets font size as well as typeface for
9625         PROP and FIXED fonts.
9626         
9627         * sel-if.c: (cmd_process_if) New function.
9628
9629         * sfm-write.c: (struct sfm_fhuser_ext) New member `n_cases'.
9630         (sfm_write_dictionary) Sets `n_cases' to 0.
9631         (sfm_write_case) Increments `n_cases'.
9632         (sfm_close) Attempts to seek the system file back to the header
9633         and write the number of cases in its proper slot.
9634
9635         * som-frnt.c: (som_insert_table) Masks off expansion options since
9636         only SOPT_X_NORM seems to work sensibly.
9637
9638         * som-low.c: (get_cell_size) Fixed bug when a table cell was sized
9639         with a `fixed' value of 2.
9640
9641         * sort.c: (cmd_sort_cases) Cancels PROCESS IF.
9642
9643         * sysfile-info.c: (cmd_sysfile_info) Doesn't display more than 10
9644         value labels; uses SOPT_NONE instead of SOPT_X_BOTH.
9645
9646         * var.h: (enum series dsc_*) Removed Fiasco extensions.
9647         (struct descriptives_proc) Removed `miss_noweight'; new members
9648         `X_bar', `M2', `M3', `M4', `min', `max'.
9649
9650         * vars-atr.c: (discard_variables) Cancels PROCESS IF.
9651
9652         * vfm.c: (close_active_file) Cancels PROCESS IF.
9653         (write_case) Doesn't process cases unselected by PROCESS IF.
9654
9655 Fri Feb 14 23:32:58 1997  Ben Pfaff  <blp@gnu.org>
9656
9657         * glob.c: (glob var err) Removed.
9658
9659         * sysfile-info.c: (cmd_sysfile_info) When adjusting table size,
9660         doesn't have to take into account number of value labels since
9661         they're in a subtable anyway.  Also, doesn't display more than 10
9662         value labels since we can't yet break pages in subtables.
9663
9664 Tue Feb  4 15:15:50 1997  Ben Pfaff  <blp@gnu.org>
9665
9666         * som-frnt.c: (som_change_table_size) Simple change for elegance
9667         that shouldn't change behavior.
9668         (som_set_value) Comment fix.
9669
9670         * som-high.c: (som_submit_table) Message fix.
9671
9672 Wed Jan 22 21:54:00 1997  Ben Pfaff  <blp@gnu.org>
9673
9674         * command.c: Added SYSFILE INFO to command table.
9675
9676         * file-handle.q: (fh_handle_filename) New function.
9677
9678         * get.c: (save_trns_proc) Fixed a bug in padding of output data
9679         with spaces.
9680
9681         * main.c: (parse) New return value for command functions, -3.
9682
9683         * misc.h: Comment fix.
9684
9685         * output.h: Comment fixes.
9686         (macro COMPONENTS) Removed.
9687
9688         * postscript.c: (write_text) Modified literal_chars[] so that `('
9689         and ')' are not written to the output in strings as literals.
9690
9691         * sfm-read.c: (sfm_read_dictionary) New argument.
9692         (read_header) New argument.  Sets the information structure's
9693         values from the header information.  
9694         (read_variables) [__CHECKER__] Redefines isalnum()--some sort of
9695         bizarre Checker problem, I guess.
9696         (read_variables) Proper cleanup on lossage.
9697
9698         * sfm.h: (struct sfm_read_info) New struct for use by
9699         sfm_read_dictionary().
9700
9701         * som-frnt.c: (som_create_table) New argument CREATE_FLAGS,
9702         currently used just for tables that can be dynamically resized and
9703         thus have to be allocated with arena_malloc() instead of
9704         arena_alloc().  All references changed.
9705         (som_change_table_size) New function.
9706         (som_insert_table) Bugfix: now inserts `cell', not `c'!
9707
9708         * som-high.c: [GLOBAL_DEBUGGING] (check_table) Moved to som-low.c.
9709         (som_submit_table) [GLOBAL_DEBUGGING] Doesn't call check_table()
9710         any more.
9711
9712         * som-low.c: (draw_cell) Calls draw_table_cell() for SCON_TABLE
9713         cells.
9714         (draw_intersection) Now takes an argument specifying the table in
9715         question.  All references changed.
9716         (draw_table_cell) New function.
9717         (som_get_table_size) [GLOBAL_DEBUGGING] Calls check_table().
9718         (som_get_table_size) Many nice new explanatory comments.
9719         [GLOBAL_DEBUGGING] (check_table) Moved here from som-high.c.
9720
9721         * som.h: New enum series SOM_CREATE_* for use as create flags with
9722         som_create_table().
9723
9724         * str.h: Moved a comment here from TODO.
9725
9726         * sysfile-info.c: New file.  Reference implementation.
9727
9728 Sun Jan 19 14:22:11 1997  Ben Pfaff  <blp@gnu.org>
9729
9730         * command.c: Added RENAME VARIABLES to table of commands.
9731
9732         * data-in.c: (dls_error) Sets `cust_field'.
9733         (parse_N) Message fix.
9734         (parse_day_count) New function.
9735         (to_roman) Never outputs VX as a `short form' of V.
9736         (parse_month) Fixed parsing of Roman numerals.
9737         (parse_trailer) Message fix.
9738         (parse_DATE, parse_ADATE, parse_EDATE, parse_SDATE, parse_JDATE,
9739         parse_QYR, parse_MOYR, parse_WKYR, parse_DTIME) Issue a message if
9740         the date is invalid.
9741         (parse_SDATE) Fixed swapped day, year.
9742         (parse_JDATE) Fixed bug for dates in 1582.
9743         (parse_DTIME) Allows days not between 1 and 31.
9744         (parse_numeric) Makes local copy of f.type for easier usage.
9745         FMT_DOLLAR fixed.
9746
9747         * data-out.c: (convert_F) When outputting as scientific, properly
9748         sets f.type as fp->type.
9749         (insert_commas) Fixed operator precedence problem with setting of
9750         nitems.  Changed strcpy to memcpy (no null terminator). 
9751         (convert_date) Fixed FMT_JDATE: added 1900 to year.
9752         (convert_CCx) Essentially rewritten, but now it works.
9753
9754         * display.c: (cmd_display) Added DISPLAY FILE LABEL (undocumented
9755         feature of Fiasco).
9756         (display_documents) Implemented.
9757
9758         * error.c: (glob var cust_field) New var.
9759         (vmsg) Displays cust_field as part of message classes DE and DW.
9760
9761         * formats.c: (debug_print) Fixed to compile under updated
9762         dictionary format.
9763
9764         * get.c: (cmd_get, cmd_save_internal) Close file handle on
9765         failure.
9766
9767         * misc.c: (parse_format_specifier) Formatting fix.
9768
9769         * modify-vars.c: (struct var_modification) Renamed `n_reorder' as
9770         `n_rename' for clarity.
9771         (cmd_modify_vars) Initializes `forward' and `positional' at
9772         appropriate times.  Frees lists of vars to rename on failure.
9773         Comment fix.  Frees memory on success.  
9774         (rearrange_dict) Simplified `for' loop condition.
9775
9776         * rename-vars.c: New file (reference implementation).
9777         
9778         * set.q: (internal_cmd_set) Fixed `emu' test condition.
9779
9780         * sfm-read.c: (read_header) File label is created only if file
9781         label in file is not blank.
9782         (read_variables) Initializes `dict' local variable.
9783         (read_documents) Proper behavior on lossage.
9784
9785         * sfm-write.c: (write_header) Doesn't blank out the file label
9786         (why was this here to begin with?!)
9787
9788         * temporary.c: (save_dictionary) File label is copied only if
9789         non-NULL.  Doesn't try to xstrdup() dictionary documents.
9790         Adapted so as to not irritate Checker.
9791         (free_dictionary) Only destroys var_by_name if non-NULL.
9792
9793         * title.c: (cmd_file_label) Doesn't skip FILE, LABEL tokens.
9794         (cmd_document) Doesn't skip DOCUMENT token.  Adds some header
9795         lines to the document, indents the document.  Also, it works now.
9796         (add_document_line) New function.
9797
9798         * var.h: (struct dictionary) Reordering.
9799
9800         * vars-prs.c: (parse_variables) On lossage, only local_free()'s
9801         bits if it was allocated to begin with.
9802
9803 Thu Jan 16 13:08:57 1997  Ben Pfaff  <blp@gnu.org>
9804
9805         * command.c: Added MODIFY VARS to list of commands.
9806
9807         * configure.in: Updated custom macros for autoconf 2.12.  Removed
9808         mmap reference; fixed termcap library reference.
9809
9810         * display.c: (display_variables) Fixed a few bugs although it's
9811         still not well written.
9812
9813         * error.c: [!__CHECKER__] (chkr_disp_call_chain) New function.
9814         (induce_segfault) Calls chkr_disp_call_chain() instead of
9815         inducing an actual SIGSEGV.
9816
9817         * expr-opt.c: (evaluate_tree) Swapped order of arguments to
9818         str_search() and str_rsearch().  Fixed tests for matches on
9819         OP_INDEX and OP_RINDEX.
9820
9821         * filename.c: (good_getcwd) Removed as the new libc for Checker
9822         doesn't contain this bug, apparently.
9823
9824         * misc.c: (str_search, str_rsearch) Changed order of arguments for
9825         consistency with GNU memmem.
9826         (blp_getdelim) Changed `len' from `int' to `size_t'.
9827
9828         * modify-vars.c: Reference implementation.
9829
9830         * som-frnt.c: (zero_length) New global var.
9831         (som_create_table) Message fix.
9832
9833         * som.h: Added gcc attributions to som_set_text(),
9834         som_output_text() prototypes.  blank_line() refers to
9835         zero_length[] instead of a literal null string to suppress gcc
9836         warnings.
9837
9838         * sort.c: (do_external_sort) Fixed fencepost error on lossage.
9839         (allocate_cases) Decrements x_max so the last element of x[] can
9840         be used by the algorithm.
9841
9842         * var.h: Changed minor details of `variable' declaration.  
9843         (struct modify_vars_proc) New struct.
9844         (struct variable) Added field p.mfv.
9845
9846         * vars-atr.c: Comment fix.
9847
9848         * vars-prs.c: (fill_all_vars) More optimal implementation.
9849
9850         * vfm.c: (dump_splits) Sets the last byte of temp_buf to a null
9851         character, which it shouldn't have to do but printf() seems to
9852         read the null byte even though I supply a maximum length...
9853
9854 Fri Jan 10 20:22:08 1997  Ben Pfaff  <blp@gnu.org>
9855
9856         * command.c: Removed command alias X for QUIT.
9857         (parse_cmd) Fixed comment parsing.
9858
9859         * dfm.c: (struct dfm_fhuser_ext) Fields `len', `size' are now of
9860         type size_t.
9861         (read_record) Fixed references to len, size.
9862         (dfm_get_record) Restructured.
9863
9864         * file-handle.h: (struct file_handle) Field `lrecl' now of type
9865         size_t.
9866
9867         * file-handle.q: (internal_cmd_file_handle) Checks for nonpositive
9868         record length.
9869
9870         * modify-vars.c: New file.  Not complete.
9871         
9872         * set.q: (set_ccx) Fixed operator precedence problem regarding ^
9873         and ==.
9874
9875         * sfm-read.c: (bswap_flt64, read_header, write_variable) Fixed
9876         problems caused by int/size_t differences.
9877
9878         * sort.c: (output_record, merge_once) Cast `size_t's to `int's in
9879         appropriate spots.
9880
9881         * str.c: (strcasecmp) Fixed bug that cropped up when the strings
9882         being compared were of equal length.
9883
9884 Thu Jan  2 19:08:23 1997  Ben Pfaff  <blp@gnu.org>
9885
9886         * command.c: Added DOCUMENT, DROP DOCUMENTS, FILE LABEL.
9887
9888         * lexer.c: (get_dotted_rest_of_line) New function.
9889
9890         * sel-if.c: (cmd_filter) Cannot choose string or scratch variables
9891         as filters.
9892
9893         * sfm-read.c: (sfm_read_dictionary) Calls read_documents() to read
9894         type 6 records.  Frees the dictionary properly.
9895         (read_header) Initializes the dictionary instead of letting
9896         read_variables() do it.  Sets the dictionary file label from the
9897         system file.
9898         (read_documents) New function.
9899
9900         * sfm-write.c: (sfm_write_dictionary) Calls write_documents() to
9901         write type 6 record if appropriate.
9902         (write_header) Writes file label from dictionary.
9903         (write_documents) New function.
9904
9905         * temporary.c: (save_dictionary, restore_dictionary,
9906         free_dictionary) Properly handle new fields in dictionary struct.
9907
9908         * title.c: (get_title) Returns after failure().
9909         (cmd_file_label, cmd_document, cmd_drop_documents) New functions
9910         for new commands FILE LABEL, DOCUMENT, DROP DOCUMENTS.  Untested.
9911
9912         * var.h: (struct dictionary) New fields `label', `n_documents',
9913         `documents'.
9914
9915 Wed Jan  1 22:08:10 1997  Ben Pfaff  <blp@gnu.org>
9916
9917         * command.c: Added FILTER to list of commands.
9918
9919         * frequencies.g: [WEIGHTING] Removed test for weighting!=-1 since
9920         it's always true.
9921
9922         * get.c: (cmd_save_internal) Removed weighting code since it's now
9923         handled by sfm-write.c.  Properly commented out debug code.
9924
9925         * glob.c: (glob var weighting) Removed.
9926
9927         * sel-if.c: Comment fixes.
9928         (cmd_filter) New function.
9929
9930         * sfm-read.c: (struct sfm_fhuser_ext) New field `weight_index'.
9931         (sfm_read_dictionary) Sets weighting variable direct in the
9932         created dictionary now.  (Apparently we previously didn't support
9933         weighting on GET?)
9934         (read_header) Sets weight_index field in sfm_fhuser_ext from
9935         header read from disk.
9936
9937         * sfm-write.c: (sfm_write_dictionary) Comment fix.
9938         (write_header) Now sets the weighting in the header from the
9939         passed primary dictionary instead of from the sfm_write_info.
9940
9941         * sfm.h: (struct sfm_write_info) Removed field `weight'.
9942
9943         * som-high.c: (dump_crush_table) Fixed a couple of assertions that
9944         broke on boundary conditions.
9945
9946         * var.h: (struct dictionary) New fields `weight_var',
9947         `weight_index', and `filter_var'.
9948         (glob var weighting) Removed.  This is now part of struct
9949         dictionary.  All references changed; the less mechanical changes
9950         are described above.
9951
9952         * vars-atr.c: (find_dict_variable) New function.
9953
9954         * vfm.c: (static var filter_index) New variable.
9955         (open_active_file) Initializes filter_index from default_dict.
9956         (write_case) Calls proc_func() only if the filter variable is
9957         nonzero; this implements FILTER behavior.
9958
9959         * weight.c: (static var weight_varname) Removed.
9960         (cmd_weight) Modified default_dict instead of glob vars.
9961         (update_weighting) Changed the signature to modify a dictionary
9962         instead of glob vars.  Now returns the weighting variable.
9963         (get_weighting_variable) Removed; its function is absorbed by
9964         update_weighting().
9965         (stop_weighting) Operates on a dictionary now.
9966
9967 Wed Jan  1 17:00:59 1997  Ben Pfaff  <blp@gnu.org>
9968
9969         * sort.c: Removed debugging info from messages.
9970         (do_external_sort) Cleans up after itself by deleting the
9971         temporary directory on failure.  (On success it is deleted by the
9972         input program.)
9973         (allocate_cases) Removed debug code.  Added clean up code.
9974         (output_record) Removed debug code.
9975         (merge) Added code to close all the input files that are currently
9976         open.  This is a likely location for bugs, because I'm not sure
9977         about boundary conditions.  Removed an unnecesary heap_delete().
9978         (merge_once) Removed input file "optimization" that in fact
9979         screwed up the rest of the code.  Message and comment fixes.
9980
9981 Sun Dec 29 21:36:48 1996  Ben Pfaff  <blp@gnu.org>
9982
9983         * error.c: [__CHECKER__] (induce_segfault) Flushes output streams.
9984
9985         * heap.c: (heap_delete) New argument.
9986
9987         * sort.c: Finished implementation of external sort.
9988
9989         * vfm.c: (read_from_disk) Returns after a disk error.
9990
9991 Sun Dec 22 23:10:39 1996  Ben Pfaff  <blp@gnu.org>
9992
9993         * sort.c: (static var state) Removed.
9994         (static vars max_handles, tmp_basename, tmp_extname,
9995         huffman_queue) New variables.
9996         (do_external_sort) Moved most code to new functions.
9997         Creates huffman_queue.
9998         (allocate_file_handles, allocate_cases) New functions.
9999         (static vars run_no, run_length, file_index, case_count) New
10000         variables. 
10001         (output_record) Returns success.  Now really writes to the output
10002         file.
10003         (begin_run, end_run) New functions.
10004         (write_initial_runs) Returns success.  Initializes run_no to -1.
10005         Calls begin_run(), end_run() at appropriate times.  Outputs debug
10006         messages.
10007         (write_to_sort_cases) Calls begin_run(), end_run() at appropriate
10008         times.
10009         (merge) New function.
10010
10011         * heap.c, heap.h: New files.  Hopefully in near-final form.
10012
10013 Sat Dec 21 21:51:04 1996  Ben Pfaff  <blp@gnu.org>
10014
10015         * glob.c: Added write_active_file to global vars.
10016
10017         * sort.c: Several new miscellaneous static variables.
10018         (cmd_sort_cases) Big comment fix.
10019         (perform_case_2) Renamed `do_external_sort' and completely
10020         rewritten.
10021         (case_2_proc_func) Removed.
10022         (output_record, write_initial_runs, write_to_sort_cases,
10023         compare_record) New functions.
10024
10025         * vfm.c: [DEBUGGING] (index_to_varname) Excised bit rot.
10026
10027 Tue Dec 17 18:57:59 1996  Ben Pfaff  <blp@gnu.org>
10028
10029         * sort.c: (perform_case_2) Changed the method for allocation of
10030         lots of memory--now allocates one case at a time in hopes that
10031         more cases can be allocated with heavily fragmented memory.
10032
10033         * var.h: (write_active_file) New global var.
10034
10035         * vfm.c: (procedure, close_active_file, write_case,
10036         SPLIT_FILE_procfunc) Now allow beginfunc, procfunc, and endfunc
10037         arguments to procedure() to be NULL.  All references to
10038         procedure() that made use of dummy functions were changed to NULL
10039         functions.
10040         (open_active_file) If write_active_file is non-NULL, the output
10041         device becomes DEV_PGM (a new enum).
10042         (close_active_file) Sets write_active_file to NULL.
10043         (read_from_memory) Comment fix.
10044         (record_case) Calls write_active_file() when the output device is
10045         DEV_PGM.
10046
10047 Sun Dec 15 15:32:16 1996  Ben Pfaff  <blp@gnu.org>
10048
10049         * sort.c: New file.
10050
10051         * autorecode.c: (cmd_autorecode) Fixed parsing of options.
10052         Fixed checking for duplicate varnames.
10053         (recode) xmalloc()'s the transformation instead of arena_alloc()'ing
10054         it.
10055         (autorecode_trns_free) Destroys hash tables for each recoding
10056         specification.
10057         (autorecode_proc_func) Compares NULL to *vpp instead of vpp.
10058
10059         * command.c: Added SORT CASES to cmd_table.
10060         (null_func, null_int_func) Prototyped.
10061
10062         * descript.g: (calc_weight, calc_noweight) Computes own case
10063         number now.
10064         
10065         * frequencies.q: (dump_statistics) Fixed problem with
10066         too-few-cases warning message.
10067
10068         * get.c: (cmd_save_internal) Handles weighting properly.
10069
10070         * hash.c: (hsh_dump) Output format changed.
10071         (force_hsh_insert) Actually works now, prototype changed.
10072
10073         * list.q: (static var case_num) New variable.
10074         (cmd_list) Initializes case_num.
10075         (list_cases) Increments case_num.
10076
10077         * var.h: Added definitions for SORT CASES.  Comment fixes.
10078
10079         * vfm.c: Some definitions moved to new file vfmP.h.  Comment
10080         fixes.  `active' renamed vfm_active, `rep' renamed
10081         vfm_replacement, all references changed.
10082         (procedure) The procfunc no longer receives a case number.  All
10083         references changed.
10084         (write_case) Subtle reordering.
10085         (SPLIT_FILE_procfunc) Counts cases differently.  Slightly less
10086         redundant.
10087
10088         * weight.c: (get_weighting_variable) New function.
10089
10090         * vfmP.h: New file with definitions from vfm.c.
10091
10092 Sat Dec 14 10:35:30 1996  Ben Pfaff  <blp@gnu.org>
10093
10094         * command.c: (FILE_TYPE_okay) Commented out some tests because
10095         they're clumsy and not yet needed.
10096
10097         * var.h: Most *_trns structures moved to their respective source
10098         files.  Some were moved into a new file, do-ifP.h.  Comment fixes.
10099         (union any_trns) Changed to a typedef for trns_header.
10100         (struct input_program_pgm) Removed.
10101
10102         * vars-prs.c: (parse_variables) Only local_free()'s bits if it
10103         was allocated in the first place.
10104
10105 Fri Dec 13 21:30:53 1996  Ben Pfaff  <blp@gnu.org>
10106
10107         * autorecode.c: New file.
10108         
10109         * command.c: Added AUTORECODE to command table; re-enabled SET.
10110
10111         * data-out.c: (convert_F) Handles infinities and NaNs properly.
10112
10113         * error.c: (vmsg) Comment fixes.
10114
10115         * hash.c: Comment fix.
10116         (hashpjw_d) New function.
10117         (hashpjw) Reimplemented as call to more general function
10118         hashpjw_d().
10119         (internal_comparison_fn) Initializes pointers properly.
10120         (hsh_sort) [GLOBAL_DEBUGGING] New debugging code.
10121         (force_hsh_insert, force_hsh_find) New debugging wrapper
10122         functions.
10123
10124         * main.c: (main) Message fix.
10125
10126         * output.c: (outp_read_devices) Message fix.
10127
10128         * set.q: Comment fixes.
10129         (custom_results) Implemented Wnd/X form of subcommand.
10130         (set_routing) New function.
10131         (internal_cmd_set) Implemented ERRORS, MESSAGES.
10132
10133         * settings.h: (SET_ROUTE_*) New enum series.
10134         (set_results) Renamed set_results_file, all references changed.
10135         (set_messages) Removed.
10136         (glob vars set_errors, set_messages, set_results) New vars.
10137
10138         * title.c: (get_title) Remembers to xstrdup() the result of
10139         get_rest_of_line().
10140
10141         * var.h: (arc_item, arc_spec, autorecode_trns) New structures for
10142         use by AUTORECODE.
10143         (union any_trns) New element `arc'.
10144
10145 Fri Dec  6 23:53:47 1996  Ben Pfaff  <blp@gnu.org>
10146
10147         * command.c: (output_line) Removed references to set_screen.
10148
10149         * error.c: (static var terminating) New var.
10150         (hcf) Sets terminating to 1.
10151         (vmsg) If terminating is nonzero, does not attempt to call hcf().
10152         This prevents an infinite loop if an error occurs within hcf().
10153
10154         * expr-evl.c: (evaluate_expression) [__CHECKER__] Replaced case
10155         statement circumlocution with `case 42000' trick.
10156         (evaluate_expression) New support for OP_STR_MIS.
10157
10158         * expr-opt.c: (evaluate_expression) [__CHECKER__] Replaced case
10159         statement circumlocution with `case 42000' trick.
10160         (dump_node) Handles OP_STR_MIS.
10161
10162         * expr-prs.c: (MISSING_func, SYSMIS_func) Rewrote to handle string
10163         variables exceptions.
10164         (parse_function) Message fix.
10165         (ops[]) Added OP_STR_MIS.
10166
10167         * expr.h: Added OP_STR_MIS to OP_* enum.  Comment fixes.
10168
10169         * exprP.h: [__CHECKER__] Removed case statement circumlocution.
10170
10171         * glob.c: Removed set_scrnfile glob var.
10172         (init_glob) set_errorbreak set to 0 by default.
10173
10174         * groff-font.c: Changed included files.
10175         (groff_read_font) Initializes font_arena local var correctly.
10176         (default_font) New function.
10177
10178         * output.c: Comment fixes.
10179         (glob var disabled_devices) New variable.
10180         [GLOBAL_DEBUGGING] (static var iterating_driver_list) New
10181         variable.
10182         [GLOBAL_DEBUGGING] (reentrancy) New function.
10183         [GLOBAL_DEBUGGING] (outp_read_devices, outp_done, find_driver,
10184         outp_iterate_enabled_drivers) Calls to reentrancy().
10185         (destroy_list) New function.
10186         (outp_done) Moved code to destroy_list().
10187         (parse_options) Parses `listing', `screen', `printer' options
10188         internally.
10189         (configure_driver) Sets new `device' member of driver.
10190         (outp_iterate_enabled_drivers, outp_enable_device) New functions.
10191
10192         * output.h: Comment fixes.  New enum series OUTP_DEV_*.
10193         (struct outp_driver_struct) New member `device'.
10194
10195         * postscript.c: (find_encoding_file) Doesn't display its own error
10196         messages.
10197         (default_encoding) New function.
10198         (switch_font) Calls default_encoding() if no encoding can be
10199         found.
10200         (text) Makes up a character metric if none exists for the desired
10201         character.
10202         (load_font) Properly copies a fallback filename.  Calls
10203         default_font() for a font if none at all are known.
10204
10205         * set.q: Comment fixes.  Removed OUTPUT subcommand.
10206         (custom_listing) Calls outp_enable_device() to enable/disable
10207         listing device.
10208         (turn_screen_on) Removed.
10209         (internal_cmd_set) Calls outp_enable_device() to enable/disable
10210         screen, printer devices.
10211
10212         * settings.h: Comment fixes.
10213         (glob vars set_output, set_printer, set_screen, set_scrnfile)
10214         Removed.
10215
10216         * som-high.c: (som_submit_table, som_eject_page) Use
10217         outp_iterate_enabled_drivers() instead of iterating
10218         outp_driver_list directly.
10219
10220 Wed Dec  4 21:34:17 1996  Ben Pfaff  <blp@gnu.org>
10221
10222         * data-in.c: (parse_EDATE, parse_SDATE) New functions.
10223         (parse_string_as_format) Handles new formats.
10224         (parse_numeric) Now handles DOT and PCT formats.
10225
10226         * data-out.c: (convert_E, convert_F, insert_commas) Handle DOT
10227         format now.
10228         (convert_date) Handle EDATE and SDATE formats.
10229         (convert_CCx) Now if there's not room for the currency characters,
10230         converts it as F format if it's positive instead of giving up
10231         quickly.  Also fixed save-and-restore bug with decimal point
10232         characters.  
10233         (convert_format_to_string) Handles new formats.
10234
10235         * misc.c: (formats[]) Added new formats.
10236         (convert_fmt_ItoO) Supports new formats.
10237
10238         * sfm-read.c: (parse_format_spec) Supports new formats.  Better
10239         data checking.  New argument, all references changed.
10240
10241         * sfm-write.c: (write_format_spec) Supports new formats.
10242
10243         * var.h: New formats FMT_DOT, FMT_PCT, FMT_EDATE, FMT_SDATE.
10244         Comment fixes.
10245
10246 Sun Dec  1 17:19:00 1996  Ben Pfaff  <blp@gnu.org>
10247
10248         * cmdline.c: Comment fixes.
10249         (parse_command_line) Changed return type to void.
10250
10251         * data-in.c: (parse_string_as_format) Added FMT_CCA...FMT_CCE to
10252         switch.
10253         (parse_numeric) Handles international numbers (comma as decimal
10254         point).  Some reformatting.
10255
10256         * data-list.c: (parse_free) Default output format is now
10257         set_format instead of hard-coded F8.2.
10258         (read_from_data_list_list) Emits error message on undefined data
10259         only if set_undefined is nonzero.
10260
10261         * data-out.c: (convert_E) Changes decimal point from period to
10262         comma if appropriate.  Restructured.  Better comments.
10263         (convert_F) Changes decimal point from period to comma if
10264         appropriate.
10265         (insert_commas) Major bug with handling of negative values fixed.
10266         Also, inserts periods instead of commas if appropriate.
10267         (convert_CCx) New function.
10268         (convert_format_to_string) Added FMT_CCA...FMT_CCE to switch.
10269         (num_to_string) Changed `.' to set_decimal.
10270
10271         * dfm.c: Comment fixes.
10272         (dfm_close) Frees ext->line even in inline_file.
10273         (open_inline_file) New function.
10274         (open_file_r) When opening the inline file: now properly
10275         recognizes `BEGIN DATA.' line, and calls open_inline_file() to
10276         finish up.
10277         (read_record) Calls fh_close_handle() instead of dfm_close() to
10278         close the inline file.  Makes a copy of the line getl_buf to avoid
10279         interlock problems.
10280         (dfm_get_record) Restructured.  Now checks the return value of
10281         open_file_r().
10282         (cmd_begin_data) Moved open code into open_inline_file().  Relaxed
10283         checking for use of inline file.  No longer tries to close inline
10284         file.
10285
10286         * error.c: (glob var error_already_flagged) New var.
10287         (vmsg) Message change.  Now checks max number of errors/warnings,
10288         acts on it.
10289
10290         * file-handle.q: (fh_handle_name) Now allows closing of
10291         inline_file.
10292         (fh_init_files) Reformatted.
10293
10294         * get.c: (trim_dictionary) Checks SCOMP option instead of COMP.
10295
10296         * getline.c: (getl_include) Fixed bug that popped up when called
10297         when file queue was empty.
10298         (read_console) Resets error_count, warning_count,
10299         error_already_flagged to zero.
10300
10301         * glob.c: Many changes to update list of variables.
10302         (init_compat_dependent) Now this function is called whenever
10303         `compat' changes.  It now sets set_seed only if it hasn't
10304         previously been referenced.  It now calls
10305         lex_init_compat_dependent().
10306
10307         * include.c: (cmd_include_at) Frees temporary buffer instead of
10308         line buffer.  
10309         (cmd_include) Doesn't make copy of include file name.
10310
10311         * lexer.c: Comment fixes.
10312         (init_lex) Moved some code into new function
10313         lex_init_compat_dependent().
10314         (lex_init_compat_dependent) New function.
10315         (hex_val) Simplified.
10316         (preprocess_line) Uses set_endcmd instead of hardcoding `.'.
10317
10318         * main.c: Comment fixes.
10319         (main) Reformatted.
10320
10321         * misc.c: (formats[]) Added FMT_CCA...FMT_CCE.
10322         (check_input_specifier) Disallows FMT_CCA...FMT_CCE.
10323         (convert_fmt_ItoO) Detects FMT_CCA...FMT_CCE.
10324         (setup_randomize) Sets set_seed_used.
10325
10326         * set.q: Comment fixes.
10327         (custom_results) Conditionalizes on `compat'.
10328         (custom_log) Calls custom_journal().
10329         (set_ccx) New function.
10330         (cmd_set) Calls init_compat_dependent() when `compat' changes.
10331         Calls set_ccx() to handle CCA...CCE.  Sets set_grouping
10332         when set_decimal changes.  Range-checks values for MITERATE,
10333         MNEST.  Message fixes.
10334
10335         * settings.h: Comment fixes.
10336         (struct set_cust_currency) New struct.
10337         (set_cc[], set_grouping, set_seed_used) New global vars.
10338
10339         * var.h: (FMT_CCA...FMT_CCE) New output formats.
10340         (FCAT_OUTPUT_ONLY) New FCAT_* constant.
10341
10342 Thu Nov 28 23:14:07 1996  Ben Pfaff  <blp@gnu.org>
10343
10344         * glob.c: Revised variables to correspond to settings.h.
10345         (init_glob) Initializes variables from settings.h properly.
10346
10347         * set.q: Began long-overdue major revision to correspond to new
10348         philosophy.  Most code changed. 
10349
10350         * settings.h: Mostly changed; reorganized, reordered, large new
10351         comment.
10352
10353 Thu Nov 28 19:46:10 1996  Ben Pfaff  <blp@gnu.org>
10354
10355         * get.c: (cmd_save_internal) No longer forces compression off.
10356
10357         * sfm-read.c: (read_compressed_data) If eof is reached when
10358         reading a new instruction octet, only signal error if we're in the
10359         middle of a case.
10360
10361         * sfm-write.c: (COMPRESSION_BIAS) New #define.
10362         (struct sfm_fhuser_ext) New member `end'.
10363         (write_header) Refers to COMPRESSION_BIAS instead of magic 100.0.
10364         (ensure_buf_space) New function.
10365         (sfm_write_case) Reimplemented in order to support compression.
10366         (sfm_close) Writes out the remaining contents of the compression
10367         buffer if any.
10368
10369 Wed Nov 27 23:18:35 1996  Ben Pfaff  <blp@gnu.org>
10370
10371         * command.c: Defined SAVE and XSAVE commands in command table.
10372
10373         * common.h: second_lowest_value is of type flt64, not double.
10374
10375         * file-handle.h: Comment fix.
10376
10377         * get.c: Comment fixes.
10378         (static var `trns') New.
10379         (save_write_case_func, save_trns_proc, save_trns_free, null_func,
10380         cmd_save_internal, cmd_save, cmd_xsave) New functions.
10381         (dict_delete_run) Clears the variables and frees them now.
10382         (trim_dictionary) Sets default for compression.
10383         On KEEP subcommand, frees deleted variables as well as clearing
10384         them.  Finally got the sense of the test for deleting all
10385         variables correct.
10386         [DEBUGGING] (dump_dict_variables) Message fix.
10387
10388         * glob.c: (init_glob) set_compression set to 1 by default.
10389
10390         * list.q: Properly #includes config.h.
10391
10392         * misc.h: New macro REM_RND_UP.
10393
10394         * settings.h: Comment fix.
10395
10396         * sfm-read.c: (structs sysfile_header, sysfile_format,
10397         sysfile_variable; inline function bswap_int32) Moved to new file
10398         sfmP.h.
10399         (corrupt_msg) [__CHECKER__] No longer induces segfault.
10400         (sfm_read_dictionary) Fixed bug caused by failing to initialize
10401         var_by_index.
10402         (read_machine_flt64_info) Fixed some problems caused by confusion
10403         between flt64 and double types.
10404         (read_header) Message fix.
10405         (read_variables) Fixed set of cases in which we byte-swap sv.print
10406         and sv.write.  Fixed confusion of flt64 and double.
10407
10408         * sfm.h: (struct sfm_write_info) New.
10409
10410         * som-high.c: (som_draw_title) Properly frees `s'.
10411
10412         * temporary.c: (save_dictionary) Comment fix.
10413
10414         * var.h: Comment fixes.  New FMT_* enum, FMT_NUMBER_OF_FORMATS.
10415         (struct trns_header) Formatting fix.
10416         (struct save_trns) New.
10417
10418         * vars-atr.c: (discard_variables) Comment fix.
10419
10420         * sfm-write.c: New file, baseline release.
10421
10422         * sfmP.h: New file, baseline release.
10423
10424 Sun Nov 24 14:53:53 1996  Ben Pfaff  <blp@gnu.org>
10425
10426         * cmdline.c: (parse_command_line) `--version' output updated.
10427         (glob var syntax_message[]) Added my e-mail address.
10428
10429         * file-handle.q, lexer.c, vfm.c: Changed many instances of
10430         `illegal' to `invalid'.
10431
10432         * sfm-read.c: (struct sfm_fhuser_ext) New fields used as
10433         uncompression buffer.
10434         (sfm_close) Frees decompression buffer.
10435         (sfm_read_dictionary) Initializes decompression buffer.
10436         (buffer_input, read_compressed_data) New functions.
10437         (sfm_read_case) Restructured; now calls read_compressed_data() to
10438         handle compressed system file data.
10439
10440         * var.h: Comment fix.
10441
10442 Mon Nov 11 15:34:09 1996  Ben Pfaff  <blp@gnu.org>
10443
10444         * dfm.c: (dfm_close) Does not set h->{ext,class} because the
10445         caller handles it.
10446          
10447         * get.c: New comments.  New static var `get_file'.
10448         (cmd_get) Now fully implemented.  Calls discard_variables();
10449         initializes fv and lv for all variables; new debug code; sets
10450         up the dictionary; sets up the input program.
10451         (read_from_get, cancel_get) New functions.
10452
10453         * sfm-read.c: Comment fixes.
10454         (sfm_close) New static function.
10455         (sfm_read_dictionary) Properly sets up the class of the
10456         file_handle.  No longer cares what size the data is in records of
10457         type 7.  Also, on failure, properly cleans up the file_handle and
10458         free()s some stuff.
10459         (read_variables) No longer thinks it knows `nval' of the
10460         dictionary.  Now sets p.get.fv, etc., instead of speculatively
10461         setting fv itself.
10462         (read_value_labels) Fixed off-by-one error in indexing of
10463         var_by_index[].
10464         (sfm_read_case) New function.
10465         (sfm_r_class) New static var.
10466
10467         * var.h: (get_proc) New struct.
10468         (struct variable) New member p.get.
10469
10470 Thu Nov  7 20:52:28 1996  Ben Pfaff  <blp@gnu.org>
10471
10472         * get.c: Removed GTSV_OPT_MAP because of a misinterpretation of
10473         the manual's meaning.
10474         (rename_variables) New function.
10475         (trim_variables) Doesn't try to parse MAP any more.  Removed debug
10476         code.  Now properly reorders the dictionary on the KEEP keyword.
10477
10478         * sfm-read.c: (read_value_labels) Fixed some bugs regarding
10479         garbage collection.
10480
10481         * vars-atr.c: (clear_variable) New argument `dictionary *'.
10482         (rename_variable) New function.
10483         (free_val_lab) Reformatted.
10484
10485 Thu Nov  7 17:29:16 1996  Ben Pfaff  <blp@gnu.org>
10486
10487         * var.h: Reindented entire file.  Comment fixes.
10488         (glob vars var, var_by_name, nvar, N, nval, n_splits, splits)
10489         Removed.
10490         (glob var default_dict) New.
10491         (struct indirect_dictionary) Removed.
10492
10493         * Many other source files were changed to add `default_dict.'
10494         before all references to the dictionary of the active file.
10495         
10496         * vars-atr.c: (make_indirect_dictionary) Removed.
10497
10498         * glob.c: Reindented all variable declarations.  Updated for
10499         changed var.h.  Comment fixes.
10500
10501         * temporary.c: (restore_dictionary, save_dictionary) Simplified
10502         because now we can mainly copy dictionary structs.
10503
10504         * vars-prs.c: (is_dict_varname, parse_dict_variable,
10505         parse_variables) Takes dictionary instead of indirect_dictionary
10506         first argument.
10507         (parse_variables) Instead of calling make_indirect_dictionary,
10508         just sets DICT to &default_dict if DICT is NULL.  Of course, lots
10509         of `*dict.' references had to be changed to `dict->'.  Removed
10510         debug code.
10511
10512 Thu Nov  7 15:48:52 1996  Ben Pfaff  <blp@gnu.org>
10513
10514         * get.c: Added GTSV_OPT_* series of enums.
10515         (trim_dictionary, dict_delete_run) New functions.
10516         [DEBUGGING] (dump_dict_variables) New function.
10517         (cmd_get) Calls trim_dictionary() to get dictionary fully set-up.
10518         [DEBUGGING] Calls dump_dict_variables() to display results.
10519
10520         * glob.c: (cmp_variable) Now a public function declared in var.h.
10521
10522         * sfm-read.c: Turned off debug code.  Comment fixes.
10523         (read_machine_int32_info, read_machine_flt64_info) New functions
10524         to parse type 7 records.
10525         (sfm_read_dictionary) Properly byteswaps several fields now.
10526         Calls read_machine_*_info() to parse type 7 subtypes 3 and 4
10527         records.  [DEBUGGING] Dumps dictionary.
10528         (read_variables) Sets `index' field of variables created properly.
10529         Constructs avl tree of variables in dictionary.  [DEBUGGING] No
10530         longer dumps dictionary.
10531         (read_value_labels) Properly byteswaps fields.  [DEBUGGING] New
10532         debug code.
10533         [DEBUGGING] (dump_dictionary) No longer stubbed out.
10534
10535         * temporary.c: (restore_dictionary) Destroys `var_by_name' glob
10536         var before destroying any variables just to save a little time.
10537
10538         * var.h: (struct variable) Reordered in order to make name[] the
10539         first member; this makes pointers to `variable' pointers to the
10540         variable name, simplifying avl trees, etc.
10541         (struct indirect_dictionary) New struct.
10542
10543         * vars-atr.c: (find_variable) Rewritten for efficiency.
10544         (make_indirect_dictionary, is_dict_varname, parse_dict_variable)
10545         New functions.
10546         (is_varname) Rewritten for efficiency.
10547         (parse_variables) New argument, which is a `dictionary *'.  All
10548         references changed.  This function now reads variable names from
10549         the dictionary passed, or from the default dictionary if NULL.
10550
10551 Tue Nov  5 18:34:59 1996  Ben Pfaff  <blp@gnu.org>
10552
10553         * misc.h: Added new macro DIV_RND_UP to perform integer division,
10554         rounding up.  Changed many references to ROUND_UP to use this
10555         instead.
10556
10557         * sfm-read.c: Includes avl.h.
10558         (corrupt_msg) Induces a segfault under Checker.
10559         (macro assertive_bufread) New.  Many references to bufread() now
10560         use this instead.
10561         (sfm_read_dictionary) Split up into several functions.  Added code
10562         to read dictionary records following the the type 2 records.  Not
10563         quite complete.  New variable `var_by_index'.
10564         (read_header, read_variables) New functions extracted from
10565         sfm_read_dictionary().
10566         (read_value_labels) New function.
10567         (bufread) Checks ferror() if fread() doesn't return the expected
10568         value; if ferror() is zero it's just EOF.
10569         (dump_dictionary) Stubbed out.
10570
10571         * BTW: The source code now exceeds 50000 lines!
10572         
10573 Mon Nov  4 22:03:28 1996  Ben Pfaff  <blp@gnu.org>
10574
10575         * command.c: Added GET to cmd_table[].
10576
10577         * list.q: Removed reference to alloca headers.
10578         (cmd_list) Gave prototype.
10579
10580         * sfm-read.c: Added DEBUGGING comments.
10581         (sfm_read_dictionary) Checks bias correctly.  Sets
10582         dict->var_by_name to NULL.  Calculates long_string_count
10583         correctly.  realloc's dict->var[] array to minimum size.
10584         [DEBUGGING] Calls dump_dictionary.
10585         [DEBUGGING] (dump_dictionary) New function.
10586
10587         * temporary.c: (save_dictionary) Sets var_by_name to NULL.
10588         (restore_dictionary) If the dictionary contains a non-NULL
10589         var_by_name, uses that instead of generating one.
10590         (free_dictionary) Destroys var_by_name.
10591
10592         * var.h: (struct dictionary) Added field `var_by_name'.
10593
10594         * get.c: New file, not complete.
10595
10596 Sun Nov  3 12:24:36 1996  Ben Pfaff  <blp@gnu.org>
10597
10598         * mis-val.c: New enums MV_NOR_*.  New struct num_or_range.
10599         (parse_num_or_range) New function.
10600         (parse_numeric) Reimplemented in order to support LOW THRU <n> and
10601         <n> THRU HIGH missing values.
10602
10603         * output.h: [__GNUC__>1 && __OPTIMIZE__] (width, height) Made
10604         __attribute__((const)).
10605
10606         * q2c.c: (get_token) Merged isdigit || isalpha into isalnum.
10607
10608         * sfm-read.c: Finished reference implementation.
10609
10610         * sfm.h: Includes var.h.
10611
10612         * var.h: Comment fixes.
10613         (struct `variable') Reordered some fields.
10614
10615         * vars-atr.c: (is_num_user_missing) Added support for MISSING_*
10616         constants added previously.
10617
10618 Wed Oct 30 17:13:08 1996  Ben Pfaff  <blp@gnu.org>
10619
10620         * common.h: Comment fixes.  Added declaration of
10621         `second_lowest_value' as variable or macro.  Made `compat_type',
10622         `pgm_state_type' into anonymous enums.
10623
10624         * display.c: Comment fix.
10625
10626         * glob.c: [ENDIAN==UNKNOWN] Added definition for `endian' global
10627         var.
10628         [!defined SECOND_LOWEST_VALUE] Added definition for
10629         `second_lowest_value' global var.
10630         (compat, pgm_state global vars) Changed types to `int'.
10631         (init_glob) Initializes `second_lowest_value'.
10632
10633         * sfm-read.c: Continued work, not complete.
10634
10635         * var.h: Added new MISSING_* constants to handle LOWEST and
10636         HIGHEST.
10637
10638 Sat Oct 26 23:06:06 1996  Ben Pfaff  <blp@gnu.org>
10639
10640         * sfm-read.c: New file, not complete.
10641
10642         * cases.c: (vec_insert) Changed vector expansion algorithm.
10643         (vec_delete) Fixed bug that screwed up deletion sometimes, it was
10644         mucking up the RECODE transformation in particular.
10645         (envector) Harmless change in notation.
10646
10647         dfm is now fairly well tested again.  
10648         * dfm.c: (dfm_get_record) Only returns ext->ptr if ext is
10649         non-NULL--duh.
10650         (cmd_begin_data) if(ext->line) replaced by if(ext && ext->line).
10651
10652         * recode.c: Comment fix.
10653
10654         * sfm.h: Interface should be fairly final now, or at least for a
10655         day or so...
10656
10657         * vfm.c: [DEBUGGING] (index_to_varname) New function.
10658         (open_active_file) [DEBUGGING] Translates ccase indices into
10659         variable names now to make it easier to understand what's really
10660         going on.
10661
10662 Sat Oct 26 20:46:31 1996  Ben Pfaff  <blp@gnu.org>
10663
10664         * data-in.c: Comment fix.
10665
10666         * data-list.c: Includes dfm.h.
10667         (do_reading) Uses new function dfm_push_cust().
10668
10669         * data-out.c: (convert_time, convert_WKDAY, convert_MONTH) Added
10670         `return 1;' at end.
10671
10672         * file-handle.h: Completely changed.  Some parts split off into
10673         new file dfm.h.  Implemented in file-handle.q.
10674         (enum FH_*) Removed.
10675         (struct fh_ext_class) New struct.
10676         (struct file_handle) Retained only these fields: name, norm_fn,
10677         fn, recform, lrecl, mode.  New fields class, ext.
10678         (get_handle_by_name, get_handle_by_filename, parse_file_handle,
10679         close_handle, handle_name) Added `fh_' prefix to name, all
10680         references changed.
10681
10682         * dfm.h: New file, implemented in dfm.c.
10683         (get_record, put_record, fwd_record, bkwd_record, set_record,
10684         get_cur_col) Functions moved from file-handle.h, now prefixed with
10685         `dfm_'.
10686         (dfm_push_cust) New function.
10687
10688         * sfm.h: New file.  Incomplete.
10689
10690         * dfm.c: All functions adjusted/rewritten for new dfm/fhp
10691         interface.  Functions reordered, comments changed.  Not well
10692         tested, probably full of bugs.
10693         (struct dfm_fhuser_ext) New struct.
10694         (dfm_close) New function.
10695         (open_file_r) Pickier about finding `BEGIN DATA.' line.
10696         (open_file_w) User messages changed.
10697         (get_record) Comment fixed.
10698         (read_record) Increments ext->ln even for inline_file.  Calls
10699         dfm_close() for inline_file when `END DATA.' encountered.
10700         (dfm_get_record) Experimental restructuring.
10701         (dfm_push_cust) New function.
10702         (cmd_begin_data) Detects whether the inline file was fully read by
10703         checking whether it is still open; detects whether it was read at
10704         all by checking whether the line number is greater than zero.
10705
10706         * file-handle.q: All functions adjust/rewritten for new dfm/fhp
10707         interface.  Functions reordered, comments changed.  Not well
10708         tested, probably full of bugs.
10709         (init_file_handle) Removed initializers for obsolete fields, added
10710         new fields.
10711         (fh_close_handle) Much simpler, now mainly calls the class
10712         function.
10713         (fh_init_files) Renamed inline file internal filename.
10714
10715         * file-type.c: Includes dfm.h.
10716         (read_from_file_type) Doesn't use dfm internal state anymore.
10717
10718         * inpt-pgm.c, print.c: Include dfm.h.
10719
10720         * recode.c: (internal_cmd_recode) Casts strlen() return value to
10721         int in comparison with other int.
10722
10723         * som-high.c: (build_target) Fixed operator precedence problem in
10724         if statement (& versus ==).
10725
10726 Sat Oct 26 10:39:25 1996  Ben Pfaff  <blp@gnu.org>
10727
10728         * dfm.c: (read_record) Can now read fixed-length records; not
10729         tested.
10730         (put_record) Can now write fixed-length records; not tested.
10731
10732         * file-handle.h: FH_* defines changed to enums.  New enum series
10733         FH_RF_*, FH_MD_*.
10734         (struct file_handle) New members recform, lrecl, mode.
10735
10736         * file-handle.q: Parser changed.
10737         (internal_cmd_file_handle) Added support for new /RECFORM, /MODE,
10738         /LRECL subcommands.  These are compatible with Windows.
10739         (init_file_handle) Initializes recform, mode fields.
10740
10741         * q2c.c: (get_line) When outputting `!' comment lines, now
10742         increments the output file line number so that `#line' directives
10743         are correct.
10744         (make_identifier) New function that converts an arbitrary string
10745         into a valid C identifier.
10746         (dump_vars) Calls make_identifier() in two places in order to
10747         suppress some errors for bad identifiers.
10748         (make_match) Allows TRUE as synonym for YES and FALSE as synonym
10749         for NO.  Allows numbers to be prefixed by underscores to make them
10750         acceptable C identifiers but still to be parsed as numbers by the
10751         Fiasco lexer.
10752
10753 Thu Oct 24 20:13:42 1996  Ben Pfaff  <blp@gnu.org>
10754
10755         * command.c: Re-enabled RECODE, SAMPLE, SELECT IF.
10756         
10757         * dfm.c: Comment fixes. (get_record) Gives error if file handle
10758         was opened for writing.
10759         (open_file_w) New function.
10760         (read_record) Uses strncasecmp if available.  Improved error
10761         messages, comments.
10762         (put_record) New function.
10763
10764         * file-handle.h: Moved function comments into dfm.c and
10765         file-handle.q.  Comment fixes.  Removed declarations of
10766         tilde_expand() and normalize_filename().
10767         (struct file_handle) Changed `open' from boolean to enumerated
10768         field to allow for three states--closed, open for reading, open
10769         for writing--all references changed.
10770
10771         * file-handle.q: Includes filename.h.
10772
10773         * print.c: (CMD_* enums) Renamed PRT_* and moved into var.h; all
10774         references changed.
10775         (alloc_line) Makes allowance for line terminator characters in
10776         calculations.
10777         (print_trns_proc) Now handles OUTFILE, WRITE differences.
10778         (print_space_trns_proc) Handles OUTFILE differences.
10779
10780         * recode.c, sample.c: Comment fixes.
10781
10782         * var.h: (struct print_trns) Changed boolean field `eject' to
10783         bitmapped field `options'; all references changed.  New enums
10784         PRT_* for use with this field.
10785
10786         * exception.h, test-exception.c: Removed.
10787
10788 Thu Oct 24 17:47:14 1996  Ben Pfaff  <blp@gnu.org>
10789
10790         * ascii.c: (delineate) Turned off debug output.
10791
10792         * common.c: [Checker and Linux] (__assert_fail, __eprintf) Moved
10793         to error.c.
10794
10795         * data-in.c: (parse_string_as_format) Sets the entire string value
10796         to spaces, not just the short string part of it.  Is this correct
10797         now? 
10798
10799         * data-out.c: (convert_date) Fixed DATETIME format problems with
10800         decimal places, removed debug code.
10801
10802         * dfm.c: (open_file_r) Fixed bug where an error would occur in the
10803         middle of parsing BEGIN DATA that would cause the lexer to read
10804         from a wild pointer `prog'; now calls new function
10805         preprocess_line() in lexer.c.
10806
10807         * error.c: [__CHECKER__] (hcf) Calls induce_segfault() on improper
10808         termination.
10809         [Checker and Linux] (__assert_fail, _eprintf) Moved from common.c.
10810         Now call induce_segfault() to induce the segfault.
10811         (induce_segfault) New function.
10812
10813         * expr-opt.c: Comment fix.
10814         (parse_sysvar) New function.
10815         (parse_primary) Added system variable support--calls
10816         parse_sysvar().
10817         (global var ops) Added OP_CASENUM operator.
10818
10819         * expr.h: Comment fixes.
10820         (OP_* enum) added OP_CASENUM operator.
10821         (struct casenum_node) New struct.
10822         (union any_union_union) New member `cas' of type `casenum_node'.
10823
10824         * glob.c: (global var last_vfm_invocation) New var.
10825         (init_glob) Initializes last_vfm_invocation.
10826
10827         * lexer.c: (lookahead) Fixed reversed condition on if statement.
10828
10829         * getline.c: (get_line) Split into get_line() and preprocess_line().
10830         (preprocess_line) New function.
10831
10832         * var.h: Declares last_vfm_invocation.
10833
10834         * vfm.c: (procedure) Sets last_vfm_invocation.
10835
10836 Wed Oct 23 21:53:43 1996  Ben Pfaff  <blp@gnu.org>
10837
10838         * command.c: (parse_cmd) Fixed bad assertion related to
10839         lookahead().
10840
10841         * data-in.c: (parse_month) Implemented to parse months according
10842         to full interpretation of standard.
10843         (to_roman) New function.
10844         (parse_wk_delimiter) Bug fix (forgot to skip `WK' in string).
10845         (parse_weekday) Bug fix (forgot to skip all the day name).
10846
10847         * data-list.c: (read_from_data_list_fixed) Fixed bug that screwed
10848         up parsing of multirecord data items.  Also fixed user message.
10849
10850         * data-out.c: Comment fix.
10851         (year2, year4, convert_date, convert_time, convert_WKDAY,
10852         convert_MONTH) New functions to support time & date output.
10853         (convert_format_to_string) Calls new time & date output routines.
10854
10855         * expr-prs.c: (nary_num_func) Found a bug, but didn't fix it yet.
10856
10857         * lexer.c: (lookahead) Noted a previously unnoticed caveat in
10858         comment.
10859
10860         * main.c: [DEBUGGING] (dump_token) Updated to handle getline.h.
10861
10862         * misc.c: (global var formats) Fixed declarations of DATETIME,
10863         TIME, DTIME.
10864
10865         * postscript.c: (text) Fixed a pair of bugs in the reallocation of
10866         the output_char buffer.
10867
10868         * vars-prs.c: (parse_DATA_LIST_vars) Fixed a failure to free
10869         memory bug.  Fixed user messages.
10870
10871 Tue Oct 22 17:27:04 1996  Ben Pfaff  <blp@gnu.org>
10872
10873         * Removed #pragma argsused from lots of places.
10874         
10875         * data-in.c: Implemented zoned decimal and time-date formats.
10876         Untested.  This is a huge chunk of code--maybe 1000 lines and 50
10877         new functions.
10878
10879         * data-out.c: Implemented zoned decimal format.
10880
10881         * expr.h: Moved yrmoda() declaration here from exprP.h.
10882
10883         * misc.c: (global var formats) Minor fixes--added
10884         FCAT_SHIFT_DECIMAL to formats N and Z.
10885         (convert_fmt_ItoO) Added support for format Z.
10886
10887         * som-frnt.c: (som_set_value) Fixed bug regarding string values.
10888
10889 Mon Oct 21 20:39:59 1996  Ben Pfaff  <blp@gnu.org>
10890
10891         * command.c: (parse_cmd) [GLOBAL_DEBUGGING] Inserted call to
10892         som_check_workspace() that is activated between commands.
10893
10894         * data-list.c: (dump_fixed_table, dump_free_table) Finished these
10895         for good, I hope.
10896
10897         * list.q: (begin_row) Changed title expansion style from
10898         SOPT_X_VERT to SOPT_X_SHSP.
10899
10900         * som-frnt.c: Now includes `somP.h'.
10901         (som_push_workspace, som_pop_workspace) New functions that, taken
10902         together, form a solution to the recursive table building problem
10903         mentioned yesterday.  Surrounded every table output routine
10904         throughout the program with calls to these functions.
10905         [GLOBAL_DEBUGGING] (som_check_workspace) New function.
10906         (som_create_table) Checks that there's an active workspace.
10907         (som_destroy_all_tables, som_crush) Removed.
10908
10909         * som-high.c: (global var som_preserve_tables) Removed, all
10910         references deleted.
10911         (som_submit_table) Checks that there's an active workspace.
10912         (dump_columnated_table) Doesn't columnate tables that would have
10913         just one row per column.
10914         (dump_crush_page, som_dump_crush_page) Removed debugging code.
10915         (som_dump_crush_page) Moved row number labels from left side of
10916         tables to right side.
10917         (som_get_table_size) Added support for SOPT_X_SHSP.
10918
10919         * som.h: New cell expansion type SOPT_X_SHSP.
10920
10921         * somP.h: (global vars arena_stack, n_arena_stack, m_arena_stack)
10922         New vars.
10923         (global var curtab_arena) Moved from som-frnt.c.
10924
10925 Sun Oct 20 13:45:28 1996  Ben Pfaff  <blp@gnu.org>
10926
10927         * ascii.c: [GLOBAL_DEBUGGING] (SUPPRESS_WARNINGS) New debug option
10928         that causes bad location warnings to be suppressed.
10929         (delineate) Saves current font when calling draw_text(); fixed
10930         handling of NULLs when backing up.  Also fixed line-wrapping bug.
10931
10932         * command.c: Re-enabled `LEAVE', `NUMERIC', `PRINT', `PRINT EJECT',
10933         `PRINT FORMATS', `PRINT SPACE', `STRING', `TITLE', `WRITE'.
10934
10935         * common.c: Added code to cause assertion failure to dump core
10936         when run under Checker.
10937
10938         * data-list.c: (dump_fixed_table) Fixed some inconsistencies, but
10939         there are still bugs.
10940
10941         * glob.c: (__eprintf) Removed.
10942
10943         * list.q: Inserted som_preserve_tables kluge that prevents tables
10944         from being thrown away due to recursive table building through
10945         som_output_line being called from a transformation during the LIST
10946         procedure invocation.  This is a general problem that must be
10947         solved in a better way since it applies to all procedures in
10948         general.
10949         (begin_row) Changed title options to SOM_X_VERT from SOM_X_BOTH.
10950         (flush_table) Removed SOM_TOPT_PRESERVE from submission options.
10951
10952         * numeric.c: Fixed several errors in the form of msg() calls.
10953
10954         * print.c: Updated for use of som.
10955         (dump_table) Reimplemented.
10956         (print_trns_proc) Calls som_eject_page() instead of eject_page().
10957         Calls som_output_text() instead of outs_line().
10958
10959         * som-frnt.c: (som_destroy_all_tables) Sets som_preserve_tables to
10960         0.
10961         (som_output_text) Function moved from som-low.c.  Interface
10962         changed.
10963
10964         * som-high.c: (som_preserve_tables) New global public variable
10965         declared in som.h.
10966         (som_submit_table) Destroys the tables only if som_preserve_tables
10967         is 0.
10968         (paginate_horizontally) Bugfix: sets som.mpw even if there's only
10969         one subrow per row.  Now labels subrows if there's more than one
10970         subrow per row.
10971         (dump_crush_table) Added wishlist comment.
10972         (som_eject_page) New public function declared in som.h.
10973
10974         * som-low.c: (som_dump_crush_page) Draws row labels if there's
10975         more than one subrow per row.
10976         (som_output_text) Moved to som-frnt.c.
10977
10978         * som.h: (SOM_TOPT_PRESERVE) Removed.
10979
10980         * title.c: (get_title) Changed interface.
10981         (cmd_title) Changed `title' to `outp_title'.
10982         (cmd_subtitle) Changed `subtitle' to `outp_subtitle'.
10983
10984 Sun Oct 20 09:04:15 1996  Ben Pfaff  <blp@gnu.org>
10985
10986         * list.q: (flush_table) Conforms to new partial options in
10987         som_submission_form.
10988
10989         * som-high.c: (paginate_horizontally) Changed form of subrow
10990         number labels.
10991         (build_target) Omits spacing before table if
10992         SOM_TOPT_PARTIAL_OMIT_TOP is selected.
10993         (dump_crush_page) Changed interface.  Only trims bottom rule if
10994         SOM_TOPT_PARTIAL_OMIT_BTM is not selected.
10995         (dump_crush_table) Handles partial tables.
10996         (output_row_label) New function.
10997         (som_dump_crush_page) Emits subrow number labels.  Draws vertical
10998         rule on the right edge of narrow subrows.
10999
11000         * som.h: Changed SOM_SUB_PARTIAL_* series of submission type
11001         constants to a series of SOM_TOPT_PARTIAL_* submission options.
11002         All references updated.
11003
11004 Fri Oct 18 19:46:49 1996  Ben Pfaff  <blp@gnu.org>
11005
11006         * misc.c: Comment fix.
11007
11008         * som-high.c: (examine_table) Treats crushed tables separates for
11009         purpose of determining header size.
11010         (paginate_horizontally) Allots space for line numbers in crushed
11011         tables with lots of subrows per row.  Calculates the `maximum page
11012         width', the width of the widest horizontal page.
11013         (build_target) Removed trim argument; all references changed.
11014         Stricter assertions.  (dump_crush_page) New function.
11015         (dump_crush_table) Reimplemented.
11016
11017         * som-low.c: (som_dump_page) Uses new RULE_ROW &c. constants.
11018         (som_dump_crush_page) Reimplemented, interface changed.
11019
11020         * somP.h: Many many new helper macros for use with crushed tables.
11021         (global var som) Removed `tv', `cum_y' members; all references
11022         removed.  New members `mpw', `digit_space'.
11023
11024 Sun Sep 29 19:37:03 1996  Ben Pfaff  <blp@gnu.org>
11025
11026         * arena.c: (arena_alloc) [!DISCRETE_BLOCKS] Removed `size'
11027         variable, changed to constant 1024.
11028         (arena_ca_strdup) Changed `sizeof(a_string)' to
11029         `sizeof(c_string)'.
11030         (arena_ca_strdup) [!DISCRETE_BLOCKS] Changed bad cast from
11031         `(c_string *)' to `(char *)'; this fixed some offset problems.
11032
11033         * filename.c: (readlink_malloc) Changed initial allocation from
11034         100 bytes to 128.
11035         (good_getcwd) Changed from xmalloc() to local_alloc(); removed
11036         comment.
11037
11038         * postscript.c: (read_fontmap) Fixed leak by changing &owner to
11039         &fm->owner in several places.
11040
11041         * som-high.c: (output_table) Changed interface to rest of world.
11042         (examine_crush_table) Removed.  Crushed tables are re-broken now,
11043         in preparation for rewrite.
11044
11045         * som.h: Comment fix.
11046
11047 Sat Sep 28 21:28:07 1996  Ben Pfaff  <blp@gnu.org>
11048
11049         * ascii.c: (ascii_init_driver) Disposes of x->file.filename and x
11050         itself in the cleanup stage.
11051
11052         * descript.q: (display) At least temporarily, changed the table
11053         format to a crushed table.
11054
11055         * list.q: (begin_row) At least temporarily, added horizontal lines
11056         between cases.
11057
11058         * som-high.c: (examine_crush_table) Sets som.hh to the width of
11059         the horizontal "headers," that is, to the width of the far left
11060         and far right rules.
11061         (justify_pagination) Sets som.th to the width of the widest row
11062         in the crushed table.  Fixed inner loop off-by-one error.
11063
11064         * som-low.c: (som_dump_crush_page) Added code to draw horizontal
11065         rules.
11066
11067         * somP.h: Comment fix.
11068
11069 Fri Sep 27 20:08:39 1996  Ben Pfaff  <blp@gnu.org>
11070
11071         * filename.c: (open_file_ext) Now, doesn't set f->file to NULL
11072         before closing it; also, opens the constructed filename `s'
11073         instead of f->filename.
11074
11075         * postscript.c: Moved initialization of x->loaded, x->prop,
11076         x->fixed, x->current, also the add_encoding() calls, into
11077         postopen().
11078         (preclose) Destroys x->combos; sets x->loaded, x->combos to NULL;
11079         sets x->last_font to NULL; sets x->next_combo to zero.
11080
11081         * som-high.c: (crushed_row_height) Moved definition farther up.
11082         (som_submit_table) Doesn't calculate line width, font size until
11083         after calling open_page(), to accomodate changes to PostScript
11084         driver.
11085         (vert_headers) Removed; equivalent functionality moved to
11086         examine_table(), examine_crush_table().
11087         (justify_pagination) Replaced with different algorithm.
11088         (dump_crush_table) Bugfix that caused tables to fail to be clipped
11089         at the bottom of the page.
11090
11091 Thu Sep 26 22:20:26 1996  Ben Pfaff  <blp@gnu.org>
11092
11093         * command.c: Added cmd_list back into cmd_table.
11094
11095         * freq.c, frequencies.q, repeat.c, list.q, vars-atr.c, vfm.c:
11096         Comment fix: `#define DEBUGGING' --> `#define DEBUGGING 1'.
11097
11098         * list.q: (flush_table) Updated to new som_submission_form format.
11099
11100         * som-frnt.c: Comment fix.
11101
11102         * som-high.c: Changed `#endif' to `#undef EXTERN'.
11103         (output_table) Calls som_get_table_size() directly; handles
11104         crushed tables.
11105         (examine_crush_table) New function; calls vert_headers().
11106         (examine_table) Moved some code into new function, vert_headers().
11107         (justify_pagination) New function.
11108         (dump_plain_table) Removed `static' from `cy'.
11109         (dump_crush_table) New function.
11110
11111         * som-low.c: (som_dump_crush_page) New function.
11112
11113         * som.h: Comment fixes.
11114         (enum SOM_TOPT_CRUSH) New.
11115         (SOM_SUB_PARTIAL_BEG, SOM_SUB_PARTIAL_MID, SOM_SUB_PARTIAL_END)
11116         Temporarily set to zero to make do with LIST procedure.
11117
11118         * somP.h: Re-ordering.
11119
11120 Wed Sep 25 19:36:11 1996  Ben Pfaff  <blp@gnu.org>
11121
11122         * som.c: Split into som-frnt.c, som-high.c, som-low.c.
11123
11124         * somP.h: New file for use by som-high.c, som-low.c.
11125
11126         * q2c.c: Added definition for VME.
11127         (get_line) Now dumps `!' comment lines to the output file
11128         verbatim.
11129
11130         * crosstabs.q, descript.q, file-handle.q, frequencies.q, list.q,
11131         set.q: Changed format of `!' comment lines.
11132
11133 Tue Sep 24 18:39:09 1996  Ben Pfaff  <blp@gnu.org>
11134
11135         * All source files: Added copyright notice.
11136
11137         * common.c: (xmalloc, xrealloc, xstrdup) Cast size_t's to unsigned
11138         longs in msg() calls.
11139
11140         * con32s.c: (xmalloc, xrealloc) Updated from common.c.
11141
11142         * q2c.c: (xmalloc, xrealloc, xstrdup) Updated from common.c.
11143
11144 Sat Sep 21 23:16:31 1996  Ben Pfaff  <blp@gnu.org>
11145
11146         * output.c: (outp_read_devices) Changed criteria for
11147         distinguishing different types of lines.
11148
11149 Fri Sep 20 22:52:28 1996  Ben Pfaff  <blp@gnu.org>
11150
11151         * cmdline.c: Changed syntax message.
11152
11153         * filename.c: (good_getcwd) Bug fix (?).
11154         (normalize_filename) [__BORLANDC__] Uses _fullpath() library
11155         function.
11156         (search_path) Appends DIR_SEPARATOR to directory name only if it
11157         does not already end with one.
11158
11159         * glob.c: Checks STAT_PAGER envvar before PAGER.
11160
11161         * output.c: Checks environment variables instead of just local
11162         macros.
11163
11164 Tue Sep 10 21:39:00 1996  Ben Pfaff  <blp@gnu.org>
11165
11166         * arena.c: (arena_destroy) Swatted a subtle bug that cropped up
11167         when the pointer passed to the function was within the arena
11168         itself, so that it couldn't properly be set to NULL _after the
11169         arena was freed_.
11170
11171         * command.c: Re-enabled DISPLAY.
11172
11173         * display.c: Rewritten to handle tables.  Untested.
11174
11175         * filename.c: (search_path) Fixed memory leak.
11176
11177         * frequencies.q: (cmd_frequencies) Frees v_variables.
11178         (postcalc) Calls cleanup_freq_tab() after displaying statistics.
11179         (cleanup_freq_tab) New function to garbage collect.
11180         (dump_full) Elegantized.
11181
11182         * main.c: New comment.
11183
11184         * output.h: New tag for tagged quotes: TAG_NEWLINE.
11185
11186         * postscript.c: Comment fix.
11187         (release_fontmap, free_font_entry) New functions.
11188         (ps_init_driver) Sets free_font_entry() as the freefunc for
11189         hashtable `loaded'.  Calls release_fontmap() when destroying a
11190         driver; also frees the output filename; also frees the
11191         ps_driver_ext block.
11192         (free_ps_encoding) Frees the filename as well as the encoding
11193         block.
11194         (output_encodings) Frees the line buffer and pops the msg-filename
11195         stack.
11196         (read_fontmap) Frees the fontmap filename and the line buffer.
11197         (postopen, preclose) Misc. garbage collection fixes.
11198         (ps_open_page) Destroys the `combos' hash table; sets `last_font'
11199         to NULL; this fixes some output problems.
11200         (text) Handles TAG_NEWLINE.  Untested.
11201
11202         * som.c: (cell_byte_size) Merged SCON_VALUE and SCON_TEXT cases.
11203         (som_set_string) Removed.  All references changed to
11204         `som_set_text'.
11205         (som_set_text) Rewritten.  New interface.  More general.
11206
11207         * som.h: Minor format changes.
11208         (struct som_value_cell) Removed; all references changed to
11209         `som_text_cell'.
11210         (enums SOT_*) Changed.
11211
11212 Mon Sep  9 21:43:13 1996  Ben Pfaff  <blp@gnu.org>
11213
11214         * command.c: Re-enabled SPLIT FILE.
11215
11216         * postscript.c: Comment fix.
11217
11218         * som.h: Added `SOT_NONE'.
11219
11220         * split-file.h: (cmd_split_file) Removed superfluous parenthesis.
11221
11222         * vfm.c: (dump_splits) Reimplemented.
11223
11224 Sat Sep  7 22:35:12 1996  Ben Pfaff  <blp@gnu.org>
11225
11226         * Compiled the project under gcc 2.7.2, which gave some new
11227         warnings.  This led to many additions of casts from unsigned to
11228         int sprinkled throughout the code.
11229         
11230         * arena.c: Many uses of `unsigned' changed to `size_t'.
11231
11232         * command.c: Added END FILE, END REPEAT to command table.
11233         (var cmd_end_repeat) Renamed cmd_end_repeat_p.
11234         (find_command, FILE_TYPE_okay) Not commented out anymore.
11235         (parse_cmd) Calls FILE_TYPE_okay again.
11236         (output_line) Added calls to som_output_text() to put the line
11237         in the output files.
11238
11239         * common.c: (macro VME) Format changes.
11240         (xstrdup) Asserts that its argument is not NULL.
11241         
11242         * data-list.c: Implemented dump_fixed_table().
11243         
11244         * inpt-pgm.c: Formatting changes.  Comment changes.
11245         (end_case_proc) Renamed end_case_trns_proc.
11246         (cmd_end_file, end_file_trns_proc) New functions.
11247
11248         * misc.c: Many uses of `int' and `unsigned' changed to `size_t'.
11249
11250         * misc.h: (local_strdup) New macro corresponding to strdup() but
11251         allocating its data through local_alloc() if possible--that is, if
11252         GNU C is in use.
11253
11254         * postscript.c: Comment changes.
11255         (quote_ps_name, quote_ps_string, output_encodings) New functions.
11256         (output_line, add_string) New macros supporting
11257         output_encodings().
11258         (postopen) Fixed contents of ${fixed-font} and ${prop-font}
11259         substitution vars.  Calls output_encodings() when a line
11260         consisting of `!encodings' is encountered.
11261         (preclose) Some code moved into quote_ps_string().
11262         (dump_line) Changed into macro supporting dump_fancy_line().
11263         (switch_font) Now outputs DSC "%%IncludeResource: font (...)"
11264         command when appropriate.
11265         (write_text) Fixed `literal_char' array (I think it's fixed, at
11266         least.)
11267         (text) Fixed bug when width was zero.  Now exits immediately on
11268         zero height_left.  Now, when executing `goto restart;', checks
11269         that cp<end, so that we don't read beyond end-of-string.  Also,
11270         outputs the correct code to the output file by outputting the code
11271         from the metric instead of the internal metric index.
11272
11273         * repeat.c: (cmd_end_repeat) New function.
11274
11275         * som.c: (var som) `headers' renamed `options' and semantics
11276         changed.  All references changed.
11277         (draw_title) `if(px!=-1 || px!=-1)' --> `if(px!=-1 || py!=-1)'.
11278         (build_target) Only inserts spacing if SOM_TOPT_SPACING not
11279         selected.
11280         (som_text_table) Removed.
11281         (som_output_text) New function.
11282
11283         * som.h: (struct som_submission_form) Removed `header', `reuse',
11284         replaced with bitmapped field `options'.
11285         (SOM_TOPT_*) New enum set for som_submission_form.options.
11286         (SOT_*) New enum set for som_output_text().
11287
11288         * temporary.c: (copy_variable) When copying the var label, only
11289         calls xstrdup() if it's non-NULL.
11290
11291         * var.h: (enum type `vartype') Removed; all references changed to
11292         `int'.
11293
11294         * vars-atr.c: (init_variable) Changed local var `nbytes' from
11295         `int' to `size_t'.
11296
11297 Thu Sep  5 22:05:56 1996  Ben Pfaff  <blp@gnu.org>
11298
11299         * font.h: Comment changes.
11300
11301         * groff-font.c: (groff_read_font) Initializes `name' field to
11302         NULL.  Handles `encoding' field.
11303
11304         * hash.c: (hsh_dump) [GLOBAL_DEBUGGING] Output formatting changes.
11305
11306         * postscript.c: (struct font_entry) Removed `position' field.
11307         (struct ps_font_combo) New struct.
11308         (struct ps_driver_ext) Removed field `next_position'.  New fields
11309         `combos', `next_combo'.  `last_font' field changed from
11310         `font_entry *' to `ps_font_combo *'.
11311         (ps_init_driver) Reformatted; handles new fields.  When
11312         OPO_AUTO_ENCODE is set, adds the two default fonts' encodings to
11313         the encoding list.
11314         (get_encoding, find_encoding_file) New functions.
11315         (add_encoding) Some code moved out into find_encoding_file().
11316         (postopen) Changed value for ${title}.
11317         (preclose) Sets `loaded' field to NULL after destroying the hash
11318         table.
11319         (ps_open_page) Added comment.  Inits the `combos' and `next_combo'
11320         fields.
11321         (ps_text_set_font_by_position) Figures out the current family if
11322         not known.
11323         (compare_ps_combo, hash_ps_combo, free_ps_combo) New functions.
11324         (switch_font) Implemented.
11325         (write_text) Calls switch_font() more often.  Format changes.
11326         #undefs its macros after they're no longer useful.
11327         (text) Changed `continue' at one point to a jump to the top of the
11328         loop because we don't want `separate' reset to 0 at that point.
11329         (load_font) No longer sets `position' in the font_entry created.
11330
11331 Wed Sep  4 21:45:35 1996  Ben Pfaff  <blp@gnu.org>
11332
11333         * font.h: (struct font_desc) New member `encoding', which is not
11334         properly handled yet.
11335
11336         * glob.c: (init_glob) Some new i18n code, which is probably
11337         screwed up.
11338
11339         * output.c: (outp_read_devices, outp_get_paper_size) Changed
11340         `size' local from `int' to `size_t'.
11341
11342         * postscript.c: New driver configuration parameter `auto-encode'.
11343         New enums OPO_AUTO_ENCODE, ODA_COUNT.
11344         (struct font_entry) New member `position'.
11345         (struct ps_driver_ext) Reordered.  New hash table member
11346         `encodings'; new members `next_position', `next_encoding',
11347         `last_font'.  Members `current', `prop', `fixed' changed from type
11348         `font_desc *' to `font_entry *'; all references changed.
11349         (struct ps_encoding) New struct.
11350         (read_ps_encodings, compare_ps_encoding, hash_ps_encoding,
11351         free_ps_encoding, add_encoding) New functions.
11352         (ps_init_driver) Added OPO_AUTO_ENCODE to default
11353         x->output_options.  Initializes new members of ps_driver_ext.
11354         Changed default value for prologue_fn, encoding_fn.  Calls
11355         read_ps_encodings after loading default fonts.
11356         (option_tab[], ps_option) Handle new configuration parameter.
11357         (switch_font) New function.
11358         (struct output_char) `font' member changed from `font_desc *' to
11359         `font_entry *'.  New member `separate'.
11360         (read_fontmap) Changed `size' from `int' to `size_t'.
11361         (output_line, put_number) New macros for write_text().
11362         (write_text) Optimizes text output by consolidating multiple
11363         calls to PostScript `show' operator.
11364         (text) Keeps track of when text arguments can't be consolidated by
11365         write_text(), and marks those spots in the output stream.
11366         (load_font) Sets `position' of the allocated font_entry to -1, cuz
11367         the font hasn't been switched to by switch_font(), which is where
11368         the position is important--the PostScript is what cares about the
11369         position.
11370
11371 Sat Aug 31 23:52:38 1996  Ben Pfaff  <blp@gnu.org>
11372
11373         * hash.c: (hsh_destroy) Ignores NULL argument.  Doesn't try to
11374         call a NULL free_func.
11375         (hsh_rehash) Elegantized.
11376         (hsh_probe) Fix bug that manifested when the table was expanded
11377         and thus had to change location in memory.  Good thing
11378         too--otherwise could have been much more subtle.
11379         (hsh_find) [GLOBAL_DEBUGGING] Not stubbed out anymore.
11380         (hsh_foreach) New function for hash table iteration.
11381
11382         * hash.h: (struct hsh_iterator) New.
11383
11384         * lexer.c: (parse_tagged_quote) Font and family name strings in
11385         tags are now null-terminated.
11386
11387         * output.c: (outp_evaluate_dimension) Fixed over-aggressive unit
11388         parsing.
11389         (internal_get_paper_size, outp_get_paper_size) Fixed; now work as
11390         documented.  (Never before tested?)
11391
11392         * output.h: Comment changes.
11393
11394         * postscript.c: New driver options `optimize-text-size',
11395         `optimize-line-size', `max-fonts-simult'.  New enum set for
11396         specing cached line types.  Comment fixes.
11397         (struct line_form) New struct.
11398         (struct ps_driver_struct) New members `text_opt', `line_opt',
11399         `max_fonts', `lines'.
11400         (ps_init_driver) Initializes new members of ps_driver_struct.
11401         (user option type enum set) New member `nonneg_int_arg'.
11402         (static var option_tab[]) Supports new options.
11403         (ps_option) Handles new options.
11404         (find_ps_file) Made static.  No longer calls hsh_dump().
11405         (ps_get_var) Made static.
11406         (preclose) Dumps out proper DSC trailer.
11407         (ps_open_page) Elegantized.
11408         (ps_close_page) Calls dump_lines() if appropriate.
11409         (ps_line_horz, ps_line_vert, ps_line_intersection) Reduced to
11410         wrappers around line().
11411         (int_2_compare, compare_line, dump_line, dump_fancy_line,
11412         dump_lines, hash_line, free_line, line) New functions for support
11413         of line caching.
11414         (write_text, text) Made static.
11415         (text) Added to font support, not finished.
11416
11417 Thu Aug 29 21:36:41 1996  Ben Pfaff  <blp@gnu.org>
11418
11419         * font.h: (struct font_desc) New members ascent, descent.
11420
11421         * groff-font.c: (groff_read_font) Calculates font ascent and
11422         descent from the ascent and descent of the `d' and `p' characters,
11423         respectively, as per a suggestion on comp.fonts.
11424
11425         * postscript.c: (ps_open_page, ps_close_page, ps_line_horz,
11426         ps_line_vert, ps_line_intersection) Rewritten to deal with changed
11427         prologue.
11428         (write_text) Handles text right-justification and centering (not
11429         full justification).  Still very inefficient.  (One output line
11430         per character?!)
11431         (struct output_char) Added fields for font and font size.
11432         (text) Many bugfixes.
11433
11434 Sat Aug 24 23:26:00 1996  Ben Pfaff  <blp@gnu.org>
11435
11436         * cmdline.c: (usage) Calls outp_list_classes().
11437
11438         * font.h: Comment fix.
11439
11440         * groff-font.c: New exported global var `space_index'.
11441         (groff_init) New function to initialize `space_index'.
11442         (hash_kern) Casts result to unsigned.
11443         (font_name_to_index) Renamed font_char_name_to_index.  All
11444         references changed.  Also, now returns the value of `space_index'
11445         when passed an ASCII space character as an argument.  Fixed
11446         handling of nulls.
11447         (font_get_kern_adjust) Changed i from `int' to `unsigned'.
11448         Handles passed NULL pointers properly.
11449
11450         * lexer.c: (parse_tagged_quote) Comment fix.  Better range
11451         checking.
11452
11453         * output.c: (outp_list_drivers) Removed.  Removed all references.
11454         
11455         * output.h: Comment fixes.
11456
11457         * postscript.c: (ps_open_global) Calls groff_init().
11458         (output_char) New structure.
11459         (write_text) New function.
11460         (text) No longer stubbed out!  Now the output is correct--with a
11461         few exceptions, one of them being that the page has to be held
11462         upside down into a mirror.
11463
11464 Sun Aug 11 21:31:22 1996  Ben Pfaff  <blp@gnu.org>
11465
11466         * font.h: Comment fix.
11467         
11468         * font.c: (name_to_index) Renamed font_name_to_index, made extern.
11469         All callers changed.
11470         (number_to_index) Renamed font_number_to_index, made extern.  All
11471         callers changed.
11472         (font_get_kern_adjust, font_get_char_metrics) New functions.
11473
11474         * output.h: New constant OUTP_T_INTERNAL_DRAW.
11475
11476         * postscript.c: Changed default line width back to 1/2 point.
11477         (ps_line_horz, ps_line_vert, ps_line_intersection) Now lines are
11478         in the center of the space allotted for them, not just a fixed
11479         offset from the edge of the space; this fixes some bugs.
11480         (ps_line_intersection) Now supports all command line styles.
11481         (ps_text_get_size) Bug fix in computation of em width.
11482         (text) New function, the meat behind ps_text_metrics and
11483         ps_text_draw.  Not complete.
11484         (ps_text_metrics, ps_text_draw) Removed the stub taken from
11485         ascii.c; call text().
11486
11487 Sat Aug 10 23:28:17 1996  Ben Pfaff  <blp@gnu.org>
11488
11489         * arena.c: (arena_free) Assert that the argument is non-NULL.
11490         
11491         * groff-font.c: (add_kern) Calls arena_free() for old_kern if and
11492         only if old_kern is non-NULL.
11493
11494         * postscript.c: (ps_init_driver) Changed default line width to 1
11495         point.
11496         (postopen) New prologue variables.
11497         (ps_line_horz, ps_line_vert, ps_line_intersection) Implements some
11498         more of the common line styles properly, but not all.
11499         (ps_text_metrics) Fixed problem with this stubbed out version that
11500         kept it from taking font sizes into account.
11501
11502 Thu Aug  8 22:31:11 1996  Ben Pfaff  <blp@gnu.org>
11503
11504         * arena.c: (arena_malloc) Bug fix.
11505         (arena_dump) [GLOBAL_DEBUGGING] New function.
11506
11507         * ascii.c: Comment fix.
11508         (count_fancy_chars, delineate) Now static functions.
11509         
11510         * filename.c: (interp_vars) Bug fixes.
11511
11512         * font.h: Comment fixes.
11513
11514         * glob.c: (init_glob) Sets set_viewwidth, set_viewlength at
11515         beginning in case we have an error message to display before
11516         initializing the display.
11517
11518         * groff-font.c: Comment fix.  Changed rehash threshold from 2/3
11519         full to 1/2 full.
11520         (groff_read_font) Bug fixes.
11521         (name_to_index) Increments hash.used.  Sets `name' field of hash
11522         entry properly.
11523         (add_kern) Sets kern_max_used after rehashing.  Other bug fixes.
11524
11525         * hash.c: Return type changed.
11526
11527         * postscript.c: Continued development.  Now marks lines on the
11528         paper, but very buggy.
11529
11530 Sat Aug  3 20:50:35 1996  Ben Pfaff  <blp@gnu.org>
11531
11532         * Changed comments in many source files from `/* xxx /* yyy */' to
11533         `/* xxx */ /* yyy */' for cleanliness.
11534
11535         * arena.c: (arena_sd_strdup) New function.
11536         
11537         * ascii.c: (struct ascii_driver_ext) New member `file'.
11538         (ascii_init_driver) Fills out member `file' for initing; uses
11539         close_file_ext for closing drivers.
11540         (ascii_option) Changed %.*s back to %s because the a_string's are
11541         always null-terminated.
11542         (postopen, preclose) New functions.
11543         (ascii_open_page) Uses new style of open_file_ext.
11544         (ascii_option, commit_line_buf, output_lines) Use ext->file.file
11545         instead of this->output.
11546         (__assert_fail) Removed.
11547
11548         * cmdline.c: Changed syntax_message[].
11549
11550         * error.c: #include's <readline/history.h> only if the history
11551         library is available, not if just the readline library is
11552         available.
11553
11554         * filename.c: (expand_line) Removed alloca() support.
11555         (interp_vars) No longer tilde-expands argument.  Limit on output
11556         length removed.
11557         (tilde_expand) Now treats argument as path rather than filename.
11558         [!unix] Now is a no-op function.
11559         (search_path) Better verbose message formatting.
11560         (open_file, close_file) Comment fixes.
11561         (close_file) [!unix] Doesn't bother with pipes.
11562         (open_file_ext) Completely rewritten, interface revamped.
11563         (close_file_ext) New function.
11564
11565         * font.h: Comment changes.
11566
11567         * frequencies.q: Removed AIX alloca support since it doesn't use
11568         alloca.
11569
11570         * hash.c: Comment changes & additions.
11571         (hsh_create) Initializes entire table instead of first M entries.
11572         (hsh_probe) Stupid bug fixed.  Now it works.
11573         (hsh_dump) [GLOBAL_DEBUGGING] New function.
11574
11575         * main.c: (parse) Detects EOF properly in token-eating loop.
11576         Should the STOP token have its value changed to 0?
11577
11578         * misc.c: (blp_getdelim) [HAVE_GETDELIM] Now it's a macro.
11579         (blp_getline) Now it's a macro.
11580
11581         * output.h: (struct outp_driver) Removed members output, filename.
11582         
11583         * output.c: (outp_init) [!NO_POSTSCRIPT] Installs PostScript
11584         drivers in driver table.
11585         (outp_read_devices) Frees buf.  Warns if there are no active
11586         output drivers.
11587         (outp_configure_clear) Sets outp_configure_vec to NULL after
11588         deleting its elements.
11589         (configure_driver, destroy_driver) Removed references to output,
11590         filename members of outp_driver.
11591         (outp_evaluate_dimension, internal_get_paper_size,
11592         outp_get_paper_size) New functions.
11593
11594         * postscript.c: Continued development.  Now links but doesn't make
11595         any marks on the page.  Lotsa bugs I suppose.
11596
11597         * str.c: (strcasecmp) [!HAVE_STRCASECMP] New function.
11598
11599         * str.h: Comment changes.
11600
11601 Sat Jul 27 22:32:38 1996  Ben Pfaff  <blp@gnu.org>
11602
11603         * Removed dependencies on non-nested comments in several files.
11604         Also removed references to (unix || __unix__) in #if's since
11605         prefh.orig makes those two equivalent.
11606         
11607         * ascii.c: (ascii_open_global) Creates ascii_arena.
11608         (ascii_close_global) Destroys ascii_arena.
11609         (ascii_init_driver) Doesn't create ascii_arena.
11610         (ascii_copy_driver) Removed.
11611         (ascii_option) Possible bugfix regarding %s vs. %.*s with a_string's.
11612         (outp_class ascii_class) Removed ascii_copy_driver reference.
11613
11614         * frequencies.q: Now can display all statistics except median.
11615         Still not finished.
11616
11617         * output.c: Handles outp_class.ref_count so output class
11618         destructors are called properly.
11619         (add_class) Sets ref_count to 0.
11620         (configure_driver) Initializes class if ref_count++ is 0.
11621         (destroy_driver) Destructs class if --ref_count is 0.  Frees the
11622         class output file name.
11623         
11624         * output.h: (struct outp_class) Removed copy_driver, inited.
11625         Added ref_count.
11626
11627         * postscript.c: Completely replaced but not finished.
11628         
11629 Tue Jul 23 21:48:36 1996  Ben Pfaff  <blp@gnu.org>
11630
11631         * approx.h: #includes <float.h>.
11632
11633         * arena.h, arena.c: Many functions changed to take an arena **
11634         instead of an arena *, for consistency.  All callers changed.
11635         (arena_alloc) Now creates a new arena if passed *A that is NULL.
11636         (arena_destroy) Sets *A to NULL.
11637         
11638         * ascii.c: (delineate) Implements OUTP_T_VERT correctly.  Removed
11639         assertion that `width' be positive.
11640
11641         * command.c: Removed #if's from cmd_table.
11642         (walk_cmdtable_func) [0] New function (debug code).
11643         (init_cmd_parser) [0] Dumps out cmd_table (debug code).
11644         (parse_cmd) Doesn't return failure for unimplemented commands.
11645
11646         * common.h: (SYSMIS) Changed from DBL_MAX to -DBL_MAX.
11647         (SYSCODE) New constant macro.
11648
11649         * descript.q: Checks for positive n_variables before performing
11650         analysis.
11651
11652         * file-handle.q: (get_handle_by_filename) Bug fix: passes &f to
11653         avl_find instead of &fp as arg 2.
11654
11655         * frequencies.g, frequencies.q: Continued updating; now compiles &
11656         works again, but not complete.
11657
11658         * main.c: Changes to user messages.
11659
11660         * misc.c: (reverse) [0] New function.
11661
11662         * settings.h: Comment removed.  #includes "common.h".
11663
11664         * som.c: (som_set_null) New function.
11665         (som_set_value, som_set_string, som_set_text) More detailing
11666         assertions.
11667         (som_set_float) Implemented function.
11668         (dump_columnated_table) Bug fix regarding page breaks.
11669         (draw_cell) Bug fix regarding text that spilled out of a cell.
11670         (draw_intersection, draw_horz_rule, draw_vert_rule) No longer draw
11671         null lines.
11672         (get_cell_size) Support SCON_EMPTY cells.
11673         (get_table_size) When calculating rules' widths and heights, mask
11674         out SLIN_SPACING bit.  Added SOPT_X_HLTL support.
11675         
11676         * som.h: (som_any_cell) New option SOPT_X_HTLT.  Removed
11677         SOPT_X_SHADE.
11678         (struct som_submission_form) New member `header'; all users
11679         changed.
11680
11681         * val-labs.c: (get_label) User messages changed.
11682
11683         * var.h: Changed FREQUENCIES structures.
11684
11685         * vars-atr.c: (is_num_user_missing, is_str_user_missing) Made
11686         inline.
11687         
11688 Fri Jul 19 19:11:13 1996  Ben Pfaff  <blp@gnu.org>
11689
11690         * approx.h: Definition of EPSILON now depends on system's
11691         DBL_EPSILON.  Removed GNU C specific code.
11692         (cmpapx) Renamed approx_compare.
11693
11694         * frequencies.g, frequencies.q: Continued updating; still doesn't
11695         compile.
11696
11697         * groff-font.c: (name_to_index) Fix bug that kept it from
11698         compiling.
11699
11700         * hash.c, hash.h: Completed work.
11701
11702         * var.h: Changes to freq_tab, frequencies_proc.
11703         
11704 Wed Jul 17 21:23:36 1996  Ben Pfaff  <blp@gnu.org>
11705
11706         New hashing code.
11707         * hash.c, hash.h: New files.  Not completed.
11708         * Makefile.am: Added hash.c to source file list.
11709         * font.h: (struct font_desc) New member kern_size_p.
11710         * groff-font.c: Uses hash.h.
11711         (hashpjw) Moved to hash.c.
11712         (next_prime_power) Rewrote, renamed hsh_next_prime, moved to
11713         hash.c.
11714         (static var hash) New member size_p.
11715         * var.h: Includes hash.h.
11716         (struct freq_tab) Changed AVL_TREE to hash_tab.
11717
11718         * vars-prs.c: Comment, formatting fixes.
11719
11720         * frequencies.g, frequencies.q: Continued updating.  Not yet
11721         working.
11722
11723         * formats.c: Bug fix.
11724
11725 Tue Jul 16 22:10:04 1996  Ben Pfaff  <blp@gnu.org>
11726
11727         Increasing parallelism between DESCRIPTIVES and FREQUENCIES.
11728         * descript.g: Comment fixes.
11729         * descript.q: Comment fixes.  Moved some declarations into var.h.
11730         Made dsc_info a static table.  Updated FIXMEs.
11731         (internal_cmd_descriptives) Beautified.
11732         
11733         * frequencies.q: Started updating into working order.
11734         * frequencies.g: New file analogous to descript.g.
11735         * var.h: Comment fixes.  Added structures for FREQUENCIES.
11736         
11737         * som.c: Removed vestiges of crushing and partial table support.
11738
11739 Sun Jul 14 15:45:31 1996  Ben Pfaff  <blp@gnu.org>
11740
11741         * Many more changes to som.c especially, but these will not be
11742         documented as I have resolved to remove them.  This patchlevel is
11743         being released solely so that I can fall back to it if I decide
11744         that removing the changes is not a good idea.
11745
11746 Sat Jul 13 09:58:44 1996  Ben Pfaff  <blp@gnu.org>
11747
11748         * som.c: (global var som) New member `cum_y'.
11749         (build_target) Properly handles titles for partial tables.
11750         (dump_partial_beg, dump_partial_mid, dump_partial_end)
11751         Merged into single new function dump_partial().  Fixed problem
11752         with titles on partial tables.
11753         (dump_table) Calls dump_partial() for all parts of partial tables.
11754         (dump_page) Criteria for drawing title changed.
11755         
11756 Fri Jul 12 22:03:36 1996  Ben Pfaff  <blp@gnu.org>
11757
11758         * command.c: (cmd_table) Added LIST, WEIGHT.
11759
11760         * command.c: (cmd_remark) No longer frees `s' since it's not
11761         dynamically allocated.
11762         
11763         * data-out.c: (convert_f) Now correctly handles the case where
11764         abs(v->f)<1 but v->f rounds to a value of 1.00 given the specified
11765         number of decimals.
11766         (som_destroy_all_tables) Removed argument.  All callers changed.
11767         (som_vline, som_hline) Argument validity checking corrected.
11768         (som_set_value) Implemented half-heartedly.
11769         (replicate_table) Copies tables piece-by-piece when using Checker.
11770
11771         * som.h: New line style SLIN_1THIN, currently equivalent to
11772         SLIN_0.  New enum set SOM_SUB_*.
11773         (struct som_submission_form) Removed `seq_no'.  Added `type'.
11774         
11775         * list.q: Newly working file; uses partial tables.
11776         
11777         * som.c: (som_reduce_table) Renamed som_set_table_height().
11778         (som_crush) Removed argument `group'.
11779         (global var som) Removed `nt', `seq_no'.  Added `type'.
11780         (som_submit_table) Arguments changed.
11781         (output_table) Removed partial table code.
11782         (build_target) New arg; partial table support added.  All callers
11783         changed.
11784         (dump_plain_table) Removed partial table code.
11785         (dump_partial_beg, dump_partial_mid, dump_partial_end) New functions.
11786         (dump_table) Supports partial tables.
11787         (dump_page) New argument to allow not drawing top and/or bottom
11788         headers.  All callers changed.  Supports partial tables.
11789
11790 Sat Jul  6 22:22:25 1996  Ben Pfaff  <blp@gnu.org>
11791
11792         * data-out.c: Changed `#include <approx.h>' to `#include
11793         "approx.h".
11794         (convert_F) Comment fix.  Now won't print `-.000', etc.
11795
11796         * descript.q: Now Z-scores work, although there appears to
11797         be a bug (which might actually be in data-out.c:convert_F()).
11798         (descriptives_trns_proc, descriptives_trns_free) New functions.
11799         (run_z_pass) Implemented.
11800         
11801         * var.h: Comment fixes.
11802         (dsc_z_score, descriptives_trns) New structs.
11803         (descriptives_trns) Added to any_trns as `dsc'.
11804
11805         * error.c, error.h: New error class, IS (Installation Script
11806         error), used in those instances where the error is in the
11807         installation, but there is a script file or installation file that
11808         can be usefully referred to.
11809         
11810         * output.c: Change many IE classes to IS classes.
11811
11812         * cases.c, command.c, common.c, crosstabs.q, expr-evl.c,
11813         frequencies.q, list.q, vars-prs.c, vfm.c: Removed reference to
11814         HAVE_MALLOC_H because Borland C++ alloca() is broken, so why
11815         include the corresponding header?
11816         
11817         * glob.c: (init_glob) Don't malloc term_buffer under Checker.
11818         Don't bail out if termcap can't be read.
11819
11820         * som.c: (som_destroy_table) Removed.
11821         (som_reduce_table, som_destroy_all_tables) New functions.
11822         (som_crush) New function, not implemented.
11823         
11824         * som.h: New table option STAB_CRUSH.  Comment fix.  New struct
11825         som_submission_form.  Function prototypes revised.
11826
11827         Outputting huge tables (1000s of rows) a few rows at a time
11828         is supported, though untested.  May even break everything.
11829         Actually, the code doesn't even compile right now.
11830         * som.c: (struct som) New fields htv, nt, seq_no.
11831         (som_submit_table) Multiple arguments changed to a single
11832         pointer to struct submission_form.  Only increments subtable_num
11833         if seq_no is zero.  Only destroys table if it's not going to
11834         be reused.
11835         (replicate_table) New function.
11836         (output_table) Comment fix.
11837         (examine_table) Changed inline code to code calling
11838         replicate_table().  Calculates htv.  Supports partial tables.
11839         (draw_title) Removed comment.
11840         (build_target) Only allows for title on first part of partial
11841         tables.
11842         (dump_plain_table) Only resets table chunk number on first part
11843         of partial tables; FIXME: doesn't work quite right.  Supports
11844         partial tables.
11845         (dump_page) Titles only on first part of partial tables.
11846
11847 Fri Jul  5 20:16:19 1996  Ben Pfaff  <blp@gnu.org>
11848
11849         * Thanks to an unreliable IDE hard drive, I have spent the last
11850         day reconstructing my Debian GNU/Linux installation and redoing
11851         the previous day's changes--somehow I managed to save every file
11852         except for output.c and output.h.  So the following changes could
11853         really be considered independent of the output.c, output.h changes
11854         from Jul 4.
11855
11856         * output.h, output.c: Moved the outp_configure_vec global var,
11857         outp_names struct, and enum set OUTP_S_* from output.h to output.c.
11858         outp_configure_vec is now static.
11859         
11860 Thu Jul  4 20:20:24 1996  Ben Pfaff  <blp@gnu.org>
11861
11862         * The entire philosophy behind configuration of the output drivers
11863         changed.  Now there is a termcap-type configuration where drivers
11864         to be read are determined beforehand, rather than parsing the
11865         entire output init file and storing it in memory & deciding what
11866         to actually use later.  Faster & more memory-efficient at the same
11867         time, cool.
11868         
11869         * output.c: Comment fix.  Removed outp_init_drivers global var.
11870         Removed all references to synonyms.  New structure outp_defn.  New
11871         global vars outp_macros, outp_configure_vec.
11872         (search_name, delete_name, add_name, check_configure_vec,
11873         expand_name, find_defn_value) New static functions.
11874         (outp_configure_clear, outp_configure_add, outp_configure_macro,
11875         outp_read_devices) New extern functions.
11876         (outp_init) Much functionality moved into outp_read_devices.
11877         (outp_read_devices) Format of output init file changed; name of
11878         file is `devices' rather than `output' to avoid Makefile
11879         conflicts.
11880         (outp_clear) Renamed outp_done.
11881         (outp_list_classes) Bug fix, cleaned up.
11882         (outp_list_drivers) Not implemented anymore.
11883         (outp_configure_driver) Now a static function; simplified; now
11884         interpolates macros; supports new structure.
11885         (outp_enable_driver, match_synonym) Removed; all references
11886         removed.
11887         (find_driver) First argument removed.
11888         
11889         * output.h: Global var outp_init_drivers removed; new structure
11890         outp_names; new enum set OUTP_S_*; new global var
11891         outp_configure_vec; function prototypes for output.c exports
11892         updated.
11893         
11894         * main.c: (main) Calls outp_read_devices() after parsing the
11895         command line.
11896         
11897         * cmdline.c: (parse_command_line) New option -v --verbose;
11898         --version changed to -V.  --device option changed syntax to just
11899         take a single device name.  Accepts key=value declaration of
11900         output init file macros.  Syntax message updated.
11901
11902         * filename.c: (expand_line) New function.
11903         (interp_environ_vars) Renamed interp_vars; no longer uses
11904         fixed-size buffer.
11905         (blp_getenv) Allows $ARCH and $VER pseudo-environment-vars to be
11906         overridden by real environment vars.
11907         (search_path) Uses verbose_msg() instead of #ifdef'd printf().
11908         * filename.h: interp_environ_vars() renamed interp_vars().
11909         
11910         * error.c, error.h: Added extern variable `verbosity', message
11911         class MM.
11912         
11913         * error.c: (vmsg) Support message class MM.
11914         (verbose_msg) New function.
11915
11916         * descript.q: (generate_z_varname) Bug fix in generation of
11917         Z-score varnames.
11918         (dump_z_table) Bug fix in column headers.
11919         
11920         * ascii.c: (ascii_init_driver) Changed minimum number of lines per
11921         page from 29 to 15.  Don't set a default for ops[OPS_INIT,
11922         OPS_DONE].  Writes the uninit string when the driver is closed.
11923         (ascii_open_page) Write the init string before the first page.
11924         (output_shorts) Form of main loop changed from `while' to `for'.
11925         Bug fix with overstrikes: the character is printed *after* the
11926         backspace.  Eliminated a lot of `& 0xff' modifiers.
11927         (advance_to_left_margin) New function.
11928         (return_carriage, output_lines) Handle left margin.
11929
11930 Thu Jul  4 00:35:59 1996  Ben Pfaff  <blp@gnu.org>
11931
11932         * ascii.c: New option `carriage-return-style'.
11933
11934         * ascii.c: (count_fancy_chars) New function.
11935         (delineate, text_metrics) Use new function; bug fixes regarding
11936         rich text strings.
11937         (text_draw) Bug fix with rich text.
11938         (output_string, output_shorts) Reordered.
11939         (output_shorts) Now handles boxchars and some overstrike font
11940         changes.
11941         (output_char, return_carriage) New functions.
11942         (output_lines) Now handles overstriking and font changes properly;
11943         some code moved to output_shorts.
11944
11945 Tue Jul  2 22:13:23 1996  Ben Pfaff  <blp@gnu.org>
11946
11947         [GLOBAL_DEBUGGING]
11948         * ascii.c: New member `debug' in ascii_driver_ext.
11949         (ascii_init_driver, delineate) Uses new member.
11950
11951         Now you can set a vertical height on writing text.
11952         * ascii.c: (delineate) Keeps track of vertical position.
11953         (text_draw) No longer considers fully justified text an internal
11954         error.
11955         
11956         * output.h: New flag OUTP_T_VERT; other OUTP_T_ values changed.
11957
11958         Tables' titles are drawn; they can have variable height.
11959         * som.c: `som' struct has new member, title_height.
11960         (draw_title) New argument.  Moved within file.  All caller
11961         changed.
11962         (build_target) New argument, amount of space needed for first row.
11963         Calculates height of title, takes that into account.  All callers
11964         changed.
11965         (dump_plain_table, dump_columnated_table) Took calculation of y1,
11966         y2 out of loop.
11967         (dump_columnated_table) [GLOBAL_DEBUGGING] Debugging code
11968         improved.
11969         (dump_columnated_table) Organized for readability.
11970         (dump_page) Makes use of som.title_height.
11971
11972         * som.c: Many comment bug fixes.
11973
11974         * descript.q: (try_name, generate_z_name) Bug fix regarding
11975         generation of Z-score variable names.
11976         * var.h: Removed num from descriptives_proc; all referents removed.
11977
11978 Mon Jul  1 22:13:39 1996  Ben Pfaff  <blp@gnu.org>
11979
11980         * ascii.c: (ascii_line_horz, ascii_line_vert,
11981         ascii_line_intersection) Added debugging code.
11982
11983         Added a descriptive line above each table to describe it.
11984         * command.c: (parse_cmd) Calls som_new_series.
11985         
11986         * som.c: New static vars table_num, subtable_num.  New `som'
11987         member `title'.
11988         (dump_page) New arguments.
11989         (som_submit_table) Handle new variables.
11990         
11991         * som.c, som.h: (som_submit_table) New arguments.  All callers
11992         changed.
11993         (som_new_series) New function.
11994         (build_target) Makes room for extra line.
11995         (draw_title) New function.
11996         (dump_page) Calls draw_title.  Bug fix: doesn't always set
11997         som.ext->cp to 0.
11998         
11999         Columnation of tables support.
12000         * som.h: Deleted fr, lr, ri from som_table.  Reorganized.
12001         
12002         * som.c: Deleted references to fr, lr, ri.
12003         (som_columnate) Bux fix: sets group member of table.
12004         (som_add_options) Function removed.
12005         (dump_table) Split into three functions; extensively reworked.
12006         
12007         * descript.q: (dump_z_table) Better output table formatting; added
12008         title support to correspond to som.h changes.
12009         (display) Title support.
12010
12011         * output.h: Added OUTP_T_NONE.
12012         
12013 Mon Jul  1 13:00:00 1996  Ben Pfaff  <blp@gnu.org>
12014
12015         * descript.q: Improved handling of Z scores; still not perfect.
12016         
12017         * output.h, ascii.c: Added hook for getting em width of current
12018         font.
12019         
12020         * som.c: Uses new em-width hook.  Added debugging code to
12021         several functions.
12022         (som_columnate) New argument.
12023         (som_add_options) Removed.
12024
12025 Jun 29 17:40:47 1996  Ben Pfaff  <blp@gnu.org>
12026
12027         * som.h, som.c, output.c, output.h, ascii.c: Updated to work with
12028         rules as a property of the table instead of as a property of the
12029         cells.
12030         
12031         * ascii.c: Added `header' to table of options.
12032         
12033         * descript.q: Added even shorter statistic names; modified to work
12034         with new som interface.
12035         
12036         * misc.c (blp_getdelim): Bug fix.
12037         
12038         * version.c: includes 'conf.h'.
12039         
12040 ----------------------------------------------------------------------
12041 Local Variables:
12042 mode: change-log
12043 version-control: never
12044 End: