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

Function conf_askvalue

scripts/config/conf.c:318–348  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

316}
317
318static int conf_askvalue(struct symbol *sym, const char *def)
319{
320 if (!sym_has_value(sym))
321 printf("(NEW) ");
322
323 line[0] = '\n';
324 line[1] = 0;
325
326 if (!sym_is_changeable(sym)) {
327 printf("%s\n", def);
328 line[0] = '\n';
329 line[1] = 0;
330 return 0;
331 }
332
333 switch (input_mode) {
334 case oldconfig:
335 case syncconfig:
336 if (sym_has_value(sym)) {
337 printf("%s\n", def);
338 return 0;
339 }
340 /* fall through */
341 default:
342 fflush(stdout);
343 xfgets(line, sizeof(line), stdin);
344 break;
345 }
346
347 return 1;
348}
349
350static int conf_string(struct menu *menu)
351{

Callers 2

conf_stringFunction · 0.85
conf_symFunction · 0.85

Calls 3

sym_has_valueFunction · 0.85
sym_is_changeableFunction · 0.85
xfgetsFunction · 0.85

Tested by

no test coverage detected