MCPcopy Create free account
hub / github.com/apache/nuttx / main

Function main

tools/incdir.c:261–520  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

259 ****************************************************************************/
260
261int main(int argc, char **argv, char **envp)
262{
263#ifdef HOST_CYGWIN
264 char *convpath = NULL;
265 bool wintool = false;
266#endif
267 enum pathtype_e pathtype = USER_PATH;
268 enum os_e os;
269 enum compiler_e compiler;
270 const char *progname = argv[0];
271 const char *cmdarg;
272 char *ccname;
273 char * const *dirlist;
274 size_t respsize = 0;
275 char *response = NULL;
276 int ndirs;
277 int ret;
278 int ch;
279 int i;
280
281 /* Handle command line options */
282
283 while ((ch = getopt(argc, argv, "wsh")) >= 0)
284 {
285 switch (ch)
286 {
287 case 'w':
288#ifdef HOST_CYGWIN
289 wintool = true;
290#endif
291 break;
292
293 case 's':
294 pathtype = SYSTEM_PATH;
295 break;
296
297 case 'h':
298 show_help(progname, EXIT_SUCCESS);
299 }
300 }
301
302 if (optind >= argc)
303 {
304 fprintf(stderr, "ERROR: Missing <compiler-path>\n");
305 show_advice(progname, EXIT_FAILURE);
306 }
307
308 ccname = basename(argv[optind]);
309 optind++;
310
311 if (optind >= argc)
312 {
313 fprintf(stderr, "ERROR: At least one directory must be supplied\n");
314 show_advice(progname, EXIT_FAILURE);
315 }
316
317 dirlist = &argv[optind];
318 ndirs = argc - optind;

Callers

nothing calls this directly

Calls 14

getoptFunction · 0.85
show_helpFunction · 0.85
fprintfFunction · 0.85
show_adviceFunction · 0.85
basenameFunction · 0.85
get_osFunction · 0.85
exitFunction · 0.85
my_asprintfFunction · 0.85
fputsFunction · 0.85
get_compilerFunction · 0.70
mallocFunction · 0.50
strncpyFunction · 0.50

Tested by

no test coverage detected