559 |
static bool |
static bool |
560 |
rename_variables (struct dictionary *dict) |
rename_variables (struct dictionary *dict) |
561 |
{ |
{ |
562 |
int i; |
size_t i; |
563 |
|
|
564 |
int success = 0; |
int success = 0; |
565 |
|
|
566 |
struct variable **v; |
struct variable **v; |
567 |
char **new_names; |
char **new_names; |
568 |
int nv, nn; |
size_t nv, nn; |
569 |
char *err_name; |
char *err_name; |
570 |
|
|
571 |
int group; |
int group; |
602 |
group = 1; |
group = 1; |
603 |
while (lex_match ('(')) |
while (lex_match ('(')) |
604 |
{ |
{ |
605 |
int old_nv = nv; |
size_t old_nv = nv; |
606 |
|
|
607 |
if (!parse_variables (dict, &v, &nv, PV_NO_DUPLICATE | PV_APPEND)) |
if (!parse_variables (dict, &v, &nv, PV_NO_DUPLICATE | PV_APPEND)) |
608 |
goto done; |
goto done; |
618 |
msg (SE, _("Number of variables on left side of `=' (%d) does not " |
msg (SE, _("Number of variables on left side of `=' (%d) does not " |
619 |
"match number of variables on right side (%d), in " |
"match number of variables on right side (%d), in " |
620 |
"parenthesized group %d of RENAME subcommand."), |
"parenthesized group %d of RENAME subcommand."), |
621 |
nv - old_nv, nn - old_nv, group); |
(unsigned) (nv - old_nv), (unsigned) (nn - old_nv), group); |
622 |
goto done; |
goto done; |
623 |
} |
} |
624 |
if (!lex_force_match (')')) |
if (!lex_force_match (')')) |
648 |
drop_variables (struct dictionary *dict) |
drop_variables (struct dictionary *dict) |
649 |
{ |
{ |
650 |
struct variable **v; |
struct variable **v; |
651 |
int nv; |
size_t nv; |
652 |
|
|
653 |
lex_match ('='); |
lex_match ('='); |
654 |
if (!parse_variables (dict, &v, &nv, PV_NONE)) |
if (!parse_variables (dict, &v, &nv, PV_NONE)) |
670 |
keep_variables (struct dictionary *dict) |
keep_variables (struct dictionary *dict) |
671 |
{ |
{ |
672 |
struct variable **v; |
struct variable **v; |
673 |
int nv; |
size_t nv; |
674 |
int i; |
size_t i; |
675 |
|
|
676 |
lex_match ('='); |
lex_match ('='); |
677 |
if (!parse_variables (dict, &v, &nv, PV_NONE)) |
if (!parse_variables (dict, &v, &nv, PV_NONE)) |
726 |
struct mtf_file *head; /* First file mentioned on FILE or TABLE. */ |
struct mtf_file *head; /* First file mentioned on FILE or TABLE. */ |
727 |
struct mtf_file *tail; /* Last file mentioned on FILE or TABLE. */ |
struct mtf_file *tail; /* Last file mentioned on FILE or TABLE. */ |
728 |
|
|
729 |
int by_cnt; /* Number of variables on BY subcommand. */ |
size_t by_cnt; /* Number of variables on BY subcommand. */ |
730 |
|
|
731 |
/* Names of FIRST, LAST variables. */ |
/* Names of FIRST, LAST variables. */ |
732 |
char first[LONG_NAME_LEN + 1], last[LONG_NAME_LEN + 1]; |
char first[LONG_NAME_LEN + 1], last[LONG_NAME_LEN + 1]; |
919 |
|
|
920 |
for (iter = mtf.head; iter != NULL; iter = iter->next) |
for (iter = mtf.head; iter != NULL; iter = iter->next) |
921 |
{ |
{ |
922 |
int i; |
size_t i; |
923 |
|
|
924 |
iter->by = xmalloc (sizeof *iter->by * mtf.by_cnt); |
iter->by = xmalloc (sizeof *iter->by * mtf.by_cnt); |
925 |
|
|