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

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

?? tr.c

?? linux開發技術詳解一書的源碼
?? C
?? 第 1 頁 / 共 4 頁
字號:
			  if (star_digits_closebracket (es, i + 2))
			    {
			      free (opnd_str);
			      goto try_bracketed_repeat;
			    }
			  else
			    {
			      char *tmp = make_printable_str (opnd_str,
							      opnd_str_len);
			      error (0, 0, _("invalid character class `%s'"),
				     tmp);
			      free (tmp);
			      return 1;
			    }
			}
		    }
		  else
		    {
		      parse_failed = append_equiv_class (result, opnd_str,
							 opnd_str_len);

		      /* FIXME: big comment.  */
		      if (parse_failed)
			{
			  if (star_digits_closebracket (es, i + 2))
			    {
			      free (opnd_str);
			      goto try_bracketed_repeat;
			    }
			  else
			    {
			      char *tmp = make_printable_str (opnd_str,
							      opnd_str_len);
			      error (0, 0,
	       _("%s: equivalence class operand must be a single character"),
				     tmp);
			      free (tmp);
			      return 1;
			    }
			}
		    }
		  free (opnd_str);

		  /* Return nonzero if append_*_class reports a problem.  */
		  if (parse_failed)
		    return 1;
		  else
		    i = closing_delim_idx + 2;
		  continue;
		}
	      /* Else fall through.  This could be [:*] or [=*].  */
	    }

	try_bracketed_repeat:

	  /* Determine whether this is a bracketed repeat range
	     matching the RE \[.\*(dec_or_oct_number)?\].  */
	  err = find_bracketed_repeat (es, i + 1, &char_to_repeat,
				       &repeat_count,
				       &closing_bracket_idx);
	  if (err == 0)
	    {
	      append_repeated_char (result, char_to_repeat, repeat_count);
	      i = closing_bracket_idx + 1;
	    }
	  else if (err == -1)
	    {
	      matched_multi_char_construct = 0;
	    }
	  else
	    {
	      /* Found a string that looked like [c*n] but the
		 numeric part was invalid.  */
	      return 1;
	    }

	  if (matched_multi_char_construct)
	    continue;

	  /* We reach this point if P does not match [:str:], [=c=],
	     [c*n], or [c*].  Now, see if P looks like a range `[-c'
	     (from `[' to `c').  */
	}

      /* Look ahead one char for ranges like a-z.  */
      if (ES_MATCH (es, i + 1, '-'))
	{
	  if (append_range (result, p[i], p[i + 2]))
	    return 1;
	  i += 3;
	}
      else
	{
	  append_normal_char (result, p[i]);
	  ++i;
	}
    }

  /* Now handle the (2 or fewer) remaining characters p[i]..p[es->len - 1].  */
  for (; i < es->len; i++)
    append_normal_char (result, p[i]);

  return 0;
}

/* Given a Spec_list S (with its saved state implicit in the values
   of its members `tail' and `state'), return the next single character
   in the expansion of S's constructs.  If the last character of S was
   returned on the previous call or if S was empty, this function
   returns -1.  For example, successive calls to get_next where S
   represents the spec-string 'a-d[y*3]' will return the sequence
   of values a, b, c, d, y, y, y, -1.  Finally, if the construct from
   which the returned character comes is [:upper:] or [:lower:], the
   parameter CLASS is given a value to indicate which it was.  Otherwise
   CLASS is set to UL_NONE.  This value is used only when constructing
   the translation table to verify that any occurrences of upper and
   lower class constructs in the spec-strings appear in the same relative
   positions.  */

