-#include "t-test.h"
-
-/* Values. */
-
-/* Definition of the max length of a short string value, generally
- eight characters. */
-#define MAX_SHORT_STRING ((SIZEOF_DOUBLE)>=8 ? ((SIZEOF_DOUBLE)+1)/2*2 : 8)
-#define MIN_LONG_STRING (MAX_SHORT_STRING+1)
-
-/* FYI: It is a bad situation if sizeof(flt64) < MAX_SHORT_STRING:
- then short string missing values can be truncated in system files
- because there's only room for as many characters as can fit in a
- flt64. */
-#if MAX_SHORT_STRING > 8
-#error MAX_SHORT_STRING must be less than 8.
-#endif
-
-/* Special values. */
-#define SYSMIS (-DBL_MAX)
-#define LOWEST second_lowest_value
-#define HIGHEST DBL_MAX
-
-/* Describes one value, which is either a floating-point number or a
- short string. */
-union value
- {
- /* A numeric value. */
- double f;
-
- /* A short-string value. */
- unsigned char s[MAX_SHORT_STRING];
-
- /* This member is used by data-in.c to return a string result,
- since it may need to return a long string. As currently
- implemented, it's a pointer to a static internal buffer in
- data-in.c.
-
- Also used by evaluate_expression() to return a string result.
- As currently implemented, it's a pointer to a dynamic buffer in
- the appropriate expression.
-
- Also used by the AGGREGATE procedure in handling string
- values. */
- unsigned char *c;
-
- /* Sometimes we insert value's in a hash table. */
- unsigned long hash[SIZEOF_DOUBLE / SIZEOF_LONG];
- };
-\f
-/* Frequency tables. */
-
-/* Frequency table entry. */
-struct freq
- {
- union value v; /* The value. */
- double c; /* The number of occurrences of the value. */
- };
-
-/* Types of frequency tables. */
-enum
- {
- FRQM_GENERAL,
- FRQM_INTEGER
- };
-
-/* Entire frequency table. */
-struct freq_tab
- {
- int mode; /* FRQM_GENERAL or FRQM_INTEGER. */
-
- /* General mode. */
- struct hsh_table *data; /* Undifferentiated data. */
-
- /* Integer mode. */
- double *vector; /* Frequencies proper. */
- int min, max; /* The boundaries of the table. */
- double out_of_range; /* Sum of weights of out-of-range values. */
- double sysmis; /* Sum of weights of SYSMIS values. */
-
- /* All modes. */
- struct freq *valid; /* Valid freqs. */
- int n_valid; /* Number of total freqs. */
-
- struct freq *missing; /* Missing freqs. */
- int n_missing; /* Number of missing freqs. */
-
- /* Statistics. */
- double total_cases; /* Sum of weights of all cases. */
- double valid_cases; /* Sum of weights of valid cases. */
- };
-\f
-/* Procedures' private per-variable data. */
-
-/* Structure name suffixes for private data:
- _proc: for a procedure (i.e., LIST -> list_proc).
- _trns: for a transformation (i.e., COMPUTE -> compute_trns.
- _pgm: for an input program (i.e., DATA LIST -> data_list_pgm). */
-
-/* CROSSTABS private data. */
-struct crosstab_proc
- {
- /* Integer mode only. */
- int min; /* Minimum value. */
- int max; /* Maximum value + 1. */
- int count; /* max - min. */
- };
-
-
-/* FREQUENCIES private data. */
-enum
- {
- frq_mean = 0, frq_semean, frq_median, frq_mode, frq_stddev, frq_variance,
- frq_kurt, frq_sekurt, frq_skew, frq_seskew, frq_range, frq_min, frq_max,
- frq_sum, frq_n_stats
- };
-
-struct frequencies_proc
- {
- int used; /* 1=This variable already used. */
-
- /* Freqency table. */
- struct freq_tab tab; /* Frequencies table to use. */
-
- /* Percentiles. */
- int n_groups; /* Number of groups. */
- double *groups; /* Groups. */
-
- /* Statistics. */
- double stat[frq_n_stats];
- };
-
-/* LIST private data. */
-struct list_proc
- {
- int newline; /* Whether a new line begins here. */
- int width; /* Field width. */
- int vert; /* Whether to print the varname vertically. */
- };
-
-/* DESCRIPTIVES private data. Note that the DESCRIPTIVES procedure also
- has a transformation, descriptives_trns. */
-enum
- {
- /* As these are used as bit indexes, there must be 32 or fewer.
- Be very careful in adjusting these, see the structure below
- and the table in descriptives.q. */
- dsc_mean = 0, dsc_semean, dsc_stddev, dsc_variance, dsc_kurt,
- dsc_sekurt, dsc_skew, dsc_seskew, dsc_range, dsc_min,
- dsc_max, dsc_sum, dsc_n_stats
- };
-
-struct descriptives_proc
- {
- /* Miscellaneous. */
- int dup; /* Finds duplicates in list of
- variables. */
- char zname[10]; /* Name for z-score variable. */