亚洲欧美第一页_禁久久精品乱码_粉嫩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一区二区三区免费野_久草精品视频
99riav一区二区三区| 欧美不卡一区二区三区四区| 波波电影院一区二区三区| 国产美女在线观看一区| 精品在线播放午夜| 国内久久精品视频| 国产美女精品人人做人人爽| 精品一区二区在线播放| 国产一区二区不卡老阿姨| 久久精品国产99| 国产一区二区三区日韩| 成人免费视频视频在线观看免费| 国产高清不卡一区| 国产69精品一区二区亚洲孕妇| 国产成人在线看| 成人动漫一区二区| 91高清视频免费看| 欧美人狂配大交3d怪物一区| 在线播放91灌醉迷j高跟美女| 欧美一区二区美女| 久久精品视频网| 国产精品久久毛片av大全日韩| 国产精品的网站| 亚洲国产精品精华液网站| 麻豆精品一区二区三区| 国产成人一区在线| 在线免费观看一区| 欧美一二三区在线| 久久亚洲综合色| 国产精品久久久久久户外露出 | 国产午夜一区二区三区| 中文幕一区二区三区久久蜜桃| 亚洲日本va午夜在线影院| 亚洲精品国产无套在线观| 午夜久久久影院| 国产精品亚洲专一区二区三区| 99久久免费精品| 911精品国产一区二区在线| 国产日韩精品一区二区三区在线| 亚洲摸摸操操av| 久久97超碰色| 91亚洲男人天堂| 日韩一区二区在线观看视频| 国产精品网站导航| 日韩激情一二三区| 国产传媒欧美日韩成人| 欧美午夜宅男影院| 久久久精品影视| 亚洲国产毛片aaaaa无费看| 国产一区二区h| 欧美日韩1234| 中文字幕一区三区| 免费久久99精品国产| 色综合激情久久| 精品国产欧美一区二区| 亚洲精品国产精品乱码不99 | av在线不卡免费看| 91精品国产综合久久久蜜臀图片 | 日韩黄色在线观看| 成人黄色777网| 欧美白人最猛性xxxxx69交| 亚洲欧美区自拍先锋| 精品亚洲国内自在自线福利| 色域天天综合网| 欧美激情在线看| 美腿丝袜亚洲三区| 欧美日韩在线亚洲一区蜜芽| 国产精品视频第一区| 免费观看久久久4p| 欧美日韩你懂的| 亚洲欧美二区三区| 成人黄色a**站在线观看| 久久婷婷国产综合精品青草| 五月婷婷激情综合| 色综合一区二区| 国产精品久久久久久久久免费丝袜| 久久福利视频一区二区| 欧美人妇做爰xxxⅹ性高电影| 亚洲精品国产精品乱码不99| 成人午夜电影网站| 久久久久久久久久电影| 蜜桃视频在线一区| 欧美区一区二区三区| 亚洲综合色婷婷| 色综合中文字幕国产| 亚洲视频狠狠干| 91小视频在线免费看| 国产精品午夜在线| 国产成人在线网站| 久久久久久久综合| 精品午夜久久福利影院| 欧美成人性福生活免费看| 日本va欧美va欧美va精品| 欧美老肥妇做.爰bbww| 亚洲成人三级小说| 91麻豆国产在线观看| 亚洲色图制服丝袜| 91啪九色porn原创视频在线观看| 欧美国产乱子伦| av高清不卡在线| 国产精品久99| 99精品国产视频| 一区二区日韩电影| 欧美日韩国产一级片| 首页国产欧美久久| 欧美一区二区三区视频免费 | 成人免费看视频| 欧美激情一区二区三区蜜桃视频 | 欧美精品xxxxbbbb| 青青青伊人色综合久久| 欧美一区二区视频在线观看2020| 日本不卡一二三| 欧美大片在线观看一区| 国产在线国偷精品产拍免费yy| 久久久99久久| 99久久精品国产导航| 一区二区三区不卡在线观看| 欧美日韩精品久久久| 日本亚洲免费观看| 久久亚洲精品小早川怜子| 国产成人在线免费观看| 亚洲日本一区二区三区| 欧美日韩免费一区二区三区视频| 日韩精品一二三四| 精品国产91九色蝌蚪| av一二三不卡影片| 午夜视频一区在线观看| 欧美v国产在线一区二区三区| 国产成人午夜精品影院观看视频 | 色国产精品一区在线观看| 亚洲国产精品一区二区久久恐怖片| 4438成人网| 国产九色精品成人porny| 亚洲乱码国产乱码精品精可以看 | 一区二区三区美女| 日韩一区二区三区在线| 日本不卡的三区四区五区| 久久久无码精品亚洲日韩按摩| 成人av在线网| 亚洲高清久久久| 久久麻豆一区二区| 91久久线看在观草草青青| 日本欧美一区二区| 国产精品久久久久久亚洲毛片| 在线看不卡av| 国产自产高清不卡| 亚洲三级电影网站| 精品伦理精品一区| 日本精品一区二区三区高清 | 欧美顶级少妇做爰| 粉嫩久久99精品久久久久久夜| 亚洲国产中文字幕| 国产欧美一区二区精品忘忧草 | 欧美日韩一二三区| 国产一区二区在线看| 亚洲精品老司机| 久久久久久久久久看片| 欧美性生活大片视频| 国产精品白丝jk黑袜喷水| 亚洲午夜精品网| 国产精品毛片无遮挡高清| 91精品国产一区二区三区香蕉| 国产69精品一区二区亚洲孕妇| 日韩va亚洲va欧美va久久| 亚洲欧美一区二区三区孕妇| 久久综合九色综合97婷婷女人| 欧美视频一区二区三区在线观看| 国产91清纯白嫩初高中在线观看 | 七七婷婷婷婷精品国产| 亚洲天堂成人在线观看| 国产日韩欧美高清| 欧美成人一区二区| 91 com成人网| 欧美色综合久久| 成人18视频日本| 国产精品综合二区| 久久精品99国产国产精| 午夜国产不卡在线观看视频| 亚洲视频在线一区观看| 国产人久久人人人人爽| 精品国产青草久久久久福利| 欧美精品三级日韩久久| 欧美在线免费观看亚洲| 99视频精品免费视频| 国产黄色成人av| 久久精品国产澳门| 免费在线观看一区二区三区| 亚洲成年人影院| 亚洲最新在线观看| 亚洲色图欧美在线| 国产精品国产三级国产aⅴ无密码 国产精品国产三级国产aⅴ原创 | 国产精品午夜电影| 国产亚洲女人久久久久毛片| 精品国产一区二区三区四区四| 555www色欧美视频| 7777精品伊人久久久大香线蕉的 | 日日嗨av一区二区三区四区| 亚洲人妖av一区二区| 亚洲欧美日韩电影| 一区二区三区精品|