X-Git-Url: https://pintos-os.org/cgi-bin/gitweb.cgi?a=blobdiff_plain;ds=inline;f=src%2Fvar.h;h=ae81fa8c27a5bd4152517666b81eec0c43438e51;hb=25f3bb47d1dab6a32c0ba30db8583413dd17d93b;hp=802004bccab843c590c5f426c49fbec1ef01ea5d;hpb=ad01fea350354a7df11790a561e935a8bffd3636;p=pspp diff --git a/src/var.h b/src/var.h index 802004bcca..ae81fa8c27 100644 --- a/src/var.h +++ b/src/var.h @@ -31,42 +31,38 @@ /* Script variables. */ /* Variable type. */ -enum +enum var_type { NUMERIC, /* A numeric variable. */ - ALPHA /* A string variable. - (STRING is pre-empted by lexer.h.) */ + ALPHA /* A string variable. */ }; +const char *var_type_adj (enum var_type); +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. */ - int type; /* NUMERIC or ALPHA. */ + 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 @@ -75,7 +71,7 @@ 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 *); }; @@ -215,6 +211,7 @@ enum PV_NO_SCRATCH = 00200 /* Disallow scratch variables. */ }; +struct pool; struct variable *parse_variable (void); struct variable *parse_dict_variable (const struct dictionary *); int parse_variables (const struct dictionary *, struct variable ***, size_t *, @@ -223,7 +220,8 @@ int parse_var_set_vars (const struct var_set *, struct variable ***, size_t *, int opts); int parse_DATA_LIST_vars (char ***names, size_t *cnt, int opts); int parse_mixed_vars (char ***names, size_t *cnt, int opts); - +int parse_mixed_vars_pool (struct pool *, + char ***names, size_t *cnt, int opts); /* Return a string representing this variable, in the form most