diff options
Diffstat (limited to 'src/commands.c')
| -rw-r--r-- | src/commands.c | 20 |
1 files changed, 10 insertions, 10 deletions
diff --git a/src/commands.c b/src/commands.c index 7f58ef5..9ac1ae6 100644 --- a/src/commands.c +++ b/src/commands.c | |||
| @@ -2,7 +2,7 @@ | |||
| 2 | 2 | ||
| 3 | #include "commands.h" | 3 | #include "commands.h" |
| 4 | 4 | ||
| 5 | static bool read_step(CommandArgs *args, char *str); | 5 | static bool read_cs(CommandArgs *args, char *str); |
| 6 | static bool read_scrtype(CommandArgs *args, char *str); | 6 | static bool read_scrtype(CommandArgs *args, char *str); |
| 7 | static bool read_scramble(int c, char **v, CommandArgs *args); | 7 | static bool read_scramble(int c, char **v, CommandArgs *args); |
| 8 | 8 | ||
| @@ -95,7 +95,7 @@ solve_parse_args(int c, char **v) | |||
| 95 | a->opts->print_number = false; | 95 | a->opts->print_number = false; |
| 96 | } else if (!strcmp(v[i], "-c")) { | 96 | } else if (!strcmp(v[i], "-c")) { |
| 97 | a->opts->count_only = true; | 97 | a->opts->count_only = true; |
| 98 | } else if (!read_step(a, v[i])) { | 98 | } else if (!read_cs(a, v[i])) { |
| 99 | break; | 99 | break; |
| 100 | } | 100 | } |
| 101 | } | 101 | } |
| @@ -218,7 +218,7 @@ solve_exec(CommandArgs *args) | |||
| 218 | 218 | ||
| 219 | make_solved(&c); | 219 | make_solved(&c); |
| 220 | apply_alg(args->scramble, &c); | 220 | apply_alg(args->scramble, &c); |
| 221 | sols = solve(&c, args->step, args->opts); | 221 | sols = solve(&c, args->cs, args->opts); |
| 222 | 222 | ||
| 223 | if (args->opts->count_only) | 223 | if (args->opts->count_only) |
| 224 | printf("%d\n", sols->len); | 224 | printf("%d\n", sols->len); |
| @@ -345,8 +345,8 @@ steps_exec(CommandArgs *args) | |||
| 345 | { | 345 | { |
| 346 | int i; | 346 | int i; |
| 347 | 347 | ||
| 348 | for (i = 0; steps[i] != NULL; i++) | 348 | for (i = 0; csteps[i] != NULL; i++) |
| 349 | printf("%-15s %s\n", steps[i]->shortname, steps[i]->name); | 349 | printf("%-15s %s\n", csteps[i]->shortname, csteps[i]->name); |
| 350 | } | 350 | } |
| 351 | 351 | ||
| 352 | void | 352 | void |
| @@ -503,13 +503,13 @@ read_scrtype(CommandArgs *args, char *str) | |||
| 503 | } | 503 | } |
| 504 | 504 | ||
| 505 | static bool | 505 | static bool |
| 506 | read_step(CommandArgs *args, char *str) | 506 | read_cs(CommandArgs *args, char *str) |
| 507 | { | 507 | { |
| 508 | int i; | 508 | int i; |
| 509 | 509 | ||
| 510 | for (i = 0; steps[i] != NULL; i++) { | 510 | for (i = 0; csteps[i] != NULL; i++) { |
| 511 | if (!strcmp(steps[i]->shortname, str)) { | 511 | if (!strcmp(csteps[i]->shortname, str)) { |
| 512 | args->step = steps[i]; | 512 | args->cs = csteps[i]; |
| 513 | return true; | 513 | return true; |
| 514 | } | 514 | } |
| 515 | } | 515 | } |
| @@ -546,7 +546,7 @@ new_args() | |||
| 546 | args->opts = malloc(sizeof(SolveOptions)); | 546 | args->opts = malloc(sizeof(SolveOptions)); |
| 547 | 547 | ||
| 548 | /* step and command are static */ | 548 | /* step and command are static */ |
| 549 | args->step = steps[0]; /* default: first step in list */ | 549 | args->cs = csteps[0]; /* default: first step in list */ |
| 550 | args->command = NULL; | 550 | args->command = NULL; |
| 551 | 551 | ||
| 552 | return args; | 552 | return args; |
