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

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

?? localealias.c

?? Gsm手機(短信息,電話簿)開發庫C++源代碼
?? C
字號:
/* Handle aliases for locale names.
   Copyright (C) 1995, 1996, 1997, 1998 Free Software Foundation, Inc.
   Written by Ulrich Drepper <drepper@gnu.ai.mit.edu>, 1995.

   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,
   Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.  */

#ifdef HAVE_CONFIG_H
# include <gsm_config.h>
#endif

#include <ctype.h>
#include <stdio.h>
#include <sys/types.h>

#ifdef __GNUC__
# define alloca __builtin_alloca
# define HAVE_ALLOCA 1
#else
# if defined HAVE_ALLOCA_H || defined _LIBC
#  include <alloca.h>
# else
#  ifdef _AIX
 #pragma alloca
#  else
#   ifndef alloca
char *alloca ();
#   endif
#  endif
# endif
#endif

#if defined STDC_HEADERS || defined _LIBC
# include <stdlib.h>
#else
char *getenv ();
# ifdef HAVE_MALLOC_H
#  include <malloc.h>
# else
void free ();
# endif
#endif

#if defined HAVE_STRING_H || defined _LIBC
# ifndef _GNU_SOURCE
#  define _GNU_SOURCE	1
# endif
# include <string.h>
#else
# include <strings.h>
# ifndef memcpy
#  define memcpy(Dst, Src, Num) bcopy (Src, Dst, Num)
# endif
#endif
#if !HAVE_STRCHR && !defined _LIBC
# ifndef strchr
#  define strchr index
# endif
#endif

#include "gettext.h"
#include "gettextP.h"

/* @@ end of prolog @@ */

#ifdef _LIBC
/* Rename the non ANSI C functions.  This is required by the standard
   because some ANSI C functions will require linking with this object
   file and the name space must not be polluted.  */
# define strcasecmp __strcasecmp

# define mempcpy __mempcpy
# define HAVE_MEMPCPY	1

/* We need locking here since we can be called from different places.  */
# include <bits/libc-lock.h>

__libc_lock_define_initialized (static, lock);
#endif


/* For those loosing systems which don't have `alloca' we have to add
   some additional code emulating it.  */
#ifdef HAVE_ALLOCA
/* Nothing has to be done.  */
# define ADD_BLOCK(list, address) /* nothing */
# define FREE_BLOCKS(list) /* nothing */
#else
struct block_list
{
  void *address;
  struct block_list *next;
};
# define ADD_BLOCK(list, addr)						      \
  do {									      \
    struct block_list *newp = (struct block_list *) malloc (sizeof (*newp));  \
    /* If we cannot get a free block we cannot add the new element to	      \
       the list.  */							      \
    if (newp != NULL) {							      \
      newp->address = (addr);						      \
      newp->next = (list);						      \
      (list) = newp;							      \
    }									      \
  } while (0)
# define FREE_BLOCKS(list)						      \
  do {									      \
    while (list != NULL) {						      \
      struct block_list *old = list;					      \
      list = list->next;						      \
      free (old);							      \
    }									      \
  } while (0)
# undef alloca
# define alloca(size) (malloc (size))
#endif	/* have alloca */


struct alias_map
{
  const char *alias;
  const char *value;
};


static char *string_space = NULL;
static size_t string_space_act = 0;
static size_t string_space_max = 0;
static struct alias_map *map;
static size_t nmap = 0;
static size_t maxmap = 0;


/* Prototypes for local functions.  */
static size_t read_alias_file PARAMS ((const char *fname, int fname_len))
     internal_function;
static void extend_alias_table PARAMS ((void));
static int alias_compare PARAMS ((const struct alias_map *map1,
				  const struct alias_map *map2));