static int
get_next (struct Spec_list *s, enum Upper_Lower_class *class)
{
  struct List_element *p;
  int return_val;
  int i;

  if (class)
    *class = UL_NONE;

  if (s->state == BEGIN_STATE)
    {
      s->tail = s->head->next;
      s->state = NEW_ELEMENT;
    }

  p = s->tail;
  if (p == NULL)
    return -1;

  switch (p->type)
    {
    case RE_NORMAL_CHAR:
      return_val = p->u.normal_char;
      s->state = NEW_ELEMENT;
      s->tail = p->next;
      break;

    case RE_RANGE:
      if (s->state == NEW_ELEMENT)
	s->state = ORD (p->u.range.first_char);
      else
	++(s->state);
      return_val = CHR (s->state);
      if (s->state == ORD (p->u.range.last_char))
	{
	  s->tail = p->next;
	  s->state = NEW_ELEMENT;
	}
      break;

    case RE_CHAR_CLASS:
      if (class)
	{
	  int upper_or_lower;
	  switch (p->u.char_class)
	    {
	    case CC_LOWER:
	      *class = UL_LOWER;
	      upper_or_lower = 1;
	      break;
	    case CC_UPPER:
	      *class = UL_UPPER;
	      upper_or_lower = 1;
	      break;
	    default:
	      upper_or_lower = 0;
	      break;
	    }

	  if (upper_or_lower)
	    {
	      s->tail = p->next;
	      s->state = NEW_ELEMENT;
	      return_val = 0;
	      break;
	    }
	}

      if (s->state == NEW_ELEMENT)
	{
	  for (i = 0; i < N_CHARS; i++)
	    if (is_char_class_member (p->u.char_class, i))
	      break;
	  assert (i < N_CHARS);
	  s->state = i;
	}
      assert (is_char_class_member (p->u.char_class, s->state));
      return_val = CHR (s->state);
      for (i = s->state + 1; i < N_CHARS; i++)
	if (is_char_class_member (p->u.char_class, i))
	  break;
      if (i < N_CHARS)
	s->state = i;
      else
	{
	  s->tail = p->next;
	  s->state = NEW_ELEMENT;
	}
      break;

    case RE_EQUIV_CLASS:
      /* FIXME: this assumes that each character is alone in its own
         equivalence class (which appears to be correct for my
         LC_COLLATE.  But I don't know of any function that allows
         one to determine a character's equivalence class.  */

      return_val = p->u.equiv_code;
      s->state = NEW_ELEMENT;
      s->tail = p->next;
      break;

    case RE_REPEATED_CHAR:
      /* Here, a repeat count of n == 0 means don't repeat at all.  */
      if (p->u.repeated_char.repeat_count == 0)
	{
	  s->tail = p->next;
	  s->state = NEW_ELEMENT;
	  return_val = get_next (s, class);
	}
      else
	{
	  if (s->state == NEW_ELEMENT)
	    {
	      s->state = 0;
	    }
	  ++(s->state);
	  return_val = p->u.repeated_char.the_repeated_char;
	  if (p->u.repeated_char.repeat_count > 0
	      && s->state == p->u.repeated_char.repeat_count)
	    {
	      s->tail = p->next;
	      s->state = NEW_ELEMENT;
	    }
	}
      break;

    case RE_NO_TYPE:
      abort ();
      break;

    default:
      abort ();
      break;
    }

  return return_val;
}

/* This is a minor kludge.  This function is called from
   get_spec_stats to determine the cardinality of a set derived
   from a complemented string.  It's a kludge in that some of the
   same operations are (duplicated) performed in set_initialize.  */

static int
card_of_complement (struct Spec_list *s)
{
  int c;
  int cardinality = N_CHARS;
  SET_TYPE in_set[N_CHARS];

  memset (in_set, 0, N_CHARS * sizeof (in_set[0]));
  s->state = BEGIN_STATE;
  while ((c = get_next (s, NULL)) != -1)
    if (!in_set[c]++)
      --cardinality;
  return cardinality;
}

/* Gather statistics about the spec-list S in preparation for the tests
   in validate that determine the consistency of the specs.  This function
   is called at most twice; once for string1, and again for any string2.
   LEN_S1 < 0 indicates that this is the first call and that S represents
   string1.  When LEN_S1 >= 0, it is the length of the expansion of the
   constructs in string1, and we can use its value to resolve any
   indefinite repeat construct in S (which represents string2).  Hence,
   this function has the side-effect that it converts a valid [c*]
   construct in string2 to [c*n] where n is large enough (or 0) to give
   string2 the same length as string1.  For example, with the command
   tr a-z 'A[\n*]Z' on the second call to get_spec_stats, LEN_S1 would
   be 26 and S (representing string2) would be converted to 'A[\n*24]Z'.  */

