Update of /cvsroot/lib/LIB/intl In directory usw-pr-cvs1:/tmp/cvs-serv22416/intl Modified Files: ChangeLog Makefile.in VERSION bindtextdom.c dcgettext.c dgettext.c explodename.c finddomain.c gettext.c gettext.h gettextP.h hash-string.h intl-compat.c l10nflist.c libgettext.h loadinfo.h loadmsgcat.c localealias.c textdomain.c Log Message: * usuniêty komunikat o braku ./lib.data * rozgrzebane init_locale * uaktualnione intl/ Index: ChangeLog =================================================================== RCS file: /cvsroot/lib/LIB/intl/ChangeLog,v retrieving revision 1.1.1.1 retrieving revision 1.2 diff -C2 -d -r1.1.1.1 -r1.2 *** ChangeLog 10 May 2000 11:31:47 -0000 1.1.1.1 --- ChangeLog 10 Jul 2002 22:13:49 -0000 1.2 *************** *** 1,1086 **** ! 1998-04-29 Ulrich Drepper <dr...@cy...> ! ! * intl/localealias.c (read_alias_file): Use unsigned char for ! local variables. Remove unused variable tp. ! * intl/l10nflist.c (_nl_normalize_codeset): Use unsigned char * ! for type of codeset. For loosing Solaris systems. ! * intl/loadinfo.h: Adapt prototype of _nl_normalize_codeset. ! * intl/bindtextdom.c (BINDTEXTDOMAIN): Don't define local variable ! len if not needed. ! Patches by Jim Meyering. [...1061 lines suppressed...] ! * po-to-tbl.sed: Adopt for new .po file format. ! ! * linux-msg.sed, xopen-msg.sed: Adopt for new .po file format. ! ! Sun Jul 2 23:55:03 1995 Ulrich Drepper <drepper@myware> ! ! * tupdate.perl.in: Complete rewrite for new .po file format. ! Sun Jul 2 02:06:50 1995 Ulrich Drepper <drepper@myware> - * First official release. This directory contains all the code - needed to internationalize own packages. It provides functions - which allow to use the X/Open catgets function with an interface - like the Uniforum gettext function. For system which does not - have neither of those a complete implementation is provided. --- 1,4 ---- ! 2001-09-13 GNU <bug...@gn...> ! * Version 0.10.40 released. Index: Makefile.in =================================================================== RCS file: /cvsroot/lib/LIB/intl/Makefile.in,v retrieving revision 1.1.1.1 retrieving revision 1.2 diff -C2 -d -r1.1.1.1 -r1.2 *** Makefile.in 10 May 2000 11:31:47 -0000 1.1.1.1 --- Makefile.in 10 Jul 2002 22:13:50 -0000 1.2 *************** *** 1,18 **** # Makefile for directory with message catalog handling in GNU NLS Utilities. ! # Copyright (C) 1995, 1996, 1997 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. PACKAGE = @PACKAGE@ --- 1,19 ---- # Makefile for directory with message catalog handling in GNU NLS Utilities. ! # Copyright (C) 1995-1998, 2000, 2001 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. PACKAGE = @PACKAGE@ *************** *** 29,39 **** exec_prefix = @exec_prefix@ transform = @program_transform_name@ ! libdir = $(exec_prefix)/lib ! includedir = $(prefix)/include ! datadir = $(prefix)/@DATADIRNAME@ localedir = $(datadir)/locale ! gnulocaledir = $(prefix)/share/locale ! gettextsrcdir = @datadir@/gettext/intl ! aliaspath = $(localedir):. subdir = intl --- 30,39 ---- exec_prefix = @exec_prefix@ transform = @program_transform_name@ ! libdir = @libdir@ ! includedir = @includedir@ ! datadir = @datadir@ localedir = $(datadir)/locale ! gettextsrcdir = $(datadir)/gettext/intl ! aliaspath = $(localedir) subdir = intl *************** *** 41,46 **** INSTALL_DATA = @INSTALL_DATA@ MKINSTALLDIRS = @MKINSTALLDIRS@ ! l = @l@ AR = ar --- 41,47 ---- INSTALL_DATA = @INSTALL_DATA@ MKINSTALLDIRS = @MKINSTALLDIRS@ + mkinstalldirs = $(SHELL) `case "$(MKINSTALLDIRS)" in /*) echo "$(MKINSTALLDIRS)" ;; *) echo "$(top_builddir)/$(MKINSTALLDIRS)" ;; esac` ! l = @INTL_LIBTOOL_SUFFIX_PREFIX@ AR = ar *************** *** 48,54 **** LIBTOOL = @LIBTOOL@ RANLIB = @RANLIB@ ! DEFS = -DLOCALEDIR=\"$(localedir)\" -DGNULOCALEDIR=\"$(gnulocaledir)\" \ ! -DLOCALE_ALIAS_PATH=\"$(aliaspath)\" @DEFS@ CPPFLAGS = @CPPFLAGS@ CFLAGS = @CFLAGS@ --- 49,57 ---- LIBTOOL = @LIBTOOL@ RANLIB = @RANLIB@ + YACC = @INTLBISON@ -y -d + YFLAGS = --name-prefix=__gettext ! DEFS = -DLOCALEDIR=\"$(localedir)\" -DLOCALE_ALIAS_PATH=\"$(aliaspath)\" \ ! -DLIBDIR=\"$(libdir)\" @DEFS@ CPPFLAGS = @CPPFLAGS@ CFLAGS = @CFLAGS@ *************** *** 57,78 **** COMPILE = $(CC) -c $(DEFS) $(INCLUDES) $(CPPFLAGS) $(CFLAGS) $(XCFLAGS) ! HEADERS = $(COMHDRS) libgettext.h loadinfo.h COMHDRS = gettext.h gettextP.h hash-string.h ! SOURCES = $(COMSRCS) intl-compat.c cat-compat.c COMSRCS = bindtextdom.c dcgettext.c dgettext.c gettext.c \ finddomain.c loadmsgcat.c localealias.c textdomain.c l10nflist.c \ ! explodename.c OBJECTS = @INTLOBJS@ bindtextdom.$lo dcgettext.$lo dgettext.$lo gettext.$lo \ finddomain.$lo loadmsgcat.$lo localealias.$lo textdomain.$lo l10nflist.$lo \ ! explodename.$lo ! CATOBJS = cat-compat.$lo ../po/cat-id-tbl.$lo GETTOBJS = intl-compat.$lo ! DISTFILES.common = ChangeLog Makefile.in linux-msg.sed po2tbl.sed.in \ ! xopen-msg.sed $(HEADERS) $(SOURCES) DISTFILES.normal = VERSION ! DISTFILES.gettext = libintl.glibc intlh.inst.in .SUFFIXES: ! .SUFFIXES: .c .o .lo .c.o: $(COMPILE) $< --- 60,93 ---- COMPILE = $(CC) -c $(DEFS) $(INCLUDES) $(CPPFLAGS) $(CFLAGS) $(XCFLAGS) ! HEADERS = $(COMHDRS) libgnuintl.h libgettext.h loadinfo.h COMHDRS = gettext.h gettextP.h hash-string.h ! SOURCES = $(COMSRCS) intl-compat.c COMSRCS = 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 \ ! localcharset.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 \ ! plural.$lo localcharset.$lo GETTOBJS = intl-compat.$lo ! DISTFILES.common = Makefile.in \ ! config.charset locale.alias ref-add.sin ref-del.sin $(HEADERS) $(SOURCES) ! DISTFILES.generated = plural.c DISTFILES.normal = VERSION ! DISTFILES.gettext = COPYING.LIB-2 COPYING.LIB-2.1 libintl.glibc ! DISTFILES.obsolete = xopen-msg.sed linux-msg.sed po2tbl.sed.in cat-compat.c ! ! # Libtool's library version information for libintl. ! # Before making a gettext release, the gettext maintainer must change this ! # according to the libtool documentation, section "Library interface versions". ! # Maintainers of other packages that include the intl directory must *not* ! # change these values. ! LTV_CURRENT=1 ! LTV_REVISION=1 ! LTV_AGE=0 .SUFFIXES: ! .SUFFIXES: .c .y .o .lo .sin .sed .c.o: $(COMPILE) $< *************** *** 80,101 **** $(LIBTOOL) --mode=compile $(COMPILE) $< ! INCLUDES = -I.. -I. -I$(top_srcdir)/intl -I$(top_srcdir)/lib ! all: all-@USE_INCLUDED_LIBINTL@ ! all-yes: libintl.$la intlh.inst ! all-no: ! libintl.a: $(OBJECTS) rm -f $@ $(AR) cru $@ $(OBJECTS) $(RANLIB) $@ ! libintl.la: $(OBJECTS) ! $(LIBTOOL) --mode=link $(CC) $(LDFLAGS) -o $@ $(OBJECTS) \ ! -version-info 1:0 -rpath $(libdir) ! ../po/cat-id-tbl.$lo: ../po/cat-id-tbl.c $(top_srcdir)/po/$(PACKAGE).pot ! cd ../po && $(MAKE) cat-id-tbl.$lo check: all --- 95,133 ---- $(LIBTOOL) --mode=compile $(COMPILE) $< ! .y.c: ! $(YACC) $(YFLAGS) --output $@ $< ! rm -f $*.h ! .sin.sed: ! sed -e '/^#/d' -e 's/@''PACKAGE''@/@PACKAGE@/g' $< > t-$@ ! mv t-$@ $@ ! INCLUDES = -I.. -I. -I$(top_srcdir)/intl ! all: all-@USE_INCLUDED_LIBINTL@ ! all-yes: libintl.$la libintl.h charset.alias ref-add.sed ref-del.sed ! all-no: all-no-@BUILD_INCLUDED_LIBINTL@ ! all-no-yes: libgnuintl.$la ! all-no-no: ! ! libintl.a libgnuintl.a: $(OBJECTS) rm -f $@ $(AR) cru $@ $(OBJECTS) $(RANLIB) $@ ! libintl.la libgnuintl.la: $(OBJECTS) ! $(LIBTOOL) --mode=link \ ! $(CC) $(CPPFLAGS) $(CFLAGS) $(XCFLAGS) $(LDFLAGS) -o $@ \ ! $(OBJECTS) @LIBICONV@ \ ! -version-info $(LTV_CURRENT):$(LTV_REVISION):$(LTV_AGE) \ ! -rpath $(libdir) \ ! -no-undefined ! libintl.h: libgnuintl.h ! cp $(srcdir)/libgnuintl.h libintl.h ! ! charset.alias: config.charset ! $(SHELL) $(srcdir)/config.charset '@host@' > t-$@ ! mv t-$@ $@ check: all *************** *** 105,111 **** # We must not install the libintl.h/libintl.a files if we are on a ! # system which has the gettext() function in its C library or in a ! # separate library or use the catgets interface. A special case is ! # where configure found a previously installed GNU gettext library. # If you want to use the one which comes with this version of the # package, you have to use `configure --with-included-gettext'. --- 137,142 ---- # We must not install the libintl.h/libintl.a files if we are on a ! # system which has the GNU gettext() function in its C library or in a ! # separate library. # If you want to use the one which comes with this version of the # package, you have to use `configure --with-included-gettext'. *************** *** 114,124 **** if test "$(PACKAGE)" = "gettext" \ && test '@INTLOBJS@' = '$(GETTOBJS)'; then \ ! if test -r $(MKINSTALLDIRS); then \ ! $(MKINSTALLDIRS) $(libdir) $(includedir); \ else \ ! $(top_srcdir)/mkinstalldirs $(libdir) $(includedir); \ fi; \ ! $(INSTALL_DATA) intlh.inst $(includedir)/libintl.h; \ ! $(INSTALL_DATA) libintl.a $(libdir)/libintl.a; \ else \ : ; \ --- 145,181 ---- if test "$(PACKAGE)" = "gettext" \ && test '@INTLOBJS@' = '$(GETTOBJS)'; then \ ! $(mkinstalldirs) $(DESTDIR)$(libdir) $(DESTDIR)$(includedir); \ ! $(INSTALL_DATA) libintl.h $(DESTDIR)$(includedir)/libintl.h; \ ! $(LIBTOOL) --mode=install \ ! $(INSTALL_DATA) libintl.$la $(DESTDIR)$(libdir)/libintl.$la; \ ! else \ ! : ; \ ! fi ! if test '@USE_INCLUDED_LIBINTL@' = yes; then \ ! $(mkinstalldirs) $(DESTDIR)$(libdir); \ ! temp=$(DESTDIR)$(libdir)/t-charset.alias; \ ! dest=$(DESTDIR)$(libdir)/charset.alias; \ ! if test -f $(DESTDIR)$(libdir)/charset.alias; then \ ! orig=$(DESTDIR)$(libdir)/charset.alias; \ ! sed -f ref-add.sed $$orig > $$temp; \ ! $(INSTALL_DATA) $$temp $$dest; \ ! rm -f $$temp; \ else \ ! if test @GLIBC21@ = no; then \ ! orig=charset.alias; \ ! sed -f ref-add.sed $$orig > $$temp; \ ! $(INSTALL_DATA) $$temp $$dest; \ ! rm -f $$temp; \ ! fi; \ fi; \ ! $(mkinstalldirs) $(DESTDIR)$(localedir); \ ! test -f $(DESTDIR)$(localedir)/locale.alias \ ! && orig=$(DESTDIR)$(localedir)/locale.alias \ ! || orig=$(srcdir)/locale.alias; \ ! temp=$(DESTDIR)$(localedir)/t-locale.alias; \ ! dest=$(DESTDIR)$(localedir)/locale.alias; \ ! sed -f ref-add.sed $$orig > $$temp; \ ! $(INSTALL_DATA) $$temp $$dest; \ ! rm -f $$temp; \ else \ : ; \ *************** *** 126,138 **** install-data: all if test "$(PACKAGE)" = "gettext"; then \ ! if test -r $(MKINSTALLDIRS); then \ ! $(MKINSTALLDIRS) $(gettextsrcdir); \ ! else \ ! $(top_srcdir)/mkinstalldirs $(gettextsrcdir); \ ! fi; \ ! $(INSTALL_DATA) VERSION $(gettextsrcdir)/VERSION; \ ! dists="$(DISTFILES.common)"; \ for file in $$dists; do \ ! $(INSTALL_DATA) $(srcdir)/$$file $(gettextsrcdir)/$$file; \ done; \ else \ --- 183,204 ---- install-data: all if test "$(PACKAGE)" = "gettext"; then \ ! $(mkinstalldirs) $(DESTDIR)$(gettextsrcdir); \ ! $(INSTALL_DATA) VERSION $(DESTDIR)$(gettextsrcdir)/VERSION; \ ! $(INSTALL_DATA) ChangeLog.inst $(DESTDIR)$(gettextsrcdir)/ChangeLog; \ ! dists="COPYING.LIB-2 COPYING.LIB-2.1 $(DISTFILES.common)"; \ for file in $$dists; do \ ! $(INSTALL_DATA) $(srcdir)/$$file \ ! $(DESTDIR)$(gettextsrcdir)/$$file; \ ! done; \ ! chmod a+x $(DESTDIR)$(gettextsrcdir)/config.charset; \ ! dists="$(DISTFILES.generated)"; \ ! for file in $$dists; do \ ! if test -f $$file; then dir=.; else dir=$(srcdir); fi; \ ! $(INSTALL_DATA) $$dir/$$file \ ! $(DESTDIR)$(gettextsrcdir)/$$file; \ ! done; \ ! dists="$(DISTFILES.obsolete)"; \ ! for file in $$dists; do \ ! rm -f $(DESTDIR)$(gettextsrcdir)/$$file; \ done; \ else \ *************** *** 144,155 **** uninstall: ! dists="$(DISTFILES.common)"; \ ! for file in $$dists; do \ ! rm -f $(gettextsrcdir)/$$file; \ ! done info dvi: ! $(OBJECTS): ../config.h libgettext.h bindtextdom.$lo finddomain.$lo loadmsgcat.$lo: gettextP.h gettext.h loadinfo.h dcgettext.$lo: gettextP.h gettext.h hash-string.h loadinfo.h --- 210,258 ---- uninstall: ! if test "$(PACKAGE)" = "gettext" \ ! && test '@INTLOBJS@' = '$(GETTOBJS)'; then \ ! rm -f $(DESTDIR)$(includedir)/libintl.h; \ ! $(LIBTOOL) --mode=uninstall \ ! rm -f $(DESTDIR)$(libdir)/libintl.$la; \ ! else \ ! : ; \ ! fi ! if test '@USE_INCLUDED_LIBINTL@' = yes; then \ ! if test -f $(DESTDIR)$(libdir)/charset.alias; then \ ! temp=$(DESTDIR)$(libdir)/t-charset.alias; \ ! dest=$(DESTDIR)$(libdir)/charset.alias; \ ! sed -f ref-del.sed $$dest > $$temp; \ ! if grep '^# Packages using this file: $$' $$temp > /dev/null; then \ ! rm -f $$dest; \ ! else \ ! $(INSTALL_DATA) $$temp $$dest; \ ! fi; \ ! rm -f $$temp; \ ! fi; \ ! if test -f $(DESTDIR)$(localedir)/locale.alias; then \ ! temp=$(DESTDIR)$(localedir)/t-locale.alias; \ ! dest=$(DESTDIR)$(localedir)/locale.alias; \ ! sed -f ref-del.sed $$dest > $$temp; \ ! if grep '^# Packages using this file: $$' $$temp > /dev/null; then \ ! rm -f $$dest; \ ! else \ ! $(INSTALL_DATA) $$temp $$dest; \ ! fi; \ ! rm -f $$temp; \ ! fi; \ ! else \ ! : ; \ ! fi ! if test "$(PACKAGE)" = "gettext"; then \ ! for file in VERSION ChangeLog COPYING.LIB-2 COPYING.LIB-2.1 $(DISTFILES.common) $(DISTFILES.generated); do \ ! rm -f $(DESTDIR)$(gettextsrcdir)/$$file; \ ! done; \ ! else \ ! : ; \ ! fi info dvi: ! $(OBJECTS): ../config.h libgnuintl.h bindtextdom.$lo finddomain.$lo loadmsgcat.$lo: gettextP.h gettext.h loadinfo.h dcgettext.$lo: gettextP.h gettext.h hash-string.h loadinfo.h *************** *** 167,176 **** mostlyclean: ! rm -f *.a *.o *.lo core core.* clean: mostlyclean distclean: clean ! rm -f Makefile ID TAGS po2msg.sed po2tbl.sed maintainer-clean: distclean --- 270,286 ---- mostlyclean: ! rm -f *.a *.la *.o *.lo core core.* ! rm -f libintl.h charset.alias ref-add.sed ref-del.sed ! rm -f -r .libs _libs clean: mostlyclean distclean: clean ! rm -f Makefile ID TAGS ! if test "$(PACKAGE)" = gettext; then \ ! rm -f ChangeLog.inst $(DISTFILES.normal); \ ! else \ ! : ; \ ! fi maintainer-clean: distclean *************** *** 182,186 **** # other files which should not be distributed in other packages. distdir = ../$(PACKAGE)-$(VERSION)/$(subdir) ! dist distdir: Makefile $(DISTFILES) if test "$(PACKAGE)" = gettext; then \ additional="$(DISTFILES.gettext)"; \ --- 292,296 ---- # other files which should not be distributed in other packages. distdir = ../$(PACKAGE)-$(VERSION)/$(subdir) ! dist distdir: Makefile if test "$(PACKAGE)" = gettext; then \ additional="$(DISTFILES.gettext)"; \ *************** *** 188,212 **** additional="$(DISTFILES.normal)"; \ fi; \ ! for file in $(DISTFILES.common) $$additional; do \ ! ln $(srcdir)/$$file $(distdir) 2> /dev/null \ ! || cp -p $(srcdir)/$$file $(distdir); \ done - dist-libc: - tar zcvf intl-glibc.tar.gz $(COMSRCS) $(COMHDRS) libintl.h.glibc - Makefile: Makefile.in ../config.status cd .. \ && CONFIG_FILES=$(subdir)/$@ CONFIG_HEADERS= $(SHELL) ./config.status - - # The dependency for intlh.inst is different in gettext and all other - # packages. Because we cannot you GNU make features we have to solve - # the problem while rewriting Makefile.in. - @GT...@in...st: intlh.inst.in ../config.status - @GT_YES@ cd .. \ - @GT_YES@ && CONFIG_FILES=$(subdir)/$@ CONFIG_HEADERS= \ - @GT_YES@ $(SHELL) ./config.status - @GT_NO@.PHONY: intlh.inst - @GT...@in...st: # Tell versions [3.59,3.63) of GNU make not to export all variables. --- 298,311 ---- additional="$(DISTFILES.normal)"; \ fi; \ ! $(MAKE) $(DISTFILES.common) $(DISTFILES.generated) $$additional; \ ! for file in ChangeLog $(DISTFILES.common) $(DISTFILES.generated) $$additional; do \ ! if test -f $$file; then dir=.; else dir=$(srcdir); fi; \ ! ln $$dir/$$file $(distdir) 2> /dev/null \ ! || cp -p $$dir/$$file $(distdir); \ done Makefile: Makefile.in ../config.status cd .. \ && CONFIG_FILES=$(subdir)/$@ CONFIG_HEADERS= $(SHELL) ./config.status # Tell versions [3.59,3.63) of GNU make not to export all variables. Index: VERSION =================================================================== RCS file: /cvsroot/lib/LIB/intl/VERSION,v retrieving revision 1.1.1.1 retrieving revision 1.2 diff -C2 -d -r1.1.1.1 -r1.2 *** VERSION 10 May 2000 11:31:47 -0000 1.1.1.1 --- VERSION 10 Jul 2002 22:13:50 -0000 1.2 *************** *** 1 **** ! GNU gettext library from gettext-0.10.35 --- 1 ---- ! GNU gettext library from gettext-0.10.40 Index: bindtextdom.c =================================================================== RCS file: /cvsroot/lib/LIB/intl/bindtextdom.c,v retrieving revision 1.1.1.1 retrieving revision 1.2 diff -C2 -d -r1.1.1.1 -r1.2 *** bindtextdom.c 10 May 2000 11:31:48 -0000 1.1.1.1 --- bindtextdom.c 10 Jul 2002 22:13:50 -0000 1.2 *************** *** 1,18 **** /* Implementation of the bindtextdomain(3) function ! Copyright (C) 1995, 1996, 1997, 1998 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. */ #ifdef HAVE_CONFIG_H --- 1,19 ---- /* Implementation of the bindtextdomain(3) function ! Copyright (C) 1995-1998, 2000, 2001 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. */ #ifdef HAVE_CONFIG_H *************** *** 20,49 **** #endif ! #if defined STDC_HEADERS || defined _LIBC ! # include <stdlib.h> ! #else ! # ifdef HAVE_MALLOC_H ! # include <malloc.h> ! # else ! void free (); ! # endif ! #endif ! #if defined HAVE_STRING_H || defined _LIBC ! # include <string.h> #else ! # include <strings.h> ! # ifndef memcpy ! # define memcpy(Dst, Src, Num) bcopy (Src, Dst, Num) ! # endif #endif #ifdef _LIBC ! # include <libintl.h> #else ! # include "libgettext.h" #endif - #include "gettext.h" - #include "gettextP.h" /* @@ end of prolog @@ */ --- 21,57 ---- #endif ! #include <stddef.h> ! #include <stdlib.h> ! #include <string.h> ! #ifdef _LIBC ! # include <libintl.h> #else ! # include "libgnuintl.h" #endif + #include "gettextP.h" #ifdef _LIBC ! /* We have to handle multi-threaded applications. */ ! # include <bits/libc-lock.h> #else ! /* Provide dummy implementation if this is outside glibc. */ ! # define __libc_rwlock_define(CLASS, NAME) ! # define __libc_rwlock_wrlock(NAME) ! # define __libc_rwlock_unlock(NAME) ! #endif ! ! /* The internal variables in the standalone libintl.a must have different ! names than the internal variables in GNU libc, otherwise programs ! using libintl.a cannot be linked statically. */ ! #if !defined _LIBC ! # define _nl_default_dirname _nl_default_dirname__ ! # define _nl_domain_bindings _nl_domain_bindings__ ! #endif ! ! /* Some compilers, like SunOS4 cc, don't have offsetof in <stddef.h>. */ ! #ifndef offsetof ! # define offsetof(type,ident) ((size_t)&(((type*)0)->ident)) #endif /* @@ end of prolog @@ */ *************** *** 55,58 **** --- 63,69 ---- extern struct binding *_nl_domain_bindings; + /* Lock variable to protect the global data in the gettext implementation. */ + __libc_rwlock_define (extern, _nl_state_lock) + /* Names for the libintl functions are a problem. They must not clash *************** *** 62,65 **** --- 73,77 ---- #ifdef _LIBC # define BINDTEXTDOMAIN __bindtextdomain + # define BIND_TEXTDOMAIN_CODESET __bind_textdomain_codeset # ifndef strdup # define strdup(str) __strdup (str) *************** *** 67,84 **** #else # define BINDTEXTDOMAIN bindtextdomain__ #endif ! /* Specify that the DOMAINNAME message catalog will be found ! in DIRNAME rather than in the system locale data base. */ ! char * ! BINDTEXTDOMAIN (domainname, dirname) const char *domainname; ! const char *dirname; { struct binding *binding; /* Some sanity checks. */ if (domainname == NULL || domainname[0] == '\0') ! return NULL; for (binding = _nl_domain_bindings; binding != NULL; binding = binding->next) --- 79,118 ---- #else # define BINDTEXTDOMAIN bindtextdomain__ + # define BIND_TEXTDOMAIN_CODESET bind_textdomain_codeset__ #endif ! /* Prototypes for local functions. */ ! static void set_binding_values PARAMS ((const char *domainname, ! const char **dirnamep, ! const char **codesetp)); ! ! /* Specifies the directory name *DIRNAMEP and the output codeset *CODESETP ! to be used for the DOMAINNAME message catalog. ! If *DIRNAMEP or *CODESETP is NULL, the corresponding attribute is not ! modified, only the current value is returned. ! If DIRNAMEP or CODESETP is NULL, the corresponding attribute is neither ! modified nor returned. */ ! static void ! set_binding_values (domainname, dirnamep, codesetp) const char *domainname; ! const char **dirnamep; ! const char **codesetp; { struct binding *binding; + int modified; /* Some sanity checks. */ if (domainname == NULL || domainname[0] == '\0') ! { ! if (dirnamep) ! *dirnamep = NULL; ! if (codesetp) ! *codesetp = NULL; ! return; ! } ! ! __libc_rwlock_wrlock (_nl_state_lock); ! ! modified = 0; for (binding = _nl_domain_bindings; binding != NULL; binding = binding->next) *************** *** 96,176 **** } - if (dirname == NULL) - /* The current binding has be to returned. */ - return binding == NULL ? (char *) _nl_default_dirname : binding->dirname; - if (binding != NULL) { ! /* The domain is already bound. If the new value and the old ! one are equal we simply do nothing. Otherwise replace the ! old binding. */ ! if (strcmp (dirname, binding->dirname) != 0) { ! char *new_dirname; ! if (strcmp (dirname, _nl_default_dirname) == 0) ! new_dirname = (char *) _nl_default_dirname; else { #if defined _LIBC || defined HAVE_STRDUP ! new_dirname = strdup (dirname); ! if (new_dirname == NULL) ! return NULL; #else ! size_t len = strlen (dirname) + 1; ! new_dirname = (char *) malloc (len); ! if (new_dirname == NULL) ! return NULL; ! ! memcpy (new_dirname, dirname, len); #endif } ! if (binding->dirname != _nl_default_dirname) ! free (binding->dirname); ! binding->dirname = new_dirname; } } else { /* We have to create a new binding. */ ! #if !defined _LIBC && !defined HAVE_STRDUP ! size_t len; ! #endif struct binding *new_binding = ! (struct binding *) malloc (sizeof (*new_binding)); ! if (new_binding == NULL) ! return NULL; #if defined _LIBC || defined HAVE_STRDUP ! new_binding->domainname = strdup (domainname); ! if (new_binding->domainname == NULL) ! return NULL; #else ! len = strlen (domainname) + 1; ! new_binding->domainname = (char *) malloc (len); ! if (new_binding->domainname == NULL) ! return NULL; ! memcpy (new_binding->domainname, domainname, len); #endif ! ! if (strcmp (dirname, _nl_default_dirname) == 0) ! new_binding->dirname = (char *) _nl_default_dirname; else { #if defined _LIBC || defined HAVE_STRDUP ! new_binding->dirname = strdup (dirname); ! if (new_binding->dirname == NULL) ! return NULL; #else ! len = strlen (dirname) + 1; ! new_binding->dirname = (char *) malloc (len); ! if (new_binding->dirname == NULL) ! return NULL; ! memcpy (new_binding->dirname, dirname, len); #endif } /* Now enqueue it. */ --- 130,300 ---- } if (binding != NULL) { ! if (dirnamep) { ! const char *dirname = *dirnamep; ! if (dirname == NULL) ! /* The current binding has be to returned. */ ! *dirnamep = binding->dirname; else { + /* The domain is already bound. If the new value and the old + one are equal we simply do nothing. Otherwise replace the + old binding. */ + char *result = binding->dirname; + if (strcmp (dirname, result) != 0) + { + if (strcmp (dirname, _nl_default_dirname) == 0) + result = (char *) _nl_default_dirname; + else + { #if defined _LIBC || defined HAVE_STRDUP ! result = strdup (dirname); #else ! size_t len = strlen (dirname) + 1; ! result = (char *) malloc (len); ! if (__builtin_expect (result != NULL, 1)) ! memcpy (result, dirname, len); #endif + } + + if (__builtin_expect (result != NULL, 1)) + { + if (binding->dirname != _nl_default_dirname) + free (binding->dirname); + + binding->dirname = result; + modified = 1; + } + } + *dirnamep = result; } + } ! if (codesetp) ! { ! const char *codeset = *codesetp; ! if (codeset == NULL) ! /* The current binding has be to returned. */ ! *codesetp = binding->codeset; ! else ! { ! /* The domain is already bound. If the new value and the old ! one are equal we simply do nothing. Otherwise replace the ! old binding. */ ! char *result = binding->codeset; ! if (result == NULL || strcmp (codeset, result) != 0) ! { ! #if defined _LIBC || defined HAVE_STRDUP ! result = strdup (codeset); ! #else ! size_t len = strlen (codeset) + 1; ! result = (char *) malloc (len); ! if (__builtin_expect (result != NULL, 1)) ! memcpy (result, codeset, len); ! #endif ! ! if (__builtin_expect (result != NULL, 1)) ! { ! if (binding->codeset != NULL) ! free (binding->codeset); ! ! binding->codeset = result; ! binding->codeset_cntr++; ! modified = 1; ! } ! } ! *codesetp = result; ! } } } + else if ((dirnamep == NULL || *dirnamep == NULL) + && (codesetp == NULL || *codesetp == NULL)) + { + /* Simply return the default values. */ + if (dirnamep) + *dirnamep = _nl_default_dirname; + if (codesetp) + *codesetp = NULL; + } else { /* We have to create a new binding. */ ! size_t len = strlen (domainname) + 1; struct binding *new_binding = ! (struct binding *) malloc (offsetof (struct binding, domainname) + len); ! if (__builtin_expect (new_binding == NULL, 0)) ! goto failed; ! ! memcpy (new_binding->domainname, domainname, len); + if (dirnamep) + { + const char *dirname = *dirnamep; + + if (dirname == NULL) + /* The default value. */ + dirname = _nl_default_dirname; + else + { + if (strcmp (dirname, _nl_default_dirname) == 0) + dirname = _nl_default_dirname; + else + { + char *result; #if defined _LIBC || defined HAVE_STRDUP ! result = strdup (dirname); ! if (__builtin_expect (result == NULL, 0)) ! goto failed_dirname; #else ! size_t len = strlen (dirname) + 1; ! result = (char *) malloc (len); ! if (__builtin_expect (result == NULL, 0)) ! goto failed_dirname; ! memcpy (result, dirname, len); #endif ! dirname = result; ! } ! } ! *dirnamep = dirname; ! new_binding->dirname = (char *) dirname; ! } else + /* The default value. */ + new_binding->dirname = (char *) _nl_default_dirname; + + new_binding->codeset_cntr = 0; + + if (codesetp) { + const char *codeset = *codesetp; + + if (codeset != NULL) + { + char *result; + #if defined _LIBC || defined HAVE_STRDUP ! result = strdup (codeset); ! if (__builtin_expect (result == NULL, 0)) ! goto failed_codeset; #else ! size_t len = strlen (codeset) + 1; ! result = (char *) malloc (len); ! if (__builtin_expect (result == NULL, 0)) ! goto failed_codeset; ! memcpy (result, codeset, len); #endif + codeset = result; + new_binding->codeset_cntr++; + } + *codesetp = codeset; + new_binding->codeset = (char *) codeset; } + else + new_binding->codeset = NULL; /* Now enqueue it. */ *************** *** 192,203 **** } ! binding = new_binding; } ! return binding->dirname; } #ifdef _LIBC ! /* Alias for function name in GNU C Library. */ weak_alias (__bindtextdomain, bindtextdomain); #endif --- 316,369 ---- } ! modified = 1; ! ! /* Here we deal with memory allocation failures. */ ! if (0) ! { ! failed_codeset: ! if (new_binding->dirname != _nl_default_dirname) ! free (new_binding->dirname); ! failed_dirname: ! free (new_binding); ! failed: ! if (dirnamep) ! *dirnamep = NULL; ! if (codesetp) ! *codesetp = NULL; ! } } ! /* If we modified any binding, we flush the caches. */ ! if (modified) ! ++_nl_msg_cat_cntr; ! ! __libc_rwlock_unlock (_nl_state_lock); ! } ! ! /* Specify that the DOMAINNAME message catalog will be found ! in DIRNAME rather than in the system locale data base. */ ! char * ! BINDTEXTDOMAIN (domainname, dirname) ! const char *domainname; ! const char *dirname; ! { ! set_binding_values (domainname, &dirname, NULL); ! return (char *) dirname; ! } ! ! /* Specify the character encoding in which the messages from the ! DOMAINNAME message catalog will be returned. */ ! char * ! BIND_TEXTDOMAIN_CODESET (domainname, codeset) ! const char *domainname; ! const char *codeset; ! { ! set_binding_values (domainname, NULL, &codeset); ! return (char *) codeset; } #ifdef _LIBC ! /* Aliases for function names in GNU C Library. */ weak_alias (__bindtextdomain, bindtextdomain); + weak_alias (__bind_textdomain_codeset, bind_textdomain_codeset); #endif Index: dcgettext.c =================================================================== RCS file: /cvsroot/lib/LIB/intl/dcgettext.c,v retrieving revision 1.1.1.1 retrieving revision 1.2 diff -C2 -d -r1.1.1.1 -r1.2 *** dcgettext.c 10 May 2000 11:31:49 -0000 1.1.1.1 --- dcgettext.c 10 Jul 2002 22:13:50 -0000 1.2 *************** *** 1,18 **** /* Implementation of the dcgettext(3) function. ! Copyright (C) 1995, 1996, 1997, 1998 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. */ #ifdef HAVE_CONFIG_H --- 1,19 ---- /* Implementation of the dcgettext(3) function. ! Copyright (C) 1995-1999, 2000, 2001 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. */ #ifdef HAVE_CONFIG_H *************** *** 20,211 **** #endif - #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 - - #include <errno.h> - #ifndef errno - extern int errno; - #endif - #ifndef __set_errno - # define __set_errno(val) errno = (val) - #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> - #endif - #if !HAVE_STRCHR && !defined _LIBC - # ifndef strchr - # define strchr index - # endif - #endif - - #if defined HAVE_UNISTD_H || defined _LIBC - # include <unistd.h> - #endif - - #include "gettext.h" #include "gettextP.h" #ifdef _LIBC # include <libintl.h> #else ! # include "libgettext.h" #endif - #include "hash-string.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 getcwd __getcwd - # ifndef stpcpy - # define stpcpy __stpcpy - # endif - #else - # if !defined HAVE_GETCWD - char *getwd (); - # define getcwd(buf, max) getwd (buf) - # else - char *getcwd (); - # endif - # ifndef HAVE_STPCPY - static char *stpcpy PARAMS ((char *dest, const char *src)); - # endif - #endif - - /* Amount to increase buffer size by in each try. */ - #define PATH_INCR 32 - - /* The following is from pathmax.h. */ - /* Non-POSIX BSD systems might have gcc's limits.h, which doesn't define - PATH_MAX but might cause redefinition warnings when sys/param.h is - later included (as on MORE/BSD 4.3). */ - #if defined(_POSIX_VERSION) || (defined(HAVE_LIMITS_H) && !defined(__GNUC__)) - # include <limits.h> - #endif - - #ifndef _POSIX_PATH_MAX - # define _POSIX_PATH_MAX 255 - #endif - - #if !defined(PATH_MAX) && defined(_PC_PATH_MAX) - # define PATH_MAX (pathconf ("/", _PC_PATH_MAX) < 1 ? 1024 : pathconf ("/", _PC_PATH_MAX)) - #endif - - /* Don't include sys/param.h if it already has been. */ - #if defined(HAVE_SYS_PARAM_H) && !defined(PATH_MAX) && !defined(MAXPATHLEN) - # include <sys/param.h> - #endif - - #if !defined(PATH_MAX) && defined(MAXPATHLEN) - # define PATH_MAX MAXPATHLEN - #endif - - #ifndef PATH_MAX - # define PATH_MAX _POSIX_PATH_MAX - #endif - - /* 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 - - /* Name of the default domain used for gettext(3) prior any call to - textdomain(3). The default value for this is "messages". */ - const char _nl_default_default_domain[] = "messages"; - - /* Value used as the default domain for gettext(3). */ - const char *_nl_current_default_domain = _nl_default_default_domain; - - /* Contains the default location of the message catalogs. */ - const char _nl_default_dirname[] = GNULOCALEDIR; - - /* List with bindings of specific domains created by bindtextdomain() - calls. */ - struct binding *_nl_domain_bindings; - - /* Prototypes for local functions. */ - static char *find_msg PARAMS ((struct loaded_l10nfile *domain_file, - const char *msgid)) internal_function; - static const char *category_to_name PARAMS ((int category)) internal_function; - static const char *guess_category_value PARAMS ((int category, - const char *categoryname)) - internal_function; - - - /* 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 */ - - /* Names for the libintl functions are a problem. They must not clash with existing names and they should follow ANSI C. But this source --- 21,33 ---- #endif #include "gettextP.h" #ifdef _LIBC # include <libintl.h> #else ! # include "libgnuintl.h" #endif /* @@ end of prolog @@ */ /* Names for the libintl functions are a problem. They must not clash with existing names and they should follow ANSI C. But this source *************** *** 214,219 **** --- 36,43 ---- #ifdef _LIBC # define DCGETTEXT __dcgettext + # define DCIGETTEXT __dcigettext #else # define DCGETTEXT dcgettext__ + # define DCIGETTEXT dcigettext__ #endif *************** *** 226,386 **** int category; { ! #ifndef HAVE_ALLOCA ! struct block_list *block_list = NULL; ! #endif ! struct loaded_l10nfile *domain; ! struct binding *binding; ! const char *categoryname; ! const char *categoryvalue; ! char *dirname, *xdomainname; ! char *single_locale; ! char *retval; ! int saved_errno = errno; ! ! /* If no real MSGID is given return NULL. */ ! if (msgid == NULL) ! return NULL; ! ! /* If DOMAINNAME is NULL, we are interested in the default domain. If ! CATEGORY is not LC_MESSAGES this might not make much sense but the ! defintion left this undefined. */ ! if (domainname == NULL) ! domainname = _nl_current_default_domain; ! ! /* First find matching binding. */ ! for (binding = _nl_domain_bindings; binding != NULL; binding = binding->next) ! { ! int compare = strcmp (domainname, binding->domainname); ! if (compare == 0) ! /* We found it! */ ! break; ! if (compare < 0) ! { ! /* It is not in the list. */ ! binding = NULL; ! break; ! } ! } ! ! if (binding == NULL) ! dirname = (char *) _nl_default_dirname; ! else if (binding->dirname[0] == '/') ! dirname = binding->dirname; ! else ! { ! /* We have a relative path. Make it absolute now. */ ! size_t dirname_len = strlen (binding->dirname) + 1; ! size_t path_max; ! char *ret; ! ! path_max = (unsigned) PATH_MAX; ! path_max += 2; /* The getcwd docs say to do this. */ ! ! dirname = (char *) alloca (path_max + dirname_len); ! ADD_BLOCK (block_list, dirname); ! ! __set_errno (0); ! while ((ret = getcwd (dirname, path_max)) == NULL && errno == ERANGE) ! { ! path_max += PATH_INCR; ! dirname = (char *) alloca (path_max + dirname_len); ! ADD_BLOCK (block_list, dirname); ! __set_errno (0); ! } ! ! if (ret == NULL) ! { ! /* We cannot get the current working directory. Don't signal an ! error but simply return the default string. */ ! FREE_BLOCKS (block_list); ! __set_errno (saved_errno); ! return (char *) msgid; ! } ! ! stpcpy (stpcpy (strchr (dirname, '\0'), "/"), binding->dirname); ! } ! ! /* Now determine the symbolic name of CATEGORY and its value. */ ! categoryname = category_to_name (category); ! categoryvalue = guess_category_value (category, categoryname); ! ! xdomainname = (char *) alloca (strlen (categoryname) ! + strlen (domainname) + 5); ! ADD_BLOCK (block_list, xdomainname); ! ! stpcpy (stpcpy (stpcpy (stpcpy (xdomainname, categoryname), "/"), ! domainname), ! ".mo"); ! ! /* Creating working area. */ ! single_locale = (char *) alloca (strlen (categoryvalue) + 1); ! ADD_BLOCK (block_list, single_locale); ! ! ! /* Search for the given string. This is a loop because we perhaps ! got an ordered list of languages to consider for th translation. */ ! while (1) ! { ! /* Make CATEGORYVALUE point to the next element of the list. */ ! while (categoryvalue[0] != '\0' && categoryvalue[0] == ':') ! ++categoryvalue; ! if (categoryvalue[0] == '\0') ! { ! /* The whole contents of CATEGORYVALUE has been searched but ! no valid entry has been found. We solve this situation ! by implicitly appending a "C" entry, i.e. no translation ! will take place. */ ! single_locale[0] = 'C'; ! single_locale[1] = '\0'; ! } ! else ! { ! char *cp = single_locale; ! while (categoryvalue[0] != '\0' && categoryvalue[0] != ':') ! *cp++ = *categoryvalue++; ! *cp = '\0'; ! } ! ! /* If the current locale value is C (or POSIX) we don't load a ! domain. Return the MSGID. */ ! if (strcmp (single_locale, "C") == 0 ! || strcmp (single_locale, "POSIX") == 0) ! { ! FREE_BLOCKS (block_list); ! __set_errno (saved_errno); ! return (char *) msgid; ! } ! ! ! /* Find structure describing the message catalog matching the ! DOMAINNAME and CATEGORY. */ ! domain = _nl_find_domain (dirname, single_locale, xdomainname); ! ! if (domain != NULL) ! { ! retval = find_msg (domain, msgid); ! ! if (retval == NULL) ! { ! int cnt; ! ! for (cnt = 0; domain->successor[cnt] != NULL; ++cnt) ! { ! retval = find_msg (domain->successor[cnt], msgid); ! ! if (retval != NULL) ! break; ! } ! } ! ! if (retval != NULL) ! { ! FREE_BLOCKS (block_list); ! __set_errno (saved_errno); ! return retval; ! } ! } ! } ! /* NOTREACHED */ } --- 50,54 ---- int category; { ! return DCIGETTEXT (domainname, msgid, NULL, 0, 0, category); } *************** *** 388,624 **** /* Alias for function name in GNU C Library. */ weak_alias (__dcgettext, dcgettext); - #endif - - - static char * - internal_function - find_msg (domain_file, msgid) - struct loaded_l10nfile *domain_file; - const char *msgid; - { - size_t top, act, bottom; - struct loaded_domain *domain; - - if (domain_file->decided == 0) - _nl_load_domain (domain_file); - - if (domain_file->data == NULL) - return NULL; - - domain = (struct loaded_domain *) domain_file->data; - - /* Locate the MSGID and its translation. */ - if (domain->hash_size > 2 && domain->hash_tab != NULL) - { - /* Use the hashing table. */ - nls_uint32 len = strlen (msgid); - nls_uint32 hash_val = hash_string (msgid); - nls_uint32 idx = hash_val % domain->hash_size; - nls_uint32 incr = 1 + (hash_val % (domain->hash_size - 2)); - nls_uint32 nstr = W (domain->must_swap, domain->hash_tab[idx]); - - if (nstr == 0) - /* Hash table entry is empty. */ - return NULL; - - if (W (domain->must_swap, domain->orig_tab[nstr - 1].length) == len - && strcmp (msgid, - domain->data + W (domain->must_swap, - domain->orig_tab[nstr - 1].offset)) == 0) - return (char *) domain->data + W (domain->must_swap, - domain->trans_tab[nstr - 1].offset); - - while (1) - { - if (idx >= domain->hash_size - incr) - idx -= domain->hash_size - incr; - else - idx += incr; - - nstr = W (domain->must_swap, domain->hash_tab[idx]); - if (nstr == 0) - /* Hash table entry is empty. */ - return NULL; - - if (W (domain->must_swap, domain->orig_tab[nstr - 1].length) == len - && strcmp (msgid, - domain->data + W (domain->must_swap, - domain->orig_tab[nstr - 1].offset)) - == 0) - return (char *) domain->data - + W (domain->must_swap, domain->trans_tab[nstr - 1].offset); - } - /* NOTREACHED */ - } - - /* Now we try the default method: binary search in the sorted - array of messages. */ - bottom = 0; - top = domain->nstrings; - while (bottom < top) - { - int cmp_val; - - act = (bottom + top) / 2; - cmp_val = strcmp (msgid, domain->data - + W (domain->must_swap, - domain->orig_tab[act].offset)); - if (cmp_val < 0) - top = act; - else if (cmp_val > 0) - bottom = act + 1; - else - break; - } - - /* If an translation is found return this. */ - return bottom >= top ? NULL : (char *) domain->data - + W (domain->must_swap, - domain->trans_tab[act].offset); - } - - - /* Return string representation of locale CATEGORY. */ - static const char * - internal_function - category_to_name (category) - int category; - { - const char *retval; - - switch (category) - { - #ifdef LC_COLLATE - case LC_COLLATE: - retval = "LC_COLLATE"; - break; - #endif - #ifdef LC_CTYPE - case LC_CTYPE: - retval = "LC_CTYPE"; - break; - #endif - #ifdef LC_MONETARY - case LC_MONETARY: - retval = "LC_MONETARY"; - break; - #endif - #ifdef LC_NUMERIC - case LC_NUMERIC: - retval = "LC_NUMERIC"; - break; - #endif - #ifdef LC_TIME - case LC_TIME: - retval = "LC_TIME"; - break; - #endif - #ifdef LC_MESSAGES - case LC_MESSAGES: - retval = "LC_MESSAGES"; - break; - #endif - #ifdef LC_RESPONSE - case LC_RESPONSE: - retval = "LC_RESPONSE"; - break; - #endif - #ifdef LC_ALL - case LC_ALL: - /* This might not make sense but is perhaps better than any other - value. */ - retval = "LC_ALL"; - break; - #endif - default: - /* If you have a better idea for a default value let me know. */ - retval = "LC_XXX"; - } - - return retval; - } - - /* Guess value of current locale from value of the environment variables. */ - static const char * - internal_function - guess_category_value (category, categoryname) - int category; - const char *categoryname; - { - const char *retval; - - /* The highest priority value is the `LANGUAGE' environment - variable. This is a GNU extension. */ - retval = getenv ("LANGUAGE"); - if (retval != NULL && retval[0] != '\0') - return retval; - - /* `LANGUAGE' is not set. So we have to proceed with the POSIX - methods of looking to `LC_ALL', `LC_xxx', and `LANG'. On some - systems this can be done by the `setlocale' function itself. */ - #if defined HAVE_SETLOCALE && defined HAVE_LC_MESSAGES && defined HAVE_LOCALE_NULL - return setlocale (category, NULL); - #else - /* Setting of LC_ALL overwrites all other. */ - retval = getenv ("LC_ALL"); - if (retval != NULL && retval[0] != '\0') - return retval; - - /* Next comes the name of the desired category. */ - retval = getenv (categoryname); - if (retval != NULL && retval[0] != '\0') - return retval; - - /* Last possibility is the LANG environment variable. */ - retval = getenv ("LANG"); - if (retval != NULL && retval[0] != '\0') - return retval; - - /* We use C as the default domain. POSIX says this is implementation - defined. */ - return "C"; - #endif - } - - /* @@ begin of epilog @@ */ - - /* We don't want libintl.a to depend on any other library. So we - avoid the non-standard function stpcpy. In GNU C Library this - function is available, though. Also allow the symbol HAVE_STPCPY - to be defined. */ - #if !_LIBC && !HAVE_STPCPY - static char * - stpcpy (dest, src) - char *dest; - const char *src; - { - while ((*dest++ = *src++) != '\0') - /* Do nothing. */ ; - return dest - 1; - } - #endif - - - #ifdef _LIBC - /* If we want to free all resources we have to do some work at - program's end. */ - static void __attribute__ ((unused)) - free_mem (void) - { - struct binding *runp; - - for (runp = _nl_domain_bindings; runp != NULL; runp = runp->next) - { - free (runp->domainname); - if (runp->dirname != _nl_default_dirname) - /* Yes, this is a pointer comparison. */ - free (runp->dirname); - } - - if (_nl_current_default_domain != _nl_default_default_domain) - /* Yes, again a pointer comparison. */ - free ((char *) _nl_current_default_domain); - } - - text_set_element (__libc_subfreeres, free_mem); #endif --- 56,58 ---- Index: dgettext.c =================================================================== RCS file: /cvsroot/lib/LIB/intl/dgettext.c,v retrieving revision 1.1.1.1 retrieving revision 1.2 diff -C2 -d -r1.1.1.1 -r1.2 *** dgettext.c 10 May 2000 11:31:49 -0000 1.1.1.1 --- dgettext.c 10 Jul 2002 22:13:50 -0000 1.2 *************** *** 1,18 **** ! /* Implementation of the dgettext(3) function ! Copyright (C) 1995, 1996, 1997 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. */ #ifdef HAVE_CONFIG_H --- 1,19 ---- ! /* Implementation of the dgettext(3) function. ! Copyright (C) 1995-1997, 2000, 2001 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. */ #ifdef HAVE_CONFIG_H *************** *** 20,31 **** #endif ! #if defined HAVE_LOCALE_H || defined _LIBC ! # include <locale.h> ! #endif #ifdef _LIBC # include <libintl.h> #else ! # include "libgettext.h" #endif --- 21,31 ---- #endif ! #include <locale.h> + #include "gettextP.h" #ifdef _LIBC # include <libintl.h> #else ! # include "libgnuintl.h" #endif Index: explodename.c =================================================================== RCS file: /cvsroot/lib/LIB/intl/explodename.c,v retrieving revision 1.1.1.1 retrieving revision 1.2 diff -C2 -d -r1.1.1.1 -r1.2 *** explodename.c 10 May 2000 11:31:56 -0000 1.1.1.1 --- explodename.c 10 Jul 2002 22:13:50 -0000 1.2 *************** *** 1,18 **** ! /* Copyright (C) 1995, 1996, 1997, 1998 Free Software Foundation, Inc. Contributed by Ulrich Drepper <dr...@gn...>, 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 --- 1,19 ---- ! /* Copyright (C) 1995-1998, 2000, 2001 Free Software Foundation, Inc. Contributed by Ulrich Drepper <dr...@gn...>, 1995. ! 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. */ #ifdef HAVE_CONFIG_H *************** *** 20,32 **** #endif ! #if defined STDC_HEADERS || defined _LIBC ! # include <stdlib.h> ! #endif ! ! #if defined HAVE_STRING_H || defined _LIBC ! # include <string.h> ! #else ! # include <strings.h> ! #endif #include <sys/types.h> --- 21,26 ---- #endif ! #include <stdlib.h> ! #include <string.h> #include <sys/types.h> *************** *** 44,47 **** --- 38,53 ---- /* @@ end of prolog @@ */ + char * + _nl_find_language (name) + const char *name; + { + while (name[0] != '\0' && name[0] != '_' && name[0] != '@' + && name[0] != '+' && name[0] != ',') + ++name; + + return (char *) name; + } + + int _nl_explode_name (name, language, modifier, territory, codeset, *************** *** 75,81 **** syntax = undecided; *language = cp = name; ! while (cp[0] != '\0' && cp[0] != '_' && cp[0] != '@' ! && cp[0] != '+' && cp[0] != ',') ! ++cp; if (*language == cp) --- 81,85 ---- syntax = undecided; *language = cp = name; ! cp = _nl_find_language (*language); if (*language == cp) Index: finddomain.c =================================================================== RCS file: /cvsroot/lib/LIB/intl/finddomain.c,v retrieving revision 1.1.1.1 retrieving revision 1.2 diff -C2 -d -r1.1.1.1 -r1.2 *** finddomain.c 10 May 2000 11:31:56 -0000 1.1.1.1 --- finddomain.c 10 Jul 2002 22:13:50 -0000 1.2 *************** *** 1,19 **** /* Handle list of needed message catalogs ! Copyright (C) 1995, 1996, 1997, 1998 Free Software Foundation, Inc. ! Written by Ulrich Drepper <dr...@gn...>, 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 --- 1,20 ---- /* Handle list of needed message catalogs ! Copyright (C) 1995-1999, 2000, 2001 Free Software Foundation, Inc. ! Written by Ulrich Drepper <dr...@gn...>, 1995. ! 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. */ #ifdef HAVE_CONFIG_H *************** *** 21,52 **** #endif - #include <ctype.h> - #include <errno.h> #include <s... [truncated message content] |