From: Bruno Haible Date: Tue, 14 Jan 2003 13:35:05 +0000 (+0000) Subject: New file localcharset.h. X-Git-Tag: v0.12~1172 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=f3cd698b78fd234bcc1a2ba5c528a54dae507ae1;p=thirdparty%2Fgettext.git New file localcharset.h. --- diff --git a/intl/ChangeLog b/intl/ChangeLog index 233f72b66..1a507a3c5 100644 --- a/intl/ChangeLog +++ b/intl/ChangeLog @@ -1,3 +1,11 @@ +2003-01-12 Bruno Haible + + * localcharset.h: New file. + * localcharset.c: Include it. + * Makefile.in (HEADERS): Add localcharset.h. + (COMHDRS): Remove variable, fold into HEADERS. + (COMSRCS): Remove variable, fold into SOURCES. + 2002-12-12 Bruno Haible * dcigettext.c (INTVARDEF): Correct fallback definition. diff --git a/intl/Makefile.in b/intl/Makefile.in index 65cd6b5fe..79fa7cc04 100644 --- a/intl/Makefile.in +++ b/intl/Makefile.in @@ -1,5 +1,5 @@ # Makefile for directory with message catalog handling in GNU NLS Utilities. -# Copyright (C) 1995-1998, 2000-2002 Free Software Foundation, Inc. +# Copyright (C) 1995-1998, 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 @@ -59,13 +59,12 @@ LDFLAGS = @LDFLAGS@ COMPILE = $(CC) -c $(DEFS) $(INCLUDES) $(CPPFLAGS) $(CFLAGS) $(XCFLAGS) -HEADERS = $(COMHDRS) libgnuintl.h loadinfo.h -COMHDRS = gmo.h gettextP.h hash-string.h plural-exp.h eval-plural.h os2compat.h -SOURCES = $(COMSRCS) intl-compat.c -COMSRCS = bindtextdom.c dcgettext.c dgettext.c gettext.c \ +HEADERS = gmo.h gettextP.h hash-string.h loadinfo.h plural-exp.h \ +eval-plural.h localcharset.h os2compat.h libgnuintl.h +SOURCES = bindtextdom.c dcgettext.c dgettext.c gettext.c \ finddomain.c loadmsgcat.c localealias.c textdomain.c l10nflist.c \ explodename.c dcigettext.c dcngettext.c dngettext.c ngettext.c plural.y \ -plural-exp.c localcharset.c localename.c osdep.c os2compat.c +plural-exp.c localcharset.c localename.c osdep.c os2compat.c intl-compat.c OBJECTS = @INTLOBJS@ bindtextdom.$lo dcgettext.$lo dgettext.$lo gettext.$lo \ finddomain.$lo loadmsgcat.$lo localealias.$lo textdomain.$lo l10nflist.$lo \ explodename.$lo dcigettext.$lo dcngettext.$lo dngettext.$lo ngettext.$lo \ diff --git a/intl/localcharset.c b/intl/localcharset.c index 2b1564e2f..dad97308c 100644 --- a/intl/localcharset.c +++ b/intl/localcharset.c @@ -23,6 +23,9 @@ # include #endif +/* Specification. */ +#include "localcharset.h" + #if HAVE_STDDEF_H # include #endif diff --git a/intl/localcharset.h b/intl/localcharset.h new file mode 100644 index 000000000..2522e92ed --- /dev/null +++ b/intl/localcharset.h @@ -0,0 +1,23 @@ +/* Determine a canonical name for the current locale's character encoding. + Copyright (C) 2002 Free Software Foundation, Inc. + + 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. */ + +/* Determine the current locale's character encoding, and canonicalize it + into one of the canonical names listed in config.charset. + The result must not be freed; it is statically allocated. + If the canonical name cannot be determined, the result is a non-canonical + name. */ +extern const char * locale_charset (void); diff --git a/lib/ChangeLog b/lib/ChangeLog index fd8e89af4..84bbb4f1c 100644 --- a/lib/ChangeLog +++ b/lib/ChangeLog @@ -1,3 +1,9 @@ +2003-01-12 Bruno Haible + + * localcharset.h: New file. + * localcharset.c: Include it. + * Makefile.am (libgettextlib_la_SOURCES): Add localcharset.h. + 2003-01-12 Bruno Haible * alloca_.h: New file, from gnulib. diff --git a/lib/Makefile.am b/lib/Makefile.am index 3caa9cb95..c300e0e38 100644 --- a/lib/Makefile.am +++ b/lib/Makefile.am @@ -151,7 +151,7 @@ MOSTLYCLEANFILES += alloca.h # >>> gnulib module localcharset. -libgettextlib_la_SOURCES += localcharset.c +libgettextlib_la_SOURCES += localcharset.h localcharset.c EXTRA_DIST += config.charset ref-add.sin ref-del.sin DEFS += -DLIBDIR=\"$(libdir)\" diff --git a/lib/localcharset.c b/lib/localcharset.c index 2b1564e2f..dad97308c 100644 --- a/lib/localcharset.c +++ b/lib/localcharset.c @@ -23,6 +23,9 @@ # include #endif +/* Specification. */ +#include "localcharset.h" + #if HAVE_STDDEF_H # include #endif diff --git a/lib/localcharset.h b/lib/localcharset.h new file mode 100644 index 000000000..2522e92ed --- /dev/null +++ b/lib/localcharset.h @@ -0,0 +1,23 @@ +/* Determine a canonical name for the current locale's character encoding. + Copyright (C) 2002 Free Software Foundation, Inc. + + 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. */ + +/* Determine the current locale's character encoding, and canonicalize it + into one of the canonical names listed in config.charset. + The result must not be freed; it is statically allocated. + If the canonical name cannot be determined, the result is a non-canonical + name. */ +extern const char * locale_charset (void); diff --git a/src/ChangeLog b/src/ChangeLog index 550e1565f..1ecccb412 100644 --- a/src/ChangeLog +++ b/src/ChangeLog @@ -1,3 +1,12 @@ +2003-01-12 Bruno Haible + + * msgconv.c: Include localcharset.h. + (locale_charset): Remove declaration. + * msginit.c: Include localcharset.h. + (locale_charset): Remove declaration. + * msgl-charset.c: Include localcharset.h. + (locale_charset): Remove declaration. + 2003-01-12 Bruno Haible * format-java.c: Include alloca.h instead of liballoca.h. diff --git a/src/msgconv.c b/src/msgconv.c index a95094662..e5eda8579 100644 --- a/src/msgconv.c +++ b/src/msgconv.c @@ -1,5 +1,5 @@ /* Converts a translation catalog to a different character encoding. - Copyright (C) 2001-2002 Free Software Foundation, Inc. + Copyright (C) 2001-2003 Free Software Foundation, Inc. Written by Bruno Haible , 2001. This program is free software; you can redistribute it and/or modify @@ -35,13 +35,12 @@ #include "read-po.h" #include "write-po.h" #include "msgl-iconv.h" +#include "localcharset.h" #include "exit.h" #include "gettext.h" #define _(str) gettext (str) -extern const char * locale_charset (void); - /* Force output of PO file even if empty. */ static int force_po; diff --git a/src/msginit.c b/src/msginit.c index 75c926fd2..339a8ab23 100644 --- a/src/msginit.c +++ b/src/msginit.c @@ -75,6 +75,7 @@ #include "read-po.h" #include "write-po.h" #include "po-charset.h" +#include "localcharset.h" #include "po-time.h" #include "plural-table.h" #include "xmalloc.h" @@ -94,7 +95,6 @@ #define SIZEOF(a) (sizeof(a) / sizeof(a[0])) -extern const char * locale_charset (void); extern const char * _nl_locale_name (int category, const char *categoryname); extern const char * _nl_expand_alias (const char *name); diff --git a/src/msgl-charset.c b/src/msgl-charset.c index 777f809e7..582193cf2 100644 --- a/src/msgl-charset.c +++ b/src/msgl-charset.c @@ -29,6 +29,7 @@ #include #include "po-charset.h" +#include "localcharset.h" #include "error.h" #include "progname.h" #include "basename.h" @@ -40,8 +41,6 @@ #define _(str) gettext (str) -extern const char * locale_charset (void); - void compare_po_locale_charsets (const msgdomain_list_ty *mdlp) {