static void
get_spec_stats (struct Spec_list *s)
{
  struct List_element *p;
  int len = 0;

  s->n_indefinite_repeats = 0;
  s->has_equiv_class = 0;
  s->has_restricted_char_class = 0;
  s->has_char_class = 0;
  for (p = s->head->next; p; p = p->next)
    {
      switch (p->type)
	{
	  int i;
	case RE_NORMAL_CHAR:
	  ++len;
	  break;

	case RE_RANGE:
	  assert (p->u.range.last_char >= p->u.range.first_char);
	  len += p->u.range.last_char - p->u.range.first_char + 1;
	  break;

	case RE_CHAR_CLASS:
	  s->has_char_class = 1;
	  for (i = 0; i < N_CHARS; i++)
	    if (is_char_class_member (p->u.char_class, i))
	      ++len;
	  switch (p->u.char_class)
	    {
	    case CC_UPPER:
	    case CC_LOWER:
	      break;
	    default:
	      s->has_restricted_char_class = 1;
	      break;
	    }
	  break;

	case RE_EQUIV_CLASS:
	  for (i = 0; i < N_CHARS; i++)
	    if (is_equiv_class_member (p->u.equiv_code, i))
	      ++len;
	  s->has_equiv_class = 1;
	  break;

	case RE_REPEATED_CHAR:
	  if (p->u.repeated_char.repeat_count > 0)
	    len += p->u.repeated_char.repeat_count;
	  else if (p->u.repeated_char.repeat_count == 0)
	    {
	      s->indefinite_repeat_element = p;
	      ++(s->n_indefinite_repeats);
	    }
	  break;

	case RE_NO_TYPE:
	  assert (0);
	  break;
	}
    }

  s->length = len;
}

static void
get_s1_spec_stats (struct Spec_list *s1)
{
  get_spec_stats (s1);
  if (complement)
    s1->length = card_of_complement (s1);
}

static void
get_s2_spec_stats (struct Spec_list *s2, size_t len_s1)
{
  get_spec_stats (s2);
  if (len_s1 >= s2->length && s2->n_indefinite_repeats == 1)
    {
      s2->indefinite_repeat_element->u.repeated_char.repeat_count =
	len_s1 - s2->length;
      s2->length = len_s1;
    }
}

static void
spec_init (struct Spec_list *spec_list)
{
  spec_list->head = spec_list->tail =
    (struct List_element *) xmalloc (sizeof (struct List_element));
  spec_list->head->next = NULL;
}

/* This function makes two passes over the argument string S.  The first
   one converts all \c and \ddd escapes to their one-byte representations.
   The second constructs a linked specification list, SPEC_LIST, of the
   characters and constructs that comprise the argument string.  If either
   of these passes detects an error, this function returns nonzero.  */

static int
parse_str (const unsigned char *s, struct Spec_list *spec_list)
{
  struct E_string es;
  int fail;

  fail = unquote (s, &es);
  if (!fail)
    fail = build_spec_list (&es, spec_list);
  es_free (&es);
  return fail;
}

/* Given two specification lists, S1 and S2, and assuming that
   S1->length > S2->length, append a single [c*n] element to S2 where c
   is the last character in the expansion of S2 and n is the difference
   between the two lengths.
   Upon successful completion, S2->length is set to S1->length.  The only
   way this function can fail to make S2 as long as S1 is when S2 has
   zero-length, since in that case, there is no last character to repeat.
   So S2->length is required to be at least 1.

   Providing this functionality allows the user to do some pretty
   non-BSD (and non-portable) things:  For example, the command
       tr -cs '[:upper:]0-9' '[:lower:]'
   is almost guaranteed to give results that depend on your collating
   sequence.  */

