3b579e7cc1d64137814fda1c14a4f4bedc6b20d7
[pspp-builds.git] / src / ChangeLog
1 Sun Jul  3 22:47:39 2005  Ben Pfaff  <blp@gnu.org>
2
3         * get.c: (cmd_match_files) Fix memory leak on `by' and on
4         `vfm_source'.
5
6         * getline.c: [HAVE_LIBREADLINE] (read_console) Fix memory leak on
7         `line'.
8
9         * vfm.c: (close_active_file) Remove unnecessary test.
10
11 Sun Jul  3 21:45:32 2005  Ben Pfaff  <blp@gnu.org>
12
13         Fix NDEBUG compile errors.
14
15         * hash.h: Needed explicit #include <assert.h>.
16
17         * linked-list.c: (ll_next) First arg is UNUSED when NDEBUG is
18         defined.
19
20 Sun Jun 12 23:44:38 2005  Ben Pfaff  <blp@gnu.org>
21
22         Implement embedding for PostScript driver.  Fixes bug 12970.
23
24         * ascii.c: Fix compiler warnings.
25
26         * html.c: Ditto.
27
28         * chart.h: Add `file' member.
29
30         * output.h: (struct outp_class) initialise_chart, finalise_chart
31         should take outp_driver *, not outp_class *.  Update all
32         references.
33
34         * plot-chart.c: (chart_create) Fix segfault when there are no
35         output drivers at all.
36         (chart_submit) Call d->class->finalise_chart.
37
38         * postscript.c: (ps_open_page) Set cp_y to 0.
39         (ps_submit) New function.
40         (ps_chart_initialise) Implement.
41         (ps_chart_finalise) Implement.
42         (static var postscript_class) Add ps_submit.
43         (static var epsf_class) Add ps_submit.
44         
45
46 Sun Jun 12 14:54:40 2005  Ben Pfaff  <blp@gnu.org>
47
48         Did some more work on bug 12859 and then realized that a *good*
49         solution would require some fundamental restructuring.  For now,
50         I'm marking REPEATING DATA unimplemented, and then we can revisit
51         it post-0.4.0.
52         
53         * command.def: Make REPEATING DATA unimplemented.
54
55         * data-list.c: (cmd_repeating_data) Assume inline file is 80
56         characters wide.
57         (realize_value) Revert previous changes; no longer needed.
58         Updated all callers.
59
60         * error.c: (err_hcf) Set nfile_loc, mfile_loc to 0 after freeing
61         file_loc, to avoid bad references later.
62
63         * str.c: Fix typo.
64
65 Tue Jun  7 00:14:09 2005  Ben Pfaff  <blp@gnu.org>
66
67         Make some code tolerant of reentry.  Should not be needed if other
68         code is correct but it is good to be generally tolerant.
69         
70         * error.c: (err_hcf) Set file_loc to null after free().
71
72         * output.c: (outp_done) Similar changes.
73
74         * str.c: (ds_destroy) Ditto.
75         
76 Tue Jun  7 00:10:20 2005  Ben Pfaff  <blp@gnu.org>
77
78         Continue work on bug 12859, plus some code cleanup.
79         
80         * data-list.c: (cmd_repeating_data) Replace `seen' bitmap by
81         boolean variables.  Don't try to compute starts_end, cont_end for
82         inline file.  Calculate length only after parsing variable
83         specifications.  Add proper transformation to list.
84         (realize_value) If the rpd_num_or_var has no value, return new
85         DEFAULT_MEMBER argument (for use with inline file).
86         (repeating_data_trns_proc) Pass default values.
87
88         * dfm-read.c: (dfm_close_reader) Only skip data if *not* still
89         open, and only if we actually started reading data.
90
91 Sun Jun  5 18:39:36 2005  Ben Pfaff  <blp@gnu.org>
92
93         Fix bug 11894.
94         
95         * output.c: (outp_read_devices) Fix message.
96
97 Fri May 27 12:34:43 WST 2005 John Darrington <john@darrington.wattle.id.au>
98         
99         * sort-prs.[ch] (newfiles), aggregate.c, sort.[ch]: Separated the guts 
100         of the sort algorithm from the parser for the SORT command.
101         
102         * rank.q: Added the parser for the RANK command.
103         
104 Thu May 26 12:29:21 2005  Ben Pfaff  <blp@gnu.org>
105
106         Fix bug 13192.
107
108         * sort.c: (sort_parse_criteria) Only set *saw_direction if
109         saw_direction is non-null.  Thanks to John Darrington for
110         reporting this bug.
111
112 Tue May 24 21:52:55 2005  Ben Pfaff  <blp@gnu.org>
113
114         * get.c: (mtf_processing) Handle case of a lookup table as the
115         active file.  Thanks to John Darrington for reporting this bug.
116
117 Wed May 25 10:27:02 WST 2005 John Darrington <john@darrington.wattle.id.au>
118         
119         * alloc.c alloc.h: (xcalloc) changed signature to imitate the
120         POSIX  calloc function.
121         
122         * crosstabs.q get.c vars-prs.c: Updated calls to xcalloc to
123         reflect new signature.
124
125         * sfm-read.c: Now much more robust in the face of badly formed
126         system files.
127
128 Mon May 23 11:57:31 WST 2005 John Darrington <john@darrington.wattle.id.au>
129
130         *sfm-read.c: Fixed some bugs regarding long string continuation
131         records, which the previous fix uncovered.
132
133 Sat May 21 12:48:34 WST 2005 John Darrington <john@darrington.wattle.id.au>
134
135         * sfm-read.c, sfmP.h:  Allow reading of system files when the 
136         case_size value in the header is -1.  Also changed some Errors to 
137         Warnings when reading system files.
138
139 Tue May 17 21:00:57 2005  Ben Pfaff  <blp@gnu.org>
140
141         * data-list.c: (data_list_trns_free) Don't free the argument
142         because cancel_transformations() will do that itself.
143         (data_list_source_destroy) Destroy the argument to
144         data_list_trns_free(), because it no longer does so itself.
145
146 Tue May 17 18:29:35 2005  Ben Pfaff  <blp@gnu.org>
147
148         * data-out.c: (format_and_round) Don't output leading `-' if value
149         rounds to zero.
150
151 Tue May 17 00:06:43 2005  Ben Pfaff  <blp@gnu.org>
152
153         Fix bug 11119.
154
155         * som.c: (output_encodings) If some cell in the table won't fit
156         with the horizontal or vertical headers, cancel those headers.
157
158         * som.h: (struct som_table_class) Add fits_width, fits_length,
159         set_headers members.
160
161         * tab.c: (tabi_fits_width) New function.
162         (tabi_fits_length) New function.
163         (tabi_set_headers) New function.
164         (global var tab_table_class) Add the new functions as appropriate
165         members.
166         
167 Mon May 16 22:34:06 2005  Ben Pfaff  <blp@gnu.org>
168
169         Fix rest of bug 13054.
170
171         * format.def: Fix EDATE, SDATE, ADATE, JDATE, QYR, MOYR, WKYR,
172         DATETIME, TIME system/portable file values.
173
174 Mon May 16 22:31:15 2005  Ben Pfaff  <blp@gnu.org>
175
176         * data-list.c: (parse_free) Use make_input_format().
177         
178         * data-out.c: (num_to_string) Use make_output_format().
179
180         * dictionary.c: (dict_create_var) Ditto.
181
182         * format.c: (global var f8_2) New var.
183         (make_input_format) New function.
184         (make_output_format) New function.
185
186         * get.c: (cmd_match_files) Use make_output_format().
187
188         * list.q: (cmd_list) Ditto.
189
190         * matrix-data.c: Ditto.
191
192         * sfm-read.c: (parse_format_spec) Check output specifier
193         thoroughly.
194
195         * tab.c: (tab_float) Use make_output_format().
196
197 Sun May 15 23:38:10 2005  Ben Pfaff  <blp@gnu.org>
198
199         Fix more of bug 13054.
200         
201         * format.def: FMT_A should allow 255-character output.  FMT_AHEX
202         should allow 510-character input and output.
203
204         * data-out.c: (num_to_string) Get rid of NEW_STYLE option.
205         (convert_E) Handle non-finite values.
206         (try_F) Rewrite.
207         (format_and_round) New function.
208         (convert_infinite) New function used by try_F() and convert_E().
209
210 Sun May 15 23:36:55 2005  Ben Pfaff  <blp@gnu.org>
211
212         Regularize string and buffer function names so that they make some
213         kind of sense.
214
215         * str.c: (mm_reverse) Rename buf_reverse().  Update all
216         references.
217         (mm_find_reverse) Rename buf_find_reverse().  Update all
218         references.
219         (mm_case_compare) Rename buf_compare_case().  Update all
220         references.
221         (st_compare_pad) Rename buf_compare_rpad().  Update all
222         references.
223         (str_compare_rpad) New function.
224         (st_bare_pad_copy) Rename buf_copy_str_rpad().  Update all
225         references.
226         (buf_copy_str_lpad) New function.
227         (st_bare_pad_len_copy) Rename buf_copy_rpad().  Update all
228         references.
229         (st_pad_copy) Rename str_copy_rpad().  Update all references.
230         (st_trim_copy) Rename str_copy_trunc().  Update all references.
231         (st_uppercase) Renamed str_uppercase().  Update all references.
232         
233 Sat May 14 08:22:26 WST 2005 John Darrington <john@darrington.wattle.id.au>
234
235         * dfm-read.c: Fixed polarity of test in dfm-close-reader.  Closes 
236         Bug #13082
237
238 Tue May 10 20:08:18 2005  Ben Pfaff  <blp@gnu.org>
239
240         * data-in.c: (data_in) Add assertion to check input specifier.
241
242         * data-out.c: (data_out) Add assertion to check output specifier.
243
244 Tue May 10 19:56:35 2005  Ben Pfaff  <blp@gnu.org>
245
246         Start to fix bug 13054.
247
248         * format.c: (check_input_specifier) Improve error message.
249         (check_input_specifier) Check F, COMMA, and DOLLAR formats for
250         valid decimal places.
251         (check_output_specifier) Ditto (but different criteria).
252         (convert_fmt_ItoO) Assert valid input and output specifiers.
253         Also, if input specifier has *any* decimal places, make the output
254         specifier 1 place wider.
255
256 Mon May  9 07:14:29 WST 2005 John Darrington <john@darrington.wattle.id.au>
257
258         * sysfile-info.c: Fixed bug [# 13024 ]
259
260 Sun May  8 13:52:12 2005  Ben Pfaff  <blp@gnu.org>
261
262         "Fix" bug 13021 by disabling FILE TYPE.  Eventually, we should
263         actually implement it.
264
265         * command.c: (FILE_TYPE_okay) Always return 1.
266
267         * command.def: Change FILE TYPE, END FILE TYPE into UNIMPL.
268
269         * file-type.c: Add prototypes to get rid of warnings.
270
271 Sun May  8 08:08:07 WST 2005 John Darrington <john@darrington.wattle.id.au>
272
273         * barchart.c box-whisker.c cartesian.c piechart.c plot-hist.c: Fixed 
274         more ISO/IEC 9899:1990 conformance issues.
275
276 Wed May  4 23:54:02 2005  Ben Pfaff  <blp@gnu.org>
277
278         Fix bug 12948.  See also new test in
279         tests/bugs/match-file-scratch.sh.
280         
281         * get.c: (mtf_merge_dictionary) Don't compact dictionary because
282         that deletes scratch variables that someone else might be using,
283         and because we can't reassign our sources' value indexes.
284         Instead, simply don't copy scratch variables into the master
285         dictionary.
286
287         * dictionary.c: (dict_compact_values) Delete variables from the
288         dictionary passed in, not from default_dict (!).
289
290 Tue May  3 22:25:17 2005  Ben Pfaff  <blp@gnu.org>
291
292         Improve hash.c comments, error-checking.
293         
294         * hash.c: (struct hsh_table) [NDEBUG] Add hash_ordered member.
295         (hsh_create) size == 0 should *not* return NULL!  Set
296         hash_ordered.
297         (hsh_clear) Set hash_ordered.
298         (locate_matching_entry) Check hash_ordered.
299         (hsh_rehash) Rename rehash().  Add assertion.  Set hash_ordered.
300         (hsh_data) Set hash_ordered.  Add const-ness to return value and
301         update all callers.
302         (hsh_sort) Ditto.       
303
304 Wed May  4 08:50:11 WST 2005 John Darrington <john@darrington.wattle.id.au>
305
306         * casefile.c: Removed unnecessary #include <valgrind/valgrind.h>
307
308 Tue May  3 19:14:48 WST 2005 John Darrington <john@darrington.wattle.id.au>
309
310         * copyleft.c: Updated copyright date.
311
312         * Makefile.am: Removed erroneous explicit "-lplot"
313
314         * examine.q oneway.q: Made these files conform to ISO/IEC 9899:1990
315
316 Tue May  3 16:20:31 WST 2005 John Darrington <john@darrington.wattle.id.au>
317
318         * command.c command.def: Added description string for unimplemented commands.
319
320         * oneway.q: Sorted the hash tables before shipping out the results. Closes 
321         bug [#12931].
322
323 Mon May  2 23:45:01 2005  Ben Pfaff  <blp@gnu.org>
324
325         Code improvements.
326         
327         * data-list.c:  (parse_fixed) Use lex_end_of_command().
328         (parse_free) Ditto.
329         (cmd_repeating_data) Set cont_end.num in right situations.
330         (parse_repeating_data) Remove redundant test.
331
332 Mon May  2 23:37:19 2005  Ben Pfaff  <blp@gnu.org>
333
334         Partial fix for bug 12859.
335         
336         * data-list.c: (cmd_data_list) Add transformation properly in
337         vfm_source == NULL case.
338
339 Mon May  2 23:27:28 2005  Ben Pfaff  <blp@gnu.org>
340
341         * lexer.c: (lex_error) Improve error messages.
342
343 Mon May  2 22:28:17 2005  Ben Pfaff  <blp@gnu.org>
344
345         * get.c: (cmd_match_files) Check token type before trying to match
346         tokid.  Fixes bug 12923.
347
348 Mon May  2 22:16:51 2005  Ben Pfaff  <blp@gnu.org>
349
350         * flip.c: [HAVE_SYS_TYPES_H] Include <sys/types.h>.  Fixes bug
351         12789.
352
353 Mon May  2 22:02:52 2005  Ben Pfaff  <blp@gnu.org>
354
355         * expressions/generate.pl: (get_token) Make use of /g
356         backward-compatible with Perl 5.6.1.
357
358 Sun May  1 23:00:19 2005  Ben Pfaff  <blp@gnu.org>
359
360         * var-display.c: (cmd_variable_alignment) Fix memory leak.
361         (cmd_variable_level) Ditto.
362
363 Sun May  1 22:49:04 2005  Ben Pfaff  <blp@gnu.org>
364
365         Hash table had buggy deletion function.  The fix required changing
366         other functions to do probing in the required order.
367
368         * hash.c: (locate_matching_entry) Rewrite and change interface.
369         (hsh_rehash) Rewrite to use locate_matching_entry().
370         (hsh_probe) Ditto.
371         (hsh_find) Ditto.
372         (hsh_delete) Ditto.  Also, fix stupid bugs.
373
374 Sun May  1 22:24:58 2005  Ben Pfaff  <blp@gnu.org>
375
376         * dictionary.c: (dict_clone) Properly copy vectors.
377
378 Sun May  1 22:07:58 2005  Ben Pfaff  <blp@gnu.org>
379
380         New implementation of long variable names.  Each variable has a
381         "normal" name, which may be up to 64 bytes long and which is used
382         for all normal operations.  Variables may have a "short" name,
383         which is limited to 8 bytes and used only for system and portable
384         file input and output.
385         
386         Make tokid case-preserving.  Update most uses of tokid to treat it
387         case-insensitively.
388
389         Update many commands to deal with long variable names.
390
391         * autorecode.c: (cmd_autorecode) Use strcasecmp() instead of strcmp().
392
393         * command.c: (cmd_parse) Ditto.
394         (match_strings) Use toupper() before comparing characters.
395         (conflicting_3char_prefixes) Use mm_case_compare() instead of
396         memcmp().
397         (cmd_match_words) Ditto.
398
399         * compute.c: (lvalue_parse) Use st_trim_copy() instead of
400         strncpy().
401
402         * count.c: (struct cnt_var_info) Change n[] to fit long var name.
403         Use st_trim_copy() instead of strcpy().
404
405         * data-in.c: (parse_enum) Use mm_case_compare() instead of
406         memcmp().
407
408         * data-list.c: (struct dls_var_spec) Change name[] to fit long var
409         name.
410         (parse_free) Use st_trim_copy() instead of strcpy().
411
412         * descript.c: (struct dsc_var) Change z_name[] to fit long var
413         name.
414         (try_name) Use strcasecmp() instead of strcmp().
415         (generate_z_varname) Use st_trim_copy() instead of strcpy().
416         (descriptives_compare_dsc_vars) Use strcasecmp() instead of
417         strcmp().
418
419         * dictionary.c: (struct dictionary) Removed `long_name_tab'
420         member.
421         (compare_long_names) Removed.
422         (hash_long_name) Removed.
423         (dict_create) Don't initialize `long_name_tab' member.
424         (dict_clone) Copy short names into new dictionary. 
425         (dict_clear) Don't clear `long_name_tab' member.
426         (dict_get_varname_block) Removed.
427         (dict_add_longvar_entry) Removed.
428         (free_nte) Removed.
429         (dict_destroy) Don't destroy `long_name_tab' member.
430         (dict_create_var_from_short) Removed.
431         (dict_create_var_x) Removed.
432         (dict_create_var) Get rid of longname handling.
433         Clear short name.
434         (dict_clone_var) Get rid of longname parameter and longname
435         handling.
436         (dict_lookup_var) Get rid of longname handling.
437         (dict_reorder_var) New function.
438         (dict_rename_var) Clear short name.
439         (dict_rename_vars) Get rid of longname handling.  Clear short
440         names.
441         (dict_create_vector) Support long vector names.
442         (dict_lookup_vector) Use strcasecmp() instead of strcmp().
443         (quasi_base27) Removed.
444         (make_short_name) Removed.
445         (compare_strings) New function.
446         (hash_string) New function.
447         (dict_assign_short_names) New function.
448
449         * file-handle.q: (get_handle_with_name) Use strcasecmp() instead
450         of strcmp().
451         (get_handle_for_filename) Support long handle names.
452
453         * file-type.c: (struct col_spec) Make `name' fit long var names.
454         (cmd_file_type) Use strcasecmp() instead of strcmp().
455
456         * flip.c: (make_new_var) Rewrite.
457         (flip_sink_write) Use st_trim_copy() instead of strncpy().
458
459         * format.c: (parse_format_specifier_name) Use mm_case_compare()
460         instead of memcmp().
461
462         * get.c: (cmd_save_internal) Rephrase.
463         (rename_variables) Drop test for identical variable name.
464         (struct mtf_proc) Change `first', `last' to fit long var name.
465
466         * hash.c: (hsh_hash_case_string) New function for case-insensitive
467         string hashing.
468
469         * lexer.c: (restore_token) Use st_trim_copy() instead of
470         strncpy().
471         (lex_get) Don't uppercase string when copying into tokid.
472         (lex_put_back_id) Use st_trim_copy() instead of
473         strncpy().
474
475         * list.q: (determine_layout) Consider length of variable names in
476         choosing vertical layout.
477
478         * matrix-data.c: (cmd_matrix_data) Use strcasecmp() instead of
479         strcmp().
480         (string_to_content_type) Ditto.
481
482         * modify-vars.c: (compare_variables_given_ordering) Ditto.
483         (struct var_renaming) Change `new_name' to fit long var name.
484         (compare_var_renaming_by_new_name) Use strcasecmp() instead of
485         strcmp().
486
487         * pfm-read.c: (read_variables) Disallow system variables in system
488         files.
489         (write_variables) Call dict_assign_short_names() and use
490         short_name[] members.
491
492         * repeat.c: (internal_cmd_do_repeat) Use strcasecmp() instead of
493         strcmp().
494
495         * sfm-read.c: (sfm_open_reader) Rewrite code for long variable
496         map.  Reorder variables into same order as long variable map.
497         (read_variables) Set short name.
498
499         * sfm-write.c: (sfm_open_writer) Call dict_assign_short_names().
500         (write_variable) Use st_bare_pad_copy().
501         (write_longvar_table) Rewrite.
502
503         * str.c: (mm_case_compare) New function.
504
505         * sysfile-info.c: (compare_vectors_by_name) Use strcasecmp()
506         instead of strcmp().
507
508         * t-test.q: (tts_custom_groups) Remove redundant test.
509         (tts_custom_pairs) Ditto.
510
511         * var.h: (struct variable) Change `name' to fit long var names.
512         Remove `longname'.  Add `short_name' member.  Reorder some
513         variables.
514         (struct name_table_entry) Removed.
515         (struct vector) Change `name' to fit long vector names.
516
517         * vars-atr.c: (var_is_valid_name) Allow long var names.
518         (compare_var_names) Use strcasecmp() instead of strcmp().
519         (compare_var_ptr_names) Ditto.
520         (hash_var_name) Use hsh_hash_case_string().
521         (hash_var_ptr_name) Ditto.
522         (var_set_short_name) New function.
523         (var_clear_short_name) New function.
524         (var_set_short_name_suffix) New function.
525
526         * vars-prs.c: (parse_DATA_LIST_vars) Support long names.
527         Use strcasecmp() instead of strcmp().
528         (struct array_var_set) Removed `longname_tab'.
529         (array_var_set_lookup_var_idx) Drop longname_tab support.
530         (array_var_set_destroy) Don't destroy `longname_tab'.
531         (var_set_create_from_array) Don't create `longname_tab'.
532
533         * vector.c: (cmd_vector) Use strcasecmp() instead of strcmp().
534         Support long names.
535
536         * expressions/parse.c: (word_matches) Use mm_case_compare()
537         instead of memcmp().
538         (compare_strings) New function.
539         (lookup_function) Use compare_strings() instead of strcmp().
540         
541 Sun May  1 22:07:43 2005  Ben Pfaff  <blp@gnu.org>
542
543         * algorithm.c: (move_element) New function.
544
545 Sun May  1 22:05:35 2005  Ben Pfaff  <blp@gnu.org>
546
547         * aggregate.c: (parse_aggregate_functions) Always initialize
548         destvar.
549
550 Sun May  1 22:03:47 2005  Ben Pfaff  <blp@gnu.org>
551
552         * aggregate.c: (cmd_aggregate) Use dict_clone_var_assert().
553
554         * dictionary.c: (dict_clone) Ditto.
555         (dict_clone_var_assert) New function.
556
557         * get.c: (mtf_merge_dictionary) Use dict_clone_var_assert().
558
559 Sun May  1 15:05:54 WST 2005 John Darrington <john@darrington.wattle.id.au>
560
561         * error.c: Added a string for the compiler version to the
562         request_bug_report_and_abort function.
563
564         * groff_font.c, font.c: Removed manpage(1) style references from 
565         comments, because RMS frowns upon them.
566
567 Thu Apr 28 18:52:06 2005  Ben Pfaff  <blp@gnu.org>
568
569         * expressions/parse.c: Improve previous fix for bug 12858 (LAG).
570
571 Fri Apr 29 09:28:00 WST 2005 John Darrington <john@darrington.wattle.id.au>
572
573         * expressions/parse.c: Added handler for OP_LAG_Vn and OP_LAG_Vs.  
574         Fixed bug [#12858] .
575
576 Wed Apr 27 12:42:34 WST 2005 John Darrington <john@darrington.wattle.id.au>
577
578         * loop.c recode.c repeat.c: Fixed a couple of instances of SHORT_NAME_LEN 
579         which should be LONG_NAME_LEN
580
581 Wed Apr 27 07:43:50 WST 2005 John Darrington <john@darrington.wattle.id.au>
582
583         * command.def echo.c:  Added the ECHO command.
584
585 Mon Apr 25 22:55:59 2005  Ben Pfaff  <blp@gnu.org>
586
587         Finish fixing MATCH FILES (bug 11677).
588
589         * get.c: (trim_dictionary) Rewrite in terms of drop_variables(),
590         keep_variables(), rename_variables().
591         (drop_variables) New function.
592         (keep_variables) New function.
593         (struct mtf_file) Rename `in' to `in_name'.  Add `in_var'.
594         (cmd_match_files) Deal with in_var.  Use drop_variables(),
595         keep_variables().  When IN is specified, require BY.  Set master
596         variables after master dictionary is complete.  Add IN variables
597         after master dictionary is complete.
598         (mtf_free_file) Free `in_name'.
599         (mtf_delete_file_in_place) Set in_var value to 0.
600         (mtf_read_nonactive_records)  Rephrase.
601         (mtf_processing) Support IN.  Rephrase.  Fix bugs.
602         (mtf_merge_dictionary) Don't set master variables; we do that
603         later now.
604         (get_master) Don't insist that there's a master variable.
605         
606 Mon Apr 25 22:55:22 2005  Ben Pfaff  <blp@gnu.org>
607
608         Kluge to make some variable renaming sort of work.
609         Needs real fix.
610
611         * dictionary.c: (dict_rename_var) Call dict_add_longvar_entry().
612
613 Mon Apr 25 22:52:28 2005  Ben Pfaff  <blp@gnu.org>
614
615         Add functions for comparing sets of variables between cases.
616         Use the functions.
617
618         * case.c: (case_compare) New function.
619         (case_compare_2dict) New function.
620         
621         * aggregate.c: (struct agr_proc) Remove `prev_break' member.  Add
622         `break_case'.
623         (cmd_aggregate) Nullify break_case.  Don't call
624         initialize_aggregate_info().
625         (agr_destroy) Destroy break_case.
626         (aggregate_single_case) Rewrite.  Use case_compare().
627         (dump_aggregate_info) Copy from break_case into output.
628         (initialize_aggregate_info) Copy break_case from input.
629
630         * get.c: (mtf_compare_BY_values) Use case_compare_2dict().
631
632         * vfm.c: (equal_splits) Use case_compare().
633
634 Sat Apr 23 17:01:04 WST 2005 John Darrington <john@darrington.wattle.id.au>
635
636         * dictionary.c vars-prs.c sfm-write.c: Fixed some memory leaks
637
638 Sun Apr 17 23:08:15 2005  Ben Pfaff  <blp@gnu.org>
639
640         Start work on fixing MATCH FILES.
641
642         * get.c: (enum operation) Remove OP_MATCH.
643         (trim_dictionary) Change return value to bool.  Don't support
644         OP_MATCH.
645         (struct mtf_file) Remove `first', `last' members.
646         (struct mtf_proc) Add `first', `last' members.  Change mtf_case
647         from `struct ccase *' to `struct ccase'.  Remove `by' member.
648         (cmd_match_files) Essentially rewrite.
649         (mtf_free) Don't free `by' member.  Destroy `mtf_case' member.
650         (mtf_read_nonactive_records) mtf_ parameter is not unused.
651         (mtf_processing) Ditto.  Also rephrase some code.
652         (mtf_merge_dictionary) Rewrite for easy comprehension.  
653
654 Sun Apr 17 23:06:00 2005  Ben Pfaff  <blp@gnu.org>
655
656         * matrix-data.c: (wr_output_data) [DEBUGGING] Fix compilation
657         error.
658
659         * q2c.c: (dump_token) [DEBUGGING] Fix compilation error.
660         
661 Thu Apr 14 2005 John Darrington
662
663         * var-display.c: New file.
664
665         * format.h var.h sfm-read.c sfm-write.c dictionary.c :  Added 
666           display_width, measure and alignment parameters to variables.
667
668         * aggregate.c command.def compute.c count.c data-list.c descript.c
669           dictionary.c dictionary.h expr-prs.c file-type.c flip.c get.c 
670           lexer.c lexer.h loop.c modify-vars.c pfm-read.c recode.c repeat.c 
671           sfm-read.c sfm-write.c sfm-write.h sfmP.h val-labs.c val.h var.h 
672           vars-prs.c vector.c :  
673               - Replaced literal constants representing maximum variable name 
674                 length with macro definitions. 
675               - Added support for long variable names.
676               - Changed lexer such that it no longer makes tokens upper
677                 case, but relies upon case insensitive behaviour of commands.
678
679 Mon Apr  4 22:27:34 2005  Ben Pfaff  <blp@gnu.org>
680
681         * aggregate.c: (parse_aggregate_functions) If dict_create_var()
682         fails, don't dereference the resulting null pointer (bug 12427).
683         Also, fix double free error.
684
685 Sat Mar 19 23:06:02 2005  Ben Pfaff  <blp@gnu.org>
686
687         * aggregate.c: (parse_aggregate_functions) Fix N_NO_VARS format.
688         (accumulate_aggregate_info) Set int1 to 1 for SUM.
689         (dump_aggregate_info) Only make SUM non-missing if there was at
690         least one variate.
691
692 Sat Mar 19 14:48:19 2005  Ben Pfaff  <blp@gnu.org>
693
694         * aggregate.c: (dump_aggregate_info) Properly test whether the
695         destination variable is numeric, when making the result
696         system-missing for columnwise missing values.
697
698 Mon Mar 14 21:52:34 2005  Ben Pfaff  <blp@gnu.org>
699
700         * misc.h: Remove GCC specializations.
701
702 Mon Mar 14 21:07:23 2005  Ben Pfaff  <blp@gnu.org>
703
704         Make sort stable (bug 12313).
705         
706         * sort.c: Don't need to include some headers anymore.
707         (static var min_buffers) New variable.
708         (static var max_buffers) New variable.
709         (static var allow_internal_sort) New variable.
710         (cmd_sort_cases) Add test mode.
711         (sort_execute) Rephrase.
712         (do_internal_sort) Don't try internal sorting if
713         allow_internal_sort is set.
714         (struct external_sort) Renamed `initial_runs' to `runs' and
715         updated all references.
716         (macro MIN_BUFFER_TOTAL_SIZE_RECS) Removed.
717         (macro MIN_BUFFER_SIZE_BYTES) Removed.
718         (macro MIN_BUFFER_SIZE_RECS) Removed.
719         (compare_initial_runs) Removed.
720         (struct record_run) Add member `idx'.
721         (write_initial_runs) Pass increasing values to process_case() as
722         index.
723         (process_case) Add `idx' parameter and use it to initialize new
724         `idx' member.
725         (allocate_cases) Limit allocated buffers to max_buffers.
726         (compare_record_run) Use new `idx' member for last resort
727         comparison, for stability.
728         (end_run) Call casefile_sleep() on irs->casefile, to prevent
729         running out of file descriptors.
730         (struct merge_state) Removed.
731         (merge) Don't need to allocate cases.  Always use MAX_MERGE_ORDER
732         unless we have fewer runs left.  Always merge consecutive runs,
733         for stability.  Return the final run.
734         (mod) Removed.
735         (choose_merge) New function.
736         (merge_once) Rewritten.
737
738 Mon Mar 14 21:05:42 2005  Ben Pfaff  <blp@gnu.org>
739
740         * cmdline.c: (static var testing_mode) Move into
741         parse_command_line().
742         
743 Mon Mar 14 21:05:13 2005  Ben Pfaff  <blp@gnu.org>
744
745         * algorithm.c: (remove_range) New function.
746         (remove_element) New function.
747
748         * dictionary.c: (dict_delete_var) Use remove_element().
749
750         * flip.c: (cmd_flip) Ditto.
751
752 Sun Mar 13 22:52:05 2005  Ben Pfaff  <blp@gnu.org>
753
754         * file-handle.q: (struct file_handle) `open_mode' should not be
755         const.
756         
757 Sun Mar 13 22:40:54 2005  Ben Pfaff  <blp@gnu.org>
758
759         First phase of making SORT CASES stable (bug 12313).
760
761         * sort.c: (struct indexed_case) New structure.
762         (do_internal_sort) Rewrite to make internal sorting stable.
763         (compare_case_dblptrs) Removed.
764         (compare_indexed_cases) New function.
765
766 Sun Mar 13 22:38:40 2005  Ben Pfaff  <blp@gnu.org>
767
768         Clean-ups.
769
770         * casefile.c: (casereader_read_xfer_assert) New function.
771
772         * dictionary.c: (dict_compact_case) New function.
773
774         * flip.c: (struct flip_pgm) New member idx_to_fv.
775         (cmd_flip) Initialize idx_to_fv member.
776         (destroy_flip_pgm) Free idx_to_fv member.
777         (flip_sink_write) Use struct flip_pgm member instead of case_sink
778         member.
779         (flip_sink_write) Ditto.
780
781         * vfm.c: (write_case) Use dict_compact_case() instead of
782         compact_case().
783         (compact_case) Removed.
784         (storage_source_create) Removed `dict' parameter.  All references
785         updated.
786
787         * vfm.h: (struct case_source) Removed `value_cnt' member.  All
788         references removed.
789         (struct case_sink) Removed `dict', `idx_to_fv' members.  All
790         references removed.
791
792 Sun Mar 13 22:35:55 2005  Ben Pfaff  <blp@gnu.org>
793
794         More AGGREGATE fixes.
795
796         * aggregate.c: (accumulate_aggregate_info) Implement NMISS and
797         NUMISS for strings.  Fix FOUT, POUT, FGT, FLT, FIN, FOUT for
798         strings.
799         (initialize_aggregate_info) Fix initialization for MIN, MAX for
800         strings.
801
802 Sat Mar 12 23:26:21 2005  Ben Pfaff  <blp@gnu.org>
803
804         Start work on testing and debugging AGGREGATE.
805
806         * aggregate.c: (cmd_aggregate) Use discrete bool variables instead
807         of a bit-map.  Require proper subcommand ordering.  Make OUTFILE
808         subcommand mandatory.
809         (parse_aggregate_functions) Check that PIN, POUT, FIN, FOUT
810         functions' arguments are in the correct order and swap them if
811         not.
812         (accumulate_aggregate_info) Make SUM include weights.  Add various
813         string functions.
814         (dump_aggregate_info) Add various string functions.
815         (initialize_aggregate_info) Initialize int1 for MIN, MAX.
816
817         * sort.c: (sort_parse_criteria) Add parameter for returning
818         whether any directions were specified.  All callers updated.
819
820 Sun Mar 13 14:54:27 WST 2005 John Darrington <john@darrington.wattle.id.au>
821
822         * t-test.q: Fixed erroneous logic in compare_group_binary.
823
824 Sat Mar 12 13:29:21 2005  Ben Pfaff  <blp@gnu.org>
825
826         * split-file.c: (cmd_split_file) Ignore LAYERED and SEPARATE
827         keywords (bug 11628).
828
829 Sat Mar 12 13:17:12 2005  Ben Pfaff  <blp@gnu.org>
830
831         * vfm.c: (procedure_with_splits) Fix bug 11492: end_func() must be
832         called *before* close_active_file().
833
834 Sat Mar 12 12:20:57 2005  Ben Pfaff  <blp@gnu.org>
835
836         * file-handle.q: (struct file_handle) Change open_mode from
837         character pointer to 3-char array, for safety.  Updated all
838         references.
839
840 Sat Mar 12 12:15:49 2005  Ben Pfaff  <blp@gnu.org>
841
842         Thanks to Ben Kujala <bkujala@oregonchildcare.org> for reporting
843         these bugs.
844         
845         * pfm-read.c: (read_header) Improve error message for many cases
846         in which the input is not actually a portable file.
847
848         * file-handle.q: (fh_open) When we give an error message, actually
849         return NULL.
850
851 Fri Mar 11 11:50:30 2005  Ben Pfaff  <blp@gnu.org>
852
853         * format.c: (check_common_specifier) New function for checks
854         common to check_input_specifier() and check_output_specifier().
855         (check_input_specifier) Use check_common_specifier().
856         (check_output_specifier) Use check_common_specifier().
857         (check_string_specifier) Removed.
858         (check_specifier_type) New function.
859         (check_specifier_width) New function.
860         (get_format_var_width) Fix bug.
861
862         * formats.c: (internal_cmd_formats) Only accept numeric variables.
863
864         * lexer.c: (check_id) Rename lex_id_to_token(), make public,
865         update all references.  Make case-insensitive.
866
867         * pfm-read.c: Essentially rewrite the whole file.  Now much
868         cleaner.
869
870         * print.c: (check_string_width) New function.
871         (fixed_parse_compatible) Use check_string_width(),
872         check_specifier_type().
873         (dump_fmt_list) Ditto.
874
875         * str.c: (st_trim_copy) New function.
876         (st_uppercase) New function.
877
878         * vars-atr.c: (var_is_valid_name) New function.
879         
880         * expressions/parse.c: (type_coercion_core) Use
881         check_specifier_type().
882         
883 Fri Mar 11 11:31:24 2005  Ben Pfaff  <blp@gnu.org>
884
885         * expressions/evaluate.c: (cmd_debug_evaluate) Fix memory leaks.
886
887         * expressions/parse.c: (no_match) Ditto.
888
889 Wed Mar  9 09:54:27 2005  Ben Pfaff  <blp@gnu.org>
890
891         * Makefile.am: (pspp_LDADD) Add libgsl-extras.a.
892
893         * expressions/helpers.c: (struct func_params) Removed.
894         (generalized_idf) Removed.
895         (cdf_beta) Removed.
896         (idf_beta) Removed.
897         (idf_fdist) Use gslextras_cdf_beta_Pinv() instead of idf_beta().
898
899         * expressions/operations.def: Implement IDF.BETA, CDF.BINOM,
900         CDF.GEOM, CDF.HYPER, CDF.NEGBIN, CDF.POISSON using gsl-extras.
901         Implement SIG.F, which I had overlooked previously.
902
903 Tue Mar  8 12:47:53 WST 2005 John Darrington <john@darrington.wattle.id.au>
904
905         * command.c command.def glob.[ch] cmdline.c: Made DEBUG cmds
906         available only in testing mode.
907
908 Sun Mar  6 23:25:40 2005  Ben Pfaff  <blp@gnu.org>
909
910         * data-in.c: Use `bool' throughout, where relevant.
911
912 Sun Mar  6 19:52:22 2005  Ben Pfaff  <blp@gnu.org>
913
914         DATA LIST with free-field formats should not have implied decimal
915         places (bug 12035).  Also clean up data-in.c a bit.
916
917         * data-in.h: (enum) Add DI_IMPLIED_DECIMALS.
918
919         * data-in.c: (apply_implied_decimals) New function.
920         (parse_numeric) Don't adjust exponent if DI_IMPLIED_DECIMALS not
921         set.  Also, get rid of gotos.
922         (parse_Z) Use apply_implied_decimals() if the field doesn't
923         contain a decimal point.
924         (parse_N) Use apply_implied_decimals().
925         (parse_IB) Ditto.
926         (parse_PIB) Ditto.
927         (parse_P) Ditto.
928         (parse_PK) Ditto.
929         (to_roman) Removed.
930         (parse_enum) New function.
931         (macro CHAR_IS_ROMAN) Removed.
932         (macro ROMAN_VALUE) Removed.
933         (parse_month) Use parse_enum().
934         (parse_weekday) Use parse_enum().
935         (parse_DATETIME) Use long for weekday.
936
937         * data-list.c: (read_from_data_list_fixed) Use
938         DI_IMPLIED_DECIMALS.
939
940 Sun Mar  6 17:07:20 2005  Ben Pfaff  <blp@gnu.org>
941
942         When the lexer sees something like `-5' in the input, it has to
943         decide whether it's a negative numeric constant token or a '-'
944         token followed by a positive numeric constant token.  It always
945         decides on the former, and then the parser can call
946         lex_negative_to_dash() if it wants the latter.  However, this
947         doesn't work for the case of `-0', because negative zero is
948         (portably) indistinguishable from positive zero.  So now we divide
949         T_NUM into two tokens, T_POS_NUM and T_NEG_NUM, to make the
950         distinction clear.  This requires a little bit of extra effort,
951         because there were several references to T_NUM in the code base.
952         
953         * lexer.c: (lex_get) Use T_NEG_NUM and T_POS_NUM to distinguish
954         positive and negative numeric constants.
955         (lex_double_p) Renamed lex_is_number().  Changed return type to
956         bool.  Updated all relevant references to T_NUM to instead use
957         this function.
958         (lex_double) Renamed lex_number().  All references updated.
959         (lex_integer_p) Renamed lex_is_integer().  Changed return type to
960         bool.  All references updated.
961         (lex_token_representation) Understand T_NEG_NUM and T_POS_NUM.
962         (lex_negative_to_dash) Ditto.
963         (dump_token) Ditto.
964         
965         * lexer.h: (enum) Add T_POS_NUM, T_NEG_NUM.  Remove T_NUM.
966
967 Sun Mar  6 22:09:20 2005  Ben Pfaff  <blp@gnu.org>
968
969         * expressions/operations.def: (NUMBER) Use DI_IMPLIED_DECIMALS.
970
971 Sun Mar  6 19:33:24 2005  Ben Pfaff  <blp@gnu.org>
972
973         * expressions/operations.def: (VEC_ELEM_NUM) Treat user-missing
974         values as system-missing.
975
976         * expressions/parse.c: (parse_vector_element) Fix order of
977         arguments in call to expr_allocate_binary().
978
979 Sun Mar  6 17:51:05 2005  Ben Pfaff  <blp@gnu.org>
980
981         * expressions/optimize.c: (optimize_tree) Fix optimization bug for
982         x**2.
983
984         * expressions/parse.c: (type_coercion_core) Set *node to NULL on
985         failure, as indicated by function comment.
986         (parse_binary_operators) Always return NULL on type_coercion()
987         failure.  Should have been doing this anyway, but bug in
988         type_coercion_core() filtered through.
989         (parse_add) Fix typo in user message.
990         (parse_primary) Understand T_NEG_NUM and T_POS_NUM.
991
992 Sun Mar  6 10:47:13 2005  Ben Pfaff  <blp@gnu.org>
993
994         * expressions/operations.def: Add VALUE function.
995
996         * expressions/parse.c: (parse_function) Need an unary composite
997         node for variables in A TO B, not a variable node.  Use
998         allocate_unary_variable().
999         (parse_primary) Use allocate_unary_variable().
1000         (allocate_unary_variable) New function.
1001
1002 Thu Mar  3 23:53:32 2005  Ben Pfaff  <blp@gnu.org>
1003
1004         * expressions/PSPP_expressions.pm: Renamed it back to generate.pl
1005         but fixed the real problem that was preventing the build from a
1006         separate directory.  I liked it my way better ;-)
1007         
1008 Thu Mar  3 23:17:51 2005  Ben Pfaff  <blp@gnu.org>
1009
1010         * expressions/parse.c: (expr_parse) Fix parameter type.  Thanks to
1011         John Darrington <john@darrington.wattle.id.au> for reporting this
1012         bug.
1013
1014 Thu Mar  3 22:10:25 WST 2005 John Darrington <john@darrington.wattle.id.au>
1015
1016         * expressions/Makefile.am expressions/evaluate.h.pl
1017           expressions/evaluate.inc.pl expressions/operations.h.pl
1018           expressions/optimize.inc.pl expressions/parse.inc.p:
1019
1020           Renamed generate.pl to PSPP_expressions.pm and adjusted *.pl
1021           to suit. 
1022
1023           Fixed everything so that it can be built from an arbitrary
1024           directory.
1025         
1026 Thu Mar  3 22:08:35 WST 2005 John Darrington <john@darrington.wattle.id.au>
1027
1028         * Makefile.am : Fixed up CLEANFILES target.
1029
1030 Mon Feb 28 23:49:56 2005  Ben Pfaff  <blp@gnu.org>
1031
1032         * str.h: Changed `struct len_string' to `struct fixed_string', a
1033         more accurate name.  Updated all references.
1034
1035 Mon Feb 28 23:35:30 2005  Ben Pfaff  <blp@gnu.org>
1036
1037         Redo calendar support.  Should now be bug-for-bug compatible.
1038         
1039         * calendar.c: New file.
1040
1041         * calendar.h: New file.
1042
1043         * data-in.c: Use new calendar functions.
1044         (parse_sign) Change sense of return value.
1045         (calendar_error) New function.
1046         (ymd_to_ofs) New function.
1047         (ymd_to_date) New function.
1048         (parse_DATE) Use new function.
1049         (parse_ADATE) Ditto.
1050         (parse_EDATE) Ditto.
1051         (parse_SDATE) Ditto.
1052         (parse_JDATE) Ditto.
1053         (parse_QYR) Ditto.
1054         (parse_MOYR) Ditto.
1055         (parse_WKYR) Ditto.
1056         (parse_TIME) Ditto.
1057         (parse_DTIME) Ditto.
1058         (parse_DATETIME) Ditto.
1059
1060         * data-out.c: (convert_date) Use new calendar functions.
1061
1062         * error.c: (err_vmsg) Changed interface to be more sensible.
1063         Updated all callers.
1064         (dump_message) Don't double new-lines (why did we do this
1065         anyway?).
1066
1067 Mon Feb 28 23:30:25 2005  Ben Pfaff  <blp@gnu.org>
1068
1069         * sfmP.h: (macro flt64) Moved here from pref.h.orig.
1070         (macro FLT64_MAX) Moved here from pref.h.orig.
1071
1072 Mon Feb 28 23:28:01 2005  Ben Pfaff  <blp@gnu.org>
1073
1074         * set.q: Support SET EPOCH.
1075         (static var set_epoch) New var.
1076         (aux_stc_custom_epoch) New function.
1077         (stc_custom_epoch) New function.
1078         (get_epoch) New function.
1079         (stc_custom_pager) [USE_INTERNAL_PAGER] Fix bug.
1080
1081         * format.c: Make it possible just to check whether a specifier is
1082         valid without emitting an error message.
1083         (parse_format_specifier_name) Change interface, update all
1084         callers.
1085         (check_input_specifier) Ditto.
1086         (check_output_specifier) Ditto.
1087         (parse_format_specifier) Ditto.
1088
1089 Mon Feb 28 23:24:08 2005  Ben Pfaff  <blp@gnu.org>
1090
1091         * command.def: Add DEBUG POOL.
1092
1093         * pool.c: (pool_destroy) Fix bug in deleting this pool from its
1094         parent.
1095         (pool_clear) Properly account for size of pool gizmo.
1096         (pool_realloc) Ditto.
1097         (pool_clone) New function.
1098
1099         * pool.h: Mark our allocation functions MALLOC_LIKE.
1100
1101 Mon Feb 28 23:21:26 2005  Ben Pfaff  <blp@gnu.org>
1102
1103         * Makefile.am: Move many definitions into new top-level
1104         Make.build.  Add expressions to SUBDIRS.  Add calendar.c,
1105         calendar.h.  Remove expr-evl.c, expr-opt.c expr-prs.c, expr.h,
1106         exprP.h, expr.def.
1107
1108         * case.c: (case_resize) New function.
1109         (case_swap) New function.
1110
1111         * casefile.c: Include mkfile.h.
1112
1113 Fri Feb 25 21:11:35 WST 2005 John Darrington <john@darrington.wattle.id.au>
1114
1115         * sfm-read.c: Fixed a buglet which caused a crash when trying
1116         to read a non-existent file.
1117
1118 Sun Feb 13 16:11:13 2005  Ben Pfaff  <blp@gnu.org>
1119
1120         Fix bug 11955.
1121
1122         * aggregate.c: (parse_aggregate_functions) Code cleanup.
1123         Important part: get rid of spurious copying of function->format to
1124         destvar->print and destvar->write.
1125
1126 Fri Feb 11 00:08:36 2005  Ben Pfaff  <blp@gnu.org>
1127
1128         Fix bug 11916, which was confusing a variable's `index' member
1129         with the variable's position in a var_set.  Although these are
1130         usually the same, they are not for array `var_set's.
1131         
1132         Took advantage of this bug as an opportunity to clean up and
1133         rewrite parse_var_set_vars().
1134
1135         * vars-prs.c: (parse_vs_variable_idx) New function.
1136         (parse_vs_variable) Reimplement in terms of
1137         parse_vs_variable_idx().
1138         (parse_var_idx_class) New function.
1139         (add_variable) New function.
1140         (add_variables) New function.
1141         (parse_var_set_vars) Rewritten.
1142         (struct var_set) Change `lookup_var' member that returns a
1143         variable into `lookup_var_idx' member that returns an int.
1144         Updated the var set implementations in obvious corresponding ways.
1145         Used compare_var_ptr_names(), hash_var_ptr_name() just added.
1146         
1147 Fri Feb 11 00:06:03 2005  Ben Pfaff  <blp@gnu.org>
1148
1149         Use our global variable compare & hash functions and give them
1150         better names.  Add similar functions for dealing with double
1151         pointers to variables.
1152         
1153         * vars-atr.c: (compare_variables) Renamed compare_var_names().
1154         (hash_variable) Renamed hash_var_name().
1155         (compare_var_ptr_names) New function.
1156         (hash_var_ptr_name) New function.
1157         
1158         * t-test.q: (cmd_t_test) Use global compare_var_names(),
1159         hash_var_name().
1160         (compare_var_name) Removed.
1161         (hash_var_name) Removed.
1162
1163 Fri Feb 11 00:04:39 2005  Ben Pfaff  <blp@gnu.org>
1164
1165         Fix dictionary bug.
1166         
1167         * dictionary.c: (compare_variable_dblptrs) Rename
1168         compare_var_ptrs() and fix it to properly dereference the double
1169         pointers.
1170
1171 Mon Feb  7 09:58:15 WST 2005 John Darrington <john@darrington.wattle.id.au>
1172
1173         crosstabs.q examine.q oneway.q q2c.c:  Added a q2c feature to 
1174         declare subcommands as mandatory.  Closed bug #11843
1175
1176 Sat Feb  5 20:35:10 WST 2005 John Darrington <john@darrington.wattle.id.au>
1177         
1178         * getline.c command.[ch] command.def:  Added (very rudimentary)
1179         support for line  completion when in interactive mode.  Partially 
1180         addresses bug #11693
1181         
1182 Mon Jan 31 09:52:51 WST 2005 John Darrington <john@darrington.wattle.id.au>
1183
1184         * examine.q factor_stats.c oneway.q output.c pfm-read.c: Fixed some
1185         problems revealed by valgrind.
1186
1187
1188 Wed Jan 26 11:44:11 WST 2005 John Darrington <john@darrington.wattle.id.au>
1189
1190         * set.q: Affixed a fix to the previous fix such that we'll be OK now
1191         whether or not PAGER is set.
1192
1193 Wed Jan 26 09:25:54 WST 2005 John Darrington <john@darrington.wattle.id.au>
1194
1195         * set.q: Copied the string produced by getenv("PAGER") thus avoiding
1196         "invalid free" errors.  Hopefully fixes bug #11722
1197
1198         * compute.c expr-prs.c: Check that lvalues are populated before 
1199         attempting to destroy them.  Closes bug #11676
1200
1201 Tue Jan 25 21:01:43 WST 2005 John Darrington <john@darrington.wattle.id.au>
1202
1203         * aggregate.c: Initialised the complete agr_proc structure.
1204         Closes bug #11675
1205
1206
1207 Sun Jan 23 23:02:21 2005  Ben Pfaff  <blp@gnu.org>
1208
1209         * print.c: (print_trns_free) Close the dfm writer if there is one,
1210         fixing a memory leak.
1211
1212 Mon Jan 24 12:24:36 WST 2005 John Darrington <john@darrington.wattle.id.au>
1213
1214         * glob.c oneway.q q2c.c t-test.q vfm.c: Still *more* memory leaks 
1215         fixed.
1216
1217
1218 Fri Jan 21 19:54:14 WST 2005 John Darrington <john@darrington.wattle.id.au>
1219
1220         * linked-list.[ch] Added
1221
1222         * examine.q file-handle.[hq] font.h glob.c groff-font.c postscript.c 
1223           set.q:    Yet more memory leaks
1224
1225 Tue Jan 18 23:12:40 WST 2005 John Darrington <john@darrington.wattle.id.au>
1226
1227         * t-test.q examine.q : More memory leaks fixed.
1228
1229 Tue Jan 18 19:26:59 WST 2005 John Darrington <john@darrington.wattle.id.au>
1230
1231         * examine.q  factor_stats.[ch] get.c pfm-read.c: Plugged numerous
1232         memory leaks.
1233
1234 Mon Jan 10 14:43:45 WST 2005 John Darrington <john@darrington.wattle.id.au>
1235
1236         * ascii.c cartesian.c casefile.c chart.h devind.c 
1237           examine.q frequencies.q
1238           html.c output.h piechart.c plot-chart.c plot-hist.c
1239
1240           Integrated the chart rendering into the output stream
1241           (currently only works for html).
1242           
1243           Removed gratuitous use of ifndef NO_CHARTS, and replaced with
1244           dummy-chart.c for compiling without charts.
1245
1246         * mkfile.[ch] Created.  
1247
1248         * som.[ch] tab.[ch]: Changed name of som_table to som_entity
1249         Added type element so we can tell if it's a chart or a table.
1250
1251         * chart.h examine.q piechart.c plot-chart.c plot-hist.c: changed the 
1252         API of charts to be more like that of tables.
1253
1254 Thu Jan 13 21:00:02 WST 2005 John Darrington <john@darrington.wattle.id.au>
1255
1256         * casefile.c main.c: Moved the SIGINT handler from casefile.c to
1257         main.c. Removed the handler for SIGQUIT.
1258
1259 Mon Jan 10 14:43:45 WST 2005 John Darrington <john@darrington.wattle.id.au>
1260
1261         * casefile.c: Added a signal handler to delete temp files on 
1262         SIGINT and SIGQUIT
1263
1264         * permissions.c Inhibited the PERMISSIONS command when SAFER is on.
1265
1266         * command.def Added a lot more unimplemented commands.
1267
1268         * copyleft.[ch] cmdline.c Moved legal information to copyleft.c
1269
1270 Sat Jan  8 23:58:34 2005  Ben Pfaff  <blp@gnu.org>
1271
1272         * sort.c: (compare_initial_runs) Needed additional level of
1273         dereferencing.
1274         (merge_once) Fix plenty of stupid mistakes.
1275
1276 Sat Jan  8 23:55:27 2005  Ben Pfaff  <blp@gnu.org>
1277
1278         * casefile.c: (casefile_sleep) Need to flush_buffer() after
1279         calling casefile_to_disk() or we will lose the last block in the
1280         file if the casefile started out as disk-based.
1281         (casefile_get_reader) Initialize reader->destructive to 0.
1282         (cmd_debug_casefile) Add new test pattern.
1283         (test_casefile) Define new test pattern to make sure
1284         casefile_sleep() works properly.
1285
1286 Fri Jan  7 08:00:05 WST 2005 John Darrington <john@darrington.wattle.id.au>
1287
1288         * Makefile.am chart.[ch]  histogram.[ch] piechart.c (Modified);
1289           plot-hist.c plot-chart.c (Added) Reorganised these files in an
1290           attempt to seperate the creation and processing of charts from their
1291           actuall renedering.
1292
1293         * examine.q frequencies.q generated charts conditional upon the NO_CHARTS
1294           macro.
1295
1296 Thu Jan  6 18:48:58 WST 2005 John Darrington <john@darrington.wattle.id.au>
1297
1298         * main.c Added a signal handler for SIGFPE
1299
1300         * sort.c Somewhat more robust fix to the previous entry.
1301
1302 Wed Jan  5 21:23:31 2005  Ben Pfaff  <blp@gnu.org>
1303
1304         * sort.c: (merge) Fix assertion for proper Huffman merge pattern:
1305         0 == 1 modulo 1.  See Knuth 5.4.9 (vol. 3, 2nd ed.,
1306         pp. 361).  Thanks to John Darrington <john@cellform.com.au> for
1307         reporting the bug.
1308
1309 Wed Jan  5 22:42:26 WST 2005 John Darrington <john@darrington.wattle.id.au>
1310
1311         * case.h Fixed bug # 11307
1312         
1313 Wed Jan  5 08:30:48 WST 2005 John Darrington <john@darrington.wattle.id.au>
1314
1315         * val-labs.c Fixed bug which caused a crash if VALUE LABELS had
1316         a trailing slash.
1317
1318 Mon Jan  3 17:44:37 2005  Ben Pfaff  <blp@gnu.org>
1319
1320         * pfm-read.c: (read_variables) Remove direct manipulation of
1321         v->aux, which is no longer needed.  Fixes bug 11483.
1322
1323 Sat Jan  1 19:01:16 WST 2005 John Darrington <john@darrington.wattle.id.au>
1324
1325         * data-list.c Fixed a bug in parsing delimiters.
1326
1327         * group.c vars-atr.c Fixed buglet in hash/compare functions for alpha
1328         values.
1329
1330         * percentiles.c Properly handled calculation of Tukey hinges where
1331         the number of data is small.
1332
1333         * oneway.q Used the generic value_to_string function for independent
1334         variable instead of trying to do it ourselves.
1335
1336         * box-whisker.c Fixed a buglet which caused a crash if the number of
1337         data was zero
1338
1339
1340 Fri Dec 31 16:47:45 WST 2004 John Darrington <john@darrington.wattle.id.au>
1341
1342         * examine.q box-whisker.c chart.h Implemented boxplots in EXAMINE
1343
1344         * percentiles.c Fixed some bugs when calculating percentiles when
1345         there's a small number of cases.
1346
1347 Wed Dec 29 08:18:08 WST 2004 John Darrington <john@darrington.wattle.id.au>
1348
1349         * percentiles.[ch] Added. Calculates percentiles and Tukey hinges
1350
1351         * examine.q factor_stats.[ch]  Added calculation of percentiles
1352
1353 Fri Dec 24 15:09:11 WST 2004 John Darrington <john@darrington.wattle.id.au>
1354
1355         * t-test.q Fixed bug #11227 Made t-test work when the independent
1356         variable is alpha
1357
1358 Sat Dec 11 11:43:45 WST 2004 John Darrington <john@darrington.wattle.id.au>
1359
1360         * factor_stats.c Fixed calculation of trimmed mean under various
1361         special conditions.
1362
1363 Sat Dec  4 17:14:45 WST 2004 John Darrington <john@darrington.wattle.id.au>
1364
1365         * histogram.c chart.[ch] factor_stats.c frequencies.q
1366
1367         Added code to calculate sensible histogram ranges and limits.
1368
1369 Thu Dec  2 13:37:43 WST 2004 John Darrington <john@darrington.wattle.id.au>
1370
1371         * chart.h Updated to reflect many API changes.
1372
1373         * cartesian.c chart.c Moved the definitions of chart_write_{xy}scale from 
1374         cartesian.c and into chart.c
1375
1376         * factorstats.[ch] Added the histogram calculations
1377
1378         * casefile.c Removed an unused variable.
1379
1380         * frequencies.q examine.q histogram.c  Reworked the API for 
1381         histograms.
1382
1383         * piechart.c  Revised the API for piecharts.
1384
1385         * var.h  Moved the definitions of freq_tab and freq out of var.h
1386         and into frequencies.q where they belong.
1387         
1388 Tue Nov 30 21:10:20 2004  Ben Pfaff  <blp@gnu.org>
1389
1390         * flip.c: (flip_file) Check for off_t separately from fseeko(),
1391         using AC_TYPE_OFF_T.
1392
1393 Tue Nov 30 08:47:41 2004  Ben Pfaff  <blp@gnu.org>
1394
1395         * flip.c: (flip_file) If fseeko() is not available, use long int
1396         for off_t.  Thanks to "Marshall DeBerry" <mdb@radix.net> for
1397         reporting the problem.
1398
1399 Mon Nov 29 12:20:59 WST 2004 John Darrington <john@darrington.wattle.id.au>
1400
1401         * examine.q factor_stats.[ch] Changed stderr to se_mean to avoid
1402         conflict with stdio.
1403
1404 Sun Nov 21 10:32:41 WST 2004 John Darrington <john@darrington.wattle.id.au>
1405
1406         * var-labs.c (var_to_string) Now returns null if the variable is null
1407
1408         * value-labels.c (value_to_string) Made it return null if either the 
1409         value or the variable is null.
1410
1411         * hash.c (hsh_clear) Fixed a buglet.
1412
1413         * examine.q  factor_stats.[ch] Largely  rewrote, because I'd started 
1414         with  the wrong model.
1415
1416         * casefile.[ch] Added a function to return the casereader.case_idx 
1417         member
1418
1419         * examine.q  Implemented the extreme values results.
1420
1421 John Darrington <john@darrington.wattle.id.au>
1422
1423         * settings.h set.c glob.[ch] frequencies.q q2c.c error.c lexer.[ch] 
1424           output.[ch] getline.c 
1425
1426           Plugged some memory leaks
1427
1428 Mon Nov 15 23:47:40 2004  Ben Pfaff  <blp@gnu.org>
1429
1430         Adopt GSL random number generators, paving the way for providing
1431         the complete suite of random number generators on expressions.
1432         
1433         * Makefile.am: Remove random.c, random.h.
1434
1435         * random.c: Removed.
1436
1437         * random.h: Removed.
1438
1439         * algorithm.c: (algo_default_random) Use GSL functions.
1440
1441         * casefile.c: (test_casefile) Use GSL RNG functions.
1442
1443         * expr-evl.c: (expr_evaluate) Use GSL RNG functions for OP_NORMAL,
1444         OP_UNIFORM.
1445
1446         * sample.c: (cmd_sample) Use GSL RNG functions.
1447         (sample_trns_proc) Ditto.
1448
1449         * set.q: (static var set_seed) Removed.
1450         (static var seed_flag) Removed.
1451         (static var rng) New variable.
1452         (aux_stc_custom_seed) No seed value anymore, don't print anything.
1453         (stc_custom_seed) Use new seed functions.
1454         (seed_is_set) Removed.
1455         (get_rng) New function that composes the entire external
1456         interface.
1457         (set_rng) New function.
1458         (random_seed) New function.
1459
1460 Mon Nov 15 22:08:25 2004  Ben Pfaff  <blp@gnu.org>
1461
1462         * expr-evl.c: (expr_evaluate) Fix XDATE.JDAY formula.  Thanks to
1463         John Darrington <john@darrington.wattle.id.au> for reporting this
1464         bug.
1465
1466 Tue Nov 16 13:19:18 WST 2004 John Darrington <john@darrington.wattle.id.au>
1467
1468         * permissions.c command.def Added the PERMISSIONS command
1469
1470 Mon Nov 15 01:33:32 2004  Ben Pfaff  <blp@gnu.org>
1471
1472         * q2c.c: (dump_header) Don't try to emit #includes at very top of
1473         output file because that will precede #include <config.h>, which
1474         is bad.
1475         (main) Add needed headers to /* (header) */ code.
1476
1477 Mon Nov 15 01:21:36 2004  Ben Pfaff  <blp@gnu.org>
1478
1479         Instead of making system or portable file readers responsible for
1480         dropping and reordering variables, make them read full cases and
1481         let the caller take care of any changes.
1482
1483         * get.c: New "case map" structure to handle this.  Use for GET,
1484         IMPORT, MATCH FILES.  Essentially rewrite the whole file.
1485
1486         * pfm-read.c: (pfm_read_case) Read into provided case.  Signature
1487         changed appropriately.
1488
1489         * sfm-read.c: (sfm_read_case) Ditto.
1490
1491 Mon Nov 15 00:47:45 2004  Ben Pfaff  <blp@gnu.org>
1492
1493         Decided that case_serialize() and case_unserialize() were too
1494         abstract.  Also we need a couple more functions to avoid excessive
1495         copying for data in/out fast paths.
1496
1497         * case.c: (case_serial_size) Removed.
1498         (case_serialize) Rename case_to_values() and make its argument
1499         explicitly an array of union values.
1500         (case_unserialize) Rename case_from_values() and make its argument
1501         explicitly an array of union values.
1502         (case_data_all) New function.
1503         (case_data_all_rw) New function.
1504
1505         * casefile.c: (struct casefile) Change buffer from array of
1506         unsigned char to array of union value for better accuracy.
1507         Redefine buffer_used and buffer_size in terms of values, not
1508         bytes.  Remove case_size because it is now redundant with
1509         value_cnt.  Fix up all references to these members.
1510
1511 Mon Nov 15 00:45:46 2004  Ben Pfaff  <blp@gnu.org>
1512
1513         * barchart.c: (struct subcat) Make `label' member const to silence
1514         GCC warning with -Wwrite-strings.
1515
1516         * cartesian.c: (struct dataset) Ditto.
1517
1518         * case.c: Don't re-define NDEBUG if already defined.
1519         Add lots of comments.
1520
1521         * str.c: Fix includes.
1522
1523         * crosstabs.q: Fix includes.
1524
1525         * examine.q: Fix includes.  Fix GCC warning about unused
1526         variables.
1527         
1528         * frequencies.q: (stat macro) Removed and replaced where used by
1529         its expansion.
1530
1531         * list.q: Fix includes.
1532
1533         * oneway.q: Fix includes.
1534
1535         * piechart.c: Fix includes.  Only define M_PI if not already
1536         defined.
1537
1538         * sfm-read.c: (bswap) New function.
1539         (bswap_int32) Write in terms of bswap.
1540         (bswap_flt64) Ditto.
1541
1542         * str.c: (ds_data) Add external definition here, needed because
1543         str.h has only an `extern inline' version.
1544
1545         * value-labels.c: Fix includes.
1546
1547 Mon Nov 15 00:40:55 2004  Ben Pfaff  <blp@gnu.org>
1548
1549         Instead of providing a system or portable file writer with a raw
1550         case in the format needed for output, provide it with a regular
1551         case.  The writer takes care of any needed translation.
1552
1553         * aggregate.c: Adopt new scheme for AGGREGATE.
1554         (struct agr_proc) sfm_agr_case member removed.
1555         (write_case_to_sfm) Removed because the new interface is easier to
1556         use.
1557
1558         * get.c: Adopt new scheme for SAVE, XSAVE, EXPORT.
1559
1560         * pfm-write.c: Implement new scheme.
1561
1562         * sfm-write.c: Ditto.
1563
1564 Mon Nov 15 00:32:24 2004  Ben Pfaff  <blp@gnu.org>
1565
1566         Instead of treating `struct file_handle' as a class to subclass
1567         into data files, system files, and portable files, instead use it
1568         as a helper that coordinates access.  Now it is opaque, too.
1569
1570         This means that most references to a struct file_handle are now
1571         changed into references to one of struct dfm_reader, struct
1572         dfm_writer, struct sfm_reader, struct sfm_writer, struct
1573         pfm_reader, or struct pfm_writer, according to what's being read
1574         or written.
1575
1576         Most related changes are only worth summarizing briefly.
1577
1578         * dictionary.c: (dict_clear) Destroy aux data in deleted
1579         variables.
1580         (dict_clear_aux) New function.
1581         (dict_create_var) Initialize aux, aux_dtor.
1582         (dict_delete_var) Destroy aux data in deleted variable.
1583
1584         * file-handle.h: (struct fh_ext_class) Removed.
1585         (struct file_handle) Removed.
1586         (fh_init_files) Removed.
1587
1588         * file-handle.q: Changed references to a handle's `private' member
1589         to direct references.
1590         (struct private_file_handle) Renamed file_handle.
1591         Add next, open_cnt, type, open_mode, aux members.
1592         (struct file_handle_list) Removed.
1593         (extern var inline_file) Removed.
1594         (static var file_handles) Changed from file_handle_list * to
1595         file_handle *.
1596         (create_file_handle) Initialize new members.
1597         (fh_close_handle) Removed.
1598         (mode_name) New function.
1599         (fh_open) New function.
1600         (fh_close) New function.
1601         (fh_parse_file_handle) Renamed fh_parse().
1602
1603         * glob.c: (init_glob) Remove fh_init_files() call.
1604         
1605         * aggregate.c: use sfm_writer.
1606         (create_sysfile) Removed because the new interface is simpler.
1607         
1608         * apply-dict.c: Use sfm_reader.
1609
1610         * data-list.c: Use dfm_reader.
1611
1612         * file-type.c: Use dfm_reader.
1613
1614         * get.c: Use sfm_reader, sfm_writer, pfm_reader, pfm_writer.
1615
1616         * inpt-pgm.c: Use dfm_reader.
1617
1618         * print.c: Use dfm_writer.
1619
1620         * sysfile-info: Use sfm_reader.
1621
1622         * dfm-read.c: Adopt new file handle infrastructure.
1623
1624         * dfm-write.c: Ditto.
1625
1626         * pfm-read.c: Ditto.
1627         
1628         * pfm-write.c: Ditto.
1629
1630         * sfm-read.c: Ditto.
1631
1632         * sfm-write.c: Ditto.
1633         
1634 Mon Nov 15 00:31:44 2004  Ben Pfaff  <blp@gnu.org>
1635
1636         Break dictionary functions into separate header file.
1637
1638         * dictionary.h: New file.
1639
1640         * var.h: Moved dict_*() functions to dictionary.h.
1641
1642 Mon Nov 15 00:30:33 2004  Ben Pfaff  <blp@gnu.org>
1643
1644         Get rid of procedure-specific union in struct variable, using
1645         instead a void * pointer and a destructor function.
1646
1647         Most related changes are only worth brief summaries.
1648
1649         * crosstabs.q: Fix includes.  Use new struct var_range in lieu of
1650         old p.crs member in struct variable.
1651         
1652         * frequencies.q: Fix includes.  Use new struct var_freqs in lieu
1653         of old p.frq member in struct variable.
1654
1655         * histogram.c: (draw_histogram) Takes new freq_tab arg because
1656         it's no longer possible to grab this from var->p.frq.
1657
1658         * piechart.c: (draw_piechart) Ditto.
1659
1660         * group.c: (group_proc_get) New function.
1661
1662         * levene.c: Use group_proc_get() in lieu of old p.grp_data member
1663         in struct variable.
1664
1665         * oneway.q: Ditto.
1666
1667         * t-test.q: Ditto.
1668
1669         * main.c: (execute_command) Clear aux data in default_dict after
1670         each command.  (It's debatable whether this should be done.)
1671
1672         * matrix-data.c: Use new struct mxd_var in lieu of old p.mxd
1673         member in struct variable.
1674
1675         * means.q: Get rid of integer mode, which is not included in
1676         recent SPSS and was the only code that wanted per-variable private
1677         data.
1678
1679         * var.h: (struct crosstab_proc) Removed.
1680         (struct frequencies_proc) Removed.
1681         (struct list_proc) Removed.
1682         (struct get_proc) Removed.
1683         (struct means_proc) Removed.
1684         (struct matrix_data_proc) Removed.
1685         (struct match_files_proc) Removed.
1686         (lots of enums) Removed.
1687         (struct variable) Removed members `p', `get'.  Add member
1688         `aux_dtor'.
1689
1690         * vars-atr.c: (var_attach_aux) New function.
1691         (var_detach_aux) New function.
1692         (var_clear_aux) New function.
1693         (var_dtor_free) New function.
1694         (discard_variables) Use NULL instead of inline_file.
1695
1696 Fri Nov 12 10:07:11 WST 2004 John Darrington <john@darrington.wattle.id.au>
1697
1698         * value-labs.c  Fixed the implmentation of value_to_string, so 
1699         that it properly handles alpha values.
1700
1701         * oneway.q  Changed instances where labels were being probed manually, 
1702         to use the canonical {var,value}_to_string functions
1703
1704 Thu Nov 11 21:01:31 WST 2004 John Darrington <john@darrington.wattle.id.au>
1705
1706         * examine.q cartesian.c chart.[ch]   Added normal and detrended normal
1707         plots.  Changed the API of the cartesian plot to be a much lower level
1708         thing.
1709
1710 Sun Nov  7 17:25:04 WST 2004 John Darrington <john@darrington.wattle.id.au>
1711
1712         * examine.q Added some of the parametric calculations
1713
1714         * factor_stats.[ch]  Created
1715         
1716 Sat Nov  6 21:24:31 WST 2004 John Darrington <john@darrington.wattle.id.au>
1717
1718         * examine.q  Changed the definition of factors to be a composite, and
1719         dealt with the consequences.
1720
1721 Sat Nov  6 20:40:38 WST 2004 John Darrington <john@darrington.wattle.id.au>
1722
1723         * examine.q Fixed problem where examine wasn't dealing properly with 
1724         splits
1725
1726 Sat Nov  6 14:49:47 WST 2004 John Darrington <john@darrington.wattle.id.au>
1727
1728         * oneway.q Fixed problem where oneway wasn't dealing properly with 
1729         splits
1730
1731 Thu Nov  4 11:09:01 WST 2004 John Darrington <john@darrington.wattle.id.au>
1732
1733         * q2c.c examine.q  Fixed a bug (feature?) whereby arrays in the
1734         command which had settings didn't get the appropriate code
1735         generated.
1736
1737         * val.h value-labels.[ch] var-labs.c Added v*to_string functions
1738         to convert variables/values to strings.
1739
1740         * examine.q  Added framework for the EXAMINE command.
1741
1742 Mon Nov  1 12:46:17 WST 2004 John Darrington <john@darrington.wattle.id.au>
1743
1744         * q2c.c frequencies.q set.q t-test.q  Fixed the q2c parsing of DBL 
1745         subcommand types.  Changed frequencies.q to use it rather then the 
1746         custom parser.  Dealt with the consequences.  Added a test for NTILES
1747         subcommand of frequencies.
1748
1749 Sat Oct 30 09:16:29 WST 2004 John Darrington <john@darrington.wattle.id.au>
1750
1751         * oneway.q   Fixed up the behaviour when given missing values
1752
1753         * levene.c oneway.q Fixed a buglet with the levene statistic and
1754         incorporated the levene test into the oneway command.
1755
1756         * group.h  t-test.q  Moved the CMP_EQ and CMP_LE symbols out of 
1757         global scope, since they're only relevant to T-TEST
1758
1759 Fri Oct 29 17:39:03 WST 2004 John Darrington <john@darrington.wattle.id.au>
1760
1761         * group.c group.h group_proc.h levene.c oneway.q t-test.q
1762
1763         Made the t-test more consistent
1764         with the way it handles groups.  That is, it now uses a hash instead
1765         of an array of 2.  Also, made the levene.c file independent of the 
1766         implementation of the t-test.  So now levene should be fine for both
1767         t-test and anova.
1768
1769         * Added an oneway.q file for one way anova
1770
1771 Wed Jun  2 22:08:02 2004  Ben Pfaff  <blp@gnu.org>
1772
1773         * descript.c: (cmd_descriptives) Remove harmless but bogus test in
1774         STATISTICS parsing.
1775
1776 Mon May 31 20:45:24 2004  Ben Pfaff  <blp@gnu.org>
1777
1778         Fix memory leaks.
1779
1780         * data-list.c: (cmd_data_list) Free dls->delims on lossage.
1781         (data_list_trns_free) Free dls->delims.
1782
1783         * t-test.q: (tts_custom_pairs) Free vars.
1784         (ssbox_one_sample_init) Fix tab_vline() argument.
1785         (ssbox_independent_samples_init) Ditto.
1786         (trbox_paired_init) Ditto.
1787         (trbox_one_sample_init) Ditto.
1788
1789 Mon May 31 17:19:27 2004  Ben Pfaff  <blp@gnu.org>
1790
1791         Generalize casefiles to the extent that we can use them for
1792         sorting and other kinds of data transformations.  Change cases to
1793         be copy-on-write to improve memory efficiency in common cases.
1794         Every access to a member of a `struct ccase' was changed to be a
1795         call to a case_*() function, especially case_data(), case_num(),
1796         case_str(), or case_data_rw().  Many instances of a local variable
1797         named "case_num" were changed to "case_idx" as a consequence.
1798         Many `struct ccase *' were changed to actual `struct ccase'
1799         because of copying semantics of cases.  In several places there
1800         was a choice between updating debug code to work with the new ADTs
1801         or just deleting it because it was useless; I chose to delete it.
1802  
1803         * Makefile.am: (pspp_SOURCES) Add case.c, case.h.
1804
1805         * case.c: New file.
1806
1807         * case.h: New file.
1808
1809         * aggregate.c: (struct agr_proc) Change type of `sort' to
1810         sort_criteria *.  Add `break_vars', `break_var_cnt' members.
1811         Rename `vars' to `agr_vars', all references updated.  Change
1812         `agr_case' to type `struct ccase'.
1813         (cmd_aggregate) Deal with new members.  Use case_create(),
1814         sort_active_file_in_place(), sort_active_file_to_casefile().
1815         (agr_destroy) Deal with new members.
1816         (aggregate_single_case) Ditto.
1817         (dump_aggregate_info) Ditto.
1818         (initialize_aggregate_info) Ditto.
1819         (agr_to_active_file) Ditto.
1820         (presorted_agr_to_sysfile) Ditto.
1821         (sort_agr_to_sysfile) Removed.
1822
1823         * alloc.c: (out_of_memory) Make non-static.
1824
1825         * alloc.h: Prototype out_of_memory().
1826
1827         * casefile.c: Switched from a linked list in-memory representation
1828         to a two-level array-style representation.  The linked list was
1829         appropriate when we could stick a header onto cases, but that's no
1830         longer the case.  Also, the two-level array will allow for random
1831         in-memory access in case that's ever wanted.  Also added the
1832         concept of a `destructive casereader', one that destroys cases in
1833         the underlying casefile as they are read out.
1834         (macro CASES_PER_BLOCK) New macro.
1835         (struct casefile) New members `value_cnt', `case_list_size',
1836         `case_acct_size', `being_destroyed', `cases'.  Removed `head',
1837         `tail'.
1838         (struct casereader) Removed `cur'.  Added `destructive', `c'.
1839         (global var casefiles) Made static.
1840         (static var case_bytes) New var.
1841         (casefile_create) Takes a value count, not a case size in bytes,
1842         to conform to the case interface.  All callers updated.  Deal with
1843         new and removed members.
1844         (casefile_destroy) Deal with new and removed members.
1845         (casefile_sleep) New function.
1846         (casefile_get_case_size) Removed.
1847         (casefile_get_value_cnt) New function.
1848         (casefile_append) Rewritten to deal with new and removed members.
1849         (casefile_append_xfer) New function.
1850         (write_case_to_disk) Use case_serialize().
1851         (call_posix_fadvise) Removed because posix_fadvise64 segfaults.
1852         Couldn't figure out why.
1853         (casefile_to_disk) Don't call call_posix_fadvise.  Rewritten to
1854         deal with new and removed members.
1855         (merge) Removed.
1856         (merge_sort) Removed.
1857         (casefile_sort) Removed.
1858         (casefile_get_reader) Deal with new and removed members.
1859         (casefile_get_destructive_reader) New function.
1860         (reader_open_file) Make code more readable.  Create case for
1861         reader.
1862         (casereader_get_casefile) New function.
1863         (casereader_read) Deal with new and removed members.  Now returns
1864         a copy of the case, so that the caller is responsible for
1865         destroying the returned case.
1866         (casereader_read_xfer) New function.
1867         (casereader_destroy) Destroy reader's case.
1868         (test_casefile) Second arg is now a value count, all callers
1869         updated.  Now tests destructive readers too.
1870         (get_random_case) Deal with new case ADT.
1871         (write_random_case) Ditto.
1872         (read_and_verify_random_case) Ditto.
1873
1874         * crosstabs.q: Remove debug code.
1875
1876         * descript.q: (calc_descriptives) Deal with new case, casefile
1877         ADTs.
1878
1879         * dfm.c: (cmd_begin_data) There's no storage_source_class anymore.
1880
1881         * do-if.c: Remove unneeded header inclusion.
1882
1883         * expr-prs.c: Remove debug code.
1884
1885         * exprP.h: Remove debug code.
1886
1887         * flip.c: (flip_file) Use fseeko() if available.
1888
1889         * formats.c: Remove debug code.
1890
1891         * get.c: Remove debug code.
1892         (struct mtf_file) Change `input' from `union value *' to `struct
1893         ccase', all references updated.
1894
1895         * levene.c: (levene) Deal with new case, casefile ADTs.
1896
1897         * list.q: Remove debug code.
1898
1899         * loop.c: Remove debug code.
1900         
1901         * matrix-data.c: Remove debug code.
1902
1903         * means.q: Remove debug code.
1904
1905         * mis-val.c: Remove debug code.
1906
1907         * pfm-read.c: Remove debug code.
1908         (pfm_read_code) Change second arg from `union value *' to `struct
1909         ccase *', all references updated.
1910
1911         * recode.c: (string_to_long) Make first arg const.
1912         (convert_to_double) Ditto.
1913
1914         * repeat.c: Remove debug code.
1915
1916         * sample.c: Remove debug code.
1917
1918         * sfm-read.c: Remove debug code.
1919         (sfm_read_case) Change second arg from `union value *' to `struct
1920         ccase *'.
1921
1922         * sort.c: Redone in terms of casefiles.
1923         (enum sort_direction) Moved here from sort.h.
1924         (struct sort_criterion) New structure.
1925         (struct sort_criteria) New structure.
1926         (cmd_sort_cases) Rewritten.
1927         (prepare_to_sort_active_file) New function.
1928         (sort_active_file_in_place) New function.
1929         (sort_active_file_to_casefile) New function.
1930         (parse_sort) Renamed sort_parse_criteria(), rewritten & interface
1931         changed, all callers updated.
1932         (destroy_sort_cases_pgm) Renamed sort_destroy_criteria(),
1933         rewritten & interface changed, all callers updated.
1934         (sort_cases) Renamed sort_execute(), rewritten & interface
1935         changed, all callers updated.
1936         (struct internal_sort) Removed.
1937         (do_internal_sort) Rewritten, interface changed.
1938         (destroy_internal_sort) Removed.
1939         (compare_case_dblptrs) Use sort_criteria instead of sort_case_pgm.
1940         (struct initial_run) Removed; an initial run is now just a
1941         casefile.
1942         (compare_initial_runs) Rewritten.
1943         (struct external_sort) Changed almost completely.
1944         (do_external_sort) Rewritten, interface changed.
1945         (destroy_external_sort) Rewritten.
1946         [HAVE_MKDTEMP] (make_temp_dir) Removed.
1947         [!HAVE_MKDTEMP] (do_mkdir) Removed.
1948         [!HAVE_MKDTEMP] (make_temp_dir) Removed.
1949         (init_external_sort) Removed.
1950         (simulate_error) Removed.
1951         (rmdir_temp_dir) Removed.
1952         (get_temp_file_name) Removed.
1953         (open_temp_file) Removed.
1954         (close_temp_file) Removed.
1955         (remove_temp_file) Removed.
1956         (write_temp_file) Removed.
1957         (read_temp_file) Removed.
1958         (struct record_run) Change `record' from `struct case_lit *' to
1959         `struct ccase'.
1960         (struct initial_run_state) Remove `idx_to_fv', `free_list',
1961         `file_idx', `output_file'.  Add `run', casefile'.  Change
1962         `last_output' from `struct case_list *' to `struct ccase'.
1963         (write_initial_runs) Change interface, rewrite.
1964         (sort_sink_write) Renamed process_case(), changed interfaced,
1965         rewrote.
1966         (destroy_initial_run_state) Rewritten.
1967         (allocate_cases) Rewritten.
1968         (compare_record) Interface changed, rewritten.
1969         (start_run) Rewritten.
1970         (end_run) Rewritten.
1971         (output_record) Rewritten.
1972         (grab_case) Removed.
1973         (release_case) Removed.
1974         (struct merge_case) Change `cases' from double pointer to single
1975         pointer.
1976         (merge) Deal with new case and casefile ADTs.
1977         (struct run) Removed.
1978         (merge_once) Rewritten, interface changed.
1979         (fill_run_buffer) Removed.
1980         (sort_sink_make_source) Removed.
1981         (sort_sink_class) Removed.
1982         (struct sort_source_aux) Removed.
1983         (sort_source_read_helper) Removed.
1984         (sort_source_read) Removed.
1985         (read_sort_output) Removed.
1986         (read_internal_sort_output) Removed.
1987         (read_external_sort_output) Removed.
1988         (sort_source_destroy) Removed.
1989         (sort_source_class) Removed.
1990
1991         * sort.h: (struct sort_cases_pgm) Removed.
1992         (enum sort_direction) Moved to sort.c.
1993
1994         * t-test.q: (calculate) Deal with new case, casefile ADTs.
1995
1996         * tab.c: Remove debug code.
1997
1998         * var-labs.c: Remove debug code.
1999
2000         * var.h: (struct ccase) Removed.
2001         (struct case_list) Removed.
2002
2003         * vars-atr.c: (discard_variables) Use free_case_source().
2004
2005         * vars-prs.c: (parse_vs_variable) Make arg const.
2006         (parse_dict_variable) Ditto.
2007         (parse_variables) Make struct dictionary * arg const.
2008         (parse_var_set_vars) Make struct var_set * arg const.
2009         (struct var_set) Add const to some of the function pointers' args.
2010         (var_set_get_cnt) Make arg const.
2011         (var_set_get_var) Make first arg const.
2012         (var_set_lookup_var) Make first arg const.
2013         (dict_var_set_get_cnt) Make arg const.
2014         (dict_var_set_get_var) Make first arg const.
2015         (dict_var_set_lookup_var) Make first arg const.
2016         (var_set_create_from_dict) Make arg const.  Add cast to aux
2017         assignment.
2018         (struct array_var_set) Add const to var member.
2019         (array_var_set_get_cnt) Make arg const.
2020         (array_var_set_get_var) Make first arg const.
2021         (array_var_set_lookup_var) Make first arg const.
2022         (var_set_create_from_array) Make first arg const.  Insert cast.
2023
2024         * vfm.c: (struct write_case_data) Change trns_case, sink_case
2025         members from `struct ccase *' to `struct ccase'.
2026         (static var lag_queue) Change from double to single pointer.
2027         (procedure) Optimize trivial case.
2028         (internal_procedure) Deal with changed case, case_source ADTs.
2029         (create_trns_case) Changed interface, rewrote.
2030         (open_active_interface) Initialize modified lag queue.
2031         (write_case) Deal with changed case ADT.
2032         (lag_case) Deal with modified lag queue.
2033         (close_active_file) Destroy modified lag queue.
2034         Deal with changed case_source, case_sink ADTs.
2035         (destroy_storage_stream_info) Make null arg into no-op.
2036         (storage_sink_make_source) Set aux in created source.
2037         (storage_source_read) Deal with changed case, casefile ADTs.
2038         (storage_source_create) New function.
2039         (lagged_case) Rewrite.
2040         (free_case_source) New function.
2041         (free_case_sink) Rewrite.
2042         (struct split_aux_data) Changed prev_case from `struct ccase *' to
2043         `struct ccase'.
2044         (procedure_with_splits) Deal with changed prev_case.
2045         (procedure_with_splits_callback) Ditto.
2046         (multipass_split_aux_data) Changed prev_case from `struct ccase *' to
2047         `struct ccase'.
2048         (multipass_procedure_with_splits) Deal with changed prev_case.
2049         (multipass_split_callback) Ditto.
2050         
2051         
2052 Mon May 31 17:19:06 2004  Ben Pfaff  <blp@gnu.org>
2053
2054         The workspace idea didn't work out.
2055
2056         * Makefile.am: (pspp_SOURCES) Remove workspace.c, workspace.h.
2057         
2058         * workspace.c: Removed.
2059
2060         * workspace.h: Removed.
2061
2062 Sun May 30 18:35:19 2004  Ben Pfaff  <blp@gnu.org>
2063
2064         Fully implement arbitrary delimiters on DATA LIST, extending the
2065         half implementation that was already there.
2066
2067         * data-list.c: (struct data_list_pgm) Remove `delim', add
2068         `delims', `delim_cnt'.
2069         (cmd_data_list) Initialize new members.  Parse delimiters and
2070         clean up code a bit.
2071         (cut_field) Extract fields with arbitrary delimiters.  Also, fix
2072         handling of leading commas.
2073         (read_from_data_list_fixed) Expand tabs.  Adapt to new DFM
2074         interfaces.
2075         (read_from_data_list_free) Adapt to new DFM interfaces.
2076         (read_from_data_list_list) Ditto.
2077         (repeating_data_trns_proc) Ditto.
2078
2079         * dfm.c: Split up reader and writer into separate code, because
2080         they do different things.  Use struct string instead of explicit
2081         allocation code, for clarity.
2082         (enum dfm_reader_flags) New enum.
2083         (struct dfm_fhuser_ext) Removed.
2084         (struct dfm_reader_ext) New.
2085         (get_reader) New function, used by just about all the reader
2086         functions.
2087         (dfm_close) Removed.
2088         (close_reader) New function.
2089         (dfm_open_for_reading) Rewrite initialization of dfm_fhuser_ext.
2090         (dfm_open_for_writing) Ditto.
2091         (macro force_line_buffer_expansion) Removed.
2092         (count_tabs) Removed.
2093         (tabs_to_spaces) Removed.
2094         (read_record) Deal with new dfm_reader_ext.  Use struct string
2095         functions.  Don't convert tabs to spaces.
2096         (dfm_eof) New function.
2097         (dfm_get_record) Changed interface, rewrote.
2098         (dfm_expand_tabs) New function.
2099         (dfm_fwd_record) Renamed dfm_forward_record(), updated to new
2100         dfm_reader_ext, rewritten.
2101         (dfm_bkwd_record) Renamed dfm_reread_record(), updated to new
2102         dfm_reader_ext, rewritten.
2103         (dfm_set_record) Removed in favor of dfm_forward_columns().
2104         (dfm_forward_columns) New function.
2105         (dfm_get_cur_col) Renamed dfm_column_start, updated to new
2106         dfm_reader_ext, rewritten.
2107         (static var dfm_r_class) Use close_reader for the destructor.
2108         (struct dfm_writer_ext) New.
2109         (dfm_put_record) Updated to new dfm_writer_ext, rewritten.  Uses
2110         bounce buffer now instead of local allocation.
2111         (close_writer) New function.
2112         (static var dfm_writer_ext) Use close_writer for destructor.
2113         (cmd_begin_data) Adapt to new dfm_reader_ext.
2114
2115         * file-handle.q: Add support for per-file tab width.
2116         (struct private_file_handle) Add tab_width member.
2117         (q2c specifications) Add tabwidth subcommand.
2118         (cmd_file_handle) Put parsed tab width into private_file_handle.
2119         (create_file_handle) Set default tab width.
2120         (handle_get_tab_width) New function.
2121
2122         * file-type.c: (file_type_source_read) Adapt to new DFM interface.
2123
2124         * inpt-pgm.c: (reread_trns_proc) Ditto.
2125
2126         * matrix-data.c: (context) Ditto.
2127         (another_token) Ditto.
2128         (mget_token) Ditto.
2129         (force_eol) Ditto.
2130
2131 Sun May 30 18:33:59 2004  Ben Pfaff  <blp@gnu.org>
2132
2133         * casefile.c: (casefile_destroy) Fix memory leak by freeing
2134         cf->filename.
2135         (casereader_destroy) Don't close file descriptor -1.
2136
2137         * recode.c: (cmd_recode) Fix memory leak.
2138
2139         * set.q: (q2c specifications) Fix typo in user message.
2140
2141         * str.c: (st_bare_pad_len_copy) Change memcpy to memmove to avoid
2142         undefined behavior for overlapping arguments.
2143
2144 Sun May 30 18:31:48 2004  Ben Pfaff  <blp@gnu.org>
2145
2146         * casefile.c: valgrind doesn't implement posix_fadvise() yet, so
2147         don't call it when we're running under valgrind.
2148         (call_posix_fadvise) New function.
2149         (casefile_to_disk) Use call_posix_fadvise().
2150         (reader_open_file) Ditto.
2151         
2152 Sun May 30 18:20:12 2004  Ben Pfaff  <blp@gnu.org>
2153
2154         Update our string ADTs, struct string and struct len_string.  Get
2155         rid of pool support, which was largely unused.  Rename lots of
2156         functions to have more obvious or consistent names.
2157         
2158         * ascii.c: Get rid of ascii_pool.  It was only used for string
2159         allocations.
2160         (ascii_open_global) Don't create ascii_pool.
2161         (ascii_close_driver) Don't destroy ascii_pool.
2162         (ascii_postopen_driver) Don't use pool.
2163         (ascii_close_driver) Destroy strings manually.
2164
2165         * str.c: (ds_create) Remove pool argument, all references updated.
2166         (ds_init) Ditto.
2167         (ds_replace) Remove pool support, make more efficient when we
2168         don't need to reallocate.
2169         (ds_destroy) Remove pool support.
2170         (ds_rpad) New function.
2171         (ds_size) Renamed ds_capacity(), all references updated.
2172         (ds_value) Renamed ds_c_str(), all references updated.
2173         (ds_concat) Renamed ds_puts(), all references updated.
2174         (ds_concat_buffer) Renamed ds_concat(), all references updated.
2175         (ds_putchar) Renamed ds_putc(), all references updated.
2176         (ds_getline) Renamed ds_gets(), all references updated.
2177         (ls_create) Remove pool argument, all references updated.
2178         (ls_create_buffer) Ditto.
2179         (ls_destroy) Removed pool support.
2180         (ls_value) Renamed ls_c_str(), all references updated.
2181
2182         * str.h: (ls_length) [__GNUC__] Add inline version.
2183         (ls_c_str) [__GNUC__] Add inline version.
2184         (ls_end) [__GNUC__] Add inline version.
2185         (struct string) Remove pool member.  Rename `size' to `capacity',
2186         all references updated.
2187
2188         * tab.c: (text_format) Instead of using pool argument to
2189         ls_create_buffer(), call pool_register() on allocated data.
2190
2191 Mon Apr 26 22:40:07 2004  Ben Pfaff  <blp@gnu.org>
2192
2193         We're abusing the current ASCII driver by telling it to allocate a
2194         9999-line, 9999-character page in the tests.  This causes some
2195         systems to curl up and die because it allocates 20 MB of
2196         contiguous RAM.  This change alleviates at least part of the
2197         problem.  It is mostly a stop-gap until the new output system is
2198         ready.
2199         
2200         * ascii.c: (struct line) New structure.
2201         (struct ascii_driver_ext) Remove `page', `page_size', `line_len',
2202         `line_len_size', `n_output' members.  Add `lines', `lines_cap'.
2203         (ascii_preopen_driver) Initialize new members, not old ones.
2204         (ascii_close_driver) Destroy new members, not old ones.
2205         (ascii_open_page) Allocate new members, not old ones.
2206         (expand_line) Allocate room in line.
2207         (draw_line) Use new members.
2208         (ascii_line_horz) Ditto.
2209         (ascii_line_vert) Ditto.
2210         (ascii_line_intersection) Ditto.
2211         (text_draw) Ditto.
2212         (output_lines) Ditto.
2213         (ascii_close_page) Ditto.
2214
2215 Sun Apr 25 23:40:15 2004  Ben Pfaff  <blp@gnu.org>
2216
2217         * matrix.c: Dead code.  Removed.
2218
2219         * matrix.h: Dead code.  Removed.
2220
2221 Fri Apr 16 23:59:51 2004  Ben Pfaff  <blp@gnu.org>
2222
2223         Contrary to what I'd always understood, there is an efficient
2224         algorithm for deletion from a hash table populated via linear
2225         probing.  This change implements it.
2226         
2227         * hash.c: (hsh_rehash) Probe in increasing order.
2228         (hsh_probe) Ditto.
2229         (locate_matching_entry) Ditto.
2230         (hsh_delete) Use Knuth's Algorithm 6.4R for deletion.
2231
2232 Tue Apr 13 19:24:15 2004  Ben Pfaff  <blp@gnu.org>
2233
2234         * moments.c (calc_moments): Adjust calculation of kurtosis to
2235         avoid subtracting huge numbers from huge numbers, on Michael
2236         Kiefte's advice.
2237
2238 Sun Apr 11 14:22:12 2004  Ben Pfaff  <blp@gnu.org>
2239
2240         Rework moments routines for improved numerical stability based on
2241         Michael Kiefte's advice.  Any bugs or remaining numerical problems
2242         are still mine though.
2243
2244         There is now a struct moments1 for use with one-pass moments.  It
2245         uses a provisional means algorithm as an attempt to improve
2246         accuracy of higher moments.  The older struct moments now only
2247         handles two-pass moments.
2248         
2249         * aggregate.c: Use moments1 instead moments.
2250
2251         * descript.c: Revert previous change, which is no longer needed
2252         due to the moments revision.
2253
2254         * moments.c: (calc_moments) New function for calculating variance,
2255         skewness, kurtosis.
2256         (moments_pass_one) Only accumulate weights bigger than zero.
2257         (moments_calculate) Allow calculating the mean on pass one, others
2258         require pass two.  Implement in terms of calc_moments().
2259         (struct moments1) New structure.
2260         (init_moments1) New function.
2261         (moments1_clear) Ditto.
2262         (moments1_create) Ditto.
2263         (moments1_add) Ditto.
2264         (moments1_calculate) Ditto.
2265         (moments1_destroy) Ditto.
2266         (cmd_debug_moments) Deal with `struct moments' or `struct
2267         moments1' as requested by user.
2268
2269 Sun Apr 11 14:21:55 2004  Ben Pfaff  <blp@gnu.org>
2270
2271         * Makefile.am (pspp_SOURCES): Remove debug.c.
2272
2273         * debug.c: Removed.  It was empty anyway.
2274
2275 Fri Apr  9 20:04:49 2004  Ben Pfaff  <blp@gnu.org>
2276
2277         * descript.c (calc_descriptives): Fix assert failure when only
2278         MOMENT_MEAN is needed.
2279
2280 2004-04-09  Michael Kiefte  <mkiefte@dal.ca>
2281
2282         * descript.c: 
2283
2284         fixed problem with parsing in match_statistic() causing
2285         "DESCRIPTIVE STAT=MEAN." to barf.
2286
2287         "MEAN" is now default if "SORT" given without specification.
2288
2289         Fixed infinite loop with "DESCRIPT GIBBERISH=ALL."  Parsing is
2290         generally less forgiving of syntax errors: better to have it do
2291         nothing and type it in again then to not know what it actually did
2292         instead.  
2293
2294         z-score transformation now checks score for user-missing values
2295         and checks std_dev for SYSMIS.
2296
2297 2004-04-06  Michael Kiefte  <mkiefte@dal.ca>
2298
2299         * aggregate.c, crosstabs.q, descript.c, dictionary.c, frequencies.q, levene.c, t-test.q, var.h: 
2300         Changed dict_get_case_weight() to accept an additional int * flag
2301         to complain about system-missing, user-missing, zero, or negative
2302         weights and updated existing functions to pass int * to
2303         dict_get_case_weight().
2304
2305 2004-04-05  jmd  <jmd@gnu.org>
2306
2307         * main.c: Fixed configuration problems with gsl
2308
2309         * t-test.q: Fixed some problems encountered when compiling under Cygwin
2310
2311 2004-04-03  blp  <blp@gnu.org>
2312
2313         * lexer.c, ChangeLog:
2314         Fix infinite loop on comment at end of file, add test.
2315
2316 2004-04-03  jmd  <jmd@gnu.org>
2317
2318         * 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:
2319         Fixed the calculation of percentiles and added --syntax and --algorithm options
2320
2321 Sat Apr  3 11:43:37 2004  Ben Pfaff  <blp@gnu.org>
2322
2323         * lexer.c: (lex_skip_comment) Handle end-of-file correctly (I
2324         hope).
2325
2326 Sat Apr  3 15:00:18 WST 2004 John Darrington <john@darrington.wattle.id.au>
2327
2328         * frequencies.q:  Fixed the calculation of percentiles
2329
2330         * Makefile.am:  Added the --ansi flag and dealt with the
2331         consequences.  Added some entries to PSPP_sources so that
2332         make distcheck would pass
2333
2334         * cmdline.c:   Added the --syntax and --algorithm options
2335
2336         * q2c.c:  Added an implicit /ALGORITHM subcommand to everything.
2337
2338 Fri Apr  2 11:25:22 WAST 2004 John Darrington <john@darrington.wattle.id.au>
2339
2340         * t-test.q, levene.c, levene.h  Converted t-test (incl levene) to 
2341         use the new multipass_split_... mechanism.
2342
2343 Wed Mar 31 22:36:22 2004  Ben Pfaff  <blp@gnu.org>
2344
2345         * frequencies.q: (calc_stats) Use moments data structure and
2346         calc_seskew(), calc_sekurt() functions.
2347
2348         * set.q main.c settings.h Added support for --syntax and --algorithm 
2349         options
2350
2351 Tue Mar 30 22:04:19 2004  Ben Pfaff  <blp@gnu.org>
2352
2353         * vfm.c: Had to get last call to multipass_split_output() inside
2354         open_active_file()/close_active_file() pairing, so introduce new
2355         function.
2356         (internal_procedure) Move procedure() code here, except for calls
2357         to open_active_file() and close_active_file().
2358         (procedure) Wrap open_active_file() and close_active_file() around
2359         internal_procedure().
2360         (multipass_procedure_with_splits) Wrap open_active_file() and
2361         close_active_file() around internal_procedure().
2362
2363 Tue Mar 30 22:01:57 2004  Ben Pfaff  <blp@gnu.org>
2364
2365         * descript.c: (cmd_descriptives) Free `vars' to avoid memory leak.
2366
2367 Mon Mar 29 16:26:40 2004  Ben Pfaff  <blp@gnu.org>
2368
2369         * debug.c: Removed.  Moved cmd_debug_evaluate() into expr-evl.c.
2370
2371         * expr-evl.c: (cmd_debug_evaluate) Moved here from debug.c.
2372
2373 Mon Mar 29 16:03:08 2004  Ben Pfaff  <blp@gnu.org>
2374
2375         * algorithm.c: By default turn off some of the more expensive
2376         assertions.
2377         (expensive_assert) New macro which expands to assert if
2378         EXTRA_CHECKS is defined, to nothing otherwise.
2379         (unique) Use expensive_assert().
2380         (binary_search) Ditto.
2381         (push_heap) Ditto.
2382         (pop_heap) Ditto.
2383         (make_heap) Ditto.
2384         (sort_heap) Ditto.
2385
2386         * command.c: (conflicting_3char_prefixes) Words that are the same
2387         don't cause conflicts when they are abbreviated to the first three
2388         letters.
2389
2390         * expr-evl.c: (CONCAT_func) Fix memory leak by incrementing struct
2391         nonterm_node's n earlier.
2392         (generic_str_func) Ditto.
2393         
2394 Mon Mar 29 15:32:17 2004  Ben Pfaff  <blp@gnu.org>
2395
2396         Add support for multipass procedures.  Rewrite DESCRIPTIVES to
2397         test multipass support, take advantage of new moments
2398         calculation, and to not be such crappy code.  Get rid of q2c
2399         processing for DESCRIPTIVES.
2400
2401         * vfm.c: (struct multipass_split_aux_data) New structure.
2402         (multipass_procedure_with_splits) New function.
2403         (multipass_split_callback) New function.
2404         (multipass_split_output) New function.
2405         * descript.q: Removed.
2406
2407         * descript.c: New file.
2408
2409         * var.h: Removed descriptives enums.
2410         (struct descriptives_proc) Removed.
2411         (struct variable) Removed p.dsc.
2412
2413         * Makefile.am: (q_sources_c) Remove descript.c.
2414         (q_sources_q) Removed descript.q.
2415         
2416 Mon Mar 29 15:31:55 2004  Ben Pfaff  <blp@gnu.org>
2417
2418         New manager for keeping track of used workspace.
2419         
2420         * workspace.c: New file.
2421
2422         * workspace.h: New file.
2423
2424         * Makefile.am: (pspp_SOURCES) Add workspace.c, workspace.h.
2425
2426         * sort.c: (do_internal_sort) Use workspace_malloc().
2427         (destroy_internal_sort) Use workspace_free().
2428
2429 Mon Mar 29 15:31:08 2004  Ben Pfaff  <blp@gnu.org>
2430
2431         New `struct casefile' for managing sets of cases.
2432
2433         * casefile.c: New file.
2434
2435         * casefile.h: New file.
2436
2437         * command.def: Add DEBUG CASEFILE command.
2438
2439         * Makefile.am: (pspp_SOURCES) Add casefile.c, casefile.h.
2440
2441         * sort.c: (sort_cases) Move logic for sending storage file to disk
2442         into do_external_sort().
2443         (struct internal_sort) Use an array of ccase pointers instead of a
2444         case_list.
2445         (do_internal_sort) Rewrite to handle casefiles.
2446         (compare_case_list) Removed.
2447         (compare_cases) New function.
2448         (compare_case_dblptrs) New function.
2449         (read_internal_sort_output) Deal with new struct internal_sort.
2450
2451         * vfm.c: (static var workspace_overflow) Removed.
2452         (struct storage_stream_info) Removed all the members.  Added
2453         struct casefile * member.
2454         (storage_sink_open) Use casefile.
2455         (open_storage_file) Removed.
2456         (write_storage_file) Removed.
2457         (storage_to_disk) Removed.
2458         (destroy_storage_stream_info) Use casefile.
2459         (storage_sink_write) Use casefile.
2460         (storage_sink_make_source) Use casefile.
2461         (storage_source_count) Use casefile.
2462         (storage_source_read) Use casefile.
2463         (storage_source_on_disk) Removed.
2464         (storage_source_get_cases) Removed.
2465         (storage_source_set_cases) Removed.
2466         (storage_source_get_casefile) New function.
2467         
2468 Mon Mar 29 15:30:09 2004  Ben Pfaff  <blp@gnu.org>
2469
2470         New `struct moments' for calculating moments.
2471
2472         * stats.c: Removed.
2473
2474         * stats.h: Removed.
2475
2476         * moments.c: New file.
2477
2478         * moments.h: New file.
2479
2480         * command.def: Add DEBUG MOMENTS command.
2481
2482         * Makefile.am: (pspp_SOURCES) Add moments.c, moments.h.  Remove
2483         stats.c, stats.h.
2484
2485         * aggregate.c: Modify AGGREGATE to use the new moments
2486         calculation, even if not in such a great way.
2487         (struct agr_var) Add `moments' member.
2488         (parse_aggregate_functions) Set `moments' member to null.
2489         (agr_destroy) Destroy `moments' member.
2490         (accumulate_aggregate_info) Use `moments' for standard deviation.
2491         (dump_aggregate_info) Ditto.
2492         (initialize_aggregate_info) Create or clear `moments'.
2493
2494         * misc.h: Add pow2(), pow3(), pow4() functions in place of sqr(),
2495         cube(), pow4() that were in stats.h.  All references updated.
2496
2497         * crosstabs.q: stats.h had chi-square significance functions.  Use
2498         GSL instead.
2499         (display_chisq) Use gsl_cdf_chisq_Q() instead of chisq_sig().
2500
2501         * expr-evl.c: (expr_evaluate) Use moments_of_values() for
2502         OP_CFVAR, OP_MEAN, OP_SD, OP_VARIANCE.
2503                 
2504 Fri Mar 26 14:21:23 2004  Ben Pfaff  <blp@gnu.org>
2505
2506         * dictionary.c: (dict_compact_values) Compacted values need to
2507         start off from 0.
2508
2509 Fri Mar 26 00:54:57 2004  Ben Pfaff  <blp@gnu.org>
2510
2511         * var-labs.c: (cmd_variable_labels) For compatibility, don't allow
2512         `/' at start.  Check return value of parse_variables() for error
2513         return.
2514
2515 Fri Mar 26 00:19:27 2004  Ben Pfaff  <blp@gnu.org>
2516
2517         Revamp expressions: make the code a little nicer, and fix bugs
2518         found in testing.
2519         
2520         * expr-evl.c: (expr_evaluate) Make expression argument const.
2521         Support OP_ADD, OP_SUB, OP_MUL, OP_DIV instead of OP_PLUS, OP_MUL.
2522         OP_POW is missing for arg 2 <= 0.  OP_LOG is natural log, not
2523         base-10 log.  Fix OP_ANY, OP_ANY_STRING, OP_RANGE, OP_RANGE_STRING
2524         off-by-ones.  Add OP_MAX_STRING, OP_MIN_STRING.  Fix OP_TIME_HMS,
2525         OP_DATE_WKYR boundary conditions.  Add OP_CTIME_DAYS,
2526         OP_CTIME_HOURS, OP_CTIME_MINUTES, OP_CTIME_DAYS, OP_CTIME_SECONDS.
2527         Support OP_INDEX_2, OP_INDEX_3, OP_RINDEX_2, OP_RINDEX_3 instead
2528         of OP_INDEX, OP_INDEX_OPT, OP_RINDEX, OP_RINDEX_OPT.  Merge
2529         OP_LPAD_OPT into OP_LPAD, OP_RPAD_OPT into OP_RPAD, OP_LTRIM_OPT
2530         into OP_LTRIM, OP_RTRIM_OPT into OP_RTRIM, OP_NUMBER_OPT into
2531         OP_NUMBER.  Fix OP_RTRIM fragility.  Support OP_SUBSTR_2,
2532         OP_SUBSTR_3 instead of OP_SUBSTR, OP_SUBSTR_OPT.  Remove OP_INV.
2533         Simplify OP_SYSMIS.  Remove OP_STR_MIS.
2534
2535         * expr-opt.c: (optimize_expression) Rewrite.
2536         (macro n0) Removed.
2537         (macro n1) Removed.
2538         (macro n2) Removed.
2539         (macro s0) Removed.
2540         (macro s0l) Removed.
2541         (macro s1) Removed.
2542         (macro s1l) Removed.
2543         (macro s2) Removed.
2544         (macro s2l) Removed.
2545         (macro s) Removed.
2546         (macro sl) Removed.
2547         (eq_num_con) New function.
2548         (optimize_tree) New function.
2549         (macro rnc) Removed.
2550         (macro frnc) Removed.
2551         (str_search) Add const to string params.
2552         (str_rsearch) Ditto.
2553         (evaluate_tree_no_missing) Renamed from evaluate_tree.  Add num[],
2554         str[], str_len[] locals to substitute for most of removed macros.
2555         Support OP_ADD, OP_SUB, OP_MUL, OP_DIV instead of OP_PLUS, OP_MUL.
2556         Removed support for missing values because we're never called with
2557         missing values.  Use set_number() or set_number_errno() instead of
2558         rnc or frnc.  Removed any stuff that caused trouble in testing.
2559         We can re-add it later if it really slows anything.  Fix some
2560         random problems.
2561         (evaluate_tree_with_missing) Not yet supported.  To be added later
2562         if it's important.
2563         (repl_num_con) Removed.
2564         (collapse_node) New function.
2565         (force_repl_num_con) Removed.
2566         (set_number) New function.
2567         (set_number_errno) New function.
2568         (repl_str_con) Removed.
2569         (set_string) New function.
2570         (yrmoda) Tighten boundary conditions.  Adopt 2030 cut-off for
2571         2-digit years.
2572         (dump_node) No special case for OP_AND, OP_OR.
2573
2574         * expr-prs.c: (expr_prs) Honor EXPR_NO_OPTIMIZE bit.  Rewrite.
2575         (expr_get_type) New function.
2576         (type_check) Rewrite.
2577         (type_coercion) New function.
2578         (struct operator) New structure.
2579         (match_operator New function.
2580         (parse_binary_operators) New function.
2581         (parse_inverting_unary_operator) New function.
2582         (parse_or) Rewritten.
2583         (parse_and) Rewritten.
2584         (parse_not) Rewritten.
2585         (parse_rel) Rewritten.
2586         (parse_add) Rewritten.
2587         (parse_mul) Rewritten.
2588         (parse_neg) Rewritten.
2589         (parse_exp) Rewritten.
2590         (parse_sysvar) Add $TRUE, $FALSE system variables.
2591         Get $LENGTH, $WIDTH from get_viewlength(), get_viewwidth().
2592         (parse_primary) Use allocate_var_node(), allocate_num_con(),
2593         allocate_str_con().
2594         (struct function) Remove desc, change `func' prototype.
2595         (unary_func) Remove special cases.
2596         (MISSING_func) Reduce to unary_func() that just returns a boolean.
2597         (SYSMIS_func) Handle SYSMIS((x)) like SYSMIS(x).
2598         (VALUE_func) Use allocate_var_node().
2599         (nary_num_func) Allow MIN and MAX for strings.
2600         Use allocate_var_node().  Properly clean up.
2601         Fix return type.
2602         (generic_str_func) Use local table instead of removed `desc'
2603         member.  Mostly rewrite.
2604         (get_num_args) Revise error message.
2605         (parse_function) Return EXPR_ERROR, not 0 on error.
2606         (macro op) Removed.
2607         (macro varies) Removed.
2608         (ops[]) Use expr.def.
2609         (free_node) Do nothing if node is null.
2610         (allocate_num_con) New function.
2611         (allocate_str_con) New function.
2612         (allocate_var_node) New function.
2613         (allocate_binary_nonterminal) New function.
2614         (append_nonterminal_arg) Removed.
2615         (static var func_tab[]) Revised.
2616         (expr_debug_print_postfix) Make parameter const.
2617         Use printf() instead of debug_printf().
2618
2619         * expr.def: New file.
2620         
2621         * expr.h: Change PXP_* to EXPR_*, all references updated.  Also
2622         use named enum instead of unnamed, all references updated.  Add
2623         EXPR_ANY, EXPR_NO_OPTIMIZE.
2624
2625         * exprP.h: Remove EX_*.  Add DEFINE_OPERATOR.  Use expr.def
2626         instead of defining OP_* directly.
2627         (macro IS_TERMINAL) New macro.
2628         (macro IS_NONTERMINAL) New macro.
2629         (enum OP_NO_FLAGS) New.
2630         
2631 Fri Mar 26 00:18:01 2004  Ben Pfaff  <blp@gnu.org>
2632
2633         * error.c: (err_assert_fail) msg variable needs to be non-const.
2634
2635 Fri Mar 26 00:17:24 2004  Ben Pfaff  <blp@gnu.org>
2636
2637         * debug.c: (cmd_debug_evaluate) Rewrite.
2638
2639 Fri Mar 26 00:15:13 2004  Ben Pfaff  <blp@gnu.org>
2640
2641         Fix some CROSSTABS bit rot stupidity.
2642
2643         * crosstabs.q: Reorder the CELLS subcommands for compatibility.
2644         (internal_cmd_crosstabs) Initializes cells[] correctly.
2645         (float_M_suffix) Rename format_cell_entry(), change prototype,
2646         rewrite.
2647         (display_crosstabulation) Fix cell formatting.
2648
2649 Fri Mar 26 00:14:09 2004  Ben Pfaff  <blp@gnu.org>
2650
2651         Make lex_rest_of_line(), lex_entire_end() not discard lines.  Have
2652         to call lex_discard_line() to do that.
2653
2654         * command.c: (run_command) Call lex_discard_line() after
2655         lex_rest_of_line().
2656
2657         * lexer.c: (lex_entire_end) Change behavior.
2658         (lex_rest_of_line) Change behavior.  Return const char *.
2659         (lex_discard_line) Don't clear getl_buf, don't emit message.
2660
2661         * main.c: (handle_error) Emit message here.
2662
2663         * repeat.c: (internal_cmd_do_repeat) Use lex_discard_line()
2664         instead of lex_entire_line().
2665
2666         * str.c: (mm_find_reverse) Make length params size_t.  Rewrite.
2667
2668         * title.c: (get_title) Call lex_discard_line() after
2669         lex_rest_of_line().
2670         (cmd_file_label) Ditto.
2671         (cmd_document) Deal with const char * return value.
2672
2673 Fri Mar 26 00:10:16 2004  Ben Pfaff  <blp@gnu.org>
2674
2675         Removed REMARK command.
2676
2677         * command.c: (extract_prefix) Removed.
2678         (output_line) Removed.
2679         (cmd_remark) Removed.
2680
2681         * command.def: Remove REMARK.
2682
2683 Fri Mar 26 00:08:38 2004  Ben Pfaff  <blp@gnu.org>
2684
2685         Added abort() after lots of assert(0) invocations to avoid some
2686         compiler warnings.  We really need a NOT_REACHED macro.
2687
2688 Tue Mar 23 08:00:42 WAST 2004 John Darrington <john@darrington.wattle.id.au>
2689
2690         * sort.c: Added missing call to temp_file_close.  Changed error 
2691         messages to warnings.
2692
2693         * set.q: Improved setting of set_view{length,width} to be more tolerant
2694         of buggy OSes.
2695
2696 Sun Mar 21 10:11:14 WST 2004 John Darrington <john@darrington.wattle.id.au>
2697
2698         * val-labs.c: Fixed a bug where PSPP would crash, if VALUE LABELS was
2699         used with incorrect syntax.
2700
2701         * error.c, error.h et al:  Overridden definition of assert for a
2702         custom one.
2703
2704         * test-q.c: Fixed a buglet where it would crash if no /VARIABLES
2705         subcommand was given when it ought to have been.
2706
2707 Sat Mar 20 22:19:08 2004  Ben Pfaff  <blp@gnu.org>
2708
2709         * tab.c: (tab_vline) Fix assertions to respect row_ofs and
2710         col_ofs.
2711         (tab_hline) Ditto.
2712         (tab_box) Ditto.
2713         (tab_joint_text) Ditto.
2714
2715 Sat Mar 20 17:57:23 2004  Ben Pfaff  <blp@gnu.org>
2716
2717         * levene.c: Add #include.
2718
2719         * set.q: (set_viewport) Add `int' argument to make its prototype
2720         correct for signal().
2721
2722 Sat Mar 20 15:35:17 2004  Ben Pfaff  <blp@gnu.org>
2723
2724         * expr-evl.c: (expr_evaluate) Assert that `c' is nonzero before
2725         using it.
2726
2727 Sat Mar 20 15:18:16 2004  Ben Pfaff  <blp@gnu.org>
2728
2729         Changed DFM from open-at-first-access to explicit-open.  Before,
2730         calling dfm_get_record() or dfm_put_record() would automatically
2731         open the file.  Now, you have to call dfm_open_for_reading() or
2732         dfm_open_for_writing() explicitly.  This makes it possible to
2733         check permissions, file existence, etc. earlier.
2734
2735         Also made struct file_handle more opaque, and clean up in general.
2736
2737         * data-list.c: (cmd_data_list) Open handle for reading.
2738
2739         * dfm.c: (struct dfm_fhuser_ext) Add `where', `saw_begin_data'
2740         members.
2741         (open_file_r) Renamed dfm_open_for_reading(), rewrote.
2742         (open_file_w) Renamed dfm_open_for_writing(), rewrote.
2743         (open_inline_file) Removed.
2744         (read_record) For inline_file, if we haven't seen BEGIN DATA, read
2745         it.  Deal with line_number in extension record instead of file
2746         handle.
2747         (dfm_get_record) Rewrote.
2748         (dfm_put_record) Rewrote.
2749         (dfm_push) Assert file is open and one of ours.  Deal with
2750         line_number in extension record instead of file handle.
2751         (dfm_pop) Assert file is open and one of ours.  Deal with
2752         line_number in extension record instead of file handle.
2753         (cmd_begin_data) Use dfm_open_for_reading().  Mark that we saw
2754         BEGIN DATA.     
2755
2756         * file-handle.h: (enum constants RH_RF_*) Removed.
2757         (enum constants FH_MD_*) Removed.
2758         (struct file_handle) Removed `name', `norm_fn', `fn', `where',
2759         `recform', `lrecl', `mode' members.  Public references to
2760         `recform' changed to use handle_get_mode(), references to `lrecl'
2761         changed to use handle_get_record_width().  Added `private' member.
2762         (enum file_handle_mode) New.
2763
2764         * file-handle.q: (struct private_file_handle) New structure.
2765         (struct file_handle_list) New structure.
2766         (static var files) New.
2767         (static var file_handles) Removed.
2768         (init_file_handle) Removed.
2769         (create_file_handle) Removed.
2770         (get_handle_with_name) New function.
2771         (get_handle_for_filename) New function.
2772         (cmd_file_handle) Rewritten.
2773         (hash_file_handle) Removed.
2774         (cmp_file_handle) Removed.
2775         (fh_init_files) Rewritten.
2776         (fh_parse_file_handle) Rewritten.  Allows identifiers as
2777         filenames.
2778         (fh_get_handle_by_name) Renamed handle_get_name(), all references
2779         updated.  Rewritten.
2780         (fh_get_handle_by_filename) Renamed handle_get_filename(), all
2781         references updated.  Rewritten.
2782         (fh_record_width) Renamed handle_get_record_width(), all
2783         references updated.  Rewritten.
2784         (handle_get_mode) New function.
2785
2786         * file-type.c: (cmd_file_type) Open handle for reading.
2787
2788         * filename.c: [unix] (struct file_identity) New structure.
2789         [unix] (fn_get_identity) New function.
2790         [unix] (fn_free_identity) New function.
2791         [unix] (fn_compare_file_identities) New function.
2792         [!unix] (struct file_identity) New structure.
2793         [!unix] (fn_get_identity) New function.
2794         [!unix] (fn_free_identity) New function.
2795         [!unix] (fn_compare_file_identities) New function.
2796
2797         * lexer.c: (static var put) Renamed put_token, all references
2798         updated.
2799         (static var put_tokstr) New.
2800         (static var put_tokval) New.
2801         (lex_init) Initialize put_tokstr().
2802         (restore_token) New function.
2803         (save_token) New function.
2804         (lex_get) Use restore_token().
2805         (lex_put_back) Use save_token().
2806         (lex_put_back_id) New function.
2807         (lex_put_forward) Removed.
2808         (lex_preprocess_line) Set put_token instead of using
2809         lex_put_forward().
2810         (lex_negative_to_dash) Use save_token(), set put_token directly.
2811         (dump_token) Use stderr instead of stdout.
2812
2813         * main.c: (main) Remove call to cmd_init().
2814         
2815         * matrix-data.c: (cmd_matrix_data) Open file for reading.
2816
2817         * pfm-read.c: Use handle_get_filename() instead of trying to use
2818         h->fn directly, all over.
2819
2820         * pfm-write.c: Ditto.
2821
2822         * print.c: (internal_cmd_print) Open handle for writing.
2823         (dump_table) Use handle_get_filename().
2824         (print_trns_proc) Use handle_get_mode().
2825         (cmd_print_space) Use fh_parse_file_handle().
2826         Open handle for writing.
2827         [0] (debug_print) Removed.
2828
2829         * sfm-read.c: Use handle_get_filename() instead of trying to use
2830         h->fn directly, all over.
2831
2832         * sfm-write.c: Ditto.
2833
2834 Sat Mar 20 14:35:48 2004  Ben Pfaff  <blp@gnu.org>
2835
2836         Fix memory leaks.
2837         
2838         * autorecode.c: (arc_free) Free arc->src_values.
2839
2840         * error.c: (msg) Free buf.
2841
2842         * val-labs.c: (do_value_labels) Always free vars.
2843
2844         * vfm.c: (close_active_file) If sink has no make_source then call
2845         its destroy function.
2846
2847 Sat Mar 20 14:00:24 2004  Ben Pfaff  <blp@gnu.org>
2848
2849         Fixed cmd_parse() so that it always skips past a full command
2850         name.  A few special commands for which this would be bad get
2851         special treatment.  This lets us drop code for skipping past the
2852         end of a command name in most cmd_*() functions.  It's not worth
2853         listing all the commands affected.
2854
2855         * command.c: (struct command) Remove `cmd' member, replace by
2856         `name' member, all references updated.  Remove `word', `next',
2857         `skip_entire_name' members.
2858         (macro DEFCMD) Deal with revised `struct command'.
2859         (macro UNIMPL) Ditto.
2860         (macro SPCCMD) New macro for commands whose last word shouldn't be
2861         skipped.
2862         (static array cmd_table[]) Make const, rename `commands', remove
2863         sentinel element.
2864         (macro COMMAND_CNT) New macro.
2865         (split_words) Removed.
2866         (cmd_init) Removed.
2867         (FILE_TYPE_okay) Make parameter const.
2868         (cmd_parse) Improve error messages.
2869         (match_strings) New function.
2870         (next_word) New function.
2871         (enum command_match) New enum.
2872         (conflicting_3char_prefixes) New function.
2873         (conflicting_3char_prefix_command) New function.
2874         (cmd_match_words) New function.
2875         (count_matching_commands) New function.
2876         (get_command_name) New function.
2877         (free_words) New function.
2878         (unknown_command_error) New function.
2879         (figure_out_command) Renamed parse_command_name(), rewritten.
2880
2881         * command.def: Removed @ command.  Marked BEGIN DATA, DOCUMENT,
2882         FILE LABEL, REMARK, SUBTITLE, TITLE as special.  Renamed EVALUATE
2883         to DEBUG EVALUATE.  Added N alias for N OF CASES, SORT alias for
2884         SORT CASES.
2885
2886         * command.h: (macro SPCCMD) New.
2887
2888         * include.c: (cmd_include_at) Removed.
2889         (cmd_include) Allow identifier to be used as filename.
2890
2891         * inpt-pgm.c: (cmd_reread) Use fh_parse_file_handle().
2892
2893         * t-test.q: (cmd_t_test) Command name is now parsed for us.
2894         
2895
2896 Sat Mar 20 13:56:00 2004  Ben Pfaff  <blp@gnu.org>
2897
2898         Start work on better test framework.
2899         
2900         * Makefile.am: (pspp_sources) Add debug.c.
2901         
2902         * debug.c: New file.
2903
2904         * compute.c: (cmd_evaluate) Moved to debug.c, renamed
2905         cmd_debug_evaluate().
2906
2907         * expr-prs.c: (expr_parse) Remove PXP_DUMP support.
2908
2909         * expr.h: (enum constant PXP_DUMP) Removed.
2910
2911 Sat Mar 20 00:05:42 WST 2004 John Darrington <john@darrington.wattle.id.au>
2912
2913         * set.q:  Implemented the SHOW command, and synced it to the existing 
2914         SET cmd.
2915
2916         Added a handler for SIGWINCH so that viewlength and viewwidth follow
2917         changes as the window size is changed.
2918
2919         Added fallback to set viewlength and viewwidth from LINES and COLUMS
2920         environment variables if other methods are not available.
2921
2922         glob.c: Removed a lot of global variables from glob.c and encapsulated 
2923         them in set.q
2924
2925         random.c: Tidied up the way the random seed is set.
2926
2927         str.c: Added a ds_vprintf function.
2928
2929         error.c: Extended dump_message so that messages are always broken at
2930         '\n' characters.
2931         
2932 Thu Mar 18 11:07:14 2004  Ben Pfaff  <blp@gnu.org>
2933
2934         * pfm-write.c: (bufwrite) Write out the correct element for string
2935         variables.  From Andreas Streichardt <streichardt@globalpark.de>.
2936
2937 Mon Mar 15 20:48:03 2004  Ben Pfaff  <blp@gnu.org>
2938
2939         Get rid of static and global (!) vars in matrix-data.c.
2940
2941         * matrix-data.c: (static var nr_data) Removed.
2942         (static var nr_factor_values) Removed.
2943         (static var max_cell_index) Removed.
2944         (static var split_values) Removed.
2945         (struct nr_aux_data) New structure.
2946         (read_matrices_without_rowtype) Use a local struct nr_aux_data in
2947         place of static vars, pass to create_case_source() and procedure()
2948         as aux data.
2949         (nr_read_data_lines) Use struct nr_aux_data * parameter instead of
2950         struct matrix_data_pgm *.
2951         (nr_read_splits) Ditto.
2952         (nr_read_factors) Ditto.
2953         (nr_output_data) Ditto.
2954         (static var wr_content) Removed.
2955         (global var wr_data) Removed.
2956         (global var wr_current) Removed.
2957         (struct wr_aux_data) New structure.
2958         (read_matrices_with_rowtype) Use a local struct wr_aux_data in
2959         place of static vars, pass to create_case_source() and procedure()
2960         as aux data.
2961         (matrix_data_read_with_rowtype) Use struct wr_aux_data * parameter
2962         instead of matrix_data_pgm *.
2963         (wr_read_splits) Ditto.
2964         (wr_output_data) Ditto.
2965         (wr_read_rowtype) Ditto.
2966         (wr_read_factors) Ditto.
2967         (wr_read_indeps) Ditto.
2968         
2969 Mon Mar 15 20:07:29 2004  Ben Pfaff  <blp@gnu.org>
2970
2971         Get rid of static vars in autorecode.c.
2972
2973         * autorecode.c: (struct autorecode_trns) Rename `arc' to `specs',
2974         `n_arc' to `spec_cnt'.  All references updated.
2975         (static var v_src) Removed.
2976         (static var v_dest) Removed.
2977         (static var h_trns) Removed.
2978         (static var nv_src) Removed.
2979         (static var descend) Removed.
2980         (static var print) Removed.
2981         (enum direction) New enum.
2982         (struct autorecode_pgm) New structure.
2983         (cmd_autorecode) Use struct autorecode_pgm instead of static vars.
2984         Move n_dest local var into struct autorecode_pgm for ease of
2985         clean-up.  Use arc_free().
2986         (arc_free) New function.
2987         (recode) Modify to take struct autorecode_pgm * parameter instead
2988         of using statics.  Let the caller clean up.
2989         (autorecode_proc_func) Use struct autorecode_pgm * auxiliary data
2990         instead of statics.  Rearrange code a little.
2991
2992 Mon Mar 15 00:25:02 2004  Ben Pfaff  <blp@gnu.org>
2993
2994         Get rid of static, global vars in recode.c.  Remove debug code.
2995
2996         * recode.c: (static var head) Removed.
2997         (global var v) Removed.
2998         (global var nv) Removed.
2999         (cmd_recode) New local variables head, v, nv.  Initialize and free
3000         v.  Don't call debug_print().
3001         [DEBUGGING] (dump_dest) Removed.
3002         [DEBUGGING] (debug_print) Removed.
3003
3004 Mon Mar 15 00:14:49 2004  Ben Pfaff  <blp@gnu.org>
3005
3006         Get rid of static vars in expr-opt.c.
3007
3008         * expr-opt.c: (static var e) Removed.
3009         (static var nop) Removed.
3010         (static var mop) Removed.
3011         (static var ndbl) Removed.
3012         (static var mdbl) Removed.
3013         (static var nstr) Removed.
3014         (static var mstr) Removed.
3015         (static var nvars) Removed.
3016         (static var mvars) Removed.
3017         (struct expr_dump_state) New structure.
3018         (dump_expression) Use new struct expr_dump_state instead of static
3019         vars and pass to functions we call.
3020         (dump_node) Use struct expr_dump_state * parameter.
3021         (emit) Ditto.
3022         (emit_num_con) Ditto.
3023         (emit_str_con) Ditto.
3024         (emit_var) Ditto.
3025         
3026 Mon Mar 15 00:03:51 2004  Ben Pfaff  <blp@gnu.org>
3027
3028         Get rid of static var in COUNT.
3029
3030         * count.c: (static var head) Move into cmd_count().
3031         (cmd_count) [DEBUGGING] Don't call debug_print.
3032         [DEBUGGING] (debug_print) Removed.
3033
3034 Sun Mar 14 23:56:09 2004  Ben Pfaff  <blp@gnu.org>
3035
3036         Get rid of static vars in VALUE LABELS, ADD VALUE LABELS.
3037
3038         * val-labs.c: (static var v) Removed.
3039         (static var nv) Removed.
3040         [DEBUGGING] (debug_print) Removed.
3041         (verify_val_labs) Add struct variable **, int parameters.
3042         (get_label) Ditto.  Improve error messages, streamline.
3043         (erase_labels) New function for erasing value labels, taking over
3044         part of verify_val_labs()'s function.
3045         (init) Removed.
3046         (done) Removed.
3047         (cmd_value_labels) No need to call init() or done() anymore.
3048         (cmd_add_value_labels) Ditto.
3049         (do_value_labels) Add vars, var_cnt local variables.  Clean up
3050         after them internally.  Call erase_labels() if we should.  Don't
3051         call debug_print().
3052
3053 Sun Mar 14 23:33:53 2004  Ben Pfaff  <blp@gnu.org>
3054
3055         Get rid of static vars in MATCH FILES.
3056         
3057         * get.c: (static var mtf_head) Removed.
3058         (static var mtf_tail) Removed.
3059         (static var mtf_by) Removed.
3060         (static var mtf_n_by) Removed.
3061         (static var mtf_master) Removed.
3062         (static var mtf_seq_num) Removed.
3063         (static var mtf_seq_nums) Removed.
3064         (static var mtf_sink) Removed.
3065         (static var mtf_case) Removed.
3066         (struct mtf_proc) New structure.
3067         (cmd_match_files) Use struct mtf_proc instead of static vars.
3068         (mtf_processing_finish) Ditto.
3069         (mtf_free) Ditto.
3070         (mtf_delete_file_in_place) Ditto.
3071         (mtf_read_nonactive_records) Ditto.
3072         (mtf_compare_BY_values) Ditto.
3073         (mtf_processing) Ditto.
3074         (mtf_merge_dictionary) Ditto.
3075
3076 Sun Mar 14 22:48:12 2004  Ben Pfaff  <blp@gnu.org>
3077
3078         * command.def: Add CASESTOVARS, VARSTOCASES unimplemented commands.
3079
3080         * dictionary.c: (dict_rename_var) Add assertion.
3081         (dict_contains_var) Check by index instead of name.
3082
3083 Sun Mar 14 22:01:02 2004  Ben Pfaff  <blp@gnu.org>
3084
3085         Get rid of compaction_necessary, compaction_nval, compaction_case.
3086         Redo VFM interface.  Replace disk_sink and memory_sink by
3087         storage_sink, disk_source and memory_source by storage_source.
3088
3089         * vfm.h: (struct case_sink) Add `dict', `idx_to_fv', `value_cnt'
3090         members.
3091
3092         * vfm.c: 
3093         (struct write_case_data) Remove `begin_func', `end_func',
3094         `func_aux' members.  Add `aux', `trns_case', `sink_case',
3095         `cases_written', `cases_analyzed' members.
3096         (global var compaction_necessary) Make static.
3097         (global var compaction_nval) Removed.
3098         (global var compaction_case) Removed.
3099         (static var case_count) Removed.
3100         (struct procedure_aux_data) Removed.
3101         (struct split_aux_data) Removed.
3102         (procedure) Remove begin_func, end_func parameters.  Rewrite.
3103         (static var not_canceled) Removed.
3104         (process_active_file) Removed.
3105         (process_active_file_write_case) Removed.
3106         (process_active_file_output_case) Removed.
3107         (prepare_for_writing) Moved into open_active_file().
3108         (arrange_compaction) Ditto.
3109         (setup_lag) Ditto.
3110         (open_active_file) Rewrote.
3111         (write_case) New function.
3112         [DEBUGGING] (index_to_varname) Removed.
3113         (execute_transformations) New function.
3114         (exclude_this_case) Renamed filter_case(), changed interface.
3115         (clear_case) Added struct ccase * parameter to interface.
3116         (close_active_file) Added struct write_case_data * parameter,
3117         rewrote.
3118         (disk_sink_create) Removed.
3119         (disk_sink_destroy) Removed.
3120         (disk_sink_make_source) Removed.
3121         (disk_sink_write) Removed.
3122         (disk_source_count) Removed.
3123         (disk_source_destroy) Removed.
3124         (disk_source_read) Removed.
3125         (global var disk_sink_class) Removed.
3126         (global var disk_source_class) Removed.
3127         (global var memory_sink_class) Removed.
3128         (global var memory_source_class) Removed.
3129         (memory_sink_create) Removed.
3130         (memory_sink_destroy) Removed.
3131         (memory_sink_make_source) Removed.
3132         (memory_sink_write) Removed.
3133         (memory_source_count) Removed.
3134         (memory_source_destroy) Removed.
3135         (memory_source_get_cases) Removed.
3136         (memory_source_read) Removed.
3137         (memory_source_set_cases) Removed.
3138         (struct disk_stream_info) Removed.
3139         (struct memory_sink_info) Removed.
3140         (struct memory_source_info) Removed.
3141         (write_active_file_to_disk) Removed.
3142         (destroy_storage_stream_info) New function.
3143         (global var null_sink_class) New var.
3144         (global var storage_sink_class) New var.
3145         (global var storage_source_class) New var.
3146         (open_storage_file) New function.
3147         (storage_sink_destroy) New function.
3148         (storage_sink_make_source) New function.
3149         (storage_sink_open) New function.
3150         (storage_sink_write) New function.
3151         (storage_source_count) New function.
3152         (storage_source_destroy) New function.
3153         (storage_source_get_cases) New function.
3154         (storage_source_on_disk) New function.
3155         (storage_source_read) New function.
3156         (storage_source_set_cases) New function.
3157         (storage_source_to_disk) New function.
3158         (storage_to_disk) New function.
3159         (struct storage_stream_info) New structure.
3160         (write_storage_file) New function.
3161         (procedure_write_case) Removed.
3162         (create_case_source) Add `struct dictionary *' parameter, all
3163         references updated.
3164         (create_case_sink) Ditto.
3165         (free_case_sink) New function.
3166         (struct split_aux_data) New structure.
3167         (procedure_with_splits) New function implementing what procedure()
3168         used to.
3169         (SPLIT_FILE_proc_func) Removed.
3170         (procedure_with_splits_callback) New function.
3171         (equal_splits) New function.
3172         
3173         * aggregate.c: Pass around a struct instead of using statics.
3174         (static var outfile) Remove.
3175         (enum type) Give it tag `missing_treatment'.
3176         (static var missing) Remove.
3177         (static var sort) Remove.
3178         (static var agr_first) Remove.
3179         (static var agr_next) Remove.
3180         (static var case_count) Remove.
3181         (static var prev_case) Remove.
3182         (static var buf64_1xx) Remove.
3183         (static var buf_1xx) Remove.
3184         (struct agr_proc) New structure incorporating the above.
3185         (cmd_aggregate) Use new struct.  Clean up error handling using
3186         agr_destroy().  Completely rewrite actual implementation of
3187         aggregation.
3188         (create_sysfile) Add struct agr_proc * parameter, modify
3189         accordingly.
3190         (parse_aggregate_functions) Ditto.
3191         (free_aggregate_functions) Ditto.  Rename agr_destroy().
3192         (aggregate_single_case) Add struct agr_proc * parameter, modify
3193         accordingly.
3194         (accumulate_aggregate_info) Ditto.
3195         (dump_aggregate_info) Ditto.
3196         (initialize_aggregate_info) Ditto.
3197         (agr_00x_trns_proc) Removed.
3198         (agr_00x_end_func) Removed.
3199         (agr_10x_trns_proc) Removed.
3200         (agr_10x_trns_free) Removed.
3201         (agr_10x_end_func) Removed.
3202         (agr_11x_read) Removed.
3203         (agr_11x_finish) Removed.
3204         [DEBUGGING] (debug_print) Removed.
3205         (write_case_to_sfm) Add struct agr_proc * parameter, modify
3206         accordingly.
3207         (agr_to_active_file) New function.
3208         (presorted_agr_to_sysfile) New function.
3209         (sort_agr_to_sysfile) New function.
3210
3211         * autorecode.c: (cmd_autorecode) Use procedure_with_splits().
3212
3213         * crosstabs.q: (internal_cmd_crosstabs) Ditto.
3214
3215         * descript.q: (cmd_descriptives) Ditto.
3216
3217         * dfm.c: (cmd_begin_data) Check for storage_source_class.  Adapt
3218         to new procedure() interface.
3219
3220         * command.c: (cmd_execute) Adapt to new procedure() interface.
3221
3222         * dictionary.c: (dict_compact_values) Also delete scratch
3223         variables.
3224         (dict_get_compacted_value_cnt) New function.
3225         (dict_get_compacted_idx_to_fv) New function.
3226
3227         * flip.c: (cmd_flip) Warn about and cancel TEMPORARY.
3228         (cmd_flip) Adapt to new procedure() interface.
3229         (flip_sink_write) Use sink->idx_to_fv.
3230
3231         * frequencies.q: (internal_cmd_frequencies) Use
3232         procedure_with_splits().
3233
3234         * get.c: (cmd_save_internal) Adapt to new procedure() interface.
3235         (static var mtf_sink) New static var.
3236         (static var mtf_case) New static var.
3237         (cmd_match_files) Warn about and cancel TEMPORARY.  Redo the way
3238         we actually implement the matching.
3239         (mtf_delete_file_in_place) Use mtf_case.
3240         (mtf_processing) Use mtf_case and mtf_sink.
3241         (cmd_export) Adapt to new procedure() interface.
3242
3243         * levene.c: (levene) Use procedure_with_splits().
3244
3245         * list.q: (cmd_list) Use procedure_with_splits().
3246
3247         * matrix-data.c: (read_matrices_without_rowtype) Adapt to new
3248         procedure() interface.
3249         (read_matrices_with_rowtype) Ditto.
3250
3251         * modify-vars.c; (cmd_modify_vars) Warn about and cancel
3252         TEMPORARY.  Adapt to new procedure() interface.
3253
3254         * rename-vars.c: Warn about and cancel TEMPORARY.
3255
3256         * sort.c: (cmd_sort_cases) Warn about TEMPORARY.
3257         (sort_cases) Use dict_get_compacted_value_cnt() instead of
3258         compaction_nval.  Adapt to new procedure() interface.  Use
3259         storage_source_to_disk().
3260         (do_internal_sort) Don't try to dump the cases to memory.
3261         (compare_case_lists) Pass null idx_to_fv.
3262         (struct initial_run_state) Add `idx_to_fv' member.  Remove
3263         `case_size' member.
3264         (write_initial_runs) Don't initialize irs->case_size.  Adapt to
3265         new procedure() interface.  Reset irs->idx_to_fv after calling
3266         procedure().
3267         (sort_sink_write) Set irs->idx_to_fv.  Use case_size from struct
3268         sort_cases_pgm.  Pass irs, not struct sort_cases_pgm to
3269         push_heap().
3270         (destroy_initial_run_state) Don't dereference irs after freeing
3271         it.
3272         (allocate_cases) Don't calculate case_size locally.
3273         (compare_record) Add idx_to_fv parameter.
3274         (compare_record_run) Change parameter from struct sort_cases_pgm *
3275         to struct initial_run_state *.  Pass irs->idx_to_fv to
3276         compare_record().
3277         (compare_record_run) Third parameter now a struct
3278         initial_run_state *.
3279         (output_record) No need for out_case anymore.  Pass irs, not
3280         struct sort_cases_pgm to pop_heap().  Use case_size from struct
3281         sort_cases_pgm.
3282         (merge) Use case_size from struct sort_cases_pgm.
3283         (merge_once) Use case_size from struct sort_cases_pgm.
3284         Pass null pointer to compare_record() as idx_to_fv.
3285         (global var sort_sink_class) Make static.
3286
3287         * t-test.q: (cmd_t_test) Use procedure_with_splits().
3288
3289         * temporary.c: Remove debugging crap.
3290
3291 Sat Mar 13 14:19:52 WST 2004 John Darrington <john@darrington.wattle.id.au>
3292
3293         * t-test.q, levene.c: Fixed up the handling of MISSING values
3294         int the T-TEST
3295
3296 Fri Mar 12 16:23:35 WST 2004 John Darrington <john@darrington.wattle.id.au>
3297
3298         * t-test.q, levene.c: Added support for T-TEST /GROUP where only 
3299         one value is given.
3300
3301 Wed Mar 10 23:25:13 2004  Ben Pfaff  <blp@gnu.org>
3302
3303         Change explicit variable name checks into use of
3304         dict_class_from_id().
3305
3306         * dictionary.c: (dict_create_var)  Change explicit variable name
3307         check into use of dict_class_from_id().
3308
3309         * get.c: (trim_dictionary) Ditto.
3310
3311         * sel-if.c: (cmd_filter) Ditto.
3312
3313         * sysfile-info.c: (cmd_display) Ditto.
3314
3315         * vars-prs.c: (parse_DATA_LIST_vars) Ditto.
3316
3317         * vfm.c: (arrange_compaction) Ditto.
3318
3319         * weight.c: (cmd_weight) Ditto.
3320
3321 Wed Mar 10 21:16:34 2004  Ben Pfaff  <blp@gnu.org>
3322
3323         * temporary.c: (cmd_temporary) When TEMPORARY was the first
3324         transformation following the input program, if any, for some
3325         reason we special-cased f_trns.  That's just wrong.  It should
3326         always be set to n_trns.
3327
3328 Tue Mar  9 23:44:40 2004  Ben Pfaff  <blp@gnu.org>
3329
3330         * format.c: (parse_format_specifier_name) Fix brown-bag bug
3331         introduced in last check-in.
3332
3333 Tue Mar  9 23:10:41 2004  Ben Pfaff  <blp@gnu.org>
3334
3335         * format.c: (global array translate_fmt[]) Removed.
3336         (translate_fmt) New function as replacement.
3337         (parse_format_specifier_name) Rewrite.
3338
3339         * pfm-read.c: (convert_format) Use translate_fmt() instead of
3340         translate_fmt[].
3341
3342         * sfm-read.c: (parse_format_spec) Ditto.
3343
3344         * postscript.c: (text) Fix handling of fonts with missing
3345         ligatures.
3346
3347         * sort.c: (struct external_sort) Add temp_name member.
3348         (destroy_external_sort) Free temp_dir, temp_name members.
3349         (init_external_sort) Allocate temp_name.
3350         (get_temp_file_name) Change prototype.
3351         (open_temp_file) Deal with change to get_temp_file_name().
3352         (close_temp_file) Ditto.
3353         (remove_temp_file) Ditto.
3354         (write_temp_file) Ditto.
3355         (read_temp_file) Ditto.
3356         (sort_sink_destroy) Removed.
3357         (sort_sink_class) Change destroy member to null.
3358
3359 Tue Mar  9 22:36:34 2004  Ben Pfaff  <blp@gnu.org>
3360
3361         Eliminate temp_case.
3362
3363         * aggregate.c: (cmd_aggregate) No need to save/restore temp_case
3364         anymore.  Use agr_11x_finish().
3365         (aggregate_single_case) Make first param const.
3366         (accumulate_aggregate_info) Ditto.
3367         (agr_00x_end_func) Use compaction_case, not temp_case.
3368         (agr_11x_func) Break into agr_11x_read(), agr_11x_finish().
3369
3370         * data-list.c: (struct data_list_pgm) Add `case_size' member.
3371         (cmd_data_list) Initialize case_size.
3372         (read_from_data_list_fixed) Add struct ccase * param, use instead
3373         of temp_case.
3374         (read_from_data_list_free) Ditto.
3375         (read_from_data_list_list) Ditto.
3376         (read_one_case) Rename data_list_trns_proc(), all references
3377         updated.  Add argument in calling above functions.  Use c
3378         argument instead of temp_case.
3379         (destroy_dls) Rename data_list_trns_free(), all references
3380         updated.
3381
3382         * expr-evl.c: (expr_evaluate) Make second parameter const.
3383
3384         * file-type.c: (struct file_type_pgm) Add `case_size' member.
3385         (cmd_end_file_type) Initialize `case_size'.
3386         (file_type_source_read) Add struct ccase * parameter.  Use instead
3387         of temp_case.
3388
3389         * flip.c: Rewritten.
3390
3391         * get.c: (struct get_pgm) New structure to keep track of
3392         case_size.
3393         (cmd_get) Initialize case_size.
3394         (cmd_import) Ditto.
3395         (get_source) Deal with struct get_pgm.
3396         (get_source_read) Add struct ccase * parameter, use instead of
3397         temp_case.
3398         (import_source_read) Ditto.
3399
3400         * get.c: Use a null pointer instead of temp_case to represent the
3401         "current case" in a struct mtf_file's input member.
3402         (mtf_processing_finish) Pass null to mtf_processing(), not
3403         temp_case.
3404         (mtf_read_nonactive_records) Don't set iter->input to temp_case.
3405         (mtf_compare_BY_values) Add extra arg, use instead of null input
3406         members.
3407         (mtf_processing) Use c parameter instead of temp_case.  Pass
3408         compaction_case to process_active_file_output_case().
3409         
3410         * glob.c: (global variable temp_case) Removed.
3411
3412         * inpt-pgm.c: (struct input_program_pgm) Add `case_size' member.
3413         (cmd_input_program) Initialize case_size.  Set
3414         vfm_source->value_cnt.
3415         (init_case) Add struct ccase * parameter, use instead of
3416         temp_case.
3417         (clear_case) Ditto.
3418         (input_program_source_read) Ditto.
3419
3420         * matrix-data.c: (matrix_data_read_without_rowtype) Ditto.
3421         (dump_cell_content) Ditto.
3422         (nr_output_data) Ditto.
3423         (read_matrices_without_rowtype) Ditto.
3424         (matrix_data_read_with_rowtype) Ditto.
3425         (wr_read_splits) Ditto.
3426         (wr_output_data) Ditto.
3427
3428         * sort.h: (struct sort_cases_pgm) New member `case_size'.
3429         
3430         * sort.c: (sort_cases) Initialize scp->case_size.
3431         (struct external_sort) Remove `case_size' member.
3432         (write_initial_runs) Only call vfm_sink->class_destroy if
3433         non-null.
3434         (struct sort_source_aux) New structure.
3435         (sort_source_read_helper) New function.
3436         (sort_source_read) Use sort_source_read_helper().
3437         (read_sort_output) Change interface to be more reasonable.
3438         (read_internal_sort_output) Ditto.
3439         (read_external_sort_output) Ditto.
3440
3441         * vars-prs.c: (dict_class_to_name) Pass return value through
3442         gettext.
3443
3444         * vfm.c: (struct procedure_aux_data) Add `trns_case' member.
3445         (procedure) Initialize trns_case.
3446         (procedure) Pass trns_case to vfm_source->class->read().
3447         Free trns_case.
3448         (process_active_file) Start using struct procedure_aux_data.
3449         (process_active_file_write_case) Pass trns_case to
3450         transformations, lag_case(), clear_case().
3451         (process_active_file_output_case) Add struct ccase * parameter.
3452         (create_trns_case) New function.
3453         (make_temp_case) Removed.
3454         (vector_initialization) Removed.
3455         (close_active_file) Only call make_source if non-null, otherwise
3456         set vfm_source to null pointer.  Don't free temp_case.
3457         (disk_source_read) Add struct ccase * parameter, use instead of
3458         temp_case.
3459         (memory_source_read) Ditto.
3460         (lag_case) Add const struct ccase * member.
3461         (procedure_write_case) Use trns_case instead of temp_case.
3462         (clear_case) Add struct ccase * member, use instead of temp_case.
3463         (exclude_this_case) Ditto.
3464         (create_case_source) Add struct dictionary * parameter, use to
3465         initialize source->value_cnt.
3466
3467         * vfm.h: (struct case_source) Add `value_cnt' member.
3468         (struct case_source_class) Add struct ccase * parameter to `read'
3469         member function pointer.
3470         (struct case_sink_class) Make struct ccase * parameter const in
3471         `write' member function pointer.
3472         
3473 Wed Mar  3 20:44:37 2004  Ben Pfaff  <blp@gnu.org>
3474
3475         Fix a lot of "possibly uninitialized variable" warnings.  Some of
3476         them are even real bugs.  A few of them make me wonder how the
3477         code ever worked.
3478
3479         * aggregate.c: (parse_aggregate_functions) Initialize `function.
3480
3481         * ascii.c: (output_lines) Add default case to switch.
3482
3483         * crosstabs.q: Remove static variable `expected' and all
3484         references to it.
3485         (display_crosstabulation) Always calculate expected value.
3486         (calc_chisq) Ditto.
3487         (output_pivot_table) Initialize `cmp'.
3488         (display_crosstabulation) New variable `last_row', which is
3489         initialized.
3490
3491         * data-in.c: (parse_numeric) Always initialize sign.  How did this
3492         work at all?!
3493
3494         * data-list.c: (repeating_data_trns_proc) Always initialize code.
3495         Always set info.ofs.  (How did this work?!)
3496
3497         * expr-opt.c: (optimize_tree) Always initialize `m'.
3498         (evaluate_tree) Always initialize `c'.  (How did this work?)
3499
3500         * frequencies.q: (frq_custom_variables) Always initialize min,
3501         max.
3502         (frq_custom_grouped) Always initialize `dl'.
3503
3504         * groff-font.c: (groff_read_font) Always initialize char_set.
3505
3506         * matrix-data.c: (nr_output_data) Initialize `split'.
3507         (wr_read_splits) Remove shadowing split_cnt declaration.
3508         (wr_output_data) Initialize `split'.
3509
3510         * output.c: (tokener) Skip add character on syntax error.
3511
3512         * pool.c: (pool_strndup) Always set `copy'.  (How did this work?!)
3513
3514         * postscript.c: (read_ps_encodings) Use line.string instead of
3515         uninitialized `bp'.
3516         (write_text) Add default case to switch.
3517         (text) Always initialize multiple variables.  Fix bug with
3518         ligatures.
3519
3520         * print.c: (fixed_parse_fortran) Initialize head.
3521         (alloc_line) Add default case to switch.
3522
3523         * recode.c: (parse_dest_spec) Handle case where nothing matches.
3524         (recode_trns_proc) Move variable declaration inward.  Add default
3525         case to switch.
3526
3527         * sfm-read.c: (read_header) Initialize skip_amt.
3528
3529         * sysfile-info.c: (display_variables) Always initialize pc.
3530
3531         * vars-prs.c: Initialized `included'.
3532
3533 Wed Mar  3 09:30:09 2004  Ben Pfaff  <blp@gnu.org>
3534
3535         * main.c: (main) sigaction()'s sa_flags member was uninitialized.
3536         Just use signal() instead.
3537
3538 Wed Mar  3 09:26:30 2004  Ben Pfaff  <blp@gnu.org>
3539
3540         Get rid of vfm_sink_info and vfm_source_info.
3541         
3542         * aggregate.c: (agr_00x_end_func) Don't increment
3543         sfm_sink_info.ncases.
3544
3545         * sort.c: (do_internal_sort) Get case count from
3546         vfm_source->class->count().
3547         (struct external_sort) Add `case_size' member.
3548         (do_external_sort) Initialize case_size.
3549         (struct initial_run_state) Add `case_size' member.
3550         (write_initial_runs) Initialize case_size.
3551         (sort_sink_write) Use case_size.
3552         (read_external_sort_output) Use case_size.  Get case_cnt from
3553         initial_runs.
3554
3555         * vfm.c: (struct write_case_data) Add underscores to existing arg
3556         names, all references updated.  Renamed `aux' as `func_aux', all
3557         references updated.  Added new `aux' member.
3558         (global var vfm_source_info) Removed.
3559         (global var vfm_sink_info) Removed.
3560         (struct procedure_aux_data) New.
3561         (struct split_aux_data) New.
3562         (procedure) Use `aux' fields for procedure_aux_data,
3563         split_aux_data.
3564         (process_active_file_write_case) Pass case_count + 1 to
3565         transformation procedures, exclude_this_case().
3566         (process_active_file_output_case) Don't increment
3567         vfm_sink_info.ncases.
3568         (prepare_for_writing) Don't initialize vfm_sink_info.  Don't try
3569         to send data to disk early.
3570         (make_temp_case) Don't use vfm_sink_info.case_size.
3571         (close_active_file) Don't initialize vfm_source_info.
3572         (struct disk_stream_info) New, to allow for case_cnt and case_size fields.
3573         (disk_sink_create) Initialize and/or update disk_stream_info.
3574         (disk_sink_write) Ditto.
3575         (disk_sink_destroy) Ditto.
3576         (disk_sink_make_source) Ditto.
3577         (disk_source_read) Ditto.
3578         (disk_source_destroy) Ditto.
3579         (global var disk_source_class) Add disk_source_count().
3580         (disk_source_count) New function.
3581         (struct memory_sink_info) Add `case_cnt', `case_size' members.
3582         (struct memory_source_info) Ditto.
3583         (memory_sink_create) Deal with case_cnt, case_size.
3584         (memory_sink_write) Ditto.
3585         (memory_sink_make_source) Ditto.
3586         (memory_source_read) Ditto.
3587         (memory_source_count) New function.
3588         (memory_source_class) Add memory_source_count().
3589         (procedure_write_case) Don't use vfm_sink_info.ncases.  Do use
3590         proc_aux->cases_written, and pass it to transformation procedures
3591         and exclude_this_case ().
3592         (exclude_this_case) Add case_num parameter.  Pass it to
3593         expr_evaluate().
3594         (SPLIT_FILE_procfunc) Use split_aux->prev_case instead of static
3595         variable.
3596
3597         * vfm.h: (struct case_source_class) Add `count' member.
3598
3599         * vfmP.h: (struct stream_info) Removed.
3600         (global variable vfm_source_info) Removed.
3601         (global variable vfm_sink_info) Removed.
3602         
3603 Tue Mar  2 23:38:17 2004  Ben Pfaff  <blp@gnu.org>
3604
3605         * var.h: (typedef trns_proc_func) New typedef.
3606         (trns_free_func) New typedef.
3607         (struct trns_header) Change `proc' to type trns_proc_func, `free'
3608         to type trns_free_func.  This only changes the actual type of
3609         trns_proc_func, adding a `case_num' parameter.  Updated all
3610         implementations to use the typedefs instead.
3611
3612         * compute.c: (compute_num) Pass case_num to expr_evaluate().
3613         (compute_num_vec) Ditto.
3614         (compute_str) Ditto.
3615         (compute_str_vec) Ditto.
3616
3617         * do-if.c: (do_if_trns_proc) Ditto.
3618
3619         * expr-evl.c: (expr_evaluate) Add new case_num parameter, use for
3620         OP_CASENUM.
3621
3622         * inpt-pgm.c: (input_program_source_read) Maintain case count,
3623         pass to transformation functions.
3624         (reread_trns_proc) Pass case_num arg to expr_evaluate().
3625
3626         * loop.c: (loop_1_trns_proc) Ditto.
3627         (loop_2_trns_proc) Ditto.
3628         (loop_3_trns_proc) Ditto.
3629
3630         * print.c: (print_space_trns_proc) Ditto.
3631
3632         * sel-if.c: (select_if_proc) Ditto.
3633
3634 Tue Mar  2 11:36:52 2004  Ben Pfaff  <blp@gnu.org>
3635
3636         * frequencies.q: (cleanup_freq_tab) Avoid memory leak by
3637         destroying hash table.
3638
3639         * glob.c: (read_active_file) Variable not referenced, removed.
3640         (cancel_input_pgm) Ditto.
3641
3642         * levene.c: Add #include <stdlib.h> needed to call free().
3643
3644         * aggregate.c: (parse_aggregate_functions) Make `function'
3645         variable const.
3646
3647 Tue Mar  2 11:30:56 2004  Ben Pfaff  <blp@gnu.org>
3648
3649         Start working to eliminate VFM dependence on static variables.
3650
3651         * command.c: (cmd_parse) Use case_source_is_class().
3652
3653         * data-list.c: Rewrite to eliminate use of static variables.
3654
3655         * dfm.c: (cmd_begin_data) Use case_source_is_class().
3656
3657         * file-handle.q: (fh_handle_name) Make parameter const.
3658
3659         * file-type.c: Rewrite to eliminate use of static variables.
3660
3661         * flip.c: Rewrite to eliminate use of static variables.
3662
3663         * format.c: (get_format_var_width) New function.
3664
3665         * get.c: Eliminate use of static variables.
3666
3667         * inpt-pgm.c: Eliminate use of static variables.
3668
3669         * matrix-data.c: Eliminate use of static variables.
3670
3671         * set.q: (set_max_workspace) New variable.
3672         (cmd_set) Use SET WORKSPACE to modify set_max_workspace.
3673
3674         * var.h: (struct case_list) Move here from vfmP.h.
3675
3676         * vars-atr.c: (discard_variables) Handle new vfm_source type.
3677
3678         * vfm.c: (vfm_source) Change type from struct case_stream to
3679         struct case_source.
3680         (vfm_sink) Change type from struct case_stream to struct
3681         case_sink.
3682         (static var paging) Rename workspace_overflow, all references
3683         updated.
3684         (procedure) Use new class structures.
3685         (process_active_file) Ditto.
3686         (process_active_file_write_case) Ditto.
3687         (prepare_for_writing) Use set_max_workspace.  Use new class
3688         structures.
3689         (close_active_file) Use new class structures.  Free old sink.
3690         (global var disk_source_file) Removed.
3691         (global var disk_sink_file) Removed.
3692         (disk_stream_init) Removed.
3693         (disk_stream_read) Removed.
3694         (disk_stream_write) Removed.
3695         (disk_stream_mode) Removed.
3696         (disk_stream_destroy_source) Removed.
3697         (disk_stream_destroy_sink) Removed.
3698         (global var vfm_disk_stream) Removed.
3699         (disk_sink_create) New function.
3700         (disk_sink_write) New function.
3701         (disk_sink_destroy) New function.
3702         (disk_sink_make_source) New function.
3703         (disk_sink_class) New static var.
3704         (disk_source_read) New function.
3705         (disk_source_destroy) New function.
3706         (global var vfm_source_class) New var.
3707         (global var memory_source_cases) Removed.
3708         (global var memory_sink_cases) Removed.
3709         (global var memory_sink_max_cases) Removed.
3710         (struct memory_sink_info) New struct.
3711         (memory_stream_init) Removed.
3712         (memory_stream_read) Removed.
3713         (memory_stream_write) Removed.
3714         (memory_stream_mode) Removed.
3715         (memory_stream_destroy_source) Removed.
3716         (memory_stream_destroy_sink) Removed.
3717         (global var vfm_memory_stream) Removed.
3718         (page_to_disk) Renamed write_active_file_to_disk().
3719         (memory_sink_create) New function.
3720         (memory_sink_write) New function.
3721         (memory_sink_destroy) New function.
3722         (memory_sink_make_source) New function.
3723         (memory_sink_class) New static var.
3724         (memory_source_read) New function.
3725         (memory_source_destroy) New function.
3726         (memory_source_get_cases) New function.
3727         (memory_source_set_cases) New function.
3728         (global var vfm_source_class) New var.
3729         (procedure_write_case) Use new class structures.
3730         (create_case_source) New function.
3731         (case_source_is_complex) New function.
3732         (case_source_is_class) New function.
3733         (create_case_sink) New function.
3734
3735         * vfm.h: (global variable reinit_sysmis) Not used, removed.
3736         (global variable reinit_blanks) Not used, removed.
3737         (global variable init_zero) Not used, removed.
3738         (global variable init_blanks) Not used, removed.
3739         (struct case_source) New struct.
3740         (struct case_source_class) New struct.
3741         (struct case_sink) New struct.
3742         (struct case_sink_class) New struct.
3743         (struct case_stream) Removed.
3744
3745         * vfmP.h: (struct case_list) Moved to var.h.
3746
3747 Tue Mar  2 11:28:30 2004  Ben Pfaff  <blp@gnu.org>
3748
3749         * algorithm.c: (count_equal) New function.
3750         (count_if) New function.
3751         (unique) Add assertions.
3752         (partition) Add assertions.
3753         (is_partitioned) New function.
3754         (copy_if) Add assertions.
3755         (remove_equal) Add assertions.
3756         (lexicographical_compare) Rename lexicographical_compare_3way.
3757         (sort) Add assertions.  Rephrase some code.
3758         (is_sorted) New function.
3759
3760 Sun Feb 29 23:24:57 2004  Ben Pfaff  <blp@gnu.org>
3761
3762         Rewrite SORT CASES.
3763
3764         * sort.c: Completely rewrite.
3765
3766         * sort.h: Expose interface via struct sort_cases_pgm, not via
3767         global variables.
3768
3769         * aggregate.c: (sort) New static var.
3770         (cmd_aggregate) Use sort.
3771         (create_sysfile) Ditto.
3772         (aggregate_single_case) Ditto.
3773         (dump_aggregate_info) Ditto.
3774         (agr_00x_end_func) Ditto.
3775         (debug_print) Ditto.
3776
3777         * var.h: (enum SRT_ASCEND) Removed.
3778         (enum SRT_DESCEND) Removed.
3779         (struct sort_cases_proc) Removed.
3780         (struct variable) Remove p.srt member.
3781
3782 Sun Feb 29 23:22:45 2004  Ben Pfaff  <blp@gnu.org>
3783
3784         Get rid of the old, crappy heap structure and replace it by a new,
3785         shiny, C++ STL-like heap structure.
3786         
3787         * Makefile.am: (pspp_SOURCES) Remove heap.c, heap.h.
3788
3789         * algorithm.c: (push_heap) New function.
3790         (heapify) Ditto.
3791         (pop_heap) Ditto.
3792         (make_heap) Ditto.
3793         (sort_heap) Ditto.
3794         (is_heap) Ditto.
3795         
3796         * heap.c: Removed.
3797
3798         * heap.h: Removed.
3799
3800 Sun Feb 29 23:21:53 2004  Ben Pfaff  <blp@gnu.org>
3801
3802         Increase warning level.
3803         
3804         * Makefile.am: (AM_CFLAGS) Remove -Wnouninitialized.
3805
3806 Sat Feb 21 17:38:58 WST 2004 John Darrington <john@darrington.wattle.id.au>
3807
3808         * main.c: Added a signal handler for SIGSEGV requesting a bug report.
3809          
3810 Fri Feb 20 23:22:14 2004  Ben Pfaff  <blp@gnu.org>
3811
3812         * dictionary.c: (dict_create_var) Fix root cause of bug worked
3813         around by previous change log entry.
3814         
3815         * compute.c: (lvalue_finalize) Remove workaround from previous
3816         change log entry.
3817
3818 Fri Feb 20 14:37:41 WAST 2004 John Darrington <john@darrington.wattle.id.au>
3819
3820         * compute.c: Fixed a bug where the Format was not getting set for 
3821           computed variables (thus causing a crash when SAVEing).
3822
3823         * Added a test to stop this bug ever coming back
3824
3825 Wed Feb 18 22:21:35 2004  Ben Pfaff  <blp@gnu.org>
3826
3827         Got rid of approx.h.  In general, replaced all references to
3828         approx_eq() by ==, approx_lt() by <, etc.  Other types of changes
3829         noted below.
3830
3831         * Makefile.am: (pspp_SOURCES) Removed approx.h.
3832
3833         * data-out.c: (try_F) Replaced test for approx_eq(number, 0.0) by
3834         test for mag < EPSILON.
3835
3836         * misc.h: Add definition of EPSILON.
3837
3838 Wed Feb 18 21:32:44 2004  Ben Pfaff  <blp@gnu.org>
3839
3840         * vfm.c: (procedure) Add check to prevent recursive call.
3841
3842 Wed Feb 18 21:48:54 WST 2004 John Darrington <john@darrington.wattle.id.au>
3843
3844         * Moved the declarations relating to values to their own header file
3845           (val.h)
3846
3847         * Added levene.c and levene.h
3848
3849         * vars-atr.c: Changed the signature of compare_values to 
3850         take const * arguments.
3851                 
3852         * t-test.q: Changed the structure of struct t_test_proc 
3853        variables now contain their own group statistics information.
3854        Eventually, t_test_proc might get renamed, because it'd be 
3855        applicable to other commands too.
3856
3857 Mon Feb 16 23:15:51 2004  Ben Pfaff  <blp@gnu.org>
3858
3859         * data-out.c: Clean up.  Changed interface of convert_*() to take
3860         either a `double' or a `const char *' instead of a `const union
3861         value *'.  Update all implementations of those interfaces.
3862         (data_out) Use switch statements instead of a table.
3863         (convert_AHEX) Rewrite.
3864
3865         * format.h: Update comment.
3866
3867 Mon Feb 16 22:14:36 2004  Ben Pfaff  <blp@gnu.org>
3868
3869         * q2c.c: (dump_header) Add an Emacs header line to output files
3870         that makes generated .c files read-only by default, to make it
3871         difficult to accidentally change generated files.
3872
3873 Mon Feb 16 22:12:07 2004  Ben Pfaff  <blp@gnu.org>
3874
3875         * frequencies.q: (compare_freq_numeric_a) Compare by frequency,
3876         not bogus a->v.c <=> b->v.c pointer compare.
3877         (compare_freq_alpha_a) Ditto.
3878         (compare_freq_numeric_d) Ditto.
3879         (compare_freq_alpha_d) Ditto.
3880         
3881 Mon Feb 16 22:00:53 2004  Ben Pfaff  <blp@gnu.org>
3882
3883         Changed data_out() to store string data directly into a `union
3884         value''s s member, not indirectly into c.
3885
3886         * crosstabs.q: (output_pivot_table) Use format_short() instead of
3887         data_out().
3888         (table_value_missing) Ditto.
3889         (float_M_suffix) Ditto.
3890         (format_short) New function.
3891
3892         * data-in.h: (data_in_finite_line) Remove inline definition.
3893
3894         * data-list.c: (destroy_dls_var_spec) New function.
3895         (destroy_dls) Rewrite in terms of destroy_dls_var_spec().
3896         (data_list_source_destroy_source) Avoid cast.
3897         (struct repeating_data_trns) New field `id_value'.  Update
3898         comments.
3899         (cmd_repeating_data) Initialize id_value.  Use new
3900         repeating_data_trns_free() for freeing REPEATING DATA
3901         transformations.
3902         (rpd_parse_record) Rewrite support for record ID to be less bogus.
3903         (repeating_data_trns_free) New function.
3904
3905         * data-out.c: (data_out) Change return type to `void' by replacing
3906         error returns by writing a message into the output buffer.
3907         (convert_A) Read from v->s instead of v->c.
3908         (convert_AHEX) Ditto.
3909
3910         * expr-evl.c: Update comment.
3911         (expr_evaluate) Add assertion in OP_STRING case.
3912
3913         * format.h: (macro MAX_FORMATTED_LEN) New macro.
3914
3915         * list.q: (list_cases) Update for new data_out() semantics.
3916
3917         * print.c: (print_trns_proc) Ditto.
3918
3919         * tab.c: (tab_value) Ditto.
3920         (tab_float) Avoid stupid cast.
3921
3922         * var.h: Update comments.
3923         (macro MAX_STRING) New macro.
3924         (macro MAX_ELEMS_PER_VALUE) New macro.
3925
3926         * vars-atr.c: (compare_values) New function.
3927
3928         * vfm.c: (dump_splits) Update for new data_out() semantics.
3929
3930 Mon Feb 16 21:45:47 2004  Ben Pfaff  <blp@gnu.org>
3931
3932         * crosstabs.q: (struct table_entry) Rename v[] to values[].  All
3933         references updated.
3934         (struct crosstab) Rename v[] to vars[].  All references updated.
3935         (hash_table_entry) Replace the hash algorithm and fix a bug at the
3936         same time, which caused the hash value to depend only on a single
3937         value, not all of the variables' values.
3938         
3939 Mon Feb 16 12:49:53 2004  Ben Pfaff  <blp@gnu.org>
3940
3941         Clean up struct dictionary's value_cnt usage.
3942
3943         * dictionary.c: Add a function comment to each function.
3944         (struct dictionary) Rename value_cnt to next_value_idx, which more
3945         accurately reflects its meaning.  All references updated.
3946         (dict_rename_vars) Add assertion.
3947         (dict_get_value_cnt) Rename dict_get_next_value_idx().  All
3948         references updated.
3949         (dict_get_case_size) New function.
3950
3951         * aggregate.c: (create_sysfile) Use dict_get_case_size().
3952
3953         * get.c: (mtf_read_nonactive_records) Ditto.
3954
3955         * sort.c: (allocate_cases) Ditto.
3956         (write_initial_runs) Ditto.
3957         (merge) Ditto.
3958         (merge_once) Ditto.
3959
3960         * vfm.c: (prepare_for_writing) Ditto.
3961         (setup_lag) Ditto.
3962         (lag_case) Ditto.
3963
3964 Mon Feb 16 00:17:55 2004  Ben Pfaff  <blp@gnu.org>
3965
3966         Make vfm.c slightly less grotesque.
3967
3968         * vfm.c: (filter_var) Removed.
3969         (filter_index) Removed.
3970         (FILTERED macro) Removed.
3971         (exclude_this_case) New function.
3972         (process_active_file_write_case) Use exclude_this_case() instead
3973         of FILTERED and inline tests.
3974         (procedure_write_case) Ditto.
3975         (setup_filter) Removed.
3976         (open_active_file) Don't call setup_filter().
3977         (close_active_file) Call dict_get_filter() instead of checking
3978         filter_var.
3979
3980 Mon Feb 16 00:01:53 2004  Ben Pfaff  <blp@gnu.org>
3981
3982         * var.h: (struct variable) Update comments.
3983
3984 Sun Feb 15 23:14:59 2004  Ben Pfaff  <blp@gnu.org>
3985
3986         New functions dict_create_var_assert(), dict_lookup_var_assert().
3987         Converted several dict_*_var()/assert pairs into a single
3988         dict_*_var_assert().
3989
3990         * dictionary.c: (dict_create_var_assert) New function.
3991         (dict_lookup_var_assert) New function.
3992
3993 Sun Feb 15 23:06:08 2004  Ben Pfaff  <blp@gnu.org>
3994
3995         Got rid of "struct long_vec", envector(), devector(), etc.  Added
3996         two members `init', `reinit' to struct variable as a substitute.
3997         
3998         * Makefile.am: (pspp_SOURCES) Removed cases.c, cases.h.
3999         
4000         * cases.c: Removed.
4001
4002         * cases.h: Removed.
4003
4004         * aggregate.c: (parse_aggregate_functions) destvar doesn't need
4005         init.
4006
4007         * autorecode.c: (cmd_autorecode) destvars don't need init.
4008
4009         * compute.c: (lvalue_finalize) Set reinit.
4010
4011         * data-list.c: (fixed_parse_compatible) Don't need init usually.
4012         (dump_fmt_list) Ditto.
4013         (parse_free) Ditto.
4014
4015         * descript.q: (run_z_pass) Don't need init for z-scores.
4016
4017         * dictionary.c: (dict_create_var) Initialize `init', `reinit'
4018         members.
4019         (dict_clone_var) Copy `reinit' member, initialize `init' member.
4020
4021         * glob.c: (init_glob) Remove vec_init() calls.
4022
4023         * inpt-pgm.c: (cmd_end_input_program) Use `reinit', not `left'.
4024         
4025         * loop.c: (internal_cmd_loop) Don't need to call envector().
4026
4027         * numeric.c: (cmd_numeric) Ditto.
4028         (cmd_string) Ditto.
4029         (cmd_leave) Ditto.  Set `init', `reinit' members.
4030
4031         * recode.c: (cmd_recode) Don't need to call envector().
4032
4033         * repeat.c: (internal_cmd_do_repeat) Ditto.
4034
4035         * var.h: (struct variable) Remove `left'.  Add `init', `reinit'.
4036         (force_create_variable) Removed prototype.
4037         (force_dup_variable) Ditto.
4038
4039         * vector.c: (cmd_vector) Don't need to call envector().
4040
4041         * vfm.c: (reinit_sysmis) Removed.
4042         (reinit_blanks) Removed.
4043         (init_zero) Removed.
4044         (init_blanks) Removed.
4045         (process_active_file_write_case) No need to deal with vectors.
4046         Call clear_temp_case().
4047         (vector_initialization) Rewrite to use `init', `reinit'.
4048         (close_active_file) No need to call vec_clear().
4049         (procedure_write_case) Call clear_temp_case().
4050         (clear_temp_case) New function.
4051
4052 Sun Feb 15 20:50:36 2004  Ben Pfaff  <blp@gnu.org>
4053
4054         * pfm-write.c: (bufwrite) Get rid of nasty cast that also invoked
4055         undefined behavior.
4056
4057 Thu Feb 12 23:35:15 2004  Ben Pfaff  <blp@gnu.org>
4058
4059         Add auxiliary argument to procedure() interface.  Associated small
4060         clean-ups of vfm interface.
4061         
4062         * Updated every caller of procedure() and process_active_file() to
4063         reflect modified interface.  Simple, ordinary changes not listed
4064         otherwise below.
4065
4066         * Updated every function that implements struct case_stream's
4067         `read' function to take a write_case_func and a write_case_data.
4068         Also updated every caller of write_case() to instead call them
4069         through these arguments.  In some cases this meant that the extra
4070         args had to be threaded through a couple of extra levels.  This
4071         wasn't difficult or interesting so the details won't be given.
4072
4073         * data-list.c: (struct repeating_data_trns) Add members
4074         `write_case', `wc_data' as kluge.
4075         (read_one_set_of_repetitions) Rename repeating_data_trns_proc and
4076         make non-static.
4077         (repeating_data_set_write_case) New function.
4078
4079         * data-list.h: New file to declare repeating_data_trns_proc() and
4080         repeating_data_set_write_case().
4081
4082         * inpt-pgm.c: (input_program_source_read) Call
4083         repeating_data_set_write_case() for all the REPEATING DATA
4084         transformations, so that they know where to send their cases.
4085         It's a big kluge.  Also kluge in END CASE.
4086         (end_case_trns_proc) Never called anymore, but we still need it,
4087         so just assert(0).
4088
4089         * sort.c: (read_sort_output) Update to match struct case_stream
4090         `read' member.
4091
4092         * vfm.c: (struct write_case_data) New structure.
4093         (proc_func) Removed.
4094         (virt_proc_func) Removed.
4095         (begin_func) Removed.
4096         (virt_begin_func) Removed.
4097         (end_func) Removed.
4098         (write_case) Removed.
4099         (procedure) Added an auxiliary parameter to each function pointer
4100         argument's prototype.  Added an auxiliary data parameter.
4101         Rewrote.
4102         (process_active_file) Ditto.
4103         (process_active_file_write_case) Pass aux data along.
4104         (close_active_file) Ditto.
4105         (procedure_write_case) Ditto.
4106         (SPLIT_FILE_procfunc) Ditto.
4107
4108         * vfm.h: (typedef write_case_data) New.
4109         (typedef write_case_func) New.
4110         (struct case_stream) Add parameters to `read' member prototype.
4111         
4112 Thu Feb 12 19:24:53 WST 2004 John Darrington <john@darrington.wattle.id.au>
4113
4114         * t-test.q:  Added calculations for independent samples. (But no Levene
4115         test yet!)
4116
4117         * Makefile.am: Moved q_sources_c into own variable 
4118
4119 Wed Feb 11 23:56:51 2004  Ben Pfaff  <blp@gnu.org>
4120
4121         Miscellaneous cleanups.
4122         
4123         * Change unused to UNUSED in many source files to reflect modified
4124         pref.h.  Change use of __WIN32__, __MSDOS, __DJGPP__,
4125         __CYGWIN32__, __unix__, and unix not to assume that they're
4126         defined to a nonzero value.  Change use of __attribute__ to use
4127         NO_RETURN or PRINTF_FORMAT instead.
4128         
4129         * alloc.h: Move definitions for local_alloc(), local_free() here
4130         from ../pref.h.orig and simplify.
4131
4132         * expr-evl.c: Instead of working differently based on PAGED_STACK,
4133         use a pool allocator unconditionally.
4134         (CHECK_STRING_SPACE) Removed.
4135         (ALLOC_STRING_SPACE) Removed.
4136         (expr_evaluate) Use e->pool instead of CHECK_STRING_SPACE and
4137         ALLOC_STRING_SPACE.
4138
4139         * expr-opt.c: (dump_expression) Allocate string pool.
4140
4141         * expr-prs.c: (expr_free) Free string pool.
4142
4143         * pool.c: (pool_destroy) This pool must be removed from its
4144         parent's list of gizmos, not from its own.  Use free_all_gizmos().
4145         (pool_clear) New function.
4146         (free_all_gizmos) New function.
4147         (pool_alloc) Use space in empty block after this one if any.
4148         (pool_release) Only empty out blocks, don't actually free() them.
4149
4150         * print.c: Get rid of PAGED_STACK special case by always
4151         dynamically allocating line buffers.
4152         (struct print_trns) Always include the `line' member.
4153         (internal_cmd_print) Always initialize the `line' member.
4154         (alloc_line) Always allocate memory for `line'.
4155         (print_trns_proc) Always initialize buf from `line' member.
4156         (print_trns_free) Always free `line' memory.
4157
4158         * sort.c: (allocate_file_handles) Special-case MS-DOS for mkdir()
4159         call.
4160         
4161 Wed Feb 11 20:33:18 2004  Ben Pfaff  <blp@gnu.org>
4162
4163         * flip.c: Fixed crash from FLIP when a numeric variable is
4164           specified on NEWNAMES and a large value is used, and a couple of
4165           other minor bugs besides.
4166           (struct varname) Make name a 9-character fixed-size array
4167           instead of a 1-character variable size array.
4168           (make_new_var) Allow digits in variable names.
4169           (flip_stream_write) Limit numeric values to 8 characters and
4170           format system missing and very large and small values more
4171           appropriately.
4172
4173 Thu Feb  5 13:19:06 WAST 2004 John Darrington <john@darrington.wattle.id.au>
4174
4175         * command.c: Fixed test on command return status for the correct 
4176           value,  which had been causing a crash under certain invalid input.
4177
4178 Wed Feb  4 15:34:11 WST 2004 John Darrington <john@darrington.wattle.id.au>
4179
4180         * t-test.q: Added calculations for the one sample variant of the T-TEST
4181
4182 Tue Feb  3 20:09:54 2004  Ben Pfaff  <blp@gnu.org>
4183
4184         * tab.c: (render_strip) Fix bug that sometimes caused joined text
4185           in joined cells to be rendered outside box boundaries.
4186
4187 Tue Feb  3 18:56:45 WST 2004 John Darrington <john@darrington.wattle.id.au>
4188
4189         * random.c (rng_create): Fixed seeding so that it gets reseeded after
4190         SET seed=xx has been called.
4191
4192 Mon Jan 19 14:08:09 2004  Ben Pfaff  <blp@gnu.org> 
4193
4194         * random.c (rng_get_double): Fix always-returning-zero bug in my
4195         preferred way, and at the same time make sure rounding doesn't
4196         bite us.
4197
4198 Thu Jan  1 23:16:41 2004  Ben Pfaff  <blp@gnu.org>
4199
4200         * html.c: (change_attributes) Dead code, removed.
4201         (escape_string) Eliminate code to call change_attributes() that
4202         never actually called it.
4203         (output_tab_table) Get rid of dependence on tab_hit
4204         and struct tab_joined_cell's hit member, which are abominations.
4205
4206         * tab.c: (tab_output_text) Don't call
4207         d->class->text_set_font_by_name if it's a null pointer.
4208         (macro UNROLL_LOOP) Eliminate.
4209         (macro UNROLL_3_LOOPS) Eliminate.
4210         (tabi_render) Rewrite not to use the above macros.
4211
4212 Thu Jan  1 23:09:07 2004  Ben Pfaff  <blp@gnu.org>
4213
4214         Start working on a new output driver system, one that doesn't suck
4215         so much, by adding a "device-independent" output driver.  The idea
4216         is to write out only a single output stream, then use separate
4217         processes to translate them into whatever formats we want.  This
4218         is similar to how "groff" works with its various output drivers
4219         (grops, grotty, grodvi, ...).
4220         
4221         * Makefile.am: (pspp_SOURCES) Add devind.c, devind.h.
4222
4223         * list.q: (write_all_headers) Stub out devind class.
4224         (clean_up) Ditto.
4225         (determine_layout) Ditto.
4226         (list_cases) Ditto.
4227
4228         * output.c: (outp_init) Add devind class.
4229
4230         * devind.c: New file.
4231
4232         * devind.h: New file.
4233
4234 Thu Jan  1 23:08:14 2004  Ben Pfaff  <blp@gnu.org>
4235
4236         * frequencies.q: (hash_value_alpha) Fixed up the previous change
4237         to use the proper string length.
4238
4239 Wed Dec 31 16:27:33 WAST 2003 John Darrington <john@darrington.wattle.id.au>
4240
4241         * Fixed bug where FREQ would crash on alpha values
4242
4243 Tue Dec 30 22:42:57 2003  Ben Pfaff  <blp@gnu.org>
4244
4245         * Removed bletcherous alloca() workarounds for AIX from top of
4246         many files.  AIX can use the alternative alloca() implementation
4247         instead.
4248
4249 Tue Dec 30 22:35:16 2003  Ben Pfaff  <blp@gnu.org>
4250
4251         * ascii.c: (ascii_option) Fix implementation of headers option.
4252
4253 Tue Dec 30 22:32:53 2003  Ben Pfaff  <blp@gnu.org>
4254
4255         * ascii.c: Add a "squeeze" option to the ASCII driver to squeeze
4256         multiple blank lines into one.
4257         (struct ascii_driver_ext) Add squeeze_blank_lines option.
4258         (ascii_preopen_driver) Initialize squeeze_blank_lines.
4259         (static var option_tab) Add squeeze entry.
4260         (ascii_option) Set squeeze_blank_lines.
4261         (output_lines) Implement squeezing blank lines.
4262
4263 Wed Dec 31 07:19:46 WST 2003 John Darrington <john@darrington.wattle.id.au>
4264
4265         * Removed redundant code from output.h
4266
4267 Sat Dec 27 22:17:52 2003  Ben Pfaff  <blp@gnu.org>
4268
4269         Dictionary classes: each variable is "ordinary", "system", or
4270         "scratch".
4271
4272         * var.h: (enum dict_class) New enum.
4273
4274         * vars-prs.c: (dict_class_from_id) New function.
4275         (dict_class_to_name) New function.
4276
4277 Sat Dec 27 22:16:06 2003  Ben Pfaff  <blp@gnu.org>
4278
4279         * var.h: (struct freq_tab_set) Removed (not used).
4280
4281 Sat Dec 27 22:15:21 2003  Ben Pfaff  <blp@gnu.org>
4282
4283         * value-labels.c: (val_labs_destroy) vls needs to be freed too.
4284
4285 Sat Dec 27 22:10:49 2003  Ben Pfaff  <blp@gnu.org>
4286
4287         * stats.c: (hypercube) Rename pow4().  All references updated.
4288
4289 Sat Dec 27 22:05:49 2003  Ben Pfaff  <blp@gnu.org>
4290
4291         * rename-vars.c: (cmd_rename_variables) Rewritten.
4292         (compare_name) Removed.
4293
4294 Sat Dec 27 22:03:51 2003  Ben Pfaff  <blp@gnu.org>
4295
4296         var_set feature, and code taking advantage of it.
4297         
4298         * crosstabs.q: (static var var_dict) Removed.
4299         (static var variables) New variable.
4300         (static var variables_cnt) New variable.
4301         (cmd_crosstabs) Free variables instead of var_dict.
4302         (internal_cmd_crosstabs) Initialize and use variables,
4303         variables_cnt instead of var_dict.
4304         (free_var_dict) Removed.
4305         (crs_custom_tables) Use var_set instead of a copied dictionary.
4306         (crs_custom_variables) Set up variables, variables_cnt instead of
4307         var_dict.
4308         [DEBUGGING] (debug_print) Ditto.
4309
4310         * means.q: (mns_custom_tables) Use var_set instead of a copied
4311         dictionary.
4312
4313         * vars-prs.c: (parse_vs_variable) New function.
4314         (parse_dict_variable) Rewritten.
4315         (parse_variable) Rewritten.
4316         (parse_variables) Renamed parse_var_set_vars(), rewritten.
4317         (parse_variables) New function in terms of parse_var_set_vars().
4318         Now requires its first argument to be non-null.  All references
4319         that passed a null pointer updated to pass default_dict instead.
4320         (macro id_dict) Removed.
4321         (parse_DATA_LIST_vars) Add assertions.
4322         (parse_mixed_vars) Ditto.
4323         (struct var_set) New structure.
4324         (var_set_get_cnt) New function.
4325         (var_set_get_var) New function.
4326         (var_set_lookup_var) New function.
4327         (var_set_destroy) New function.
4328         (dict_var_set_get_cnt) New function.
4329         (dict_var_set_get_var) New function.
4330         (dict_var_set_lookup_var) New function.
4331         (dict_var_set_destroy) New function.
4332         (var_set_create_from_dict) New function.
4333         (struct array_var_set) New structure.
4334         (array_var_set_get_cnt) New function.
4335         (array_var_set_get_var) New function.
4336         (array_var_set_lookup_var) New function.
4337         (array_var_set_destroy) New function.
4338         (var_set_create_from_array) New function.
4339
4340         * q2c.c: (dump_parser) Use parse_variables(default_dict, ...)
4341         instead of parse_variables(NULL, ...) in output code.
4342
4343 Sat Dec 27 21:38:53 2003  Ben Pfaff  <blp@gnu.org>
4344
4345         Change inp_init from a 2-bit vector to an ordinary array.
4346         Initialize it all in cmd_end_input_program() instead of in
4347         create_variable().
4348
4349         * inpt-pgm.c: (enum value_init_type) New enum.
4350         (global var inp_init) Change to `enum value_init_type *', make
4351         static.
4352         (inp_init_size) Removed.
4353         (inp_nval) Change to `size_t', make static.
4354         (cmd_input_program) Don't initialize inp_init or inp_init_size.
4355         (cmd_end_input_program) Initialize inp_init, inp_nval.
4356         (init_case) Rewrite.
4357         (clear_case) Rewrite.
4358
4359         * inpt-pgm.h: Removed.
4360
4361 Sat Dec 27 21:36:38 2003  Ben Pfaff  <blp@gnu.org>
4362
4363         * hash.c: (hsh_hash_bytes) Use Fowler-Noll-Vo hash instead of
4364         Colin Plumb hash.  It is simpler and should better resist
4365         collisions.
4366         (hsh_hash_string) Ditto.
4367
4368 Sat Dec 27 21:34:57 2003  Ben Pfaff  <blp@gnu.org>
4369
4370         * get.c: (export_write_case_func) Remove debug printing code.
4371
4372 Sat Dec 27 21:11:09 2003  Ben Pfaff  <blp@gnu.org>
4373
4374         * get.c: (cmd_save_internal) Rename parameter.  Use &t->h instead
4375         of cast.
4376         (save_write_case_func) Use &trns->h instead of cast.
4377         (cmd_export) Use &t->h instead of cast.
4378
4379 Sat Dec 27 20:57:42 2003  Ben Pfaff  <blp@gnu.org>
4380
4381         Moved vectors into the dictionary.
4382
4383         * var.h: (struct vector) Moved here from vector.h.  `index' member
4384         renamed `idx', `v' renamed `var', `nv' renamed `cnt'.  All
4385         references updated.
4386         
4387         * vector.h: Removed.
4388
4389         * vector.c: (global var vec) Removed.
4390         (global var nvec) Removed.
4391         (cmd_vector) Rewritten.
4392         (find_vector) Removed.
4393
4394         * dictionary.c: (dict_create_vector) New function.
4395         (dict_get_vector) New function, replaces reading global vec[]
4396         array.
4397         (dict_get_vector_cnt) New function, replaces reading global nvec
4398         variable.
4399         (dict_lookup_vector) New function, replaces find_vector().
4400         (dict_clear_vectors) New function.
4401
4402 Sat Dec 27 20:54:01 2003  Ben Pfaff  <blp@gnu.org>
4403
4404         Start to move away from `struct variable' p `union' member to void
4405         * aux member.
4406
4407         * var.h: (struct variable) Add `aux' member.
4408
4409 Sat Dec 27 20:36:25 2003  Ben Pfaff  <blp@gnu.org>
4410
4411         Get rid of struct variable `foo' member.
4412
4413         * frequencies.q: (internal_cmd_frequencies) Use p.frq.used instead
4414         of foo.
4415         (frq_custom_variables) Ditto.
4416         (frq_custom_grouped) Ditto.
4417
4418         * get.c: (struct save_trns) Change `var' member from `int *' to
4419         `struct variable **'.
4420         (cmd_save_internal) Use aux instead of foo.
4421         (save_trns_proc) Use revised `var' member.
4422         (static var mtf_seq_no) Renamed mtf_seq_num.
4423         (static var mtf_seq_nums) New static var.
4424         (cmd_match_files) Initialize mtf_seq_nums.
4425         (mtf_free) Free mtf_seq_nums.
4426         (mtf_processing) Use mtf_seq_nums instead of foo.
4427         (mtf_merge_dictionary) No need to initialize mv->foo.
4428         (cmd_export) Use aux instead of foo.  Use revised `var' member.
4429         (mns_custom_tables) Don't use foo to check for duplicates, that's
4430         what PV_NO_DUPLICATE is for.
4431
4432         * var.h: (struct variable) Remove `foo' member.
4433         (struct frequencies_proc) New member.
4434         
4435 Sat Dec 27 19:46:13 2003  Ben Pfaff  <blp@gnu.org>
4436
4437         Clean up COMPUTE and IF.
4438
4439         * compute.c: More or less rewrite the darn thing.
4440         (struct compute_trns) Rename and reorder and add and delete
4441         members.
4442         (cmd_compute) Rewrite.
4443         (compute_num) Make conditional on test expression.  Now used for
4444         both COMPUTE and IF.
4445         (compute_num_vec) Ditto.
4446         (compute_str) Ditto.
4447         (compute_str_vec) Ditto.
4448         (cmd_if) Rewrite.
4449         (if_num) Removed.
4450         (if_num_vec) Removed.
4451         (if_str) Removed.
4452         (if_str_vec) Removed.
4453         (parse_target_expression) Renamed parse_rvalue_expression(),
4454         rewritten.
4455         (new_trns) Renamed compute_trns_create(), rewritten.
4456         (delete_trns) Removed.
4457         (free_trns) Renamed compute_trns_free(), rewritten.
4458         (struct lvalue) New structure.
4459         (parse_var_or_vec) Renamed lvalue_parse(), rewritten.
4460         (lvalue_get_type) New function.
4461         (lvalue_is_vector) New function.
4462         (lvalue_finalize) New function.
4463         (lvalue_destroy) New function.
4464         
4465 Sat Dec 27 19:44:14 2003  Ben Pfaff  <blp@gnu.org>
4466
4467         * command.def: Disallow MODIFY VARS in input mode, so that
4468         variables can't get dropped and confuse cmd_end_input_program()'s
4469         attempt to fill inp_init[].
4470         
4471         * modify-vars.c: (static var forward_positional_ordering) New
4472         variable.
4473         (struct var_modification) Entirely changed.
4474         (rearrange_dict) Interface changed, rewritten.
4475         (cmd_modify_vars) Deal with modified struct var_modification, much
4476         rewritten.
4477         (struct var_renaming) New structure.
4478         (compare_var_renaming_by_new_name) New function.
4479         (validate_var_modification) New function.
4480
4481         * var.h: (struct modify_vars_proc) Removed.
4482         (struct variable) Removed member p.mfv.
4483
4484 Sat Dec 27 19:40:26 2003  Ben Pfaff  <blp@gnu.org>
4485
4486         Make EVALUATE a valid command whether we're debugging or not, so
4487         that `make check' can succeed regardless of whether debugging is
4488         turned on.
4489         
4490         * command.def: [GLOBAL_DEBUGGING] Drop the #if.
4491
4492         * compute.c: [GLOBAL_DEBUGGING] (cmd_evaluate) Drop the #if.
4493
4494 Sat Dec 27 19:34:40 2003  Ben Pfaff  <blp@gnu.org>
4495
4496         * apply-dict.c: (cmd_apply_dictionary) Replace a ghastly switch
4497         statement by a simple if test.
4498
4499         * dfm.c: (dfm_get_record) Add assertion.
4500
4501 Sat Dec 27 17:51:26 2003  Ben Pfaff  <blp@gnu.org>
4502
4503         For each file x.c, move #include "x.h" to the very top of the
4504         include list, to catch x.h failing to include the proper headers.
4505
4506 Sat Dec 27 17:50:19 2003  Ben Pfaff  <blp@gnu.org>
4507
4508         * algorithm.c: (find) New function.
4509         (remove_equal) New function.
4510         (set_difference) New function.
4511         (adjacent_find_equal) New function.
4512         [TEST_UNIQUE] Removed test case.
4513         (copy_if) Find end test.
4514
4515 Sat Dec 27 17:42:45 2003  Ben Pfaff  <blp@gnu.org>
4516
4517         * dictionary.c: (dict_get_case_weight) New convenience function.
4518
4519         * aggregate.c: (accumulate_aggregate_info) Use
4520         dict_get_case_weight().
4521
4522         * frequencies.q: (calc_general) Ditto.
4523         (calc_integer) Ditto.
4524         (calc) Ditto.
4525
4526         * t-test.q: (groups_calc) Ditto.
4527         (z_calc) Ditto.
4528
4529 Sat Dec 27 17:29:45 2003  Ben Pfaff  <blp@gnu.org>
4530
4531         * glob.c: (global var default_dict) Change from `struct
4532         dictionary' to `struct dictionary *'.  All references changed.
4533         (init_glob) Initialize default_dict with dict_create().
4534
4535 Sat Dec 27 17:06:06 2003  Ben Pfaff  <blp@gnu.org>
4536
4537         struct dictionary now made opaque.  All related functions:
4538
4539         * get.c: (rename_variables) Removed.
4540         (dict_delete_run) Removed.
4541         
4542         * temporary.c: (copy_variable) Removed.
4543         (new_dictionary) Removed.
4544         (save_dictionary) Removed.
4545         (restore_dictionary) Removed.
4546         (free_dictionary) Removed.
4547
4548         * vars-atr.c: (clear_default_dict) Removed.
4549         (find_variable) Removed.
4550         (find_dict_variable) Removed.
4551         (create_variable) Removed.
4552         (delete_variable) Removed.
4553         (common_init_stuff) Removed.
4554         (init_variable) Removed.  Updating of inp_init moved into
4555         cmd_end_input_program().
4556         (replace_variable) Removed.
4557         (rename_variable) Removed.
4558         (clear_variable) Removed.
4559         (dup_variable) Removed.
4560
4561         * vars-prs.c: (is_varname) Removed.
4562         (is_dict_varname) Removed.
4563         (fill_all_vars) Removed.
4564
4565         * vector.c: (find_vector) Removed.
4566
4567         * weight.c: (stop_weighting) Removed.
4568
4569         * dictionary.c: New file.
4570         (dict_create) New, replaces new_dictionary().
4571         (dict_clone) New, replaces save_dictionary() and
4572         restore_dictionary().
4573         (dict_clear) New, replaces clear_default_dict().
4574         (dict_destroy) New, replaces free_dictionary().
4575         (dict_get_var_cnt) New function, replaces references to
4576         dict->nvar.
4577         (dict_get_var) New function, replaces references to dict->var[i].
4578         (dict_get_vars) New function, replaces fill_all_vars().
4579         (dict_create_var) New, replaces create_variable().  Interface
4580         drops `type' parameter, using a zero `width' to designate numeric.
4581         (dict_clone_var) New, replaces dup_variable().
4582         (dict_rename_var) New, replaces rename_variable().
4583         (dict_lookup_var) New, replaces find_variable(),
4584         find_dict_variable(), is_varname().
4585         (dict_contains_var) New function.
4586         (compare_variable_dblptrs) New function.
4587         (dict_delete_var) New function, replaces clear_variable().
4588         (dict_delete_vars) New function, replaces dict_delete_run().
4589         (dict_reorder_vars) New function.
4590         (dict_rename_vars) New function, replaces rename_variables().
4591         (dict_get_weight) New function, replaces reading dict->weight_var.
4592         (dict_set_weight) New function, replaces writing dict->weight_var
4593         or calling stop_weight(dict).
4594         (dict_get_filter) New function, replaces reading dict->filter_var.
4595         (dict_set_filter) New function, replaces writing dict->filter_var.
4596         (dict_get_case_limit) New function, replaces reading dict->N.
4597         (dict_set_case_limit) New function, replaces writing dict->N.
4598         (dict_get_value_cnt) New function, replaces reading dict->nval.
4599         (dict_compact_values) New function, replaces a loop that was
4600         replicated in several places.
4601         (dict_get_split_vars) New function, replaces reading dict->splits.
4602         (dict_get_split_cnt) New function, replaces reading
4603         dict->n_splits.
4604         (dict_set_split_vars) New function, replaces writing dict->splits.
4605         (dict_get_label) New function, replaces reading dict->label.
4606         (dict_set_label) New function, replaces writing dict->label.
4607         (dict_get_documents) New function, replaces reading
4608         dict->documents.
4609         (dict_set_documents) New function, replaces writing
4610         dict->documents.
4611         
4612         All references to above functions updated.
4613         
4614         * aggregate.c: (cmd_aggregate) Copy file label and documents from
4615         old dictionary to new by hand, because dict_create() can't do it
4616         itself.  Use dict_set_documents(), dict_set_split_vars().
4617
4618         * temporary.c: (cancel_temporary) Also set temp_dict to NULL after
4619         calling dict_destroy().
4620
4621         * data-list.c: (dls_var_spec) Remove `type' member, replace by
4622         `width'.
4623         (fixed_parse_compatible) Some slightly nontrivial changes for
4624         dict_create_var().
4625         (dump_fmt_list) Ditto.
4626         (parse_free) Ditto.
4627
4628         * file-type.c: (create_col_var) Ditto.
4629
4630         * get.c: (cmd_get) Use dict_compact_values() instead of a loop.
4631         (trim_dictionary) Use dict_delete_vars(), dict_reorder_vars().
4632         (rename_variables) Use dict_rename_vars().
4633         (mtf_merge_dictionary) Use dict_get_documents(),
4634         dict_set_documents(), dict_compact_values().
4635
4636         * pfm-read.c: (read_variables) Deal with changes to weighting.
4637
4638         * q2c.c: (dump_parser) Use dict_lookup_var() instead of
4639         is_varname() in output code.
4640
4641         * sfm-read.c: (read_header) Use dict_create(), dict_set_label(),
4642         other dictionary functions.
4643
4644         * title.c: (add_document_line) Use dict_get_documents(),
4645         dict_set_documents().
4646
4647         * vars-atr.c: (discard_variables) Use dict_clear(default_dict),
4648         reset default_handle by hand.  dict_clear() will clear vectors so
4649         there's no need for that by hand.
4650
4651         * vfm.c: (close_active_file) Move call to finish_compaction()
4652         earlier, so that we can do the compaction as a single step using
4653         dict_compact_values().  Use dict_clear_vectors().
4654         (finish_compaction) Use dict_delete_var(), dict_compact_values().
4655                 
4656         Some functions don't have replacements:
4657
4658         * vars-atr.c: (force_create_variable) Removed.  All references
4659         updated to dict_create_var() followed by an assertion.
4660         (force_dup_variable) Removed.  All references updated to
4661         dict_clone_var() followed by an assertion.
4662         
4663         * weight.c: (update_weighting) Removed.  No longer necessary, so
4664         all references removed.
4665
4666 Sat Dec 27 16:43:01 2003  Ben Pfaff  <blp@gnu.org>
4667
4668         Clean up AGGREGATE.
4669         
4670         * aggregate.c: Eliminate separation of weighted and unweighted
4671         case.  It made the code too obscure and I doubt it was actually
4672         faster.  Instead, all code uses the "weighted" code, because
4673         that's a generalization of the "unweighted" code.
4674         (FWEIGHT) Removed.
4675         (FOPTIONS) Ditto.
4676         (parse_aggregate_functions) No need to set FWEIGHT.
4677         (accumulate_aggregate_info) Get rid of FWEIGHT cases.
4678         (dump_aggregate_info) Ditto.
4679         (initialize_aggregate_info) No need for special plain_function
4680         that gets rid of FWEIGHT option.
4681
4682         * aggregate.c: Get rid of approximations.
4683         (accumulate_aggregate_info) Don't use approx_gt(), approx_lt(),
4684         approx_in_range().
4685         (aggregate_single_case) Don't use approx_ne().
4686
4687 Sat Dec 27 16:19:36 2003  Ben Pfaff  <blp@gnu.org>
4688
4689         * ascii.c (ascii_line_width): Dead code, removed.
4690
4691         * postscript.c (ps_line_width): Ditto.
4692
4693         * q2c.c (xrealloc): Ditto.
4694
4695         * count.c (internal_cmd_count): Ditto.
4696
4697         * means.q (validate_dependent_endpoint): Ditto.
4698
4699         * set.q: (cmd_gset) Ditto.
4700
4701         * weight.c: [0] (weight_trns_proc) Ditto.
4702
4703 Sat Dec 27 16:18:16 2003  Ben Pfaff  <blp@gnu.org>
4704
4705         Make the code -Wmissing-prototypes clean.
4706
4707         * Makefile.am (version.c): Add #include "version.h".
4708         
4709         * ascii.c: (ascii_open_global) Make static.
4710         (ascii_close_page) Ditto.
4711         (ascii_font_sizes) Ditto.
4712         (ascii_postopen_driver) Ditto.
4713         (ascii_close_driver) Ditto.
4714         (ascii_option) Ditto.
4715         (ascii_open_page) Ditto.
4716         (ascii_line_horz) Ditto.
4717         (ascii_line_vert) Ditto.
4718         (ascii_line_intersection) Ditto.
4719         (ascii_box) Ditto.
4720         (ascii_polyline_begin) Ditto.
4721         (ascii_polyline_point) Ditto.
4722         (ascii_polyline_end) Ditto.
4723         (ascii_text_set_font_by_name) Ditto.
4724         (ascii_text_set_font_by_position) Ditto.
4725         (ascii_text_set_font_by_family) Ditto.
4726         (ascii_text_get_font_name) Ditto.
4727         (ascii_text_get_font_family) Ditto.
4728         (ascii_text_set_size) Ditto.
4729         (ascii_text_get_size) Ditto.
4730         (ascii_text_metrics) Ditto.
4731         (ascii_text_draw) Ditto.
4732         (ascii_close_page) Ditto.
4733
4734         * cmdline.h: New header for parse_command_line().  Used where
4735         needed.
4736
4737         * command.c: Move prototypes for cmd_*() functions to command.h.
4738
4739         * command.h: Prototypes for cmd_*() functions moved here from
4740         command.c.
4741
4742         * crosstabs.q: (gamma_int) Ditto.
4743
4744         * file-handle.h: Add fh_init_files() prototype.
4745         
4746         * getline.c: (welcome) Ditto.
4747
4748         * glob.h: New header for init_glob().  Used where appropriate.
4749
4750         * hash.c: (comparison_helper) Ditto.
4751
4752         * html.c: (html_open_global) Ditto.
4753         (html_close_global) Ditto.
4754         (html_preopen_driver) Ditto.
4755         (html_postopen_driver) Ditto.
4756         (html_close_driver) Ditto.
4757         (html_option) Ditto.
4758         (html_open_page) Ditto.
4759         (html_close_page) Ditto.
4760         (html_submit) Ditto.
4761
4762         * inpt-pgm.c: (input_program_source_read) Ditto.
4763
4764         * output.c: (find_defn_value) Ditto.
4765         (destroy_list) Ditto.
4766
4767         * pfm-read.c: (read_int) Ditto.
4768
4769         * postscript.c: (ps_open_global) Ditto.
4770         (ps_close_global) Ditto.
4771         (ps_font_sizes) Ditto.
4772         (ps_preopen_driver) Ditto.
4773         (ps_postopen_driver) Ditto.
4774         (ps_close_driver) Ditto.
4775         (ps_option) Ditto.
4776         (ps_open_page) Ditto.
4777         (ps_close_page) Ditto.
4778         (ps_line_horz) Ditto.
4779         (ps_line_vert) Ditto.
4780         (ps_line_intersection) Ditto.
4781         (ps_box) Ditto.
4782         (ps_polyline_begin) Ditto.
4783         (ps_polyline_point) Ditto.
4784         (ps_polyline_end) Ditto.
4785         (ps_text_set_font_by_name) Ditto.
4786         (ps_text_set_font_by_position) Ditto.
4787         (ps_text_set_font_family) Ditto.
4788         (ps_text_get_font_name) Ditto.
4789         (ps_text_get_font_family) Ditto.
4790         (ps_text_set_size) Ditto.
4791         (ps_text_get_size) Ditto.
4792         (ps_text_metrics) Ditto.
4793         (ps_text_draw) Ditto.
4794
4795         * q2c.c: (finish_up) Ditto.
4796         (xmalloc) Ditto.
4797         (xstrdup) Ditto.
4798         (get_buffer) Ditto.
4799         (st_lower) Ditto.
4800         (st_upper) Ditto.
4801         (skip_ws) Ditto.
4802         (get_line) Ditto.
4803         (add_symbol) Ditto.
4804         (find_symbol) Ditto.
4805         (lex_get) Ditto.
4806         (force_id) Ditto.
4807         (force_string) Ditto.
4808         (match_id) Ditto.
4809         (match_token) Ditto.
4810         (skip_token) Ditto.
4811         (parse) Ditto.
4812         (parse_setting) Ditto.
4813         (parse_specifier) Ditto.
4814         (parse_specifiers) Ditto.
4815         (parse_subcommand) Ditto.
4816         (dump_specifier_vars) Ditto.
4817         (is_keyword) Ditto.
4818         (make_identifier) Ditto.
4819         (dump_declarations) Ditto.
4820         (dump_specifier_init) Ditto.
4821         (dump_vars_init) Ditto.
4822         (make_match) Ditto.
4823         (dump_specifier_parse) Ditto.
4824         (dump_subcommand) Ditto.
4825         (dump_parser) Ditto.
4826         (dump_header) Ditto.
4827         (dump_free) Ditto.
4828         (recognize_directive) Ditto.
4829
4830         * recode.c: (string_to_long) Ditto.
4831
4832         * repeat.c: (find_DO_REPEAT_substitution) Ditto.
4833
4834         * repeat.h: New header for perform_DO_REPEAT_substitutions, used
4835         where appropriate.
4836
4837         * sort.c: (sort_stream_read) Ditto.
4838         (sort_stream_mode) Ditto.
4839         
4840 Fri Dec 19 23:35:04 2003  Ben Pfaff  <blp@gnu.org>
4841
4842         * algorithm.c (binary_search): Fix comparison.
4843
4844 Fri Dec 19 23:27:45 2003  Ben Pfaff  <blp@gnu.org>
4845
4846         * algorithm.c: (binary_search) Fix assertion.
4847
4848 Fri Dec 19 21:31:48 2003  Ben Pfaff  <blp@gnu.org>
4849
4850         * sysfile-info.c: (compare_vectors_by_name) Rewrite.
4851
4852 Fri Dec 19 21:30:24 2003  Ben Pfaff  <blp@gnu.org>
4853
4854         * sort.c: (compare_case_lists) Rewrite.
4855
4856 Fri Dec 19 16:44:22 2003  Ben Pfaff  <blp@gnu.org>
4857
4858         * quicksort.c: Removed (not used).
4859
4860         * quicksort.h: Removed (not used).
4861
4862         * sort.c: Removed blp_quicksort() prototype.
4863
4864 Fri Dec 19 16:42:13 2003  Ben Pfaff  <blp@gnu.org>
4865
4866         * postscript.c: (int_2_compare) Rewrite.
4867         (compare_line) Rewrite.
4868
4869 Fri Dec 19 16:38:35 2003  Ben Pfaff  <blp@gnu.org>
4870
4871         * matrix-data.c (compare_factors) Use lexicographical_compare()
4872         algorithm.
4873         (compare_doubles) New function.
4874         
4875         * algorithm.c: (lexicographical_compare) New algorithm.
4876
4877 Fri Dec 19 16:23:45 2003  Ben Pfaff  <blp@gnu.org>
4878
4879         * matrix-data.c (compare_variables_by_mxd_vartype): Rewrite.
4880
4881 Fri Dec 19 15:54:45 2003  Ben Pfaff  <blp@gnu.org>
4882
4883         * expr-prs.c: (cmp_func) Removed.
4884         (parse_function) Use binary_search() algorithm.
4885         (compare_functions) New function.
4886         (init_func_tab) Use sort() algorithm.
4887
4888         * algorithm.c: (binary_search) New algorithm.
4889
4890 Fri Dec 19 15:50:45 2003  Ben Pfaff  <blp@gnu.org>
4891
4892         * descript.q: (display) Use sort() algorithm instead of qsort().
4893         (compare_func) Removed.
4894         (descriptives_compare_variables) New function.
4895
4896 Fri Dec 19 15:08:38 2003  Ben Pfaff  <blp@gnu.org>
4897
4898         Get rid of AVL trees.  Hashes are more appropriate for everything
4899         PSPP does.
4900
4901         * Makefile.am: (pspp_SOURCES) Remove avl.c, avl.h.
4902         
4903         * avl.c: Removed.
4904
4905         * avl.h: Removed.
4906
4907 Fri Dec 19 14:33:31 2003  Ben Pfaff  <blp@gnu.org>
4908
4909         Much code can be clarified by using C++ STL-like algorithms.  Not
4910         all uses of these algorithms are listed below, only the ones where
4911         the change to an algorithm was the only change of interest.
4912         
4913         * Makefile.am: (pspp_SOURCES) Add algorithm.c, algorithm.h.
4914         
4915         * algorithm.c: New file.
4916
4917         * algorithm.h: New file.
4918
4919         * modify-vars.c: (static var forward) Removed.
4920         (static var positional) Removed.
4921         (compare_variables) Removed.
4922         (struct ordering) New.
4923         (cmd_modify_vars) Use sort() algorithm.
4924         (compare_variables_given_ordering) New function.
4925         (rearrange_dict) Use sort() algorithm.
4926
4927         * sysfile-info.c: (cmd_display) Use sort() algorithm.
4928         (cmp_var_by_name) Removed.
4929
4930 Fri Dec 19 14:26:17 2003  Ben Pfaff  <blp@gnu.org>
4931
4932         Make file handles use a hash table.
4933         
4934         * file-handle.q: (files) Change to hash table, make static.
4935         (cmd_file_handle) Use hash table functions.
4936         (fh_get_handle_by_filename) Ditto.
4937         (fh_get_handle_by_name) Ditto.
4938         (hash_file_handle) New function.
4939         (cmp_file_handle) Rewrite.
4940         (fh_init_files) Use hash table functions.
4941
4942 Fri Dec 19 14:24:38 2003  Ben Pfaff  <blp@gnu.org>
4943
4944         Clean up FREQUENCIES.
4945         
4946         * Makefile.am: (pspp_SOURCES) Remove frequencies.g.
4947
4948         * frequencies.q: Remove a lot of old #if'd out code at the end.
4949         (internal_cmd_frequencies) Use calc() instead of calc_no_weight()
4950         or calc_weight().  Initialize percentile_values.
4951         (calc) New function based on calc_weight() from frequencies.g.
4952         (precalc) Use hash functions.
4953         (static var comparison_func) Removed.
4954         (static var comparison_param) Removed.
4955         (comparison_helper) Removed.
4956         (get_freq_comparator) New function.
4957         (not_missing) New function.
4958         (add_freq) Removed.
4959         (postprocess_freq_tab) Use hash table functions, algorithms,
4960         get_freq_comparator().  Rewrite.
4961         (cleanup_freq_tab) Rephrase.
4962         (add_percentile) Clean up spacing.
4963         (hash_value_numeric) New function.
4964         (hash_value_alpha) New function.
4965         (compare_value_numeric_a) Rewrite.
4966         (compare_value_alpha_a) Rewrite.
4967         (compare_value_numeric_d) Rewrite.
4968         (compare_value_alpha_d) Rewrite.
4969         (compare_freq_numeric_a) Rewrite.
4970         (compare_freq_alpha_a) Rewrite.
4971         (compare_freq_numeric_d) Rewrite.
4972         (compare_freq_alpha_d) Rewrite.
4973         (calc_stats) Clean up mode, percentiles, max.
4974         (dump_statistics) Clean up spacing.
4975         
4976         * frequencies.g: Removed.
4977
4978         * var.h: (struct freq_tab) Change `data' to hash table.
4979
4980 Fri Dec 19 14:15:46 2003  Ben Pfaff  <blp@gnu.org>
4981
4982         * file-handle.h: Remove declaration of global variable `files',
4983         which wasn't used anywhere.
4984
4985         * postscript.c: (add_encoding) Remove superfluous cast.
4986         (line) Ditto.
4987
4988         * sfm-read.c: [linux] (bswap_int32) Drop ntohl() non-portable
4989         version.
4990
4991         * temporary.c: [0] (display_tree) Removed.
4992
4993 Fri Dec 19 14:13:04 2003  Ben Pfaff  <blp@gnu.org>
4994
4995         Implement a new random number generator based on the alleged RC4
4996         algorithm.
4997
4998         * expr-evl.c: (expr_evaluate) Use rng_get_double_normal() instead
4999         of rand_normal().
5000
5001         * random.c: [!HAVE_GOOD_RANDOM] (real_rand) Removed.
5002         [!HAVE_GOOD_RANDOM] (real_srand) Removed.
5003         (macro k) Removed.
5004         (static var V[]) Removed.
5005         (static var Y) Removed.
5006         (static var X2) Removed.
5007         (setup_randomize) Removed.
5008         (shuffle) Removed.
5009         (rand_uniform) Removed.
5010         (rand_normal) Removed.
5011         (struct rng) New structure.
5012         (rng_create) New function.
5013         (rng_destroy) New function.
5014         (swap_byte) New static function.
5015         (rng_seed) New function.
5016         (rng_get_bytes) New function.
5017         (rng_get_int) New function.
5018         (rng_get_unsigned) New function.
5019         (rng_get_double) New function.
5020         (rng_get_double_normal) New function.
5021         (pspp_rng) New function.
5022
5023         * random.h: Sync up to random.c.
5024
5025         * sample.c: (struct sample_trns) Make `frac' unsigned and a
5026         fraction of UINT_MAX, not 65536.
5027         (cmd_sample) Use rng_get_unsigned(), rng_get_double(), UINT_MAX
5028         fraction.
5029
5030         * vfm.c: (open_active_file) No need to call setup_randomize() any
5031         longer.
5032
5033 Fri Dec 19 12:05:56 2003  Ben Pfaff  <blp@gnu.org>
5034
5035         Change dictionary name indexes to use hash tables instead of AVL
5036         trees.
5037
5038         * crosstabs.q: (free_var_dict) Use hash tables.
5039         (crs_custom_tables) Ditto.
5040         (calc_general) Ditto.
5041         (compare_table_entry) Rewrite.
5042         (enum_var_values) Reorder parameters.  All references updated.
5043         Rewrite.
5044
5045         * get.c: (rename_variable) Use hash tables.
5046         (mtf_merge_dictionary) Ditto.
5047
5048         * glob.c: (init_glob) Use hash tables.
5049         (cmp_variable) Removed.
5050
5051         * means.q: (mns_custom_tables) Use hash tables.
5052
5053         * modify-vars.c: (rearrange_dict) Use hash tables.
5054
5055         * rename-vars.c: (cmd_rename_variables) Use hash tables.
5056
5057         * sfm-read.c: (read_header) Use hash tables.
5058         (read_variables) Ditto.
5059
5060         * temporary.c: (new_dictionary) Use hash tables.
5061         (save_dictionary) Ditto.
5062         (restore_dictionary) Ditto.
5063
5064         * var.h: (struct dictionary) Change AVL tree `var_by_name' into
5065         hash table `name_tab'.
5066
5067         * vars-atr.c: [DEBUGGING] (dump_one_var_node) Removed.
5068         [DEBUGGING] (dump_var_tree) Removed.
5069         (find_variable) Use hash tables.
5070         (find_dict_variable) Ditto.
5071         (common_init_stuff) Ditto.
5072         (rename_variable) Ditto.
5073         (clear_variable) Ditto.  Also, remove debug code.
5074         (dup_variable) Use hash tables.
5075
5076         * vars-prs.c: (fill_all_vars) Use hash tables.
5077         (is_dict_varname) Ditto.
5078         (parse_dict_variable) Ditto.
5079         
5080 Fri Dec 19 11:46:23 2003  Ben Pfaff  <blp@gnu.org>
5081
5082         Change value labels to use hash tables instead of AVL trees, and
5083         change value labels into an ADT.
5084
5085         * Makefile.am: (pspp_SOURCES) Add value-labels.c, value-labels.h.
5086         
5087         * value-labels.c: New file.
5088
5089         * value-labels.h: New file.
5090
5091         * apply-dict.c: (cmd_apply_dictionary) Use value label ADT.
5092         Get rid of a stupid use of goto.
5093
5094         * autorecode.c: (compare_alpha_value) Rewrite.
5095         (hash_alpha_value) Ditto.
5096         (compare_numeric_value) Rewrite.
5097         (hash_numeric_value) Ditto.
5098
5099         * frequencies.q: (dump_full) Use value label ADT.
5100
5101         * pfm-read.c: (read_value_label) Use value label ADT.
5102
5103         * pfm-write.c: (write_value_labels) Use value label ADT.
5104
5105         * sfm-read.c: (read_variables) Use value label ADT.
5106         (read_value_labels) Rewrite.
5107
5108         * sfm-write.c: (write_value_labels) Rewrite.
5109
5110         * sysfile-info.c: (cmd_sysfile_info) Use value label ADT.
5111         (display_variables) Ditto.
5112         (describe_variable) Ditto.
5113
5114         * t-test.q: (print_t_groups) Use value label ADT.
5115
5116         * temporary.c: (copy_variable) Use value label ADT.
5117         (free_dictionary) Ditto.
5118
5119         * val-labs.c: (verify_val_labs) Use value label ADT.
5120         (get_label) Ditto.
5121         (debug_print) Ditto.
5122         (val_lab_cmp) Removed.
5123         (inc_ref_count) Removed.
5124         (copy_value_labels) Removed.
5125
5126         * var.h: (struct value_label) Removed.
5127         (struct variable) Change AVL tree `val_lab' into hash table
5128         `val_labs'.
5129
5130         * vars-atr.c: (init_variable) Use value label ADT.
5131         (clear_variable) Ditto.
5132         (free_value_label) Removed.
5133         (free_val_lab) Removed.
5134         (get_val_lab) Removed.
5135         (compare_variables) New function.
5136         (hash_variable) New function.
5137
5138         * vfm.c: (dump_splits) Use value label ADT.
5139
5140 Fri Dec 19 11:18:11 2003  Ben Pfaff  <blp@gnu.org>
5141
5142         Add to the hash table interface.
5143
5144         * hash.c: (hsh_hash_bytes) Add assertion.
5145         (hsh_hash_string) Ditto.
5146         (hsh_clear) Ditto.
5147         (hsh_rehash) Ditto.
5148         (hsh_probe) Ditto.
5149         (hsh_create) Ditto.  Also make minimum `size'.
5150         (hsh_destroy) Rephrase.
5151         (sort_nulls_last) Removed.
5152         (not_null) New function.
5153         (hsh_data) Ditto.
5154         (comparison_helper) Ditto.
5155         (hsh_sort) Rewritten.
5156         (hsh_data_copy) New function.
5157         (hsh_sort_copy) Ditto.
5158         (hsh_insert) Ditto.
5159         (hsh_replace) Ditto.
5160         (hsh_hash_double) Ditto.
5161         (hsh_delete) Fix stupid bug.
5162         
5163 Thu Dec 18 12:27:03 WAST 2003 John Darrington <john@darrington.wattle.id.au>
5164         * added a calculation of the mode to FREQUENCIES
5165
5166 Wed Dec 17 12:53:01 WAST 2003 John Darrington <john@darrington.wattle.id.au>
5167
5168         * moved (un)defs of DEBUGGING to config.h
5169
5170 Mon Dec 15 21:35:59 2003  Ben Pfaff  <blp@gnu.org>
5171
5172         * groff-font.c: (add_kern) Fix indentation.
5173         (add_kern) Use & instead of % to take power-of-2 modulus.
5174         (font_get_kern_adjust) Likewise.
5175
5176 Fri Dec 12 23:54:37 2003  Ben Pfaff  <blp@gnu.org>
5177
5178         * autorecode.c: (recode) Replace stupid use of memcpy() by
5179         memberwise copy.
5180         (hash_alpha_value) Use hsh_hash_bytes().  Get rid of nasty casts.
5181         (hash_numeric_value) Ditto.
5182         (autorecode_proc_func) pool_strdup() was wrong here because the
5183         source string was not null-terminated.  Use new pool_strndup()
5184         instead.
5185
5186         * crosstabs.q: (enum_var_values) Remove superfluous and bizarre
5187         use of hsh_iterator_init().
5188
5189         * data-in.c: (parse_N) Initialize i->v->f.
5190
5191         * flip.c: (cmd_flip) Use memmove(), not memcpy(), to copy
5192         overlapping arrays.
5193
5194         * groff-font.c: Use power-of-2 hash table sizes, not prime.
5195         (groff_read_font) Don't call hsh_next_prime().  Don't call
5196         fclose(NULL).
5197         (static var hash) Remove `size_p', `max_used' members.
5198         (font_char_name_to_index) Don't call hsh_next_prime().  Use
5199         hsh_hash_string() instead of hashpjw(), & instead of %.
5200         (default_font) Don't call hsh_next_prime().
5201
5202         * pool.c: (pool_strndup) New function.
5203         (pool_strdup) Reimplement in terms of pool_strndup.
5204
5205         * postscript.c: (hash_font_entry) Use hsh_hash_string().  Get rid
5206         of nasty casts.
5207         (hash_ps_encoding) Use hsh_hash_string().
5208         (hash_ps_combo) Use hsh_hash_string(), hsh_hash_int().
5209         (hash_filename2font) Use hsh_hash_string().
5210
5211         * som.c: Add #include <stdlib.h>.
5212
5213         * tab.c: (tab_destroy) Don't set t->container after freeing `t'
5214         (by destroying its pool).
5215         
5216 Fri Dec 12 23:18:59 2003  Ben Pfaff  <blp@gnu.org>
5217
5218         Miscellaneous hash table code cleanup:
5219         
5220         * hash.h: (struct hsh_table) Moved into hash.c.
5221         (hsh_count) Ditto, and transformed into function.
5222         (hsh_compare_func) New typedef, used for defining otherwise-long
5223         function types here and in hash.c
5224         (hsh_hash_func) Ditto.
5225         (hsh_free_func) Ditto.
5226         
5227         * hash.c: (struct hsh_table) Renamed `n' to `used', `m' to `size',
5228         `table' to `entries'.  Removed `mp'.  All references updated.
5229         (hsh_clear) Don't shrink entries array; if the hash was this big
5230         once, it probably will be again.
5231         (hsh_rehash) Made static.
5232         (force_hsh_insert) Renamed hsh_force_insert.
5233         (force_hsh_find) Renamed hsh_force_find.
5234
5235         Made hash table sizes powers of 2, because that's fine with any
5236         reasonable hash function and because taking a power-of-2 modulus
5237         is faster than any other:
5238         
5239         (hsh_prime_tab) Removed;
5240         (hsh_next_prime) Ditto.
5241         (next_power_of_2) New function.
5242         (hsh_create) Use next_power_of_2.
5243         (hsh_rehash) Use & instead of %.
5244
5245         Cleaned up hsh_sort:
5246         
5247         (internal_comparison_fn) Removed.
5248         (sort_nulls_last) New function.
5249         (hsh_sort) Removed second parameter, switched to using the new
5250         quicksort() function from quicksort.h to avoid using nasty need
5251         for static variables with qsort().  All references updated.
5252
5253         Changed the hash functions offered, because there are better hash
5254         functions than the ones we had, and cleaned up the names to boot:
5255         
5256         * hash.c: (hashpjw_d) Removed.
5257         (hashpjw) Ditto.
5258         (hsh_hash_bytes) New function.
5259         (hsh_hash_string) New function.
5260         (hsh_hash_int) New function.
5261
5262         Improved the hash table iteration interface:
5263         
5264         * hash.h: (hsh_iterator_init) Removed.
5265         (struct hsh_iterator) Removed `init' member, change `next' to
5266         size_t.
5267
5268         * hash.c: (hsh_foreach) Removed.  All references updated to use
5269         hsh_first/hsh_next instead.
5270         (hsh_first) New function.  Notably, unlike hsh_foreach() it does
5271         not treat a null pointer as an empty hash table.
5272         (hsh_next) New function.
5273
5274         Made deletion possible, though slow:
5275
5276         * hash.c: (locate_matching_entry) New function.
5277         (hsh_find) Use locate_matching_entry().
5278         (hsh_delete) New function also using locate_matching_entry().
5279         (hsh_force_delete) New function.
5280
5281 Fri Dec 12 23:16:10 2003  Ben Pfaff  <blp@gnu.org>
5282
5283         * quicksort.c: New file implementing a sort routine with a
5284         interface better than qsort() because it passes a user-provided
5285         parameter to the sort routine.
5286
5287         * Makefile.am: Add quicksort.c, quicksort.h.
5288
5289 Fri Dec 12 13:31:58 2003  Ben Pfaff  <blp@gnu.org>
5290
5291         * All source files: Get rid of nasty special cases for Checker,
5292         which is pretty obsolete now.
5293
5294 Thu Dec 11 21:38:24 WST 2003 John Darrington <john@darrington.wattle.id.au>
5295
5296         * Fixed a bug apparent when using the FREQUENCIES command with the
5297         html driver.  The html driver was incorrectly trying to display 
5298         empty cells.
5299
5300 Sun Jan  2 21:40:13 2000  Ben Pfaff  <blp@gnu.org>
5301
5302         * Makefile.am: Reorganized.  Put locale dir in version.c instead
5303         of passing it to each compile command.  Only put local gmp libs in
5304         LD_ADD if not installed on system.  Remove `boast' target.
5305
5306         * All source files: struct and union typedefs eliminated.
5307         `sizeof type' replaced by `sizeof object' where practical.  Moved
5308         `unused' qualifiers from start to end of declarations for gcc
5309         2.7.2 compatibility.  Change `while (1)' to `for (;;)'.  Made
5310         assertions on pointers strictly compliant.  Removed _ prefixes on
5311         some function parameter names.
5312
5313         * alloc.c: New source file, containing these external linkage
5314         functions removed from common.c: xmalloc, xcalloc, xrealloc,
5315         xstrdup.
5316
5317         * arena.c: Removed.
5318         
5319         * arena.h: Removed.
5320
5321         * ascii.c: Migrated from arenas to pools.
5322         (struct ascii_driver_ext) ops[], box[], fonts[] changed from
5323         c_string to len_string.  All references changed.
5324         (ascii_option) Signature changed to comply to new output.c
5325         interface.
5326         (count_fancy_chars) Removed.
5327         (delineate) Removed support for rich text.
5328         (ascii_text_metrics) Ditto.
5329         (text_draw) Ditto.
5330         (output_shorts) Change `box', `off', `on' from c_string to
5331         len_string.  Change `remaining' from int to size_t.
5332         (ascii_close_page) Make page numbering less haphazard.
5333
5334         * autorecode.c: Migrate from arenas to pools.
5335
5336         * avl.c: Migrate from arenas to pools.  Synch from libavl 1.4.0.
5337
5338         * bitvector.h: New file containing these macros from misc.h:
5339         SET_BIT, CLEAR_BIT, SET_BIT_TO, TEST_BIT, BIT_INDEX.
5340
5341         * command.c: (struct command) cmd1, cmd2, cmd3 members changed to
5342         word[3].  ncmd removed.
5343         (var empty_string) Removed.
5344         (var cmd_table) Declaration updated.
5345         (var cmdtab) Removed.
5346         (cmp_command) Removed.
5347         (split_words) Rewritten to use strtok_r().
5348         (init_cmd_parser) Renamed cmd_init().  Rewritten.
5349         (find_command) Removed.
5350         (FILE_TYPE_okay) Rewritten.
5351         (cmd_parse) Rewritten.  Semantics of the return value of command
5352         handlers has changed: they must now return one of the new CMD_*
5353         enumerals, rather than a magic value.  This meant that all
5354         commands had to be modified, and they were.
5355         (figure_out_command) New function.
5356
5357         * command.def: Add CORRELATIONS, PEARSON CORRELATIONS.  Add
5358         #defines for INIT, INPU, etc.
5359
5360         * command.h: New CMD_* enum series.
5361         (cur_proc) Make const char *, not char *.
5362         (cmd_init) Prototype.
5363         (cmd_parse) Ditto.
5364
5365         * common.c: Removed.
5366
5367         * common.h: Removed.
5368
5369         * correlations.q: New file.
5370
5371         * crosstabs.q: Migrate from arenas to pools.  Migrate to new-style
5372         q2c.
5373         (custom_tables) Renamed crs_custom_tables().
5374         (custom_variables) Renamed crs_custom_variables().
5375         (calc_integer) Add in some `const' qualifiers.
5376         (table_value_missing) Change from a_string to len_string.
5377         (float_M_suffix) Change from a_string to len_string.
5378
5379         * data-in.c: Rewritten.  All references to
5380         parse_string_as_format() changed to data_in().
5381
5382         * data-in.h: New file.
5383
5384         * data-list.c: Change DLS_* from #define's to enums.  Move from
5385         rpd_msg() to tmsg().
5386         (RPD_ERR) New #define.
5387         (do_reading) Change dfm_push_cust() to dfm_push(), pop_cust() to
5388         dfm_pop().
5389         (read_from_data_list_fixed) Change from old
5390         parse_string_as_format() to new data_in().
5391         (read_from_data_list_free) Ditto.
5392         (read_from_data_list_list) Ditto.
5393         (cmd_repeating_data) Modify approach to checking for end of
5394         command.
5395         (rpd_msg) Removed.
5396         (rpd_parse_record) Change from old parse_string_as_format() to new
5397         data_in().  Change from old convert_format_to_string() to new
5398         data_out().
5399         (read_one_set_of_repetitions) Change dfm_push_cust() to
5400         dfm_push(), pop_cust() to dfm_pop().
5401
5402         * data-out.c: Rewritten.  All references to
5403         convert_format_to_string() changed to data_out().
5404
5405         * descript.q: Migrate to new q2c.
5406         (cmd_descriptives) Removed.
5407         (internal_cmd_descriptives) Renamed cmd_descriptives ().
5408         (custom_variables) Renamed dsc_custom_variables().
5409
5410         * dfm.c: (struct dfm_fhuser_ext) `ln' removed.  All references
5411         removed.
5412         (open_file_r) Initialize h->where.line_number.  Migrate to new
5413         struct string.
5414         (open_file_w) Initialize h->where.line_number.
5415         (read_record) Change from ext->ln to h->where.line_number.
5416         Migrate to struct string.
5417         (dfm_put_record) Rephrased.
5418         (dfm_push_cust) Renamed dfm_push(), rewritten.
5419         (dfm_pop) New function.
5420
5421         * error.c: All references updated.
5422         (glob var error_count) Renamed err_err_count.
5423         (glob var warning_count) Renamed err_warning_count.
5424         (glob var error_already_flagged) Renamed err_already_flagged.
5425         (glob var verbosity) Renamed err_verbosity.
5426         (glob var cust_fn) Removed.
5427         (glob var cust_ln) Removed.
5428         (static var file_loc) New.
5429         (static var nfile_loc) New.
5430         (static var mfile_loc) New.
5431         (tmsg) New function.
5432         (push_cust) Removed.
5433         (pop_cust) Removed.
5434         (msg) Rewritten.
5435         (static var terminating) Removed.
5436         (failure) Renamed err_failure().
5437         (hcf) Renamed err_hcf().
5438         (err_push_file_locator) New function.
5439         (err_pop_file_locator) New function.
5440         (err_location) New function.
5441         (check_error_count) Renamed err_check_count().
5442         (vmsg) Renamed err_vmsg().  Interface changed.
5443         (verbose_msg) Removed.
5444         (err_cond_fail) New function.
5445         (error_break) Renamed err_break().
5446
5447         * error.h: All references updated.
5448         (enum MSG_CLASS_COUNT) Renamed ERR_CLASS_COUNT.
5449         (enum ERR_CLASS_MASK, ERR_VERBOSITY_SHIFT, ERR_VERBOSITY_MASK)
5450         New.
5451         (struct file_locator) New.
5452         (struct error) New.
5453         (macro verbose_msg) Removed.
5454         (macro cond_fail) Removed.
5455
5456         * expr-opt.c: (evaluate_tree) sizeof(char) == 1.
5457
5458         * expr-prs.c: Reorganized.  All references updated.
5459         (exprtypename) Renamed expr_type_name().
5460         (typename) Renamed type_name().
5461         (free_expression) Renamed expr_free().
5462         (parse_expression) Renamed expr_parse().  Uses new type_check()
5463         function.
5464         (init_functab) Renamed init_func_tab().
5465         (type_check) New function.
5466         (parse_or) Rewritten to use new allocate_nonterminal() and
5467         append_nonterminal_arg() functions.
5468         (parse_and) Ditto.
5469         (parse_not) Ditto.
5470         (parse_rel) Ditto.  Also simplified logic.
5471         (parse_add) Ditto.
5472         (parse_mul) Ditto.
5473         (parse_neg) Ditto.
5474         (parse_exp) Ditto.
5475         (SYSMIS_func) Ditto.
5476         (VALUE_func) Rephrased.
5477         (CONCAT_func) Fix memory leak by replacing free by free_node on
5478         lossage.
5479         (generic_str_func) Ditto.
5480         (parse_function) Ditto.  Also rephrasings.  Uses bsearch() to find
5481         function.
5482         (allocate_nonterminal) New function.
5483         (append_nonterminal_arg) New function.
5484         (static func_tab[]) Now at file level.
5485         (cmp_func) Moved.
5486         (init_func_tab) Moved.  Now just uses qsort() to sort func_tab[].
5487
5488         * expr.h: (enum series OP_*) Moved to exprP.h.
5489         (OP_* defines) Ditto.
5490         (struct op_desc) Ditto.
5491         (global ops[]) Ditto.
5492         (struct num_con_node) Ditto.
5493         (struct str_con_node) Ditto.
5494         (struct var_node) Ditto.
5495         (struct lag_node) Ditto.
5496         (struct casenum_node) Ditto.
5497         (struct nonterm_node) Ditto.
5498         (union any_node) Members renamed.
5499         (struct sys_node) Removed.
5500         (struct val_node) Removed.
5501         (operator typedef) Removed.
5502         (typedef exprtype) Removed.
5503         (enum series EX_*) Moved to exprP.h.
5504         (struct expression) Ditto.  Also renamed a lot of the members.
5505         (PXP_* defines) Changed to enums.
5506         (free_node prototype) Moved to exprP.h.
5507
5508         * file-handle.h: (struct file_handle) New member `where'.
5509
5510         * file-handle.q: Migrated to new q2c format.
5511         (prepend_current_directory) Removed (dead code).
5512         (cmd_file_handle) Incorporated all of internal_cmd_file_handle().
5513         (fh_get_handle_by_filename) Removed dead code.
5514         Set new `where' member.
5515
5516         * file-type.c: (file_type_source_read) References to
5517         parse_string_as_format() changed to data_in().
5518         dfm_push_cust()/pop_cust() changed to dfm_push()/dfm_pop().
5519
5520         * filename.c: All references updated.
5521         (init_filename) Renamed fn_init().
5522         (expand_line) Removed.
5523         (macro EXPAND_LINE) Removed.
5524         (interp_vars) Renamed fn_interp_vars().  Now uses st_*() instead
5525         of custom functions.
5526         (gnu_getcwd) Renamed fn_get_cwd(), rewritten.
5527         (tilde_expand) Renamed fn_tilde_expand(), uses ds_*().
5528         (normalize_filename) Renamed fn_normalize().
5529         (search_path) Renamed fn_search_path(), rewritten.
5530         (prepend_dir) Renamed fn_prepend_dir().
5531         (blp_getenv) Renamed fn_getenv().
5532         (blp_dirname) Renamed fn_dirname().
5533         (fn_basename) New function, not used.
5534         (absolute_filename_p) Renamed fn_absolute_p().
5535         (is_special_filename) Renamed fn_special_p().
5536         (file_exists) Renamed fn_exists_p().
5537         (readlink_malloc) Renamed fn_readlink().
5538         (getenv_default) Renamed fn_getenv_default().
5539         (open_file) Renamed fn_open().
5540         (close_file) Renamed fn_close().
5541         (open_file_ext) Renamed fn_open_ext().
5542         (close_file_ext) Renamed fn_close_ext().
5543
5544         * font.h: Migrate from arenas to pools.
5545
5546         * format.c: (parse_format_specifier_name) Deal with ds_* strings.
5547
5548         * frequencies.g: Migrate from arenas to pools.
5549
5550         * frequencies.q: Migrate to new q2c version.  Migrate from arenas
5551         to pools.
5552
5553         * getline.c: All references updated.
5554         (global getl_buf) Changed from char * to struct string.
5555         (static getl_include_path) Ditto.
5556         (global getl_buf_len) Removed.
5557         (global getl_buf_size) Removed.
5558         (getl_include_path) Deal with new getl_buf, getl_include_path.
5559         (getl_uninitialize) New function.
5560         (getl_get_current_directory) Rewritten.
5561         (getl_clear_include_path) Rewritten.
5562         (getl_add_include_dir) Rewritten.
5563         (getl_add_file) Assertion fixed.
5564         (getl_add_virtual_file) Change initial value of `remaining_loops'
5565         from 2 to 1.
5566         (welcome) Rewritten.
5567         (handle_line_buffer) Make static.  Change logic to make
5568         getl_add_virtual_file() change sensible.  Use ds_*() strings.
5569         (getl_read_line) Use ds_*() strings.  Implement SET ECHO.
5570         (getl_close_file) Moved.
5571         (getl_location) New function.
5572
5573         * getline.h: All references updated.
5574         (macro curln) Removed.
5575         (macro curfn) Removed.
5576         (macro am_interactive) Renamed getl_am_interactive.
5577         (macro am_reading_script) Renamed getl_reading_script.
5578
5579         * glob.c: (global fmt_parse_ignore_error) Removed.
5580         (init_glob) Use locale_dir not LOCALEDIR.  Use feholdexcept() on
5581         systems that support it (C99).  Turn off SET ECHO by default.  No
5582         necessary julcal initialization anymore.
5583
5584         * groff-font.c: Migrate from arenas to pools.
5585         (groff_read_font) Use err_push_file_locator().
5586         (groff_read_DESC) Ditto.
5587         (font_msg) Use tmsg().
5588
5589         * hash.c: (hsh_sort) Fix debug code.
5590         [GLOBAL_DEBUGGING] Include stdio.h.
5591
5592         * hash.h: (macro force_hsh_insert) Rephrase.
5593
5594         * heap.c: Rewritten.
5595         
5596         * heap.h: Rewritten.
5597
5598         * html.c: (html_option) Change from outp_value to struct string.
5599         (postopen) Change from curfn to getl_location().
5600         (escape_string) Remove rich-text code.  Signature changed.
5601         (output_tab_table) Switch from a_string to struct len_string.
5602         Remove rich text support.
5603
5604         * lexer.c: All references updated.  Largely rewritten.  Major
5605         changes listed below.  Removed tagged quote support.  Adapted to
5606         struct string tokstr.
5607         (global tokstr) Changed to struct string.
5608         (global tokstr_size) Removed.
5609         (global tokstr_len) Removed.
5610         (global tokid) New.
5611         (global tokint) Removed.
5612         (global toklongstr) Removed.
5613         (C* defines) Removed.
5614         (static tbl[]) Removed.
5615         (static id[]) Removed.
5616         (static une[]) Removed.
5617         (discard_line) Renamed lex_discard_line().
5618         (get_entire_line) Renamed lex_entire_line().
5619         (get_rest_of_line) Renamed lex_rest_of_line().
5620         (get_dotted_rest_of_line) Merged into lex_rest_of_line().
5621         (make_hexit) Removed.
5622         (syntax_error) Renamed lex_error().  Return value removed.
5623         (get_token_representation) Renamed lex_token_representation().
5624         (putback) Renamed lex_put_back().
5625         (putfwd) Renamed lex_put_forward().
5626         (convert_negative_to_dash) Renamed lex_negative_to_dash().
5627         (set_prog) Renamed lex_set_prog().
5628         (init_lex) Renamed lex_init().
5629         (reset_eof) Renamed lex_reset_eof().
5630         (lookahead) Renamed lex_look_ahead().
5631         (check_id) Rewritten.
5632         (yylex) Renamed lex_get(), rewritten.
5633         (lex_end_of_command) New function.  Many commands were rephrased
5634         using this.
5635         (lex_integer_p) New function.  Replaces compare of tokint against
5636         NOT_LONG.
5637         (lex_integer) New function.  Replaces tokint.
5638         (match_tok) Renamed lex_match().
5639         (match_id) Renamed lex_match_id().
5640         (match_int) Renamed lex_match_int().
5641         (force_match_id) Renamed lex_force_match_id(), added return value.
5642         (force_match) Renamed lex_force_match(), added return value.
5643         (force_string) Renamed lex_force_string(), added return value.
5644         (force_int) Renamed lex_force_int(), added return value.
5645         (lex_id_match_len) New function.
5646         (id_match) Renamed lex_id_match(), rewritten.
5647         (get_line) Renamed lex_get_line().
5648         (preprocess_line) Renamed lex_preprocess_line().
5649         (tokname) Renamed lex_token_name().
5650         (bin_value_func) Removed.
5651         (oct_value_func) Removed.
5652         (hex_value_func) Removed.
5653         (unexpected_eof) New function.
5654         (convert_numeric_string_to_char_string) New function.
5655         (parse_string) Rewritten, signature changed.
5656         (add_tokstr_char) Removed.
5657         (add_tokstr_unsigned) Removed.
5658         (add_tokstr_string) Removed.
5659         (parse_tagged_quote) Removed.
5660         (skip_comment) Renamed lex_skip_comment().
5661
5662         * lexer.h: All references updated.
5663         (macro is_id1) Renamed CHAR_IS_ID1.
5664         (macro is_idn) Renamed CHAR_IS_IDN.
5665         (token names ID, NUM, STRING, STOP, ... WITH, EXP) Renamed with
5666         prefix T_: T_ID, T_NUM, T_STRING, T_STOP, ... T_WITH, T_EXP.
5667         (macro get_token) Removed.
5668         (macro id_match) Removed.
5669         (macro force_match_id) Removed.
5670         (macro force_match) Removed.
5671         (macro force_string) Removed.
5672         (macro force_int) Removed.
5673         (macro force_num) Removed.
5674         (macro force_id) Removed.
5675
5676         * lexerP.h: Removed.
5677
5678         * list.q: Migrated to new q2c format.
5679         (write_line) Deal with struct len_string.
5680         (write_varname) Ditto.
5681         (write_fallback_headers) Ditto.
5682
5683         * magic.c: New file, incorporating the following global variables
5684         previously in other files: endian, second_lowest_value.  And both
5685         of those are conditional on #define's.
5686
5687         * magic.h: New file, incorporating the following global variable
5688         declarations: endian, second_lowest_value, and the following macro
5689         declarations: NOT_DOUBLE, NOT_LONG, NOT_INT.
5690
5691         * main.c: Added declarations of pgmname, finished, curdate,
5692         start_interactive.
5693         (main) Call new parse_script() function.
5694         (parse_script) New function.
5695         (execute_command) New function.
5696         (dump_token) Removed.
5697         (handle_error) New function.
5698
5699         * matrix.c: New file.
5700
5701         * matrix.h: New file.
5702
5703         * matrix-data.c: Migrated from arenas to pools.
5704         (mget_token) Change from parse_string_as_format() to data_in().
5705
5706         * means.q: Migrate to new q2c.
5707         (custom_tables) Renamed mns_custom_tables().
5708         (custom_crossbreak) Renamed mns_custom_crossbreak().
5709         (custom_variables) Renamed mns_custom_variables().
5710
5711         * mis-val.c: (static var width) Changed from `int' to `size_t'.
5712         (parse_varnames) Prototype.
5713         (parse_numeric) Rephrasings.
5714         (parse_alpha) Adapt to new struct string tokstr.
5715
5716         * misc.c: (intlog10) Rewritten.
5717         (spacing) Removed.
5718         (ansi_rand) Renamed real_rand(), moved into random.c.
5719         (ansi_srand) Renamed real_srand(), moved into random.c.
5720         (setup_randomize) Moved to random.c.
5721         (rand_uniform) Ditto.
5722         (rand_normal) Ditto.
5723         (rand_simple) Ditto.
5724         (get_config_line) Removed.
5725         (reverse) Removed (dead code).
5726
5727         * misc.h: (macro SET_BIT) Moved to bitvector.h.
5728         (macro CLEAR_BIT) Ditto.
5729         (macro TEST_BIT) Ditto.
5730         (macro SET_BIT_TO) Ditto.
5731         (macro BIT_INDEX) Ditto.
5732
5733         * output.c: (outp_read_devices) Move to err_push_file_locator()
5734         from push_cust().  Use struct string.
5735         (expand_op_tokstr) Removed.
5736         (static var op_tokstr) Changed to struct string.
5737         (static var op_tokstr_size) Removed.
5738         (tokener) Rephrasings.  Use struct string.
5739         (parse_options) Use struct string.
5740         (destroy_driver) Fix assertion.
5741         (outp_get_paper_size) Move to err_push_file_locator().
5742         [0] Removed dead code.
5743         (outp_string_width) Move to len_string.
5744
5745         * output.h: Comment fixes.
5746         (TAG_* enum series) Removed.
5747         (struct outp_value) Removed.
5748         (enum OUTP_T_FANCY) Removed.
5749         (struct outp_text) `s' changed from a_string to len_string.
5750         (struct outp_class) `option' change arg 3 from outp_value to
5751         struct string.
5752
5753         * pfm-read.c: (corrupt_msg) Rewritten.
5754
5755         * pfm-write.c: (bufwrite) Fix assertion.
5756
5757         * pool.c: New file, reference version.
5758
5759         * pool.h: New file, reference version.
5760
5761         * postscript.c: (ps_font_sizes) Fix assertion.
5762         (ps_option) Change arg 3 from outp_value to struct string.
5763         Adapt to struct string.
5764         (macro output_line) Removed.
5765         (macro add_string) Removed.
5766         (output_encodings) Adapted to struct string.  Moved to
5767         err_push_file_locator().
5768         (find_encoding_file) Fix assertion.
5769         (read_ps_encodings) Move to err_push_file_locator().
5770         (postopen) Use getl_location() instead of curfn.
5771         (out_text_plain) Move to len_string.
5772         (text) Ditto.  Remove rich text support.
5773
5774         * print.c: (cmd_print) Remove now-unneeded resource cleanup code.
5775         (cmd_print_eject) Ditto.
5776         (cmd_write) Ditto.
5777         (internal_cmd_print) Now cleans up after itself.  Uses
5778         fh_parse_file_handle() now.
5779         (cmd_print_space) Use PXP_NUMERIC to type-check.
5780
5781         * q2c.c: Overhauled.  Removed _("") i18n support.  All references
5782         updated.  All output functions updated to handle structures rather
5783         than local or static variables.  Adapt to new PSPP lex_*()
5784         functions.
5785         (macro _) Removed.
5786         (macro N_) Removed.
5787         (macro MAX_N_SBC) Removed.
5788         (global bare) Removed.
5789         (enum STRING) Renamed T_STRING.
5790         (enum ID) Renamed T_ID.
5791         (get_buffer) Buffer size increased.
5792         (strlower) Renamed st_lower(), rephrased.
5793         (strupper) Renamed st_upper(), rephrased.
5794         (skip_ws) New function.
5795         (get_line) Don't special-case any types of lines (like those
5796         beginning with ! or $, for instance).
5797         (get_token) Renamed lex_get().  Rephrased.
5798         (static var `prefix') New.
5799         (parse) New function.
5800         (parse_setting) Minor rephrasing.
5801         (dump_specifier_vars) Ditto.
5802         (make_identifier) Put null terminator on identifier, duh.
5803         (dump_vars) Renamed dump_declarations().  Never indent.  Never
5804         static.  Output changed entirely.
5805         (dump_specifier_init) Rephrase.
5806         (dump_vars_init) No index variable needed.  Other modifications.
5807         (dump_parser) Don't parse command name.  Do dump functions instead
5808         of just code fragments.
5809         (dump_free) Dump function instead of code fragment.
5810         (recognize_directive) New function.
5811         (main) Use recognize_directive().  Don't rely on magic $ line
5812         beginning: instead, parse comments.  Update list of headers.
5813
5814         * random.c: New file, containing the following functions:
5815         real_rand(), real_srand(), setup_randomize, shuffle, rand_uniform,
5816         rand_normal, rand_simple.
5817
5818         * random.h: New file.
5819
5820         * recode.c: (cmd_recode) Merge internal_cmd_recode() into this
5821         function.  `max_src_width', `max_dst_width' changed to size_t.
5822         (internal_cmd_recode) Removed.
5823         (parse_dest_spec) Merge similar cases.
5824         (parse_src_spec) Add assertion.
5825
5826         * repeat.c: (recognize_keyword) New function.
5827         (internal_cmd_do_repeat) Parse and handle PRINT keyword on END
5828         REPEAT.  Improve recognition of END REPEAT (use
5829         recognize_keyword()).  Move from curfn to getl_location().  Use
5830         struct string.
5831                 
5832         (perform_DO_REPEAT_substitutions) Adapt to struct string.
5833
5834         * set.q: Adapt to new q2c.
5835         (cmd_set) Range-check some values better.
5836         (custom_blanks) Renamed stc_custom_blanks().
5837         (custom_length) Renamed stc_custom_length().
5838         (custom_results) Renamed stc_custom_results().
5839         (custom_seed) Renamed stc_custom_seed().
5840         (custom_width) Renamed stc_custom_width().
5841         (custom_format) Renamed stc_custom_format().
5842         (custom_journal) Renamed stc_custom_journal().
5843         (custom_color) Renamed stc_custom_color().
5844         (custom_listing) Renamed stc_custom_listing().
5845         (custom_disk) Renamed stc_custom_disk().
5846         (custom_log) Renamed stc_custom_log().
5847         (custom_rcolor) Renamed stc_custom_rcolor().
5848         (custom_viewlength) Renamed stc_custom_viewlength().
5849         (custom_workdev) Renamed stc_custom_workdev().
5850
5851         * settings.h: Not necessary to include format.h any longer.
5852
5853         * sfm-read.h: (macro bswap_int32) Moved here from sfmP.h.
5854         (corrupt_msg) Rewritten.
5855
5856         * sort.c: Adapt to rewritten heap ADT.
5857
5858         * str.c: (aa_strcpy) Removed.
5859         (ab_strcpy) Removed.
5860         (ac_strcpy) Removed.
5861         (ba_strcpy) Removed.
5862         (bb_strcpy) Removed.
5863         (ca_strcpy) Removed.
5864         (aa_strdup) Removed.
5865         (aa_strdupcpy) Removed.
5866         (ba_strdup) Removed.
5867         (sa_strdup) Removed.
5868         (memrev) Renamed mm_reverse().
5869         (memrmem) Renamed mm_find_reverse().
5870         (cmp_str) Renamed st_compare_pad().
5871         (strmaxcpy) Removed.
5872         (strbarepadcpy) Renamed st_bare_pad_copy(), signature changed.
5873         (strbarepadlencpy) Renamed st_bare_pad_len_copy(), signature
5874         changed.
5875         (strpadcpy) Renamed st_pad_copy(), signature changed.
5876         (blpstrset) Removed.
5877         (ds_create) New function.
5878         (ds_init) New function.
5879         (ds_replace) New function.
5880         (ds_destroy) New function.
5881         (ds_clear) New function.
5882         (ds_extend) New function.
5883         (ds_shrink) New function.
5884         (ds_truncate) New function.
5885         (ds_length) New function.
5886         (ds_size) New function.
5887         (ds_value) New function.
5888         (ds_end) New function.
5889         (ds_concat) New function.
5890         (ds_concat_buffer) New function.
5891         (ds_printf) New function.
5892         (ds_putchar) New function.
5893         (ds_getline) New function.
5894         (ds_get_config_line) New function derived from the old
5895         misc.c:get_config_line().
5896         (ls_create) New function.
5897         (ls_create_buffer) New function.
5898         (ls_init) New function.
5899         (ls_shallow_copy) New function.
5900         (ls_destroy) New function.
5901         (ls_null) New function.
5902         (ls_null_p) New function.
5903         (ls_empty_p) New function.
5904         (ls_length) New function.
5905         (ls_value) New function.
5906         (ls_end) New function.
5907
5908         * str.h: Reformatted.
5909         (struct a_string) Removed.
5910         (struct b_string) Removed.
5911         (struct c_string) Removed.
5912         (struct len_string) New.
5913         (struct string) New.
5914         (macro as_streq) Removed.
5915         (macro bs_streq) Removed.
5916         (macro cs_streq) Removed.
5917         (macro sa_streq) Removed.
5918         (macro sb_streq) Removed.
5919         [__GNUC__] (inline function ds_putchar) New function.
5920         [__GNUC__] (inline function ds_length) New function.
5921         [__GNUC__] (inline function ds_value) New function.
5922         [__GNUC__] (inline function ds_end) New function.
5923
5924         * sysfile-info.c: (cmd_sysfile_info) Rephrased.
5925         (display_vectors) Fix missing i18n.
5926
5927         * t-test.q: Migrate to new q2c.
5928
5929         * tab.c: Migrate from arenas to pools.
5930         (tab_create) Use struct len_string.
5931         (tab_realloc) Ditto.
5932         (text_format) Ditto.
5933         (tab_joint_text) Ditto.
5934         (tab_natural_width) Remove rich text support.
5935         (tab_natural_height) Ditto.
5936         (tab_output_text) Handle TAT_FIX.
5937         (tab_raw) Change arg from a_string to len_string.
5938         (tabi_driver) Fix assertion.  Use struct len_string.
5939         (render_strip) Use struct len_string.  Remove rich text support.
5940         Add `const' qualifiers.
5941
5942         * tab.h: (enum TAB_RICH) Remove.
5943         (enums TAB_COL_NONE, TAB_COL_DONE) New.  Where appropriate,
5944         SOM_COL_* updated to read TAB_COL_*.
5945         (struct tab_table) Change arena to pool.  Change a_string to
5946         len_string.
5947
5948         * temporary.c: (restore_dictionary) Rewrite Checker code.
5949
5950         * var.h: (macros MAX_SHORT_STRING, MIN_LONG_STRING, SYSMIS,
5951         LOWEST, HIGHEST) Moved here from common.h.
5952         (typedef any_trns) Removed.  All references changed to `struct
5953         trns_header'.
5954
5955         * vars-atr.c: (force_create_variable) Fix assertion.
5956         (force_dup_variable) Fix assertion.
5957         
5958 Thu Jun  3 18:40:42 1999  Ben Pfaff  <blp@gnu.org>
5959
5960         Using alphanumeric variables in functions under AGGREGATE
5961         segfaulted.  Fixed.  Thanks to Dr. Dirk Melcher
5962         <BZN-mdksh@t-online.de> for reporting this bug.
5963         
5964         * aggregate.c: (parse_aggregate_functions) When setting the
5965         FSTRING bit, also allocate memory for the `string' member of
5966         agr_next.
5967         (free_aggregate_functions) Free iter->string.  Don't use the
5968         non-function bits when indexing the array of functions.
5969         [DEBUGGING] (debug_print) Don't use the non-function bits when
5970         indexing the array of functions.        
5971
5972 Sun May 30 00:00:54 1999  Ben Pfaff  <blp@gnu.org>
5973
5974         Under certain circumstances, the final case would be omitted from
5975         the results of an AGGREGATE operation.  Fixed.  Thanks to Dr. Dirk
5976         Melcher <BZN-mdksh@t-online.de> for reporting this bug.
5977         
5978         * aggregate.c (agr_00x_end_func): Increment number of cases in
5979         sink before writing case.  For streams that keep track of how many
5980         cases there are based on this value, this means that the last case
5981         will be read in on the next stream read.
5982
5983 Sat May 29 22:03:31 1999  Ben Pfaff  <blp@gnu.org>
5984
5985         Undefined behavior was invoked by referencing a freed pointer.
5986         
5987         * vfm.c (memory_stream_write): Free pointer *after* checking for
5988         non-null status.
5989
5990 Sat May 29 22:02:22 1999  Ben Pfaff  <blp@gnu.org>
5991
5992         A wrong record size was displayed when paging the active file to
5993         disk.
5994         
5995         * vfm.c: (memory_stream_write) Fix off-by-one error.
5996
5997 Sat May 29 21:50:26 1999  Ben Pfaff  <blp@gnu.org>
5998
5999         Not having enough temporary space for sorting caused a core dump.
6000         Fixed.
6001         
6002         * sort.c: (allocate_cases) Initialize i.
6003
6004 Sat May 29 21:40:54 1999  Ben Pfaff  <blp@gnu.org>
6005
6006         Syntax errors in function descriptions on AGGREGATE caused core
6007         dumps.  Fixed.
6008         
6009         * aggregate.c (cmd_aggregate): Don't free agr_dict after calling
6010         free_aggregate_functions(), since that function already frees
6011         agr_dict.
6012         
6013 Sat May 29 21:06:10 1999  Ben Pfaff  <blp@gnu.org>
6014
6015         A null pointer was dereferenced, causing a core dump, when
6016         PERCENTILES was specified on FREQUENCIES.  This fixes the problem,
6017         but PSPP still doesn't calculate percentiles.  Thanks to Regnor
6018         Jernsletten <rjernsle@eunet.no> for reporting this problem.
6019         
6020         * arena.c: (arena_malloc) If the arena hasn't been initialized
6021         already, initialize it.
6022
6023 Sat May 29 20:47:29 1999  Ben Pfaff  <blp@gnu.org>
6024
6025         * Makefile.cygwin: New file supplied by Hankin <hankin@dunno.com>
6026         for compilation with Cygnus Windows B20.  Not used by other
6027         systems.
6028
6029 Sat May 29 20:36:04 1999  Ben Pfaff  <blp@gnu.org>
6030
6031         SORT always sorted in ascending order.  Fixed.  Thanks to Dr. Dirk
6032         Melcher <BZN-mdksh@t-online.de> for reporting this bug.
6033
6034         * sort.c: (compare_case_lists) Reverse sense of comparison if
6035         sorting in descending order.
6036         (compare_record) Ditto.
6037
6038 Tue Mar  9 13:18:54 1999  Ben Pfaff  <blp@gnu.org>
6039
6040         SPLIT FILE with a string variable caused a core dump.  Fixed.
6041
6042         * vfm.c: If the variable is a string then make a temporary value
6043         struct pointing to it.  The underlying problem is a lot bigger
6044         than this (see TODO) but this is a stopgap for the simple case at
6045         least.
6046         
6047 Tue Mar  9 13:15:53 1999  Ben Pfaff  <blp@gnu.org>
6048
6049         Nested INCLUDEs didn't work.  Fixed.
6050
6051         * getline.c: (getl_include) Set first_line to NULL in allocated
6052         structure.
6053
6054 Tue Mar  9 13:13:46 1999  Ben Pfaff  <blp@gnu.org>
6055
6056         The MATCH FILES procedure set the values of variables not present
6057         to 0.  It should have been SYSMIS.  This is now fixed.
6058
6059         * get.c: (mtf_delete_file_in_place) Replace 0.0 by SYSMIS.
6060
6061 Tue Mar  9 12:52:23 1999  Ben Pfaff  <blp@gnu.org>
6062
6063         The REMARK command was too aggressive about skipping lines.  It
6064         didn't like being the last command in a file.
6065
6066         * command.c: (cmd_remark) Call get_entire_line() instead of
6067         get_line().
6068
6069 Tue Mar  9 12:48:05 1999  Ben Pfaff  <blp@gnu.org>
6070
6071         Comment parsing wasn't consistent with the rest of the code in its
6072         idea of where one command ends and another starts.  This meant
6073         that sometimes commands would be mysteriously ignored.  Thanks to
6074         Dr. Dirk Melcher <BZN-mdksh@t-online.de> for reporting this bug.
6075          
6076         * command.c: (parse_cmd) Hand off comment parsing to new function
6077         skip_comment() in lexer.c.
6078         * lexer.c: (skip_comment) New function.
6079
6080 Wed Jan 20 20:22:07 1999  Ben Pfaff  <blp@gnu.org>
6081
6082         The TABLE subcommand on MATCH FILES worked only erratically at
6083         best.  This fixes it.  Thanks to Dr. Dirk Melcher
6084         <BZN-mdksh@t-online.de> for reporting this bug.
6085
6086         * get.c: (mtf_compare_BY_values) When comparing string values, a
6087         difference of 1 is still a difference :-)
6088         (mtf_processing) Inverted TABLE reading logic fixed.  Also don't
6089         advance TABLE files automatically when matched.  Comment fixes.
6090
6091 Tue Jan 19 22:32:31 1999  Ben Pfaff  <blp@gnu.org>
6092
6093         VARIABLE LABELS rejected a slash before the first variable
6094         specification, contradicting the documentation.  Thanks to Walter
6095         M. Gray <graywm@northernc.on.ca> for reporting this bug.
6096
6097         * var-labs.c: (cmd_variable_labels) Ignore a leading slash in
6098         command specification.
6099
6100 Tue Jan 19 22:29:54 1999  Ben Pfaff  <blp@gnu.org>
6101
6102         Because of an incorrect optimization in memory allocation,
6103         CROSSTABS sometimes segfaulted when asked to output multiple
6104         tables.  Thanks to Walter M. Gray <graywm@northernc.on.ca> for
6105         reporting this bug.
6106
6107         * crosstabs.q: (postcalc) New variables maxcols, maxcells, which
6108         are passed to output_pivot_table() for its use.
6109         (output_pivot_table) Instead of assuming the number of columns is
6110         constant, keep track with maxcols.  In general mode, use maxcells
6111         to determine whether more matrix cells need to be allocated.    
6112
6113 Tue Jan 19 22:27:46 1999  Ben Pfaff  <blp@gnu.org>
6114
6115         CROSSTABS didn't display value labels for column and row
6116         variables.  Thanks to Walter M. Gray <graywm@northernc.on.ca> for
6117         reporting this bug.
6118
6119         * crosstabs.q: (table_value_missing) If the specified value has a
6120         value label for this variable, then show it instead of the raw
6121         value.
6122         (display_dimensions) Delegate display of value_labels to
6123         table_value_missing.
6124
6125 Mon Jan 18 20:04:06 1999  Ben Pfaff  <blp@gnu.org>
6126
6127         WRITE didn't write line ends.  Fixed.  Thanks to Dr. Dirk Melcher
6128         <BZN-mdksh@t-online.de> for reporting this bug.
6129
6130         * print.c: (print_trns_proc) Write (CR/)LF if PRINT is used _or_
6131         if the file isn't declared as binary.
6132
6133 Mon Jan 18 19:56:45 1999  Ben Pfaff  <blp@gnu.org>
6134
6135         MATCH FILES corrupted memory and dumped core on some syntax
6136         errors.  Fixed.
6137
6138         * get.c: (cmd_match_files) Set file->handle to NULL before
6139         jumping to lossage.
6140         (mtf_free_file) Don't free a null dictionary.   
6141
6142 Mon Jan 18 19:27:57 1999  Ben Pfaff  <blp@gnu.org>
6143
6144         MATCH FILES should set numeric values not available to the
6145         system-missing value, not to 0.  Thanks to Dr. Dirk Melcher
6146         <BZN-mdksh@t-online.de> for reporting this bug.
6147
6148         * get.c: (mtf_processing) Set unused records to system-missing,
6149         not 0.
6150
6151 Mon Jan 18 15:06:46 1999  Ben Pfaff  <blp@gnu.org>
6152
6153         KEEP didn't work properly on the SAVE procedure.  Fixed.  Thanks
6154         to Ralf Geschke <ralf@kuerbis.org> for reporting this bug.
6155
6156         * temporary.c: (save_dictionary) Initialize var_by_name AVL tree
6157         in newly created dictionary, and add each copied variable to the
6158         tree.
6159  
6160 Mon Jan 18 15:04:48 1999  Ben Pfaff  <blp@gnu.org>
6161
6162         Memory leak fix.
6163         
6164         * get.c: (trim_dictionary) Free variable list for KEEP after
6165         finishing with it.
6166
6167 Mon Jan 18 12:57:36 1999  Ben Pfaff  <blp@gnu.org>
6168
6169         Some systems didn't like the way open_file was coded.  Thanks to
6170         Hankin <hankin@rogue.consultco.com> for pointing this out.
6171
6172         * filename.c: (open_file) Don't try to store stdin, stdout,
6173         stderr as part of an array, because that doesn't always work.
6174
6175 Mon Jan 18 12:53:27 1999  Ben Pfaff  <blp@gnu.org>
6176
6177         The SAVE procedure didn't save long string variables properly.
6178         Fixed by this patch.  Thanks to Hankin
6179         <hankin@rogue.consultco.com> for this patch.
6180         
6181         * sfm-write.c: (write_variable) Fix off-by-one error in writing
6182         out variable pad records.
6183
6184 Tue Jan  5 14:29:27 1999  Ben Pfaff  <blp@gnu.org>
6185
6186         Previously, if PRINT SPACE were given a negative argument, it
6187         would report an error, then spin in an (almost) infinite loop.
6188         This fixes that behavior.
6189
6190         * print.c: (print_space_trns_proc) After reporting a negative
6191         argument, set number of lines to print to 1.
6192
6193 Tue Jan  5 13:59:55 1999  Ben Pfaff  <blp@gnu.org>
6194
6195         SPSS 8.0 outputs some new record types in its system files, and it
6196         allows longer value labels.  Accept these system files.
6197
6198         * sfm-read.c: (sfm_read_dictionary) Ignore record type 7 subtype
6199         11 emitted by SPSS 8.0.
6200         
6201 Tue Jan  5 13:55:50 1999  Ben Pfaff  <blp@gnu.org>
6202
6203         The LIST procedure was too conservative in allocating space for
6204         buffers, which caused a bug that only showed up with very long
6205         output variables.  Thanks to Hankin <hankin@dunno.com> for this
6206         bug report.
6207
6208         * list.q: (determine_layout) Allocate 1022 bytes instead of 256.
6209
6210 Tue Jan  5 13:34:34 1999  Ben Pfaff  <blp@gnu.org>
6211
6212         Typo meant string format specifiers weren't checked properly.  I
6213         think that Hankin <hankin@dunno.com> sent me this report, but I'm
6214         willing to be corrected on this point.
6215  
6216         * format.c: (check_string_specifier) Fix obvious typo.  
6217
6218 Tue Jan  5 12:50:42 1999  Ben Pfaff  <blp@gnu.org>
6219
6220         Using $CASENUM in an expression didn't work.  Here's a fix.
6221         Thanks to Dirk Melcher <BZN-mdksh@t-online.de> for reporting this
6222         bug.
6223          
6224         * expr-evl.c: (evaluate_expression) Add OP_CASENUM case.
6225
6226         * expr-opt.c: (dump_node) OP_CASENUM is acceptable.
6227
6228 Tue Jan  5 12:47:48 1999  Ben Pfaff  <blp@gnu.org>
6229
6230         The changes in 0.2.1 to fix DATA LIST FREE parsing broke some
6231         other behavior, *sigh*.  This patch hopefully fixes that.  This
6232         time I've actually tested it.
6233
6234         Thanks to Hankin <hankin@dunno.com> for reporting this bug.
6235
6236         * data-list.c: (read_from_data_list_free,
6237         read_from_data_list_list) Call parse_string_as_format() directly
6238         without mucking around with the field width.
6239
6240 Tue Jan  5 12:31:19 1999  Ben Pfaff  <blp@gnu.org>
6241
6242         Occasionally, you may encounter a script that wants to be
6243         interpreted in interactive mode.  Make -i emulate this behavior to
6244         allow such scripts to be executed with PSPP.
6245
6246         Thanks to Hankin <hankin@dunno.com> for reporting this behavior.
6247
6248         * cmdline.c: (pre_syntax_message[]) Update -i description.
6249
6250         * lexer.c: (preprocess_line) When getl_interactive is 2 (i.e.,
6251         when -i is given on the command line) don't treat unindented lines
6252         as starting a new command.
6253
6254 Tue Jan  5 12:30:10 1999  Ben Pfaff  <blp@gnu.org>
6255
6256         In conjunction with egcs 1.1.1, Checker emits some bogus warnings,
6257         mostly caused by local initialized aggregates.  After egcs is
6258         fixed upstream these can be removed, but for now they're not a big
6259         deal.
6260         
6261         * ascii.c: (ascii_postopen_driver) Checker chokes on local
6262         initialized arrays.  Avoid this.
6263
6264         * sfm-write.c: (sfm_write_dictionary) Don't use a local
6265         initialized struct.
6266
6267 Tue Jan  5 12:07:24 1999  Ben Pfaff  <blp@gnu.org>
6268
6269         egcs 1.1.1 has some new warnings relative to gcc 2.8.1, which the
6270         following changes avoid.  Currently I compile sources with egcs
6271         1.1.1 and gcc 2.7.2.3 before sending them out.
6272
6273         * apply-dict.c: (apply_dict) Use new avl_traverser_init() macro.
6274         
6275         * ascii.c: (option_tab[]) Initialize all struct members.
6276
6277         * avl.h: (avl_traverser_init) New macro.
6278         
6279         * command.c: (DEFCMD, UNIMPL macros, cmd_table[]) Initialize all
6280         struct members.
6281
6282         * crosstabs.q: (enum_var_values) Use new hsh_iterator_init()
6283         macro.
6284
6285         * hash.c: Comment fix.
6286
6287         * hash.h: (hsh_iterator_init) New macro.
6288
6289         * html.c: (option_tab[]) Initialize all struct members.
6290
6291         * pfm-write.c: (write_value_labels) Use new avl_traverser_init()
6292         macro.
6293
6294         * postscript.c: (option_tab[]) Initialize all struct members.
6295         (output_encodings, preclose, dump_lines) Use new
6296         hsh_iterator_init() macro.
6297
6298         * sfm-write.c: (write_value_labels) Use new avl_traverser_init()
6299         macro.
6300
6301         * sysfile-info.c: (describe_variable) Use new avl_traverser_init()
6302         macro.
6303
6304 Thu Nov 19 12:32:45 1998  Ben Pfaff  <blp@gnu.org>
6305
6306         * data-in.c: Examined each of the parsing functions to make sure
6307         that they wouldn't dump core if they were passed a string of the
6308         wrong length, since now the DATA LIST FREE/LIST routines don't
6309         check for field width before passing it to the data parser.
6310         (parse_RBHEX, parse_AHEX) Reject odd length input.
6311         (parse_string_as_format) Reject input that's too short or too
6312         long.
6313
6314         * data-list.c: Before, the DATA LIST FREE/LIST routines would pad
6315         a field to its entire declared output width then pass it to the
6316         data-in parsing routines.  This contradicted the documented
6317         behavior.  This is fixed in these changes.  Thanks to Mark H. Wood
6318         <mwood@IUPUI.Edu>.  In addition, this fixes a few more details of
6319         free-format parsing that differed from SPSS.
6320         (cut_field) Commas and spaces are treated identically.  Returns
6321         the proper column instead of a fixed 1 value.
6322         (parse_field) Removed.
6323         (read_from_data_list_free, read_from_data_list_list) Call
6324         parse_string_as_format directly instead of parse_field.
6325
6326         * heap.c: (heap_delete) Stylistic fixes.
6327
6328 Sun Aug  9 11:12:13 1998  Ben Pfaff  <blp@gnu.org>
6329
6330         * loop.c: (loop_2_trns_proc) Formatting fix.
6331
6332         * sel-if.c: (cmd_filter) Set FILTER_before_TEMPORARY.
6333
6334         * var.h: (glob var FILTER_before_TEMPORARY) New global var.
6335
6336         * vfm.c: (macro FILTERED) New.
6337         (static var filter_var) New.
6338         (process_active_file_write_case) Use FILTERED.
6339         (setup_filter) Set filter_var.
6340         (close_active_file) Delete the filter if not
6341         FILTER_before_TEMPORARY.
6342         (procedure_write_case) Use FILTERED.
6343
6344 Sat Aug  8 00:20:14 1998  Ben Pfaff  <blp@gnu.org>
6345
6346         * crosstabs.q: Changed /PIVOT={ON,OFF} to /FORMAT={PIVOT,NOPIVOT}.
6347
6348         * data-in.c: (parse_day_count) Message fix.
6349         (parse_month) Style fix.
6350
6351         * data-list.c: (struct data_list_pgm) New member eof.
6352         (cmd_data_list) Init eof to 0.
6353         (do_reading) Implement the /END subcommand and read-past-eof
6354         checking.
6355
6356         * do-if.c: Include stdio.h when debugging.
6357         (cmd_else_if) Make sure the command is .-terminated.
6358
6359         * glob.c: (init_glob) Capitalize the command prompt.
6360
6361         * inpt-pgm.c: (end_case_trns_proc) Debugging message.
6362         (end_file_trns_proc) Debugging message.
6363
6364         * loop.c: (internal_cmd_loop) Make it work when there's no loop
6365         index!
6366         (loop_2_trns_proc) Enable MXLOOPS (why was this disabled?)
6367
6368         * main.c: (dump_token) Make kwtab[] const.
6369
6370         * set.q: Spelling, comment fixes.
6371
6372         * sysfile-info.c: (cmd_display) DISPLAY VECTORS not DISPLAY
6373         VECTOR.
6374
6375         * vars-prs.c: (fill_all_vars) Style fix.
6376
6377         * vfm.c: (index_to_varname) Return const.
6378
6379 Tue Aug  4 23:49:23 1998  Ben Pfaff  <blp@gnu.org>
6380
6381         * Changes in many source files for partial -ansi -pedantic and
6382         no-debugging compliance: Remove trailing common in enum
6383         declarations; add `unused' attributes; insert some appropriate
6384         casts.
6385
6386         * cmdline.c: (parse_command_line) Add new --testing-mode flag.
6387
6388         * command.c: (shell) Make static.
6389         (run_command) Make static.
6390
6391         * data-list.c: (dump_fixed_table) Remove use of local_strdup().
6392
6393         * dfm.c: (cmd_begin_data) I18n fix.
6394
6395         * error.c: (verbose_msg) Define if __STRICT_ANSI__.
6396
6397         * error.h: (macro verbose_msg) Define if __STRICT_ANSI__.
6398
6399         * expr-opt.c: (evaluate_tree) Don't initialize local arrays if
6400         __STRICT_ANSI__.
6401
6402         * file-handle.q: Don't prepend the source file directory name to
6403         the data file name.  (Ongoing issue.)
6404         (prepend_current_directory) Comment out.
6405         (internal_cmd_file_handle) Don't call prepend_current_directory().
6406         (fh_get_handle_by_filename) Ditto.
6407
6408         * filename.c: Append zero byte to readlink() return value.
6409
6410         * getline.c: (getl_read_line) I18n fix.
6411
6412         * lexer.h: Don't use gcc features if __STRICT_ANSI__.
6413
6414         * misc.h: Don't use gcc features if __STRICT_ANSI__.
6415
6416         * pfm-write.c: (bufwrite) Don't try to increment a void * pointer
6417         directly.
6418
6419         * postscript.c: (output_encodings) Don't use local_strdup().
6420         (postopen) Ditto.
6421
6422         * print.c: Don't use gcc features if __STRICT_ANSI__.
6423
6424         * q2c.c: (dump_vars) Don't put a , at the end of the last enum.
6425
6426         * recode.c: (parse_src_spec) Fully brace nested if's.
6427
6428         * set.q: (global var set_testing_mode) New var.
6429
6430 Wed Jul 29 22:01:44 1998  Ben Pfaff  <blp@gnu.org>
6431
6432         * ascii.c: Add some more `unused' attributes that only come into
6433         play when NDEBUG is defined.
6434         (ascii_close_page) Set s_len when reallocating s.
6435         
6436         * crosstabs.q: (delete_missing) New function.
6437         (output_pivot_table) Call delete_missing() if /MISSING=REPORT.
6438         (make_summary_table) Create summary table reallocable.
6439
6440         * postscript.c: Add more `unused' attributes as above.
6441
6442         * tab.c: (tab_create) [GLOBAL_DEBUGGING] Set reallocable member.
6443         (tab_realloc) [GLOBAL_DEBUGGING] Assert that table is reallocable.
6444          
6445         * tab.h: (struct tab_table) [GLOBAL_DEBUGGING] New `reallocable'
6446         member.
6447
6448         * var.h: (macro force_dup_variable) [!GLOBAL_DEBUGGING] Remove
6449         gratuitous space between parameter definition.
6450
6451         * vars-atr.c: Changed some assert(0)'s to abort()'s to prevent
6452         complaints about running off the end of functions with NDEBUG
6453         enabled.
6454
6455 Sun Jul  5 00:17:25 1998  Ben Pfaff  <blp@gnu.org>
6456
6457         * Several source files: Removed some PORTME notes when reflection
6458         revealed that ANSI forbids that sort of breakage.  Also, added
6459         lots of `unused' qualifiers here and there.
6460
6461         * aggregate.c: (accumulate_aggregate_info) Remove local var
6462         weighting that turned out not to be used.
6463
6464         * avl.c: Update to version 1.1.0.  Add unused specifier.
6465         (avl_destroy) Initialize ab to 0.  Comment fixes.  Cast return
6466         value to void *.
6467         (avl_probe) Replace some instances of 1 with +1 where appropriate.
6468         (avl_find) Cast return value to void *.
6469         (avl_delete) q doesn't need to be initialized at the beginning of
6470         the function.  Replace some instances of 1 with +1.
6471         (force_avl_delete) Renamed avl_force_delete, all references changed.
6472         (compare_ints) `param' marked unused.
6473         (print_int) `param' marked unused.
6474         (recurse_tree) Replace some instances of 1 with +1.
6475
6476         * avl.h: Update to version 1.1.0.  Only declares avl function
6477         types if not already declared.
6478         (AVL_MAX_HEIGHT) Only define if not already defined.
6479         (struct avl_node) New unused member char pad[2].
6480         [GLOBAL_DEBUGGING] Change conditionalization to NDEBUG instead.
6481         (force_avl_insert) Renamed avl_force_insert.
6482         (force_avl_delete) Renamed avl_force_delete.
6483
6484         * crosstabs.q: (struct table_entry) Put `freq' into a union with
6485         new member `data'.
6486         (struct crosstab) Add new member `ofs'.
6487         (glob var int_tab) Removed.
6488         (custom_tables) In integer mode, assign v[i] properly through the
6489         indirect var_dict.
6490         (custom_variables) Now p.crs.max == max + 1.
6491         [DEBUGGING] (debug_print) p.crs.min and p.crs.max are now ints.
6492         (precalc) Implement integer mode.
6493         (calc_integer) Implement integer mode.
6494         (compare_table_entry) Remove unused local variable `comparing'.
6495         (make_summary_table) Implement integer mode.
6496         (macro ns_rows) Implemented as static variable now.
6497         (several variables) Made static, from global.
6498         (output_pivot_table) Use table_value_missing() for column heads.
6499         Remove several unused local variables.  Implement integer mode
6500         table summing.  Count up ns_rows.
6501         (crosstabs_dim) Make columns wider when /MISSING=REPORT requested.
6502         (find_pivot_extent) Moved into find_pivot_extent_general; now just
6503         calls that function or find_pivot_extent_integer.
6504         (find_pivot_extent_integer) New function.
6505         (enum_var_values) Implemented for integer mode.
6506         (table_value_missing) New function.
6507         (display_dimensions) Call table_value_missing() for heads.
6508         (float_M_suffix) New function.
6509         (display_crosstabulation) Call table_value_missing() for row
6510         heads.  Handle missing values in /MISSING=REPORT mode.
6511         (calc_fisher) Remove unused var N.
6512         (calc_r) Remove unused var fact.
6513
6514         * data-list.c: (dump_fixed_table) Fix table dimensioning.
6515         (read_one_set_of_repetitions) Remove unused vars var_spec, column.
6516
6517         * data-out.c: (insert_commas) Remove unused var cp.
6518         (convert_CCx) Remove unused vars save_set_decimal,
6519         save_set_grouping.
6520
6521         * descript.q: (dump_z_table) Fix table dimensioning.
6522         (pre_calc) Remove unused var j.
6523         (display) Remove unused vars title, s.  Fix table dimensioning.
6524
6525         * expr-evl.c: Comment fixes.
6526
6527         * frequencies.q: (full_dim) New function.
6528         (dump_full) Fix table dimensioning.
6529         (condensed_dim) New function.
6530         (dump_condensed) Fix table dimensioning.
6531
6532         * get.c: (cmd_match_files) Remove unused var n_val.  Remove unused
6533         label winnage.
6534
6535         * html.c: (html_close_drive) Remove unused var i.
6536         (postopen) Remove unused vars title, curfn_len, cp.
6537         (preclose) Remove unused vars this, x.
6538
6539         * lexer.c: Comment fixes.
6540
6541         * matrix-data.c: (cmd_matrix_data) Remove unused var index.
6542
6543         * means.q: (custom_tables) Remove unused var m_dim.
6544
6545         * mis-val.c: Format fix.
6546
6547         * modify-vars.c: (cmd_modify_vars) Remove unused var new_dict.
6548
6549         * output.c: (outp_get_paper_size) Remove unused var cp.
6550
6551         * pfm-read.c: (read_float) Remove unused var save, unused label
6552         underflow.
6553         (read_variables) Remove unused vars cp, j.
6554         (read_value_label) Remove unused var j.
6555
6556         * pfm-write.c: (bufwrite) Remove unused var i.
6557
6558         * postscript.c: (ps_postopen_drive) Remove unused vars dev_info,
6559         fn.
6560         (output_encodings) Remove unused vars char_cp, n_output.
6561         (read_ps_encodings) Remove unused var ep.
6562         (postopen) Remove unused var title.
6563         (preclose) Remove unused var fp.
6564         (ps_open_page) Remove unused vars true, false, orientation,
6565         mirror_horz, mirror_vert, width, length.
6566         (ps_text_metrics) Remove unused var x.
6567
6568         * q2c.c: (find_symbol) Remove unused var y.
6569         (parse_setting) Remove unused parameter sbc, all references
6570         changed.
6571         (dump_parser) Remove unused var cp.
6572         (dump_free) Remove unused var i.
6573
6574         * set.q: (static vars args, n) Removed.
6575         (internal_cmd_gset) Removed.
6576
6577         * sfm-read.c: (sfm_read_dictionary) Removed unused var i.
6578         (read_machine_flt64_info) Removed unused var file_endian.
6579         (read_documents) Removed unused var i.
6580         (read_compressed_data) Removed unused parameter dict, all
6581         references changed.
6582
6583         * sfm-write.c: (bufwrite) Removed unused var i.
6584         (sfm_write_case) Removed unused var i.
6585
6586         * sort.c: (merge_once) Remove unused var t.
6587         (write_separate) #if 0 out as dead code.
6588
6589         * split-file.c: (cmd_split_file) Remove unused var i.
6590
6591         * sysfile-info.c: (sysfile_info_dim) New function.
6592         (cmd_sysfile_info) Fix table dimensioning.
6593         (variables_dim) New function.
6594         (display_variables) Fix table dimensioning.
6595         (describe_variable) Remove unused var prev_r.
6596
6597         * t-test.q: (z_postcalc) Removed.
6598         (pairs_calc) Remove unused var bad_weight.
6599         (postcalc) Remove unused vars dfn, dfd.
6600
6601         * tab.c: (tab_create) Set t->dim to NULL.
6602         (tab_dim) Make sure t->dim is NULL first.
6603         (tab_natural_width) Remove parameter `clamp'.
6604         (tab_value) Remove duplicate assertion for table.
6605         (tab_raw) New function.
6606         (nowrap_dim) New function.
6607         (wrap_dim) New function.
6608         (tab_output_text) Fix table dimensioning.
6609
6610         * tab.h: (tab_raw) New macro.
6611
6612         * val-labs.c: (get_label) Remove unused var type.
6613         (copy_value_labels) Remove unused var trav.
6614
6615         * var.h: (struct crosstab_proc) Completely changed.
6616
6617         * vars-prs.c: (parse_dict_variable) Remove unused var v.
6618
6619         * vfm.c: (open_active_file) Remove unused vars i, lp.
6620
6621         * weight.c: (weight_trns_proc) #if 0 out as dead code.
6622         
6623 Tue Jun  2 23:37:21 1998  Ben Pfaff  <blp@gnu.org>
6624
6625         * Makefile.am: Add apply-dict.c, flip.c.
6626
6627         * apply-dict.c: New file.
6628         
6629         * command.c: (struct command) Make cmd[] larger for CLEAR
6630         TRANSFORMATIONS command name.
6631         (parse_cmd) Make sure we're in a valid state before using it as an
6632         index.  Discard variables and reset state on invalid transitions.
6633         (cmd_clear_transformations) New function.
6634
6635         * command.def: Add APPLY DICTIONARY, CLEAR TRANSFORMATIONS, FLIP.
6636         Add unimplemented PRESERVE, RESTORE.
6637
6638         * file-handle.h: Include stddef.h.
6639
6640         * flip.c: New file.
6641         
6642         * pfm-read.c: (parse_value) Pad value label values with spaces,
6643         not nulls.
6644
6645         * sfm-read.c: (struct sfm_fhuser_ext) Add reference count.
6646         (sfm_close) Decrement reference count, make sure it's zero.
6647         (sfm_maybe_close) New function.
6648         (sfm_read_dictionary) Handle reference counts.
6649
6650         * vars-atr.c: (clear_default_dict) New function.
6651         (discard_variables) Use clear_default_dict().
6652
6653 Sun May 31 00:58:05 1998  Ben Pfaff  <blp@gnu.org>
6654
6655         * Makefile.am: Add pfm-write.c.
6656         (LDADD) Add the libgmp2 libraries.
6657
6658         * command.def: Define EXPORT.
6659
6660         * get.c: (cmd_export) New function.
6661         (export_write_case_func) New function.
6662
6663         * pfm-read.c: (static spss2ascii[]) Make it const.
6664
6665         * pfm-write.c: New file.
6666
6667         * sfm-write.c: Formatting, comment fixes.
6668
6669         * var.h: Comment fix.
6670
6671 Fri May 29 21:44:12 1998  Ben Pfaff  <blp@gnu.org>
6672
6673         * Makefile.am: Add pfm.h, pfm-read.c.
6674
6675         * command.def: IMPORT is now implemented.
6676
6677         * format.c: (glob var translate_fmt[]) New var.
6678
6679         * get.c: (enum GTSV_NONE) Renamed GTSV_OPT_NONE.
6680         (cmd_import) New function.
6681         (import_source_read) New function.
6682         (glob var import_source) New var.
6683
6684         * pfm-read.c: New file.
6685
6686         * pfm.h: New file.
6687         
6688         * sfm-read.c: (parse_format_spec) Local variable translate_fmt[]
6689         moved in format.c.
6690         (dump_dictionary) Disabled printing a couple of items.
6691
6692 Mon May 25 12:42:37 1998  Ben Pfaff  <blp@gnu.org>
6693
6694         * crosstabs.q: (postcalc) Call make_summary_table().
6695         (make_summary_table) New function.
6696         (insert_summary) New function.
6697         (display_dimensions) Remove some unnecessary arguments, all
6698         references changed.
6699         (output_pivot_table) Fix lots of problems with the risk table
6700         setup.
6701         (submit) Don't display an empty table.
6702         (display_risk) Fix order of arguments to calc_risk().
6703
6704         * glob.c: Always include assert.h and stdlib.h.
6705
6706         * output.h: (enum OUTP_T_JUST_FULL) Removed, all references
6707         removed.
6708
6709         * tab.c: (tab_create) Cosmetic changes.
6710
6711         * tab.h: (enum TAB_JUSTIFY) Removed, all references removed.
6712
6713 Sun May 24 22:39:23 1998  Ben Pfaff  <blp@gnu.org>
6714
6715         * tab.def: Removed.
6716
6717         * crosstabs.q: (output_pivot_table) Headers drawing and submission
6718         code simplified, moved into new function submit().
6719         (submit) New function.
6720         (crosstabs_dim) New function.
6721         (display_directional) Substitute variable names for %s where
6722         appropriate.
6723         (somers_d_v[], somers_d_ase[], somers_d_t[]) New static vars.
6724         (calc_symmetric) Initialize parameters only if non-NULL.
6725         Calculate Somers' d.
6726         (calc_directional) Calculate Somers' d (or copy it, really).
6727         Calculate eta.
6728
6729         * output.c: (outp_string_width) New function.
6730
6731         * postscript.c: (postopen) Calculate font widths based on the
6732         width of the zero '0' character, not the width of the space
6733         character.  Set paper-width and paper-length based on points, not
6734         device units.
6735         (ps_open_page) Fix page setup string for landscape mode.
6736
6737         * som.h: (struct som_dimension) Removed.
6738         (struct som_table_class) height, width members take int * not
6739         som_dimesion * now.
6740
6741         * tab.c: Many functions now have added parameter validation.
6742         (tab_height, tab_width) These functions were removed and merged
6743         into a single function tab_resize(), and all references changed.
6744         (tab_dim) Rewritten since the interface changed; reduced from
6745         hundreds of lines to two.  All callers were changed.  Currently
6746         most of them just use tab_natural_dimensions as their callback and
6747         await detailed translation of functionality.
6748         (tab_natural_width) New function.
6749         (tab_natural_height) New function.
6750         (tab_natural_dimensions) New function.  This is a callback
6751         function, not something that you'd want to call directly.
6752         (tab_nat_dim) Removed.
6753         (tabi_table) Allocates t->w and t->h.
6754         (tabi_driver) Inlined sum_columns()'s functionality.  Calls the
6755         dimensions callback.
6756         (evaluate_dimensions) Removed.
6757         (sum_columns) Removed.
6758
6759         * tab.h: (enum TAL_1THIN) Removed.
6760         (enum series t_*) Removed.
6761         (struct tab_table) Members trh, trv changed to unsigned char *
6762         from int *.  Member dim changed to a function pointer from a
6763         unsigned char *.  Member max_stack_height removed.  New members
6764         hr_tot, vr_tot.
6765         (macros tab_l, tab_r, tab_t, tab_b) New.
6766
6767 Sat May 23 23:22:13 1998  Ben Pfaff  <blp@gnu.org>
6768
6769         * ascii.c: (delineate) Assign last_space_nchars before skipping
6770         spaces, to fix right justification.
6771
6772         * crosstabs.q: (static vars risk, direct) New vars.
6773         (static var pearson_r) Removed.
6774         (glob var chisq_fisher) Made static.
6775         (static vars row_tot[], col_tot[]) Don't include grand total
6776         anymore.
6777         (static var grand_total) Renamed W, all references changed.
6778         (output_pivot_table) Only make `table' if num_cells != 0.  Make
6779         risk and directional tables.  Deal with grand total no longer part
6780         of col_tot[].  Free rows and cols after we're done with them.
6781         (display_risk) New function.
6782         (display_directional) New function.
6783         (clac_r) Rewritten so that it stores all its results into its
6784         arguments, so it can be used for Spearman's correlation too.
6785         (calc_symmetric) Added a t[] argument, all references changed.
6786         Calculates ASEs for tau-b, tau-c, gamma.  Calculates Spearman's r,
6787         Pearson's r, Cohen's kappa.
6788         (calc_risk) New function.
6789         (calc_directional) New function.
6790
6791         * som.c: (som_submit) Improved debugging code.
6792
6793         * stats.c: (hypercube) New function.
6794         (cube) New function.
6795         (sqr) New function.
6796         (normal_sig) Went back to old implementation, which actually
6797         worked.
6798
6799         * stats.h: (macros square, cube, hypercube) Removed.  The
6800         equivalent functions in stats.c are inlined here; all references
6801         to square changed to sqr.
6802
6803 Fri May 22 00:03:41 1998  Ben Pfaff  <blp@gnu.org>
6804
6805         * crosstabs.q: (N_SYMMETRIC) New define.
6806         (postcalc) Disable debug printing.
6807         (static vars chisq_fisher, pearson_r) New.
6808         (output_pivot_table) Add support for symmetric measures.  Add
6809         chi-square output of exact sigs.
6810         (display_chisq) Rewritten.
6811         (display_symmetric) New function.
6812         (gamma_int) New function.
6813         (Pr) New function.
6814         (swap) New function.
6815         (calc_fisher) New function.
6816         (calc_chisq) Check boundary conditions better. Calculate Yates,
6817         Fisher, Mantel-Haenszel tests.
6818         (calc_r) New function.
6819         (calc_symmetric) New function.
6820
6821         * stats.c: (normal_sig) Rewritten with new algorithm.  Renamed
6822         from calc_normal.
6823         (chisq_sig) Better boundary conditions.  Renamed from
6824         calc_significance.
6825
6826         * tab.h: (struct tab_table) New member cf.
6827
6828         * tab.c: (tab_create) Set cf.
6829         (tab_width) New function.
6830         (tab_realloc) Handle cf.
6831         (tab_vline) Handle cf.
6832         (tab_hline) Handle cf.
6833         (tab_box) Handle cf.
6834         (tab_value) Handle cf.
6835         (tab_float) Handle cf.
6836         (tab_text) Handle cf.
6837         (tab_joint_text) Handle cf.
6838         (tab_offset) Handle cf.
6839         (tab_next_row) Handle cf.
6840         (evaluate_dimensions) Handle cf.
6841         (render_strip) Handle cf.
6842
6843 Wed May 20 00:03:59 1998  Ben Pfaff  <blp@gnu.org>
6844
6845         * crosstabs.q: (postcalc) New vars row_tot, col_tot, pass them to
6846         output_pivot_table().
6847         (output_pivot_table) Moved lots of local variables outside and
6848         made them static.  Add beginnings of chi-square statistic
6849         support.  Now column and row totals aren't in the main matrix.
6850         Always zero out any leftover rows & columns after we're done with
6851         the table entries.  Move all output stuff into
6852         display_dimensions(), display_crosstabs(), display_chisq().
6853         (display_dimensions) New function.
6854         (display_crosstabulation) New function.
6855         (display_chisq) New function.
6856         (calc_chisq) Implemented Pearson and likelihood-ratio chisquares.
6857
6858         * frequencies.q: (dump_full, dump_condensed) Remove tab_null()
6859         references, simplify logic.
6860
6861         * postscript.c: Remove scale, translate-x, translate-y,
6862         mirror-horz, mirror-vert, rotate-180 options.
6863         (struct ps_driver_ext) Remove scale, translate_x, translate_y.
6864         All references deleted.
6865         (macro YT) New macro.
6866         (array option_tab[]) Removed options.
6867         (ps_option) Removed options.
6868         (ps_open_page) Write page setup explicitly to output file, without
6869         using now-deleted BP function.
6870         (macro dump_line) Use YT().
6871         (macro dump_thick_line) Use YT().
6872         (draw_headers) Use YT().
6873         (switch_font) Reorder arguments to SF function.
6874         (write_text) Use YT().
6875
6876         * sfm-read.c: (sfm_read_case) Don't attempt to read variables that
6877         have get.fv == -1.
6878
6879         * sysfile-info.c: (describe_variables) Don't use tab_nulls().
6880
6881         * tab.c: (tab_create) Initialize t->ct to zeros.  Remove
6882         null-debugging code.
6883         (tab_realloc) Remove null-debugging code.  Initialize new regions
6884         of t->ct to zeros.
6885         (tab_vline) Support offsets.
6886         (tab_hline) Support offsets.
6887         (tab_box) Support offsets.
6888         (tab_null) Removed.
6889         (tab_nulls) Removed.
6890         (tab_row) Removed.
6891         (tab_col) Removed.
6892         (evaluate_dimensions) Remove null-debugging code.  Understand
6893         TAB_EMPTY attribute.  Assert that text.s.s is always non-NULL if
6894         TAB_EMPTY not present.
6895
6896         * tab.h: New cell attribute TAB_EMPTY.
6897         (macros tab_nr, tab_nc, tab_row, tab_col) New.
6898
6899         * vars-atr.c: (init_variable) Set get.fv to -1 so that GET doesn't
6900         try to read them from system files.
6901
6902         * vfm.c: (dump_splits) Don't call tab_null().   
6903
6904 Sat May 16 19:36:55 1998  Ben Pfaff  <blp@gnu.org>
6905
6906         * crosstabs.q: (struct crosstab) Added `missing' member.
6907         (custom_tables) Init missing.
6908         (calc_general) Handle missing values.
6909         (calc_chisq) New function.
6910         (output_pivot_table) Start work on chi-square output.  Update for
6911         new tab offset support functions.  Shorten statistic names.
6912
6913         * Several files: add in more `const's to placate gcc's warnings.
6914
6915         * tab.h: (struct tab_table) Add col_ofs, row_ofs members.  Comment
6916         fixes.
6917
6918         * tab.c: (tab_height, tab_realloc, tab_vline, tab_hline, tab_box,
6919         tab_null, tab_nulls, tab_value, tab_float, tab_text,
6920         tab_joint_text) Add col_ofs and row_ofs support.
6921         (tab_offset) New function.
6922         (tab_next_row) New function.
6923         (tab_row) New function.
6924         (tab_col) New function.
6925         (tabi_table) Add col_ofs and row_ofs support.
6926
6927         * vars-atr.c: (is_system_missing) New function.
6928
6929 Tue May 12 16:14:30 1998  Ben Pfaff  <blp@gnu.org>
6930
6931         * crosstabs.q: Expanded subcommand names RESID --> RESIDUAL, etc.
6932         (static var no_cells) Removed.
6933         (static var num_cells) New.
6934         (static var expected) New.
6935         (static var cells[]) New.
6936         (internal_cmd_crosstabs) Deal with new variables.
6937         (postcalc) Removed most of the meat and put it in new function
6938         output_pivot_table().
6939         (output_pivot_table) Calculates and outputs an entire pivot table.
6940
6941         * postscript.c: (postopen) Fix problems with free()ing addresses
6942         not obtained from malloc().
6943
6944         * som.c: (som_submit) Add assertion.
6945
6946         * sysfile-info.c: (describe_variable) Use new tab_nulls()
6947         function.
6948
6949         * tab.c: (static var tab_names[]) New.
6950         (tab_realloc) -1 for nc or nr indicates no change.
6951         (tab_nulls) New function.
6952         (tab_dim) Use tab_names[].
6953         (tabi_cumulate) Don't include bottom or right headers.  Furrfu.
6954         (evaluate_dimensions) Don't terminate on uninited cells, just put
6955         an X in them and emit a notice.  Use tab_names[].
6956
6957         * tab.h: Move bits into tab.def.
6958
6959         * tab.def: New.  Don't try to declare tab_table_class because then
6960         som.h has to be included.       
6961         
6962 Thu May  7 22:55:04 1998  Ben Pfaff  <blp@gnu.org>
6963
6964         * command.def: New file, contains all the command definitions
6965         previously included bodily in command.c.
6966
6967         * format.def: New file, contains all of the format definitions
6968         previously split across format.h, format.c, and sfm-write.c.
6969
6970         * lexer.h: Renamed from tokens.h in order to match corresponding
6971         .c file name.
6972
6973         * lexerP.h: Moved some rarely used functions exported by lexer.c
6974         into here.
6975
6976         * Makefile.am: Commemorate renamed files.
6977         (EXTRA_DIST) Add command.def, format.def.
6978
6979         * command.c: [0] (walk_cmdtable_func) Removed.
6980
6981         * crosstabs.q: (postcalc) Made it work and print out matrices
6982         proving it.
6983         (enum_column_values) Renamed enum_var_values, generalized for any
6984         variable.
6985
6986         * format.h: (struct fmt_desc) New member `spss'.
6987
6988         * q2c.c: (main) Generated code includes lexer.h instead of
6989         tokens.h.
6990
6991         * sfm-write.c: (write_format_spec) Use new spss member of fmt_spec
6992         instead of an independent translation table.
6993
6994 Tue May  5 13:19:03 1998  Ben Pfaff  <blp@gnu.org>
6995
6996         * Lots of source files: Added const to declarations.
6997
6998         * aggregate.c: (parse_aggregate_function) Rename inner i to j.
6999         
7000         * arena.c: (arena_clear) Set prev pointer to null when done.
7001
7002         * ascii.c: (ascii_option) Rename index as indx.
7003
7004         * avl.c: This is now a separate library called libavl.
7005         (xmalloc) Make static.
7006         (avl_probe) Step A7 can use the cache instead of an explicit
7007         compare.
7008         (avl_delete) Don't maintain a q pointer because it's always
7009         available in the pointer stack.  Comment fix.
7010
7011         * avl.h: This is now a separate library called libavl.
7012
7013         * command.c: (cmd_table[]) Remove spurious trailing "".
7014
7015         * common.h: Only include random() fix if this system needs it.
7016
7017         * crosstabs.q: Include alloca headers.
7018         (n_sorted_tab) New global var.
7019         (postcalc) Mostly rewritten.
7020         (find_pivot_extent) Rewritten.
7021         (enum_column_values) Rewritten.
7022
7023         * data-out.c: (convert_F) Rename inner n as n_spaces.
7024
7025         * error.c: (dump_message) Don't have an outer var i.
7026
7027         * file-handle.q: (static var f) Removed.  All references removed.
7028         (internal_cmd_file_handle) Uses a local variable instead of f.
7029
7030         * get.c: (trim_dictionary) Change scope of i, i1, i2.
7031         (cmd_match_files) Don't strcpy tokstr into sbc (why was this ever
7032         done?)
7033
7034         * getline.h: Declare getl_history as extern.  Reported by
7035         palme@uni-wuppertal.de (Hubert Palme).
7036
7037         * postscript.c: (postopen) Some large mods for constness.
7038
7039         * recode.c: Remove spurious copyrights since PSPP is owned by FSF
7040         anyway.
7041
7042 Fri Apr 24 12:52:47 1998  Ben Pfaff  <blp@gnu.org>
7043
7044         * Makefile.am: Rename BUILT_SOURCES to q_sources, all references
7045         changed.  Add avl.c, avl.h to pspp_SOURCES.  Remove avllib from
7046         LDADD.
7047
7048         * avl.c, avl.h: New files.  These form a clean-room
7049         reimplementation of avllib.  Iterative algorithms are used in
7050         place of recursive ones, so there is no resemblance in the code.
7051
7052         * Lots of headers: Don't include other headers by default.
7053
7054         * Lots of source files: Explicitly include all needed headers.
7055
7056         * arena.c: (arena_clear) New function.
7057
7058         * crosstabs.q: (ROW_VAR, COL_VAR) New enums.
7059         (static var ar) Removed.
7060         (staitc vars ar_tc, ar_col) New.
7061         (cmd_crosstabs) Destroy the arenas.
7062         (internal_cmd_crosstabs) Create the arenas.
7063         (precalc) Don't need a free function for the hash.
7064         (calc_general) Make sure to zero out the trailer on the key data
7065         before inserting.
7066         (print_table_entries) Updated.
7067         (postcalc) Worked on actually implementing.
7068         (find_pivot_extent) New function.
7069         (compare_value) New function.
7070         (enum_column_values) New function.
7071
7072         * data-in.c: (parse_month) Make local array `static const'.
7073         
7074         * data-out.c: (convert_date) Make local array `static const'.
7075         (convert_WKDAY) Same.
7076         (convert_MONTH) Same.
7077
7078         * frequencies.q: (postprocess_freq_tab) avl_walk_inorder() has
7079         been renamed to avl_walk().
7080         
7081         * hash.c: Rewritten more efficiently.
7082
7083         * hash.h: Add attribute const to hsh_next_prime declaration.
7084
7085         * lexer.c: (id_match) Make arguments const.
7086
7087         * postscript.c: (ps_postopen_driver) Make default fonts the
7088         Helvetica family.
7089
7090         * q2c.c: (main) Generated code needs stdlib.h.
7091
7092         * sfm-write.c: (write_value_labels) An avl_traverser needs to be
7093         initialized to 0 now, not to NULL.  All other references to
7094         avl_traverser were updated in the same way.
7095
7096         * tokens.h: Macro version of id_match updated to use const
7097         properly.
7098
7099         * val-labs.c: (inc_ref_count) New function.
7100         (copy_value_labels) Simply through use of new avl_copy() function.
7101
7102 Wed Apr 15 13:01:58 1998  Ben Pfaff  <blp@gnu.org>
7103
7104         * crosstabs.q: Probably doesn't compile.  New PIVOT subcommand.
7105         (postcalc) Worked on this.
7106
7107         * postscript.c: (OPO_DOUBLE_LINE) New enum.
7108         (struct ps_driver_ext) New line_width_thick member.
7109         (ps_preopen_drive) Init line_width_thick.
7110         (option_tab[]) Add line-* options.
7111         (ps_option) Parse line-* options.
7112         (postopen) Add line_width_thick support.  Strip leading spaces on
7113         prologue output lines.
7114         (ps_open_page) Include line_width_thick in output.
7115         (macro dump_thick_line) New.
7116         (dump_fancy_line) Support thick lines as well as double lines.
7117
7118 Tue Apr 14 00:50:08 1998  Ben Pfaff  <blp@gnu.org>
7119
7120         * Makefile.am: Add crosstabs.c to BUILT_SOURCES.  Add crosstabs.q
7121         to pspp_SOURCES.  Add crosstabs.q to EXTRA_DIST.
7122
7123         * Many source files: Rename `options' to `pv_opts' as appropriate.
7124
7125         * command.c: (static var cmd_table[]) Add CROSSTABS command.
7126
7127         * common.c: (xcalloc) New function.
7128
7129         * crosstabs.q: New file.  Not finished yet, though.
7130                 
7131         * data-list.c: Comment fix.
7132
7133         * error.c: Remove some old Checker cruft.
7134
7135         * frequencies.q: (dump_full) Cumulate valid percent instead of
7136         regular percent.
7137
7138         * getline.c: Comment fix.
7139
7140         * hash.c: Comment fixes.
7141
7142         * hash.h: (struct hsh_table) Make hash functions return unsigned
7143         instead of int to avoid problems with taking the modulo of
7144         negative return values.  All references changed.
7145
7146         * misc.c: (intlog10) Make its table static const instead of auto.
7147
7148         * sfm-read.c: (read_header) Make `prefix' static const instead of
7149         auto.
7150
7151         * var.h: (union value) Add member `hash'.
7152         (struct variable) Rename prv_index as `foo'--all references
7153         changed.  Reorder.
7154         (typedef pv_opts) Removed.  All references changed.
7155
7156         * vars-prs.c: (parse_variables) Message fixes.
7157         
7158 Mon Mar  9 15:35:08 1998  Ben Pfaff  <blp@gnu.org>
7159
7160         * get.c: (cmd_match_files) Don't reverse the order of FILEs as
7161         they are being inserted.  Don't check for BY variables of
7162         different types.  Discard variables if the active file isn't
7163         included in the merge.
7164         (mtf_processing) Essentially rewritten.
7165         (mtf_merge_dictionary) Check for master/slave variables of
7166         different types/widths.
7167
7168         * vfm.c: (static var not_canceled) New var.
7169         (process_active_file) Don't call vfm_source->read() if
7170         there's no vfm-source.  Initialize not_canceled.
7171         (process_active_file_write_case) Honor and update not_canceled.
7172         (prepare_for_writing) Rollback changes from yesterday, they were
7173         wrong.
7174         (close_active_file) Don't destroy vfm_source unless it exists.
7175         
7176 Mon Mar  9 00:56:16 1998  Ben Pfaff  <blp@gnu.org>
7177
7178         * Lots of source files: Added { } around nested if/else constructs
7179         to avoid new gcc 2.8 warnings.
7180
7181         * data-in.c: (parse_Z) Declare `int' type explicitly.
7182         (convert_Z) Ditto.
7183
7184         * get.c: (struct mtf_file) Add prev, next_min, by, input members.
7185         (cmd_match_files) Initialize mtf_by_values.  Manage by, input,
7186         prev members.  Put TABLEs at the end of the chain and FILEs at the
7187         beginning.  Don't allow the active file in STATE_INIT.  Use proper
7188         `seen' value for the active file.  Fill out the by members and
7189         make sure they're of consistent type.  Do the actual merge
7190         operation.
7191         (mtf_processing_finish) New function.
7192         (var_type_description) New function.
7193         (mtf_free_file) New function.
7194         (mtf_free) Rewritten.
7195         (mtf_delete_file_in_place) New function.
7196         (mtf_read_nonactive_records) New function.
7197         (mtf_compare_BY_values) New function.
7198         (static var mtf_seq_no) New var.
7199         (mtf_processing) New function.
7200         (mtf_merge_dictionary) Assign nval members for the system file
7201         dictionary.  Assign fv values for its variables.  Point each slave
7202         variable to the corresponding master variable.
7203
7204         * hash.c: Include str.h.
7205
7206         * mis-val.c: (copy_missing_values) src arg is const.
7207
7208         * misc.c: (spacing) Make `max' var explicitly int.
7209
7210         * sfm-read.c: (dump_dictionary) Message reformatting.
7211         (sfm_read_case) Add assertion.
7212
7213         * sort.c: Esthetic fixes.
7214
7215         * var.h: (struct match_files_proc) New struct.
7216         (struct variable) Add private data match_files_proc.
7217
7218         * vars-atr.c: (delete_variable) Implement.  Add argument for the
7219         dictionary that owning the variable.
7220         (dup_variable) Add assertion.
7221
7222         * vfm.c: Comment fixes, hopefully the comments are correct now.
7223         (process_active_file) New function.
7224         (process_active_file_write_case) New function.
7225         (process_active_file_output_case) New function.
7226         (prepare_for_writing) Use temp_dict->nval for vfm_info, not
7227         default_dict.nval.
7228         (write_case) Renamed procedure_write_case().  Now write_case is a
7229         pointer to a function.  Style fixes.
7230         
7231 1998-03-05  Ben Pfaff  <blp@gnu.org>
7232
7233         * Makefile.am: (q2c) Link with libmisc.
7234         (version.c) Define default_config_path, include_path,
7235         groff_font_path.
7236
7237         * ascii.c: (ascii_postopen_driver) When the default newline string
7238         is requested, open file in text mode.  Suggested by
7239         palme@uni-wuppertal.de (Hubert Palme).
7240         (static vars line_buf, line_p) Change from char * to unsigned char
7241         *.
7242         (ascii_close_page) char * to unsigned char *.
7243
7244         * cmdline.c: (parse_command_line) Implement -r option by
7245         prepending ~/.pspp/rc to the list of files to process.
7246
7247         * command.c: (cmd_remark) Reset getl_prompt to the standard prompt
7248         before pulling in a final line.
7249         (null_func, null_int_func) Removed (dead code).
7250
7251         * descript.q: (display) Calculate width of variable name column
7252         properly.  Calculate number of valid cases properly.  Reported by
7253         palme@uni-wuppertal.de (Hubert Palme).
7254
7255         * filename.c: (init_filename) Use default_config_path instead of
7256         now obsolete CONFIG_PATH.
7257
7258         * getline.c: (getl_initialize) Use include_path instead of now
7259         obsolete INCLUDE_PATH.
7260         (getl_add_file) New argument `where'.  All references changed.
7261
7262         * groff.c: (find_font_file) Use groff_font_path instead of now
7263         obsolete GROFF_FONT_PATH.
7264         
7265         * postscript.c: (find_ps_file) Use groff_font_path instead of now
7266         obsolete GROFF_FONT_PATH.  Copy through temporary variable to
7267         avoid problems with constness.
7268
7269         * str.h: (macro cs_streq) New macro.
7270
7271         * version.h: (glob var default_config_path, include_path,
7272         groff_font_path) New vars.
7273         
7274 1998-02-23  Ben Pfaff  <blp@gnu.org>
7275
7276         * Many source files: Change verbose_msg() priority levels and
7277         messages.
7278
7279         * aggregate.c: Include debug-print.h.
7280
7281         * cmdline.c: (parse_command_line) Add --safer/-s and --command/-c
7282         options.
7283         (static var pre_syntax_message) Document --safer/-s and
7284         --command/-c.
7285
7286         * command.c: (cmd_erase, cmd_host) Disable if set_safer is set.
7287
7288         * dfm.c: (open_inline_file) [__CHECKER__] Zero out ext->file,
7289         because it's not used but it's still copied.
7290         (open_file_r) Remove gratuitous debug message.
7291
7292         * filename.c: (safety_violation) New function.
7293         (open_file) Remove gratuitous debug messages.  Don't allow pipe
7294         files if set_safer is set.
7295
7296         * get.c: Turn off debugging.
7297
7298         * getline.c: (getl_add_virtual_file) New function.
7299         (getl_read_line) Add verbose_msg() call for opening new syntax
7300         file.
7301         (getl_perform_delayed_reset) Add a return value describing whether
7302         any action was taken.  Call reset_eof().
7303
7304         * getline.h: Comment fix.
7305
7306         * groff-font.c: (groff_read_font) Use `goto next_iteration' in
7307         place of incorrect `continue'.  Use strtok_r() instead of
7308         strtok().  Always check strtok_r() return value.
7309         (groff_read_DESC) Use strtok_r() instead of strtok().
7310
7311         * lexer.c: (reset_eof) New function.
7312
7313         * main.c: (parse) Get a token after performing a delayed reset
7314         action; allow empty syntax files.
7315
7316         * postscript.c: (output_encodings) Use strtok_r() instead of
7317         strtok().
7318
7319         * q2c.c: (dump_parser) Use strtok_r() instead of strtok().
7320
7321         * set.q: Comment fixes.
7322         (glob var set_safer) New var.
7323         (internal_cmd_set) Support SAFER.
7324
7325         * str.h: [!HAVE_STRTOK_R] Declare strtok_r() prototype.
7326
7327         * temporary.c: (free_dictionary) Set d->splits to NULL after
7328         freeing.
7329
7330         * vars-atr.c: (clear_variable) Decrement dict->n_splits if
7331         variable deleted, not if it *isn't* deleted.
7332
7333 1998-02-16  Ben Pfaff  <blp@gnu.org>
7334
7335         * command.c: (array cmd_table[]) Add MATCH FILES.
7336
7337         * common.c: Comment fixes.
7338
7339         * data-list.c, dfm.c, error.c, filename.c, list.q, matrix-data.c,
7340         modify-vars.c, postscript.c, sfm-read.c, sfm-write.c, tab.c:
7341         Include alloca.h.  Problem reported by palme@uni-wuppertal.de
7342         (Hubert Palme).
7343
7344         * expr-opt.c: Include str.h.  Problem reported by
7345         palme@uni-wuppertal.de (Hubert Palme).
7346
7347         * get.c: (cmd_get) [DEBUGGING] Update v->p.get to v->get.
7348         (static var mtf_by) Change from char ** to variable **.
7349         (static var mtf_master) New var.
7350         (mtf_merge_dictionary) New function.
7351         (cmd_match_files) Init mtf_master.  Parse mtf_by according to new
7352         var type.  Reorder tests properly.  Initialize file->dict.  Detect
7353         TABLE= without BY=.  Read file dictionaries and merge them.  Give
7354         subcommand name with IN, LAST, FIRST error messages.  Create IN,
7355         LAST, FIRST variables.  Comment fixes.
7356         (mtf_free) Don't free default_dict.  Free mtf_master.
7357
7358         * getline.c: Define getl_mode.  Change getl_buf_size to size_t
7359         from int.
7360         (handle_line_buffer) Cast int to size_t in comparison to avoid
7361         warning.
7362
7363         * getline.h: Declare getl_mode extern.
7364
7365         * groff-font.c: (groff_read_font) Type-fix calls to getline.
7366         (groff_read_DESC) Make line_size a size_t.
7367         (match_tok) Parenthesize name to avoid macro expansion.
7368
7369         * mis-val.c: (copy_missing_values) New function.
7370
7371         * postscript.c: (postopen) Make buf_size a size_t.
7372
7373         * sfm-read.c: (dump_dictionary) Make global from static.  Print
7374         variable info in parts for easier debugging with Checker.
7375
7376         * temporary.c: (copy_variable) Use copy_value_labels().
7377         (new_dictionary) New arg: whether to copy file label, documents.
7378
7379         * val-labs.c: (copy_value_labels) New function.
7380
7381         * var.h: (enums MISSING_*) Add MISSING_COUNT.
7382
7383         * vars-atr.c: [GLOBAL_DEBUGGING] (force_dup_variable) New
7384         function.
7385         (dup_variable) Set prv_index, get.fv, get.nv.
7386
7387 Fri Feb 13 15:38:36 1998  Ben Pfaff  <blp@gnu.org>
7388
7389         * Makefile.am: (pspp_SOURCE) Add htmlP.h.
7390
7391         * Many source files: For ANSI-compliance, add empty statement
7392         after label.  Reported by palme@uni-wuppertal.de (Hubert Palme)
7393         and Micah Altman <maltman@www-vdc.fas.harvard.edu>.
7394
7395         * data-in.c: (parse_numeric) Some header files break on
7396         -DBL_MIN_10_EXP because they get a --; add () for safety.
7397         Reported by palme@uni-wuppertal.de (Hubert Palme).
7398
7399         * dfm.c: Idea by Dr Eberhard W Lisse <el@linux.lisse.na>.
7400         (struct dfm_fhuser_ext) Change `file' from FILE * to file_ext.
7401         (dfm_close) Use close_file_ext.
7402         (open_inline_file) Set file.file to NULL, not file.
7403         (open_file_r, open_file_w) Initialize file.file; fill in file_ext
7404         struct and use open_file_ext().
7405         (read_record) Use file.file.
7406
7407         * file-handle.q: (prepend_current_directory) Pass through special
7408         filenames.
7409
7410         * filename.c: Only include unistd.h if HAVE_UNISTD_H.
7411         (normalize_filename) Pass through special filenames.
7412         (open_file, close_file) Accept pipe| and |pipe syntaxes as
7413         equivalent.
7414         (dirname) Rename blp_dirname() because of name conflict on some
7415         OS.  All references changed.  Reported by palme@uni-wuppertal.de
7416         (Hubert Palme).
7417         (is_special_filename) New function.
7418
7419         * get.c: (GTSV_OPT*) Add GTSV_OPT_MATCH_FILES.
7420         (trim_dictionary) Conditionalize some of the options on whether
7421         GTSV_OPT_MATCH_FILES is in *options.
7422         (rename_variables) Don't allow variables to be renamed as scratch
7423         variables.
7424         (MTF_*) New enum series.
7425         (struct mtf_file) New struct.
7426         (static vars mtf_head, mtf_tail, mtf_by, mtf_n_by, mtf_free) New
7427         vars.
7428         (cmd_match_files, mtf_free) New functions.
7429
7430         * lexer.c: (match_int) Needed parentheses around name to escape
7431         macro expansion.  Reported by Micah Altman
7432         <maltman@www-vdc.fas.harvard.edu>.
7433
7434         * print.c: Needed to include alloca.h.  Reported by Micah Altman
7435         <maltman@www-vdc.fas.harvard.edu>.
7436
7437         * recode.c: (convert_to_double) Parenthesize -DBL_MIN_10_EXP to
7438         -(DBL_MIN_10_EXP).  Reported by palme@uni-wuppertal.de (Hubert
7439         Palme).
7440         
7441         * str.h: Include stdarg.h.  Reported by palme@uni-wuppertal.de
7442         (Hubert Palme) and Micah Altman <maltman@www-vdc.fas.harvard.edu>.
7443
7444 Thu Feb  5 00:18:21 1998  Ben Pfaff  <blp@gnu.org>
7445
7446         * html.c: (struct html_driver_ext) Move into htmlP.h.
7447         (html_preopen_driver) Initialize cp_x, cp_y.
7448         (html_submit) Implement as call to output_tab_table().
7449         (change_attributes) New function.
7450         (escape_string) New function.
7451         (output_tab_table) New function.
7452
7453         * list.q: (write_all_headers) Add code for writing headers for the
7454         html driver.
7455         (clean_up) Write out the html close-table tag.
7456         (determine_layout) Ignore html driver.
7457         (list_cases) Write html data.
7458
7459         * som.c: (som_submit) Move more of the code into output_table().
7460
7461         * tab.c: (static var hit) Make a global var and rename tab_hit.
7462         (static var tab_table_class) Make a global var.
7463
7464         * htmlP.h: New file.
7465
7466 Tue Feb  3 16:12:18 1998  Ben Pfaff  <blp@gnu.org>
7467
7468         * dump-sysfile.c: Removed.
7469
7470         * html.c: (preclose) Change comment in emitted code.
7471
7472         * matrix-data.c: Debugging off by default.  Comment fixes.
7473         (static var container) New var.
7474         (cmd_matrix_data) Create and destroy container.  Initialize
7475         is_per_factor[] to 0s.  Move code into new function
7476         string_to_content_type().  Require split values to be present in
7477         the data when ROWTYPE_ is explicit.  Call specific function, not
7478         general read_matrices().
7479         (string_to_content_type) New function.
7480         (context) Exclude all whitespace, not just spaces.
7481         (mget_token) A dot is a number.  Add assertion.
7482         (static var data) Renamed nr_data.
7483         (static var factor_values) Renamed nr_factor_values.
7484         (read_matrices) Renamed read_matrices_without_rowtype().  Handle
7485         only specific case.  Close data_file before exit.
7486         (fill_matrix) New function.
7487         (read_data_lines) Renamed nr_read_data_lines().  Remove debug
7488         printing.  Style fixes.  Message fixes.  Move code into
7489         fill_matrix().
7490         (read_matrices_without_rowtype) Rename
7491         matrix_data_read_without_rowtype().  Fix off-by-one error on
7492         loops.  Allocate nr_data[] memory from arena.
7493         (read_matrices_with_rowtype) Removed.
7494         (read_splits) Renamed nr_read_splits().  Style fixes.
7495         (read_factors) Renamed nr_read_factors().
7496         (dump_cell_content) Comment fixes.  Arguments changed.  Change
7497         debug printing.  All references changed.
7498         (output_data) Renamed nr_output_data().
7499         (static var wr_content) New var.
7500         (struct factor_data) New struct.
7501         (static var wr_data) New var.
7502         (static var wr_current) New var.
7503         (matrix_data_source_destroy_source) Removed.
7504         (read_matrices_with_rowtype) New function.
7505         (matrix_data_read_with_rowtype) New function.
7506         (wr_read_splits) New function.
7507         (compare_factors) New function.
7508         (wr_output_data) New function.
7509         (wr_read_rowtype) New function.
7510         (wr_read_factors) New function.
7511         (wr_read_indeps) New function.
7512         (glob var matrix_data_source) Make destroy_source member NULL as
7513         well.
7514
7515 Fri Jan 23 00:09:08 1998  Ben Pfaff  <blp@gnu.org>
7516
7517         * lexer.c: (syntax_error) Give better error message when at end of
7518         file.
7519
7520         * matrix-data.c: (var content_names[]) Fix PROX spelling.  Change
7521         N_SCALAR to output as plain N.
7522         (mdump_token) Change output format.
7523         (context) Fix message output interaction with spaces in input.
7524         (another_token) New function.
7525         (force_eol) Improved error message.
7526         (static var max_cell_index) New var.
7527         (read_matrices) Init `cells'.  factor_values is now per-cell.
7528         Init max_cell_index.
7529         (read_data_lines) Replace `compare' local with new `compare' arg.
7530         Debugging messages changed.  Only read factors if per_factor.
7531         Propagate error return from read_factors(), force_eol().
7532         Copy N_SCALAR values across the N vector.
7533         (read_matrices_without_rowtype) Don't init `cells'.  Don't need to
7534         check parentheses manually since we now have is_per_factor[].
7535         Call read_data_lines() with new args.  Check for end of data after
7536         looping, using another_token().
7537         (read_factors) Arguments changed.  Use max_cell_index to determine
7538         whether to read or compare factors.  Message fixes.
7539         (dump_cell_content) New function.
7540         (output_data) Completely rewritten because content types were
7541         supported to be nested inside factor values, not vice versa.
7542         
7543 Thu Jan 22 00:26:38 1998  Ben Pfaff  <blp@gnu.org>
7544
7545         * lexer.c: (syntax_error) Support formatted varargs messages.
7546
7547         * matrix-data.c: Turn debugging on by default.
7548         (static content_type[]) New array.
7549         (static content_names[]) New array.
7550         (static rowtype_, varname_) New vars.
7551         (static is_per_factor[]) New array.
7552         (static split_values) Moved declaration.
7553         (static n_continuous, first_continuous) New var.
7554         (cmd_matrix_data) Don't init split_values.  Assign ROWTYPE_ to
7555         rowtype_.  Simplify SPLIT code.  Init is_per_factor[].  Assign
7556         VARNAME_ to varname_.  Initialize first_continuous, n_continuous.
7557         Check for continuous variables.
7558         [DEBUGGING] (debug_print) Remove content_names[].
7559         (mdump_token) New macro.
7560         (mget_token_dump) New function.
7561         (mdump_token) New function.
7562         (context) New function.
7563         (mget_token) Fix messages.
7564         (static var data, split_values, factor_values) New vars.
7565         (read_matrices) Manage split_values, factor_values.
7566         (read_data_lines) New function.
7567         (read_matrices_without_rowtype) Implemented.
7568         (read_splits) Message fixes.  Uses `just_read'.
7569         (read_factors) New function.
7570         (output_data) New function.
7571         (matrix_data_source_destroy_source) Close the file handle.
7572         (glob var matrix_source) Change name from "DATA LIST" to "MATRIX
7573         DATA".
7574
7575         * str.c: (strpadcmp) Removed.
7576
7577         * vfm.c: (dump_splits) Initialize i; fix test for end of splits.
7578
7579 Sun Jan 18 00:30:59 1998  Ben Pfaff  <blp@gnu.org>
7580
7581         * Lots of source files: Add cast to unsigned character to calls to
7582         tolower() and toupper().
7583
7584         * aggregate.c: Set default_dict.splits to NULL.
7585
7586         * command.c: (static variable tab[]) Add MATRIX DATA.
7587
7588         * data-in.c: Add debugging defines.  Formatting fixes.
7589
7590         * expr-opt.c: Formatting fixes.
7591
7592         * lexer.c: (syntax_error) Message fixes.
7593
7594         * matrix-data.c: New enum series.
7595         (static vars fmt, section, diag, explicit_rowtype, signle_split,
7596         split_values, n_factors, factors, cells, pop_n, contents,
7597         n_contents) New vars.
7598         (cmd_matrix_data) Finished implementation.
7599         (compare_variables_by_mxd_vartype) New function.
7600         [DEBUGGING] (debug_print) New function.
7601         (static vars mtoken, mtokstr, mtoklen, mtokval) New vars.
7602         (read_matrices) New function.
7603         (read_matrices_without_rowtype) New function.
7604         (read_matrices_with_rowtype) New function.
7605         (read_splits) New function.
7606         (mget_token) New function.
7607         (force_eol) New function.
7608         [0] (test_tokenizer) New function.
7609         (matrix_data_source_destroy_source) New function.
7610         (glob var matrix_data_source) New var.
7611
7612         * misc.h: Include ieeefp.h if present.
7613
7614         * split-file.h: (cmd_split_file) Changes corresponding to struct
7615         dictionary changes.
7616
7617         * str.h: Fix memmem prototype.
7618
7619         * temporary.c: (save_dictionary, restore_dictionary,
7620         free_dictionary) Changes corresponding to struct dictionary
7621         changes.
7622
7623         * var.h: (MXD_* enums) New enum series.
7624         (struct matrix_data_proc) New struct.
7625         (struct split) Removed.
7626         (struct dictionary) Changed `splits' member from `split *' to
7627         `variable **'.
7628         (macro force_create_variable) New macro.  Replaced lots of
7629         create_variable()/assert() calls with calls to this macro.
7630
7631         * vars-atr.c: (discard_variables) Changed assertion.
7632         [GLOBAL_DEBUGGING] (force_create_variable) New function
7633         called by the macro of the same name.
7634         (clear_variable) Changes to delete splits from the dictionary
7635         corresponding to struct dictionary changes.
7636
7637         * vars-prs.c: (parse_variables) [GLOBAL_DEBUGGING] Check for
7638         corrupted variable `index' values in the dictionary passed in
7639         every time this function is called.
7640
7641         * vfm.c: (dump_splits, SPLIT_FILE_procfunc) Changes corresponding
7642         to struct dictionary changes.
7643
7644 Tue Jan 13 23:45:02 1998  Ben Pfaff  <blp@gnu.org>
7645
7646         * Makefile.am: (pspp_SOURCES) Add matrix-data.c.
7647
7648         * command.c: New includes.
7649         (static array cmd_table[]) Add ERASE, HOST, NEW FILE.
7650         (cmd_erase) New function.
7651         [unix] (shell) New function.
7652         (run_command) New function.
7653         (cmd_host) New function.
7654         (cmd_new_file) New function.
7655
7656         * expr-prs.c: (parse_primary) Message fix.
7657
7658         * inpt-pgm.c: Formatting fix.
7659         (cmd_reread) Implement the FILE subcommand.
7660
7661         * matrix-data.c: New file.
7662
7663         * q2c.c: (dump_header) Change output commenting style.
7664
7665         * weight.c: Comment fix.
7666
7667 Tue Jan 13 00:53:39 1998  Ben Pfaff  <blp@gnu.org>
7668
7669         * aggregate.c: (buf64_10x) Renamed buf64_1xx, all references
7670         changed.
7671         (buf_10x) Renamed buf_1xx, all references changed.
7672         (cmd_aggregate) Implemented cases 010, 011, 110, and 111 (all
7673         cases now implemented).
7674         (create_sysfile) New function.
7675         (agr_11x_func) New function.
7676
7677         * data-in.c: (parse_numeric) Work properly if there's an
7678         explicitly coded decimal point in the data and decimal places are
7679         specified on DATA LIST.  Bug reported by Dr Eberhard W Lisse
7680         <el@linux.lisse.na>.
7681
7682         * get.c: (cmd_get, cmd_save_internal) Allow extraneous slash
7683         before file specification on GET, SAVE, XSAVE.  Bug reported by Dr
7684         Eberhard W Lisse <el@linux.lisse.na>.
7685
7686         * q2c.c: [!HAVE_STRERROR] Include misc/strerror.c, not
7687         strerror.c.  Bug reported by Alexandre Oliva
7688         <oliva@dcc.unicamp.br>.
7689
7690         * sort.c: Include sort.h.  Comment fixes.  A few esthetic fixes.
7691         (static var separate_case_tab) New var.
7692         (cmd_sort_cases) Cancel temporary transformations here.  Free
7693         v_sort before return.
7694         (sort_cases) Run an EXECUTE procedure if SEPARATE is nonzero and
7695         we're reading from a sort stream.  Don't cancel temporary
7696         transformations.  Offload internal sorting to do_internal_sort().
7697         (do_internal_sort) New function.  Handles internal sorting even
7698         when SEPARATE is nonzero.  Doesn't free v_sort.
7699         (do_external_sort) Take new arg SEPARATE.  Only destroy `x' if
7700         it's non-NULL.
7701         (write_initial_runs) Take new arg SEPARATE.  Only destroy the old
7702         sink if SEPARATE is zero.
7703         (read_output_cases) Renamed read_sort_output(), all references
7704         changed.  Now uses separate_case_tab when it exists.
7705         (write_separate) New function.
7706
7707         * vfm.c: (page_to_disk) Destroy memory_source_cases, not
7708         memory_sink_cases.  Don't redundantly call
7709         vfm_source->destroy_source().
7710         (memory_stream_mode) After switching over, set memory_sink_cases
7711         to NULL.
7712
7713 Sat Jan 10 23:35:51 1998  Ben Pfaff  <blp@gnu.org>
7714
7715         * aggregate.c: (struct agr_var) Expand dbl[] array from 2 to 3
7716         elements.
7717         (static var prev_case) New, moved out of aggregate_single_case()
7718         local scope.
7719         (static var buf64_10x, buf_10x) New.
7720         (cmd_aggregate) Initialize prev_case.  Comment fixes.  Implement
7721         the 000, 001, 100, and 101 cases.  Free prev_case.
7722         (parse_aggregate_functions) Disallow scratch variables.
7723         (free_aggregate_functions) Only free agr_dict if non-null.  Use
7724         iter->function to determine numeric/string type, not
7725         iter->src->type.
7726         (aggregate_single_case) Don't manage prev_case.  Initialize
7727         aggregate info after dumping it.
7728         (accumulate_aggregate_info) Fix sum, weighted sum, mean, weighted
7729         mean, stddev, weighted stddev definitions.
7730         (dump_aggregate_info) Implemented.
7731         (initialize_aggregate_info) Renamed from
7732         initialize_aggregate_functions().  Initializes dbl[2].
7733         (agr_00x_trns_proc, agr_00x_end_func, write_case_to_sfm,
7734         agr_10x_trns_proc, agr_10x_trns_free, agr_10x_end_func) New.
7735
7736         * cases.c: (alloc_val) Removed.
7737
7738         * get.c: (cmd_save_internal) Initialize new `dict' member.
7739
7740         * sfm-write.c: (sfm_write_dictionary, write_header,
7741         write_variable, write_value_labels, write_documents) Reorganize,
7742         simplify for new parameter structure.
7743         (write_variable) Only one variable * argument now.
7744
7745         * sfm.h: (struct sfm_write_info) Removed `pri', `sec', and
7746         replaced by new `dict' member.
7747
7748         * temporary.c: (new_dictionary) Initialize n_documents.
7749
7750         * vars-atr.c: (dup_variable) Allocate `value's from dict into
7751         v->fv manually.
7752         (init_variable, replace_variable) Eliminate usage of alloc_val().
7753
7754         * vars-prs.c: (parse_DATA_LIST_vars) Accept PV_NO_SCRATCH option.
7755
7756         * vfm.c: (arrange_compaction) Allow `temporary' value of 2 to
7757         signal that AGGREGATE is to be used for forming final cases.
7758         (close_active_file) Call end_func before stopping lagging.  Cancel
7759         temporary after finishing compaction.
7760         (write_case) Comment fixes.  Cleaned up.
7761         (compact_case) Let AGGREGATE handle compaction when `temporary' is
7762         2.
7763
7764 Sat Jan 10 02:10:47 1998  Ben Pfaff  <blp@gnu.org>
7765
7766         * Makefile.am: (BUILT_SOURCES) Add means.c.
7767         (pspp_SOURCES) Add means.c.
7768         (EXTRA_DIST) Add means.q.
7769
7770         * command.c: (array cmd_table[]) Add MEANS.
7771
7772         * common.h: Esthetic fixes.  Comment fixes.  Test for
7773         MAX_SHORT_STRING greater than 8.
7774         (macros LOWEST, HIGHEST) New.
7775
7776         * data-in.c, data-list.c, recode.c: Comment fixes.
7777
7778         * means.q: New file, base version.
7779
7780         * mis-val.c: (parse_num_or_range, parse_numeric) Replace -DBL_MAX
7781         with LOWEST, DBL_MAX with HIGHEST.
7782
7783         * q2c.c: (dump_vars) Add an enum to array types giving the number
7784         of values for the enum.
7785
7786         * sfm-read.c: (sfm_read_dictionary, read_machine_flt64_info)
7787         Replace second_lowest_value with second_lowest_flt64.
7788
7789         * sfm-write.c: (write_variable, write_rec_7_34) Replace
7790         second_lowest_value with second_lowest_flt64.
7791
7792         * t-test.q: Comment fix.
7793
7794         * temporary.c: (restore_dictionary) Esthetic fix.
7795
7796         * tokens.h: (force_match_id, force_match, force_string, force_int,
7797         force_num, force_id) Replace msg() with syntax_error().
7798
7799         * var.h: (struct means_proc) New.
7800         (struct variable) Add mns member to `p' union.
7801
7802         * vars-prs.c: (parse_variable, parse_dict_variable,
7803         parse_variables, parse_DATA_LIST_vars) Replace msg() with
7804         syntax_error().
7805
7806 Thu Jan  8 22:28:41 1998  Ben Pfaff  <blp@gnu.org>
7807
7808         * Makefile.am: (pspp_SOURCES) Add tab.h.
7809
7810         * Most source files: Added a cast to unsigned char in usages of
7811         the ctype is*() functions.  Replaced `end of command expected'
7812         calls to msg() with calls to syntax_error().
7813
7814         * frequencies.q: (dump_condensed) Fix tab_dim() column reference.
7815
7816         * lexer.c: (hex_val) Removed (was dead code).
7817         (idmatch) Parenthesize function name to avoid macro expansion.
7818
7819         * postscript.c: Comment fixes.
7820         (ps_preopen_driver) Change default font size to 10pt.
7821
7822         * sfm-read.c: (read_variables) Byteswap sv.print, sv.write as
7823         int32s.
7824         (parse_format_spec) Change system-file format spec argument type
7825         to int32.  Parse the format spec with bitwise operators.
7826
7827         * sfmP.h: (struct sysfile_format) Removed.
7828         (struct sysfile_variable) Changed print, write members from
7829         sysfile_format to int32.
7830
7831         * tokens.h: Esthetic fixes.
7832         [__GNUC__] (macro id_match) New macro to hopefully speed up
7833         identifier matching.
7834         (macros match_id, match_tok, match_int) Implemented in
7835         compiler-independent manner; no longer GNU C only.
7836
7837         * vfm.h: Include time.h.
7838
7839 Mon Jan  5 11:06:15 1998  Ben Pfaff  <blp@gnu.org>
7840
7841         * data-list.c: (dump_fixed_table) Change tab_dim().
7842
7843         * dump-sysfile.c: (open_sysfile) Fix mmap() call.
7844
7845         * error.c: Include command.h.
7846
7847         * frequencies.g: Formatting fixes.
7848
7849         * frequencies.q: Add tab_dim() calls.  Make the total cell a
7850         joined cell.
7851
7852         * glob.c: Include command.h.
7853
7854         * sfm-read.c: (struct sfm_fhuser_ext) New members sysmis, highest,
7855         lowest.
7856         (sfm_read_dictionary) Initialize sysmis, highest, lowest.
7857         (sfm_read_machine_flt64_info) Update sysmis, highest, lowest.
7858         (read_variables) Byteswap sv.type; byteswap sv.print, sv.write as
7859         the other elements (is this right?).
7860         (read_variables) Use lowest, highest members.
7861         (parse_format_spec) New arg `vv' for more stringent checking.
7862         (dump_dictionary) Byteswaps nonexplicit data.
7863         (sfm_read_case) Byteswap numeric data.
7864
7865         * som.c: Initialize table_num to 1.
7866         (render_segments) Remember to increment y_index after each table
7867         segment.
7868
7869         * sysfile-info.c: (cmd_sysfile_info) Change tab_dim().  Don't call
7870         avl_count() on a NULL tree.  No title for the second table.
7871         (cmd_display) Handle DISPLAY VECTORS by calling display_vectors().
7872         Handle AS_SCRATCH as AS_NAMES.  Warn if no variables.  Re-enable;
7873         fix call to display_variables().
7874         (display_variables) Default to 4 columns, not 3.  Set up headers.
7875         Column title is Variable, not Name.  Fix index column.
7876         Add joint text.  Add tab_dim().  Handle value labels properly.
7877         Handle DISPLAY LABELS properly.  Draw boxes correctly.
7878         (describe_variable) Value labels don't need titles.  Don't clear
7879         nonexistent index column.
7880         (compare_vectors_by_name) New function.
7881         (display_vectors) New function.
7882
7883         * tab.c: (tab_height) Add assertion.
7884         (tab_null) Add debug code.
7885         (evaluate_dimensions) Add debug code.
7886
7887         * var.h: (struct variable) get_proc data is sometimes used
7888         simultaneously with other per-procedure info, therefore it was
7889         removed from the union.  All references changed.        
7890
7891 Sun Jan  4 18:13:33 1998  Ben Pfaff  <blp@gnu.org>
7892
7893         * ascii.c: (ascii_close_page) Put title on second line of headers
7894         if there is no subtitle.
7895
7896         * command.c: (glob var cur_proc) Move definition here, from
7897         common.c.
7898         (cmd_remark) Emit blank line before remarks.
7899
7900         * command.h: (glob var cur_proc) Move declaration here, from
7901         common.h.
7902
7903         * data-list.c: (dump_fixed_table) Fix messages.
7904         (dump_free_table) Call tab_nat_dim().
7905
7906         * descript.q: (dump_z_table) Modify tab_dim() call.
7907
7908         * frequencies.q: (dump_condensed, dump_statistics) Add tab_dim()
7909         call.
7910         (dump_statistics) Don't output header.
7911
7912         * groff-font.c: Minor format fix.
7913
7914         * html.c: Comment fix.
7915
7916         * list.q: (write_varname) Indent after advancing page.
7917
7918         * output.h: Minor reordering.
7919
7920         * postscript.c: Comment fixes.  Many places, '\n' was replaced by
7921         a reference to eol[].
7922         (struct ps_driver_ext) New member eol[].
7923         (ps_preopen_driver) Initialize eol[].
7924         (ps_postopen_driver) Fix sense of text for text_opt, line_opt
7925         defaults.  Handle headers.  Fix test for minimum page length.
7926         (static var option_tab[]) Add `line-ends'.
7927         (ps_option) Handle line-ends to change eol[].
7928         (postopen) Scale prop_em_width and fixed_width properly.  Set the
7929         prologue title to outp_title if applicable.  Replace the prologue
7930         line ends with eol[].  Call draw_headers() if headers are enabled.
7931         (text_width) New function.
7932         (out_text_plain) New function.
7933         (draw_headers) New function.
7934
7935         * print.c: (dump_table) Call tab_nat_dim().
7936
7937         * som.c: (som_blank_line) Only advance a line if not at the top of
7938         a page.
7939         (som_submit) Move several informational table calls here.
7940         Increment subtable_num if SOMF_NO_TITLE not set.
7941         (output_table) Advance a line if SOMF_NO_SPACING not set.
7942         (render_columns, render_segments, render_simple) Handle spacing
7943         between tables.  Handle table titles.  Remove debug output.
7944
7945         * som.h: (SOMF_*) New enum series.
7946         (struct som_table_class) New member `flags'.
7947
7948         * sysfile-info.c: (cmd_sysfile_info) Calls tab_nat_dim().  No
7949         headers or spacing.
7950         (display_variables) Calls tab_nat_dim().
7951         (describe_variable) Remove restriction on number of value labels.
7952         Make value labels separated by thin lines.
7953
7954         * tab.c: (tab_create) Default `flags' to none.
7955         (tab_float) New arg `w'.  All references changed.
7956         (tab_nat_dim) New function.
7957         (tab_output_text) No title or spacing.
7958         (tab_flags) New function.
7959         (tabi_flags) New function.
7960         (tabi_title) New function.
7961         (strip_height) Removed.
7962         (tabi_render) Skip title when necessary.
7963         (static var tab_tab_class) Add tabi_flags, tabi_title.
7964         (evaluate_dimensions) Disable display of column, row size.
7965         (sum_columns) Add title height to top header.
7966         (render_strip) Moved within file.
7967
7968         * tab.h: (struct tab_table) New member `flags'.
7969
7970         * vfm.c: (dump_splits) Calls tab_nat_dim().  No title.
7971
7972 Sat Jan  3 16:55:44 1998  Ben Pfaff  <blp@gnu.org>
7973
7974         * Most source files: Add `const' attribute in all appropriate
7975         places.
7976         
7977         * sysfile-info.c: (cmd_sysfile_info) Add tab_dim() call, add a
7978         column to the variables table for use by describe_variable().
7979         (cmd_display) Disable for the present.
7980         (display_documents) Don't wrap documents.
7981         (display_variables) Table has four columns now.
7982         (describe_variable) Table has four columns now.  Don't use a
7983         subtable, use joined cells instead.
7984
7985         * tab.c: (tab_create) Don't set `join'.
7986         (tab_realloc) ct array is not made up of a_string's.
7987         Reallocate trh, hrh, h arrays, initialize trh array.  Initialize
7988         cell contents on GLOBAL_DEBUGGING, not DEBUGGING.
7989         (text_format) New function.
7990         (tab_title) Rewritten, uses text_format().
7991         (tab_text) Rewritten, uses text_format().
7992         (tab_joint_text) New function.
7993         (tab_join) Removed.
7994         (static var hit) New variable.
7995         (render_strip) New args r1, r2.  Implement joined cells that fit
7996         on a single page.
7997         (tabi_render) Increment hit.  Pass new args to render_strip().
7998         (evaluate_dimensions) [GLOBAL_DEBUGGING] Check for uninitialized
7999         cells.  For t_naw and t_nah, ignore joined cells and null cells in
8000         calculations.
8001         
8002         * tab.h: (struct tab_join_rect) Removed.
8003         (struct tab_table) Removed `join'.
8004         (TAB_JOIN_MAIN) Removed.
8005         (struct tab_joined_cell) New struct.
8006         (TAT_NOWRAP) New enum.
8007
8008 Fri Jan  2 01:39:58 1998  Ben Pfaff  <blp@gnu.org>
8009
8010         * ascii.c: (ascii_postopen) Replace ASCII_* macros with their
8011         expansions.
8012         (ascii_postopen_driver) Fix initialization of *_spacing so that
8013         the TAL_0 bit doesn't count.
8014
8015         * data-list.c: (dump_fixed_table) Use natural width for Format
8016         column.
8017
8018         * glob.c: (rerange) Removed.
8019         (get_date) Formatting fixes.  Internationalization fix.
8020
8021         * html.c: (html_postopen_driver) Replace HTML_DEFAULT_OUTPUT_FILE
8022         with "pspp.html".
8023
8024         * postscript.c: (ps_postopen_driver) Replace
8025         PS_DEFAULT_OUTPUT_FILE with "pspp.ps".
8026
8027         * som.c: (som_submit) Don't eject page before every table.
8028         (output_table) Fix order of arguments on call to area().
8029         (render_columns) Fix calculation of max_len.
8030         
8031         * tab.c: (tabi_cumulate) Minor change to increase elegance.
8032         (render_strip) New function.
8033         (strip_height) New function.
8034         (tabi_render) Rewrite as calls to render_strip().
8035
8036         * tab.h: (TAT_* enums) Removed TAT_RICH, all references removed.
8037         Renumbered TAT_PRINTF, TAT_TITLE, TAT_FIX to correspond better
8038         with the TAB_* and OUTP_T_* constants.
8039         
8040 Thu Jan  1 11:53:52 1998  Ben Pfaff  <blp@gnu.org>
8041
8042         * Makefile.am: Formatting fixes.
8043
8044         * ascii.c: (ascii_postopen_driver) Initialize *_line_spacing[],
8045         *_line_width[].
8046
8047         * data-list.c: (dump_fixed_table) Add tab_dim() call.
8048
8049         * descript.q: (dump_z_table, display) Add tab_dim() calls.
8050
8051         * dump-sysfile.c: (glob var length) Make type off_t.
8052         (usage) Fix arguments.
8053         (main) Return 0.
8054
8055         * output.h: (OUTP_T_*) Change constants' value to match tab.h.
8056         Now right-justification is the default so many references had to
8057         change.
8058         (struct outp_class) Removed line_width, all references changed.
8059         (OUTP_DEV_*) Add OUTP_DEV_DISABLED.
8060         (struct outp_driver) Add elements horiz_line_width,
8061         vert_line_width, horiz_line_spacing, vert_line_spacing.  Remove
8062         som element.
8063
8064         * postscript.c: (outp_encodings) Formatting fixes.  Fix garbage
8065         collection.
8066         (postopen) Initialize all the informational members of
8067         outp_driver.
8068
8069         * som.c: (som_blank_line) New function, renamed from blank_line(),
8070         all references changed.
8071         (som_submit) Disables drivers whose pages can't be opened.
8072         (render_columns, render_simple, render_segments) Add debug output.
8073         (render_columns) Fix loop range.
8074         (render_simple) Don't try to render the headers, they're taken
8075         care of automatically.  Advance cp_y past the table when done.
8076         (render_segments) Fix loop ranges.
8077
8078         * tab.c: Initialize new members of tab_table.
8079         (tab_vline) Handle trv[]; don't set style for spacing-only lines.
8080         (tab_hline) Handle trh[]; don't set style for spacing-only lines.
8081         (tab_box) Handle trh[], trv[]; don't set style for spacing-only
8082         lines.
8083         (set_expr) Removed.
8084         (tab_dim) New function.
8085         (tab_col_width) Removed.
8086         (tab_row_height) Removed.
8087         (tab_output_text) Call tab_dim().
8088         (tabi_driver) Call evaluate_dimensions(), sum_columns().
8089         (tabi_area) Implemented.
8090         (tabi_cumulate) Implemented.
8091         (tabi_render) Partially implemented, but broken.
8092         (var tab_table_class) Made static.
8093         (evaluate_dimensions) New function.
8094         (sum_columns) New function.
8095
8096         * tab.h: (enum t_*) Now start at t_end.  New: t_ptw, t_nr, t_nc,
8097         t_nah, t_naw, t_neg, t_xch, t_dup, t_lbl, t_jnz, t_sac, t_sar,
8098         t_scr, t_srr, t_sentinel.  Removed: t_nat.
8099         (struct tab_table) New: wl, wr, ht, hb, trh, hrh, trv, wrv, dim,
8100         max_stack_height, w, h.  Removed: ce, re.
8101         (macro blank_line) Removed.
8102         (glob var zero_length) Removed.
8103
8104 Fri Dec 26 15:44:31 1997  Ben Pfaff  <blp@gnu.org>
8105
8106         * Most source files: include some of the new include files broken
8107         out of var.h.
8108         
8109         * Makefile.am: (pspp_SOURCES) Add all the new source files to the
8110         list.
8111
8112         * aggregate.c: (glob var outfile) Make static.
8113
8114         * command.c: (glob var pgm_state) Move here.
8115
8116         * common.c: (glob vars endian, second_lowest_value, pgmname,
8117         finished, curdate, cur_proc, start_interactive, history_file) Move
8118         here.
8119
8120         * descript.q: (structs dsc_z_score, descriptives_trns) Move here.
8121
8122         * file-handle.q: (glob vars files, inline_file) Move here.
8123
8124         * glob.c: Lost lots of glob vars, detailed in individual file
8125         entries.
8126         (init_glob) set_printer, set_screen were obsolete, deleted.
8127         set_cprompt has fewer spaces because pspp has fewer letters than
8128         fiasco.
8129
8130         * inpt-pgm.c: (glob vars inp_init, inp_init_size) Move here.
8131         (inp_nval) Made static.
8132
8133         * lexer.c: (glob vars token, tokval, tokstr, tokstr_size,
8134         tokstr_len, toklongstr, tokint) Move here.
8135
8136         * misc.c: Lost several vars and functions.
8137
8138         * set.q: (all the set_* variables) Move here.
8139
8140         * str.c: (strmaxcpy, strbarepadcpy, strbarepadlencpy, strpadcpy,
8141         blpstrset, strpadcmp, memrev, memrmem, cmp_str) Move here from
8142         misc.c.
8143
8144         * tab.c: (set_expr, tab_col_width, tab_row_height) New functions.
8145
8146         * tab.h: (enum series t_*) New enums.
8147         (struct tab_table) Use arena struct tag.  New members ce, re.
8148
8149         * tokens.h: Comment fixes.
8150
8151         * var.h: Move lots of enums and variables and functions and
8152         structures to other files.  Use and declare a lot more union and
8153         struct tags.  Comment fixes.  
8154
8155         * vector.c: (glob vars vec, nvec) Move here.
8156
8157         * vfm.c: (glob vars reinit_sysmis, reinit_blanks, init_zero,
8158         init_blanks, last_vfm_invocation) Move here.
8159
8160         * cases.h: New file.
8161         (struct long_vec) Move here.
8162         (vec_init, vec_clear, vec_insert, vec_delete, devector, envector)
8163         Move here.
8164
8165         * command.h: New file.
8166         (STATE_* enums) Move here.
8167         (glob var pgm_state) Move here.
8168
8169         * format.c: New file.
8170         (glob var formats) Move here.
8171         (parse_format_specifier_name, fmt_to_string,
8172         check_input_specifier, check_output_specifier,
8173         check_string_specifier, convert_fmt_ItoO, parse_format_specifier)
8174         Move here.
8175
8176         * format.h: New file.  Move functions now in format.c here.
8177         (FMT_* enums) Move here.
8178         (struct fmt_desc) Move here.
8179         (FCAT_* enums) Move here.
8180         (struct fmt_spec) Move here.
8181         (glob vars formats, fmt_parse_ignore_error) Move here.
8182
8183         * inpt-pgm.h: New file.
8184         (INP_* enums) Move here, make #defines into enums.
8185         (glob vars inp_init, inp_init_size) Move here.
8186
8187         * sort.h: New file.
8188         (glob vars v_sort, nv_sort) Move here.
8189         (sort_cases, read_sort_output) Move here.
8190
8191         * vector.h: New file.
8192         (struct vector) Move here, add struct tag.
8193         (glob vars vec, nvec) Move here.
8194         (find_vector) Move here.
8195
8196         * New file.
8197         (glob vars last_vfm_invocation, temp_case, reinit_sysmis,
8198         reinit_blanks, init_zero, init_blanks) Move here.
8199         (struct case_stream) Move here.
8200         (glob vars vfm_source, vfm_sink, vfm_memory_stream,
8201         vfm_disk_stream, sort_stream, data_list_source,
8202         input_program_source, file_type_source, get_source, n_lag) Move
8203         here.
8204         (procedure, write_case, lagged_case, compact_case, page_to_disk)
8205         Move here.
8206                 
8207 Wed Dec 24 22:40:42 1997  Ben Pfaff  <blp@gnu.org>
8208
8209         * Makefile.am: (pspp_SOURCES) Added html.c, som.c, som.h.
8210         (LDADD) Add libdcdflib.
8211
8212         * ascii.c: Comment and formatting fixes.  Almost every external
8213         function had an assert added, checking driver_open and page_open.
8214         (ascii_init_driver) Broken into ascii_preopen_driver,
8215         ascii_postopen_driver, ascii_close_driver.  Manages driver_open.
8216         (ascii_open_page) Sets page_open.
8217         (ascii_close_page) Clears page_open.
8218
8219         * html.c: Comment and formatting fixes.  Almost every external
8220         function had an assert added, checking driver_open and page_open.
8221         (html_init_driver) Broken into html_preopen_driver,
8222         html_postopen_driver, html_close_driver.  Manages driver_open.
8223         (html_open_page) Sets page_open.
8224         (html_close_page) Clears page_open.
8225         (html_submit) Disabled.
8226
8227         * lexer.c: (parse_string) Remove debugging printf.
8228
8229         * list.q: (determine_layout) Open a page if one is not yet open.
8230
8231         * output.c: Comment fixes.
8232         (add_class) Set the class member of the new list element.
8233         (parse_options) Don't handle device type.
8234         (colon_tokenize) New function.
8235         (configure_driver) New four-field format with a field for device
8236         type.  Now initialize driver_open, page_open, next, and prev
8237         fields.  Use new colon_tokenize() function.  Don't do a memory
8238         copy to replace a driver, it doesn't work; instead delete the old
8239         driver and insert a new one.
8240         (destroy_driver) Don't call som_destroy_driver().  Close the page
8241         if it's open.  Find the class in the list of classes and decrement
8242         that reference count.  Remove the driver from the global driver
8243         list.
8244         (outp_iterate_enabled_drivers) Renamed outp_drivers().  All
8245         references changed.  Rewritten.  Don't return a driver that's not
8246         enabled.
8247         (outp_eject_page) All references to som_internal_eject_page()
8248         changed to use this.  Sets cp_x to 0 as well as cp_y.
8249
8250         * output.h: (OUTP_I_* enums) Removed.
8251         (struct som_submission_form) Removed.
8252         (struct outp_class) init_driver broken into preopen_driver,
8253         postopen_driver, and close_driver.  submit changed to take a
8254         som_table argument.
8255
8256         * postscript.c: Comment and formatting fixes.  Almost every
8257         external function had an assert added, checking driver_open and
8258         page_open.
8259         (ps_init_driver) Broken into ps_preopen_driver,
8260         ps_postopen_driver, ps_close_driver.  Manages driver_open.
8261         (ps_open_page) Sets page_open.
8262         (ps_close_page) Clears page_open.
8263
8264         * som.c: New file, base implementation.
8265         
8266         * som.h: (struct som_table) Add struct tag.
8267         (enum SOM_COL_ACROSS) Removed.
8268         (SOM_ROWS, SOM_COLUMNS) New enums.
8269         (struct som_table_class) Add member `cumulate'.  Remove `segment';
8270         change `render' arguments.
8271         (struct som_point, struct som_rect) Removed.
8272         (som_submit_table) Fixed typo, should have been som_submit.
8273
8274         * sysfile-info: (describe_variable) Don't try to insert a
8275         subtable; just destroy it for now.
8276
8277         * t-test.q: Include dcdflib/cdflib.h instead of cdflib.h.  Fix
8278         references to value labels.
8279
8280         * tab.c: (tab_destroy) New function.
8281         (tab_columns) Change argument.
8282         [0] (tab_submit) Remove dead code.
8283         (tab_title) Allocate string from the table's arena.
8284         (tab_output_text) Only free the buffer if we allocated it.
8285         (tab_submit) New function.
8286         (static vars t, d) New static vars.
8287         (tabi_table, tabi_driver, tabi_count, tabi_area, tabi_columns,
8288         tabi_headers, tabi_cumulate, tabi_render) New functions.
8289         (glob var tab_table_class) New global var.
8290
8291         * tab.h: (struct tab_join_rect) Don't use a som_rect; directly
8292         encapsulate the rectangle.  All references changed.
8293         
8294 Sun Dec 21 16:18:58 1997  Ben Pfaff  <blp@gnu.org>
8295
8296         * All header files updated to use struct tags in addition to
8297         typedefs for all structures.  Don't use word `struct' in struct
8298         tags.
8299         
8300         * Makefile.am: (pspp_SOURCES) Remove html.c.
8301         (INCLUDES) Replace the lib/* includes with a single lib/ include;
8302         all references updated.
8303
8304         * command.c: (parse_cmd) Remove call to som_check_workspace.
8305         (output_line) Update to new som.
8306
8307         * data-in.c: (parse_numeric) A single dot is not an error; it is
8308         the system-missing value.
8309
8310         * data-list.c: (dump_fixed_table, dump_free_table) Update to new
8311         som.
8312
8313         * data-out.c: Added `const' as appropriate to many prototypes.
8314         (convert_E, convert_F, convert_CCx) Take double argument instead
8315         of value * argument.
8316         (convert_format_to_string) Call changed functions appropriately.
8317         Instead of modifying the caller's value for FCAT_SHIFT_DECIMAL,
8318         make a local copy of the value.
8319
8320         * descript.q: Remove custom_variables() prototype now provided by
8321         q2c.  
8322         (custom_variables) Don't increment sbc_variables, the caller does
8323         this.
8324         (dump_z_table, display) Update to new som.
8325
8326         * error.c: (vmsg) Add const to prototype.  Remove code to handle
8327         `too many errors' condition.
8328         (check_error_count) New function.
8329         (msg) Add const to prototype.
8330
8331         * filename.c: (open_file) Rewrite for elegance.
8332
8333         * frequencies.q: Remove custom_*() prototypes now provided by q2c.
8334         (dump_full, dump_condensed, dump_statistics) Update for new som.
8335
8336         * list.q: Don't include somP.h.  Change all references to
8337         som_driver_ext to refer to the new members of som_driver.  Change
8338         som_internal_eject_page() references to outp_eject_page().
8339
8340         * main.c: (parse) Rewrite for elegance.  Add call to
8341         check_error_count().
8342
8343         * output.c: (add_class, outp_list_classes, outp_configure_driver)
8344         Rewrite or revise for new outp_driver_class_list structure.
8345         (outp_iterate_enabled_drivers) Fix comparison between disabled
8346         devices and current device type.
8347         (outp_eject_page) New function.
8348
8349         * output.h: Comment fixes.
8350         (struct outp_driver) New members driver_open, page_open, cp_x,
8351         cp_y, font_height, prop_em_width, fixed_width.  Deleted members
8352         ref_count, next.
8353         (struct outp_driver_class_list) New struct.
8354         (outp_class_list) Changed to type outp_driver_class_list; all
8355         references updated.
8356
8357         * print.c: (dump_table, print_trns_proc) Updated for new som.
8358
8359         * q2c.c: (dump_vars) Simplify array subcommand code.  Declare
8360         prototypes for custom subcommands.
8361         (dump_subcommand) Always include the `else'.
8362         (dump_parser) Fix comments in output code.
8363
8364         * set.q: Reordered functions.
8365
8366         * som-frnt.c, som-high.c, som-low.c, somP.h: Removed.
8367         
8368         * som.h: Rewritten from scratch.
8369
8370         * str.h: Remove dead code.
8371
8372         * tab.c, tab.h: New files, base implementation.
8373
8374         * sysfile-info.c: (cmd_sysfile_info, describe_variable) Update to
8375         new som.
8376
8377         * t-test.q: New code from John Williams
8378         <johnr.williams@stonebow.otago.ac.nz>.  Include math.h, cdflib.h.
8379         Many many new static vars and defines.
8380         (precalc, postcalc, g_postcalc, z_postcalc, t_pairs, t_groups,
8381         groups_calc, pairs_calc, z_dev_calc, z_calc) New functions.
8382         (struct value_list) New struct.
8383         (variance, covariance, pooled_variance, oneway, pearson_r, f_sig,
8384         t_crt, t_sig, print_t_groups) New functions.
8385         (cmd_t_test) Implemented.
8386
8387         * temporary.c: (cancel_temporary) Only free the temp_dict if it's
8388         non-NULL.
8389
8390         * vfm.c: (dump_splits) Update to new som.
8391
8392 Thu Dec  4 23:02:22 1997  Ben Pfaff  <blp@gnu.org>
8393
8394         * Makefile.am: (fiasco_SOURCES) Add html.c.
8395
8396         * aggregate.c: Base source.
8397
8398         * ascii.c: (postopen, preclose) Reformat.
8399
8400         * data-out.c, expr-evl.c: Comment fixes.
8401         
8402         * filename.c: (open_file) When opening a file for writing, use
8403         line buffering instead of full buffering for better interactive
8404         performance.  Suggested by Valerio Aimale
8405         <valerio@svpop.com.dist.unige.it>.  Also, recognize special file
8406         names `stdin', `stdout', `stderr'.
8407
8408         * groff-font.c: Comment fixes.
8409
8410         * html.c: New file; base version.
8411
8412         * list.q: (write_all_headers, clean_up, determine_layout,
8413         list_cases) Ignore `special' devices for now.  Needs to be fixed
8414         later.
8415
8416         * output.c: (outp_init) Add html driver to list; reverse list
8417         order.
8418
8419         * output.h: (struct outp_class_struct) New members `special',
8420         `submit'; comment fixes.  All references changed.
8421
8422         * postscript.c: (ps_init_driver) Make defaults for text_opt,
8423         line_opt depend on whether the OUTP_DEV_SCREEN bit is set on the
8424         device.
8425         (postopen) Comment fix.
8426         (preclose) Comment fixes, formatting fixes.  Change x->file.file
8427         references to more proper f->file.
8428
8429         * som-high.c: (som_submit_table) Special classes use their own
8430         renderers.
8431
8432         * som.h: Comment fixes.
8433
8434         * temporary.c: (new_dictionary) Don't try to xstrdup() a NULL
8435         string.
8436         
8437 Tue Dec  2 14:36:07 1997  Ben Pfaff  <blp@gnu.org>
8438
8439         * Makefile.am: (fiasco_SOURCES) Add aggregate.c back in.
8440
8441         * aggregate.c: Still working on this.
8442
8443         * command.c: (cmd_table[]) Add AGGREGATE back in.
8444         (split_words) Make '-' a legal word separator as well as ' '.
8445
8446         * main.c: Comment fixes.
8447
8448         * q2c.c: (dump_parser) Don't require the procedure's full name to
8449         be present, in the generated source.
8450
8451         * t-test.q: Change name to `t-test' from `t test'.  Let PAIRS be
8452         multiply specified and let it be default; let MISSING, CRITERIA,
8453         FORMAT be multiply specified.
8454         (cmd_t_test) Parse command name.  [DEBUGGING] Call debug_print().
8455         (custom_groups) Fix defaults.
8456         (custom_pairs) Check whether this is a PAIRS subcommand before
8457         attempting to parse.  Better garbage collection.  Proper storage
8458         allocation.
8459         [DEBUGGING] (debug_print) New function.
8460
8461         * temporary.c: Comment fixes.
8462         (copy_variable) Don't copy variable name and index.
8463         (save_dictionary) Copy variable name and index by hand.
8464
8465         * vars-atr.c: Comment fixes.
8466         (create_variable) New dictionary argument.  All references
8467         changed.
8468         (common_init_stuff) New dictionary argument.  All references
8469         changed.
8470         (init_variable) New dictionary argument.  All references changed.
8471         (dup_variable) New function.
8472
8473         * vars-prs.c: (parse_variables) If there are any errors, we always
8474         return 0.  Previously, it was possible for some types of errors to
8475         be ignored.
8476         
8477 Sat Nov 22 01:20:59 1997  Ben Pfaff  <blp@gnu.org>
8478
8479         * Makefile.am: (fiasco_SOURCES) For 0.1.5 release, remove
8480         aggregate.c.
8481
8482         * command.c: (cmd_table[]) Comment out AGGREGATE; add T TEST.
8483
8484         * list.q, t-test.q: Remove ALL option from VARLIST declaration in
8485         grammar rules.
8486
8487         * q2c.c: Comment fixes.
8488         (SBC_* enums) Remove SBC_VARLIST_ALL; all references removed.
8489         
8490         * t-test.q: (cmd_list) Rename cmd_t_test.
8491
8492         * temporary.c: (new_dictionary) Don't declare as static.
8493         
8494 Fri Nov 21 00:03:06 1997  Ben Pfaff  <blp@gnu.org>
8495
8496         * aggregate.c: Changes, still not finished.
8497
8498         * file-handle.q, frequencies.q, list.q, set.q: Comment fixes.
8499
8500         * q2c.c: Comment fixes.  Now its output is internationalized.
8501         (get_token) Fix parsing of escapes within literal strings.
8502         (main) Fix bad #line directives in output.
8503
8504         * t-test.q: Base implementation.
8505
8506         * temporary.c: (new_dictionary) New function.
8507         (restore_dictionary) [__CHECKER__] Change fill character to *
8508         (from @).
8509         
8510 Sun Nov 16 01:29:57 1997  Ben Pfaff  <blp@gnu.org>
8511
8512         * Makefile.am: (BUILT_SOURCES, fiasco_SOURCES) Add t-test.c
8513
8514         * aggregate.c: Changes, still not finished.
8515
8516         * descript.q, list.q: Comment fixes.
8517
8518         * q2c.c: Almost completely rewritten.
8519
8520         * t-test.q: New file, not complete.
8521
8522 Fri Nov 14 00:14:48 1997  Ben Pfaff  <blp@gnu.org>
8523
8524         * aggregate.c: Changes, still not finished.
8525
8526         * sort.c: (sort_cases) Call cancel_temporary() instead of doing it
8527         by hand.
8528
8529         * temporary.c: (cancel_temporary) New function.
8530
8531         * vars-atr.c: (discard_variables) Call cancel_temporary() instead
8532         of doing it by hand.
8533
8534         * vfm.c: (close_active_file) After restoring a TEMPORARY
8535         dictionary, set temp_dict to NULL.  Cancel TEMPORARY through
8536         cancel_temporary().
8537         (SPLIT_FILE_procfunc) Comment fix.
8538
8539 Tue Oct 28 16:08:45 1997  Ben Pfaff  <blp@gnu.org>
8540
8541         * Makefile.am: (fiasco_SOURCES) Add aggregate.c.
8542
8543         * aggregate.c: New file, not finished yet.
8544
8545         * command.c: (cmd_table) Add AGGREGATE.
8546
8547         * common.h: (pgm_state) Move declaration to var.h.
8548
8549         * lexer.c: (bin_value_func, oct_value_func, hex_value_func) i18n
8550         fixes.
8551         (parse_string) Message fix.
8552
8553         * recode.c: Comment fix.
8554
8555         * sfm-read.c: (read_variables) Code esthetic fixes.
8556         (write_header) Default date is `Jan', not `JAN'.
8557
8558         * sfmP.h: (bswap_int32) [!__linux__] Fix off-by-one errors.
8559
8560         * sort.c: (cmd_sort_cases) Farm the work out to new function
8561         parse_sort_variables().
8562         (parse_sort_variables) New function.
8563         (sort_cases) New function.  Cancels temporary transformations,
8564         which sorting didn't do previously.
8565         (cmd_sort_cases) Better garbage collection on error.  Uses
8566         do_external_sort().
8567         (write_initial_runs, merge_once) Improved code esthetics.
8568         (sort_stream_read) Reduced to one call to read_output_cases().
8569         (read_output_cases) New function.
8570
8571         * var-labs.c: (cmd_variable_labels) Re-enabled truncation of
8572         variable labels to 120 characters.
8573
8574         * var.h: Comment fixes.
8575         (glob var pgm_state) From common.h.
8576
8577         * vars-atr.c: (discard_variables) Set pgm_state to STATE_INIT.
8578
8579         * vars-prs.c: (parse_DATA_LIST_vars) Support PV_SINGLE in
8580         options.  Set *names to NULL on error.
8581
8582         * vfm.c: (memory_stream_init) Assert compaction_nval != 0.
8583
8584 Thu Oct  9 09:59:49 1997  Ben Pfaff  <blp@gnu.org>
8585
8586         * sfm-write.c, vfm.c: [HAVE_UNISTD] #include <unistd.h>, needed by
8587         SunOS4.  From Alexandre Oliva <oliva@dcc.unicamp.br>.
8588
8589 Wed Oct  8 18:55:24 1997  Ben Pfaff  <blp@gnu.org>
8590
8591         * vfm.c: (page_to_disk) Added missing local variables.
8592
8593 Tue Oct  7 20:23:17 1997  Ben Pfaff  <blp@gnu.org>
8594
8595         * get.c: Comment fix.
8596
8597         * sort.c: (cmd_sort_cases) Attempt to perform internal sort if the
8598         source is anything other than a disk stream, not just if it's in a
8599         memory stream.  Call page_to_disk() before external sort.
8600         (allocate_cases) Message fix.
8601
8602         * vfm.c: (prepare_for_writing) Warn user when paging workspace to
8603         disk.
8604         (page_to_disk) New function.
8605
8606 Sun Oct  5 15:56:14 1997  Ben Pfaff  <blp@gnu.org>
8607
8608         * Makefile.am: (INCLUDES) Include .. instead of $(top_srcdir).
8609
8610         * common.h: (macro strerror) Remove.  From Alexandre Oliva
8611         <oliva@dcc.unicamp.br>.
8612
8613         * get.c: (dict_delete_run) The number of variables to delete is
8614         not necessarily the number of variables that need to be shifted
8615         up.
8616         (trim_dictionary) Don't set *options to 0.  Fix bug that caused
8617         too many variables to be deleted.
8618
8619         * postscript.c: Comment fix.
8620
8621         * q2c.c: Include strerror.c.  From Alexandre Oliva
8622         <oliva@dcc.unicamp.br>.
8623
8624         * set.q: #undef ON and OFF.  From Alexandre Oliva
8625         <oliva@dcc.unicamp.br>.
8626
8627         * sfm-read.c: (sfm_read_dictionary) Don't set the file class too
8628         early, otherwise errors cause a bad free().
8629
8630         * str.h: (macro nvsprintf) s/FORMATS/FORMAT/ typo.  From Alexandre
8631         Oliva <oliva@dcc.unicamp.br>.
8632
8633         * temporary.c: (save_dictionary) Don't allocate memory if
8634         n_documents is 0.
8635
8636         * vfm.c: (memory_stream_write) Message fix.
8637
8638 Sat Oct  4 16:20:43 1997  Ben Pfaff  <blp@gnu.org>
8639
8640         * command.c: (static var cmd_table[]) Define REPEATING DATA
8641         command.
8642
8643         * common.h: Added support for broken systems that are missing
8644         EXIT_SUCCESS, EXIT_FAILURE, RAND_MAX, and/or strerror().
8645
8646         * Many source files: Replace syntax error messages via msg() with
8647         call to syntax_error().
8648
8649         * data-list.c: (dump_fixed_table) Add support for dumping table
8650         for REPEATING DATA as well as DATA LIST FIXED.
8651         (cmd_repeating_data) Allows and requires `/' between subcommands.
8652         Does proper thing with allowing rpd.starts_end to stay 0.  Allows
8653         CONTINUED specifications to be omitted.  Forces CONTINUED to be
8654         specified if ID is.  Calculates starts_end, cont_end from logical
8655         record length as reported by fhp.  Calls dump_fixed_table() if
8656         requested.  Fixed length of record copied by memcpy.
8657         (parse_num_or_var) Sets `num' to 0, not NOT_INT, for variables.
8658         Message fix.
8659         (realize_value) Returns sensible value for out-of-range variable
8660         values.
8661         (rpd_parse_record) New argument `ofs'.  Fixed confusion between
8662         length of occurrences and length of line.  Added warning for
8663         fields that exceed the line length.  Fixed infinite loop.
8664         (read_one_set_of_repetitions) Numerous minor changes for more
8665         complete SPSS compliance.  Message fixes.
8666
8667         * dfm.c: (dfm_close) If the file being closed is the inline file,
8668         read all the remaining data before closing it.
8669         (dfm_get_record) Don't close the file on lossage, as either it
8670         has been closed already or it doesn't belong to us.
8671
8672         * error.c: (puts_stdout) New function.
8673         (vmsg) Use puts_stdout instead of puts.
8674
8675         * file-handle.q: (fh_record_width) New function.
8676
8677         * inpt-pgm.c: (init_case) Fixed buffer overrun when inp_nval % 4
8678         == 0.
8679         (clear_case) Ditto.
8680         (input_program_source_read) Made an old kluge an approved method.
8681
8682         * lexer.c: (syntax_error) New function.
8683
8684         * misc.c: [BROKEN_RAND] (ansi_rand, ansi_srand; static var next)
8685         New.
8686
8687         * output.c: (oupt_get_paper_size) Message fix.
8688
8689         * q2c.c: Numerous fixes to formatting of generated code made to
8690         conform to GNU coding standards.  Uses syntax_error() in generated
8691         code.  Other miscellaneous generated message fixes.  Added support
8692         for broken systems that are missing EXIT_SUCCESS, EXIT_FAILURE,
8693         RAND_MAX, and/or strerror().
8694
8695 Sat Oct  4 02:09:56 1997  Ben Pfaff  <blp@gnu.org>
8696
8697         * data-in.c: Comment fixes.
8698
8699         * data-list.c: (struct repeating_data_trns) New member `id_spec'.
8700         (find_variable_input_spec) New function.
8701         (cmd_repeating_data) Initializes id_spec.
8702         (rpd_parse_record) Implemented.
8703         (read_one_set_of_repetitions) Returns -3 by default in order to
8704         kluge out some potential bugs.
8705
8706         * data-out.c: Comment fixes.
8707
8708         * file-type.c: (internal_cmd_record_type) Message fix.
8709
8710         * inpt-pgm.c: (input_program_source_read) Special temporary kluge
8711         for handling -3 return value.
8712
8713 Sat Sep 20 23:58:15 1997  Ben Pfaff  <blp@gnu.org>
8714
8715         * data-list.c: Comment fixes.
8716         (struct dls_var_spec) Reordered members.
8717         (read_from_data_list_fixed) Restructured.
8718         (struct repeating_data_trns) Reordered members.  Renamed `starts'
8719         as `starts_beg', `ends' as `starts_end'.
8720         (cmd_repeating_data) Calculates length of repeated data if
8721         necessary and possible.
8722         (parse_num_or_var) Don't allow string variables.
8723         (realize_value) New function.
8724         (rpd_msg) New function.
8725         (rpd_parse_record) New function.  Currently stubbed out.
8726         (read_one_set_of_repetitions) Implemented.
8727
8728         * inpt-pgm.c: (input_program_source_read) Comment fix.
8729
8730 Thu Sep 18 21:34:57 1997  Ben Pfaff  <blp@gnu.org>
8731
8732         * command.c: (cmd_end_repeat_p) Removed.
8733         (init_cmd_parser) Doesn't set cmd_end_repeat_p.
8734         (parse_cmd_name) Removed.
8735
8736         * data-list.c: Comment fixes.
8737         (data_list_pgm) Removed `eof' member.
8738         (static var first) New var.
8739         (cmd_data_list) Sets `first'.  Ensures that DATA LIST uses the
8740         FILE TYPE file inside FILE TYPE structures.
8741         (append_var_spec) Appends to *first, not dls.spec.
8742         (parse_fixed) Message fixes.
8743         (struct rpd_num_or_var) New.
8744         (struct repeating_data_trns) New.
8745         (static var rpd) New.
8746         (cmd_repeating_data) New function.
8747         (parse_num_or_var) New function.
8748         (parse_repeating_data) New function.
8749         (read_one_set_of_repetitions) New function.
8750
8751         * file-type.c: (cmd_file_type) Message fixes.  Always
8752         default_handle to FILE TYPE file handle.
8753         (internal_cmd_record_type) Message fixes.
8754
8755 Wed Aug 20 14:22:03 1997  Ben Pfaff  <blp@gnu.org>
8756
8757         * repeat.c: Comment fix.  Disable debugging.
8758
8759         * temporary.c: (restore_dictionary) Sets splits to NULL and
8760         n_splits to 0 before destroying the variables because now doing
8761         this tries to remove split variables.
8762
8763         * vars-atr.c: (discard_variables) Asserts that n_splits is 0 after
8764         destroying the dictionary.
8765         (clear_variable) Removes a variable from splits after destroying
8766         it.
8767
8768 Mon Aug 18 18:06:55 1997  Ben Pfaff  <blp@gnu.org>
8769
8770         * cmdline.c: (set_compat) Removed.
8771         (pick_compat) Removed.
8772         (parse_command_line) Removed -c option.
8773         (pre_syntax_message) Removed -c option.
8774         (usage) Remove compatibility code.
8775
8776         * common.h: (macros VER_PC, VER_WND, VER_X) Removed.
8777         (glob var compat) Removed.
8778
8779         * compute.c: (type_check) Fixed messages about type mismatches.
8780
8781         * data-list.c: (cmd_data_list) Removed compatibility code.
8782         (fixed_parse_compatible) Calls convert_negative_to_dash().
8783         Fixed bug where it only set the variable in fx.spec if it created
8784         the variable itself.
8785         (dump_fmt_list) Spelling fix.
8786         (cut_field) Removed compatibility code.
8787
8788         * dfm.c: (cmd_begin_data) Don't require a command terminator on
8789         BEGIN DATA command.
8790
8791         * expr-evl.c: (evaluate_expression) Implement LAG.
8792
8793         * expr-prs.c: (parse_add) Calls convert_negative_to_dash().
8794         (parse_neg) Calls convert_negative_to_dash().
8795         (LAG_func) Increases n_lag to the lag requested.  Fixed assignment
8796         bug.
8797
8798         * expr.h: (struct expression_struct) Removed member max_lag.
8799
8800         * file-type.c: (parse_col_spec) Calls convert_negative_to_dash().
8801         (internal_cmd_record_type) Removed special handling to produce
8802         negative numbers from dash tokens.
8803
8804         * getline.c: (static var DO_REPEAT_level) New var.
8805         (getl_add_DO_REPEAT_file) Increments DO_REPEAT_level.
8806         (handle_line_buffer) Copies the line into getl_buf; doesn't call
8807         copy_with_DO_REPEAT_substitutions().
8808         (getl_read_line) Maintains value of getl_mode.  Calls
8809         perform_DO_REPEAT_substitutions() whenever DO_REPEAT_level is
8810         positive.
8811         (getl_close_file) Decrements DO_REPEAT_level when appropriate.
8812
8813         * getline.h: (getl_mode) New glob var.
8814
8815         * glob.c: Comment fixes.
8816         (init_glob) Restructured.  Sets set_seed.
8817         (init_compat_dependent) Removed.  All references removed.
8818         (get_date) Format changed from MM/DD/YY to DD MMM YYYY.
8819         (__htonl, __htons) Removed.  (What were these for?)
8820
8821         * lexer.c: (static var tbl) Dash set to class CNUM.
8822         (make_hexit) New function from data-out.c.
8823         (get_token_representation) Rewritten.
8824         (convert_negative_to_dash) New function.
8825         (lex_init_compat_dependent) Removed.
8826         (yylex) A dash is parsed as part of a number if it is followed by
8827         a digit.  The ASCII representation of a number is copied to
8828         tokstr.  String parsing farmed out to parse_string().  Comment
8829         fixes.
8830         (bin_value_func, oct_value_func, hex_value_func, parse_string) New
8831         functions.
8832         (preprocess_line) Line processing depends on interactive/batch
8833         mode, not on compatibility mode.  Removed PC+ compatibility code.
8834
8835         * loop.c: (loop_3_trns_proc) Comment fix.
8836
8837         * main.c: Remove dead code.
8838         (main) Remove call to init_compat_dependent().
8839
8840         * misc.c: (convert_fmt_ItoO) Make E format conversion more
8841         conformant.
8842
8843         * print.c: (parse_string_argument) Calls
8844         convert_negative_to_dash().
8845         (fixed_parse_compatible) Calls convert_negative_to_dash().
8846
8847         * repeat.c: (RPT_* defines) Removed.
8848         (struct rpt_numeric) Removed.
8849         (struct repeat_entry) New member type, changed `replacement' from
8850         char * to char **.
8851         (clean_up) Deallocation adapted to new repeat_entry.
8852         (internal_cmd_do_repeat) `type' defaults to 0.  Remove lookahead()
8853         usage.  Creates vars for `type' of 1.
8854         (parse_ids) Sets type of 1.  Adapted to new repeat_entry.
8855         (store_numeric) Rewritten, new interface.
8856         (parse_numbers) Rewritten.
8857         (parse_strings) Rewritten.
8858         (find_DO_REPEAT_substitution) New function.
8859         (perform_DO_REPEAT_substitutions) New function.
8860         (copy_with_DO_REPEAT_substitutions) Removed.
8861         (debug_print) Rewritten.
8862
8863         * set.q: Comment fix.
8864         (custom_results) Removed compatibility code.
8865         (internal_cmd_set) Removed SET EMULATION subcommand.  Removed
8866         compatibility code.
8867
8868         * sysfile-info.c: (cmd_display) Removed compatibility code.
8869
8870         * tokens.h: Comment fixes.
8871         (token types enum) Removed `toktype' typedef name for this int
8872         type.  Removed SUBST.  Restructured.
8873
8874         * vars-atr.c: (discard_variables) Sets n_lag to 0.
8875
8876         * vars-prs.c: Comment fix.
8877
8878         * vfm.c: Comment fixes.
8879         (glob var n_lag) New var.
8880         (static vars lag_count, lag_head, lag_queue) New vars.
8881         (procedure) Removed argument nlag.
8882         (setup_lag) New function.
8883         (close_active_file) Discards lagging state.
8884         (lag_case) New function.
8885         (lagged_case) New function.
8886         (write_case) Lags a case if lagging.
8887
8888         * weight.c: (cmd_weight) Removed compatibility code.
8889         
8890 Sun Aug 17 22:34:40 1997  Ben Pfaff  <blp@gnu.org>
8891
8892         * getline.h: (struct getl_script) New members loop_index, macros.
8893
8894         * getline.c: (getl_add_file) Sets first_line field to NULL.
8895         (getl_add_DO_REPEAT_file) New function.
8896         (handle_line_buffer) When the current line's length is negative,
8897         set the filename and line number.  Increment line number after
8898         reading line.  Pass the line to
8899         copy_with_DO_REPEAT_substitutions() for processing.
8900         (getl_close_file) Free DO REPEAT lines before freeing the
8901         filename, and just set the filename to NULL when doing this,
8902         because otherwise the filename gets freed twice.
8903
8904         * glob.c: (glob var queuing) Removed.  All references removed.
8905
8906         * lexer.c: Comment fixes.
8907         (get_token_representation) New function.
8908
8909         * repeat.c: Comment fixes.
8910         (struct repeat_entry) Replaced type and v union members with a
8911         simple string.
8912         (append_record) New function.
8913         (internal_cmd_do_repeat) Started reforming it for the new
8914         repeat_entry struct.  Properly records filename changes in the
8915         getl_line_buf.  Fixed improper use of = for ==.  Fixed sense of
8916         strncasecmp() result usage.  Uses append_record() to simplify.
8917         Properly discards END REPEAT line.  Calls getl_add_DO_REPEAT_file
8918         to add in the file.
8919
8920         (copy_with_DO_REPEAT_substitutions) Started coding.
8921
8922         [DEBUGGING] (debug_print_lines) New function.
8923
8924         * set.q: (custom_results, internal_cmd_set) s/VER_PCP40/VER_PC/;
8925
8926         * tokens.h: (macro is_id1, is_idn) New macros.
8927
8928 Sat Aug 16 10:57:41 1997  Ben Pfaff  <blp@gnu.org>
8929
8930         * cmdline.c: (static var pre_syntax_message) Changed `win'
8931         compatibility mode to `wnd'.
8932
8933         * data-list.c: (fixed_parse_spss) Renamed
8934         fixed_parse_compatible().
8935
8936         * glob.c: (init_glob) Excise unused code for
8937         program_invocation_short_name.
8938
8939         * lexer.c: (preprocess_line) Leading indentors are ignored in Wnd
8940         as well as in X.
8941
8942         * print.c: (fixed_parse_spss) Renamed fixed_parse_compatible().
8943
8944         * set.q: `win' compatibility renamed `wnd'.
8945
8946 Thu Aug 14 22:11:12 1997  Ben Pfaff  <blp@gnu.org>
8947
8948         * filename.c: [__WIN32__] Change the included Windows header files
8949         (again).
8950         (absolute_filename_p) [__MSDOS__] A filename with a colon as the
8951         second character is absolute.
8952         (dirname) Fix logic error.  Don't printf() the results.
8953         (prepend_dir) Don't printf() the results.
8954
8955         * getline.c: (handle_line_buffer) New function.
8956         (getl_read_line) Reads line with handle_line_buffer() when
8957         appropriate.
8958         (getl_close_file) Discard line buffer data.
8959
8960         * getline.h: Comment fixes.
8961         (struct getl_line_list) New struct.
8962         (getl_script_struct) Added line buffer members.  These are hooks
8963         for use by DO REPEAT to allow it to insert virtual source code
8964         into the program.
8965
8966         * glob.c: (init_glob) [__DJGPP__ || (__WIN32__ && __BORLANDC__)]
8967         Override Borland C++ stupidity that claims Windows has a console
8968         window size of 0x3.
8969
8970         * repeat.c: This is in the process of being restructured from
8971         using a token-buffering approach to the DO REPEAT facility to
8972         using the more flexible approach of a line-buffering approach in
8973         conjunction with the getline module.  Comment fixes.
8974         (struct tok_struct) Removed.
8975         (static vars queue_index, queue_head, queue) Removed.
8976         (static vars line_buf_head, line_buf_tail) New vars.
8977         (internal_cmd_do_repeat) Instead of queuing tokens, queue lines.
8978         Not complete.
8979         (pull_queue, destroy_queue) Removed.
8980         [DEBUGGING] (debug_print_tokens) Removed.
8981
8982 Tue Aug  5 13:57:58 1997  Ben Pfaff  <blp@gnu.org>
8983
8984         * file-handle.q: (prepend_current_directory) New function.
8985         (internal_cmd_file_handle, fh_get_handle_by_filename) Prepends
8986         current directory before normalizing filename.
8987
8988         * filename.c: (gnu_getcwd) New function.
8989         (absolute_filename_p) New function.
8990         (search_path) New argument, PREPEND.  All references changed to
8991         pass NULL except those explicitly mentioned.  Uses
8992         absolute_filename_p().  Prepends PREPEND before trying the
8993         filename.
8994         (dirname, prepend_dir) New functions.
8995
8996         * getline.c: (getl_get_current_directory) New function.
8997         (getl_include) Passes getl_get_current_directory() as PREPEND arg
8998         to search_path().
8999                 
9000 Sun Aug  3 11:42:36 1997  Ben Pfaff  <blp@gnu.org>
9001
9002         * In several source files, the term `script' was replaced with
9003         `syntax file' inside error messages.  Usage of the term `script'
9004         in the sense of a syntax file is now deprecated.
9005
9006         * cmdline.c: (static vars pre_syntax_message, post_syntax_message)
9007         Updated messages.
9008
9009         * dump-sysfile.c: (usage) Update message.
9010
9011         * getline.c: (getl_read_line) Ignore lines beginning with `#!'.
9012
9013         * getline.h: (glob var getl_include_path) Declare extern.
9014
9015         * list.q: Define EXTERN as extern before #including somP.h.
9016
9017         * var.h: Remove declaration of `disptype' variable.
9018
9019         * vfm.c: (close_active_file) After switching the data sink to a
9020         data source, set vfm_sink to NULL, because it doesn't exist any
9021         more.
9022
9023 Thu Jul 17 21:41:44 1997  Ben Pfaff  <blp@gnu.org>
9024
9025         * glob.c: [__BORLANDC__] Include math.h.  Define _matherr() and
9026         _matherrl() to ignore all math errors.
9027
9028         * sfm-read.c: (read_value_labels) When reading the labels from
9029         disk, read the little parts separately instead of as a struct;
9030         this avoids alignment problems.
9031
9032         * sfm-write.c: (struct sfm_fhuser_ext) New member `elem_type'.
9033         (sfm_write_dictionary) Sets elem_type and frees it on lossage.
9034         (write_header) Allocates and initializes elem_type.
9035         (sfm_write_case) Uses elem_type to determine how to handle each
9036         flt64 element.
9037         (sfm_close) Frees elem_type.
9038
9039         * sfmP.h: Comment fix.
9040         [__BORLANDC__] Uses #pragma -a to adjust structure member
9041         alignment.
9042         
9043 Thu Jul 17 01:55:12 1997  Ben Pfaff  <blp@gnu.org>
9044
9045         * Makefile.am: (fiasco_SOURCES) Remove display.c.
9046
9047         * common.c: Fix typo.
9048
9049         * dfm.c: (read_record) Remove strncasecmp() emulation and fix the
9050         sense of the condition.
9051
9052         * expr-evl.c: (macro ALLOC_STRING_SPACE) [!PAGED_STACK] Add
9053         line-continuation backslash.
9054
9055         * filename.c: [__WIN32__] Include <windef.h> before <winbase.h>.
9056
9057         * frequencies.q: (custom_grouped, add_percentile) Don't use a
9058         non-constant expression as an argument to sizeof.
9059
9060         * glob.c: [__WIN32__ && __BORLANDC__] When including <conio.h>,
9061         undefine gettext macro because that's a conio function.
9062
9063         * hash.h: (hsh_prime_tab declaration) Remove.
9064
9065         * list.q: (write_fallback_headers) Move `leader' allocation out of
9066         main loop.  Change to local_alloc() allocation.
9067
9068         * output.h: Formatting fixes.  Put __attribute__ in right place on
9069         function prototypes.
9070
9071         * sfm-read.c: (read_machine_flt64_info, read_variables) Change
9072         incorrect `SECOND_LOWEST_VALUE' references to proper
9073         `second_lowest_value'.
9074
9075         * som-frnt.c: (EXTERN macro) Define as `extern' instead of null
9076         value.  This way 2 out of 3 of the som files define the vars
9077         extern, the correct way, that actually works under BC++.
9078         (som_set_float) Don't use nonconstant initializers for a struct.
9079
9080         * som-high.c: Add the standard alloca() header.
9081         (replicate_table) Add prototype.
9082
9083         Merged DISPLAY routine.
9084         * sysfile-info.c: (AS_*) New enum series.
9085         (cmd_sysfile_info) Gutted.  Calls describe_variable() to do the
9086         dirty work.
9087         (cmd_display, display_macros, display_documents,
9088         display_variables) Stolen from defunct display.c.
9089         (describe_variable) New function.
9090
9091         * temporary.c: [0] (display_tree) New debug function.
9092         (copy_variable) Performs shallow copy of value labels instead of
9093         deep copy; i.e., just copys the AVL tree and increments the
9094         reference counts.
9095
9096         * val-labs.c: Comment fixes.
9097         (do_value_labels) Optionally skip leading forward slash.
9098         (get_label) Creates only a single value label instead of many
9099         copies of one, and sets the reference count.
9100
9101         * display.c: Removed.
9102
9103         * dump-sysfile.c: New file, not yet complete.
9104
9105 Fri Jul 11 23:02:18 1997  Ben Pfaff  <blp@gnu.org>
9106
9107         For lots of source files I added more verbose_msg's.  These aren't
9108         listed below as they have tested as being benign.  In some cases
9109         these replaced debug_printf() calls.
9110
9111         * output.c: (outp_read_devices) Message fix.
9112
9113         * postscript.c: (output_encodings) Message fix.  Reports errors on
9114         fclose().
9115         (postopen) Message fix.
9116         
9117 Fri Jul 11 14:09:40 1997  Ben Pfaff  <blp@gnu.org>
9118
9119         * dfm.c: (dfm_close) Don't call fclose() for a NULL FILE.
9120
9121         * filename.c: (close_file_ext) Set f->file to NULL *after* closing
9122         it.
9123
9124         * main.c: Remove <malloc.h> #include.
9125
9126         * mis-val.c: (parse_numeric) Set .f member for each missing[]
9127         instead of trying to just set the missing[] itself, which is a
9128         gcc-specific idiom.
9129
9130         * sfm-read.c: (read_variables) Same.
9131
9132         * str.h: Add memmem() prototype.
9133
9134         * val-labs.c, var-labs.c: Replace <malloc.h> with <stdlib.h>.
9135
9136 Thu Jul 10 22:13:53 1997  Ben Pfaff  <blp@gnu.org>
9137
9138         * Makefile.am: (q2c) Don't include any libraries in the link.
9139
9140         * dfm.c: (force_line_buffer_extension) New macro.
9141         (count_tabs) New function.
9142         (tabs_To_spaces) New function.
9143         (read_record) Calls tabs_to_spaces() on the line being processed.
9144
9145         * q2c.c: Disabled i18n for this proglet so that libintl.a doesn't
9146         have to be compiled twice (once for CC, once for LOCAL_CC).
9147  
9148 Sun Jul  6 19:14:33 1997  Ben Pfaff  <blp@gnu.org>
9149
9150         * Makefile.am: (INCLUDES) Add intl directory; fix directories.
9151         (LDADD) Add @INTLLIBS@.
9152         (q2c) Add LIBS, @INTLLIBS@ to link step.
9153
9154         * inpt-pgm.c: Turn off debugging.
9155
9156         * postscript.c: (postopen) Format fix.  local_free() blocks
9157         returned by local_alloc(); don't free() them.
9158
9159 Sat Jul  5 23:44:51 1997  Ben Pfaff  <blp@gnu.org>
9160
9161         * data-in.c: (parse_string_as_format) Comment fix.  Fix check for
9162         string length.
9163
9164         * data-list.c: (read_from_data_list_fixed) Pass proper value for
9165         LEN arg, not simply the full string length.
9166
9167         * sort.c: (allocate_file_handles) Check SPSS compatible temp file
9168         directories before generic temp file directories.
9169
9170         * vfm.c: Disable debugging.
9171
9172 Fri Jul  4 13:26:41 1997  Ben Pfaff  <blp@gnu.org>
9173
9174         * get.c: Comment fix.
9175         (cmd_save_internal) Always passes GTSV_OPT_SAVE option.
9176
9177 Wed Jun 25 22:52:28 1997  Ben Pfaff  <blp@gnu.org>
9178
9179         * expr-prs.c: (debug_print_postfix) Conditionally included on
9180         GLOBAL_DEBUGGING.  Removed out_header() reference.
9181
9182         * exprP.h: Removed #undef GLOBAL_DEBUGGING.
9183
9184 Sun Jun 22 22:00:28 1997  Ben Pfaff  <blp@gnu.org>
9185
9186         * ascii.c: Removed obsolete ascii_close_page() prototype.
9187
9188         * command.c: (output_line) Comment fix.
9189
9190         * data-in.c: Formatting fix.
9191         (parse_string_as_format) Now the `fc' argument is used only for
9192         the purpose of error messages; it is not an index into the string
9193         passed.  All references changed.
9194
9195         * data-list.c: Comment fix.
9196         (cut_field) Comment fix.  Now returns the column number of the
9197         position of the field cut out on success.
9198         (parse_field) Added `column' argument.  Puts the column numbers in
9199         the error message.
9200         (read_from_data_list_free, read_from_data_list_list) Record the
9201         column number returned by cut_field(), pass it to parse_field().
9202
9203         * dfm.c: Comment fix.
9204
9205         * do-ifP.h: Comment fix.
9206
9207         * expr-prs.c: (SYSMIS_func) Implemented string-type arguments for
9208         the SYSMIS function.
9209
9210         * expr.h, exprP.h: Comment fix.
9211
9212         * glob.c: (init_glob) Only calls setlocale() and family if
9213         ENABLE_NLS set.
9214
9215         * hash.h: Comment fix.
9216
9217         * include.c: Comment fix.
9218
9219         * output.c: Comment fix.
9220
9221         * postscript.c: (ps_line_intersection) Simplified assertion.
9222
9223         * repeat.c: Comment fix.
9224
9225         * vars-atr.c: Comment fix.
9226
9227         * vars-prs.c: Comment fix.
9228
9229         * vfm.c: (vector_initialization) [DEBUGGING] Fixed undefined
9230         behavior with usage of postincrement.
9231         (memory_stream_read) Discards cases as it goes. 
9232
9233 Sun Jun 15 16:45:17 1997  Ben Pfaff  <blp@gnu.org>
9234
9235         * Makefile.am: Cleans q2c, not just distcleans it.  Distcleans
9236         foo.
9237
9238         * Most source files: Includes debug-print.h, related comment
9239         fixes.
9240
9241         * cases.c: (alloc_val) Removed complex allocation code.  Merely
9242         increments default_dict.nval and returns the former value.
9243         (envector, devector) Removed references to lv member of struct
9244         variable.
9245
9246         * common.h: (macro VME) Replaced complex definition with simple
9247         one.
9248
9249         * data-list.c: (cmd_data_list) Sets vfm_source instead of
9250         read_active_file and cancel_input_pgm.
9251         (read_from_data_list, cancel_data_list) Removed.
9252         (data_list_source_read, data_list_source_destroy_source) New
9253         functions.
9254         (glob var data_list_source) New var.
9255
9256         * dfm.c: (open_file_r, open_file_w) Simplified debug output.
9257         (cmd_begin_data) Improved criteria for an input program accessing
9258         the inline file.  Still not perfect.
9259
9260         * do-if.c: (do_if_trns_proc) Simplified debug output.
9261
9262         * expr-prs.c: Comment fixes.
9263         [DEBUGGING] (debug_print_postfix) Simplified debug output.
9264
9265         * file-handle.q: (fh_close_handle) Simplified debug output.
9266
9267         * file-type.c: Comment fixes.
9268         (cmd_file_type) Sets vfm_source instead of read_active_file and
9269         cancel_input_pgm.
9270         (cmd_end_file_type) On failure, discards variables in place of
9271         just canceling the input program.
9272         (read_from_file_type) Renamed file_type_source_read.
9273         (cancel_file_type) Renamed file_type_source_destroy_source.
9274         (glob var file_type_source) New var.
9275
9276         * get.c: (GTSV_* enum series) New enums GTSV_OPT_SAVE, GTSV_NONE.
9277         (cmd_get) Initializes options to GTSV_NONE before passing to
9278         trim_dictionary().  Removed `lv' reference.  Sets vfm_source
9279         instead of read_active_file and cancel_input_pgm.
9280         (cmd_save_internal) Initializes options before passing to
9281         trim_dictionary().  Local var `nval' removed.
9282         (dict_delete_run) Comment fixes.
9283         (trim_dictionary) Comment fixes.  Disallows scratch variables if
9284         GTSV_OPT_SAVE set in options.
9285         (read_from_get) Renamed get_source_read.
9286         (cancel_get) Renamed get_source_destroy_source.
9287         (glob var get_source) New var.
9288
9289         * inpt-pgm.c: (cmd_input_program) Sets vfm_source instead of
9290         read_active_file and cancel_input_pgm.
9291         (read_from_input_program) Renamed input_program_source_read.
9292         Simplified debug output.
9293         (cancel_input_program) Renamed
9294         input_program_source_destroy_source.
9295         (glob var input_program_source) New var.
9296
9297         * loop.c: (loop_1_trns_proc) Simplified debug output.
9298
9299         * main.c: (dump_token) Made eof output more explicit.
9300
9301         * sfm-read.c: (read_variables, dump_dictionary) Removed `lv'
9302         references.
9303
9304         * sort.c: (cmd_sort_cases) Disallows scratch variables.  Removed
9305         code for always-memory or always-disk cases.  malloc's case-list
9306         based on vfm_source_info.ncases.  Explicit support for
9307         memory_stream via memory_source_cases.
9308         (do_external_sort) Sets vfm_source instead of read_active_file and
9309         cancel_input_pgm.
9310         (allocate_file_handles) The temporary directory permissions are
9311         set to 0700 instead of 0777.
9312         (allocate_cases) Formatting fixes.  Simplified debug output.
9313         (output_record) Compacts the case if necessary before writing it
9314         out.
9315         (close_handle, open_handle_w) Simplified debug output.
9316         (write_initial_runs) Destroys vfm_sink, then sets it to
9317         sort_stream.  Writes records to memory based on
9318         vfm_sink_info.case_size.
9319         (write_to_sort_cases) Renamed sort_stream_write().
9320         (merge) Simplified error handling.  Simplified debug output.
9321         Formatting fixes.
9322         (read_from_external_sort) Renamed sort_stream_read().
9323         Reads records based on vfm_source_info.case_size.
9324         (sort_stream_write) Writes records to memory based on
9325         vfm_sink_info.case_size.
9326         (sort_stream_mode) New function.
9327         (glob var sort_stream) New variable.
9328
9329         * temporary.c: (cmd_temporary) Simplified debug output.
9330         (copy_variable) Removed references to `lv'.
9331
9332         * title.c: (get_title) Simplified debug output.
9333
9334         * var.h: Comment fixes.
9335         (struct get_proc) Removed member `lv'.
9336         (struct variable) Removed member `lv'.  Comment fixes.
9337         (glob vars read_active_file, write_active_file, cancel_input_pgm)
9338         Removed.
9339         (struct case_stream) New.
9340
9341         * vars-atr.c: (discard_variables) Changed cancel_input_pgm,
9342         read_active_file references to use vfm_source.
9343         (init_variable, replace_variable) Removed references to `lv'.
9344
9345         * vfm.c: Comment fixes.
9346         (glob var vfm_source, vfm_sink, vfm_source_info, vfm_sink_info)
9347         New variables.
9348         (static var queue, qh, qt, n_lag) Removed.  All references
9349         removed.
9350         (glob var compaction_necessary, compaction_nval, compaction_case,
9351         paging) New variables.
9352         (record_case) Removed.
9353         (procedure) Comment fixes.  Calls vfm_source->read() instead of
9354         read_active_file().
9355         (lag) Removed.
9356         (prepare_for_writing, arrange_compaction, make_temp_case,
9357         vector_initialization, setup_filter) New function.
9358         (open_active_file) Most of the code moved into the abovementioned
9359         new functions.  Now sets temp_dict to &default_dict if there is no
9360         temporary dictionary, for convenience.  New debug output.
9361         (close_active_file) Deals with changing the sink to the source.
9362         Calls finish_compaction().  Frees compaction_case.  Mostly
9363         rewritten.
9364         (glob vars disk_source_file, disk_sink_file) New vars.
9365         (destroy_active_file, read_from_memory) Removed.
9366         (disk_stream_init, disk_stream_read, disk_stream_write,
9367         disk_stream_mode, disk_stream_destroy_source,
9368         disk_stream_destroy_sink) New functions.
9369         (glob var vfm_disk_stream) New var.
9370         (glob vars memory_source_cases, memory_sink_cases,
9371         memory_sink_iter, memory_sink_max_cases) New vars.
9372         (memory_stream_init, memory_stream_read, memory_stream_write,
9373         memory_stream_mode, memory_stream_destroy_source,
9374         memory_stream_destroy_sink) New functions.
9375         (glob var vfm_memory_stream) New var.
9376         (write_case) Local var `i' renamed `cur_trns'; local var `retval'
9377         named `more_cases'.  Simplified debug output.  Otherwise mostly
9378         rewritten.
9379         (record_case) Moved into the stream drivers.  Removed.
9380         (transform) Removed (was dead code).
9381         (SPLIT_FILE_procfunc) s/vfm_replacement/vfm_sink_info/.  In the
9382         common case that the splits don't change, we don't need to copy
9383         the case into prev_case again--pointless.
9384         (compact_case) New function.
9385         (finish_compaction) New function.
9386
9387         * vfmP.h: Comment fixes.
9388         (DEV_* enum series) Removed. 
9389         (struct storage) Renamed `stream_info'.  Removed variant record.
9390         Removed `device' member.
9391
9392         * debug-print.h: New file.
9393         
9394 Sun Jun  8 01:12:38 1997  Ben Pfaff  <blp@gnu.org>
9395
9396         * autorecode.c: Turned off debugging.
9397
9398         * data-list.c: (destroy_dls) Closes the associated file handle.
9399
9400         * descript.q: (custom_variables) Added PV_NO_SCRATCH to
9401         parse_variables() options.
9402
9403         * dfm.c: (open_file_r) Removed gratuituous argument to msg() call.
9404
9405         * display.c: (display_variables) Really fixed null cell bug.
9406
9407         * file-handle.q: (fh_close_handle) Changed debugging message.
9408
9409         * frequencies.q: (custom_variables) Added PV_NO_SCRATCH to
9410         parse_variables() options.
9411
9412         * list.q: Added PV_NO_SCRATCH in q2c varlist options.
9413         (cmd_list) Fails if no variables specified.
9414         (determine_layout) Writes blank lines manually.
9415
9416         * loop.c: (loop_1_trns_proc) Made debugging code only print
9417         messages if debugging.
9418
9419         * q2c.c: (dump_subcommand) Appends sbc->message to SBC_VARLIST
9420         parse_variables() arguments.
9421         (main) Parses optional parenthesized options to varlist
9422         subcommands into sbc->message.
9423
9424         * sfm-read.c: Format fix.
9425
9426         * var.h: (FV_*) New enum series.
9427         (PV_*) New enum PV_NO_SCRATCH.
9428
9429         * vars-prs.c: (find_var) Removed.
9430         (fill_all_vars) Takes FV_* enum instead of boolean third
9431         argument.  Rewritten to deal with scratch as well as system
9432         variables.
9433         (parse_variables) Error message on scratch variable if
9434         PV_NO_SCRATCH set.
9435
9436         * vfm.c: (static var virt_begin_func) New var.
9437         (procedure) Sets up virt_begin_func.
9438         (SPLIT_FILE_procfunc) For the first case, calls virt_begin_func()
9439         after dump_splits().  For succeeding groups changes, calls
9440         virt_begin_func() instead of begin_func().      
9441
9442 Fri Jun  6 22:42:23 1997  Ben Pfaff  <blp@gnu.org>
9443
9444         * count.c, data-out.c, file-handle.q, list.q, loop.c: Turned off
9445         debugging.
9446
9447         * dfm.c: Added some debugging messages, disabled by default.
9448         (open_file_r) Fixed error message.
9449         (read_record) On eof on inline_file, instead of calling
9450         fh_close_handle(), simply jump to eof label like a normal file.
9451         Message fixes.
9452
9453         * display.c: Thin lines between rows for certain kinds of
9454         listing.  Fixed `null cell' bug.
9455
9456         * error.c: (failure) Flush stdout, stderr before failing.
9457
9458         * file-handle.q: (fh_close_handle) Added debugging message.
9459
9460         * frequencies.q: (dump_full) Bottom line extends across entire
9461         table width.  Changed title formatting.
9462         (dump_condensed) Changed title formatting.
9463         (dump_statistics) Fixed title formatting.
9464
9465         * glob.c: (init_glob) Moved initialization of cur_proc out of #if.
9466         Sets default value of set_format.
9467
9468         * list.q: (cmd_list) Calls blank_line() before determine_layout().
9469         Passes write_all_headers() to procedure() as pre-group func.
9470         (write_all_headers) New function.
9471         (determine_layout) Removed calls to write_header().
9472         Calls blank_line() before and after write_fallback_headers().
9473
9474         * recode.c: (recode_trns_free) Only attempts to free head->map if
9475         non-NULL.
9476
9477         * sfm-read.c: (read_variables) Allows `#' at beginning of system
9478         file variable names but gives a warning.  Sets `left' based on
9479         first character being/not being `#'.  On lossage frees dict->var.
9480
9481         * som-high.c: (som_draw_title) Simplified title formatting.
9482
9483         * vfm.c: (dump_splits) Fixed and changed splits formatting.
9484
9485 Thu Jun  5 22:51:15 1997  Ben Pfaff  <blp@gnu.org>
9486
9487         * autorecode.c: (cmd_autorecode) Sets h_trans to NULL at
9488         beginning.  Frees v_src, v_dest on successful exit.  Frees
9489         h_trans[*], h_trans on lossage.
9490         (recode) Frees h_trans[*], h_trans.
9491
9492         * dfm.c: (dfm_close) Formatting change.
9493         (open_inline_file) Now passed a dfm_fhuser_ext to initialize; no
9494         longer allocates its own in inline_file.
9495         (open_file_r) Passes the local dfm_fhuser_ext to
9496         open_inline_file().
9497         (open_file_w) Message fix. 
9498         (read_record) Buffer reallocation strategy changed.  Frees
9499         ext->line even in inline_file to prevent leaks.
9500         (dfm_put_record) Fixed bug where `ext' was cached before the file
9501         was opened and thus it would be NULL when the file really was
9502         open.
9503         (cmd_begin_data) Sets up inline_file basics itself, then calls
9504         open_inline_file() for the dfm_fhuser_ext.  Formatting fix.
9505
9506         * list.q: (write_line) Formatting fix.
9507         (clean_up) Minor strategy change.  Sets proportional font after
9508         finishing cleanup.
9509         (determine_layout) Sets fixed font before writing regular headers,
9510         or after writing fallback headers.
9511
9512         * modify-vars.c: (cmd_modify_vars) Frees variable lists for DROP
9513         and KEEP vars after using them.
9514
9515         * postscript.c: (ps_init_driver) Frees x->family.
9516         (postopen) When loading fonts, free the temporary font name buffer
9517         after using it.
9518         (ps_text_set_font_by_position) Free temporary font name buffer
9519         after using it.
9520         (text) Fixed code that calculated `lig' so that `lig' always gets
9521         initialized.  Formatting fix.
9522
9523         * som-low.c: (get_cell_size, som_get_table_size) `prop_height' ->
9524         `font_height'.
9525         [GLOBAL_DEBUGGIGN] (check_table) Use arena_alloc() to allocate
9526         cells, not xmalloc(), so that the cells will get destroyed
9527         automatically.
9528
9529         * sysfile-info.c: (cmd_sysfile_info) Frees the dictionary after
9530         using it.
9531
9532 Tue Jun  3 23:33:22 1997  Ben Pfaff  <blp@gnu.org>
9533
9534         * ascii.c: (ascii_text_draw) Always sets metrics for strings that
9535         are drawn.
9536
9537         * dfm.c: Comment fix.
9538
9539         * list.q: Comment fixes.  Include somP.h.  Removed static vars
9540         table, n_columns, n_rows, part.  New struct list_ext.  New static
9541         var line_buf.
9542         (n_lines_remaining, n_chars_width, write_line) New functions.
9543         (cmd_list, list_cases) Rewritten.
9544         (begin_row, end_row, flush_table) Removed.
9545         (write_header, clean_up, write_varname, write_fallback_headers,
9546         determine_layout) New functions.
9547
9548         * output.c: (outp_iterate_enabled_drivers) Minor reformat.
9549
9550         * output.h: Comment fix.
9551
9552         * postscript.c: Comment fix.
9553         (struct ps_driver_ext) Removed prop_size, fixed_size members;
9554         added font_size.  All references changed.
9555         (ps_init_driver) Initializes font_size.  Simplified space checking
9556         code.
9557         (static var option_tab[]) Removed prop-size, fixed-size; added
9558         font-size.
9559         (ps_option) Handles font_size.
9560
9561         * som-high.c: Moved prototypes into somP.h.
9562         (som_init_driver) New function.
9563         (som_submit_table) Moved some code into new function
9564         som_init_driver().
9565         (build_target) Moved some code into new function
9566         som_internal_eject_page().
9567         (som_eject_page) Uses som_internal_eject_page().
9568         (som_internal_eject_page) New function.
9569
9570         * som-low.c: Moved prototypes into somP.h.
9571
9572         * som.h: Formatting fixes.
9573
9574         * somP.h: (struct som_driver_ext) Removed em_width;
9575         added prop_em_width, fixed_width.
9576
9577 Mon Jun  2 14:25:25 1997  Ben Pfaff  <blp@gnu.org>
9578
9579         * Makefile.am: Added `localedir' definition.  Added
9580         -DLOCALEDIR="..." to DEFS.  Added -I. to INCLUDES.
9581
9582         * ascii.c: (macro draw_line) Fixed capitalization.
9583
9584         * ascii.c, autorecode.c, cases.c, cmdline.c, command.c, common.c,
9585         compute.c, count.c, data-in.c, data-list.c, data-out.c,
9586         descript.q, dfm.c, display.c, do-if.c, error.c, expr-evl.c,
9587         expr-opt.c, expr-prs.c, file-handle.q, file-type.c, filename.c,
9588         formats.c, frequencies.q, get.c, getline.c, glob.c, groff-font.c,
9589         hash.c, heap.c, include.c, inpt-pgm.c, lexer.c, list.q, loop.c,
9590         main.c, mis-val.c, misc.c, modify-vars.c, numeric.c, output.c,
9591         postscript.c, print.c, q2c.c, recode.c, rename-vars.c, repeat.c,
9592         sample.c, sel-if.c, sfm-read.c, sfm-write.c, sfmP.h, som-frnt.c,
9593         som-high.c, som-low.c, sort.c, split-file.c, sysfile-info.c,
9594         temporary.c, title.c, tokens.h, val-labs.c, var-labs.c,
9595         vars-atr.c, vars-prs.c, vector.c, vfm.c, weight.c: Marked strings
9596         for internationlization.
9597
9598         * glob.c: [HAVE_LOCALE_H] Includes locale.h.
9599
9600 Sun Jun  1 23:31:18 1997  Ben Pfaff  <blp@gnu.org>
9601
9602         * do-if.c, sort.c, val-labs.c: Comment fixes.
9603
9604         * glob.c: (init_glob) Uncommented, updated i18n support.
9605         
9606         * arena.c, ascii.c, data-in.c, descript.q, error.c, expr-evl.c,
9607         expr-opt.c, expr-prs.c, filename.c, frequencies.q, groff-font.c,
9608         output.c, postscript.c, sfm-read.c, som-high.c, vars-prs.c: Made
9609         the declarations of macros taking arguments a lot nicer.
9610
9611 Sun Jun  1 17:22:04 1997  Ben Pfaff  <blp@gnu.org>
9612
9613         * error.h: Removed CE, CW aliases for SE, SW.
9614
9615         * q2c.c: Removed explicit streq() definition since it's duplicated
9616         in str.h.
9617         
9618         * approx.h, error.h, font.h, hash.h, misc.h, output.h, somP.h,
9619         stats.h, str.h, tokens.h: Made the declarations of macros taking
9620         arguments a lot nicer-looking of <pinard@iro.umontreal.ca>.
9621         Comment fixes.
9622
9623 Sun Jun  1 12:02:06 1997  Ben Pfaff  <blp@gnu.org>
9624
9625         * cmdline.c: Comment fixes.
9626         (pick_compat) Changed return type to int.  Now, instead of setting
9627         glob var `compat' to the emulation, returns the emulation.  All
9628         references changed.
9629         (parse_command_line) Added terminating null to end of
9630         `long_options' array definition.
9631         (pre_syntax_message) Fixes.
9632         (usage) Shows the default emulation in the syntax message by
9633         calling pick_compat().
9634
9635         * getline.c: (getl_add_include_dir) Separates paths with
9636         PATH_DELIMITER, not DIR_SEPARATOR.
9637
9638         * glob.c: (init_glob) Fixed references to DEFAULT_VER_PCP40,
9639         DEFAULT_VER_WIN61, DEFAULT_VER_X40.
9640
9641         * output.c: (outp_configure_macro) Make earlier definitions for a
9642         particular key override later ones for the same key.
9643         
9644 Fri May 30 19:40:49 1997  Ben Pfaff  <blp@gnu.org>
9645
9646         * ascii.c: Comment fixes.
9647
9648         * output.c: (outp_get_paper_size)
9649         s/STAT_OUTPUT_INIT_FILE/STAT_OUTPUT_PAPERSIZE_FILE/.
9650         
9651 Sun May 25 22:34:07 1997  Ben Pfaff  <blp@gnu.org>
9652
9653         * ascii.c, postscript.c, sfm-read.c, sfm-write.c, sort.c: Include
9654         <errno.h>.  GNU libc 2 enforces this!
9655
9656         * command.c: (parse_cmd) Fixed problem with `else' clause being
9657         paired with wrong `if'.  Comment fix.
9658
9659 Fri May  9 16:53:52 1997  Ben Pfaff  <blp@gnu.org>
9660
9661         * getline.c: [!HAVE_LIBREADLINE] (read_console) Changed
9662         blp_getline() to getline().
9663
9664         * output.c: (outp_eval_dimension) Changed the fix from last time;
9665         there was no variable `a'.
9666
9667         * q2c.c: (get_line) Fixed boundary condition overrun bug.
9668
9669 Mon May  5 21:58:22 1997  Ben Pfaff  <blp@gnu.org>
9670
9671         * output.c: (outp_evaluate_dimension) Fixed handling of negative
9672         numbers having fractional parts.  Added case of a fraction without
9673         a whole-number part.
9674
9675 Fri May  2 22:08:05 1997  Ben Pfaff  <blp@gnu.org>
9676
9677         * ascii.c: (ascii_text_get_font_position) Removed.
9678
9679         * expr.h, exprP.h: Disabled debugging.
9680
9681         * groff-font.c, postscript.c: Changed `groff' to `Groff' in
9682         several places.
9683
9684         * output.h: (struct outp_class_struct) Removed
9685         text_get_font_position method.  All references deleted.
9686
9687         * postscript.c: Big change here.  Fontmaps were completely
9688         eliminated because of a change in philosophy.  Comment fixes.
9689         (struct ps_fontmap, ps2dit_map, font_family, dit2family_map)
9690         Removed.
9691         (struct ps_driver_ext) `position', `fontmap', `prop_name',
9692         `fixed_name' members removed.  New members `prop_family',
9693         `fixed_family'.  `family' member changed to type char *.
9694         (static var ps_fontmaps) Removed.
9695         () Removed.
9696         (ps_init_driver) Removed obsolete references, updated.
9697         Initializes `translate_x', `translate_y', `scale'.  Doesn't read
9698         fontmap, of course.  Refers to font names through internal_name
9699         rather than subversive means.  Frees proper items.
9700         (static var option_tab[]) Removed `fontmap-file' option; renamed
9701         `fixed-font', `prop-font'.
9702         (ps_option) Corresponds to option_tab[].
9703         (read_fontmap, release_fontmap, ps_to_dit, compare_ps2dit,
9704         hash_ps2dit, compare_dit2family, hash_dit2family, compare_family,
9705         hash_family) Removed.
9706         (postopen) Generates font names from family names.  Gets
9707         PostScript font name properly.  New prologue file comment `!!!'
9708         style.
9709         (ps_open_page) Adds translate_x, translate_y to BP prologue
9710         function; gives SF argument floating-point format.
9711         (ps_text_set_font_by_name) Doesn't try to map PostScript->Groff
9712         font name.  Doesn't change font family.
9713         (ps_text_set_font_by_position) Generates Groff font name from font
9714         family name instead of through table lookup.
9715         (ps_text_set_font_by_family) Renamed `ps_text_set_font_family',
9716         all references changed.  Reduced to simple string assignment.
9717         (ps_get_font_name) Removed.
9718         (ps_get_font_family) Reduced to string return.
9719         (text) Doesn't save `position' since it no longer exists.  Ugly
9720         kluge to save font family--fix soon?
9721         (load_font) Removed PostScript name argument.
9722         
9723 Thu May  1 14:58:59 1997  Ben Pfaff  <blp@gnu.org>
9724
9725         * postscript.c: Comment fix.
9726         (ps_open_page) Puts scale factor in PostScript output.
9727         
9728 Sat Apr 26 11:49:32 1997  Ben Pfaff  <blp@gnu.org>
9729
9730         * Makefile.am: Distcleans q2c.
9731
9732 Wed Apr 23 21:33:48 1997  Ben Pfaff  <blp@gnu.org>
9733
9734         * ascii.c: (delineate) Sets text size even if width is zero.
9735
9736         * command.c: Comment fix.
9737         (static var cmd_table[]) Re-enabled EVALUATE command.
9738         (parse_cmd) Lotsa comment fixes.  Fixed infinite loop in parsing
9739         of comments in script files.  Now more liberal on criteria for
9740         performing a state transition--if *anything* happened correctly,
9741         not just if *everything* happened correctly.
9742
9743         * data-out.c: (convert_F) Comment fix.  Why in the fsck does
9744         Checker segfault on formatting large numbers and why in the fsck
9745         hadn't I noticed this before?
9746
9747         * expr.h, exprP.h: No longer turn off GLOBAL_DEBUGGING.
9748
9749         * list.q: (cmd_list) Commented out the actual output routine
9750         because of various problems.  Probably will abandon the idea of
9751         using the general `crushed tables' for the LIST procedure.
9752
9753         * temporary.c: (restore_dictionary) Sets var_by_name to NULL after
9754         clearing it.  Allocates a new var_by_name dictionary before trying
9755         to add members to it.
9756
9757         * vars-atr.c: [DEBUGGING] (dump_one_var_node) Removed argument
9758         `sib'.  Changed type of `node' argument.
9759         [DEBUGGING] (dump_var_tree) Replaced avlwalk() with
9760         avl_walk_inorder().
9761         (clear_variable) Only dumps the var tree if var_by_name non-NULL.
9762         [DEBUGGING] Only deletes the variable from var_by_name if that var
9763         non-NULL.
9764
9765 Fri Apr 18 16:48:41 1997  Ben Pfaff  <blp@gnu.org>
9766
9767         * Makefile.am: Added include files to SOURCES.  Added
9768         frequencies.q to EXTRA_DIST.  Removed include/ from INCLUDES.  Now
9769         includes rules for q2c.  Added `boast' target.
9770
9771 Fri Apr 18 15:42:22 1997  Ben Pfaff  <blp@gnu.org>
9772
9773         * Makefile.am: Maintainer-clean Makefile.in.
9774         
9775         * Makefile.am: Fixed redundant EXTRA_DIST line.
9776
9777         * ascii.c: Comment fixes.
9778         (ascii_line_vert) Fixed overly aggressive range check.
9779
9780         * display.c: Removed dead code.
9781
9782         * list.q: Turn debugging on.
9783         (flush_table) New debug code.
9784
9785         * sfm-read.c: (read_value_labels) malloc's the structure before
9786         trying to assign to its members.
9787
9788         * sfm-write.c: Comment fix.
9789
9790         * som-high.c: (som_submit_table) Sets som.t and som.d on each call
9791         to output_table().
9792         (output_table) No arguments anymore--gets them through `som'
9793         global.  New debug code.  In crushed tables, now sets `htv' as
9794         well as `hv' to avoid bad confusion later.
9795         (dump_crush_page) New debug code.
9796
9797         * som-low.c: (som_dump_crush_page) New debug code.
9798
9799 Thu Mar 27 01:11:29 1997  Ben Pfaff  <blp@gnu.org>
9800
9801         All source files: Broke long lines into multiple lines.
9802         
9803         * ascii.c: (ascii_close_page) Uses host_system var in place of
9804         HOST_SYSTEM constant.
9805
9806         * cmdline.c: (var syntax_message[]) Broke into
9807         pre_syntax_message[] and post_syntax_message[].
9808         (usage) Outputs both parts, separated by driver list.
9809
9810         * error.h: Fixed broken formatting.
9811
9812         * expr-opt.c: (str_search, str_rsearch) New functions.
9813
9814         * misc.c: (blp_getdelim) Removed.  All references changed to
9815         `getdelim'.
9816         (str_search, str_rsearch) Removed.
9817         (memrmem) New function.
9818
9819         * misc.h: (blp_getline) Removed.  All reference changed to
9820         `getline'.
9821
9822         * stat.h: New file.
9823
9824         * filename.c: Includes "stat.h", not <sys/stat.h>.
9825         (blp_getenv) Uses host_system var instead of HOST_SYSTEM constant.
9826
9827         * output.c: (outp_list_classes) Changed output formatting.
9828
9829         * sfm-write.c: (write_header) Uses host_system var instead of
9830         HOST_SYSTEM constant.
9831         (write_rec_7_34) Extracts version numbers from the version string.
9832         Untested.
9833
9834         * sort.c: Includes "stat.h", not <sys/stat.h>.
9835
9836         * str.c: (strcasecmp) Removed.
9837
9838         * title.c: (cmd_document) Uses host_system var instead of
9839         HOST_SYSTEM constant.
9840
9841         * version.c: Generated on-the-fly by the Makefile instead of being
9842         static.
9843
9844         * str.h: Comment fixes.  Doesn't substitute for missing memmove or
9845         memcpy.
9846         [!HAVE_STRNCASECMP] Declares strncasecmp().
9847
9848         * version.h: Removed stray character.  Comment fixes.
9849         (vars host_system, build_system) New vars.
9850
9851 Mon Mar 24 21:47:31 1997  Ben Pfaff  <blp@gnu.org>
9852
9853         * Most source files: Changed formatting of copyright notice; fixed
9854         FSF address; reformatted to better conform to GNU standards;
9855         comment fixes.  Added markups to prevent GNU indent from messing
9856         up my beautiful formatting :-).
9857         
9858         * q2c.c: (get_line) Ignores lines that begin with `/* *INDENT' so
9859         that GNU indent markups can be passed through without problems.
9860
9861 Wed Feb 19 21:30:31 1997  Ben Pfaff  <blp@gnu.org>
9862
9863         * get.c: Turned off debugging.
9864
9865         * glob.c: (init_glob) Turned on save-file compression by default.
9866
9867         * sfm-write.c: (sfm_write_case) Fixed bug which resulted in less
9868         compression than was possible in save files.
9869
9870 Sun Feb 16 20:57:20 1997  Ben Pfaff  <blp@gnu.org>
9871
9872         * data-out.c: (convert_F) Comment fixes.  Debug message fixes.
9873
9874         * frequencies.q: Removed Fiasco extensions.  Updated calculation
9875         algorithms.  Polished output format. 
9876         (struct frq_info_struct) Removed members `max_degree', `min_n',
9877         all references removed.
9878         (macro frq_extensions) Removed.
9879         (static vars min_n, max_degree) Removed, all references removed.
9880         (internal_cmd_frequencies) Doesn't handle extensions.  Doesn't
9881         calculate `min_n', `max_degree'.
9882         (postcalc) Passes new arg to dump_statistics().
9883         (dump_full) Honor NOLABEL option.  Buggy?  Adds variable name
9884         title.
9885         (dump_condensed) Adds variable name title.
9886         (sum_freqs) Removed.
9887         (calc_stats) Updated calculation algorithm.
9888         (dump_statistics) Removed warning for too-few observations.
9889         Changed table formatting.  Adds variable name title if passed new
9890         arg is nonzero.
9891
9892         * output.h: Comment fix.
9893
9894         * recode.c, sample.c, sort.c: Disabled debug code.
9895
9896         * som-frnt.c: (som_set_value, som_set_float, som_set_text)
9897         Improved debug code.
9898
9899         * var.h: (enum series frq_*) Removed Fiasco extensions.
9900
9901 Sat Feb 15 21:26:53 1997  Ben Pfaff  <blp@gnu.org>
9902
9903         * command.c: Added PROCESS IF to command table.
9904
9905         * Lots & lots of places, removed checks for NULLs preceding calls
9906         to free_expression(), which itself checks.
9907
9908         * descript.q: Removed Fiasco extensions.  Removed optimizations
9909         for non-weighted active files.  Implemented some options.
9910         Finished polishing output format.  Comment fixes.  Merged
9911         `descript.g'.
9912         (static vars n_glob_miss_list, n_glob_valid, n_glob_missing,
9913         max_degree, min_n) Removed.
9914         (macro dsc_extensions) Removed.
9915         (struct dsc_info_struct) Removed `min_n' member, all references
9916         fixed.
9917         (internal_cmd_descriptives) Removed calculation of min_n,
9918         max_degree.  Only deals with one `calc' routine instead of two
9919         flavors.
9920         (precalc) Eliminated redundancy.  Updated for changes to
9921         descriptives_proc structure.
9922         (calc) Moved here from `descript.g'.  Rewritten to calculate
9923         statistics via `moments about the mean' rather than by summing,
9924         summing squares, summing cubes, and so on.
9925         (postcalc) Rewritten for new-style statistical calculation.
9926         (display) Removed support for displaying variables across rows.
9927         No longer crushes the descriptives table.  Removed ancient code.
9928         Added display of N, by variable and listwise.
9929
9930         * descript.g: Removed; merged into `descript.q'.
9931
9932         * expr-evl.c: (evaluate_expression) Now returns a double.  For
9933         numeric results, it returns the result as well as storing it in
9934         the passed `value' structure if non-NULL.  For string results it
9935         just returns 0.0 and it must be passed non-NULL.  Many references
9936         to this function were optimized by use of this change, especially
9937         but not exclusively in `compute.c'.
9938
9939         * frequencies.g: Comment fix.
9940
9941         * glob.c: (glob var process_if_expr) New global var.
9942
9943         * postscript.c: (static var option_tab[]) Corrected entry for
9944         `fixed_size'.
9945         (postopen) Sets x->size to x->prop_size.
9946         (ps_text_set_font_by_name) Sets font size as well as typeface for
9947         PROP and FIXED fonts.
9948         
9949         * sel-if.c: (cmd_process_if) New function.
9950
9951         * sfm-write.c: (struct sfm_fhuser_ext) New member `n_cases'.
9952         (sfm_write_dictionary) Sets `n_cases' to 0.
9953         (sfm_write_case) Increments `n_cases'.
9954         (sfm_close) Attempts to seek the system file back to the header
9955         and write the number of cases in its proper slot.
9956
9957         * som-frnt.c: (som_insert_table) Masks off expansion options since
9958         only SOPT_X_NORM seems to work sensibly.
9959
9960         * som-low.c: (get_cell_size) Fixed bug when a table cell was sized
9961         with a `fixed' value of 2.
9962
9963         * sort.c: (cmd_sort_cases) Cancels PROCESS IF.
9964
9965         * sysfile-info.c: (cmd_sysfile_info) Doesn't display more than 10
9966         value labels; uses SOPT_NONE instead of SOPT_X_BOTH.
9967
9968         * var.h: (enum series dsc_*) Removed Fiasco extensions.
9969         (struct descriptives_proc) Removed `miss_noweight'; new members
9970         `X_bar', `M2', `M3', `M4', `min', `max'.
9971
9972         * vars-atr.c: (discard_variables) Cancels PROCESS IF.
9973
9974         * vfm.c: (close_active_file) Cancels PROCESS IF.
9975         (write_case) Doesn't process cases unselected by PROCESS IF.
9976
9977 Fri Feb 14 23:32:58 1997  Ben Pfaff  <blp@gnu.org>
9978
9979         * glob.c: (glob var err) Removed.
9980
9981         * sysfile-info.c: (cmd_sysfile_info) When adjusting table size,
9982         doesn't have to take into account number of value labels since
9983         they're in a subtable anyway.  Also, doesn't display more than 10
9984         value labels since we can't yet break pages in subtables.
9985
9986 Tue Feb  4 15:15:50 1997  Ben Pfaff  <blp@gnu.org>
9987
9988         * som-frnt.c: (som_change_table_size) Simple change for elegance
9989         that shouldn't change behavior.
9990         (som_set_value) Comment fix.
9991
9992         * som-high.c: (som_submit_table) Message fix.
9993
9994 Wed Jan 22 21:54:00 1997  Ben Pfaff  <blp@gnu.org>
9995
9996         * command.c: Added SYSFILE INFO to command table.
9997
9998         * file-handle.q: (fh_handle_filename) New function.
9999
10000         * get.c: (save_trns_proc) Fixed a bug in padding of output data
10001         with spaces.
10002
10003         * main.c: (parse) New return value for command functions, -3.
10004
10005         * misc.h: Comment fix.
10006
10007         * output.h: Comment fixes.
10008         (macro COMPONENTS) Removed.
10009
10010         * postscript.c: (write_text) Modified literal_chars[] so that `('
10011         and ')' are not written to the output in strings as literals.
10012
10013         * sfm-read.c: (sfm_read_dictionary) New argument.
10014         (read_header) New argument.  Sets the information structure's
10015         values from the header information.  
10016         (read_variables) [__CHECKER__] Redefines isalnum()--some sort of
10017         bizarre Checker problem, I guess.
10018         (read_variables) Proper cleanup on lossage.
10019
10020         * sfm.h: (struct sfm_read_info) New struct for use by
10021         sfm_read_dictionary().
10022
10023         * som-frnt.c: (som_create_table) New argument CREATE_FLAGS,
10024         currently used just for tables that can be dynamically resized and
10025         thus have to be allocated with arena_malloc() instead of
10026         arena_alloc().  All references changed.
10027         (som_change_table_size) New function.
10028         (som_insert_table) Bugfix: now inserts `cell', not `c'!
10029
10030         * som-high.c: [GLOBAL_DEBUGGING] (check_table) Moved to som-low.c.
10031         (som_submit_table) [GLOBAL_DEBUGGING] Doesn't call check_table()
10032         any more.
10033
10034         * som-low.c: (draw_cell) Calls draw_table_cell() for SCON_TABLE
10035         cells.
10036         (draw_intersection) Now takes an argument specifying the table in
10037         question.  All references changed.
10038         (draw_table_cell) New function.
10039         (som_get_table_size) [GLOBAL_DEBUGGING] Calls check_table().
10040         (som_get_table_size) Many nice new explanatory comments.
10041         [GLOBAL_DEBUGGING] (check_table) Moved here from som-high.c.
10042
10043         * som.h: New enum series SOM_CREATE_* for use as create flags with
10044         som_create_table().
10045
10046         * str.h: Moved a comment here from TODO.
10047
10048         * sysfile-info.c: New file.  Reference implementation.
10049
10050 Sun Jan 19 14:22:11 1997  Ben Pfaff  <blp@gnu.org>
10051
10052         * command.c: Added RENAME VARIABLES to table of commands.
10053
10054         * data-in.c: (dls_error) Sets `cust_field'.
10055         (parse_N) Message fix.
10056         (parse_day_count) New function.
10057         (to_roman) Never outputs VX as a `short form' of V.
10058         (parse_month) Fixed parsing of Roman numerals.
10059         (parse_trailer) Message fix.
10060         (parse_DATE, parse_ADATE, parse_EDATE, parse_SDATE, parse_JDATE,
10061         parse_QYR, parse_MOYR, parse_WKYR, parse_DTIME) Issue a message if
10062         the date is invalid.
10063         (parse_SDATE) Fixed swapped day, year.
10064         (parse_JDATE) Fixed bug for dates in 1582.
10065         (parse_DTIME) Allows days not between 1 and 31.
10066         (parse_numeric) Makes local copy of f.type for easier usage.
10067         FMT_DOLLAR fixed.
10068
10069         * data-out.c: (convert_F) When outputting as scientific, properly
10070         sets f.type as fp->type.
10071         (insert_commas) Fixed operator precedence problem with setting of
10072         nitems.  Changed strcpy to memcpy (no null terminator). 
10073         (convert_date) Fixed FMT_JDATE: added 1900 to year.
10074         (convert_CCx) Essentially rewritten, but now it works.
10075
10076         * display.c: (cmd_display) Added DISPLAY FILE LABEL (undocumented
10077         feature of Fiasco).
10078         (display_documents) Implemented.
10079
10080         * error.c: (glob var cust_field) New var.
10081         (vmsg) Displays cust_field as part of message classes DE and DW.
10082
10083         * formats.c: (debug_print) Fixed to compile under updated
10084         dictionary format.
10085
10086         * get.c: (cmd_get, cmd_save_internal) Close file handle on
10087         failure.
10088
10089         * misc.c: (parse_format_specifier) Formatting fix.
10090
10091         * modify-vars.c: (struct var_modification) Renamed `n_reorder' as
10092         `n_rename' for clarity.
10093         (cmd_modify_vars) Initializes `forward' and `positional' at
10094         appropriate times.  Frees lists of vars to rename on failure.
10095         Comment fix.  Frees memory on success.  
10096         (rearrange_dict) Simplified `for' loop condition.
10097
10098         * rename-vars.c: New file (reference implementation).
10099         
10100         * set.q: (internal_cmd_set) Fixed `emu' test condition.
10101
10102         * sfm-read.c: (read_header) File label is created only if file
10103         label in file is not blank.
10104         (read_variables) Initializes `dict' local variable.
10105         (read_documents) Proper behavior on lossage.
10106
10107         * sfm-write.c: (write_header) Doesn't blank out the file label
10108         (why was this here to begin with?!)
10109
10110         * temporary.c: (save_dictionary) File label is copied only if
10111         non-NULL.  Doesn't try to xstrdup() dictionary documents.
10112         Adapted so as to not irritate Checker.
10113         (free_dictionary) Only destroys var_by_name if non-NULL.
10114
10115         * title.c: (cmd_file_label) Doesn't skip FILE, LABEL tokens.
10116         (cmd_document) Doesn't skip DOCUMENT token.  Adds some header
10117         lines to the document, indents the document.  Also, it works now.
10118         (add_document_line) New function.
10119
10120         * var.h: (struct dictionary) Reordering.
10121
10122         * vars-prs.c: (parse_variables) On lossage, only local_free()'s
10123         bits if it was allocated to begin with.
10124
10125 Thu Jan 16 13:08:57 1997  Ben Pfaff  <blp@gnu.org>
10126
10127         * command.c: Added MODIFY VARS to list of commands.
10128
10129         * configure.in: Updated custom macros for autoconf 2.12.  Removed
10130         mmap reference; fixed termcap library reference.
10131
10132         * display.c: (display_variables) Fixed a few bugs although it's
10133         still not well written.
10134
10135         * error.c: [!__CHECKER__] (chkr_disp_call_chain) New function.
10136         (induce_segfault) Calls chkr_disp_call_chain() instead of
10137         inducing an actual SIGSEGV.
10138
10139         * expr-opt.c: (evaluate_tree) Swapped order of arguments to
10140         str_search() and str_rsearch().  Fixed tests for matches on
10141         OP_INDEX and OP_RINDEX.
10142
10143         * filename.c: (good_getcwd) Removed as the new libc for Checker
10144         doesn't contain this bug, apparently.
10145
10146         * misc.c: (str_search, str_rsearch) Changed order of arguments for
10147         consistency with GNU memmem.
10148         (blp_getdelim) Changed `len' from `int' to `size_t'.
10149
10150         * modify-vars.c: Reference implementation.
10151
10152         * som-frnt.c: (zero_length) New global var.
10153         (som_create_table) Message fix.
10154
10155         * som.h: Added gcc attributions to som_set_text(),
10156         som_output_text() prototypes.  blank_line() refers to
10157         zero_length[] instead of a literal null string to suppress gcc
10158         warnings.
10159
10160         * sort.c: (do_external_sort) Fixed fencepost error on lossage.
10161         (allocate_cases) Decrements x_max so the last element of x[] can
10162         be used by the algorithm.
10163
10164         * var.h: Changed minor details of `variable' declaration.  
10165         (struct modify_vars_proc) New struct.
10166         (struct variable) Added field p.mfv.
10167
10168         * vars-atr.c: Comment fix.
10169
10170         * vars-prs.c: (fill_all_vars) More optimal implementation.
10171
10172         * vfm.c: (dump_splits) Sets the last byte of temp_buf to a null
10173         character, which it shouldn't have to do but printf() seems to
10174         read the null byte even though I supply a maximum length...
10175
10176 Fri Jan 10 20:22:08 1997  Ben Pfaff  <blp@gnu.org>
10177
10178         * command.c: Removed command alias X for QUIT.
10179         (parse_cmd) Fixed comment parsing.
10180
10181         * dfm.c: (struct dfm_fhuser_ext) Fields `len', `size' are now of
10182         type size_t.
10183         (read_record) Fixed references to len, size.
10184         (dfm_get_record) Restructured.
10185
10186         * file-handle.h: (struct file_handle) Field `lrecl' now of type
10187         size_t.
10188
10189         * file-handle.q: (internal_cmd_file_handle) Checks for nonpositive
10190         record length.
10191
10192         * modify-vars.c: New file.  Not complete.
10193         
10194         * set.q: (set_ccx) Fixed operator precedence problem regarding ^
10195         and ==.
10196
10197         * sfm-read.c: (bswap_flt64, read_header, write_variable) Fixed
10198         problems caused by int/size_t differences.
10199
10200         * sort.c: (output_record, merge_once) Cast `size_t's to `int's in
10201         appropriate spots.
10202
10203         * str.c: (strcasecmp) Fixed bug that cropped up when the strings
10204         being compared were of equal length.
10205
10206 Thu Jan  2 19:08:23 1997  Ben Pfaff  <blp@gnu.org>
10207
10208         * command.c: Added DOCUMENT, DROP DOCUMENTS, FILE LABEL.
10209
10210         * lexer.c: (get_dotted_rest_of_line) New function.
10211
10212         * sel-if.c: (cmd_filter) Cannot choose string or scratch variables
10213         as filters.
10214
10215         * sfm-read.c: (sfm_read_dictionary) Calls read_documents() to read
10216         type 6 records.  Frees the dictionary properly.
10217         (read_header) Initializes the dictionary instead of letting
10218         read_variables() do it.  Sets the dictionary file label from the
10219         system file.
10220         (read_documents) New function.
10221
10222         * sfm-write.c: (sfm_write_dictionary) Calls write_documents() to
10223         write type 6 record if appropriate.
10224         (write_header) Writes file label from dictionary.
10225         (write_documents) New function.
10226
10227         * temporary.c: (save_dictionary, restore_dictionary,
10228         free_dictionary) Properly handle new fields in dictionary struct.
10229
10230         * title.c: (get_title) Returns after failure().
10231         (cmd_file_label, cmd_document, cmd_drop_documents) New functions
10232         for new commands FILE LABEL, DOCUMENT, DROP DOCUMENTS.  Untested.
10233
10234         * var.h: (struct dictionary) New fields `label', `n_documents',
10235         `documents'.
10236
10237 Wed Jan  1 22:08:10 1997  Ben Pfaff  <blp@gnu.org>
10238
10239         * command.c: Added FILTER to list of commands.
10240
10241         * frequencies.g: [WEIGHTING] Removed test for weighting!=-1 since
10242         it's always true.
10243
10244         * get.c: (cmd_save_internal) Removed weighting code since it's now
10245         handled by sfm-write.c.  Properly commented out debug code.
10246
10247         * glob.c: (glob var weighting) Removed.
10248
10249         * sel-if.c: Comment fixes.
10250         (cmd_filter) New function.
10251
10252         * sfm-read.c: (struct sfm_fhuser_ext) New field `weight_index'.
10253         (sfm_read_dictionary) Sets weighting variable direct in the
10254         created dictionary now.  (Apparently we previously didn't support
10255         weighting on GET?)
10256         (read_header) Sets weight_index field in sfm_fhuser_ext from
10257         header read from disk.
10258
10259         * sfm-write.c: (sfm_write_dictionary) Comment fix.
10260         (write_header) Now sets the weighting in the header from the
10261         passed primary dictionary instead of from the sfm_write_info.
10262
10263         * sfm.h: (struct sfm_write_info) Removed field `weight'.
10264
10265         * som-high.c: (dump_crush_table) Fixed a couple of assertions that
10266         broke on boundary conditions.
10267
10268         * var.h: (struct dictionary) New fields `weight_var',
10269         `weight_index', and `filter_var'.
10270         (glob var weighting) Removed.  This is now part of struct
10271         dictionary.  All references changed; the less mechanical changes
10272         are described above.
10273
10274         * vars-atr.c: (find_dict_variable) New function.
10275
10276         * vfm.c: (static var filter_index) New variable.
10277         (open_active_file) Initializes filter_index from default_dict.
10278         (write_case) Calls proc_func() only if the filter variable is
10279         nonzero; this implements FILTER behavior.
10280
10281         * weight.c: (static var weight_varname) Removed.
10282         (cmd_weight) Modified default_dict instead of glob vars.
10283         (update_weighting) Changed the signature to modify a dictionary
10284         instead of glob vars.  Now returns the weighting variable.
10285         (get_weighting_variable) Removed; its function is absorbed by
10286         update_weighting().
10287         (stop_weighting) Operates on a dictionary now.
10288
10289 Wed Jan  1 17:00:59 1997  Ben Pfaff  <blp@gnu.org>
10290
10291         * sort.c: Removed debugging info from messages.
10292         (do_external_sort) Cleans up after itself by deleting the
10293         temporary directory on failure.  (On success it is deleted by the
10294         input program.)
10295         (allocate_cases) Removed debug code.  Added clean up code.
10296         (output_record) Removed debug code.
10297         (merge) Added code to close all the input files that are currently
10298         open.  This is a likely location for bugs, because I'm not sure
10299         about boundary conditions.  Removed an unnecesary heap_delete().
10300         (merge_once) Removed input file "optimization" that in fact
10301         screwed up the rest of the code.  Message and comment fixes.
10302
10303 Sun Dec 29 21:36:48 1996  Ben Pfaff  <blp@gnu.org>
10304
10305         * error.c: [__CHECKER__] (induce_segfault) Flushes output streams.
10306
10307         * heap.c: (heap_delete) New argument.
10308
10309         * sort.c: Finished implementation of external sort.
10310
10311         * vfm.c: (read_from_disk) Returns after a disk error.
10312
10313 Sun Dec 22 23:10:39 1996  Ben Pfaff  <blp@gnu.org>
10314
10315         * sort.c: (static var state) Removed.
10316         (static vars max_handles, tmp_basename, tmp_extname,
10317         huffman_queue) New variables.
10318         (do_external_sort) Moved most code to new functions.
10319         Creates huffman_queue.
10320         (allocate_file_handles, allocate_cases) New functions.
10321         (static vars run_no, run_length, file_index, case_count) New
10322         variables. 
10323         (output_record) Returns success.  Now really writes to the output
10324         file.
10325         (begin_run, end_run) New functions.
10326         (write_initial_runs) Returns success.  Initializes run_no to -1.
10327         Calls begin_run(), end_run() at appropriate times.  Outputs debug
10328         messages.
10329         (write_to_sort_cases) Calls begin_run(), end_run() at appropriate
10330         times.
10331         (merge) New function.
10332
10333         * heap.c, heap.h: New files.  Hopefully in near-final form.
10334
10335 Sat Dec 21 21:51:04 1996  Ben Pfaff  <blp@gnu.org>
10336
10337         * glob.c: Added write_active_file to global vars.
10338
10339         * sort.c: Several new miscellaneous static variables.
10340         (cmd_sort_cases) Big comment fix.
10341         (perform_case_2) Renamed `do_external_sort' and completely
10342         rewritten.
10343         (case_2_proc_func) Removed.
10344         (output_record, write_initial_runs, write_to_sort_cases,
10345         compare_record) New functions.
10346
10347         * vfm.c: [DEBUGGING] (index_to_varname) Excised bit rot.
10348
10349 Tue Dec 17 18:57:59 1996  Ben Pfaff  <blp@gnu.org>
10350
10351         * sort.c: (perform_case_2) Changed the method for allocation of
10352         lots of memory--now allocates one case at a time in hopes that
10353         more cases can be allocated with heavily fragmented memory.
10354
10355         * var.h: (write_active_file) New global var.
10356
10357         * vfm.c: (procedure, close_active_file, write_case,
10358         SPLIT_FILE_procfunc) Now allow beginfunc, procfunc, and endfunc
10359         arguments to procedure() to be NULL.  All references to
10360         procedure() that made use of dummy functions were changed to NULL
10361         functions.
10362         (open_active_file) If write_active_file is non-NULL, the output
10363         device becomes DEV_PGM (a new enum).
10364         (close_active_file) Sets write_active_file to NULL.
10365         (read_from_memory) Comment fix.
10366         (record_case) Calls write_active_file() when the output device is
10367         DEV_PGM.
10368
10369 Sun Dec 15 15:32:16 1996  Ben Pfaff  <blp@gnu.org>
10370
10371         * sort.c: New file.
10372
10373         * autorecode.c: (cmd_autorecode) Fixed parsing of options.
10374         Fixed checking for duplicate varnames.
10375         (recode) xmalloc()'s the transformation instead of arena_alloc()'ing
10376         it.
10377         (autorecode_trns_free) Destroys hash tables for each recoding
10378         specification.
10379         (autorecode_proc_func) Compares NULL to *vpp instead of vpp.
10380
10381         * command.c: Added SORT CASES to cmd_table.
10382         (null_func, null_int_func) Prototyped.
10383
10384         * descript.g: (calc_weight, calc_noweight) Computes own case
10385         number now.
10386         
10387         * frequencies.q: (dump_statistics) Fixed problem with
10388         too-few-cases warning message.
10389
10390         * get.c: (cmd_save_internal) Handles weighting properly.
10391
10392         * hash.c: (hsh_dump) Output format changed.
10393         (force_hsh_insert) Actually works now, prototype changed.
10394
10395         * list.q: (static var case_num) New variable.
10396         (cmd_list) Initializes case_num.
10397         (list_cases) Increments case_num.
10398
10399         * var.h: Added definitions for SORT CASES.  Comment fixes.
10400
10401         * vfm.c: Some definitions moved to new file vfmP.h.  Comment
10402         fixes.  `active' renamed vfm_active, `rep' renamed
10403         vfm_replacement, all references changed.
10404         (procedure) The procfunc no longer receives a case number.  All
10405         references changed.
10406         (write_case) Subtle reordering.
10407         (SPLIT_FILE_procfunc) Counts cases differently.  Slightly less
10408         redundant.
10409
10410         * weight.c: (get_weighting_variable) New function.
10411
10412         * vfmP.h: New file with definitions from vfm.c.
10413
10414 Sat Dec 14 10:35:30 1996  Ben Pfaff  <blp@gnu.org>
10415
10416         * command.c: (FILE_TYPE_okay) Commented out some tests because
10417         they're clumsy and not yet needed.
10418
10419         * var.h: Most *_trns structures moved to their respective source
10420         files.  Some were moved into a new file, do-ifP.h.  Comment fixes.
10421         (union any_trns) Changed to a typedef for trns_header.
10422         (struct input_program_pgm) Removed.
10423
10424         * vars-prs.c: (parse_variables) Only local_free()'s bits if it
10425         was allocated in the first place.
10426
10427 Fri Dec 13 21:30:53 1996  Ben Pfaff  <blp@gnu.org>
10428
10429         * autorecode.c: New file.
10430         
10431         * command.c: Added AUTORECODE to command table; re-enabled SET.
10432
10433         * data-out.c: (convert_F) Handles infinities and NaNs properly.
10434
10435         * error.c: (vmsg) Comment fixes.
10436
10437         * hash.c: Comment fix.
10438         (hashpjw_d) New function.
10439         (hashpjw) Reimplemented as call to more general function
10440         hashpjw_d().
10441         (internal_comparison_fn) Initializes pointers properly.
10442         (hsh_sort) [GLOBAL_DEBUGGING] New debugging code.
10443         (force_hsh_insert, force_hsh_find) New debugging wrapper
10444         functions.
10445
10446         * main.c: (main) Message fix.
10447
10448         * output.c: (outp_read_devices) Message fix.
10449
10450         * set.q: Comment fixes.
10451         (custom_results) Implemented Wnd/X form of subcommand.
10452         (set_routing) New function.
10453         (internal_cmd_set) Implemented ERRORS, MESSAGES.
10454
10455         * settings.h: (SET_ROUTE_*) New enum series.
10456         (set_results) Renamed set_results_file, all references changed.
10457         (set_messages) Removed.
10458         (glob vars set_errors, set_messages, set_results) New vars.
10459
10460         * title.c: (get_title) Remembers to xstrdup() the result of
10461         get_rest_of_line().
10462
10463         * var.h: (arc_item, arc_spec, autorecode_trns) New structures for
10464         use by AUTORECODE.
10465         (union any_trns) New element `arc'.
10466
10467 Fri Dec  6 23:53:47 1996  Ben Pfaff  <blp@gnu.org>
10468
10469         * command.c: (output_line) Removed references to set_screen.
10470
10471         * error.c: (static var terminating) New var.
10472         (hcf) Sets terminating to 1.
10473         (vmsg) If terminating is nonzero, does not attempt to call hcf().
10474         This prevents an infinite loop if an error occurs within hcf().
10475
10476         * expr-evl.c: (evaluate_expression) [__CHECKER__] Replaced case
10477         statement circumlocution with `case 42000' trick.
10478         (evaluate_expression) New support for OP_STR_MIS.
10479
10480         * expr-opt.c: (evaluate_expression) [__CHECKER__] Replaced case
10481         statement circumlocution with `case 42000' trick.
10482         (dump_node) Handles OP_STR_MIS.
10483
10484         * expr-prs.c: (MISSING_func, SYSMIS_func) Rewrote to handle string
10485         variables exceptions.
10486         (parse_function) Message fix.
10487         (ops[]) Added OP_STR_MIS.
10488
10489         * expr.h: Added OP_STR_MIS to OP_* enum.  Comment fixes.
10490
10491         * exprP.h: [__CHECKER__] Removed case statement circumlocution.
10492
10493         * glob.c: Removed set_scrnfile glob var.
10494         (init_glob) set_errorbreak set to 0 by default.
10495
10496         * groff-font.c: Changed included files.
10497         (groff_read_font) Initializes font_arena local var correctly.
10498         (default_font) New function.
10499
10500         * output.c: Comment fixes.
10501         (glob var disabled_devices) New variable.
10502         [GLOBAL_DEBUGGING] (static var iterating_driver_list) New
10503         variable.
10504         [GLOBAL_DEBUGGING] (reentrancy) New function.
10505         [GLOBAL_DEBUGGING] (outp_read_devices, outp_done, find_driver,
10506         outp_iterate_enabled_drivers) Calls to reentrancy().
10507         (destroy_list) New function.
10508         (outp_done) Moved code to destroy_list().
10509         (parse_options) Parses `listing', `screen', `printer' options
10510         internally.
10511         (configure_driver) Sets new `device' member of driver.
10512         (outp_iterate_enabled_drivers, outp_enable_device) New functions.
10513
10514         * output.h: Comment fixes.  New enum series OUTP_DEV_*.
10515         (struct outp_driver_struct) New member `device'.
10516
10517         * postscript.c: (find_encoding_file) Doesn't display its own error
10518         messages.
10519         (default_encoding) New function.
10520         (switch_font) Calls default_encoding() if no encoding can be
10521         found.
10522         (text) Makes up a character metric if none exists for the desired
10523         character.
10524         (load_font) Properly copies a fallback filename.  Calls
10525         default_font() for a font if none at all are known.
10526
10527         * set.q: Comment fixes.  Removed OUTPUT subcommand.
10528         (custom_listing) Calls outp_enable_device() to enable/disable
10529         listing device.
10530         (turn_screen_on) Removed.
10531         (internal_cmd_set) Calls outp_enable_device() to enable/disable
10532         screen, printer devices.
10533
10534         * settings.h: Comment fixes.
10535         (glob vars set_output, set_printer, set_screen, set_scrnfile)
10536         Removed.
10537
10538         * som-high.c: (som_submit_table, som_eject_page) Use
10539         outp_iterate_enabled_drivers() instead of iterating
10540         outp_driver_list directly.
10541
10542 Wed Dec  4 21:34:17 1996  Ben Pfaff  <blp@gnu.org>
10543
10544         * data-in.c: (parse_EDATE, parse_SDATE) New functions.
10545         (parse_string_as_format) Handles new formats.
10546         (parse_numeric) Now handles DOT and PCT formats.
10547
10548         * data-out.c: (convert_E, convert_F, insert_commas) Handle DOT
10549         format now.
10550         (convert_date) Handle EDATE and SDATE formats.
10551         (convert_CCx) Now if there's not room for the currency characters,
10552         converts it as F format if it's positive instead of giving up
10553         quickly.  Also fixed save-and-restore bug with decimal point
10554         characters.  
10555         (convert_format_to_string) Handles new formats.
10556
10557         * misc.c: (formats[]) Added new formats.
10558         (convert_fmt_ItoO) Supports new formats.
10559
10560         * sfm-read.c: (parse_format_spec) Supports new formats.  Better
10561         data checking.  New argument, all references changed.
10562
10563         * sfm-write.c: (write_format_spec) Supports new formats.
10564
10565         * var.h: New formats FMT_DOT, FMT_PCT, FMT_EDATE, FMT_SDATE.
10566         Comment fixes.
10567
10568 Sun Dec  1 17:19:00 1996  Ben Pfaff  <blp@gnu.org>
10569
10570         * cmdline.c: Comment fixes.
10571         (parse_command_line) Changed return type to void.
10572
10573         * data-in.c: (parse_string_as_format) Added FMT_CCA...FMT_CCE to
10574         switch.
10575         (parse_numeric) Handles international numbers (comma as decimal
10576         point).  Some reformatting.
10577
10578         * data-list.c: (parse_free) Default output format is now
10579         set_format instead of hard-coded F8.2.
10580         (read_from_data_list_list) Emits error message on undefined data
10581         only if set_undefined is nonzero.
10582
10583         * data-out.c: (convert_E) Changes decimal point from period to
10584         comma if appropriate.  Restructured.  Better comments.
10585         (convert_F) Changes decimal point from period to comma if
10586         appropriate.
10587         (insert_commas) Major bug with handling of negative values fixed.
10588         Also, inserts periods instead of commas if appropriate.
10589         (convert_CCx) New function.
10590         (convert_format_to_string) Added FMT_CCA...FMT_CCE to switch.
10591         (num_to_string) Changed `.' to set_decimal.
10592
10593         * dfm.c: Comment fixes.
10594         (dfm_close) Frees ext->line even in inline_file.
10595         (open_inline_file) New function.
10596         (open_file_r) When opening the inline file: now properly
10597         recognizes `BEGIN DATA.' line, and calls open_inline_file() to
10598         finish up.
10599         (read_record) Calls fh_close_handle() instead of dfm_close() to
10600         close the inline file.  Makes a copy of the line getl_buf to avoid
10601         interlock problems.
10602         (dfm_get_record) Restructured.  Now checks the return value of
10603         open_file_r().
10604         (cmd_begin_data) Moved open code into open_inline_file().  Relaxed
10605         checking for use of inline file.  No longer tries to close inline
10606         file.
10607
10608         * error.c: (glob var error_already_flagged) New var.
10609         (vmsg) Message change.  Now checks max number of errors/warnings,
10610         acts on it.
10611
10612         * file-handle.q: (fh_handle_name) Now allows closing of
10613         inline_file.
10614         (fh_init_files) Reformatted.
10615
10616         * get.c: (trim_dictionary) Checks SCOMP option instead of COMP.
10617
10618         * getline.c: (getl_include) Fixed bug that popped up when called
10619         when file queue was empty.
10620         (read_console) Resets error_count, warning_count,
10621         error_already_flagged to zero.
10622
10623         * glob.c: Many changes to update list of variables.
10624         (init_compat_dependent) Now this function is called whenever
10625         `compat' changes.  It now sets set_seed only if it hasn't
10626         previously been referenced.  It now calls
10627         lex_init_compat_dependent().
10628
10629         * include.c: (cmd_include_at) Frees temporary buffer instead of
10630         line buffer.  
10631         (cmd_include) Doesn't make copy of include file name.
10632
10633         * lexer.c: Comment fixes.
10634         (init_lex) Moved some code into new function
10635         lex_init_compat_dependent().
10636         (lex_init_compat_dependent) New function.
10637         (hex_val) Simplified.
10638         (preprocess_line) Uses set_endcmd instead of hardcoding `.'.
10639
10640         * main.c: Comment fixes.
10641         (main) Reformatted.
10642
10643         * misc.c: (formats[]) Added FMT_CCA...FMT_CCE.
10644         (check_input_specifier) Disallows FMT_CCA...FMT_CCE.
10645         (convert_fmt_ItoO) Detects FMT_CCA...FMT_CCE.
10646         (setup_randomize) Sets set_seed_used.
10647
10648         * set.q: Comment fixes.
10649         (custom_results) Conditionalizes on `compat'.
10650         (custom_log) Calls custom_journal().
10651         (set_ccx) New function.
10652         (cmd_set) Calls init_compat_dependent() when `compat' changes.
10653         Calls set_ccx() to handle CCA...CCE.  Sets set_grouping
10654         when set_decimal changes.  Range-checks values for MITERATE,
10655         MNEST.  Message fixes.
10656
10657         * settings.h: Comment fixes.
10658         (struct set_cust_currency) New struct.
10659         (set_cc[], set_grouping, set_seed_used) New global vars.
10660
10661         * var.h: (FMT_CCA...FMT_CCE) New output formats.
10662         (FCAT_OUTPUT_ONLY) New FCAT_* constant.
10663
10664 Thu Nov 28 23:14:07 1996  Ben Pfaff  <blp@gnu.org>
10665
10666         * glob.c: Revised variables to correspond to settings.h.
10667         (init_glob) Initializes variables from settings.h properly.
10668
10669         * set.q: Began long-overdue major revision to correspond to new
10670         philosophy.  Most code changed. 
10671
10672         * settings.h: Mostly changed; reorganized, reordered, large new
10673         comment.
10674
10675 Thu Nov 28 19:46:10 1996  Ben Pfaff  <blp@gnu.org>
10676
10677         * get.c: (cmd_save_internal) No longer forces compression off.
10678
10679         * sfm-read.c: (read_compressed_data) If eof is reached when
10680         reading a new instruction octet, only signal error if we're in the
10681         middle of a case.
10682
10683         * sfm-write.c: (COMPRESSION_BIAS) New #define.
10684         (struct sfm_fhuser_ext) New member `end'.
10685         (write_header) Refers to COMPRESSION_BIAS instead of magic 100.0.
10686         (ensure_buf_space) New function.
10687         (sfm_write_case) Reimplemented in order to support compression.
10688         (sfm_close) Writes out the remaining contents of the compression
10689         buffer if any.
10690
10691 Wed Nov 27 23:18:35 1996  Ben Pfaff  <blp@gnu.org>
10692
10693         * command.c: Defined SAVE and XSAVE commands in command table.
10694
10695         * common.h: second_lowest_value is of type flt64, not double.
10696
10697         * file-handle.h: Comment fix.
10698
10699         * get.c: Comment fixes.
10700         (static var `trns') New.
10701         (save_write_case_func, save_trns_proc, save_trns_free, null_func,
10702         cmd_save_internal, cmd_save, cmd_xsave) New functions.
10703         (dict_delete_run) Clears the variables and frees them now.
10704         (trim_dictionary) Sets default for compression.
10705         On KEEP subcommand, frees deleted variables as well as clearing
10706         them.  Finally got the sense of the test for deleting all
10707         variables correct.
10708         [DEBUGGING] (dump_dict_variables) Message fix.
10709
10710         * glob.c: (init_glob) set_compression set to 1 by default.
10711
10712         * list.q: Properly #includes config.h.
10713
10714         * misc.h: New macro REM_RND_UP.
10715
10716         * settings.h: Comment fix.
10717
10718         * sfm-read.c: (structs sysfile_header, sysfile_format,
10719         sysfile_variable; inline function bswap_int32) Moved to new file
10720         sfmP.h.
10721         (corrupt_msg) [__CHECKER__] No longer induces segfault.
10722         (sfm_read_dictionary) Fixed bug caused by failing to initialize
10723         var_by_index.
10724         (read_machine_flt64_info) Fixed some problems caused by confusion
10725         between flt64 and double types.
10726         (read_header) Message fix.
10727         (read_variables) Fixed set of cases in which we byte-swap sv.print
10728         and sv.write.  Fixed confusion of flt64 and double.
10729
10730         * sfm.h: (struct sfm_write_info) New.
10731
10732         * som-high.c: (som_draw_title) Properly frees `s'.
10733
10734         * temporary.c: (save_dictionary) Comment fix.
10735
10736         * var.h: Comment fixes.  New FMT_* enum, FMT_NUMBER_OF_FORMATS.
10737         (struct trns_header) Formatting fix.
10738         (struct save_trns) New.
10739
10740         * vars-atr.c: (discard_variables) Comment fix.
10741
10742         * sfm-write.c: New file, baseline release.
10743
10744         * sfmP.h: New file, baseline release.
10745
10746 Sun Nov 24 14:53:53 1996  Ben Pfaff  <blp@gnu.org>
10747
10748         * cmdline.c: (parse_command_line) `--version' output updated.
10749         (glob var syntax_message[]) Added my e-mail address.
10750
10751         * file-handle.q, lexer.c, vfm.c: Changed many instances of
10752         `illegal' to `invalid'.
10753
10754         * sfm-read.c: (struct sfm_fhuser_ext) New fields used as
10755         uncompression buffer.
10756         (sfm_close) Frees decompression buffer.
10757         (sfm_read_dictionary) Initializes decompression buffer.
10758         (buffer_input, read_compressed_data) New functions.
10759         (sfm_read_case) Restructured; now calls read_compressed_data() to
10760         handle compressed system file data.
10761
10762         * var.h: Comment fix.
10763
10764 Mon Nov 11 15:34:09 1996  Ben Pfaff  <blp@gnu.org>
10765
10766         * dfm.c: (dfm_close) Does not set h->{ext,class} because the
10767         caller handles it.
10768          
10769         * get.c: New comments.  New static var `get_file'.
10770         (cmd_get) Now fully implemented.  Calls discard_variables();
10771         initializes fv and lv for all variables; new debug code; sets
10772         up the dictionary; sets up the input program.
10773         (read_from_get, cancel_get) New functions.
10774
10775         * sfm-read.c: Comment fixes.
10776         (sfm_close) New static function.
10777         (sfm_read_dictionary) Properly sets up the class of the
10778         file_handle.  No longer cares what size the data is in records of
10779         type 7.  Also, on failure, properly cleans up the file_handle and
10780         free()s some stuff.
10781         (read_variables) No longer thinks it knows `nval' of the
10782         dictionary.  Now sets p.get.fv, etc., instead of speculatively
10783         setting fv itself.
10784         (read_value_labels) Fixed off-by-one error in indexing of
10785         var_by_index[].
10786         (sfm_read_case) New function.
10787         (sfm_r_class) New static var.
10788
10789         * var.h: (get_proc) New struct.
10790         (struct variable) New member p.get.
10791
10792 Thu Nov  7 20:52:28 1996  Ben Pfaff  <blp@gnu.org>
10793
10794         * get.c: Removed GTSV_OPT_MAP because of a misinterpretation of
10795         the manual's meaning.
10796         (rename_variables) New function.
10797         (trim_variables) Doesn't try to parse MAP any more.  Removed debug
10798         code.  Now properly reorders the dictionary on the KEEP keyword.
10799
10800         * sfm-read.c: (read_value_labels) Fixed some bugs regarding
10801         garbage collection.
10802
10803         * vars-atr.c: (clear_variable) New argument `dictionary *'.
10804         (rename_variable) New function.
10805         (free_val_lab) Reformatted.
10806
10807 Thu Nov  7 17:29:16 1996  Ben Pfaff  <blp@gnu.org>
10808
10809         * var.h: Reindented entire file.  Comment fixes.
10810         (glob vars var, var_by_name, nvar, N, nval, n_splits, splits)
10811         Removed.
10812         (glob var default_dict) New.
10813         (struct indirect_dictionary) Removed.
10814
10815         * Many other source files were changed to add `default_dict.'
10816         before all references to the dictionary of the active file.
10817         
10818         * vars-atr.c: (make_indirect_dictionary) Removed.
10819
10820         * glob.c: Reindented all variable declarations.  Updated for
10821         changed var.h.  Comment fixes.
10822
10823         * temporary.c: (restore_dictionary, save_dictionary) Simplified
10824         because now we can mainly copy dictionary structs.
10825
10826         * vars-prs.c: (is_dict_varname, parse_dict_variable,
10827         parse_variables) Takes dictionary instead of indirect_dictionary
10828         first argument.
10829         (parse_variables) Instead of calling make_indirect_dictionary,
10830         just sets DICT to &default_dict if DICT is NULL.  Of course, lots
10831         of `*dict.' references had to be changed to `dict->'.  Removed
10832         debug code.
10833
10834 Thu Nov  7 15:48:52 1996  Ben Pfaff  <blp@gnu.org>
10835
10836         * get.c: Added GTSV_OPT_* series of enums.
10837         (trim_dictionary, dict_delete_run) New functions.
10838         [DEBUGGING] (dump_dict_variables) New function.
10839         (cmd_get) Calls trim_dictionary() to get dictionary fully set-up.
10840         [DEBUGGING] Calls dump_dict_variables() to display results.
10841
10842         * glob.c: (cmp_variable) Now a public function declared in var.h.
10843
10844         * sfm-read.c: Turned off debug code.  Comment fixes.
10845         (read_machine_int32_info, read_machine_flt64_info) New functions
10846         to parse type 7 records.
10847         (sfm_read_dictionary) Properly byteswaps several fields now.
10848         Calls read_machine_*_info() to parse type 7 subtypes 3 and 4
10849         records.  [DEBUGGING] Dumps dictionary.
10850         (read_variables) Sets `index' field of variables created properly.
10851         Constructs avl tree of variables in dictionary.  [DEBUGGING] No
10852         longer dumps dictionary.
10853         (read_value_labels) Properly byteswaps fields.  [DEBUGGING] New
10854         debug code.
10855         [DEBUGGING] (dump_dictionary) No longer stubbed out.
10856
10857         * temporary.c: (restore_dictionary) Destroys `var_by_name' glob
10858         var before destroying any variables just to save a little time.
10859
10860         * var.h: (struct variable) Reordered in order to make name[] the
10861         first member; this makes pointers to `variable' pointers to the
10862         variable name, simplifying avl trees, etc.
10863         (struct indirect_dictionary) New struct.
10864
10865         * vars-atr.c: (find_variable) Rewritten for efficiency.
10866         (make_indirect_dictionary, is_dict_varname, parse_dict_variable)
10867         New functions.
10868         (is_varname) Rewritten for efficiency.
10869         (parse_variables) New argument, which is a `dictionary *'.  All
10870         references changed.  This function now reads variable names from
10871         the dictionary passed, or from the default dictionary if NULL.
10872
10873 Tue Nov  5 18:34:59 1996  Ben Pfaff  <blp@gnu.org>
10874
10875         * misc.h: Added new macro DIV_RND_UP to perform integer division,
10876         rounding up.  Changed many references to ROUND_UP to use this
10877         instead.
10878
10879         * sfm-read.c: Includes avl.h.
10880         (corrupt_msg) Induces a segfault under Checker.
10881         (macro assertive_bufread) New.  Many references to bufread() now
10882         use this instead.
10883         (sfm_read_dictionary) Split up into several functions.  Added code
10884         to read dictionary records following the the type 2 records.  Not
10885         quite complete.  New variable `var_by_index'.
10886         (read_header, read_variables) New functions extracted from
10887         sfm_read_dictionary().
10888         (read_value_labels) New function.
10889         (bufread) Checks ferror() if fread() doesn't return the expected
10890         value; if ferror() is zero it's just EOF.
10891         (dump_dictionary) Stubbed out.
10892
10893         * BTW: The source code now exceeds 50000 lines!
10894         
10895 Mon Nov  4 22:03:28 1996  Ben Pfaff  <blp@gnu.org>
10896
10897         * command.c: Added GET to cmd_table[].
10898
10899         * list.q: Removed reference to alloca headers.
10900         (cmd_list) Gave prototype.
10901
10902         * sfm-read.c: Added DEBUGGING comments.
10903         (sfm_read_dictionary) Checks bias correctly.  Sets
10904         dict->var_by_name to NULL.  Calculates long_string_count
10905         correctly.  realloc's dict->var[] array to minimum size.
10906         [DEBUGGING] Calls dump_dictionary.
10907         [DEBUGGING] (dump_dictionary) New function.
10908
10909         * temporary.c: (save_dictionary) Sets var_by_name to NULL.
10910         (restore_dictionary) If the dictionary contains a non-NULL
10911         var_by_name, uses that instead of generating one.
10912         (free_dictionary) Destroys var_by_name.
10913
10914         * var.h: (struct dictionary) Added field `var_by_name'.
10915
10916         * get.c: New file, not complete.
10917
10918 Sun Nov  3 12:24:36 1996  Ben Pfaff  <blp@gnu.org>
10919
10920         * mis-val.c: New enums MV_NOR_*.  New struct num_or_range.
10921         (parse_num_or_range) New function.
10922         (parse_numeric) Reimplemented in order to support LOW THRU <n> and
10923         <n> THRU HIGH missing values.
10924
10925         * output.h: [__GNUC__>1 && __OPTIMIZE__] (width, height) Made
10926         __attribute__((const)).
10927
10928         * q2c.c: (get_token) Merged isdigit || isalpha into isalnum.
10929
10930         * sfm-read.c: Finished reference implementation.
10931
10932         * sfm.h: Includes var.h.
10933
10934         * var.h: Comment fixes.
10935         (struct `variable') Reordered some fields.
10936
10937         * vars-atr.c: (is_num_user_missing) Added support for MISSING_*
10938         constants added previously.
10939
10940 Wed Oct 30 17:13:08 1996  Ben Pfaff  <blp@gnu.org>
10941
10942         * common.h: Comment fixes.  Added declaration of
10943         `second_lowest_value' as variable or macro.  Made `compat_type',
10944         `pgm_state_type' into anonymous enums.
10945
10946         * display.c: Comment fix.
10947
10948         * glob.c: [ENDIAN==UNKNOWN] Added definition for `endian' global
10949         var.
10950         [!defined SECOND_LOWEST_VALUE] Added definition for
10951         `second_lowest_value' global var.
10952         (compat, pgm_state global vars) Changed types to `int'.
10953         (init_glob) Initializes `second_lowest_value'.
10954
10955         * sfm-read.c: Continued work, not complete.
10956
10957         * var.h: Added new MISSING_* constants to handle LOWEST and
10958         HIGHEST.
10959
10960 Sat Oct 26 23:06:06 1996  Ben Pfaff  <blp@gnu.org>
10961
10962         * sfm-read.c: New file, not complete.
10963
10964         * cases.c: (vec_insert) Changed vector expansion algorithm.
10965         (vec_delete) Fixed bug that screwed up deletion sometimes, it was
10966         mucking up the RECODE transformation in particular.
10967         (envector) Harmless change in notation.
10968
10969         dfm is now fairly well tested again.  
10970         * dfm.c: (dfm_get_record) Only returns ext->ptr if ext is
10971         non-NULL--duh.
10972         (cmd_begin_data) if(ext->line) replaced by if(ext && ext->line).
10973
10974         * recode.c: Comment fix.
10975
10976         * sfm.h: Interface should be fairly final now, or at least for a
10977         day or so...
10978
10979         * vfm.c: [DEBUGGING] (index_to_varname) New function.
10980         (open_active_file) [DEBUGGING] Translates ccase indices into
10981         variable names now to make it easier to understand what's really
10982         going on.
10983
10984 Sat Oct 26 20:46:31 1996  Ben Pfaff  <blp@gnu.org>
10985
10986         * data-in.c: Comment fix.
10987
10988         * data-list.c: Includes dfm.h.
10989         (do_reading) Uses new function dfm_push_cust().
10990
10991         * data-out.c: (convert_time, convert_WKDAY, convert_MONTH) Added
10992         `return 1;' at end.
10993
10994         * file-handle.h: Completely changed.  Some parts split off into
10995         new file dfm.h.  Implemented in file-handle.q.
10996         (enum FH_*) Removed.
10997         (struct fh_ext_class) New struct.
10998         (struct file_handle) Retained only these fields: name, norm_fn,
10999         fn, recform, lrecl, mode.  New fields class, ext.
11000         (get_handle_by_name, get_handle_by_filename, parse_file_handle,
11001         close_handle, handle_name) Added `fh_' prefix to name, all
11002         references changed.
11003
11004         * dfm.h: New file, implemented in dfm.c.
11005         (get_record, put_record, fwd_record, bkwd_record, set_record,
11006         get_cur_col) Functions moved from file-handle.h, now prefixed with
11007         `dfm_'.
11008         (dfm_push_cust) New function.
11009
11010         * sfm.h: New file.  Incomplete.
11011
11012         * dfm.c: All functions adjusted/rewritten for new dfm/fhp
11013         interface.  Functions reordered, comments changed.  Not well
11014         tested, probably full of bugs.
11015         (struct dfm_fhuser_ext) New struct.
11016         (dfm_close) New function.
11017         (open_file_r) Pickier about finding `BEGIN DATA.' line.
11018         (open_file_w) User messages changed.
11019         (get_record) Comment fixed.
11020         (read_record) Increments ext->ln even for inline_file.  Calls
11021         dfm_close() for inline_file when `END DATA.' encountered.
11022         (dfm_get_record) Experimental restructuring.
11023         (dfm_push_cust) New function.
11024         (cmd_begin_data) Detects whether the inline file was fully read by
11025         checking whether it is still open; detects whether it was read at
11026         all by checking whether the line number is greater than zero.
11027
11028         * file-handle.q: All functions adjust/rewritten for new dfm/fhp
11029         interface.  Functions reordered, comments changed.  Not well
11030         tested, probably full of bugs.
11031         (init_file_handle) Removed initializers for obsolete fields, added
11032         new fields.
11033         (fh_close_handle) Much simpler, now mainly calls the class
11034         function.
11035         (fh_init_files) Renamed inline file internal filename.
11036
11037         * file-type.c: Includes dfm.h.
11038         (read_from_file_type) Doesn't use dfm internal state anymore.
11039
11040         * inpt-pgm.c, print.c: Include dfm.h.
11041
11042         * recode.c: (internal_cmd_recode) Casts strlen() return value to
11043         int in comparison with other int.
11044
11045         * som-high.c: (build_target) Fixed operator precedence problem in
11046         if statement (& versus ==).
11047
11048 Sat Oct 26 10:39:25 1996  Ben Pfaff  <blp@gnu.org>
11049
11050         * dfm.c: (read_record) Can now read fixed-length records; not
11051         tested.
11052         (put_record) Can now write fixed-length records; not tested.
11053
11054         * file-handle.h: FH_* defines changed to enums.  New enum series
11055         FH_RF_*, FH_MD_*.
11056         (struct file_handle) New members recform, lrecl, mode.
11057
11058         * file-handle.q: Parser changed.
11059         (internal_cmd_file_handle) Added support for new /RECFORM, /MODE,
11060         /LRECL subcommands.  These are compatible with Windows.
11061         (init_file_handle) Initializes recform, mode fields.
11062
11063         * q2c.c: (get_line) When outputting `!' comment lines, now
11064         increments the output file line number so that `#line' directives
11065         are correct.
11066         (make_identifier) New function that converts an arbitrary string
11067         into a valid C identifier.
11068         (dump_vars) Calls make_identifier() in two places in order to
11069         suppress some errors for bad identifiers.
11070         (make_match) Allows TRUE as synonym for YES and FALSE as synonym
11071         for NO.  Allows numbers to be prefixed by underscores to make them
11072         acceptable C identifiers but still to be parsed as numbers by the
11073         Fiasco lexer.
11074
11075 Thu Oct 24 20:13:42 1996  Ben Pfaff  <blp@gnu.org>
11076
11077         * command.c: Re-enabled RECODE, SAMPLE, SELECT IF.
11078         
11079         * dfm.c: Comment fixes. (get_record) Gives error if file handle
11080         was opened for writing.
11081         (open_file_w) New function.
11082         (read_record) Uses strncasecmp if available.  Improved error
11083         messages, comments.
11084         (put_record) New function.
11085
11086         * file-handle.h: Moved function comments into dfm.c and
11087         file-handle.q.  Comment fixes.  Removed declarations of
11088         tilde_expand() and normalize_filename().
11089         (struct file_handle) Changed `open' from boolean to enumerated
11090         field to allow for three states--closed, open for reading, open
11091         for writing--all references changed.
11092
11093         * file-handle.q: Includes filename.h.
11094
11095         * print.c: (CMD_* enums) Renamed PRT_* and moved into var.h; all
11096         references changed.
11097         (alloc_line) Makes allowance for line terminator characters in
11098         calculations.
11099         (print_trns_proc) Now handles OUTFILE, WRITE differences.
11100         (print_space_trns_proc) Handles OUTFILE differences.
11101
11102         * recode.c, sample.c: Comment fixes.
11103
11104         * var.h: (struct print_trns) Changed boolean field `eject' to
11105         bitmapped field `options'; all references changed.  New enums
11106         PRT_* for use with this field.
11107
11108         * exception.h, test-exception.c: Removed.
11109
11110 Thu Oct 24 17:47:14 1996  Ben Pfaff  <blp@gnu.org>
11111
11112         * ascii.c: (delineate) Turned off debug output.
11113
11114         * common.c: [Checker and Linux] (__assert_fail, __eprintf) Moved
11115         to error.c.
11116
11117         * data-in.c: (parse_string_as_format) Sets the entire string value
11118         to spaces, not just the short string part of it.  Is this correct
11119         now? 
11120
11121         * data-out.c: (convert_date) Fixed DATETIME format problems with
11122         decimal places, removed debug code.
11123
11124         * dfm.c: (open_file_r) Fixed bug where an error would occur in the
11125         middle of parsing BEGIN DATA that would cause the lexer to read
11126         from a wild pointer `prog'; now calls new function
11127         preprocess_line() in lexer.c.
11128
11129         * error.c: [__CHECKER__] (hcf) Calls induce_segfault() on improper
11130         termination.
11131         [Checker and Linux] (__assert_fail, _eprintf) Moved from common.c.
11132         Now call induce_segfault() to induce the segfault.
11133         (induce_segfault) New function.
11134
11135         * expr-opt.c: Comment fix.
11136         (parse_sysvar) New function.
11137         (parse_primary) Added system variable support--calls
11138         parse_sysvar().
11139         (global var ops) Added OP_CASENUM operator.
11140
11141         * expr.h: Comment fixes.
11142         (OP_* enum) added OP_CASENUM operator.
11143         (struct casenum_node) New struct.
11144         (union any_union_union) New member `cas' of type `casenum_node'.
11145
11146         * glob.c: (global var last_vfm_invocation) New var.
11147         (init_glob) Initializes last_vfm_invocation.
11148
11149         * lexer.c: (lookahead) Fixed reversed condition on if statement.
11150
11151         * getline.c: (get_line) Split into get_line() and preprocess_line().
11152         (preprocess_line) New function.
11153
11154         * var.h: Declares last_vfm_invocation.
11155
11156         * vfm.c: (procedure) Sets last_vfm_invocation.
11157
11158 Wed Oct 23 21:53:43 1996  Ben Pfaff  <blp@gnu.org>
11159
11160         * command.c: (parse_cmd) Fixed bad assertion related to
11161         lookahead().
11162
11163         * data-in.c: (parse_month) Implemented to parse months according
11164         to full interpretation of standard.
11165         (to_roman) New function.
11166         (parse_wk_delimiter) Bug fix (forgot to skip `WK' in string).
11167         (parse_weekday) Bug fix (forgot to skip all the day name).
11168
11169         * data-list.c: (read_from_data_list_fixed) Fixed bug that screwed
11170         up parsing of multirecord data items.  Also fixed user message.
11171
11172         * data-out.c: Comment fix.
11173         (year2, year4, convert_date, convert_time, convert_WKDAY,
11174         convert_MONTH) New functions to support time & date output.
11175         (convert_format_to_string) Calls new time & date output routines.
11176
11177         * expr-prs.c: (nary_num_func) Found a bug, but didn't fix it yet.
11178
11179         * lexer.c: (lookahead) Noted a previously unnoticed caveat in
11180         comment.
11181
11182         * main.c: [DEBUGGING] (dump_token) Updated to handle getline.h.
11183
11184         * misc.c: (global var formats) Fixed declarations of DATETIME,
11185         TIME, DTIME.
11186
11187         * postscript.c: (text) Fixed a pair of bugs in the reallocation of
11188         the output_char buffer.
11189
11190         * vars-prs.c: (parse_DATA_LIST_vars) Fixed a failure to free
11191         memory bug.  Fixed user messages.
11192
11193 Tue Oct 22 17:27:04 1996  Ben Pfaff  <blp@gnu.org>
11194
11195         * Removed #pragma argsused from lots of places.
11196         
11197         * data-in.c: Implemented zoned decimal and time-date formats.
11198         Untested.  This is a huge chunk of code--maybe 1000 lines and 50
11199         new functions.
11200
11201         * data-out.c: Implemented zoned decimal format.
11202
11203         * expr.h: Moved yrmoda() declaration here from exprP.h.
11204
11205         * misc.c: (global var formats) Minor fixes--added
11206         FCAT_SHIFT_DECIMAL to formats N and Z.
11207         (convert_fmt_ItoO) Added support for format Z.
11208
11209         * som-frnt.c: (som_set_value) Fixed bug regarding string values.
11210
11211 Mon Oct 21 20:39:59 1996  Ben Pfaff  <blp@gnu.org>
11212
11213         * command.c: (parse_cmd) [GLOBAL_DEBUGGING] Inserted call to
11214         som_check_workspace() that is activated between commands.
11215
11216         * data-list.c: (dump_fixed_table, dump_free_table) Finished these
11217         for good, I hope.
11218
11219         * list.q: (begin_row) Changed title expansion style from
11220         SOPT_X_VERT to SOPT_X_SHSP.
11221
11222         * som-frnt.c: Now includes `somP.h'.
11223         (som_push_workspace, som_pop_workspace) New functions that, taken
11224         together, form a solution to the recursive table building problem
11225         mentioned yesterday.  Surrounded every table output routine
11226         throughout the program with calls to these functions.
11227         [GLOBAL_DEBUGGING] (som_check_workspace) New function.
11228         (som_create_table) Checks that there's an active workspace.
11229         (som_destroy_all_tables, som_crush) Removed.
11230
11231         * som-high.c: (global var som_preserve_tables) Removed, all
11232         references deleted.
11233         (som_submit_table) Checks that there's an active workspace.
11234         (dump_columnated_table) Doesn't columnate tables that would have
11235         just one row per column.
11236         (dump_crush_page, som_dump_crush_page) Removed debugging code.
11237         (som_dump_crush_page) Moved row number labels from left side of
11238         tables to right side.
11239         (som_get_table_size) Added support for SOPT_X_SHSP.
11240
11241         * som.h: New cell expansion type SOPT_X_SHSP.
11242
11243         * somP.h: (global vars arena_stack, n_arena_stack, m_arena_stack)
11244         New vars.
11245         (global var curtab_arena) Moved from som-frnt.c.
11246
11247 Sun Oct 20 13:45:28 1996  Ben Pfaff  <blp@gnu.org>
11248
11249         * ascii.c: [GLOBAL_DEBUGGING] (SUPPRESS_WARNINGS) New debug option
11250         that causes bad location warnings to be suppressed.
11251         (delineate) Saves current font when calling draw_text(); fixed
11252         handling of NULLs when backing up.  Also fixed line-wrapping bug.
11253
11254         * command.c: Re-enabled `LEAVE', `NUMERIC', `PRINT', `PRINT EJECT',
11255         `PRINT FORMATS', `PRINT SPACE', `STRING', `TITLE', `WRITE'.
11256
11257         * common.c: Added code to cause assertion failure to dump core
11258         when run under Checker.
11259
11260         * data-list.c: (dump_fixed_table) Fixed some inconsistencies, but
11261         there are still bugs.
11262
11263         * glob.c: (__eprintf) Removed.
11264
11265         * list.q: Inserted som_preserve_tables kluge that prevents tables
11266         from being thrown away due to recursive table building through
11267         som_output_line being called from a transformation during the LIST
11268         procedure invocation.  This is a general problem that must be
11269         solved in a better way since it applies to all procedures in
11270         general.
11271         (begin_row) Changed title options to SOM_X_VERT from SOM_X_BOTH.
11272         (flush_table) Removed SOM_TOPT_PRESERVE from submission options.
11273
11274         * numeric.c: Fixed several errors in the form of msg() calls.
11275
11276         * print.c: Updated for use of som.
11277         (dump_table) Reimplemented.
11278         (print_trns_proc) Calls som_eject_page() instead of eject_page().
11279         Calls som_output_text() instead of outs_line().
11280
11281         * som-frnt.c: (som_destroy_all_tables) Sets som_preserve_tables to
11282         0.
11283         (som_output_text) Function moved from som-low.c.  Interface
11284         changed.
11285
11286         * som-high.c: (som_preserve_tables) New global public variable
11287         declared in som.h.
11288         (som_submit_table) Destroys the tables only if som_preserve_tables
11289         is 0.
11290         (paginate_horizontally) Bugfix: sets som.mpw even if there's only
11291         one subrow per row.  Now labels subrows if there's more than one
11292         subrow per row.
11293         (dump_crush_table) Added wishlist comment.
11294         (som_eject_page) New public function declared in som.h.
11295
11296         * som-low.c: (som_dump_crush_page) Draws row labels if there's
11297         more than one subrow per row.
11298         (som_output_text) Moved to som-frnt.c.
11299
11300         * som.h: (SOM_TOPT_PRESERVE) Removed.
11301
11302         * title.c: (get_title) Changed interface.
11303         (cmd_title) Changed `title' to `outp_title'.
11304         (cmd_subtitle) Changed `subtitle' to `outp_subtitle'.
11305
11306 Sun Oct 20 09:04:15 1996  Ben Pfaff  <blp@gnu.org>
11307
11308         * list.q: (flush_table) Conforms to new partial options in
11309         som_submission_form.
11310
11311         * som-high.c: (paginate_horizontally) Changed form of subrow
11312         number labels.
11313         (build_target) Omits spacing before table if
11314         SOM_TOPT_PARTIAL_OMIT_TOP is selected.
11315         (dump_crush_page) Changed interface.  Only trims bottom rule if
11316         SOM_TOPT_PARTIAL_OMIT_BTM is not selected.
11317         (dump_crush_table) Handles partial tables.
11318         (output_row_label) New function.
11319         (som_dump_crush_page) Emits subrow number labels.  Draws vertical
11320         rule on the right edge of narrow subrows.
11321
11322         * som.h: Changed SOM_SUB_PARTIAL_* series of submission type
11323         constants to a series of SOM_TOPT_PARTIAL_* submission options.
11324         All references updated.
11325
11326 Fri Oct 18 19:46:49 1996  Ben Pfaff  <blp@gnu.org>
11327
11328         * misc.c: Comment fix.
11329
11330         * som-high.c: (examine_table) Treats crushed tables separates for
11331         purpose of determining header size.
11332         (paginate_horizontally) Allots space for line numbers in crushed
11333         tables with lots of subrows per row.  Calculates the `maximum page
11334         width', the width of the widest horizontal page.
11335         (build_target) Removed trim argument; all references changed.
11336         Stricter assertions.  (dump_crush_page) New function.
11337         (dump_crush_table) Reimplemented.
11338
11339         * som-low.c: (som_dump_page) Uses new RULE_ROW &c. constants.
11340         (som_dump_crush_page) Reimplemented, interface changed.
11341
11342         * somP.h: Many many new helper macros for use with crushed tables.
11343         (global var som) Removed `tv', `cum_y' members; all references
11344         removed.  New members `mpw', `digit_space'.
11345
11346 Sun Sep 29 19:37:03 1996  Ben Pfaff  <blp@gnu.org>
11347
11348         * arena.c: (arena_alloc) [!DISCRETE_BLOCKS] Removed `size'
11349         variable, changed to constant 1024.
11350         (arena_ca_strdup) Changed `sizeof(a_string)' to
11351         `sizeof(c_string)'.
11352         (arena_ca_strdup) [!DISCRETE_BLOCKS] Changed bad cast from
11353         `(c_string *)' to `(char *)'; this fixed some offset problems.
11354
11355         * filename.c: (readlink_malloc) Changed initial allocation from
11356         100 bytes to 128.
11357         (good_getcwd) Changed from xmalloc() to local_alloc(); removed
11358         comment.
11359
11360         * postscript.c: (read_fontmap) Fixed leak by changing &owner to
11361         &fm->owner in several places.
11362
11363         * som-high.c: (output_table) Changed interface to rest of world.
11364         (examine_crush_table) Removed.  Crushed tables are re-broken now,
11365         in preparation for rewrite.
11366
11367         * som.h: Comment fix.
11368
11369 Sat Sep 28 21:28:07 1996  Ben Pfaff  <blp@gnu.org>
11370
11371         * ascii.c: (ascii_init_driver) Disposes of x->file.filename and x
11372         itself in the cleanup stage.
11373
11374         * descript.q: (display) At least temporarily, changed the table
11375         format to a crushed table.
11376
11377         * list.q: (begin_row) At least temporarily, added horizontal lines
11378         between cases.
11379
11380         * som-high.c: (examine_crush_table) Sets som.hh to the width of
11381         the horizontal "headers," that is, to the width of the far left
11382         and far right rules.
11383         (justify_pagination) Sets som.th to the width of the widest row
11384         in the crushed table.  Fixed inner loop off-by-one error.
11385
11386         * som-low.c: (som_dump_crush_page) Added code to draw horizontal
11387         rules.
11388
11389         * somP.h: Comment fix.
11390
11391 Fri Sep 27 20:08:39 1996  Ben Pfaff  <blp@gnu.org>
11392
11393         * filename.c: (open_file_ext) Now, doesn't set f->file to NULL
11394         before closing it; also, opens the constructed filename `s'
11395         instead of f->filename.
11396
11397         * postscript.c: Moved initialization of x->loaded, x->prop,
11398         x->fixed, x->current, also the add_encoding() calls, into
11399         postopen().
11400         (preclose) Destroys x->combos; sets x->loaded, x->combos to NULL;
11401         sets x->last_font to NULL; sets x->next_combo to zero.
11402
11403         * som-high.c: (crushed_row_height) Moved definition farther up.
11404         (som_submit_table) Doesn't calculate line width, font size until
11405         after calling open_page(), to accomodate changes to PostScript
11406         driver.
11407         (vert_headers) Removed; equivalent functionality moved to
11408         examine_table(), examine_crush_table().
11409         (justify_pagination) Replaced with different algorithm.
11410         (dump_crush_table) Bugfix that caused tables to fail to be clipped
11411         at the bottom of the page.
11412
11413 Thu Sep 26 22:20:26 1996  Ben Pfaff  <blp@gnu.org>
11414
11415         * command.c: Added cmd_list back into cmd_table.
11416
11417         * freq.c, frequencies.q, repeat.c, list.q, vars-atr.c, vfm.c:
11418         Comment fix: `#define DEBUGGING' --> `#define DEBUGGING 1'.
11419
11420         * list.q: (flush_table) Updated to new som_submission_form format.
11421
11422         * som-frnt.c: Comment fix.
11423
11424         * som-high.c: Changed `#endif' to `#undef EXTERN'.
11425         (output_table) Calls som_get_table_size() directly; handles
11426         crushed tables.
11427         (examine_crush_table) New function; calls vert_headers().
11428         (examine_table) Moved some code into new function, vert_headers().
11429         (justify_pagination) New function.
11430         (dump_plain_table) Removed `static' from `cy'.
11431         (dump_crush_table) New function.
11432
11433         * som-low.c: (som_dump_crush_page) New function.
11434
11435         * som.h: Comment fixes.
11436         (enum SOM_TOPT_CRUSH) New.
11437         (SOM_SUB_PARTIAL_BEG, SOM_SUB_PARTIAL_MID, SOM_SUB_PARTIAL_END)
11438         Temporarily set to zero to make do with LIST procedure.
11439
11440         * somP.h: Re-ordering.
11441
11442 Wed Sep 25 19:36:11 1996  Ben Pfaff  <blp@gnu.org>
11443
11444         * som.c: Split into som-frnt.c, som-high.c, som-low.c.
11445
11446         * somP.h: New file for use by som-high.c, som-low.c.
11447
11448         * q2c.c: Added definition for VME.
11449         (get_line) Now dumps `!' comment lines to the output file
11450         verbatim.
11451
11452         * crosstabs.q, descript.q, file-handle.q, frequencies.q, list.q,
11453         set.q: Changed format of `!' comment lines.
11454
11455 Tue Sep 24 18:39:09 1996  Ben Pfaff  <blp@gnu.org>
11456
11457         * All source files: Added copyright notice.
11458
11459         * common.c: (xmalloc, xrealloc, xstrdup) Cast size_t's to unsigned
11460         longs in msg() calls.
11461
11462         * con32s.c: (xmalloc, xrealloc) Updated from common.c.
11463
11464         * q2c.c: (xmalloc, xrealloc, xstrdup) Updated from common.c.
11465
11466 Sat Sep 21 23:16:31 1996  Ben Pfaff  <blp@gnu.org>
11467
11468         * output.c: (outp_read_devices) Changed criteria for
11469         distinguishing different types of lines.
11470
11471 Fri Sep 20 22:52:28 1996  Ben Pfaff  <blp@gnu.org>
11472
11473         * cmdline.c: Changed syntax message.
11474
11475         * filename.c: (good_getcwd) Bug fix (?).
11476         (normalize_filename) [__BORLANDC__] Uses _fullpath() library
11477         function.
11478         (search_path) Appends DIR_SEPARATOR to directory name only if it
11479         does not already end with one.
11480
11481         * glob.c: Checks STAT_PAGER envvar before PAGER.
11482
11483         * output.c: Checks environment variables instead of just local
11484         macros.
11485
11486 Tue Sep 10 21:39:00 1996  Ben Pfaff  <blp@gnu.org>
11487
11488         * arena.c: (arena_destroy) Swatted a subtle bug that cropped up
11489         when the pointer passed to the function was within the arena
11490         itself, so that it couldn't properly be set to NULL _after the
11491         arena was freed_.
11492
11493         * command.c: Re-enabled DISPLAY.
11494
11495         * display.c: Rewritten to handle tables.  Untested.
11496
11497         * filename.c: (search_path) Fixed memory leak.
11498
11499         * frequencies.q: (cmd_frequencies) Frees v_variables.
11500         (postcalc) Calls cleanup_freq_tab() after displaying statistics.
11501         (cleanup_freq_tab) New function to garbage collect.
11502         (dump_full) Elegantized.
11503
11504         * main.c: New comment.
11505
11506         * output.h: New tag for tagged quotes: TAG_NEWLINE.
11507
11508         * postscript.c: Comment fix.
11509         (release_fontmap, free_font_entry) New functions.
11510         (ps_init_driver) Sets free_font_entry() as the freefunc for
11511         hashtable `loaded'.  Calls release_fontmap() when destroying a
11512         driver; also frees the output filename; also frees the
11513         ps_driver_ext block.
11514         (free_ps_encoding) Frees the filename as well as the encoding
11515         block.
11516         (output_encodings) Frees the line buffer and pops the msg-filename
11517         stack.
11518         (read_fontmap) Frees the fontmap filename and the line buffer.
11519         (postopen, preclose) Misc. garbage collection fixes.
11520         (ps_open_page) Destroys the `combos' hash table; sets `last_font'
11521         to NULL; this fixes some output problems.
11522         (text) Handles TAG_NEWLINE.  Untested.
11523
11524         * som.c: (cell_byte_size) Merged SCON_VALUE and SCON_TEXT cases.
11525         (som_set_string) Removed.  All references changed to
11526         `som_set_text'.
11527         (som_set_text) Rewritten.  New interface.  More general.
11528
11529         * som.h: Minor format changes.
11530         (struct som_value_cell) Removed; all references changed to
11531         `som_text_cell'.
11532         (enums SOT_*) Changed.
11533
11534 Mon Sep  9 21:43:13 1996  Ben Pfaff  <blp@gnu.org>
11535
11536         * command.c: Re-enabled SPLIT FILE.
11537
11538         * postscript.c: Comment fix.
11539
11540         * som.h: Added `SOT_NONE'.
11541
11542         * split-file.h: (cmd_split_file) Removed superfluous parenthesis.
11543
11544         * vfm.c: (dump_splits) Reimplemented.
11545
11546 Sat Sep  7 22:35:12 1996  Ben Pfaff  <blp@gnu.org>
11547
11548         * Compiled the project under gcc 2.7.2, which gave some new
11549         warnings.  This led to many additions of casts from unsigned to
11550         int sprinkled throughout the code.
11551         
11552         * arena.c: Many uses of `unsigned' changed to `size_t'.
11553
11554         * command.c: Added END FILE, END REPEAT to command table.
11555         (var cmd_end_repeat) Renamed cmd_end_repeat_p.
11556         (find_command, FILE_TYPE_okay) Not commented out anymore.
11557         (parse_cmd) Calls FILE_TYPE_okay again.
11558         (output_line) Added calls to som_output_text() to put the line
11559         in the output files.
11560
11561         * common.c: (macro VME) Format changes.
11562         (xstrdup) Asserts that its argument is not NULL.
11563         
11564         * data-list.c: Implemented dump_fixed_table().
11565         
11566         * inpt-pgm.c: Formatting changes.  Comment changes.
11567         (end_case_proc) Renamed end_case_trns_proc.
11568         (cmd_end_file, end_file_trns_proc) New functions.
11569
11570         * misc.c: Many uses of `int' and `unsigned' changed to `size_t'.
11571
11572         * misc.h: (local_strdup) New macro corresponding to strdup() but
11573         allocating its data through local_alloc() if possible--that is, if
11574         GNU C is in use.
11575
11576         * postscript.c: Comment changes.
11577         (quote_ps_name, quote_ps_string, output_encodings) New functions.
11578         (output_line, add_string) New macros supporting
11579         output_encodings().
11580         (postopen) Fixed contents of ${fixed-font} and ${prop-font}
11581         substitution vars.  Calls output_encodings() when a line
11582         consisting of `!encodings' is encountered.
11583         (preclose) Some code moved into quote_ps_string().
11584         (dump_line) Changed into macro supporting dump_fancy_line().
11585         (switch_font) Now outputs DSC "%%IncludeResource: font (...)"
11586         command when appropriate.
11587         (write_text) Fixed `literal_char' array (I think it's fixed, at
11588         least.)
11589         (text) Fixed bug when width was zero.  Now exits immediately on
11590         zero height_left.  Now, when executing `goto restart;', checks
11591         that cp<end, so that we don't read beyond end-of-string.  Also,
11592         outputs the correct code to the output file by outputting the code
11593         from the metric instead of the internal metric index.
11594
11595         * repeat.c: (cmd_end_repeat) New function.
11596
11597         * som.c: (var som) `headers' renamed `options' and semantics
11598         changed.  All references changed.
11599         (draw_title) `if(px!=-1 || px!=-1)' --> `if(px!=-1 || py!=-1)'.
11600         (build_target) Only inserts spacing if SOM_TOPT_SPACING not
11601         selected.
11602         (som_text_table) Removed.
11603         (som_output_text) New function.
11604
11605         * som.h: (struct som_submission_form) Removed `header', `reuse',
11606         replaced with bitmapped field `options'.
11607         (SOM_TOPT_*) New enum set for som_submission_form.options.
11608         (SOT_*) New enum set for som_output_text().
11609
11610         * temporary.c: (copy_variable) When copying the var label, only
11611         calls xstrdup() if it's non-NULL.
11612
11613         * var.h: (enum type `vartype') Removed; all references changed to
11614         `int'.
11615
11616         * vars-atr.c: (init_variable) Changed local var `nbytes' from
11617         `int' to `size_t'.
11618
11619 Thu Sep  5 22:05:56 1996  Ben Pfaff  <blp@gnu.org>
11620
11621         * font.h: Comment changes.
11622
11623         * groff-font.c: (groff_read_font) Initializes `name' field to
11624         NULL.  Handles `encoding' field.
11625
11626         * hash.c: (hsh_dump) [GLOBAL_DEBUGGING] Output formatting changes.
11627
11628         * postscript.c: (struct font_entry) Removed `position' field.
11629         (struct ps_font_combo) New struct.
11630         (struct ps_driver_ext) Removed field `next_position'.  New fields
11631         `combos', `next_combo'.  `last_font' field changed from
11632         `font_entry *' to `ps_font_combo *'.
11633         (ps_init_driver) Reformatted; handles new fields.  When
11634         OPO_AUTO_ENCODE is set, adds the two default fonts' encodings to
11635         the encoding list.
11636         (get_encoding, find_encoding_file) New functions.
11637         (add_encoding) Some code moved out into find_encoding_file().
11638         (postopen) Changed value for ${title}.
11639         (preclose) Sets `loaded' field to NULL after destroying the hash
11640         table.
11641         (ps_open_page) Added comment.  Inits the `combos' and `next_combo'
11642         fields.
11643         (ps_text_set_font_by_position) Figures out the current family if
11644         not known.
11645         (compare_ps_combo, hash_ps_combo, free_ps_combo) New functions.
11646         (switch_font) Implemented.
11647         (write_text) Calls switch_font() more often.  Format changes.
11648         #undefs its macros after they're no longer useful.
11649         (text) Changed `continue' at one point to a jump to the top of the
11650         loop because we don't want `separate' reset to 0 at that point.
11651         (load_font) No longer sets `position' in the font_entry created.
11652
11653 Wed Sep  4 21:45:35 1996  Ben Pfaff  <blp@gnu.org>
11654
11655         * font.h: (struct font_desc) New member `encoding', which is not
11656         properly handled yet.
11657
11658         * glob.c: (init_glob) Some new i18n code, which is probably
11659         screwed up.
11660
11661         * output.c: (outp_read_devices, outp_get_paper_size) Changed
11662         `size' local from `int' to `size_t'.
11663
11664         * postscript.c: New driver configuration parameter `auto-encode'.
11665         New enums OPO_AUTO_ENCODE, ODA_COUNT.
11666         (struct font_entry) New member `position'.
11667         (struct ps_driver_ext) Reordered.  New hash table member
11668         `encodings'; new members `next_position', `next_encoding',
11669         `last_font'.  Members `current', `prop', `fixed' changed from type
11670         `font_desc *' to `font_entry *'; all references changed.
11671         (struct ps_encoding) New struct.
11672         (read_ps_encodings, compare_ps_encoding, hash_ps_encoding,
11673         free_ps_encoding, add_encoding) New functions.
11674         (ps_init_driver) Added OPO_AUTO_ENCODE to default
11675         x->output_options.  Initializes new members of ps_driver_ext.
11676         Changed default value for prologue_fn, encoding_fn.  Calls
11677         read_ps_encodings after loading default fonts.
11678         (option_tab[], ps_option) Handle new configuration parameter.
11679         (switch_font) New function.
11680         (struct output_char) `font' member changed from `font_desc *' to
11681         `font_entry *'.  New member `separate'.
11682         (read_fontmap) Changed `size' from `int' to `size_t'.
11683         (output_line, put_number) New macros for write_text().
11684         (write_text) Optimizes text output by consolidating multiple
11685         calls to PostScript `show' operator.
11686         (text) Keeps track of when text arguments can't be consolidated by
11687         write_text(), and marks those spots in the output stream.
11688         (load_font) Sets `position' of the allocated font_entry to -1, cuz
11689         the font hasn't been switched to by switch_font(), which is where
11690         the position is important--the PostScript is what cares about the
11691         position.
11692
11693 Sat Aug 31 23:52:38 1996  Ben Pfaff  <blp@gnu.org>
11694
11695         * hash.c: (hsh_destroy) Ignores NULL argument.  Doesn't try to
11696         call a NULL free_func.
11697         (hsh_rehash) Elegantized.
11698         (hsh_probe) Fix bug that manifested when the table was expanded
11699         and thus had to change location in memory.  Good thing
11700         too--otherwise could have been much more subtle.
11701         (hsh_find) [GLOBAL_DEBUGGING] Not stubbed out anymore.
11702         (hsh_foreach) New function for hash table iteration.
11703
11704         * hash.h: (struct hsh_iterator) New.
11705
11706         * lexer.c: (parse_tagged_quote) Font and family name strings in
11707         tags are now null-terminated.
11708
11709         * output.c: (outp_evaluate_dimension) Fixed over-aggressive unit
11710         parsing.
11711         (internal_get_paper_size, outp_get_paper_size) Fixed; now work as
11712         documented.  (Never before tested?)
11713
11714         * output.h: Comment changes.
11715
11716         * postscript.c: New driver options `optimize-text-size',
11717         `optimize-line-size', `max-fonts-simult'.  New enum set for
11718         specing cached line types.  Comment fixes.
11719         (struct line_form) New struct.
11720         (struct ps_driver_struct) New members `text_opt', `line_opt',
11721         `max_fonts', `lines'.
11722         (ps_init_driver) Initializes new members of ps_driver_struct.
11723         (user option type enum set) New member `nonneg_int_arg'.
11724         (static var option_tab[]) Supports new options.
11725         (ps_option) Handles new options.
11726         (find_ps_file) Made static.  No longer calls hsh_dump().
11727         (ps_get_var) Made static.
11728         (preclose) Dumps out proper DSC trailer.
11729         (ps_open_page) Elegantized.
11730         (ps_close_page) Calls dump_lines() if appropriate.
11731         (ps_line_horz, ps_line_vert, ps_line_intersection) Reduced to
11732         wrappers around line().
11733         (int_2_compare, compare_line, dump_line, dump_fancy_line,
11734         dump_lines, hash_line, free_line, line) New functions for support
11735         of line caching.
11736         (write_text, text) Made static.
11737         (text) Added to font support, not finished.
11738
11739 Thu Aug 29 21:36:41 1996  Ben Pfaff  <blp@gnu.org>
11740
11741         * font.h: (struct font_desc) New members ascent, descent.
11742
11743         * groff-font.c: (groff_read_font) Calculates font ascent and
11744         descent from the ascent and descent of the `d' and `p' characters,
11745         respectively, as per a suggestion on comp.fonts.
11746
11747         * postscript.c: (ps_open_page, ps_close_page, ps_line_horz,
11748         ps_line_vert, ps_line_intersection) Rewritten to deal with changed
11749         prologue.
11750         (write_text) Handles text right-justification and centering (not
11751         full justification).  Still very inefficient.  (One output line
11752         per character?!)
11753         (struct output_char) Added fields for font and font size.
11754         (text) Many bugfixes.
11755
11756 Sat Aug 24 23:26:00 1996  Ben Pfaff  <blp@gnu.org>
11757
11758         * cmdline.c: (usage) Calls outp_list_classes().
11759
11760         * font.h: Comment fix.
11761
11762         * groff-font.c: New exported global var `space_index'.
11763         (groff_init) New function to initialize `space_index'.
11764         (hash_kern) Casts result to unsigned.
11765         (font_name_to_index) Renamed font_char_name_to_index.  All
11766         references changed.  Also, now returns the value of `space_index'
11767         when passed an ASCII space character as an argument.  Fixed
11768         handling of nulls.
11769         (font_get_kern_adjust) Changed i from `int' to `unsigned'.
11770         Handles passed NULL pointers properly.
11771
11772         * lexer.c: (parse_tagged_quote) Comment fix.  Better range
11773         checking.
11774
11775         * output.c: (outp_list_drivers) Removed.  Removed all references.
11776         
11777         * output.h: Comment fixes.
11778
11779         * postscript.c: (ps_open_global) Calls groff_init().
11780         (output_char) New structure.
11781         (write_text) New function.
11782         (text) No longer stubbed out!  Now the output is correct--with a
11783         few exceptions, one of them being that the page has to be held
11784         upside down into a mirror.
11785
11786 Sun Aug 11 21:31:22 1996  Ben Pfaff  <blp@gnu.org>
11787
11788         * font.h: Comment fix.
11789         
11790         * font.c: (name_to_index) Renamed font_name_to_index, made extern.
11791         All callers changed.
11792         (number_to_index) Renamed font_number_to_index, made extern.  All
11793         callers changed.
11794         (font_get_kern_adjust, font_get_char_metrics) New functions.
11795
11796         * output.h: New constant OUTP_T_INTERNAL_DRAW.
11797
11798         * postscript.c: Changed default line width back to 1/2 point.
11799         (ps_line_horz, ps_line_vert, ps_line_intersection) Now lines are
11800         in the center of the space allotted for them, not just a fixed
11801         offset from the edge of the space; this fixes some bugs.
11802         (ps_line_intersection) Now supports all command line styles.
11803         (ps_text_get_size) Bug fix in computation of em width.
11804         (text) New function, the meat behind ps_text_metrics and
11805         ps_text_draw.  Not complete.
11806         (ps_text_metrics, ps_text_draw) Removed the stub taken from
11807         ascii.c; call text().
11808
11809 Sat Aug 10 23:28:17 1996  Ben Pfaff  <blp@gnu.org>
11810
11811         * arena.c: (arena_free) Assert that the argument is non-NULL.
11812         
11813         * groff-font.c: (add_kern) Calls arena_free() for old_kern if and
11814         only if old_kern is non-NULL.
11815
11816         * postscript.c: (ps_init_driver) Changed default line width to 1
11817         point.
11818         (postopen) New prologue variables.
11819         (ps_line_horz, ps_line_vert, ps_line_intersection) Implements some
11820         more of the common line styles properly, but not all.
11821         (ps_text_metrics) Fixed problem with this stubbed out version that
11822         kept it from taking font sizes into account.
11823
11824 Thu Aug  8 22:31:11 1996  Ben Pfaff  <blp@gnu.org>
11825
11826         * arena.c: (arena_malloc) Bug fix.
11827         (arena_dump) [GLOBAL_DEBUGGING] New function.
11828
11829         * ascii.c: Comment fix.
11830         (count_fancy_chars, delineate) Now static functions.
11831         
11832         * filename.c: (interp_vars) Bug fixes.
11833
11834         * font.h: Comment fixes.
11835
11836         * glob.c: (init_glob) Sets set_viewwidth, set_viewlength at
11837         beginning in case we have an error message to display before
11838         initializing the display.
11839
11840         * groff-font.c: Comment fix.  Changed rehash threshold from 2/3
11841         full to 1/2 full.
11842         (groff_read_font) Bug fixes.
11843         (name_to_index) Increments hash.used.  Sets `name' field of hash
11844         entry properly.
11845         (add_kern) Sets kern_max_used after rehashing.  Other bug fixes.
11846
11847         * hash.c: Return type changed.
11848
11849         * postscript.c: Continued development.  Now marks lines on the
11850         paper, but very buggy.
11851
11852 Sat Aug  3 20:50:35 1996  Ben Pfaff  <blp@gnu.org>
11853
11854         * Changed comments in many source files from `/* xxx /* yyy */' to
11855         `/* xxx */ /* yyy */' for cleanliness.
11856
11857         * arena.c: (arena_sd_strdup) New function.
11858         
11859         * ascii.c: (struct ascii_driver_ext) New member `file'.
11860         (ascii_init_driver) Fills out member `file' for initing; uses
11861         close_file_ext for closing drivers.
11862         (ascii_option) Changed %.*s back to %s because the a_string's are
11863         always null-terminated.
11864         (postopen, preclose) New functions.
11865         (ascii_open_page) Uses new style of open_file_ext.
11866         (ascii_option, commit_line_buf, output_lines) Use ext->file.file
11867         instead of this->output.
11868         (__assert_fail) Removed.
11869
11870         * cmdline.c: Changed syntax_message[].
11871
11872         * error.c: #include's <readline/history.h> only if the history
11873         library is available, not if just the readline library is
11874         available.
11875
11876         * filename.c: (expand_line) Removed alloca() support.
11877         (interp_vars) No longer tilde-expands argument.  Limit on output
11878         length removed.
11879         (tilde_expand) Now treats argument as path rather than filename.
11880         [!unix] Now is a no-op function.
11881         (search_path) Better verbose message formatting.
11882         (open_file, close_file) Comment fixes.
11883         (close_file) [!unix] Doesn't bother with pipes.
11884         (open_file_ext) Completely rewritten, interface revamped.
11885         (close_file_ext) New function.
11886
11887         * font.h: Comment changes.
11888
11889         * frequencies.q: Removed AIX alloca support since it doesn't use
11890         alloca.
11891
11892         * hash.c: Comment changes & additions.
11893         (hsh_create) Initializes entire table instead of first M entries.
11894         (hsh_probe) Stupid bug fixed.  Now it works.
11895         (hsh_dump) [GLOBAL_DEBUGGING] New function.
11896
11897         * main.c: (parse) Detects EOF properly in token-eating loop.
11898         Should the STOP token have its value changed to 0?
11899
11900         * misc.c: (blp_getdelim) [HAVE_GETDELIM] Now it's a macro.
11901         (blp_getline) Now it's a macro.
11902
11903         * output.h: (struct outp_driver) Removed members output, filename.
11904         
11905         * output.c: (outp_init) [!NO_POSTSCRIPT] Installs PostScript
11906         drivers in driver table.
11907         (outp_read_devices) Frees buf.  Warns if there are no active
11908         output drivers.
11909         (outp_configure_clear) Sets outp_configure_vec to NULL after
11910         deleting its elements.
11911         (configure_driver, destroy_driver) Removed references to output,
11912         filename members of outp_driver.
11913         (outp_evaluate_dimension, internal_get_paper_size,
11914         outp_get_paper_size) New functions.
11915
11916         * postscript.c: Continued development.  Now links but doesn't make
11917         any marks on the page.  Lotsa bugs I suppose.
11918
11919         * str.c: (strcasecmp) [!HAVE_STRCASECMP] New function.
11920
11921         * str.h: Comment changes.
11922
11923 Sat Jul 27 22:32:38 1996  Ben Pfaff  <blp@gnu.org>
11924
11925         * Removed dependencies on non-nested comments in several files.
11926         Also removed references to (unix || __unix__) in #if's since
11927         prefh.orig makes those two equivalent.
11928         
11929         * ascii.c: (ascii_open_global) Creates ascii_arena.
11930         (ascii_close_global) Destroys ascii_arena.
11931         (ascii_init_driver) Doesn't create ascii_arena.
11932         (ascii_copy_driver) Removed.
11933         (ascii_option) Possible bugfix regarding %s vs. %.*s with a_string's.
11934         (outp_class ascii_class) Removed ascii_copy_driver reference.
11935
11936         * frequencies.q: Now can display all statistics except median.
11937         Still not finished.
11938
11939         * output.c: Handles outp_class.ref_count so output class
11940         destructors are called properly.
11941         (add_class) Sets ref_count to 0.
11942         (configure_driver) Initializes class if ref_count++ is 0.
11943         (destroy_driver) Destructs class if --ref_count is 0.  Frees the
11944         class output file name.
11945         
11946         * output.h: (struct outp_class) Removed copy_driver, inited.
11947         Added ref_count.
11948
11949         * postscript.c: Completely replaced but not finished.
11950         
11951 Tue Jul 23 21:48:36 1996  Ben Pfaff  <blp@gnu.org>
11952
11953         * approx.h: #includes <float.h>.
11954
11955         * arena.h, arena.c: Many functions changed to take an arena **
11956         instead of an arena *, for consistency.  All callers changed.
11957         (arena_alloc) Now creates a new arena if passed *A that is NULL.
11958         (arena_destroy) Sets *A to NULL.
11959         
11960         * ascii.c: (delineate) Implements OUTP_T_VERT correctly.  Removed
11961         assertion that `width' be positive.
11962
11963         * command.c: Removed #if's from cmd_table.
11964         (walk_cmdtable_func) [0] New function (debug code).
11965         (init_cmd_parser) [0] Dumps out cmd_table (debug code).
11966         (parse_cmd) Doesn't return failure for unimplemented commands.
11967
11968         * common.h: (SYSMIS) Changed from DBL_MAX to -DBL_MAX.
11969         (SYSCODE) New constant macro.
11970
11971         * descript.q: Checks for positive n_variables before performing
11972         analysis.
11973
11974         * file-handle.q: (get_handle_by_filename) Bug fix: passes &f to
11975         avl_find instead of &fp as arg 2.
11976
11977         * frequencies.g, frequencies.q: Continued updating; now compiles &
11978         works again, but not complete.
11979
11980         * main.c: Changes to user messages.
11981
11982         * misc.c: (reverse) [0] New function.
11983
11984         * settings.h: Comment removed.  #includes "common.h".
11985
11986         * som.c: (som_set_null) New function.
11987         (som_set_value, som_set_string, som_set_text) More detailing
11988         assertions.
11989         (som_set_float) Implemented function.
11990         (dump_columnated_table) Bug fix regarding page breaks.
11991         (draw_cell) Bug fix regarding text that spilled out of a cell.
11992         (draw_intersection, draw_horz_rule, draw_vert_rule) No longer draw
11993         null lines.
11994         (get_cell_size) Support SCON_EMPTY cells.
11995         (get_table_size) When calculating rules' widths and heights, mask
11996         out SLIN_SPACING bit.  Added SOPT_X_HLTL support.
11997         
11998         * som.h: (som_any_cell) New option SOPT_X_HTLT.  Removed
11999         SOPT_X_SHADE.
12000         (struct som_submission_form) New member `header'; all users
12001         changed.
12002
12003         * val-labs.c: (get_label) User messages changed.
12004
12005         * var.h: Changed FREQUENCIES structures.
12006
12007         * vars-atr.c: (is_num_user_missing, is_str_user_missing) Made
12008         inline.
12009         
12010 Fri Jul 19 19:11:13 1996  Ben Pfaff  <blp@gnu.org>
12011
12012         * approx.h: Definition of EPSILON now depends on system's
12013         DBL_EPSILON.  Removed GNU C specific code.
12014         (cmpapx) Renamed approx_compare.
12015
12016         * frequencies.g, frequencies.q: Continued updating; still doesn't
12017         compile.
12018
12019         * groff-font.c: (name_to_index) Fix bug that kept it from
12020         compiling.
12021
12022         * hash.c, hash.h: Completed work.
12023
12024         * var.h: Changes to freq_tab, frequencies_proc.
12025         
12026 Wed Jul 17 21:23:36 1996  Ben Pfaff  <blp@gnu.org>
12027
12028         New hashing code.
12029         * hash.c, hash.h: New files.  Not completed.
12030         * Makefile.am: Added hash.c to source file list.
12031         * font.h: (struct font_desc) New member kern_size_p.
12032         * groff-font.c: Uses hash.h.
12033         (hashpjw) Moved to hash.c.
12034         (next_prime_power) Rewrote, renamed hsh_next_prime, moved to
12035         hash.c.
12036         (static var hash) New member size_p.
12037         * var.h: Includes hash.h.
12038         (struct freq_tab) Changed AVL_TREE to hash_tab.
12039
12040         * vars-prs.c: Comment, formatting fixes.
12041
12042         * frequencies.g, frequencies.q: Continued updating.  Not yet
12043         working.
12044
12045         * formats.c: Bug fix.
12046
12047 Tue Jul 16 22:10:04 1996  Ben Pfaff  <blp@gnu.org>
12048
12049         Increasing parallelism between DESCRIPTIVES and FREQUENCIES.
12050         * descript.g: Comment fixes.
12051         * descript.q: Comment fixes.  Moved some declarations into var.h.
12052         Made dsc_info a static table.  Updated FIXMEs.
12053         (internal_cmd_descriptives) Beautified.
12054         
12055         * frequencies.q: Started updating into working order.
12056         * frequencies.g: New file analogous to descript.g.
12057         * var.h: Comment fixes.  Added structures for FREQUENCIES.
12058         
12059         * som.c: Removed vestiges of crushing and partial table support.
12060
12061 Sun Jul 14 15:45:31 1996  Ben Pfaff  <blp@gnu.org>
12062
12063         * Many more changes to som.c especially, but these will not be
12064         documented as I have resolved to remove them.  This patchlevel is
12065         being released solely so that I can fall back to it if I decide
12066         that removing the changes is not a good idea.
12067
12068 Sat Jul 13 09:58:44 1996  Ben Pfaff  <blp@gnu.org>
12069
12070         * som.c: (global var som) New member `cum_y'.
12071         (build_target) Properly handles titles for partial tables.
12072         (dump_partial_beg, dump_partial_mid, dump_partial_end)
12073         Merged into single new function dump_partial().  Fixed problem
12074         with titles on partial tables.
12075         (dump_table) Calls dump_partial() for all parts of partial tables.
12076         (dump_page) Criteria for drawing title changed.
12077         
12078 Fri Jul 12 22:03:36 1996  Ben Pfaff  <blp@gnu.org>
12079
12080         * command.c: (cmd_table) Added LIST, WEIGHT.
12081
12082         * command.c: (cmd_remark) No longer frees `s' since it's not
12083         dynamically allocated.
12084         
12085         * data-out.c: (convert_f) Now correctly handles the case where
12086         abs(v->f)<1 but v->f rounds to a value of 1.00 given the specified
12087         number of decimals.
12088         (som_destroy_all_tables) Removed argument.  All callers changed.
12089         (som_vline, som_hline) Argument validity checking corrected.
12090         (som_set_value) Implemented half-heartedly.
12091         (replicate_table) Copies tables piece-by-piece when using Checker.
12092
12093         * som.h: New line style SLIN_1THIN, currently equivalent to
12094         SLIN_0.  New enum set SOM_SUB_*.
12095         (struct som_submission_form) Removed `seq_no'.  Added `type'.
12096         
12097         * list.q: Newly working file; uses partial tables.
12098         
12099         * som.c: (som_reduce_table) Renamed som_set_table_height().
12100         (som_crush) Removed argument `group'.
12101         (global var som) Removed `nt', `seq_no'.  Added `type'.
12102         (som_submit_table) Arguments changed.
12103         (output_table) Removed partial table code.
12104         (build_target) New arg; partial table support added.  All callers
12105         changed.
12106         (dump_plain_table) Removed partial table code.
12107         (dump_partial_beg, dump_partial_mid, dump_partial_end) New functions.
12108         (dump_table) Supports partial tables.
12109         (dump_page) New argument to allow not drawing top and/or bottom
12110         headers.  All callers changed.  Supports partial tables.
12111
12112 Sat Jul  6 22:22:25 1996  Ben Pfaff  <blp@gnu.org>
12113
12114         * data-out.c: Changed `#include <approx.h>' to `#include
12115         "approx.h".
12116         (convert_F) Comment fix.  Now won't print `-.000', etc.
12117
12118         * descript.q: Now Z-scores work, although there appears to
12119         be a bug (which might actually be in data-out.c:convert_F()).
12120         (descriptives_trns_proc, descriptives_trns_free) New functions.
12121         (run_z_pass) Implemented.
12122         
12123         * var.h: Comment fixes.
12124         (dsc_z_score, descriptives_trns) New structs.
12125         (descriptives_trns) Added to any_trns as `dsc'.
12126
12127         * error.c, error.h: New error class, IS (Installation Script
12128         error), used in those instances where the error is in the
12129         installation, but there is a script file or installation file that
12130         can be usefully referred to.
12131         
12132         * output.c: Change many IE classes to IS classes.
12133
12134         * cases.c, command.c, common.c, crosstabs.q, expr-evl.c,
12135         frequencies.q, list.q, vars-prs.c, vfm.c: Removed reference to
12136         HAVE_MALLOC_H because Borland C++ alloca() is broken, so why
12137         include the corresponding header?
12138         
12139         * glob.c: (init_glob) Don't malloc term_buffer under Checker.
12140         Don't bail out if termcap can't be read.
12141
12142         * som.c: (som_destroy_table) Removed.
12143         (som_reduce_table, som_destroy_all_tables) New functions.
12144         (som_crush) New function, not implemented.
12145         
12146         * som.h: New table option STAB_CRUSH.  Comment fix.  New struct
12147         som_submission_form.  Function prototypes revised.
12148
12149         Outputting huge tables (1000s of rows) a few rows at a time
12150         is supported, though untested.  May even break everything.
12151         Actually, the code doesn't even compile right now.
12152         * som.c: (struct som) New fields htv, nt, seq_no.
12153         (som_submit_table) Multiple arguments changed to a single
12154         pointer to struct submission_form.  Only increments subtable_num
12155         if seq_no is zero.  Only destroys table if it's not going to
12156         be reused.
12157         (replicate_table) New function.
12158         (output_table) Comment fix.
12159         (examine_table) Changed inline code to code calling
12160         replicate_table().  Calculates htv.  Supports partial tables.
12161         (draw_title) Removed comment.
12162         (build_target) Only allows for title on first part of partial
12163         tables.
12164         (dump_plain_table) Only resets table chunk number on first part
12165         of partial tables; FIXME: doesn't work quite right.  Supports
12166         partial tables.
12167         (dump_page) Titles only on first part of partial tables.
12168
12169 Fri Jul  5 20:16:19 1996  Ben Pfaff  <blp@gnu.org>
12170
12171         * Thanks to an unreliable IDE hard drive, I have spent the last
12172         day reconstructing my Debian GNU/Linux installation and redoing
12173         the previous day's changes--somehow I managed to save every file
12174         except for output.c and output.h.  So the following changes could
12175         really be considered independent of the output.c, output.h changes
12176         from Jul 4.
12177
12178         * output.h, output.c: Moved the outp_configure_vec global var,
12179         outp_names struct, and enum set OUTP_S_* from output.h to output.c.
12180         outp_configure_vec is now static.
12181         
12182 Thu Jul  4 20:20:24 1996  Ben Pfaff  <blp@gnu.org>
12183
12184         * The entire philosophy behind configuration of the output drivers
12185         changed.  Now there is a termcap-type configuration where drivers
12186         to be read are determined beforehand, rather than parsing the
12187         entire output init file and storing it in memory & deciding what
12188         to actually use later.  Faster & more memory-efficient at the same
12189         time, cool.
12190         
12191         * output.c: Comment fix.  Removed outp_init_drivers global var.
12192         Removed all references to synonyms.  New structure outp_defn.  New
12193         global vars outp_macros, outp_configure_vec.
12194         (search_name, delete_name, add_name, check_configure_vec,
12195         expand_name, find_defn_value) New static functions.
12196         (outp_configure_clear, outp_configure_add, outp_configure_macro,
12197         outp_read_devices) New extern functions.
12198         (outp_init) Much functionality moved into outp_read_devices.
12199         (outp_read_devices) Format of output init file changed; name of
12200         file is `devices' rather than `output' to avoid Makefile
12201         conflicts.
12202         (outp_clear) Renamed outp_done.
12203         (outp_list_classes) Bug fix, cleaned up.
12204         (outp_list_drivers) Not implemented anymore.
12205         (outp_configure_driver) Now a static function; simplified; now
12206         interpolates macros; supports new structure.
12207         (outp_enable_driver, match_synonym) Removed; all references
12208         removed.
12209         (find_driver) First argument removed.
12210         
12211         * output.h: Global var outp_init_drivers removed; new structure
12212         outp_names; new enum set OUTP_S_*; new global var
12213         outp_configure_vec; function prototypes for output.c exports
12214         updated.
12215         
12216         * main.c: (main) Calls outp_read_devices() after parsing the
12217         command line.
12218         
12219         * cmdline.c: (parse_command_line) New option -v --verbose;
12220         --version changed to -V.  --device option changed syntax to just
12221         take a single device name.  Accepts key=value declaration of
12222         output init file macros.  Syntax message updated.
12223
12224         * filename.c: (expand_line) New function.
12225         (interp_environ_vars) Renamed interp_vars; no longer uses
12226         fixed-size buffer.
12227         (blp_getenv) Allows $ARCH and $VER pseudo-environment-vars to be
12228         overridden by real environment vars.
12229         (search_path) Uses verbose_msg() instead of #ifdef'd printf().
12230         * filename.h: interp_environ_vars() renamed interp_vars().
12231         
12232         * error.c, error.h: Added extern variable `verbosity', message
12233         class MM.
12234         
12235         * error.c: (vmsg) Support message class MM.
12236         (verbose_msg) New function.
12237
12238         * descript.q: (generate_z_varname) Bug fix in generation of
12239         Z-score varnames.
12240         (dump_z_table) Bug fix in column headers.
12241         
12242         * ascii.c: (ascii_init_driver) Changed minimum number of lines per
12243         page from 29 to 15.  Don't set a default for ops[OPS_INIT,
12244         OPS_DONE].  Writes the uninit string when the driver is closed.
12245         (ascii_open_page) Write the init string before the first page.
12246         (output_shorts) Form of main loop changed from `while' to `for'.
12247         Bug fix with overstrikes: the character is printed *after* the
12248         backspace.  Eliminated a lot of `& 0xff' modifiers.
12249         (advance_to_left_margin) New function.
12250         (return_carriage, output_lines) Handle left margin.
12251
12252 Thu Jul  4 00:35:59 1996  Ben Pfaff  <blp@gnu.org>
12253
12254         * ascii.c: New option `carriage-return-style'.
12255
12256         * ascii.c: (count_fancy_chars) New function.
12257         (delineate, text_metrics) Use new function; bug fixes regarding
12258         rich text strings.
12259         (text_draw) Bug fix with rich text.
12260         (output_string, output_shorts) Reordered.
12261         (output_shorts) Now handles boxchars and some overstrike font
12262         changes.
12263         (output_char, return_carriage) New functions.
12264         (output_lines) Now handles overstriking and font changes properly;
12265         some code moved to output_shorts.
12266
12267 Tue Jul  2 22:13:23 1996  Ben Pfaff  <blp@gnu.org>
12268
12269         [GLOBAL_DEBUGGING]
12270         * ascii.c: New member `debug' in ascii_driver_ext.
12271         (ascii_init_driver, delineate) Uses new member.
12272
12273         Now you can set a vertical height on writing text.
12274         * ascii.c: (delineate) Keeps track of vertical position.
12275         (text_draw) No longer considers fully justified text an internal
12276         error.
12277         
12278         * output.h: New flag OUTP_T_VERT; other OUTP_T_ values changed.
12279
12280         Tables' titles are drawn; they can have variable height.
12281         * som.c: `som' struct has new member, title_height.
12282         (draw_title) New argument.  Moved within file.  All caller
12283         changed.
12284         (build_target) New argument, amount of space needed for first row.
12285         Calculates height of title, takes that into account.  All callers
12286         changed.
12287         (dump_plain_table, dump_columnated_table) Took calculation of y1,
12288         y2 out of loop.
12289         (dump_columnated_table) [GLOBAL_DEBUGGING] Debugging code
12290         improved.
12291         (dump_columnated_table) Organized for readability.
12292         (dump_page) Makes use of som.title_height.
12293
12294         * som.c: Many comment bug fixes.
12295
12296         * descript.q: (try_name, generate_z_name) Bug fix regarding
12297         generation of Z-score variable names.
12298         * var.h: Removed num from descriptives_proc; all referents removed.
12299
12300 Mon Jul  1 22:13:39 1996  Ben Pfaff  <blp@gnu.org>
12301
12302         * ascii.c: (ascii_line_horz, ascii_line_vert,
12303         ascii_line_intersection) Added debugging code.
12304
12305         Added a descriptive line above each table to describe it.
12306         * command.c: (parse_cmd) Calls som_new_series.
12307         
12308         * som.c: New static vars table_num, subtable_num.  New `som'
12309         member `title'.
12310         (dump_page) New arguments.
12311         (som_submit_table) Handle new variables.
12312         
12313         * som.c, som.h: (som_submit_table) New arguments.  All callers
12314         changed.
12315         (som_new_series) New function.
12316         (build_target) Makes room for extra line.
12317         (draw_title) New function.
12318         (dump_page) Calls draw_title.  Bug fix: doesn't always set
12319         som.ext->cp to 0.
12320         
12321         Columnation of tables support.
12322         * som.h: Deleted fr, lr, ri from som_table.  Reorganized.
12323         
12324         * som.c: Deleted references to fr, lr, ri.
12325         (som_columnate) Bux fix: sets group member of table.
12326         (som_add_options) Function removed.
12327         (dump_table) Split into three functions; extensively reworked.
12328         
12329         * descript.q: (dump_z_table) Better output table formatting; added
12330         title support to correspond to som.h changes.
12331         (display) Title support.
12332
12333         * output.h: Added OUTP_T_NONE.
12334         
12335 Mon Jul  1 13:00:00 1996  Ben Pfaff  <blp@gnu.org>
12336
12337         * descript.q: Improved handling of Z scores; still not perfect.
12338         
12339         * output.h, ascii.c: Added hook for getting em width of current
12340         font.
12341         
12342         * som.c: Uses new em-width hook.  Added debugging code to
12343         several functions.
12344         (som_columnate) New argument.
12345         (som_add_options) Removed.
12346
12347 Jun 29 17:40:47 1996  Ben Pfaff  <blp@gnu.org>
12348
12349         * som.h, som.c, output.c, output.h, ascii.c: Updated to work with
12350         rules as a property of the table instead of as a property of the
12351         cells.
12352         
12353         * ascii.c: Added `header' to table of options.
12354         
12355         * descript.q: Added even shorter statistic names; modified to work
12356         with new som interface.
12357         
12358         * misc.c (blp_getdelim): Bug fix.
12359         
12360         * version.c: includes 'conf.h'.
12361         
12362 ----------------------------------------------------------------------
12363 Local Variables:
12364 mode: change-log
12365 version-control: never
12366 End: