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

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

?? getopt.c

?? SSD6 pq1的原版正確答案
?? C
?? 第 1 頁 / 共 2 頁
字號:
// Taken from http://lottery.merseyworld.com/Wheel/

/* Getopt for GNU.
   NOTE: getopt is now part of the C library, so if you don't know what
   "Keep this file name-space clean" means, talk to roland@gnu.ai.mit.edu
   before changing it!

   Copyright (C) 1987, 88, 89, 90, 91, 92, 1993
   	Free Software Foundation, Inc.

   This program is free software; you can redistribute it and/or modify it
   under the terms of the GNU General Public License as published by the
   Free Software Foundation; either version 2, or (at your option) any
   later version.

   This program is distributed in the hope that it will be useful,
   but WITHOUT ANY WARRANTY; without even the implied warranty of
   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
   GNU General Public License for more details.

   You should have received a copy of the GNU General Public License
   along with this program; if not, write to the Free Software
   Foundation, 675 Mass Ave, Cambridge, MA 02139, USA.  */

#ifdef HAVE_CONFIG_H
#include "config.h"
#endif

#ifndef __STDC__
#  ifndef const
#    define const
#  endif
#endif

/* This tells Alpha OSF/1 not to define a getopt prototype in <stdio.h>.  */
#ifndef _NO_PROTO
#define _NO_PROTO
#endif

#include <stdio.h>
#include "tailor.h"

/* Comment out all this code if we are using the GNU C Library, and are not
   actually compiling the library itself.  This code is part of the GNU C
   Library, but also included in many other GNU distributions.  Compiling
   and linking in this code is a waste when using the GNU C library
   (especially if it is a shared library).  Rather than having every GNU
   program understand `configure --with-gnu-libc' and omit the object files,
   it is simpler to just do this in the source for each such file.  */

#if defined (_LIBC) || !defined (__GNU_LIBRARY__)


/* This needs to come after some library #include
   to get __GNU_LIBRARY__ defined.  */
#ifdef	__GNU_LIBRARY__
/* Don't include stdlib.h for non-GNU C libraries because some of them
   contain conflicting prototypes for getopt.  */
#include <stdlib.h>
#endif	/* GNU C library.  */

/* If GETOPT_COMPAT is defined, `+' as well as `--' can introduce a
   long-named option.  Because this is not POSIX.2 compliant, it is
   being phased out.  */
/* #define GETOPT_COMPAT */

/* This version of `getopt' appears to the caller like standard Unix `getopt'
   but it behaves differently for the user, since it allows the user
   to intersperse the options with the other arguments.

   As `getopt' works, it permutes the elements of ARGV so that,
   when it is done, all the options precede everything else.  Thus
   all application programs are extended to handle flexible argument order.

   Setting the environment variable POSIXLY_CORRECT disables permutation.
   Then the behavior is completely standard.

   GNU application programs can use a third alternative mode in which
   they can distinguish the relative order of options and other arguments.  */

#include "getopt.h"

/* For communication from `getopt' to the caller.
   When `getopt' finds an option that takes an argument,
   the argument value is returned here.
   Also, when `ordering' is RETURN_IN_ORDER,
   each non-option ARGV-element is returned here.  */

char *optarg = 0;

/* Index in ARGV of the next element to be scanned.
   This is used for communication to and from the caller
   and for communication between successive calls to `getopt'.

   On entry to `getopt', zero means this is the first call; initialize.

   When `getopt' returns EOF, this is the index of the first of the
   non-option elements that the caller should itself scan.

   Otherwise, `optind' communicates from one call to the next
   how much of ARGV has been scanned so far.  */

/* XXX 1003.2 says this must be 1 before any call.  */
int optind = 0;

/* The next char to be scanned in the option-element
   in which the last option character we returned was found.
   This allows us to pick up the scan where we left off.

   If this is zero, or a null string, it means resume the scan
   by advancing to the next ARGV-element.  */

static char *nextchar;

/* Callers store zero here to inhibit the error message
   for unrecognized options.  */

int opterr = 1;

/* Set to an option character which was unrecognized.
   This must be initialized on some systems to avoid linking in the
   system's own getopt implementation.  */

#define BAD_OPTION '\0'
int optopt = BAD_OPTION;

/* Describe how to deal with options that follow non-option ARGV-elements.

   If the caller did not specify anything,
   the default is REQUIRE_ORDER if the environment variable
   POSIXLY_CORRECT is defined, PERMUTE otherwise.

   REQUIRE_ORDER means don't recognize them as options;
   stop option processing when the first non-option is seen.
   This is what Unix does.
   This mode of operation is selected by either setting the environment
   variable POSIXLY_CORRECT, or using `+' as the first character
   of the list of option characters.

   PERMUTE is the default.  We permute the contents of ARGV as we scan,
   so that eventually all the non-options are at the end.  This allows options
   to be given in any order, even with programs that were not written to
   expect this.

   RETURN_IN_ORDER is an option available to programs that were written
   to expect options and other ARGV-elements in any order and that care about
   the ordering of the two.  We describe each non-option ARGV-element
   as if it were the argument of an option with character code 1.
   Using `-' as the first character of the list of option characters
   selects this mode of operation.

   The special argument `--' forces an end of option-scanning regardless
   of the value of `ordering'.  In the case of RETURN_IN_ORDER, only
   `--' can cause `getopt' to return EOF with `optind' != ARGC.  */

static enum
{
  REQUIRE_ORDER, PERMUTE, RETURN_IN_ORDER
} ordering;

#ifdef	__GNU_LIBRARY__
/* We want to avoid inclusion of string.h with non-GNU libraries
   because there are many ways it can cause trouble.
   On some systems, it contains special magic macros that don't work
   in GCC.  */
#include <string.h>
#define	my_index	strchr
#define	my_strlen	strlen
#else

/* Avoid depending on library functions or files
   whose names are inconsistent.  */

#if __STDC__ || defined(PROTO)
extern char *getenv(const char *name);
extern int  strcmp (const char *s1, const char *s2);
extern int  strncmp(const char *s1, const char *s2, int n);

static int my_strlen(const char *s);
static char *my_index (const char *str, int chr);
#else
extern char *getenv ();
#endif

static int
my_strlen (str)
     const char *str;
{
  int n = 0;
  while (*str++)
    n++;
  return n;
}

static char *
my_index (str, chr)
     const char *str;
     int chr;
{
  while (*str)
    {
      if (*str == chr)
	return (char *) str;
      str++;
    }
  return 0;
}

#endif				/* GNU C library.  */

/* Handle permutation of arguments.  */

/* Describe the part of ARGV that contains non-options that have
   been skipped.  `first_nonopt' is the index in ARGV of the first of them;
   `last_nonopt' is the index after the last of them.  */

static int first_nonopt;
static int last_nonopt;

/* Exchange two adjacent subsequences of ARGV.
   One subsequence is elements [first_nonopt,last_nonopt)
   which contains all the non-options that have been skipped so far.
   The other is elements [last_nonopt,optind), which contains all
   the options processed since those non-options were skipped.

   `first_nonopt' and `last_nonopt' are relocated so that they describe
   the new indices of the non-options in ARGV after they are moved.

   To perform the swap, we first reverse the order of all elements. So
   all options now come before all non options, but they are in the
   wrong order. So we put back the options and non options in original
   order by reversing them again. For example:
       original input:      a b c -x -y
       reverse all:         -y -x c b a
       reverse options:     -x -y c b a
       reverse non options: -x -y a b c
*/

#if __STDC__ || defined(PROTO)
static void exchange (char **argv);
#endif

static void
exchange (argv)
     char **argv;
{
  char *temp, **first, **last;

  /* Reverse all the elements [first_nonopt, optind) */
  first = &argv[first_nonopt];
  last  = &argv[optind-1];
  while (first < last) {
    temp = *first; *first = *last; *last = temp; first++; last--;
  }
  /* Put back the options in order */
  first = &argv[first_nonopt];
  first_nonopt += (optind - last_nonopt);
  last  = &argv[first_nonopt - 1];
  while (first < last) {
    temp = *first; *first = *last; *last = temp; first++; last--;
  }

  /* Put back the non options in order */
  first = &argv[first_nonopt];
  last_nonopt = optind;
  last  = &argv[last_nonopt-1];
  while (first < last) {
    temp = *first; *first = *last; *last = temp; first++; last--;
  }
}