static void
string2_extend (const struct Spec_list *s1, struct Spec_list *s2)
{
  struct List_element *p;
  int char_to_repeat;
  int i;

  assert (translating);
  assert (s1->length > s2->length);
  assert (s2->length > 0);

  p = s2->tail;
  switch (p->type)
    {
    case RE_NORMAL_CHAR:
      char_to_repeat = p->u.normal_char;
      break;
    case RE_RANGE:
      char_to_repeat = p->u.range.last_char;
      break;
    case RE_CHAR_CLASS:
      for (i = N_CHARS; i >= 0; i--)
	if (is_char_class_member (p->u.char_class, i))
	  break;
      assert (i >= 0);
      char_to_repeat = CHR (i);
      break;

    case RE_REPEATED_CHAR:
      char_to_repeat = p->u.repeated_char.the_repeated_char;
      break;

    case RE_EQUIV_CLASS:
      /* This shouldn't happen, because validate exits with an error
         if it finds an equiv class in string2 when translating.  */
      abort ();
      break;

    case RE_NO_TYPE:
      abort ();
      break;

    default:
      abort ();
      break;
    }

  append_repeated_char (s2, char_to_repeat, s1->length - s2->length);
  s2->length = s1->length;
}

/* Return non-zero if S is a non-empty list in which exactly one
   character (but potentially, many instances of it) appears.
   E.g.  [X*] or xxxxxxxx.  */

static int
homogeneous_spec_list (struct Spec_list *s)
{
  int b, c;

  s->state = BEGIN_STATE;

  if ((b = get_next (s, NULL)) == -1)
    return 0;

  while ((c = get_next (s, NULL)) != -1)
    if (c != b)
      return 0;

  return 1;
}

/* Die with an error message if S1 and S2 describe strings that
   are not valid with the given command line switches.
   A side effect of this function is that if a valid [c*] or
   [c*0] construct appears in string2, it is converted to [c*n]
   with a value for n that makes s2->length == s1->length.  By
   the same token, if the --truncate-set1 option is not
   given, S2 may be extended.  */

