📄 loadmsgcat.c
字号:
/* Load needed message catalogs. Copyright (C) 1995-1999, 2000-2002 Free Software Foundation, Inc. This program is free software; you can redistribute it and/or modify it under the terms of the GNU Library 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 Library General Public License for more details. You should have received a copy of the GNU Library 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. *//* Tell glibc's <string.h> to provide a prototype for mempcpy(). This must come before <config.h> because <config.h> may include <features.h>, and once <features.h> has been included, it's too late. */#ifndef _GNU_SOURCE# define _GNU_SOURCE 1#endif#ifdef HAVE_CONFIG_H# include <config.h>#endif#include <ctype.h>#include <errno.h>#include <fcntl.h>#include <sys/types.h>#include <sys/stat.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 allocachar *alloca ();# endif# endif# endif#endif#include <stdlib.h>#include <string.h>#if defined HAVE_UNISTD_H || defined _LIBC# include <unistd.h>#endif#ifdef _LIBC# include <langinfo.h># include <locale.h>#endif#if (defined HAVE_MMAP && defined HAVE_MUNMAP && !defined DISALLOW_MMAP) \ || (defined _LIBC && defined _POSIX_MAPPED_FILES)# include <sys/mman.h># undef HAVE_MMAP# define HAVE_MMAP 1#else# undef HAVE_MMAP#endif#if defined HAVE_STDINT_H_WITH_UINTMAX || defined _LIBC# include <stdint.h>#endif#if defined HAVE_INTTYPES_H || defined _LIBC# include <inttypes.h>#endif#include "gmo.h"#include "gettextP.h"#include "hash-string.h"#include "plural-exp.h"#ifdef _LIBC# include "../locale/localeinfo.h"#endif/* Provide fallback values for macros that ought to be defined in <inttypes.h>. Note that our fallback values need not be literal strings, because we don't use them with preprocessor string concatenation. */#if !defined PRId8 || PRI_MACROS_BROKEN# undef PRId8# define PRId8 "d"#endif#if !defined PRIi8 || PRI_MACROS_BROKEN# undef PRIi8# define PRIi8 "i"#endif#if !defined PRIo8 || PRI_MACROS_BROKEN# undef PRIo8# define PRIo8 "o"#endif#if !defined PRIu8 || PRI_MACROS_BROKEN# undef PRIu8# define PRIu8 "u"#endif#if !defined PRIx8 || PRI_MACROS_BROKEN# undef PRIx8# define PRIx8 "x"#endif#if !defined PRIX8 || PRI_MACROS_BROKEN# undef PRIX8# define PRIX8 "X"#endif#if !defined PRId16 || PRI_MACROS_BROKEN# undef PRId16# define PRId16 "d"#endif#if !defined PRIi16 || PRI_MACROS_BROKEN# undef PRIi16# define PRIi16 "i"#endif#if !defined PRIo16 || PRI_MACROS_BROKEN# undef PRIo16# define PRIo16 "o"#endif#if !defined PRIu16 || PRI_MACROS_BROKEN# undef PRIu16# define PRIu16 "u"#endif#if !defined PRIx16 || PRI_MACROS_BROKEN# undef PRIx16# define PRIx16 "x"#endif#if !defined PRIX16 || PRI_MACROS_BROKEN# undef PRIX16# define PRIX16 "X"#endif#if !defined PRId32 || PRI_MACROS_BROKEN# undef PRId32# define PRId32 "d"#endif#if !defined PRIi32 || PRI_MACROS_BROKEN# undef PRIi32# define PRIi32 "i"#endif#if !defined PRIo32 || PRI_MACROS_BROKEN# undef PRIo32# define PRIo32 "o"#endif#if !defined PRIu32 || PRI_MACROS_BROKEN# undef PRIu32# define PRIu32 "u"#endif#if !defined PRIx32 || PRI_MACROS_BROKEN# undef PRIx32# define PRIx32 "x"#endif#if !defined PRIX32 || PRI_MACROS_BROKEN# undef PRIX32# define PRIX32 "X"#endif#if !defined PRId64 || PRI_MACROS_BROKEN# undef PRId64# define PRId64 (sizeof (long) == 8 ? "ld" : "lld")#endif#if !defined PRIi64 || PRI_MACROS_BROKEN# undef PRIi64# define PRIi64 (sizeof (long) == 8 ? "li" : "lli")#endif#if !defined PRIo64 || PRI_MACROS_BROKEN# undef PRIo64# define PRIo64 (sizeof (long) == 8 ? "lo" : "llo")#endif#if !defined PRIu64 || PRI_MACROS_BROKEN# undef PRIu64# define PRIu64 (sizeof (long) == 8 ? "lu" : "llu")#endif#if !defined PRIx64 || PRI_MACROS_BROKEN# undef PRIx64# define PRIx64 (sizeof (long) == 8 ? "lx" : "llx")#endif#if !defined PRIX64 || PRI_MACROS_BROKEN# undef PRIX64# define PRIX64 (sizeof (long) == 8 ? "lX" : "llX")#endif#if !defined PRIdLEAST8 || PRI_MACROS_BROKEN# undef PRIdLEAST8# define PRIdLEAST8 "d"#endif#if !defined PRIiLEAST8 || PRI_MACROS_BROKEN# undef PRIiLEAST8# define PRIiLEAST8 "i"#endif#if !defined PRIoLEAST8 || PRI_MACROS_BROKEN# undef PRIoLEAST8# define PRIoLEAST8 "o"#endif#if !defined PRIuLEAST8 || PRI_MACROS_BROKEN# undef PRIuLEAST8# define PRIuLEAST8 "u"#endif#if !defined PRIxLEAST8 || PRI_MACROS_BROKEN# undef PRIxLEAST8# define PRIxLEAST8 "x"#endif#if !defined PRIXLEAST8 || PRI_MACROS_BROKEN# undef PRIXLEAST8# define PRIXLEAST8 "X"#endif#if !defined PRIdLEAST16 || PRI_MACROS_BROKEN# undef PRIdLEAST16# define PRIdLEAST16 "d"#endif#if !defined PRIiLEAST16 || PRI_MACROS_BROKEN# undef PRIiLEAST16# define PRIiLEAST16 "i"#endif#if !defined PRIoLEAST16 || PRI_MACROS_BROKEN# undef PRIoLEAST16# define PRIoLEAST16 "o"#endif#if !defined PRIuLEAST16 || PRI_MACROS_BROKEN# undef PRIuLEAST16# define PRIuLEAST16 "u"#endif#if !defined PRIxLEAST16 || PRI_MACROS_BROKEN# undef PRIxLEAST16# define PRIxLEAST16 "x"#endif#if !defined PRIXLEAST16 || PRI_MACROS_BROKEN# undef PRIXLEAST16# define PRIXLEAST16 "X"#endif#if !defined PRIdLEAST32 || PRI_MACROS_BROKEN# undef PRIdLEAST32# define PRIdLEAST32 "d"#endif#if !defined PRIiLEAST32 || PRI_MACROS_BROKEN# undef PRIiLEAST32# define PRIiLEAST32 "i"#endif#if !defined PRIoLEAST32 || PRI_MACROS_BROKEN# undef PRIoLEAST32# define PRIoLEAST32 "o"#endif#if !defined PRIuLEAST32 || PRI_MACROS_BROKEN# undef PRIuLEAST32# define PRIuLEAST32 "u"#endif#if !defined PRIxLEAST32 || PRI_MACROS_BROKEN# undef PRIxLEAST32# define PRIxLEAST32 "x"#endif#if !defined PRIXLEAST32 || PRI_MACROS_BROKEN# undef PRIXLEAST32# define PRIXLEAST32 "X"#endif#if !defined PRIdLEAST64 || PRI_MACROS_BROKEN# undef PRIdLEAST64# define PRIdLEAST64 PRId64#endif#if !defined PRIiLEAST64 || PRI_MACROS_BROKEN# undef PRIiLEAST64# define PRIiLEAST64 PRIi64#endif#if !defined PRIoLEAST64 || PRI_MACROS_BROKEN# undef PRIoLEAST64# define PRIoLEAST64 PRIo64#endif#if !defined PRIuLEAST64 || PRI_MACROS_BROKEN# undef PRIuLEAST64# define PRIuLEAST64 PRIu64#endif#if !defined PRIxLEAST64 || PRI_MACROS_BROKEN# undef PRIxLEAST64# define PRIxLEAST64 PRIx64#endif#if !defined PRIXLEAST64 || PRI_MACROS_BROKEN# undef PRIXLEAST64# define PRIXLEAST64 PRIX64#endif#if !defined PRIdFAST8 || PRI_MACROS_BROKEN# undef PRIdFAST8# define PRIdFAST8 "d"#endif#if !defined PRIiFAST8 || PRI_MACROS_BROKEN# undef PRIiFAST8# define PRIiFAST8 "i"#endif#if !defined PRIoFAST8 || PRI_MACROS_BROKEN# undef PRIoFAST8# define PRIoFAST8 "o"#endif#if !defined PRIuFAST8 || PRI_MACROS_BROKEN# undef PRIuFAST8# define PRIuFAST8 "u"#endif#if !defined PRIxFAST8 || PRI_MACROS_BROKEN# undef PRIxFAST8# define PRIxFAST8 "x"#endif#if !defined PRIXFAST8 || PRI_MACROS_BROKEN# undef PRIXFAST8# define PRIXFAST8 "X"#endif#if !defined PRIdFAST16 || PRI_MACROS_BROKEN# undef PRIdFAST16# define PRIdFAST16 "d"#endif#if !defined PRIiFAST16 || PRI_MACROS_BROKEN# undef PRIiFAST16# define PRIiFAST16 "i"#endif#if !defined PRIoFAST16 || PRI_MACROS_BROKEN# undef PRIoFAST16# define PRIoFAST16 "o"#endif#if !defined PRIuFAST16 || PRI_MACROS_BROKEN# undef PRIuFAST16# define PRIuFAST16 "u"#endif#if !defined PRIxFAST16 || PRI_MACROS_BROKEN# undef PRIxFAST16# define PRIxFAST16 "x"#endif#if !defined PRIXFAST16 || PRI_MACROS_BROKEN# undef PRIXFAST16# define PRIXFAST16 "X"#endif#if !defined PRIdFAST32 || PRI_MACROS_BROKEN# undef PRIdFAST32# define PRIdFAST32 "d"#endif#if !defined PRIiFAST32 || PRI_MACROS_BROKEN# undef PRIiFAST32# define PRIiFAST32 "i"#endif#if !defined PRIoFAST32 || PRI_MACROS_BROKEN# undef PRIoFAST32# define PRIoFAST32 "o"#endif#if !defined PRIuFAST32 || PRI_MACROS_BROKEN# undef PRIuFAST32# define PRIuFAST32 "u"#endif#if !defined PRIxFAST32 || PRI_MACROS_BROKEN# undef PRIxFAST32# define PRIxFAST32 "x"#endif#if !defined PRIXFAST32 || PRI_MACROS_BROKEN# undef PRIXFAST32# define PRIXFAST32 "X"#endif#if !defined PRIdFAST64 || PRI_MACROS_BROKEN# undef PRIdFAST64# define PRIdFAST64 PRId64#endif#if !defined PRIiFAST64 || PRI_MACROS_BROKEN# undef PRIiFAST64# define PRIiFAST64 PRIi64#endif#if !defined PRIoFAST64 || PRI_MACROS_BROKEN# undef PRIoFAST64# define PRIoFAST64 PRIo64#endif#if !defined PRIuFAST64 || PRI_MACROS_BROKEN# undef PRIuFAST64# define PRIuFAST64 PRIu64#endif#if !defined PRIxFAST64 || PRI_MACROS_BROKEN# undef PRIxFAST64# define PRIxFAST64 PRIx64#endif#if !defined PRIXFAST64 || PRI_MACROS_BROKEN# undef PRIXFAST64# define PRIXFAST64 PRIX64#endif#if !defined PRIdMAX || PRI_MACROS_BROKEN# undef PRIdMAX# define PRIdMAX (sizeof (uintmax_t) == sizeof (long) ? "ld" : "lld")#endif#if !defined PRIiMAX || PRI_MACROS_BROKEN# undef PRIiMAX# define PRIiMAX (sizeof (uintmax_t) == sizeof (long) ? "li" : "lli")#endif#if !defined PRIoMAX || PRI_MACROS_BROKEN# undef PRIoMAX# define PRIoMAX (sizeof (uintmax_t) == sizeof (long) ? "lo" : "llo")#endif#if !defined PRIuMAX || PRI_MACROS_BROKEN# undef PRIuMAX# define PRIuMAX (sizeof (uintmax_t) == sizeof (long) ? "lu" : "llu")#endif#if !defined PRIxMAX || PRI_MACROS_BROKEN# undef PRIxMAX# define PRIxMAX (sizeof (uintmax_t) == sizeof (long) ? "lx" : "llx")#endif#if !defined PRIXMAX || PRI_MACROS_BROKEN# undef PRIXMAX# define PRIXMAX (sizeof (uintmax_t) == sizeof (long) ? "lX" : "llX")#endif#if !defined PRIdPTR || PRI_MACROS_BROKEN# undef PRIdPTR# define PRIdPTR \ (sizeof (void *) == sizeof (long) ? "ld" : \ sizeof (void *) == sizeof (int) ? "d" : \ "lld")#endif#if !defined PRIiPTR || PRI_MACROS_BROKEN# undef PRIiPTR# define PRIiPTR \ (sizeof (void *) == sizeof (long) ? "li" : \ sizeof (void *) == sizeof (int) ? "i" : \ "lli")#endif#if !defined PRIoPTR || PRI_MACROS_BROKEN# undef PRIoPTR# define PRIoPTR \ (sizeof (void *) == sizeof (long) ? "lo" : \ sizeof (void *) == sizeof (int) ? "o" : \ "llo")#endif#if !defined PRIuPTR || PRI_MACROS_BROKEN# undef PRIuPTR# define PRIuPTR \ (sizeof (void *) == sizeof (long) ? "lu" : \ sizeof (void *) == sizeof (int) ? "u" : \ "llu")#endif#if !defined PRIxPTR || PRI_MACROS_BROKEN# undef PRIxPTR# define PRIxPTR \ (sizeof (void *) == sizeof (long) ? "lx" : \ sizeof (void *) == sizeof (int) ? "x" : \ "llx")#endif
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -