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