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

? 歡迎來到蟲蟲下載站! | ?? 資源下載 ?? 資源專輯 ?? 關于我們
? 蟲蟲下載站

?? getopt.c

?? 圖象壓縮程序
?? C
字號:
/*	$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)#endif#ifndef __CYGWIN__#define __progname __argv[0]#elseextern char *__progname;#endif#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;}

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
国产精品婷婷午夜在线观看| 91香蕉视频黄| 精品国产乱子伦一区| 国产老妇另类xxxxx| 国产精品视频一区二区三区不卡| 成人污污视频在线观看| 日韩理论电影院| 欧美这里有精品| 蜜臀久久久久久久| 国产日韩欧美高清在线| 91免费国产在线| 日韩在线一区二区三区| 久久亚洲春色中文字幕久久久| 成人免费电影视频| 亚洲一级片在线观看| 精品福利二区三区| 99久久99精品久久久久久| 亚洲chinese男男1069| 久久久久久久久99精品| 99久久777色| 男男gaygay亚洲| 国产精品毛片大码女人| 欧美日韩国产片| 国产成人综合自拍| 亚洲永久免费视频| 国产视频一区在线观看| 精品1区2区3区| 国产美女在线精品| 亚洲va在线va天堂| 国产精品视频一二三区| 欧美一区二区免费| va亚洲va日韩不卡在线观看| 丝袜国产日韩另类美女| 国产精品视频看| 日韩精品一区二区三区老鸭窝| 99精品黄色片免费大全| 精品一区二区三区免费视频| 一级做a爱片久久| 久久久国际精品| 国产精品久久久久一区二区三区共| 欧美偷拍一区二区| www.久久精品| 国产老女人精品毛片久久| 午夜成人免费视频| 亚洲欧美另类综合偷拍| 久久久天堂av| 日韩三级电影网址| 欧美亚洲一区二区在线观看| 国产精品一区在线| 欧美精品一二三区| av午夜精品一区二区三区| 加勒比av一区二区| 免费在线观看一区| 亚洲444eee在线观看| 国产精品久久久久久福利一牛影视| 日韩久久精品一区| 在线观看亚洲a| 色综合中文字幕国产| 国产a区久久久| 国产毛片精品视频| 国产美女精品人人做人人爽| 日产精品久久久久久久性色| 亚洲女同ⅹxx女同tv| 国产精品成人网| 日本一区二区三区电影| 国产清纯美女被跳蛋高潮一区二区久久w| 91麻豆精品国产无毒不卡在线观看 | 国产精品夜夜爽| 美腿丝袜亚洲综合| 毛片一区二区三区| 秋霞成人午夜伦在线观看| 亚洲成在线观看| 亚洲国产你懂的| 亚洲成人777| 石原莉奈一区二区三区在线观看 | 在线国产电影不卡| 色综合 综合色| 在线观看一区日韩| 欧美日韩国产一级| 欧美精品在线视频| 91精品免费在线观看| 日韩免费观看高清完整版在线观看| 欧美日韩电影在线| 欧美一区二区三区免费观看视频| 欧美日本高清视频在线观看| 精品视频在线看| 欧美一级理论片| www国产成人免费观看视频 深夜成人网| 精品少妇一区二区三区视频免付费 | 欧美男人的天堂一二区| 91麻豆精品国产91久久久久| 欧美一级xxx| 国产色一区二区| 亚洲裸体xxx| 亚洲综合av网| 喷水一区二区三区| 国产成人久久精品77777最新版本| 国产精品99久久久久| 99久久精品国产网站| 亚洲综合小说图片| 蜜桃精品视频在线| 久久成人麻豆午夜电影| 国产成人精品三级麻豆| 色国产综合视频| 欧美videos中文字幕| 中文字幕乱码日本亚洲一区二区| 一区二区三区四区国产精品| 婷婷综合五月天| 国产精品综合视频| 色噜噜狠狠一区二区三区果冻| 日韩一区二区三区在线视频| 国产精品乱码人人做人人爱| 亚洲在线观看免费视频| 国产在线视频一区二区三区| 色域天天综合网| 精品久久五月天| 一个色在线综合| 精品一区二区免费看| 色综合婷婷久久| 久久色在线观看| 亚洲成人免费观看| 国产99精品国产| 在线播放/欧美激情| 国产精品久久久久久久久搜平片 | 色狠狠色狠狠综合| 欧美电视剧免费全集观看| 亚洲伦理在线免费看| 经典三级在线一区| 欧美视频精品在线| 欧美激情一区二区在线| 麻豆精品久久精品色综合| 色成人在线视频| 国产女同性恋一区二区| 日韩国产精品大片| 91精彩视频在线观看| 国产欧美一区在线| 久久99精品一区二区三区 | 国产一区高清在线| 欧美精品久久天天躁| 亚洲免费色视频| 国产电影一区在线| 欧美大片日本大片免费观看| 亚洲伊人色欲综合网| 成人免费视频caoporn| 日韩久久免费av| 免费观看一级欧美片| 欧美日韩一区二区三区高清 | 一区二区在线观看av| 成人免费va视频| 国产三级精品三级| 激情伊人五月天久久综合| 欧美一区二区三区四区视频| 亚洲444eee在线观看| 精品视频资源站| 亚洲午夜久久久久久久久电影院| 一本大道av一区二区在线播放| 国产精品入口麻豆九色| 国产成人免费在线| 久久九九久久九九| 国产成人av自拍| 久久久久久影视| 国产二区国产一区在线观看 | 亚洲蜜桃精久久久久久久| 成人av片在线观看| 国产精品欧美极品| 99久久久久免费精品国产| 国产精品三级视频| 成人av电影免费在线播放| 中文字幕一区二区三区在线观看 | 久久99九九99精品| 欧美zozozo| 国产麻豆精品久久一二三| 精品国产伦一区二区三区观看体验 | 一区二区三区在线视频观看| 91免费在线播放| 亚洲午夜精品17c| 欧美一区二区在线不卡| 久久不见久久见免费视频7| 久久综合成人精品亚洲另类欧美 | 91精品国产综合久久久久久漫画| 日韩电影在线免费看| 日韩免费在线观看| 国内偷窥港台综合视频在线播放| 久久久精品tv| 一本一道波多野结衣一区二区| 亚洲成人手机在线| 欧美成人video| 成人国产电影网| 亚洲国产精品久久久男人的天堂| 欧美一卡在线观看| 国产ts人妖一区二区| 亚洲丝袜自拍清纯另类| 欧美欧美欧美欧美| 国产一区91精品张津瑜| 亚洲免费看黄网站| 日韩亚洲欧美综合| 成人av在线看| 日韩激情中文字幕| 国产亚洲欧美中文| 欧美色图片你懂的|