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

Function conf_string

scripts/config/mconf.c:756–794  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

754}
755
756static void conf_string(struct menu *menu)
757{
758 const char *prompt = menu_get_prompt(menu);
759
760 while (1) {
761 int res;
762 const char *heading;
763
764 switch (sym_get_type(menu->sym)) {
765 case S_INT:
766 heading = inputbox_instructions_int;
767 break;
768 case S_HEX:
769 heading = inputbox_instructions_hex;
770 break;
771 case S_STRING:
772 heading = inputbox_instructions_string;
773 break;
774 default:
775 heading = "Internal mconf error!";
776 }
777 dialog_clear();
778 res = dialog_inputbox(prompt ? prompt : "Main Menu",
779 heading, 10, 75,
780 sym_get_string_value(menu->sym));
781 switch (res) {
782 case 0:
783 if (sym_set_string_value(menu->sym, dialog_input_result))
784 return;
785 show_textbox(NULL, "You have made an invalid entry.", 5, 43);
786 break;
787 case 1:
788 show_help(menu);
789 break;
790 case KEY_ESC:
791 return;
792 }
793 }
794}
795
796static void conf_load(void)
797{

Callers 1

confFunction · 0.70

Calls 8

menu_get_promptFunction · 0.85
sym_get_typeFunction · 0.85
dialog_clearFunction · 0.85
sym_get_string_valueFunction · 0.85
sym_set_string_valueFunction · 0.85
show_textboxFunction · 0.85
dialog_inputboxFunction · 0.70
show_helpFunction · 0.70

Tested by

no test coverage detected