X-Git-Url: https://pintos-os.org/cgi-bin/gitweb.cgi?a=blobdiff_plain;f=src%2Fvar.h;h=f4930eea0e65b61a279033d6ae4335b03fb6e7c5;hb=4f8599928787c4b9da99caff29b27724c2e3298d;hp=ca644a4dea9497b0cd76b94ec153a34a544423e4;hpb=47bd6f9b29268bddee3a19ae6d013b33c978a7e2;p=pspp diff --git a/src/var.h b/src/var.h index ca644a4dea..f4930eea0e 100644 --- a/src/var.h +++ b/src/var.h @@ -24,7 +24,7 @@ #include #include "config.h" #include - +#include "cat.h" #include "format.h" #include "missing-values.h" @@ -43,32 +43,26 @@ const char *var_type_noun (enum var_type); /* A variable's dictionary entry. */ struct variable { - /* Basic information. */ + /* Dictionary information. */ char name[LONG_NAME_LEN + 1]; /* Variable name. Mixed case. */ enum var_type type; /* NUMERIC or ALPHA. */ 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. */ - unsigned reinit : 1; /* Cases are: 1=reinitialized; 0=left. */ - - /* Data for use by containing dictionary. */ - int index; /* Dictionary index. */ - - /* Missing values. */ struct missing_values miss; /* Missing values. */ - - /* Display formats. */ struct fmt_spec print; /* Default format for PRINT. */ struct fmt_spec write; /* Default format for WRITE. */ - - /* Labels. */ struct val_labs *val_labs; /* Value labels. */ char *label; /* Variable label. */ + enum measure measure; /* Nominal, ordinal, or continuous. */ + int display_width; /* Width of data editor column. */ + enum alignment alignment; /* Alignment of data in GUI. */ - /* GUI display parameters. */ - enum measure measure; /* Nominal ordinal or continuous */ - int display_width; /* Width of data editor column */ - enum alignment alignment; /* Alignment of data in gui */ + /* Case information. */ + int fv, nv; /* Index into `value's, number of values. */ + bool init; /* True if needs init and possibly reinit. */ + bool reinit; /* True: reinitialize; false: leave. */ + + /* Data for use by containing dictionary. */ + int index; /* Dictionary index. */ /* Short name, used only for system and portable file input and output. Upper case only. There is no index for short @@ -77,9 +71,14 @@ struct variable string. */ char short_name[SHORT_NAME_LEN + 1]; - /* Per-command info. */ + /* Each command may use these fields as needed. */ void *aux; void (*aux_dtor) (struct variable *); + + /* Values of a categorical variable. Procedures need + vectors with binary entries, so any variable of type ALPHA will + have its values stored here. */ + struct cat_vals *obs_vals; }; /* Variable names. */ @@ -130,10 +129,6 @@ extern struct dictionary *default_dict; /* Transformation state. */ -/* Default file handle for DATA LIST, REREAD, REPEATING DATA - commands. */ -extern struct file_handle *default_handle; - /* PROCESS IF expression. */ extern struct expression *process_if_expr;