MCPcopy Index your code
hub / github.com/F-Stack/f-stack / ff_load_config

Function ff_load_config

lib/ff_config.c:1344–1379  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1342}
1343
1344int
1345ff_load_config(int argc, char *const argv[])
1346{
1347 ff_default_config(&ff_global_cfg);
1348
1349 int ret = ff_parse_args(&ff_global_cfg, argc, argv);
1350 if (ret < 0) {
1351 return ret;
1352 }
1353
1354 ret = ini_parse(ff_global_cfg.filename, ini_parse_handler,
1355 &ff_global_cfg);
1356 if (ret != 0) {
1357 switch(ret) {
1358 case -1:
1359 printf("failed to open file %s\n", ff_global_cfg.filename);
1360 break;
1361 case -2:
1362 printf("failed to allocate memory for config parsing\n");
1363 break;
1364 default:
1365 printf("parse %s failed on line %d\n", ff_global_cfg.filename, ret);
1366 }
1367 return -1;
1368 }
1369
1370 if (ff_check_config(&ff_global_cfg)) {
1371 return -1;
1372 }
1373
1374 if (dpdk_args_setup(&ff_global_cfg) <= 0) {
1375 return -1;
1376 }
1377
1378 return 0;
1379}

Callers 1

ff_initFunction · 0.85

Calls 6

ff_default_configFunction · 0.85
ff_parse_argsFunction · 0.85
ini_parseFunction · 0.85
ff_check_configFunction · 0.85
dpdk_args_setupFunction · 0.85
printfFunction · 0.70

Tested by

no test coverage detected