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

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

?? fnmatch.c

?? UNIX下SH的實現源碼
?? C
?? 第 1 頁 / 共 2 頁
字號:
	      goto matched;
	    }
	  else
	    {
	      c = *p++;
	      if (c == '\0')
		return ((test == '[') ? savep : (char *)0); /*]*/
	      c = FOLD (c);
	      continue;
	    }
        }

      /* POSIX.2 character class expression.  See POSIX.2 2.8.3.2. */
      if (c == '[' && *p == ':')
	{
	  pc = 0;	/* make sure invalid char classes don't match. */
	  if (STREQN (p+1, "alnum:]", 7))
	    { pc = isalnum (test); p += 8; }
	  else if (STREQN (p+1, "alpha:]", 7))
	    { pc = isalpha (test); p += 8; }
	  else if (STREQN (p+1, "blank:]", 7))
	    { pc = isblank (test); p += 8; }
	  else if (STREQN (p+1, "cntrl:]", 7))
	    { pc = iscntrl (test); p += 8; }
	  else if (STREQN (p+1, "digit:]", 7))
	    { pc = isdigit (test); p += 8; }
	  else if (STREQN (p+1, "graph:]", 7))
	    { pc = isgraph (test); p += 8; }
	  else if (STREQN (p+1, "lower:]", 7))
	    { pc = islower (test); p += 8; }
	  else if (STREQN (p+1, "print:]", 7))
	    { pc = isprint (test); p += 8; }
	  else if (STREQN (p+1, "punct:]", 7))
	    { pc = ispunct (test); p += 8; }
	  else if (STREQN (p+1, "space:]", 7))
	    { pc = isspace (test); p += 8; }
	  else if (STREQN (p+1, "upper:]", 7))
	    { pc = isupper (test); p += 8; }
	  else if (STREQN (p+1, "xdigit:]", 8))
	    { pc = isxdigit (test); p += 9; }
	  else if (STREQN (p+1, "ascii:]", 7))
	    { pc = isascii (test); p += 8; }
	  if (pc)
	    {
/*[*/	      /* Move past the closing `]', since the first thing we do at
	         the `matched:' label is back p up one. */
	      p++;
	      goto matched;
	    }
	  else
	    {
	      /* continue the loop here, since this expression can't be
		 the first part of a range expression. */
	      c = *p++;
	      if (c == '\0')
		return ((test == '[') ? savep : (char *)0);
	      else if (c == ']')
	        break;
	      c = FOLD (c);
	      continue;
	    }
	}
 
      /* POSIX.2 collating symbols.  See POSIX.2 2.8.3.2.  Find the end of
	 the symbol name, make sure it is terminated by `.]', translate
	 the name to a character using the external table, and do the
	 comparison. */
      if (c == '[' && *p == '.')
	{
	  p = parse_collsym (p, &pc);
	  /* An invalid collating symbol cannot be the first point of a
	     range.  If it is, we set cstart to one greater than `test',
	     so any comparisons later will fail. */
	  cstart = (pc == -1) ? test + 1 : pc;
	}

      if (!(flags & FNM_NOESCAPE) && c == '\\')
	{
	  if (*p == '\0')
	    return (char *)0;
	  cstart = cend = *p++;
	}

      cstart = cend = FOLD (cstart);

      /* POSIX.2 2.8.3.1.2 says: `An expression containing a `[' that
	 is not preceded by a backslash and is not part of a bracket
	 expression produces undefined results.'  This implementation
	 treats the `[' as just a character to be matched if there is
	 not a closing `]'. */
      if (c == '\0')
	return ((test == '[') ? savep : (char *)0);

      c = *p++;
      c = FOLD (c);

      if ((flags & FNM_PATHNAME) && c == '/')
	/* [/] can never match when matching a pathname.  */
	return (char *)0;

      /* This introduces a range, unless the `-' is the last
	 character of the class.  Find the end of the range
	 and move past it. */
      if (c == '-' && *p != ']')
	{
	  cend = *p++;
	  if (!(flags & FNM_NOESCAPE) && cend == '\\')
	    cend = *p++;
	  if (cend == '\0')
	    return (char *)0;
	  if (cend == '[' && *p == '.')
	    {
	      p = parse_collsym (p, &pc);
	      /* An invalid collating symbol cannot be the second part of a
		 range expression.  If we get one, we set cend to one fewer
		 than the test character to make sure the range test fails. */
	      cend = (pc == -1) ? test - 1 : pc;
	    }
	  cend = FOLD (cend);

	  c = *p++;

	  /* POSIX.2 2.8.3.2:  ``The ending range point shall collate
	     equal to or higher than the starting range point; otherwise
	     the expression shall be treated as invalid.''  Note that this
	     applies to only the range expression; the rest of the bracket
	     expression is still checked for matches. */
	  if (rangecmp (cstart, cend) > 0)
	    {
	      if (c == ']')
	        break;
	      c = FOLD (c);
	      continue;
	    }
	}

      if (rangecmp (test, cstart) >= 0 && rangecmp (test, cend) <= 0)
	goto matched;

      if (c == ']')
	break;
    }
  /* No match. */
  return (!not ? (char *)0 : p);

matched:
  /* Skip the rest of the [...] that already matched.  */
#if 0
#if 0
  brcnt = (c != ']') + (c == '[' && (*p == '=' || *p == ':' || *p == '.'));
#else
  c = *--p;
  brcnt = 1;
#endif
#else
  c = *--p;
  brcnt = 1;
#endif
  while (brcnt > 0)
    {
      /* A `[' without a matching `]' is just another character to match. */
      if (c == '\0')
	return ((test == '[') ? savep : (char *)0);

      c = *p++;
      if (c == '[' && (*p == '=' || *p == ':' || *p == '.'))
        brcnt++;
      else if (c == ']')
        brcnt--;
      else if (!(flags & FNM_NOESCAPE) && c == '\\')
	{
	  if (*p == '\0')
	    return (char *)0;
	  /* XXX 1003.2d11 is unclear if this is right. */
	  ++p;
	}
    }
  return (not ? (char *)0 : p);
}

#if defined (EXTENDED_GLOB)
/* ksh-like extended pattern matching:

	[?*+@!](pat-list)

   where pat-list is a list of one or patterns separated by `|'.  Operation
   is as follows:

	?(patlist)	match zero or one of the given patterns
	*(patlist)	match zero or more of the given patterns
	+(patlist)	match one or more of the given patterns
	@(patlist)	match exactly one of the given patterns
	!(patlist)	match anything except one of the given patterns
*/

/* Scan a pattern starting at STRING and ending at END, keeping track of
   embedded () and [].  If DELIM is 0, we scan until a matching `)'
   because we're scanning a `patlist'.  Otherwise, we scan until we see
   DELIM.  In all cases, we never scan past END.  The return value is the
   first character after the matching DELIM. */
static char *
patscan (string, end, delim)
     char *string, *end;
     int delim;
{
  int pnest, bnest;
  char *s, c;

  pnest = bnest = 0;
  for (s = string; c = *s; s++)
    {
      if (s >= end)
        return (s);
      switch (c)
	{
	case '\0':
	  return ((char *)0);
	case '[':
	  bnest++;
	  break;
	case ']':
	  if (bnest)
	    bnest--;
	  break;
	case '(':
	  if (bnest == 0)
	    pnest++;
	  break;
	case ')':
#if 0
	  if (bnest == 0)
	    pnest--;
	  if (pnest <= 0)
	    return ++s;
#else
	  if (bnest == 0 && pnest-- <= 0)
	    return ++s;
#endif
	  break;
	case '|':
	  if (bnest == 0 && pnest == 0 && delim == '|')
	    return ++s;
	  break;
	}
    }

  return (char *)0;
}

