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

? 歡迎來到蟲蟲下載站! | ?? 資源下載 ?? 資源專輯 ?? 關(guān)于我們
? 蟲蟲下載站

?? tr.c

?? linux開發(fā)技術(shù)詳解一書的源碼
?? C
?? 第 1 頁 / 共 4 頁
字號:
	    case 'b':
	      c = '\b';
	      break;
	    case 'f':
	      c = '\f';
	      break;
	    case 'n':
	      c = '\n';
	      break;
	    case 'r':
	      c = '\r';
	      break;
	    case 't':
	      c = '\t';
	      break;
	    case 'v':
	      c = '\v';
	      break;
	    case '0':
	    case '1':
	    case '2':
	    case '3':
	    case '4':
	    case '5':
	    case '6':
	    case '7':
	      c = s[i + 1] - '0';
	      oct_digit = s[i + 2] - '0';
	      if (0 <= oct_digit && oct_digit <= 7)
		{
		  c = 8 * c + oct_digit;
		  ++i;
		  oct_digit = s[i + 2] - '0';
		  if (0 <= oct_digit && oct_digit <= 7)
		    {
		      if (8 * c + oct_digit < N_CHARS)
			{
			  c = 8 * c + oct_digit;
			  ++i;
			}
		      else if (!posix_pedantic)
			{
			  /* A 3-digit octal number larger than \377 won't
			     fit in 8 bits.  So we stop when adding the
			     next digit would put us over the limit and
			     give a warning about the ambiguity.  POSIX
			     isn't clear on this, but one person has said
			     that in his interpretation, POSIX says tr
			     can't even give a warning.  */
			  error (0, 0, _("warning: the ambiguous octal escape \
\\%c%c%c is being\n\tinterpreted as the 2-byte sequence \\0%c%c, `%c'"),
				 s[i], s[i + 1], s[i + 2],
				 s[i], s[i + 1], s[i + 2]);
			}
		    }
		}
	      break;
	    case '\0':
	      error (0, 0, _("invalid backslash escape at end of string"));
	      return 1;

	    default:
	      if (posix_pedantic)
		{
		  error (0, 0, _("invalid backslash escape `\\%c'"), s[i + 1]);
		  return 1;
		}
	      else
	        {
		  c = s[i + 1];
		  es->escaped[j] = 1;
		}
	    }
	  ++i;
	  es->s[j++] = c;
	  break;
	default:
	  es->s[j++] = s[i];
	  break;
	}
    }
  es->len = j;
  return 0;
}

/* If CLASS_STR is a valid character class string, return its index
   in the global char_class_name array.  Otherwise, return CC_NO_CLASS.  */

static enum Char_class
look_up_char_class (const unsigned char *class_str, size_t len)
{
  unsigned int i;

  for (i = 0; i < N_CHAR_CLASSES; i++)
    if (strncmp ((const char *) class_str, char_class_name[i], len) == 0
	&& strlen (char_class_name[i]) == len)
      return (enum Char_class) i;
  return CC_NO_CLASS;
}

/* Return a newly allocated string with a printable version of C.
   This function is used solely for formatting error messages.  */

static char *
make_printable_char (unsigned int c)
{
  char *buf = xmalloc (5);

  assert (c < N_CHARS);
  if (ISPRINT (c))
    {
      buf[0] = c;
      buf[1] = '\0';
    }
  else
    {
      sprintf (buf, "\\%03o", c);
    }
  return buf;
}

/* Return a newly allocated copy of S which is suitable for printing.
   LEN is the number of characters in S.  Most non-printing
   (isprint) characters are represented by a backslash followed by
   3 octal digits.  However, the characters represented by \c escapes
   where c is one of [abfnrtv] are represented by their 2-character \c
   sequences.  This function is used solely for printing error messages.  */

static char *
make_printable_str (const unsigned char *s, size_t len)
{
  /* Worst case is that every character expands to a backslash
     followed by a 3-character octal escape sequence.  */
  char *printable_buf = xmalloc (4 * len + 1);
  char *p = printable_buf;
  size_t i;

  for (i = 0; i < len; i++)
    {
      char buf[5];
      char *tmp = NULL;

      switch (s[i])
	{
	case '\\':
	  tmp = "\\";
	  break;
	case '\007':
	  tmp = "\\a";
	  break;
	case '\b':
	  tmp = "\\b";
	  break;
	case '\f':
	  tmp = "\\f";
	  break;
	case '\n':
	  tmp = "\\n";
	  break;
	case '\r':
	  tmp = "\\r";
	  break;
	case '\t':
	  tmp = "\\t";
	  break;
	case '\v':
	  tmp = "\\v";
	  break;
	default:
	  if (ISPRINT (s[i]))
	    {
	      buf[0] = s[i];
	      buf[1] = '\0';
	    }
	  else
	    sprintf (buf, "\\%03o", s[i]);
	  tmp = buf;
	  break;
	}
      p = stpcpy (p, tmp);
    }
  return printable_buf;
}

