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

Function conf_string

scripts/config/conf.c:350–381  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

348}
349
350static int conf_string(struct menu *menu)
351{
352 struct symbol *sym = menu->sym;
353 const char *def;
354
355 while (1) {
356 printf("%*s%s ", indent - 1, "", menu->prompt->text);
357 printf("(%s) ", sym->name);
358 def = sym_get_string_value(sym);
359 if (def)
360 printf("[%s] ", def);
361 if (!conf_askvalue(sym, def))
362 return 0;
363 switch (line[0]) {
364 case '\n':
365 break;
366 case '?':
367 /* print help */
368 if (line[1] == '\n') {
369 print_help(menu);
370 def = NULL;
371 break;
372 }
373 /* fall through */
374 default:
375 line[strlen(line)-1] = 0;
376 def = line;
377 }
378 if (def && sym_set_string_value(sym, def))
379 return 0;
380 }
381}
382
383static int conf_sym(struct menu *menu)
384{

Callers 1

confFunction · 0.70

Calls 4

sym_get_string_valueFunction · 0.85
conf_askvalueFunction · 0.85
print_helpFunction · 0.85
sym_set_string_valueFunction · 0.85

Tested by

no test coverage detected