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

Function conf_sym

scripts/config/conf.c:383–448  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

381}
382
383static int conf_sym(struct menu *menu)
384{
385 struct symbol *sym = menu->sym;
386 tristate oldval, newval;
387
388 while (1) {
389 printf("%*s%s ", indent - 1, "", menu->prompt->text);
390 if (sym->name)
391 printf("(%s) ", sym->name);
392 putchar('[');
393 oldval = sym_get_tristate_value(sym);
394 switch (oldval) {
395 case no:
396 putchar('N');
397 break;
398 case mod:
399 putchar('M');
400 break;
401 case yes:
402 putchar('Y');
403 break;
404 }
405 if (oldval != no && sym_tristate_within_range(sym, no))
406 printf("/n");
407 if (oldval != mod && sym_tristate_within_range(sym, mod))
408 printf("/m");
409 if (oldval != yes && sym_tristate_within_range(sym, yes))
410 printf("/y");
411 printf("/?] ");
412 if (!conf_askvalue(sym, sym_get_string_value(sym)))
413 return 0;
414 strip(line);
415
416 switch (line[0]) {
417 case 'n':
418 case 'N':
419 newval = no;
420 if (!line[1] || !strcmp(&line[1], "o"))
421 break;
422 continue;
423 case 'm':
424 case 'M':
425 newval = mod;
426 if (!line[1])
427 break;
428 continue;
429 case 'y':
430 case 'Y':
431 newval = yes;
432 if (!line[1] || !strcmp(&line[1], "es"))
433 break;
434 continue;
435 case 0:
436 newval = oldval;
437 break;
438 case '?':
439 goto help;
440 default:

Callers 2

conf_choiceFunction · 0.85
confFunction · 0.85

Calls 7

sym_get_tristate_valueFunction · 0.85
conf_askvalueFunction · 0.85
sym_get_string_valueFunction · 0.85
stripFunction · 0.85
sym_set_tristate_valueFunction · 0.85
print_helpFunction · 0.85

Tested by

no test coverage detected