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

Function parse_app_args

dpdk/examples/server_node_efd/efd_node/node.c:91–117  ·  view source on GitHub ↗

* Parse the application arguments to the node app. */

Source from the content-addressed store, hash-verified

89 * Parse the application arguments to the node app.
90 */
91static int
92parse_app_args(int argc, char *argv[])
93{
94 int option_index, opt;
95 char **argvopt = argv;
96 const char *progname = NULL;
97 static struct option lgopts[] = { /* no long options */
98 {NULL, 0, 0, 0 }
99 };
100 progname = argv[0];
101
102 while ((opt = getopt_long(argc, argvopt, "n:", lgopts,
103 &option_index)) != EOF) {
104 switch (opt) {
105 case 'n':
106 if (parse_node_num(optarg) != 0) {
107 usage(progname);
108 return -1;
109 }
110 break;
111 default:
112 usage(progname);
113 return -1;
114 }
115 }
116 return 0;
117}
118
119/*
120 * Tx buffer error callback

Callers 1

mainFunction · 0.70

Calls 3

getopt_longFunction · 0.85
parse_node_numFunction · 0.85
usageFunction · 0.70

Tested by

no test coverage detected