MCPcopy Create free account
hub / github.com/Entware/Entware / conf_string

Function conf_string

scripts/config/nconf.c:1452–1494  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1450}
1451
1452static void conf_string(struct menu *menu)
1453{
1454 const char *prompt = menu_get_prompt(menu);
1455
1456 while (1) {
1457 int res;
1458 const char *heading;
1459
1460 switch (sym_get_type(menu->sym)) {
1461 case S_INT:
1462 heading = inputbox_instructions_int;
1463 break;
1464 case S_HEX:
1465 heading = inputbox_instructions_hex;
1466 break;
1467 case S_STRING:
1468 heading = inputbox_instructions_string;
1469 break;
1470 default:
1471 heading = "Internal nconf error!";
1472 }
1473 res = dialog_inputbox(main_window,
1474 prompt ? prompt : "Main Menu",
1475 heading,
1476 sym_get_string_value(menu->sym),
1477 &dialog_input_result,
1478 &dialog_input_result_len);
1479 switch (res) {
1480 case 0:
1481 if (sym_set_string_value(menu->sym,
1482 dialog_input_result))
1483 return;
1484 btn_dialog(main_window,
1485 "You have made an invalid entry.", 0);
1486 break;
1487 case 1:
1488 show_help(menu);
1489 break;
1490 case KEY_EXIT:
1491 return;
1492 }
1493 }
1494}
1495
1496static void conf_load(void)
1497{

Callers 1

selected_confFunction · 0.70

Calls 7

menu_get_promptFunction · 0.85
sym_get_typeFunction · 0.85
sym_get_string_valueFunction · 0.85
sym_set_string_valueFunction · 0.85
btn_dialogFunction · 0.85
dialog_inputboxFunction · 0.70
show_helpFunction · 0.70

Tested by

no test coverage detected