/* Return 0 if dequoted pattern matches S in the current locale. */
static int
strcompare (p, pe, s, se)
     char *p, *pe, *s, *se;
{
  int ret;
  char c1, c2;

  c1 = *pe;
  c2 = *se;

  *pe = *se = '\0';
#if defined (HAVE_STRCOLL)
  ret = strcoll (p, s);
#else
  ret = strcmp (p, s);
#endif

  *pe = c1;
  *se = c2;

  return (ret == 0 ? ret : FNM_NOMATCH);
}

/* Match a ksh extended pattern specifier.  Return FNM_NOMATCH on failure or
   0 on success.  This is handed the entire rest of the pattern and string
   the first time an extended pattern specifier is encountered, so it calls
   gmatch recursively. */
static int
extmatch (xc, s, se, p, pe, flags)
     int xc;		/* select which operation */
     char *s, *se;
     char *p, *pe;
     int flags;
{
  char *prest;			/* pointer to rest of pattern */
  char *psub;			/* pointer to sub-pattern */
  char *pnext;			/* pointer to next sub-pattern */
  char *srest;			/* pointer to rest of string */
  int m1, m2;

#if 0
fprintf(stderr, "extmatch: xc = %c\n", xc);
fprintf(stderr, "extmatch: s = %s; se = %s\n", s, se);
fprintf(stderr, "extmatch: p = %s; pe = %s\n", p, pe);
#endif

  prest = patscan (p + (*p == '('), pe, 0); /* ) */
  if (prest == 0)
    /* If PREST is 0, we failed to scan a valid pattern.  In this
       case, we just want to compare the two as strings. */
    return (strcompare (p - 1, pe, s, se));

  switch (xc)
    {
    case '+':			/* match one or more occurrences */
    case '*':			/* match zero or more occurrences */
      /* If we can get away with no matches, don't even bother.  Just
	 call gmatch on the rest of the pattern and return success if
	 it succeeds. */
      if (xc == '*' && (gmatch (s, se, prest, pe, flags) == 0))
	return 0;

      /* OK, we have to do this the hard way.  First, we make sure one of
         the subpatterns matches, then we try to match the rest of the
         string. */
      for (psub = p + 1; ; psub = pnext)
	{
	  pnext = patscan (psub, pe, '|');
	  for (srest = s; srest <= se; srest++)
	    {
	      /* Match this substring (S -> SREST) against this
		 subpattern (psub -> pnext - 1) */
	      m1 = gmatch (s, srest, psub, pnext - 1, flags) == 0;
	      /* OK, we matched a subpattern, so make sure the rest of the
		 string matches the rest of the pattern.  Also handle
		 multiple matches of the pattern. */
	      if (m1)
		m2 = (gmatch (srest, se, prest, pe, flags) == 0) ||
		      (s != srest && gmatch (srest, se, p - 1, pe, flags) == 0);
	      if (m1 && m2)
	        return (0);
	    }
	  if (pnext == prest)
	    break;
	}
      return (FNM_NOMATCH);

    case '?':		/* match zero or one of the patterns */
    case '@':		/* match exactly one of the patterns */
      /* If we can get away with no matches, don't even bother.  Just
	 call gmatch on the rest of the pattern and return success if
	 it succeeds. */
      if (xc == '?' && (gmatch (s, se, prest, pe, flags) == 0))
	return 0;

      /* OK, we have to do this the hard way.  First, we see if one of
	 the subpatterns matches, then, if it does, we try to match the
	 rest of the string. */
      for (psub = p + 1; ; psub = pnext)
	{
	  pnext = patscan (psub, pe, '|');
	  srest = (prest == pe) ? se : s;
	  for ( ; srest <= se; srest++)
	    {
	      if (gmatch (s, srest, psub, pnext - 1, flags) == 0 &&
		  gmatch (srest, se, prest, pe, flags) == 0)
		return (0);
	    }
	  if (pnext == prest)
	    break;
	}
      return (FNM_NOMATCH);

    case '!':		/* match anything *except* one of the patterns */
      for (srest = s; srest <= se; srest++)
	{
	  m1 = 0;
	  for (psub = p + 1; ; psub = pnext)
	    {
	      pnext = patscan (psub, pe, '|');
	      /* If one of the patterns matches, just bail immediately. */
	      if (m1 = (gmatch (s, srest, psub, pnext - 1, flags) == 0))
		break;
	      if (pnext == prest)
		break;
	    }
	  if (m1 == 0 && gmatch (srest, se, prest, pe, flags) == 0)
	    return (0);	
	}
      return (FNM_NOMATCH);
    }

  return (FNM_NOMATCH);
}
#endif /* EXTENDED_GLOB */

