亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频

? 歡迎來到蟲蟲下載站! | ?? 資源下載 ?? 資源專輯 ?? 關(guān)于我們
? 蟲蟲下載站

?? getopt.c

?? 絕對好的源碼
?? C
字號(hào):
/*	$NetBSD: getopt_long.c,v 1.15 2002/01/31 22:43:40 tv Exp $	*//*- * Copyright (c) 2000 The NetBSD Foundation, Inc. * All rights reserved. * * This code is derived from software contributed to The NetBSD Foundation * by Dieter Baron and Thomas Klausner. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: * 1. Redistributions of source code must retain the above copyright *    notice, this list of conditions and the following disclaimer. * 2. Redistributions in binary form must reproduce the above copyright *    notice, this list of conditions and the following disclaimer in the *    documentation and/or other materials provided with the distribution. * 3. All advertising materials mentioning features or use of this software *    must display the following acknowledgement: *        This product includes software developed by the NetBSD *        Foundation, Inc. and its contributors. * 4. Neither the name of The NetBSD Foundation nor the names of its *    contributors may be used to endorse or promote products derived *    from this software without specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR * PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE * POSSIBILITY OF SUCH DAMAGE. */#include <assert.h>#include <errno.h>#include <stdlib.h>#include <string.h>#include <getopt.h>#include <stdarg.h>#include <stdio.h>#define REPLACE_GETOPT#define _DIAGASSERT(x) do {} while (0)#ifdef REPLACE_GETOPT#ifdef __weak_alias__weak_alias(getopt,_getopt)#endifint opterr = 1;	/* if error message should be printed */int optind = 1;	/* index into parent argv vector */int optopt = '?';	/* character checked for validity */int optreset;	/* reset getopt */char *optarg;	/* argument associated with option */#endif#ifdef __weak_alias__weak_alias(getopt_long,_getopt_long)#endifchar *__progname = "x264";#define IGNORE_FIRST	(*options == '-' || *options == '+')#define PRINT_ERROR	((opterr) && ((*options != ':') \				      || (IGNORE_FIRST && options[1] != ':')))#define IS_POSIXLY_CORRECT (getenv("POSIXLY_INCORRECT_GETOPT") == NULL)#define PERMUTE         (!IS_POSIXLY_CORRECT && !IGNORE_FIRST)/* XXX: GNU ignores PC if *options == '-' */#define IN_ORDER        (!IS_POSIXLY_CORRECT && *options == '-')/* return values */#define	BADCH	(int)'?'#define	BADARG		((IGNORE_FIRST && options[1] == ':') \			 || (*options == ':') ? (int)':' : (int)'?')#define INORDER (int)1static char EMSG[1];static int getopt_internal (int, char * const *, const char *);static int gcd (int, int);static void permute_args (int, int, int, char * const *);static char *place = EMSG; /* option letter processing *//* XXX: set optreset to 1 rather than these two */static int nonopt_start = -1; /* first non option argument (for permute) */static int nonopt_end = -1;   /* first option after non options (for permute) *//* Error messages */static const char recargchar[] = "option requires an argument -- %c";static const char recargstring[] = "option requires an argument -- %s";static const char ambig[] = "ambiguous option -- %.*s";static const char noarg[] = "option doesn't take an argument -- %.*s";static const char illoptchar[] = "unknown option -- %c";static const char illoptstring[] = "unknown option -- %s";static void_vwarnx(const char *fmt, va_list ap){  (void)fprintf(stderr, "%s: ", __progname);  if (fmt != NULL)    (void)vfprintf(stderr, fmt, ap);  (void)fprintf(stderr, "\n");}static voidwarnx(const char *fmt, ...){  va_list ap;  va_start(ap, fmt);  _vwarnx(fmt, ap);  va_end(ap);}/* * Compute the greatest common divisor of a and b. */static intgcd(a, b)	int a;	int b;{	int c;	c = a % b;	while (c != 0) {		a = b;		b = c;		c = a % b;	}	return b;}/* * Exchange the block from nonopt_start to nonopt_end with the block * from nonopt_end to opt_end (keeping the same order of arguments * in each block). */static voidpermute_args(panonopt_start, panonopt_end, opt_end, nargv)	int panonopt_start;	int panonopt_end;	int opt_end;	char * const *nargv;{	int cstart, cyclelen, i, j, ncycle, nnonopts, nopts, pos;	char *swap;	_DIAGASSERT(nargv != NULL);	/*	 * compute lengths of blocks and number and size of cycles	 */	nnonopts = panonopt_end - panonopt_start;	nopts = opt_end - panonopt_end;	ncycle = gcd(nnonopts, nopts);	cyclelen = (opt_end - panonopt_start) / ncycle;	for (i = 0; i < ncycle; i++) {		cstart = panonopt_end+i;		pos = cstart;		for (j = 0; j < cyclelen; j++) {			if (pos >= panonopt_end)				pos -= nnonopts;			else				pos += nopts;			swap = nargv[pos];			/* LINTED const cast */			((char **) nargv)[pos] = nargv[cstart];			/* LINTED const cast */			((char **)nargv)[cstart] = swap;		}	}}/* * getopt_internal -- *	Parse argc/argv argument vector.  Called by user level routines. *  Returns -2 if -- is found (can be long option or end of options marker). */static intgetopt_internal(nargc, nargv, options)	int nargc;	char * const *nargv;	const char *options;{	char *oli;				/* option letter list index */	int optchar;	_DIAGASSERT(nargv != NULL);	_DIAGASSERT(options != NULL);	optarg = NULL;	/*	 * XXX Some programs (like rsyncd) expect to be able to	 * XXX re-initialize optind to 0 and have getopt_long(3)	 * XXX properly function again.  Work around this braindamage.	 */	if (optind == 0)		optind = 1;	if (optreset)		nonopt_start = nonopt_end = -1;start:	if (optreset || !*place) {		/* update scanning pointer */		optreset = 0;		if (optind >= nargc) {          /* end of argument vector */			place = EMSG;			if (nonopt_end != -1) {				/* do permutation, if we have to */				permute_args(nonopt_start, nonopt_end,				    optind, nargv);				optind -= nonopt_end - nonopt_start;			}			else if (nonopt_start != -1) {				/*				 * If we skipped non-options, set optind				 * to the first of them.				 */				optind = nonopt_start;			}			nonopt_start = nonopt_end = -1;			return -1;		}		if ((*(place = nargv[optind]) != '-')		    || (place[1] == '\0')) {    /* found non-option */			place = EMSG;			if (IN_ORDER) {				/*				 * GNU extension:				 * return non-option as argument to option 1				 */				optarg = nargv[optind++];				return INORDER;			}			if (!PERMUTE) {				/*				 * if no permutation wanted, stop parsing				 * at first non-option				 */				return -1;			}			/* do permutation */			if (nonopt_start == -1)				nonopt_start = optind;			else if (nonopt_end != -1) {				permute_args(nonopt_start, nonopt_end,				    optind, nargv);				nonopt_start = optind -				    (nonopt_end - nonopt_start);				nonopt_end = -1;			}			optind++;			/* process next argument */			goto start;		}		if (nonopt_start != -1 && nonopt_end == -1)			nonopt_end = optind;		if (place[1] && *++place == '-') {	/* found "--" */			place++;			return -2;		}	}	if ((optchar = (int)*place++) == (int)':' ||	    (oli = strchr(options + (IGNORE_FIRST ? 1 : 0), optchar)) == NULL) {		/* option letter unknown or ':' */		if (!*place)			++optind;		if (PRINT_ERROR)			warnx(illoptchar, optchar);		optopt = optchar;		return BADCH;	}	if (optchar == 'W' && oli[1] == ';') {		/* -W long-option */		/* XXX: what if no long options provided (called by getopt)? */		if (*place)			return -2;		if (++optind >= nargc) {	/* no arg */			place = EMSG;			if (PRINT_ERROR)				warnx(recargchar, optchar);			optopt = optchar;			return BADARG;		} else				/* white space */			place = nargv[optind];		/*		 * Handle -W arg the same as --arg (which causes getopt to		 * stop parsing).		 */		return -2;	}	if (*++oli != ':') {			/* doesn't take argument */		if (!*place)			++optind;	} else {				/* takes (optional) argument */		optarg = NULL;		if (*place)			/* no white space */			optarg = place;		/* XXX: disable test for :: if PC? (GNU doesn't) */		else if (oli[1] != ':') {	/* arg not optional */			if (++optind >= nargc) {	/* no arg */				place = EMSG;				if (PRINT_ERROR)					warnx(recargchar, optchar);				optopt = optchar;				return BADARG;			} else				optarg = nargv[optind];		}		place = EMSG;		++optind;	}	/* dump back option letter */	return optchar;}#ifdef REPLACE_GETOPT/* * getopt -- *	Parse argc/argv argument vector. * * [eventually this will replace the real getopt] */intgetopt(nargc, nargv, options)	int nargc;	char * const *nargv;	const char *options;{	int retval;	_DIAGASSERT(nargv != NULL);	_DIAGASSERT(options != NULL);	if ((retval = getopt_internal(nargc, nargv, options)) == -2) {		++optind;		/*		 * We found an option (--), so if we skipped non-options,		 * we have to permute.		 */		if (nonopt_end != -1) {			permute_args(nonopt_start, nonopt_end, optind,				       nargv);			optind -= nonopt_end - nonopt_start;		}		nonopt_start = nonopt_end = -1;		retval = -1;	}	return retval;}#endif/* * getopt_long -- *	Parse argc/argv argument vector. */intgetopt_long(nargc, nargv, options, long_options, idx)	int nargc;	char * const *nargv;	const char *options;	const struct option *long_options;	int *idx;{	int retval;	_DIAGASSERT(nargv != NULL);	_DIAGASSERT(options != NULL);	_DIAGASSERT(long_options != NULL);	/* idx may be NULL */	if ((retval = getopt_internal(nargc, nargv, options)) == -2) {		char *current_argv, *has_equal;		size_t current_argv_len;		int i, match;		current_argv = place;		match = -1;		optind++;		place = EMSG;		if (*current_argv == '\0') {		/* found "--" */			/*			 * We found an option (--), so if we skipped			 * non-options, we have to permute.			 */			if (nonopt_end != -1) {				permute_args(nonopt_start, nonopt_end,				    optind, nargv);				optind -= nonopt_end - nonopt_start;			}			nonopt_start = nonopt_end = -1;			return -1;		}		if ((has_equal = strchr(current_argv, '=')) != NULL) {			/* argument found (--option=arg) */			current_argv_len = has_equal - current_argv;			has_equal++;		} else			current_argv_len = strlen(current_argv);		for (i = 0; long_options[i].name; i++) {			/* find matching long option */			if (strncmp(current_argv, long_options[i].name,			    current_argv_len))				continue;			if (strlen(long_options[i].name) ==			    (unsigned)current_argv_len) {				/* exact match */				match = i;				break;			}			if (match == -1)		/* partial match */				match = i;			else {				/* ambiguous abbreviation */				if (PRINT_ERROR)					warnx(ambig, (int)current_argv_len,					     current_argv);				optopt = 0;				return BADCH;			}		}		if (match != -1) {			/* option found */			if (long_options[match].has_arg == no_argument			    && has_equal) {				if (PRINT_ERROR)					warnx(noarg, (int)current_argv_len,					     current_argv);				/*				 * XXX: GNU sets optopt to val regardless of				 * flag				 */				if (long_options[match].flag == NULL)					optopt = long_options[match].val;				else					optopt = 0;				return BADARG;			}			if (long_options[match].has_arg == required_argument ||			    long_options[match].has_arg == optional_argument) {				if (has_equal)					optarg = has_equal;				else if (long_options[match].has_arg ==				    required_argument) {					/*					 * optional argument doesn't use					 * next nargv					 */					optarg = nargv[optind++];				}			}			if ((long_options[match].has_arg == required_argument)			    && (optarg == NULL)) {				/*				 * Missing argument; leading ':'				 * indicates no error should be generated				 */				if (PRINT_ERROR)					warnx(recargstring, current_argv);				/*				 * XXX: GNU sets optopt to val regardless				 * of flag				 */				if (long_options[match].flag == NULL)					optopt = long_options[match].val;				else					optopt = 0;				--optind;				return BADARG;			}		} else {			/* unknown option */			if (PRINT_ERROR)				warnx(illoptstring, current_argv);			optopt = 0;			return BADCH;		}		if (long_options[match].flag) {			*long_options[match].flag = long_options[match].val;			retval = 0;		} else			retval = long_options[match].val;		if (idx)			*idx = match;	}	return retval;}