/* Append a newly allocated structure representing a
   character C to the specification list LIST.  */

static void
append_normal_char (struct Spec_list *list, unsigned int c)
{
  struct List_element *new;

  new = (struct List_element *) xmalloc (sizeof (struct List_element));
  new->next = NULL;
  new->type = RE_NORMAL_CHAR;
  new->u.normal_char = c;
  assert (list->tail);
  list->tail->next = new;
  list->tail = new;
}

/* Append a newly allocated structure representing the range
   of characters from FIRST to LAST to the specification list LIST.
   Return nonzero if LAST precedes FIRST in the collating sequence,
   zero otherwise.  This means that '[c-c]' is acceptable.  */

static int
append_range (struct Spec_list *list, unsigned int first, unsigned int last)
{
  struct List_element *new;

  if (ORD (first) > ORD (last))
    {
      char *tmp1 = make_printable_char (first);
      char *tmp2 = make_printable_char (last);

      error (0, 0,
       _("range-endpoints of `%s-%s' are in reverse collating sequence order"),
	     tmp1, tmp2);
      free (tmp1);
      free (tmp2);
      return 1;
    }
  new = (struct List_element *) xmalloc (sizeof (struct List_element));
  new->next = NULL;
  new->type = RE_RANGE;
  new->u.range.first_char = first;
  new->u.range.last_char = last;
  assert (list->tail);
  list->tail->next = new;
  list->tail = new;
  return 0;
}

/* If CHAR_CLASS_STR is a valid character class string, append a
   newly allocated structure representing that character class to the end
   of the specification list LIST and return 0.  If CHAR_CLASS_STR is not
   a valid string return nonzero.  */

static int
append_char_class (struct Spec_list *list,
		   const unsigned char *char_class_str, size_t len)
{
  enum Char_class char_class;
  struct List_element *new;

  char_class = look_up_char_class (char_class_str, len);
  if (char_class == CC_NO_CLASS)
    return 1;
  new = (struct List_element *) xmalloc (sizeof (struct List_element));
  new->next = NULL;
  new->type = RE_CHAR_CLASS;
  new->u.char_class = char_class;
  assert (list->tail);
  list->tail->next = new;
  list->tail = new;
  return 0;
}

/* Append a newly allocated structure representing a [c*n]
   repeated character construct to the specification list LIST.
   THE_CHAR is the single character to be repeated, and REPEAT_COUNT
   is a non-negative repeat count.  */

static void
append_repeated_char (struct Spec_list *list, unsigned int the_char,
		      size_t repeat_count)
{
  struct List_element *new;

  new = (struct List_element *) xmalloc (sizeof (struct List_element));
  new->next = NULL;
  new->type = RE_REPEATED_CHAR;
  new->u.repeated_char.the_repeated_char = the_char;
  new->u.repeated_char.repeat_count = repeat_count;
  assert (list->tail);
  list->tail->next = new;
  list->tail = new;
}

/* Given a string, EQUIV_CLASS_STR, from a [=str=] context and
   the length of that string, LEN, if LEN is exactly one, append
   a newly allocated structure representing the specified
   equivalence class to the specification list, LIST and return zero.
   If LEN is not 1, return nonzero.  */

static int
append_equiv_class (struct Spec_list *list,
		    const unsigned char *equiv_class_str, size_t len)
{
  struct List_element *new;

  if (len != 1)
    return 1;
  new = (struct List_element *) xmalloc (sizeof (struct List_element));
  new->next = NULL;
  new->type = RE_EQUIV_CLASS;
  new->u.equiv_code = *equiv_class_str;
  assert (list->tail);
  list->tail->next = new;
  list->tail = new;
  return 0;
}

/* Return a newly allocated copy of the LEN-byte prefix of P.
   The returned string may contain NUL bytes and is *not* NUL-terminated.  */

static unsigned char *
xmemdup (const unsigned char *p, size_t len)
{
  unsigned char *tmp = (unsigned char *) xmalloc (len);

  /* Use memcpy rather than strncpy because `p' may contain zero-bytes.  */
  memcpy (tmp, p, len);
  return tmp;
}

/* Search forward starting at START_IDX for the 2-char sequence
   (PRE_BRACKET_CHAR,']') in the string P of length P_LEN.  If such
   a sequence is found, set *RESULT_IDX to the index of the first
   character and return nonzero. Otherwise return zero.  P may contain
   zero bytes.  */

static int
find_closing_delim (const struct E_string *es, size_t start_idx,
		    unsigned int pre_bracket_char, size_t *result_idx)
{
  size_t i;

  for (i = start_idx; i < es->len - 1; i++)
    if (es->s[i] == pre_bracket_char && es->s[i + 1] == ']'
	&& !es->escaped[i] && !es->escaped[i + 1])
      {
	*result_idx = i;
	return 1;
      }
  return 0;
}

/* Parse the bracketed repeat-char syntax.  If the P_LEN characters
   beginning with P[ START_IDX ] comprise a valid [c*n] construct,
   then set *CHAR_TO_REPEAT, *REPEAT_COUNT, and *CLOSING_BRACKET_IDX
   and return zero. If the second character following
   the opening bracket is not `*' or if no closing bracket can be
   found, return -1.  If a closing bracket is found and the
   second char is `*', but the string between the `*' and `]' isn't
   empty, an octal number, or a decimal number, print an error message
   and return -2.  */

static int
find_bracketed_repeat (const struct E_string *es, size_t start_idx,
		       unsigned int *char_to_repeat, size_t *repeat_count,
		       size_t *closing_bracket_idx)
{
  size_t i;

  assert (start_idx + 1 < es->len);
  if (!ES_MATCH (es, start_idx + 1, '*'))
    return -1;

  for (i = start_idx + 2; i < es->len; i++)
    {
      if (ES_MATCH (es, i, ']'))
	{
	  size_t digit_str_len = i - start_idx - 2;

	  *char_to_repeat = es->s[start_idx];
	  if (digit_str_len == 0)
	    {
	      /* We've matched [c*] -- no explicit repeat count.  */
	      *repeat_count = 0;
	      *closing_bracket_idx = i;
	      return 0;
	    }

	  /* Here, we have found [c*s] where s should be a string
	     of octal (if it starts with `0') or decimal digits.  */
	  {
	    const char *digit_str = (const char *) &es->s[start_idx + 2];
	    unsigned long int tmp_ulong;
	    char *d_end;
	    int base = 10;
	    /* Select the base manually so we can be sure it's either 8 or 10.
	       If the spec allowed it to be interpreted as hexadecimal, we
	       could have used `0' and let xstrtoul decide.  */
	    if (*digit_str == '0')
	      {
		base = 8;
		++digit_str;
		--digit_str_len;
	      }
	    if (xstrtoul (digit_str, &d_end, base, &tmp_ulong, NULL)
		  != LONGINT_OK
		|| BEGIN_STATE < tmp_ulong
		|| digit_str + digit_str_len != d_end)
	      {
		char *tmp = make_printable_str (es->s + start_idx + 2,
						i - start_idx - 2);
		error (0, 0, _("invalid repeat count `%s' in [c*n] construct"),
		       tmp);
		free (tmp);
		return -2;
	      }
	    *repeat_count = tmp_ulong;
	  }
	  *closing_bracket_idx = i;
	  return 0;
	}
    }
  return -1;			/* No bracket found.  */
}

/* Return nonzero if the string at ES->s[IDX] matches the regular
   expression `\*[0-9]*\]', zero otherwise.  To match, the `*' and
   the `]' must not be escaped.  */

static int
star_digits_closebracket (const struct E_string *es, size_t idx)
{
  size_t i;

  if (!ES_MATCH (es, idx, '*'))
    return 0;

  for (i = idx + 1; i < es->len; i++)
    {
      if (!ISDIGIT (es->s[i]))
	{
	  if (ES_MATCH (es, i, ']'))
	    return 1;
	  return 0;
	}
    }
  return 0;
}

/* Convert string UNESCAPED_STRING (which has been preprocessed to
   convert backslash-escape sequences) of length LEN characters into
   a linked list of the following 5 types of constructs:
      - [:str:] Character class where `str' is one of the 12 valid strings.
      - [=c=] Equivalence class where `c' is any single character.
      - [c*n] Repeat the single character `c' `n' times. n may be omitted.
	  However, if `n' is present, it must be a non-negative octal or
	  decimal integer.
      - r-s Range of characters from `r' to `s'.  The second endpoint must
	  not precede the first in the current collating sequence.
      - c Any other character is interpreted as itself.  */