/* Scan elements of ARGV (whose length is ARGC) for option characters
   given in OPTSTRING.

   If an element of ARGV starts with '-', and is not exactly "-" or "--",
   then it is an option element.  The characters of this element
   (aside from the initial '-') are option characters.  If `getopt'
   is called repeatedly, it returns successively each of the option characters
   from each of the option elements.

   If `getopt' finds another option character, it returns that character,
   updating `optind' and `nextchar' so that the next call to `getopt' can
   resume the scan with the following option character or ARGV-element.

   If there are no more option characters, `getopt' returns `EOF'.
   Then `optind' is the index in ARGV of the first ARGV-element
   that is not an option.  (The ARGV-elements have been permuted
   so that those that are not options now come last.)

   OPTSTRING is a string containing the legitimate option characters.
   If an option character is seen that is not listed in OPTSTRING,
   return BAD_OPTION after printing an error message.  If you set `opterr' to
   zero, the error message is suppressed but we still return BAD_OPTION.

   If a char in OPTSTRING is followed by a colon, that means it wants an arg,
   so the following text in the same ARGV-element, or the text of the following
   ARGV-element, is returned in `optarg'.  Two colons mean an option that
   wants an optional arg; if there is text in the current ARGV-element,
   it is returned in `optarg', otherwise `optarg' is set to zero.

   If OPTSTRING starts with `-' or `+', it requests different methods of
   handling the non-option ARGV-elements.
   See the comments about RETURN_IN_ORDER and REQUIRE_ORDER, above.

   Long-named options begin with `--' instead of `-'.
   Their names may be abbreviated as long as the abbreviation is unique
   or is an exact match for some defined option.  If they have an
   argument, it follows the option name in the same ARGV-element, separated
   from the option name by a `=', or else the in next ARGV-element.
   When `getopt' finds a long-named option, it returns 0 if that option's
   `flag' field is nonzero, the value of the option's `val' field
   if the `flag' field is zero.

   The elements of ARGV aren't really const, because we permute them.
   But we pretend they're const in the prototype to be compatible
   with other systems.

   LONGOPTS is a vector of `struct option' terminated by an
   element containing a name which is zero.

   LONGIND returns the index in LONGOPT of the long-named option found.
   It is only valid when a long-named option has been found by the most
   recent call.

   If LONG_ONLY is nonzero, '-' as well as '--' can introduce
   long-named options.  */

