249 |
static struct |
static struct |
250 |
{ |
{ |
251 |
struct variable **v; /* variable list */ |
struct variable **v; /* variable list */ |
252 |
int nv; /* number of variables in list */ |
size_t nv; /* number of variables in list */ |
253 |
int cv; /* number of variables from list used up so far |
size_t cv; /* number of variables from list used up so far |
254 |
by the FORTRAN-like format specifiers */ |
by the FORTRAN-like format specifiers */ |
255 |
|
|
256 |
int recno; /* current 1-based record number */ |
int recno; /* current 1-based record number */ |
452 |
else |
else |
453 |
{ |
{ |
454 |
/* User wants dictionary format specifiers. */ |
/* User wants dictionary format specifiers. */ |
455 |
int i; |
size_t i; |
456 |
|
|
457 |
lex_match ('*'); |
lex_match ('*'); |
458 |
for (i = 0; i < fx.nv; i++) |
for (i = 0; i < fx.nv; i++) |
500 |
static int |
static int |
501 |
fixed_parse_compatible (void) |
fixed_parse_compatible (void) |
502 |
{ |
{ |
503 |
int dividend; |
int individual_var_width; |
504 |
int type; |
int type; |
505 |
int i; |
size_t i; |
506 |
|
|
507 |
type = fx.v[0]->type; |
type = fx.v[0]->type; |
508 |
for (i = 1; i < fx.nv; i++) |
for (i = 1; i < fx.nv; i++) |
610 |
|
|
611 |
if ((fx.lc - fx.fc + 1) % fx.nv) |
if ((fx.lc - fx.fc + 1) % fx.nv) |
612 |
{ |
{ |
613 |
msg (SE, _("The %d columns %d-%d can't be evenly divided into %d " |
msg (SE, _("The %d columns %d-%d can't be evenly divided into %u " |
614 |
"fields."), fx.lc - fx.fc + 1, fx.fc + 1, fx.lc + 1, fx.nv); |
"fields."), |
615 |
|
fx.lc - fx.fc + 1, fx.fc + 1, fx.lc + 1, (unsigned) fx.nv); |
616 |
return 0; |
return 0; |
617 |
} |
} |
618 |
|
|
619 |
dividend = (fx.lc - fx.fc + 1) / fx.nv; |
individual_var_width = (fx.lc - fx.fc + 1) / fx.nv; |
620 |
fx.spec.u.v.f.w = dividend; |
fx.spec.u.v.f.w = individual_var_width; |
621 |
if (!check_output_specifier (&fx.spec.u.v.f, true) |
if (!check_output_specifier (&fx.spec.u.v.f, true) |
622 |
|| !check_specifier_type (&fx.spec.u.v.f, type, true)) |
|| !check_specifier_type (&fx.spec.u.v.f, type, true)) |
623 |
return 0; |
return 0; |
631 |
fx.spec.type = PRT_VAR; |
fx.spec.type = PRT_VAR; |
632 |
for (i = 0; i < fx.nv; i++) |
for (i = 0; i < fx.nv; i++) |
633 |
{ |
{ |
634 |
fx.spec.fc = fx.fc + dividend * i; |
fx.spec.fc = fx.fc + individual_var_width * i; |
635 |
fx.spec.u.v.v = fx.v[i]; |
fx.spec.u.v.v = fx.v[i]; |
636 |
append_var_spec (&fx.spec); |
append_var_spec (&fx.spec); |
637 |
} |
} |