From 360f8a2618bb34181bf5e298b291fc40955d07a0 Mon Sep 17 00:00:00 2001 From: Bruno Haible Date: Fri, 30 May 2003 13:29:10 +0000 Subject: [PATCH] Upgrade to gettext-0.12.1. --- lib/ChangeLog | 6 ++++++ lib/config.charset | 5 +++-- lib/localcharset.c | 44 +++++++++++++++++++++++++++++++++++--------- lib/localcharset.h | 37 ++++++++++++++++++++++++++++--------- 4 files changed, 72 insertions(+), 20 deletions(-) diff --git a/lib/ChangeLog b/lib/ChangeLog index bfa1f96533..fa45b31f96 100644 --- a/lib/ChangeLog +++ b/lib/ChangeLog @@ -1,3 +1,9 @@ +2003-05-30 Bruno Haible + + * config.charset: Upgrade to gettext-0.12.1 and libiconv-1.9.1. + * localcharset.h: Likewise. + * localcharset.c: Likewise. + 2003-05-28 Paul Eggert Assume the headers required for C89 freestanding compilers. diff --git a/lib/config.charset b/lib/config.charset index 4f98b5b0ca..32becece96 100755 --- a/lib/config.charset +++ b/lib/config.charset @@ -1,7 +1,7 @@ #! /bin/sh # Output a system dependent table of character encoding aliases. # -# Copyright (C) 2000-2002 Free Software Foundation, Inc. +# Copyright (C) 2000-2003 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 @@ -71,7 +71,7 @@ # CP1125 dos # CP1129 aix # CP1250 woe32 -# CP1251 glibc woe32 +# CP1251 glibc solaris woe32 # CP1252 aix woe32 # CP1253 woe32 # CP1254 woe32 @@ -231,6 +231,7 @@ case "$os" in echo "ISO8859-9 ISO-8859-9" echo "ISO8859-15 ISO-8859-15" echo "koi8-r KOI8-R" + echo "ansi-1251 CP1251" echo "BIG5 BIG5" echo "Big5-HKSCS BIG5-HKSCS" echo "gb2312 GB2312" diff --git a/lib/localcharset.c b/lib/localcharset.c index dad97308c7..d04d05368f 100644 --- a/lib/localcharset.c +++ b/lib/localcharset.c @@ -1,6 +1,6 @@ /* Determine a canonical name for the current locale's character encoding. - Copyright (C) 2000-2002 Free Software Foundation, Inc. + Copyright (C) 2000-2003 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 @@ -67,6 +67,12 @@ # include #endif +#if ENABLE_RELOCATABLE +# include "relocatable.h" +#else +# define relocate(pathname) (pathname) +#endif + #if defined _WIN32 || defined __WIN32__ || defined __EMX__ || defined __DJGPP__ /* Win32, OS/2, DOS */ # define ISSLASH(C) ((C) == '/' || (C) == '\\') @@ -85,11 +91,6 @@ # define getc getc_unlocked #endif -#ifdef __cplusplus -/* When compiling with "gcc -x c++", produce a function with C linkage. */ -extern "C" const char * locale_charset (void); -#endif - /* The following static variable is declared 'volatile' to avoid a possible multithread problem in the function get_charset_aliases. If we are running in a threaded environment, and if two threads initialize @@ -113,9 +114,9 @@ get_charset_aliases () cp = charset_aliases; if (cp == NULL) { -#if !defined WIN32 +#if !(defined VMS || defined WIN32) FILE *fp; - const char *dir = LIBDIR; + const char *dir = relocate (LIBDIR); const char *base = "charset.alias"; char *file_name; @@ -203,11 +204,36 @@ get_charset_aliases () #else +# if defined VMS + /* To avoid the troubles of an extra file charset.alias_vms in the + sources of many GNU packages, simply inline the aliases here. */ + /* The list of encodings is taken from the OpenVMS 7.3-1 documentation + "Compaq C Run-Time Library Reference Manual for OpenVMS systems" + section 10.7 "Handling Different Character Sets". */ + cp = "ISO8859-1" "\0" "ISO-8859-1" "\0" + "ISO8859-2" "\0" "ISO-8859-2" "\0" + "ISO8859-5" "\0" "ISO-8859-5" "\0" + "ISO8859-7" "\0" "ISO-8859-7" "\0" + "ISO8859-8" "\0" "ISO-8859-8" "\0" + "ISO8859-9" "\0" "ISO-8859-9" "\0" + /* Japanese */ + "eucJP" "\0" "EUC-JP" "\0" + "SJIS" "\0" "SHIFT_JIS" "\0" + "DECKANJI" "\0" "DEC-KANJI" "\0" + "SDECKANJI" "\0" "EUC-JP" "\0" + /* Chinese */ + "eucTW" "\0" "EUC-TW" "\0" + "DECHANYU" "\0" "DEC-HANYU" "\0" + "DECHANZI" "\0" "GB2312" "\0" + /* Korean */ + "DECKOREAN" "\0" "EUC-KR" "\0"; +# endif + +# if defined WIN32 /* To avoid the troubles of installing a separate file in the same directory as the DLL and of retrieving the DLL's directory at runtime, simply inline the aliases here. */ -# if defined WIN32 cp = "CP936" "\0" "GBK" "\0" "CP1361" "\0" "JOHAB" "\0" "CP20127" "\0" "ASCII" "\0" diff --git a/lib/localcharset.h b/lib/localcharset.h index 2522e92ede..3b137e73c5 100644 --- a/lib/localcharset.h +++ b/lib/localcharset.h @@ -1,19 +1,30 @@ /* Determine a canonical name for the current locale's character encoding. - Copyright (C) 2002 Free Software Foundation, Inc. + Copyright (C) 2000-2003 Free Software Foundation, Inc. + This file is part of the GNU CHARSET Library. - 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) + 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 General Public License for more details. + 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. */ + +#ifndef _LOCALCHARSET_H +#define _LOCALCHARSET_H + + +#ifdef __cplusplus +extern "C" { +#endif - 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. */ /* Determine the current locale's character encoding, and canonicalize it into one of the canonical names listed in config.charset. @@ -21,3 +32,11 @@ If the canonical name cannot be determined, the result is a non-canonical name. */ extern const char * locale_charset (void); + + +#ifdef __cplusplus +} +#endif + + +#endif /* _LOCALCHARSET_H */ -- 2.30.2