31 |
/* Script variables. */ |
/* Script variables. */ |
32 |
|
|
33 |
/* Variable type. */ |
/* Variable type. */ |
34 |
enum |
enum var_type |
35 |
{ |
{ |
36 |
NUMERIC, /* A numeric variable. */ |
NUMERIC, /* A numeric variable. */ |
37 |
ALPHA /* A string variable. |
ALPHA /* A string variable. */ |
|
(STRING is pre-empted by lexer.h.) */ |
|
38 |
}; |
}; |
39 |
|
|
40 |
|
const char *var_type_adj (enum var_type); |
41 |
|
const char *var_type_noun (enum var_type); |
42 |
|
|
43 |
/* A variable's dictionary entry. */ |
/* A variable's dictionary entry. */ |
44 |
struct variable |
struct variable |
45 |
{ |
{ |
46 |
/* Basic information. */ |
/* Basic information. */ |
47 |
char name[LONG_NAME_LEN + 1]; /* Variable name. Mixed case. */ |
char name[LONG_NAME_LEN + 1]; /* Variable name. Mixed case. */ |
48 |
int type; /* NUMERIC or ALPHA. */ |
enum var_type type; /* NUMERIC or ALPHA. */ |
49 |
int width; /* Size of string variables in chars. */ |
int width; /* Size of string variables in chars. */ |
50 |
int fv, nv; /* Index into `value's, number of values. */ |
int fv, nv; /* Index into `value's, number of values. */ |
51 |
unsigned init : 1; /* 1=VFM must init and possibly reinit. */ |
unsigned init : 1; /* 1=VFM must init and possibly reinit. */ |
217 |
PV_NO_SCRATCH = 00200 /* Disallow scratch variables. */ |
PV_NO_SCRATCH = 00200 /* Disallow scratch variables. */ |
218 |
}; |
}; |
219 |
|
|
220 |
|
struct pool; |
221 |
struct variable *parse_variable (void); |
struct variable *parse_variable (void); |
222 |
struct variable *parse_dict_variable (const struct dictionary *); |
struct variable *parse_dict_variable (const struct dictionary *); |
223 |
int parse_variables (const struct dictionary *, struct variable ***, size_t *, |
int parse_variables (const struct dictionary *, struct variable ***, size_t *, |
226 |
int opts); |
int opts); |
227 |
int parse_DATA_LIST_vars (char ***names, size_t *cnt, int opts); |
int parse_DATA_LIST_vars (char ***names, size_t *cnt, int opts); |
228 |
int parse_mixed_vars (char ***names, size_t *cnt, int opts); |
int parse_mixed_vars (char ***names, size_t *cnt, int opts); |
229 |
|
int parse_mixed_vars_pool (struct pool *, |
230 |
|
char ***names, size_t *cnt, int opts); |
231 |
|
|
232 |
|
|
233 |
/* Return a string representing this variable, in the form most |
/* Return a string representing this variable, in the form most |