-parse_variables (struct dictionary *d, struct variable ***var, int *cnt,
- int opts)
+parse_variables (const struct dictionary *d, struct variable ***var,
+ int *cnt, int opts)
Conversely, if parse_variables() returns non-zero, then *nv is
nonzero and *v is non-NULL. */
int
Conversely, if parse_variables() returns non-zero, then *nv is
nonzero and *v is non-NULL. */
int
static int
extract_num (char *s, char *r, int *n, int *d)
{
static int
extract_num (char *s, char *r, int *n, int *d)
{
- size_t (*get_cnt) (struct var_set *);
- struct variable *(*get_var) (struct var_set *, size_t idx);
- struct variable *(*lookup_var) (struct var_set *, const char *);
+ size_t (*get_cnt) (const struct var_set *);
+ struct variable *(*get_var) (const struct var_set *, size_t idx);
+ struct variable *(*lookup_var) (const struct var_set *, const char *);
{
struct dictionary *d = vs->aux;
return dict_get_var (d, idx);
}
{
struct dictionary *d = vs->aux;
return dict_get_var (d, idx);
}
{
struct dictionary *d = vs->aux;
return dict_lookup_var (d, name);
}
{
struct dictionary *d = vs->aux;
return dict_lookup_var (d, name);
}
{
struct var_set *vs = xmalloc (sizeof *vs);
vs->get_cnt = dict_var_set_get_cnt;
vs->get_var = dict_var_set_get_var;
vs->lookup_var = dict_var_set_lookup_var;
vs->destroy = dict_var_set_destroy;
{
struct var_set *vs = xmalloc (sizeof *vs);
vs->get_cnt = dict_var_set_get_cnt;
vs->get_var = dict_var_set_get_var;
vs->lookup_var = dict_var_set_lookup_var;
vs->destroy = dict_var_set_destroy;
- struct variable **var;
- size_t var_cnt;
- struct hsh_table *name_tab;
+ struct variable *const *var;/* Array of variables. */
+ size_t var_cnt; /* Number of elements in var. */
+ struct hsh_table *name_tab; /* Hash from variable names to variables. */
compare_variables, hash_variable, NULL,
NULL);
for (i = 0; i < var_cnt; i++)
compare_variables, hash_variable, NULL,
NULL);
for (i = 0; i < var_cnt; i++)