X-Git-Url: https://pintos-os.org/cgi-bin/gitweb.cgi?a=blobdiff_plain;f=src%2Fvar.h;h=6d5cad7938ea2589cb6047b55ac6a3d8b21af14c;hb=b996647adb40b2b51f888c8e755d5f5f2c15cb37;hp=277bfde8ad3ccd1f3afda2aa01c2077633f85fe6;hpb=ccf2f45c091ce1555b4e2a36186c501675c18a59;p=pspp diff --git a/src/var.h b/src/var.h index 277bfde8ad..6d5cad7938 100644 --- a/src/var.h +++ b/src/var.h @@ -151,19 +151,6 @@ struct get_proc int fv, nv; /* First, # of values. */ }; -/* Sort order. */ -enum - { - SRT_ASCEND, /* A, B, C, ..., X, Y, Z. */ - SRT_DESCEND /* Z, Y, X, ..., C, B, A. */ - }; - -/* SORT CASES private data. */ -struct sort_cases_proc - { - int order; /* SRT_ASCEND or SRT_DESCEND. */ - }; - /* MEANS private data. */ struct means_proc { @@ -234,8 +221,6 @@ struct variable int index; /* Index into its dictionary's var[]. */ int type; /* NUMERIC or ALPHA. */ - /* Also important but parse_variables() doesn't need it. Still, - check before reordering. */ int width; /* Size of string variables in chars. */ int fv, nv; /* Index into `value's, number of values. */ unsigned init : 1; /* 1=VFM must init and possibly reinit. */ @@ -263,7 +248,6 @@ struct variable struct frequencies_proc frq; struct list_proc lst; struct means_proc mns; - struct sort_cases_proc srt; struct matrix_data_proc mxd; struct match_files_proc mtf; struct t_test_proc t_t; @@ -302,6 +286,13 @@ struct ccase { union value data[1]; }; + +/* Linked list of cases. */ +struct case_list + { + struct case_list *next; + struct ccase c; + }; /* Dictionary. */ @@ -352,7 +343,10 @@ void dict_set_case_limit (struct dictionary *, int); int dict_get_next_value_idx (const struct dictionary *); size_t dict_get_case_size (const struct dictionary *); + void dict_compact_values (struct dictionary *); +size_t dict_get_compacted_value_cnt (const struct dictionary *); +int *dict_get_compacted_idx_to_fv (const struct dictionary *); struct variable *const *dict_get_split_vars (const struct dictionary *); size_t dict_get_split_cnt (const struct dictionary *); @@ -412,6 +406,7 @@ void cancel_temporary (void); /* Functions. */ void dump_split_vars (const struct ccase *); +typedef int (* is_missing_func )(const union value *, const struct variable *); int is_num_user_missing (double, const struct variable *); int is_str_user_missing (const unsigned char[], const struct variable *); @@ -422,17 +417,16 @@ void copy_missing_values (struct variable *dest, const struct variable *src); /* Transformations. */ +struct trns_header; +typedef int trns_proc_func (struct trns_header *, struct ccase *, int); +typedef void trns_free_func (struct trns_header *); + /* Header for all transformations. */ struct trns_header { - /* Index into t_trns[]. */ - int index; - - /* Transformation proc. */ - int (*proc) (struct trns_header *, struct ccase *); - - /* Garbage collector proc. */ - void (*free) (struct trns_header *); + int index; /* Index into t_trns[]. */ + trns_proc_func *proc; /* Transformation proc. */ + trns_free_func *free; /* Garbage collector proc. */ }; /* Array of transformations */ @@ -457,7 +451,6 @@ size_t var_set_get_cnt (struct var_set *vs); struct variable *var_set_get_var (struct var_set *vs, size_t idx); struct variable *var_set_lookup_var (struct var_set *vs, const char *name); void var_set_destroy (struct var_set *vs); - /* Variable parsers. */