| 3468 | } |
| 3469 | |
| 3470 | staticfn int |
| 3471 | optfn_playmode( |
| 3472 | int optidx, int req, boolean negated, |
| 3473 | char *opts, char *op) |
| 3474 | { |
| 3475 | if (req == do_init) { |
| 3476 | return optn_ok; |
| 3477 | } |
| 3478 | if (req == do_set) { |
| 3479 | /* play mode: normal, explore/discovery, or debug/wizard */ |
| 3480 | |
| 3481 | if (duplicate || negated) |
| 3482 | return optn_err; |
| 3483 | if (op == empty_optstr) |
| 3484 | return optn_err; |
| 3485 | if (!strncmpi(op, "normal", 6) || !strcmpi(op, "play")) { |
| 3486 | wizard = discover = FALSE; |
| 3487 | } else if (!strncmpi(op, "explore", 6) |
| 3488 | || !strncmpi(op, "discovery", 6)) { |
| 3489 | wizard = FALSE, discover = TRUE; |
| 3490 | } else if (!strncmpi(op, "debug", 5) || !strncmpi(op, "wizard", 6)) { |
| 3491 | wizard = TRUE, discover = FALSE; |
| 3492 | } else { |
| 3493 | config_error_add("Invalid value for \"%s\":%s", |
| 3494 | allopt[optidx].name, op); |
| 3495 | return optn_err; |
| 3496 | } |
| 3497 | return optn_ok; |
| 3498 | } |
| 3499 | if (req == get_val || req == get_cnf_val) { |
| 3500 | Strcpy(opts, wizard ? "debug" : discover ? "explore" : "normal"); |
| 3501 | return optn_ok; |
| 3502 | } |
| 3503 | return optn_ok; |
| 3504 | } |
| 3505 | |
| 3506 | staticfn int |
| 3507 | optfn_race( |
nothing calls this directly
no test coverage detected