Allowed reading of "broken" system files which have -1 as the number of data
[pspp-builds.git] / src / ChangeLog
1 Sat May 21 12:48:34 WST 2005 John Darrington <john@darrington.wattle.id.au>
2
3         * sfm-read.c, sfmP.h:  Allow reading of system files when the 
4         case_size value in the header is -1.  Also changed some Errors to 
5         Warnings when reading system files.
6
7 Tue May 17 21:00:57 2005  Ben Pfaff  <blp@gnu.org>
8
9         * data-list.c: (data_list_trns_free) Don't free the argument
10         because cancel_transformations() will do that itself.
11         (data_list_source_destroy) Destroy the argument to
12         data_list_trns_free(), because it no longer does so itself.
13
14 Tue May 17 18:29:35 2005  Ben Pfaff  <blp@gnu.org>
15
16         * data-out.c: (format_and_round) Don't output leading `-' if value
17         rounds to zero.
18
19 Tue May 17 00:06:43 2005  Ben Pfaff  <blp@gnu.org>
20
21         Fix PR 11119.
22
23         * som.c: (output_encodings) If some cell in the table won't fit
24         with the horizontal or vertical headers, cancel those headers.
25
26         * som.h: (struct som_table_class) Add fits_width, fits_length,
27         set_headers members.
28
29         * tab.c: (tabi_fits_width) New function.
30         (tabi_fits_length) New function.
31         (tabi_set_headers) New function.
32         (global var tab_table_class) Add the new functions as appropriate
33         members.
34         
35 Mon May 16 22:34:06 2005  Ben Pfaff  <blp@gnu.org>
36
37         Fix rest of PR 13054.
38
39         * format.def: Fix EDATE, SDATE, ADATE, JDATE, QYR, MOYR, WKYR,
40         DATETIME, TIME system/portable file values.
41
42 Mon May 16 22:31:15 2005  Ben Pfaff  <blp@gnu.org>
43
44         * data-list.c: (parse_free) Use make_input_format().
45         
46         * data-out.c: (num_to_string) Use make_output_format().
47
48         * dictionary.c: (dict_create_var) Ditto.
49
50         * format.c: (global var f8_2) New var.
51         (make_input_format) New function.
52         (make_output_format) New function.
53
54         * get.c: (cmd_match_files) Use make_output_format().
55
56         * list.q: (cmd_list) Ditto.
57
58         * matrix-data.c: Ditto.
59
60         * sfm-read.c: (parse_format_spec) Check output specifier
61         thoroughly.
62
63         * tab.c: (tab_float) Use make_output_format().
64
65 Sun May 15 23:38:10 2005  Ben Pfaff  <blp@gnu.org>
66
67         Fix more of PR 13054.
68         
69         * format.def: FMT_A should allow 255-character output.  FMT_AHEX
70         should allow 510-character input and output.
71
72         * data-out.c: (num_to_string) Get rid of NEW_STYLE option.
73         (convert_E) Handle non-finite values.
74         (try_F) Rewrite.
75         (format_and_round) New function.
76         (convert_infinite) New function used by try_F() and convert_E().
77
78 Sun May 15 23:36:55 2005  Ben Pfaff  <blp@gnu.org>
79
80         Regularize string and buffer function names so that they make some
81         kind of sense.
82
83         * str.c: (mm_reverse) Rename buf_reverse().  Update all
84         references.
85         (mm_find_reverse) Rename buf_find_reverse().  Update all
86         references.
87         (mm_case_compare) Rename buf_compare_case().  Update all
88         references.
89         (st_compare_pad) Rename buf_compare_rpad().  Update all
90         references.
91         (str_compare_rpad) New function.
92         (st_bare_pad_copy) Rename buf_copy_str_rpad().  Update all
93         references.
94         (buf_copy_str_lpad) New function.
95         (st_bare_pad_len_copy) Rename buf_copy_rpad().  Update all
96         references.
97         (st_pad_copy) Rename str_copy_rpad().  Update all references.
98         (st_trim_copy) Rename str_copy_trunc().  Update all references.
99         (st_uppercase) Renamed str_uppercase().  Update all references.
100         
101 Sat May 14 08:22:26 WST 2005 John Darrington <john@darrington.wattle.id.au>
102
103         * dfm-read.c: Fixed polarity of test in dfm-close-reader.  Closes 
104         Bug #13082
105
106 Tue May 10 20:08:18 2005  Ben Pfaff  <blp@gnu.org>
107
108         * data-in.c: (data_in) Add assertion to check input specifier.
109
110         * data-out.c: (data_out) Add assertion to check output specifier.
111
112 Tue May 10 19:56:35 2005  Ben Pfaff  <blp@gnu.org>
113
114         Start to fix PR 13054.
115
116         * format.c: (check_input_specifier) Improve error message.
117         (check_input_specifier) Check F, COMMA, and DOLLAR formats for
118         valid decimal places.
119         (check_output_specifier) Ditto (but different criteria).
120         (convert_fmt_ItoO) Assert valid input and output specifiers.
121         Also, if input specifier has *any* decimal places, make the output
122         specifier 1 place wider.
123
124 Mon May  9 07:14:29 WST 2005 John Darrington <john@darrington.wattle.id.au>
125
126         * sysfile-info.c: Fixed bug [# 13024 ]
127
128 Sun May  8 13:52:12 2005  Ben Pfaff  <blp@gnu.org>
129
130         "Fix" PR 13021 by disabling FILE TYPE.  Eventually, we should
131         actually implement it.
132
133         * command.c: (FILE_TYPE_okay) Always return 1.
134
135         * command.def: Change FILE TYPE, END FILE TYPE into UNIMPL.
136
137         * file-type.c: Add prototypes to get rid of warnings.
138
139 Sun May  8 08:08:07 WST 2005 John Darrington <john@darrington.wattle.id.au>
140
141         * barchart.c box-whisker.c cartesian.c piechart.c plot-hist.c: Fixed 
142         more ISO/IEC 9899:1990 conformance issues.
143
144 Wed May  4 23:54:02 2005  Ben Pfaff  <blp@gnu.org>
145
146         Fix PR 12948.  See also new test in
147         tests/bugs/match-file-scratch.sh.
148         
149         * get.c: (mtf_merge_dictionary) Don't compact dictionary because
150         that deletes scratch variables that someone else might be using,
151         and because we can't reassign our sources' value indexes.
152         Instead, simply don't copy scratch variables into the master
153         dictionary.
154
155         * dictionary.c: (dict_compact_values) Delete variables from the
156         dictionary passed in, not from default_dict (!).
157
158 Tue May  3 22:25:17 2005  Ben Pfaff  <blp@gnu.org>
159
160         Improve hash.c comments, error-checking.
161         
162         * hash.c: (struct hsh_table) [NDEBUG] Add hash_ordered member.
163         (hsh_create) size == 0 should *not* return NULL!  Set
164         hash_ordered.
165         (hsh_clear) Set hash_ordered.
166         (locate_matching_entry) Check hash_ordered.
167         (hsh_rehash) Rename rehash().  Add assertion.  Set hash_ordered.
168         (hsh_data) Set hash_ordered.  Add const-ness to return value and
169         update all callers.
170         (hsh_sort) Ditto.       
171
172 Wed May  4 08:50:11 WST 2005 John Darrington <john@darrington.wattle.id.au>
173
174         * casefile.c: Removed unnecessary #include <valgrind/valgrind.h>
175
176 Tue May  3 19:14:48 WST 2005 John Darrington <john@darrington.wattle.id.au>
177
178         * copyleft.c: Updated copyright date.
179
180         * Makefile.am: Removed erroneous explicit "-lplot"
181
182         * examine.q oneway.q: Made these files conform to ISO/IEC 9899:1990
183
184 Tue May  3 16:20:31 WST 2005 John Darrington <john@darrington.wattle.id.au>
185
186         * command.c command.def: Added description string for unimplemented commands.
187
188         * oneway.q: Sorted the hash tables before shipping out the results. Closes 
189         bug [#12931].
190
191 Mon May  2 23:45:01 2005  Ben Pfaff  <blp@gnu.org>
192
193         Code improvements.
194         
195         * data-list.c:  (parse_fixed) Use lex_end_of_command().
196         (parse_free) Ditto.
197         (cmd_repeating_data) Set cont_end.num in right situations.
198         (parse_repeating_data) Remove redundant test.
199
200 Mon May  2 23:37:19 2005  Ben Pfaff  <blp@gnu.org>
201
202         Partial fix for PR 12859.
203         
204         * data-list.c: (cmd_data_list) Add transformation properly in
205         vfm_source == NULL case.
206
207 Mon May  2 23:27:28 2005  Ben Pfaff  <blp@gnu.org>
208
209         * lexer.c: (lex_error) Improve error messages.
210
211 Mon May  2 22:28:17 2005  Ben Pfaff  <blp@gnu.org>
212
213         * get.c: (cmd_match_files) Check token type before trying to match
214         tokid.  Fixes PR 12923.
215
216 Mon May  2 22:16:51 2005  Ben Pfaff  <blp@gnu.org>
217
218         * flip.c: [HAVE_SYS_TYPES_H] Include <sys/types.h>.  Fixes PR
219         12789.
220
221 Mon May  2 22:02:52 2005  Ben Pfaff  <blp@gnu.org>
222
223         * expressions/generate.pl: (get_token) Make use of /g
224         backward-compatible with Perl 5.6.1.
225
226 Sun May  1 23:00:19 2005  Ben Pfaff  <blp@gnu.org>
227
228         * var-display.c: (cmd_variable_alignment) Fix memory leak.
229         (cmd_variable_level) Ditto.
230
231 Sun May  1 22:49:04 2005  Ben Pfaff  <blp@gnu.org>
232
233         Hash table had buggy deletion function.  The fix required changing
234         other functions to do probing in the required order.
235
236         * hash.c: (locate_matching_entry) Rewrite and change interface.
237         (hsh_rehash) Rewrite to use locate_matching_entry().
238         (hsh_probe) Ditto.
239         (hsh_find) Ditto.
240         (hsh_delete) Ditto.  Also, fix stupid bugs.
241
242 Sun May  1 22:24:58 2005  Ben Pfaff  <blp@gnu.org>
243
244         * dictionary.c: (dict_clone) Properly copy vectors.
245
246 Sun May  1 22:07:58 2005  Ben Pfaff  <blp@gnu.org>
247
248         New implementation of long variable names.  Each variable has a
249         "normal" name, which may be up to 64 bytes long and which is used
250         for all normal operations.  Variables may have a "short" name,
251         which is limited to 8 bytes and used only for system and portable
252         file input and output.
253         
254         Make tokid case-preserving.  Update most uses of tokid to treat it
255         case-insensitively.
256
257         Update many commands to deal with long variable names.
258
259         * autorecode.c: (cmd_autorecode) Use strcasecmp() instead of strcmp().
260
261         * command.c: (cmd_parse) Ditto.
262         (match_strings) Use toupper() before comparing characters.
263         (conflicting_3char_prefixes) Use mm_case_compare() instead of
264         memcmp().
265         (cmd_match_words) Ditto.
266
267         * compute.c: (lvalue_parse) Use st_trim_copy() instead of
268         strncpy().
269
270         * count.c: (struct cnt_var_info) Change n[] to fit long var name.
271         Use st_trim_copy() instead of strcpy().
272
273         * data-in.c: (parse_enum) Use mm_case_compare() instead of
274         memcmp().
275
276         * data-list.c: (struct dls_var_spec) Change name[] to fit long var
277         name.
278         (parse_free) Use st_trim_copy() instead of strcpy().
279
280         * descript.c: (struct dsc_var) Change z_name[] to fit long var
281         name.
282         (try_name) Use strcasecmp() instead of strcmp().
283         (generate_z_varname) Use st_trim_copy() instead of strcpy().
284         (descriptives_compare_dsc_vars) Use strcasecmp() instead of
285         strcmp().
286
287         * dictionary.c: (struct dictionary) Removed `long_name_tab'
288         member.
289         (compare_long_names) Removed.
290         (hash_long_name) Removed.
291         (dict_create) Don't initialize `long_name_tab' member.
292         (dict_clone) Copy short names into new dictionary. 
293         (dict_clear) Don't clear `long_name_tab' member.
294         (dict_get_varname_block) Removed.
295         (dict_add_longvar_entry) Removed.
296         (free_nte) Removed.
297         (dict_destroy) Don't destroy `long_name_tab' member.
298         (dict_create_var_from_short) Removed.
299         (dict_create_var_x) Removed.
300         (dict_create_var) Get rid of longname handling.
301         Clear short name.
302         (dict_clone_var) Get rid of longname parameter and longname
303         handling.
304         (dict_lookup_var) Get rid of longname handling.
305         (dict_reorder_var) New function.
306         (dict_rename_var) Clear short name.
307         (dict_rename_vars) Get rid of longname handling.  Clear short
308         names.
309         (dict_create_vector) Support long vector names.
310         (dict_lookup_vector) Use strcasecmp() instead of strcmp().
311         (quasi_base27) Removed.
312         (make_short_name) Removed.
313         (compare_strings) New function.
314         (hash_string) New function.
315         (dict_assign_short_names) New function.
316
317         * file-handle.q: (get_handle_with_name) Use strcasecmp() instead
318         of strcmp().
319         (get_handle_for_filename) Support long handle names.
320
321         * file-type.c: (struct col_spec) Make `name' fit long var names.
322         (cmd_file_type) Use strcasecmp() instead of strcmp().
323
324         * flip.c: (make_new_var) Rewrite.
325         (flip_sink_write) Use st_trim_copy() instead of strncpy().
326
327         * format.c: (parse_format_specifier_name) Use mm_case_compare()
328         instead of memcmp().
329
330         * get.c: (cmd_save_internal) Rephrase.
331         (rename_variables) Drop test for identical variable name.
332         (struct mtf_proc) Change `first', `last' to fit long var name.
333
334         * hash.c: (hsh_hash_case_string) New function for case-insensitive
335         string hashing.
336
337         * lexer.c: (restore_token) Use st_trim_copy() instead of
338         strncpy().
339         (lex_get) Don't uppercase string when copying into tokid.
340         (lex_put_back_id) Use st_trim_copy() instead of
341         strncpy().
342
343         * list.q: (determine_layout) Consider length of variable names in
344         choosing vertical layout.
345
346         * matrix-data.c: (cmd_matrix_data) Use strcasecmp() instead of
347         strcmp().
348         (string_to_content_type) Ditto.
349
350         * modify-vars.c: (compare_variables_given_ordering) Ditto.
351         (struct var_renaming) Change `new_name' to fit long var name.
352         (compare_var_renaming_by_new_name) Use strcasecmp() instead of
353         strcmp().
354
355         * pfm-read.c: (read_variables) Disallow system variables in system
356         files.
357         (write_variables) Call dict_assign_short_names() and use
358         short_name[] members.
359
360         * repeat.c: (internal_cmd_do_repeat) Use strcasecmp() instead of
361         strcmp().
362
363         * sfm-read.c: (sfm_open_reader) Rewrite code for long variable
364         map.  Reorder variables into same order as long variable map.
365         (read_variables) Set short name.
366
367         * sfm-write.c: (sfm_open_writer) Call dict_assign_short_names().
368         (write_variable) Use st_bare_pad_copy().
369         (write_longvar_table) Rewrite.
370
371         * str.c: (mm_case_compare) New function.
372
373         * sysfile-info.c: (compare_vectors_by_name) Use strcasecmp()
374         instead of strcmp().
375
376         * t-test.q: (tts_custom_groups) Remove redundant test.
377         (tts_custom_pairs) Ditto.
378
379         * var.h: (struct variable) Change `name' to fit long var names.
380         Remove `longname'.  Add `short_name' member.  Reorder some
381         variables.
382         (struct name_table_entry) Removed.
383         (struct vector) Change `name' to fit long vector names.
384
385         * vars-atr.c: (var_is_valid_name) Allow long var names.
386         (compare_var_names) Use strcasecmp() instead of strcmp().
387         (compare_var_ptr_names) Ditto.
388         (hash_var_name) Use hsh_hash_case_string().
389         (hash_var_ptr_name) Ditto.
390         (var_set_short_name) New function.
391         (var_clear_short_name) New function.
392         (var_set_short_name_suffix) New function.
393
394         * vars-prs.c: (parse_DATA_LIST_vars) Support long names.
395         Use strcasecmp() instead of strcmp().
396         (struct array_var_set) Removed `longname_tab'.
397         (array_var_set_lookup_var_idx) Drop longname_tab support.
398         (array_var_set_destroy) Don't destroy `longname_tab'.
399         (var_set_create_from_array) Don't create `longname_tab'.
400
401         * vector.c: (cmd_vector) Use strcasecmp() instead of strcmp().
402         Support long names.
403
404         * expressions/parse.c: (word_matches) Use mm_case_compare()
405         instead of memcmp().
406         (compare_strings) New function.
407         (lookup_function) Use compare_strings() instead of strcmp().
408         
409 Sun May  1 22:07:43 2005  Ben Pfaff  <blp@gnu.org>
410
411         * algorithm.c: (move_element) New function.
412
413 Sun May  1 22:05:35 2005  Ben Pfaff  <blp@gnu.org>
414
415         * aggregate.c: (parse_aggregate_functions) Always initialize
416         destvar.
417
418 Sun May  1 22:03:47 2005  Ben Pfaff  <blp@gnu.org>
419
420         * aggregate.c: (cmd_aggregate) Use dict_clone_var_assert().
421
422         * dictionary.c: (dict_clone) Ditto.
423         (dict_clone_var_assert) New function.
424
425         * get.c: (mtf_merge_dictionary) Use dict_clone_var_assert().
426
427 Sun May  1 15:05:54 WST 2005 John Darrington <john@darrington.wattle.id.au>
428
429         * error.c: Added a string for the compiler version to the
430         request_bug_report_and_abort function.
431
432         * groff_font.c, font.c: Removed manpage(1) style references from 
433         comments, because RMS frowns upon them.
434
435 Thu Apr 28 18:52:06 2005  Ben Pfaff  <blp@gnu.org>
436
437         * expressions/parse.c: Improve previous fix for PR 12858 (LAG).
438
439 Fri Apr 29 09:28:00 WST 2005 John Darrington <john@darrington.wattle.id.au>
440
441         * expressions/parse.c: Added handler for OP_LAG_Vn and OP_LAG_Vs.  
442         Fixed bug [#12858] .
443
444 Wed Apr 27 12:42:34 WST 2005 John Darrington <john@darrington.wattle.id.au>
445
446         * loop.c recode.c repeat.c: Fixed a couple of instances of SHORT_NAME_LEN 
447         which should be LONG_NAME_LEN
448
449 Wed Apr 27 07:43:50 WST 2005 John Darrington <john@darrington.wattle.id.au>
450
451         * command.def echo.c:  Added the ECHO command.
452
453 Mon Apr 25 22:55:59 2005  Ben Pfaff  <blp@gnu.org>
454
455         Finish fixing MATCH FILES (PR 11677).
456
457         * get.c: (trim_dictionary) Rewrite in terms of drop_variables(),
458         keep_variables(), rename_variables().
459         (drop_variables) New function.
460         (keep_variables) New function.
461         (struct mtf_file) Rename `in' to `in_name'.  Add `in_var'.
462         (cmd_match_files) Deal with in_var.  Use drop_variables(),
463         keep_variables().  When IN is specified, require BY.  Set master
464         variables after master dictionary is complete.  Add IN variables
465         after master dictionary is complete.
466         (mtf_free_file) Free `in_name'.
467         (mtf_delete_file_in_place) Set in_var value to 0.
468         (mtf_read_nonactive_records)  Rephrase.
469         (mtf_processing) Support IN.  Rephrase.  Fix bugs.
470         (mtf_merge_dictionary) Don't set master variables; we do that
471         later now.
472         (get_master) Don't insist that there's a master variable.
473         
474 Mon Apr 25 22:55:22 2005  Ben Pfaff  <blp@gnu.org>
475
476         Kluge to make some variable renaming sort of work.
477         Needs real fix.
478
479         * dictionary.c: (dict_rename_var) Call dict_add_longvar_entry().
480
481 Mon Apr 25 22:52:28 2005  Ben Pfaff  <blp@gnu.org>
482
483         Add functions for comparing sets of variables between cases.
484         Use the functions.
485
486         * case.c: (case_compare) New function.
487         (case_compare_2dict) New function.
488         
489         * aggregate.c: (struct agr_proc) Remove `prev_break' member.  Add
490         `break_case'.
491         (cmd_aggregate) Nullify break_case.  Don't call
492         initialize_aggregate_info().
493         (agr_destroy) Destroy break_case.
494         (aggregate_single_case) Rewrite.  Use case_compare().
495         (dump_aggregate_info) Copy from break_case into output.
496         (initialize_aggregate_info) Copy break_case from input.
497
498         * get.c: (mtf_compare_BY_values) Use case_compare_2dict().
499
500         * vfm.c: (equal_splits) Use case_compare().
501
502 Sat Apr 23 17:01:04 WST 2005 John Darrington <john@darrington.wattle.id.au>
503
504         * dictionary.c vars-prs.c sfm-write.c: Fixed some memory leaks
505
506 Sun Apr 17 23:08:15 2005  Ben Pfaff  <blp@gnu.org>
507
508         Start work on fixing MATCH FILES.
509
510         * get.c: (enum operation) Remove OP_MATCH.
511         (trim_dictionary) Change return value to bool.  Don't support
512         OP_MATCH.
513         (struct mtf_file) Remove `first', `last' members.
514         (struct mtf_proc) Add `first', `last' members.  Change mtf_case
515         from `struct ccase *' to `struct ccase'.  Remove `by' member.
516         (cmd_match_files) Essentially rewrite.
517         (mtf_free) Don't free `by' member.  Destroy `mtf_case' member.
518         (mtf_read_nonactive_records) mtf_ parameter is not unused.
519         (mtf_processing) Ditto.  Also rephrase some code.
520         (mtf_merge_dictionary) Rewrite for easy comprehension.  
521
522 Sun Apr 17 23:06:00 2005  Ben Pfaff  <blp@gnu.org>
523
524         * matrix-data.c: (wr_output_data) [DEBUGGING] Fix compilation
525         error.
526
527         * q2c.c: (dump_token) [DEBUGGING] Fix compilation error.
528         
529 Thu Apr 14 2005 John Darrington
530
531         * var-display.c: New file.
532
533         * format.h var.h sfm-read.c sfm-write.c dictionary.c :  Added 
534           display_width, measure and alignment parameters to variables.
535
536         * aggregate.c command.def compute.c count.c data-list.c descript.c
537           dictionary.c dictionary.h expr-prs.c file-type.c flip.c get.c 
538           lexer.c lexer.h loop.c modify-vars.c pfm-read.c recode.c repeat.c 
539           sfm-read.c sfm-write.c sfm-write.h sfmP.h val-labs.c val.h var.h 
540           vars-prs.c vector.c :  
541               - Replaced literal constants representing maximum variable name 
542                 length with macro definitions. 
543               - Added support for long variable names.
544               - Changed lexer such that it no longer makes tokens upper
545                 case, but relies upon case insensitive behaviour of commands.
546
547 Mon Apr  4 22:27:34 2005  Ben Pfaff  <blp@gnu.org>
548
549         * aggregate.c: (parse_aggregate_functions) If dict_create_var()
550         fails, don't dereference the resulting null pointer (PR 12427).
551         Also, fix double free error.
552
553 Sat Mar 19 23:06:02 2005  Ben Pfaff  <blp@gnu.org>
554
555         * aggregate.c: (parse_aggregate_functions) Fix N_NO_VARS format.
556         (accumulate_aggregate_info) Set int1 to 1 for SUM.
557         (dump_aggregate_info) Only make SUM non-missing if there was at
558         least one variate.
559
560 Sat Mar 19 14:48:19 2005  Ben Pfaff  <blp@gnu.org>
561
562         * aggregate.c: (dump_aggregate_info) Properly test whether the
563         destination variable is numeric, when making the result
564         system-missing for columnwise missing values.
565
566 Mon Mar 14 21:52:34 2005  Ben Pfaff  <blp@gnu.org>
567
568         * misc.h: Remove GCC specializations.
569
570 Mon Mar 14 21:07:23 2005  Ben Pfaff  <blp@gnu.org>
571
572         Make sort stable (PR 12313).
573         
574         * sort.c: Don't need to include some headers anymore.
575         (static var min_buffers) New variable.
576         (static var max_buffers) New variable.
577         (static var allow_internal_sort) New variable.
578         (cmd_sort_cases) Add test mode.
579         (sort_execute) Rephrase.
580         (do_internal_sort) Don't try internal sorting if
581         allow_internal_sort is set.
582         (struct external_sort) Renamed `initial_runs' to `runs' and
583         updated all references.
584         (macro MIN_BUFFER_TOTAL_SIZE_RECS) Removed.
585         (macro MIN_BUFFER_SIZE_BYTES) Removed.
586         (macro MIN_BUFFER_SIZE_RECS) Removed.
587         (compare_initial_runs) Removed.
588         (struct record_run) Add member `idx'.
589         (write_initial_runs) Pass increasing values to process_case() as
590         index.
591         (process_case) Add `idx' parameter and use it to initialize new
592         `idx' member.
593         (allocate_cases) Limit allocated buffers to max_buffers.
594         (compare_record_run) Use new `idx' member for last resort
595         comparison, for stability.
596         (end_run) Call casefile_sleep() on irs->casefile, to prevent
597         running out of file descriptors.
598         (struct merge_state) Removed.
599         (merge) Don't need to allocate cases.  Always use MAX_MERGE_ORDER
600         unless we have fewer runs left.  Always merge consecutive runs,
601         for stability.  Return the final run.
602         (mod) Removed.
603         (choose_merge) New function.
604         (merge_once) Rewritten.
605
606 Mon Mar 14 21:05:42 2005  Ben Pfaff  <blp@gnu.org>
607
608         * cmdline.c: (static var testing_mode) Move into
609         parse_command_line().
610         
611 Mon Mar 14 21:05:13 2005  Ben Pfaff  <blp@gnu.org>
612
613         * algorithm.c: (remove_range) New function.
614         (remove_element) New function.
615
616         * dictionary.c: (dict_delete_var) Use remove_element().
617
618         * flip.c: (cmd_flip) Ditto.
619
620 Sun Mar 13 22:52:05 2005  Ben Pfaff  <blp@gnu.org>
621
622         * file-handle.q: (struct file_handle) `open_mode' should not be
623         const.
624         
625 Sun Mar 13 22:40:54 2005  Ben Pfaff  <blp@gnu.org>
626
627         First phase of making SORT CASES stable (PR 12313).
628
629         * sort.c: (struct indexed_case) New structure.
630         (do_internal_sort) Rewrite to make internal sorting stable.
631         (compare_case_dblptrs) Removed.
632         (compare_indexed_cases) New function.
633
634 Sun Mar 13 22:38:40 2005  Ben Pfaff  <blp@gnu.org>
635
636         Clean-ups.
637
638         * casefile.c: (casereader_read_xfer_assert) New function.
639
640         * dictionary.c: (dict_compact_case) New function.
641
642         * flip.c: (struct flip_pgm) New member idx_to_fv.
643         (cmd_flip) Initialize idx_to_fv member.
644         (destroy_flip_pgm) Free idx_to_fv member.
645         (flip_sink_write) Use struct flip_pgm member instead of case_sink
646         member.
647         (flip_sink_write) Ditto.
648
649         * vfm.c: (write_case) Use dict_compact_case() instead of
650         compact_case().
651         (compact_case) Removed.
652         (storage_source_create) Removed `dict' parameter.  All references
653         updated.
654
655         * vfm.h: (struct case_source) Removed `value_cnt' member.  All
656         references removed.
657         (struct case_sink) Removed `dict', `idx_to_fv' members.  All
658         references removed.
659
660 Sun Mar 13 22:35:55 2005  Ben Pfaff  <blp@gnu.org>
661
662         More AGGREGATE fixes.
663
664         * aggregate.c: (accumulate_aggregate_info) Implement NMISS and
665         NUMISS for strings.  Fix FOUT, POUT, FGT, FLT, FIN, FOUT for
666         strings.
667         (initialize_aggregate_info) Fix initialization for MIN, MAX for
668         strings.
669
670 Sat Mar 12 23:26:21 2005  Ben Pfaff  <blp@gnu.org>
671
672         Start work on testing and debugging AGGREGATE.
673
674         * aggregate.c: (cmd_aggregate) Use discrete bool variables instead
675         of a bit-map.  Require proper subcommand ordering.  Make OUTFILE
676         subcommand mandatory.
677         (parse_aggregate_functions) Check that PIN, POUT, FIN, FOUT
678         functions' arguments are in the correct order and swap them if
679         not.
680         (accumulate_aggregate_info) Make SUM include weights.  Add various
681         string functions.
682         (dump_aggregate_info) Add various string functions.
683         (initialize_aggregate_info) Initialize int1 for MIN, MAX.
684
685         * sort.c: (sort_parse_criteria) Add parameter for returning
686         whether any directions were specified.  All callers updated.
687
688 Sun Mar 13 14:54:27 WST 2005 John Darrington <john@darrington.wattle.id.au>
689
690         * t-test.q: Fixed erroneous logic in compare_group_binary.
691
692 Sat Mar 12 13:29:21 2005  Ben Pfaff  <blp@gnu.org>
693
694         * split-file.c: (cmd_split_file) Ignore LAYERED and SEPARATE
695         keywords (PR 11628).
696
697 Sat Mar 12 13:17:12 2005  Ben Pfaff  <blp@gnu.org>
698
699         * vfm.c: (procedure_with_splits) Fix PR 11492: end_func() must be
700         called *before* close_active_file().
701
702 Sat Mar 12 12:20:57 2005  Ben Pfaff  <blp@gnu.org>
703
704         * file-handle.q: (struct file_handle) Change open_mode from
705         character pointer to 3-char array, for safety.  Updated all
706         references.
707
708 Sat Mar 12 12:15:49 2005  Ben Pfaff  <blp@gnu.org>
709
710         Thanks to Ben Kujala <bkujala@oregonchildcare.org> for reporting
711         these bugs.
712         
713         * pfm-read.c: (read_header) Improve error message for many cases
714         in which the input is not actually a portable file.
715
716         * file-handle.q: (fh_open) When we give an error message, actually
717         return NULL.
718
719 Fri Mar 11 11:50:30 2005  Ben Pfaff  <blp@gnu.org>
720
721         * format.c: (check_common_specifier) New function for checks
722         common to check_input_specifier() and check_output_specifier().
723         (check_input_specifier) Use check_common_specifier().
724         (check_output_specifier) Use check_common_specifier().
725         (check_string_specifier) Removed.
726         (check_specifier_type) New function.
727         (check_specifier_width) New function.
728         (get_format_var_width) Fix bug.
729
730         * formats.c: (internal_cmd_formats) Only accept numeric variables.
731
732         * lexer.c: (check_id) Rename lex_id_to_token(), make public,
733         update all references.  Make case-insensitive.
734
735         * pfm-read.c: Essentially rewrite the whole file.  Now much
736         cleaner.
737
738         * print.c: (check_string_width) New function.
739         (fixed_parse_compatible) Use check_string_width(),
740         check_specifier_type().
741         (dump_fmt_list) Ditto.
742
743         * str.c: (st_trim_copy) New function.
744         (st_uppercase) New function.
745
746         * vars-atr.c: (var_is_valid_name) New function.
747         
748         * expressions/parse.c: (type_coercion_core) Use
749         check_specifier_type().
750         
751 Fri Mar 11 11:31:24 2005  Ben Pfaff  <blp@gnu.org>
752
753         * expressions/evaluate.c: (cmd_debug_evaluate) Fix memory leaks.
754
755         * expressions/parse.c: (no_match) Ditto.
756
757 Wed Mar  9 09:54:27 2005  Ben Pfaff  <blp@gnu.org>
758
759         * Makefile.am: (pspp_LDADD) Add libgsl-extras.a.
760
761         * expressions/helpers.c: (struct func_params) Removed.
762         (generalized_idf) Removed.
763         (cdf_beta) Removed.
764         (idf_beta) Removed.
765         (idf_fdist) Use gslextras_cdf_beta_Pinv() instead of idf_beta().
766
767         * expressions/operations.def: Implement IDF.BETA, CDF.BINOM,
768         CDF.GEOM, CDF.HYPER, CDF.NEGBIN, CDF.POISSON using gsl-extras.
769         Implement SIG.F, which I had overlooked previously.
770
771 Tue Mar  8 12:47:53 WST 2005 John Darrington <john@darrington.wattle.id.au>
772
773         * command.c command.def glob.[ch] cmdline.c: Made DEBUG cmds
774         available only in testing mode.
775
776 Sun Mar  6 23:25:40 2005  Ben Pfaff  <blp@gnu.org>
777
778         * data-in.c: Use `bool' throughout, where relevant.
779
780 Sun Mar  6 19:52:22 2005  Ben Pfaff  <blp@gnu.org>
781
782         DATA LIST with free-field formats should not have implied decimal
783         places (PR 12035).  Also clean up data-in.c a bit.
784
785         * data-in.h: (enum) Add DI_IMPLIED_DECIMALS.
786
787         * data-in.c: (apply_implied_decimals) New function.
788         (parse_numeric) Don't adjust exponent if DI_IMPLIED_DECIMALS not
789         set.  Also, get rid of gotos.
790         (parse_Z) Use apply_implied_decimals() if the field doesn't
791         contain a decimal point.
792         (parse_N) Use apply_implied_decimals().
793         (parse_IB) Ditto.
794         (parse_PIB) Ditto.
795         (parse_P) Ditto.
796         (parse_PK) Ditto.
797         (to_roman) Removed.
798         (parse_enum) New function.
799         (macro CHAR_IS_ROMAN) Removed.
800         (macro ROMAN_VALUE) Removed.
801         (parse_month) Use parse_enum().
802         (parse_weekday) Use parse_enum().
803         (parse_DATETIME) Use long for weekday.
804
805         * data-list.c: (read_from_data_list_fixed) Use
806         DI_IMPLIED_DECIMALS.
807
808 Sun Mar  6 17:07:20 2005  Ben Pfaff  <blp@gnu.org>
809
810         When the lexer sees something like `-5' in the input, it has to
811         decide whether it's a negative numeric constant token or a '-'
812         token followed by a positive numeric constant token.  It always
813         decides on the former, and then the parser can call
814         lex_negative_to_dash() if it wants the latter.  However, this
815         doesn't work for the case of `-0', because negative zero is
816         (portably) indistinguishable from positive zero.  So now we divide
817         T_NUM into two tokens, T_POS_NUM and T_NEG_NUM, to make the
818         distinction clear.  This requires a little bit of extra effort,
819         because there were several references to T_NUM in the code base.
820         
821         * lexer.c: (lex_get) Use T_NEG_NUM and T_POS_NUM to distinguish
822         positive and negative numeric constants.
823         (lex_double_p) Renamed lex_is_number().  Changed return type to
824         bool.  Updated all relevant references to T_NUM to instead use
825         this function.
826         (lex_double) Renamed lex_number().  All references updated.
827         (lex_integer_p) Renamed lex_is_integer().  Changed return type to
828         bool.  All references updated.
829         (lex_token_representation) Understand T_NEG_NUM and T_POS_NUM.
830         (lex_negative_to_dash) Ditto.
831         (dump_token) Ditto.
832         
833         * lexer.h: (enum) Add T_POS_NUM, T_NEG_NUM.  Remove T_NUM.
834
835 Sun Mar  6 22:09:20 2005  Ben Pfaff  <blp@gnu.org>
836
837         * expressions/operations.def: (NUMBER) Use DI_IMPLIED_DECIMALS.
838
839 Sun Mar  6 19:33:24 2005  Ben Pfaff  <blp@gnu.org>
840
841         * expressions/operations.def: (VEC_ELEM_NUM) Treat user-missing
842         values as system-missing.
843
844         * expressions/parse.c: (parse_vector_element) Fix order of
845         arguments in call to expr_allocate_binary().
846
847 Sun Mar  6 17:51:05 2005  Ben Pfaff  <blp@gnu.org>
848
849         * expressions/optimize.c: (optimize_tree) Fix optimization bug for
850         x**2.
851
852         * expressions/parse.c: (type_coercion_core) Set *node to NULL on
853         failure, as indicated by function comment.
854         (parse_binary_operators) Always return NULL on type_coercion()
855         failure.  Should have been doing this anyway, but bug in
856         type_coercion_core() filtered through.
857         (parse_add) Fix typo in user message.
858         (parse_primary) Understand T_NEG_NUM and T_POS_NUM.
859
860 Sun Mar  6 10:47:13 2005  Ben Pfaff  <blp@gnu.org>
861
862         * expressions/operations.def: Add VALUE function.
863
864         * expressions/parse.c: (parse_function) Need an unary composite
865         node for variables in A TO B, not a variable node.  Use
866         allocate_unary_variable().
867         (parse_primary) Use allocate_unary_variable().
868         (allocate_unary_variable) New function.
869
870 Thu Mar  3 23:53:32 2005  Ben Pfaff  <blp@gnu.org>
871
872         * expressions/PSPP_expressions.pm: Renamed it back to generate.pl
873         but fixed the real problem that was preventing the build from a
874         separate directory.  I liked it my way better ;-)
875         
876 Thu Mar  3 23:17:51 2005  Ben Pfaff  <blp@gnu.org>
877
878         * expressions/parse.c: (expr_parse) Fix parameter type.  Thanks to
879         John Darrington <john@darrington.wattle.id.au> for reporting this
880         bug.
881
882 Thu Mar  3 22:10:25 WST 2005 John Darrington <john@darrington.wattle.id.au>
883
884         * expressions/Makefile.am expressions/evaluate.h.pl
885           expressions/evaluate.inc.pl expressions/operations.h.pl
886           expressions/optimize.inc.pl expressions/parse.inc.p:
887
888           Renamed generate.pl to PSPP_expressions.pm and adjusted *.pl
889           to suit. 
890
891           Fixed everything so that it can be built from an arbitrary
892           directory.
893         
894 Thu Mar  3 22:08:35 WST 2005 John Darrington <john@darrington.wattle.id.au>
895
896         * Makefile.am : Fixed up CLEANFILES target.
897
898 Mon Feb 28 23:49:56 2005  Ben Pfaff  <blp@gnu.org>
899
900         * str.h: Changed `struct len_string' to `struct fixed_string', a
901         more accurate name.  Updated all references.
902
903 Mon Feb 28 23:35:30 2005  Ben Pfaff  <blp@gnu.org>
904
905         Redo calendar support.  Should now be bug-for-bug compatible.
906         
907         * calendar.c: New file.
908
909         * calendar.h: New file.
910
911         * data-in.c: Use new calendar functions.
912         (parse_sign) Change sense of return value.
913         (calendar_error) New function.
914         (ymd_to_ofs) New function.
915         (ymd_to_date) New function.
916         (parse_DATE) Use new function.
917         (parse_ADATE) Ditto.
918         (parse_EDATE) Ditto.
919         (parse_SDATE) Ditto.
920         (parse_JDATE) Ditto.
921         (parse_QYR) Ditto.
922         (parse_MOYR) Ditto.
923         (parse_WKYR) Ditto.
924         (parse_TIME) Ditto.
925         (parse_DTIME) Ditto.
926         (parse_DATETIME) Ditto.
927
928         * data-out.c: (convert_date) Use new calendar functions.
929
930         * error.c: (err_vmsg) Changed interface to be more sensible.
931         Updated all callers.
932         (dump_message) Don't double new-lines (why did we do this
933         anyway?).
934
935 Mon Feb 28 23:30:25 2005  Ben Pfaff  <blp@gnu.org>
936
937         * sfmP.h: (macro flt64) Moved here from pref.h.orig.
938         (macro FLT64_MAX) Moved here from pref.h.orig.
939
940 Mon Feb 28 23:28:01 2005  Ben Pfaff  <blp@gnu.org>
941
942         * set.q: Support SET EPOCH.
943         (static var set_epoch) New var.
944         (aux_stc_custom_epoch) New function.
945         (stc_custom_epoch) New function.
946         (get_epoch) New function.
947         (stc_custom_pager) [USE_INTERNAL_PAGER] Fix bug.
948
949         * format.c: Make it possible just to check whether a specifier is
950         valid without emitting an error message.
951         (parse_format_specifier_name) Change interface, update all
952         callers.
953         (check_input_specifier) Ditto.
954         (check_output_specifier) Ditto.
955         (parse_format_specifier) Ditto.
956
957 Mon Feb 28 23:24:08 2005  Ben Pfaff  <blp@gnu.org>
958
959         * command.def: Add DEBUG POOL.
960
961         * pool.c: (pool_destroy) Fix bug in deleting this pool from its
962         parent.
963         (pool_clear) Properly account for size of pool gizmo.
964         (pool_realloc) Ditto.
965         (pool_clone) New function.
966
967         * pool.h: Mark our allocation functions MALLOC_LIKE.
968
969 Mon Feb 28 23:21:26 2005  Ben Pfaff  <blp@gnu.org>
970
971         * Makefile.am: Move many definitions into new top-level
972         Make.build.  Add expressions to SUBDIRS.  Add calendar.c,
973         calendar.h.  Remove expr-evl.c, expr-opt.c expr-prs.c, expr.h,
974         exprP.h, expr.def.
975
976         * case.c: (case_resize) New function.
977         (case_swap) New function.
978
979         * casefile.c: Include mkfile.h.
980
981 Fri Feb 25 21:11:35 WST 2005 John Darrington <john@darrington.wattle.id.au>
982
983         * sfm-read.c: Fixed a buglet which caused a crash when trying
984         to read a non-existent file.
985
986 Sun Feb 13 16:11:13 2005  Ben Pfaff  <blp@gnu.org>
987
988         Fix PR 11955.
989
990         * aggregate.c: (parse_aggregate_functions) Code cleanup.
991         Important part: get rid of spurious copying of function->format to
992         destvar->print and destvar->write.
993
994 Fri Feb 11 00:08:36 2005  Ben Pfaff  <blp@gnu.org>
995
996         Fix PR 11916, which was confusing a variable's `index' member
997         with the variable's position in a var_set.  Although these are
998         usually the same, they are not for array `var_set's.
999         
1000         Took advantage of this bug as an opportunity to clean up and
1001         rewrite parse_var_set_vars().
1002
1003         * vars-prs.c: (parse_vs_variable_idx) New function.
1004         (parse_vs_variable) Reimplement in terms of
1005         parse_vs_variable_idx().
1006         (parse_var_idx_class) New function.
1007         (add_variable) New function.
1008         (add_variables) New function.
1009         (parse_var_set_vars) Rewritten.
1010         (struct var_set) Change `lookup_var' member that returns a
1011         variable into `lookup_var_idx' member that returns an int.
1012         Updated the var set implementations in obvious corresponding ways.
1013         Used compare_var_ptr_names(), hash_var_ptr_name() just added.
1014         
1015 Fri Feb 11 00:06:03 2005  Ben Pfaff  <blp@gnu.org>
1016
1017         Use our global variable compare & hash functions and give them
1018         better names.  Add similar functions for dealing with double
1019         pointers to variables.
1020         
1021         * vars-atr.c: (compare_variables) Renamed compare_var_names().
1022         (hash_variable) Renamed hash_var_name().
1023         (compare_var_ptr_names) New function.
1024         (hash_var_ptr_name) New function.
1025         
1026         * t-test.q: (cmd_t_test) Use global compare_var_names(),
1027         hash_var_name().
1028         (compare_var_name) Removed.
1029         (hash_var_name) Removed.
1030
1031 Fri Feb 11 00:04:39 2005  Ben Pfaff  <blp@gnu.org>
1032
1033         Fix dictionary bug.
1034         
1035         * dictionary.c: (compare_variable_dblptrs) Rename
1036         compare_var_ptrs() and fix it to properly dereference the double
1037         pointers.
1038
1039 Mon Feb  7 09:58:15 WST 2005 John Darrington <john@darrington.wattle.id.au>
1040
1041         crosstabs.q examine.q oneway.q q2c.c:  Added a q2c feature to 
1042         declare subcommands as mandatory.  Closed bug #11843
1043
1044 Sat Feb  5 20:35:10 WST 2005 John Darrington <john@darrington.wattle.id.au>
1045         
1046         * getline.c command.[ch] command.def:  Added (very rudimentary)
1047         support for line  completion when in interactive mode.  Partially 
1048         addresses bug #11693
1049         
1050 Mon Jan 31 09:52:51 WST 2005 John Darrington <john@darrington.wattle.id.au>
1051
1052         * examine.q factor_stats.c oneway.q output.c pfm-read.c: Fixed some
1053         problems revealed by valgrind.
1054
1055
1056 Wed Jan 26 11:44:11 WST 2005 John Darrington <john@darrington.wattle.id.au>
1057
1058         * set.q: Affixed a fix to the previous fix such that we'll be OK now
1059         whether or not PAGER is set.
1060
1061 Wed Jan 26 09:25:54 WST 2005 John Darrington <john@darrington.wattle.id.au>
1062
1063         * set.q: Copied the string produced by getenv("PAGER") thus avoiding
1064         "invalid free" errors.  Hopefully fixes bug #11722
1065
1066         * compute.c expr-prs.c: Check that lvalues are populated before 
1067         attempting to destroy them.  Closes bug #11676
1068
1069 Tue Jan 25 21:01:43 WST 2005 John Darrington <john@darrington.wattle.id.au>
1070
1071         * aggregate.c: Initialised the complete agr_proc structure.
1072         Closes bug #11675
1073
1074
1075 Sun Jan 23 23:02:21 2005  Ben Pfaff  <blp@gnu.org>
1076
1077         * print.c: (print_trns_free) Close the dfm writer if there is one,
1078         fixing a memory leak.
1079
1080 Mon Jan 24 12:24:36 WST 2005 John Darrington <john@darrington.wattle.id.au>
1081
1082         * glob.c oneway.q q2c.c t-test.q vfm.c: Still *more* memory leaks 
1083         fixed.
1084
1085
1086 Fri Jan 21 19:54:14 WST 2005 John Darrington <john@darrington.wattle.id.au>
1087
1088         * linked-list.[ch] Added
1089
1090         * examine.q file-handle.[hq] font.h glob.c groff-font.c postscript.c 
1091           set.q:    Yet more memory leaks
1092
1093 Tue Jan 18 23:12:40 WST 2005 John Darrington <john@darrington.wattle.id.au>
1094
1095         * t-test.q examine.q : More memory leaks fixed.
1096
1097 Tue Jan 18 19:26:59 WST 2005 John Darrington <john@darrington.wattle.id.au>
1098
1099         * examine.q  factor_stats.[ch] get.c pfm-read.c: Plugged numerous
1100         memory leaks.
1101
1102 Mon Jan 10 14:43:45 WST 2005 John Darrington <john@darrington.wattle.id.au>
1103
1104         * ascii.c cartesian.c casefile.c chart.h devind.c 
1105           examine.q frequencies.q
1106           html.c output.h piechart.c plot-chart.c plot-hist.c
1107
1108           Integrated the chart rendering into the output stream
1109           (currently only works for html).
1110           
1111           Removed gratuitous use of ifndef NO_CHARTS, and replaced with
1112           dummy-chart.c for compiling without charts.
1113
1114         * mkfile.[ch] Created.  
1115
1116         * som.[ch] tab.[ch]: Changed name of som_table to som_entity
1117         Added type element so we can tell if it's a chart or a table.
1118
1119         * chart.h examine.q piechart.c plot-chart.c plot-hist.c: changed the 
1120         API of charts to be more like that of tables.
1121
1122 Thu Jan 13 21:00:02 WST 2005 John Darrington <john@darrington.wattle.id.au>
1123
1124         * casefile.c main.c: Moved the SIGINT handler from casefile.c to
1125         main.c. Removed the handler for SIGQUIT.
1126
1127 Mon Jan 10 14:43:45 WST 2005 John Darrington <john@darrington.wattle.id.au>
1128
1129         * casefile.c: Added a signal handler to delete temp files on 
1130         SIGINT and SIGQUIT
1131
1132         * permissions.c Inhibited the PERMISSIONS command when SAFER is on.
1133
1134         * command.def Added a lot more unimplemented commands.
1135
1136         * copyleft.[ch] cmdline.c Moved legal information to copyleft.c
1137
1138 Sat Jan  8 23:58:34 2005  Ben Pfaff  <blp@gnu.org>
1139
1140         * sort.c: (compare_initial_runs) Needed additional level of
1141         dereferencing.
1142         (merge_once) Fix plenty of stupid mistakes.
1143
1144 Sat Jan  8 23:55:27 2005  Ben Pfaff  <blp@gnu.org>
1145
1146         * casefile.c: (casefile_sleep) Need to flush_buffer() after
1147         calling casefile_to_disk() or we will lose the last block in the
1148         file if the casefile started out as disk-based.
1149         (casefile_get_reader) Initialize reader->destructive to 0.
1150         (cmd_debug_casefile) Add new test pattern.
1151         (test_casefile) Define new test pattern to make sure
1152         casefile_sleep() works properly.
1153
1154 Fri Jan  7 08:00:05 WST 2005 John Darrington <john@darrington.wattle.id.au>
1155
1156         * Makefile.am chart.[ch]  histogram.[ch] piechart.c (Modified);
1157           plot-hist.c plot-chart.c (Added) Reorganised these files in an
1158           attempt to seperate the creation and processing of charts from their
1159           actuall renedering.
1160
1161         * examine.q frequencies.q generated charts conditional upon the NO_CHARTS
1162           macro.
1163
1164 Thu Jan  6 18:48:58 WST 2005 John Darrington <john@darrington.wattle.id.au>
1165
1166         * main.c Added a signal handler for SIGFPE
1167
1168         * sort.c Somewhat more robust fix to the previous entry.
1169
1170 Wed Jan  5 21:23:31 2005  Ben Pfaff  <blp@gnu.org>
1171
1172         * sort.c: (merge) Fix assertion for proper Huffman merge pattern:
1173         0 == 1 modulo 1.  See Knuth 5.4.9 (vol. 3, 2nd ed.,
1174         pp. 361).  Thanks to John Darrington <john@cellform.com.au> for
1175         reporting the bug.
1176
1177 Wed Jan  5 22:42:26 WST 2005 John Darrington <john@darrington.wattle.id.au>
1178
1179         * case.h Fixed bug # 11307
1180         
1181 Wed Jan  5 08:30:48 WST 2005 John Darrington <john@darrington.wattle.id.au>
1182
1183         * val-labs.c Fixed bug which caused a crash if VALUE LABELS had
1184         a trailing slash.
1185
1186 Mon Jan  3 17:44:37 2005  Ben Pfaff  <blp@gnu.org>
1187
1188         * pfm-read.c: (read_variables) Remove direct manipulation of
1189         v->aux, which is no longer needed.  Fixes PR 11483.
1190
1191 Sat Jan  1 19:01:16 WST 2005 John Darrington <john@darrington.wattle.id.au>
1192
1193         * data-list.c Fixed a bug in parsing delimiters.
1194
1195         * group.c vars-atr.c Fixed buglet in hash/compare functions for alpha
1196         values.
1197
1198         * percentiles.c Properly handled calculation of Tukey hinges where
1199         the number of data is small.
1200
1201         * oneway.q Used the generic value_to_string function for independent
1202         variable instead of trying to do it ourselves.
1203
1204         * box-whisker.c Fixed a buglet which caused a crash if the number of
1205         data was zero
1206
1207
1208 Fri Dec 31 16:47:45 WST 2004 John Darrington <john@darrington.wattle.id.au>
1209
1210         * examine.q box-whisker.c chart.h Implemented boxplots in EXAMINE
1211
1212         * percentiles.c Fixed some bugs when calculating percentiles when
1213         there's a small number of cases.
1214
1215 Wed Dec 29 08:18:08 WST 2004 John Darrington <john@darrington.wattle.id.au>
1216
1217         * percentiles.[ch] Added. Calculates percentiles and Tukey hinges
1218
1219         * examine.q factor_stats.[ch]  Added calculation of percentiles
1220
1221 Fri Dec 24 15:09:11 WST 2004 John Darrington <john@darrington.wattle.id.au>
1222
1223         * t-test.q Fixed bug #11227 Made t-test work when the independent
1224         variable is alpha
1225
1226 Sat Dec 11 11:43:45 WST 2004 John Darrington <john@darrington.wattle.id.au>
1227
1228         * factor_stats.c Fixed calculation of trimmed mean under various
1229         special conditions.
1230
1231 Sat Dec  4 17:14:45 WST 2004 John Darrington <john@darrington.wattle.id.au>
1232
1233         * histogram.c chart.[ch] factor_stats.c frequencies.q
1234
1235         Added code to calculate sensible histogram ranges and limits.
1236
1237 Thu Dec  2 13:37:43 WST 2004 John Darrington <john@darrington.wattle.id.au>
1238
1239         * chart.h Updated to reflect many API changes.
1240
1241         * cartesian.c chart.c Moved the definitions of chart_write_{xy}scale from 
1242         cartesian.c and into chart.c
1243
1244         * factorstats.[ch] Added the histogram calculations
1245
1246         * casefile.c Removed an unused variable.
1247
1248         * frequencies.q examine.q histogram.c  Reworked the API for 
1249         histograms.
1250
1251         * piechart.c  Revised the API for piecharts.
1252
1253         * var.h  Moved the definitions of freq_tab and freq out of var.h
1254         and into frequencies.q where they belong.
1255         
1256 Tue Nov 30 21:10:20 2004  Ben Pfaff  <blp@gnu.org>
1257
1258         * flip.c: (flip_file) Check for off_t separately from fseeko(),
1259         using AC_TYPE_OFF_T.
1260
1261 Tue Nov 30 08:47:41 2004  Ben Pfaff  <blp@gnu.org>
1262
1263         * flip.c: (flip_file) If fseeko() is not available, use long int
1264         for off_t.  Thanks to "Marshall DeBerry" <mdb@radix.net> for
1265         reporting the problem.
1266
1267 Mon Nov 29 12:20:59 WST 2004 John Darrington <john@darrington.wattle.id.au>
1268
1269         * examine.q factor_stats.[ch] Changed stderr to se_mean to avoid
1270         conflict with stdio.
1271
1272 Sun Nov 21 10:32:41 WST 2004 John Darrington <john@darrington.wattle.id.au>
1273
1274         * var-labs.c (var_to_string) Now returns null if the variable is null
1275
1276         * value-labels.c (value_to_string) Made it return null if either the 
1277         value or the variable is null.
1278
1279         * hash.c (hsh_clear) Fixed a buglet.
1280
1281         * examine.q  factor_stats.[ch] Largely  rewrote, because I'd started 
1282         with  the wrong model.
1283
1284         * casefile.[ch] Added a function to return the casereader.case_idx 
1285         member
1286
1287         * examine.q  Implemented the extreme values results.
1288
1289 John Darrington <john@darrington.wattle.id.au>
1290
1291         * settings.h set.c glob.[ch] frequencies.q q2c.c error.c lexer.[ch] 
1292           output.[ch] getline.c 
1293
1294           Plugged some memory leaks
1295
1296 Mon Nov 15 23:47:40 2004  Ben Pfaff  <blp@gnu.org>
1297
1298         Adopt GSL random number generators, paving the way for providing
1299         the complete suite of random number generators on expressions.
1300         
1301         * Makefile.am: Remove random.c, random.h.
1302
1303         * random.c: Removed.
1304
1305         * random.h: Removed.
1306
1307         * algorithm.c: (algo_default_random) Use GSL functions.
1308
1309         * casefile.c: (test_casefile) Use GSL RNG functions.
1310
1311         * expr-evl.c: (expr_evaluate) Use GSL RNG functions for OP_NORMAL,
1312         OP_UNIFORM.
1313
1314         * sample.c: (cmd_sample) Use GSL RNG functions.
1315         (sample_trns_proc) Ditto.
1316
1317         * set.q: (static var set_seed) Removed.
1318         (static var seed_flag) Removed.
1319         (static var rng) New variable.
1320         (aux_stc_custom_seed) No seed value anymore, don't print anything.
1321         (stc_custom_seed) Use new seed functions.
1322         (seed_is_set) Removed.
1323         (get_rng) New function that composes the entire external
1324         interface.
1325         (set_rng) New function.
1326         (random_seed) New function.
1327
1328 Mon Nov 15 22:08:25 2004  Ben Pfaff  <blp@gnu.org>
1329
1330         * expr-evl.c: (expr_evaluate) Fix XDATE.JDAY formula.  Thanks to
1331         John Darrington <john@darrington.wattle.id.au> for reporting this
1332         bug.
1333
1334 Tue Nov 16 13:19:18 WST 2004 John Darrington <john@darrington.wattle.id.au>
1335
1336         * permissions.c command.def Added the PERMISSIONS command
1337
1338 Mon Nov 15 01:33:32 2004  Ben Pfaff  <blp@gnu.org>
1339
1340         * q2c.c: (dump_header) Don't try to emit #includes at very top of
1341         output file because that will precede #include <config.h>, which
1342         is bad.
1343         (main) Add needed headers to /* (header) */ code.
1344
1345 Mon Nov 15 01:21:36 2004  Ben Pfaff  <blp@gnu.org>
1346
1347         Instead of making system or portable file readers responsible for
1348         dropping and reordering variables, make them read full cases and
1349         let the caller take care of any changes.
1350
1351         * get.c: New "case map" structure to handle this.  Use for GET,
1352         IMPORT, MATCH FILES.  Essentially rewrite the whole file.
1353
1354         * pfm-read.c: (pfm_read_case) Read into provided case.  Signature
1355         changed appropriately.
1356
1357         * sfm-read.c: (sfm_read_case) Ditto.
1358
1359 Mon Nov 15 00:47:45 2004  Ben Pfaff  <blp@gnu.org>
1360
1361         Decided that case_serialize() and case_unserialize() were too
1362         abstract.  Also we need a couple more functions to avoid excessive
1363         copying for data in/out fast paths.
1364
1365         * case.c: (case_serial_size) Removed.
1366         (case_serialize) Rename case_to_values() and make its argument
1367         explicitly an array of union values.
1368         (case_unserialize) Rename case_from_values() and make its argument
1369         explicitly an array of union values.
1370         (case_data_all) New function.
1371         (case_data_all_rw) New function.
1372
1373         * casefile.c: (struct casefile) Change buffer from array of
1374         unsigned char to array of union value for better accuracy.
1375         Redefine buffer_used and buffer_size in terms of values, not
1376         bytes.  Remove case_size because it is now redundant with
1377         value_cnt.  Fix up all references to these members.
1378
1379 Mon Nov 15 00:45:46 2004  Ben Pfaff  <blp@gnu.org>
1380
1381         * barchart.c: (struct subcat) Make `label' member const to silence
1382         GCC warning with -Wwrite-strings.
1383
1384         * cartesian.c: (struct dataset) Ditto.
1385
1386         * case.c: Don't re-define NDEBUG if already defined.
1387         Add lots of comments.
1388
1389         * str.c: Fix includes.
1390
1391         * crosstabs.q: Fix includes.
1392
1393         * examine.q: Fix includes.  Fix GCC warning about unused
1394         variables.
1395         
1396         * frequencies.q: (stat macro) Removed and replaced where used by
1397         its expansion.
1398
1399         * list.q: Fix includes.
1400
1401         * oneway.q: Fix includes.
1402
1403         * piechart.c: Fix includes.  Only define M_PI if not already
1404         defined.
1405
1406         * sfm-read.c: (bswap) New function.
1407         (bswap_int32) Write in terms of bswap.
1408         (bswap_flt64) Ditto.
1409
1410         * str.c: (ds_data) Add external definition here, needed because
1411         str.h has only an `extern inline' version.
1412
1413         * value-labels.c: Fix includes.
1414
1415 Mon Nov 15 00:40:55 2004  Ben Pfaff  <blp@gnu.org>
1416
1417         Instead of providing a system or portable file writer with a raw
1418         case in the format needed for output, provide it with a regular
1419         case.  The writer takes care of any needed translation.
1420
1421         * aggregate.c: Adopt new scheme for AGGREGATE.
1422         (struct agr_proc) sfm_agr_case member removed.
1423         (write_case_to_sfm) Removed because the new interface is easier to
1424         use.
1425
1426         * get.c: Adopt new scheme for SAVE, XSAVE, EXPORT.
1427
1428         * pfm-write.c: Implement new scheme.
1429
1430         * sfm-write.c: Ditto.
1431
1432 Mon Nov 15 00:32:24 2004  Ben Pfaff  <blp@gnu.org>
1433
1434         Instead of treating `struct file_handle' as a class to subclass
1435         into data files, system files, and portable files, instead use it
1436         as a helper that coordinates access.  Now it is opaque, too.
1437
1438         This means that most references to a struct file_handle are now
1439         changed into references to one of struct dfm_reader, struct
1440         dfm_writer, struct sfm_reader, struct sfm_writer, struct
1441         pfm_reader, or struct pfm_writer, according to what's being read
1442         or written.
1443
1444         Most related changes are only worth summarizing briefly.
1445
1446         * dictionary.c: (dict_clear) Destroy aux data in deleted
1447         variables.
1448         (dict_clear_aux) New function.
1449         (dict_create_var) Initialize aux, aux_dtor.
1450         (dict_delete_var) Destroy aux data in deleted variable.
1451
1452         * file-handle.h: (struct fh_ext_class) Removed.
1453         (struct file_handle) Removed.
1454         (fh_init_files) Removed.
1455
1456         * file-handle.q: Changed references to a handle's `private' member
1457         to direct references.
1458         (struct private_file_handle) Renamed file_handle.
1459         Add next, open_cnt, type, open_mode, aux members.
1460         (struct file_handle_list) Removed.
1461         (extern var inline_file) Removed.
1462         (static var file_handles) Changed from file_handle_list * to
1463         file_handle *.
1464         (create_file_handle) Initialize new members.
1465         (fh_close_handle) Removed.
1466         (mode_name) New function.
1467         (fh_open) New function.
1468         (fh_close) New function.
1469         (fh_parse_file_handle) Renamed fh_parse().
1470
1471         * glob.c: (init_glob) Remove fh_init_files() call.
1472         
1473         * aggregate.c: use sfm_writer.
1474         (create_sysfile) Removed because the new interface is simpler.
1475         
1476         * apply-dict.c: Use sfm_reader.
1477
1478         * data-list.c: Use dfm_reader.
1479
1480         * file-type.c: Use dfm_reader.
1481
1482         * get.c: Use sfm_reader, sfm_writer, pfm_reader, pfm_writer.
1483
1484         * inpt-pgm.c: Use dfm_reader.
1485
1486         * print.c: Use dfm_writer.
1487
1488         * sysfile-info: Use sfm_reader.
1489
1490         * dfm-read.c: Adopt new file handle infrastructure.
1491
1492         * dfm-write.c: Ditto.
1493
1494         * pfm-read.c: Ditto.
1495         
1496         * pfm-write.c: Ditto.
1497
1498         * sfm-read.c: Ditto.
1499
1500         * sfm-write.c: Ditto.
1501         
1502 Mon Nov 15 00:31:44 2004  Ben Pfaff  <blp@gnu.org>
1503
1504         Break dictionary functions into separate header file.
1505
1506         * dictionary.h: New file.
1507
1508         * var.h: Moved dict_*() functions to dictionary.h.
1509
1510 Mon Nov 15 00:30:33 2004  Ben Pfaff  <blp@gnu.org>
1511
1512         Get rid of procedure-specific union in struct variable, using
1513         instead a void * pointer and a destructor function.
1514
1515         Most related changes are only worth brief summaries.
1516
1517         * crosstabs.q: Fix includes.  Use new struct var_range in lieu of
1518         old p.crs member in struct variable.
1519         
1520         * frequencies.q: Fix includes.  Use new struct var_freqs in lieu
1521         of old p.frq member in struct variable.
1522
1523         * histogram.c: (draw_histogram) Takes new freq_tab arg because
1524         it's no longer possible to grab this from var->p.frq.
1525
1526         * piechart.c: (draw_piechart) Ditto.
1527
1528         * group.c: (group_proc_get) New function.
1529
1530         * levene.c: Use group_proc_get() in lieu of old p.grp_data member
1531         in struct variable.
1532
1533         * oneway.q: Ditto.
1534
1535         * t-test.q: Ditto.
1536
1537         * main.c: (execute_command) Clear aux data in default_dict after
1538         each command.  (It's debatable whether this should be done.)
1539
1540         * matrix-data.c: Use new struct mxd_var in lieu of old p.mxd
1541         member in struct variable.
1542
1543         * means.q: Get rid of integer mode, which is not included in
1544         recent SPSS and was the only code that wanted per-variable private
1545         data.
1546
1547         * var.h: (struct crosstab_proc) Removed.
1548         (struct frequencies_proc) Removed.
1549         (struct list_proc) Removed.
1550         (struct get_proc) Removed.
1551         (struct means_proc) Removed.
1552         (struct matrix_data_proc) Removed.
1553         (struct match_files_proc) Removed.
1554         (lots of enums) Removed.
1555         (struct variable) Removed members `p', `get'.  Add member
1556         `aux_dtor'.
1557
1558         * vars-atr.c: (var_attach_aux) New function.
1559         (var_detach_aux) New function.
1560         (var_clear_aux) New function.
1561         (var_dtor_free) New function.
1562         (discard_variables) Use NULL instead of inline_file.
1563
1564 Fri Nov 12 10:07:11 WST 2004 John Darrington <john@darrington.wattle.id.au>
1565
1566         * value-labs.c  Fixed the implmentation of value_to_string, so 
1567         that it properly handles alpha values.
1568
1569         * oneway.q  Changed instances where labels were being probed manually, 
1570         to use the canonical {var,value}_to_string functions
1571
1572 Thu Nov 11 21:01:31 WST 2004 John Darrington <john@darrington.wattle.id.au>
1573
1574         * examine.q cartesian.c chart.[ch]   Added normal and detrended normal
1575         plots.  Changed the API of the cartesian plot to be a much lower level
1576         thing.
1577
1578 Sun Nov  7 17:25:04 WST 2004 John Darrington <john@darrington.wattle.id.au>
1579
1580         * examine.q Added some of the parametric calculations
1581
1582         * factor_stats.[ch]  Created
1583         
1584 Sat Nov  6 21:24:31 WST 2004 John Darrington <john@darrington.wattle.id.au>
1585
1586         * examine.q  Changed the definition of factors to be a composite, and
1587         dealt with the consequences.
1588
1589 Sat Nov  6 20:40:38 WST 2004 John Darrington <john@darrington.wattle.id.au>
1590
1591         * examine.q Fixed problem where examine wasn't dealing properly with 
1592         splits
1593
1594 Sat Nov  6 14:49:47 WST 2004 John Darrington <john@darrington.wattle.id.au>
1595
1596         * oneway.q Fixed problem where oneway wasn't dealing properly with 
1597         splits
1598
1599 Thu Nov  4 11:09:01 WST 2004 John Darrington <john@darrington.wattle.id.au>
1600
1601         * q2c.c examine.q  Fixed a bug (feature?) whereby arrays in the
1602         command which had settings didn't get the appropriate code
1603         generated.
1604
1605         * val.h value-labels.[ch] var-labs.c Added v*to_string functions
1606         to convert variables/values to strings.
1607
1608         * examine.q  Added framework for the EXAMINE command.
1609
1610 Mon Nov  1 12:46:17 WST 2004 John Darrington <john@darrington.wattle.id.au>
1611
1612         * q2c.c frequencies.q set.q t-test.q  Fixed the q2c parsing of DBL 
1613         subcommand types.  Changed frequencies.q to use it rather then the 
1614         custom parser.  Dealt with the consequences.  Added a test for NTILES
1615         subcommand of frequencies.
1616
1617 Sat Oct 30 09:16:29 WST 2004 John Darrington <john@darrington.wattle.id.au>
1618
1619         * oneway.q   Fixed up the behaviour when given missing values
1620
1621         * levene.c oneway.q Fixed a buglet with the levene statistic and
1622         incorporated the levene test into the oneway command.
1623
1624         * group.h  t-test.q  Moved the CMP_EQ and CMP_LE symbols out of 
1625         global scope, since they're only relevant to T-TEST
1626
1627 Fri Oct 29 17:39:03 WST 2004 John Darrington <john@darrington.wattle.id.au>
1628
1629         * group.c group.h group_proc.h levene.c oneway.q t-test.q
1630
1631         Made the t-test more consistent
1632         with the way it handles groups.  That is, it now uses a hash instead
1633         of an array of 2.  Also, made the levene.c file independent of the 
1634         implementation of the t-test.  So now levene should be fine for both
1635         t-test and anova.
1636
1637         * Added an oneway.q file for one way anova
1638
1639 Wed Jun  2 22:08:02 2004  Ben Pfaff  <blp@gnu.org>
1640
1641         * descript.c: (cmd_descriptives) Remove harmless but bogus test in
1642         STATISTICS parsing.
1643
1644 Mon May 31 20:45:24 2004  Ben Pfaff  <blp@gnu.org>
1645
1646         Fix memory leaks.
1647
1648         * data-list.c: (cmd_data_list) Free dls->delims on lossage.
1649         (data_list_trns_free) Free dls->delims.
1650
1651         * t-test.q: (tts_custom_pairs) Free vars.
1652         (ssbox_one_sample_init) Fix tab_vline() argument.
1653         (ssbox_independent_samples_init) Ditto.
1654         (trbox_paired_init) Ditto.
1655         (trbox_one_sample_init) Ditto.
1656
1657 Mon May 31 17:19:27 2004  Ben Pfaff  <blp@gnu.org>
1658
1659         Generalize casefiles to the extent that we can use them for
1660         sorting and other kinds of data transformations.  Change cases to
1661         be copy-on-write to improve memory efficiency in common cases.
1662         Every access to a member of a `struct ccase' was changed to be a
1663         call to a case_*() function, especially case_data(), case_num(),
1664         case_str(), or case_data_rw().  Many instances of a local variable
1665         named "case_num" were changed to "case_idx" as a consequence.
1666         Many `struct ccase *' were changed to actual `struct ccase'
1667         because of copying semantics of cases.  In several places there
1668         was a choice between updating debug code to work with the new ADTs
1669         or just deleting it because it was useless; I chose to delete it.
1670  
1671         * Makefile.am: (pspp_SOURCES) Add case.c, case.h.
1672
1673         * case.c: New file.
1674
1675         * case.h: New file.
1676
1677         * aggregate.c: (struct agr_proc) Change type of `sort' to
1678         sort_criteria *.  Add `break_vars', `break_var_cnt' members.
1679         Rename `vars' to `agr_vars', all references updated.  Change
1680         `agr_case' to type `struct ccase'.
1681         (cmd_aggregate) Deal with new members.  Use case_create(),
1682         sort_active_file_in_place(), sort_active_file_to_casefile().
1683         (agr_destroy) Deal with new members.
1684         (aggregate_single_case) Ditto.
1685         (dump_aggregate_info) Ditto.
1686         (initialize_aggregate_info) Ditto.
1687         (agr_to_active_file) Ditto.
1688         (presorted_agr_to_sysfile) Ditto.
1689         (sort_agr_to_sysfile) Removed.
1690
1691         * alloc.c: (out_of_memory) Make non-static.
1692
1693         * alloc.h: Prototype out_of_memory().
1694
1695         * casefile.c: Switched from a linked list in-memory representation
1696         to a two-level array-style representation.  The linked list was
1697         appropriate when we could stick a header onto cases, but that's no
1698         longer the case.  Also, the two-level array will allow for random
1699         in-memory access in case that's ever wanted.  Also added the
1700         concept of a `destructive casereader', one that destroys cases in
1701         the underlying casefile as they are read out.
1702         (macro CASES_PER_BLOCK) New macro.
1703         (struct casefile) New members `value_cnt', `case_list_size',
1704         `case_acct_size', `being_destroyed', `cases'.  Removed `head',
1705         `tail'.
1706         (struct casereader) Removed `cur'.  Added `destructive', `c'.
1707         (global var casefiles) Made static.
1708         (static var case_bytes) New var.
1709         (casefile_create) Takes a value count, not a case size in bytes,
1710         to conform to the case interface.  All callers updated.  Deal with
1711         new and removed members.
1712         (casefile_destroy) Deal with new and removed members.
1713         (casefile_sleep) New function.
1714         (casefile_get_case_size) Removed.
1715         (casefile_get_value_cnt) New function.
1716         (casefile_append) Rewritten to deal with new and removed members.
1717         (casefile_append_xfer) New function.
1718         (write_case_to_disk) Use case_serialize().
1719         (call_posix_fadvise) Removed because posix_fadvise64 segfaults.
1720         Couldn't figure out why.
1721         (casefile_to_disk) Don't call call_posix_fadvise.  Rewritten to
1722         deal with new and removed members.
1723         (merge) Removed.
1724         (merge_sort) Removed.
1725         (casefile_sort) Removed.
1726         (casefile_get_reader) Deal with new and removed members.
1727         (casefile_get_destructive_reader) New function.
1728         (reader_open_file) Make code more readable.  Create case for
1729         reader.
1730         (casereader_get_casefile) New function.
1731         (casereader_read) Deal with new and removed members.  Now returns
1732         a copy of the case, so that the caller is responsible for
1733         destroying the returned case.
1734         (casereader_read_xfer) New function.
1735         (casereader_destroy) Destroy reader's case.
1736         (test_casefile) Second arg is now a value count, all callers
1737         updated.  Now tests destructive readers too.
1738         (get_random_case) Deal with new case ADT.
1739         (write_random_case) Ditto.
1740         (read_and_verify_random_case) Ditto.
1741
1742         * crosstabs.q: Remove debug code.
1743
1744         * descript.q: (calc_descriptives) Deal with new case, casefile
1745         ADTs.
1746
1747         * dfm.c: (cmd_begin_data) There's no storage_source_class anymore.
1748
1749         * do-if.c: Remove unneeded header inclusion.
1750
1751         * expr-prs.c: Remove debug code.
1752
1753         * exprP.h: Remove debug code.
1754
1755         * flip.c: (flip_file) Use fseeko() if available.
1756
1757         * formats.c: Remove debug code.
1758
1759         * get.c: Remove debug code.
1760         (struct mtf_file) Change `input' from `union value *' to `struct
1761         ccase', all references updated.
1762
1763         * levene.c: (levene) Deal with new case, casefile ADTs.
1764
1765         * list.q: Remove debug code.
1766
1767         * loop.c: Remove debug code.
1768         
1769         * matrix-data.c: Remove debug code.
1770
1771         * means.q: Remove debug code.
1772
1773         * mis-val.c: Remove debug code.
1774
1775         * pfm-read.c: Remove debug code.
1776         (pfm_read_code) Change second arg from `union value *' to `struct
1777         ccase *', all references updated.
1778
1779         * recode.c: (string_to_long) Make first arg const.
1780         (convert_to_double) Ditto.
1781
1782         * repeat.c: Remove debug code.
1783
1784         * sample.c: Remove debug code.
1785
1786         * sfm-read.c: Remove debug code.
1787         (sfm_read_case) Change second arg from `union value *' to `struct
1788         ccase *'.
1789
1790         * sort.c: Redone in terms of casefiles.
1791         (enum sort_direction) Moved here from sort.h.
1792         (struct sort_criterion) New structure.
1793         (struct sort_criteria) New structure.
1794         (cmd_sort_cases) Rewritten.
1795         (prepare_to_sort_active_file) New function.
1796         (sort_active_file_in_place) New function.
1797         (sort_active_file_to_casefile) New function.
1798         (parse_sort) Renamed sort_parse_criteria(), rewritten & interface
1799         changed, all callers updated.
1800         (destroy_sort_cases_pgm) Renamed sort_destroy_criteria(),
1801         rewritten & interface changed, all callers updated.
1802         (sort_cases) Renamed sort_execute(), rewritten & interface
1803         changed, all callers updated.
1804         (struct internal_sort) Removed.
1805         (do_internal_sort) Rewritten, interface changed.
1806         (destroy_internal_sort) Removed.
1807         (compare_case_dblptrs) Use sort_criteria instead of sort_case_pgm.
1808         (struct initial_run) Removed; an initial run is now just a
1809         casefile.
1810         (compare_initial_runs) Rewritten.
1811         (struct external_sort) Changed almost completely.
1812         (do_external_sort) Rewritten, interface changed.
1813         (destroy_external_sort) Rewritten.
1814         [HAVE_MKDTEMP] (make_temp_dir) Removed.
1815         [!HAVE_MKDTEMP] (do_mkdir) Removed.
1816         [!HAVE_MKDTEMP] (make_temp_dir) Removed.
1817         (init_external_sort) Removed.
1818         (simulate_error) Removed.
1819         (rmdir_temp_dir) Removed.
1820         (get_temp_file_name) Removed.
1821         (open_temp_file) Removed.
1822         (close_temp_file) Removed.
1823         (remove_temp_file) Removed.
1824         (write_temp_file) Removed.
1825         (read_temp_file) Removed.
1826         (struct record_run) Change `record' from `struct case_lit *' to
1827         `struct ccase'.
1828         (struct initial_run_state) Remove `idx_to_fv', `free_list',
1829         `file_idx', `output_file'.  Add `run', casefile'.  Change
1830         `last_output' from `struct case_list *' to `struct ccase'.
1831         (write_initial_runs) Change interface, rewrite.
1832         (sort_sink_write) Renamed process_case(), changed interfaced,
1833         rewrote.
1834         (destroy_initial_run_state) Rewritten.
1835         (allocate_cases) Rewritten.
1836         (compare_record) Interface changed, rewritten.
1837         (start_run) Rewritten.
1838         (end_run) Rewritten.
1839         (output_record) Rewritten.
1840         (grab_case) Removed.
1841         (release_case) Removed.
1842         (struct merge_case) Change `cases' from double pointer to single
1843         pointer.
1844         (merge) Deal with new case and casefile ADTs.
1845         (struct run) Removed.
1846         (merge_once) Rewritten, interface changed.
1847         (fill_run_buffer) Removed.
1848         (sort_sink_make_source) Removed.
1849         (sort_sink_class) Removed.
1850         (struct sort_source_aux) Removed.
1851         (sort_source_read_helper) Removed.
1852         (sort_source_read) Removed.
1853         (read_sort_output) Removed.
1854         (read_internal_sort_output) Removed.
1855         (read_external_sort_output) Removed.
1856         (sort_source_destroy) Removed.
1857         (sort_source_class) Removed.
1858
1859         * sort.h: (struct sort_cases_pgm) Removed.
1860         (enum sort_direction) Moved to sort.c.
1861
1862         * t-test.q: (calculate) Deal with new case, casefile ADTs.
1863
1864         * tab.c: Remove debug code.
1865
1866         * var-labs.c: Remove debug code.
1867
1868         * var.h: (struct ccase) Removed.
1869         (struct case_list) Removed.
1870
1871         * vars-atr.c: (discard_variables) Use free_case_source().
1872
1873         * vars-prs.c: (parse_vs_variable) Make arg const.
1874         (parse_dict_variable) Ditto.
1875         (parse_variables) Make struct dictionary * arg const.
1876         (parse_var_set_vars) Make struct var_set * arg const.
1877         (struct var_set) Add const to some of the function pointers' args.
1878         (var_set_get_cnt) Make arg const.
1879         (var_set_get_var) Make first arg const.
1880         (var_set_lookup_var) Make first arg const.
1881         (dict_var_set_get_cnt) Make arg const.
1882         (dict_var_set_get_var) Make first arg const.
1883         (dict_var_set_lookup_var) Make first arg const.
1884         (var_set_create_from_dict) Make arg const.  Add cast to aux
1885         assignment.
1886         (struct array_var_set) Add const to var member.
1887         (array_var_set_get_cnt) Make arg const.
1888         (array_var_set_get_var) Make first arg const.
1889         (array_var_set_lookup_var) Make first arg const.
1890         (var_set_create_from_array) Make first arg const.  Insert cast.
1891
1892         * vfm.c: (struct write_case_data) Change trns_case, sink_case
1893         members from `struct ccase *' to `struct ccase'.
1894         (static var lag_queue) Change from double to single pointer.
1895         (procedure) Optimize trivial case.
1896         (internal_procedure) Deal with changed case, case_source ADTs.
1897         (create_trns_case) Changed interface, rewrote.
1898         (open_active_interface) Initialize modified lag queue.
1899         (write_case) Deal with changed case ADT.
1900         (lag_case) Deal with modified lag queue.
1901         (close_active_file) Destroy modified lag queue.
1902         Deal with changed case_source, case_sink ADTs.
1903         (destroy_storage_stream_info) Make null arg into no-op.
1904         (storage_sink_make_source) Set aux in created source.
1905         (storage_source_read) Deal with changed case, casefile ADTs.
1906         (storage_source_create) New function.
1907         (lagged_case) Rewrite.
1908         (free_case_source) New function.
1909         (free_case_sink) Rewrite.
1910         (struct split_aux_data) Changed prev_case from `struct ccase *' to
1911         `struct ccase'.
1912         (procedure_with_splits) Deal with changed prev_case.
1913         (procedure_with_splits_callback) Ditto.
1914         (multipass_split_aux_data) Changed prev_case from `struct ccase *' to
1915         `struct ccase'.
1916         (multipass_procedure_with_splits) Deal with changed prev_case.
1917         (multipass_split_callback) Ditto.
1918         
1919         
1920 Mon May 31 17:19:06 2004  Ben Pfaff  <blp@gnu.org>
1921
1922         The workspace idea didn't work out.
1923
1924         * Makefile.am: (pspp_SOURCES) Remove workspace.c, workspace.h.
1925         
1926         * workspace.c: Removed.
1927
1928         * workspace.h: Removed.
1929
1930 Sun May 30 18:35:19 2004  Ben Pfaff  <blp@gnu.org>
1931
1932         Fully implement arbitrary delimiters on DATA LIST, extending the
1933         half implementation that was already there.
1934
1935         * data-list.c: (struct data_list_pgm) Remove `delim', add
1936         `delims', `delim_cnt'.
1937         (cmd_data_list) Initialize new members.  Parse delimiters and
1938         clean up code a bit.
1939         (cut_field) Extract fields with arbitrary delimiters.  Also, fix
1940         handling of leading commas.
1941         (read_from_data_list_fixed) Expand tabs.  Adapt to new DFM
1942         interfaces.
1943         (read_from_data_list_free) Adapt to new DFM interfaces.
1944         (read_from_data_list_list) Ditto.
1945         (repeating_data_trns_proc) Ditto.
1946
1947         * dfm.c: Split up reader and writer into separate code, because
1948         they do different things.  Use struct string instead of explicit
1949         allocation code, for clarity.
1950         (enum dfm_reader_flags) New enum.
1951         (struct dfm_fhuser_ext) Removed.
1952         (struct dfm_reader_ext) New.
1953         (get_reader) New function, used by just about all the reader
1954         functions.
1955         (dfm_close) Removed.
1956         (close_reader) New function.
1957         (dfm_open_for_reading) Rewrite initialization of dfm_fhuser_ext.
1958         (dfm_open_for_writing) Ditto.
1959         (macro force_line_buffer_expansion) Removed.
1960         (count_tabs) Removed.
1961         (tabs_to_spaces) Removed.
1962         (read_record) Deal with new dfm_reader_ext.  Use struct string
1963         functions.  Don't convert tabs to spaces.
1964         (dfm_eof) New function.
1965         (dfm_get_record) Changed interface, rewrote.
1966         (dfm_expand_tabs) New function.
1967         (dfm_fwd_record) Renamed dfm_forward_record(), updated to new
1968         dfm_reader_ext, rewritten.
1969         (dfm_bkwd_record) Renamed dfm_reread_record(), updated to new
1970         dfm_reader_ext, rewritten.
1971         (dfm_set_record) Removed in favor of dfm_forward_columns().
1972         (dfm_forward_columns) New function.
1973         (dfm_get_cur_col) Renamed dfm_column_start, updated to new
1974         dfm_reader_ext, rewritten.
1975         (static var dfm_r_class) Use close_reader for the destructor.
1976         (struct dfm_writer_ext) New.
1977         (dfm_put_record) Updated to new dfm_writer_ext, rewritten.  Uses
1978         bounce buffer now instead of local allocation.
1979         (close_writer) New function.
1980         (static var dfm_writer_ext) Use close_writer for destructor.
1981         (cmd_begin_data) Adapt to new dfm_reader_ext.
1982
1983         * file-handle.q: Add support for per-file tab width.
1984         (struct private_file_handle) Add tab_width member.
1985         (q2c specifications) Add tabwidth subcommand.
1986         (cmd_file_handle) Put parsed tab width into private_file_handle.
1987         (create_file_handle) Set default tab width.
1988         (handle_get_tab_width) New function.
1989
1990         * file-type.c: (file_type_source_read) Adapt to new DFM interface.
1991
1992         * inpt-pgm.c: (reread_trns_proc) Ditto.
1993
1994         * matrix-data.c: (context) Ditto.
1995         (another_token) Ditto.
1996         (mget_token) Ditto.
1997         (force_eol) Ditto.
1998
1999 Sun May 30 18:33:59 2004  Ben Pfaff  <blp@gnu.org>
2000
2001         * casefile.c: (casefile_destroy) Fix memory leak by freeing
2002         cf->filename.
2003         (casereader_destroy) Don't close file descriptor -1.
2004
2005         * recode.c: (cmd_recode) Fix memory leak.
2006
2007         * set.q: (q2c specifications) Fix typo in user message.
2008
2009         * str.c: (st_bare_pad_len_copy) Change memcpy to memmove to avoid
2010         undefined behavior for overlapping arguments.
2011
2012 Sun May 30 18:31:48 2004  Ben Pfaff  <blp@gnu.org>
2013
2014         * casefile.c: valgrind doesn't implement posix_fadvise() yet, so
2015         don't call it when we're running under valgrind.
2016         (call_posix_fadvise) New function.
2017         (casefile_to_disk) Use call_posix_fadvise().
2018         (reader_open_file) Ditto.
2019         
2020 Sun May 30 18:20:12 2004  Ben Pfaff  <blp@gnu.org>
2021
2022         Update our string ADTs, struct string and struct len_string.  Get
2023         rid of pool support, which was largely unused.  Rename lots of
2024         functions to have more obvious or consistent names.
2025         
2026         * ascii.c: Get rid of ascii_pool.  It was only used for string
2027         allocations.
2028         (ascii_open_global) Don't create ascii_pool.
2029         (ascii_close_driver) Don't destroy ascii_pool.
2030         (ascii_postopen_driver) Don't use pool.
2031         (ascii_close_driver) Destroy strings manually.
2032
2033         * str.c: (ds_create) Remove pool argument, all references updated.
2034         (ds_init) Ditto.
2035         (ds_replace) Remove pool support, make more efficient when we
2036         don't need to reallocate.
2037         (ds_destroy) Remove pool support.
2038         (ds_rpad) New function.
2039         (ds_size) Renamed ds_capacity(), all references updated.
2040         (ds_value) Renamed ds_c_str(), all references updated.
2041         (ds_concat) Renamed ds_puts(), all references updated.
2042         (ds_concat_buffer) Renamed ds_concat(), all references updated.
2043         (ds_putchar) Renamed ds_putc(), all references updated.
2044         (ds_getline) Renamed ds_gets(), all references updated.
2045         (ls_create) Remove pool argument, all references updated.
2046         (ls_create_buffer) Ditto.
2047         (ls_destroy) Removed pool support.
2048         (ls_value) Renamed ls_c_str(), all references updated.
2049
2050         * str.h: (ls_length) [__GNUC__] Add inline version.
2051         (ls_c_str) [__GNUC__] Add inline version.
2052         (ls_end) [__GNUC__] Add inline version.
2053         (struct string) Remove pool member.  Rename `size' to `capacity',
2054         all references updated.
2055
2056         * tab.c: (text_format) Instead of using pool argument to
2057         ls_create_buffer(), call pool_register() on allocated data.
2058
2059 Mon Apr 26 22:40:07 2004  Ben Pfaff  <blp@gnu.org>
2060
2061         We're abusing the current ASCII driver by telling it to allocate a
2062         9999-line, 9999-character page in the tests.  This causes some
2063         systems to curl up and die because it allocates 20 MB of
2064         contiguous RAM.  This change alleviates at least part of the
2065         problem.  It is mostly a stop-gap until the new output system is
2066         ready.
2067         
2068         * ascii.c: (struct line) New structure.
2069         (struct ascii_driver_ext) Remove `page', `page_size', `line_len',
2070         `line_len_size', `n_output' members.  Add `lines', `lines_cap'.
2071         (ascii_preopen_driver) Initialize new members, not old ones.
2072         (ascii_close_driver) Destroy new members, not old ones.
2073         (ascii_open_page) Allocate new members, not old ones.
2074         (expand_line) Allocate room in line.
2075         (draw_line) Use new members.
2076         (ascii_line_horz) Ditto.
2077         (ascii_line_vert) Ditto.
2078         (ascii_line_intersection) Ditto.
2079         (text_draw) Ditto.
2080         (output_lines) Ditto.
2081         (ascii_close_page) Ditto.
2082
2083 Sun Apr 25 23:40:15 2004  Ben Pfaff  <blp@gnu.org>
2084
2085         * matrix.c: Dead code.  Removed.
2086
2087         * matrix.h: Dead code.  Removed.
2088
2089 Fri Apr 16 23:59:51 2004  Ben Pfaff  <blp@gnu.org>
2090
2091         Contrary to what I'd always understood, there is an efficient
2092         algorithm for deletion from a hash table populated via linear
2093         probing.  This change implements it.
2094         
2095         * hash.c: (hsh_rehash) Probe in increasing order.
2096         (hsh_probe) Ditto.
2097         (locate_matching_entry) Ditto.
2098         (hsh_delete) Use Knuth's Algorithm 6.4R for deletion.
2099
2100 Tue Apr 13 19:24:15 2004  Ben Pfaff  <blp@gnu.org>
2101
2102         * moments.c (calc_moments): Adjust calculation of kurtosis to
2103         avoid subtracting huge numbers from huge numbers, on Michael
2104         Kiefte's advice.
2105
2106 Sun Apr 11 14:22:12 2004  Ben Pfaff  <blp@gnu.org>
2107
2108         Rework moments routines for improved numerical stability based on
2109         Michael Kiefte's advice.  Any bugs or remaining numerical problems
2110         are still mine though.
2111
2112         There is now a struct moments1 for use with one-pass moments.  It
2113         uses a provisional means algorithm as an attempt to improve
2114         accuracy of higher moments.  The older struct moments now only
2115         handles two-pass moments.
2116         
2117         * aggregate.c: Use moments1 instead moments.
2118
2119         * descript.c: Revert previous change, which is no longer needed
2120         due to the moments revision.
2121
2122         * moments.c: (calc_moments) New function for calculating variance,
2123         skewness, kurtosis.
2124         (moments_pass_one) Only accumulate weights bigger than zero.
2125         (moments_calculate) Allow calculating the mean on pass one, others
2126         require pass two.  Implement in terms of calc_moments().
2127         (struct moments1) New structure.
2128         (init_moments1) New function.
2129         (moments1_clear) Ditto.
2130         (moments1_create) Ditto.
2131         (moments1_add) Ditto.
2132         (moments1_calculate) Ditto.
2133         (moments1_destroy) Ditto.
2134         (cmd_debug_moments) Deal with `struct moments' or `struct
2135         moments1' as requested by user.
2136
2137 Sun Apr 11 14:21:55 2004  Ben Pfaff  <blp@gnu.org>
2138
2139         * Makefile.am (pspp_SOURCES): Remove debug.c.
2140
2141         * debug.c: Removed.  It was empty anyway.
2142
2143 Fri Apr  9 20:04:49 2004  Ben Pfaff  <blp@gnu.org>
2144
2145         * descript.c (calc_descriptives): Fix assert failure when only
2146         MOMENT_MEAN is needed.
2147
2148 2004-04-09  Michael Kiefte  <mkiefte@dal.ca>
2149
2150         * descript.c: 
2151
2152         fixed problem with parsing in match_statistic() causing
2153         "DESCRIPTIVE STAT=MEAN." to barf.
2154
2155         "MEAN" is now default if "SORT" given without specification.
2156
2157         Fixed infinite loop with "DESCRIPT GIBBERISH=ALL."  Parsing is
2158         generally less forgiving of syntax errors: better to have it do
2159         nothing and type it in again then to not know what it actually did
2160         instead.  
2161
2162         z-score transformation now checks score for user-missing values
2163         and checks std_dev for SYSMIS.
2164
2165 2004-04-06  Michael Kiefte  <mkiefte@dal.ca>
2166
2167         * aggregate.c, crosstabs.q, descript.c, dictionary.c, frequencies.q, levene.c, t-test.q, var.h: 
2168         Changed dict_get_case_weight() to accept an additional int * flag
2169         to complain about system-missing, user-missing, zero, or negative
2170         weights and updated existing functions to pass int * to
2171         dict_get_case_weight().
2172
2173 2004-04-05  jmd  <jmd@gnu.org>
2174
2175         * main.c: Fixed configuration problems with gsl
2176
2177         * t-test.q: Fixed some problems encountered when compiling under Cygwin
2178
2179 2004-04-03  blp  <blp@gnu.org>
2180
2181         * lexer.c, ChangeLog:
2182         Fix infinite loop on comment at end of file, add test.
2183
2184 2004-04-03  jmd  <jmd@gnu.org>
2185
2186         * 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:
2187         Fixed the calculation of percentiles and added --syntax and --algorithm options
2188
2189 Sat Apr  3 11:43:37 2004  Ben Pfaff  <blp@gnu.org>
2190
2191         * lexer.c: (lex_skip_comment) Handle end-of-file correctly (I
2192         hope).
2193
2194 Sat Apr  3 15:00:18 WST 2004 John Darrington <john@darrington.wattle.id.au>
2195
2196         * frequencies.q:  Fixed the calculation of percentiles
2197
2198         * Makefile.am:  Added the --ansi flag and dealt with the
2199         consequences.  Added some entries to PSPP_sources so that
2200         make distcheck would pass
2201
2202         * cmdline.c:   Added the --syntax and --algorithm options
2203
2204         * q2c.c:  Added an implicit /ALGORITHM subcommand to everything.
2205
2206 Fri Apr  2 11:25:22 WAST 2004 John Darrington <john@darrington.wattle.id.au>
2207
2208         * t-test.q, levene.c, levene.h  Converted t-test (incl levene) to 
2209         use the new multipass_split_... mechanism.
2210
2211 Wed Mar 31 22:36:22 2004  Ben Pfaff  <blp@gnu.org>
2212
2213         * frequencies.q: (calc_stats) Use moments data structure and
2214         calc_seskew(), calc_sekurt() functions.
2215
2216         * set.q main.c settings.h Added support for --syntax and --algorithm 
2217         options
2218
2219 Tue Mar 30 22:04:19 2004  Ben Pfaff  <blp@gnu.org>
2220
2221         * vfm.c: Had to get last call to multipass_split_output() inside
2222         open_active_file()/close_active_file() pairing, so introduce new
2223         function.
2224         (internal_procedure) Move procedure() code here, except for calls
2225         to open_active_file() and close_active_file().
2226         (procedure) Wrap open_active_file() and close_active_file() around
2227         internal_procedure().
2228         (multipass_procedure_with_splits) Wrap open_active_file() and
2229         close_active_file() around internal_procedure().
2230
2231 Tue Mar 30 22:01:57 2004  Ben Pfaff  <blp@gnu.org>
2232
2233         * descript.c: (cmd_descriptives) Free `vars' to avoid memory leak.
2234
2235 Mon Mar 29 16:26:40 2004  Ben Pfaff  <blp@gnu.org>
2236
2237         * debug.c: Removed.  Moved cmd_debug_evaluate() into expr-evl.c.
2238
2239         * expr-evl.c: (cmd_debug_evaluate) Moved here from debug.c.
2240
2241 Mon Mar 29 16:03:08 2004  Ben Pfaff  <blp@gnu.org>
2242
2243         * algorithm.c: By default turn off some of the more expensive
2244         assertions.
2245         (expensive_assert) New macro which expands to assert if
2246         EXTRA_CHECKS is defined, to nothing otherwise.
2247         (unique) Use expensive_assert().
2248         (binary_search) Ditto.
2249         (push_heap) Ditto.
2250         (pop_heap) Ditto.
2251         (make_heap) Ditto.
2252         (sort_heap) Ditto.
2253
2254         * command.c: (conflicting_3char_prefixes) Words that are the same
2255         don't cause conflicts when they are abbreviated to the first three
2256         letters.
2257
2258         * expr-evl.c: (CONCAT_func) Fix memory leak by incrementing struct
2259         nonterm_node's n earlier.
2260         (generic_str_func) Ditto.
2261         
2262 Mon Mar 29 15:32:17 2004  Ben Pfaff  <blp@gnu.org>
2263
2264         Add support for multipass procedures.  Rewrite DESCRIPTIVES to
2265         test multipass support, take advantage of new moments
2266         calculation, and to not be such crappy code.  Get rid of q2c
2267         processing for DESCRIPTIVES.
2268
2269         * vfm.c: (struct multipass_split_aux_data) New structure.
2270         (multipass_procedure_with_splits) New function.
2271         (multipass_split_callback) New function.
2272         (multipass_split_output) New function.
2273         * descript.q: Removed.
2274
2275         * descript.c: New file.
2276
2277         * var.h: Removed descriptives enums.
2278         (struct descriptives_proc) Removed.
2279         (struct variable) Removed p.dsc.
2280
2281         * Makefile.am: (q_sources_c) Remove descript.c.
2282         (q_sources_q) Removed descript.q.
2283         
2284 Mon Mar 29 15:31:55 2004  Ben Pfaff  <blp@gnu.org>
2285
2286         New manager for keeping track of used workspace.
2287         
2288         * workspace.c: New file.
2289
2290         * workspace.h: New file.
2291
2292         * Makefile.am: (pspp_SOURCES) Add workspace.c, workspace.h.
2293
2294         * sort.c: (do_internal_sort) Use workspace_malloc().
2295         (destroy_internal_sort) Use workspace_free().
2296
2297 Mon Mar 29 15:31:08 2004  Ben Pfaff  <blp@gnu.org>
2298
2299         New `struct casefile' for managing sets of cases.
2300
2301         * casefile.c: New file.
2302
2303         * casefile.h: New file.
2304
2305         * command.def: Add DEBUG CASEFILE command.
2306
2307         * Makefile.am: (pspp_SOURCES) Add casefile.c, casefile.h.
2308
2309         * sort.c: (sort_cases) Move logic for sending storage file to disk
2310         into do_external_sort().
2311         (struct internal_sort) Use an array of ccase pointers instead of a
2312         case_list.
2313         (do_internal_sort) Rewrite to handle casefiles.
2314         (compare_case_list) Removed.
2315         (compare_cases) New function.
2316         (compare_case_dblptrs) New function.
2317         (read_internal_sort_output) Deal with new struct internal_sort.
2318
2319         * vfm.c: (static var workspace_overflow) Removed.
2320         (struct storage_stream_info) Removed all the members.  Added
2321         struct casefile * member.
2322         (storage_sink_open) Use casefile.
2323         (open_storage_file) Removed.
2324         (write_storage_file) Removed.
2325         (storage_to_disk) Removed.
2326         (destroy_storage_stream_info) Use casefile.
2327         (storage_sink_write) Use casefile.
2328         (storage_sink_make_source) Use casefile.
2329         (storage_source_count) Use casefile.
2330         (storage_source_read) Use casefile.
2331         (storage_source_on_disk) Removed.
2332         (storage_source_get_cases) Removed.
2333         (storage_source_set_cases) Removed.
2334         (storage_source_get_casefile) New function.
2335         
2336 Mon Mar 29 15:30:09 2004  Ben Pfaff  <blp@gnu.org>
2337
2338         New `struct moments' for calculating moments.
2339
2340         * stats.c: Removed.
2341
2342         * stats.h: Removed.
2343
2344         * moments.c: New file.
2345
2346         * moments.h: New file.
2347
2348         * command.def: Add DEBUG MOMENTS command.
2349
2350         * Makefile.am: (pspp_SOURCES) Add moments.c, moments.h.  Remove
2351         stats.c, stats.h.
2352
2353         * aggregate.c: Modify AGGREGATE to use the new moments
2354         calculation, even if not in such a great way.
2355         (struct agr_var) Add `moments' member.
2356         (parse_aggregate_functions) Set `moments' member to null.
2357         (agr_destroy) Destroy `moments' member.
2358         (accumulate_aggregate_info) Use `moments' for standard deviation.
2359         (dump_aggregate_info) Ditto.
2360         (initialize_aggregate_info) Create or clear `moments'.
2361
2362         * misc.h: Add pow2(), pow3(), pow4() functions in place of sqr(),
2363         cube(), pow4() that were in stats.h.  All references updated.
2364
2365         * crosstabs.q: stats.h had chi-square significance functions.  Use
2366         GSL instead.
2367         (display_chisq) Use gsl_cdf_chisq_Q() instead of chisq_sig().
2368
2369         * expr-evl.c: (expr_evaluate) Use moments_of_values() for
2370         OP_CFVAR, OP_MEAN, OP_SD, OP_VARIANCE.
2371                 
2372 Fri Mar 26 14:21:23 2004  Ben Pfaff  <blp@gnu.org>
2373
2374         * dictionary.c: (dict_compact_values) Compacted values need to
2375         start off from 0.
2376
2377 Fri Mar 26 00:54:57 2004  Ben Pfaff  <blp@gnu.org>
2378
2379         * var-labs.c: (cmd_variable_labels) For compatibility, don't allow
2380         `/' at start.  Check return value of parse_variables() for error
2381         return.
2382
2383 Fri Mar 26 00:19:27 2004  Ben Pfaff  <blp@gnu.org>
2384
2385         Revamp expressions: make the code a little nicer, and fix bugs
2386         found in testing.
2387         
2388         * expr-evl.c: (expr_evaluate) Make expression argument const.
2389         Support OP_ADD, OP_SUB, OP_MUL, OP_DIV instead of OP_PLUS, OP_MUL.
2390         OP_POW is missing for arg 2 <= 0.  OP_LOG is natural log, not
2391         base-10 log.  Fix OP_ANY, OP_ANY_STRING, OP_RANGE, OP_RANGE_STRING
2392         off-by-ones.  Add OP_MAX_STRING, OP_MIN_STRING.  Fix OP_TIME_HMS,
2393         OP_DATE_WKYR boundary conditions.  Add OP_CTIME_DAYS,
2394         OP_CTIME_HOURS, OP_CTIME_MINUTES, OP_CTIME_DAYS, OP_CTIME_SECONDS.
2395         Support OP_INDEX_2, OP_INDEX_3, OP_RINDEX_2, OP_RINDEX_3 instead
2396         of OP_INDEX, OP_INDEX_OPT, OP_RINDEX, OP_RINDEX_OPT.  Merge
2397         OP_LPAD_OPT into OP_LPAD, OP_RPAD_OPT into OP_RPAD, OP_LTRIM_OPT
2398         into OP_LTRIM, OP_RTRIM_OPT into OP_RTRIM, OP_NUMBER_OPT into
2399         OP_NUMBER.  Fix OP_RTRIM fragility.  Support OP_SUBSTR_2,
2400         OP_SUBSTR_3 instead of OP_SUBSTR, OP_SUBSTR_OPT.  Remove OP_INV.
2401         Simplify OP_SYSMIS.  Remove OP_STR_MIS.
2402
2403         * expr-opt.c: (optimize_expression) Rewrite.
2404         (macro n0) Removed.
2405         (macro n1) Removed.
2406         (macro n2) Removed.
2407         (macro s0) Removed.
2408         (macro s0l) Removed.
2409         (macro s1) Removed.
2410         (macro s1l) Removed.
2411         (macro s2) Removed.
2412         (macro s2l) Removed.
2413         (macro s) Removed.
2414         (macro sl) Removed.
2415         (eq_num_con) New function.
2416         (optimize_tree) New function.
2417         (macro rnc) Removed.
2418         (macro frnc) Removed.
2419         (str_search) Add const to string params.
2420         (str_rsearch) Ditto.
2421         (evaluate_tree_no_missing) Renamed from evaluate_tree.  Add num[],
2422         str[], str_len[] locals to substitute for most of removed macros.
2423         Support OP_ADD, OP_SUB, OP_MUL, OP_DIV instead of OP_PLUS, OP_MUL.
2424         Removed support for missing values because we're never called with
2425         missing values.  Use set_number() or set_number_errno() instead of
2426         rnc or frnc.  Removed any stuff that caused trouble in testing.
2427         We can re-add it later if it really slows anything.  Fix some
2428         random problems.
2429         (evaluate_tree_with_missing) Not yet supported.  To be added later
2430         if it's important.
2431         (repl_num_con) Removed.
2432         (collapse_node) New function.
2433         (force_repl_num_con) Removed.
2434         (set_number) New function.
2435         (set_number_errno) New function.
2436         (repl_str_con) Removed.
2437         (set_string) New function.
2438         (yrmoda) Tighten boundary conditions.  Adopt 2030 cut-off for
2439         2-digit years.
2440         (dump_node) No special case for OP_AND, OP_OR.
2441
2442         * expr-prs.c: (expr_prs) Honor EXPR_NO_OPTIMIZE bit.  Rewrite.
2443         (expr_get_type) New function.
2444         (type_check) Rewrite.
2445         (type_coercion) New function.
2446         (struct operator) New structure.
2447         (match_operator New function.
2448         (parse_binary_operators) New function.
2449         (parse_inverting_unary_operator) New function.
2450         (parse_or) Rewritten.
2451         (parse_and) Rewritten.
2452         (parse_not) Rewritten.
2453         (parse_rel) Rewritten.
2454         (parse_add) Rewritten.
2455         (parse_mul) Rewritten.
2456         (parse_neg) Rewritten.
2457         (parse_exp) Rewritten.
2458         (parse_sysvar) Add $TRUE, $FALSE system variables.
2459         Get $LENGTH, $WIDTH from get_viewlength(), get_viewwidth().
2460         (parse_primary) Use allocate_var_node(), allocate_num_con(),
2461         allocate_str_con().
2462         (struct function) Remove desc, change `func' prototype.
2463         (unary_func) Remove special cases.
2464         (MISSING_func) Reduce to unary_func() that just returns a boolean.
2465         (SYSMIS_func) Handle SYSMIS((x)) like SYSMIS(x).
2466         (VALUE_func) Use allocate_var_node().
2467         (nary_num_func) Allow MIN and MAX for strings.
2468         Use allocate_var_node().  Properly clean up.
2469         Fix return type.
2470         (generic_str_func) Use local table instead of removed `desc'
2471         member.  Mostly rewrite.
2472         (get_num_args) Revise error message.
2473         (parse_function) Return EXPR_ERROR, not 0 on error.
2474         (macro op) Removed.
2475         (macro varies) Removed.
2476         (ops[]) Use expr.def.
2477         (free_node) Do nothing if node is null.
2478         (allocate_num_con) New function.
2479         (allocate_str_con) New function.
2480         (allocate_var_node) New function.
2481         (allocate_binary_nonterminal) New function.
2482         (append_nonterminal_arg) Removed.
2483         (static var func_tab[]) Revised.
2484         (expr_debug_print_postfix) Make parameter const.
2485         Use printf() instead of debug_printf().
2486
2487         * expr.def: New file.
2488         
2489         * expr.h: Change PXP_* to EXPR_*, all references updated.  Also
2490         use named enum instead of unnamed, all references updated.  Add
2491         EXPR_ANY, EXPR_NO_OPTIMIZE.
2492
2493         * exprP.h: Remove EX_*.  Add DEFINE_OPERATOR.  Use expr.def
2494         instead of defining OP_* directly.
2495         (macro IS_TERMINAL) New macro.
2496         (macro IS_NONTERMINAL) New macro.
2497         (enum OP_NO_FLAGS) New.
2498         
2499 Fri Mar 26 00:18:01 2004  Ben Pfaff  <blp@gnu.org>
2500
2501         * error.c: (err_assert_fail) msg variable needs to be non-const.
2502
2503 Fri Mar 26 00:17:24 2004  Ben Pfaff  <blp@gnu.org>
2504
2505         * debug.c: (cmd_debug_evaluate) Rewrite.
2506
2507 Fri Mar 26 00:15:13 2004  Ben Pfaff  <blp@gnu.org>
2508
2509         Fix some CROSSTABS bit rot stupidity.
2510
2511         * crosstabs.q: Reorder the CELLS subcommands for compatibility.
2512         (internal_cmd_crosstabs) Initializes cells[] correctly.
2513         (float_M_suffix) Rename format_cell_entry(), change prototype,
2514         rewrite.
2515         (display_crosstabulation) Fix cell formatting.
2516
2517 Fri Mar 26 00:14:09 2004  Ben Pfaff  <blp@gnu.org>
2518
2519         Make lex_rest_of_line(), lex_entire_end() not discard lines.  Have
2520         to call lex_discard_line() to do that.
2521
2522         * command.c: (run_command) Call lex_discard_line() after
2523         lex_rest_of_line().
2524
2525         * lexer.c: (lex_entire_end) Change behavior.
2526         (lex_rest_of_line) Change behavior.  Return const char *.
2527         (lex_discard_line) Don't clear getl_buf, don't emit message.
2528
2529         * main.c: (handle_error) Emit message here.
2530
2531         * repeat.c: (internal_cmd_do_repeat) Use lex_discard_line()
2532         instead of lex_entire_line().
2533
2534         * str.c: (mm_find_reverse) Make length params size_t.  Rewrite.
2535
2536         * title.c: (get_title) Call lex_discard_line() after
2537         lex_rest_of_line().
2538         (cmd_file_label) Ditto.
2539         (cmd_document) Deal with const char * return value.
2540
2541 Fri Mar 26 00:10:16 2004  Ben Pfaff  <blp@gnu.org>
2542
2543         Removed REMARK command.
2544
2545         * command.c: (extract_prefix) Removed.
2546         (output_line) Removed.
2547         (cmd_remark) Removed.
2548
2549         * command.def: Remove REMARK.
2550
2551 Fri Mar 26 00:08:38 2004  Ben Pfaff  <blp@gnu.org>
2552
2553         Added abort() after lots of assert(0) invocations to avoid some
2554         compiler warnings.  We really need a NOT_REACHED macro.
2555
2556 Tue Mar 23 08:00:42 WAST 2004 John Darrington <john@darrington.wattle.id.au>
2557
2558         * sort.c: Added missing call to temp_file_close.  Changed error 
2559         messages to warnings.
2560
2561         * set.q: Improved setting of set_view{length,width} to be more tolerant
2562         of buggy OSes.
2563
2564 Sun Mar 21 10:11:14 WST 2004 John Darrington <john@darrington.wattle.id.au>
2565
2566         * val-labs.c: Fixed a bug where PSPP would crash, if VALUE LABELS was
2567         used with incorrect syntax.
2568
2569         * error.c, error.h et al:  Overridden definition of assert for a
2570         custom one.
2571
2572         * test-q.c: Fixed a buglet where it would crash if no /VARIABLES
2573         subcommand was given when it ought to have been.
2574
2575 Sat Mar 20 22:19:08 2004  Ben Pfaff  <blp@gnu.org>
2576
2577         * tab.c: (tab_vline) Fix assertions to respect row_ofs and
2578         col_ofs.
2579         (tab_hline) Ditto.
2580         (tab_box) Ditto.
2581         (tab_joint_text) Ditto.
2582
2583 Sat Mar 20 17:57:23 2004  Ben Pfaff  <blp@gnu.org>
2584
2585         * levene.c: Add #include.
2586
2587         * set.q: (set_viewport) Add `int' argument to make its prototype
2588         correct for signal().
2589
2590 Sat Mar 20 15:35:17 2004  Ben Pfaff  <blp@gnu.org>
2591
2592         * expr-evl.c: (expr_evaluate) Assert that `c' is nonzero before
2593         using it.
2594
2595 Sat Mar 20 15:18:16 2004  Ben Pfaff  <blp@gnu.org>
2596
2597         Changed DFM from open-at-first-access to explicit-open.  Before,
2598         calling dfm_get_record() or dfm_put_record() would automatically
2599         open the file.  Now, you have to call dfm_open_for_reading() or
2600         dfm_open_for_writing() explicitly.  This makes it possible to
2601         check permissions, file existence, etc. earlier.
2602
2603         Also made struct file_handle more opaque, and clean up in general.
2604
2605         * data-list.c: (cmd_data_list) Open handle for reading.
2606
2607         * dfm.c: (struct dfm_fhuser_ext) Add `where', `saw_begin_data'
2608         members.
2609         (open_file_r) Renamed dfm_open_for_reading(), rewrote.
2610         (open_file_w) Renamed dfm_open_for_writing(), rewrote.
2611         (open_inline_file) Removed.
2612         (read_record) For inline_file, if we haven't seen BEGIN DATA, read
2613         it.  Deal with line_number in extension record instead of file
2614         handle.
2615         (dfm_get_record) Rewrote.
2616         (dfm_put_record) Rewrote.
2617         (dfm_push) Assert file is open and one of ours.  Deal with
2618         line_number in extension record instead of file handle.
2619         (dfm_pop) Assert file is open and one of ours.  Deal with
2620         line_number in extension record instead of file handle.
2621         (cmd_begin_data) Use dfm_open_for_reading().  Mark that we saw
2622         BEGIN DATA.     
2623
2624         * file-handle.h: (enum constants RH_RF_*) Removed.
2625         (enum constants FH_MD_*) Removed.
2626         (struct file_handle) Removed `name', `norm_fn', `fn', `where',
2627         `recform', `lrecl', `mode' members.  Public references to
2628         `recform' changed to use handle_get_mode(), references to `lrecl'
2629         changed to use handle_get_record_width().  Added `private' member.
2630         (enum file_handle_mode) New.
2631
2632         * file-handle.q: (struct private_file_handle) New structure.
2633         (struct file_handle_list) New structure.
2634         (static var files) New.
2635         (static var file_handles) Removed.
2636         (init_file_handle) Removed.
2637         (create_file_handle) Removed.
2638         (get_handle_with_name) New function.
2639         (get_handle_for_filename) New function.
2640         (cmd_file_handle) Rewritten.
2641         (hash_file_handle) Removed.
2642         (cmp_file_handle) Removed.
2643         (fh_init_files) Rewritten.
2644         (fh_parse_file_handle) Rewritten.  Allows identifiers as
2645         filenames.
2646         (fh_get_handle_by_name) Renamed handle_get_name(), all references
2647         updated.  Rewritten.
2648         (fh_get_handle_by_filename) Renamed handle_get_filename(), all
2649         references updated.  Rewritten.
2650         (fh_record_width) Renamed handle_get_record_width(), all
2651         references updated.  Rewritten.
2652         (handle_get_mode) New function.
2653
2654         * file-type.c: (cmd_file_type) Open handle for reading.
2655
2656         * filename.c: [unix] (struct file_identity) New structure.
2657         [unix] (fn_get_identity) New function.
2658         [unix] (fn_free_identity) New function.
2659         [unix] (fn_compare_file_identities) New function.
2660         [!unix] (struct file_identity) New structure.
2661         [!unix] (fn_get_identity) New function.
2662         [!unix] (fn_free_identity) New function.
2663         [!unix] (fn_compare_file_identities) New function.
2664
2665         * lexer.c: (static var put) Renamed put_token, all references
2666         updated.
2667         (static var put_tokstr) New.
2668         (static var put_tokval) New.
2669         (lex_init) Initialize put_tokstr().
2670         (restore_token) New function.
2671         (save_token) New function.
2672         (lex_get) Use restore_token().
2673         (lex_put_back) Use save_token().
2674         (lex_put_back_id) New function.
2675         (lex_put_forward) Removed.
2676         (lex_preprocess_line) Set put_token instead of using
2677         lex_put_forward().
2678         (lex_negative_to_dash) Use save_token(), set put_token directly.
2679         (dump_token) Use stderr instead of stdout.
2680
2681         * main.c: (main) Remove call to cmd_init().
2682         
2683         * matrix-data.c: (cmd_matrix_data) Open file for reading.
2684
2685         * pfm-read.c: Use handle_get_filename() instead of trying to use
2686         h->fn directly, all over.
2687
2688         * pfm-write.c: Ditto.
2689
2690         * print.c: (internal_cmd_print) Open handle for writing.
2691         (dump_table) Use handle_get_filename().
2692         (print_trns_proc) Use handle_get_mode().
2693         (cmd_print_space) Use fh_parse_file_handle().
2694         Open handle for writing.
2695         [0] (debug_print) Removed.
2696
2697         * sfm-read.c: Use handle_get_filename() instead of trying to use
2698         h->fn directly, all over.
2699
2700         * sfm-write.c: Ditto.
2701
2702 Sat Mar 20 14:35:48 2004  Ben Pfaff  <blp@gnu.org>
2703
2704         Fix memory leaks.
2705         
2706         * autorecode.c: (arc_free) Free arc->src_values.
2707
2708         * error.c: (msg) Free buf.
2709
2710         * val-labs.c: (do_value_labels) Always free vars.
2711
2712         * vfm.c: (close_active_file) If sink has no make_source then call
2713         its destroy function.
2714
2715 Sat Mar 20 14:00:24 2004  Ben Pfaff  <blp@gnu.org>
2716
2717         Fixed cmd_parse() so that it always skips past a full command
2718         name.  A few special commands for which this would be bad get
2719         special treatment.  This lets us drop code for skipping past the
2720         end of a command name in most cmd_*() functions.  It's not worth
2721         listing all the commands affected.
2722
2723         * command.c: (struct command) Remove `cmd' member, replace by
2724         `name' member, all references updated.  Remove `word', `next',
2725         `skip_entire_name' members.
2726         (macro DEFCMD) Deal with revised `struct command'.
2727         (macro UNIMPL) Ditto.
2728         (macro SPCCMD) New macro for commands whose last word shouldn't be
2729         skipped.
2730         (static array cmd_table[]) Make const, rename `commands', remove
2731         sentinel element.
2732         (macro COMMAND_CNT) New macro.
2733         (split_words) Removed.
2734         (cmd_init) Removed.
2735         (FILE_TYPE_okay) Make parameter const.
2736         (cmd_parse) Improve error messages.
2737         (match_strings) New function.
2738         (next_word) New function.
2739         (enum command_match) New enum.
2740         (conflicting_3char_prefixes) New function.
2741         (conflicting_3char_prefix_command) New function.
2742         (cmd_match_words) New function.
2743         (count_matching_commands) New function.
2744         (get_command_name) New function.
2745         (free_words) New function.
2746         (unknown_command_error) New function.
2747         (figure_out_command) Renamed parse_command_name(), rewritten.
2748
2749         * command.def: Removed @ command.  Marked BEGIN DATA, DOCUMENT,
2750         FILE LABEL, REMARK, SUBTITLE, TITLE as special.  Renamed EVALUATE
2751         to DEBUG EVALUATE.  Added N alias for N OF CASES, SORT alias for
2752         SORT CASES.
2753
2754         * command.h: (macro SPCCMD) New.
2755
2756         * include.c: (cmd_include_at) Removed.
2757         (cmd_include) Allow identifier to be used as filename.
2758
2759         * inpt-pgm.c: (cmd_reread) Use fh_parse_file_handle().
2760
2761         * t-test.q: (cmd_t_test) Command name is now parsed for us.
2762         
2763
2764 Sat Mar 20 13:56:00 2004  Ben Pfaff  <blp@gnu.org>
2765
2766         Start work on better test framework.
2767         
2768         * Makefile.am: (pspp_sources) Add debug.c.
2769         
2770         * debug.c: New file.
2771
2772         * compute.c: (cmd_evaluate) Moved to debug.c, renamed
2773         cmd_debug_evaluate().
2774
2775         * expr-prs.c: (expr_parse) Remove PXP_DUMP support.
2776
2777         * expr.h: (enum constant PXP_DUMP) Removed.
2778
2779 Sat Mar 20 00:05:42 WST 2004 John Darrington <john@darrington.wattle.id.au>
2780
2781         * set.q:  Implemented the SHOW command, and synced it to the existing 
2782         SET cmd.
2783
2784         Added a handler for SIGWINCH so that viewlength and viewwidth follow
2785         changes as the window size is changed.
2786
2787         Added fallback to set viewlength and viewwidth from LINES and COLUMS
2788         environment variables if other methods are not available.
2789
2790         glob.c: Removed a lot of global variables from glob.c and encapsulated 
2791         them in set.q
2792
2793         random.c: Tidied up the way the random seed is set.
2794
2795         str.c: Added a ds_vprintf function.
2796
2797         error.c: Extended dump_message so that messages are always broken at
2798         '\n' characters.
2799         
2800 Thu Mar 18 11:07:14 2004  Ben Pfaff  <blp@gnu.org>
2801
2802         * pfm-write.c: (bufwrite) Write out the correct element for string
2803         variables.  From Andreas Streichardt <streichardt@globalpark.de>.
2804
2805 Mon Mar 15 20:48:03 2004  Ben Pfaff  <blp@gnu.org>
2806
2807         Get rid of static and global (!) vars in matrix-data.c.
2808
2809         * matrix-data.c: (static var nr_data) Removed.
2810         (static var nr_factor_values) Removed.
2811         (static var max_cell_index) Removed.
2812         (static var split_values) Removed.
2813         (struct nr_aux_data) New structure.
2814         (read_matrices_without_rowtype) Use a local struct nr_aux_data in
2815         place of static vars, pass to create_case_source() and procedure()
2816         as aux data.
2817         (nr_read_data_lines) Use struct nr_aux_data * parameter instead of
2818         struct matrix_data_pgm *.
2819         (nr_read_splits) Ditto.
2820         (nr_read_factors) Ditto.
2821         (nr_output_data) Ditto.
2822         (static var wr_content) Removed.
2823         (global var wr_data) Removed.
2824         (global var wr_current) Removed.
2825         (struct wr_aux_data) New structure.
2826         (read_matrices_with_rowtype) Use a local struct wr_aux_data in
2827         place of static vars, pass to create_case_source() and procedure()
2828         as aux data.
2829         (matrix_data_read_with_rowtype) Use struct wr_aux_data * parameter
2830         instead of matrix_data_pgm *.
2831         (wr_read_splits) Ditto.
2832         (wr_output_data) Ditto.
2833         (wr_read_rowtype) Ditto.
2834         (wr_read_factors) Ditto.
2835         (wr_read_indeps) Ditto.
2836         
2837 Mon Mar 15 20:07:29 2004  Ben Pfaff  <blp@gnu.org>
2838
2839         Get rid of static vars in autorecode.c.
2840
2841         * autorecode.c: (struct autorecode_trns) Rename `arc' to `specs',
2842         `n_arc' to `spec_cnt'.  All references updated.
2843         (static var v_src) Removed.
2844         (static var v_dest) Removed.
2845         (static var h_trns) Removed.
2846         (static var nv_src) Removed.
2847         (static var descend) Removed.
2848         (static var print) Removed.
2849         (enum direction) New enum.
2850         (struct autorecode_pgm) New structure.
2851         (cmd_autorecode) Use struct autorecode_pgm instead of static vars.
2852         Move n_dest local var into struct autorecode_pgm for ease of
2853         clean-up.  Use arc_free().
2854         (arc_free) New function.
2855         (recode) Modify to take struct autorecode_pgm * parameter instead
2856         of using statics.  Let the caller clean up.
2857         (autorecode_proc_func) Use struct autorecode_pgm * auxiliary data
2858         instead of statics.  Rearrange code a little.
2859
2860 Mon Mar 15 00:25:02 2004  Ben Pfaff  <blp@gnu.org>
2861
2862         Get rid of static, global vars in recode.c.  Remove debug code.
2863
2864         * recode.c: (static var head) Removed.
2865         (global var v) Removed.
2866         (global var nv) Removed.
2867         (cmd_recode) New local variables head, v, nv.  Initialize and free
2868         v.  Don't call debug_print().
2869         [DEBUGGING] (dump_dest) Removed.
2870         [DEBUGGING] (debug_print) Removed.
2871
2872 Mon Mar 15 00:14:49 2004  Ben Pfaff  <blp@gnu.org>
2873
2874         Get rid of static vars in expr-opt.c.
2875
2876         * expr-opt.c: (static var e) Removed.
2877         (static var nop) Removed.
2878         (static var mop) Removed.
2879         (static var ndbl) Removed.
2880         (static var mdbl) Removed.
2881         (static var nstr) Removed.
2882         (static var mstr) Removed.
2883         (static var nvars) Removed.
2884         (static var mvars) Removed.
2885         (struct expr_dump_state) New structure.
2886         (dump_expression) Use new struct expr_dump_state instead of static
2887         vars and pass to functions we call.
2888         (dump_node) Use struct expr_dump_state * parameter.
2889         (emit) Ditto.
2890         (emit_num_con) Ditto.
2891         (emit_str_con) Ditto.
2892         (emit_var) Ditto.
2893         
2894 Mon Mar 15 00:03:51 2004  Ben Pfaff  <blp@gnu.org>
2895
2896         Get rid of static var in COUNT.
2897
2898         * count.c: (static var head) Move into cmd_count().
2899         (cmd_count) [DEBUGGING] Don't call debug_print.
2900         [DEBUGGING] (debug_print) Removed.
2901
2902 Sun Mar 14 23:56:09 2004  Ben Pfaff  <blp@gnu.org>
2903
2904         Get rid of static vars in VALUE LABELS, ADD VALUE LABELS.
2905
2906         * val-labs.c: (static var v) Removed.
2907         (static var nv) Removed.
2908         [DEBUGGING] (debug_print) Removed.
2909         (verify_val_labs) Add struct variable **, int parameters.
2910         (get_label) Ditto.  Improve error messages, streamline.
2911         (erase_labels) New function for erasing value labels, taking over
2912         part of verify_val_labs()'s function.
2913         (init) Removed.
2914         (done) Removed.
2915         (cmd_value_labels) No need to call init() or done() anymore.
2916         (cmd_add_value_labels) Ditto.
2917         (do_value_labels) Add vars, var_cnt local variables.  Clean up
2918         after them internally.  Call erase_labels() if we should.  Don't
2919         call debug_print().
2920
2921 Sun Mar 14 23:33:53 2004  Ben Pfaff  <blp@gnu.org>
2922
2923         Get rid of static vars in MATCH FILES.
2924         
2925         * get.c: (static var mtf_head) Removed.
2926         (static var mtf_tail) Removed.
2927         (static var mtf_by) Removed.
2928         (static var mtf_n_by) Removed.
2929         (static var mtf_master) Removed.
2930         (static var mtf_seq_num) Removed.
2931         (static var mtf_seq_nums) Removed.
2932         (static var mtf_sink) Removed.
2933         (static var mtf_case) Removed.
2934         (struct mtf_proc) New structure.
2935         (cmd_match_files) Use struct mtf_proc instead of static vars.
2936         (mtf_processing_finish) Ditto.
2937         (mtf_free) Ditto.
2938         (mtf_delete_file_in_place) Ditto.
2939         (mtf_read_nonactive_records) Ditto.
2940         (mtf_compare_BY_values) Ditto.
2941         (mtf_processing) Ditto.
2942         (mtf_merge_dictionary) Ditto.
2943
2944 Sun Mar 14 22:48:12 2004  Ben Pfaff  <blp@gnu.org>
2945
2946         * command.def: Add CASESTOVARS, VARSTOCASES unimplemented commands.
2947
2948         * dictionary.c: (dict_rename_var) Add assertion.
2949         (dict_contains_var) Check by index instead of name.
2950
2951 Sun Mar 14 22:01:02 2004  Ben Pfaff  <blp@gnu.org>
2952
2953         Get rid of compaction_necessary, compaction_nval, compaction_case.
2954         Redo VFM interface.  Replace disk_sink and memory_sink by
2955         storage_sink, disk_source and memory_source by storage_source.
2956
2957         * vfm.h: (struct case_sink) Add `dict', `idx_to_fv', `value_cnt'
2958         members.
2959
2960         * vfm.c: 
2961         (struct write_case_data) Remove `begin_func', `end_func',
2962         `func_aux' members.  Add `aux', `trns_case', `sink_case',
2963         `cases_written', `cases_analyzed' members.
2964         (global var compaction_necessary) Make static.
2965         (global var compaction_nval) Removed.
2966         (global var compaction_case) Removed.
2967         (static var case_count) Removed.
2968         (struct procedure_aux_data) Removed.
2969         (struct split_aux_data) Removed.
2970         (procedure) Remove begin_func, end_func parameters.  Rewrite.
2971         (static var not_canceled) Removed.
2972         (process_active_file) Removed.
2973         (process_active_file_write_case) Removed.
2974         (process_active_file_output_case) Removed.
2975         (prepare_for_writing) Moved into open_active_file().
2976         (arrange_compaction) Ditto.
2977         (setup_lag) Ditto.
2978         (open_active_file) Rewrote.
2979         (write_case) New function.
2980         [DEBUGGING] (index_to_varname) Removed.
2981         (execute_transformations) New function.
2982         (exclude_this_case) Renamed filter_case(), changed interface.
2983         (clear_case) Added struct ccase * parameter to interface.
2984         (close_active_file) Added struct write_case_data * parameter,
2985         rewrote.
2986         (disk_sink_create) Removed.
2987         (disk_sink_destroy) Removed.
2988         (disk_sink_make_source) Removed.
2989         (disk_sink_write) Removed.
2990         (disk_source_count) Removed.
2991         (disk_source_destroy) Removed.
2992         (disk_source_read) Removed.
2993         (global var disk_sink_class) Removed.
2994         (global var disk_source_class) Removed.
2995         (global var memory_sink_class) Removed.
2996         (global var memory_source_class) Removed.
2997         (memory_sink_create) Removed.
2998         (memory_sink_destroy) Removed.
2999         (memory_sink_make_source) Removed.
3000         (memory_sink_write) Removed.
3001         (memory_source_count) Removed.
3002         (memory_source_destroy) Removed.
3003         (memory_source_get_cases) Removed.
3004         (memory_source_read) Removed.
3005         (memory_source_set_cases) Removed.
3006         (struct disk_stream_info) Removed.
3007         (struct memory_sink_info) Removed.
3008         (struct memory_source_info) Removed.
3009         (write_active_file_to_disk) Removed.
3010         (destroy_storage_stream_info) New function.
3011         (global var null_sink_class) New var.
3012         (global var storage_sink_class) New var.
3013         (global var storage_source_class) New var.
3014         (open_storage_file) New function.
3015         (storage_sink_destroy) New function.
3016         (storage_sink_make_source) New function.
3017         (storage_sink_open) New function.
3018         (storage_sink_write) New function.
3019         (storage_source_count) New function.
3020         (storage_source_destroy) New function.
3021         (storage_source_get_cases) New function.
3022         (storage_source_on_disk) New function.
3023         (storage_source_read) New function.
3024         (storage_source_set_cases) New function.
3025         (storage_source_to_disk) New function.
3026         (storage_to_disk) New function.
3027         (struct storage_stream_info) New structure.
3028         (write_storage_file) New function.
3029         (procedure_write_case) Removed.
3030         (create_case_source) Add `struct dictionary *' parameter, all
3031         references updated.
3032         (create_case_sink) Ditto.
3033         (free_case_sink) New function.
3034         (struct split_aux_data) New structure.
3035         (procedure_with_splits) New function implementing what procedure()
3036         used to.
3037         (SPLIT_FILE_proc_func) Removed.
3038         (procedure_with_splits_callback) New function.
3039         (equal_splits) New function.
3040         
3041         * aggregate.c: Pass around a struct instead of using statics.
3042         (static var outfile) Remove.
3043         (enum type) Give it tag `missing_treatment'.
3044         (static var missing) Remove.
3045         (static var sort) Remove.
3046         (static var agr_first) Remove.
3047         (static var agr_next) Remove.
3048         (static var case_count) Remove.
3049         (static var prev_case) Remove.
3050         (static var buf64_1xx) Remove.
3051         (static var buf_1xx) Remove.
3052         (struct agr_proc) New structure incorporating the above.
3053         (cmd_aggregate) Use new struct.  Clean up error handling using
3054         agr_destroy().  Completely rewrite actual implementation of
3055         aggregation.
3056         (create_sysfile) Add struct agr_proc * parameter, modify
3057         accordingly.
3058         (parse_aggregate_functions) Ditto.
3059         (free_aggregate_functions) Ditto.  Rename agr_destroy().
3060         (aggregate_single_case) Add struct agr_proc * parameter, modify
3061         accordingly.
3062         (accumulate_aggregate_info) Ditto.
3063         (dump_aggregate_info) Ditto.
3064         (initialize_aggregate_info) Ditto.
3065         (agr_00x_trns_proc) Removed.
3066         (agr_00x_end_func) Removed.
3067         (agr_10x_trns_proc) Removed.
3068         (agr_10x_trns_free) Removed.
3069         (agr_10x_end_func) Removed.
3070         (agr_11x_read) Removed.
3071         (agr_11x_finish) Removed.
3072         [DEBUGGING] (debug_print) Removed.
3073         (write_case_to_sfm) Add struct agr_proc * parameter, modify
3074         accordingly.
3075         (agr_to_active_file) New function.
3076         (presorted_agr_to_sysfile) New function.
3077         (sort_agr_to_sysfile) New function.
3078
3079         * autorecode.c: (cmd_autorecode) Use procedure_with_splits().
3080
3081         * crosstabs.q: (internal_cmd_crosstabs) Ditto.
3082
3083         * descript.q: (cmd_descriptives) Ditto.
3084
3085         * dfm.c: (cmd_begin_data) Check for storage_source_class.  Adapt
3086         to new procedure() interface.
3087
3088         * command.c: (cmd_execute) Adapt to new procedure() interface.
3089
3090         * dictionary.c: (dict_compact_values) Also delete scratch
3091         variables.
3092         (dict_get_compacted_value_cnt) New function.
3093         (dict_get_compacted_idx_to_fv) New function.
3094
3095         * flip.c: (cmd_flip) Warn about and cancel TEMPORARY.
3096         (cmd_flip) Adapt to new procedure() interface.
3097         (flip_sink_write) Use sink->idx_to_fv.
3098
3099         * frequencies.q: (internal_cmd_frequencies) Use
3100         procedure_with_splits().
3101
3102         * get.c: (cmd_save_internal) Adapt to new procedure() interface.
3103         (static var mtf_sink) New static var.
3104         (static var mtf_case) New static var.
3105         (cmd_match_files) Warn about and cancel TEMPORARY.  Redo the way
3106         we actually implement the matching.
3107         (mtf_delete_file_in_place) Use mtf_case.
3108         (mtf_processing) Use mtf_case and mtf_sink.
3109         (cmd_export) Adapt to new procedure() interface.
3110
3111         * levene.c: (levene) Use procedure_with_splits().
3112
3113         * list.q: (cmd_list) Use procedure_with_splits().
3114
3115         * matrix-data.c: (read_matrices_without_rowtype) Adapt to new
3116         procedure() interface.
3117         (read_matrices_with_rowtype) Ditto.
3118
3119         * modify-vars.c; (cmd_modify_vars) Warn about and cancel
3120         TEMPORARY.  Adapt to new procedure() interface.
3121
3122         * rename-vars.c: Warn about and cancel TEMPORARY.
3123
3124         * sort.c: (cmd_sort_cases) Warn about TEMPORARY.
3125         (sort_cases) Use dict_get_compacted_value_cnt() instead of
3126         compaction_nval.  Adapt to new procedure() interface.  Use
3127         storage_source_to_disk().
3128         (do_internal_sort) Don't try to dump the cases to memory.
3129         (compare_case_lists) Pass null idx_to_fv.
3130         (struct initial_run_state) Add `idx_to_fv' member.  Remove
3131         `case_size' member.
3132         (write_initial_runs) Don't initialize irs->case_size.  Adapt to
3133         new procedure() interface.  Reset irs->idx_to_fv after calling
3134         procedure().
3135         (sort_sink_write) Set irs->idx_to_fv.  Use case_size from struct
3136         sort_cases_pgm.  Pass irs, not struct sort_cases_pgm to
3137         push_heap().
3138         (destroy_initial_run_state) Don't dereference irs after freeing
3139         it.
3140         (allocate_cases) Don't calculate case_size locally.
3141         (compare_record) Add idx_to_fv parameter.
3142         (compare_record_run) Change parameter from struct sort_cases_pgm *
3143         to struct initial_run_state *.  Pass irs->idx_to_fv to
3144         compare_record().
3145         (compare_record_run) Third parameter now a struct
3146         initial_run_state *.
3147         (output_record) No need for out_case anymore.  Pass irs, not
3148         struct sort_cases_pgm to pop_heap().  Use case_size from struct
3149         sort_cases_pgm.
3150         (merge) Use case_size from struct sort_cases_pgm.
3151         (merge_once) Use case_size from struct sort_cases_pgm.
3152         Pass null pointer to compare_record() as idx_to_fv.
3153         (global var sort_sink_class) Make static.
3154
3155         * t-test.q: (cmd_t_test) Use procedure_with_splits().
3156
3157         * temporary.c: Remove debugging crap.
3158
3159 Sat Mar 13 14:19:52 WST 2004 John Darrington <john@darrington.wattle.id.au>
3160
3161         * t-test.q, levene.c: Fixed up the handling of MISSING values
3162         int the T-TEST
3163
3164 Fri Mar 12 16:23:35 WST 2004 John Darrington <john@darrington.wattle.id.au>
3165
3166         * t-test.q, levene.c: Added support for T-TEST /GROUP where only 
3167         one value is given.
3168
3169 Wed Mar 10 23:25:13 2004  Ben Pfaff  <blp@gnu.org>
3170
3171         Change explicit variable name checks into use of
3172         dict_class_from_id().
3173
3174         * dictionary.c: (dict_create_var)  Change explicit variable name
3175         check into use of dict_class_from_id().
3176
3177         * get.c: (trim_dictionary) Ditto.
3178
3179         * sel-if.c: (cmd_filter) Ditto.
3180
3181         * sysfile-info.c: (cmd_display) Ditto.
3182
3183         * vars-prs.c: (parse_DATA_LIST_vars) Ditto.
3184
3185         * vfm.c: (arrange_compaction) Ditto.
3186
3187         * weight.c: (cmd_weight) Ditto.
3188
3189 Wed Mar 10 21:16:34 2004  Ben Pfaff  <blp@gnu.org>
3190
3191         * temporary.c: (cmd_temporary) When TEMPORARY was the first
3192         transformation following the input program, if any, for some
3193         reason we special-cased f_trns.  That's just wrong.  It should
3194         always be set to n_trns.
3195
3196 Tue Mar  9 23:44:40 2004  Ben Pfaff  <blp@gnu.org>
3197
3198         * format.c: (parse_format_specifier_name) Fix brown-bag bug
3199         introduced in last check-in.
3200
3201 Tue Mar  9 23:10:41 2004  Ben Pfaff  <blp@gnu.org>
3202
3203         * format.c: (global array translate_fmt[]) Removed.
3204         (translate_fmt) New function as replacement.
3205         (parse_format_specifier_name) Rewrite.
3206
3207         * pfm-read.c: (convert_format) Use translate_fmt() instead of
3208         translate_fmt[].
3209
3210         * sfm-read.c: (parse_format_spec) Ditto.
3211
3212         * postscript.c: (text) Fix handling of fonts with missing
3213         ligatures.
3214
3215         * sort.c: (struct external_sort) Add temp_name member.
3216         (destroy_external_sort) Free temp_dir, temp_name members.
3217         (init_external_sort) Allocate temp_name.
3218         (get_temp_file_name) Change prototype.
3219         (open_temp_file) Deal with change to get_temp_file_name().
3220         (close_temp_file) Ditto.
3221         (remove_temp_file) Ditto.
3222         (write_temp_file) Ditto.
3223         (read_temp_file) Ditto.
3224         (sort_sink_destroy) Removed.
3225         (sort_sink_class) Change destroy member to null.
3226
3227 Tue Mar  9 22:36:34 2004  Ben Pfaff  <blp@gnu.org>
3228
3229         Eliminate temp_case.
3230
3231         * aggregate.c: (cmd_aggregate) No need to save/restore temp_case
3232         anymore.  Use agr_11x_finish().
3233         (aggregate_single_case) Make first param const.
3234         (accumulate_aggregate_info) Ditto.
3235         (agr_00x_end_func) Use compaction_case, not temp_case.
3236         (agr_11x_func) Break into agr_11x_read(), agr_11x_finish().
3237
3238         * data-list.c: (struct data_list_pgm) Add `case_size' member.
3239         (cmd_data_list) Initialize case_size.
3240         (read_from_data_list_fixed) Add struct ccase * param, use instead
3241         of temp_case.
3242         (read_from_data_list_free) Ditto.
3243         (read_from_data_list_list) Ditto.
3244         (read_one_case) Rename data_list_trns_proc(), all references
3245         updated.  Add argument in calling above functions.  Use c
3246         argument instead of temp_case.
3247         (destroy_dls) Rename data_list_trns_free(), all references
3248         updated.
3249
3250         * expr-evl.c: (expr_evaluate) Make second parameter const.
3251
3252         * file-type.c: (struct file_type_pgm) Add `case_size' member.
3253         (cmd_end_file_type) Initialize `case_size'.
3254         (file_type_source_read) Add struct ccase * parameter.  Use instead
3255         of temp_case.
3256
3257         * flip.c: Rewritten.
3258
3259         * get.c: (struct get_pgm) New structure to keep track of
3260         case_size.
3261         (cmd_get) Initialize case_size.
3262         (cmd_import) Ditto.
3263         (get_source) Deal with struct get_pgm.
3264         (get_source_read) Add struct ccase * parameter, use instead of
3265         temp_case.
3266         (import_source_read) Ditto.
3267
3268         * get.c: Use a null pointer instead of temp_case to represent the
3269         "current case" in a struct mtf_file's input member.
3270         (mtf_processing_finish) Pass null to mtf_processing(), not
3271         temp_case.
3272         (mtf_read_nonactive_records) Don't set iter->input to temp_case.
3273         (mtf_compare_BY_values) Add extra arg, use instead of null input
3274         members.
3275         (mtf_processing) Use c parameter instead of temp_case.  Pass
3276         compaction_case to process_active_file_output_case().
3277         
3278         * glob.c: (global variable temp_case) Removed.
3279
3280         * inpt-pgm.c: (struct input_program_pgm) Add `case_size' member.
3281         (cmd_input_program) Initialize case_size.  Set
3282         vfm_source->value_cnt.
3283         (init_case) Add struct ccase * parameter, use instead of
3284         temp_case.
3285         (clear_case) Ditto.
3286         (input_program_source_read) Ditto.
3287
3288         * matrix-data.c: (matrix_data_read_without_rowtype) Ditto.
3289         (dump_cell_content) Ditto.
3290         (nr_output_data) Ditto.
3291         (read_matrices_without_rowtype) Ditto.
3292         (matrix_data_read_with_rowtype) Ditto.
3293         (wr_read_splits) Ditto.
3294         (wr_output_data) Ditto.
3295
3296         * sort.h: (struct sort_cases_pgm) New member `case_size'.
3297         
3298         * sort.c: (sort_cases) Initialize scp->case_size.
3299         (struct external_sort) Remove `case_size' member.
3300         (write_initial_runs) Only call vfm_sink->class_destroy if
3301         non-null.
3302         (struct sort_source_aux) New structure.
3303         (sort_source_read_helper) New function.
3304         (sort_source_read) Use sort_source_read_helper().
3305         (read_sort_output) Change interface to be more reasonable.
3306         (read_internal_sort_output) Ditto.
3307         (read_external_sort_output) Ditto.
3308
3309         * vars-prs.c: (dict_class_to_name) Pass return value through
3310         gettext.
3311
3312         * vfm.c: (struct procedure_aux_data) Add `trns_case' member.
3313         (procedure) Initialize trns_case.
3314         (procedure) Pass trns_case to vfm_source->class->read().
3315         Free trns_case.
3316         (process_active_file) Start using struct procedure_aux_data.
3317         (process_active_file_write_case) Pass trns_case to
3318         transformations, lag_case(), clear_case().
3319         (process_active_file_output_case) Add struct ccase * parameter.
3320         (create_trns_case) New function.
3321         (make_temp_case) Removed.
3322         (vector_initialization) Removed.
3323         (close_active_file) Only call make_source if non-null, otherwise
3324         set vfm_source to null pointer.  Don't free temp_case.
3325         (disk_source_read) Add struct ccase * parameter, use instead of
3326         temp_case.
3327         (memory_source_read) Ditto.
3328         (lag_case) Add const struct ccase * member.
3329         (procedure_write_case) Use trns_case instead of temp_case.
3330         (clear_case) Add struct ccase * member, use instead of temp_case.
3331         (exclude_this_case) Ditto.
3332         (create_case_source) Add struct dictionary * parameter, use to
3333         initialize source->value_cnt.
3334
3335         * vfm.h: (struct case_source) Add `value_cnt' member.
3336         (struct case_source_class) Add struct ccase * parameter to `read'
3337         member function pointer.
3338         (struct case_sink_class) Make struct ccase * parameter const in
3339         `write' member function pointer.
3340         
3341 Wed Mar  3 20:44:37 2004  Ben Pfaff  <blp@gnu.org>
3342
3343         Fix a lot of "possibly uninitialized variable" warnings.  Some of
3344         them are even real bugs.  A few of them make me wonder how the
3345         code ever worked.
3346
3347         * aggregate.c: (parse_aggregate_functions) Initialize `function.
3348
3349         * ascii.c: (output_lines) Add default case to switch.
3350
3351         * crosstabs.q: Remove static variable `expected' and all
3352         references to it.
3353         (display_crosstabulation) Always calculate expected value.
3354         (calc_chisq) Ditto.
3355         (output_pivot_table) Initialize `cmp'.
3356         (display_crosstabulation) New variable `last_row', which is
3357         initialized.
3358
3359         * data-in.c: (parse_numeric) Always initialize sign.  How did this
3360         work at all?!
3361
3362         * data-list.c: (repeating_data_trns_proc) Always initialize code.
3363         Always set info.ofs.  (How did this work?!)
3364
3365         * expr-opt.c: (optimize_tree) Always initialize `m'.
3366         (evaluate_tree) Always initialize `c'.  (How did this work?)
3367
3368         * frequencies.q: (frq_custom_variables) Always initialize min,
3369         max.
3370         (frq_custom_grouped) Always initialize `dl'.
3371
3372         * groff-font.c: (groff_read_font) Always initialize char_set.
3373
3374         * matrix-data.c: (nr_output_data) Initialize `split'.
3375         (wr_read_splits) Remove shadowing split_cnt declaration.
3376         (wr_output_data) Initialize `split'.
3377
3378         * output.c: (tokener) Skip add character on syntax error.
3379
3380         * pool.c: (pool_strndup) Always set `copy'.  (How did this work?!)
3381
3382         * postscript.c: (read_ps_encodings) Use line.string instead of
3383         uninitialized `bp'.
3384         (write_text) Add default case to switch.
3385         (text) Always initialize multiple variables.  Fix bug with
3386         ligatures.
3387
3388         * print.c: (fixed_parse_fortran) Initialize head.
3389         (alloc_line) Add default case to switch.
3390
3391         * recode.c: (parse_dest_spec) Handle case where nothing matches.
3392         (recode_trns_proc) Move variable declaration inward.  Add default
3393         case to switch.
3394
3395         * sfm-read.c: (read_header) Initialize skip_amt.
3396
3397         * sysfile-info.c: (display_variables) Always initialize pc.
3398
3399         * vars-prs.c: Initialized `included'.
3400
3401 Wed Mar  3 09:30:09 2004  Ben Pfaff  <blp@gnu.org>
3402
3403         * main.c: (main) sigaction()'s sa_flags member was uninitialized.
3404         Just use signal() instead.
3405
3406 Wed Mar  3 09:26:30 2004  Ben Pfaff  <blp@gnu.org>
3407
3408         Get rid of vfm_sink_info and vfm_source_info.
3409         
3410         * aggregate.c: (agr_00x_end_func) Don't increment
3411         sfm_sink_info.ncases.
3412
3413         * sort.c: (do_internal_sort) Get case count from
3414         vfm_source->class->count().
3415         (struct external_sort) Add `case_size' member.
3416         (do_external_sort) Initialize case_size.
3417         (struct initial_run_state) Add `case_size' member.
3418         (write_initial_runs) Initialize case_size.
3419         (sort_sink_write) Use case_size.
3420         (read_external_sort_output) Use case_size.  Get case_cnt from
3421         initial_runs.
3422
3423         * vfm.c: (struct write_case_data) Add underscores to existing arg
3424         names, all references updated.  Renamed `aux' as `func_aux', all
3425         references updated.  Added new `aux' member.
3426         (global var vfm_source_info) Removed.
3427         (global var vfm_sink_info) Removed.
3428         (struct procedure_aux_data) New.
3429         (struct split_aux_data) New.
3430         (procedure) Use `aux' fields for procedure_aux_data,
3431         split_aux_data.
3432         (process_active_file_write_case) Pass case_count + 1 to
3433         transformation procedures, exclude_this_case().
3434         (process_active_file_output_case) Don't increment
3435         vfm_sink_info.ncases.
3436         (prepare_for_writing) Don't initialize vfm_sink_info.  Don't try
3437         to send data to disk early.
3438         (make_temp_case) Don't use vfm_sink_info.case_size.
3439         (close_active_file) Don't initialize vfm_source_info.
3440         (struct disk_stream_info) New, to allow for case_cnt and case_size fields.
3441         (disk_sink_create) Initialize and/or update disk_stream_info.
3442         (disk_sink_write) Ditto.
3443         (disk_sink_destroy) Ditto.
3444         (disk_sink_make_source) Ditto.
3445         (disk_source_read) Ditto.
3446         (disk_source_destroy) Ditto.
3447         (global var disk_source_class) Add disk_source_count().
3448         (disk_source_count) New function.
3449         (struct memory_sink_info) Add `case_cnt', `case_size' members.
3450         (struct memory_source_info) Ditto.
3451         (memory_sink_create) Deal with case_cnt, case_size.
3452         (memory_sink_write) Ditto.
3453         (memory_sink_make_source) Ditto.
3454         (memory_source_read) Ditto.
3455         (memory_source_count) New function.
3456         (memory_source_class) Add memory_source_count().
3457         (procedure_write_case) Don't use vfm_sink_info.ncases.  Do use
3458         proc_aux->cases_written, and pass it to transformation procedures
3459         and exclude_this_case ().
3460         (exclude_this_case) Add case_num parameter.  Pass it to
3461         expr_evaluate().
3462         (SPLIT_FILE_procfunc) Use split_aux->prev_case instead of static
3463         variable.
3464
3465         * vfm.h: (struct case_source_class) Add `count' member.
3466
3467         * vfmP.h: (struct stream_info) Removed.
3468         (global variable vfm_source_info) Removed.
3469         (global variable vfm_sink_info) Removed.
3470         
3471 Tue Mar  2 23:38:17 2004  Ben Pfaff  <blp@gnu.org>
3472
3473         * var.h: (typedef trns_proc_func) New typedef.
3474         (trns_free_func) New typedef.
3475         (struct trns_header) Change `proc' to type trns_proc_func, `free'
3476         to type trns_free_func.  This only changes the actual type of
3477         trns_proc_func, adding a `case_num' parameter.  Updated all
3478         implementations to use the typedefs instead.
3479
3480         * compute.c: (compute_num) Pass case_num to expr_evaluate().
3481         (compute_num_vec) Ditto.
3482         (compute_str) Ditto.
3483         (compute_str_vec) Ditto.
3484
3485         * do-if.c: (do_if_trns_proc) Ditto.
3486
3487         * expr-evl.c: (expr_evaluate) Add new case_num parameter, use for
3488         OP_CASENUM.
3489
3490         * inpt-pgm.c: (input_program_source_read) Maintain case count,
3491         pass to transformation functions.
3492         (reread_trns_proc) Pass case_num arg to expr_evaluate().
3493
3494         * loop.c: (loop_1_trns_proc) Ditto.
3495         (loop_2_trns_proc) Ditto.
3496         (loop_3_trns_proc) Ditto.
3497
3498         * print.c: (print_space_trns_proc) Ditto.
3499
3500         * sel-if.c: (select_if_proc) Ditto.
3501
3502 Tue Mar  2 11:36:52 2004  Ben Pfaff  <blp@gnu.org>
3503
3504         * frequencies.q: (cleanup_freq_tab) Avoid memory leak by
3505         destroying hash table.
3506
3507         * glob.c: (read_active_file) Variable not referenced, removed.
3508         (cancel_input_pgm) Ditto.
3509
3510         * levene.c: Add #include <stdlib.h> needed to call free().
3511
3512         * aggregate.c: (parse_aggregate_functions) Make `function'
3513         variable const.
3514
3515 Tue Mar  2 11:30:56 2004  Ben Pfaff  <blp@gnu.org>
3516
3517         Start working to eliminate VFM dependence on static variables.
3518
3519         * command.c: (cmd_parse) Use case_source_is_class().
3520
3521         * data-list.c: Rewrite to eliminate use of static variables.
3522
3523         * dfm.c: (cmd_begin_data) Use case_source_is_class().
3524
3525         * file-handle.q: (fh_handle_name) Make parameter const.
3526
3527         * file-type.c: Rewrite to eliminate use of static variables.
3528
3529         * flip.c: Rewrite to eliminate use of static variables.
3530
3531         * format.c: (get_format_var_width) New function.
3532
3533         * get.c: Eliminate use of static variables.
3534
3535         * inpt-pgm.c: Eliminate use of static variables.
3536
3537         * matrix-data.c: Eliminate use of static variables.
3538
3539         * set.q: (set_max_workspace) New variable.
3540         (cmd_set) Use SET WORKSPACE to modify set_max_workspace.
3541
3542         * var.h: (struct case_list) Move here from vfmP.h.
3543
3544         * vars-atr.c: (discard_variables) Handle new vfm_source type.
3545
3546         * vfm.c: (vfm_source) Change type from struct case_stream to
3547         struct case_source.
3548         (vfm_sink) Change type from struct case_stream to struct
3549         case_sink.
3550         (static var paging) Rename workspace_overflow, all references
3551         updated.
3552         (procedure) Use new class structures.
3553         (process_active_file) Ditto.
3554         (process_active_file_write_case) Ditto.
3555         (prepare_for_writing) Use set_max_workspace.  Use new class
3556         structures.
3557         (close_active_file) Use new class structures.  Free old sink.
3558         (global var disk_source_file) Removed.
3559         (global var disk_sink_file) Removed.
3560         (disk_stream_init) Removed.
3561         (disk_stream_read) Removed.
3562         (disk_stream_write) Removed.
3563         (disk_stream_mode) Removed.
3564         (disk_stream_destroy_source) Removed.
3565         (disk_stream_destroy_sink) Removed.
3566         (global var vfm_disk_stream) Removed.
3567         (disk_sink_create) New function.
3568         (disk_sink_write) New function.
3569         (disk_sink_destroy) New function.
3570         (disk_sink_make_source) New function.
3571         (disk_sink_class) New static var.
3572         (disk_source_read) New function.
3573         (disk_source_destroy) New function.
3574         (global var vfm_source_class) New var.
3575         (global var memory_source_cases) Removed.
3576         (global var memory_sink_cases) Removed.
3577         (global var memory_sink_max_cases) Removed.
3578         (struct memory_sink_info) New struct.
3579         (memory_stream_init) Removed.
3580         (memory_stream_read) Removed.
3581         (memory_stream_write) Removed.
3582         (memory_stream_mode) Removed.
3583         (memory_stream_destroy_source) Removed.
3584         (memory_stream_destroy_sink) Removed.
3585         (global var vfm_memory_stream) Removed.
3586         (page_to_disk) Renamed write_active_file_to_disk().
3587         (memory_sink_create) New function.
3588         (memory_sink_write) New function.
3589         (memory_sink_destroy) New function.
3590         (memory_sink_make_source) New function.
3591         (memory_sink_class) New static var.
3592         (memory_source_read) New function.
3593         (memory_source_destroy) New function.
3594         (memory_source_get_cases) New function.
3595         (memory_source_set_cases) New function.
3596         (global var vfm_source_class) New var.
3597         (procedure_write_case) Use new class structures.
3598         (create_case_source) New function.
3599         (case_source_is_complex) New function.
3600         (case_source_is_class) New function.
3601         (create_case_sink) New function.
3602
3603         * vfm.h: (global variable reinit_sysmis) Not used, removed.
3604         (global variable reinit_blanks) Not used, removed.
3605         (global variable init_zero) Not used, removed.
3606         (global variable init_blanks) Not used, removed.
3607         (struct case_source) New struct.
3608         (struct case_source_class) New struct.
3609         (struct case_sink) New struct.
3610         (struct case_sink_class) New struct.
3611         (struct case_stream) Removed.
3612
3613         * vfmP.h: (struct case_list) Moved to var.h.
3614
3615 Tue Mar  2 11:28:30 2004  Ben Pfaff  <blp@gnu.org>
3616
3617         * algorithm.c: (count_equal) New function.
3618         (count_if) New function.
3619         (unique) Add assertions.
3620         (partition) Add assertions.
3621         (is_partitioned) New function.
3622         (copy_if) Add assertions.
3623         (remove_equal) Add assertions.
3624         (lexicographical_compare) Rename lexicographical_compare_3way.
3625         (sort) Add assertions.  Rephrase some code.
3626         (is_sorted) New function.
3627
3628 Sun Feb 29 23:24:57 2004  Ben Pfaff  <blp@gnu.org>
3629
3630         Rewrite SORT CASES.
3631
3632         * sort.c: Completely rewrite.
3633
3634         * sort.h: Expose interface via struct sort_cases_pgm, not via
3635         global variables.
3636
3637         * aggregate.c: (sort) New static var.
3638         (cmd_aggregate) Use sort.
3639         (create_sysfile) Ditto.
3640         (aggregate_single_case) Ditto.
3641         (dump_aggregate_info) Ditto.
3642         (agr_00x_end_func) Ditto.
3643         (debug_print) Ditto.
3644
3645         * var.h: (enum SRT_ASCEND) Removed.
3646         (enum SRT_DESCEND) Removed.
3647         (struct sort_cases_proc) Removed.
3648         (struct variable) Remove p.srt member.
3649
3650 Sun Feb 29 23:22:45 2004  Ben Pfaff  <blp@gnu.org>
3651
3652         Get rid of the old, crappy heap structure and replace it by a new,
3653         shiny, C++ STL-like heap structure.
3654         
3655         * Makefile.am: (pspp_SOURCES) Remove heap.c, heap.h.
3656
3657         * algorithm.c: (push_heap) New function.
3658         (heapify) Ditto.
3659         (pop_heap) Ditto.
3660         (make_heap) Ditto.
3661         (sort_heap) Ditto.
3662         (is_heap) Ditto.
3663         
3664         * heap.c: Removed.
3665
3666         * heap.h: Removed.
3667
3668 Sun Feb 29 23:21:53 2004  Ben Pfaff  <blp@gnu.org>
3669
3670         Increase warning level.
3671         
3672         * Makefile.am: (AM_CFLAGS) Remove -Wnouninitialized.
3673
3674 Sat Feb 21 17:38:58 WST 2004 John Darrington <john@darrington.wattle.id.au>
3675
3676         * main.c: Added a signal handler for SIGSEGV requesting a bug report.
3677          
3678 Fri Feb 20 23:22:14 2004  Ben Pfaff  <blp@gnu.org>
3679
3680         * dictionary.c: (dict_create_var) Fix root cause of bug worked
3681         around by previous change log entry.
3682         
3683         * compute.c: (lvalue_finalize) Remove workaround from previous
3684         change log entry.
3685
3686 Fri Feb 20 14:37:41 WAST 2004 John Darrington <john@darrington.wattle.id.au>
3687
3688         * compute.c: Fixed a bug where the Format was not getting set for 
3689           computed variables (thus causing a crash when SAVEing).
3690
3691         * Added a test to stop this bug ever coming back
3692
3693 Wed Feb 18 22:21:35 2004  Ben Pfaff  <blp@gnu.org>
3694
3695         Got rid of approx.h.  In general, replaced all references to
3696         approx_eq() by ==, approx_lt() by <, etc.  Other types of changes
3697         noted below.
3698
3699         * Makefile.am: (pspp_SOURCES) Removed approx.h.
3700
3701         * data-out.c: (try_F) Replaced test for approx_eq(number, 0.0) by
3702         test for mag < EPSILON.
3703
3704         * misc.h: Add definition of EPSILON.
3705
3706 Wed Feb 18 21:32:44 2004  Ben Pfaff  <blp@gnu.org>
3707
3708         * vfm.c: (procedure) Add check to prevent recursive call.
3709
3710 Wed Feb 18 21:48:54 WST 2004 John Darrington <john@darrington.wattle.id.au>
3711
3712         * Moved the declarations relating to values to their own header file
3713           (val.h)
3714
3715         * Added levene.c and levene.h
3716
3717         * vars-atr.c: Changed the signature of compare_values to 
3718         take const * arguments.
3719                 
3720         * t-test.q: Changed the structure of struct t_test_proc 
3721        variables now contain their own group statistics information.
3722        Eventually, t_test_proc might get renamed, because it'd be 
3723        applicable to other commands too.
3724
3725 Mon Feb 16 23:15:51 2004  Ben Pfaff  <blp@gnu.org>
3726
3727         * data-out.c: Clean up.  Changed interface of convert_*() to take
3728         either a `double' or a `const char *' instead of a `const union
3729         value *'.  Update all implementations of those interfaces.
3730         (data_out) Use switch statements instead of a table.
3731         (convert_AHEX) Rewrite.
3732
3733         * format.h: Update comment.
3734
3735 Mon Feb 16 22:14:36 2004  Ben Pfaff  <blp@gnu.org>
3736
3737         * q2c.c: (dump_header) Add an Emacs header line to output files
3738         that makes generated .c files read-only by default, to make it
3739         difficult to accidentally change generated files.
3740
3741 Mon Feb 16 22:12:07 2004  Ben Pfaff  <blp@gnu.org>
3742
3743         * frequencies.q: (compare_freq_numeric_a) Compare by frequency,
3744         not bogus a->v.c <=> b->v.c pointer compare.
3745         (compare_freq_alpha_a) Ditto.
3746         (compare_freq_numeric_d) Ditto.
3747         (compare_freq_alpha_d) Ditto.
3748         
3749 Mon Feb 16 22:00:53 2004  Ben Pfaff  <blp@gnu.org>
3750
3751         Changed data_out() to store string data directly into a `union
3752         value''s s member, not indirectly into c.
3753
3754         * crosstabs.q: (output_pivot_table) Use format_short() instead of
3755         data_out().
3756         (table_value_missing) Ditto.
3757         (float_M_suffix) Ditto.
3758         (format_short) New function.
3759
3760         * data-in.h: (data_in_finite_line) Remove inline definition.
3761
3762         * data-list.c: (destroy_dls_var_spec) New function.
3763         (destroy_dls) Rewrite in terms of destroy_dls_var_spec().
3764         (data_list_source_destroy_source) Avoid cast.
3765         (struct repeating_data_trns) New field `id_value'.  Update
3766         comments.
3767         (cmd_repeating_data) Initialize id_value.  Use new
3768         repeating_data_trns_free() for freeing REPEATING DATA
3769         transformations.
3770         (rpd_parse_record) Rewrite support for record ID to be less bogus.
3771         (repeating_data_trns_free) New function.
3772
3773         * data-out.c: (data_out) Change return type to `void' by replacing
3774         error returns by writing a message into the output buffer.
3775         (convert_A) Read from v->s instead of v->c.
3776         (convert_AHEX) Ditto.
3777
3778         * expr-evl.c: Update comment.
3779         (expr_evaluate) Add assertion in OP_STRING case.
3780
3781         * format.h: (macro MAX_FORMATTED_LEN) New macro.
3782
3783         * list.q: (list_cases) Update for new data_out() semantics.
3784
3785         * print.c: (print_trns_proc) Ditto.
3786
3787         * tab.c: (tab_value) Ditto.
3788         (tab_float) Avoid stupid cast.
3789
3790         * var.h: Update comments.
3791         (macro MAX_STRING) New macro.
3792         (macro MAX_ELEMS_PER_VALUE) New macro.
3793
3794         * vars-atr.c: (compare_values) New function.
3795
3796         * vfm.c: (dump_splits) Update for new data_out() semantics.
3797
3798 Mon Feb 16 21:45:47 2004  Ben Pfaff  <blp@gnu.org>
3799
3800         * crosstabs.q: (struct table_entry) Rename v[] to values[].  All
3801         references updated.
3802         (struct crosstab) Rename v[] to vars[].  All references updated.
3803         (hash_table_entry) Replace the hash algorithm and fix a bug at the
3804         same time, which caused the hash value to depend only on a single
3805         value, not all of the variables' values.
3806         
3807 Mon Feb 16 12:49:53 2004  Ben Pfaff  <blp@gnu.org>
3808
3809         Clean up struct dictionary's value_cnt usage.
3810
3811         * dictionary.c: Add a function comment to each function.
3812         (struct dictionary) Rename value_cnt to next_value_idx, which more
3813         accurately reflects its meaning.  All references updated.
3814         (dict_rename_vars) Add assertion.
3815         (dict_get_value_cnt) Rename dict_get_next_value_idx().  All
3816         references updated.
3817         (dict_get_case_size) New function.
3818
3819         * aggregate.c: (create_sysfile) Use dict_get_case_size().
3820
3821         * get.c: (mtf_read_nonactive_records) Ditto.
3822
3823         * sort.c: (allocate_cases) Ditto.
3824         (write_initial_runs) Ditto.
3825         (merge) Ditto.
3826         (merge_once) Ditto.
3827
3828         * vfm.c: (prepare_for_writing) Ditto.
3829         (setup_lag) Ditto.
3830         (lag_case) Ditto.
3831
3832 Mon Feb 16 00:17:55 2004  Ben Pfaff  <blp@gnu.org>
3833
3834         Make vfm.c slightly less grotesque.
3835
3836         * vfm.c: (filter_var) Removed.
3837         (filter_index) Removed.
3838         (FILTERED macro) Removed.
3839         (exclude_this_case) New function.
3840         (process_active_file_write_case) Use exclude_this_case() instead
3841         of FILTERED and inline tests.
3842         (procedure_write_case) Ditto.
3843         (setup_filter) Removed.
3844         (open_active_file) Don't call setup_filter().
3845         (close_active_file) Call dict_get_filter() instead of checking
3846         filter_var.
3847
3848 Mon Feb 16 00:01:53 2004  Ben Pfaff  <blp@gnu.org>
3849
3850         * var.h: (struct variable) Update comments.
3851
3852 Sun Feb 15 23:14:59 2004  Ben Pfaff  <blp@gnu.org>
3853
3854         New functions dict_create_var_assert(), dict_lookup_var_assert().
3855         Converted several dict_*_var()/assert pairs into a single
3856         dict_*_var_assert().
3857
3858         * dictionary.c: (dict_create_var_assert) New function.
3859         (dict_lookup_var_assert) New function.
3860
3861 Sun Feb 15 23:06:08 2004  Ben Pfaff  <blp@gnu.org>
3862
3863         Got rid of "struct long_vec", envector(), devector(), etc.  Added
3864         two members `init', `reinit' to struct variable as a substitute.
3865         
3866         * Makefile.am: (pspp_SOURCES) Removed cases.c, cases.h.
3867         
3868         * cases.c: Removed.
3869
3870         * cases.h: Removed.
3871
3872         * aggregate.c: (parse_aggregate_functions) destvar doesn't need
3873         init.
3874
3875         * autorecode.c: (cmd_autorecode) destvars don't need init.
3876
3877         * compute.c: (lvalue_finalize) Set reinit.
3878
3879         * data-list.c: (fixed_parse_compatible) Don't need init usually.
3880         (dump_fmt_list) Ditto.
3881         (parse_free) Ditto.
3882
3883         * descript.q: (run_z_pass) Don't need init for z-scores.
3884
3885         * dictionary.c: (dict_create_var) Initialize `init', `reinit'
3886         members.
3887         (dict_clone_var) Copy `reinit' member, initialize `init' member.
3888
3889         * glob.c: (init_glob) Remove vec_init() calls.
3890
3891         * inpt-pgm.c: (cmd_end_input_program) Use `reinit', not `left'.
3892         
3893         * loop.c: (internal_cmd_loop) Don't need to call envector().
3894
3895         * numeric.c: (cmd_numeric) Ditto.
3896         (cmd_string) Ditto.
3897         (cmd_leave) Ditto.  Set `init', `reinit' members.
3898
3899         * recode.c: (cmd_recode) Don't need to call envector().
3900
3901         * repeat.c: (internal_cmd_do_repeat) Ditto.
3902
3903         * var.h: (struct variable) Remove `left'.  Add `init', `reinit'.
3904         (force_create_variable) Removed prototype.
3905         (force_dup_variable) Ditto.
3906
3907         * vector.c: (cmd_vector) Don't need to call envector().
3908
3909         * vfm.c: (reinit_sysmis) Removed.
3910         (reinit_blanks) Removed.
3911         (init_zero) Removed.
3912         (init_blanks) Removed.
3913         (process_active_file_write_case) No need to deal with vectors.
3914         Call clear_temp_case().
3915         (vector_initialization) Rewrite to use `init', `reinit'.
3916         (close_active_file) No need to call vec_clear().
3917         (procedure_write_case) Call clear_temp_case().
3918         (clear_temp_case) New function.
3919
3920 Sun Feb 15 20:50:36 2004  Ben Pfaff  <blp@gnu.org>
3921
3922         * pfm-write.c: (bufwrite) Get rid of nasty cast that also invoked
3923         undefined behavior.
3924
3925 Thu Feb 12 23:35:15 2004  Ben Pfaff  <blp@gnu.org>
3926
3927         Add auxiliary argument to procedure() interface.  Associated small
3928         clean-ups of vfm interface.
3929         
3930         * Updated every caller of procedure() and process_active_file() to
3931         reflect modified interface.  Simple, ordinary changes not listed
3932         otherwise below.
3933
3934         * Updated every function that implements struct case_stream's
3935         `read' function to take a write_case_func and a write_case_data.
3936         Also updated every caller of write_case() to instead call them
3937         through these arguments.  In some cases this meant that the extra
3938         args had to be threaded through a couple of extra levels.  This
3939         wasn't difficult or interesting so the details won't be given.
3940
3941         * data-list.c: (struct repeating_data_trns) Add members
3942         `write_case', `wc_data' as kluge.
3943         (read_one_set_of_repetitions) Rename repeating_data_trns_proc and
3944         make non-static.
3945         (repeating_data_set_write_case) New function.
3946
3947         * data-list.h: New file to declare repeating_data_trns_proc() and
3948         repeating_data_set_write_case().
3949
3950         * inpt-pgm.c: (input_program_source_read) Call
3951         repeating_data_set_write_case() for all the REPEATING DATA
3952         transformations, so that they know where to send their cases.
3953         It's a big kluge.  Also kluge in END CASE.
3954         (end_case_trns_proc) Never called anymore, but we still need it,
3955         so just assert(0).
3956
3957         * sort.c: (read_sort_output) Update to match struct case_stream
3958         `read' member.
3959
3960         * vfm.c: (struct write_case_data) New structure.
3961         (proc_func) Removed.
3962         (virt_proc_func) Removed.
3963         (begin_func) Removed.
3964         (virt_begin_func) Removed.
3965         (end_func) Removed.
3966         (write_case) Removed.
3967         (procedure) Added an auxiliary parameter to each function pointer
3968         argument's prototype.  Added an auxiliary data parameter.
3969         Rewrote.
3970         (process_active_file) Ditto.
3971         (process_active_file_write_case) Pass aux data along.
3972         (close_active_file) Ditto.
3973         (procedure_write_case) Ditto.
3974         (SPLIT_FILE_procfunc) Ditto.
3975
3976         * vfm.h: (typedef write_case_data) New.
3977         (typedef write_case_func) New.
3978         (struct case_stream) Add parameters to `read' member prototype.
3979         
3980 Thu Feb 12 19:24:53 WST 2004 John Darrington <john@darrington.wattle.id.au>
3981
3982         * t-test.q:  Added calculations for independent samples. (But no Levene
3983         test yet!)
3984
3985         * Makefile.am: Moved q_sources_c into own variable 
3986
3987 Wed Feb 11 23:56:51 2004  Ben Pfaff  <blp@gnu.org>
3988
3989         Miscellaneous cleanups.
3990         
3991         * Change unused to UNUSED in many source files to reflect modified
3992         pref.h.  Change use of __WIN32__, __MSDOS, __DJGPP__,
3993         __CYGWIN32__, __unix__, and unix not to assume that they're
3994         defined to a nonzero value.  Change use of __attribute__ to use
3995         NO_RETURN or PRINTF_FORMAT instead.
3996         
3997         * alloc.h: Move definitions for local_alloc(), local_free() here
3998         from ../pref.h.orig and simplify.
3999
4000         * expr-evl.c: Instead of working differently based on PAGED_STACK,
4001         use a pool allocator unconditionally.
4002         (CHECK_STRING_SPACE) Removed.
4003         (ALLOC_STRING_SPACE) Removed.
4004         (expr_evaluate) Use e->pool instead of CHECK_STRING_SPACE and
4005         ALLOC_STRING_SPACE.
4006
4007         * expr-opt.c: (dump_expression) Allocate string pool.
4008
4009         * expr-prs.c: (expr_free) Free string pool.
4010
4011         * pool.c: (pool_destroy) This pool must be removed from its
4012         parent's list of gizmos, not from its own.  Use free_all_gizmos().
4013         (pool_clear) New function.
4014         (free_all_gizmos) New function.
4015         (pool_alloc) Use space in empty block after this one if any.
4016         (pool_release) Only empty out blocks, don't actually free() them.
4017
4018         * print.c: Get rid of PAGED_STACK special case by always
4019         dynamically allocating line buffers.
4020         (struct print_trns) Always include the `line' member.
4021         (internal_cmd_print) Always initialize the `line' member.
4022         (alloc_line) Always allocate memory for `line'.
4023         (print_trns_proc) Always initialize buf from `line' member.
4024         (print_trns_free) Always free `line' memory.
4025
4026         * sort.c: (allocate_file_handles) Special-case MS-DOS for mkdir()
4027         call.
4028         
4029 Wed Feb 11 20:33:18 2004  Ben Pfaff  <blp@gnu.org>
4030
4031         * flip.c: Fixed crash from FLIP when a numeric variable is
4032           specified on NEWNAMES and a large value is used, and a couple of
4033           other minor bugs besides.
4034           (struct varname) Make name a 9-character fixed-size array
4035           instead of a 1-character variable size array.
4036           (make_new_var) Allow digits in variable names.
4037           (flip_stream_write) Limit numeric values to 8 characters and
4038           format system missing and very large and small values more
4039           appropriately.
4040
4041 Thu Feb  5 13:19:06 WAST 2004 John Darrington <john@darrington.wattle.id.au>
4042
4043         * command.c: Fixed test on command return status for the correct 
4044           value,  which had been causing a crash under certain invalid input.
4045
4046 Wed Feb  4 15:34:11 WST 2004 John Darrington <john@darrington.wattle.id.au>
4047
4048         * t-test.q: Added calculations for the one sample variant of the T-TEST
4049
4050 Tue Feb  3 20:09:54 2004  Ben Pfaff  <blp@gnu.org>
4051
4052         * tab.c: (render_strip) Fix bug that sometimes caused joined text
4053           in joined cells to be rendered outside box boundaries.
4054
4055 Tue Feb  3 18:56:45 WST 2004 John Darrington <john@darrington.wattle.id.au>
4056
4057         * random.c (rng_create): Fixed seeding so that it gets reseeded after
4058         SET seed=xx has been called.
4059
4060 Mon Jan 19 14:08:09 2004  Ben Pfaff  <blp@gnu.org> 
4061
4062         * random.c (rng_get_double): Fix always-returning-zero bug in my
4063         preferred way, and at the same time make sure rounding doesn't
4064         bite us.
4065
4066 Thu Jan  1 23:16:41 2004  Ben Pfaff  <blp@gnu.org>
4067
4068         * html.c: (change_attributes) Dead code, removed.
4069         (escape_string) Eliminate code to call change_attributes() that
4070         never actually called it.
4071         (output_tab_table) Get rid of dependence on tab_hit
4072         and struct tab_joined_cell's hit member, which are abominations.
4073
4074         * tab.c: (tab_output_text) Don't call
4075         d->class->text_set_font_by_name if it's a null pointer.
4076         (macro UNROLL_LOOP) Eliminate.
4077         (macro UNROLL_3_LOOPS) Eliminate.
4078         (tabi_render) Rewrite not to use the above macros.
4079
4080 Thu Jan  1 23:09:07 2004  Ben Pfaff  <blp@gnu.org>
4081
4082         Start working on a new output driver system, one that doesn't suck
4083         so much, by adding a "device-independent" output driver.  The idea
4084         is to write out only a single output stream, then use separate
4085         processes to translate them into whatever formats we want.  This
4086         is similar to how "groff" works with its various output drivers
4087         (grops, grotty, grodvi, ...).
4088         
4089         * Makefile.am: (pspp_SOURCES) Add devind.c, devind.h.
4090
4091         * list.q: (write_all_headers) Stub out devind class.
4092         (clean_up) Ditto.
4093         (determine_layout) Ditto.
4094         (list_cases) Ditto.
4095
4096         * output.c: (outp_init) Add devind class.
4097
4098         * devind.c: New file.
4099
4100         * devind.h: New file.
4101
4102 Thu Jan  1 23:08:14 2004  Ben Pfaff  <blp@gnu.org>
4103
4104         * frequencies.q: (hash_value_alpha) Fixed up the previous change
4105         to use the proper string length.
4106
4107 Wed Dec 31 16:27:33 WAST 2003 John Darrington <john@darrington.wattle.id.au>
4108
4109         * Fixed bug where FREQ would crash on alpha values
4110
4111 Tue Dec 30 22:42:57 2003  Ben Pfaff  <blp@gnu.org>
4112
4113         * Removed bletcherous alloca() workarounds for AIX from top of
4114         many files.  AIX can use the alternative alloca() implementation
4115         instead.
4116
4117 Tue Dec 30 22:35:16 2003  Ben Pfaff  <blp@gnu.org>
4118
4119         * ascii.c: (ascii_option) Fix implementation of headers option.
4120
4121 Tue Dec 30 22:32:53 2003  Ben Pfaff  <blp@gnu.org>
4122
4123         * ascii.c: Add a "squeeze" option to the ASCII driver to squeeze
4124         multiple blank lines into one.
4125         (struct ascii_driver_ext) Add squeeze_blank_lines option.
4126         (ascii_preopen_driver) Initialize squeeze_blank_lines.
4127         (static var option_tab) Add squeeze entry.
4128         (ascii_option) Set squeeze_blank_lines.
4129         (output_lines) Implement squeezing blank lines.
4130
4131 Wed Dec 31 07:19:46 WST 2003 John Darrington <john@darrington.wattle.id.au>
4132
4133         * Removed redundant code from output.h
4134
4135 Sat Dec 27 22:17:52 2003  Ben Pfaff  <blp@gnu.org>
4136
4137         Dictionary classes: each variable is "ordinary", "system", or
4138         "scratch".
4139
4140         * var.h: (enum dict_class) New enum.
4141
4142         * vars-prs.c: (dict_class_from_id) New function.
4143         (dict_class_to_name) New function.
4144
4145 Sat Dec 27 22:16:06 2003  Ben Pfaff  <blp@gnu.org>
4146
4147         * var.h: (struct freq_tab_set) Removed (not used).
4148
4149 Sat Dec 27 22:15:21 2003  Ben Pfaff  <blp@gnu.org>
4150
4151         * value-labels.c: (val_labs_destroy) vls needs to be freed too.
4152
4153 Sat Dec 27 22:10:49 2003  Ben Pfaff  <blp@gnu.org>
4154
4155         * stats.c: (hypercube) Rename pow4().  All references updated.
4156
4157 Sat Dec 27 22:05:49 2003  Ben Pfaff  <blp@gnu.org>
4158
4159         * rename-vars.c: (cmd_rename_variables) Rewritten.
4160         (compare_name) Removed.
4161
4162 Sat Dec 27 22:03:51 2003  Ben Pfaff  <blp@gnu.org>
4163
4164         var_set feature, and code taking advantage of it.
4165         
4166         * crosstabs.q: (static var var_dict) Removed.
4167         (static var variables) New variable.
4168         (static var variables_cnt) New variable.
4169         (cmd_crosstabs) Free variables instead of var_dict.
4170         (internal_cmd_crosstabs) Initialize and use variables,
4171         variables_cnt instead of var_dict.
4172         (free_var_dict) Removed.
4173         (crs_custom_tables) Use var_set instead of a copied dictionary.
4174         (crs_custom_variables) Set up variables, variables_cnt instead of
4175         var_dict.
4176         [DEBUGGING] (debug_print) Ditto.
4177
4178         * means.q: (mns_custom_tables) Use var_set instead of a copied
4179         dictionary.
4180
4181         * vars-prs.c: (parse_vs_variable) New function.
4182         (parse_dict_variable) Rewritten.
4183         (parse_variable) Rewritten.
4184         (parse_variables) Renamed parse_var_set_vars(), rewritten.
4185         (parse_variables) New function in terms of parse_var_set_vars().
4186         Now requires its first argument to be non-null.  All references
4187         that passed a null pointer updated to pass default_dict instead.
4188         (macro id_dict) Removed.
4189         (parse_DATA_LIST_vars) Add assertions.
4190         (parse_mixed_vars) Ditto.
4191         (struct var_set) New structure.
4192         (var_set_get_cnt) New function.
4193         (var_set_get_var) New function.
4194         (var_set_lookup_var) New function.
4195         (var_set_destroy) New function.
4196         (dict_var_set_get_cnt) New function.
4197         (dict_var_set_get_var) New function.
4198         (dict_var_set_lookup_var) New function.
4199         (dict_var_set_destroy) New function.
4200         (var_set_create_from_dict) New function.
4201         (struct array_var_set) New structure.
4202         (array_var_set_get_cnt) New function.
4203         (array_var_set_get_var) New function.
4204         (array_var_set_lookup_var) New function.
4205         (array_var_set_destroy) New function.
4206         (var_set_create_from_array) New function.
4207
4208         * q2c.c: (dump_parser) Use parse_variables(default_dict, ...)
4209         instead of parse_variables(NULL, ...) in output code.
4210
4211 Sat Dec 27 21:38:53 2003  Ben Pfaff  <blp@gnu.org>
4212
4213         Change inp_init from a 2-bit vector to an ordinary array.
4214         Initialize it all in cmd_end_input_program() instead of in
4215         create_variable().
4216
4217         * inpt-pgm.c: (enum value_init_type) New enum.
4218         (global var inp_init) Change to `enum value_init_type *', make
4219         static.
4220         (inp_init_size) Removed.
4221         (inp_nval) Change to `size_t', make static.
4222         (cmd_input_program) Don't initialize inp_init or inp_init_size.
4223         (cmd_end_input_program) Initialize inp_init, inp_nval.
4224         (init_case) Rewrite.
4225         (clear_case) Rewrite.
4226
4227         * inpt-pgm.h: Removed.
4228
4229 Sat Dec 27 21:36:38 2003  Ben Pfaff  <blp@gnu.org>
4230
4231         * hash.c: (hsh_hash_bytes) Use Fowler-Noll-Vo hash instead of
4232         Colin Plumb hash.  It is simpler and should better resist
4233         collisions.
4234         (hsh_hash_string) Ditto.
4235
4236 Sat Dec 27 21:34:57 2003  Ben Pfaff  <blp@gnu.org>
4237
4238         * get.c: (export_write_case_func) Remove debug printing code.
4239
4240 Sat Dec 27 21:11:09 2003  Ben Pfaff  <blp@gnu.org>
4241
4242         * get.c: (cmd_save_internal) Rename parameter.  Use &t->h instead
4243         of cast.
4244         (save_write_case_func) Use &trns->h instead of cast.
4245         (cmd_export) Use &t->h instead of cast.
4246
4247 Sat Dec 27 20:57:42 2003  Ben Pfaff  <blp@gnu.org>
4248
4249         Moved vectors into the dictionary.
4250
4251         * var.h: (struct vector) Moved here from vector.h.  `index' member
4252         renamed `idx', `v' renamed `var', `nv' renamed `cnt'.  All
4253         references updated.
4254         
4255         * vector.h: Removed.
4256
4257         * vector.c: (global var vec) Removed.
4258         (global var nvec) Removed.
4259         (cmd_vector) Rewritten.
4260         (find_vector) Removed.
4261
4262         * dictionary.c: (dict_create_vector) New function.
4263         (dict_get_vector) New function, replaces reading global vec[]
4264         array.
4265         (dict_get_vector_cnt) New function, replaces reading global nvec
4266         variable.
4267         (dict_lookup_vector) New function, replaces find_vector().
4268         (dict_clear_vectors) New function.
4269
4270 Sat Dec 27 20:54:01 2003  Ben Pfaff  <blp@gnu.org>
4271
4272         Start to move away from `struct variable' p `union' member to void
4273         * aux member.
4274
4275         * var.h: (struct variable) Add `aux' member.
4276
4277 Sat Dec 27 20:36:25 2003  Ben Pfaff  <blp@gnu.org>
4278
4279         Get rid of struct variable `foo' member.
4280
4281         * frequencies.q: (internal_cmd_frequencies) Use p.frq.used instead
4282         of foo.
4283         (frq_custom_variables) Ditto.
4284         (frq_custom_grouped) Ditto.
4285
4286         * get.c: (struct save_trns) Change `var' member from `int *' to
4287         `struct variable **'.
4288         (cmd_save_internal) Use aux instead of foo.
4289         (save_trns_proc) Use revised `var' member.
4290         (static var mtf_seq_no) Renamed mtf_seq_num.
4291         (static var mtf_seq_nums) New static var.
4292         (cmd_match_files) Initialize mtf_seq_nums.
4293         (mtf_free) Free mtf_seq_nums.
4294         (mtf_processing) Use mtf_seq_nums instead of foo.
4295         (mtf_merge_dictionary) No need to initialize mv->foo.
4296         (cmd_export) Use aux instead of foo.  Use revised `var' member.
4297         (mns_custom_tables) Don't use foo to check for duplicates, that's
4298         what PV_NO_DUPLICATE is for.
4299
4300         * var.h: (struct variable) Remove `foo' member.
4301         (struct frequencies_proc) New member.
4302         
4303 Sat Dec 27 19:46:13 2003  Ben Pfaff  <blp@gnu.org>
4304
4305         Clean up COMPUTE and IF.
4306
4307         * compute.c: More or less rewrite the darn thing.
4308         (struct compute_trns) Rename and reorder and add and delete
4309         members.
4310         (cmd_compute) Rewrite.
4311         (compute_num) Make conditional on test expression.  Now used for
4312         both COMPUTE and IF.
4313         (compute_num_vec) Ditto.
4314         (compute_str) Ditto.
4315         (compute_str_vec) Ditto.
4316         (cmd_if) Rewrite.
4317         (if_num) Removed.
4318         (if_num_vec) Removed.
4319         (if_str) Removed.
4320         (if_str_vec) Removed.
4321         (parse_target_expression) Renamed parse_rvalue_expression(),
4322         rewritten.
4323         (new_trns) Renamed compute_trns_create(), rewritten.
4324         (delete_trns) Removed.
4325         (free_trns) Renamed compute_trns_free(), rewritten.
4326         (struct lvalue) New structure.
4327         (parse_var_or_vec) Renamed lvalue_parse(), rewritten.
4328         (lvalue_get_type) New function.
4329         (lvalue_is_vector) New function.
4330         (lvalue_finalize) New function.
4331         (lvalue_destroy) New function.
4332         
4333 Sat Dec 27 19:44:14 2003  Ben Pfaff  <blp@gnu.org>
4334
4335         * command.def: Disallow MODIFY VARS in input mode, so that
4336         variables can't get dropped and confuse cmd_end_input_program()'s
4337         attempt to fill inp_init[].
4338         
4339         * modify-vars.c: (static var forward_positional_ordering) New
4340         variable.
4341         (struct var_modification) Entirely changed.
4342         (rearrange_dict) Interface changed, rewritten.
4343         (cmd_modify_vars) Deal with modified struct var_modification, much
4344         rewritten.
4345         (struct var_renaming) New structure.
4346         (compare_var_renaming_by_new_name) New function.
4347         (validate_var_modification) New function.
4348
4349         * var.h: (struct modify_vars_proc) Removed.
4350         (struct variable) Removed member p.mfv.
4351
4352 Sat Dec 27 19:40:26 2003  Ben Pfaff  <blp@gnu.org>
4353
4354         Make EVALUATE a valid command whether we're debugging or not, so
4355         that `make check' can succeed regardless of whether debugging is
4356         turned on.
4357         
4358         * command.def: [GLOBAL_DEBUGGING] Drop the #if.
4359
4360         * compute.c: [GLOBAL_DEBUGGING] (cmd_evaluate) Drop the #if.
4361
4362 Sat Dec 27 19:34:40 2003  Ben Pfaff  <blp@gnu.org>
4363
4364         * apply-dict.c: (cmd_apply_dictionary) Replace a ghastly switch
4365         statement by a simple if test.
4366
4367         * dfm.c: (dfm_get_record) Add assertion.
4368
4369 Sat Dec 27 17:51:26 2003  Ben Pfaff  <blp@gnu.org>
4370
4371         For each file x.c, move #include "x.h" to the very top of the
4372         include list, to catch x.h failing to include the proper headers.
4373
4374 Sat Dec 27 17:50:19 2003  Ben Pfaff  <blp@gnu.org>
4375
4376         * algorithm.c: (find) New function.
4377         (remove_equal) New function.
4378         (set_difference) New function.
4379         (adjacent_find_equal) New function.
4380         [TEST_UNIQUE] Removed test case.
4381         (copy_if) Find end test.
4382
4383 Sat Dec 27 17:42:45 2003  Ben Pfaff  <blp@gnu.org>
4384
4385         * dictionary.c: (dict_get_case_weight) New convenience function.
4386
4387         * aggregate.c: (accumulate_aggregate_info) Use
4388         dict_get_case_weight().
4389
4390         * frequencies.q: (calc_general) Ditto.
4391         (calc_integer) Ditto.
4392         (calc) Ditto.
4393
4394         * t-test.q: (groups_calc) Ditto.
4395         (z_calc) Ditto.
4396
4397 Sat Dec 27 17:29:45 2003  Ben Pfaff  <blp@gnu.org>
4398
4399         * glob.c: (global var default_dict) Change from `struct
4400         dictionary' to `struct dictionary *'.  All references changed.
4401         (init_glob) Initialize default_dict with dict_create().
4402
4403 Sat Dec 27 17:06:06 2003  Ben Pfaff  <blp@gnu.org>
4404
4405         struct dictionary now made opaque.  All related functions:
4406
4407         * get.c: (rename_variables) Removed.
4408         (dict_delete_run) Removed.
4409         
4410         * temporary.c: (copy_variable) Removed.
4411         (new_dictionary) Removed.
4412         (save_dictionary) Removed.
4413         (restore_dictionary) Removed.
4414         (free_dictionary) Removed.
4415
4416         * vars-atr.c: (clear_default_dict) Removed.
4417         (find_variable) Removed.
4418         (find_dict_variable) Removed.
4419         (create_variable) Removed.
4420         (delete_variable) Removed.
4421         (common_init_stuff) Removed.
4422         (init_variable) Removed.  Updating of inp_init moved into
4423         cmd_end_input_program().
4424         (replace_variable) Removed.
4425         (rename_variable) Removed.
4426         (clear_variable) Removed.
4427         (dup_variable) Removed.
4428
4429         * vars-prs.c: (is_varname) Removed.
4430         (is_dict_varname) Removed.
4431         (fill_all_vars) Removed.
4432
4433         * vector.c: (find_vector) Removed.
4434
4435         * weight.c: (stop_weighting) Removed.
4436
4437         * dictionary.c: New file.
4438         (dict_create) New, replaces new_dictionary().
4439         (dict_clone) New, replaces save_dictionary() and
4440         restore_dictionary().
4441         (dict_clear) New, replaces clear_default_dict().
4442         (dict_destroy) New, replaces free_dictionary().
4443         (dict_get_var_cnt) New function, replaces references to
4444         dict->nvar.
4445         (dict_get_var) New function, replaces references to dict->var[i].
4446         (dict_get_vars) New function, replaces fill_all_vars().
4447         (dict_create_var) New, replaces create_variable().  Interface
4448         drops `type' parameter, using a zero `width' to designate numeric.
4449         (dict_clone_var) New, replaces dup_variable().
4450         (dict_rename_var) New, replaces rename_variable().
4451         (dict_lookup_var) New, replaces find_variable(),
4452         find_dict_variable(), is_varname().
4453         (dict_contains_var) New function.
4454         (compare_variable_dblptrs) New function.
4455         (dict_delete_var) New function, replaces clear_variable().
4456         (dict_delete_vars) New function, replaces dict_delete_run().
4457         (dict_reorder_vars) New function.
4458         (dict_rename_vars) New function, replaces rename_variables().
4459         (dict_get_weight) New function, replaces reading dict->weight_var.
4460         (dict_set_weight) New function, replaces writing dict->weight_var
4461         or calling stop_weight(dict).
4462         (dict_get_filter) New function, replaces reading dict->filter_var.
4463         (dict_set_filter) New function, replaces writing dict->filter_var.
4464         (dict_get_case_limit) New function, replaces reading dict->N.
4465         (dict_set_case_limit) New function, replaces writing dict->N.
4466         (dict_get_value_cnt) New function, replaces reading dict->nval.
4467         (dict_compact_values) New function, replaces a loop that was
4468         replicated in several places.
4469         (dict_get_split_vars) New function, replaces reading dict->splits.
4470         (dict_get_split_cnt) New function, replaces reading
4471         dict->n_splits.
4472         (dict_set_split_vars) New function, replaces writing dict->splits.
4473         (dict_get_label) New function, replaces reading dict->label.
4474         (dict_set_label) New function, replaces writing dict->label.
4475         (dict_get_documents) New function, replaces reading
4476         dict->documents.
4477         (dict_set_documents) New function, replaces writing
4478         dict->documents.
4479         
4480         All references to above functions updated.
4481         
4482         * aggregate.c: (cmd_aggregate) Copy file label and documents from
4483         old dictionary to new by hand, because dict_create() can't do it
4484         itself.  Use dict_set_documents(), dict_set_split_vars().
4485
4486         * temporary.c: (cancel_temporary) Also set temp_dict to NULL after
4487         calling dict_destroy().
4488
4489         * data-list.c: (dls_var_spec) Remove `type' member, replace by
4490         `width'.
4491         (fixed_parse_compatible) Some slightly nontrivial changes for
4492         dict_create_var().
4493         (dump_fmt_list) Ditto.
4494         (parse_free) Ditto.
4495
4496         * file-type.c: (create_col_var) Ditto.
4497
4498         * get.c: (cmd_get) Use dict_compact_values() instead of a loop.
4499         (trim_dictionary) Use dict_delete_vars(), dict_reorder_vars().
4500         (rename_variables) Use dict_rename_vars().
4501         (mtf_merge_dictionary) Use dict_get_documents(),
4502         dict_set_documents(), dict_compact_values().
4503
4504         * pfm-read.c: (read_variables) Deal with changes to weighting.
4505
4506         * q2c.c: (dump_parser) Use dict_lookup_var() instead of
4507         is_varname() in output code.
4508
4509         * sfm-read.c: (read_header) Use dict_create(), dict_set_label(),
4510         other dictionary functions.
4511
4512         * title.c: (add_document_line) Use dict_get_documents(),
4513         dict_set_documents().
4514
4515         * vars-atr.c: (discard_variables) Use dict_clear(default_dict),
4516         reset default_handle by hand.  dict_clear() will clear vectors so
4517         there's no need for that by hand.
4518
4519         * vfm.c: (close_active_file) Move call to finish_compaction()
4520         earlier, so that we can do the compaction as a single step using
4521         dict_compact_values().  Use dict_clear_vectors().
4522         (finish_compaction) Use dict_delete_var(), dict_compact_values().
4523                 
4524         Some functions don't have replacements:
4525
4526         * vars-atr.c: (force_create_variable) Removed.  All references
4527         updated to dict_create_var() followed by an assertion.
4528         (force_dup_variable) Removed.  All references updated to
4529         dict_clone_var() followed by an assertion.
4530         
4531         * weight.c: (update_weighting) Removed.  No longer necessary, so
4532         all references removed.
4533
4534 Sat Dec 27 16:43:01 2003  Ben Pfaff  <blp@gnu.org>
4535
4536         Clean up AGGREGATE.
4537         
4538         * aggregate.c: Eliminate separation of weighted and unweighted
4539         case.  It made the code too obscure and I doubt it was actually
4540         faster.  Instead, all code uses the "weighted" code, because
4541         that's a generalization of the "unweighted" code.
4542         (FWEIGHT) Removed.
4543         (FOPTIONS) Ditto.
4544         (parse_aggregate_functions) No need to set FWEIGHT.
4545         (accumulate_aggregate_info) Get rid of FWEIGHT cases.
4546         (dump_aggregate_info) Ditto.
4547         (initialize_aggregate_info) No need for special plain_function
4548         that gets rid of FWEIGHT option.
4549
4550         * aggregate.c: Get rid of approximations.
4551         (accumulate_aggregate_info) Don't use approx_gt(), approx_lt(),
4552         approx_in_range().
4553         (aggregate_single_case) Don't use approx_ne().
4554
4555 Sat Dec 27 16:19:36 2003  Ben Pfaff  <blp@gnu.org>
4556
4557         * ascii.c (ascii_line_width): Dead code, removed.
4558
4559         * postscript.c (ps_line_width): Ditto.
4560
4561         * q2c.c (xrealloc): Ditto.
4562
4563         * count.c (internal_cmd_count): Ditto.
4564
4565         * means.q (validate_dependent_endpoint): Ditto.
4566
4567         * set.q: (cmd_gset) Ditto.
4568
4569         * weight.c: [0] (weight_trns_proc) Ditto.
4570
4571 Sat Dec 27 16:18:16 2003  Ben Pfaff  <blp@gnu.org>
4572
4573         Make the code -Wmissing-prototypes clean.
4574
4575         * Makefile.am (version.c): Add #include "version.h".
4576         
4577         * ascii.c: (ascii_open_global) Make static.
4578         (ascii_close_page) Ditto.
4579         (ascii_font_sizes) Ditto.
4580         (ascii_postopen_driver) Ditto.
4581         (ascii_close_driver) Ditto.
4582         (ascii_option) Ditto.
4583         (ascii_open_page) Ditto.
4584         (ascii_line_horz) Ditto.
4585         (ascii_line_vert) Ditto.
4586         (ascii_line_intersection) Ditto.
4587         (ascii_box) Ditto.
4588         (ascii_polyline_begin) Ditto.
4589         (ascii_polyline_point) Ditto.
4590         (ascii_polyline_end) Ditto.
4591         (ascii_text_set_font_by_name) Ditto.
4592         (ascii_text_set_font_by_position) Ditto.
4593         (ascii_text_set_font_by_family) Ditto.
4594         (ascii_text_get_font_name) Ditto.
4595         (ascii_text_get_font_family) Ditto.
4596         (ascii_text_set_size) Ditto.
4597         (ascii_text_get_size) Ditto.
4598         (ascii_text_metrics) Ditto.
4599         (ascii_text_draw) Ditto.
4600         (ascii_close_page) Ditto.
4601
4602         * cmdline.h: New header for parse_command_line().  Used where
4603         needed.
4604
4605         * command.c: Move prototypes for cmd_*() functions to command.h.
4606
4607         * command.h: Prototypes for cmd_*() functions moved here from
4608         command.c.
4609
4610         * crosstabs.q: (gamma_int) Ditto.
4611
4612         * file-handle.h: Add fh_init_files() prototype.
4613         
4614         * getline.c: (welcome) Ditto.
4615
4616         * glob.h: New header for init_glob().  Used where appropriate.
4617
4618         * hash.c: (comparison_helper) Ditto.
4619
4620         * html.c: (html_open_global) Ditto.
4621         (html_close_global) Ditto.
4622         (html_preopen_driver) Ditto.
4623         (html_postopen_driver) Ditto.
4624         (html_close_driver) Ditto.
4625         (html_option) Ditto.
4626         (html_open_page) Ditto.
4627         (html_close_page) Ditto.
4628         (html_submit) Ditto.
4629
4630         * inpt-pgm.c: (input_program_source_read) Ditto.
4631
4632         * output.c: (find_defn_value) Ditto.
4633         (destroy_list) Ditto.
4634
4635         * pfm-read.c: (read_int) Ditto.
4636
4637         * postscript.c: (ps_open_global) Ditto.
4638         (ps_close_global) Ditto.
4639         (ps_font_sizes) Ditto.
4640         (ps_preopen_driver) Ditto.
4641         (ps_postopen_driver) Ditto.
4642         (ps_close_driver) Ditto.
4643         (ps_option) Ditto.
4644         (ps_open_page) Ditto.
4645         (ps_close_page) Ditto.
4646         (ps_line_horz) Ditto.
4647         (ps_line_vert) Ditto.
4648         (ps_line_intersection) Ditto.
4649         (ps_box) Ditto.
4650         (ps_polyline_begin) Ditto.
4651         (ps_polyline_point) Ditto.
4652         (ps_polyline_end) Ditto.
4653         (ps_text_set_font_by_name) Ditto.
4654         (ps_text_set_font_by_position) Ditto.
4655         (ps_text_set_font_family) Ditto.
4656         (ps_text_get_font_name) Ditto.
4657         (ps_text_get_font_family) Ditto.
4658         (ps_text_set_size) Ditto.
4659         (ps_text_get_size) Ditto.
4660         (ps_text_metrics) Ditto.
4661         (ps_text_draw) Ditto.
4662
4663         * q2c.c: (finish_up) Ditto.
4664         (xmalloc) Ditto.
4665         (xstrdup) Ditto.
4666         (get_buffer) Ditto.
4667         (st_lower) Ditto.
4668         (st_upper) Ditto.
4669         (skip_ws) Ditto.
4670         (get_line) Ditto.
4671         (add_symbol) Ditto.
4672         (find_symbol) Ditto.
4673         (lex_get) Ditto.
4674         (force_id) Ditto.
4675         (force_string) Ditto.
4676         (match_id) Ditto.
4677         (match_token) Ditto.
4678         (skip_token) Ditto.
4679         (parse) Ditto.
4680         (parse_setting) Ditto.
4681         (parse_specifier) Ditto.
4682         (parse_specifiers) Ditto.
4683         (parse_subcommand) Ditto.
4684         (dump_specifier_vars) Ditto.
4685         (is_keyword) Ditto.
4686         (make_identifier) Ditto.
4687         (dump_declarations) Ditto.
4688         (dump_specifier_init) Ditto.
4689         (dump_vars_init) Ditto.
4690         (make_match) Ditto.
4691         (dump_specifier_parse) Ditto.
4692         (dump_subcommand) Ditto.
4693         (dump_parser) Ditto.
4694         (dump_header) Ditto.
4695         (dump_free) Ditto.
4696         (recognize_directive) Ditto.
4697
4698         * recode.c: (string_to_long) Ditto.
4699
4700         * repeat.c: (find_DO_REPEAT_substitution) Ditto.
4701
4702         * repeat.h: New header for perform_DO_REPEAT_substitutions, used
4703         where appropriate.
4704
4705         * sort.c: (sort_stream_read) Ditto.
4706         (sort_stream_mode) Ditto.
4707         
4708 Fri Dec 19 23:35:04 2003  Ben Pfaff  <blp@gnu.org>
4709
4710         * algorithm.c (binary_search): Fix comparison.
4711
4712 Fri Dec 19 23:27:45 2003  Ben Pfaff  <blp@gnu.org>
4713
4714         * algorithm.c: (binary_search) Fix assertion.
4715
4716 Fri Dec 19 21:31:48 2003  Ben Pfaff  <blp@gnu.org>
4717
4718         * sysfile-info.c: (compare_vectors_by_name) Rewrite.
4719
4720 Fri Dec 19 21:30:24 2003  Ben Pfaff  <blp@gnu.org>
4721
4722         * sort.c: (compare_case_lists) Rewrite.
4723
4724 Fri Dec 19 16:44:22 2003  Ben Pfaff  <blp@gnu.org>
4725
4726         * quicksort.c: Removed (not used).
4727
4728         * quicksort.h: Removed (not used).
4729
4730         * sort.c: Removed blp_quicksort() prototype.
4731
4732 Fri Dec 19 16:42:13 2003  Ben Pfaff  <blp@gnu.org>
4733
4734         * postscript.c: (int_2_compare) Rewrite.
4735         (compare_line) Rewrite.
4736
4737 Fri Dec 19 16:38:35 2003  Ben Pfaff  <blp@gnu.org>
4738
4739         * matrix-data.c (compare_factors) Use lexicographical_compare()
4740         algorithm.
4741         (compare_doubles) New function.
4742         
4743         * algorithm.c: (lexicographical_compare) New algorithm.
4744
4745 Fri Dec 19 16:23:45 2003  Ben Pfaff  <blp@gnu.org>
4746
4747         * matrix-data.c (compare_variables_by_mxd_vartype): Rewrite.
4748
4749 Fri Dec 19 15:54:45 2003  Ben Pfaff  <blp@gnu.org>
4750
4751         * expr-prs.c: (cmp_func) Removed.
4752         (parse_function) Use binary_search() algorithm.
4753         (compare_functions) New function.
4754         (init_func_tab) Use sort() algorithm.
4755
4756         * algorithm.c: (binary_search) New algorithm.
4757
4758 Fri Dec 19 15:50:45 2003  Ben Pfaff  <blp@gnu.org>
4759
4760         * descript.q: (display) Use sort() algorithm instead of qsort().
4761         (compare_func) Removed.
4762         (descriptives_compare_variables) New function.
4763
4764 Fri Dec 19 15:08:38 2003  Ben Pfaff  <blp@gnu.org>
4765
4766         Get rid of AVL trees.  Hashes are more appropriate for everything
4767         PSPP does.
4768
4769         * Makefile.am: (pspp_SOURCES) Remove avl.c, avl.h.
4770         
4771         * avl.c: Removed.
4772
4773         * avl.h: Removed.
4774
4775 Fri Dec 19 14:33:31 2003  Ben Pfaff  <blp@gnu.org>
4776
4777         Much code can be clarified by using C++ STL-like algorithms.  Not
4778         all uses of these algorithms are listed below, only the ones where
4779         the change to an algorithm was the only change of interest.
4780         
4781         * Makefile.am: (pspp_SOURCES) Add algorithm.c, algorithm.h.
4782         
4783         * algorithm.c: New file.
4784
4785         * algorithm.h: New file.
4786
4787         * modify-vars.c: (static var forward) Removed.
4788         (static var positional) Removed.
4789         (compare_variables) Removed.
4790         (struct ordering) New.
4791         (cmd_modify_vars) Use sort() algorithm.
4792         (compare_variables_given_ordering) New function.
4793         (rearrange_dict) Use sort() algorithm.
4794
4795         * sysfile-info.c: (cmd_display) Use sort() algorithm.
4796         (cmp_var_by_name) Removed.
4797
4798 Fri Dec 19 14:26:17 2003  Ben Pfaff  <blp@gnu.org>
4799
4800         Make file handles use a hash table.
4801         
4802         * file-handle.q: (files) Change to hash table, make static.
4803         (cmd_file_handle) Use hash table functions.
4804         (fh_get_handle_by_filename) Ditto.
4805         (fh_get_handle_by_name) Ditto.
4806         (hash_file_handle) New function.
4807         (cmp_file_handle) Rewrite.
4808         (fh_init_files) Use hash table functions.
4809
4810 Fri Dec 19 14:24:38 2003  Ben Pfaff  <blp@gnu.org>
4811
4812         Clean up FREQUENCIES.
4813         
4814         * Makefile.am: (pspp_SOURCES) Remove frequencies.g.
4815
4816         * frequencies.q: Remove a lot of old #if'd out code at the end.
4817         (internal_cmd_frequencies) Use calc() instead of calc_no_weight()
4818         or calc_weight().  Initialize percentile_values.
4819         (calc) New function based on calc_weight() from frequencies.g.
4820         (precalc) Use hash functions.
4821         (static var comparison_func) Removed.
4822         (static var comparison_param) Removed.
4823         (comparison_helper) Removed.
4824         (get_freq_comparator) New function.
4825         (not_missing) New function.
4826         (add_freq) Removed.
4827         (postprocess_freq_tab) Use hash table functions, algorithms,
4828         get_freq_comparator().  Rewrite.
4829         (cleanup_freq_tab) Rephrase.
4830         (add_percentile) Clean up spacing.
4831         (hash_value_numeric) New function.
4832         (hash_value_alpha) New function.
4833         (compare_value_numeric_a) Rewrite.
4834         (compare_value_alpha_a) Rewrite.
4835         (compare_value_numeric_d) Rewrite.
4836         (compare_value_alpha_d) Rewrite.
4837         (compare_freq_numeric_a) Rewrite.
4838         (compare_freq_alpha_a) Rewrite.
4839         (compare_freq_numeric_d) Rewrite.
4840         (compare_freq_alpha_d) Rewrite.
4841         (calc_stats) Clean up mode, percentiles, max.
4842         (dump_statistics) Clean up spacing.
4843         
4844         * frequencies.g: Removed.
4845
4846         * var.h: (struct freq_tab) Change `data' to hash table.
4847
4848 Fri Dec 19 14:15:46 2003  Ben Pfaff  <blp@gnu.org>
4849
4850         * file-handle.h: Remove declaration of global variable `files',
4851         which wasn't used anywhere.
4852
4853         * postscript.c: (add_encoding) Remove superfluous cast.
4854         (line) Ditto.
4855
4856         * sfm-read.c: [linux] (bswap_int32) Drop ntohl() non-portable
4857         version.
4858
4859         * temporary.c: [0] (display_tree) Removed.
4860
4861 Fri Dec 19 14:13:04 2003  Ben Pfaff  <blp@gnu.org>
4862
4863         Implement a new random number generator based on the alleged RC4
4864         algorithm.
4865
4866         * expr-evl.c: (expr_evaluate) Use rng_get_double_normal() instead
4867         of rand_normal().
4868
4869         * random.c: [!HAVE_GOOD_RANDOM] (real_rand) Removed.
4870         [!HAVE_GOOD_RANDOM] (real_srand) Removed.
4871         (macro k) Removed.
4872         (static var V[]) Removed.
4873         (static var Y) Removed.
4874         (static var X2) Removed.
4875         (setup_randomize) Removed.
4876         (shuffle) Removed.
4877         (rand_uniform) Removed.
4878         (rand_normal) Removed.
4879         (struct rng) New structure.
4880         (rng_create) New function.
4881         (rng_destroy) New function.
4882         (swap_byte) New static function.
4883         (rng_seed) New function.
4884         (rng_get_bytes) New function.
4885         (rng_get_int) New function.
4886         (rng_get_unsigned) New function.
4887         (rng_get_double) New function.
4888         (rng_get_double_normal) New function.
4889         (pspp_rng) New function.
4890
4891         * random.h: Sync up to random.c.
4892
4893         * sample.c: (struct sample_trns) Make `frac' unsigned and a
4894         fraction of UINT_MAX, not 65536.
4895         (cmd_sample) Use rng_get_unsigned(), rng_get_double(), UINT_MAX
4896         fraction.
4897
4898         * vfm.c: (open_active_file) No need to call setup_randomize() any
4899         longer.
4900
4901 Fri Dec 19 12:05:56 2003  Ben Pfaff  <blp@gnu.org>
4902
4903         Change dictionary name indexes to use hash tables instead of AVL
4904         trees.
4905
4906         * crosstabs.q: (free_var_dict) Use hash tables.
4907         (crs_custom_tables) Ditto.
4908         (calc_general) Ditto.
4909         (compare_table_entry) Rewrite.
4910         (enum_var_values) Reorder parameters.  All references updated.
4911         Rewrite.
4912
4913         * get.c: (rename_variable) Use hash tables.
4914         (mtf_merge_dictionary) Ditto.
4915
4916         * glob.c: (init_glob) Use hash tables.
4917         (cmp_variable) Removed.
4918
4919         * means.q: (mns_custom_tables) Use hash tables.
4920
4921         * modify-vars.c: (rearrange_dict) Use hash tables.
4922
4923         * rename-vars.c: (cmd_rename_variables) Use hash tables.
4924
4925         * sfm-read.c: (read_header) Use hash tables.
4926         (read_variables) Ditto.
4927
4928         * temporary.c: (new_dictionary) Use hash tables.
4929         (save_dictionary) Ditto.
4930         (restore_dictionary) Ditto.
4931
4932         * var.h: (struct dictionary) Change AVL tree `var_by_name' into
4933         hash table `name_tab'.
4934
4935         * vars-atr.c: [DEBUGGING] (dump_one_var_node) Removed.
4936         [DEBUGGING] (dump_var_tree) Removed.
4937         (find_variable) Use hash tables.
4938         (find_dict_variable) Ditto.
4939         (common_init_stuff) Ditto.
4940         (rename_variable) Ditto.
4941         (clear_variable) Ditto.  Also, remove debug code.
4942         (dup_variable) Use hash tables.
4943
4944         * vars-prs.c: (fill_all_vars) Use hash tables.
4945         (is_dict_varname) Ditto.
4946         (parse_dict_variable) Ditto.
4947         
4948 Fri Dec 19 11:46:23 2003  Ben Pfaff  <blp@gnu.org>
4949
4950         Change value labels to use hash tables instead of AVL trees, and
4951         change value labels into an ADT.
4952
4953         * Makefile.am: (pspp_SOURCES) Add value-labels.c, value-labels.h.
4954         
4955         * value-labels.c: New file.
4956
4957         * value-labels.h: New file.
4958
4959         * apply-dict.c: (cmd_apply_dictionary) Use value label ADT.
4960         Get rid of a stupid use of goto.
4961
4962         * autorecode.c: (compare_alpha_value) Rewrite.
4963         (hash_alpha_value) Ditto.
4964         (compare_numeric_value) Rewrite.
4965         (hash_numeric_value) Ditto.
4966
4967         * frequencies.q: (dump_full) Use value label ADT.
4968
4969         * pfm-read.c: (read_value_label) Use value label ADT.
4970
4971         * pfm-write.c: (write_value_labels) Use value label ADT.
4972
4973         * sfm-read.c: (read_variables) Use value label ADT.
4974         (read_value_labels) Rewrite.
4975
4976         * sfm-write.c: (write_value_labels) Rewrite.
4977
4978         * sysfile-info.c: (cmd_sysfile_info) Use value label ADT.
4979         (display_variables) Ditto.
4980         (describe_variable) Ditto.
4981
4982         * t-test.q: (print_t_groups) Use value label ADT.
4983
4984         * temporary.c: (copy_variable) Use value label ADT.
4985         (free_dictionary) Ditto.
4986
4987         * val-labs.c: (verify_val_labs) Use value label ADT.
4988         (get_label) Ditto.
4989         (debug_print) Ditto.
4990         (val_lab_cmp) Removed.
4991         (inc_ref_count) Removed.
4992         (copy_value_labels) Removed.
4993
4994         * var.h: (struct value_label) Removed.
4995         (struct variable) Change AVL tree `val_lab' into hash table
4996         `val_labs'.
4997
4998         * vars-atr.c: (init_variable) Use value label ADT.
4999         (clear_variable) Ditto.
5000         (free_value_label) Removed.
5001         (free_val_lab) Removed.
5002         (get_val_lab) Removed.
5003         (compare_variables) New function.
5004         (hash_variable) New function.
5005
5006         * vfm.c: (dump_splits) Use value label ADT.
5007
5008 Fri Dec 19 11:18:11 2003  Ben Pfaff  <blp@gnu.org>
5009
5010         Add to the hash table interface.
5011
5012         * hash.c: (hsh_hash_bytes) Add assertion.
5013         (hsh_hash_string) Ditto.
5014         (hsh_clear) Ditto.
5015         (hsh_rehash) Ditto.
5016         (hsh_probe) Ditto.
5017         (hsh_create) Ditto.  Also make minimum `size'.
5018         (hsh_destroy) Rephrase.
5019         (sort_nulls_last) Removed.
5020         (not_null) New function.
5021         (hsh_data) Ditto.
5022         (comparison_helper) Ditto.
5023         (hsh_sort) Rewritten.
5024         (hsh_data_copy) New function.
5025         (hsh_sort_copy) Ditto.
5026         (hsh_insert) Ditto.
5027         (hsh_replace) Ditto.
5028         (hsh_hash_double) Ditto.
5029         (hsh_delete) Fix stupid bug.
5030         
5031 Thu Dec 18 12:27:03 WAST 2003 John Darrington <john@darrington.wattle.id.au>
5032         * added a calculation of the mode to FREQUENCIES
5033
5034 Wed Dec 17 12:53:01 WAST 2003 John Darrington <john@darrington.wattle.id.au>
5035
5036         * moved (un)defs of DEBUGGING to config.h
5037
5038 Mon Dec 15 21:35:59 2003  Ben Pfaff  <blp@gnu.org>
5039
5040         * groff-font.c: (add_kern) Fix indentation.
5041         (add_kern) Use & instead of % to take power-of-2 modulus.
5042         (font_get_kern_adjust) Likewise.
5043
5044 Fri Dec 12 23:54:37 2003  Ben Pfaff  <blp@gnu.org>
5045
5046         * autorecode.c: (recode) Replace stupid use of memcpy() by
5047         memberwise copy.
5048         (hash_alpha_value) Use hsh_hash_bytes().  Get rid of nasty casts.
5049         (hash_numeric_value) Ditto.
5050         (autorecode_proc_func) pool_strdup() was wrong here because the
5051         source string was not null-terminated.  Use new pool_strndup()
5052         instead.
5053
5054         * crosstabs.q: (enum_var_values) Remove superfluous and bizarre
5055         use of hsh_iterator_init().
5056
5057         * data-in.c: (parse_N) Initialize i->v->f.
5058
5059         * flip.c: (cmd_flip) Use memmove(), not memcpy(), to copy
5060         overlapping arrays.
5061
5062         * groff-font.c: Use power-of-2 hash table sizes, not prime.
5063         (groff_read_font) Don't call hsh_next_prime().  Don't call
5064         fclose(NULL).
5065         (static var hash) Remove `size_p', `max_used' members.
5066         (font_char_name_to_index) Don't call hsh_next_prime().  Use
5067         hsh_hash_string() instead of hashpjw(), & instead of %.
5068         (default_font) Don't call hsh_next_prime().
5069
5070         * pool.c: (pool_strndup) New function.
5071         (pool_strdup) Reimplement in terms of pool_strndup.
5072
5073         * postscript.c: (hash_font_entry) Use hsh_hash_string().  Get rid
5074         of nasty casts.
5075         (hash_ps_encoding) Use hsh_hash_string().
5076         (hash_ps_combo) Use hsh_hash_string(), hsh_hash_int().
5077         (hash_filename2font) Use hsh_hash_string().
5078
5079         * som.c: Add #include <stdlib.h>.
5080
5081         * tab.c: (tab_destroy) Don't set t->container after freeing `t'
5082         (by destroying its pool).
5083         
5084 Fri Dec 12 23:18:59 2003  Ben Pfaff  <blp@gnu.org>
5085
5086         Miscellaneous hash table code cleanup:
5087         
5088         * hash.h: (struct hsh_table) Moved into hash.c.
5089         (hsh_count) Ditto, and transformed into function.
5090         (hsh_compare_func) New typedef, used for defining otherwise-long
5091         function types here and in hash.c
5092         (hsh_hash_func) Ditto.
5093         (hsh_free_func) Ditto.
5094         
5095         * hash.c: (struct hsh_table) Renamed `n' to `used', `m' to `size',
5096         `table' to `entries'.  Removed `mp'.  All references updated.
5097         (hsh_clear) Don't shrink entries array; if the hash was this big
5098         once, it probably will be again.
5099         (hsh_rehash) Made static.
5100         (force_hsh_insert) Renamed hsh_force_insert.
5101         (force_hsh_find) Renamed hsh_force_find.
5102
5103         Made hash table sizes powers of 2, because that's fine with any
5104         reasonable hash function and because taking a power-of-2 modulus
5105         is faster than any other:
5106         
5107         (hsh_prime_tab) Removed;
5108         (hsh_next_prime) Ditto.
5109         (next_power_of_2) New function.
5110         (hsh_create) Use next_power_of_2.
5111         (hsh_rehash) Use & instead of %.
5112
5113         Cleaned up hsh_sort:
5114         
5115         (internal_comparison_fn) Removed.
5116         (sort_nulls_last) New function.
5117         (hsh_sort) Removed second parameter, switched to using the new
5118         quicksort() function from quicksort.h to avoid using nasty need
5119         for static variables with qsort().  All references updated.
5120
5121         Changed the hash functions offered, because there are better hash
5122         functions than the ones we had, and cleaned up the names to boot:
5123         
5124         * hash.c: (hashpjw_d) Removed.
5125         (hashpjw) Ditto.
5126         (hsh_hash_bytes) New function.
5127         (hsh_hash_string) New function.
5128         (hsh_hash_int) New function.
5129
5130         Improved the hash table iteration interface:
5131         
5132         * hash.h: (hsh_iterator_init) Removed.
5133         (struct hsh_iterator) Removed `init' member, change `next' to
5134         size_t.
5135
5136         * hash.c: (hsh_foreach) Removed.  All references updated to use
5137         hsh_first/hsh_next instead.
5138         (hsh_first) New function.  Notably, unlike hsh_foreach() it does
5139         not treat a null pointer as an empty hash table.
5140         (hsh_next) New function.
5141
5142         Made deletion possible, though slow:
5143
5144         * hash.c: (locate_matching_entry) New function.
5145         (hsh_find) Use locate_matching_entry().
5146         (hsh_delete) New function also using locate_matching_entry().
5147         (hsh_force_delete) New function.
5148
5149 Fri Dec 12 23:16:10 2003  Ben Pfaff  <blp@gnu.org>
5150
5151         * quicksort.c: New file implementing a sort routine with a
5152         interface better than qsort() because it passes a user-provided
5153         parameter to the sort routine.
5154
5155         * Makefile.am: Add quicksort.c, quicksort.h.
5156
5157 Fri Dec 12 13:31:58 2003  Ben Pfaff  <blp@gnu.org>
5158
5159         * All source files: Get rid of nasty special cases for Checker,
5160         which is pretty obsolete now.
5161
5162 Thu Dec 11 21:38:24 WST 2003 John Darrington <john@darrington.wattle.id.au>
5163
5164         * Fixed a bug apparent when using the FREQUENCIES command with the
5165         html driver.  The html driver was incorrectly trying to display 
5166         empty cells.
5167
5168 Sun Jan  2 21:40:13 2000  Ben Pfaff  <blp@gnu.org>
5169
5170         * Makefile.am: Reorganized.  Put locale dir in version.c instead
5171         of passing it to each compile command.  Only put local gmp libs in
5172         LD_ADD if not installed on system.  Remove `boast' target.
5173
5174         * All source files: struct and union typedefs eliminated.
5175         `sizeof type' replaced by `sizeof object' where practical.  Moved
5176         `unused' qualifiers from start to end of declarations for gcc
5177         2.7.2 compatibility.  Change `while (1)' to `for (;;)'.  Made
5178         assertions on pointers strictly compliant.  Removed _ prefixes on
5179         some function parameter names.
5180
5181         * alloc.c: New source file, containing these external linkage
5182         functions removed from common.c: xmalloc, xcalloc, xrealloc,
5183         xstrdup.
5184
5185         * arena.c: Removed.
5186         
5187         * arena.h: Removed.
5188
5189         * ascii.c: Migrated from arenas to pools.
5190         (struct ascii_driver_ext) ops[], box[], fonts[] changed from
5191         c_string to len_string.  All references changed.
5192         (ascii_option) Signature changed to comply to new output.c
5193         interface.
5194         (count_fancy_chars) Removed.
5195         (delineate) Removed support for rich text.
5196         (ascii_text_metrics) Ditto.
5197         (text_draw) Ditto.
5198         (output_shorts) Change `box', `off', `on' from c_string to
5199         len_string.  Change `remaining' from int to size_t.
5200         (ascii_close_page) Make page numbering less haphazard.
5201
5202         * autorecode.c: Migrate from arenas to pools.
5203
5204         * avl.c: Migrate from arenas to pools.  Synch from libavl 1.4.0.
5205
5206         * bitvector.h: New file containing these macros from misc.h:
5207         SET_BIT, CLEAR_BIT, SET_BIT_TO, TEST_BIT, BIT_INDEX.
5208
5209         * command.c: (struct command) cmd1, cmd2, cmd3 members changed to
5210         word[3].  ncmd removed.
5211         (var empty_string) Removed.
5212         (var cmd_table) Declaration updated.
5213         (var cmdtab) Removed.
5214         (cmp_command) Removed.
5215         (split_words) Rewritten to use strtok_r().
5216         (init_cmd_parser) Renamed cmd_init().  Rewritten.
5217         (find_command) Removed.
5218         (FILE_TYPE_okay) Rewritten.
5219         (cmd_parse) Rewritten.  Semantics of the return value of command
5220         handlers has changed: they must now return one of the new CMD_*
5221         enumerals, rather than a magic value.  This meant that all
5222         commands had to be modified, and they were.
5223         (figure_out_command) New function.
5224
5225         * command.def: Add CORRELATIONS, PEARSON CORRELATIONS.  Add
5226         #defines for INIT, INPU, etc.
5227
5228         * command.h: New CMD_* enum series.
5229         (cur_proc) Make const char *, not char *.
5230         (cmd_init) Prototype.
5231         (cmd_parse) Ditto.
5232
5233         * common.c: Removed.
5234
5235         * common.h: Removed.
5236
5237         * correlations.q: New file.
5238
5239         * crosstabs.q: Migrate from arenas to pools.  Migrate to new-style
5240         q2c.
5241         (custom_tables) Renamed crs_custom_tables().
5242         (custom_variables) Renamed crs_custom_variables().
5243         (calc_integer) Add in some `const' qualifiers.
5244         (table_value_missing) Change from a_string to len_string.
5245         (float_M_suffix) Change from a_string to len_string.
5246
5247         * data-in.c: Rewritten.  All references to
5248         parse_string_as_format() changed to data_in().
5249
5250         * data-in.h: New file.
5251
5252         * data-list.c: Change DLS_* from #define's to enums.  Move from
5253         rpd_msg() to tmsg().
5254         (RPD_ERR) New #define.
5255         (do_reading) Change dfm_push_cust() to dfm_push(), pop_cust() to
5256         dfm_pop().
5257         (read_from_data_list_fixed) Change from old
5258         parse_string_as_format() to new data_in().
5259         (read_from_data_list_free) Ditto.
5260         (read_from_data_list_list) Ditto.
5261         (cmd_repeating_data) Modify approach to checking for end of
5262         command.
5263         (rpd_msg) Removed.
5264         (rpd_parse_record) Change from old parse_string_as_format() to new
5265         data_in().  Change from old convert_format_to_string() to new
5266         data_out().
5267         (read_one_set_of_repetitions) Change dfm_push_cust() to
5268         dfm_push(), pop_cust() to dfm_pop().
5269
5270         * data-out.c: Rewritten.  All references to
5271         convert_format_to_string() changed to data_out().
5272
5273         * descript.q: Migrate to new q2c.
5274         (cmd_descriptives) Removed.
5275         (internal_cmd_descriptives) Renamed cmd_descriptives ().
5276         (custom_variables) Renamed dsc_custom_variables().
5277
5278         * dfm.c: (struct dfm_fhuser_ext) `ln' removed.  All references
5279         removed.
5280         (open_file_r) Initialize h->where.line_number.  Migrate to new
5281         struct string.
5282         (open_file_w) Initialize h->where.line_number.
5283         (read_record) Change from ext->ln to h->where.line_number.
5284         Migrate to struct string.
5285         (dfm_put_record) Rephrased.
5286         (dfm_push_cust) Renamed dfm_push(), rewritten.
5287         (dfm_pop) New function.
5288
5289         * error.c: All references updated.
5290         (glob var error_count) Renamed err_err_count.
5291         (glob var warning_count) Renamed err_warning_count.
5292         (glob var error_already_flagged) Renamed err_already_flagged.
5293         (glob var verbosity) Renamed err_verbosity.
5294         (glob var cust_fn) Removed.
5295         (glob var cust_ln) Removed.
5296         (static var file_loc) New.
5297         (static var nfile_loc) New.
5298         (static var mfile_loc) New.
5299         (tmsg) New function.
5300         (push_cust) Removed.
5301         (pop_cust) Removed.
5302         (msg) Rewritten.
5303         (static var terminating) Removed.
5304         (failure) Renamed err_failure().
5305         (hcf) Renamed err_hcf().
5306         (err_push_file_locator) New function.
5307         (err_pop_file_locator) New function.
5308         (err_location) New function.
5309         (check_error_count) Renamed err_check_count().
5310         (vmsg) Renamed err_vmsg().  Interface changed.
5311         (verbose_msg) Removed.
5312         (err_cond_fail) New function.
5313         (error_break) Renamed err_break().
5314
5315         * error.h: All references updated.
5316         (enum MSG_CLASS_COUNT) Renamed ERR_CLASS_COUNT.
5317         (enum ERR_CLASS_MASK, ERR_VERBOSITY_SHIFT, ERR_VERBOSITY_MASK)
5318         New.
5319         (struct file_locator) New.
5320         (struct error) New.
5321         (macro verbose_msg) Removed.
5322         (macro cond_fail) Removed.
5323
5324         * expr-opt.c: (evaluate_tree) sizeof(char) == 1.
5325
5326         * expr-prs.c: Reorganized.  All references updated.
5327         (exprtypename) Renamed expr_type_name().
5328         (typename) Renamed type_name().
5329         (free_expression) Renamed expr_free().
5330         (parse_expression) Renamed expr_parse().  Uses new type_check()
5331         function.
5332         (init_functab) Renamed init_func_tab().
5333         (type_check) New function.
5334         (parse_or) Rewritten to use new allocate_nonterminal() and
5335         append_nonterminal_arg() functions.
5336         (parse_and) Ditto.
5337         (parse_not) Ditto.
5338         (parse_rel) Ditto.  Also simplified logic.
5339         (parse_add) Ditto.
5340         (parse_mul) Ditto.
5341         (parse_neg) Ditto.
5342         (parse_exp) Ditto.
5343         (SYSMIS_func) Ditto.
5344         (VALUE_func) Rephrased.
5345         (CONCAT_func) Fix memory leak by replacing free by free_node on
5346         lossage.
5347         (generic_str_func) Ditto.
5348         (parse_function) Ditto.  Also rephrasings.  Uses bsearch() to find
5349         function.
5350         (allocate_nonterminal) New function.
5351         (append_nonterminal_arg) New function.
5352         (static func_tab[]) Now at file level.
5353         (cmp_func) Moved.
5354         (init_func_tab) Moved.  Now just uses qsort() to sort func_tab[].
5355
5356         * expr.h: (enum series OP_*) Moved to exprP.h.
5357         (OP_* defines) Ditto.
5358         (struct op_desc) Ditto.
5359         (global ops[]) Ditto.
5360         (struct num_con_node) Ditto.
5361         (struct str_con_node) Ditto.
5362         (struct var_node) Ditto.
5363         (struct lag_node) Ditto.
5364         (struct casenum_node) Ditto.
5365         (struct nonterm_node) Ditto.
5366         (union any_node) Members renamed.
5367         (struct sys_node) Removed.
5368         (struct val_node) Removed.
5369         (operator typedef) Removed.
5370         (typedef exprtype) Removed.
5371         (enum series EX_*) Moved to exprP.h.
5372         (struct expression) Ditto.  Also renamed a lot of the members.
5373         (PXP_* defines) Changed to enums.
5374         (free_node prototype) Moved to exprP.h.
5375
5376         * file-handle.h: (struct file_handle) New member `where'.
5377
5378         * file-handle.q: Migrated to new q2c format.
5379         (prepend_current_directory) Removed (dead code).
5380         (cmd_file_handle) Incorporated all of internal_cmd_file_handle().
5381         (fh_get_handle_by_filename) Removed dead code.
5382         Set new `where' member.
5383
5384         * file-type.c: (file_type_source_read) References to
5385         parse_string_as_format() changed to data_in().
5386         dfm_push_cust()/pop_cust() changed to dfm_push()/dfm_pop().
5387
5388         * filename.c: All references updated.
5389         (init_filename) Renamed fn_init().
5390         (expand_line) Removed.
5391         (macro EXPAND_LINE) Removed.
5392         (interp_vars) Renamed fn_interp_vars().  Now uses st_*() instead
5393         of custom functions.
5394         (gnu_getcwd) Renamed fn_get_cwd(), rewritten.
5395         (tilde_expand) Renamed fn_tilde_expand(), uses ds_*().
5396         (normalize_filename) Renamed fn_normalize().
5397         (search_path) Renamed fn_search_path(), rewritten.
5398         (prepend_dir) Renamed fn_prepend_dir().
5399         (blp_getenv) Renamed fn_getenv().
5400         (blp_dirname) Renamed fn_dirname().
5401         (fn_basename) New function, not used.
5402         (absolute_filename_p) Renamed fn_absolute_p().
5403         (is_special_filename) Renamed fn_special_p().
5404         (file_exists) Renamed fn_exists_p().
5405         (readlink_malloc) Renamed fn_readlink().
5406         (getenv_default) Renamed fn_getenv_default().
5407         (open_file) Renamed fn_open().
5408         (close_file) Renamed fn_close().
5409         (open_file_ext) Renamed fn_open_ext().
5410         (close_file_ext) Renamed fn_close_ext().
5411
5412         * font.h: Migrate from arenas to pools.
5413
5414         * format.c: (parse_format_specifier_name) Deal with ds_* strings.
5415
5416         * frequencies.g: Migrate from arenas to pools.
5417
5418         * frequencies.q: Migrate to new q2c version.  Migrate from arenas
5419         to pools.
5420
5421         * getline.c: All references updated.
5422         (global getl_buf) Changed from char * to struct string.
5423         (static getl_include_path) Ditto.
5424         (global getl_buf_len) Removed.
5425         (global getl_buf_size) Removed.
5426         (getl_include_path) Deal with new getl_buf, getl_include_path.
5427         (getl_uninitialize) New function.
5428         (getl_get_current_directory) Rewritten.
5429         (getl_clear_include_path) Rewritten.
5430         (getl_add_include_dir) Rewritten.
5431         (getl_add_file) Assertion fixed.
5432         (getl_add_virtual_file) Change initial value of `remaining_loops'
5433         from 2 to 1.
5434         (welcome) Rewritten.
5435         (handle_line_buffer) Make static.  Change logic to make
5436         getl_add_virtual_file() change sensible.  Use ds_*() strings.
5437         (getl_read_line) Use ds_*() strings.  Implement SET ECHO.
5438         (getl_close_file) Moved.
5439         (getl_location) New function.
5440
5441         * getline.h: All references updated.
5442         (macro curln) Removed.
5443         (macro curfn) Removed.
5444         (macro am_interactive) Renamed getl_am_interactive.
5445         (macro am_reading_script) Renamed getl_reading_script.
5446
5447         * glob.c: (global fmt_parse_ignore_error) Removed.
5448         (init_glob) Use locale_dir not LOCALEDIR.  Use feholdexcept() on
5449         systems that support it (C99).  Turn off SET ECHO by default.  No
5450         necessary julcal initialization anymore.
5451
5452         * groff-font.c: Migrate from arenas to pools.
5453         (groff_read_font) Use err_push_file_locator().
5454         (groff_read_DESC) Ditto.
5455         (font_msg) Use tmsg().
5456
5457         * hash.c: (hsh_sort) Fix debug code.
5458         [GLOBAL_DEBUGGING] Include stdio.h.
5459
5460         * hash.h: (macro force_hsh_insert) Rephrase.
5461
5462         * heap.c: Rewritten.
5463         
5464         * heap.h: Rewritten.
5465
5466         * html.c: (html_option) Change from outp_value to struct string.
5467         (postopen) Change from curfn to getl_location().
5468         (escape_string) Remove rich-text code.  Signature changed.
5469         (output_tab_table) Switch from a_string to struct len_string.
5470         Remove rich text support.
5471
5472         * lexer.c: All references updated.  Largely rewritten.  Major
5473         changes listed below.  Removed tagged quote support.  Adapted to
5474         struct string tokstr.
5475         (global tokstr) Changed to struct string.
5476         (global tokstr_size) Removed.
5477         (global tokstr_len) Removed.
5478         (global tokid) New.
5479         (global tokint) Removed.
5480         (global toklongstr) Removed.
5481         (C* defines) Removed.
5482         (static tbl[]) Removed.
5483         (static id[]) Removed.
5484         (static une[]) Removed.
5485         (discard_line) Renamed lex_discard_line().
5486         (get_entire_line) Renamed lex_entire_line().
5487         (get_rest_of_line) Renamed lex_rest_of_line().
5488         (get_dotted_rest_of_line) Merged into lex_rest_of_line().
5489         (make_hexit) Removed.
5490         (syntax_error) Renamed lex_error().  Return value removed.
5491         (get_token_representation) Renamed lex_token_representation().
5492         (putback) Renamed lex_put_back().
5493         (putfwd) Renamed lex_put_forward().
5494         (convert_negative_to_dash) Renamed lex_negative_to_dash().
5495         (set_prog) Renamed lex_set_prog().
5496         (init_lex) Renamed lex_init().
5497         (reset_eof) Renamed lex_reset_eof().
5498         (lookahead) Renamed lex_look_ahead().
5499         (check_id) Rewritten.
5500         (yylex) Renamed lex_get(), rewritten.
5501         (lex_end_of_command) New function.  Many commands were rephrased
5502         using this.
5503         (lex_integer_p) New function.  Replaces compare of tokint against
5504         NOT_LONG.
5505         (lex_integer) New function.  Replaces tokint.
5506         (match_tok) Renamed lex_match().
5507         (match_id) Renamed lex_match_id().
5508         (match_int) Renamed lex_match_int().
5509         (force_match_id) Renamed lex_force_match_id(), added return value.
5510         (force_match) Renamed lex_force_match(), added return value.
5511         (force_string) Renamed lex_force_string(), added return value.
5512         (force_int) Renamed lex_force_int(), added return value.
5513         (lex_id_match_len) New function.
5514         (id_match) Renamed lex_id_match(), rewritten.
5515         (get_line) Renamed lex_get_line().
5516         (preprocess_line) Renamed lex_preprocess_line().
5517         (tokname) Renamed lex_token_name().
5518         (bin_value_func) Removed.
5519         (oct_value_func) Removed.
5520         (hex_value_func) Removed.
5521         (unexpected_eof) New function.
5522         (convert_numeric_string_to_char_string) New function.
5523         (parse_string) Rewritten, signature changed.
5524         (add_tokstr_char) Removed.
5525         (add_tokstr_unsigned) Removed.
5526         (add_tokstr_string) Removed.
5527         (parse_tagged_quote) Removed.
5528         (skip_comment) Renamed lex_skip_comment().
5529
5530         * lexer.h: All references updated.
5531         (macro is_id1) Renamed CHAR_IS_ID1.
5532         (macro is_idn) Renamed CHAR_IS_IDN.
5533         (token names ID, NUM, STRING, STOP, ... WITH, EXP) Renamed with
5534         prefix T_: T_ID, T_NUM, T_STRING, T_STOP, ... T_WITH, T_EXP.
5535         (macro get_token) Removed.
5536         (macro id_match) Removed.
5537         (macro force_match_id) Removed.
5538         (macro force_match) Removed.
5539         (macro force_string) Removed.
5540         (macro force_int) Removed.
5541         (macro force_num) Removed.
5542         (macro force_id) Removed.
5543
5544         * lexerP.h: Removed.
5545
5546         * list.q: Migrated to new q2c format.
5547         (write_line) Deal with struct len_string.
5548         (write_varname) Ditto.
5549         (write_fallback_headers) Ditto.
5550
5551         * magic.c: New file, incorporating the following global variables
5552         previously in other files: endian, second_lowest_value.  And both
5553         of those are conditional on #define's.
5554
5555         * magic.h: New file, incorporating the following global variable
5556         declarations: endian, second_lowest_value, and the following macro
5557         declarations: NOT_DOUBLE, NOT_LONG, NOT_INT.
5558
5559         * main.c: Added declarations of pgmname, finished, curdate,
5560         start_interactive.
5561         (main) Call new parse_script() function.
5562         (parse_script) New function.
5563         (execute_command) New function.
5564         (dump_token) Removed.
5565         (handle_error) New function.
5566
5567         * matrix.c: New file.
5568
5569         * matrix.h: New file.
5570
5571         * matrix-data.c: Migrated from arenas to pools.
5572         (mget_token) Change from parse_string_as_format() to data_in().
5573
5574         * means.q: Migrate to new q2c.
5575         (custom_tables) Renamed mns_custom_tables().
5576         (custom_crossbreak) Renamed mns_custom_crossbreak().
5577         (custom_variables) Renamed mns_custom_variables().
5578
5579         * mis-val.c: (static var width) Changed from `int' to `size_t'.
5580         (parse_varnames) Prototype.
5581         (parse_numeric) Rephrasings.
5582         (parse_alpha) Adapt to new struct string tokstr.
5583
5584         * misc.c: (intlog10) Rewritten.
5585         (spacing) Removed.
5586         (ansi_rand) Renamed real_rand(), moved into random.c.
5587         (ansi_srand) Renamed real_srand(), moved into random.c.
5588         (setup_randomize) Moved to random.c.
5589         (rand_uniform) Ditto.
5590         (rand_normal) Ditto.
5591         (rand_simple) Ditto.
5592         (get_config_line) Removed.
5593         (reverse) Removed (dead code).
5594
5595         * misc.h: (macro SET_BIT) Moved to bitvector.h.
5596         (macro CLEAR_BIT) Ditto.
5597         (macro TEST_BIT) Ditto.
5598         (macro SET_BIT_TO) Ditto.
5599         (macro BIT_INDEX) Ditto.
5600
5601         * output.c: (outp_read_devices) Move to err_push_file_locator()
5602         from push_cust().  Use struct string.
5603         (expand_op_tokstr) Removed.
5604         (static var op_tokstr) Changed to struct string.
5605         (static var op_tokstr_size) Removed.
5606         (tokener) Rephrasings.  Use struct string.
5607         (parse_options) Use struct string.
5608         (destroy_driver) Fix assertion.
5609         (outp_get_paper_size) Move to err_push_file_locator().
5610         [0] Removed dead code.
5611         (outp_string_width) Move to len_string.
5612
5613         * output.h: Comment fixes.
5614         (TAG_* enum series) Removed.
5615         (struct outp_value) Removed.
5616         (enum OUTP_T_FANCY) Removed.
5617         (struct outp_text) `s' changed from a_string to len_string.
5618         (struct outp_class) `option' change arg 3 from outp_value to
5619         struct string.
5620
5621         * pfm-read.c: (corrupt_msg) Rewritten.
5622
5623         * pfm-write.c: (bufwrite) Fix assertion.
5624
5625         * pool.c: New file, reference version.
5626
5627         * pool.h: New file, reference version.
5628
5629         * postscript.c: (ps_font_sizes) Fix assertion.
5630         (ps_option) Change arg 3 from outp_value to struct string.
5631         Adapt to struct string.
5632         (macro output_line) Removed.
5633         (macro add_string) Removed.
5634         (output_encodings) Adapted to struct string.  Moved to
5635         err_push_file_locator().
5636         (find_encoding_file) Fix assertion.
5637         (read_ps_encodings) Move to err_push_file_locator().
5638         (postopen) Use getl_location() instead of curfn.
5639         (out_text_plain) Move to len_string.
5640         (text) Ditto.  Remove rich text support.
5641
5642         * print.c: (cmd_print) Remove now-unneeded resource cleanup code.
5643         (cmd_print_eject) Ditto.
5644         (cmd_write) Ditto.
5645         (internal_cmd_print) Now cleans up after itself.  Uses
5646         fh_parse_file_handle() now.
5647         (cmd_print_space) Use PXP_NUMERIC to type-check.
5648
5649         * q2c.c: Overhauled.  Removed _("") i18n support.  All references
5650         updated.  All output functions updated to handle structures rather
5651         than local or static variables.  Adapt to new PSPP lex_*()
5652         functions.
5653         (macro _) Removed.
5654         (macro N_) Removed.
5655         (macro MAX_N_SBC) Removed.
5656         (global bare) Removed.
5657         (enum STRING) Renamed T_STRING.
5658         (enum ID) Renamed T_ID.
5659         (get_buffer) Buffer size increased.
5660         (strlower) Renamed st_lower(), rephrased.
5661         (strupper) Renamed st_upper(), rephrased.
5662         (skip_ws) New function.
5663         (get_line) Don't special-case any types of lines (like those
5664         beginning with ! or $, for instance).
5665         (get_token) Renamed lex_get().  Rephrased.
5666         (static var `prefix') New.
5667         (parse) New function.
5668         (parse_setting) Minor rephrasing.
5669         (dump_specifier_vars) Ditto.
5670         (make_identifier) Put null terminator on identifier, duh.
5671         (dump_vars) Renamed dump_declarations().  Never indent.  Never
5672         static.  Output changed entirely.
5673         (dump_specifier_init) Rephrase.
5674         (dump_vars_init) No index variable needed.  Other modifications.
5675         (dump_parser) Don't parse command name.  Do dump functions instead
5676         of just code fragments.
5677         (dump_free) Dump function instead of code fragment.
5678         (recognize_directive) New function.
5679         (main) Use recognize_directive().  Don't rely on magic $ line
5680         beginning: instead, parse comments.  Update list of headers.
5681
5682         * random.c: New file, containing the following functions:
5683         real_rand(), real_srand(), setup_randomize, shuffle, rand_uniform,
5684         rand_normal, rand_simple.
5685
5686         * random.h: New file.
5687
5688         * recode.c: (cmd_recode) Merge internal_cmd_recode() into this
5689         function.  `max_src_width', `max_dst_width' changed to size_t.
5690         (internal_cmd_recode) Removed.
5691         (parse_dest_spec) Merge similar cases.
5692         (parse_src_spec) Add assertion.
5693
5694         * repeat.c: (recognize_keyword) New function.
5695         (internal_cmd_do_repeat) Parse and handle PRINT keyword on END
5696         REPEAT.  Improve recognition of END REPEAT (use
5697         recognize_keyword()).  Move from curfn to getl_location().  Use
5698         struct string.
5699                 
5700         (perform_DO_REPEAT_substitutions) Adapt to struct string.
5701
5702         * set.q: Adapt to new q2c.
5703         (cmd_set) Range-check some values better.
5704         (custom_blanks) Renamed stc_custom_blanks().
5705         (custom_length) Renamed stc_custom_length().
5706         (custom_results) Renamed stc_custom_results().
5707         (custom_seed) Renamed stc_custom_seed().
5708         (custom_width) Renamed stc_custom_width().
5709         (custom_format) Renamed stc_custom_format().
5710         (custom_journal) Renamed stc_custom_journal().
5711         (custom_color) Renamed stc_custom_color().
5712         (custom_listing) Renamed stc_custom_listing().
5713         (custom_disk) Renamed stc_custom_disk().
5714         (custom_log) Renamed stc_custom_log().
5715         (custom_rcolor) Renamed stc_custom_rcolor().
5716         (custom_viewlength) Renamed stc_custom_viewlength().
5717         (custom_workdev) Renamed stc_custom_workdev().
5718
5719         * settings.h: Not necessary to include format.h any longer.
5720
5721         * sfm-read.h: (macro bswap_int32) Moved here from sfmP.h.
5722         (corrupt_msg) Rewritten.
5723
5724         * sort.c: Adapt to rewritten heap ADT.
5725
5726         * str.c: (aa_strcpy) Removed.
5727         (ab_strcpy) Removed.
5728         (ac_strcpy) Removed.
5729         (ba_strcpy) Removed.
5730         (bb_strcpy) Removed.
5731         (ca_strcpy) Removed.
5732         (aa_strdup) Removed.
5733         (aa_strdupcpy) Removed.
5734         (ba_strdup) Removed.
5735         (sa_strdup) Removed.
5736         (memrev) Renamed mm_reverse().
5737         (memrmem) Renamed mm_find_reverse().
5738         (cmp_str) Renamed st_compare_pad().
5739         (strmaxcpy) Removed.
5740         (strbarepadcpy) Renamed st_bare_pad_copy(), signature changed.
5741         (strbarepadlencpy) Renamed st_bare_pad_len_copy(), signature
5742         changed.
5743         (strpadcpy) Renamed st_pad_copy(), signature changed.
5744         (blpstrset) Removed.
5745         (ds_create) New function.
5746         (ds_init) New function.
5747         (ds_replace) New function.
5748         (ds_destroy) New function.
5749         (ds_clear) New function.
5750         (ds_extend) New function.
5751         (ds_shrink) New function.
5752         (ds_truncate) New function.
5753         (ds_length) New function.
5754         (ds_size) New function.
5755         (ds_value) New function.
5756         (ds_end) New function.
5757         (ds_concat) New function.
5758         (ds_concat_buffer) New function.
5759         (ds_printf) New function.
5760         (ds_putchar) New function.
5761         (ds_getline) New function.
5762         (ds_get_config_line) New function derived from the old
5763         misc.c:get_config_line().
5764         (ls_create) New function.
5765         (ls_create_buffer) New function.
5766         (ls_init) New function.
5767         (ls_shallow_copy) New function.
5768         (ls_destroy) New function.
5769         (ls_null) New function.
5770         (ls_null_p) New function.
5771         (ls_empty_p) New function.
5772         (ls_length) New function.
5773         (ls_value) New function.
5774         (ls_end) New function.
5775
5776         * str.h: Reformatted.
5777         (struct a_string) Removed.
5778         (struct b_string) Removed.
5779         (struct c_string) Removed.
5780         (struct len_string) New.
5781         (struct string) New.
5782         (macro as_streq) Removed.
5783         (macro bs_streq) Removed.
5784         (macro cs_streq) Removed.
5785         (macro sa_streq) Removed.
5786         (macro sb_streq) Removed.
5787         [__GNUC__] (inline function ds_putchar) New function.
5788         [__GNUC__] (inline function ds_length) New function.
5789         [__GNUC__] (inline function ds_value) New function.
5790         [__GNUC__] (inline function ds_end) New function.
5791
5792         * sysfile-info.c: (cmd_sysfile_info) Rephrased.
5793         (display_vectors) Fix missing i18n.
5794
5795         * t-test.q: Migrate to new q2c.
5796
5797         * tab.c: Migrate from arenas to pools.
5798         (tab_create) Use struct len_string.
5799         (tab_realloc) Ditto.
5800         (text_format) Ditto.
5801         (tab_joint_text) Ditto.
5802         (tab_natural_width) Remove rich text support.
5803         (tab_natural_height) Ditto.
5804         (tab_output_text) Handle TAT_FIX.
5805         (tab_raw) Change arg from a_string to len_string.
5806         (tabi_driver) Fix assertion.  Use struct len_string.
5807         (render_strip) Use struct len_string.  Remove rich text support.
5808         Add `const' qualifiers.
5809
5810         * tab.h: (enum TAB_RICH) Remove.
5811         (enums TAB_COL_NONE, TAB_COL_DONE) New.  Where appropriate,
5812         SOM_COL_* updated to read TAB_COL_*.
5813         (struct tab_table) Change arena to pool.  Change a_string to
5814         len_string.
5815
5816         * temporary.c: (restore_dictionary) Rewrite Checker code.
5817
5818         * var.h: (macros MAX_SHORT_STRING, MIN_LONG_STRING, SYSMIS,
5819         LOWEST, HIGHEST) Moved here from common.h.
5820         (typedef any_trns) Removed.  All references changed to `struct
5821         trns_header'.
5822
5823         * vars-atr.c: (force_create_variable) Fix assertion.
5824         (force_dup_variable) Fix assertion.
5825         
5826 Thu Jun  3 18:40:42 1999  Ben Pfaff  <blp@gnu.org>
5827
5828         Using alphanumeric variables in functions under AGGREGATE
5829         segfaulted.  Fixed.  Thanks to Dr. Dirk Melcher
5830         <BZN-mdksh@t-online.de> for reporting this bug.
5831         
5832         * aggregate.c: (parse_aggregate_functions) When setting the
5833         FSTRING bit, also allocate memory for the `string' member of
5834         agr_next.
5835         (free_aggregate_functions) Free iter->string.  Don't use the
5836         non-function bits when indexing the array of functions.
5837         [DEBUGGING] (debug_print) Don't use the non-function bits when
5838         indexing the array of functions.        
5839
5840 Sun May 30 00:00:54 1999  Ben Pfaff  <blp@gnu.org>
5841
5842         Under certain circumstances, the final case would be omitted from
5843         the results of an AGGREGATE operation.  Fixed.  Thanks to Dr. Dirk
5844         Melcher <BZN-mdksh@t-online.de> for reporting this bug.
5845         
5846         * aggregate.c (agr_00x_end_func): Increment number of cases in
5847         sink before writing case.  For streams that keep track of how many
5848         cases there are based on this value, this means that the last case
5849         will be read in on the next stream read.
5850
5851 Sat May 29 22:03:31 1999  Ben Pfaff  <blp@gnu.org>
5852
5853         Undefined behavior was invoked by referencing a freed pointer.
5854         
5855         * vfm.c (memory_stream_write): Free pointer *after* checking for
5856         non-null status.
5857
5858 Sat May 29 22:02:22 1999  Ben Pfaff  <blp@gnu.org>
5859
5860         A wrong record size was displayed when paging the active file to
5861         disk.
5862         
5863         * vfm.c: (memory_stream_write) Fix off-by-one error.
5864
5865 Sat May 29 21:50:26 1999  Ben Pfaff  <blp@gnu.org>
5866
5867         Not having enough temporary space for sorting caused a core dump.
5868         Fixed.
5869         
5870         * sort.c: (allocate_cases) Initialize i.
5871
5872 Sat May 29 21:40:54 1999  Ben Pfaff  <blp@gnu.org>
5873
5874         Syntax errors in function descriptions on AGGREGATE caused core
5875         dumps.  Fixed.
5876         
5877         * aggregate.c (cmd_aggregate): Don't free agr_dict after calling
5878         free_aggregate_functions(), since that function already frees
5879         agr_dict.
5880         
5881 Sat May 29 21:06:10 1999  Ben Pfaff  <blp@gnu.org>
5882
5883         A null pointer was dereferenced, causing a core dump, when
5884         PERCENTILES was specified on FREQUENCIES.  This fixes the problem,
5885         but PSPP still doesn't calculate percentiles.  Thanks to Regnor
5886         Jernsletten <rjernsle@eunet.no> for reporting this problem.
5887         
5888         * arena.c: (arena_malloc) If the arena hasn't been initialized
5889         already, initialize it.
5890
5891 Sat May 29 20:47:29 1999  Ben Pfaff  <blp@gnu.org>
5892
5893         * Makefile.cygwin: New file supplied by Hankin <hankin@dunno.com>
5894         for compilation with Cygnus Windows B20.  Not used by other
5895         systems.
5896
5897 Sat May 29 20:36:04 1999  Ben Pfaff  <blp@gnu.org>
5898
5899         SORT always sorted in ascending order.  Fixed.  Thanks to Dr. Dirk
5900         Melcher <BZN-mdksh@t-online.de> for reporting this bug.
5901
5902         * sort.c: (compare_case_lists) Reverse sense of comparison if
5903         sorting in descending order.
5904         (compare_record) Ditto.
5905
5906 Tue Mar  9 13:18:54 1999  Ben Pfaff  <blp@gnu.org>
5907
5908         SPLIT FILE with a string variable caused a core dump.  Fixed.
5909
5910         * vfm.c: If the variable is a string then make a temporary value
5911         struct pointing to it.  The underlying problem is a lot bigger
5912         than this (see TODO) but this is a stopgap for the simple case at
5913         least.
5914         
5915 Tue Mar  9 13:15:53 1999  Ben Pfaff  <blp@gnu.org>
5916
5917         Nested INCLUDEs didn't work.  Fixed.
5918
5919         * getline.c: (getl_include) Set first_line to NULL in allocated
5920         structure.
5921
5922 Tue Mar  9 13:13:46 1999  Ben Pfaff  <blp@gnu.org>
5923
5924         The MATCH FILES procedure set the values of variables not present
5925         to 0.  It should have been SYSMIS.  This is now fixed.
5926
5927         * get.c: (mtf_delete_file_in_place) Replace 0.0 by SYSMIS.
5928
5929 Tue Mar  9 12:52:23 1999  Ben Pfaff  <blp@gnu.org>
5930
5931         The REMARK command was too aggressive about skipping lines.  It
5932         didn't like being the last command in a file.
5933
5934         * command.c: (cmd_remark) Call get_entire_line() instead of
5935         get_line().
5936
5937 Tue Mar  9 12:48:05 1999  Ben Pfaff  <blp@gnu.org>
5938
5939         Comment parsing wasn't consistent with the rest of the code in its
5940         idea of where one command ends and another starts.  This meant
5941         that sometimes commands would be mysteriously ignored.  Thanks to
5942         Dr. Dirk Melcher <BZN-mdksh@t-online.de> for reporting this bug.
5943          
5944         * command.c: (parse_cmd) Hand off comment parsing to new function
5945         skip_comment() in lexer.c.
5946         * lexer.c: (skip_comment) New function.
5947
5948 Wed Jan 20 20:22:07 1999  Ben Pfaff  <blp@gnu.org>
5949
5950         The TABLE subcommand on MATCH FILES worked only erratically at
5951         best.  This fixes it.  Thanks to Dr. Dirk Melcher
5952         <BZN-mdksh@t-online.de> for reporting this bug.
5953
5954         * get.c: (mtf_compare_BY_values) When comparing string values, a
5955         difference of 1 is still a difference :-)
5956         (mtf_processing) Inverted TABLE reading logic fixed.  Also don't
5957         advance TABLE files automatically when matched.  Comment fixes.
5958
5959 Tue Jan 19 22:32:31 1999  Ben Pfaff  <blp@gnu.org>
5960
5961         VARIABLE LABELS rejected a slash before the first variable
5962         specification, contradicting the documentation.  Thanks to Walter
5963         M. Gray <graywm@northernc.on.ca> for reporting this bug.
5964
5965         * var-labs.c: (cmd_variable_labels) Ignore a leading slash in
5966         command specification.
5967
5968 Tue Jan 19 22:29:54 1999  Ben Pfaff  <blp@gnu.org>
5969
5970         Because of an incorrect optimization in memory allocation,
5971         CROSSTABS sometimes segfaulted when asked to output multiple
5972         tables.  Thanks to Walter M. Gray <graywm@northernc.on.ca> for
5973         reporting this bug.
5974
5975         * crosstabs.q: (postcalc) New variables maxcols, maxcells, which
5976         are passed to output_pivot_table() for its use.
5977         (output_pivot_table) Instead of assuming the number of columns is
5978         constant, keep track with maxcols.  In general mode, use maxcells
5979         to determine whether more matrix cells need to be allocated.    
5980
5981 Tue Jan 19 22:27:46 1999  Ben Pfaff  <blp@gnu.org>
5982
5983         CROSSTABS didn't display value labels for column and row
5984         variables.  Thanks to Walter M. Gray <graywm@northernc.on.ca> for
5985         reporting this bug.
5986
5987         * crosstabs.q: (table_value_missing) If the specified value has a
5988         value label for this variable, then show it instead of the raw
5989         value.
5990         (display_dimensions) Delegate display of value_labels to
5991         table_value_missing.
5992
5993 Mon Jan 18 20:04:06 1999  Ben Pfaff  <blp@gnu.org>
5994
5995         WRITE didn't write line ends.  Fixed.  Thanks to Dr. Dirk Melcher
5996         <BZN-mdksh@t-online.de> for reporting this bug.
5997
5998         * print.c: (print_trns_proc) Write (CR/)LF if PRINT is used _or_
5999         if the file isn't declared as binary.
6000
6001 Mon Jan 18 19:56:45 1999  Ben Pfaff  <blp@gnu.org>
6002
6003         MATCH FILES corrupted memory and dumped core on some syntax
6004         errors.  Fixed.
6005
6006         * get.c: (cmd_match_files) Set file->handle to NULL before
6007         jumping to lossage.
6008         (mtf_free_file) Don't free a null dictionary.   
6009
6010 Mon Jan 18 19:27:57 1999  Ben Pfaff  <blp@gnu.org>
6011
6012         MATCH FILES should set numeric values not available to the
6013         system-missing value, not to 0.  Thanks to Dr. Dirk Melcher
6014         <BZN-mdksh@t-online.de> for reporting this bug.
6015
6016         * get.c: (mtf_processing) Set unused records to system-missing,
6017         not 0.
6018
6019 Mon Jan 18 15:06:46 1999  Ben Pfaff  <blp@gnu.org>
6020
6021         KEEP didn't work properly on the SAVE procedure.  Fixed.  Thanks
6022         to Ralf Geschke <ralf@kuerbis.org> for reporting this bug.
6023
6024         * temporary.c: (save_dictionary) Initialize var_by_name AVL tree
6025         in newly created dictionary, and add each copied variable to the
6026         tree.
6027  
6028 Mon Jan 18 15:04:48 1999  Ben Pfaff  <blp@gnu.org>
6029
6030         Memory leak fix.
6031         
6032         * get.c: (trim_dictionary) Free variable list for KEEP after
6033         finishing with it.
6034
6035 Mon Jan 18 12:57:36 1999  Ben Pfaff  <blp@gnu.org>
6036
6037         Some systems didn't like the way open_file was coded.  Thanks to
6038         Hankin <hankin@rogue.consultco.com> for pointing this out.
6039
6040         * filename.c: (open_file) Don't try to store stdin, stdout,
6041         stderr as part of an array, because that doesn't always work.
6042
6043 Mon Jan 18 12:53:27 1999  Ben Pfaff  <blp@gnu.org>
6044
6045         The SAVE procedure didn't save long string variables properly.
6046         Fixed by this patch.  Thanks to Hankin
6047         <hankin@rogue.consultco.com> for this patch.
6048         
6049         * sfm-write.c: (write_variable) Fix off-by-one error in writing
6050         out variable pad records.
6051
6052 Tue Jan  5 14:29:27 1999  Ben Pfaff  <blp@gnu.org>
6053
6054         Previously, if PRINT SPACE were given a negative argument, it
6055         would report an error, then spin in an (almost) infinite loop.
6056         This fixes that behavior.
6057
6058         * print.c: (print_space_trns_proc) After reporting a negative
6059         argument, set number of lines to print to 1.
6060
6061 Tue Jan  5 13:59:55 1999  Ben Pfaff  <blp@gnu.org>
6062
6063         SPSS 8.0 outputs some new record types in its system files, and it
6064         allows longer value labels.  Accept these system files.
6065
6066         * sfm-read.c: (sfm_read_dictionary) Ignore record type 7 subtype
6067         11 emitted by SPSS 8.0.
6068         
6069 Tue Jan  5 13:55:50 1999  Ben Pfaff  <blp@gnu.org>
6070
6071         The LIST procedure was too conservative in allocating space for
6072         buffers, which caused a bug that only showed up with very long
6073         output variables.  Thanks to Hankin <hankin@dunno.com> for this
6074         bug report.
6075
6076         * list.q: (determine_layout) Allocate 1022 bytes instead of 256.
6077
6078 Tue Jan  5 13:34:34 1999  Ben Pfaff  <blp@gnu.org>
6079
6080         Typo meant string format specifiers weren't checked properly.  I
6081         think that Hankin <hankin@dunno.com> sent me this report, but I'm
6082         willing to be corrected on this point.
6083  
6084         * format.c: (check_string_specifier) Fix obvious typo.  
6085
6086 Tue Jan  5 12:50:42 1999  Ben Pfaff  <blp@gnu.org>
6087
6088         Using $CASENUM in an expression didn't work.  Here's a fix.
6089         Thanks to Dirk Melcher <BZN-mdksh@t-online.de> for reporting this
6090         bug.
6091          
6092         * expr-evl.c: (evaluate_expression) Add OP_CASENUM case.
6093
6094         * expr-opt.c: (dump_node) OP_CASENUM is acceptable.
6095
6096 Tue Jan  5 12:47:48 1999  Ben Pfaff  <blp@gnu.org>
6097
6098         The changes in 0.2.1 to fix DATA LIST FREE parsing broke some
6099         other behavior, *sigh*.  This patch hopefully fixes that.  This
6100         time I've actually tested it.
6101
6102         Thanks to Hankin <hankin@dunno.com> for reporting this bug.
6103
6104         * data-list.c: (read_from_data_list_free,
6105         read_from_data_list_list) Call parse_string_as_format() directly
6106         without mucking around with the field width.
6107
6108 Tue Jan  5 12:31:19 1999  Ben Pfaff  <blp@gnu.org>
6109
6110         Occasionally, you may encounter a script that wants to be
6111         interpreted in interactive mode.  Make -i emulate this behavior to
6112         allow such scripts to be executed with PSPP.
6113
6114         Thanks to Hankin <hankin@dunno.com> for reporting this behavior.
6115
6116         * cmdline.c: (pre_syntax_message[]) Update -i description.
6117
6118         * lexer.c: (preprocess_line) When getl_interactive is 2 (i.e.,
6119         when -i is given on the command line) don't treat unindented lines
6120         as starting a new command.
6121
6122 Tue Jan  5 12:30:10 1999  Ben Pfaff  <blp@gnu.org>
6123
6124         In conjunction with egcs 1.1.1, Checker emits some bogus warnings,
6125         mostly caused by local initialized aggregates.  After egcs is
6126         fixed upstream these can be removed, but for now they're not a big
6127         deal.
6128         
6129         * ascii.c: (ascii_postopen_driver) Checker chokes on local
6130         initialized arrays.  Avoid this.
6131
6132         * sfm-write.c: (sfm_write_dictionary) Don't use a local
6133         initialized struct.
6134
6135 Tue Jan  5 12:07:24 1999  Ben Pfaff  <blp@gnu.org>
6136
6137         egcs 1.1.1 has some new warnings relative to gcc 2.8.1, which the
6138         following changes avoid.  Currently I compile sources with egcs
6139         1.1.1 and gcc 2.7.2.3 before sending them out.
6140
6141         * apply-dict.c: (apply_dict) Use new avl_traverser_init() macro.
6142         
6143         * ascii.c: (option_tab[]) Initialize all struct members.
6144
6145         * avl.h: (avl_traverser_init) New macro.
6146         
6147         * command.c: (DEFCMD, UNIMPL macros, cmd_table[]) Initialize all
6148         struct members.
6149
6150         * crosstabs.q: (enum_var_values) Use new hsh_iterator_init()
6151         macro.
6152
6153         * hash.c: Comment fix.
6154
6155         * hash.h: (hsh_iterator_init) New macro.
6156
6157         * html.c: (option_tab[]) Initialize all struct members.
6158
6159         * pfm-write.c: (write_value_labels) Use new avl_traverser_init()
6160         macro.
6161
6162         * postscript.c: (option_tab[]) Initialize all struct members.
6163         (output_encodings, preclose, dump_lines) Use new
6164         hsh_iterator_init() macro.
6165
6166         * sfm-write.c: (write_value_labels) Use new avl_traverser_init()
6167         macro.
6168
6169         * sysfile-info.c: (describe_variable) Use new avl_traverser_init()
6170         macro.
6171
6172 Thu Nov 19 12:32:45 1998  Ben Pfaff  <blp@gnu.org>
6173
6174         * data-in.c: Examined each of the parsing functions to make sure
6175         that they wouldn't dump core if they were passed a string of the
6176         wrong length, since now the DATA LIST FREE/LIST routines don't
6177         check for field width before passing it to the data parser.
6178         (parse_RBHEX, parse_AHEX) Reject odd length input.
6179         (parse_string_as_format) Reject input that's too short or too
6180         long.
6181
6182         * data-list.c: Before, the DATA LIST FREE/LIST routines would pad
6183         a field to its entire declared output width then pass it to the
6184         data-in parsing routines.  This contradicted the documented
6185         behavior.  This is fixed in these changes.  Thanks to Mark H. Wood
6186         <mwood@IUPUI.Edu>.  In addition, this fixes a few more details of
6187         free-format parsing that differed from SPSS.
6188         (cut_field) Commas and spaces are treated identically.  Returns
6189         the proper column instead of a fixed 1 value.
6190         (parse_field) Removed.
6191         (read_from_data_list_free, read_from_data_list_list) Call
6192         parse_string_as_format directly instead of parse_field.
6193
6194         * heap.c: (heap_delete) Stylistic fixes.
6195
6196 Sun Aug  9 11:12:13 1998  Ben Pfaff  <blp@gnu.org>
6197
6198         * loop.c: (loop_2_trns_proc) Formatting fix.
6199
6200         * sel-if.c: (cmd_filter) Set FILTER_before_TEMPORARY.
6201
6202         * var.h: (glob var FILTER_before_TEMPORARY) New global var.
6203
6204         * vfm.c: (macro FILTERED) New.
6205         (static var filter_var) New.
6206         (process_active_file_write_case) Use FILTERED.
6207         (setup_filter) Set filter_var.
6208         (close_active_file) Delete the filter if not
6209         FILTER_before_TEMPORARY.
6210         (procedure_write_case) Use FILTERED.
6211
6212 Sat Aug  8 00:20:14 1998  Ben Pfaff  <blp@gnu.org>
6213
6214         * crosstabs.q: Changed /PIVOT={ON,OFF} to /FORMAT={PIVOT,NOPIVOT}.
6215
6216         * data-in.c: (parse_day_count) Message fix.
6217         (parse_month) Style fix.
6218
6219         * data-list.c: (struct data_list_pgm) New member eof.
6220         (cmd_data_list) Init eof to 0.
6221         (do_reading) Implement the /END subcommand and read-past-eof
6222         checking.
6223
6224         * do-if.c: Include stdio.h when debugging.
6225         (cmd_else_if) Make sure the command is .-terminated.
6226
6227         * glob.c: (init_glob) Capitalize the command prompt.
6228
6229         * inpt-pgm.c: (end_case_trns_proc) Debugging message.
6230         (end_file_trns_proc) Debugging message.
6231
6232         * loop.c: (internal_cmd_loop) Make it work when there's no loop
6233         index!
6234         (loop_2_trns_proc) Enable MXLOOPS (why was this disabled?)
6235
6236         * main.c: (dump_token) Make kwtab[] const.
6237
6238         * set.q: Spelling, comment fixes.
6239
6240         * sysfile-info.c: (cmd_display) DISPLAY VECTORS not DISPLAY
6241         VECTOR.
6242
6243         * vars-prs.c: (fill_all_vars) Style fix.
6244
6245         * vfm.c: (index_to_varname) Return const.
6246
6247 Tue Aug  4 23:49:23 1998  Ben Pfaff  <blp@gnu.org>
6248
6249         * Changes in many source files for partial -ansi -pedantic and
6250         no-debugging compliance: Remove trailing common in enum
6251         declarations; add `unused' attributes; insert some appropriate
6252         casts.
6253
6254         * cmdline.c: (parse_command_line) Add new --testing-mode flag.
6255
6256         * command.c: (shell) Make static.
6257         (run_command) Make static.
6258
6259         * data-list.c: (dump_fixed_table) Remove use of local_strdup().
6260
6261         * dfm.c: (cmd_begin_data) I18n fix.
6262
6263         * error.c: (verbose_msg) Define if __STRICT_ANSI__.
6264
6265         * error.h: (macro verbose_msg) Define if __STRICT_ANSI__.
6266
6267         * expr-opt.c: (evaluate_tree) Don't initialize local arrays if
6268         __STRICT_ANSI__.
6269
6270         * file-handle.q: Don't prepend the source file directory name to
6271         the data file name.  (Ongoing issue.)
6272         (prepend_current_directory) Comment out.
6273         (internal_cmd_file_handle) Don't call prepend_current_directory().
6274         (fh_get_handle_by_filename) Ditto.
6275
6276         * filename.c: Append zero byte to readlink() return value.
6277
6278         * getline.c: (getl_read_line) I18n fix.
6279
6280         * lexer.h: Don't use gcc features if __STRICT_ANSI__.
6281
6282         * misc.h: Don't use gcc features if __STRICT_ANSI__.
6283
6284         * pfm-write.c: (bufwrite) Don't try to increment a void * pointer
6285         directly.
6286
6287         * postscript.c: (output_encodings) Don't use local_strdup().
6288         (postopen) Ditto.
6289
6290         * print.c: Don't use gcc features if __STRICT_ANSI__.
6291
6292         * q2c.c: (dump_vars) Don't put a , at the end of the last enum.
6293
6294         * recode.c: (parse_src_spec) Fully brace nested if's.
6295
6296         * set.q: (global var set_testing_mode) New var.
6297
6298 Wed Jul 29 22:01:44 1998  Ben Pfaff  <blp@gnu.org>
6299
6300         * ascii.c: Add some more `unused' attributes that only come into
6301         play when NDEBUG is defined.
6302         (ascii_close_page) Set s_len when reallocating s.
6303         
6304         * crosstabs.q: (delete_missing) New function.
6305         (output_pivot_table) Call delete_missing() if /MISSING=REPORT.
6306         (make_summary_table) Create summary table reallocable.
6307
6308         * postscript.c: Add more `unused' attributes as above.
6309
6310         * tab.c: (tab_create) [GLOBAL_DEBUGGING] Set reallocable member.
6311         (tab_realloc) [GLOBAL_DEBUGGING] Assert that table is reallocable.
6312          
6313         * tab.h: (struct tab_table) [GLOBAL_DEBUGGING] New `reallocable'
6314         member.
6315
6316         * var.h: (macro force_dup_variable) [!GLOBAL_DEBUGGING] Remove
6317         gratuitous space between parameter definition.
6318
6319         * vars-atr.c: Changed some assert(0)'s to abort()'s to prevent
6320         complaints about running off the end of functions with NDEBUG
6321         enabled.
6322
6323 Sun Jul  5 00:17:25 1998  Ben Pfaff  <blp@gnu.org>
6324
6325         * Several source files: Removed some PORTME notes when reflection
6326         revealed that ANSI forbids that sort of breakage.  Also, added
6327         lots of `unused' qualifiers here and there.
6328
6329         * aggregate.c: (accumulate_aggregate_info) Remove local var
6330         weighting that turned out not to be used.
6331
6332         * avl.c: Update to version 1.1.0.  Add unused specifier.
6333         (avl_destroy) Initialize ab to 0.  Comment fixes.  Cast return
6334         value to void *.
6335         (avl_probe) Replace some instances of 1 with +1 where appropriate.
6336         (avl_find) Cast return value to void *.
6337         (avl_delete) q doesn't need to be initialized at the beginning of
6338         the function.  Replace some instances of 1 with +1.
6339         (force_avl_delete) Renamed avl_force_delete, all references changed.
6340         (compare_ints) `param' marked unused.
6341         (print_int) `param' marked unused.
6342         (recurse_tree) Replace some instances of 1 with +1.
6343
6344         * avl.h: Update to version 1.1.0.  Only declares avl function
6345         types if not already declared.
6346         (AVL_MAX_HEIGHT) Only define if not already defined.
6347         (struct avl_node) New unused member char pad[2].
6348         [GLOBAL_DEBUGGING] Change conditionalization to NDEBUG instead.
6349         (force_avl_insert) Renamed avl_force_insert.
6350         (force_avl_delete) Renamed avl_force_delete.
6351
6352         * crosstabs.q: (struct table_entry) Put `freq' into a union with
6353         new member `data'.
6354         (struct crosstab) Add new member `ofs'.
6355         (glob var int_tab) Removed.
6356         (custom_tables) In integer mode, assign v[i] properly through the
6357         indirect var_dict.
6358         (custom_variables) Now p.crs.max == max + 1.
6359         [DEBUGGING] (debug_print) p.crs.min and p.crs.max are now ints.
6360         (precalc) Implement integer mode.
6361         (calc_integer) Implement integer mode.
6362         (compare_table_entry) Remove unused local variable `comparing'.
6363         (make_summary_table) Implement integer mode.
6364         (macro ns_rows) Implemented as static variable now.
6365         (several variables) Made static, from global.
6366         (output_pivot_table) Use table_value_missing() for column heads.
6367         Remove several unused local variables.  Implement integer mode
6368         table summing.  Count up ns_rows.
6369         (crosstabs_dim) Make columns wider when /MISSING=REPORT requested.
6370         (find_pivot_extent) Moved into find_pivot_extent_general; now just
6371         calls that function or find_pivot_extent_integer.
6372         (find_pivot_extent_integer) New function.
6373         (enum_var_values) Implemented for integer mode.
6374         (table_value_missing) New function.
6375         (display_dimensions) Call table_value_missing() for heads.
6376         (float_M_suffix) New function.
6377         (display_crosstabulation) Call table_value_missing() for row
6378         heads.  Handle missing values in /MISSING=REPORT mode.
6379         (calc_fisher) Remove unused var N.
6380         (calc_r) Remove unused var fact.
6381
6382         * data-list.c: (dump_fixed_table) Fix table dimensioning.
6383         (read_one_set_of_repetitions) Remove unused vars var_spec, column.
6384
6385         * data-out.c: (insert_commas) Remove unused var cp.
6386         (convert_CCx) Remove unused vars save_set_decimal,
6387         save_set_grouping.
6388
6389         * descript.q: (dump_z_table) Fix table dimensioning.
6390         (pre_calc) Remove unused var j.
6391         (display) Remove unused vars title, s.  Fix table dimensioning.
6392
6393         * expr-evl.c: Comment fixes.
6394
6395         * frequencies.q: (full_dim) New function.
6396         (dump_full) Fix table dimensioning.
6397         (condensed_dim) New function.
6398         (dump_condensed) Fix table dimensioning.
6399
6400         * get.c: (cmd_match_files) Remove unused var n_val.  Remove unused
6401         label winnage.
6402
6403         * html.c: (html_close_drive) Remove unused var i.
6404         (postopen) Remove unused vars title, curfn_len, cp.
6405         (preclose) Remove unused vars this, x.
6406
6407         * lexer.c: Comment fixes.
6408
6409         * matrix-data.c: (cmd_matrix_data) Remove unused var index.
6410
6411         * means.q: (custom_tables) Remove unused var m_dim.
6412
6413         * mis-val.c: Format fix.
6414
6415         * modify-vars.c: (cmd_modify_vars) Remove unused var new_dict.
6416
6417         * output.c: (outp_get_paper_size) Remove unused var cp.
6418
6419         * pfm-read.c: (read_float) Remove unused var save, unused label
6420         underflow.
6421         (read_variables) Remove unused vars cp, j.
6422         (read_value_label) Remove unused var j.
6423
6424         * pfm-write.c: (bufwrite) Remove unused var i.
6425
6426         * postscript.c: (ps_postopen_drive) Remove unused vars dev_info,
6427         fn.
6428         (output_encodings) Remove unused vars char_cp, n_output.
6429         (read_ps_encodings) Remove unused var ep.
6430         (postopen) Remove unused var title.
6431         (preclose) Remove unused var fp.
6432         (ps_open_page) Remove unused vars true, false, orientation,
6433         mirror_horz, mirror_vert, width, length.
6434         (ps_text_metrics) Remove unused var x.
6435
6436         * q2c.c: (find_symbol) Remove unused var y.
6437         (parse_setting) Remove unused parameter sbc, all references
6438         changed.
6439         (dump_parser) Remove unused var cp.
6440         (dump_free) Remove unused var i.
6441
6442         * set.q: (static vars args, n) Removed.
6443         (internal_cmd_gset) Removed.
6444
6445         * sfm-read.c: (sfm_read_dictionary) Removed unused var i.
6446         (read_machine_flt64_info) Removed unused var file_endian.
6447         (read_documents) Removed unused var i.
6448         (read_compressed_data) Removed unused parameter dict, all
6449         references changed.
6450
6451         * sfm-write.c: (bufwrite) Removed unused var i.
6452         (sfm_write_case) Removed unused var i.
6453
6454         * sort.c: (merge_once) Remove unused var t.
6455         (write_separate) #if 0 out as dead code.
6456
6457         * split-file.c: (cmd_split_file) Remove unused var i.
6458
6459         * sysfile-info.c: (sysfile_info_dim) New function.
6460         (cmd_sysfile_info) Fix table dimensioning.
6461         (variables_dim) New function.
6462         (display_variables) Fix table dimensioning.
6463         (describe_variable) Remove unused var prev_r.
6464
6465         * t-test.q: (z_postcalc) Removed.
6466         (pairs_calc) Remove unused var bad_weight.
6467         (postcalc) Remove unused vars dfn, dfd.
6468
6469         * tab.c: (tab_create) Set t->dim to NULL.
6470         (tab_dim) Make sure t->dim is NULL first.
6471         (tab_natural_width) Remove parameter `clamp'.
6472         (tab_value) Remove duplicate assertion for table.
6473         (tab_raw) New function.
6474         (nowrap_dim) New function.
6475         (wrap_dim) New function.
6476         (tab_output_text) Fix table dimensioning.
6477
6478         * tab.h: (tab_raw) New macro.
6479
6480         * val-labs.c: (get_label) Remove unused var type.
6481         (copy_value_labels) Remove unused var trav.
6482
6483         * var.h: (struct crosstab_proc) Completely changed.
6484
6485         * vars-prs.c: (parse_dict_variable) Remove unused var v.
6486
6487         * vfm.c: (open_active_file) Remove unused vars i, lp.
6488
6489         * weight.c: (weight_trns_proc) #if 0 out as dead code.
6490         
6491 Tue Jun  2 23:37:21 1998  Ben Pfaff  <blp@gnu.org>
6492
6493         * Makefile.am: Add apply-dict.c, flip.c.
6494
6495         * apply-dict.c: New file.
6496         
6497         * command.c: (struct command) Make cmd[] larger for CLEAR
6498         TRANSFORMATIONS command name.
6499         (parse_cmd) Make sure we're in a valid state before using it as an
6500         index.  Discard variables and reset state on invalid transitions.
6501         (cmd_clear_transformations) New function.
6502
6503         * command.def: Add APPLY DICTIONARY, CLEAR TRANSFORMATIONS, FLIP.
6504         Add unimplemented PRESERVE, RESTORE.
6505
6506         * file-handle.h: Include stddef.h.
6507
6508         * flip.c: New file.
6509         
6510         * pfm-read.c: (parse_value) Pad value label values with spaces,
6511         not nulls.
6512
6513         * sfm-read.c: (struct sfm_fhuser_ext) Add reference count.
6514         (sfm_close) Decrement reference count, make sure it's zero.
6515         (sfm_maybe_close) New function.
6516         (sfm_read_dictionary) Handle reference counts.
6517
6518         * vars-atr.c: (clear_default_dict) New function.
6519         (discard_variables) Use clear_default_dict().
6520
6521 Sun May 31 00:58:05 1998  Ben Pfaff  <blp@gnu.org>
6522
6523         * Makefile.am: Add pfm-write.c.
6524         (LDADD) Add the libgmp2 libraries.
6525
6526         * command.def: Define EXPORT.
6527
6528         * get.c: (cmd_export) New function.
6529         (export_write_case_func) New function.
6530
6531         * pfm-read.c: (static spss2ascii[]) Make it const.
6532
6533         * pfm-write.c: New file.
6534
6535         * sfm-write.c: Formatting, comment fixes.
6536
6537         * var.h: Comment fix.
6538
6539 Fri May 29 21:44:12 1998  Ben Pfaff  <blp@gnu.org>
6540
6541         * Makefile.am: Add pfm.h, pfm-read.c.
6542
6543         * command.def: IMPORT is now implemented.
6544
6545         * format.c: (glob var translate_fmt[]) New var.
6546
6547         * get.c: (enum GTSV_NONE) Renamed GTSV_OPT_NONE.
6548         (cmd_import) New function.
6549         (import_source_read) New function.
6550         (glob var import_source) New var.
6551
6552         * pfm-read.c: New file.
6553
6554         * pfm.h: New file.
6555         
6556         * sfm-read.c: (parse_format_spec) Local variable translate_fmt[]
6557         moved in format.c.
6558         (dump_dictionary) Disabled printing a couple of items.
6559
6560 Mon May 25 12:42:37 1998  Ben Pfaff  <blp@gnu.org>
6561
6562         * crosstabs.q: (postcalc) Call make_summary_table().
6563         (make_summary_table) New function.
6564         (insert_summary) New function.
6565         (display_dimensions) Remove some unnecessary arguments, all
6566         references changed.
6567         (output_pivot_table) Fix lots of problems with the risk table
6568         setup.
6569         (submit) Don't display an empty table.
6570         (display_risk) Fix order of arguments to calc_risk().
6571
6572         * glob.c: Always include assert.h and stdlib.h.
6573
6574         * output.h: (enum OUTP_T_JUST_FULL) Removed, all references
6575         removed.
6576
6577         * tab.c: (tab_create) Cosmetic changes.
6578
6579         * tab.h: (enum TAB_JUSTIFY) Removed, all references removed.
6580
6581 Sun May 24 22:39:23 1998  Ben Pfaff  <blp@gnu.org>
6582
6583         * tab.def: Removed.
6584
6585         * crosstabs.q: (output_pivot_table) Headers drawing and submission
6586         code simplified, moved into new function submit().
6587         (submit) New function.
6588         (crosstabs_dim) New function.
6589         (display_directional) Substitute variable names for %s where
6590         appropriate.
6591         (somers_d_v[], somers_d_ase[], somers_d_t[]) New static vars.
6592         (calc_symmetric) Initialize parameters only if non-NULL.
6593         Calculate Somers' d.
6594         (calc_directional) Calculate Somers' d (or copy it, really).
6595         Calculate eta.
6596
6597         * output.c: (outp_string_width) New function.
6598
6599         * postscript.c: (postopen) Calculate font widths based on the
6600         width of the zero '0' character, not the width of the space
6601         character.  Set paper-width and paper-length based on points, not
6602         device units.
6603         (ps_open_page) Fix page setup string for landscape mode.
6604
6605         * som.h: (struct som_dimension) Removed.
6606         (struct som_table_class) height, width members take int * not
6607         som_dimesion * now.
6608
6609         * tab.c: Many functions now have added parameter validation.
6610         (tab_height, tab_width) These functions were removed and merged
6611         into a single function tab_resize(), and all references changed.
6612         (tab_dim) Rewritten since the interface changed; reduced from
6613         hundreds of lines to two.  All callers were changed.  Currently
6614         most of them just use tab_natural_dimensions as their callback and
6615         await detailed translation of functionality.
6616         (tab_natural_width) New function.
6617         (tab_natural_height) New function.
6618         (tab_natural_dimensions) New function.  This is a callback
6619         function, not something that you'd want to call directly.
6620         (tab_nat_dim) Removed.
6621         (tabi_table) Allocates t->w and t->h.
6622         (tabi_driver) Inlined sum_columns()'s functionality.  Calls the
6623         dimensions callback.
6624         (evaluate_dimensions) Removed.
6625         (sum_columns) Removed.
6626
6627         * tab.h: (enum TAL_1THIN) Removed.
6628         (enum series t_*) Removed.
6629         (struct tab_table) Members trh, trv changed to unsigned char *
6630         from int *.  Member dim changed to a function pointer from a
6631         unsigned char *.  Member max_stack_height removed.  New members
6632         hr_tot, vr_tot.
6633         (macros tab_l, tab_r, tab_t, tab_b) New.
6634
6635 Sat May 23 23:22:13 1998  Ben Pfaff  <blp@gnu.org>
6636
6637         * ascii.c: (delineate) Assign last_space_nchars before skipping
6638         spaces, to fix right justification.
6639
6640         * crosstabs.q: (static vars risk, direct) New vars.
6641         (static var pearson_r) Removed.
6642         (glob var chisq_fisher) Made static.
6643         (static vars row_tot[], col_tot[]) Don't include grand total
6644         anymore.
6645         (static var grand_total) Renamed W, all references changed.
6646         (output_pivot_table) Only make `table' if num_cells != 0.  Make
6647         risk and directional tables.  Deal with grand total no longer part
6648         of col_tot[].  Free rows and cols after we're done with them.
6649         (display_risk) New function.
6650         (display_directional) New function.
6651         (clac_r) Rewritten so that it stores all its results into its
6652         arguments, so it can be used for Spearman's correlation too.
6653         (calc_symmetric) Added a t[] argument, all references changed.
6654         Calculates ASEs for tau-b, tau-c, gamma.  Calculates Spearman's r,
6655         Pearson's r, Cohen's kappa.
6656         (calc_risk) New function.
6657         (calc_directional) New function.
6658
6659         * som.c: (som_submit) Improved debugging code.
6660
6661         * stats.c: (hypercube) New function.
6662         (cube) New function.
6663         (sqr) New function.
6664         (normal_sig) Went back to old implementation, which actually
6665         worked.
6666
6667         * stats.h: (macros square, cube, hypercube) Removed.  The
6668         equivalent functions in stats.c are inlined here; all references
6669         to square changed to sqr.
6670
6671 Fri May 22 00:03:41 1998  Ben Pfaff  <blp@gnu.org>
6672
6673         * crosstabs.q: (N_SYMMETRIC) New define.
6674         (postcalc) Disable debug printing.
6675         (static vars chisq_fisher, pearson_r) New.
6676         (output_pivot_table) Add support for symmetric measures.  Add
6677         chi-square output of exact sigs.
6678         (display_chisq) Rewritten.
6679         (display_symmetric) New function.
6680         (gamma_int) New function.
6681         (Pr) New function.
6682         (swap) New function.
6683         (calc_fisher) New function.
6684         (calc_chisq) Check boundary conditions better. Calculate Yates,
6685         Fisher, Mantel-Haenszel tests.
6686         (calc_r) New function.
6687         (calc_symmetric) New function.
6688
6689         * stats.c: (normal_sig) Rewritten with new algorithm.  Renamed
6690         from calc_normal.
6691         (chisq_sig) Better boundary conditions.  Renamed from
6692         calc_significance.
6693
6694         * tab.h: (struct tab_table) New member cf.
6695
6696         * tab.c: (tab_create) Set cf.
6697         (tab_width) New function.
6698         (tab_realloc) Handle cf.
6699         (tab_vline) Handle cf.
6700         (tab_hline) Handle cf.
6701         (tab_box) Handle cf.
6702         (tab_value) Handle cf.
6703         (tab_float) Handle cf.
6704         (tab_text) Handle cf.
6705         (tab_joint_text) Handle cf.
6706         (tab_offset) Handle cf.
6707         (tab_next_row) Handle cf.
6708         (evaluate_dimensions) Handle cf.
6709         (render_strip) Handle cf.
6710
6711 Wed May 20 00:03:59 1998  Ben Pfaff  <blp@gnu.org>
6712
6713         * crosstabs.q: (postcalc) New vars row_tot, col_tot, pass them to
6714         output_pivot_table().
6715         (output_pivot_table) Moved lots of local variables outside and
6716         made them static.  Add beginnings of chi-square statistic
6717         support.  Now column and row totals aren't in the main matrix.
6718         Always zero out any leftover rows & columns after we're done with
6719         the table entries.  Move all output stuff into
6720         display_dimensions(), display_crosstabs(), display_chisq().
6721         (display_dimensions) New function.
6722         (display_crosstabulation) New function.
6723         (display_chisq) New function.
6724         (calc_chisq) Implemented Pearson and likelihood-ratio chisquares.
6725
6726         * frequencies.q: (dump_full, dump_condensed) Remove tab_null()
6727         references, simplify logic.
6728
6729         * postscript.c: Remove scale, translate-x, translate-y,
6730         mirror-horz, mirror-vert, rotate-180 options.
6731         (struct ps_driver_ext) Remove scale, translate_x, translate_y.
6732         All references deleted.
6733         (macro YT) New macro.
6734         (array option_tab[]) Removed options.
6735         (ps_option) Removed options.
6736         (ps_open_page) Write page setup explicitly to output file, without
6737         using now-deleted BP function.
6738         (macro dump_line) Use YT().
6739         (macro dump_thick_line) Use YT().
6740         (draw_headers) Use YT().
6741         (switch_font) Reorder arguments to SF function.
6742         (write_text) Use YT().
6743
6744         * sfm-read.c: (sfm_read_case) Don't attempt to read variables that
6745         have get.fv == -1.
6746
6747         * sysfile-info.c: (describe_variables) Don't use tab_nulls().
6748
6749         * tab.c: (tab_create) Initialize t->ct to zeros.  Remove
6750         null-debugging code.
6751         (tab_realloc) Remove null-debugging code.  Initialize new regions
6752         of t->ct to zeros.
6753         (tab_vline) Support offsets.
6754         (tab_hline) Support offsets.
6755         (tab_box) Support offsets.
6756         (tab_null) Removed.
6757         (tab_nulls) Removed.
6758         (tab_row) Removed.
6759         (tab_col) Removed.
6760         (evaluate_dimensions) Remove null-debugging code.  Understand
6761         TAB_EMPTY attribute.  Assert that text.s.s is always non-NULL if
6762         TAB_EMPTY not present.
6763
6764         * tab.h: New cell attribute TAB_EMPTY.
6765         (macros tab_nr, tab_nc, tab_row, tab_col) New.
6766
6767         * vars-atr.c: (init_variable) Set get.fv to -1 so that GET doesn't
6768         try to read them from system files.
6769
6770         * vfm.c: (dump_splits) Don't call tab_null().   
6771
6772 Sat May 16 19:36:55 1998  Ben Pfaff  <blp@gnu.org>
6773
6774         * crosstabs.q: (struct crosstab) Added `missing' member.
6775         (custom_tables) Init missing.
6776         (calc_general) Handle missing values.
6777         (calc_chisq) New function.
6778         (output_pivot_table) Start work on chi-square output.  Update for
6779         new tab offset support functions.  Shorten statistic names.
6780
6781         * Several files: add in more `const's to placate gcc's warnings.
6782
6783         * tab.h: (struct tab_table) Add col_ofs, row_ofs members.  Comment
6784         fixes.
6785
6786         * tab.c: (tab_height, tab_realloc, tab_vline, tab_hline, tab_box,
6787         tab_null, tab_nulls, tab_value, tab_float, tab_text,
6788         tab_joint_text) Add col_ofs and row_ofs support.
6789         (tab_offset) New function.
6790         (tab_next_row) New function.
6791         (tab_row) New function.
6792         (tab_col) New function.
6793         (tabi_table) Add col_ofs and row_ofs support.
6794
6795         * vars-atr.c: (is_system_missing) New function.
6796
6797 Tue May 12 16:14:30 1998  Ben Pfaff  <blp@gnu.org>
6798
6799         * crosstabs.q: Expanded subcommand names RESID --> RESIDUAL, etc.
6800         (static var no_cells) Removed.
6801         (static var num_cells) New.
6802         (static var expected) New.
6803         (static var cells[]) New.
6804         (internal_cmd_crosstabs) Deal with new variables.
6805         (postcalc) Removed most of the meat and put it in new function
6806         output_pivot_table().
6807         (output_pivot_table) Calculates and outputs an entire pivot table.
6808
6809         * postscript.c: (postopen) Fix problems with free()ing addresses
6810         not obtained from malloc().
6811
6812         * som.c: (som_submit) Add assertion.
6813
6814         * sysfile-info.c: (describe_variable) Use new tab_nulls()
6815         function.
6816
6817         * tab.c: (static var tab_names[]) New.
6818         (tab_realloc) -1 for nc or nr indicates no change.
6819         (tab_nulls) New function.
6820         (tab_dim) Use tab_names[].
6821         (tabi_cumulate) Don't include bottom or right headers.  Furrfu.
6822         (evaluate_dimensions) Don't terminate on uninited cells, just put
6823         an X in them and emit a notice.  Use tab_names[].
6824
6825         * tab.h: Move bits into tab.def.
6826
6827         * tab.def: New.  Don't try to declare tab_table_class because then
6828         som.h has to be included.       
6829         
6830 Thu May  7 22:55:04 1998  Ben Pfaff  <blp@gnu.org>
6831
6832         * command.def: New file, contains all the command definitions
6833         previously included bodily in command.c.
6834
6835         * format.def: New file, contains all of the format definitions
6836         previously split across format.h, format.c, and sfm-write.c.
6837
6838         * lexer.h: Renamed from tokens.h in order to match corresponding
6839         .c file name.
6840
6841         * lexerP.h: Moved some rarely used functions exported by lexer.c
6842         into here.
6843
6844         * Makefile.am: Commemorate renamed files.
6845         (EXTRA_DIST) Add command.def, format.def.
6846
6847         * command.c: [0] (walk_cmdtable_func) Removed.
6848
6849         * crosstabs.q: (postcalc) Made it work and print out matrices
6850         proving it.
6851         (enum_column_values) Renamed enum_var_values, generalized for any
6852         variable.
6853
6854         * format.h: (struct fmt_desc) New member `spss'.
6855
6856         * q2c.c: (main) Generated code includes lexer.h instead of
6857         tokens.h.
6858
6859         * sfm-write.c: (write_format_spec) Use new spss member of fmt_spec
6860         instead of an independent translation table.
6861
6862 Tue May  5 13:19:03 1998  Ben Pfaff  <blp@gnu.org>
6863
6864         * Lots of source files: Added const to declarations.
6865
6866         * aggregate.c: (parse_aggregate_function) Rename inner i to j.
6867         
6868         * arena.c: (arena_clear) Set prev pointer to null when done.
6869
6870         * ascii.c: (ascii_option) Rename index as indx.
6871
6872         * avl.c: This is now a separate library called libavl.
6873         (xmalloc) Make static.
6874         (avl_probe) Step A7 can use the cache instead of an explicit
6875         compare.
6876         (avl_delete) Don't maintain a q pointer because it's always
6877         available in the pointer stack.  Comment fix.
6878
6879         * avl.h: This is now a separate library called libavl.
6880
6881         * command.c: (cmd_table[]) Remove spurious trailing "".
6882
6883         * common.h: Only include random() fix if this system needs it.
6884
6885         * crosstabs.q: Include alloca headers.
6886         (n_sorted_tab) New global var.
6887         (postcalc) Mostly rewritten.
6888         (find_pivot_extent) Rewritten.
6889         (enum_column_values) Rewritten.
6890
6891         * data-out.c: (convert_F) Rename inner n as n_spaces.
6892
6893         * error.c: (dump_message) Don't have an outer var i.
6894
6895         * file-handle.q: (static var f) Removed.  All references removed.
6896         (internal_cmd_file_handle) Uses a local variable instead of f.
6897
6898         * get.c: (trim_dictionary) Change scope of i, i1, i2.
6899         (cmd_match_files) Don't strcpy tokstr into sbc (why was this ever
6900         done?)
6901
6902         * getline.h: Declare getl_history as extern.  Reported by
6903         palme@uni-wuppertal.de (Hubert Palme).
6904
6905         * postscript.c: (postopen) Some large mods for constness.
6906
6907         * recode.c: Remove spurious copyrights since PSPP is owned by FSF
6908         anyway.
6909
6910 Fri Apr 24 12:52:47 1998  Ben Pfaff  <blp@gnu.org>
6911
6912         * Makefile.am: Rename BUILT_SOURCES to q_sources, all references
6913         changed.  Add avl.c, avl.h to pspp_SOURCES.  Remove avllib from
6914         LDADD.
6915
6916         * avl.c, avl.h: New files.  These form a clean-room
6917         reimplementation of avllib.  Iterative algorithms are used in
6918         place of recursive ones, so there is no resemblance in the code.
6919
6920         * Lots of headers: Don't include other headers by default.
6921
6922         * Lots of source files: Explicitly include all needed headers.
6923
6924         * arena.c: (arena_clear) New function.
6925
6926         * crosstabs.q: (ROW_VAR, COL_VAR) New enums.
6927         (static var ar) Removed.
6928         (staitc vars ar_tc, ar_col) New.
6929         (cmd_crosstabs) Destroy the arenas.
6930         (internal_cmd_crosstabs) Create the arenas.
6931         (precalc) Don't need a free function for the hash.
6932         (calc_general) Make sure to zero out the trailer on the key data
6933         before inserting.
6934         (print_table_entries) Updated.
6935         (postcalc) Worked on actually implementing.
6936         (find_pivot_extent) New function.
6937         (compare_value) New function.
6938         (enum_column_values) New function.
6939
6940         * data-in.c: (parse_month) Make local array `static const'.
6941         
6942         * data-out.c: (convert_date) Make local array `static const'.
6943         (convert_WKDAY) Same.
6944         (convert_MONTH) Same.
6945
6946         * frequencies.q: (postprocess_freq_tab) avl_walk_inorder() has
6947         been renamed to avl_walk().
6948         
6949         * hash.c: Rewritten more efficiently.
6950
6951         * hash.h: Add attribute const to hsh_next_prime declaration.
6952
6953         * lexer.c: (id_match) Make arguments const.
6954
6955         * postscript.c: (ps_postopen_driver) Make default fonts the
6956         Helvetica family.
6957
6958         * q2c.c: (main) Generated code needs stdlib.h.
6959
6960         * sfm-write.c: (write_value_labels) An avl_traverser needs to be
6961         initialized to 0 now, not to NULL.  All other references to
6962         avl_traverser were updated in the same way.
6963
6964         * tokens.h: Macro version of id_match updated to use const
6965         properly.
6966
6967         * val-labs.c: (inc_ref_count) New function.
6968         (copy_value_labels) Simply through use of new avl_copy() function.
6969
6970 Wed Apr 15 13:01:58 1998  Ben Pfaff  <blp@gnu.org>
6971
6972         * crosstabs.q: Probably doesn't compile.  New PIVOT subcommand.
6973         (postcalc) Worked on this.
6974
6975         * postscript.c: (OPO_DOUBLE_LINE) New enum.
6976         (struct ps_driver_ext) New line_width_thick member.
6977         (ps_preopen_drive) Init line_width_thick.
6978         (option_tab[]) Add line-* options.
6979         (ps_option) Parse line-* options.
6980         (postopen) Add line_width_thick support.  Strip leading spaces on
6981         prologue output lines.
6982         (ps_open_page) Include line_width_thick in output.
6983         (macro dump_thick_line) New.
6984         (dump_fancy_line) Support thick lines as well as double lines.
6985
6986 Tue Apr 14 00:50:08 1998  Ben Pfaff  <blp@gnu.org>
6987
6988         * Makefile.am: Add crosstabs.c to BUILT_SOURCES.  Add crosstabs.q
6989         to pspp_SOURCES.  Add crosstabs.q to EXTRA_DIST.
6990
6991         * Many source files: Rename `options' to `pv_opts' as appropriate.
6992
6993         * command.c: (static var cmd_table[]) Add CROSSTABS command.
6994
6995         * common.c: (xcalloc) New function.
6996
6997         * crosstabs.q: New file.  Not finished yet, though.
6998                 
6999         * data-list.c: Comment fix.
7000
7001         * error.c: Remove some old Checker cruft.
7002
7003         * frequencies.q: (dump_full) Cumulate valid percent instead of
7004         regular percent.
7005
7006         * getline.c: Comment fix.
7007
7008         * hash.c: Comment fixes.
7009
7010         * hash.h: (struct hsh_table) Make hash functions return unsigned
7011         instead of int to avoid problems with taking the modulo of
7012         negative return values.  All references changed.
7013
7014         * misc.c: (intlog10) Make its table static const instead of auto.
7015
7016         * sfm-read.c: (read_header) Make `prefix' static const instead of
7017         auto.
7018
7019         * var.h: (union value) Add member `hash'.
7020         (struct variable) Rename prv_index as `foo'--all references
7021         changed.  Reorder.
7022         (typedef pv_opts) Removed.  All references changed.
7023
7024         * vars-prs.c: (parse_variables) Message fixes.
7025         
7026 Mon Mar  9 15:35:08 1998  Ben Pfaff  <blp@gnu.org>
7027
7028         * get.c: (cmd_match_files) Don't reverse the order of FILEs as
7029         they are being inserted.  Don't check for BY variables of
7030         different types.  Discard variables if the active file isn't
7031         included in the merge.
7032         (mtf_processing) Essentially rewritten.
7033         (mtf_merge_dictionary) Check for master/slave variables of
7034         different types/widths.
7035
7036         * vfm.c: (static var not_canceled) New var.
7037         (process_active_file) Don't call vfm_source->read() if
7038         there's no vfm-source.  Initialize not_canceled.
7039         (process_active_file_write_case) Honor and update not_canceled.
7040         (prepare_for_writing) Rollback changes from yesterday, they were
7041         wrong.
7042         (close_active_file) Don't destroy vfm_source unless it exists.
7043         
7044 Mon Mar  9 00:56:16 1998  Ben Pfaff  <blp@gnu.org>
7045
7046         * Lots of source files: Added { } around nested if/else constructs
7047         to avoid new gcc 2.8 warnings.
7048
7049         * data-in.c: (parse_Z) Declare `int' type explicitly.
7050         (convert_Z) Ditto.
7051
7052         * get.c: (struct mtf_file) Add prev, next_min, by, input members.
7053         (cmd_match_files) Initialize mtf_by_values.  Manage by, input,
7054         prev members.  Put TABLEs at the end of the chain and FILEs at the
7055         beginning.  Don't allow the active file in STATE_INIT.  Use proper
7056         `seen' value for the active file.  Fill out the by members and
7057         make sure they're of consistent type.  Do the actual merge
7058         operation.
7059         (mtf_processing_finish) New function.
7060         (var_type_description) New function.
7061         (mtf_free_file) New function.
7062         (mtf_free) Rewritten.
7063         (mtf_delete_file_in_place) New function.
7064         (mtf_read_nonactive_records) New function.
7065         (mtf_compare_BY_values) New function.
7066         (static var mtf_seq_no) New var.
7067         (mtf_processing) New function.
7068         (mtf_merge_dictionary) Assign nval members for the system file
7069         dictionary.  Assign fv values for its variables.  Point each slave
7070         variable to the corresponding master variable.
7071
7072         * hash.c: Include str.h.
7073
7074         * mis-val.c: (copy_missing_values) src arg is const.
7075
7076         * misc.c: (spacing) Make `max' var explicitly int.
7077
7078         * sfm-read.c: (dump_dictionary) Message reformatting.
7079         (sfm_read_case) Add assertion.
7080
7081         * sort.c: Esthetic fixes.
7082
7083         * var.h: (struct match_files_proc) New struct.
7084         (struct variable) Add private data match_files_proc.
7085
7086         * vars-atr.c: (delete_variable) Implement.  Add argument for the
7087         dictionary that owning the variable.
7088         (dup_variable) Add assertion.
7089
7090         * vfm.c: Comment fixes, hopefully the comments are correct now.
7091         (process_active_file) New function.
7092         (process_active_file_write_case) New function.
7093         (process_active_file_output_case) New function.
7094         (prepare_for_writing) Use temp_dict->nval for vfm_info, not
7095         default_dict.nval.
7096         (write_case) Renamed procedure_write_case().  Now write_case is a
7097         pointer to a function.  Style fixes.
7098         
7099 1998-03-05  Ben Pfaff  <blp@gnu.org>
7100
7101         * Makefile.am: (q2c) Link with libmisc.
7102         (version.c) Define default_config_path, include_path,
7103         groff_font_path.
7104
7105         * ascii.c: (ascii_postopen_driver) When the default newline string
7106         is requested, open file in text mode.  Suggested by
7107         palme@uni-wuppertal.de (Hubert Palme).
7108         (static vars line_buf, line_p) Change from char * to unsigned char
7109         *.
7110         (ascii_close_page) char * to unsigned char *.
7111
7112         * cmdline.c: (parse_command_line) Implement -r option by
7113         prepending ~/.pspp/rc to the list of files to process.
7114
7115         * command.c: (cmd_remark) Reset getl_prompt to the standard prompt
7116         before pulling in a final line.
7117         (null_func, null_int_func) Removed (dead code).
7118
7119         * descript.q: (display) Calculate width of variable name column
7120         properly.  Calculate number of valid cases properly.  Reported by
7121         palme@uni-wuppertal.de (Hubert Palme).
7122
7123         * filename.c: (init_filename) Use default_config_path instead of
7124         now obsolete CONFIG_PATH.
7125
7126         * getline.c: (getl_initialize) Use include_path instead of now
7127         obsolete INCLUDE_PATH.
7128         (getl_add_file) New argument `where'.  All references changed.
7129
7130         * groff.c: (find_font_file) Use groff_font_path instead of now
7131         obsolete GROFF_FONT_PATH.
7132         
7133         * postscript.c: (find_ps_file) Use groff_font_path instead of now
7134         obsolete GROFF_FONT_PATH.  Copy through temporary variable to
7135         avoid problems with constness.
7136
7137         * str.h: (macro cs_streq) New macro.
7138
7139         * version.h: (glob var default_config_path, include_path,
7140         groff_font_path) New vars.
7141         
7142 1998-02-23  Ben Pfaff  <blp@gnu.org>
7143
7144         * Many source files: Change verbose_msg() priority levels and
7145         messages.
7146
7147         * aggregate.c: Include debug-print.h.
7148
7149         * cmdline.c: (parse_command_line) Add --safer/-s and --command/-c
7150         options.
7151         (static var pre_syntax_message) Document --safer/-s and
7152         --command/-c.
7153
7154         * command.c: (cmd_erase, cmd_host) Disable if set_safer is set.
7155
7156         * dfm.c: (open_inline_file) [__CHECKER__] Zero out ext->file,
7157         because it's not used but it's still copied.
7158         (open_file_r) Remove gratuitous debug message.
7159
7160         * filename.c: (safety_violation) New function.
7161         (open_file) Remove gratuitous debug messages.  Don't allow pipe
7162         files if set_safer is set.
7163
7164         * get.c: Turn off debugging.
7165
7166         * getline.c: (getl_add_virtual_file) New function.
7167         (getl_read_line) Add verbose_msg() call for opening new syntax
7168         file.
7169         (getl_perform_delayed_reset) Add a return value describing whether
7170         any action was taken.  Call reset_eof().
7171
7172         * getline.h: Comment fix.
7173
7174         * groff-font.c: (groff_read_font) Use `goto next_iteration' in
7175         place of incorrect `continue'.  Use strtok_r() instead of
7176         strtok().  Always check strtok_r() return value.
7177         (groff_read_DESC) Use strtok_r() instead of strtok().
7178
7179         * lexer.c: (reset_eof) New function.
7180
7181         * main.c: (parse) Get a token after performing a delayed reset
7182         action; allow empty syntax files.
7183
7184         * postscript.c: (output_encodings) Use strtok_r() instead of
7185         strtok().
7186
7187         * q2c.c: (dump_parser) Use strtok_r() instead of strtok().
7188
7189         * set.q: Comment fixes.
7190         (glob var set_safer) New var.
7191         (internal_cmd_set) Support SAFER.
7192
7193         * str.h: [!HAVE_STRTOK_R] Declare strtok_r() prototype.
7194
7195         * temporary.c: (free_dictionary) Set d->splits to NULL after
7196         freeing.
7197
7198         * vars-atr.c: (clear_variable) Decrement dict->n_splits if
7199         variable deleted, not if it *isn't* deleted.
7200
7201 1998-02-16  Ben Pfaff  <blp@gnu.org>
7202
7203         * command.c: (array cmd_table[]) Add MATCH FILES.
7204
7205         * common.c: Comment fixes.
7206
7207         * data-list.c, dfm.c, error.c, filename.c, list.q, matrix-data.c,
7208         modify-vars.c, postscript.c, sfm-read.c, sfm-write.c, tab.c:
7209         Include alloca.h.  Problem reported by palme@uni-wuppertal.de
7210         (Hubert Palme).
7211
7212         * expr-opt.c: Include str.h.  Problem reported by
7213         palme@uni-wuppertal.de (Hubert Palme).
7214
7215         * get.c: (cmd_get) [DEBUGGING] Update v->p.get to v->get.
7216         (static var mtf_by) Change from char ** to variable **.
7217         (static var mtf_master) New var.
7218         (mtf_merge_dictionary) New function.
7219         (cmd_match_files) Init mtf_master.  Parse mtf_by according to new
7220         var type.  Reorder tests properly.  Initialize file->dict.  Detect
7221         TABLE= without BY=.  Read file dictionaries and merge them.  Give
7222         subcommand name with IN, LAST, FIRST error messages.  Create IN,
7223         LAST, FIRST variables.  Comment fixes.
7224         (mtf_free) Don't free default_dict.  Free mtf_master.
7225
7226         * getline.c: Define getl_mode.  Change getl_buf_size to size_t
7227         from int.
7228         (handle_line_buffer) Cast int to size_t in comparison to avoid
7229         warning.
7230
7231         * getline.h: Declare getl_mode extern.
7232
7233         * groff-font.c: (groff_read_font) Type-fix calls to getline.
7234         (groff_read_DESC) Make line_size a size_t.
7235         (match_tok) Parenthesize name to avoid macro expansion.
7236
7237         * mis-val.c: (copy_missing_values) New function.
7238
7239         * postscript.c: (postopen) Make buf_size a size_t.
7240
7241         * sfm-read.c: (dump_dictionary) Make global from static.  Print
7242         variable info in parts for easier debugging with Checker.
7243
7244         * temporary.c: (copy_variable) Use copy_value_labels().
7245         (new_dictionary) New arg: whether to copy file label, documents.
7246
7247         * val-labs.c: (copy_value_labels) New function.
7248
7249         * var.h: (enums MISSING_*) Add MISSING_COUNT.
7250
7251         * vars-atr.c: [GLOBAL_DEBUGGING] (force_dup_variable) New
7252         function.
7253         (dup_variable) Set prv_index, get.fv, get.nv.
7254
7255 Fri Feb 13 15:38:36 1998  Ben Pfaff  <blp@gnu.org>
7256
7257         * Makefile.am: (pspp_SOURCE) Add htmlP.h.
7258
7259         * Many source files: For ANSI-compliance, add empty statement
7260         after label.  Reported by palme@uni-wuppertal.de (Hubert Palme)
7261         and Micah Altman <maltman@www-vdc.fas.harvard.edu>.
7262
7263         * data-in.c: (parse_numeric) Some header files break on
7264         -DBL_MIN_10_EXP because they get a --; add () for safety.
7265         Reported by palme@uni-wuppertal.de (Hubert Palme).
7266
7267         * dfm.c: Idea by Dr Eberhard W Lisse <el@linux.lisse.na>.
7268         (struct dfm_fhuser_ext) Change `file' from FILE * to file_ext.
7269         (dfm_close) Use close_file_ext.
7270         (open_inline_file) Set file.file to NULL, not file.
7271         (open_file_r, open_file_w) Initialize file.file; fill in file_ext
7272         struct and use open_file_ext().
7273         (read_record) Use file.file.
7274
7275         * file-handle.q: (prepend_current_directory) Pass through special
7276         filenames.
7277
7278         * filename.c: Only include unistd.h if HAVE_UNISTD_H.
7279         (normalize_filename) Pass through special filenames.
7280         (open_file, close_file) Accept pipe| and |pipe syntaxes as
7281         equivalent.
7282         (dirname) Rename blp_dirname() because of name conflict on some
7283         OS.  All references changed.  Reported by palme@uni-wuppertal.de
7284         (Hubert Palme).
7285         (is_special_filename) New function.
7286
7287         * get.c: (GTSV_OPT*) Add GTSV_OPT_MATCH_FILES.
7288         (trim_dictionary) Conditionalize some of the options on whether
7289         GTSV_OPT_MATCH_FILES is in *options.
7290         (rename_variables) Don't allow variables to be renamed as scratch
7291         variables.
7292         (MTF_*) New enum series.
7293         (struct mtf_file) New struct.
7294         (static vars mtf_head, mtf_tail, mtf_by, mtf_n_by, mtf_free) New
7295         vars.
7296         (cmd_match_files, mtf_free) New functions.
7297
7298         * lexer.c: (match_int) Needed parentheses around name to escape
7299         macro expansion.  Reported by Micah Altman
7300         <maltman@www-vdc.fas.harvard.edu>.
7301
7302         * print.c: Needed to include alloca.h.  Reported by Micah Altman
7303         <maltman@www-vdc.fas.harvard.edu>.
7304
7305         * recode.c: (convert_to_double) Parenthesize -DBL_MIN_10_EXP to
7306         -(DBL_MIN_10_EXP).  Reported by palme@uni-wuppertal.de (Hubert
7307         Palme).
7308         
7309         * str.h: Include stdarg.h.  Reported by palme@uni-wuppertal.de
7310         (Hubert Palme) and Micah Altman <maltman@www-vdc.fas.harvard.edu>.
7311
7312 Thu Feb  5 00:18:21 1998  Ben Pfaff  <blp@gnu.org>
7313
7314         * html.c: (struct html_driver_ext) Move into htmlP.h.
7315         (html_preopen_driver) Initialize cp_x, cp_y.
7316         (html_submit) Implement as call to output_tab_table().
7317         (change_attributes) New function.
7318         (escape_string) New function.
7319         (output_tab_table) New function.
7320
7321         * list.q: (write_all_headers) Add code for writing headers for the
7322         html driver.
7323         (clean_up) Write out the html close-table tag.
7324         (determine_layout) Ignore html driver.
7325         (list_cases) Write html data.
7326
7327         * som.c: (som_submit) Move more of the code into output_table().
7328
7329         * tab.c: (static var hit) Make a global var and rename tab_hit.
7330         (static var tab_table_class) Make a global var.
7331
7332         * htmlP.h: New file.
7333
7334 Tue Feb  3 16:12:18 1998  Ben Pfaff  <blp@gnu.org>
7335
7336         * dump-sysfile.c: Removed.
7337
7338         * html.c: (preclose) Change comment in emitted code.
7339
7340         * matrix-data.c: Debugging off by default.  Comment fixes.
7341         (static var container) New var.
7342         (cmd_matrix_data) Create and destroy container.  Initialize
7343         is_per_factor[] to 0s.  Move code into new function
7344         string_to_content_type().  Require split values to be present in
7345         the data when ROWTYPE_ is explicit.  Call specific function, not
7346         general read_matrices().
7347         (string_to_content_type) New function.
7348         (context) Exclude all whitespace, not just spaces.
7349         (mget_token) A dot is a number.  Add assertion.
7350         (static var data) Renamed nr_data.
7351         (static var factor_values) Renamed nr_factor_values.
7352         (read_matrices) Renamed read_matrices_without_rowtype().  Handle
7353         only specific case.  Close data_file before exit.
7354         (fill_matrix) New function.
7355         (read_data_lines) Renamed nr_read_data_lines().  Remove debug
7356         printing.  Style fixes.  Message fixes.  Move code into
7357         fill_matrix().
7358         (read_matrices_without_rowtype) Rename
7359         matrix_data_read_without_rowtype().  Fix off-by-one error on
7360         loops.  Allocate nr_data[] memory from arena.
7361         (read_matrices_with_rowtype) Removed.
7362         (read_splits) Renamed nr_read_splits().  Style fixes.
7363         (read_factors) Renamed nr_read_factors().
7364         (dump_cell_content) Comment fixes.  Arguments changed.  Change
7365         debug printing.  All references changed.
7366         (output_data) Renamed nr_output_data().
7367         (static var wr_content) New var.
7368         (struct factor_data) New struct.
7369         (static var wr_data) New var.
7370         (static var wr_current) New var.
7371         (matrix_data_source_destroy_source) Removed.
7372         (read_matrices_with_rowtype) New function.
7373         (matrix_data_read_with_rowtype) New function.
7374         (wr_read_splits) New function.
7375         (compare_factors) New function.
7376         (wr_output_data) New function.
7377         (wr_read_rowtype) New function.
7378         (wr_read_factors) New function.
7379         (wr_read_indeps) New function.
7380         (glob var matrix_data_source) Make destroy_source member NULL as
7381         well.
7382
7383 Fri Jan 23 00:09:08 1998  Ben Pfaff  <blp@gnu.org>
7384
7385         * lexer.c: (syntax_error) Give better error message when at end of
7386         file.
7387
7388         * matrix-data.c: (var content_names[]) Fix PROX spelling.  Change
7389         N_SCALAR to output as plain N.
7390         (mdump_token) Change output format.
7391         (context) Fix message output interaction with spaces in input.
7392         (another_token) New function.
7393         (force_eol) Improved error message.
7394         (static var max_cell_index) New var.
7395         (read_matrices) Init `cells'.  factor_values is now per-cell.
7396         Init max_cell_index.
7397         (read_data_lines) Replace `compare' local with new `compare' arg.
7398         Debugging messages changed.  Only read factors if per_factor.
7399         Propagate error return from read_factors(), force_eol().
7400         Copy N_SCALAR values across the N vector.
7401         (read_matrices_without_rowtype) Don't init `cells'.  Don't need to
7402         check parentheses manually since we now have is_per_factor[].
7403         Call read_data_lines() with new args.  Check for end of data after
7404         looping, using another_token().
7405         (read_factors) Arguments changed.  Use max_cell_index to determine
7406         whether to read or compare factors.  Message fixes.
7407         (dump_cell_content) New function.
7408         (output_data) Completely rewritten because content types were
7409         supported to be nested inside factor values, not vice versa.
7410         
7411 Thu Jan 22 00:26:38 1998  Ben Pfaff  <blp@gnu.org>
7412
7413         * lexer.c: (syntax_error) Support formatted varargs messages.
7414
7415         * matrix-data.c: Turn debugging on by default.
7416         (static content_type[]) New array.
7417         (static content_names[]) New array.
7418         (static rowtype_, varname_) New vars.
7419         (static is_per_factor[]) New array.
7420         (static split_values) Moved declaration.
7421         (static n_continuous, first_continuous) New var.
7422         (cmd_matrix_data) Don't init split_values.  Assign ROWTYPE_ to
7423         rowtype_.  Simplify SPLIT code.  Init is_per_factor[].  Assign
7424         VARNAME_ to varname_.  Initialize first_continuous, n_continuous.
7425         Check for continuous variables.
7426         [DEBUGGING] (debug_print) Remove content_names[].
7427         (mdump_token) New macro.
7428         (mget_token_dump) New function.
7429         (mdump_token) New function.
7430         (context) New function.
7431         (mget_token) Fix messages.
7432         (static var data, split_values, factor_values) New vars.
7433         (read_matrices) Manage split_values, factor_values.
7434         (read_data_lines) New function.
7435         (read_matrices_without_rowtype) Implemented.
7436         (read_splits) Message fixes.  Uses `just_read'.
7437         (read_factors) New function.
7438         (output_data) New function.
7439         (matrix_data_source_destroy_source) Close the file handle.
7440         (glob var matrix_source) Change name from "DATA LIST" to "MATRIX
7441         DATA".
7442
7443         * str.c: (strpadcmp) Removed.
7444
7445         * vfm.c: (dump_splits) Initialize i; fix test for end of splits.
7446
7447 Sun Jan 18 00:30:59 1998  Ben Pfaff  <blp@gnu.org>
7448
7449         * Lots of source files: Add cast to unsigned character to calls to
7450         tolower() and toupper().
7451
7452         * aggregate.c: Set default_dict.splits to NULL.
7453
7454         * command.c: (static variable tab[]) Add MATRIX DATA.
7455
7456         * data-in.c: Add debugging defines.  Formatting fixes.
7457
7458         * expr-opt.c: Formatting fixes.
7459
7460         * lexer.c: (syntax_error) Message fixes.
7461
7462         * matrix-data.c: New enum series.
7463         (static vars fmt, section, diag, explicit_rowtype, signle_split,
7464         split_values, n_factors, factors, cells, pop_n, contents,
7465         n_contents) New vars.
7466         (cmd_matrix_data) Finished implementation.
7467         (compare_variables_by_mxd_vartype) New function.
7468         [DEBUGGING] (debug_print) New function.
7469         (static vars mtoken, mtokstr, mtoklen, mtokval) New vars.
7470         (read_matrices) New function.
7471         (read_matrices_without_rowtype) New function.
7472         (read_matrices_with_rowtype) New function.
7473         (read_splits) New function.
7474         (mget_token) New function.
7475         (force_eol) New function.
7476         [0] (test_tokenizer) New function.
7477         (matrix_data_source_destroy_source) New function.
7478         (glob var matrix_data_source) New var.
7479
7480         * misc.h: Include ieeefp.h if present.
7481
7482         * split-file.h: (cmd_split_file) Changes corresponding to struct
7483         dictionary changes.
7484
7485         * str.h: Fix memmem prototype.
7486
7487         * temporary.c: (save_dictionary, restore_dictionary,
7488         free_dictionary) Changes corresponding to struct dictionary
7489         changes.
7490
7491         * var.h: (MXD_* enums) New enum series.
7492         (struct matrix_data_proc) New struct.
7493         (struct split) Removed.
7494         (struct dictionary) Changed `splits' member from `split *' to
7495         `variable **'.
7496         (macro force_create_variable) New macro.  Replaced lots of
7497         create_variable()/assert() calls with calls to this macro.
7498
7499         * vars-atr.c: (discard_variables) Changed assertion.
7500         [GLOBAL_DEBUGGING] (force_create_variable) New function
7501         called by the macro of the same name.
7502         (clear_variable) Changes to delete splits from the dictionary
7503         corresponding to struct dictionary changes.
7504
7505         * vars-prs.c: (parse_variables) [GLOBAL_DEBUGGING] Check for
7506         corrupted variable `index' values in the dictionary passed in
7507         every time this function is called.
7508
7509         * vfm.c: (dump_splits, SPLIT_FILE_procfunc) Changes corresponding
7510         to struct dictionary changes.
7511
7512 Tue Jan 13 23:45:02 1998  Ben Pfaff  <blp@gnu.org>
7513
7514         * Makefile.am: (pspp_SOURCES) Add matrix-data.c.
7515
7516         * command.c: New includes.
7517         (static array cmd_table[]) Add ERASE, HOST, NEW FILE.
7518         (cmd_erase) New function.
7519         [unix] (shell) New function.
7520         (run_command) New function.
7521         (cmd_host) New function.
7522         (cmd_new_file) New function.
7523
7524         * expr-prs.c: (parse_primary) Message fix.
7525
7526         * inpt-pgm.c: Formatting fix.
7527         (cmd_reread) Implement the FILE subcommand.
7528
7529         * matrix-data.c: New file.
7530
7531         * q2c.c: (dump_header) Change output commenting style.
7532
7533         * weight.c: Comment fix.
7534
7535 Tue Jan 13 00:53:39 1998  Ben Pfaff  <blp@gnu.org>
7536
7537         * aggregate.c: (buf64_10x) Renamed buf64_1xx, all references
7538         changed.
7539         (buf_10x) Renamed buf_1xx, all references changed.
7540         (cmd_aggregate) Implemented cases 010, 011, 110, and 111 (all
7541         cases now implemented).
7542         (create_sysfile) New function.
7543         (agr_11x_func) New function.
7544
7545         * data-in.c: (parse_numeric) Work properly if there's an
7546         explicitly coded decimal point in the data and decimal places are
7547         specified on DATA LIST.  Bug reported by Dr Eberhard W Lisse
7548         <el@linux.lisse.na>.
7549
7550         * get.c: (cmd_get, cmd_save_internal) Allow extraneous slash
7551         before file specification on GET, SAVE, XSAVE.  Bug reported by Dr
7552         Eberhard W Lisse <el@linux.lisse.na>.
7553
7554         * q2c.c: [!HAVE_STRERROR] Include misc/strerror.c, not
7555         strerror.c.  Bug reported by Alexandre Oliva
7556         <oliva@dcc.unicamp.br>.
7557
7558         * sort.c: Include sort.h.  Comment fixes.  A few esthetic fixes.
7559         (static var separate_case_tab) New var.
7560         (cmd_sort_cases) Cancel temporary transformations here.  Free
7561         v_sort before return.
7562         (sort_cases) Run an EXECUTE procedure if SEPARATE is nonzero and
7563         we're reading from a sort stream.  Don't cancel temporary
7564         transformations.  Offload internal sorting to do_internal_sort().
7565         (do_internal_sort) New function.  Handles internal sorting even
7566         when SEPARATE is nonzero.  Doesn't free v_sort.
7567         (do_external_sort) Take new arg SEPARATE.  Only destroy `x' if
7568         it's non-NULL.
7569         (write_initial_runs) Take new arg SEPARATE.  Only destroy the old
7570         sink if SEPARATE is zero.
7571         (read_output_cases) Renamed read_sort_output(), all references
7572         changed.  Now uses separate_case_tab when it exists.
7573         (write_separate) New function.
7574
7575         * vfm.c: (page_to_disk) Destroy memory_source_cases, not
7576         memory_sink_cases.  Don't redundantly call
7577         vfm_source->destroy_source().
7578         (memory_stream_mode) After switching over, set memory_sink_cases
7579         to NULL.
7580
7581 Sat Jan 10 23:35:51 1998  Ben Pfaff  <blp@gnu.org>
7582
7583         * aggregate.c: (struct agr_var) Expand dbl[] array from 2 to 3
7584         elements.
7585         (static var prev_case) New, moved out of aggregate_single_case()
7586         local scope.
7587         (static var buf64_10x, buf_10x) New.
7588         (cmd_aggregate) Initialize prev_case.  Comment fixes.  Implement
7589         the 000, 001, 100, and 101 cases.  Free prev_case.
7590         (parse_aggregate_functions) Disallow scratch variables.
7591         (free_aggregate_functions) Only free agr_dict if non-null.  Use
7592         iter->function to determine numeric/string type, not
7593         iter->src->type.
7594         (aggregate_single_case) Don't manage prev_case.  Initialize
7595         aggregate info after dumping it.
7596         (accumulate_aggregate_info) Fix sum, weighted sum, mean, weighted
7597         mean, stddev, weighted stddev definitions.
7598         (dump_aggregate_info) Implemented.
7599         (initialize_aggregate_info) Renamed from
7600         initialize_aggregate_functions().  Initializes dbl[2].
7601         (agr_00x_trns_proc, agr_00x_end_func, write_case_to_sfm,
7602         agr_10x_trns_proc, agr_10x_trns_free, agr_10x_end_func) New.
7603
7604         * cases.c: (alloc_val) Removed.
7605
7606         * get.c: (cmd_save_internal) Initialize new `dict' member.
7607
7608         * sfm-write.c: (sfm_write_dictionary, write_header,
7609         write_variable, write_value_labels, write_documents) Reorganize,
7610         simplify for new parameter structure.
7611         (write_variable) Only one variable * argument now.
7612
7613         * sfm.h: (struct sfm_write_info) Removed `pri', `sec', and
7614         replaced by new `dict' member.
7615
7616         * temporary.c: (new_dictionary) Initialize n_documents.
7617
7618         * vars-atr.c: (dup_variable) Allocate `value's from dict into
7619         v->fv manually.
7620         (init_variable, replace_variable) Eliminate usage of alloc_val().
7621
7622         * vars-prs.c: (parse_DATA_LIST_vars) Accept PV_NO_SCRATCH option.
7623
7624         * vfm.c: (arrange_compaction) Allow `temporary' value of 2 to
7625         signal that AGGREGATE is to be used for forming final cases.
7626         (close_active_file) Call end_func before stopping lagging.  Cancel
7627         temporary after finishing compaction.
7628         (write_case) Comment fixes.  Cleaned up.
7629         (compact_case) Let AGGREGATE handle compaction when `temporary' is
7630         2.
7631
7632 Sat Jan 10 02:10:47 1998  Ben Pfaff  <blp@gnu.org>
7633
7634         * Makefile.am: (BUILT_SOURCES) Add means.c.
7635         (pspp_SOURCES) Add means.c.
7636         (EXTRA_DIST) Add means.q.
7637
7638         * command.c: (array cmd_table[]) Add MEANS.
7639
7640         * common.h: Esthetic fixes.  Comment fixes.  Test for
7641         MAX_SHORT_STRING greater than 8.
7642         (macros LOWEST, HIGHEST) New.
7643
7644         * data-in.c, data-list.c, recode.c: Comment fixes.
7645
7646         * means.q: New file, base version.
7647
7648         * mis-val.c: (parse_num_or_range, parse_numeric) Replace -DBL_MAX
7649         with LOWEST, DBL_MAX with HIGHEST.
7650
7651         * q2c.c: (dump_vars) Add an enum to array types giving the number
7652         of values for the enum.
7653
7654         * sfm-read.c: (sfm_read_dictionary, read_machine_flt64_info)
7655         Replace second_lowest_value with second_lowest_flt64.
7656
7657         * sfm-write.c: (write_variable, write_rec_7_34) Replace
7658         second_lowest_value with second_lowest_flt64.
7659
7660         * t-test.q: Comment fix.
7661
7662         * temporary.c: (restore_dictionary) Esthetic fix.
7663
7664         * tokens.h: (force_match_id, force_match, force_string, force_int,
7665         force_num, force_id) Replace msg() with syntax_error().
7666
7667         * var.h: (struct means_proc) New.
7668         (struct variable) Add mns member to `p' union.
7669
7670         * vars-prs.c: (parse_variable, parse_dict_variable,
7671         parse_variables, parse_DATA_LIST_vars) Replace msg() with
7672         syntax_error().
7673
7674 Thu Jan  8 22:28:41 1998  Ben Pfaff  <blp@gnu.org>
7675
7676         * Makefile.am: (pspp_SOURCES) Add tab.h.
7677
7678         * Most source files: Added a cast to unsigned char in usages of
7679         the ctype is*() functions.  Replaced `end of command expected'
7680         calls to msg() with calls to syntax_error().
7681
7682         * frequencies.q: (dump_condensed) Fix tab_dim() column reference.
7683
7684         * lexer.c: (hex_val) Removed (was dead code).
7685         (idmatch) Parenthesize function name to avoid macro expansion.
7686
7687         * postscript.c: Comment fixes.
7688         (ps_preopen_driver) Change default font size to 10pt.
7689
7690         * sfm-read.c: (read_variables) Byteswap sv.print, sv.write as
7691         int32s.
7692         (parse_format_spec) Change system-file format spec argument type
7693         to int32.  Parse the format spec with bitwise operators.
7694
7695         * sfmP.h: (struct sysfile_format) Removed.
7696         (struct sysfile_variable) Changed print, write members from
7697         sysfile_format to int32.
7698
7699         * tokens.h: Esthetic fixes.
7700         [__GNUC__] (macro id_match) New macro to hopefully speed up
7701         identifier matching.
7702         (macros match_id, match_tok, match_int) Implemented in
7703         compiler-independent manner; no longer GNU C only.
7704
7705         * vfm.h: Include time.h.
7706
7707 Mon Jan  5 11:06:15 1998  Ben Pfaff  <blp@gnu.org>
7708
7709         * data-list.c: (dump_fixed_table) Change tab_dim().
7710
7711         * dump-sysfile.c: (open_sysfile) Fix mmap() call.
7712
7713         * error.c: Include command.h.
7714
7715         * frequencies.g: Formatting fixes.
7716
7717         * frequencies.q: Add tab_dim() calls.  Make the total cell a
7718         joined cell.
7719
7720         * glob.c: Include command.h.
7721
7722         * sfm-read.c: (struct sfm_fhuser_ext) New members sysmis, highest,
7723         lowest.
7724         (sfm_read_dictionary) Initialize sysmis, highest, lowest.
7725         (sfm_read_machine_flt64_info) Update sysmis, highest, lowest.
7726         (read_variables) Byteswap sv.type; byteswap sv.print, sv.write as
7727         the other elements (is this right?).
7728         (read_variables) Use lowest, highest members.
7729         (parse_format_spec) New arg `vv' for more stringent checking.
7730         (dump_dictionary) Byteswaps nonexplicit data.
7731         (sfm_read_case) Byteswap numeric data.
7732
7733         * som.c: Initialize table_num to 1.
7734         (render_segments) Remember to increment y_index after each table
7735         segment.
7736
7737         * sysfile-info.c: (cmd_sysfile_info) Change tab_dim().  Don't call
7738         avl_count() on a NULL tree.  No title for the second table.
7739         (cmd_display) Handle DISPLAY VECTORS by calling display_vectors().
7740         Handle AS_SCRATCH as AS_NAMES.  Warn if no variables.  Re-enable;
7741         fix call to display_variables().
7742         (display_variables) Default to 4 columns, not 3.  Set up headers.
7743         Column title is Variable, not Name.  Fix index column.
7744         Add joint text.  Add tab_dim().  Handle value labels properly.
7745         Handle DISPLAY LABELS properly.  Draw boxes correctly.
7746         (describe_variable) Value labels don't need titles.  Don't clear
7747         nonexistent index column.
7748         (compare_vectors_by_name) New function.
7749         (display_vectors) New function.
7750
7751         * tab.c: (tab_height) Add assertion.
7752         (tab_null) Add debug code.
7753         (evaluate_dimensions) Add debug code.
7754
7755         * var.h: (struct variable) get_proc data is sometimes used
7756         simultaneously with other per-procedure info, therefore it was
7757         removed from the union.  All references changed.        
7758
7759 Sun Jan  4 18:13:33 1998  Ben Pfaff  <blp@gnu.org>
7760
7761         * ascii.c: (ascii_close_page) Put title on second line of headers
7762         if there is no subtitle.
7763
7764         * command.c: (glob var cur_proc) Move definition here, from
7765         common.c.
7766         (cmd_remark) Emit blank line before remarks.
7767
7768         * command.h: (glob var cur_proc) Move declaration here, from
7769         common.h.
7770
7771         * data-list.c: (dump_fixed_table) Fix messages.
7772         (dump_free_table) Call tab_nat_dim().
7773
7774         * descript.q: (dump_z_table) Modify tab_dim() call.
7775
7776         * frequencies.q: (dump_condensed, dump_statistics) Add tab_dim()
7777         call.
7778         (dump_statistics) Don't output header.
7779
7780         * groff-font.c: Minor format fix.
7781
7782         * html.c: Comment fix.
7783
7784         * list.q: (write_varname) Indent after advancing page.
7785
7786         * output.h: Minor reordering.
7787
7788         * postscript.c: Comment fixes.  Many places, '\n' was replaced by
7789         a reference to eol[].
7790         (struct ps_driver_ext) New member eol[].
7791         (ps_preopen_driver) Initialize eol[].
7792         (ps_postopen_driver) Fix sense of text for text_opt, line_opt
7793         defaults.  Handle headers.  Fix test for minimum page length.
7794         (static var option_tab[]) Add `line-ends'.
7795         (ps_option) Handle line-ends to change eol[].
7796         (postopen) Scale prop_em_width and fixed_width properly.  Set the
7797         prologue title to outp_title if applicable.  Replace the prologue
7798         line ends with eol[].  Call draw_headers() if headers are enabled.
7799         (text_width) New function.
7800         (out_text_plain) New function.
7801         (draw_headers) New function.
7802
7803         * print.c: (dump_table) Call tab_nat_dim().
7804
7805         * som.c: (som_blank_line) Only advance a line if not at the top of
7806         a page.
7807         (som_submit) Move several informational table calls here.
7808         Increment subtable_num if SOMF_NO_TITLE not set.
7809         (output_table) Advance a line if SOMF_NO_SPACING not set.
7810         (render_columns, render_segments, render_simple) Handle spacing
7811         between tables.  Handle table titles.  Remove debug output.
7812
7813         * som.h: (SOMF_*) New enum series.
7814         (struct som_table_class) New member `flags'.
7815
7816         * sysfile-info.c: (cmd_sysfile_info) Calls tab_nat_dim().  No
7817         headers or spacing.
7818         (display_variables) Calls tab_nat_dim().
7819         (describe_variable) Remove restriction on number of value labels.
7820         Make value labels separated by thin lines.
7821
7822         * tab.c: (tab_create) Default `flags' to none.
7823         (tab_float) New arg `w'.  All references changed.
7824         (tab_nat_dim) New function.
7825         (tab_output_text) No title or spacing.
7826         (tab_flags) New function.
7827         (tabi_flags) New function.
7828         (tabi_title) New function.
7829         (strip_height) Removed.
7830         (tabi_render) Skip title when necessary.
7831         (static var tab_tab_class) Add tabi_flags, tabi_title.
7832         (evaluate_dimensions) Disable display of column, row size.
7833         (sum_columns) Add title height to top header.
7834         (render_strip) Moved within file.
7835
7836         * tab.h: (struct tab_table) New member `flags'.
7837
7838         * vfm.c: (dump_splits) Calls tab_nat_dim().  No title.
7839
7840 Sat Jan  3 16:55:44 1998  Ben Pfaff  <blp@gnu.org>
7841
7842         * Most source files: Add `const' attribute in all appropriate
7843         places.
7844         
7845         * sysfile-info.c: (cmd_sysfile_info) Add tab_dim() call, add a
7846         column to the variables table for use by describe_variable().
7847         (cmd_display) Disable for the present.
7848         (display_documents) Don't wrap documents.
7849         (display_variables) Table has four columns now.
7850         (describe_variable) Table has four columns now.  Don't use a
7851         subtable, use joined cells instead.
7852
7853         * tab.c: (tab_create) Don't set `join'.
7854         (tab_realloc) ct array is not made up of a_string's.
7855         Reallocate trh, hrh, h arrays, initialize trh array.  Initialize
7856         cell contents on GLOBAL_DEBUGGING, not DEBUGGING.
7857         (text_format) New function.
7858         (tab_title) Rewritten, uses text_format().
7859         (tab_text) Rewritten, uses text_format().
7860         (tab_joint_text) New function.
7861         (tab_join) Removed.
7862         (static var hit) New variable.
7863         (render_strip) New args r1, r2.  Implement joined cells that fit
7864         on a single page.
7865         (tabi_render) Increment hit.  Pass new args to render_strip().
7866         (evaluate_dimensions) [GLOBAL_DEBUGGING] Check for uninitialized
7867         cells.  For t_naw and t_nah, ignore joined cells and null cells in
7868         calculations.
7869         
7870         * tab.h: (struct tab_join_rect) Removed.
7871         (struct tab_table) Removed `join'.
7872         (TAB_JOIN_MAIN) Removed.
7873         (struct tab_joined_cell) New struct.
7874         (TAT_NOWRAP) New enum.
7875
7876 Fri Jan  2 01:39:58 1998  Ben Pfaff  <blp@gnu.org>
7877
7878         * ascii.c: (ascii_postopen) Replace ASCII_* macros with their
7879         expansions.
7880         (ascii_postopen_driver) Fix initialization of *_spacing so that
7881         the TAL_0 bit doesn't count.
7882
7883         * data-list.c: (dump_fixed_table) Use natural width for Format
7884         column.
7885
7886         * glob.c: (rerange) Removed.
7887         (get_date) Formatting fixes.  Internationalization fix.
7888
7889         * html.c: (html_postopen_driver) Replace HTML_DEFAULT_OUTPUT_FILE
7890         with "pspp.html".
7891
7892         * postscript.c: (ps_postopen_driver) Replace
7893         PS_DEFAULT_OUTPUT_FILE with "pspp.ps".
7894
7895         * som.c: (som_submit) Don't eject page before every table.
7896         (output_table) Fix order of arguments on call to area().
7897         (render_columns) Fix calculation of max_len.
7898         
7899         * tab.c: (tabi_cumulate) Minor change to increase elegance.
7900         (render_strip) New function.
7901         (strip_height) New function.
7902         (tabi_render) Rewrite as calls to render_strip().
7903
7904         * tab.h: (TAT_* enums) Removed TAT_RICH, all references removed.
7905         Renumbered TAT_PRINTF, TAT_TITLE, TAT_FIX to correspond better
7906         with the TAB_* and OUTP_T_* constants.
7907         
7908 Thu Jan  1 11:53:52 1998  Ben Pfaff  <blp@gnu.org>
7909
7910         * Makefile.am: Formatting fixes.
7911
7912         * ascii.c: (ascii_postopen_driver) Initialize *_line_spacing[],
7913         *_line_width[].
7914
7915         * data-list.c: (dump_fixed_table) Add tab_dim() call.
7916
7917         * descript.q: (dump_z_table, display) Add tab_dim() calls.
7918
7919         * dump-sysfile.c: (glob var length) Make type off_t.
7920         (usage) Fix arguments.
7921         (main) Return 0.
7922
7923         * output.h: (OUTP_T_*) Change constants' value to match tab.h.
7924         Now right-justification is the default so many references had to
7925         change.
7926         (struct outp_class) Removed line_width, all references changed.
7927         (OUTP_DEV_*) Add OUTP_DEV_DISABLED.
7928         (struct outp_driver) Add elements horiz_line_width,
7929         vert_line_width, horiz_line_spacing, vert_line_spacing.  Remove
7930         som element.
7931
7932         * postscript.c: (outp_encodings) Formatting fixes.  Fix garbage
7933         collection.
7934         (postopen) Initialize all the informational members of
7935         outp_driver.
7936
7937         * som.c: (som_blank_line) New function, renamed from blank_line(),
7938         all references changed.
7939         (som_submit) Disables drivers whose pages can't be opened.
7940         (render_columns, render_simple, render_segments) Add debug output.
7941         (render_columns) Fix loop range.
7942         (render_simple) Don't try to render the headers, they're taken
7943         care of automatically.  Advance cp_y past the table when done.
7944         (render_segments) Fix loop ranges.
7945
7946         * tab.c: Initialize new members of tab_table.
7947         (tab_vline) Handle trv[]; don't set style for spacing-only lines.
7948         (tab_hline) Handle trh[]; don't set style for spacing-only lines.
7949         (tab_box) Handle trh[], trv[]; don't set style for spacing-only
7950         lines.
7951         (set_expr) Removed.
7952         (tab_dim) New function.
7953         (tab_col_width) Removed.
7954         (tab_row_height) Removed.
7955         (tab_output_text) Call tab_dim().
7956         (tabi_driver) Call evaluate_dimensions(), sum_columns().
7957         (tabi_area) Implemented.
7958         (tabi_cumulate) Implemented.
7959         (tabi_render) Partially implemented, but broken.
7960         (var tab_table_class) Made static.
7961         (evaluate_dimensions) New function.
7962         (sum_columns) New function.
7963
7964         * tab.h: (enum t_*) Now start at t_end.  New: t_ptw, t_nr, t_nc,
7965         t_nah, t_naw, t_neg, t_xch, t_dup, t_lbl, t_jnz, t_sac, t_sar,
7966         t_scr, t_srr, t_sentinel.  Removed: t_nat.
7967         (struct tab_table) New: wl, wr, ht, hb, trh, hrh, trv, wrv, dim,
7968         max_stack_height, w, h.  Removed: ce, re.
7969         (macro blank_line) Removed.
7970         (glob var zero_length) Removed.
7971
7972 Fri Dec 26 15:44:31 1997  Ben Pfaff  <blp@gnu.org>
7973
7974         * Most source files: include some of the new include files broken
7975         out of var.h.
7976         
7977         * Makefile.am: (pspp_SOURCES) Add all the new source files to the
7978         list.
7979
7980         * aggregate.c: (glob var outfile) Make static.
7981
7982         * command.c: (glob var pgm_state) Move here.
7983
7984         * common.c: (glob vars endian, second_lowest_value, pgmname,
7985         finished, curdate, cur_proc, start_interactive, history_file) Move
7986         here.
7987
7988         * descript.q: (structs dsc_z_score, descriptives_trns) Move here.
7989
7990         * file-handle.q: (glob vars files, inline_file) Move here.
7991
7992         * glob.c: Lost lots of glob vars, detailed in individual file
7993         entries.
7994         (init_glob) set_printer, set_screen were obsolete, deleted.
7995         set_cprompt has fewer spaces because pspp has fewer letters than
7996         fiasco.
7997
7998         * inpt-pgm.c: (glob vars inp_init, inp_init_size) Move here.
7999         (inp_nval) Made static.
8000
8001         * lexer.c: (glob vars token, tokval, tokstr, tokstr_size,
8002         tokstr_len, toklongstr, tokint) Move here.
8003
8004         * misc.c: Lost several vars and functions.
8005
8006         * set.q: (all the set_* variables) Move here.
8007
8008         * str.c: (strmaxcpy, strbarepadcpy, strbarepadlencpy, strpadcpy,
8009         blpstrset, strpadcmp, memrev, memrmem, cmp_str) Move here from
8010         misc.c.
8011
8012         * tab.c: (set_expr, tab_col_width, tab_row_height) New functions.
8013
8014         * tab.h: (enum series t_*) New enums.
8015         (struct tab_table) Use arena struct tag.  New members ce, re.
8016
8017         * tokens.h: Comment fixes.
8018
8019         * var.h: Move lots of enums and variables and functions and
8020         structures to other files.  Use and declare a lot more union and
8021         struct tags.  Comment fixes.  
8022
8023         * vector.c: (glob vars vec, nvec) Move here.
8024
8025         * vfm.c: (glob vars reinit_sysmis, reinit_blanks, init_zero,
8026         init_blanks, last_vfm_invocation) Move here.
8027
8028         * cases.h: New file.
8029         (struct long_vec) Move here.
8030         (vec_init, vec_clear, vec_insert, vec_delete, devector, envector)
8031         Move here.
8032
8033         * command.h: New file.
8034         (STATE_* enums) Move here.
8035         (glob var pgm_state) Move here.
8036
8037         * format.c: New file.
8038         (glob var formats) Move here.
8039         (parse_format_specifier_name, fmt_to_string,
8040         check_input_specifier, check_output_specifier,
8041         check_string_specifier, convert_fmt_ItoO, parse_format_specifier)
8042         Move here.
8043
8044         * format.h: New file.  Move functions now in format.c here.
8045         (FMT_* enums) Move here.
8046         (struct fmt_desc) Move here.
8047         (FCAT_* enums) Move here.
8048         (struct fmt_spec) Move here.
8049         (glob vars formats, fmt_parse_ignore_error) Move here.
8050
8051         * inpt-pgm.h: New file.
8052         (INP_* enums) Move here, make #defines into enums.
8053         (glob vars inp_init, inp_init_size) Move here.
8054
8055         * sort.h: New file.
8056         (glob vars v_sort, nv_sort) Move here.
8057         (sort_cases, read_sort_output) Move here.
8058
8059         * vector.h: New file.
8060         (struct vector) Move here, add struct tag.
8061         (glob vars vec, nvec) Move here.
8062         (find_vector) Move here.
8063
8064         * New file.
8065         (glob vars last_vfm_invocation, temp_case, reinit_sysmis,
8066         reinit_blanks, init_zero, init_blanks) Move here.
8067         (struct case_stream) Move here.
8068         (glob vars vfm_source, vfm_sink, vfm_memory_stream,
8069         vfm_disk_stream, sort_stream, data_list_source,
8070         input_program_source, file_type_source, get_source, n_lag) Move
8071         here.
8072         (procedure, write_case, lagged_case, compact_case, page_to_disk)
8073         Move here.
8074                 
8075 Wed Dec 24 22:40:42 1997  Ben Pfaff  <blp@gnu.org>
8076
8077         * Makefile.am: (pspp_SOURCES) Added html.c, som.c, som.h.
8078         (LDADD) Add libdcdflib.
8079
8080         * ascii.c: Comment and formatting fixes.  Almost every external
8081         function had an assert added, checking driver_open and page_open.
8082         (ascii_init_driver) Broken into ascii_preopen_driver,
8083         ascii_postopen_driver, ascii_close_driver.  Manages driver_open.
8084         (ascii_open_page) Sets page_open.
8085         (ascii_close_page) Clears page_open.
8086
8087         * html.c: Comment and formatting fixes.  Almost every external
8088         function had an assert added, checking driver_open and page_open.
8089         (html_init_driver) Broken into html_preopen_driver,
8090         html_postopen_driver, html_close_driver.  Manages driver_open.
8091         (html_open_page) Sets page_open.
8092         (html_close_page) Clears page_open.
8093         (html_submit) Disabled.
8094
8095         * lexer.c: (parse_string) Remove debugging printf.
8096
8097         * list.q: (determine_layout) Open a page if one is not yet open.
8098
8099         * output.c: Comment fixes.
8100         (add_class) Set the class member of the new list element.
8101         (parse_options) Don't handle device type.
8102         (colon_tokenize) New function.
8103         (configure_driver) New four-field format with a field for device
8104         type.  Now initialize driver_open, page_open, next, and prev
8105         fields.  Use new colon_tokenize() function.  Don't do a memory
8106         copy to replace a driver, it doesn't work; instead delete the old
8107         driver and insert a new one.
8108         (destroy_driver) Don't call som_destroy_driver().  Close the page
8109         if it's open.  Find the class in the list of classes and decrement
8110         that reference count.  Remove the driver from the global driver
8111         list.
8112         (outp_iterate_enabled_drivers) Renamed outp_drivers().  All
8113         references changed.  Rewritten.  Don't return a driver that's not
8114         enabled.
8115         (outp_eject_page) All references to som_internal_eject_page()
8116         changed to use this.  Sets cp_x to 0 as well as cp_y.
8117
8118         * output.h: (OUTP_I_* enums) Removed.
8119         (struct som_submission_form) Removed.
8120         (struct outp_class) init_driver broken into preopen_driver,
8121         postopen_driver, and close_driver.  submit changed to take a
8122         som_table argument.
8123
8124         * postscript.c: Comment and formatting fixes.  Almost every
8125         external function had an assert added, checking driver_open and
8126         page_open.
8127         (ps_init_driver) Broken into ps_preopen_driver,
8128         ps_postopen_driver, ps_close_driver.  Manages driver_open.
8129         (ps_open_page) Sets page_open.
8130         (ps_close_page) Clears page_open.
8131
8132         * som.c: New file, base implementation.
8133         
8134         * som.h: (struct som_table) Add struct tag.
8135         (enum SOM_COL_ACROSS) Removed.
8136         (SOM_ROWS, SOM_COLUMNS) New enums.
8137         (struct som_table_class) Add member `cumulate'.  Remove `segment';
8138         change `render' arguments.
8139         (struct som_point, struct som_rect) Removed.
8140         (som_submit_table) Fixed typo, should have been som_submit.
8141
8142         * sysfile-info: (describe_variable) Don't try to insert a
8143         subtable; just destroy it for now.
8144
8145         * t-test.q: Include dcdflib/cdflib.h instead of cdflib.h.  Fix
8146         references to value labels.
8147
8148         * tab.c: (tab_destroy) New function.
8149         (tab_columns) Change argument.
8150         [0] (tab_submit) Remove dead code.
8151         (tab_title) Allocate string from the table's arena.
8152         (tab_output_text) Only free the buffer if we allocated it.
8153         (tab_submit) New function.
8154         (static vars t, d) New static vars.
8155         (tabi_table, tabi_driver, tabi_count, tabi_area, tabi_columns,
8156         tabi_headers, tabi_cumulate, tabi_render) New functions.
8157         (glob var tab_table_class) New global var.
8158
8159         * tab.h: (struct tab_join_rect) Don't use a som_rect; directly
8160         encapsulate the rectangle.  All references changed.
8161         
8162 Sun Dec 21 16:18:58 1997  Ben Pfaff  <blp@gnu.org>
8163
8164         * All header files updated to use struct tags in addition to
8165         typedefs for all structures.  Don't use word `struct' in struct
8166         tags.
8167         
8168         * Makefile.am: (pspp_SOURCES) Remove html.c.
8169         (INCLUDES) Replace the lib/* includes with a single lib/ include;
8170         all references updated.
8171
8172         * command.c: (parse_cmd) Remove call to som_check_workspace.
8173         (output_line) Update to new som.
8174
8175         * data-in.c: (parse_numeric) A single dot is not an error; it is
8176         the system-missing value.
8177
8178         * data-list.c: (dump_fixed_table, dump_free_table) Update to new
8179         som.
8180
8181         * data-out.c: Added `const' as appropriate to many prototypes.
8182         (convert_E, convert_F, convert_CCx) Take double argument instead
8183         of value * argument.
8184         (convert_format_to_string) Call changed functions appropriately.
8185         Instead of modifying the caller's value for FCAT_SHIFT_DECIMAL,
8186         make a local copy of the value.
8187
8188         * descript.q: Remove custom_variables() prototype now provided by
8189         q2c.  
8190         (custom_variables) Don't increment sbc_variables, the caller does
8191         this.
8192         (dump_z_table, display) Update to new som.
8193
8194         * error.c: (vmsg) Add const to prototype.  Remove code to handle
8195         `too many errors' condition.
8196         (check_error_count) New function.
8197         (msg) Add const to prototype.
8198
8199         * filename.c: (open_file) Rewrite for elegance.
8200
8201         * frequencies.q: Remove custom_*() prototypes now provided by q2c.
8202         (dump_full, dump_condensed, dump_statistics) Update for new som.
8203
8204         * list.q: Don't include somP.h.  Change all references to
8205         som_driver_ext to refer to the new members of som_driver.  Change
8206         som_internal_eject_page() references to outp_eject_page().
8207
8208         * main.c: (parse) Rewrite for elegance.  Add call to
8209         check_error_count().
8210
8211         * output.c: (add_class, outp_list_classes, outp_configure_driver)
8212         Rewrite or revise for new outp_driver_class_list structure.
8213         (outp_iterate_enabled_drivers) Fix comparison between disabled
8214         devices and current device type.
8215         (outp_eject_page) New function.
8216
8217         * output.h: Comment fixes.
8218         (struct outp_driver) New members driver_open, page_open, cp_x,
8219         cp_y, font_height, prop_em_width, fixed_width.  Deleted members
8220         ref_count, next.
8221         (struct outp_driver_class_list) New struct.
8222         (outp_class_list) Changed to type outp_driver_class_list; all
8223         references updated.
8224
8225         * print.c: (dump_table, print_trns_proc) Updated for new som.
8226
8227         * q2c.c: (dump_vars) Simplify array subcommand code.  Declare
8228         prototypes for custom subcommands.
8229         (dump_subcommand) Always include the `else'.
8230         (dump_parser) Fix comments in output code.
8231
8232         * set.q: Reordered functions.
8233
8234         * som-frnt.c, som-high.c, som-low.c, somP.h: Removed.
8235         
8236         * som.h: Rewritten from scratch.
8237
8238         * str.h: Remove dead code.
8239
8240         * tab.c, tab.h: New files, base implementation.
8241
8242         * sysfile-info.c: (cmd_sysfile_info, describe_variable) Update to
8243         new som.
8244
8245         * t-test.q: New code from John Williams
8246         <johnr.williams@stonebow.otago.ac.nz>.  Include math.h, cdflib.h.
8247         Many many new static vars and defines.
8248         (precalc, postcalc, g_postcalc, z_postcalc, t_pairs, t_groups,
8249         groups_calc, pairs_calc, z_dev_calc, z_calc) New functions.
8250         (struct value_list) New struct.
8251         (variance, covariance, pooled_variance, oneway, pearson_r, f_sig,
8252         t_crt, t_sig, print_t_groups) New functions.
8253         (cmd_t_test) Implemented.
8254
8255         * temporary.c: (cancel_temporary) Only free the temp_dict if it's
8256         non-NULL.
8257
8258         * vfm.c: (dump_splits) Update to new som.
8259
8260 Thu Dec  4 23:02:22 1997  Ben Pfaff  <blp@gnu.org>
8261
8262         * Makefile.am: (fiasco_SOURCES) Add html.c.
8263
8264         * aggregate.c: Base source.
8265
8266         * ascii.c: (postopen, preclose) Reformat.
8267
8268         * data-out.c, expr-evl.c: Comment fixes.
8269         
8270         * filename.c: (open_file) When opening a file for writing, use
8271         line buffering instead of full buffering for better interactive
8272         performance.  Suggested by Valerio Aimale
8273         <valerio@svpop.com.dist.unige.it>.  Also, recognize special file
8274         names `stdin', `stdout', `stderr'.
8275
8276         * groff-font.c: Comment fixes.
8277
8278         * html.c: New file; base version.
8279
8280         * list.q: (write_all_headers, clean_up, determine_layout,
8281         list_cases) Ignore `special' devices for now.  Needs to be fixed
8282         later.
8283
8284         * output.c: (outp_init) Add html driver to list; reverse list
8285         order.
8286
8287         * output.h: (struct outp_class_struct) New members `special',
8288         `submit'; comment fixes.  All references changed.
8289
8290         * postscript.c: (ps_init_driver) Make defaults for text_opt,
8291         line_opt depend on whether the OUTP_DEV_SCREEN bit is set on the
8292         device.
8293         (postopen) Comment fix.
8294         (preclose) Comment fixes, formatting fixes.  Change x->file.file
8295         references to more proper f->file.
8296
8297         * som-high.c: (som_submit_table) Special classes use their own
8298         renderers.
8299
8300         * som.h: Comment fixes.
8301
8302         * temporary.c: (new_dictionary) Don't try to xstrdup() a NULL
8303         string.
8304         
8305 Tue Dec  2 14:36:07 1997  Ben Pfaff  <blp@gnu.org>
8306
8307         * Makefile.am: (fiasco_SOURCES) Add aggregate.c back in.
8308
8309         * aggregate.c: Still working on this.
8310
8311         * command.c: (cmd_table[]) Add AGGREGATE back in.
8312         (split_words) Make '-' a legal word separator as well as ' '.
8313
8314         * main.c: Comment fixes.
8315
8316         * q2c.c: (dump_parser) Don't require the procedure's full name to
8317         be present, in the generated source.
8318
8319         * t-test.q: Change name to `t-test' from `t test'.  Let PAIRS be
8320         multiply specified and let it be default; let MISSING, CRITERIA,
8321         FORMAT be multiply specified.
8322         (cmd_t_test) Parse command name.  [DEBUGGING] Call debug_print().
8323         (custom_groups) Fix defaults.
8324         (custom_pairs) Check whether this is a PAIRS subcommand before
8325         attempting to parse.  Better garbage collection.  Proper storage
8326         allocation.
8327         [DEBUGGING] (debug_print) New function.
8328
8329         * temporary.c: Comment fixes.
8330         (copy_variable) Don't copy variable name and index.
8331         (save_dictionary) Copy variable name and index by hand.
8332
8333         * vars-atr.c: Comment fixes.
8334         (create_variable) New dictionary argument.  All references
8335         changed.
8336         (common_init_stuff) New dictionary argument.  All references
8337         changed.
8338         (init_variable) New dictionary argument.  All references changed.
8339         (dup_variable) New function.
8340
8341         * vars-prs.c: (parse_variables) If there are any errors, we always
8342         return 0.  Previously, it was possible for some types of errors to
8343         be ignored.
8344         
8345 Sat Nov 22 01:20:59 1997  Ben Pfaff  <blp@gnu.org>
8346
8347         * Makefile.am: (fiasco_SOURCES) For 0.1.5 release, remove
8348         aggregate.c.
8349
8350         * command.c: (cmd_table[]) Comment out AGGREGATE; add T TEST.
8351
8352         * list.q, t-test.q: Remove ALL option from VARLIST declaration in
8353         grammar rules.
8354
8355         * q2c.c: Comment fixes.
8356         (SBC_* enums) Remove SBC_VARLIST_ALL; all references removed.
8357         
8358         * t-test.q: (cmd_list) Rename cmd_t_test.
8359
8360         * temporary.c: (new_dictionary) Don't declare as static.
8361         
8362 Fri Nov 21 00:03:06 1997  Ben Pfaff  <blp@gnu.org>
8363
8364         * aggregate.c: Changes, still not finished.
8365
8366         * file-handle.q, frequencies.q, list.q, set.q: Comment fixes.
8367
8368         * q2c.c: Comment fixes.  Now its output is internationalized.
8369         (get_token) Fix parsing of escapes within literal strings.
8370         (main) Fix bad #line directives in output.
8371
8372         * t-test.q: Base implementation.
8373
8374         * temporary.c: (new_dictionary) New function.
8375         (restore_dictionary) [__CHECKER__] Change fill character to *
8376         (from @).
8377         
8378 Sun Nov 16 01:29:57 1997  Ben Pfaff  <blp@gnu.org>
8379
8380         * Makefile.am: (BUILT_SOURCES, fiasco_SOURCES) Add t-test.c
8381
8382         * aggregate.c: Changes, still not finished.
8383
8384         * descript.q, list.q: Comment fixes.
8385
8386         * q2c.c: Almost completely rewritten.
8387
8388         * t-test.q: New file, not complete.
8389
8390 Fri Nov 14 00:14:48 1997  Ben Pfaff  <blp@gnu.org>
8391
8392         * aggregate.c: Changes, still not finished.
8393
8394         * sort.c: (sort_cases) Call cancel_temporary() instead of doing it
8395         by hand.
8396
8397         * temporary.c: (cancel_temporary) New function.
8398
8399         * vars-atr.c: (discard_variables) Call cancel_temporary() instead
8400         of doing it by hand.
8401
8402         * vfm.c: (close_active_file) After restoring a TEMPORARY
8403         dictionary, set temp_dict to NULL.  Cancel TEMPORARY through
8404         cancel_temporary().
8405         (SPLIT_FILE_procfunc) Comment fix.
8406
8407 Tue Oct 28 16:08:45 1997  Ben Pfaff  <blp@gnu.org>
8408
8409         * Makefile.am: (fiasco_SOURCES) Add aggregate.c.
8410
8411         * aggregate.c: New file, not finished yet.
8412
8413         * command.c: (cmd_table) Add AGGREGATE.
8414
8415         * common.h: (pgm_state) Move declaration to var.h.
8416
8417         * lexer.c: (bin_value_func, oct_value_func, hex_value_func) i18n
8418         fixes.
8419         (parse_string) Message fix.
8420
8421         * recode.c: Comment fix.
8422
8423         * sfm-read.c: (read_variables) Code esthetic fixes.
8424         (write_header) Default date is `Jan', not `JAN'.
8425
8426         * sfmP.h: (bswap_int32) [!__linux__] Fix off-by-one errors.
8427
8428         * sort.c: (cmd_sort_cases) Farm the work out to new function
8429         parse_sort_variables().
8430         (parse_sort_variables) New function.
8431         (sort_cases) New function.  Cancels temporary transformations,
8432         which sorting didn't do previously.
8433         (cmd_sort_cases) Better garbage collection on error.  Uses
8434         do_external_sort().
8435         (write_initial_runs, merge_once) Improved code esthetics.
8436         (sort_stream_read) Reduced to one call to read_output_cases().
8437         (read_output_cases) New function.
8438
8439         * var-labs.c: (cmd_variable_labels) Re-enabled truncation of
8440         variable labels to 120 characters.
8441
8442         * var.h: Comment fixes.
8443         (glob var pgm_state) From common.h.
8444
8445         * vars-atr.c: (discard_variables) Set pgm_state to STATE_INIT.
8446
8447         * vars-prs.c: (parse_DATA_LIST_vars) Support PV_SINGLE in
8448         options.  Set *names to NULL on error.
8449
8450         * vfm.c: (memory_stream_init) Assert compaction_nval != 0.
8451
8452 Thu Oct  9 09:59:49 1997  Ben Pfaff  <blp@gnu.org>
8453
8454         * sfm-write.c, vfm.c: [HAVE_UNISTD] #include <unistd.h>, needed by
8455         SunOS4.  From Alexandre Oliva <oliva@dcc.unicamp.br>.
8456
8457 Wed Oct  8 18:55:24 1997  Ben Pfaff  <blp@gnu.org>
8458
8459         * vfm.c: (page_to_disk) Added missing local variables.
8460
8461 Tue Oct  7 20:23:17 1997  Ben Pfaff  <blp@gnu.org>
8462
8463         * get.c: Comment fix.
8464
8465         * sort.c: (cmd_sort_cases) Attempt to perform internal sort if the
8466         source is anything other than a disk stream, not just if it's in a
8467         memory stream.  Call page_to_disk() before external sort.
8468         (allocate_cases) Message fix.
8469
8470         * vfm.c: (prepare_for_writing) Warn user when paging workspace to
8471         disk.
8472         (page_to_disk) New function.
8473
8474 Sun Oct  5 15:56:14 1997  Ben Pfaff  <blp@gnu.org>
8475
8476         * Makefile.am: (INCLUDES) Include .. instead of $(top_srcdir).
8477
8478         * common.h: (macro strerror) Remove.  From Alexandre Oliva
8479         <oliva@dcc.unicamp.br>.
8480
8481         * get.c: (dict_delete_run) The number of variables to delete is
8482         not necessarily the number of variables that need to be shifted
8483         up.
8484         (trim_dictionary) Don't set *options to 0.  Fix bug that caused
8485         too many variables to be deleted.
8486
8487         * postscript.c: Comment fix.
8488
8489         * q2c.c: Include strerror.c.  From Alexandre Oliva
8490         <oliva@dcc.unicamp.br>.
8491
8492         * set.q: #undef ON and OFF.  From Alexandre Oliva
8493         <oliva@dcc.unicamp.br>.
8494
8495         * sfm-read.c: (sfm_read_dictionary) Don't set the file class too
8496         early, otherwise errors cause a bad free().
8497
8498         * str.h: (macro nvsprintf) s/FORMATS/FORMAT/ typo.  From Alexandre
8499         Oliva <oliva@dcc.unicamp.br>.
8500
8501         * temporary.c: (save_dictionary) Don't allocate memory if
8502         n_documents is 0.
8503
8504         * vfm.c: (memory_stream_write) Message fix.
8505
8506 Sat Oct  4 16:20:43 1997  Ben Pfaff  <blp@gnu.org>
8507
8508         * command.c: (static var cmd_table[]) Define REPEATING DATA
8509         command.
8510
8511         * common.h: Added support for broken systems that are missing
8512         EXIT_SUCCESS, EXIT_FAILURE, RAND_MAX, and/or strerror().
8513
8514         * Many source files: Replace syntax error messages via msg() with
8515         call to syntax_error().
8516
8517         * data-list.c: (dump_fixed_table) Add support for dumping table
8518         for REPEATING DATA as well as DATA LIST FIXED.
8519         (cmd_repeating_data) Allows and requires `/' between subcommands.
8520         Does proper thing with allowing rpd.starts_end to stay 0.  Allows
8521         CONTINUED specifications to be omitted.  Forces CONTINUED to be
8522         specified if ID is.  Calculates starts_end, cont_end from logical
8523         record length as reported by fhp.  Calls dump_fixed_table() if
8524         requested.  Fixed length of record copied by memcpy.
8525         (parse_num_or_var) Sets `num' to 0, not NOT_INT, for variables.
8526         Message fix.
8527         (realize_value) Returns sensible value for out-of-range variable
8528         values.
8529         (rpd_parse_record) New argument `ofs'.  Fixed confusion between
8530         length of occurrences and length of line.  Added warning for
8531         fields that exceed the line length.  Fixed infinite loop.
8532         (read_one_set_of_repetitions) Numerous minor changes for more
8533         complete SPSS compliance.  Message fixes.
8534
8535         * dfm.c: (dfm_close) If the file being closed is the inline file,
8536         read all the remaining data before closing it.
8537         (dfm_get_record) Don't close the file on lossage, as either it
8538         has been closed already or it doesn't belong to us.
8539
8540         * error.c: (puts_stdout) New function.
8541         (vmsg) Use puts_stdout instead of puts.
8542
8543         * file-handle.q: (fh_record_width) New function.
8544
8545         * inpt-pgm.c: (init_case) Fixed buffer overrun when inp_nval % 4
8546         == 0.
8547         (clear_case) Ditto.
8548         (input_program_source_read) Made an old kluge an approved method.
8549
8550         * lexer.c: (syntax_error) New function.
8551
8552         * misc.c: [BROKEN_RAND] (ansi_rand, ansi_srand; static var next)
8553         New.
8554
8555         * output.c: (oupt_get_paper_size) Message fix.
8556
8557         * q2c.c: Numerous fixes to formatting of generated code made to
8558         conform to GNU coding standards.  Uses syntax_error() in generated
8559         code.  Other miscellaneous generated message fixes.  Added support
8560         for broken systems that are missing EXIT_SUCCESS, EXIT_FAILURE,
8561         RAND_MAX, and/or strerror().
8562
8563 Sat Oct  4 02:09:56 1997  Ben Pfaff  <blp@gnu.org>
8564
8565         * data-in.c: Comment fixes.
8566
8567         * data-list.c: (struct repeating_data_trns) New member `id_spec'.
8568         (find_variable_input_spec) New function.
8569         (cmd_repeating_data) Initializes id_spec.
8570         (rpd_parse_record) Implemented.
8571         (read_one_set_of_repetitions) Returns -3 by default in order to
8572         kluge out some potential bugs.
8573
8574         * data-out.c: Comment fixes.
8575
8576         * file-type.c: (internal_cmd_record_type) Message fix.
8577
8578         * inpt-pgm.c: (input_program_source_read) Special temporary kluge
8579         for handling -3 return value.
8580
8581 Sat Sep 20 23:58:15 1997  Ben Pfaff  <blp@gnu.org>
8582
8583         * data-list.c: Comment fixes.
8584         (struct dls_var_spec) Reordered members.
8585         (read_from_data_list_fixed) Restructured.
8586         (struct repeating_data_trns) Reordered members.  Renamed `starts'
8587         as `starts_beg', `ends' as `starts_end'.
8588         (cmd_repeating_data) Calculates length of repeated data if
8589         necessary and possible.
8590         (parse_num_or_var) Don't allow string variables.
8591         (realize_value) New function.
8592         (rpd_msg) New function.
8593         (rpd_parse_record) New function.  Currently stubbed out.
8594         (read_one_set_of_repetitions) Implemented.
8595
8596         * inpt-pgm.c: (input_program_source_read) Comment fix.
8597
8598 Thu Sep 18 21:34:57 1997  Ben Pfaff  <blp@gnu.org>
8599
8600         * command.c: (cmd_end_repeat_p) Removed.
8601         (init_cmd_parser) Doesn't set cmd_end_repeat_p.
8602         (parse_cmd_name) Removed.
8603
8604         * data-list.c: Comment fixes.
8605         (data_list_pgm) Removed `eof' member.
8606         (static var first) New var.
8607         (cmd_data_list) Sets `first'.  Ensures that DATA LIST uses the
8608         FILE TYPE file inside FILE TYPE structures.
8609         (append_var_spec) Appends to *first, not dls.spec.
8610         (parse_fixed) Message fixes.
8611         (struct rpd_num_or_var) New.
8612         (struct repeating_data_trns) New.
8613         (static var rpd) New.
8614         (cmd_repeating_data) New function.
8615         (parse_num_or_var) New function.
8616         (parse_repeating_data) New function.
8617         (read_one_set_of_repetitions) New function.
8618
8619         * file-type.c: (cmd_file_type) Message fixes.  Always
8620         default_handle to FILE TYPE file handle.
8621         (internal_cmd_record_type) Message fixes.
8622
8623 Wed Aug 20 14:22:03 1997  Ben Pfaff  <blp@gnu.org>
8624
8625         * repeat.c: Comment fix.  Disable debugging.
8626
8627         * temporary.c: (restore_dictionary) Sets splits to NULL and
8628         n_splits to 0 before destroying the variables because now doing
8629         this tries to remove split variables.
8630
8631         * vars-atr.c: (discard_variables) Asserts that n_splits is 0 after
8632         destroying the dictionary.
8633         (clear_variable) Removes a variable from splits after destroying
8634         it.
8635
8636 Mon Aug 18 18:06:55 1997  Ben Pfaff  <blp@gnu.org>
8637
8638         * cmdline.c: (set_compat) Removed.
8639         (pick_compat) Removed.
8640         (parse_command_line) Removed -c option.
8641         (pre_syntax_message) Removed -c option.
8642         (usage) Remove compatibility code.
8643
8644         * common.h: (macros VER_PC, VER_WND, VER_X) Removed.
8645         (glob var compat) Removed.
8646
8647         * compute.c: (type_check) Fixed messages about type mismatches.
8648
8649         * data-list.c: (cmd_data_list) Removed compatibility code.
8650         (fixed_parse_compatible) Calls convert_negative_to_dash().
8651         Fixed bug where it only set the variable in fx.spec if it created
8652         the variable itself.
8653         (dump_fmt_list) Spelling fix.
8654         (cut_field) Removed compatibility code.
8655
8656         * dfm.c: (cmd_begin_data) Don't require a command terminator on
8657         BEGIN DATA command.
8658
8659         * expr-evl.c: (evaluate_expression) Implement LAG.
8660
8661         * expr-prs.c: (parse_add) Calls convert_negative_to_dash().
8662         (parse_neg) Calls convert_negative_to_dash().
8663         (LAG_func) Increases n_lag to the lag requested.  Fixed assignment
8664         bug.
8665
8666         * expr.h: (struct expression_struct) Removed member max_lag.
8667
8668         * file-type.c: (parse_col_spec) Calls convert_negative_to_dash().
8669         (internal_cmd_record_type) Removed special handling to produce
8670         negative numbers from dash tokens.
8671
8672         * getline.c: (static var DO_REPEAT_level) New var.
8673         (getl_add_DO_REPEAT_file) Increments DO_REPEAT_level.
8674         (handle_line_buffer) Copies the line into getl_buf; doesn't call
8675         copy_with_DO_REPEAT_substitutions().
8676         (getl_read_line) Maintains value of getl_mode.  Calls
8677         perform_DO_REPEAT_substitutions() whenever DO_REPEAT_level is
8678         positive.
8679         (getl_close_file) Decrements DO_REPEAT_level when appropriate.
8680
8681         * getline.h: (getl_mode) New glob var.
8682
8683         * glob.c: Comment fixes.
8684         (init_glob) Restructured.  Sets set_seed.
8685         (init_compat_dependent) Removed.  All references removed.
8686         (get_date) Format changed from MM/DD/YY to DD MMM YYYY.
8687         (__htonl, __htons) Removed.  (What were these for?)
8688
8689         * lexer.c: (static var tbl) Dash set to class CNUM.
8690         (make_hexit) New function from data-out.c.
8691         (get_token_representation) Rewritten.
8692         (convert_negative_to_dash) New function.
8693         (lex_init_compat_dependent) Removed.
8694         (yylex) A dash is parsed as part of a number if it is followed by
8695         a digit.  The ASCII representation of a number is copied to
8696         tokstr.  String parsing farmed out to parse_string().  Comment
8697         fixes.
8698         (bin_value_func, oct_value_func, hex_value_func, parse_string) New
8699         functions.
8700         (preprocess_line) Line processing depends on interactive/batch
8701         mode, not on compatibility mode.  Removed PC+ compatibility code.
8702
8703         * loop.c: (loop_3_trns_proc) Comment fix.
8704
8705         * main.c: Remove dead code.
8706         (main) Remove call to init_compat_dependent().
8707
8708         * misc.c: (convert_fmt_ItoO) Make E format conversion more
8709         conformant.
8710
8711         * print.c: (parse_string_argument) Calls
8712         convert_negative_to_dash().
8713         (fixed_parse_compatible) Calls convert_negative_to_dash().
8714
8715         * repeat.c: (RPT_* defines) Removed.
8716         (struct rpt_numeric) Removed.
8717         (struct repeat_entry) New member type, changed `replacement' from
8718         char * to char **.
8719         (clean_up) Deallocation adapted to new repeat_entry.
8720         (internal_cmd_do_repeat) `type' defaults to 0.  Remove lookahead()
8721         usage.  Creates vars for `type' of 1.
8722         (parse_ids) Sets type of 1.  Adapted to new repeat_entry.
8723         (store_numeric) Rewritten, new interface.
8724         (parse_numbers) Rewritten.
8725         (parse_strings) Rewritten.
8726         (find_DO_REPEAT_substitution) New function.
8727         (perform_DO_REPEAT_substitutions) New function.
8728         (copy_with_DO_REPEAT_substitutions) Removed.
8729         (debug_print) Rewritten.
8730
8731         * set.q: Comment fix.
8732         (custom_results) Removed compatibility code.
8733         (internal_cmd_set) Removed SET EMULATION subcommand.  Removed
8734         compatibility code.
8735
8736         * sysfile-info.c: (cmd_display) Removed compatibility code.
8737
8738         * tokens.h: Comment fixes.
8739         (token types enum) Removed `toktype' typedef name for this int
8740         type.  Removed SUBST.  Restructured.
8741
8742         * vars-atr.c: (discard_variables) Sets n_lag to 0.
8743
8744         * vars-prs.c: Comment fix.
8745
8746         * vfm.c: Comment fixes.
8747         (glob var n_lag) New var.
8748         (static vars lag_count, lag_head, lag_queue) New vars.
8749         (procedure) Removed argument nlag.
8750         (setup_lag) New function.
8751         (close_active_file) Discards lagging state.
8752         (lag_case) New function.
8753         (lagged_case) New function.
8754         (write_case) Lags a case if lagging.
8755
8756         * weight.c: (cmd_weight) Removed compatibility code.
8757         
8758 Sun Aug 17 22:34:40 1997  Ben Pfaff  <blp@gnu.org>
8759
8760         * getline.h: (struct getl_script) New members loop_index, macros.
8761
8762         * getline.c: (getl_add_file) Sets first_line field to NULL.
8763         (getl_add_DO_REPEAT_file) New function.
8764         (handle_line_buffer) When the current line's length is negative,
8765         set the filename and line number.  Increment line number after
8766         reading line.  Pass the line to
8767         copy_with_DO_REPEAT_substitutions() for processing.
8768         (getl_close_file) Free DO REPEAT lines before freeing the
8769         filename, and just set the filename to NULL when doing this,
8770         because otherwise the filename gets freed twice.
8771
8772         * glob.c: (glob var queuing) Removed.  All references removed.
8773
8774         * lexer.c: Comment fixes.
8775         (get_token_representation) New function.
8776
8777         * repeat.c: Comment fixes.
8778         (struct repeat_entry) Replaced type and v union members with a
8779         simple string.
8780         (append_record) New function.
8781         (internal_cmd_do_repeat) Started reforming it for the new
8782         repeat_entry struct.  Properly records filename changes in the
8783         getl_line_buf.  Fixed improper use of = for ==.  Fixed sense of
8784         strncasecmp() result usage.  Uses append_record() to simplify.
8785         Properly discards END REPEAT line.  Calls getl_add_DO_REPEAT_file
8786         to add in the file.
8787
8788         (copy_with_DO_REPEAT_substitutions) Started coding.
8789
8790         [DEBUGGING] (debug_print_lines) New function.
8791
8792         * set.q: (custom_results, internal_cmd_set) s/VER_PCP40/VER_PC/;
8793
8794         * tokens.h: (macro is_id1, is_idn) New macros.
8795
8796 Sat Aug 16 10:57:41 1997  Ben Pfaff  <blp@gnu.org>
8797
8798         * cmdline.c: (static var pre_syntax_message) Changed `win'
8799         compatibility mode to `wnd'.
8800
8801         * data-list.c: (fixed_parse_spss) Renamed
8802         fixed_parse_compatible().
8803
8804         * glob.c: (init_glob) Excise unused code for
8805         program_invocation_short_name.
8806
8807         * lexer.c: (preprocess_line) Leading indentors are ignored in Wnd
8808         as well as in X.
8809
8810         * print.c: (fixed_parse_spss) Renamed fixed_parse_compatible().
8811
8812         * set.q: `win' compatibility renamed `wnd'.
8813
8814 Thu Aug 14 22:11:12 1997  Ben Pfaff  <blp@gnu.org>
8815
8816         * filename.c: [__WIN32__] Change the included Windows header files
8817         (again).
8818         (absolute_filename_p) [__MSDOS__] A filename with a colon as the
8819         second character is absolute.
8820         (dirname) Fix logic error.  Don't printf() the results.
8821         (prepend_dir) Don't printf() the results.
8822
8823         * getline.c: (handle_line_buffer) New function.
8824         (getl_read_line) Reads line with handle_line_buffer() when
8825         appropriate.
8826         (getl_close_file) Discard line buffer data.
8827
8828         * getline.h: Comment fixes.
8829         (struct getl_line_list) New struct.
8830         (getl_script_struct) Added line buffer members.  These are hooks
8831         for use by DO REPEAT to allow it to insert virtual source code
8832         into the program.
8833
8834         * glob.c: (init_glob) [__DJGPP__ || (__WIN32__ && __BORLANDC__)]
8835         Override Borland C++ stupidity that claims Windows has a console
8836         window size of 0x3.
8837
8838         * repeat.c: This is in the process of being restructured from
8839         using a token-buffering approach to the DO REPEAT facility to
8840         using the more flexible approach of a line-buffering approach in
8841         conjunction with the getline module.  Comment fixes.
8842         (struct tok_struct) Removed.
8843         (static vars queue_index, queue_head, queue) Removed.
8844         (static vars line_buf_head, line_buf_tail) New vars.
8845         (internal_cmd_do_repeat) Instead of queuing tokens, queue lines.
8846         Not complete.
8847         (pull_queue, destroy_queue) Removed.
8848         [DEBUGGING] (debug_print_tokens) Removed.
8849
8850 Tue Aug  5 13:57:58 1997  Ben Pfaff  <blp@gnu.org>
8851
8852         * file-handle.q: (prepend_current_directory) New function.
8853         (internal_cmd_file_handle, fh_get_handle_by_filename) Prepends
8854         current directory before normalizing filename.
8855
8856         * filename.c: (gnu_getcwd) New function.
8857         (absolute_filename_p) New function.
8858         (search_path) New argument, PREPEND.  All references changed to
8859         pass NULL except those explicitly mentioned.  Uses
8860         absolute_filename_p().  Prepends PREPEND before trying the
8861         filename.
8862         (dirname, prepend_dir) New functions.
8863
8864         * getline.c: (getl_get_current_directory) New function.
8865         (getl_include) Passes getl_get_current_directory() as PREPEND arg
8866         to search_path().
8867                 
8868 Sun Aug  3 11:42:36 1997  Ben Pfaff  <blp@gnu.org>
8869
8870         * In several source files, the term `script' was replaced with
8871         `syntax file' inside error messages.  Usage of the term `script'
8872         in the sense of a syntax file is now deprecated.
8873
8874         * cmdline.c: (static vars pre_syntax_message, post_syntax_message)
8875         Updated messages.
8876
8877         * dump-sysfile.c: (usage) Update message.
8878
8879         * getline.c: (getl_read_line) Ignore lines beginning with `#!'.
8880
8881         * getline.h: (glob var getl_include_path) Declare extern.
8882
8883         * list.q: Define EXTERN as extern before #including somP.h.
8884
8885         * var.h: Remove declaration of `disptype' variable.
8886
8887         * vfm.c: (close_active_file) After switching the data sink to a
8888         data source, set vfm_sink to NULL, because it doesn't exist any
8889         more.
8890
8891 Thu Jul 17 21:41:44 1997  Ben Pfaff  <blp@gnu.org>
8892
8893         * glob.c: [__BORLANDC__] Include math.h.  Define _matherr() and
8894         _matherrl() to ignore all math errors.
8895
8896         * sfm-read.c: (read_value_labels) When reading the labels from
8897         disk, read the little parts separately instead of as a struct;
8898         this avoids alignment problems.
8899
8900         * sfm-write.c: (struct sfm_fhuser_ext) New member `elem_type'.
8901         (sfm_write_dictionary) Sets elem_type and frees it on lossage.
8902         (write_header) Allocates and initializes elem_type.
8903         (sfm_write_case) Uses elem_type to determine how to handle each
8904         flt64 element.
8905         (sfm_close) Frees elem_type.
8906
8907         * sfmP.h: Comment fix.
8908         [__BORLANDC__] Uses #pragma -a to adjust structure member
8909         alignment.
8910         
8911 Thu Jul 17 01:55:12 1997  Ben Pfaff  <blp@gnu.org>
8912
8913         * Makefile.am: (fiasco_SOURCES) Remove display.c.
8914
8915         * common.c: Fix typo.
8916
8917         * dfm.c: (read_record) Remove strncasecmp() emulation and fix the
8918         sense of the condition.
8919
8920         * expr-evl.c: (macro ALLOC_STRING_SPACE) [!PAGED_STACK] Add
8921         line-continuation backslash.
8922
8923         * filename.c: [__WIN32__] Include <windef.h> before <winbase.h>.
8924
8925         * frequencies.q: (custom_grouped, add_percentile) Don't use a
8926         non-constant expression as an argument to sizeof.
8927
8928         * glob.c: [__WIN32__ && __BORLANDC__] When including <conio.h>,
8929         undefine gettext macro because that's a conio function.
8930
8931         * hash.h: (hsh_prime_tab declaration) Remove.
8932
8933         * list.q: (write_fallback_headers) Move `leader' allocation out of
8934         main loop.  Change to local_alloc() allocation.
8935
8936         * output.h: Formatting fixes.  Put __attribute__ in right place on
8937         function prototypes.
8938
8939         * sfm-read.c: (read_machine_flt64_info, read_variables) Change
8940         incorrect `SECOND_LOWEST_VALUE' references to proper
8941         `second_lowest_value'.
8942
8943         * som-frnt.c: (EXTERN macro) Define as `extern' instead of null
8944         value.  This way 2 out of 3 of the som files define the vars
8945         extern, the correct way, that actually works under BC++.
8946         (som_set_float) Don't use nonconstant initializers for a struct.
8947
8948         * som-high.c: Add the standard alloca() header.
8949         (replicate_table) Add prototype.
8950
8951         Merged DISPLAY routine.
8952         * sysfile-info.c: (AS_*) New enum series.
8953         (cmd_sysfile_info) Gutted.  Calls describe_variable() to do the
8954         dirty work.
8955         (cmd_display, display_macros, display_documents,
8956         display_variables) Stolen from defunct display.c.
8957         (describe_variable) New function.
8958
8959         * temporary.c: [0] (display_tree) New debug function.
8960         (copy_variable) Performs shallow copy of value labels instead of
8961         deep copy; i.e., just copys the AVL tree and increments the
8962         reference counts.
8963
8964         * val-labs.c: Comment fixes.
8965         (do_value_labels) Optionally skip leading forward slash.
8966         (get_label) Creates only a single value label instead of many
8967         copies of one, and sets the reference count.
8968
8969         * display.c: Removed.
8970
8971         * dump-sysfile.c: New file, not yet complete.
8972
8973 Fri Jul 11 23:02:18 1997  Ben Pfaff  <blp@gnu.org>
8974
8975         For lots of source files I added more verbose_msg's.  These aren't
8976         listed below as they have tested as being benign.  In some cases
8977         these replaced debug_printf() calls.
8978
8979         * output.c: (outp_read_devices) Message fix.
8980
8981         * postscript.c: (output_encodings) Message fix.  Reports errors on
8982         fclose().
8983         (postopen) Message fix.
8984         
8985 Fri Jul 11 14:09:40 1997  Ben Pfaff  <blp@gnu.org>
8986
8987         * dfm.c: (dfm_close) Don't call fclose() for a NULL FILE.
8988
8989         * filename.c: (close_file_ext) Set f->file to NULL *after* closing
8990         it.
8991
8992         * main.c: Remove <malloc.h> #include.
8993
8994         * mis-val.c: (parse_numeric) Set .f member for each missing[]
8995         instead of trying to just set the missing[] itself, which is a
8996         gcc-specific idiom.
8997
8998         * sfm-read.c: (read_variables) Same.
8999
9000         * str.h: Add memmem() prototype.
9001
9002         * val-labs.c, var-labs.c: Replace <malloc.h> with <stdlib.h>.
9003
9004 Thu Jul 10 22:13:53 1997  Ben Pfaff  <blp@gnu.org>
9005
9006         * Makefile.am: (q2c) Don't include any libraries in the link.
9007
9008         * dfm.c: (force_line_buffer_extension) New macro.
9009         (count_tabs) New function.
9010         (tabs_To_spaces) New function.
9011         (read_record) Calls tabs_to_spaces() on the line being processed.
9012
9013         * q2c.c: Disabled i18n for this proglet so that libintl.a doesn't
9014         have to be compiled twice (once for CC, once for LOCAL_CC).
9015  
9016 Sun Jul  6 19:14:33 1997  Ben Pfaff  <blp@gnu.org>
9017
9018         * Makefile.am: (INCLUDES) Add intl directory; fix directories.
9019         (LDADD) Add @INTLLIBS@.
9020         (q2c) Add LIBS, @INTLLIBS@ to link step.
9021
9022         * inpt-pgm.c: Turn off debugging.
9023
9024         * postscript.c: (postopen) Format fix.  local_free() blocks
9025         returned by local_alloc(); don't free() them.
9026
9027 Sat Jul  5 23:44:51 1997  Ben Pfaff  <blp@gnu.org>
9028
9029         * data-in.c: (parse_string_as_format) Comment fix.  Fix check for
9030         string length.
9031
9032         * data-list.c: (read_from_data_list_fixed) Pass proper value for
9033         LEN arg, not simply the full string length.
9034
9035         * sort.c: (allocate_file_handles) Check SPSS compatible temp file
9036         directories before generic temp file directories.
9037
9038         * vfm.c: Disable debugging.
9039
9040 Fri Jul  4 13:26:41 1997  Ben Pfaff  <blp@gnu.org>
9041
9042         * get.c: Comment fix.
9043         (cmd_save_internal) Always passes GTSV_OPT_SAVE option.
9044
9045 Wed Jun 25 22:52:28 1997  Ben Pfaff  <blp@gnu.org>
9046
9047         * expr-prs.c: (debug_print_postfix) Conditionally included on
9048         GLOBAL_DEBUGGING.  Removed out_header() reference.
9049
9050         * exprP.h: Removed #undef GLOBAL_DEBUGGING.
9051
9052 Sun Jun 22 22:00:28 1997  Ben Pfaff  <blp@gnu.org>
9053
9054         * ascii.c: Removed obsolete ascii_close_page() prototype.
9055
9056         * command.c: (output_line) Comment fix.
9057
9058         * data-in.c: Formatting fix.
9059         (parse_string_as_format) Now the `fc' argument is used only for
9060         the purpose of error messages; it is not an index into the string
9061         passed.  All references changed.
9062
9063         * data-list.c: Comment fix.
9064         (cut_field) Comment fix.  Now returns the column number of the
9065         position of the field cut out on success.
9066         (parse_field) Added `column' argument.  Puts the column numbers in
9067         the error message.
9068         (read_from_data_list_free, read_from_data_list_list) Record the
9069         column number returned by cut_field(), pass it to parse_field().
9070
9071         * dfm.c: Comment fix.
9072
9073         * do-ifP.h: Comment fix.
9074
9075         * expr-prs.c: (SYSMIS_func) Implemented string-type arguments for
9076         the SYSMIS function.
9077
9078         * expr.h, exprP.h: Comment fix.
9079
9080         * glob.c: (init_glob) Only calls setlocale() and family if
9081         ENABLE_NLS set.
9082
9083         * hash.h: Comment fix.
9084
9085         * include.c: Comment fix.
9086
9087         * output.c: Comment fix.
9088
9089         * postscript.c: (ps_line_intersection) Simplified assertion.
9090
9091         * repeat.c: Comment fix.
9092
9093         * vars-atr.c: Comment fix.
9094
9095         * vars-prs.c: Comment fix.
9096
9097         * vfm.c: (vector_initialization) [DEBUGGING] Fixed undefined
9098         behavior with usage of postincrement.
9099         (memory_stream_read) Discards cases as it goes. 
9100
9101 Sun Jun 15 16:45:17 1997  Ben Pfaff  <blp@gnu.org>
9102
9103         * Makefile.am: Cleans q2c, not just distcleans it.  Distcleans
9104         foo.
9105
9106         * Most source files: Includes debug-print.h, related comment
9107         fixes.
9108
9109         * cases.c: (alloc_val) Removed complex allocation code.  Merely
9110         increments default_dict.nval and returns the former value.
9111         (envector, devector) Removed references to lv member of struct
9112         variable.
9113
9114         * common.h: (macro VME) Replaced complex definition with simple
9115         one.
9116
9117         * data-list.c: (cmd_data_list) Sets vfm_source instead of
9118         read_active_file and cancel_input_pgm.
9119         (read_from_data_list, cancel_data_list) Removed.
9120         (data_list_source_read, data_list_source_destroy_source) New
9121         functions.
9122         (glob var data_list_source) New var.
9123
9124         * dfm.c: (open_file_r, open_file_w) Simplified debug output.
9125         (cmd_begin_data) Improved criteria for an input program accessing
9126         the inline file.  Still not perfect.
9127
9128         * do-if.c: (do_if_trns_proc) Simplified debug output.
9129
9130         * expr-prs.c: Comment fixes.
9131         [DEBUGGING] (debug_print_postfix) Simplified debug output.
9132
9133         * file-handle.q: (fh_close_handle) Simplified debug output.
9134
9135         * file-type.c: Comment fixes.
9136         (cmd_file_type) Sets vfm_source instead of read_active_file and
9137         cancel_input_pgm.
9138         (cmd_end_file_type) On failure, discards variables in place of
9139         just canceling the input program.
9140         (read_from_file_type) Renamed file_type_source_read.
9141         (cancel_file_type) Renamed file_type_source_destroy_source.
9142         (glob var file_type_source) New var.
9143
9144         * get.c: (GTSV_* enum series) New enums GTSV_OPT_SAVE, GTSV_NONE.
9145         (cmd_get) Initializes options to GTSV_NONE before passing to
9146         trim_dictionary().  Removed `lv' reference.  Sets vfm_source
9147         instead of read_active_file and cancel_input_pgm.
9148         (cmd_save_internal) Initializes options before passing to
9149         trim_dictionary().  Local var `nval' removed.
9150         (dict_delete_run) Comment fixes.
9151         (trim_dictionary) Comment fixes.  Disallows scratch variables if
9152         GTSV_OPT_SAVE set in options.
9153         (read_from_get) Renamed get_source_read.
9154         (cancel_get) Renamed get_source_destroy_source.
9155         (glob var get_source) New var.
9156
9157         * inpt-pgm.c: (cmd_input_program) Sets vfm_source instead of
9158         read_active_file and cancel_input_pgm.
9159         (read_from_input_program) Renamed input_program_source_read.
9160         Simplified debug output.
9161         (cancel_input_program) Renamed
9162         input_program_source_destroy_source.
9163         (glob var input_program_source) New var.
9164
9165         * loop.c: (loop_1_trns_proc) Simplified debug output.
9166
9167         * main.c: (dump_token) Made eof output more explicit.
9168
9169         * sfm-read.c: (read_variables, dump_dictionary) Removed `lv'
9170         references.
9171
9172         * sort.c: (cmd_sort_cases) Disallows scratch variables.  Removed
9173         code for always-memory or always-disk cases.  malloc's case-list
9174         based on vfm_source_info.ncases.  Explicit support for
9175         memory_stream via memory_source_cases.
9176         (do_external_sort) Sets vfm_source instead of read_active_file and
9177         cancel_input_pgm.
9178         (allocate_file_handles) The temporary directory permissions are
9179         set to 0700 instead of 0777.
9180         (allocate_cases) Formatting fixes.  Simplified debug output.
9181         (output_record) Compacts the case if necessary before writing it
9182         out.
9183         (close_handle, open_handle_w) Simplified debug output.
9184         (write_initial_runs) Destroys vfm_sink, then sets it to
9185         sort_stream.  Writes records to memory based on
9186         vfm_sink_info.case_size.
9187         (write_to_sort_cases) Renamed sort_stream_write().
9188         (merge) Simplified error handling.  Simplified debug output.
9189         Formatting fixes.
9190         (read_from_external_sort) Renamed sort_stream_read().
9191         Reads records based on vfm_source_info.case_size.
9192         (sort_stream_write) Writes records to memory based on
9193         vfm_sink_info.case_size.
9194         (sort_stream_mode) New function.
9195         (glob var sort_stream) New variable.
9196
9197         * temporary.c: (cmd_temporary) Simplified debug output.
9198         (copy_variable) Removed references to `lv'.
9199
9200         * title.c: (get_title) Simplified debug output.
9201
9202         * var.h: Comment fixes.
9203         (struct get_proc) Removed member `lv'.
9204         (struct variable) Removed member `lv'.  Comment fixes.
9205         (glob vars read_active_file, write_active_file, cancel_input_pgm)
9206         Removed.
9207         (struct case_stream) New.
9208
9209         * vars-atr.c: (discard_variables) Changed cancel_input_pgm,
9210         read_active_file references to use vfm_source.
9211         (init_variable, replace_variable) Removed references to `lv'.
9212
9213         * vfm.c: Comment fixes.
9214         (glob var vfm_source, vfm_sink, vfm_source_info, vfm_sink_info)
9215         New variables.
9216         (static var queue, qh, qt, n_lag) Removed.  All references
9217         removed.
9218         (glob var compaction_necessary, compaction_nval, compaction_case,
9219         paging) New variables.
9220         (record_case) Removed.
9221         (procedure) Comment fixes.  Calls vfm_source->read() instead of
9222         read_active_file().
9223         (lag) Removed.
9224         (prepare_for_writing, arrange_compaction, make_temp_case,
9225         vector_initialization, setup_filter) New function.
9226         (open_active_file) Most of the code moved into the abovementioned
9227         new functions.  Now sets temp_dict to &default_dict if there is no
9228         temporary dictionary, for convenience.  New debug output.
9229         (close_active_file) Deals with changing the sink to the source.
9230         Calls finish_compaction().  Frees compaction_case.  Mostly
9231         rewritten.
9232         (glob vars disk_source_file, disk_sink_file) New vars.
9233         (destroy_active_file, read_from_memory) Removed.
9234         (disk_stream_init, disk_stream_read, disk_stream_write,
9235         disk_stream_mode, disk_stream_destroy_source,
9236         disk_stream_destroy_sink) New functions.
9237         (glob var vfm_disk_stream) New var.
9238         (glob vars memory_source_cases, memory_sink_cases,
9239         memory_sink_iter, memory_sink_max_cases) New vars.
9240         (memory_stream_init, memory_stream_read, memory_stream_write,
9241         memory_stream_mode, memory_stream_destroy_source,
9242         memory_stream_destroy_sink) New functions.
9243         (glob var vfm_memory_stream) New var.
9244         (write_case) Local var `i' renamed `cur_trns'; local var `retval'
9245         named `more_cases'.  Simplified debug output.  Otherwise mostly
9246         rewritten.
9247         (record_case) Moved into the stream drivers.  Removed.
9248         (transform) Removed (was dead code).
9249         (SPLIT_FILE_procfunc) s/vfm_replacement/vfm_sink_info/.  In the
9250         common case that the splits don't change, we don't need to copy
9251         the case into prev_case again--pointless.
9252         (compact_case) New function.
9253         (finish_compaction) New function.
9254
9255         * vfmP.h: Comment fixes.
9256         (DEV_* enum series) Removed. 
9257         (struct storage) Renamed `stream_info'.  Removed variant record.
9258         Removed `device' member.
9259
9260         * debug-print.h: New file.
9261         
9262 Sun Jun  8 01:12:38 1997  Ben Pfaff  <blp@gnu.org>
9263
9264         * autorecode.c: Turned off debugging.
9265
9266         * data-list.c: (destroy_dls) Closes the associated file handle.
9267
9268         * descript.q: (custom_variables) Added PV_NO_SCRATCH to
9269         parse_variables() options.
9270
9271         * dfm.c: (open_file_r) Removed gratuituous argument to msg() call.
9272
9273         * display.c: (display_variables) Really fixed null cell bug.
9274
9275         * file-handle.q: (fh_close_handle) Changed debugging message.
9276
9277         * frequencies.q: (custom_variables) Added PV_NO_SCRATCH to
9278         parse_variables() options.
9279
9280         * list.q: Added PV_NO_SCRATCH in q2c varlist options.
9281         (cmd_list) Fails if no variables specified.
9282         (determine_layout) Writes blank lines manually.
9283
9284         * loop.c: (loop_1_trns_proc) Made debugging code only print
9285         messages if debugging.
9286
9287         * q2c.c: (dump_subcommand) Appends sbc->message to SBC_VARLIST
9288         parse_variables() arguments.
9289         (main) Parses optional parenthesized options to varlist
9290         subcommands into sbc->message.
9291
9292         * sfm-read.c: Format fix.
9293
9294         * var.h: (FV_*) New enum series.
9295         (PV_*) New enum PV_NO_SCRATCH.
9296
9297         * vars-prs.c: (find_var) Removed.
9298         (fill_all_vars) Takes FV_* enum instead of boolean third
9299         argument.  Rewritten to deal with scratch as well as system
9300         variables.
9301         (parse_variables) Error message on scratch variable if
9302         PV_NO_SCRATCH set.
9303
9304         * vfm.c: (static var virt_begin_func) New var.
9305         (procedure) Sets up virt_begin_func.
9306         (SPLIT_FILE_procfunc) For the first case, calls virt_begin_func()
9307         after dump_splits().  For succeeding groups changes, calls
9308         virt_begin_func() instead of begin_func().      
9309
9310 Fri Jun  6 22:42:23 1997  Ben Pfaff  <blp@gnu.org>
9311
9312         * count.c, data-out.c, file-handle.q, list.q, loop.c: Turned off
9313         debugging.
9314
9315         * dfm.c: Added some debugging messages, disabled by default.
9316         (open_file_r) Fixed error message.
9317         (read_record) On eof on inline_file, instead of calling
9318         fh_close_handle(), simply jump to eof label like a normal file.
9319         Message fixes.
9320
9321         * display.c: Thin lines between rows for certain kinds of
9322         listing.  Fixed `null cell' bug.
9323
9324         * error.c: (failure) Flush stdout, stderr before failing.
9325
9326         * file-handle.q: (fh_close_handle) Added debugging message.
9327
9328         * frequencies.q: (dump_full) Bottom line extends across entire
9329         table width.  Changed title formatting.
9330         (dump_condensed) Changed title formatting.
9331         (dump_statistics) Fixed title formatting.
9332
9333         * glob.c: (init_glob) Moved initialization of cur_proc out of #if.
9334         Sets default value of set_format.
9335
9336         * list.q: (cmd_list) Calls blank_line() before determine_layout().
9337         Passes write_all_headers() to procedure() as pre-group func.
9338         (write_all_headers) New function.
9339         (determine_layout) Removed calls to write_header().
9340         Calls blank_line() before and after write_fallback_headers().
9341
9342         * recode.c: (recode_trns_free) Only attempts to free head->map if
9343         non-NULL.
9344
9345         * sfm-read.c: (read_variables) Allows `#' at beginning of system
9346         file variable names but gives a warning.  Sets `left' based on
9347         first character being/not being `#'.  On lossage frees dict->var.
9348
9349         * som-high.c: (som_draw_title) Simplified title formatting.
9350
9351         * vfm.c: (dump_splits) Fixed and changed splits formatting.
9352
9353 Thu Jun  5 22:51:15 1997  Ben Pfaff  <blp@gnu.org>
9354
9355         * autorecode.c: (cmd_autorecode) Sets h_trans to NULL at
9356         beginning.  Frees v_src, v_dest on successful exit.  Frees
9357         h_trans[*], h_trans on lossage.
9358         (recode) Frees h_trans[*], h_trans.
9359
9360         * dfm.c: (dfm_close) Formatting change.
9361         (open_inline_file) Now passed a dfm_fhuser_ext to initialize; no
9362         longer allocates its own in inline_file.
9363         (open_file_r) Passes the local dfm_fhuser_ext to
9364         open_inline_file().
9365         (open_file_w) Message fix. 
9366         (read_record) Buffer reallocation strategy changed.  Frees
9367         ext->line even in inline_file to prevent leaks.
9368         (dfm_put_record) Fixed bug where `ext' was cached before the file
9369         was opened and thus it would be NULL when the file really was
9370         open.
9371         (cmd_begin_data) Sets up inline_file basics itself, then calls
9372         open_inline_file() for the dfm_fhuser_ext.  Formatting fix.
9373
9374         * list.q: (write_line) Formatting fix.
9375         (clean_up) Minor strategy change.  Sets proportional font after
9376         finishing cleanup.
9377         (determine_layout) Sets fixed font before writing regular headers,
9378         or after writing fallback headers.
9379
9380         * modify-vars.c: (cmd_modify_vars) Frees variable lists for DROP
9381         and KEEP vars after using them.
9382
9383         * postscript.c: (ps_init_driver) Frees x->family.
9384         (postopen) When loading fonts, free the temporary font name buffer
9385         after using it.
9386         (ps_text_set_font_by_position) Free temporary font name buffer
9387         after using it.
9388         (text) Fixed code that calculated `lig' so that `lig' always gets
9389         initialized.  Formatting fix.
9390
9391         * som-low.c: (get_cell_size, som_get_table_size) `prop_height' ->
9392         `font_height'.
9393         [GLOBAL_DEBUGGIGN] (check_table) Use arena_alloc() to allocate
9394         cells, not xmalloc(), so that the cells will get destroyed
9395         automatically.
9396
9397         * sysfile-info.c: (cmd_sysfile_info) Frees the dictionary after
9398         using it.
9399
9400 Tue Jun  3 23:33:22 1997  Ben Pfaff  <blp@gnu.org>
9401
9402         * ascii.c: (ascii_text_draw) Always sets metrics for strings that
9403         are drawn.
9404
9405         * dfm.c: Comment fix.
9406
9407         * list.q: Comment fixes.  Include somP.h.  Removed static vars
9408         table, n_columns, n_rows, part.  New struct list_ext.  New static
9409         var line_buf.
9410         (n_lines_remaining, n_chars_width, write_line) New functions.
9411         (cmd_list, list_cases) Rewritten.
9412         (begin_row, end_row, flush_table) Removed.
9413         (write_header, clean_up, write_varname, write_fallback_headers,
9414         determine_layout) New functions.
9415
9416         * output.c: (outp_iterate_enabled_drivers) Minor reformat.
9417
9418         * output.h: Comment fix.
9419
9420         * postscript.c: Comment fix.
9421         (struct ps_driver_ext) Removed prop_size, fixed_size members;
9422         added font_size.  All references changed.
9423         (ps_init_driver) Initializes font_size.  Simplified space checking
9424         code.
9425         (static var option_tab[]) Removed prop-size, fixed-size; added
9426         font-size.
9427         (ps_option) Handles font_size.
9428
9429         * som-high.c: Moved prototypes into somP.h.
9430         (som_init_driver) New function.
9431         (som_submit_table) Moved some code into new function
9432         som_init_driver().
9433         (build_target) Moved some code into new function
9434         som_internal_eject_page().
9435         (som_eject_page) Uses som_internal_eject_page().
9436         (som_internal_eject_page) New function.
9437
9438         * som-low.c: Moved prototypes into somP.h.
9439
9440         * som.h: Formatting fixes.
9441
9442         * somP.h: (struct som_driver_ext) Removed em_width;
9443         added prop_em_width, fixed_width.
9444
9445 Mon Jun  2 14:25:25 1997  Ben Pfaff  <blp@gnu.org>
9446
9447         * Makefile.am: Added `localedir' definition.  Added
9448         -DLOCALEDIR="..." to DEFS.  Added -I. to INCLUDES.
9449
9450         * ascii.c: (macro draw_line) Fixed capitalization.
9451
9452         * ascii.c, autorecode.c, cases.c, cmdline.c, command.c, common.c,
9453         compute.c, count.c, data-in.c, data-list.c, data-out.c,
9454         descript.q, dfm.c, display.c, do-if.c, error.c, expr-evl.c,
9455         expr-opt.c, expr-prs.c, file-handle.q, file-type.c, filename.c,
9456         formats.c, frequencies.q, get.c, getline.c, glob.c, groff-font.c,
9457         hash.c, heap.c, include.c, inpt-pgm.c, lexer.c, list.q, loop.c,
9458         main.c, mis-val.c, misc.c, modify-vars.c, numeric.c, output.c,
9459         postscript.c, print.c, q2c.c, recode.c, rename-vars.c, repeat.c,
9460         sample.c, sel-if.c, sfm-read.c, sfm-write.c, sfmP.h, som-frnt.c,
9461         som-high.c, som-low.c, sort.c, split-file.c, sysfile-info.c,
9462         temporary.c, title.c, tokens.h, val-labs.c, var-labs.c,
9463         vars-atr.c, vars-prs.c, vector.c, vfm.c, weight.c: Marked strings
9464         for internationlization.
9465
9466         * glob.c: [HAVE_LOCALE_H] Includes locale.h.
9467
9468 Sun Jun  1 23:31:18 1997  Ben Pfaff  <blp@gnu.org>
9469
9470         * do-if.c, sort.c, val-labs.c: Comment fixes.
9471
9472         * glob.c: (init_glob) Uncommented, updated i18n support.
9473         
9474         * arena.c, ascii.c, data-in.c, descript.q, error.c, expr-evl.c,
9475         expr-opt.c, expr-prs.c, filename.c, frequencies.q, groff-font.c,
9476         output.c, postscript.c, sfm-read.c, som-high.c, vars-prs.c: Made
9477         the declarations of macros taking arguments a lot nicer.
9478
9479 Sun Jun  1 17:22:04 1997  Ben Pfaff  <blp@gnu.org>
9480
9481         * error.h: Removed CE, CW aliases for SE, SW.
9482
9483         * q2c.c: Removed explicit streq() definition since it's duplicated
9484         in str.h.
9485         
9486         * approx.h, error.h, font.h, hash.h, misc.h, output.h, somP.h,
9487         stats.h, str.h, tokens.h: Made the declarations of macros taking
9488         arguments a lot nicer-looking of <pinard@iro.umontreal.ca>.
9489         Comment fixes.
9490
9491 Sun Jun  1 12:02:06 1997  Ben Pfaff  <blp@gnu.org>
9492
9493         * cmdline.c: Comment fixes.
9494         (pick_compat) Changed return type to int.  Now, instead of setting
9495         glob var `compat' to the emulation, returns the emulation.  All
9496         references changed.
9497         (parse_command_line) Added terminating null to end of
9498         `long_options' array definition.
9499         (pre_syntax_message) Fixes.
9500         (usage) Shows the default emulation in the syntax message by
9501         calling pick_compat().
9502
9503         * getline.c: (getl_add_include_dir) Separates paths with
9504         PATH_DELIMITER, not DIR_SEPARATOR.
9505
9506         * glob.c: (init_glob) Fixed references to DEFAULT_VER_PCP40,
9507         DEFAULT_VER_WIN61, DEFAULT_VER_X40.
9508
9509         * output.c: (outp_configure_macro) Make earlier definitions for a
9510         particular key override later ones for the same key.
9511         
9512 Fri May 30 19:40:49 1997  Ben Pfaff  <blp@gnu.org>
9513
9514         * ascii.c: Comment fixes.
9515
9516         * output.c: (outp_get_paper_size)
9517         s/STAT_OUTPUT_INIT_FILE/STAT_OUTPUT_PAPERSIZE_FILE/.
9518         
9519 Sun May 25 22:34:07 1997  Ben Pfaff  <blp@gnu.org>
9520
9521         * ascii.c, postscript.c, sfm-read.c, sfm-write.c, sort.c: Include
9522         <errno.h>.  GNU libc 2 enforces this!
9523
9524         * command.c: (parse_cmd) Fixed problem with `else' clause being
9525         paired with wrong `if'.  Comment fix.
9526
9527 Fri May  9 16:53:52 1997  Ben Pfaff  <blp@gnu.org>
9528
9529         * getline.c: [!HAVE_LIBREADLINE] (read_console) Changed
9530         blp_getline() to getline().
9531
9532         * output.c: (outp_eval_dimension) Changed the fix from last time;
9533         there was no variable `a'.
9534
9535         * q2c.c: (get_line) Fixed boundary condition overrun bug.
9536
9537 Mon May  5 21:58:22 1997  Ben Pfaff  <blp@gnu.org>
9538
9539         * output.c: (outp_evaluate_dimension) Fixed handling of negative
9540         numbers having fractional parts.  Added case of a fraction without
9541         a whole-number part.
9542
9543 Fri May  2 22:08:05 1997  Ben Pfaff  <blp@gnu.org>
9544
9545         * ascii.c: (ascii_text_get_font_position) Removed.
9546
9547         * expr.h, exprP.h: Disabled debugging.
9548
9549         * groff-font.c, postscript.c: Changed `groff' to `Groff' in
9550         several places.
9551
9552         * output.h: (struct outp_class_struct) Removed
9553         text_get_font_position method.  All references deleted.
9554
9555         * postscript.c: Big change here.  Fontmaps were completely
9556         eliminated because of a change in philosophy.  Comment fixes.
9557         (struct ps_fontmap, ps2dit_map, font_family, dit2family_map)
9558         Removed.
9559         (struct ps_driver_ext) `position', `fontmap', `prop_name',
9560         `fixed_name' members removed.  New members `prop_family',
9561         `fixed_family'.  `family' member changed to type char *.
9562         (static var ps_fontmaps) Removed.
9563         () Removed.
9564         (ps_init_driver) Removed obsolete references, updated.
9565         Initializes `translate_x', `translate_y', `scale'.  Doesn't read
9566         fontmap, of course.  Refers to font names through internal_name
9567         rather than subversive means.  Frees proper items.
9568         (static var option_tab[]) Removed `fontmap-file' option; renamed
9569         `fixed-font', `prop-font'.
9570         (ps_option) Corresponds to option_tab[].
9571         (read_fontmap, release_fontmap, ps_to_dit, compare_ps2dit,
9572         hash_ps2dit, compare_dit2family, hash_dit2family, compare_family,
9573         hash_family) Removed.
9574         (postopen) Generates font names from family names.  Gets
9575         PostScript font name properly.  New prologue file comment `!!!'
9576         style.
9577         (ps_open_page) Adds translate_x, translate_y to BP prologue
9578         function; gives SF argument floating-point format.
9579         (ps_text_set_font_by_name) Doesn't try to map PostScript->Groff
9580         font name.  Doesn't change font family.
9581         (ps_text_set_font_by_position) Generates Groff font name from font
9582         family name instead of through table lookup.
9583         (ps_text_set_font_by_family) Renamed `ps_text_set_font_family',
9584         all references changed.  Reduced to simple string assignment.
9585         (ps_get_font_name) Removed.
9586         (ps_get_font_family) Reduced to string return.
9587         (text) Doesn't save `position' since it no longer exists.  Ugly
9588         kluge to save font family--fix soon?
9589         (load_font) Removed PostScript name argument.
9590         
9591 Thu May  1 14:58:59 1997  Ben Pfaff  <blp@gnu.org>
9592
9593         * postscript.c: Comment fix.
9594         (ps_open_page) Puts scale factor in PostScript output.
9595         
9596 Sat Apr 26 11:49:32 1997  Ben Pfaff  <blp@gnu.org>
9597
9598         * Makefile.am: Distcleans q2c.
9599
9600 Wed Apr 23 21:33:48 1997  Ben Pfaff  <blp@gnu.org>
9601
9602         * ascii.c: (delineate) Sets text size even if width is zero.
9603
9604         * command.c: Comment fix.
9605         (static var cmd_table[]) Re-enabled EVALUATE command.
9606         (parse_cmd) Lotsa comment fixes.  Fixed infinite loop in parsing
9607         of comments in script files.  Now more liberal on criteria for
9608         performing a state transition--if *anything* happened correctly,
9609         not just if *everything* happened correctly.
9610
9611         * data-out.c: (convert_F) Comment fix.  Why in the fsck does
9612         Checker segfault on formatting large numbers and why in the fsck
9613         hadn't I noticed this before?
9614
9615         * expr.h, exprP.h: No longer turn off GLOBAL_DEBUGGING.
9616
9617         * list.q: (cmd_list) Commented out the actual output routine
9618         because of various problems.  Probably will abandon the idea of
9619         using the general `crushed tables' for the LIST procedure.
9620
9621         * temporary.c: (restore_dictionary) Sets var_by_name to NULL after
9622         clearing it.  Allocates a new var_by_name dictionary before trying
9623         to add members to it.
9624
9625         * vars-atr.c: [DEBUGGING] (dump_one_var_node) Removed argument
9626         `sib'.  Changed type of `node' argument.
9627         [DEBUGGING] (dump_var_tree) Replaced avlwalk() with
9628         avl_walk_inorder().
9629         (clear_variable) Only dumps the var tree if var_by_name non-NULL.
9630         [DEBUGGING] Only deletes the variable from var_by_name if that var
9631         non-NULL.
9632
9633 Fri Apr 18 16:48:41 1997  Ben Pfaff  <blp@gnu.org>
9634
9635         * Makefile.am: Added include files to SOURCES.  Added
9636         frequencies.q to EXTRA_DIST.  Removed include/ from INCLUDES.  Now
9637         includes rules for q2c.  Added `boast' target.
9638
9639 Fri Apr 18 15:42:22 1997  Ben Pfaff  <blp@gnu.org>
9640
9641         * Makefile.am: Maintainer-clean Makefile.in.
9642         
9643         * Makefile.am: Fixed redundant EXTRA_DIST line.
9644
9645         * ascii.c: Comment fixes.
9646         (ascii_line_vert) Fixed overly aggressive range check.
9647
9648         * display.c: Removed dead code.
9649
9650         * list.q: Turn debugging on.
9651         (flush_table) New debug code.
9652
9653         * sfm-read.c: (read_value_labels) malloc's the structure before
9654         trying to assign to its members.
9655
9656         * sfm-write.c: Comment fix.
9657
9658         * som-high.c: (som_submit_table) Sets som.t and som.d on each call
9659         to output_table().
9660         (output_table) No arguments anymore--gets them through `som'
9661         global.  New debug code.  In crushed tables, now sets `htv' as
9662         well as `hv' to avoid bad confusion later.
9663         (dump_crush_page) New debug code.
9664
9665         * som-low.c: (som_dump_crush_page) New debug code.
9666
9667 Thu Mar 27 01:11:29 1997  Ben Pfaff  <blp@gnu.org>
9668
9669         All source files: Broke long lines into multiple lines.
9670         
9671         * ascii.c: (ascii_close_page) Uses host_system var in place of
9672         HOST_SYSTEM constant.
9673
9674         * cmdline.c: (var syntax_message[]) Broke into
9675         pre_syntax_message[] and post_syntax_message[].
9676         (usage) Outputs both parts, separated by driver list.
9677
9678         * error.h: Fixed broken formatting.
9679
9680         * expr-opt.c: (str_search, str_rsearch) New functions.
9681
9682         * misc.c: (blp_getdelim) Removed.  All references changed to
9683         `getdelim'.
9684         (str_search, str_rsearch) Removed.
9685         (memrmem) New function.
9686
9687         * misc.h: (blp_getline) Removed.  All reference changed to
9688         `getline'.
9689
9690         * stat.h: New file.
9691
9692         * filename.c: Includes "stat.h", not <sys/stat.h>.
9693         (blp_getenv) Uses host_system var instead of HOST_SYSTEM constant.
9694
9695         * output.c: (outp_list_classes) Changed output formatting.
9696
9697         * sfm-write.c: (write_header) Uses host_system var instead of
9698         HOST_SYSTEM constant.
9699         (write_rec_7_34) Extracts version numbers from the version string.
9700         Untested.
9701
9702         * sort.c: Includes "stat.h", not <sys/stat.h>.
9703
9704         * str.c: (strcasecmp) Removed.
9705
9706         * title.c: (cmd_document) Uses host_system var instead of
9707         HOST_SYSTEM constant.
9708
9709         * version.c: Generated on-the-fly by the Makefile instead of being
9710         static.
9711
9712         * str.h: Comment fixes.  Doesn't substitute for missing memmove or
9713         memcpy.
9714         [!HAVE_STRNCASECMP] Declares strncasecmp().
9715
9716         * version.h: Removed stray character.  Comment fixes.
9717         (vars host_system, build_system) New vars.
9718
9719 Mon Mar 24 21:47:31 1997  Ben Pfaff  <blp@gnu.org>
9720
9721         * Most source files: Changed formatting of copyright notice; fixed
9722         FSF address; reformatted to better conform to GNU standards;
9723         comment fixes.  Added markups to prevent GNU indent from messing
9724         up my beautiful formatting :-).
9725         
9726         * q2c.c: (get_line) Ignores lines that begin with `/* *INDENT' so
9727         that GNU indent markups can be passed through without problems.
9728
9729 Wed Feb 19 21:30:31 1997  Ben Pfaff  <blp@gnu.org>
9730
9731         * get.c: Turned off debugging.
9732
9733         * glob.c: (init_glob) Turned on save-file compression by default.
9734
9735         * sfm-write.c: (sfm_write_case) Fixed bug which resulted in less
9736         compression than was possible in save files.
9737
9738 Sun Feb 16 20:57:20 1997  Ben Pfaff  <blp@gnu.org>
9739
9740         * data-out.c: (convert_F) Comment fixes.  Debug message fixes.
9741
9742         * frequencies.q: Removed Fiasco extensions.  Updated calculation
9743         algorithms.  Polished output format. 
9744         (struct frq_info_struct) Removed members `max_degree', `min_n',
9745         all references removed.
9746         (macro frq_extensions) Removed.
9747         (static vars min_n, max_degree) Removed, all references removed.
9748         (internal_cmd_frequencies) Doesn't handle extensions.  Doesn't
9749         calculate `min_n', `max_degree'.
9750         (postcalc) Passes new arg to dump_statistics().
9751         (dump_full) Honor NOLABEL option.  Buggy?  Adds variable name
9752         title.
9753         (dump_condensed) Adds variable name title.
9754         (sum_freqs) Removed.
9755         (calc_stats) Updated calculation algorithm.
9756         (dump_statistics) Removed warning for too-few observations.
9757         Changed table formatting.  Adds variable name title if passed new
9758         arg is nonzero.
9759
9760         * output.h: Comment fix.
9761
9762         * recode.c, sample.c, sort.c: Disabled debug code.
9763
9764         * som-frnt.c: (som_set_value, som_set_float, som_set_text)
9765         Improved debug code.
9766
9767         * var.h: (enum series frq_*) Removed Fiasco extensions.
9768
9769 Sat Feb 15 21:26:53 1997  Ben Pfaff  <blp@gnu.org>
9770
9771         * command.c: Added PROCESS IF to command table.
9772
9773         * Lots & lots of places, removed checks for NULLs preceding calls
9774         to free_expression(), which itself checks.
9775
9776         * descript.q: Removed Fiasco extensions.  Removed optimizations
9777         for non-weighted active files.  Implemented some options.
9778         Finished polishing output format.  Comment fixes.  Merged
9779         `descript.g'.
9780         (static vars n_glob_miss_list, n_glob_valid, n_glob_missing,
9781         max_degree, min_n) Removed.
9782         (macro dsc_extensions) Removed.
9783         (struct dsc_info_struct) Removed `min_n' member, all references
9784         fixed.
9785         (internal_cmd_descriptives) Removed calculation of min_n,
9786         max_degree.  Only deals with one `calc' routine instead of two
9787         flavors.
9788         (precalc) Eliminated redundancy.  Updated for changes to
9789         descriptives_proc structure.
9790         (calc) Moved here from `descript.g'.  Rewritten to calculate
9791         statistics via `moments about the mean' rather than by summing,
9792         summing squares, summing cubes, and so on.
9793         (postcalc) Rewritten for new-style statistical calculation.
9794         (display) Removed support for displaying variables across rows.
9795         No longer crushes the descriptives table.  Removed ancient code.
9796         Added display of N, by variable and listwise.
9797
9798         * descript.g: Removed; merged into `descript.q'.
9799
9800         * expr-evl.c: (evaluate_expression) Now returns a double.  For
9801         numeric results, it returns the result as well as storing it in
9802         the passed `value' structure if non-NULL.  For string results it
9803         just returns 0.0 and it must be passed non-NULL.  Many references
9804         to this function were optimized by use of this change, especially
9805         but not exclusively in `compute.c'.
9806
9807         * frequencies.g: Comment fix.
9808
9809         * glob.c: (glob var process_if_expr) New global var.
9810
9811         * postscript.c: (static var option_tab[]) Corrected entry for
9812         `fixed_size'.
9813         (postopen) Sets x->size to x->prop_size.
9814         (ps_text_set_font_by_name) Sets font size as well as typeface for
9815         PROP and FIXED fonts.
9816         
9817         * sel-if.c: (cmd_process_if) New function.
9818
9819         * sfm-write.c: (struct sfm_fhuser_ext) New member `n_cases'.
9820         (sfm_write_dictionary) Sets `n_cases' to 0.
9821         (sfm_write_case) Increments `n_cases'.
9822         (sfm_close) Attempts to seek the system file back to the header
9823         and write the number of cases in its proper slot.
9824
9825         * som-frnt.c: (som_insert_table) Masks off expansion options since
9826         only SOPT_X_NORM seems to work sensibly.
9827
9828         * som-low.c: (get_cell_size) Fixed bug when a table cell was sized
9829         with a `fixed' value of 2.
9830
9831         * sort.c: (cmd_sort_cases) Cancels PROCESS IF.
9832
9833         * sysfile-info.c: (cmd_sysfile_info) Doesn't display more than 10
9834         value labels; uses SOPT_NONE instead of SOPT_X_BOTH.
9835
9836         * var.h: (enum series dsc_*) Removed Fiasco extensions.
9837         (struct descriptives_proc) Removed `miss_noweight'; new members
9838         `X_bar', `M2', `M3', `M4', `min', `max'.
9839
9840         * vars-atr.c: (discard_variables) Cancels PROCESS IF.
9841
9842         * vfm.c: (close_active_file) Cancels PROCESS IF.
9843         (write_case) Doesn't process cases unselected by PROCESS IF.
9844
9845 Fri Feb 14 23:32:58 1997  Ben Pfaff  <blp@gnu.org>
9846
9847         * glob.c: (glob var err) Removed.
9848
9849         * sysfile-info.c: (cmd_sysfile_info) When adjusting table size,
9850         doesn't have to take into account number of value labels since
9851         they're in a subtable anyway.  Also, doesn't display more than 10
9852         value labels since we can't yet break pages in subtables.
9853
9854 Tue Feb  4 15:15:50 1997  Ben Pfaff  <blp@gnu.org>
9855
9856         * som-frnt.c: (som_change_table_size) Simple change for elegance
9857         that shouldn't change behavior.
9858         (som_set_value) Comment fix.
9859
9860         * som-high.c: (som_submit_table) Message fix.
9861
9862 Wed Jan 22 21:54:00 1997  Ben Pfaff  <blp@gnu.org>
9863
9864         * command.c: Added SYSFILE INFO to command table.
9865
9866         * file-handle.q: (fh_handle_filename) New function.
9867
9868         * get.c: (save_trns_proc) Fixed a bug in padding of output data
9869         with spaces.
9870
9871         * main.c: (parse) New return value for command functions, -3.
9872
9873         * misc.h: Comment fix.
9874
9875         * output.h: Comment fixes.
9876         (macro COMPONENTS) Removed.
9877
9878         * postscript.c: (write_text) Modified literal_chars[] so that `('
9879         and ')' are not written to the output in strings as literals.
9880
9881         * sfm-read.c: (sfm_read_dictionary) New argument.
9882         (read_header) New argument.  Sets the information structure's
9883         values from the header information.  
9884         (read_variables) [__CHECKER__] Redefines isalnum()--some sort of
9885         bizarre Checker problem, I guess.
9886         (read_variables) Proper cleanup on lossage.
9887
9888         * sfm.h: (struct sfm_read_info) New struct for use by
9889         sfm_read_dictionary().
9890
9891         * som-frnt.c: (som_create_table) New argument CREATE_FLAGS,
9892         currently used just for tables that can be dynamically resized and
9893         thus have to be allocated with arena_malloc() instead of
9894         arena_alloc().  All references changed.
9895         (som_change_table_size) New function.
9896         (som_insert_table) Bugfix: now inserts `cell', not `c'!
9897
9898         * som-high.c: [GLOBAL_DEBUGGING] (check_table) Moved to som-low.c.
9899         (som_submit_table) [GLOBAL_DEBUGGING] Doesn't call check_table()
9900         any more.
9901
9902         * som-low.c: (draw_cell) Calls draw_table_cell() for SCON_TABLE
9903         cells.
9904         (draw_intersection) Now takes an argument specifying the table in
9905         question.  All references changed.
9906         (draw_table_cell) New function.
9907         (som_get_table_size) [GLOBAL_DEBUGGING] Calls check_table().
9908         (som_get_table_size) Many nice new explanatory comments.
9909         [GLOBAL_DEBUGGING] (check_table) Moved here from som-high.c.
9910
9911         * som.h: New enum series SOM_CREATE_* for use as create flags with
9912         som_create_table().
9913
9914         * str.h: Moved a comment here from TODO.
9915
9916         * sysfile-info.c: New file.  Reference implementation.
9917
9918 Sun Jan 19 14:22:11 1997  Ben Pfaff  <blp@gnu.org>
9919
9920         * command.c: Added RENAME VARIABLES to table of commands.
9921
9922         * data-in.c: (dls_error) Sets `cust_field'.
9923         (parse_N) Message fix.
9924         (parse_day_count) New function.
9925         (to_roman) Never outputs VX as a `short form' of V.
9926         (parse_month) Fixed parsing of Roman numerals.
9927         (parse_trailer) Message fix.
9928         (parse_DATE, parse_ADATE, parse_EDATE, parse_SDATE, parse_JDATE,
9929         parse_QYR, parse_MOYR, parse_WKYR, parse_DTIME) Issue a message if
9930         the date is invalid.
9931         (parse_SDATE) Fixed swapped day, year.
9932         (parse_JDATE) Fixed bug for dates in 1582.
9933         (parse_DTIME) Allows days not between 1 and 31.
9934         (parse_numeric) Makes local copy of f.type for easier usage.
9935         FMT_DOLLAR fixed.
9936
9937         * data-out.c: (convert_F) When outputting as scientific, properly
9938         sets f.type as fp->type.
9939         (insert_commas) Fixed operator precedence problem with setting of
9940         nitems.  Changed strcpy to memcpy (no null terminator). 
9941         (convert_date) Fixed FMT_JDATE: added 1900 to year.
9942         (convert_CCx) Essentially rewritten, but now it works.
9943
9944         * display.c: (cmd_display) Added DISPLAY FILE LABEL (undocumented
9945         feature of Fiasco).
9946         (display_documents) Implemented.
9947
9948         * error.c: (glob var cust_field) New var.
9949         (vmsg) Displays cust_field as part of message classes DE and DW.
9950
9951         * formats.c: (debug_print) Fixed to compile under updated
9952         dictionary format.
9953
9954         * get.c: (cmd_get, cmd_save_internal) Close file handle on
9955         failure.
9956
9957         * misc.c: (parse_format_specifier) Formatting fix.
9958
9959         * modify-vars.c: (struct var_modification) Renamed `n_reorder' as
9960         `n_rename' for clarity.
9961         (cmd_modify_vars) Initializes `forward' and `positional' at
9962         appropriate times.  Frees lists of vars to rename on failure.
9963         Comment fix.  Frees memory on success.  
9964         (rearrange_dict) Simplified `for' loop condition.
9965
9966         * rename-vars.c: New file (reference implementation).
9967         
9968         * set.q: (internal_cmd_set) Fixed `emu' test condition.
9969
9970         * sfm-read.c: (read_header) File label is created only if file
9971         label in file is not blank.
9972         (read_variables) Initializes `dict' local variable.
9973         (read_documents) Proper behavior on lossage.
9974
9975         * sfm-write.c: (write_header) Doesn't blank out the file label
9976         (why was this here to begin with?!)
9977
9978         * temporary.c: (save_dictionary) File label is copied only if
9979         non-NULL.  Doesn't try to xstrdup() dictionary documents.
9980         Adapted so as to not irritate Checker.
9981         (free_dictionary) Only destroys var_by_name if non-NULL.
9982
9983         * title.c: (cmd_file_label) Doesn't skip FILE, LABEL tokens.
9984         (cmd_document) Doesn't skip DOCUMENT token.  Adds some header
9985         lines to the document, indents the document.  Also, it works now.
9986         (add_document_line) New function.
9987
9988         * var.h: (struct dictionary) Reordering.
9989
9990         * vars-prs.c: (parse_variables) On lossage, only local_free()'s
9991         bits if it was allocated to begin with.
9992
9993 Thu Jan 16 13:08:57 1997  Ben Pfaff  <blp@gnu.org>
9994
9995         * command.c: Added MODIFY VARS to list of commands.
9996
9997         * configure.in: Updated custom macros for autoconf 2.12.  Removed
9998         mmap reference; fixed termcap library reference.
9999
10000         * display.c: (display_variables) Fixed a few bugs although it's
10001         still not well written.
10002
10003         * error.c: [!__CHECKER__] (chkr_disp_call_chain) New function.
10004         (induce_segfault) Calls chkr_disp_call_chain() instead of
10005         inducing an actual SIGSEGV.
10006
10007         * expr-opt.c: (evaluate_tree) Swapped order of arguments to
10008         str_search() and str_rsearch().  Fixed tests for matches on
10009         OP_INDEX and OP_RINDEX.
10010
10011         * filename.c: (good_getcwd) Removed as the new libc for Checker
10012         doesn't contain this bug, apparently.
10013
10014         * misc.c: (str_search, str_rsearch) Changed order of arguments for
10015         consistency with GNU memmem.
10016         (blp_getdelim) Changed `len' from `int' to `size_t'.
10017
10018         * modify-vars.c: Reference implementation.
10019
10020         * som-frnt.c: (zero_length) New global var.
10021         (som_create_table) Message fix.
10022
10023         * som.h: Added gcc attributions to som_set_text(),
10024         som_output_text() prototypes.  blank_line() refers to
10025         zero_length[] instead of a literal null string to suppress gcc
10026         warnings.
10027
10028         * sort.c: (do_external_sort) Fixed fencepost error on lossage.
10029         (allocate_cases) Decrements x_max so the last element of x[] can
10030         be used by the algorithm.
10031
10032         * var.h: Changed minor details of `variable' declaration.  
10033         (struct modify_vars_proc) New struct.
10034         (struct variable) Added field p.mfv.
10035
10036         * vars-atr.c: Comment fix.
10037
10038         * vars-prs.c: (fill_all_vars) More optimal implementation.
10039
10040         * vfm.c: (dump_splits) Sets the last byte of temp_buf to a null
10041         character, which it shouldn't have to do but printf() seems to
10042         read the null byte even though I supply a maximum length...
10043
10044 Fri Jan 10 20:22:08 1997  Ben Pfaff  <blp@gnu.org>
10045
10046         * command.c: Removed command alias X for QUIT.
10047         (parse_cmd) Fixed comment parsing.
10048
10049         * dfm.c: (struct dfm_fhuser_ext) Fields `len', `size' are now of
10050         type size_t.
10051         (read_record) Fixed references to len, size.
10052         (dfm_get_record) Restructured.
10053
10054         * file-handle.h: (struct file_handle) Field `lrecl' now of type
10055         size_t.
10056
10057         * file-handle.q: (internal_cmd_file_handle) Checks for nonpositive
10058         record length.
10059
10060         * modify-vars.c: New file.  Not complete.
10061         
10062         * set.q: (set_ccx) Fixed operator precedence problem regarding ^
10063         and ==.
10064
10065         * sfm-read.c: (bswap_flt64, read_header, write_variable) Fixed
10066         problems caused by int/size_t differences.
10067
10068         * sort.c: (output_record, merge_once) Cast `size_t's to `int's in
10069         appropriate spots.
10070
10071         * str.c: (strcasecmp) Fixed bug that cropped up when the strings
10072         being compared were of equal length.
10073
10074 Thu Jan  2 19:08:23 1997  Ben Pfaff  <blp@gnu.org>
10075
10076         * command.c: Added DOCUMENT, DROP DOCUMENTS, FILE LABEL.
10077
10078         * lexer.c: (get_dotted_rest_of_line) New function.
10079
10080         * sel-if.c: (cmd_filter) Cannot choose string or scratch variables
10081         as filters.
10082
10083         * sfm-read.c: (sfm_read_dictionary) Calls read_documents() to read
10084         type 6 records.  Frees the dictionary properly.
10085         (read_header) Initializes the dictionary instead of letting
10086         read_variables() do it.  Sets the dictionary file label from the
10087         system file.
10088         (read_documents) New function.
10089
10090         * sfm-write.c: (sfm_write_dictionary) Calls write_documents() to
10091         write type 6 record if appropriate.
10092         (write_header) Writes file label from dictionary.
10093         (write_documents) New function.
10094
10095         * temporary.c: (save_dictionary, restore_dictionary,
10096         free_dictionary) Properly handle new fields in dictionary struct.
10097
10098         * title.c: (get_title) Returns after failure().
10099         (cmd_file_label, cmd_document, cmd_drop_documents) New functions
10100         for new commands FILE LABEL, DOCUMENT, DROP DOCUMENTS.  Untested.
10101
10102         * var.h: (struct dictionary) New fields `label', `n_documents',
10103         `documents'.
10104
10105 Wed Jan  1 22:08:10 1997  Ben Pfaff  <blp@gnu.org>
10106
10107         * command.c: Added FILTER to list of commands.
10108
10109         * frequencies.g: [WEIGHTING] Removed test for weighting!=-1 since
10110         it's always true.
10111
10112         * get.c: (cmd_save_internal) Removed weighting code since it's now
10113         handled by sfm-write.c.  Properly commented out debug code.
10114
10115         * glob.c: (glob var weighting) Removed.
10116
10117         * sel-if.c: Comment fixes.
10118         (cmd_filter) New function.
10119
10120         * sfm-read.c: (struct sfm_fhuser_ext) New field `weight_index'.
10121         (sfm_read_dictionary) Sets weighting variable direct in the
10122         created dictionary now.  (Apparently we previously didn't support
10123         weighting on GET?)
10124         (read_header) Sets weight_index field in sfm_fhuser_ext from
10125         header read from disk.
10126
10127         * sfm-write.c: (sfm_write_dictionary) Comment fix.
10128         (write_header) Now sets the weighting in the header from the
10129         passed primary dictionary instead of from the sfm_write_info.
10130
10131         * sfm.h: (struct sfm_write_info) Removed field `weight'.
10132
10133         * som-high.c: (dump_crush_table) Fixed a couple of assertions that
10134         broke on boundary conditions.
10135
10136         * var.h: (struct dictionary) New fields `weight_var',
10137         `weight_index', and `filter_var'.
10138         (glob var weighting) Removed.  This is now part of struct
10139         dictionary.  All references changed; the less mechanical changes
10140         are described above.
10141
10142         * vars-atr.c: (find_dict_variable) New function.
10143
10144         * vfm.c: (static var filter_index) New variable.
10145         (open_active_file) Initializes filter_index from default_dict.
10146         (write_case) Calls proc_func() only if the filter variable is
10147         nonzero; this implements FILTER behavior.
10148
10149         * weight.c: (static var weight_varname) Removed.
10150         (cmd_weight) Modified default_dict instead of glob vars.
10151         (update_weighting) Changed the signature to modify a dictionary
10152         instead of glob vars.  Now returns the weighting variable.
10153         (get_weighting_variable) Removed; its function is absorbed by
10154         update_weighting().
10155         (stop_weighting) Operates on a dictionary now.
10156
10157 Wed Jan  1 17:00:59 1997  Ben Pfaff  <blp@gnu.org>
10158
10159         * sort.c: Removed debugging info from messages.
10160         (do_external_sort) Cleans up after itself by deleting the
10161         temporary directory on failure.  (On success it is deleted by the
10162         input program.)
10163         (allocate_cases) Removed debug code.  Added clean up code.
10164         (output_record) Removed debug code.
10165         (merge) Added code to close all the input files that are currently
10166         open.  This is a likely location for bugs, because I'm not sure
10167         about boundary conditions.  Removed an unnecesary heap_delete().
10168         (merge_once) Removed input file "optimization" that in fact
10169         screwed up the rest of the code.  Message and comment fixes.
10170
10171 Sun Dec 29 21:36:48 1996  Ben Pfaff  <blp@gnu.org>
10172
10173         * error.c: [__CHECKER__] (induce_segfault) Flushes output streams.
10174
10175         * heap.c: (heap_delete) New argument.
10176
10177         * sort.c: Finished implementation of external sort.
10178
10179         * vfm.c: (read_from_disk) Returns after a disk error.
10180
10181 Sun Dec 22 23:10:39 1996  Ben Pfaff  <blp@gnu.org>
10182
10183         * sort.c: (static var state) Removed.
10184         (static vars max_handles, tmp_basename, tmp_extname,
10185         huffman_queue) New variables.
10186         (do_external_sort) Moved most code to new functions.
10187         Creates huffman_queue.
10188         (allocate_file_handles, allocate_cases) New functions.
10189         (static vars run_no, run_length, file_index, case_count) New
10190         variables. 
10191         (output_record) Returns success.  Now really writes to the output
10192         file.
10193         (begin_run, end_run) New functions.
10194         (write_initial_runs) Returns success.  Initializes run_no to -1.
10195         Calls begin_run(), end_run() at appropriate times.  Outputs debug
10196         messages.
10197         (write_to_sort_cases) Calls begin_run(), end_run() at appropriate
10198         times.
10199         (merge) New function.
10200
10201         * heap.c, heap.h: New files.  Hopefully in near-final form.
10202
10203 Sat Dec 21 21:51:04 1996  Ben Pfaff  <blp@gnu.org>
10204
10205         * glob.c: Added write_active_file to global vars.
10206
10207         * sort.c: Several new miscellaneous static variables.
10208         (cmd_sort_cases) Big comment fix.
10209         (perform_case_2) Renamed `do_external_sort' and completely
10210         rewritten.
10211         (case_2_proc_func) Removed.
10212         (output_record, write_initial_runs, write_to_sort_cases,
10213         compare_record) New functions.
10214
10215         * vfm.c: [DEBUGGING] (index_to_varname) Excised bit rot.
10216
10217 Tue Dec 17 18:57:59 1996  Ben Pfaff  <blp@gnu.org>
10218
10219         * sort.c: (perform_case_2) Changed the method for allocation of
10220         lots of memory--now allocates one case at a time in hopes that
10221         more cases can be allocated with heavily fragmented memory.
10222
10223         * var.h: (write_active_file) New global var.
10224
10225         * vfm.c: (procedure, close_active_file, write_case,
10226         SPLIT_FILE_procfunc) Now allow beginfunc, procfunc, and endfunc
10227         arguments to procedure() to be NULL.  All references to
10228         procedure() that made use of dummy functions were changed to NULL
10229         functions.
10230         (open_active_file) If write_active_file is non-NULL, the output
10231         device becomes DEV_PGM (a new enum).
10232         (close_active_file) Sets write_active_file to NULL.
10233         (read_from_memory) Comment fix.
10234         (record_case) Calls write_active_file() when the output device is
10235         DEV_PGM.
10236
10237 Sun Dec 15 15:32:16 1996  Ben Pfaff  <blp@gnu.org>
10238
10239         * sort.c: New file.
10240
10241         * autorecode.c: (cmd_autorecode) Fixed parsing of options.
10242         Fixed checking for duplicate varnames.
10243         (recode) xmalloc()'s the transformation instead of arena_alloc()'ing
10244         it.
10245         (autorecode_trns_free) Destroys hash tables for each recoding
10246         specification.
10247         (autorecode_proc_func) Compares NULL to *vpp instead of vpp.
10248
10249         * command.c: Added SORT CASES to cmd_table.
10250         (null_func, null_int_func) Prototyped.
10251
10252         * descript.g: (calc_weight, calc_noweight) Computes own case
10253         number now.
10254         
10255         * frequencies.q: (dump_statistics) Fixed problem with
10256         too-few-cases warning message.
10257
10258         * get.c: (cmd_save_internal) Handles weighting properly.
10259
10260         * hash.c: (hsh_dump) Output format changed.
10261         (force_hsh_insert) Actually works now, prototype changed.
10262
10263         * list.q: (static var case_num) New variable.
10264         (cmd_list) Initializes case_num.
10265         (list_cases) Increments case_num.
10266
10267         * var.h: Added definitions for SORT CASES.  Comment fixes.
10268
10269         * vfm.c: Some definitions moved to new file vfmP.h.  Comment
10270         fixes.  `active' renamed vfm_active, `rep' renamed
10271         vfm_replacement, all references changed.
10272         (procedure) The procfunc no longer receives a case number.  All
10273         references changed.
10274         (write_case) Subtle reordering.
10275         (SPLIT_FILE_procfunc) Counts cases differently.  Slightly less
10276         redundant.
10277
10278         * weight.c: (get_weighting_variable) New function.
10279
10280         * vfmP.h: New file with definitions from vfm.c.
10281
10282 Sat Dec 14 10:35:30 1996  Ben Pfaff  <blp@gnu.org>
10283
10284         * command.c: (FILE_TYPE_okay) Commented out some tests because
10285         they're clumsy and not yet needed.
10286
10287         * var.h: Most *_trns structures moved to their respective source
10288         files.  Some were moved into a new file, do-ifP.h.  Comment fixes.
10289         (union any_trns) Changed to a typedef for trns_header.
10290         (struct input_program_pgm) Removed.
10291
10292         * vars-prs.c: (parse_variables) Only local_free()'s bits if it
10293         was allocated in the first place.
10294
10295 Fri Dec 13 21:30:53 1996  Ben Pfaff  <blp@gnu.org>
10296
10297         * autorecode.c: New file.
10298         
10299         * command.c: Added AUTORECODE to command table; re-enabled SET.
10300
10301         * data-out.c: (convert_F) Handles infinities and NaNs properly.
10302
10303         * error.c: (vmsg) Comment fixes.
10304
10305         * hash.c: Comment fix.
10306         (hashpjw_d) New function.
10307         (hashpjw) Reimplemented as call to more general function
10308         hashpjw_d().
10309         (internal_comparison_fn) Initializes pointers properly.
10310         (hsh_sort) [GLOBAL_DEBUGGING] New debugging code.
10311         (force_hsh_insert, force_hsh_find) New debugging wrapper
10312         functions.
10313
10314         * main.c: (main) Message fix.
10315
10316         * output.c: (outp_read_devices) Message fix.
10317
10318         * set.q: Comment fixes.
10319         (custom_results) Implemented Wnd/X form of subcommand.
10320         (set_routing) New function.
10321         (internal_cmd_set) Implemented ERRORS, MESSAGES.
10322
10323         * settings.h: (SET_ROUTE_*) New enum series.
10324         (set_results) Renamed set_results_file, all references changed.
10325         (set_messages) Removed.
10326         (glob vars set_errors, set_messages, set_results) New vars.
10327
10328         * title.c: (get_title) Remembers to xstrdup() the result of
10329         get_rest_of_line().
10330
10331         * var.h: (arc_item, arc_spec, autorecode_trns) New structures for
10332         use by AUTORECODE.
10333         (union any_trns) New element `arc'.
10334
10335 Fri Dec  6 23:53:47 1996  Ben Pfaff  <blp@gnu.org>
10336
10337         * command.c: (output_line) Removed references to set_screen.
10338
10339         * error.c: (static var terminating) New var.
10340         (hcf) Sets terminating to 1.
10341         (vmsg) If terminating is nonzero, does not attempt to call hcf().
10342         This prevents an infinite loop if an error occurs within hcf().
10343
10344         * expr-evl.c: (evaluate_expression) [__CHECKER__] Replaced case
10345         statement circumlocution with `case 42000' trick.
10346         (evaluate_expression) New support for OP_STR_MIS.
10347
10348         * expr-opt.c: (evaluate_expression) [__CHECKER__] Replaced case
10349         statement circumlocution with `case 42000' trick.
10350         (dump_node) Handles OP_STR_MIS.
10351
10352         * expr-prs.c: (MISSING_func, SYSMIS_func) Rewrote to handle string
10353         variables exceptions.
10354         (parse_function) Message fix.
10355         (ops[]) Added OP_STR_MIS.
10356
10357         * expr.h: Added OP_STR_MIS to OP_* enum.  Comment fixes.
10358
10359         * exprP.h: [__CHECKER__] Removed case statement circumlocution.
10360
10361         * glob.c: Removed set_scrnfile glob var.
10362         (init_glob) set_errorbreak set to 0 by default.
10363
10364         * groff-font.c: Changed included files.
10365         (groff_read_font) Initializes font_arena local var correctly.
10366         (default_font) New function.
10367
10368         * output.c: Comment fixes.
10369         (glob var disabled_devices) New variable.
10370         [GLOBAL_DEBUGGING] (static var iterating_driver_list) New
10371         variable.
10372         [GLOBAL_DEBUGGING] (reentrancy) New function.
10373         [GLOBAL_DEBUGGING] (outp_read_devices, outp_done, find_driver,
10374         outp_iterate_enabled_drivers) Calls to reentrancy().
10375         (destroy_list) New function.
10376         (outp_done) Moved code to destroy_list().
10377         (parse_options) Parses `listing', `screen', `printer' options
10378         internally.
10379         (configure_driver) Sets new `device' member of driver.
10380         (outp_iterate_enabled_drivers, outp_enable_device) New functions.
10381
10382         * output.h: Comment fixes.  New enum series OUTP_DEV_*.
10383         (struct outp_driver_struct) New member `device'.
10384
10385         * postscript.c: (find_encoding_file) Doesn't display its own error
10386         messages.
10387         (default_encoding) New function.
10388         (switch_font) Calls default_encoding() if no encoding can be
10389         found.
10390         (text) Makes up a character metric if none exists for the desired
10391         character.
10392         (load_font) Properly copies a fallback filename.  Calls
10393         default_font() for a font if none at all are known.
10394
10395         * set.q: Comment fixes.  Removed OUTPUT subcommand.
10396         (custom_listing) Calls outp_enable_device() to enable/disable
10397         listing device.
10398         (turn_screen_on) Removed.
10399         (internal_cmd_set) Calls outp_enable_device() to enable/disable
10400         screen, printer devices.
10401
10402         * settings.h: Comment fixes.
10403         (glob vars set_output, set_printer, set_screen, set_scrnfile)
10404         Removed.
10405
10406         * som-high.c: (som_submit_table, som_eject_page) Use
10407         outp_iterate_enabled_drivers() instead of iterating
10408         outp_driver_list directly.
10409
10410 Wed Dec  4 21:34:17 1996  Ben Pfaff  <blp@gnu.org>
10411
10412         * data-in.c: (parse_EDATE, parse_SDATE) New functions.
10413         (parse_string_as_format) Handles new formats.
10414         (parse_numeric) Now handles DOT and PCT formats.
10415
10416         * data-out.c: (convert_E, convert_F, insert_commas) Handle DOT
10417         format now.
10418         (convert_date) Handle EDATE and SDATE formats.
10419         (convert_CCx) Now if there's not room for the currency characters,
10420         converts it as F format if it's positive instead of giving up
10421         quickly.  Also fixed save-and-restore bug with decimal point
10422         characters.  
10423         (convert_format_to_string) Handles new formats.
10424
10425         * misc.c: (formats[]) Added new formats.
10426         (convert_fmt_ItoO) Supports new formats.
10427
10428         * sfm-read.c: (parse_format_spec) Supports new formats.  Better
10429         data checking.  New argument, all references changed.
10430
10431         * sfm-write.c: (write_format_spec) Supports new formats.
10432
10433         * var.h: New formats FMT_DOT, FMT_PCT, FMT_EDATE, FMT_SDATE.
10434         Comment fixes.
10435
10436 Sun Dec  1 17:19:00 1996  Ben Pfaff  <blp@gnu.org>
10437
10438         * cmdline.c: Comment fixes.
10439         (parse_command_line) Changed return type to void.
10440
10441         * data-in.c: (parse_string_as_format) Added FMT_CCA...FMT_CCE to
10442         switch.
10443         (parse_numeric) Handles international numbers (comma as decimal
10444         point).  Some reformatting.
10445
10446         * data-list.c: (parse_free) Default output format is now
10447         set_format instead of hard-coded F8.2.
10448         (read_from_data_list_list) Emits error message on undefined data
10449         only if set_undefined is nonzero.
10450
10451         * data-out.c: (convert_E) Changes decimal point from period to
10452         comma if appropriate.  Restructured.  Better comments.
10453         (convert_F) Changes decimal point from period to comma if
10454         appropriate.
10455         (insert_commas) Major bug with handling of negative values fixed.
10456         Also, inserts periods instead of commas if appropriate.
10457         (convert_CCx) New function.
10458         (convert_format_to_string) Added FMT_CCA...FMT_CCE to switch.
10459         (num_to_string) Changed `.' to set_decimal.
10460
10461         * dfm.c: Comment fixes.
10462         (dfm_close) Frees ext->line even in inline_file.
10463         (open_inline_file) New function.
10464         (open_file_r) When opening the inline file: now properly
10465         recognizes `BEGIN DATA.' line, and calls open_inline_file() to
10466         finish up.
10467         (read_record) Calls fh_close_handle() instead of dfm_close() to
10468         close the inline file.  Makes a copy of the line getl_buf to avoid
10469         interlock problems.
10470         (dfm_get_record) Restructured.  Now checks the return value of
10471         open_file_r().
10472         (cmd_begin_data) Moved open code into open_inline_file().  Relaxed
10473         checking for use of inline file.  No longer tries to close inline
10474         file.
10475
10476         * error.c: (glob var error_already_flagged) New var.
10477         (vmsg) Message change.  Now checks max number of errors/warnings,
10478         acts on it.
10479
10480         * file-handle.q: (fh_handle_name) Now allows closing of
10481         inline_file.
10482         (fh_init_files) Reformatted.
10483
10484         * get.c: (trim_dictionary) Checks SCOMP option instead of COMP.
10485
10486         * getline.c: (getl_include) Fixed bug that popped up when called
10487         when file queue was empty.
10488         (read_console) Resets error_count, warning_count,
10489         error_already_flagged to zero.
10490
10491         * glob.c: Many changes to update list of variables.
10492         (init_compat_dependent) Now this function is called whenever
10493         `compat' changes.  It now sets set_seed only if it hasn't
10494         previously been referenced.  It now calls
10495         lex_init_compat_dependent().
10496
10497         * include.c: (cmd_include_at) Frees temporary buffer instead of
10498         line buffer.  
10499         (cmd_include) Doesn't make copy of include file name.
10500
10501         * lexer.c: Comment fixes.
10502         (init_lex) Moved some code into new function
10503         lex_init_compat_dependent().
10504         (lex_init_compat_dependent) New function.
10505         (hex_val) Simplified.
10506         (preprocess_line) Uses set_endcmd instead of hardcoding `.'.
10507
10508         * main.c: Comment fixes.
10509         (main) Reformatted.
10510
10511         * misc.c: (formats[]) Added FMT_CCA...FMT_CCE.
10512         (check_input_specifier) Disallows FMT_CCA...FMT_CCE.
10513         (convert_fmt_ItoO) Detects FMT_CCA...FMT_CCE.
10514         (setup_randomize) Sets set_seed_used.
10515
10516         * set.q: Comment fixes.
10517         (custom_results) Conditionalizes on `compat'.
10518         (custom_log) Calls custom_journal().
10519         (set_ccx) New function.
10520         (cmd_set) Calls init_compat_dependent() when `compat' changes.
10521         Calls set_ccx() to handle CCA...CCE.  Sets set_grouping
10522         when set_decimal changes.  Range-checks values for MITERATE,
10523         MNEST.  Message fixes.
10524
10525         * settings.h: Comment fixes.
10526         (struct set_cust_currency) New struct.
10527         (set_cc[], set_grouping, set_seed_used) New global vars.
10528
10529         * var.h: (FMT_CCA...FMT_CCE) New output formats.
10530         (FCAT_OUTPUT_ONLY) New FCAT_* constant.
10531
10532 Thu Nov 28 23:14:07 1996  Ben Pfaff  <blp@gnu.org>
10533
10534         * glob.c: Revised variables to correspond to settings.h.
10535         (init_glob) Initializes variables from settings.h properly.
10536
10537         * set.q: Began long-overdue major revision to correspond to new
10538         philosophy.  Most code changed. 
10539
10540         * settings.h: Mostly changed; reorganized, reordered, large new
10541         comment.
10542
10543 Thu Nov 28 19:46:10 1996  Ben Pfaff  <blp@gnu.org>
10544
10545         * get.c: (cmd_save_internal) No longer forces compression off.
10546
10547         * sfm-read.c: (read_compressed_data) If eof is reached when
10548         reading a new instruction octet, only signal error if we're in the
10549         middle of a case.
10550
10551         * sfm-write.c: (COMPRESSION_BIAS) New #define.
10552         (struct sfm_fhuser_ext) New member `end'.
10553         (write_header) Refers to COMPRESSION_BIAS instead of magic 100.0.
10554         (ensure_buf_space) New function.
10555         (sfm_write_case) Reimplemented in order to support compression.
10556         (sfm_close) Writes out the remaining contents of the compression
10557         buffer if any.
10558
10559 Wed Nov 27 23:18:35 1996  Ben Pfaff  <blp@gnu.org>
10560
10561         * command.c: Defined SAVE and XSAVE commands in command table.
10562
10563         * common.h: second_lowest_value is of type flt64, not double.
10564
10565         * file-handle.h: Comment fix.
10566
10567         * get.c: Comment fixes.
10568         (static var `trns') New.
10569         (save_write_case_func, save_trns_proc, save_trns_free, null_func,
10570         cmd_save_internal, cmd_save, cmd_xsave) New functions.
10571         (dict_delete_run) Clears the variables and frees them now.
10572         (trim_dictionary) Sets default for compression.
10573         On KEEP subcommand, frees deleted variables as well as clearing
10574         them.  Finally got the sense of the test for deleting all
10575         variables correct.
10576         [DEBUGGING] (dump_dict_variables) Message fix.
10577
10578         * glob.c: (init_glob) set_compression set to 1 by default.
10579
10580         * list.q: Properly #includes config.h.
10581
10582         * misc.h: New macro REM_RND_UP.
10583
10584         * settings.h: Comment fix.
10585
10586         * sfm-read.c: (structs sysfile_header, sysfile_format,
10587         sysfile_variable; inline function bswap_int32) Moved to new file
10588         sfmP.h.
10589         (corrupt_msg) [__CHECKER__] No longer induces segfault.
10590         (sfm_read_dictionary) Fixed bug caused by failing to initialize
10591         var_by_index.
10592         (read_machine_flt64_info) Fixed some problems caused by confusion
10593         between flt64 and double types.
10594         (read_header) Message fix.
10595         (read_variables) Fixed set of cases in which we byte-swap sv.print
10596         and sv.write.  Fixed confusion of flt64 and double.
10597
10598         * sfm.h: (struct sfm_write_info) New.
10599
10600         * som-high.c: (som_draw_title) Properly frees `s'.
10601
10602         * temporary.c: (save_dictionary) Comment fix.
10603
10604         * var.h: Comment fixes.  New FMT_* enum, FMT_NUMBER_OF_FORMATS.
10605         (struct trns_header) Formatting fix.
10606         (struct save_trns) New.
10607
10608         * vars-atr.c: (discard_variables) Comment fix.
10609
10610         * sfm-write.c: New file, baseline release.
10611
10612         * sfmP.h: New file, baseline release.
10613
10614 Sun Nov 24 14:53:53 1996  Ben Pfaff  <blp@gnu.org>
10615
10616         * cmdline.c: (parse_command_line) `--version' output updated.
10617         (glob var syntax_message[]) Added my e-mail address.
10618
10619         * file-handle.q, lexer.c, vfm.c: Changed many instances of
10620         `illegal' to `invalid'.
10621
10622         * sfm-read.c: (struct sfm_fhuser_ext) New fields used as
10623         uncompression buffer.
10624         (sfm_close) Frees decompression buffer.
10625         (sfm_read_dictionary) Initializes decompression buffer.
10626         (buffer_input, read_compressed_data) New functions.
10627         (sfm_read_case) Restructured; now calls read_compressed_data() to
10628         handle compressed system file data.
10629
10630         * var.h: Comment fix.
10631
10632 Mon Nov 11 15:34:09 1996  Ben Pfaff  <blp@gnu.org>
10633
10634         * dfm.c: (dfm_close) Does not set h->{ext,class} because the
10635         caller handles it.
10636          
10637         * get.c: New comments.  New static var `get_file'.
10638         (cmd_get) Now fully implemented.  Calls discard_variables();
10639         initializes fv and lv for all variables; new debug code; sets
10640         up the dictionary; sets up the input program.
10641         (read_from_get, cancel_get) New functions.
10642
10643         * sfm-read.c: Comment fixes.
10644         (sfm_close) New static function.
10645         (sfm_read_dictionary) Properly sets up the class of the
10646         file_handle.  No longer cares what size the data is in records of
10647         type 7.  Also, on failure, properly cleans up the file_handle and
10648         free()s some stuff.
10649         (read_variables) No longer thinks it knows `nval' of the
10650         dictionary.  Now sets p.get.fv, etc., instead of speculatively
10651         setting fv itself.
10652         (read_value_labels) Fixed off-by-one error in indexing of
10653         var_by_index[].
10654         (sfm_read_case) New function.
10655         (sfm_r_class) New static var.
10656
10657         * var.h: (get_proc) New struct.
10658         (struct variable) New member p.get.
10659
10660 Thu Nov  7 20:52:28 1996  Ben Pfaff  <blp@gnu.org>
10661
10662         * get.c: Removed GTSV_OPT_MAP because of a misinterpretation of
10663         the manual's meaning.
10664         (rename_variables) New function.
10665         (trim_variables) Doesn't try to parse MAP any more.  Removed debug
10666         code.  Now properly reorders the dictionary on the KEEP keyword.
10667
10668         * sfm-read.c: (read_value_labels) Fixed some bugs regarding
10669         garbage collection.
10670
10671         * vars-atr.c: (clear_variable) New argument `dictionary *'.
10672         (rename_variable) New function.
10673         (free_val_lab) Reformatted.
10674
10675 Thu Nov  7 17:29:16 1996  Ben Pfaff  <blp@gnu.org>
10676
10677         * var.h: Reindented entire file.  Comment fixes.
10678         (glob vars var, var_by_name, nvar, N, nval, n_splits, splits)
10679         Removed.
10680         (glob var default_dict) New.
10681         (struct indirect_dictionary) Removed.
10682
10683         * Many other source files were changed to add `default_dict.'
10684         before all references to the dictionary of the active file.
10685         
10686         * vars-atr.c: (make_indirect_dictionary) Removed.
10687
10688         * glob.c: Reindented all variable declarations.  Updated for
10689         changed var.h.  Comment fixes.
10690
10691         * temporary.c: (restore_dictionary, save_dictionary) Simplified
10692         because now we can mainly copy dictionary structs.
10693
10694         * vars-prs.c: (is_dict_varname, parse_dict_variable,
10695         parse_variables) Takes dictionary instead of indirect_dictionary
10696         first argument.
10697         (parse_variables) Instead of calling make_indirect_dictionary,
10698         just sets DICT to &default_dict if DICT is NULL.  Of course, lots
10699         of `*dict.' references had to be changed to `dict->'.  Removed
10700         debug code.
10701
10702 Thu Nov  7 15:48:52 1996  Ben Pfaff  <blp@gnu.org>
10703
10704         * get.c: Added GTSV_OPT_* series of enums.
10705         (trim_dictionary, dict_delete_run) New functions.
10706         [DEBUGGING] (dump_dict_variables) New function.
10707         (cmd_get) Calls trim_dictionary() to get dictionary fully set-up.
10708         [DEBUGGING] Calls dump_dict_variables() to display results.
10709
10710         * glob.c: (cmp_variable) Now a public function declared in var.h.
10711
10712         * sfm-read.c: Turned off debug code.  Comment fixes.
10713         (read_machine_int32_info, read_machine_flt64_info) New functions
10714         to parse type 7 records.
10715         (sfm_read_dictionary) Properly byteswaps several fields now.
10716         Calls read_machine_*_info() to parse type 7 subtypes 3 and 4
10717         records.  [DEBUGGING] Dumps dictionary.
10718         (read_variables) Sets `index' field of variables created properly.
10719         Constructs avl tree of variables in dictionary.  [DEBUGGING] No
10720         longer dumps dictionary.
10721         (read_value_labels) Properly byteswaps fields.  [DEBUGGING] New
10722         debug code.
10723         [DEBUGGING] (dump_dictionary) No longer stubbed out.
10724
10725         * temporary.c: (restore_dictionary) Destroys `var_by_name' glob
10726         var before destroying any variables just to save a little time.
10727
10728         * var.h: (struct variable) Reordered in order to make name[] the
10729         first member; this makes pointers to `variable' pointers to the
10730         variable name, simplifying avl trees, etc.
10731         (struct indirect_dictionary) New struct.
10732
10733         * vars-atr.c: (find_variable) Rewritten for efficiency.
10734         (make_indirect_dictionary, is_dict_varname, parse_dict_variable)
10735         New functions.
10736         (is_varname) Rewritten for efficiency.
10737         (parse_variables) New argument, which is a `dictionary *'.  All
10738         references changed.  This function now reads variable names from
10739         the dictionary passed, or from the default dictionary if NULL.
10740
10741 Tue Nov  5 18:34:59 1996  Ben Pfaff  <blp@gnu.org>
10742
10743         * misc.h: Added new macro DIV_RND_UP to perform integer division,
10744         rounding up.  Changed many references to ROUND_UP to use this
10745         instead.
10746
10747         * sfm-read.c: Includes avl.h.
10748         (corrupt_msg) Induces a segfault under Checker.
10749         (macro assertive_bufread) New.  Many references to bufread() now
10750         use this instead.
10751         (sfm_read_dictionary) Split up into several functions.  Added code
10752         to read dictionary records following the the type 2 records.  Not
10753         quite complete.  New variable `var_by_index'.
10754         (read_header, read_variables) New functions extracted from
10755         sfm_read_dictionary().
10756         (read_value_labels) New function.
10757         (bufread) Checks ferror() if fread() doesn't return the expected
10758         value; if ferror() is zero it's just EOF.
10759         (dump_dictionary) Stubbed out.
10760
10761         * BTW: The source code now exceeds 50000 lines!
10762         
10763 Mon Nov  4 22:03:28 1996  Ben Pfaff  <blp@gnu.org>
10764
10765         * command.c: Added GET to cmd_table[].
10766
10767         * list.q: Removed reference to alloca headers.
10768         (cmd_list) Gave prototype.
10769
10770         * sfm-read.c: Added DEBUGGING comments.
10771         (sfm_read_dictionary) Checks bias correctly.  Sets
10772         dict->var_by_name to NULL.  Calculates long_string_count
10773         correctly.  realloc's dict->var[] array to minimum size.
10774         [DEBUGGING] Calls dump_dictionary.
10775         [DEBUGGING] (dump_dictionary) New function.
10776
10777         * temporary.c: (save_dictionary) Sets var_by_name to NULL.
10778         (restore_dictionary) If the dictionary contains a non-NULL
10779         var_by_name, uses that instead of generating one.
10780         (free_dictionary) Destroys var_by_name.
10781
10782         * var.h: (struct dictionary) Added field `var_by_name'.
10783
10784         * get.c: New file, not complete.
10785
10786 Sun Nov  3 12:24:36 1996  Ben Pfaff  <blp@gnu.org>
10787
10788         * mis-val.c: New enums MV_NOR_*.  New struct num_or_range.
10789         (parse_num_or_range) New function.
10790         (parse_numeric) Reimplemented in order to support LOW THRU <n> and
10791         <n> THRU HIGH missing values.
10792
10793         * output.h: [__GNUC__>1 && __OPTIMIZE__] (width, height) Made
10794         __attribute__((const)).
10795
10796         * q2c.c: (get_token) Merged isdigit || isalpha into isalnum.
10797
10798         * sfm-read.c: Finished reference implementation.
10799
10800         * sfm.h: Includes var.h.
10801
10802         * var.h: Comment fixes.
10803         (struct `variable') Reordered some fields.
10804
10805         * vars-atr.c: (is_num_user_missing) Added support for MISSING_*
10806         constants added previously.
10807
10808 Wed Oct 30 17:13:08 1996  Ben Pfaff  <blp@gnu.org>
10809
10810         * common.h: Comment fixes.  Added declaration of
10811         `second_lowest_value' as variable or macro.  Made `compat_type',
10812         `pgm_state_type' into anonymous enums.
10813
10814         * display.c: Comment fix.
10815
10816         * glob.c: [ENDIAN==UNKNOWN] Added definition for `endian' global
10817         var.
10818         [!defined SECOND_LOWEST_VALUE] Added definition for
10819         `second_lowest_value' global var.
10820         (compat, pgm_state global vars) Changed types to `int'.
10821         (init_glob) Initializes `second_lowest_value'.
10822
10823         * sfm-read.c: Continued work, not complete.
10824
10825         * var.h: Added new MISSING_* constants to handle LOWEST and
10826         HIGHEST.
10827
10828 Sat Oct 26 23:06:06 1996  Ben Pfaff  <blp@gnu.org>
10829
10830         * sfm-read.c: New file, not complete.
10831
10832         * cases.c: (vec_insert) Changed vector expansion algorithm.
10833         (vec_delete) Fixed bug that screwed up deletion sometimes, it was
10834         mucking up the RECODE transformation in particular.
10835         (envector) Harmless change in notation.
10836
10837         dfm is now fairly well tested again.  
10838         * dfm.c: (dfm_get_record) Only returns ext->ptr if ext is
10839         non-NULL--duh.
10840         (cmd_begin_data) if(ext->line) replaced by if(ext && ext->line).
10841
10842         * recode.c: Comment fix.
10843
10844         * sfm.h: Interface should be fairly final now, or at least for a
10845         day or so...
10846
10847         * vfm.c: [DEBUGGING] (index_to_varname) New function.
10848         (open_active_file) [DEBUGGING] Translates ccase indices into
10849         variable names now to make it easier to understand what's really
10850         going on.
10851
10852 Sat Oct 26 20:46:31 1996  Ben Pfaff  <blp@gnu.org>
10853
10854         * data-in.c: Comment fix.
10855
10856         * data-list.c: Includes dfm.h.
10857         (do_reading) Uses new function dfm_push_cust().
10858
10859         * data-out.c: (convert_time, convert_WKDAY, convert_MONTH) Added
10860         `return 1;' at end.
10861
10862         * file-handle.h: Completely changed.  Some parts split off into
10863         new file dfm.h.  Implemented in file-handle.q.
10864         (enum FH_*) Removed.
10865         (struct fh_ext_class) New struct.
10866         (struct file_handle) Retained only these fields: name, norm_fn,
10867         fn, recform, lrecl, mode.  New fields class, ext.
10868         (get_handle_by_name, get_handle_by_filename, parse_file_handle,
10869         close_handle, handle_name) Added `fh_' prefix to name, all
10870         references changed.
10871
10872         * dfm.h: New file, implemented in dfm.c.
10873         (get_record, put_record, fwd_record, bkwd_record, set_record,
10874         get_cur_col) Functions moved from file-handle.h, now prefixed with
10875         `dfm_'.
10876         (dfm_push_cust) New function.
10877
10878         * sfm.h: New file.  Incomplete.
10879
10880         * dfm.c: All functions adjusted/rewritten for new dfm/fhp
10881         interface.  Functions reordered, comments changed.  Not well
10882         tested, probably full of bugs.
10883         (struct dfm_fhuser_ext) New struct.
10884         (dfm_close) New function.
10885         (open_file_r) Pickier about finding `BEGIN DATA.' line.
10886         (open_file_w) User messages changed.
10887         (get_record) Comment fixed.
10888         (read_record) Increments ext->ln even for inline_file.  Calls
10889         dfm_close() for inline_file when `END DATA.' encountered.
10890         (dfm_get_record) Experimental restructuring.
10891         (dfm_push_cust) New function.
10892         (cmd_begin_data) Detects whether the inline file was fully read by
10893         checking whether it is still open; detects whether it was read at
10894         all by checking whether the line number is greater than zero.
10895
10896         * file-handle.q: All functions adjust/rewritten for new dfm/fhp
10897         interface.  Functions reordered, comments changed.  Not well
10898         tested, probably full of bugs.
10899         (init_file_handle) Removed initializers for obsolete fields, added
10900         new fields.
10901         (fh_close_handle) Much simpler, now mainly calls the class
10902         function.
10903         (fh_init_files) Renamed inline file internal filename.
10904
10905         * file-type.c: Includes dfm.h.
10906         (read_from_file_type) Doesn't use dfm internal state anymore.
10907
10908         * inpt-pgm.c, print.c: Include dfm.h.
10909
10910         * recode.c: (internal_cmd_recode) Casts strlen() return value to
10911         int in comparison with other int.
10912
10913         * som-high.c: (build_target) Fixed operator precedence problem in
10914         if statement (& versus ==).
10915
10916 Sat Oct 26 10:39:25 1996  Ben Pfaff  <blp@gnu.org>
10917
10918         * dfm.c: (read_record) Can now read fixed-length records; not
10919         tested.
10920         (put_record) Can now write fixed-length records; not tested.
10921
10922         * file-handle.h: FH_* defines changed to enums.  New enum series
10923         FH_RF_*, FH_MD_*.
10924         (struct file_handle) New members recform, lrecl, mode.
10925
10926         * file-handle.q: Parser changed.
10927         (internal_cmd_file_handle) Added support for new /RECFORM, /MODE,
10928         /LRECL subcommands.  These are compatible with Windows.
10929         (init_file_handle) Initializes recform, mode fields.
10930
10931         * q2c.c: (get_line) When outputting `!' comment lines, now
10932         increments the output file line number so that `#line' directives
10933         are correct.
10934         (make_identifier) New function that converts an arbitrary string
10935         into a valid C identifier.
10936         (dump_vars) Calls make_identifier() in two places in order to
10937         suppress some errors for bad identifiers.
10938         (make_match) Allows TRUE as synonym for YES and FALSE as synonym
10939         for NO.  Allows numbers to be prefixed by underscores to make them
10940         acceptable C identifiers but still to be parsed as numbers by the
10941         Fiasco lexer.
10942
10943 Thu Oct 24 20:13:42 1996  Ben Pfaff  <blp@gnu.org>
10944
10945         * command.c: Re-enabled RECODE, SAMPLE, SELECT IF.
10946         
10947         * dfm.c: Comment fixes. (get_record) Gives error if file handle
10948         was opened for writing.
10949         (open_file_w) New function.
10950         (read_record) Uses strncasecmp if available.  Improved error
10951         messages, comments.
10952         (put_record) New function.
10953
10954         * file-handle.h: Moved function comments into dfm.c and
10955         file-handle.q.  Comment fixes.  Removed declarations of
10956         tilde_expand() and normalize_filename().
10957         (struct file_handle) Changed `open' from boolean to enumerated
10958         field to allow for three states--closed, open for reading, open
10959         for writing--all references changed.
10960
10961         * file-handle.q: Includes filename.h.
10962
10963         * print.c: (CMD_* enums) Renamed PRT_* and moved into var.h; all
10964         references changed.
10965         (alloc_line) Makes allowance for line terminator characters in
10966         calculations.
10967         (print_trns_proc) Now handles OUTFILE, WRITE differences.
10968         (print_space_trns_proc) Handles OUTFILE differences.
10969
10970         * recode.c, sample.c: Comment fixes.
10971
10972         * var.h: (struct print_trns) Changed boolean field `eject' to
10973         bitmapped field `options'; all references changed.  New enums
10974         PRT_* for use with this field.
10975
10976         * exception.h, test-exception.c: Removed.
10977
10978 Thu Oct 24 17:47:14 1996  Ben Pfaff  <blp@gnu.org>
10979
10980         * ascii.c: (delineate) Turned off debug output.
10981
10982         * common.c: [Checker and Linux] (__assert_fail, __eprintf) Moved
10983         to error.c.
10984
10985         * data-in.c: (parse_string_as_format) Sets the entire string value
10986         to spaces, not just the short string part of it.  Is this correct
10987         now? 
10988
10989         * data-out.c: (convert_date) Fixed DATETIME format problems with
10990         decimal places, removed debug code.
10991
10992         * dfm.c: (open_file_r) Fixed bug where an error would occur in the
10993         middle of parsing BEGIN DATA that would cause the lexer to read
10994         from a wild pointer `prog'; now calls new function
10995         preprocess_line() in lexer.c.
10996
10997         * error.c: [__CHECKER__] (hcf) Calls induce_segfault() on improper
10998         termination.
10999         [Checker and Linux] (__assert_fail, _eprintf) Moved from common.c.
11000         Now call induce_segfault() to induce the segfault.
11001         (induce_segfault) New function.
11002
11003         * expr-opt.c: Comment fix.
11004         (parse_sysvar) New function.
11005         (parse_primary) Added system variable support--calls
11006         parse_sysvar().
11007         (global var ops) Added OP_CASENUM operator.
11008
11009         * expr.h: Comment fixes.
11010         (OP_* enum) added OP_CASENUM operator.
11011         (struct casenum_node) New struct.
11012         (union any_union_union) New member `cas' of type `casenum_node'.
11013
11014         * glob.c: (global var last_vfm_invocation) New var.
11015         (init_glob) Initializes last_vfm_invocation.
11016
11017         * lexer.c: (lookahead) Fixed reversed condition on if statement.
11018
11019         * getline.c: (get_line) Split into get_line() and preprocess_line().
11020         (preprocess_line) New function.
11021
11022         * var.h: Declares last_vfm_invocation.
11023
11024         * vfm.c: (procedure) Sets last_vfm_invocation.
11025
11026 Wed Oct 23 21:53:43 1996  Ben Pfaff  <blp@gnu.org>
11027
11028         * command.c: (parse_cmd) Fixed bad assertion related to
11029         lookahead().
11030
11031         * data-in.c: (parse_month) Implemented to parse months according
11032         to full interpretation of standard.
11033         (to_roman) New function.
11034         (parse_wk_delimiter) Bug fix (forgot to skip `WK' in string).
11035         (parse_weekday) Bug fix (forgot to skip all the day name).
11036
11037         * data-list.c: (read_from_data_list_fixed) Fixed bug that screwed
11038         up parsing of multirecord data items.  Also fixed user message.
11039
11040         * data-out.c: Comment fix.
11041         (year2, year4, convert_date, convert_time, convert_WKDAY,
11042         convert_MONTH) New functions to support time & date output.
11043         (convert_format_to_string) Calls new time & date output routines.
11044
11045         * expr-prs.c: (nary_num_func) Found a bug, but didn't fix it yet.
11046
11047         * lexer.c: (lookahead) Noted a previously unnoticed caveat in
11048         comment.
11049
11050         * main.c: [DEBUGGING] (dump_token) Updated to handle getline.h.
11051
11052         * misc.c: (global var formats) Fixed declarations of DATETIME,
11053         TIME, DTIME.
11054
11055         * postscript.c: (text) Fixed a pair of bugs in the reallocation of
11056         the output_char buffer.
11057
11058         * vars-prs.c: (parse_DATA_LIST_vars) Fixed a failure to free
11059         memory bug.  Fixed user messages.
11060
11061 Tue Oct 22 17:27:04 1996  Ben Pfaff  <blp@gnu.org>
11062
11063         * Removed #pragma argsused from lots of places.
11064         
11065         * data-in.c: Implemented zoned decimal and time-date formats.
11066         Untested.  This is a huge chunk of code--maybe 1000 lines and 50
11067         new functions.
11068
11069         * data-out.c: Implemented zoned decimal format.
11070
11071         * expr.h: Moved yrmoda() declaration here from exprP.h.
11072
11073         * misc.c: (global var formats) Minor fixes--added
11074         FCAT_SHIFT_DECIMAL to formats N and Z.
11075         (convert_fmt_ItoO) Added support for format Z.
11076
11077         * som-frnt.c: (som_set_value) Fixed bug regarding string values.
11078
11079 Mon Oct 21 20:39:59 1996  Ben Pfaff  <blp@gnu.org>
11080
11081         * command.c: (parse_cmd) [GLOBAL_DEBUGGING] Inserted call to
11082         som_check_workspace() that is activated between commands.
11083
11084         * data-list.c: (dump_fixed_table, dump_free_table) Finished these
11085         for good, I hope.
11086
11087         * list.q: (begin_row) Changed title expansion style from
11088         SOPT_X_VERT to SOPT_X_SHSP.
11089
11090         * som-frnt.c: Now includes `somP.h'.
11091         (som_push_workspace, som_pop_workspace) New functions that, taken
11092         together, form a solution to the recursive table building problem
11093         mentioned yesterday.  Surrounded every table output routine
11094         throughout the program with calls to these functions.
11095         [GLOBAL_DEBUGGING] (som_check_workspace) New function.
11096         (som_create_table) Checks that there's an active workspace.
11097         (som_destroy_all_tables, som_crush) Removed.
11098
11099         * som-high.c: (global var som_preserve_tables) Removed, all
11100         references deleted.
11101         (som_submit_table) Checks that there's an active workspace.
11102         (dump_columnated_table) Doesn't columnate tables that would have
11103         just one row per column.
11104         (dump_crush_page, som_dump_crush_page) Removed debugging code.
11105         (som_dump_crush_page) Moved row number labels from left side of
11106         tables to right side.
11107         (som_get_table_size) Added support for SOPT_X_SHSP.
11108
11109         * som.h: New cell expansion type SOPT_X_SHSP.
11110
11111         * somP.h: (global vars arena_stack, n_arena_stack, m_arena_stack)
11112         New vars.
11113         (global var curtab_arena) Moved from som-frnt.c.
11114
11115 Sun Oct 20 13:45:28 1996  Ben Pfaff  <blp@gnu.org>
11116
11117         * ascii.c: [GLOBAL_DEBUGGING] (SUPPRESS_WARNINGS) New debug option
11118         that causes bad location warnings to be suppressed.
11119         (delineate) Saves current font when calling draw_text(); fixed
11120         handling of NULLs when backing up.  Also fixed line-wrapping bug.
11121
11122         * command.c: Re-enabled `LEAVE', `NUMERIC', `PRINT', `PRINT EJECT',
11123         `PRINT FORMATS', `PRINT SPACE', `STRING', `TITLE', `WRITE'.
11124
11125         * common.c: Added code to cause assertion failure to dump core
11126         when run under Checker.
11127
11128         * data-list.c: (dump_fixed_table) Fixed some inconsistencies, but
11129         there are still bugs.
11130
11131         * glob.c: (__eprintf) Removed.
11132
11133         * list.q: Inserted som_preserve_tables kluge that prevents tables
11134         from being thrown away due to recursive table building through
11135         som_output_line being called from a transformation during the LIST
11136         procedure invocation.  This is a general problem that must be
11137         solved in a better way since it applies to all procedures in
11138         general.
11139         (begin_row) Changed title options to SOM_X_VERT from SOM_X_BOTH.
11140         (flush_table) Removed SOM_TOPT_PRESERVE from submission options.
11141
11142         * numeric.c: Fixed several errors in the form of msg() calls.
11143
11144         * print.c: Updated for use of som.
11145         (dump_table) Reimplemented.
11146         (print_trns_proc) Calls som_eject_page() instead of eject_page().
11147         Calls som_output_text() instead of outs_line().
11148
11149         * som-frnt.c: (som_destroy_all_tables) Sets som_preserve_tables to
11150         0.
11151         (som_output_text) Function moved from som-low.c.  Interface
11152         changed.
11153
11154         * som-high.c: (som_preserve_tables) New global public variable
11155         declared in som.h.
11156         (som_submit_table) Destroys the tables only if som_preserve_tables
11157         is 0.
11158         (paginate_horizontally) Bugfix: sets som.mpw even if there's only
11159         one subrow per row.  Now labels subrows if there's more than one
11160         subrow per row.
11161         (dump_crush_table) Added wishlist comment.
11162         (som_eject_page) New public function declared in som.h.
11163
11164         * som-low.c: (som_dump_crush_page) Draws row labels if there's
11165         more than one subrow per row.
11166         (som_output_text) Moved to som-frnt.c.
11167
11168         * som.h: (SOM_TOPT_PRESERVE) Removed.
11169
11170         * title.c: (get_title) Changed interface.
11171         (cmd_title) Changed `title' to `outp_title'.
11172         (cmd_subtitle) Changed `subtitle' to `outp_subtitle'.
11173
11174 Sun Oct 20 09:04:15 1996  Ben Pfaff  <blp@gnu.org>
11175
11176         * list.q: (flush_table) Conforms to new partial options in
11177         som_submission_form.
11178
11179         * som-high.c: (paginate_horizontally) Changed form of subrow
11180         number labels.
11181         (build_target) Omits spacing before table if
11182         SOM_TOPT_PARTIAL_OMIT_TOP is selected.
11183         (dump_crush_page) Changed interface.  Only trims bottom rule if
11184         SOM_TOPT_PARTIAL_OMIT_BTM is not selected.
11185         (dump_crush_table) Handles partial tables.
11186         (output_row_label) New function.
11187         (som_dump_crush_page) Emits subrow number labels.  Draws vertical
11188         rule on the right edge of narrow subrows.
11189
11190         * som.h: Changed SOM_SUB_PARTIAL_* series of submission type
11191         constants to a series of SOM_TOPT_PARTIAL_* submission options.
11192         All references updated.
11193
11194 Fri Oct 18 19:46:49 1996  Ben Pfaff  <blp@gnu.org>
11195
11196         * misc.c: Comment fix.
11197
11198         * som-high.c: (examine_table) Treats crushed tables separates for
11199         purpose of determining header size.
11200         (paginate_horizontally) Allots space for line numbers in crushed
11201         tables with lots of subrows per row.  Calculates the `maximum page
11202         width', the width of the widest horizontal page.
11203         (build_target) Removed trim argument; all references changed.
11204         Stricter assertions.  (dump_crush_page) New function.
11205         (dump_crush_table) Reimplemented.
11206
11207         * som-low.c: (som_dump_page) Uses new RULE_ROW &c. constants.
11208         (som_dump_crush_page) Reimplemented, interface changed.
11209
11210         * somP.h: Many many new helper macros for use with crushed tables.
11211         (global var som) Removed `tv', `cum_y' members; all references
11212         removed.  New members `mpw', `digit_space'.
11213
11214 Sun Sep 29 19:37:03 1996  Ben Pfaff  <blp@gnu.org>
11215
11216         * arena.c: (arena_alloc) [!DISCRETE_BLOCKS] Removed `size'
11217         variable, changed to constant 1024.
11218         (arena_ca_strdup) Changed `sizeof(a_string)' to
11219         `sizeof(c_string)'.
11220         (arena_ca_strdup) [!DISCRETE_BLOCKS] Changed bad cast from
11221         `(c_string *)' to `(char *)'; this fixed some offset problems.
11222
11223         * filename.c: (readlink_malloc) Changed initial allocation from
11224         100 bytes to 128.
11225         (good_getcwd) Changed from xmalloc() to local_alloc(); removed
11226         comment.
11227
11228         * postscript.c: (read_fontmap) Fixed leak by changing &owner to
11229         &fm->owner in several places.
11230
11231         * som-high.c: (output_table) Changed interface to rest of world.
11232         (examine_crush_table) Removed.  Crushed tables are re-broken now,
11233         in preparation for rewrite.
11234
11235         * som.h: Comment fix.
11236
11237 Sat Sep 28 21:28:07 1996  Ben Pfaff  <blp@gnu.org>
11238
11239         * ascii.c: (ascii_init_driver) Disposes of x->file.filename and x
11240         itself in the cleanup stage.
11241
11242         * descript.q: (display) At least temporarily, changed the table
11243         format to a crushed table.
11244
11245         * list.q: (begin_row) At least temporarily, added horizontal lines
11246         between cases.
11247
11248         * som-high.c: (examine_crush_table) Sets som.hh to the width of
11249         the horizontal "headers," that is, to the width of the far left
11250         and far right rules.
11251         (justify_pagination) Sets som.th to the width of the widest row
11252         in the crushed table.  Fixed inner loop off-by-one error.
11253
11254         * som-low.c: (som_dump_crush_page) Added code to draw horizontal
11255         rules.
11256
11257         * somP.h: Comment fix.
11258
11259 Fri Sep 27 20:08:39 1996  Ben Pfaff  <blp@gnu.org>
11260
11261         * filename.c: (open_file_ext) Now, doesn't set f->file to NULL
11262         before closing it; also, opens the constructed filename `s'
11263         instead of f->filename.
11264
11265         * postscript.c: Moved initialization of x->loaded, x->prop,
11266         x->fixed, x->current, also the add_encoding() calls, into
11267         postopen().
11268         (preclose) Destroys x->combos; sets x->loaded, x->combos to NULL;
11269         sets x->last_font to NULL; sets x->next_combo to zero.
11270
11271         * som-high.c: (crushed_row_height) Moved definition farther up.
11272         (som_submit_table) Doesn't calculate line width, font size until
11273         after calling open_page(), to accomodate changes to PostScript
11274         driver.
11275         (vert_headers) Removed; equivalent functionality moved to
11276         examine_table(), examine_crush_table().
11277         (justify_pagination) Replaced with different algorithm.
11278         (dump_crush_table) Bugfix that caused tables to fail to be clipped
11279         at the bottom of the page.
11280
11281 Thu Sep 26 22:20:26 1996  Ben Pfaff  <blp@gnu.org>
11282
11283         * command.c: Added cmd_list back into cmd_table.
11284
11285         * freq.c, frequencies.q, repeat.c, list.q, vars-atr.c, vfm.c:
11286         Comment fix: `#define DEBUGGING' --> `#define DEBUGGING 1'.
11287
11288         * list.q: (flush_table) Updated to new som_submission_form format.
11289
11290         * som-frnt.c: Comment fix.
11291
11292         * som-high.c: Changed `#endif' to `#undef EXTERN'.
11293         (output_table) Calls som_get_table_size() directly; handles
11294         crushed tables.
11295         (examine_crush_table) New function; calls vert_headers().
11296         (examine_table) Moved some code into new function, vert_headers().
11297         (justify_pagination) New function.
11298         (dump_plain_table) Removed `static' from `cy'.
11299         (dump_crush_table) New function.
11300
11301         * som-low.c: (som_dump_crush_page) New function.
11302
11303         * som.h: Comment fixes.
11304         (enum SOM_TOPT_CRUSH) New.
11305         (SOM_SUB_PARTIAL_BEG, SOM_SUB_PARTIAL_MID, SOM_SUB_PARTIAL_END)
11306         Temporarily set to zero to make do with LIST procedure.
11307
11308         * somP.h: Re-ordering.
11309
11310 Wed Sep 25 19:36:11 1996  Ben Pfaff  <blp@gnu.org>
11311
11312         * som.c: Split into som-frnt.c, som-high.c, som-low.c.
11313
11314         * somP.h: New file for use by som-high.c, som-low.c.
11315
11316         * q2c.c: Added definition for VME.
11317         (get_line) Now dumps `!' comment lines to the output file
11318         verbatim.
11319
11320         * crosstabs.q, descript.q, file-handle.q, frequencies.q, list.q,
11321         set.q: Changed format of `!' comment lines.
11322
11323 Tue Sep 24 18:39:09 1996  Ben Pfaff  <blp@gnu.org>
11324
11325         * All source files: Added copyright notice.
11326
11327         * common.c: (xmalloc, xrealloc, xstrdup) Cast size_t's to unsigned
11328         longs in msg() calls.
11329
11330         * con32s.c: (xmalloc, xrealloc) Updated from common.c.
11331
11332         * q2c.c: (xmalloc, xrealloc, xstrdup) Updated from common.c.
11333
11334 Sat Sep 21 23:16:31 1996  Ben Pfaff  <blp@gnu.org>
11335
11336         * output.c: (outp_read_devices) Changed criteria for
11337         distinguishing different types of lines.
11338
11339 Fri Sep 20 22:52:28 1996  Ben Pfaff  <blp@gnu.org>
11340
11341         * cmdline.c: Changed syntax message.
11342
11343         * filename.c: (good_getcwd) Bug fix (?).
11344         (normalize_filename) [__BORLANDC__] Uses _fullpath() library
11345         function.
11346         (search_path) Appends DIR_SEPARATOR to directory name only if it
11347         does not already end with one.
11348
11349         * glob.c: Checks STAT_PAGER envvar before PAGER.
11350
11351         * output.c: Checks environment variables instead of just local
11352         macros.
11353
11354 Tue Sep 10 21:39:00 1996  Ben Pfaff  <blp@gnu.org>
11355
11356         * arena.c: (arena_destroy) Swatted a subtle bug that cropped up
11357         when the pointer passed to the function was within the arena
11358         itself, so that it couldn't properly be set to NULL _after the
11359         arena was freed_.
11360
11361         * command.c: Re-enabled DISPLAY.
11362
11363         * display.c: Rewritten to handle tables.  Untested.
11364
11365         * filename.c: (search_path) Fixed memory leak.
11366
11367         * frequencies.q: (cmd_frequencies) Frees v_variables.
11368         (postcalc) Calls cleanup_freq_tab() after displaying statistics.
11369         (cleanup_freq_tab) New function to garbage collect.
11370         (dump_full) Elegantized.
11371
11372         * main.c: New comment.
11373
11374         * output.h: New tag for tagged quotes: TAG_NEWLINE.
11375
11376         * postscript.c: Comment fix.
11377         (release_fontmap, free_font_entry) New functions.
11378         (ps_init_driver) Sets free_font_entry() as the freefunc for
11379         hashtable `loaded'.  Calls release_fontmap() when destroying a
11380         driver; also frees the output filename; also frees the
11381         ps_driver_ext block.
11382         (free_ps_encoding) Frees the filename as well as the encoding
11383         block.
11384         (output_encodings) Frees the line buffer and pops the msg-filename
11385         stack.
11386         (read_fontmap) Frees the fontmap filename and the line buffer.
11387         (postopen, preclose) Misc. garbage collection fixes.
11388         (ps_open_page) Destroys the `combos' hash table; sets `last_font'
11389         to NULL; this fixes some output problems.
11390         (text) Handles TAG_NEWLINE.  Untested.
11391
11392         * som.c: (cell_byte_size) Merged SCON_VALUE and SCON_TEXT cases.
11393         (som_set_string) Removed.  All references changed to
11394         `som_set_text'.
11395         (som_set_text) Rewritten.  New interface.  More general.
11396
11397         * som.h: Minor format changes.
11398         (struct som_value_cell) Removed; all references changed to
11399         `som_text_cell'.
11400         (enums SOT_*) Changed.
11401
11402 Mon Sep  9 21:43:13 1996  Ben Pfaff  <blp@gnu.org>
11403
11404         * command.c: Re-enabled SPLIT FILE.
11405
11406         * postscript.c: Comment fix.
11407
11408         * som.h: Added `SOT_NONE'.
11409
11410         * split-file.h: (cmd_split_file) Removed superfluous parenthesis.
11411
11412         * vfm.c: (dump_splits) Reimplemented.
11413
11414 Sat Sep  7 22:35:12 1996  Ben Pfaff  <blp@gnu.org>
11415
11416         * Compiled the project under gcc 2.7.2, which gave some new
11417         warnings.  This led to many additions of casts from unsigned to
11418         int sprinkled throughout the code.
11419         
11420         * arena.c: Many uses of `unsigned' changed to `size_t'.
11421
11422         * command.c: Added END FILE, END REPEAT to command table.
11423         (var cmd_end_repeat) Renamed cmd_end_repeat_p.
11424         (find_command, FILE_TYPE_okay) Not commented out anymore.
11425         (parse_cmd) Calls FILE_TYPE_okay again.
11426         (output_line) Added calls to som_output_text() to put the line
11427         in the output files.
11428
11429         * common.c: (macro VME) Format changes.
11430         (xstrdup) Asserts that its argument is not NULL.
11431         
11432         * data-list.c: Implemented dump_fixed_table().
11433         
11434         * inpt-pgm.c: Formatting changes.  Comment changes.
11435         (end_case_proc) Renamed end_case_trns_proc.
11436         (cmd_end_file, end_file_trns_proc) New functions.
11437
11438         * misc.c: Many uses of `int' and `unsigned' changed to `size_t'.
11439
11440         * misc.h: (local_strdup) New macro corresponding to strdup() but
11441         allocating its data through local_alloc() if possible--that is, if
11442         GNU C is in use.
11443
11444         * postscript.c: Comment changes.
11445         (quote_ps_name, quote_ps_string, output_encodings) New functions.
11446         (output_line, add_string) New macros supporting
11447         output_encodings().
11448         (postopen) Fixed contents of ${fixed-font} and ${prop-font}
11449         substitution vars.  Calls output_encodings() when a line
11450         consisting of `!encodings' is encountered.
11451         (preclose) Some code moved into quote_ps_string().
11452         (dump_line) Changed into macro supporting dump_fancy_line().
11453         (switch_font) Now outputs DSC "%%IncludeResource: font (...)"
11454         command when appropriate.
11455         (write_text) Fixed `literal_char' array (I think it's fixed, at
11456         least.)
11457         (text) Fixed bug when width was zero.  Now exits immediately on
11458         zero height_left.  Now, when executing `goto restart;', checks
11459         that cp<end, so that we don't read beyond end-of-string.  Also,
11460         outputs the correct code to the output file by outputting the code
11461         from the metric instead of the internal metric index.
11462
11463         * repeat.c: (cmd_end_repeat) New function.
11464
11465         * som.c: (var som) `headers' renamed `options' and semantics
11466         changed.  All references changed.
11467         (draw_title) `if(px!=-1 || px!=-1)' --> `if(px!=-1 || py!=-1)'.
11468         (build_target) Only inserts spacing if SOM_TOPT_SPACING not
11469         selected.
11470         (som_text_table) Removed.
11471         (som_output_text) New function.
11472
11473         * som.h: (struct som_submission_form) Removed `header', `reuse',
11474         replaced with bitmapped field `options'.
11475         (SOM_TOPT_*) New enum set for som_submission_form.options.
11476         (SOT_*) New enum set for som_output_text().
11477
11478         * temporary.c: (copy_variable) When copying the var label, only
11479         calls xstrdup() if it's non-NULL.
11480
11481         * var.h: (enum type `vartype') Removed; all references changed to
11482         `int'.
11483
11484         * vars-atr.c: (init_variable) Changed local var `nbytes' from
11485         `int' to `size_t'.
11486
11487 Thu Sep  5 22:05:56 1996  Ben Pfaff  <blp@gnu.org>
11488
11489         * font.h: Comment changes.
11490
11491         * groff-font.c: (groff_read_font) Initializes `name' field to
11492         NULL.  Handles `encoding' field.
11493
11494         * hash.c: (hsh_dump) [GLOBAL_DEBUGGING] Output formatting changes.
11495
11496         * postscript.c: (struct font_entry) Removed `position' field.
11497         (struct ps_font_combo) New struct.
11498         (struct ps_driver_ext) Removed field `next_position'.  New fields
11499         `combos', `next_combo'.  `last_font' field changed from
11500         `font_entry *' to `ps_font_combo *'.
11501         (ps_init_driver) Reformatted; handles new fields.  When
11502         OPO_AUTO_ENCODE is set, adds the two default fonts' encodings to
11503         the encoding list.
11504         (get_encoding, find_encoding_file) New functions.
11505         (add_encoding) Some code moved out into find_encoding_file().
11506         (postopen) Changed value for ${title}.
11507         (preclose) Sets `loaded' field to NULL after destroying the hash
11508         table.
11509         (ps_open_page) Added comment.  Inits the `combos' and `next_combo'
11510         fields.
11511         (ps_text_set_font_by_position) Figures out the current family if
11512         not known.
11513         (compare_ps_combo, hash_ps_combo, free_ps_combo) New functions.
11514         (switch_font) Implemented.
11515         (write_text) Calls switch_font() more often.  Format changes.
11516         #undefs its macros after they're no longer useful.
11517         (text) Changed `continue' at one point to a jump to the top of the
11518         loop because we don't want `separate' reset to 0 at that point.
11519         (load_font) No longer sets `position' in the font_entry created.
11520
11521 Wed Sep  4 21:45:35 1996  Ben Pfaff  <blp@gnu.org>
11522
11523         * font.h: (struct font_desc) New member `encoding', which is not
11524         properly handled yet.
11525
11526         * glob.c: (init_glob) Some new i18n code, which is probably
11527         screwed up.
11528
11529         * output.c: (outp_read_devices, outp_get_paper_size) Changed
11530         `size' local from `int' to `size_t'.
11531
11532         * postscript.c: New driver configuration parameter `auto-encode'.
11533         New enums OPO_AUTO_ENCODE, ODA_COUNT.
11534         (struct font_entry) New member `position'.
11535         (struct ps_driver_ext) Reordered.  New hash table member
11536         `encodings'; new members `next_position', `next_encoding',
11537         `last_font'.  Members `current', `prop', `fixed' changed from type
11538         `font_desc *' to `font_entry *'; all references changed.
11539         (struct ps_encoding) New struct.
11540         (read_ps_encodings, compare_ps_encoding, hash_ps_encoding,
11541         free_ps_encoding, add_encoding) New functions.
11542         (ps_init_driver) Added OPO_AUTO_ENCODE to default
11543         x->output_options.  Initializes new members of ps_driver_ext.
11544         Changed default value for prologue_fn, encoding_fn.  Calls
11545         read_ps_encodings after loading default fonts.
11546         (option_tab[], ps_option) Handle new configuration parameter.
11547         (switch_font) New function.
11548         (struct output_char) `font' member changed from `font_desc *' to
11549         `font_entry *'.  New member `separate'.
11550         (read_fontmap) Changed `size' from `int' to `size_t'.
11551         (output_line, put_number) New macros for write_text().
11552         (write_text) Optimizes text output by consolidating multiple
11553         calls to PostScript `show' operator.
11554         (text) Keeps track of when text arguments can't be consolidated by
11555         write_text(), and marks those spots in the output stream.
11556         (load_font) Sets `position' of the allocated font_entry to -1, cuz
11557         the font hasn't been switched to by switch_font(), which is where
11558         the position is important--the PostScript is what cares about the
11559         position.
11560
11561 Sat Aug 31 23:52:38 1996  Ben Pfaff  <blp@gnu.org>
11562
11563         * hash.c: (hsh_destroy) Ignores NULL argument.  Doesn't try to
11564         call a NULL free_func.
11565         (hsh_rehash) Elegantized.
11566         (hsh_probe) Fix bug that manifested when the table was expanded
11567         and thus had to change location in memory.  Good thing
11568         too--otherwise could have been much more subtle.
11569         (hsh_find) [GLOBAL_DEBUGGING] Not stubbed out anymore.
11570         (hsh_foreach) New function for hash table iteration.
11571
11572         * hash.h: (struct hsh_iterator) New.
11573
11574         * lexer.c: (parse_tagged_quote) Font and family name strings in
11575         tags are now null-terminated.
11576
11577         * output.c: (outp_evaluate_dimension) Fixed over-aggressive unit
11578         parsing.
11579         (internal_get_paper_size, outp_get_paper_size) Fixed; now work as
11580         documented.  (Never before tested?)
11581
11582         * output.h: Comment changes.
11583
11584         * postscript.c: New driver options `optimize-text-size',
11585         `optimize-line-size', `max-fonts-simult'.  New enum set for
11586         specing cached line types.  Comment fixes.
11587         (struct line_form) New struct.
11588         (struct ps_driver_struct) New members `text_opt', `line_opt',
11589         `max_fonts', `lines'.
11590         (ps_init_driver) Initializes new members of ps_driver_struct.
11591         (user option type enum set) New member `nonneg_int_arg'.
11592         (static var option_tab[]) Supports new options.
11593         (ps_option) Handles new options.
11594         (find_ps_file) Made static.  No longer calls hsh_dump().
11595         (ps_get_var) Made static.
11596         (preclose) Dumps out proper DSC trailer.
11597         (ps_open_page) Elegantized.
11598         (ps_close_page) Calls dump_lines() if appropriate.
11599         (ps_line_horz, ps_line_vert, ps_line_intersection) Reduced to
11600         wrappers around line().
11601         (int_2_compare, compare_line, dump_line, dump_fancy_line,
11602         dump_lines, hash_line, free_line, line) New functions for support
11603         of line caching.
11604         (write_text, text) Made static.
11605         (text) Added to font support, not finished.
11606
11607 Thu Aug 29 21:36:41 1996  Ben Pfaff  <blp@gnu.org>
11608
11609         * font.h: (struct font_desc) New members ascent, descent.
11610
11611         * groff-font.c: (groff_read_font) Calculates font ascent and
11612         descent from the ascent and descent of the `d' and `p' characters,
11613         respectively, as per a suggestion on comp.fonts.
11614
11615         * postscript.c: (ps_open_page, ps_close_page, ps_line_horz,
11616         ps_line_vert, ps_line_intersection) Rewritten to deal with changed
11617         prologue.
11618         (write_text) Handles text right-justification and centering (not
11619         full justification).  Still very inefficient.  (One output line
11620         per character?!)
11621         (struct output_char) Added fields for font and font size.
11622         (text) Many bugfixes.
11623
11624 Sat Aug 24 23:26:00 1996  Ben Pfaff  <blp@gnu.org>
11625
11626         * cmdline.c: (usage) Calls outp_list_classes().
11627
11628         * font.h: Comment fix.
11629
11630         * groff-font.c: New exported global var `space_index'.
11631         (groff_init) New function to initialize `space_index'.
11632         (hash_kern) Casts result to unsigned.
11633         (font_name_to_index) Renamed font_char_name_to_index.  All
11634         references changed.  Also, now returns the value of `space_index'
11635         when passed an ASCII space character as an argument.  Fixed
11636         handling of nulls.
11637         (font_get_kern_adjust) Changed i from `int' to `unsigned'.
11638         Handles passed NULL pointers properly.
11639
11640         * lexer.c: (parse_tagged_quote) Comment fix.  Better range
11641         checking.
11642
11643         * output.c: (outp_list_drivers) Removed.  Removed all references.
11644         
11645         * output.h: Comment fixes.
11646
11647         * postscript.c: (ps_open_global) Calls groff_init().
11648         (output_char) New structure.
11649         (write_text) New function.
11650         (text) No longer stubbed out!  Now the output is correct--with a
11651         few exceptions, one of them being that the page has to be held
11652         upside down into a mirror.
11653
11654 Sun Aug 11 21:31:22 1996  Ben Pfaff  <blp@gnu.org>
11655
11656         * font.h: Comment fix.
11657         
11658         * font.c: (name_to_index) Renamed font_name_to_index, made extern.
11659         All callers changed.
11660         (number_to_index) Renamed font_number_to_index, made extern.  All
11661         callers changed.
11662         (font_get_kern_adjust, font_get_char_metrics) New functions.
11663
11664         * output.h: New constant OUTP_T_INTERNAL_DRAW.
11665
11666         * postscript.c: Changed default line width back to 1/2 point.
11667         (ps_line_horz, ps_line_vert, ps_line_intersection) Now lines are
11668         in the center of the space allotted for them, not just a fixed
11669         offset from the edge of the space; this fixes some bugs.
11670         (ps_line_intersection) Now supports all command line styles.
11671         (ps_text_get_size) Bug fix in computation of em width.
11672         (text) New function, the meat behind ps_text_metrics and
11673         ps_text_draw.  Not complete.
11674         (ps_text_metrics, ps_text_draw) Removed the stub taken from
11675         ascii.c; call text().
11676
11677 Sat Aug 10 23:28:17 1996  Ben Pfaff  <blp@gnu.org>
11678
11679         * arena.c: (arena_free) Assert that the argument is non-NULL.
11680         
11681         * groff-font.c: (add_kern) Calls arena_free() for old_kern if and
11682         only if old_kern is non-NULL.
11683
11684         * postscript.c: (ps_init_driver) Changed default line width to 1
11685         point.
11686         (postopen) New prologue variables.
11687         (ps_line_horz, ps_line_vert, ps_line_intersection) Implements some
11688         more of the common line styles properly, but not all.
11689         (ps_text_metrics) Fixed problem with this stubbed out version that
11690         kept it from taking font sizes into account.
11691
11692 Thu Aug  8 22:31:11 1996  Ben Pfaff  <blp@gnu.org>
11693
11694         * arena.c: (arena_malloc) Bug fix.
11695         (arena_dump) [GLOBAL_DEBUGGING] New function.
11696
11697         * ascii.c: Comment fix.
11698         (count_fancy_chars, delineate) Now static functions.
11699         
11700         * filename.c: (interp_vars) Bug fixes.
11701
11702         * font.h: Comment fixes.
11703
11704         * glob.c: (init_glob) Sets set_viewwidth, set_viewlength at
11705         beginning in case we have an error message to display before
11706         initializing the display.
11707
11708         * groff-font.c: Comment fix.  Changed rehash threshold from 2/3
11709         full to 1/2 full.
11710         (groff_read_font) Bug fixes.
11711         (name_to_index) Increments hash.used.  Sets `name' field of hash
11712         entry properly.
11713         (add_kern) Sets kern_max_used after rehashing.  Other bug fixes.
11714
11715         * hash.c: Return type changed.
11716
11717         * postscript.c: Continued development.  Now marks lines on the
11718         paper, but very buggy.
11719
11720 Sat Aug  3 20:50:35 1996  Ben Pfaff  <blp@gnu.org>
11721
11722         * Changed comments in many source files from `/* xxx /* yyy */' to
11723         `/* xxx */ /* yyy */' for cleanliness.
11724
11725         * arena.c: (arena_sd_strdup) New function.
11726         
11727         * ascii.c: (struct ascii_driver_ext) New member `file'.
11728         (ascii_init_driver) Fills out member `file' for initing; uses
11729         close_file_ext for closing drivers.
11730         (ascii_option) Changed %.*s back to %s because the a_string's are
11731         always null-terminated.
11732         (postopen, preclose) New functions.
11733         (ascii_open_page) Uses new style of open_file_ext.
11734         (ascii_option, commit_line_buf, output_lines) Use ext->file.file
11735         instead of this->output.
11736         (__assert_fail) Removed.
11737
11738         * cmdline.c: Changed syntax_message[].
11739
11740         * error.c: #include's <readline/history.h> only if the history
11741         library is available, not if just the readline library is
11742         available.
11743
11744         * filename.c: (expand_line) Removed alloca() support.
11745         (interp_vars) No longer tilde-expands argument.  Limit on output
11746         length removed.
11747         (tilde_expand) Now treats argument as path rather than filename.
11748         [!unix] Now is a no-op function.
11749         (search_path) Better verbose message formatting.
11750         (open_file, close_file) Comment fixes.
11751         (close_file) [!unix] Doesn't bother with pipes.
11752         (open_file_ext) Completely rewritten, interface revamped.
11753         (close_file_ext) New function.
11754
11755         * font.h: Comment changes.
11756
11757         * frequencies.q: Removed AIX alloca support since it doesn't use
11758         alloca.
11759
11760         * hash.c: Comment changes & additions.
11761         (hsh_create) Initializes entire table instead of first M entries.
11762         (hsh_probe) Stupid bug fixed.  Now it works.
11763         (hsh_dump) [GLOBAL_DEBUGGING] New function.
11764
11765         * main.c: (parse) Detects EOF properly in token-eating loop.
11766         Should the STOP token have its value changed to 0?
11767
11768         * misc.c: (blp_getdelim) [HAVE_GETDELIM] Now it's a macro.
11769         (blp_getline) Now it's a macro.
11770
11771         * output.h: (struct outp_driver) Removed members output, filename.
11772         
11773         * output.c: (outp_init) [!NO_POSTSCRIPT] Installs PostScript
11774         drivers in driver table.
11775         (outp_read_devices) Frees buf.  Warns if there are no active
11776         output drivers.
11777         (outp_configure_clear) Sets outp_configure_vec to NULL after
11778         deleting its elements.
11779         (configure_driver, destroy_driver) Removed references to output,
11780         filename members of outp_driver.
11781         (outp_evaluate_dimension, internal_get_paper_size,
11782         outp_get_paper_size) New functions.
11783
11784         * postscript.c: Continued development.  Now links but doesn't make
11785         any marks on the page.  Lotsa bugs I suppose.
11786
11787         * str.c: (strcasecmp) [!HAVE_STRCASECMP] New function.
11788
11789         * str.h: Comment changes.
11790
11791 Sat Jul 27 22:32:38 1996  Ben Pfaff  <blp@gnu.org>
11792
11793         * Removed dependencies on non-nested comments in several files.
11794         Also removed references to (unix || __unix__) in #if's since
11795         prefh.orig makes those two equivalent.
11796         
11797         * ascii.c: (ascii_open_global) Creates ascii_arena.
11798         (ascii_close_global) Destroys ascii_arena.
11799         (ascii_init_driver) Doesn't create ascii_arena.
11800         (ascii_copy_driver) Removed.
11801         (ascii_option) Possible bugfix regarding %s vs. %.*s with a_string's.
11802         (outp_class ascii_class) Removed ascii_copy_driver reference.
11803
11804         * frequencies.q: Now can display all statistics except median.
11805         Still not finished.
11806
11807         * output.c: Handles outp_class.ref_count so output class
11808         destructors are called properly.
11809         (add_class) Sets ref_count to 0.
11810         (configure_driver) Initializes class if ref_count++ is 0.
11811         (destroy_driver) Destructs class if --ref_count is 0.  Frees the
11812         class output file name.
11813         
11814         * output.h: (struct outp_class) Removed copy_driver, inited.
11815         Added ref_count.
11816
11817         * postscript.c: Completely replaced but not finished.
11818         
11819 Tue Jul 23 21:48:36 1996  Ben Pfaff  <blp@gnu.org>
11820
11821         * approx.h: #includes <float.h>.
11822
11823         * arena.h, arena.c: Many functions changed to take an arena **
11824         instead of an arena *, for consistency.  All callers changed.
11825         (arena_alloc) Now creates a new arena if passed *A that is NULL.
11826         (arena_destroy) Sets *A to NULL.
11827         
11828         * ascii.c: (delineate) Implements OUTP_T_VERT correctly.  Removed
11829         assertion that `width' be positive.
11830
11831         * command.c: Removed #if's from cmd_table.
11832         (walk_cmdtable_func) [0] New function (debug code).
11833         (init_cmd_parser) [0] Dumps out cmd_table (debug code).
11834         (parse_cmd) Doesn't return failure for unimplemented commands.
11835
11836         * common.h: (SYSMIS) Changed from DBL_MAX to -DBL_MAX.
11837         (SYSCODE) New constant macro.
11838
11839         * descript.q: Checks for positive n_variables before performing
11840         analysis.
11841
11842         * file-handle.q: (get_handle_by_filename) Bug fix: passes &f to
11843         avl_find instead of &fp as arg 2.
11844
11845         * frequencies.g, frequencies.q: Continued updating; now compiles &
11846         works again, but not complete.
11847
11848         * main.c: Changes to user messages.
11849
11850         * misc.c: (reverse) [0] New function.
11851
11852         * settings.h: Comment removed.  #includes "common.h".
11853
11854         * som.c: (som_set_null) New function.
11855         (som_set_value, som_set_string, som_set_text) More detailing
11856         assertions.
11857         (som_set_float) Implemented function.
11858         (dump_columnated_table) Bug fix regarding page breaks.
11859         (draw_cell) Bug fix regarding text that spilled out of a cell.
11860         (draw_intersection, draw_horz_rule, draw_vert_rule) No longer draw
11861         null lines.
11862         (get_cell_size) Support SCON_EMPTY cells.
11863         (get_table_size) When calculating rules' widths and heights, mask
11864         out SLIN_SPACING bit.  Added SOPT_X_HLTL support.
11865         
11866         * som.h: (som_any_cell) New option SOPT_X_HTLT.  Removed
11867         SOPT_X_SHADE.
11868         (struct som_submission_form) New member `header'; all users
11869         changed.
11870
11871         * val-labs.c: (get_label) User messages changed.
11872
11873         * var.h: Changed FREQUENCIES structures.
11874
11875         * vars-atr.c: (is_num_user_missing, is_str_user_missing) Made
11876         inline.
11877         
11878 Fri Jul 19 19:11:13 1996  Ben Pfaff  <blp@gnu.org>
11879
11880         * approx.h: Definition of EPSILON now depends on system's
11881         DBL_EPSILON.  Removed GNU C specific code.
11882         (cmpapx) Renamed approx_compare.
11883
11884         * frequencies.g, frequencies.q: Continued updating; still doesn't
11885         compile.
11886
11887         * groff-font.c: (name_to_index) Fix bug that kept it from
11888         compiling.
11889
11890         * hash.c, hash.h: Completed work.
11891
11892         * var.h: Changes to freq_tab, frequencies_proc.
11893         
11894 Wed Jul 17 21:23:36 1996  Ben Pfaff  <blp@gnu.org>
11895
11896         New hashing code.
11897         * hash.c, hash.h: New files.  Not completed.
11898         * Makefile.am: Added hash.c to source file list.
11899         * font.h: (struct font_desc) New member kern_size_p.
11900         * groff-font.c: Uses hash.h.
11901         (hashpjw) Moved to hash.c.
11902         (next_prime_power) Rewrote, renamed hsh_next_prime, moved to
11903         hash.c.
11904         (static var hash) New member size_p.
11905         * var.h: Includes hash.h.
11906         (struct freq_tab) Changed AVL_TREE to hash_tab.
11907
11908         * vars-prs.c: Comment, formatting fixes.
11909
11910         * frequencies.g, frequencies.q: Continued updating.  Not yet
11911         working.
11912
11913         * formats.c: Bug fix.
11914
11915 Tue Jul 16 22:10:04 1996  Ben Pfaff  <blp@gnu.org>
11916
11917         Increasing parallelism between DESCRIPTIVES and FREQUENCIES.
11918         * descript.g: Comment fixes.
11919         * descript.q: Comment fixes.  Moved some declarations into var.h.
11920         Made dsc_info a static table.  Updated FIXMEs.
11921         (internal_cmd_descriptives) Beautified.
11922         
11923         * frequencies.q: Started updating into working order.
11924         * frequencies.g: New file analogous to descript.g.
11925         * var.h: Comment fixes.  Added structures for FREQUENCIES.
11926         
11927         * som.c: Removed vestiges of crushing and partial table support.
11928
11929 Sun Jul 14 15:45:31 1996  Ben Pfaff  <blp@gnu.org>
11930
11931         * Many more changes to som.c especially, but these will not be
11932         documented as I have resolved to remove them.  This patchlevel is
11933         being released solely so that I can fall back to it if I decide
11934         that removing the changes is not a good idea.
11935
11936 Sat Jul 13 09:58:44 1996  Ben Pfaff  <blp@gnu.org>
11937
11938         * som.c: (global var som) New member `cum_y'.
11939         (build_target) Properly handles titles for partial tables.
11940         (dump_partial_beg, dump_partial_mid, dump_partial_end)
11941         Merged into single new function dump_partial().  Fixed problem
11942         with titles on partial tables.
11943         (dump_table) Calls dump_partial() for all parts of partial tables.
11944         (dump_page) Criteria for drawing title changed.
11945         
11946 Fri Jul 12 22:03:36 1996  Ben Pfaff  <blp@gnu.org>
11947
11948         * command.c: (cmd_table) Added LIST, WEIGHT.
11949
11950         * command.c: (cmd_remark) No longer frees `s' since it's not
11951         dynamically allocated.
11952         
11953         * data-out.c: (convert_f) Now correctly handles the case where
11954         abs(v->f)<1 but v->f rounds to a value of 1.00 given the specified
11955         number of decimals.
11956         (som_destroy_all_tables) Removed argument.  All callers changed.
11957         (som_vline, som_hline) Argument validity checking corrected.
11958         (som_set_value) Implemented half-heartedly.
11959         (replicate_table) Copies tables piece-by-piece when using Checker.
11960
11961         * som.h: New line style SLIN_1THIN, currently equivalent to
11962         SLIN_0.  New enum set SOM_SUB_*.
11963         (struct som_submission_form) Removed `seq_no'.  Added `type'.
11964         
11965         * list.q: Newly working file; uses partial tables.
11966         
11967         * som.c: (som_reduce_table) Renamed som_set_table_height().
11968         (som_crush) Removed argument `group'.
11969         (global var som) Removed `nt', `seq_no'.  Added `type'.
11970         (som_submit_table) Arguments changed.
11971         (output_table) Removed partial table code.
11972         (build_target) New arg; partial table support added.  All callers
11973         changed.
11974         (dump_plain_table) Removed partial table code.
11975         (dump_partial_beg, dump_partial_mid, dump_partial_end) New functions.
11976         (dump_table) Supports partial tables.
11977         (dump_page) New argument to allow not drawing top and/or bottom
11978         headers.  All callers changed.  Supports partial tables.
11979
11980 Sat Jul  6 22:22:25 1996  Ben Pfaff  <blp@gnu.org>
11981
11982         * data-out.c: Changed `#include <approx.h>' to `#include
11983         "approx.h".
11984         (convert_F) Comment fix.  Now won't print `-.000', etc.
11985
11986         * descript.q: Now Z-scores work, although there appears to
11987         be a bug (which might actually be in data-out.c:convert_F()).
11988         (descriptives_trns_proc, descriptives_trns_free) New functions.
11989         (run_z_pass) Implemented.
11990         
11991         * var.h: Comment fixes.
11992         (dsc_z_score, descriptives_trns) New structs.
11993         (descriptives_trns) Added to any_trns as `dsc'.
11994
11995         * error.c, error.h: New error class, IS (Installation Script
11996         error), used in those instances where the error is in the
11997         installation, but there is a script file or installation file that
11998         can be usefully referred to.
11999         
12000         * output.c: Change many IE classes to IS classes.
12001
12002         * cases.c, command.c, common.c, crosstabs.q, expr-evl.c,
12003         frequencies.q, list.q, vars-prs.c, vfm.c: Removed reference to
12004         HAVE_MALLOC_H because Borland C++ alloca() is broken, so why
12005         include the corresponding header?
12006         
12007         * glob.c: (init_glob) Don't malloc term_buffer under Checker.
12008         Don't bail out if termcap can't be read.
12009
12010         * som.c: (som_destroy_table) Removed.
12011         (som_reduce_table, som_destroy_all_tables) New functions.
12012         (som_crush) New function, not implemented.
12013         
12014         * som.h: New table option STAB_CRUSH.  Comment fix.  New struct
12015         som_submission_form.  Function prototypes revised.
12016
12017         Outputting huge tables (1000s of rows) a few rows at a time
12018         is supported, though untested.  May even break everything.
12019         Actually, the code doesn't even compile right now.
12020         * som.c: (struct som) New fields htv, nt, seq_no.
12021         (som_submit_table) Multiple arguments changed to a single
12022         pointer to struct submission_form.  Only increments subtable_num
12023         if seq_no is zero.  Only destroys table if it's not going to
12024         be reused.
12025         (replicate_table) New function.
12026         (output_table) Comment fix.
12027         (examine_table) Changed inline code to code calling
12028         replicate_table().  Calculates htv.  Supports partial tables.
12029         (draw_title) Removed comment.
12030         (build_target) Only allows for title on first part of partial
12031         tables.
12032         (dump_plain_table) Only resets table chunk number on first part
12033         of partial tables; FIXME: doesn't work quite right.  Supports
12034         partial tables.
12035         (dump_page) Titles only on first part of partial tables.
12036
12037 Fri Jul  5 20:16:19 1996  Ben Pfaff  <blp@gnu.org>
12038
12039         * Thanks to an unreliable IDE hard drive, I have spent the last
12040         day reconstructing my Debian GNU/Linux installation and redoing
12041         the previous day's changes--somehow I managed to save every file
12042         except for output.c and output.h.  So the following changes could
12043         really be considered independent of the output.c, output.h changes
12044         from Jul 4.
12045
12046         * output.h, output.c: Moved the outp_configure_vec global var,
12047         outp_names struct, and enum set OUTP_S_* from output.h to output.c.
12048         outp_configure_vec is now static.
12049         
12050 Thu Jul  4 20:20:24 1996  Ben Pfaff  <blp@gnu.org>
12051
12052         * The entire philosophy behind configuration of the output drivers
12053         changed.  Now there is a termcap-type configuration where drivers
12054         to be read are determined beforehand, rather than parsing the
12055         entire output init file and storing it in memory & deciding what
12056         to actually use later.  Faster & more memory-efficient at the same
12057         time, cool.
12058         
12059         * output.c: Comment fix.  Removed outp_init_drivers global var.
12060         Removed all references to synonyms.  New structure outp_defn.  New
12061         global vars outp_macros, outp_configure_vec.
12062         (search_name, delete_name, add_name, check_configure_vec,
12063         expand_name, find_defn_value) New static functions.
12064         (outp_configure_clear, outp_configure_add, outp_configure_macro,
12065         outp_read_devices) New extern functions.
12066         (outp_init) Much functionality moved into outp_read_devices.
12067         (outp_read_devices) Format of output init file changed; name of
12068         file is `devices' rather than `output' to avoid Makefile
12069         conflicts.
12070         (outp_clear) Renamed outp_done.
12071         (outp_list_classes) Bug fix, cleaned up.
12072         (outp_list_drivers) Not implemented anymore.
12073         (outp_configure_driver) Now a static function; simplified; now
12074         interpolates macros; supports new structure.
12075         (outp_enable_driver, match_synonym) Removed; all references
12076         removed.
12077         (find_driver) First argument removed.
12078         
12079         * output.h: Global var outp_init_drivers removed; new structure
12080         outp_names; new enum set OUTP_S_*; new global var
12081         outp_configure_vec; function prototypes for output.c exports
12082         updated.
12083         
12084         * main.c: (main) Calls outp_read_devices() after parsing the
12085         command line.
12086         
12087         * cmdline.c: (parse_command_line) New option -v --verbose;
12088         --version changed to -V.  --device option changed syntax to just
12089         take a single device name.  Accepts key=value declaration of
12090         output init file macros.  Syntax message updated.
12091
12092         * filename.c: (expand_line) New function.
12093         (interp_environ_vars) Renamed interp_vars; no longer uses
12094         fixed-size buffer.
12095         (blp_getenv) Allows $ARCH and $VER pseudo-environment-vars to be
12096         overridden by real environment vars.
12097         (search_path) Uses verbose_msg() instead of #ifdef'd printf().
12098         * filename.h: interp_environ_vars() renamed interp_vars().
12099         
12100         * error.c, error.h: Added extern variable `verbosity', message
12101         class MM.
12102         
12103         * error.c: (vmsg) Support message class MM.
12104         (verbose_msg) New function.
12105
12106         * descript.q: (generate_z_varname) Bug fix in generation of
12107         Z-score varnames.
12108         (dump_z_table) Bug fix in column headers.
12109         
12110         * ascii.c: (ascii_init_driver) Changed minimum number of lines per
12111         page from 29 to 15.  Don't set a default for ops[OPS_INIT,
12112         OPS_DONE].  Writes the uninit string when the driver is closed.
12113         (ascii_open_page) Write the init string before the first page.
12114         (output_shorts) Form of main loop changed from `while' to `for'.
12115         Bug fix with overstrikes: the character is printed *after* the
12116         backspace.  Eliminated a lot of `& 0xff' modifiers.
12117         (advance_to_left_margin) New function.
12118         (return_carriage, output_lines) Handle left margin.
12119
12120 Thu Jul  4 00:35:59 1996  Ben Pfaff  <blp@gnu.org>
12121
12122         * ascii.c: New option `carriage-return-style'.
12123
12124         * ascii.c: (count_fancy_chars) New function.
12125         (delineate, text_metrics) Use new function; bug fixes regarding
12126         rich text strings.
12127         (text_draw) Bug fix with rich text.
12128         (output_string, output_shorts) Reordered.
12129         (output_shorts) Now handles boxchars and some overstrike font
12130         changes.
12131         (output_char, return_carriage) New functions.
12132         (output_lines) Now handles overstriking and font changes properly;
12133         some code moved to output_shorts.
12134
12135 Tue Jul  2 22:13:23 1996  Ben Pfaff  <blp@gnu.org>
12136
12137         [GLOBAL_DEBUGGING]
12138         * ascii.c: New member `debug' in ascii_driver_ext.
12139         (ascii_init_driver, delineate) Uses new member.
12140
12141         Now you can set a vertical height on writing text.
12142         * ascii.c: (delineate) Keeps track of vertical position.
12143         (text_draw) No longer considers fully justified text an internal
12144         error.
12145         
12146         * output.h: New flag OUTP_T_VERT; other OUTP_T_ values changed.
12147
12148         Tables' titles are drawn; they can have variable height.
12149         * som.c: `som' struct has new member, title_height.
12150         (draw_title) New argument.  Moved within file.  All caller
12151         changed.
12152         (build_target) New argument, amount of space needed for first row.
12153         Calculates height of title, takes that into account.  All callers
12154         changed.
12155         (dump_plain_table, dump_columnated_table) Took calculation of y1,
12156         y2 out of loop.
12157         (dump_columnated_table) [GLOBAL_DEBUGGING] Debugging code
12158         improved.
12159         (dump_columnated_table) Organized for readability.
12160         (dump_page) Makes use of som.title_height.
12161
12162         * som.c: Many comment bug fixes.
12163
12164         * descript.q: (try_name, generate_z_name) Bug fix regarding
12165         generation of Z-score variable names.
12166         * var.h: Removed num from descriptives_proc; all referents removed.
12167
12168 Mon Jul  1 22:13:39 1996  Ben Pfaff  <blp@gnu.org>
12169
12170         * ascii.c: (ascii_line_horz, ascii_line_vert,
12171         ascii_line_intersection) Added debugging code.
12172
12173         Added a descriptive line above each table to describe it.
12174         * command.c: (parse_cmd) Calls som_new_series.
12175         
12176         * som.c: New static vars table_num, subtable_num.  New `som'
12177         member `title'.
12178         (dump_page) New arguments.
12179         (som_submit_table) Handle new variables.
12180         
12181         * som.c, som.h: (som_submit_table) New arguments.  All callers
12182         changed.
12183         (som_new_series) New function.
12184         (build_target) Makes room for extra line.
12185         (draw_title) New function.
12186         (dump_page) Calls draw_title.  Bug fix: doesn't always set
12187         som.ext->cp to 0.
12188         
12189         Columnation of tables support.
12190         * som.h: Deleted fr, lr, ri from som_table.  Reorganized.
12191         
12192         * som.c: Deleted references to fr, lr, ri.
12193         (som_columnate) Bux fix: sets group member of table.
12194         (som_add_options) Function removed.
12195         (dump_table) Split into three functions; extensively reworked.
12196         
12197         * descript.q: (dump_z_table) Better output table formatting; added
12198         title support to correspond to som.h changes.
12199         (display) Title support.
12200
12201         * output.h: Added OUTP_T_NONE.
12202         
12203 Mon Jul  1 13:00:00 1996  Ben Pfaff  <blp@gnu.org>
12204
12205         * descript.q: Improved handling of Z scores; still not perfect.
12206         
12207         * output.h, ascii.c: Added hook for getting em width of current
12208         font.
12209         
12210         * som.c: Uses new em-width hook.  Added debugging code to
12211         several functions.
12212         (som_columnate) New argument.
12213         (som_add_options) Removed.
12214
12215 Jun 29 17:40:47 1996  Ben Pfaff  <blp@gnu.org>
12216
12217         * som.h, som.c, output.c, output.h, ascii.c: Updated to work with
12218         rules as a property of the table instead of as a property of the
12219         cells.
12220         
12221         * ascii.c: Added `header' to table of options.
12222         
12223         * descript.q: Added even shorter statistic names; modified to work
12224         with new som interface.
12225         
12226         * misc.c (blp_getdelim): Bug fix.
12227         
12228         * version.c: includes 'conf.h'.
12229         
12230 ----------------------------------------------------------------------
12231 Local Variables:
12232 mode: change-log
12233 version-control: never
12234 End: