| 2437 | ****************************************************************************/ |
| 2438 | |
| 2439 | static void process_kconfigfile(const char *kconfigdir, |
| 2440 | const char *kconfigname) |
| 2441 | { |
| 2442 | FILE *stream; |
| 2443 | char *kconfigpath; |
| 2444 | |
| 2445 | /* Create the full path to the Kconfig file */ |
| 2446 | |
| 2447 | asprintf(&kconfigpath, "%s/%s", kconfigdir, kconfigname); |
| 2448 | debug("process_kconfigfile: Entry\n"); |
| 2449 | debug(" kconfigdir: %s\n", kconfigdir); |
| 2450 | debug(" kconfigpath: %s\n", kconfigpath); |
| 2451 | debug(" level: %d\n", g_level); |
| 2452 | |
| 2453 | /* Open the Kconfig file */ |
| 2454 | |
| 2455 | stream = fopen(kconfigpath, "r"); |
| 2456 | if (!stream) |
| 2457 | { |
| 2458 | error("open %s failed: %s\n", kconfigpath, strerror(errno)); |
| 2459 | exit(ERROR_KCONFIG_OPEN_FAILURE); |
| 2460 | } |
| 2461 | |
| 2462 | /* Process each line in the Kconfig file */ |
| 2463 | |
| 2464 | parse_kconfigfile(stream, kconfigdir, kconfigname); |
| 2465 | |
| 2466 | /* Close the Kconfig file and release the memory holding the full path */ |
| 2467 | |
| 2468 | fclose(stream); |
| 2469 | free(kconfigpath); |
| 2470 | } |
| 2471 | |
| 2472 | /**************************************************************************** |
| 2473 | * Public Functions |