const char *
_nl_expand_alias (name)
    const char *name;
{
  static const char *locale_alias_path = LOCALE_ALIAS_PATH;
  struct alias_map *retval;
  const char *result = NULL;
  size_t added;

#ifdef _LIBC
  __libc_lock_lock (lock);
#endif

  do
    {
      struct alias_map item;

      item.alias = name;

      if (nmap > 0)
	retval = (struct alias_map *) bsearch (&item, map, nmap,
					       sizeof (struct alias_map),
					       (int (*) PARAMS ((const void *,
								 const void *))
						) alias_compare);
      else
	retval = NULL;

      /* We really found an alias.  Return the value.  */
      if (retval != NULL)
	{
	  result = retval->value;
	  break;
	}

      /* Perhaps we can find another alias file.  */
      added = 0;
      while (added == 0 && locale_alias_path[0] != '\0')
	{
	  const char *start;

	  while (locale_alias_path[0] == ':')
	    ++locale_alias_path;
	  start = locale_alias_path;

	  while (locale_alias_path[0] != '\0' && locale_alias_path[0] != ':')
	    ++locale_alias_path;

	  if (start < locale_alias_path)
	    added = read_alias_file (start, locale_alias_path - start);
	}
    }
  while (added != 0);

#ifdef _LIBC
  __libc_lock_unlock (lock);
#endif

  return result;
}


static size_t
internal_function
read_alias_file (fname, fname_len)
     const char *fname;
     int fname_len;
{
#ifndef HAVE_ALLOCA
  struct block_list *block_list = NULL;
#endif
  FILE *fp;
  char *full_fname;
  size_t added;
  static const char aliasfile[] = "/locale.alias";

  full_fname = (char *) alloca (fname_len + sizeof aliasfile);
  ADD_BLOCK (block_list, full_fname);
#ifdef HAVE_MEMPCPY
  mempcpy (mempcpy (full_fname, fname, fname_len),
	   aliasfile, sizeof aliasfile);
#else
  memcpy (full_fname, fname, fname_len);
  memcpy (&full_fname[fname_len], aliasfile, sizeof aliasfile);
#endif

  fp = fopen (full_fname, "r");
  if (fp == NULL)
    {
      FREE_BLOCKS (block_list);
      return 0;
    }

  added = 0;
  while (!feof (fp))
    {
      /* It is a reasonable approach to use a fix buffer here because
	 a) we are only interested in the first two fields
	 b) these fields must be usable as file names and so must not
	    be that long
       */
      unsigned char buf[BUFSIZ];
      unsigned char *alias;
      unsigned char *value;
      unsigned char *cp;

      if (fgets (buf, sizeof buf, fp) == NULL)
	/* EOF reached.  */
	break;

      /* Possibly not the whole line fits into the buffer.  Ignore
	 the rest of the line.  */
      if (strchr (buf, '\n') == NULL)
	{
	  char altbuf[BUFSIZ];
	  do
	    if (fgets (altbuf, sizeof altbuf, fp) == NULL)
	      /* Make sure the inner loop will be left.  The outer loop
		 will exit at the `feof' test.  */
	      break;
	  while (strchr (altbuf, '\n') == NULL);
	}

      cp = buf;
      /* Ignore leading white space.  */
      while (isspace (cp[0]))
	++cp;

      /* A leading '#' signals a comment line.  */
      if (cp[0] != '\0' && cp[0] != '#')
	{
	  alias = cp++;
	  while (cp[0] != '\0' && !isspace (cp[0]))
	    ++cp;
	  /* Terminate alias name.  */
	  if (cp[0] != '\0')
	    *cp++ = '\0';

	  /* Now look for the beginning of the value.  */
	  while (isspace (cp[0]))
	    ++cp;

	  if (cp[0] != '\0')
	    {
	      size_t alias_len;
	      size_t value_len;

	      value = cp++;
	      while (cp[0] != '\0' && !isspace (cp[0]))
		++cp;
	      /* Terminate value.  */
	      if (cp[0] == '\n')
		{
		  /* This has to be done to make the following test
		     for the end of line possible.  We are looking for
		     the terminating '\n' which do not overwrite here.  */
		  *cp++ = '\0';
		  *cp = '\n';
		}
	      else if (cp[0] != '\0')
		*cp++ = '\0';

	      if (nmap >= maxmap)
		extend_alias_table ();

	      alias_len = strlen (alias) + 1;
	      value_len = strlen (value) + 1;

	      if (string_space_act + alias_len + value_len > string_space_max)
		{
		  /* Increase size of memory pool.  */
		  size_t new_size = (string_space_max
				     + (alias_len + value_len > 1024
					? alias_len + value_len : 1024));
		  char *new_pool = (char *) realloc (string_space, new_size);
		  if (new_pool == NULL)
		    {
		      FREE_BLOCKS (block_list);
		      return added;
		    }
		  string_space = new_pool;
		  string_space_max = new_size;
		}

	      map[nmap].alias = memcpy (&string_space[string_space_act],
					alias, alias_len);
	      string_space_act += alias_len;

	      map[nmap].value = memcpy (&string_space[string_space_act],
					value, value_len);
	      string_space_act += value_len;

	      ++nmap;
	      ++added;
	    }
	}
    }

  /* Should we test for ferror()?  I think we have to silently ignore
     errors.  --drepper  */
  fclose (fp);

  if (added > 0)
    qsort (map, nmap, sizeof (struct alias_map),
	   (int (*) PARAMS ((const void *, const void *))) alias_compare);

  FREE_BLOCKS (block_list);
  return added;
}