static int
build_spec_list (const struct E_string *es, struct Spec_list *result)
{
  const unsigned char *p;
  size_t i;

  p = es->s;

  /* The main for-loop below recognizes the 4 multi-character constructs.
     A character that matches (in its context) none of the multi-character
     constructs is classified as `normal'.  Since all multi-character
     constructs have at least 3 characters, any strings of length 2 or
     less are composed solely of normal characters.  Hence, the index of
     the outer for-loop runs only as far as LEN-2.  */

  for (i = 0; i + 2 < es->len; /* empty */)
    {
      if (ES_MATCH (es, i, '['))
	{
	  int matched_multi_char_construct;
	  size_t closing_bracket_idx;
	  unsigned int char_to_repeat;
	  size_t repeat_count;
	  int err;

	  matched_multi_char_construct = 1;
	  if (ES_MATCH (es, i + 1, ':')
	      || ES_MATCH (es, i + 1, '='))
	    {
	      size_t closing_delim_idx;
	      int found;

	      found = find_closing_delim (es, i + 2, p[i + 1],
					  &closing_delim_idx);
	      if (found)
		{
		  int parse_failed;
		  size_t opnd_str_len = closing_delim_idx - 1 - (i + 2) + 1;
		  unsigned char *opnd_str;

		  if (opnd_str_len == 0)
		    {
		      if (p[i + 1] == ':')
			error (0, 0, _("missing character class name `[::]'"));
		      else
			error (0, 0,
			       _("missing equivalence class character `[==]'"));
		      return 1;
		    }

		  opnd_str = xmemdup (p + i + 2, opnd_str_len);

		  if (p[i + 1] == ':')
		    {
		      parse_failed = append_char_class (result, opnd_str,
							opnd_str_len);

		      /* FIXME: big comment.  */
		      if (parse_failed)
			{

?? 快捷鍵說明

復(fù)制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
国产精品不卡一区| 精品在线播放午夜| 韩国一区二区视频| 精品视频一区三区九区| 精品国产欧美一区二区| 一区二区三区**美女毛片| 99久久99久久综合| 亚洲欧美在线观看| www.欧美色图| 日韩美女精品在线| 欧美亚洲综合在线| 亚洲成a人v欧美综合天堂| 91久久线看在观草草青青| 亚洲激情中文1区| 欧美日韩亚洲国产综合| 三级不卡在线观看| 国产午夜亚洲精品理论片色戒| 麻豆91精品视频| 国产午夜精品在线观看| www.99精品| 亚洲男帅同性gay1069| 97精品超碰一区二区三区| 国产目拍亚洲精品99久久精品| 丁香五精品蜜臀久久久久99网站 | 中文字幕视频一区二区三区久| 国产久卡久卡久卡久卡视频精品| 精品久久久网站| 奇米亚洲午夜久久精品| 精品少妇一区二区三区在线视频| 国产一区二区导航在线播放| 自拍偷拍欧美精品| 欧美一级久久久| 日本一道高清亚洲日美韩| 久久久噜噜噜久久中文字幕色伊伊 | 午夜欧美大尺度福利影院在线看| 日韩一级片在线观看| 成人自拍视频在线观看| 一区二区三区精品视频在线| 91麻豆精品国产91久久久久久 | 欧美一区二区二区| 日本女人一区二区三区| 国产精品午夜春色av| 欧美日韩高清一区二区不卡| 成人午夜精品在线| 美腿丝袜亚洲色图| 天天av天天翘天天综合网色鬼国产| 日本精品一级二级| 色哟哟欧美精品| 国产精品1区2区3区在线观看| 亚洲三级理论片| 国产精品进线69影院| 中文字幕欧美区| 国产午夜精品美女毛片视频| 欧美一激情一区二区三区| 9l国产精品久久久久麻豆| 国产精品91xxx| 国产精品一二一区| 国产999精品久久| 国产成人av自拍| 国产美女在线观看一区| 蜜桃视频第一区免费观看| 蜜桃传媒麻豆第一区在线观看| 亚洲制服欧美中文字幕中文字幕| 亚洲精品国产一区二区三区四区在线 | 在线观看视频一区| 欧美午夜免费电影| 日韩一区二区三区电影在线观看 | 日日摸夜夜添夜夜添亚洲女人| 亚洲人成7777| 视频在线观看一区二区三区| 精品在线一区二区三区| 久久99精品久久只有精品| 激情欧美日韩一区二区| 国产电影一区在线| av高清久久久| 欧美精品少妇一区二区三区| 日韩精品一区二区三区老鸭窝| 欧美国产视频在线| 首页国产欧美日韩丝袜| 成人天堂资源www在线| 日韩视频免费观看高清在线视频| 国产精品伦理在线| 人人爽香蕉精品| 波多野洁衣一区| 欧美一区二区三区啪啪| 国产精品美女久久久久久久 | 91老师国产黑色丝袜在线| 欧美一区中文字幕| 国产精品无码永久免费888| 亚洲一区av在线| 99精品国产视频| 国产精品久久久久毛片软件| 国产在线国偷精品产拍免费yy| 色一情一乱一乱一91av| 亚洲欧美精品午睡沙发| 欧美亚洲一区二区三区四区| 久久久久久久久99精品| 美女脱光内衣内裤视频久久网站| 在线免费观看不卡av| 风流少妇一区二区| 久久久国产精品麻豆| 国产精品视频线看| 日韩中文字幕一区二区三区| 国产综合色在线| 欧美精品一二三| 91精品国模一区二区三区| 欧美va在线播放| 欧美人狂配大交3d怪物一区| 91丨porny丨首页| 国产不卡视频一区二区三区| 视频一区二区欧美| 亚洲成人在线免费| 成人在线视频首页| 亚洲美腿欧美偷拍| 国产黑丝在线一区二区三区| 99久久综合精品| 国产精品不卡视频| 欧美在线你懂的| 亚洲美腿欧美偷拍| av电影一区二区| 国产精品污网站| 一区二区三区色| 亚洲三级久久久| 久久久久久久久久久久久夜| 亚洲五码中文字幕| 欧美aaa在线| 一卡二卡三卡日韩欧美| 国产一区91精品张津瑜| 粉嫩av一区二区三区粉嫩| 国产亲近乱来精品视频| 一区二区国产盗摄色噜噜| 欧美韩日一区二区三区| 国产91精品露脸国语对白| 亚洲视频免费观看| 石原莉奈在线亚洲二区| 国产午夜精品一区二区三区四区| 青娱乐精品视频| 亚洲综合精品自拍| 国产精品麻豆欧美日韩ww| 一本色道亚洲精品aⅴ| 成人激情综合网站| 亚洲一二三四区| 中文字幕一区av| 亚洲国产精品高清| 久久亚区不卡日本| 欧洲视频一区二区| 成人白浆超碰人人人人| 亚洲精品乱码久久久久久| 欧美成人三级在线| 精品动漫一区二区三区在线观看| 欧美一区二区视频观看视频| 欧美日韩国产综合草草| 欧美日韩在线播| 欧美精品久久一区| 欧美精品久久一区二区三区| 在线观看91精品国产麻豆| 日韩精品一区二区三区蜜臀| 日韩一区二区三区免费观看| 欧美电影免费观看高清完整版在 | 国产一区二区三区精品欧美日韩一区二区三区| 亚洲国产日韩精品| 免费成人av资源网| 国产精品69久久久久水密桃| 91丝袜呻吟高潮美腿白嫩在线观看| 色一情一乱一乱一91av| 91精品国产色综合久久不卡蜜臀| 日韩免费成人网| 国产精品色哟哟| 亚洲制服丝袜av| 久久99在线观看| 97久久精品人人爽人人爽蜜臀 | 久久精品久久精品| 丁香桃色午夜亚洲一区二区三区| 色哟哟欧美精品| 日韩免费观看2025年上映的电影| 亚洲三级在线看| 国内外成人在线视频| 欧美性做爰猛烈叫床潮| 欧美韩日一区二区三区四区| 天堂在线一区二区| 欧美性xxxxx极品少妇| 久久综合国产精品| 久久99精品视频| 欧美一区二区三区性视频| 亚洲欧美日本在线| 成人综合在线观看| 久久久久久一级片| 久久99精品网久久| 欧美色综合网站| 一区二区三区欧美视频| 成人免费高清视频| 精品国产一区二区三区忘忧草 | 不卡视频免费播放| 国产欧美一二三区| 成人综合婷婷国产精品久久蜜臀 | 精品国产伦一区二区三区免费| 亚洲午夜激情网页| 日韩一级大片在线观看| 久久成人免费电影| 久久精子c满五个校花|