diff options
author | Changwoo Ryu <cwryu@src.gnome.org> | 1998-02-08 17:44:13 +0000 |
---|---|---|
committer | Changwoo Ryu <cwryu@src.gnome.org> | 1998-02-08 17:44:13 +0000 |
commit | fd97971a478cc4026bd2b11cd431946547b520e9 (patch) | |
tree | 7314366e4bb5943ae2a933913fdb38cb7365edcb /intl/cat-compat.c | |
parent | afc41fa966b013332fd7b1844607e4f78f192389 (diff) | |
download | shared-mime-info-fd97971a478cc4026bd2b11cd431946547b520e9.tar.gz |
Use code in gettext 0.32.
svn path=/trunk/; revision=60
Diffstat (limited to 'intl/cat-compat.c')
-rw-r--r-- | intl/cat-compat.c | 42 |
1 files changed, 26 insertions, 16 deletions
diff --git a/intl/cat-compat.c b/intl/cat-compat.c index 39fcfb43..867d901b 100644 --- a/intl/cat-compat.c +++ b/intl/cat-compat.c @@ -1,20 +1,19 @@ /* Compatibility code for gettext-using-catgets interface. - Copyright (C) 1995 Free Software Foundation, Inc. + Copyright (C) 1995, 1997 Free Software Foundation, Inc. -The GNU C Library 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 of the -License, or (at your option) any later version. + 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. -The GNU C Library 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. + 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 Library General Public -License along with the GNU C Library; see the file COPYING.LIB. If -not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, -Boston, MA 02111-1307, USA. */ + 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 <config.h> @@ -40,6 +39,16 @@ char *getenv (); /* @@ end of prolog @@ */ +/* XPG3 defines the result of `setlocale (category, NULL)' as: + ``Directs `setlocale()' to query `category' and return the current + setting of `local'.'' + However it does not specify the exact format. And even worse: POSIX + defines this not at all. So we can use this feature only on selected + system (e.g. those using GNU C Library). */ +#ifdef _LIBC +# define HAVE_LOCALE_NULL +#endif + /* The catalog descriptor. */ static nl_catd catalog = (nl_catd) -1; @@ -50,11 +59,11 @@ static const char default_catalog_name[] = "messages"; static const char *catalog_name = default_catalog_name; /* Get ID for given string. If not found return -1. */ -static int msg_to_cat_id __P ((const char *msg)); +static int msg_to_cat_id PARAMS ((const char *msg)); /* Substitution for systems lacking this function in their C library. */ #if !_LIBC && !HAVE_STPCPY -static char *stpcpy __P ((char *dest, const char *src)); +static char *stpcpy PARAMS ((char *dest, const char *src)); #endif @@ -68,7 +77,8 @@ textdomain (domainname) size_t new_name_len; char *lang; -#if HAVE_SETLOCALE && HAVE_LC_MESSAGES && HAVE_SETLOCALE_NULL +#if defined HAVE_SETLOCALE && defined HAVE_LC_MESSAGES \ + && defined HAVE_LOCALE_NULL lang = setlocale (LC_MESSAGES, NULL); #else lang = getenv ("LC_ALL"); |