MCPcopy Create free account
hub / github.com/F-Stack/f-stack / append_eal_args

Function append_eal_args

dpdk/app/test-dma-perf/main.c:448–475  ·  view source on GitHub ↗

Parse the argument given in the command line of the application */

Source from the content-addressed store, hash-verified

446
447/* Parse the argument given in the command line of the application */
448static int
449append_eal_args(int argc, char **argv, const char *eal_args, char **new_argv)
450{
451 int i;
452 char *tokens[MAX_EAL_PARAM_NB];
453 char args[MAX_EAL_PARAM_LEN] = {0};
454 int token_nb, new_argc = 0;
455
456 for (i = 0; i < argc; i++) {
457 if ((strcmp(argv[i], CMDLINE_CONFIG_ARG) == 0) ||
458 (strcmp(argv[i], CMDLINE_RESULT_ARG) == 0)) {
459 i++;
460 continue;
461 }
462 strlcpy(new_argv[new_argc], argv[i], MAX_EAL_PARAM_LEN);
463 new_argc++;
464 }
465
466 if (eal_args) {
467 strlcpy(args, eal_args, MAX_EAL_PARAM_LEN);
468 token_nb = rte_strsplit(args, strlen(args),
469 tokens, MAX_EAL_PARAM_NB, ' ');
470 for (i = 0; i < token_nb; i++)
471 strlcpy(new_argv[new_argc++], tokens[i], MAX_EAL_PARAM_LEN);
472 }
473
474 return new_argc;
475}
476
477int
478main(int argc, char *argv[])

Callers 1

mainFunction · 0.85

Calls 3

strcmpFunction · 0.85
rte_strsplitFunction · 0.85
strlcpyFunction · 0.50

Tested by

no test coverage detected