?? 快捷鍵說明

復(fù)制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號(hào) Ctrl + =
減小字號(hào) Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
久久蜜臀精品av| 色综合久久久久网| 日本高清无吗v一区| 精品美女被调教视频大全网站| 中文字幕中文在线不卡住| 免费成人av资源网| 91视频xxxx| 久久久噜噜噜久久人人看| 日本伊人色综合网| 在线精品视频一区二区三四| 国产精品网站在线观看| 麻豆91在线看| 欧美一区二区三区免费大片| 有坂深雪av一区二区精品| 成人国产视频在线观看| 久久九九国产精品| 蜜桃视频在线观看一区| 欧美猛男超大videosgay| 亚洲免费观看在线观看| caoporn国产一区二区| 国产日韩精品视频一区| 麻豆国产欧美一区二区三区| 欧美日韩成人在线一区| 亚洲高清在线视频| 91精品福利在线| 亚洲精品久久嫩草网站秘色| 国产suv精品一区二区6| 久久久久久9999| 国产在线视频不卡二| 日韩三级视频在线观看| 日本在线播放一区二区三区| 在线电影院国产精品| 亚洲第一av色| 欧美精品v日韩精品v韩国精品v| 亚洲午夜av在线| 欧美日韩精品综合在线| 婷婷久久综合九色综合绿巨人| 在线免费观看一区| 亚洲永久免费av| 精品婷婷伊人一区三区三| 亚洲精品国产第一综合99久久 | 亚洲成av人片一区二区三区| 日本久久电影网| 一区二区三区在线看| 一本高清dvd不卡在线观看| 亚洲精品成人天堂一二三| 色八戒一区二区三区| 亚洲另类在线视频| 国产精品视频看| 亚洲高清免费视频| 韩国毛片一区二区三区| 欧美精品一区二区三| 麻豆精品一二三| 2022国产精品视频| 国产精品自拍av| 国产精品久久久久久妇女6080 | 日本三级韩国三级欧美三级| 欧美日韩一区二区三区不卡| 国产99久久久精品| 成人精品视频一区二区三区| 欧美一区在线视频| 老司机免费视频一区二区| 精品国内片67194| 国产精品自在在线| 国产精品传媒在线| 在线一区二区三区四区五区 | 欧美极品xxx| 97精品国产露脸对白| 亚洲一区二区三区美女| 91精品国产丝袜白色高跟鞋| 精品中文字幕一区二区小辣椒| 久久久精品黄色| 成人av午夜影院| 欧美做爰猛烈大尺度电影无法无天| 国产精品午夜电影| 欧洲一区在线观看| 日韩影院在线观看| 国产欧美日韩亚州综合 | 9人人澡人人爽人人精品| 亚洲精品高清视频在线观看| 91麻豆精品国产91久久久久久久久 | 欧美精品日韩综合在线| 国产一区二区中文字幕| 亚洲视频综合在线| 在线电影一区二区三区| 国产91综合一区在线观看| 亚洲永久免费av| 26uuu精品一区二区| 91在线码无精品| 麻豆成人久久精品二区三区小说| 国产精品久久久99| 日韩一二三区视频| 99久久综合狠狠综合久久| 日韩国产成人精品| 国产精品丝袜一区| 91精品国产91久久久久久一区二区| 国产成人精品一区二区三区网站观看 | 一本色道久久综合亚洲精品按摩| 麻豆成人综合网| 亚洲精品国产品国语在线app| 欧美v国产在线一区二区三区| 99久久婷婷国产精品综合| 美女网站在线免费欧美精品| **性色生活片久久毛片| 日韩欧美一区二区视频| 色悠悠亚洲一区二区| 久久99热这里只有精品| 亚洲黄一区二区三区| 国产亚洲欧美色| 欧美日本韩国一区| 9人人澡人人爽人人精品| 久久精品国产亚洲高清剧情介绍| 一区二区三区国产精华| 国产日韩在线不卡| 日韩视频中午一区| 欧美性猛交一区二区三区精品| 国产白丝精品91爽爽久久| 美女一区二区视频| 亚洲一级二级在线| 国产精品久久久久久一区二区三区| 日韩欧美123| 欧美日韩国产bt| 色婷婷精品久久二区二区蜜臀av | 日韩经典一区二区| 亚洲欧美日韩在线播放| 久久精品视频在线免费观看 | 在线观看国产精品网站| 豆国产96在线|亚洲| 精品综合久久久久久8888| 日韩精品久久理论片| 一区二区三区精品在线观看| 国产精品久久午夜| 国产三级一区二区| 精品免费日韩av| 日韩一级二级三级| 91精品国产综合久久久久| 在线观看日韩毛片| 91香蕉国产在线观看软件| 成人黄色电影在线| 大胆欧美人体老妇| 国产精品456| 国产一区二区精品久久99| 麻豆精品国产传媒mv男同 | 亚洲欧美日韩系列| 国产精品三级久久久久三级| 国产亚洲欧洲一区高清在线观看| 精品国产精品一区二区夜夜嗨| 欧美一二三区在线| 日韩欧美www| 欧美va亚洲va香蕉在线| 日韩精品在线看片z| 日韩午夜小视频| 日韩美一区二区三区| 911精品产国品一二三产区 | gogo大胆日本视频一区| 成人福利视频网站| 99re视频这里只有精品| 91蝌蚪国产九色| 色婷婷av一区二区三区gif| 99久久久精品| 一本大道久久精品懂色aⅴ| 色哟哟一区二区在线观看| 色伊人久久综合中文字幕| 91免费小视频| 色老汉av一区二区三区| 91久久久免费一区二区| 欧美日韩国产综合视频在线观看| 欧美日韩久久久| 日韩视频一区在线观看| 亚洲精品一区二区三区在线观看 | 久久只精品国产| 欧美国产激情一区二区三区蜜月| 欧美国产丝袜视频| 亚洲丝袜精品丝袜在线| 亚洲福利视频一区二区| 蜜臀久久99精品久久久久久9| 精品一区二区三区在线播放 | 成人av免费在线| 色综合夜色一区| 欧美精品日日鲁夜夜添| 日韩精品一区在线| 中文字幕乱码日本亚洲一区二区| 亚洲欧洲av在线| 亚洲电影中文字幕在线观看| 日本三级亚洲精品| 国产91清纯白嫩初高中在线观看 | 欧美亚州韩日在线看免费版国语版| 欧美性受xxxx| 日韩三级中文字幕| 国产精品亲子伦对白| 亚洲女人****多毛耸耸8| 日欧美一区二区| 国产大片一区二区| 欧美在线制服丝袜| 精品国产自在久精品国产| 最新不卡av在线| 日日摸夜夜添夜夜添精品视频 | 国产一区二区影院| 99re这里都是精品| 日韩亚洲欧美在线|