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