static void
validate (struct Spec_list *s1, struct Spec_list *s2)
{
  get_s1_spec_stats (s1);
  if (s1->n_indefinite_repeats > 0)
    {
      error (EXIT_FAILURE, 0,
	     _("the [c*] repeat construct may not appear in string1"));
    }

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
亚洲毛片av在线| 亚洲日本一区二区| 日韩一区在线播放| 秋霞午夜av一区二区三区| 高清不卡一区二区| 91.com在线观看| 亚洲国产精品ⅴa在线观看| 日韩国产精品大片| 91国产福利在线| 国产精品高潮呻吟| 国产不卡在线一区| 久久亚洲一级片| 日本视频在线一区| 欧美美女视频在线观看| 亚洲乱码国产乱码精品精可以看| 国产精品一区不卡| 精品国产区一区| 免费黄网站欧美| 欧美一区二区三区在线观看| 亚洲一区二区综合| 一本大道av一区二区在线播放| 久久久午夜精品| 国产一二精品视频| 26uuu亚洲| 国产老妇另类xxxxx| 久久综合九色综合久久久精品综合 | 亚洲人成小说网站色在线| 精品一区二区三区影院在线午夜 | 亚洲电影中文字幕在线观看| 97久久精品人人做人人爽50路 | 成人一区二区视频| 欧美精品一区二区三区久久久| 人人狠狠综合久久亚洲| 欧美一区2区视频在线观看| 日韩电影在线免费| 日韩欧美一区电影| 免费观看日韩av| 欧美一级搡bbbb搡bbbb| 麻豆成人免费电影| 日韩精品一区二区三区中文不卡 | 欧美日韩不卡视频| 亚洲不卡av一区二区三区| 欧美乱熟臀69xxxxxx| 日韩电影一二三区| 欧美xxxxx裸体时装秀| 国产精品自拍在线| 1区2区3区国产精品| 欧美在线小视频| 日韩综合在线视频| 久久久一区二区三区捆绑**| 国产99久久久精品| 亚洲免费观看视频| 欧美一区二区三区免费| 国产乱码精品一区二区三| 26uuu精品一区二区三区四区在线| 精品一区二区三区在线播放| 国产精品久久久久四虎| 欧美日韩高清一区二区三区| 久久精品国产精品亚洲精品| 欧美videos大乳护士334| 国产白丝精品91爽爽久久| 一区二区三区精品在线| 欧美大片日本大片免费观看| 成人av资源在线观看| 午夜精品一区在线观看| 久久亚洲精品国产精品紫薇| 色哟哟国产精品| 日韩精彩视频在线观看| 国产喷白浆一区二区三区| 色综合一区二区三区| 毛片一区二区三区| 亚洲另类在线一区| 精品国产网站在线观看| 91成人免费在线视频| 国产一区视频在线看| 一级中文字幕一区二区| 久久精品一二三| 欧美肥妇bbw| 色综合中文字幕| 国产成人亚洲精品青草天美| 午夜激情一区二区| 国产精品福利影院| 26uuu亚洲| 日韩一区二区三区视频| 色综合网色综合| 国产成人免费高清| 看电视剧不卡顿的网站| 亚洲综合丝袜美腿| 欧美激情在线一区二区| 欧美成人免费网站| 欧美日本国产视频| 在线亚洲人成电影网站色www| 国产一区二区三区免费在线观看| 伊人性伊人情综合网| 国产欧美综合在线| 欧美va在线播放| 欧美久久一区二区| 不卡大黄网站免费看| 免费高清视频精品| 日韩精品成人一区二区在线| 亚洲美女少妇撒尿| 日本一区二区三区四区 | 制服.丝袜.亚洲.另类.中文| 97久久人人超碰| 99在线精品一区二区三区| 国产成人精品亚洲777人妖 | 国产亚洲人成网站| 欧美电视剧免费观看| 欧美色涩在线第一页| 91在线视频免费观看| 成人av网站免费观看| 精品在线免费视频| 美女一区二区视频| 蜜臀av性久久久久蜜臀aⅴ四虎 | 亚洲三级电影网站| 国产精品伦理一区二区| 久久免费电影网| 国产日产欧美一区| 国产精品国产三级国产普通话99| 日本一区二区视频在线| 国产日韩欧美麻豆| 日韩伦理电影网| 中文字幕五月欧美| 亚洲精品免费一二三区| 亚洲国产成人av网| 日韩激情中文字幕| 男男gaygay亚洲| 国产一区二区三区四区在线观看| 狠狠色综合播放一区二区| 久久精品国内一区二区三区| 日韩va欧美va亚洲va久久| 久久se精品一区二区| 国产一区二区三区日韩| 成人黄色小视频在线观看| 一本到一区二区三区| 在线这里只有精品| 日韩视频免费直播| 国产亚洲午夜高清国产拍精品| 自拍偷自拍亚洲精品播放| 亚洲欧美国产三级| 日韩专区一卡二卡| 国产成人精品aa毛片| 色系网站成人免费| 日韩欧美国产小视频| 日本一区二区三区电影| 一区二区三区不卡视频在线观看| 天天色综合天天| 成人av在线资源网站| 欧美电影在线免费观看| 久久久国产精华| 亚洲综合视频在线| 国产精品一级在线| 欧美午夜一区二区三区免费大片| 精品少妇一区二区三区日产乱码 | 91精品国产日韩91久久久久久| 久久蜜桃香蕉精品一区二区三区| 国产精品三级在线观看| 视频在线观看一区| 国产很黄免费观看久久| 91国内精品野花午夜精品 | 日韩精品专区在线影院重磅| 成人欧美一区二区三区| 日本va欧美va欧美va精品| 91蜜桃网址入口| 精品国产乱子伦一区| 亚洲一区二区三区视频在线| 国产精品亚洲成人| 6080yy午夜一二三区久久| 综合色中文字幕| 国产一区二区不卡在线| 欧美一区二区成人6969| 亚洲一区二区视频在线| 成人在线视频一区| 精品国精品国产| 丝袜诱惑制服诱惑色一区在线观看| 成人av影视在线观看| 久久久久久**毛片大全| 琪琪久久久久日韩精品| 欧美性视频一区二区三区| 亚洲国产精品成人综合色在线婷婷| 日本不卡中文字幕| 欧美欧美午夜aⅴ在线观看| 亚洲美女在线一区| 成人深夜视频在线观看| 日韩欧美一区二区久久婷婷| 一区二区欧美国产| 日本久久一区二区| 亚洲婷婷在线视频| 成人免费视频网站在线观看| 久久嫩草精品久久久精品| 美女视频免费一区| 日韩精品一区国产麻豆| 美女一区二区在线观看| 欧美www视频| 五月婷婷激情综合| 在线观看91av| 日本不卡高清视频| 精品欧美黑人一区二区三区| 狠狠色狠狠色综合日日91app| 久久一区二区三区四区|