Parse the argument given in the command line of the application */
| 446 | |
| 447 | /* Parse the argument given in the command line of the application */ |
| 448 | static int |
| 449 | append_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 | |
| 477 | int |
| 478 | main(int argc, char *argv[]) |
no test coverage detected