src/dpdk/lib/librte_eal/windows/eal.c
static int
eal_parse_args(int argc, char **argv)
{
	int opt, ret;
	char **argvopt;
	int option_index;
	char *prgname = argv[0];
	struct internal_config *internal_conf =
		eal_get_internal_configuration();

	argvopt = argv;

	while ((opt = getopt_long(argc, argvopt, eal_short_options,
		eal_long_options, &option_index)) != EOF) {

		int ret;

		/* getopt is not happy, stop right now */
		if (opt == '?') {
			eal_usage(prgname);
			return -1;
		}

		ret = eal_parse_common_option(opt, optarg, internal_conf);
		/* common parser is not happy */
		if (ret < 0) {
			eal_usage(prgname);
			return -1;
		}
		/* common parser handled this option */
		if (ret == 0)
			continue;

		switch (opt) {
		case 'h':
			eal_usage(prgname);
			exit(EXIT_SUCCESS);
		default:
			if (opt < OPT_LONG_MIN_NUM && isprint(opt)) {
				RTE_LOG(ERR, EAL, "Option %c is not supported "
					"on Windows\n", opt);
			} else if (opt >= OPT_LONG_MIN_NUM &&
				opt < OPT_LONG_MAX_NUM) {
				RTE_LOG(ERR, EAL, "Option %s is not supported "
					"on Windows\n",
					eal_long_options[option_index].name);
			} else {
				RTE_LOG(ERR, EAL, "Option %d is not supported "
					"on Windows\n", opt);
			}
			eal_usage(prgname);
			return -1;
		}
	}

	if (eal_adjust_config(internal_conf) != 0)
		return -1;

	/* sanity checks */
	if (eal_check_common_options(internal_conf) != 0) {
		eal_usage(prgname);
		return -1;
	}

	if (optind >= 0)
		argv[optind - 1] = prgname;
	ret = optind - 1;
	optind = 0; /* reset getopt lib */
	return ret;
}
/* Parse the argument given in the command line of the application */
Parse the argument given in the command line of the application
Parse the argument given in the command line of the application
static int
eal_parse_args(int argc, char **argv)
{
	int opt, ret;
	char **argvopt;
	int option_index;
	char *prgname = argv[0];
	struct internal_config *internal_conf =
		eal_get_internal_configuration();
	argvopt = argv;
	while ((opt = getopt_long(argc, argvopt, eal_short_options,
		eal_long_options, &option_index)) != EOF) {
		int ret;
		if (opt == '?') {
			eal_usage(prgname);
			return -1;
		}
		ret = eal_parse_common_option(opt, optarg, internal_conf);
		if (ret < 0) {
			eal_usage(prgname);
			return -1;
		}
		if (ret == 0)
			continue;
		switch (opt) {
		case 'h':
			eal_usage(prgname);
			exit(EXIT_SUCCESS);
		default:
			if (opt < OPT_LONG_MIN_NUM && isprint(opt)) {
				RTE_LOG(ERR, EAL, "Option %c is not supported "
					"on Windows\n", opt);
			} else if (opt >= OPT_LONG_MIN_NUM &&
				opt < OPT_LONG_MAX_NUM) {
				RTE_LOG(ERR, EAL, "Option %s is not supported "
					"on Windows\n",
					eal_long_options[option_index].name);
			} else {
				RTE_LOG(ERR, EAL, "Option %d is not supported "
					"on Windows\n", opt);
			}
			eal_usage(prgname);
			return -1;
		}
	}
	if (eal_adjust_config(internal_conf) != 0)
		return -1;
	if (eal_check_common_options(internal_conf) != 0) {
		eal_usage(prgname);
		return -1;
	}
	if (optind >= 0)
		argv[optind - 1] = prgname;
	ret = optind - 1;
	optind = 0; 
	return ret;
}
static int eal_parse_args ( int argc , char * * argv ) { int opt , ret ; char * * argvopt ; int option_index ; char * prgname = argv [ 0 ] ; struct internal_config * internal_conf = eal_get_internal_configuration ( ) ; argvopt = argv ; while ( ( opt = getopt_long ( argc , argvopt , eal_short_options , eal_long_options , & option_index ) ) != EOF ) { int ret ; if ( opt == ' ' ) { eal_usage ( prgname ) ; return -1 ; } ret = eal_parse_common_option ( opt , optarg , internal_conf ) ; if ( ret < 0 ) { eal_usage ( prgname ) ; return -1 ; } if ( ret == 0 ) continue ; switch ( opt ) { case ' ' : eal_usage ( prgname ) ; exit ( EXIT_SUCCESS ) ; default : if ( opt < OPT_LONG_MIN_NUM && isprint ( opt ) ) { RTE_LOG ( ERR , EAL , " " " \n " , opt ) ; } else if ( opt >= OPT_LONG_MIN_NUM && opt < OPT_LONG_MAX_NUM ) { RTE_LOG ( ERR , EAL , " " " \n " , eal_long_options [ option_index ] . name ) ; } else { RTE_LOG ( ERR , EAL , " " " \n " , opt ) ; } eal_usage ( prgname ) ; return -1 ; } } if ( eal_adjust_config ( internal_conf ) != 0 ) return -1 ; if ( eal_check_common_options ( internal_conf ) != 0 ) { eal_usage ( prgname ) ; return -1 ; } if ( optind >= 0 ) argv [ optind - 1 ] = prgname ; ret = optind - 1 ; optind = 0 ; return ret ; }
Parse the argument given in the command line of the application
Parse the argument given in the command line of the application
/* getopt is not happy, stop right now */ /* common parser is not happy */ /* common parser handled this option */ /* sanity checks */ /* reset getopt lib */