int
_getopt_internal (argc, argv, optstring, longopts, longind, long_only)
     int argc;
     char *const *argv;
     const char *optstring;
     const struct option *longopts;
     int *longind;
     int long_only;
{
  int option_index;

  optarg = 0;

  /* Initialize the internal data when the first call is made.
     Start processing options with ARGV-element 1 (since ARGV-element 0
     is the program name); the sequence of previously skipped
     non-option ARGV-elements is empty.  */

  if (optind == 0)
    {
      first_nonopt = last_nonopt = optind = 1;

      nextchar = NULL;

      /* Determine how to handle the ordering of options and nonoptions.  */

      if (optstring[0] == '-')
	{
	  ordering = RETURN_IN_ORDER;
	  ++optstring;
	}
      else if (optstring[0] == '+')
	{
	  ordering = REQUIRE_ORDER;
	  ++optstring;
	}
      else if (getenv ("POSIXLY_CORRECT") != NULL)
	ordering = REQUIRE_ORDER;
      else
	ordering = PERMUTE;
    }

  if (nextchar == NULL || *nextchar == '\0')
    {
      if (ordering == PERMUTE)
	{
	  /* If we have just processed some options following some non-options,
	     exchange them so that the options come first.  */

	  if (first_nonopt != last_nonopt && last_nonopt != optind)
	    exchange ((char **) argv);
	  else if (last_nonopt != optind)
	    first_nonopt = optind;

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
久久人人97超碰com| 26uuu久久天堂性欧美| 国产91高潮流白浆在线麻豆| 久久精品国产99国产| 蜜臀a∨国产成人精品| 久久国产夜色精品鲁鲁99| 久久精品国产久精国产| 国产资源在线一区| 成人午夜激情在线| jizz一区二区| 欧美日韩综合不卡| 日韩一区二区在线免费观看| 精品免费一区二区三区| 久久综合久久综合久久| 国产精品传媒视频| 亚洲国产你懂的| 美腿丝袜亚洲色图| 国产成人av电影免费在线观看| 成人爱爱电影网址| 欧美日韩专区在线| 国产清纯美女被跳蛋高潮一区二区久久w | 亚洲日本青草视频在线怡红院| 亚洲免费观看视频| 蜜臀av国产精品久久久久| 国产剧情一区在线| 色一情一伦一子一伦一区| 日韩一区二区电影| 国产精品乱码一区二三区小蝌蚪| 一区二区三区国产豹纹内裤在线| 日韩精品一级中文字幕精品视频免费观看| 久久国内精品自在自线400部| 成人福利电影精品一区二区在线观看| 色哦色哦哦色天天综合| 日韩一区二区电影在线| 亚洲色欲色欲www| 日本麻豆一区二区三区视频| 粉嫩av一区二区三区粉嫩| 在线影视一区二区三区| 欧美mv日韩mv亚洲| 亚洲第一会所有码转帖| 成人看片黄a免费看在线| 91精品国模一区二区三区| 亚洲欧洲精品一区二区精品久久久| 奇米一区二区三区av| 色视频欧美一区二区三区| 久久这里只有精品视频网| 亚洲sss视频在线视频| eeuss鲁一区二区三区| 欧美tickle裸体挠脚心vk| 婷婷六月综合网| 一本大道久久a久久综合婷婷| 国产欧美日韩综合| 久久国产精品第一页| 欧美高清激情brazzers| 亚洲欧美色综合| 不卡视频免费播放| 欧美激情一区二区| 国产大陆精品国产| 久久精品一级爱片| 国产米奇在线777精品观看| 日韩欧美你懂的| 日韩av中文字幕一区二区 | 视频一区在线播放| 在线观看www91| 亚洲欧美另类小说| 99re这里都是精品| 亚洲另类在线视频| 91丨九色丨蝌蚪富婆spa| 中文字幕在线观看不卡| 成人一区二区三区| 亚洲色图20p| 色综合视频在线观看| 国产精品久久久久永久免费观看| 粉嫩嫩av羞羞动漫久久久| 国产欧美一区二区三区沐欲| 狠狠色丁香久久婷婷综合_中| 日韩限制级电影在线观看| 裸体一区二区三区| 精品福利视频一区二区三区| 久色婷婷小香蕉久久| 久久综合久久综合久久综合| 国产白丝精品91爽爽久久| 一区二区中文视频| 欧美性受极品xxxx喷水| 秋霞av亚洲一区二区三| 欧美mv和日韩mv的网站| 国产激情视频一区二区三区欧美 | 亚洲成人三级小说| 欧美一区二区三区在线电影| 裸体在线国模精品偷拍| 久久久精品人体av艺术| 99re视频精品| 亚洲国产日韩a在线播放性色| 日韩免费观看高清完整版| 精品一区二区三区日韩| 国产精品久久久久久久午夜片| 97se亚洲国产综合自在线观| 午夜精品一区二区三区三上悠亚| 日韩欧美成人激情| av动漫一区二区| 日韩国产在线观看一区| 中文字幕精品三区| 欧美丰满少妇xxxxx高潮对白| 国产呦精品一区二区三区网站| 1024国产精品| 日韩精品一区二区三区swag| 成人av电影在线播放| 青青草国产精品97视觉盛宴| 国产精品免费丝袜| 日韩午夜在线观看视频| 91在线观看高清| 激情六月婷婷久久| 亚洲国产精品一区二区久久恐怖片| 久久久另类综合| 欧美精品一卡二卡| 99re亚洲国产精品| 激情丁香综合五月| 日本中文字幕一区| 最新不卡av在线| 国产婷婷一区二区| 日韩欧美国产精品一区| 91久久精品一区二区| 国产成人三级在线观看| 美女网站在线免费欧美精品| 亚洲男人的天堂一区二区| 亚洲国产精华液网站w| 日韩午夜中文字幕| 欧美日韩激情一区二区三区| 色域天天综合网| 成人性生交大合| 国产老女人精品毛片久久| 美女性感视频久久| 日一区二区三区| 亚洲国产成人av| 亚洲精品videosex极品| 国产精品人妖ts系列视频| 精品捆绑美女sm三区| 日韩欧美色综合网站| 日韩欧美一级精品久久| 91精品国产黑色紧身裤美女| 欧美日韩精品电影| 欧美日韩一区小说| 欧美男人的天堂一二区| 欧美日韩国产电影| 欧美一区二区三区在| 91精品啪在线观看国产60岁| 欧美精三区欧美精三区| 欧美美女一区二区三区| 91麻豆精品国产| 91精品在线免费观看| 欧美一级精品大片| 亚洲精品一区二区三区在线观看 | 蜜桃视频第一区免费观看| 午夜精品影院在线观看| 日韩电影在线观看网站| 麻豆精品在线看| 国产福利一区二区三区视频| 波多野结衣91| 色久优优欧美色久优优| 欧美性大战久久| 91精品在线观看入口| 26uuu国产在线精品一区二区| 久久综合九色综合97婷婷| 久久久精品2019中文字幕之3| 日本一区二区久久| 亚洲精品国产精品乱码不99| 一区二区视频在线| 日韩二区在线观看| 国模少妇一区二区三区| 99国产精品国产精品久久| 欧美日本在线一区| 久久久久久久网| 亚洲中国最大av网站| 蜜臀精品久久久久久蜜臀 | 奇米精品一区二区三区在线观看一 | 日韩一区二区在线看片| 2020国产精品| 亚洲免费看黄网站| 美国精品在线观看| 成人av片在线观看| 欧美日韩成人在线| 中文欧美字幕免费| 亚洲va国产va欧美va观看| 国产高清在线精品| 欧美综合色免费| 国产日产精品1区| 午夜成人在线视频| www.日本不卡| 日韩午夜在线观看| 亚洲综合在线观看视频| 国产伦精品一区二区三区免费| 91成人免费在线| 国产日韩av一区二区| 午夜视频在线观看一区| 成人天堂资源www在线| 日韩亚洲欧美中文三级| 亚洲精品成人少妇| 丁香婷婷综合网| 日韩一区二区电影| 亚洲高清一区二区三区|