| 447 | } |
| 448 | |
| 449 | static int conf_choice(struct menu *menu) |
| 450 | { |
| 451 | struct symbol *sym, *def_sym; |
| 452 | struct menu *child; |
| 453 | bool is_new; |
| 454 | |
| 455 | sym = menu->sym; |
| 456 | is_new = !sym_has_value(sym); |
| 457 | if (sym_is_changeable(sym)) { |
| 458 | conf_sym(menu); |
| 459 | sym_calc_value(sym); |
| 460 | switch (sym_get_tristate_value(sym)) { |
| 461 | case no: |
| 462 | return 1; |
| 463 | case mod: |
| 464 | return 0; |
| 465 | case yes: |
| 466 | break; |
| 467 | } |
| 468 | } else { |
| 469 | switch (sym_get_tristate_value(sym)) { |
| 470 | case no: |
| 471 | return 1; |
| 472 | case mod: |
| 473 | printf("%*s%s\n", indent - 1, "", menu_get_prompt(menu)); |
| 474 | return 0; |
| 475 | case yes: |
| 476 | break; |
| 477 | } |
| 478 | } |
| 479 | |
| 480 | while (1) { |
| 481 | int cnt, def; |
| 482 | |
| 483 | printf("%*s%s\n", indent - 1, "", menu_get_prompt(menu)); |
| 484 | def_sym = sym_get_choice_value(sym); |
| 485 | cnt = def = 0; |
| 486 | line[0] = 0; |
| 487 | for (child = menu->list; child; child = child->next) { |
| 488 | if (!menu_is_visible(child)) |
| 489 | continue; |
| 490 | if (!child->sym) { |
| 491 | printf("%*c %s\n", indent, '*', menu_get_prompt(child)); |
| 492 | continue; |
| 493 | } |
| 494 | cnt++; |
| 495 | if (child->sym == def_sym) { |
| 496 | def = cnt; |
| 497 | printf("%*c", indent, '>'); |
| 498 | } else |
| 499 | printf("%*c", indent, ' '); |
| 500 | printf(" %d. %s", cnt, menu_get_prompt(child)); |
| 501 | if (child->sym->name) |
| 502 | printf(" (%s)", child->sym->name); |
| 503 | if (!sym_has_value(child->sym)) |
| 504 | printf(" (NEW)"); |
| 505 | printf("\n"); |
| 506 | } |
no test coverage detected