static void
extend_alias_table ()
{
  size_t new_size;
  struct alias_map *new_map;

  new_size = maxmap == 0 ? 100 : 2 * maxmap;
  new_map = (struct alias_map *) realloc (map, (new_size
						* sizeof (struct alias_map)));
  if (new_map == NULL)
    /* Simply don't extend: we don't have any more core.  */
    return;

  map = new_map;
  maxmap = new_size;
}


#ifdef _LIBC
static void __attribute__ ((unused))
free_mem (void)
{
  if (string_space != NULL)
    free (string_space);
  if (map != NULL)
    free (map);
}
text_set_element (__libc_subfreeres, free_mem);
#endif


static int
alias_compare (map1, map2)
     const struct alias_map *map1;
     const struct alias_map *map2;
{
#if defined _LIBC || defined HAVE_STRCASECMP
  return strcasecmp (map1->alias, map2->alias);
#else
  const unsigned char *p1 = (const unsigned char *) map1->alias;
  const unsigned char *p2 = (const unsigned char *) map2->alias;
  unsigned char c1, c2;

  if (p1 == p2)
    return 0;

  do
    {
      /* I know this seems to be odd but the tolower() function in
	 some systems libc cannot handle nonalpha characters.  */
      c1 = isupper (*p1) ? tolower (*p1) : *p1;
      c2 = isupper (*p2) ? tolower (*p2) : *p2;
      if (c1 == '\0')
	break;
      ++p1;
      ++p2;
    }
  while (c1 == c2);

  return c1 - c2;
#endif
}

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
中文字幕在线不卡| 婷婷开心久久网| 欧美一级欧美三级在线观看| 国产精品资源在线观看| 亚洲图片欧美色图| 欧美激情在线看| 日韩欧美久久久| 欧美日韩免费视频| zzijzzij亚洲日本少妇熟睡| 九九视频精品免费| 天天影视网天天综合色在线播放| 国产精品九色蝌蚪自拍| 精品久久国产老人久久综合| 51精品秘密在线观看| 一本一本大道香蕉久在线精品 | 欧美猛男超大videosgay| 成人黄色av网站在线| 久草热8精品视频在线观看| 亚洲v精品v日韩v欧美v专区| 亚洲天堂免费看| 国产无人区一区二区三区| 日韩写真欧美这视频| 欧美日韩一区二区三区四区五区| www.日韩精品| 丰满岳乱妇一区二区三区| 久久99国产精品麻豆| 视频一区二区三区入口| 亚洲精品成人悠悠色影视| 国产精品免费丝袜| 国产精品国产三级国产普通话三级| 2022国产精品视频| 精品噜噜噜噜久久久久久久久试看| 欧美另类一区二区三区| 欧美三级电影在线看| 91精彩视频在线| 日本高清视频一区二区| 色久综合一二码| 日本韩国视频一区二区| 欧美午夜精品久久久久久超碰| 色天天综合色天天久久| 一本一道久久a久久精品| 一本到不卡免费一区二区| 99re在线精品| 欧美在线观看一区| 欧美日韩精品欧美日韩精品 | 国产欧美一区二区三区网站| 欧美v亚洲v综合ⅴ国产v| 日韩欧美在线一区二区三区| 欧美v国产在线一区二区三区| 精品粉嫩超白一线天av| 精品av久久707| 久久精品视频一区二区三区| 久久久99免费| 中文字幕在线不卡| 亚洲一区在线播放| 免费在线视频一区| 国产在线一区二区综合免费视频| 国产精品1区二区.| 99在线精品免费| 在线观看国产日韩| 91精品国产综合久久香蕉的特点 | 蓝色福利精品导航| 国产在线精品免费| 成人app软件下载大全免费| 色婷婷av久久久久久久| 欧美一区二区日韩一区二区| 久久色.com| 日韩理论片在线| 日本v片在线高清不卡在线观看| 美女任你摸久久| 国产91丝袜在线18| 欧美视频第二页| 久久亚洲精品国产精品紫薇| 成人欧美一区二区三区视频网页| 一区二区三区中文字幕在线观看| 奇米色一区二区| 国产91在线|亚洲| 欧美美女一区二区三区| 国产亚洲综合在线| 亚洲一区二区欧美| 国产精品性做久久久久久| 色欧美日韩亚洲| 久久亚区不卡日本| 亚洲一区自拍偷拍| 国产一区在线看| 欧美日韩亚州综合| 国产欧美日韩另类一区| 亚洲香肠在线观看| 国产精品羞羞答答xxdd | 国产日本欧洲亚洲| 午夜av区久久| 北条麻妃一区二区三区| 欧美激情一区二区三区在线| 偷拍日韩校园综合在线| 成人激情开心网| 欧美一卡在线观看| 亚洲激情在线播放| 国产精品一区二区黑丝| 欧美电影在哪看比较好| 亚洲麻豆国产自偷在线| 国产一区二区按摩在线观看| 欧洲国产伦久久久久久久| 中文字幕乱码一区二区免费| 日本不卡在线视频| 日本韩国精品一区二区在线观看| 国产日韩三级在线| 免费看黄色91| 欧美三级乱人伦电影| 亚洲欧美一区二区久久 | 91麻豆精品国产综合久久久久久| 中文字幕一区二区在线播放| 久久不见久久见中文字幕免费| 日本黄色一区二区| 综合婷婷亚洲小说| 国产精品1区2区| 日韩三级视频中文字幕| 图片区小说区国产精品视频| 97精品久久久午夜一区二区三区| 久久久久久久久97黄色工厂| 美女视频网站久久| 欧美一二三在线| 日韩av网站在线观看| 在线欧美日韩国产| 亚洲视频免费观看| www.日韩精品| 亚洲视频一区二区在线观看| 成人精品亚洲人成在线| 久久久99免费| 国产91丝袜在线播放九色| 久久久久久综合| 国产精品小仙女| 国产农村妇女毛片精品久久麻豆| 国产一区在线视频| 国产亚洲午夜高清国产拍精品 | 欧美日韩在线播放一区| 亚洲综合色丁香婷婷六月图片| 91久久奴性调教| 亚洲黄色录像片| 欧美三级一区二区| 五月天欧美精品| 欧美一区二区在线不卡| 日本不卡123| 久久看人人爽人人| 国产一区二区在线影院| 久久久蜜桃精品| 国产99一区视频免费| 亚洲国产精品精华液2区45| 日韩精品一区在线| 日韩精品91亚洲二区在线观看| 欧美性感一类影片在线播放| 亚洲图片有声小说| 国产欧美日韩视频在线观看| 狠狠色丁香久久婷婷综| 久久婷婷成人综合色| 成人h动漫精品一区二区| 中文字幕欧美一| 欧美三级中文字| 黑人巨大精品欧美一区| 欧美视频三区在线播放| 欧美本精品男人aⅴ天堂| 美女免费视频一区| 欧美成人在线直播| 国产91精品在线观看| 一区二区三区四区在线免费观看| 精品国产成人系列| 99精品国产91久久久久久| 亚洲成人手机在线| 久久亚洲春色中文字幕久久久| 99久久精品免费看国产| 午夜精品免费在线| 2024国产精品| 欧美亚洲国产一区在线观看网站 | 天天影视网天天综合色在线播放| 精品国产乱码久久久久久免费| 成人国产一区二区三区精品| 亚洲成人激情av| 久久综合资源网| 在线免费精品视频| 国产精品一区二区你懂的| 亚洲国产成人精品视频| 久久欧美中文字幕| 欧美日韩日本视频| 成人一区二区三区| 日韩福利电影在线| 国产精品美女www爽爽爽| 91.xcao| av一区二区久久| 久久av资源站| 亚洲国产精品一区二区www在线 | xvideos.蜜桃一区二区| 在线看国产一区二区| 国产一区二区在线视频| 亚洲国产欧美在线| 国产亚洲欧洲997久久综合 | 91在线小视频| 精品在线一区二区三区| 亚洲一区二区三区四区五区中文| 久久久青草青青国产亚洲免观| 欧美日韩免费一区二区三区视频 | 678五月天丁香亚洲综合网|