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

Function conf_read_simple

scripts/config/confdata.c:369–543  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

367}
368
369int conf_read_simple(const char *name, int def)
370{
371 FILE *in = NULL;
372 char *line = NULL;
373 size_t line_asize = 0;
374 char *p, *p2;
375 struct symbol *sym;
376 int def_flags;
377 const char *warn_unknown;
378 const char *werror;
379
380 warn_unknown = getenv("KCONFIG_WARN_UNKNOWN_SYMBOLS");
381 werror = getenv("KCONFIG_WERROR");
382 if (name) {
383 in = zconf_fopen(name);
384 } else {
385 char *env;
386
387 name = conf_get_configname();
388 in = zconf_fopen(name);
389 if (in)
390 goto load;
391 conf_set_changed(true);
392
393 env = getenv("KCONFIG_DEFCONFIG_LIST");
394 if (!env)
395 return 1;
396
397 while (1) {
398 bool is_last;
399
400 while (isspace(*env))
401 env++;
402
403 if (!*env)
404 break;
405
406 p = env;
407 while (*p && !isspace(*p))
408 p++;
409
410 is_last = (*p == '\0');
411
412 *p = '\0';
413
414 in = zconf_fopen(env);
415 if (in) {
416 conf_message("using defaults found in %s",
417 env);
418 goto load;
419 }
420
421 if (is_last)
422 break;
423
424 env = p + 1;
425 }
426 }

Callers 2

conf_readFunction · 0.85
conf_touch_depsFunction · 0.85

Calls 14

zconf_fopenFunction · 0.85
conf_get_confignameFunction · 0.85
conf_set_changedFunction · 0.85
conf_messageFunction · 0.85
conf_resetFunction · 0.85
compat_getlineFunction · 0.85
sym_findFunction · 0.85
conf_warningFunction · 0.85
sym_lookupFunction · 0.85
conf_touch_depFunction · 0.85
conf_set_sym_valFunction · 0.85
sym_is_choice_valueFunction · 0.85

Tested by

no test coverage detected