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

Function conf_read_simple

util/kconfig/confdata.c:388–556  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

386}
387
388int conf_read_simple(const char *name, int def)
389{
390 FILE *in = NULL;
391 char *line = NULL;
392 size_t line_asize = 0;
393 char *p, *val, *sym_name;
394 struct symbol *sym;
395 int i, def_flags;
396 const char *warn_unknown;
397
398 warn_unknown = getenv("KCONFIG_WARN_UNKNOWN_SYMBOLS");
399 if (name) {
400 in = zconf_fopen(name);
401 } else {
402 char *env;
403
404 name = conf_get_configname();
405 in = zconf_fopen(name);
406 if (in)
407 goto load;
408 conf_set_changed(true);
409
410 env = getenv("KCONFIG_DEFCONFIG_LIST");
411 if (!env)
412 return 1;
413
414 while (1) {
415 bool is_last;
416
417 while (isspace(*env))
418 env++;
419
420 if (!*env)
421 break;
422
423 p = env;
424 while (*p && !isspace(*p))
425 p++;
426
427 is_last = (*p == '\0');
428
429 *p = '\0';
430
431 in = zconf_fopen(env);
432 if (in) {
433 conf_message("using defaults found in %s",
434 env);
435 goto load;
436 }
437
438 if (is_last)
439 break;
440
441 env = p + 1;
442 }
443 }
444 if (!in)
445 return 1;

Callers 3

conf_readFunction · 0.85
conf_touch_depsFunction · 0.85
mainFunction · 0.85

Calls 15

conf_get_confignameFunction · 0.85
conf_set_changedFunction · 0.85
conf_messageFunction · 0.85
sym_is_choiceFunction · 0.85
getline_strippedFunction · 0.85
strlenFunction · 0.85
conf_warningFunction · 0.85
sym_findFunction · 0.85
conf_touch_depFunction · 0.85
conf_noticeFunction · 0.85
conf_set_sym_valFunction · 0.85
sym_is_choice_valueFunction · 0.85

Tested by

no test coverage detected