#ifdef TEST
main (c, v)
     int c;
     char **v;
{
  char *string, *pat;

  string = v[1];
  pat = v[2];

  if (fnmatch (pat, string, 0) == 0)
    {
      printf ("%s matches %s\n", string, pat);
      exit (0);
    }
  else
    {
      printf ("%s does not match %s\n", string, pat);
      exit (1);
    }
}
#endif

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
国产999精品久久| 视频在线观看一区| 成人精品视频一区二区三区| 精品国产乱码久久久久久久| 美女一区二区视频| 日韩欧美国产系列| 国产福利一区二区三区视频在线| 欧美成人video| 丁香五精品蜜臀久久久久99网站| 国产精品视频一二| 91官网在线观看| 日韩av不卡一区二区| 欧美大片拔萝卜| 成人午夜激情片| 亚洲午夜精品网| 精品久久久久久久久久久久久久久久久| 韩国精品主播一区二区在线观看| 国产嫩草影院久久久久| 91国在线观看| 免费成人美女在线观看.| 久久嫩草精品久久久久| 99久久综合精品| 日韩国产欧美在线播放| 亚洲成人1区2区| 精品日韩一区二区| 91在线免费播放| 精品一区二区三区免费毛片爱| 欧美国产视频在线| 777奇米四色成人影色区| 国产成人免费视频网站| 亚洲国产精品久久久久婷婷884 | 国产69精品久久99不卡| 亚洲激情在线激情| 欧美精品一区二区久久婷婷| 91猫先生在线| 激情综合色综合久久| 1区2区3区国产精品| 91精品国产色综合久久久蜜香臀| 国产成人精品免费视频网站| 亚洲在线观看免费| 国产精品全国免费观看高清| 日韩视频123| 色综合天天做天天爱| 国产精品一区专区| 图片区小说区区亚洲影院| 中文字幕av一区二区三区| 欧美精品第一页| 97se狠狠狠综合亚洲狠狠| 九九精品一区二区| 午夜电影网一区| **欧美大码日韩| 久久久青草青青国产亚洲免观| 欧美视频一二三区| 成人av资源下载| 国产在线精品一区二区不卡了| 亚洲国产色一区| 中文字幕一区二区三区不卡| 欧美电影免费观看高清完整版在| 欧美三级资源在线| 色老汉av一区二区三区| 国产99精品国产| 国产盗摄一区二区| 极品少妇一区二区| 欧美视频中文字幕| 91色porny在线视频| 国产99久久久精品| 国产91丝袜在线18| 国产一区二区三区国产| 免费高清在线视频一区·| 亚洲国产精品久久久久秋霞影院| 亚洲精品一二三区| 亚洲欧美一区二区三区极速播放 | 日本一区二区在线不卡| 欧美v日韩v国产v| 日韩三级在线免费观看| 欧美色综合影院| 欧美日韩在线播| 欧美无人高清视频在线观看| 欧洲一区二区三区在线| 99久久精品国产麻豆演员表| av男人天堂一区| 99久久久久免费精品国产| 97久久超碰精品国产| 99国内精品久久| 波多野结衣在线一区| 播五月开心婷婷综合| av午夜一区麻豆| 91在线你懂得| 欧美另类高清zo欧美| 91精品国产综合久久福利| 制服丝袜亚洲网站| 精品久久久网站| 国产精品免费视频网站| 国产精品国产三级国产aⅴ入口 | 久久se精品一区二区| 久久精品999| 成人精品视频.| 波多野结衣在线一区| 91免费看视频| 欧美日韩国产免费| 久久一区二区三区四区| 中文字幕一区二区三区视频| 亚洲一区二区在线播放相泽 | 国产成人精品三级麻豆| 美女看a上一区| 亚洲区小说区图片区qvod| 91视频观看免费| 国产精品二三区| 欧美xxxxxxxx| 中文字幕va一区二区三区| 亚洲精品亚洲人成人网| 无码av中文一区二区三区桃花岛| 美国一区二区三区在线播放| 国产综合久久久久影院| 99热这里都是精品| 欧美日韩一区二区在线视频| 亚洲精品一区二区三区在线观看| 国产日韩欧美精品一区| 欧美激情中文不卡| 亚洲mv大片欧洲mv大片精品| 国产美女av一区二区三区| 色综合中文字幕国产| 欧美日韩国产中文| 久久久精品2019中文字幕之3| 亚洲激情自拍偷拍| 精品在线观看视频| 欧洲精品中文字幕| 久久奇米777| 亚洲成av人片www| 顶级嫩模精品视频在线看| 欧美日本一区二区在线观看| 精品国产一二三| 亚洲午夜久久久久久久久电影院| 欧美日韩欧美一区二区| 国产精品三级视频| 天堂va蜜桃一区二区三区漫画版| 波多野结衣在线一区| 精品国产一区二区三区av性色| 亚洲国产一区视频| 9色porny自拍视频一区二区| 日韩免费看的电影| 午夜精品久久久久久| 99精品国产91久久久久久| 欧美精品一区二区三区一线天视频 | 午夜精品久久久| 成人精品gif动图一区| 欧美一级理论片| 午夜天堂影视香蕉久久| 91小视频免费观看| 欧美国产禁国产网站cc| 国内精品免费**视频| 欧美高清一级片在线| 一区二区日韩av| 色偷偷一区二区三区| 欧美激情综合在线| 国产成人丝袜美腿| 欧美第一区第二区| 日韩精品一卡二卡三卡四卡无卡| 91高清视频在线| 亚洲另类中文字| 91无套直看片红桃| 亚洲日本中文字幕区| 99re66热这里只有精品3直播| 国产欧美精品区一区二区三区| 久久66热re国产| 26uuu欧美| 国产永久精品大片wwwapp| 日韩视频永久免费| 麻豆精品视频在线观看| www久久精品| 另类调教123区 | 一区二区三区不卡视频| 99国产精品久久| 亚洲精品乱码久久久久久久久| 99久久99久久久精品齐齐| 亚洲男同1069视频| 91激情五月电影| 肉肉av福利一精品导航| 欧美一区二区久久久| 精品一区二区三区视频| 日本aⅴ亚洲精品中文乱码| 欧美精品在欧美一区二区少妇| 五月婷婷欧美视频| 日韩一二三区不卡| 久久69国产一区二区蜜臀| 久久精品一区二区三区四区| 国产成人久久精品77777最新版本| 国产精品三级电影| 色噜噜夜夜夜综合网| 日日噜噜夜夜狠狠视频欧美人| 7777精品久久久大香线蕉| 久久99精品国产麻豆婷婷| 国产午夜亚洲精品不卡| 成人中文字幕电影| 亚洲精品中文字幕在线观看| 欧美人体做爰大胆视频| 国产一区二区三区黄视频| 国产精品久久网站| 在线一区二区视频| 免费观看日韩电影|