35 |
/* Declarations. */ |
/* Declarations. */ |
36 |
|
|
37 |
static int do_value_labels (int); |
static int do_value_labels (int); |
38 |
static int verify_val_labs (struct variable **vars, int var_cnt); |
static int verify_val_labs (struct variable **vars, size_t var_cnt); |
39 |
static void erase_labels (struct variable **vars, int var_cnt); |
static void erase_labels (struct variable **vars, size_t var_cnt); |
40 |
static int get_label (struct variable **vars, int var_cnt); |
static int get_label (struct variable **vars, size_t var_cnt); |
41 |
|
|
42 |
/* Stubs. */ |
/* Stubs. */ |
43 |
|
|
59 |
do_value_labels (int erase) |
do_value_labels (int erase) |
60 |
{ |
{ |
61 |
struct variable **vars; /* Variable list. */ |
struct variable **vars; /* Variable list. */ |
62 |
int var_cnt; /* Number of variables. */ |
size_t var_cnt; /* Number of variables. */ |
63 |
int parse_err=0; /* true if error parsing variables */ |
int parse_err=0; /* true if error parsing variables */ |
64 |
|
|
65 |
lex_match ('/'); |
lex_match ('/'); |
108 |
/* Verifies that none of the VAR_CNT variables in VARS are long |
/* Verifies that none of the VAR_CNT variables in VARS are long |
109 |
string variables. */ |
string variables. */ |
110 |
static int |
static int |
111 |
verify_val_labs (struct variable **vars, int var_cnt) |
verify_val_labs (struct variable **vars, size_t var_cnt) |
112 |
{ |
{ |
113 |
int i; |
size_t i; |
114 |
|
|
115 |
for (i = 0; i < var_cnt; i++) |
for (i = 0; i < var_cnt; i++) |
116 |
{ |
{ |
128 |
|
|
129 |
/* Erases all the labels for the VAR_CNT variables in VARS. */ |
/* Erases all the labels for the VAR_CNT variables in VARS. */ |
130 |
static void |
static void |
131 |
erase_labels (struct variable **vars, int var_cnt) |
erase_labels (struct variable **vars, size_t var_cnt) |
132 |
{ |
{ |
133 |
int i; |
size_t i; |
134 |
|
|
135 |
/* Erase old value labels if desired. */ |
/* Erase old value labels if desired. */ |
136 |
for (i = 0; i < var_cnt; i++) |
for (i = 0; i < var_cnt; i++) |
140 |
/* Parse all the labels for the VAR_CNT variables in VARS and add |
/* Parse all the labels for the VAR_CNT variables in VARS and add |
141 |
the specified labels to those variables. */ |
the specified labels to those variables. */ |
142 |
static int |
static int |
143 |
get_label (struct variable **vars, int var_cnt) |
get_label (struct variable **vars, size_t var_cnt) |
144 |
{ |
{ |
145 |
/* Parse all the labels and add them to the variables. */ |
/* Parse all the labels and add them to the variables. */ |
146 |
do |
do |
147 |
{ |
{ |
148 |
union value value; |
union value value; |
149 |
char *label; |
char *label; |
150 |
int i; |
size_t i; |
151 |
|
|
152 |
/* Set value. */ |
/* Set value. */ |
153 |
if (vars[0]->type == ALPHA) |
if (vars[0]->type == ALPHA) |