summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorColin Watson <cjwatson@debian.org>2010-07-20 08:29:16 +0100
committerColin Watson <cjwatson@debian.org>2010-07-20 08:29:16 +0100
commitf6cbccfb41238dee099354c6a5edd394395aa3e9 (patch)
tree8c6d76596e2f7d1068050e0ef96627a0cd41c701
parentaceda53bbeb1830f9ecab5e099f9d1b6748da39b (diff)
Upgrade to Gnulib 20100704.
* configure.ac (AM_GNU_GETTEXT_VERSION): Upgrade to gettext 0.18.1.
-rw-r--r--ABOUT-NLS1956
-rw-r--r--ChangeLog6
-rw-r--r--Makefile.in10
-rw-r--r--aclocal.m41
-rw-r--r--config.h.in70
-rwxr-xr-xconfigure730
-rw-r--r--configure.ac2
-rw-r--r--docs/Makefile.in10
-rw-r--r--gnulib/lib/Makefile.am7
-rw-r--r--gnulib/lib/Makefile.in17
-rw-r--r--gnulib/lib/canonicalize-lgpl.c4
-rwxr-xr-xgnulib/lib/config.charset42
-rw-r--r--gnulib/lib/error.c32
-rw-r--r--gnulib/lib/getopt.c2
-rw-r--r--gnulib/lib/getopt_int.h69
-rw-r--r--gnulib/lib/localcharset.c7
-rw-r--r--gnulib/lib/malloca.c3
-rw-r--r--gnulib/lib/regex_internal.c4
-rw-r--r--gnulib/lib/regex_internal.h2
-rw-r--r--gnulib/lib/setenv.c13
-rw-r--r--gnulib/lib/stdbool.in.h3
-rw-r--r--gnulib/lib/stdio-write.c2
-rw-r--r--gnulib/lib/stdio.in.h22
-rw-r--r--gnulib/lib/strerror.c3
-rw-r--r--gnulib/lib/string.in.h51
-rw-r--r--gnulib/lib/time.in.h12
-rw-r--r--gnulib/lib/unistd.in.h51
-rw-r--r--gnulib/lib/vasnprintf.c4
-rw-r--r--gnulib/lib/verify.h41
-rw-r--r--gnulib/lib/wchar.in.h2
-rw-r--r--gnulib/m4/asm-underscore.m448
-rw-r--r--gnulib/m4/environ.m44
-rw-r--r--gnulib/m4/fcntl-o.m48
-rw-r--r--gnulib/m4/getlogin_r.m44
-rw-r--r--gnulib/m4/gettext.m46
-rw-r--r--gnulib/m4/gnulib-common.m410
-rw-r--r--gnulib/m4/gnulib-comp.m43
-rw-r--r--gnulib/m4/iconv.m419
-rw-r--r--gnulib/m4/intl.m493
-rw-r--r--gnulib/m4/lib-link.m434
-rw-r--r--gnulib/m4/onceonly.m410
-rw-r--r--gnulib/m4/openat.m410
-rw-r--r--gnulib/m4/po.m42
-rw-r--r--gnulib/m4/printf.m44
-rw-r--r--gnulib/m4/sockpfaf.m43
-rw-r--r--gnulib/m4/stdint.m414
-rw-r--r--gnulib/m4/stdio_h.m43
-rw-r--r--gnulib/m4/string_h.m43
-rw-r--r--gnulib/m4/strnlen.m422
-rw-r--r--gnulib/m4/time_h.m419
-rw-r--r--gnulib/m4/unistd_h.m411
-rw-r--r--gnulib/m4/visibility.m426
-rw-r--r--intl/ChangeLog4
-rw-r--r--intl/Makefile.in170
-rw-r--r--intl/VERSION2
-rw-r--r--intl/bindtextdom.c6
-rwxr-xr-xintl/config.charset1132
-rw-r--r--intl/dcigettext.c136
-rw-r--r--intl/gettextP.h18
-rw-r--r--intl/intl-compat.c6
-rw-r--r--intl/intl-exports.c16
-rw-r--r--intl/l10nflist.c4
-rw-r--r--intl/langprefs.c367
-rw-r--r--intl/libgnuintl.h.in105
-rw-r--r--intl/libintl.rc4
-rw-r--r--intl/loadmsgcat.c11
-rw-r--r--intl/localcharset.c474
-rw-r--r--intl/localename.c2440
-rw-r--r--intl/lock.c891
-rw-r--r--intl/lock.h871
-rw-r--r--intl/log.c64
-rw-r--r--intl/os2compat.h6
-rw-r--r--intl/printf-args.c208
-rw-r--r--intl/printf-args.h52
-rw-r--r--intl/printf-parse.c910
-rw-r--r--intl/printf-parse.h14
-rw-r--r--intl/printf.c146
-rw-r--r--intl/relocatable.c289
-rw-r--r--intl/relocatable.h24
-rw-r--r--intl/setlocale.c1015
-rw-r--r--intl/threadlib.c75
-rw-r--r--intl/tsearch.c462
-rw-r--r--intl/tsearch.h8
-rw-r--r--intl/vasnprintf.c7771
-rw-r--r--intl/vasnwprintf.h4
-rw-r--r--intl/wprintf-parse.h14
-rw-r--r--intl/xsize.h4
-rw-r--r--lib/Makefile.in10
-rw-r--r--libdb/Makefile.in10
-rw-r--r--man/Makefile.in10
-rw-r--r--man/de/Makefile.in10
-rw-r--r--man/es/Makefile.in10
-rw-r--r--man/fr/Makefile.in10
-rw-r--r--man/id/Makefile.in10
-rw-r--r--man/it/Makefile.in10
-rw-r--r--man/ja/Makefile.in10
-rw-r--r--man/nl/Makefile.in10
-rw-r--r--man/pl/Makefile.in10
-rw-r--r--man/po4a/Makefile.in10
-rw-r--r--man/po4a/po/id.po77
-rw-r--r--man/po4a/po/nl.po75
-rw-r--r--man/po4a/po/pl.po85
-rw-r--r--man/po4a/po/ru.po111
-rw-r--r--man/ru/Makefile.in10
-rw-r--r--manual/Makefile.in10
-rw-r--r--po/Makefile.in.in39
-rw-r--r--po/Rules-quot2
-rw-r--r--src/Makefile.in10
-rw-r--r--src/tests/Makefile.in10
-rw-r--r--tools/Makefile.in10
-rw-r--r--tools/c++defs.h36
-rw-r--r--tools/warn-on-use.h9
112 files changed, 13239 insertions, 8622 deletions
diff --git a/ABOUT-NLS b/ABOUT-NLS
index 83bc72ec..b1de1b68 100644
--- a/ABOUT-NLS
+++ b/ABOUT-NLS
@@ -18,35 +18,7 @@ explain how users should proceed for getting the programs to use the
available translations. They tell how people wanting to contribute and
work on translations can contact the appropriate team.
- When reporting bugs in the `intl/' directory or bugs which may be
-related to internationalization, you should tell about the version of
-`gettext' which is used. The information can be found in the
-`intl/VERSION' file, in internationalized packages.
-
-1.1 Quick configuration advice
-==============================
-
-If you want to exploit the full power of internationalization, you
-should configure it using
-
- ./configure --with-included-gettext
-
-to force usage of internationalizing routines provided within this
-package, despite the existence of internationalizing capabilities in the
-operating system where this package is being installed. So far, only
-the `gettext' implementation in the GNU C library version 2 provides as
-many features (such as locale alias, message inheritance, automatic
-charset conversion or plural form handling) as the implementation here.
-It is also not possible to offer this additional functionality on top
-of a `catgets' implementation. Future versions of GNU `gettext' will
-very likely convey even more functionality. So it might be a good idea
-to change to GNU `gettext' as soon as possible.
-
- So you need _not_ provide this option if you are using GNU libc 2 or
-you have installed a recent copy of the GNU gettext package with the
-included `libintl'.
-
-1.2 INSTALL Matters
+1.1 INSTALL Matters
===================
Some packages are "localizable" when properly installed; the programs
@@ -56,36 +28,19 @@ internationalization, predating GNU `gettext'.
By default, this package will be installed to allow translation of
messages. It will automatically detect whether the system already
-provides the GNU `gettext' functions. If not, the included GNU
-`gettext' library will be used. This library is wholly contained
-within this package, usually in the `intl/' subdirectory, so prior
-installation of the GNU `gettext' package is _not_ required.
-Installers may use special options at configuration time for changing
-the default behaviour. The commands:
+provides the GNU `gettext' functions. Installers may use special
+options at configuration time for changing the default behaviour. The
+command:
- ./configure --with-included-gettext
./configure --disable-nls
-will, respectively, bypass any pre-existing `gettext' to use the
-internationalizing routines provided within this package, or else,
-_totally_ disable translation of messages.
+will _totally_ disable translation of messages.
When you already have GNU `gettext' installed on your system and run
configure without an option for your new package, `configure' will
-probably detect the previously built and installed `libintl.a' file and
-will decide to use this. This might not be desirable. You should use
-the more recent version of the GNU `gettext' library. I.e. if the file
-`intl/VERSION' shows that the library which comes with this package is
-more recent, you should use
-
- ./configure --with-included-gettext
-
-to prevent auto-detection.
-
- The configuration process will not test for the `catgets' function
-and therefore it will not be used. The reason is that even an
-emulation of `gettext' on top of `catgets' could not provide all the
-extensions of the GNU `gettext' library.
+probably detect the previously built and installed `libintl' library
+and will decide to use it. If not, you may have to to use the
+`--with-libintl-prefix' option to tell `configure' where to look for it.
Internationalized packages usually have many `po/LL.po' files, where
LL gives an ISO 639 two-letter code identifying the language. Unless
@@ -96,7 +51,7 @@ may be set, prior to configuration, to limit the installed set.
`LINGUAS' should then contain a space separated list of two-letter
codes, stating which languages are allowed.
-1.3 Using This Package
+1.2 Using This Package
======================
As a user, if your language has been installed for this package, you
@@ -148,7 +103,7 @@ to denote the language's main dialect. For example, `de' is equivalent
to `de_DE' (German as spoken in Germany), and `pt' to `pt_PT'
(Portuguese as spoken in Portugal) in this context.
-1.4 Translating Teams
+1.3 Translating Teams
=====================
For the Free Translation Project to be a success, we need interested
@@ -177,859 +132,1118 @@ reach the coordinator for all translator teams.
the terminology in use. Proven linguistic skills are praised more than
programming skills, here.
-1.5 Available Packages
+1.4 Available Packages
======================
Languages are not equally supported in all packages. The following
-matrix shows the current state of internationalization, as of November
-2007. The matrix shows, in regard of each package, for which languages
+matrix shows the current state of internationalization, as of June
+2010. The matrix shows, in regard of each package, for which languages
PO files have been submitted to translation coordination, with a
translation percentage of at least 50%.
- Ready PO files af am ar az be bg bs ca cs cy da de el en en_GB eo
- +----------------------------------------------------+
- Compendium | [] [] [] [] |
- a2ps | [] [] [] [] [] |
- aegis | () |
- ant-phone | () |
- anubis | [] |
- ap-utils | |
- aspell | [] [] [] [] [] |
- bash | [] |
- bfd | |
- bibshelf | [] |
- binutils | |
- bison | [] [] |
- bison-runtime | [] |
- bluez-pin | [] [] [] [] [] |
- cflow | [] |
- clisp | [] [] [] |
- console-tools | [] [] |
- coreutils | [] [] [] [] |
- cpio | |
- cpplib | [] [] [] |
- cryptonit | [] |
- dialog | |
- diffutils | [] [] [] [] [] [] |
- doodle | [] |
- e2fsprogs | [] [] |
- enscript | [] [] [] [] |
- fetchmail | [] [] () [] [] |
- findutils | [] |
- findutils_stable | [] [] [] |
- flex | [] [] [] |
- fslint | |
- gas | |
- gawk | [] [] [] |
- gcal | [] |
- gcc | [] |
- gettext-examples | [] [] [] [] [] |
- gettext-runtime | [] [] [] [] [] |
- gettext-tools | [] [] |
- gip | [] |
- gliv | [] [] |
- glunarclock | [] |
- gmult | [] [] |
- gnubiff | () |
- gnucash | [] [] () () [] |
- gnuedu | |
- gnulib | [] |
- gnunet | |
- gnunet-gtk | |
- gnutls | [] |
- gpe-aerial | [] [] |
- gpe-beam | [] [] |
- gpe-calendar | |
- gpe-clock | [] [] |
- gpe-conf | [] [] |
- gpe-contacts | |
- gpe-edit | [] |
- gpe-filemanager | |
- gpe-go | [] |
- gpe-login | [] [] |
- gpe-ownerinfo | [] [] |
- gpe-package | |
- gpe-sketchbook | [] [] |
- gpe-su | [] [] |
- gpe-taskmanager | [] [] |
- gpe-timesheet | [] |
- gpe-today | [] [] |
- gpe-todo | |
- gphoto2 | [] [] [] [] |
- gprof | [] [] |
- gpsdrive | |
- gramadoir | [] [] |
- grep | [] [] |
- gretl | () |
- gsasl | |
- gss | |
- gst-plugins-bad | [] [] |
- gst-plugins-base | [] [] |
- gst-plugins-good | [] [] [] |
- gst-plugins-ugly | [] [] |
- gstreamer | [] [] [] [] [] [] [] |
- gtick | () |
- gtkam | [] [] [] [] |
- gtkorphan | [] [] |
- gtkspell | [] [] [] [] |
- gutenprint | [] |
- hello | [] [] [] [] [] |
- herrie | [] |
- hylafax | |
- idutils | [] [] |
- indent | [] [] [] [] |
- iso_15924 | |
- iso_3166 | [] [] [] [] [] [] [] [] [] [] [] |
- iso_3166_2 | |
- iso_4217 | [] [] [] |
- iso_639 | [] [] [] [] |
- jpilot | [] |
- jtag | |
- jwhois | |
- kbd | [] [] [] [] |
- keytouch | [] [] |
- keytouch-editor | [] |
- keytouch-keyboa... | [] |
- latrine | () |
- ld | [] |
- leafpad | [] [] [] [] [] |
- libc | [] [] [] [] |
- libexif | [] |
- libextractor | [] |
- libgpewidget | [] [] [] |
- libgpg-error | [] |
- libgphoto2 | [] [] |
- libgphoto2_port | [] [] |
- libgsasl | |
- libiconv | [] [] |
- libidn | [] [] [] |
- lifelines | [] () |
- lilypond | [] |
- lingoteach | |
- lprng | |
- lynx | [] [] [] [] |
- m4 | [] [] [] [] |
- mailfromd | |
- mailutils | [] |
- make | [] [] |
- man-db | [] [] [] |
- minicom | [] [] [] |
- nano | [] [] [] |
- opcodes | [] |
- parted | [] [] |
- pilot-qof | |
- popt | [] [] [] |
- psmisc | [] |
- pwdutils | |
- qof | |
- radius | [] |
- recode | [] [] [] [] [] [] |
- rpm | [] |
- screem | |
- scrollkeeper | [] [] [] [] [] [] [] [] |
- sed | [] [] [] |
- shared-mime-info | [] [] [] [] () [] [] [] |
- sharutils | [] [] [] [] [] [] |
- shishi | |
- skencil | [] () |
- solfege | |
- soundtracker | [] [] |
- sp | [] |
- system-tools-ba... | [] [] [] [] [] [] [] [] [] |
- tar | [] [] |
- texinfo | [] [] [] |
- tin | () () |
- tuxpaint | [] [] [] [] [] [] |
- unicode-han-tra... | |
- unicode-transla... | |
- util-linux | [] [] [] [] |
- util-linux-ng | [] [] [] [] |
- vorbis-tools | [] |
- wastesedge | () |
- wdiff | [] [] [] [] |
- wget | [] [] [] |
- xchat | [] [] [] [] [] [] [] |
- xkeyboard-config | [] |
- xpad | [] [] [] |
- +----------------------------------------------------+
- af am ar az be bg bs ca cs cy da de el en en_GB eo
- 6 0 2 1 8 26 2 40 48 2 56 88 15 1 15 18
-
- es et eu fa fi fr ga gl gu he hi hr hu id is it
+ Ready PO files af am an ar as ast az be be@latin bg bn_IN bs ca
+--------------------------------------------------+
- Compendium | [] [] [] [] [] |
- a2ps | [] [] [] () |
+ a2ps | [] [] |
aegis | |
- ant-phone | [] |
- anubis | [] |
- ap-utils | [] [] |
- aspell | [] [] [] |
- bash | [] |
- bfd | [] [] |
- bibshelf | [] [] [] |
- binutils | [] [] [] |
- bison | [] [] [] [] [] [] |
- bison-runtime | [] [] [] [] [] |
- bluez-pin | [] [] [] [] [] |
- cflow | [] |
- clisp | [] [] |
- console-tools | |
- coreutils | [] [] [] [] [] [] |
- cpio | [] [] [] |
- cpplib | [] [] |
- cryptonit | [] |
- dialog | [] [] [] |
- diffutils | [] [] [] [] [] [] [] [] [] |
- doodle | [] [] |
- e2fsprogs | [] [] [] |
- enscript | [] [] [] |
- fetchmail | [] |
- findutils | [] [] [] |
- findutils_stable | [] [] [] [] |
- flex | [] [] [] |
- fslint | |
- gas | [] [] |
- gawk | [] [] [] [] () |
- gcal | [] [] |
- gcc | [] |
- gettext-examples | [] [] [] [] [] [] [] |
- gettext-runtime | [] [] [] [] [] [] |
- gettext-tools | [] [] [] [] |
- gip | [] [] [] [] |
- gliv | () |
- glunarclock | [] [] [] |
- gmult | [] [] [] |
- gnubiff | () () |
- gnucash | () () () |
- gnuedu | [] |
- gnulib | [] [] [] |
- gnunet | |
- gnunet-gtk | |
- gnutls | |
- gpe-aerial | [] [] |
- gpe-beam | [] [] |
- gpe-calendar | |
- gpe-clock | [] [] [] [] |
- gpe-conf | [] |
- gpe-contacts | [] [] |
- gpe-edit | [] [] [] [] |
- gpe-filemanager | [] |
- gpe-go | [] [] [] |
- gpe-login | [] [] [] |
- gpe-ownerinfo | [] [] [] [] [] |
- gpe-package | [] |
- gpe-sketchbook | [] [] |
- gpe-su | [] [] [] [] |
- gpe-taskmanager | [] [] [] |
- gpe-timesheet | [] [] [] [] |
- gpe-today | [] [] [] [] |
- gpe-todo | [] |
- gphoto2 | [] [] [] [] [] |
- gprof | [] [] [] [] [] |
- gpsdrive | [] |
- gramadoir | [] [] |
- grep | [] [] [] |
- gretl | [] [] [] () |
- gsasl | [] [] |
- gss | [] [] |
- gst-plugins-bad | [] [] [] [] |
- gst-plugins-base | [] [] [] [] |
- gst-plugins-good | [] [] [] [] [] |
- gst-plugins-ugly | [] [] [] [] |
- gstreamer | [] [] [] |
- gtick | [] [] [] |
- gtkam | [] [] [] [] |
- gtkorphan | [] [] |
- gtkspell | [] [] [] [] [] [] [] |
- gutenprint | [] |
- hello | [] [] [] [] [] [] [] [] [] [] [] [] [] |
- herrie | [] |
- hylafax | |
- idutils | [] [] [] [] [] |
- indent | [] [] [] [] [] [] [] [] [] [] |
- iso_15924 | [] |
- iso_3166 | [] [] [] [] [] [] [] [] [] [] [] [] [] |
- iso_3166_2 | [] |
- iso_4217 | [] [] [] [] [] [] |
- iso_639 | [] [] [] [] [] [] |
- jpilot | [] [] |
- jtag | [] |
- jwhois | [] [] [] [] [] |
- kbd | [] [] |
- keytouch | [] [] [] |
- keytouch-editor | [] |
- keytouch-keyboa... | [] [] |
- latrine | [] [] |
- ld | [] [] [] [] |
- leafpad | [] [] [] [] [] [] |
- libc | [] [] [] [] [] |
- libexif | [] |
- libextractor | [] |
- libgpewidget | [] [] [] [] [] |
- libgpg-error | [] |
- libgphoto2 | [] [] [] |
- libgphoto2_port | [] [] |
- libgsasl | [] [] |
- libiconv | [] [] [] |
- libidn | [] [] |
- lifelines | () |
- lilypond | [] [] [] |
- lingoteach | [] [] [] |
- lprng | |
- lynx | [] [] [] |
- m4 | [] [] [] [] |
- mailfromd | |
- mailutils | [] [] |
- make | [] [] [] [] [] [] [] [] |
- man-db | [] |
- minicom | [] [] [] [] |
- nano | [] [] [] [] [] [] [] |
- opcodes | [] [] [] [] |
- parted | [] [] [] |
- pilot-qof | |
- popt | [] [] [] [] |
- psmisc | [] [] |
- pwdutils | |
- qof | [] |
- radius | [] [] |
- recode | [] [] [] [] [] [] [] [] |
- rpm | [] [] |
- screem | |
- scrollkeeper | [] [] [] |
- sed | [] [] [] [] [] |
- shared-mime-info | [] [] [] [] [] [] |
- sharutils | [] [] [] [] [] [] [] [] |
- shishi | [] |
- skencil | [] [] |
- solfege | [] |
- soundtracker | [] [] [] |
- sp | [] |
- system-tools-ba... | [] [] [] [] [] [] [] [] [] |
- tar | [] [] [] [] [] |
- texinfo | [] [] [] |
- tin | [] () |
- tuxpaint | [] [] |
- unicode-han-tra... | |
- unicode-transla... | [] [] |
- util-linux | [] [] [] [] [] [] [] |
- util-linux-ng | [] [] [] [] [] [] [] |
- vorbis-tools | |
- wastesedge | () |
- wdiff | [] [] [] [] [] [] [] [] |
- wget | [] [] [] [] [] [] [] [] |
- xchat | [] [] [] [] [] [] [] |
- xkeyboard-config | [] [] [] [] |
- xpad | [] [] [] |
- +--------------------------------------------------+
- es et eu fa fi fr ga gl gu he hi hr hu id is it
- 85 22 14 2 48 101 61 12 2 8 2 6 53 29 1 52
-
- ja ka ko ku ky lg lt lv mk mn ms mt nb ne nl nn
- +--------------------------------------------------+
- Compendium | [] |
- a2ps | () [] [] |
- aegis | () |
- ant-phone | [] |
- anubis | [] [] [] |
- ap-utils | [] |
- aspell | [] [] |
- bash | [] |
+ ant-phone | |
+ anubis | |
+ aspell | [] [] |
+ bash | |
bfd | |
- bibshelf | [] |
+ bibshelf | [] |
binutils | |
- bison | [] [] [] |
- bison-runtime | [] [] [] |
- bluez-pin | [] [] [] |
+ bison | |
+ bison-runtime | [] |
+ bluez-pin | [] [] |
+ bombono-dvd | |
+ buzztard | |
cflow | |
- clisp | [] |
- console-tools | |
- coreutils | [] |
- cpio | [] |
- cpplib | [] |
- cryptonit | [] |
- dialog | [] [] |
- diffutils | [] [] [] |
+ clisp | |
+ coreutils | [] [] |
+ cpio | |
+ cppi | |
+ cpplib | [] |
+ cryptsetup | |
+ dfarc | |
+ dialog | [] [] |
+ dico | |
+ diffutils | [] |
+ dink | |
doodle | |
- e2fsprogs | [] |
- enscript | [] |
- fetchmail | [] [] |
- findutils | [] |
- findutils_stable | [] |
- flex | [] [] |
- fslint | |
+ e2fsprogs | [] |
+ enscript | [] |
+ exif | |
+ fetchmail | [] |
+ findutils | [] |
+ flex | [] |
+ freedink | |
gas | |
- gawk | [] [] |
- gcal | |
+ gawk | [] [] |
+ gcal | [] |
gcc | |
- gettext-examples | [] [] [] |
- gettext-runtime | [] [] [] |
- gettext-tools | [] [] |
- gip | [] [] |
- gliv | [] |
- glunarclock | [] [] |
- gmult | [] [] [] |
+ gettext-examples | [] [] [] [] |
+ gettext-runtime | [] [] |
+ gettext-tools | [] [] |
+ gip | [] |
+ gjay | |
+ gliv | [] |
+ glunarclock | [] [] |
gnubiff | |
- gnucash | () () () |
+ gnucash | [] |
gnuedu | |
- gnulib | [] [] |
+ gnulib | |
gnunet | |
gnunet-gtk | |
- gnutls | [] |
- gpe-aerial | [] |
- gpe-beam | [] |
- gpe-calendar | [] |
- gpe-clock | [] [] [] |
- gpe-conf | [] [] [] |
- gpe-contacts | [] |
- gpe-edit | [] [] [] |
- gpe-filemanager | [] [] |
- gpe-go | [] [] [] |
- gpe-login | [] [] [] |
- gpe-ownerinfo | [] [] |
- gpe-package | [] [] |
- gpe-sketchbook | [] [] |
- gpe-su | [] [] [] |
- gpe-taskmanager | [] [] [] [] |
- gpe-timesheet | [] |
- gpe-today | [] [] |
- gpe-todo | [] |
- gphoto2 | [] [] |
- gprof | [] |
- gpsdrive | [] |
- gramadoir | () |
- grep | [] [] |
- gretl | |
- gsasl | [] |
+ gnutls | |
+ gold | |
+ gpe-aerial | |
+ gpe-beam | |
+ gpe-bluetooth | |
+ gpe-calendar | |
+ gpe-clock | [] |
+ gpe-conf | |
+ gpe-contacts | |
+ gpe-edit | |
+ gpe-filemanager | |
+ gpe-go | |
+ gpe-login | |
+ gpe-ownerinfo | [] |
+ gpe-package | |
+ gpe-sketchbook | |
+ gpe-su | [] |
+ gpe-taskmanager | [] |
+ gpe-timesheet | [] |
+ gpe-today | [] |
+ gpe-todo | |
+ gphoto2 | |
+ gprof | [] |
+ gpsdrive | |
+ gramadoir | |
+ grep | |
+ grub | [] [] |
+ gsasl | |
gss | |
- gst-plugins-bad | [] |
- gst-plugins-base | [] |
- gst-plugins-good | [] |
- gst-plugins-ugly | [] |
- gstreamer | [] |
- gtick | [] |
- gtkam | [] [] |
- gtkorphan | [] |
- gtkspell | [] [] |
- gutenprint | [] |
- hello | [] [] [] [] [] [] [] |
- herrie | [] |
+ gst-plugins-bad | [] |
+ gst-plugins-base | [] |
+ gst-plugins-good | [] |
+ gst-plugins-ugly | [] |
+ gstreamer | [] [] [] |
+ gtick | |
+ gtkam | [] |
+ gtkorphan | [] |
+ gtkspell | [] [] [] |
+ gutenprint | |
+ hello | [] |
+ help2man | |
hylafax | |
- idutils | [] |
- indent | [] [] |
- iso_15924 | [] |
- iso_3166 | [] [] [] [] [] [] [] [] |
- iso_3166_2 | [] |
- iso_4217 | [] [] [] |
- iso_639 | [] [] [] [] |
- jpilot | () () |
- jtag | |
- jwhois | [] |
- kbd | [] |
- keytouch | [] |
- keytouch-editor | [] |
- keytouch-keyboa... | |
- latrine | [] |
- ld | |
- leafpad | [] [] |
- libc | [] [] [] |
- libexif | |
+ idutils | |
+ indent | [] [] |
+ iso_15924 | |
+ iso_3166 | [] [] [] [] [] [] [] |
+ iso_3166_2 | |
+ iso_4217 | |
+ iso_639 | [] [] [] [] |
+ iso_639_3 | |
+ jwhois | |
+ kbd | |
+ keytouch | [] |
+ keytouch-editor | |
+ keytouch-keyboa... | [] |
+ klavaro | [] |
+ latrine | |
+ ld | [] |
+ leafpad | [] [] |
+ libc | [] [] |
+ libexif | () |
libextractor | |
- libgpewidget | [] |
+ libgnutls | |
+ libgpewidget | |
libgpg-error | |
- libgphoto2 | [] |
- libgphoto2_port | [] |
- libgsasl | [] |
- libiconv | [] |
- libidn | [] [] |
- lifelines | [] |
- lilypond | [] |
- lingoteach | [] |
+ libgphoto2 | |
+ libgphoto2_port | |
+ libgsasl | |
+ libiconv | [] |
+ libidn | |
+ lifelines | |
+ liferea | [] [] |
+ lilypond | |
+ linkdr | [] |
+ lordsawar | |
lprng | |
- lynx | [] [] |
- m4 | [] [] |
+ lynx | [] |
+ m4 | |
mailfromd | |
mailutils | |
- make | [] [] [] |
+ make | |
man-db | |
- minicom | [] |
- nano | [] [] [] |
- opcodes | [] |
- parted | [] [] |
- pilot-qof | |
- popt | [] [] [] |
- psmisc | [] [] [] |
+ man-db-manpages | |
+ minicom | |
+ mkisofs | |
+ myserver | |
+ nano | [] [] |
+ opcodes | |
+ parted | |
+ pies | |
+ popt | |
+ psmisc | |
+ pspp | [] |
pwdutils | |
- qof | |
- radius | |
- recode | [] |
- rpm | [] [] |
- screem | [] |
- scrollkeeper | [] [] [] [] |
- sed | [] [] |
- shared-mime-info | [] [] [] [] [] [] [] |
- sharutils | [] [] |
+ radius | [] |
+ recode | [] [] |
+ rosegarden | |
+ rpm | |
+ rush | |
+ sarg | |
+ screem | |
+ scrollkeeper | [] [] [] |
+ sed | [] [] |
+ sharutils | [] [] |
shishi | |
skencil | |
- solfege | () () |
+ solfege | |
+ solfege-manual | |
soundtracker | |
- sp | () |
- system-tools-ba... | [] [] [] [] |
- tar | [] [] [] |
- texinfo | [] [] |
+ sp | |
+ sysstat | |
+ tar | [] |
+ texinfo | |
tin | |
- tuxpaint | () [] [] |
unicode-han-tra... | |
unicode-transla... | |
- util-linux | [] [] |
- util-linux-ng | [] [] |
+ util-linux-ng | [] |
+ vice | |
+ vmm | |
vorbis-tools | |
- wastesedge | [] |
- wdiff | [] [] |
- wget | [] [] |
- xchat | [] [] [] [] |
- xkeyboard-config | [] [] [] |
- xpad | [] [] [] |
- +--------------------------------------------------+
- ja ka ko ku ky lg lt lv mk mn ms mt nb ne nl nn
- 51 2 25 3 2 0 6 0 2 2 20 0 11 1 103 6
-
- or pa pl pt pt_BR rm ro ru rw sk sl sq sr sv ta
- +--------------------------------------------------+
- Compendium | [] [] [] [] [] |
- a2ps | () [] [] [] [] [] [] |
- aegis | () () |
- ant-phone | [] [] |
- anubis | [] [] [] |
- ap-utils | () |
- aspell | [] [] [] |
- bash | [] [] |
- bfd | |
- bibshelf | [] |
- binutils | [] [] |
- bison | [] [] [] [] [] |
- bison-runtime | [] [] [] [] [] |
- bluez-pin | [] [] [] [] [] [] [] [] [] |
- cflow | [] |
- clisp | [] |
- console-tools | [] |
- coreutils | [] [] [] [] |
- cpio | [] [] [] |
- cpplib | [] |
- cryptonit | [] [] |
- dialog | [] |
- diffutils | [] [] [] [] [] [] |
- doodle | [] [] |
- e2fsprogs | [] [] |
- enscript | [] [] [] [] [] |
- fetchmail | [] [] [] |
- findutils | [] [] [] |
- findutils_stable | [] [] [] [] [] [] |
- flex | [] [] [] [] [] |
- fslint | [] |
- gas | |
- gawk | [] [] [] [] |
- gcal | [] |
- gcc | [] [] |
- gettext-examples | [] [] [] [] [] [] [] [] |
- gettext-runtime | [] [] [] [] [] [] [] [] |
- gettext-tools | [] [] [] [] [] [] [] |
- gip | [] [] [] [] |
- gliv | [] [] [] [] [] [] |
- glunarclock | [] [] [] [] [] [] |
- gmult | [] [] [] [] |
- gnubiff | () [] |
- gnucash | () [] |
- gnuedu | |
- gnulib | [] [] [] |
- gnunet | |
- gnunet-gtk | [] |
- gnutls | [] [] |
- gpe-aerial | [] [] [] [] [] [] [] |
- gpe-beam | [] [] [] [] [] [] [] |
- gpe-calendar | [] [] [] [] |
- gpe-clock | [] [] [] [] [] [] [] [] |
- gpe-conf | [] [] [] [] [] [] [] |
- gpe-contacts | [] [] [] [] [] |
- gpe-edit | [] [] [] [] [] [] [] [] [] |
- gpe-filemanager | [] [] |
- gpe-go | [] [] [] [] [] [] [] [] |
- gpe-login | [] [] [] [] [] [] [] [] |
- gpe-ownerinfo | [] [] [] [] [] [] [] [] |
- gpe-package | [] [] |
- gpe-sketchbook | [] [] [] [] [] [] [] [] |
- gpe-su | [] [] [] [] [] [] [] [] |
- gpe-taskmanager | [] [] [] [] [] [] [] [] |
- gpe-timesheet | [] [] [] [] [] [] [] [] |
- gpe-today | [] [] [] [] [] [] [] [] |
- gpe-todo | [] [] [] [] |
- gphoto2 | [] [] [] [] [] [] |
- gprof | [] [] [] |
- gpsdrive | [] [] |
- gramadoir | [] [] |
- grep | [] [] [] [] |
- gretl | [] [] [] |
- gsasl | [] [] [] |
- gss | [] [] [] [] |
- gst-plugins-bad | [] [] [] |
- gst-plugins-base | [] [] |
- gst-plugins-good | [] [] |
- gst-plugins-ugly | [] [] [] |
- gstreamer | [] [] [] [] |
- gtick | [] |
- gtkam | [] [] [] [] [] |
- gtkorphan | [] |
- gtkspell | [] [] [] [] [] [] [] [] |
- gutenprint | [] |
- hello | [] [] [] [] [] [] [] [] |
- herrie | [] [] [] |
- hylafax | |
- idutils | [] [] [] [] [] |
- indent | [] [] [] [] [] [] [] |
- iso_15924 | |
- iso_3166 | [] [] [] [] [] [] [] [] [] [] [] [] [] |
- iso_3166_2 | |
- iso_4217 | [] [] [] [] [] [] [] |
- iso_639 | [] [] [] [] [] [] [] |
- jpilot | |
- jtag | [] |
- jwhois | [] [] [] [] |
- kbd | [] [] [] |
- keytouch | [] |
- keytouch-editor | [] |
- keytouch-keyboa... | [] |
- latrine | |
- ld | [] |
- leafpad | [] [] [] [] [] [] |
- libc | [] [] [] [] |
- libexif | [] [] |
- libextractor | [] [] |
- libgpewidget | [] [] [] [] [] [] [] [] |
- libgpg-error | [] [] [] |
- libgphoto2 | [] |
- libgphoto2_port | [] [] [] |
- libgsasl | [] [] [] [] |
- libiconv | [] [] [] |
- libidn | [] [] () |
- lifelines | [] [] |
- lilypond | |
- lingoteach | [] |
- lprng | [] |
- lynx | [] [] [] |
- m4 | [] [] [] [] [] |
- mailfromd | [] |
- mailutils | [] [] [] |
- make | [] [] [] [] |
- man-db | [] [] [] [] |
- minicom | [] [] [] [] [] |
- nano | [] [] [] [] |
- opcodes | [] [] |
- parted | [] |
- pilot-qof | |
- popt | [] [] [] [] |
- psmisc | [] [] |
- pwdutils | [] [] |
- qof | [] [] |
- radius | [] [] |
- recode | [] [] [] [] [] [] [] |
- rpm | [] [] [] [] |
- screem | |
- scrollkeeper | [] [] [] [] [] [] [] |
- sed | [] [] [] [] [] [] [] [] [] |
- shared-mime-info | [] [] [] [] [] [] |
- sharutils | [] [] [] [] |
- shishi | [] |
- skencil | [] [] [] |
- solfege | [] |
- soundtracker | [] [] |
- sp | |
- system-tools-ba... | [] [] [] [] [] [] [] [] [] |
- tar | [] [] [] [] |
- texinfo | [] [] [] [] |
- tin | () |
- tuxpaint | [] [] [] [] [] [] |
- unicode-han-tra... | |
- unicode-transla... | |
- util-linux | [] [] [] [] |
- util-linux-ng | [] [] [] [] |
- vorbis-tools | [] |
wastesedge | |
- wdiff | [] [] [] [] [] [] [] |
- wget | [] [] [] [] |
- xchat | [] [] [] [] [] [] [] |
- xkeyboard-config | [] [] [] |
- xpad | [] [] [] |
+ wdiff | |
+ wget | [] [] |
+ wyslij-po | |
+ xchat | [] [] [] [] |
+ xdg-user-dirs | [] [] [] [] [] [] [] [] [] |
+ xkeyboard-config | [] [] |
+--------------------------------------------------+
- or pa pl pt pt_BR rm ro ru rw sk sl sq sr sv ta
- 0 5 77 31 53 4 58 72 3 45 46 9 45 122 3
+ af am an ar as ast az be be@latin bg bn_IN bs ca
+ 6 0 1 2 3 19 1 10 3 28 3 1 38
+
+ crh cs da de el en en_GB en_ZA eo es et eu fa
+ +-------------------------------------------------+
+ a2ps | [] [] [] [] [] [] [] |
+ aegis | [] [] [] |
+ ant-phone | [] () |
+ anubis | [] [] |
+ aspell | [] [] [] [] [] |
+ bash | [] [] [] |
+ bfd | [] |
+ bibshelf | [] [] [] |
+ binutils | [] |
+ bison | [] [] |
+ bison-runtime | [] [] [] [] |
+ bluez-pin | [] [] [] [] [] [] |
+ bombono-dvd | [] |
+ buzztard | [] [] [] |
+ cflow | [] [] |
+ clisp | [] [] [] [] |
+ coreutils | [] [] [] [] |
+ cpio | |
+ cppi | |
+ cpplib | [] [] [] |
+ cryptsetup | [] |
+ dfarc | [] [] [] |
+ dialog | [] [] [] [] [] |
+ dico | |
+ diffutils | [] [] [] [] [] [] |
+ dink | [] [] [] |
+ doodle | [] |
+ e2fsprogs | [] [] [] |
+ enscript | [] [] [] |
+ exif | () [] [] |
+ fetchmail | [] [] () [] [] [] |
+ findutils | [] [] [] |
+ flex | [] [] |
+ freedink | [] [] [] |
+ gas | [] |
+ gawk | [] [] [] |
+ gcal | [] |
+ gcc | [] [] |
+ gettext-examples | [] [] [] [] |
+ gettext-runtime | [] [] [] [] |
+ gettext-tools | [] [] [] |
+ gip | [] [] [] [] |
+ gjay | [] |
+ gliv | [] [] [] |
+ glunarclock | [] [] |
+ gnubiff | () |
+ gnucash | [] () () () () |
+ gnuedu | [] [] |
+ gnulib | [] [] |
+ gnunet | |
+ gnunet-gtk | [] |
+ gnutls | [] [] |
+ gold | [] |
+ gpe-aerial | [] [] [] [] |
+ gpe-beam | [] [] [] [] |
+ gpe-bluetooth | [] [] |
+ gpe-calendar | [] |
+ gpe-clock | [] [] [] [] |
+ gpe-conf | [] [] [] |
+ gpe-contacts | [] [] [] |
+ gpe-edit | [] [] |
+ gpe-filemanager | [] [] [] |
+ gpe-go | [] [] [] [] |
+ gpe-login | [] [] |
+ gpe-ownerinfo | [] [] [] [] |
+ gpe-package | [] [] [] |
+ gpe-sketchbook | [] [] [] [] |
+ gpe-su | [] [] [] [] |
+ gpe-taskmanager | [] [] [] [] |
+ gpe-timesheet | [] [] [] [] |
+ gpe-today | [] [] [] [] |
+ gpe-todo | [] [] [] |
+ gphoto2 | [] [] () [] [] [] |
+ gprof | [] [] [] |
+ gpsdrive | [] [] [] |
+ gramadoir | [] [] [] |
+ grep | [] |
+ grub | [] [] |
+ gsasl | [] |
+ gss | |
+ gst-plugins-bad | [] [] [] [] [] |
+ gst-plugins-base | [] [] [] [] [] |
+ gst-plugins-good | [] [] [] [] [] [] |
+ gst-plugins-ugly | [] [] [] [] [] [] |
+ gstreamer | [] [] [] [] [] |
+ gtick | [] () [] |
+ gtkam | [] [] () [] [] |
+ gtkorphan | [] [] [] [] |
+ gtkspell | [] [] [] [] [] [] [] |
+ gutenprint | [] [] [] |
+ hello | [] [] [] [] |
+ help2man | [] |
+ hylafax | [] [] |
+ idutils | [] [] |
+ indent | [] [] [] [] [] [] [] |
+ iso_15924 | [] () [] [] |
+ iso_3166 | [] [] [] [] () [] [] [] () |
+ iso_3166_2 | () |
+ iso_4217 | [] [] [] () [] [] |
+ iso_639 | [] [] [] [] () [] [] |
+ iso_639_3 | [] |
+ jwhois | [] |
+ kbd | [] [] [] [] [] |
+ keytouch | [] [] |
+ keytouch-editor | [] [] |
+ keytouch-keyboa... | [] |
+ klavaro | [] [] [] [] |
+ latrine | [] () |
+ ld | [] [] |
+ leafpad | [] [] [] [] [] [] |
+ libc | [] [] [] [] |
+ libexif | [] [] () |
+ libextractor | |
+ libgnutls | [] |
+ libgpewidget | [] [] |
+ libgpg-error | [] [] |
+ libgphoto2 | [] () |
+ libgphoto2_port | [] () [] |
+ libgsasl | |
+ libiconv | [] [] [] [] [] |
+ libidn | [] [] [] |
+ lifelines | [] () |
+ liferea | [] [] [] [] [] |
+ lilypond | [] [] [] |
+ linkdr | [] [] [] |
+ lordsawar | [] |
+ lprng | |
+ lynx | [] [] [] [] |
+ m4 | [] [] [] [] |
+ mailfromd | |
+ mailutils | [] |
+ make | [] [] [] |
+ man-db | |
+ man-db-manpages | |
+ minicom | [] [] [] [] |
+ mkisofs | |
+ myserver | |
+ nano | [] [] [] |
+ opcodes | [] [] |
+ parted | [] [] |
+ pies | |
+ popt | [] [] [] [] [] |
+ psmisc | [] [] [] |
+ pspp | [] |
+ pwdutils | [] |
+ radius | [] |
+ recode | [] [] [] [] [] [] |
+ rosegarden | () () () |
+ rpm | [] [] [] |
+ rush | |
+ sarg | |
+ screem | |
+ scrollkeeper | [] [] [] [] [] |
+ sed | [] [] [] [] [] [] |
+ sharutils | [] [] [] [] |
+ shishi | |
+ skencil | [] () [] |
+ solfege | [] [] [] |
+ solfege-manual | [] [] |
+ soundtracker | [] [] [] |
+ sp | [] |
+ sysstat | [] [] [] |
+ tar | [] [] [] [] |
+ texinfo | [] [] [] |
+ tin | [] [] |
+ unicode-han-tra... | |
+ unicode-transla... | |
+ util-linux-ng | [] [] [] [] |
+ vice | () () |
+ vmm | [] |
+ vorbis-tools | [] [] |
+ wastesedge | [] |
+ wdiff | [] [] |
+ wget | [] [] [] |
+ wyslij-po | |
+ xchat | [] [] [] [] [] |
+ xdg-user-dirs | [] [] [] [] [] [] [] [] [] |
+ xkeyboard-config | [] [] [] [] [] [] |
+ +-------------------------------------------------+
+ crh cs da de el en en_GB en_ZA eo es et eu fa
+ 5 64 105 117 18 1 8 0 28 89 18 19 0
+
+ fi fr ga gl gu he hi hr hu hy id is it ja ka kn
+ +----------------------------------------------------+
+ a2ps | [] [] [] [] |
+ aegis | [] [] |
+ ant-phone | [] [] |
+ anubis | [] [] [] [] |
+ aspell | [] [] [] [] |
+ bash | [] [] [] [] |
+ bfd | [] [] [] |
+ bibshelf | [] [] [] [] [] |
+ binutils | [] [] [] |
+ bison | [] [] [] [] |
+ bison-runtime | [] [] [] [] [] [] |
+ bluez-pin | [] [] [] [] [] [] [] [] |
+ bombono-dvd | [] |
+ buzztard | [] |
+ cflow | [] [] [] |
+ clisp | [] |
+ coreutils | [] [] [] [] [] |
+ cpio | [] [] [] [] |
+ cppi | [] [] |
+ cpplib | [] [] [] |
+ cryptsetup | [] [] [] |
+ dfarc | [] [] [] |
+ dialog | [] [] [] [] [] [] [] |
+ dico | |
+ diffutils | [] [] [] [] [] [] [] [] [] |
+ dink | [] |
+ doodle | [] [] |
+ e2fsprogs | [] [] |
+ enscript | [] [] [] [] |
+ exif | [] [] [] [] [] [] |
+ fetchmail | [] [] [] [] |
+ findutils | [] [] [] [] [] [] |
+ flex | [] [] [] |
+ freedink | [] [] [] |
+ gas | [] [] |
+ gawk | [] [] [] [] () [] |
+ gcal | [] |
+ gcc | [] |
+ gettext-examples | [] [] [] [] [] [] [] |
+ gettext-runtime | [] [] [] [] [] [] |
+ gettext-tools | [] [] [] [] |
+ gip | [] [] [] [] [] [] |
+ gjay | [] |
+ gliv | [] () |
+ glunarclock | [] [] [] [] |
+ gnubiff | () [] () |
+ gnucash | () () () () () [] |
+ gnuedu | [] [] |
+ gnulib | [] [] [] [] [] [] |
+ gnunet | |
+ gnunet-gtk | [] |
+ gnutls | [] [] |
+ gold | [] [] |
+ gpe-aerial | [] [] [] |
+ gpe-beam | [] [] [] [] |
+ gpe-bluetooth | [] [] [] [] |
+ gpe-calendar | [] [] |
+ gpe-clock | [] [] [] [] [] |
+ gpe-conf | [] [] [] [] |
+ gpe-contacts | [] [] [] [] |
+ gpe-edit | [] [] [] |
+ gpe-filemanager | [] [] [] [] |
+ gpe-go | [] [] [] [] [] |
+ gpe-login | [] [] [] |
+ gpe-ownerinfo | [] [] [] [] [] |
+ gpe-package | [] [] [] |
+ gpe-sketchbook | [] [] [] [] |
+ gpe-su | [] [] [] [] [] [] |
+ gpe-taskmanager | [] [] [] [] [] |
+ gpe-timesheet | [] [] [] [] [] |
+ gpe-today | [] [] [] [] [] [] [] |
+ gpe-todo | [] [] [] |
+ gphoto2 | [] [] [] [] [] [] |
+ gprof | [] [] [] [] |
+ gpsdrive | [] [] [] |
+ gramadoir | [] [] [] |
+ grep | [] [] |
+ grub | [] [] [] [] |
+ gsasl | [] [] [] [] [] |
+ gss | [] [] [] [] [] |
+ gst-plugins-bad | [] [] [] [] [] [] |
+ gst-plugins-base | [] [] [] [] [] [] |
+ gst-plugins-good | [] [] [] [] [] [] |
+ gst-plugins-ugly | [] [] [] [] [] [] |
+ gstreamer | [] [] [] [] [] |
+ gtick | [] [] [] [] [] |
+ gtkam | [] [] [] [] [] |
+ gtkorphan | [] [] [] |
+ gtkspell | [] [] [] [] [] [] [] [] [] |
+ gutenprint | [] [] [] [] |
+ hello | [] [] [] |
+ help2man | [] [] |
+ hylafax | [] |
+ idutils | [] [] [] [] [] [] |
+ indent | [] [] [] [] [] [] [] [] |
+ iso_15924 | [] () [] [] |
+ iso_3166 | [] () [] [] [] [] [] [] [] [] [] [] |
+ iso_3166_2 | () [] [] [] |
+ iso_4217 | [] () [] [] [] [] |
+ iso_639 | [] () [] [] [] [] [] [] [] |
+ iso_639_3 | () [] [] |
+ jwhois | [] [] [] [] [] |
+ kbd | [] [] |
+ keytouch | [] [] [] [] [] [] |
+ keytouch-editor | [] [] [] [] [] |
+ keytouch-keyboa... | [] [] [] [] [] |
+ klavaro | [] [] |
+ latrine | [] [] [] |
+ ld | [] [] [] [] |
+ leafpad | [] [] [] [] [] [] [] () |
+ libc | [] [] [] [] [] |
+ libexif | [] |
+ libextractor | |
+ libgnutls | [] [] |
+ libgpewidget | [] [] [] [] |
+ libgpg-error | [] [] |
+ libgphoto2 | [] [] [] |
+ libgphoto2_port | [] [] [] |
+ libgsasl | [] [] [] [] [] |
+ libiconv | [] [] [] [] [] [] |
+ libidn | [] [] [] [] |
+ lifelines | () |
+ liferea | [] [] [] [] |
+ lilypond | [] [] |
+ linkdr | [] [] [] [] [] |
+ lordsawar | |
+ lprng | [] |
+ lynx | [] [] [] [] [] |
+ m4 | [] [] [] [] [] [] |
+ mailfromd | |
+ mailutils | [] [] |
+ make | [] [] [] [] [] [] [] [] [] |
+ man-db | [] [] |
+ man-db-manpages | [] |
+ minicom | [] [] [] [] [] |
+ mkisofs | [] [] [] [] |
+ myserver | |
+ nano | [] [] [] [] [] [] |
+ opcodes | [] [] [] [] |
+ parted | [] [] [] [] |
+ pies | |
+ popt | [] [] [] [] [] [] [] [] [] |
+ psmisc | [] [] [] |
+ pspp | |
+ pwdutils | [] [] |
+ radius | [] [] |
+ recode | [] [] [] [] [] [] [] [] |
+ rosegarden | () () () () () |
+ rpm | [] [] |
+ rush | |
+ sarg | [] |
+ screem | [] [] |
+ scrollkeeper | [] [] [] [] |
+ sed | [] [] [] [] [] [] [] [] |
+ sharutils | [] [] [] [] [] [] [] |
+ shishi | [] |
+ skencil | [] |
+ solfege | [] [] [] [] |
+ solfege-manual | [] [] |
+ soundtracker | [] [] |
+ sp | [] () |
+ sysstat | [] [] [] [] [] |
+ tar | [] [] [] [] [] [] [] |
+ texinfo | [] [] [] [] |
+ tin | [] |
+ unicode-han-tra... | |
+ unicode-transla... | [] [] |
+ util-linux-ng | [] [] [] [] [] [] |
+ vice | () () () |
+ vmm | [] |
+ vorbis-tools | [] |
+ wastesedge | () () |
+ wdiff | [] |
+ wget | [] [] [] [] [] [] [] [] |
+ wyslij-po | [] [] [] |
+ xchat | [] [] [] [] [] [] [] [] [] |
+ xdg-user-dirs | [] [] [] [] [] [] [] [] [] [] [] [] [] |
+ xkeyboard-config | [] [] [] [] [] |
+ +----------------------------------------------------+
+ fi fr ga gl gu he hi hr hu hy id is it ja ka kn
+ 105 121 53 20 4 8 3 5 53 2 120 5 84 67 0 4
+
+ ko ku ky lg lt lv mk ml mn mr ms mt nb nds ne
+ +-----------------------------------------------+
+ a2ps | [] |
+ aegis | |
+ ant-phone | |
+ anubis | [] [] |
+ aspell | [] |
+ bash | |
+ bfd | |
+ bibshelf | [] [] |
+ binutils | |
+ bison | [] |
+ bison-runtime | [] [] [] [] [] |
+ bluez-pin | [] [] [] [] [] |
+ bombono-dvd | |
+ buzztard | |
+ cflow | |
+ clisp | |
+ coreutils | [] |
+ cpio | |
+ cppi | |
+ cpplib | |
+ cryptsetup | |
+ dfarc | [] |
+ dialog | [] [] [] [] [] |
+ dico | |
+ diffutils | [] [] |
+ dink | |
+ doodle | |
+ e2fsprogs | |
+ enscript | |
+ exif | [] |
+ fetchmail | |
+ findutils | |
+ flex | |
+ freedink | [] |
+ gas | |
+ gawk | |
+ gcal | |
+ gcc | |
+ gettext-examples | [] [] [] [] |
+ gettext-runtime | [] |
+ gettext-tools | [] |
+ gip | [] [] |
+ gjay | |
+ gliv | |
+ glunarclock | [] |
+ gnubiff | |
+ gnucash | () () () () |
+ gnuedu | |
+ gnulib | |
+ gnunet | |
+ gnunet-gtk | |
+ gnutls | [] |
+ gold | |
+ gpe-aerial | [] |
+ gpe-beam | [] |
+ gpe-bluetooth | [] [] |
+ gpe-calendar | [] |
+ gpe-clock | [] [] [] [] [] |
+ gpe-conf | [] [] |
+ gpe-contacts | [] [] |
+ gpe-edit | [] |
+ gpe-filemanager | [] [] |
+ gpe-go | [] [] [] |
+ gpe-login | [] |
+ gpe-ownerinfo | [] [] |
+ gpe-package | [] [] |
+ gpe-sketchbook | [] [] |
+ gpe-su | [] [] [] [] [] [] |
+ gpe-taskmanager | [] [] [] [] [] [] |
+ gpe-timesheet | [] [] |
+ gpe-today | [] [] [] [] |
+ gpe-todo | [] [] |
+ gphoto2 | |
+ gprof | [] |
+ gpsdrive | |
+ gramadoir | |
+ grep | |
+ grub | |
+ gsasl | |
+ gss | |
+ gst-plugins-bad | [] [] [] [] |
+ gst-plugins-base | [] [] |
+ gst-plugins-good | [] [] |
+ gst-plugins-ugly | [] [] [] [] [] |
+ gstreamer | |
+ gtick | |
+ gtkam | [] |
+ gtkorphan | [] [] |
+ gtkspell | [] [] [] [] [] [] [] |
+ gutenprint | |
+ hello | [] [] [] |
+ help2man | |
+ hylafax | |
+ idutils | |
+ indent | |
+ iso_15924 | [] [] |
+ iso_3166 | [] [] () [] [] [] [] [] |
+ iso_3166_2 | |
+ iso_4217 | [] [] |
+ iso_639 | [] [] |
+ iso_639_3 | [] |
+ jwhois | [] |
+ kbd | |
+ keytouch | [] |
+ keytouch-editor | [] |
+ keytouch-keyboa... | [] |
+ klavaro | [] |
+ latrine | [] |
+ ld | |
+ leafpad | [] [] [] |
+ libc | [] |
+ libexif | |
+ libextractor | |
+ libgnutls | [] |
+ libgpewidget | [] [] |
+ libgpg-error | |
+ libgphoto2 | |
+ libgphoto2_port | |
+ libgsasl | |
+ libiconv | |
+ libidn | |
+ lifelines | |
+ liferea | |
+ lilypond | |
+ linkdr | |
+ lordsawar | |
+ lprng | |
+ lynx | |
+ m4 | |
+ mailfromd | |
+ mailutils | |
+ make | [] |
+ man-db | |
+ man-db-manpages | |
+ minicom | [] |
+ mkisofs | |
+ myserver | |
+ nano | [] [] |
+ opcodes | |
+ parted | |
+ pies | |
+ popt | [] [] [] |
+ psmisc | |
+ pspp | |
+ pwdutils | |
+ radius | |
+ recode | |
+ rosegarden | |
+ rpm | |
+ rush | |
+ sarg | |
+ screem | |
+ scrollkeeper | [] [] |
+ sed | |
+ sharutils | |
+ shishi | |
+ skencil | |
+ solfege | [] |
+ solfege-manual | |
+ soundtracker | |
+ sp | |
+ sysstat | [] |
+ tar | [] |
+ texinfo | [] |
+ tin | |
+ unicode-han-tra... | |
+ unicode-transla... | |
+ util-linux-ng | |
+ vice | |
+ vmm | |
+ vorbis-tools | |
+ wastesedge | |
+ wdiff | |
+ wget | [] |
+ wyslij-po | |
+ xchat | [] [] [] |
+ xdg-user-dirs | [] [] [] [] [] [] [] [] |
+ xkeyboard-config | [] [] [] |
+ +-----------------------------------------------+
+ ko ku ky lg lt lv mk ml mn mr ms mt nb nds ne
+ 20 5 10 1 13 48 4 2 2 4 24 10 20 3 1
+
+ nl nn or pa pl ps pt pt_BR ro ru rw sk sl sq sr
+ +---------------------------------------------------+
+ a2ps | [] [] [] [] [] [] [] [] |
+ aegis | [] [] [] |
+ ant-phone | [] [] |
+ anubis | [] [] [] |
+ aspell | [] [] [] [] [] |
+ bash | [] [] |
+ bfd | [] |
+ bibshelf | [] [] |
+ binutils | [] [] |
+ bison | [] [] [] |
+ bison-runtime | [] [] [] [] [] [] [] |
+ bluez-pin | [] [] [] [] [] [] [] [] |
+ bombono-dvd | [] () |
+ buzztard | [] [] |
+ cflow | [] |
+ clisp | [] [] |
+ coreutils | [] [] [] [] [] [] |
+ cpio | [] [] [] |
+ cppi | [] |
+ cpplib | [] |
+ cryptsetup | [] |
+ dfarc | [] |
+ dialog | [] [] [] [] |
+ dico | [] |
+ diffutils | [] [] [] [] [] [] |
+ dink | () |
+ doodle | [] [] |
+ e2fsprogs | [] [] |
+ enscript | [] [] [] [] [] |
+ exif | [] [] [] () [] |
+ fetchmail | [] [] [] [] |
+ findutils | [] [] [] [] [] |
+ flex | [] [] [] [] [] |
+ freedink | [] [] |
+ gas | |
+ gawk | [] [] [] [] |
+ gcal | |
+ gcc | [] |
+ gettext-examples | [] [] [] [] [] [] [] [] |
+ gettext-runtime | [] [] [] [] [] [] [] [] [] |
+ gettext-tools | [] [] [] [] [] [] |
+ gip | [] [] [] [] [] |
+ gjay | |
+ gliv | [] [] [] [] [] [] |
+ glunarclock | [] [] [] [] [] |
+ gnubiff | [] () |
+ gnucash | [] () () () |
+ gnuedu | [] |
+ gnulib | [] [] [] [] |
+ gnunet | |
+ gnunet-gtk | |
+ gnutls | [] [] |
+ gold | |
+ gpe-aerial | [] [] [] [] [] [] [] |
+ gpe-beam | [] [] [] [] [] [] [] |
+ gpe-bluetooth | [] [] |
+ gpe-calendar | [] [] [] [] |
+ gpe-clock | [] [] [] [] [] [] [] [] |
+ gpe-conf | [] [] [] [] [] [] [] |
+ gpe-contacts | [] [] [] [] [] |
+ gpe-edit | [] [] [] |
+ gpe-filemanager | [] [] [] |
+ gpe-go | [] [] [] [] [] [] [] [] |
+ gpe-login | [] [] |
+ gpe-ownerinfo | [] [] [] [] [] [] [] [] |
+ gpe-package | [] [] |
+ gpe-sketchbook | [] [] [] [] [] [] [] |
+ gpe-su | [] [] [] [] [] [] [] [] |
+ gpe-taskmanager | [] [] [] [] [] [] [] [] |
+ gpe-timesheet | [] [] [] [] [] [] [] [] |
+ gpe-today | [] [] [] [] [] [] [] [] |
+ gpe-todo | [] [] [] [] [] |
+ gphoto2 | [] [] [] [] [] [] [] [] |
+ gprof | [] [] [] |
+ gpsdrive | [] [] |
+ gramadoir | [] [] |
+ grep | [] [] [] [] |
+ grub | [] [] [] |
+ gsasl | [] [] [] [] |
+ gss | [] [] [] |
+ gst-plugins-bad | [] [] [] [] [] [] |
+ gst-plugins-base | [] [] [] [] [] |
+ gst-plugins-good | [] [] [] [] [] |
+ gst-plugins-ugly | [] [] [] [] [] [] |
+ gstreamer | [] [] [] [] [] |
+ gtick | [] [] [] |
+ gtkam | [] [] [] [] [] [] |
+ gtkorphan | [] |
+ gtkspell | [] [] [] [] [] [] [] [] [] [] |
+ gutenprint | [] [] |
+ hello | [] [] [] [] |
+ help2man | [] [] |
+ hylafax | [] |
+ idutils | [] [] [] [] [] |
+ indent | [] [] [] [] [] [] [] |
+ iso_15924 | [] [] [] [] |
+ iso_3166 | [] [] [] [] [] () [] [] [] [] [] [] [] [] |
+ iso_3166_2 | [] [] [] |
+ iso_4217 | [] [] [] [] [] [] [] [] |
+ iso_639 | [] [] [] [] [] [] [] [] [] |
+ iso_639_3 | [] [] |
+ jwhois | [] [] [] [] |
+ kbd | [] [] [] |
+ keytouch | [] [] [] |
+ keytouch-editor | [] [] [] |
+ keytouch-keyboa... | [] [] [] |
+ klavaro | [] [] |
+ latrine | [] [] |
+ ld | |
+ leafpad | [] [] [] [] [] [] [] [] [] |
+ libc | [] [] [] [] |
+ libexif | [] [] () [] |
+ libextractor | |
+ libgnutls | [] [] |
+ libgpewidget | [] [] [] |
+ libgpg-error | [] [] |
+ libgphoto2 | [] [] |
+ libgphoto2_port | [] [] [] [] [] |
+ libgsasl | [] [] [] [] [] |
+ libiconv | [] [] [] [] [] |
+ libidn | [] [] |
+ lifelines | [] [] |
+ liferea | [] [] [] [] [] () () [] |
+ lilypond | [] |
+ linkdr | [] [] [] |
+ lordsawar | |
+ lprng | [] |
+ lynx | [] [] [] |
+ m4 | [] [] [] [] [] |
+ mailfromd | [] |
+ mailutils | [] |
+ make | [] [] [] [] |
+ man-db | [] [] [] |
+ man-db-manpages | [] [] [] |
+ minicom | [] [] [] [] |
+ mkisofs | [] [] [] |
+ myserver | |
+ nano | [] [] [] [] |
+ opcodes | [] [] |
+ parted | [] [] [] [] |
+ pies | [] |
+ popt | [] [] [] [] |
+ psmisc | [] [] [] |
+ pspp | [] [] |
+ pwdutils | [] |
+ radius | [] [] [] |
+ recode | [] [] [] [] [] [] [] [] |
+ rosegarden | () () |
+ rpm | [] [] [] |
+ rush | [] [] |
+ sarg | |
+ screem | |
+ scrollkeeper | [] [] [] [] [] [] [] [] |
+ sed | [] [] [] [] [] [] [] [] [] |
+ sharutils | [] [] [] [] |
+ shishi | [] |
+ skencil | [] [] |
+ solfege | [] [] [] [] |
+ solfege-manual | [] [] [] |
+ soundtracker | [] |
+ sp | |
+ sysstat | [] [] [] [] |
+ tar | [] [] [] [] |
+ texinfo | [] [] [] [] |
+ tin | [] |
+ unicode-han-tra... | |
+ unicode-transla... | |
+ util-linux-ng | [] [] [] [] [] |
+ vice | [] |
+ vmm | [] |
+ vorbis-tools | [] [] |
+ wastesedge | [] |
+ wdiff | [] [] |
+ wget | [] [] [] [] [] [] [] |
+ wyslij-po | [] [] [] |
+ xchat | [] [] [] [] [] [] [] [] [] |
+ xdg-user-dirs | [] [] [] [] [] [] [] [] [] [] [] [] [] [] |
+ xkeyboard-config | [] [] [] |
+ +---------------------------------------------------+
+ nl nn or pa pl ps pt pt_BR ro ru rw sk sl sq sr
+ 135 10 4 7 105 1 29 62 47 91 3 54 46 9 37
- tg th tk tr uk ven vi wa xh zh_CN zh_HK zh_TW zu
+ sv sw ta te tg th tr uk vi wa zh_CN zh_HK zh_TW
+---------------------------------------------------+
- Compendium | [] [] [] [] | 19
- a2ps | [] [] [] | 19
- aegis | [] | 1
- ant-phone | [] [] | 6
- anubis | [] [] [] | 11
- ap-utils | () [] | 4
- aspell | [] [] [] | 16
- bash | [] | 6
- bfd | | 2
- bibshelf | [] | 7
- binutils | [] [] [] [] | 9
- bison | [] [] [] [] | 20
- bison-runtime | [] [] [] [] | 18
- bluez-pin | [] [] [] [] [] [] | 28
- cflow | [] [] | 5
- clisp | | 9
- console-tools | [] [] | 5
- coreutils | [] [] [] | 18
- cpio | [] [] [] [] | 11
- cpplib | [] [] [] [] [] | 12
- cryptonit | [] | 6
- dialog | [] [] [] | 9
- diffutils | [] [] [] [] [] | 29
- doodle | [] | 6
- e2fsprogs | [] [] | 10
- enscript | [] [] [] | 16
- fetchmail | [] [] | 12
- findutils | [] [] [] | 11
- findutils_stable | [] [] [] [] | 18
- flex | [] [] | 15
- fslint | [] | 2
- gas | [] | 3
- gawk | [] [] [] | 16
- gcal | [] | 5
- gcc | [] [] [] | 7
- gettext-examples | [] [] [] [] [] [] | 29
- gettext-runtime | [] [] [] [] [] [] | 28
- gettext-tools | [] [] [] [] [] | 20
- gip | [] [] | 13
- gliv | [] [] | 11
- glunarclock | [] [] [] | 15
- gmult | [] [] [] [] | 16
- gnubiff | [] | 2
- gnucash | () [] | 5
- gnuedu | [] | 2
- gnulib | [] | 10
- gnunet | | 0
- gnunet-gtk | [] [] | 3
- gnutls | | 4
- gpe-aerial | [] [] | 14
- gpe-beam | [] [] | 14
- gpe-calendar | [] [] | 7
- gpe-clock | [] [] [] [] | 21
- gpe-conf | [] [] [] | 16
- gpe-contacts | [] [] | 10
- gpe-edit | [] [] [] [] [] | 22
- gpe-filemanager | [] [] | 7
- gpe-go | [] [] [] [] | 19
- gpe-login | [] [] [] [] [] | 21
- gpe-ownerinfo | [] [] [] [] | 21
- gpe-package | [] | 6
- gpe-sketchbook | [] [] | 16
- gpe-su | [] [] [] [] | 21
- gpe-taskmanager | [] [] [] [] | 21
- gpe-timesheet | [] [] [] [] | 18
- gpe-today | [] [] [] [] [] | 21
- gpe-todo | [] [] | 8
- gphoto2 | [] [] [] [] | 21
- gprof | [] [] | 13
- gpsdrive | [] | 5
- gramadoir | [] | 7
- grep | [] | 12
- gretl | | 6
- gsasl | [] [] [] | 9
- gss | [] | 7
- gst-plugins-bad | [] [] [] | 13
- gst-plugins-base | [] [] | 11
- gst-plugins-good | [] [] [] [] [] | 16
- gst-plugins-ugly | [] [] [] | 13
- gstreamer | [] [] [] | 18
- gtick | [] [] | 7
- gtkam | [] | 16
- gtkorphan | [] | 7
- gtkspell | [] [] [] [] [] [] | 27
- gutenprint | | 4
- hello | [] [] [] [] [] | 38
- herrie | [] [] | 8
- hylafax | | 0
- idutils | [] [] | 15
- indent | [] [] [] [] [] | 28
- iso_15924 | [] [] | 4
- iso_3166 | [] [] [] [] [] [] [] [] [] | 54
- iso_3166_2 | [] [] | 4
- iso_4217 | [] [] [] [] [] | 24
- iso_639 | [] [] [] [] [] | 26
- jpilot | [] [] [] [] | 7
- jtag | [] | 3
- jwhois | [] [] [] | 13
- kbd | [] [] [] | 13
- keytouch | [] | 8
- keytouch-editor | [] | 5
- keytouch-keyboa... | [] | 5
- latrine | [] [] | 5
- ld | [] [] [] [] | 10
- leafpad | [] [] [] [] [] | 24
- libc | [] [] [] | 19
- libexif | [] | 5
- libextractor | [] | 5
- libgpewidget | [] [] [] | 20
- libgpg-error | [] | 6
- libgphoto2 | [] [] | 9
- libgphoto2_port | [] [] [] | 11
- libgsasl | [] | 8
- libiconv | [] [] | 11
- libidn | [] [] | 11
- lifelines | | 4
- lilypond | [] | 6
- lingoteach | [] | 6
- lprng | [] | 2
- lynx | [] [] [] | 15
- m4 | [] [] [] | 18
- mailfromd | [] [] | 3
- mailutils | [] [] | 8
- make | [] [] [] | 20
- man-db | [] | 9
- minicom | [] | 14
- nano | [] [] [] | 20
- opcodes | [] [] | 10
- parted | [] [] [] | 11
- pilot-qof | [] | 1
- popt | [] [] [] [] | 18
- psmisc | [] [] | 10
- pwdutils | [] | 3
- qof | [] | 4
- radius | [] [] | 7
- recode | [] [] [] | 25
- rpm | [] [] [] [] | 13
- screem | [] | 2
- scrollkeeper | [] [] [] [] | 26
- sed | [] [] [] [] | 23
- shared-mime-info | [] [] [] | 29
- sharutils | [] [] [] | 23
- shishi | [] | 3
- skencil | [] | 7
- solfege | [] | 3
- soundtracker | [] [] | 9
- sp | [] | 3
- system-tools-ba... | [] [] [] [] [] [] [] | 38
- tar | [] [] [] | 17
- texinfo | [] [] [] | 15
- tin | | 1
- tuxpaint | [] [] [] | 19
+ a2ps | [] [] [] [] [] | 27
+ aegis | [] | 9
+ ant-phone | [] [] [] [] | 9
+ anubis | [] [] [] [] | 15
+ aspell | [] [] [] | 20
+ bash | [] [] [] | 12
+ bfd | [] | 6
+ bibshelf | [] [] [] | 16
+ binutils | [] [] | 8
+ bison | [] [] | 12
+ bison-runtime | [] [] [] [] [] [] | 29
+ bluez-pin | [] [] [] [] [] [] [] [] | 37
+ bombono-dvd | [] | 4
+ buzztard | [] | 7
+ cflow | [] [] [] | 9
+ clisp | | 10
+ coreutils | [] [] [] [] | 22
+ cpio | [] [] [] [] [] [] | 13
+ cppi | [] [] | 5
+ cpplib | [] [] [] [] [] [] | 14
+ cryptsetup | [] [] | 7
+ dfarc | [] | 9
+ dialog | [] [] [] [] [] [] [] | 30
+ dico | [] | 2
+ diffutils | [] [] [] [] [] [] | 30
+ dink | | 4
+ doodle | [] [] | 7
+ e2fsprogs | [] [] [] | 11
+ enscript | [] [] [] [] | 17
+ exif | [] [] [] | 16
+ fetchmail | [] [] [] | 17
+ findutils | [] [] [] [] [] | 20
+ flex | [] [] [] [] | 15
+ freedink | [] | 10
+ gas | [] | 4
+ gawk | [] [] [] [] | 18
+ gcal | [] [] | 5
+ gcc | [] [] [] | 7
+ gettext-examples | [] [] [] [] [] [] [] | 34
+ gettext-runtime | [] [] [] [] [] [] [] | 29
+ gettext-tools | [] [] [] [] [] [] | 22
+ gip | [] [] [] [] | 22
+ gjay | [] | 3
+ gliv | [] [] [] | 14
+ glunarclock | [] [] [] [] [] | 19
+ gnubiff | [] [] | 4
+ gnucash | () [] () [] () | 10
+ gnuedu | [] [] | 7
+ gnulib | [] [] [] [] | 16
+ gnunet | [] | 1
+ gnunet-gtk | [] [] [] | 5
+ gnutls | [] [] [] | 10
+ gold | [] | 4
+ gpe-aerial | [] [] [] | 18
+ gpe-beam | [] [] [] | 19
+ gpe-bluetooth | [] [] [] | 13
+ gpe-calendar | [] [] [] [] | 12
+ gpe-clock | [] [] [] [] [] | 28
+ gpe-conf | [] [] [] [] | 20
+ gpe-contacts | [] [] [] | 17
+ gpe-edit | [] [] [] | 12
+ gpe-filemanager | [] [] [] [] | 16
+ gpe-go | [] [] [] [] [] | 25
+ gpe-login | [] [] [] | 11
+ gpe-ownerinfo | [] [] [] [] [] | 25
+ gpe-package | [] [] [] | 13
+ gpe-sketchbook | [] [] [] | 20
+ gpe-su | [] [] [] [] [] | 30
+ gpe-taskmanager | [] [] [] [] [] | 29
+ gpe-timesheet | [] [] [] [] [] | 25
+ gpe-today | [] [] [] [] [] [] | 30
+ gpe-todo | [] [] [] [] | 17
+ gphoto2 | [] [] [] [] [] | 24
+ gprof | [] [] [] | 15
+ gpsdrive | [] [] [] | 11
+ gramadoir | [] [] [] | 11
+ grep | [] [] [] | 10
+ grub | [] [] [] | 14
+ gsasl | [] [] [] [] | 14
+ gss | [] [] [] | 11
+ gst-plugins-bad | [] [] [] [] | 26
+ gst-plugins-base | [] [] [] [] [] | 24
+ gst-plugins-good | [] [] [] [] | 24
+ gst-plugins-ugly | [] [] [] [] [] | 29
+ gstreamer | [] [] [] [] | 22
+ gtick | [] [] [] | 13
+ gtkam | [] [] [] | 20
+ gtkorphan | [] [] [] | 14
+ gtkspell | [] [] [] [] [] [] [] [] [] | 45
+ gutenprint | [] | 10
+ hello | [] [] [] [] [] [] | 21
+ help2man | [] [] | 7
+ hylafax | [] | 5
+ idutils | [] [] [] [] | 17
+ indent | [] [] [] [] [] [] | 30
+ iso_15924 | () [] () [] [] | 16
+ iso_3166 | [] [] () [] [] () [] [] [] () | 53
+ iso_3166_2 | () [] () [] | 9
+ iso_4217 | [] () [] [] () [] [] | 26
+ iso_639 | [] [] [] () [] () [] [] [] [] | 38
+ iso_639_3 | [] () | 8
+ jwhois | [] [] [] [] [] | 16
+ kbd | [] [] [] [] [] | 15
+ keytouch | [] [] [] | 16
+ keytouch-editor | [] [] [] | 14
+ keytouch-keyboa... | [] [] [] | 14
+ klavaro | [] | 11
+ latrine | [] [] [] | 10
+ ld | [] [] [] [] | 11
+ leafpad | [] [] [] [] [] [] | 33
+ libc | [] [] [] [] [] | 21
+ libexif | [] () | 7
+ libextractor | [] | 1
+ libgnutls | [] [] [] | 9
+ libgpewidget | [] [] [] | 14
+ libgpg-error | [] [] [] | 9
+ libgphoto2 | [] [] | 8
+ libgphoto2_port | [] [] [] [] | 14
+ libgsasl | [] [] [] | 13
+ libiconv | [] [] [] [] | 21
+ libidn | () [] [] | 11
+ lifelines | [] | 4
+ liferea | [] [] [] | 21
+ lilypond | [] | 7
+ linkdr | [] [] [] [] [] | 17
+ lordsawar | | 1
+ lprng | [] | 3
+ lynx | [] [] [] [] | 17
+ m4 | [] [] [] [] | 19
+ mailfromd | [] [] | 3
+ mailutils | [] | 5
+ make | [] [] [] [] | 21
+ man-db | [] [] [] | 8
+ man-db-manpages | | 4
+ minicom | [] [] | 16
+ mkisofs | [] [] | 9
+ myserver | | 0
+ nano | [] [] [] [] | 21
+ opcodes | [] [] [] | 11
+ parted | [] [] [] [] [] | 15
+ pies | [] [] | 3
+ popt | [] [] [] [] [] [] | 27
+ psmisc | [] [] | 11
+ pspp | | 4
+ pwdutils | [] [] | 6
+ radius | [] [] | 9
+ recode | [] [] [] [] | 28
+ rosegarden | () | 0
+ rpm | [] [] [] | 11
+ rush | [] [] | 4
+ sarg | | 1
+ screem | [] | 3
+ scrollkeeper | [] [] [] [] [] | 27
+ sed | [] [] [] [] [] | 30
+ sharutils | [] [] [] [] [] | 22
+ shishi | [] | 3
+ skencil | [] [] | 7
+ solfege | [] [] [] [] | 16
+ solfege-manual | [] | 8
+ soundtracker | [] [] [] | 9
+ sp | [] | 3
+ sysstat | [] [] | 15
+ tar | [] [] [] [] [] [] | 23
+ texinfo | [] [] [] [] [] | 17
+ tin | | 4
unicode-han-tra... | | 0
unicode-transla... | | 2
- util-linux | [] [] [] | 20
- util-linux-ng | [] [] [] | 20
- vorbis-tools | [] [] | 4
- wastesedge | | 1
- wdiff | [] [] | 23
- wget | [] [] [] | 20
- xchat | [] [] [] [] | 29
- xkeyboard-config | [] [] [] | 14
- xpad | [] [] [] | 15
+ util-linux-ng | [] [] [] [] | 20
+ vice | () () | 1
+ vmm | [] | 4
+ vorbis-tools | [] | 6
+ wastesedge | | 2
+ wdiff | [] [] | 7
+ wget | [] [] [] [] [] | 26
+ wyslij-po | [] [] | 8
+ xchat | [] [] [] [] [] [] | 36
+ xdg-user-dirs | [] [] [] [] [] [] [] [] [] [] | 63
+ xkeyboard-config | [] [] [] | 22
+---------------------------------------------------+
- 76 teams tg th tk tr uk ven vi wa xh zh_CN zh_HK zh_TW zu
- 163 domains 0 3 1 74 51 0 143 21 1 57 7 45 0 2036
+ 85 teams sv sw ta te tg th tr uk vi wa zh_CN zh_HK zh_TW
+ 178 domains 119 1 3 3 0 10 65 51 155 17 98 7 41 2618
Some counters in the preceding matrix are higher than the number of
visible blocks let us expect. This is because a few extra PO files are
@@ -1042,12 +1256,12 @@ distributed as such by its maintainer. There might be an observable
lag between the mere existence a PO file and its wide availability in a
distribution.
- If November 2007 seems to be old, you may fetch a more recent copy
-of this `ABOUT-NLS' file on most GNU archive sites. The most
-up-to-date matrix with full percentage details can be found at
+ If June 2010 seems to be old, you may fetch a more recent copy of
+this `ABOUT-NLS' file on most GNU archive sites. The most up-to-date
+matrix with full percentage details can be found at
`http://translationproject.org/extra/matrix.html'.
-1.6 Using `gettext' in new packages
+1.5 Using `gettext' in new packages
===================================
If you are writing a freely available program and want to
diff --git a/ChangeLog b/ChangeLog
index c87aae94..1f2f2c6c 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,9 @@
+Tue Jul 20 08:18:41 BST 2010 Colin Watson <cjwatson@debian.org>
+
+ Upgrade to Gnulib 20100704.
+
+ * configure.ac (AM_GNU_GETTEXT_VERSION): Upgrade to gettext 0.18.1.
+
Wed May 19 12:38:31 BST 2010 Colin Watson <cjwatson@debian.org>
* src/descriptions.c (parse_descriptions): Free record.
diff --git a/Makefile.in b/Makefile.in
index f3763ebe..20e7c26d 100644
--- a/Makefile.in
+++ b/Makefile.in
@@ -53,6 +53,7 @@ am__aclocal_m4_deps = $(top_srcdir)/m4/man-bdb.m4 \
$(top_srcdir)/gnulib/m4/00gnulib.m4 \
$(top_srcdir)/gnulib/m4/alloca.m4 \
$(top_srcdir)/gnulib/m4/argp.m4 \
+ $(top_srcdir)/gnulib/m4/asm-underscore.m4 \
$(top_srcdir)/gnulib/m4/atexit.m4 \
$(top_srcdir)/gnulib/m4/btowc.m4 \
$(top_srcdir)/gnulib/m4/canonicalize.m4 \
@@ -286,6 +287,7 @@ ALLOCA_H = @ALLOCA_H@
AMTAR = @AMTAR@
AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@
APPLE_UNIVERSAL_BUILD = @APPLE_UNIVERSAL_BUILD@
+ASM_SYMBOL_PREFIX = @ASM_SYMBOL_PREFIX@
AUTOCONF = @AUTOCONF@
AUTOHEADER = @AUTOHEADER@
AUTOMAKE = @AUTOMAKE@
@@ -449,6 +451,7 @@ GNULIB_PUTC = @GNULIB_PUTC@
GNULIB_PUTCHAR = @GNULIB_PUTCHAR@
GNULIB_PUTENV = @GNULIB_PUTENV@
GNULIB_PUTS = @GNULIB_PUTS@
+GNULIB_PWRITE = @GNULIB_PWRITE@
GNULIB_RANDOM_R = @GNULIB_RANDOM_R@
GNULIB_RAWMEMCHR = @GNULIB_RAWMEMCHR@
GNULIB_READLINK = @GNULIB_READLINK@
@@ -616,6 +619,7 @@ HAVE_MKOSTEMPS = @HAVE_MKOSTEMPS@
HAVE_MKSTEMP = @HAVE_MKSTEMP@
HAVE_MKSTEMPS = @HAVE_MKSTEMPS@
HAVE_NANOSLEEP = @HAVE_NANOSLEEP@
+HAVE_NEWLOCALE = @HAVE_NEWLOCALE@
HAVE_NL_LANGINFO = @HAVE_NL_LANGINFO@
HAVE_OPENAT = @HAVE_OPENAT@
HAVE_OS_H = @HAVE_OS_H@
@@ -624,6 +628,7 @@ HAVE_POSIX_PRINTF = @HAVE_POSIX_PRINTF@
HAVE_POSIX_SIGNALBLOCKING = @HAVE_POSIX_SIGNALBLOCKING@
HAVE_PREAD = @HAVE_PREAD@
HAVE_PTSNAME = @HAVE_PTSNAME@
+HAVE_PWRITE = @HAVE_PWRITE@
HAVE_RANDOM_H = @HAVE_RANDOM_H@
HAVE_RANDOM_R = @HAVE_RANDOM_R@
HAVE_RAWMEMCHR = @HAVE_RAWMEMCHR@
@@ -709,6 +714,7 @@ INSTOBJEXT = @INSTOBJEXT@
INTLBISON = @INTLBISON@
INTLLIBS = @INTLLIBS@
INTLOBJS = @INTLOBJS@
+INTL_DEFAULT_VERBOSITY = @INTL_DEFAULT_VERBOSITY@
INTL_LIBTOOL_SUFFIX_PREFIX = @INTL_LIBTOOL_SUFFIX_PREFIX@
INTL_MACOSX_LIBS = @INTL_MACOSX_LIBS@
LDFLAGS = @LDFLAGS@
@@ -806,6 +812,7 @@ PO4A = @PO4A@
POSUB = @POSUB@
PRAGMA_SYSTEM_HEADER = @PRAGMA_SYSTEM_HEADER@
PRI_MACROS_BROKEN = @PRI_MACROS_BROKEN@
+PTHREAD_H_DEFINES_STRUCT_TIMESPEC = @PTHREAD_H_DEFINES_STRUCT_TIMESPEC@
PTRDIFF_T_SUFFIX = @PTRDIFF_T_SUFFIX@
RANLIB = @RANLIB@
REPLACE_BTOWC = @REPLACE_BTOWC@
@@ -870,6 +877,7 @@ REPLACE_POPEN = @REPLACE_POPEN@
REPLACE_PREAD = @REPLACE_PREAD@
REPLACE_PRINTF = @REPLACE_PRINTF@
REPLACE_PUTENV = @REPLACE_PUTENV@
+REPLACE_PWRITE = @REPLACE_PWRITE@
REPLACE_READLINK = @REPLACE_READLINK@
REPLACE_REALPATH = @REPLACE_REALPATH@
REPLACE_REMOVE = @REPLACE_REMOVE@
@@ -889,6 +897,7 @@ REPLACE_STRDUP = @REPLACE_STRDUP@
REPLACE_STRERROR = @REPLACE_STRERROR@
REPLACE_STRNCAT = @REPLACE_STRNCAT@
REPLACE_STRNDUP = @REPLACE_STRNDUP@
+REPLACE_STRNLEN = @REPLACE_STRNLEN@
REPLACE_STRSIGNAL = @REPLACE_STRSIGNAL@
REPLACE_STRSTR = @REPLACE_STRSTR@
REPLACE_STRTOD = @REPLACE_STRTOD@
@@ -896,6 +905,7 @@ REPLACE_STRTOK_R = @REPLACE_STRTOK_R@
REPLACE_SYMLINK = @REPLACE_SYMLINK@
REPLACE_TIMEGM = @REPLACE_TIMEGM@
REPLACE_TMPFILE = @REPLACE_TMPFILE@
+REPLACE_TTYNAME_R = @REPLACE_TTYNAME_R@
REPLACE_UNLINK = @REPLACE_UNLINK@
REPLACE_UNLINKAT = @REPLACE_UNLINKAT@
REPLACE_UNSETENV = @REPLACE_UNSETENV@
diff --git a/aclocal.m4 b/aclocal.m4
index 97fb56ec..f532e913 100644
--- a/aclocal.m4
+++ b/aclocal.m4
@@ -1063,6 +1063,7 @@ m4_include([m4/man-trans-subst.m4])
m4_include([gnulib/m4/00gnulib.m4])
m4_include([gnulib/m4/alloca.m4])
m4_include([gnulib/m4/argp.m4])
+m4_include([gnulib/m4/asm-underscore.m4])
m4_include([gnulib/m4/atexit.m4])
m4_include([gnulib/m4/btowc.m4])
m4_include([gnulib/m4/canonicalize.m4])
diff --git a/config.h.in b/config.h.in
index 1a0263cd..db86f171 100644
--- a/config.h.in
+++ b/config.h.in
@@ -781,13 +781,12 @@
/* Define if you have neqn. */
#undef HAVE_NEQN
+/* Define to 1 if you have the `newlocale' function. */
+#undef HAVE_NEWLOCALE
+
/* Define to 1 if you have the `nl_langinfo' function. */
#undef HAVE_NL_LANGINFO
-/* Define if you have <langinfo.h> and it defines the NL_LOCALE_NAME macro if
- _GNU_SOURCE is defined. */
-#undef HAVE_NL_LOCALE_NAME
-
/* Define if you have nroff. */
#undef HAVE_NROFF
@@ -1074,6 +1073,9 @@
/* Define to 1 if ptsname is declared even after undefining macros. */
#undef HAVE_RAW_DECL_PTSNAME
+/* Define to 1 if pwrite is declared even after undefining macros. */
+#undef HAVE_RAW_DECL_PWRITE
+
/* Define to 1 if random_r is declared even after undefining macros. */
#undef HAVE_RAW_DECL_RANDOM_R
@@ -1500,6 +1502,9 @@
/* Define to 1 if the system has the type `unsigned long long int'. */
#undef HAVE_UNSIGNED_LONG_LONG_INT
+/* Define to 1 if you have the `uselocale' function. */
+#undef HAVE_USELOCALE
+
/* Define to 1 if you have the `vasnprintf' function. */
#undef HAVE_VASNPRINTF
@@ -1771,6 +1776,10 @@
/* Define to 1 if unlink() on a parent directory may succeed */
#undef UNLINK_PARENT_BUG
+/* Define to the prefix of C symbols at the assembler and linker level, either
+ an underscore or empty. */
+#undef USER_LABEL_PREFIX
+
/* Define if the POSIX multithreading library can be used. */
#undef USE_POSIX_THREADS
@@ -1972,13 +1981,14 @@
nothing if this is not supported. Do not define if restrict is
supported directly. */
#undef restrict
-/* Work around a bug in Sun C++: it does not support _Restrict, even
- though the corresponding Sun C compiler does, which causes
- "#define restrict _Restrict" in the previous line. Perhaps some future
- version of Sun C++ will work with _Restrict; if so, it'll probably
- define __RESTRICT, just as Sun C does. */
+/* Work around a bug in Sun C++: it does not support _Restrict or
+ __restrict__, even though the corresponding Sun C compiler ends up with
+ "#define restrict _Restrict" or "#define restrict __restrict__" in the
+ previous line. Perhaps some future version of Sun C++ will work with
+ restrict; if so, hopefully it defines __RESTRICT like Sun C does. */
#if defined __SUNPRO_CC && !defined __RESTRICT
# define _Restrict
+# define __restrict__
#endif
/* Define to `unsigned int' if <sys/types.h> does not define. */
@@ -1987,9 +1997,6 @@
/* Define as a signed type of the same size as size_t. */
#undef ssize_t
-/* Define to rpl_strnlen if the replacement function should be used. */
-#undef strnlen
-
/* Define to `int' if <sys/types.h> doesn't define. */
#undef uid_t
@@ -2030,20 +2037,29 @@
#define __libc_lock_lock_recursive gl_recursive_lock_lock
#define __libc_lock_unlock_recursive gl_recursive_lock_unlock
#define glthread_in_use libintl_thread_in_use
-#define glthread_lock_init libintl_lock_init
-#define glthread_lock_lock libintl_lock_lock
-#define glthread_lock_unlock libintl_lock_unlock
-#define glthread_lock_destroy libintl_lock_destroy
-#define glthread_rwlock_init libintl_rwlock_init
-#define glthread_rwlock_rdlock libintl_rwlock_rdlock
-#define glthread_rwlock_wrlock libintl_rwlock_wrlock
-#define glthread_rwlock_unlock libintl_rwlock_unlock
-#define glthread_rwlock_destroy libintl_rwlock_destroy
-#define glthread_recursive_lock_init libintl_recursive_lock_init
-#define glthread_recursive_lock_lock libintl_recursive_lock_lock
-#define glthread_recursive_lock_unlock libintl_recursive_lock_unlock
-#define glthread_recursive_lock_destroy libintl_recursive_lock_destroy
-#define glthread_once libintl_once
-#define glthread_once_call libintl_once_call
+#define glthread_lock_init_func libintl_lock_init_func
+#define glthread_lock_lock_func libintl_lock_lock_func
+#define glthread_lock_unlock_func libintl_lock_unlock_func
+#define glthread_lock_destroy_func libintl_lock_destroy_func
+#define glthread_rwlock_init_multithreaded libintl_rwlock_init_multithreaded
+#define glthread_rwlock_init_func libintl_rwlock_init_func
+#define glthread_rwlock_rdlock_multithreaded libintl_rwlock_rdlock_multithreaded
+#define glthread_rwlock_rdlock_func libintl_rwlock_rdlock_func
+#define glthread_rwlock_wrlock_multithreaded libintl_rwlock_wrlock_multithreaded
+#define glthread_rwlock_wrlock_func libintl_rwlock_wrlock_func
+#define glthread_rwlock_unlock_multithreaded libintl_rwlock_unlock_multithreaded
+#define glthread_rwlock_unlock_func libintl_rwlock_unlock_func
+#define glthread_rwlock_destroy_multithreaded libintl_rwlock_destroy_multithreaded
+#define glthread_rwlock_destroy_func libintl_rwlock_destroy_func
+#define glthread_recursive_lock_init_multithreaded libintl_recursive_lock_init_multithreaded
+#define glthread_recursive_lock_init_func libintl_recursive_lock_init_func
+#define glthread_recursive_lock_lock_multithreaded libintl_recursive_lock_lock_multithreaded
+#define glthread_recursive_lock_lock_func libintl_recursive_lock_lock_func
+#define glthread_recursive_lock_unlock_multithreaded libintl_recursive_lock_unlock_multithreaded
+#define glthread_recursive_lock_unlock_func libintl_recursive_lock_unlock_func
+#define glthread_recursive_lock_destroy_multithreaded libintl_recursive_lock_destroy_multithreaded
+#define glthread_recursive_lock_destroy_func libintl_recursive_lock_destroy_func
+#define glthread_once_func libintl_once_func
#define glthread_once_singlethreaded libintl_once_singlethreaded
+#define glthread_once_multithreaded libintl_once_multithreaded
diff --git a/configure b/configure
index b59d17e1..14e177df 100755
--- a/configure
+++ b/configure
@@ -651,9 +651,11 @@ WINDRES
WOE32
WOE32DLL
HAVE_WPRINTF
+HAVE_NEWLOCALE
HAVE_SNPRINTF
HAVE_ASPRINTF
HAVE_POSIX_PRINTF
+INTL_DEFAULT_VERBOSITY
INTL_MACOSX_LIBS
INTLBISON
LTLIBICONV
@@ -688,6 +690,7 @@ NEXT_WCHAR_H
HAVE_UNISTD_H
NEXT_AS_FIRST_DIRECTIVE_UNISTD_H
NEXT_UNISTD_H
+PTHREAD_H_DEFINES_STRUCT_TIMESPEC
SYS_TIME_H_DEFINES_STRUCT_TIMESPEC
TIME_H_DEFINES_STRUCT_TIMESPEC
NEXT_AS_FIRST_DIRECTIVE_TIME_H
@@ -749,6 +752,7 @@ NEXT_AS_FIRST_DIRECTIVE_STDLIB_H
NEXT_STDLIB_H
NEXT_AS_FIRST_DIRECTIVE_STDIO_H
NEXT_STDIO_H
+ASM_SYMBOL_PREFIX
STDINT_H
WINT_T_SUFFIX
WCHAR_T_SUFFIX
@@ -795,6 +799,7 @@ APPLE_UNIVERSAL_BUILD
UNDEFINE_STRTOK_R
REPLACE_STRTOK_R
REPLACE_STRSIGNAL
+REPLACE_STRNLEN
REPLACE_STRNDUP
REPLACE_STRNCAT
REPLACE_STRERROR
@@ -1055,10 +1060,12 @@ REPLACE_WRITE
REPLACE_USLEEP
REPLACE_UNLINKAT
REPLACE_UNLINK
+REPLACE_TTYNAME_R
REPLACE_SYMLINK
REPLACE_SLEEP
REPLACE_RMDIR
REPLACE_READLINK
+REPLACE_PWRITE
REPLACE_PREAD
REPLACE_LSEEK
REPLACE_LINKAT
@@ -1086,6 +1093,7 @@ HAVE_SYMLINK
HAVE_SLEEP
HAVE_READLINKAT
HAVE_READLINK
+HAVE_PWRITE
HAVE_PREAD
HAVE_PIPE2
HAVE_LINKAT
@@ -1119,6 +1127,7 @@ GNULIB_SLEEP
GNULIB_RMDIR
GNULIB_READLINKAT
GNULIB_READLINK
+GNULIB_PWRITE
GNULIB_PREAD
GNULIB_PIPE2
GNULIB_LSEEK
@@ -9203,6 +9212,8 @@ fi
+ LIBC_FATAL_STDERR_=1
+ export LIBC_FATAL_STDERR_
# The Ultrix 4.2 mips builtin alloca declared by alloca.h only works
# for constant arguments. Useless!
@@ -9451,16 +9462,16 @@ else
cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h. */
typedef int * int_ptr;
- int foo (int_ptr $ac_kw ip) {
- return ip[0];
+ int foo (int_ptr $ac_kw ip) {
+ return ip[0];
}
int
main ()
{
int s[1];
- int * $ac_kw t = s;
- t[0] = 0;
- return foo(t)
+ int * $ac_kw t = s;
+ t[0] = 0;
+ return foo(t)
;
return 0;
}
@@ -10191,6 +10202,7 @@ $as_echo "#define FUNC_REALPATH_WORKS 1" >>confdefs.h
GNULIB_LSEEK=0;
GNULIB_PIPE2=0;
GNULIB_PREAD=0;
+ GNULIB_PWRITE=0;
GNULIB_READLINK=0;
GNULIB_READLINKAT=0;
GNULIB_RMDIR=0;
@@ -10224,6 +10236,7 @@ $as_echo "#define FUNC_REALPATH_WORKS 1" >>confdefs.h
HAVE_LINKAT=1;
HAVE_PIPE2=1;
HAVE_PREAD=1;
+ HAVE_PWRITE=1;
HAVE_READLINK=1;
HAVE_READLINKAT=1;
HAVE_SLEEP=1;
@@ -10251,10 +10264,12 @@ $as_echo "#define FUNC_REALPATH_WORKS 1" >>confdefs.h
REPLACE_LINKAT=0;
REPLACE_LSEEK=0;
REPLACE_PREAD=0;
+ REPLACE_PWRITE=0;
REPLACE_READLINK=0;
REPLACE_RMDIR=0;
REPLACE_SLEEP=0;
REPLACE_SYMLINK=0;
+ REPLACE_TTYNAME_R=0;
REPLACE_UNLINK=0;
REPLACE_UNLINKAT=0;
REPLACE_USLEEP=0;
@@ -13246,7 +13261,7 @@ fi
done
if test -z "$already_handled"; then
names_already_handled="$names_already_handled $name"
- uppername=`echo "$name" | sed -e 'y|abcdefghijklmnopqrstuvwxyz./-|ABCDEFGHIJKLMNOPQRSTUVWXYZ___|'`
+ uppername=`echo "$name" | sed -e 'y|abcdefghijklmnopqrstuvwxyz./+-|ABCDEFGHIJKLMNOPQRSTUVWXYZ____|'`
eval value=\"\$HAVE_LIB$uppername\"
if test -n "$value"; then
if test "$value" = yes; then
@@ -14384,6 +14399,7 @@ $as_echo "$gt_cv_locale_fr_utf8" >&6; }
REPLACE_STRERROR=0;
REPLACE_STRNCAT=0;
REPLACE_STRNDUP=0;
+ REPLACE_STRNLEN=0;
REPLACE_STRSIGNAL=0;
REPLACE_STRTOK_R=0;
UNDEFINE_STRTOK_R=0;
@@ -15403,6 +15419,48 @@ $as_echo "#define HAVE_UNSIGNED_LONG_LONG_INT 1" >>confdefs.h
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether C symbols are prefixed with underscore at the linker level" >&5
+$as_echo_n "checking whether C symbols are prefixed with underscore at the linker level... " >&6; }
+if test "${gl_cv_prog_as_underscore+set}" = set; then :
+ $as_echo_n "(cached) " >&6
+else
+ cat > conftest.c <<EOF
+#ifdef __cplusplus
+extern "C" int foo (void);
+#endif
+int foo(void) { return 0; }
+EOF
+ # Look for the assembly language name in the .s file.
+ { ac_try='${CC-cc} $CFLAGS $CPPFLAGS -S conftest.c'
+ { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_try\""; } >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+ test $ac_status = 0; }; } >/dev/null 2>&1
+ if grep _foo conftest.s >/dev/null ; then
+ gl_cv_prog_as_underscore=yes
+ else
+ gl_cv_prog_as_underscore=no
+ fi
+ rm -f conftest*
+
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_prog_as_underscore" >&5
+$as_echo "$gl_cv_prog_as_underscore" >&6; }
+ if test $gl_cv_prog_as_underscore = yes; then
+ USER_LABEL_PREFIX=_
+ else
+ USER_LABEL_PREFIX=
+ fi
+
+cat >>confdefs.h <<_ACEOF
+#define USER_LABEL_PREFIX $USER_LABEL_PREFIX
+_ACEOF
+
+ ASM_SYMBOL_PREFIX='"'${USER_LABEL_PREFIX}'"'
+
+
+
@@ -16245,6 +16303,7 @@ $as_echo "$gl_cv_sys_struct_timespec_in_time_h" >&6; }
TIME_H_DEFINES_STRUCT_TIMESPEC=0
SYS_TIME_H_DEFINES_STRUCT_TIMESPEC=0
+ PTHREAD_H_DEFINES_STRUCT_TIMESPEC=0
if test $gl_cv_sys_struct_timespec_in_time_h = yes; then
TIME_H_DEFINES_STRUCT_TIMESPEC=1
else
@@ -16276,6 +16335,36 @@ fi
$as_echo "$gl_cv_sys_struct_timespec_in_sys_time_h" >&6; }
if test $gl_cv_sys_struct_timespec_in_sys_time_h = yes; then
SYS_TIME_H_DEFINES_STRUCT_TIMESPEC=1
+ else
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for struct timespec in <pthread.h>" >&5
+$as_echo_n "checking for struct timespec in <pthread.h>... " >&6; }
+if test "${gl_cv_sys_struct_timespec_in_pthread_h+set}" = set; then :
+ $as_echo_n "(cached) " >&6
+else
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+#include <pthread.h>
+
+int
+main ()
+{
+static struct timespec x; x.tv_sec = x.tv_nsec;
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"; then :
+ gl_cv_sys_struct_timespec_in_pthread_h=yes
+else
+ gl_cv_sys_struct_timespec_in_pthread_h=no
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_sys_struct_timespec_in_pthread_h" >&5
+$as_echo "$gl_cv_sys_struct_timespec_in_pthread_h" >&6; }
+ if test $gl_cv_sys_struct_timespec_in_pthread_h = yes; then
+ PTHREAD_H_DEFINES_STRUCT_TIMESPEC=1
+ fi
fi
fi
@@ -16288,6 +16377,7 @@ $as_echo "$gl_cv_sys_struct_timespec_in_sys_time_h" >&6; }
+
:
@@ -22276,7 +22366,8 @@ fi
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_fchownat_nofollow_works" >&5
$as_echo "$gl_cv_func_fchownat_nofollow_works" >&6; }
if test $gl_cv_func_fchownat_nofollow_works = no; then :
- REPLACE_FCHOWNAT=1
+
+ REPLACE_FCHOWNAT=1
$as_echo "#define FCHOWNAT_NOFOLLOW_BUG 1" >>confdefs.h
@@ -24969,6 +25060,7 @@ _ACEOF
+
:
@@ -25598,6 +25690,7 @@ $as_echo "#define GNULIB_TEST_STRNDUP 1" >>confdefs.h
+
:
@@ -25606,9 +25699,8 @@ $as_echo "#define GNULIB_TEST_STRNDUP 1" >>confdefs.h
if test $ac_cv_have_decl_strnlen = no; then
HAVE_DECL_STRNLEN=0
- fi
-
- { $as_echo "$as_me:${as_lineno-$LINENO}: checking for working strnlen" >&5
+ else
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for working strnlen" >&5
$as_echo_n "checking for working strnlen... " >&6; }
if test "${ac_cv_func_strnlen_working+set}" = set; then :
$as_echo_n "(cached) " >&6
@@ -25665,13 +25757,20 @@ test $ac_cv_func_strnlen_working = no &&
gl_LIBOBJS="$gl_LIBOBJS strnlen.$ac_objext"
- if test $ac_cv_func_strnlen_working = no; then
- # This is necessary because automake-1.6.1 doesn't understand
- # that the above use of AC_FUNC_STRNLEN means we may have to use
- # lib/strnlen.c.
- #AC_LIBOBJ([strnlen])
+ if test $ac_cv_func_strnlen_working = no; then
+ REPLACE_STRNLEN=1
+ fi
+ fi
+ if test $HAVE_DECL_STRNLEN = 0 || test $REPLACE_STRNLEN = 1; then
+
+
+
+
-$as_echo "#define strnlen rpl_strnlen" >>confdefs.h
+
+
+
+ gl_LIBOBJS="$gl_LIBOBJS strnlen.$ac_objext"
:
fi
@@ -26727,7 +26826,7 @@ $as_echo "$gl_cv_next_unistd_h" >&6; }
- for gl_func in chown dup2 dup3 environ euidaccess faccessat fchdir fchownat fsync ftruncate getcwd getdomainname getdtablesize getgroups gethostname getlogin getlogin_r getpagesize getusershell setusershell endusershell lchown link linkat lseek pipe2 pread readlink readlinkat rmdir sleep symlink symlinkat ttyname_r unlink unlinkat usleep; do
+ for gl_func in chown dup2 dup3 environ euidaccess faccessat fchdir fchownat fsync ftruncate getcwd getdomainname getdtablesize getgroups gethostname getlogin getlogin_r getpagesize getusershell setusershell endusershell lchown link linkat lseek pipe2 pread pwrite readlink readlinkat rmdir sleep symlink symlinkat ttyname_r unlink unlinkat usleep; do
as_gl_Symbol=`$as_echo "gl_cv_have_raw_decl_$gl_func" | $as_tr_sh`
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $gl_func is declared without a macro" >&5
$as_echo_n "checking whether $gl_func is declared without a macro... " >&6; }
@@ -28305,7 +28404,7 @@ $as_echo "$USE_NLS" >&6; }
- GETTEXT_MACRO_VERSION=0.17
+ GETTEXT_MACRO_VERSION=0.18
@@ -28628,7 +28727,37 @@ $as_echo "$ac_cv_gnu_library_2" >&6; }
CFLAG_VISIBILITY=
HAVE_VISIBILITY=0
if test -n "$GCC"; then
- { $as_echo "$as_me:${as_lineno-$LINENO}: checking for simple visibility declarations" >&5
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the -Werror option is usable" >&5
+$as_echo_n "checking whether the -Werror option is usable... " >&6; }
+ if test "${gl_cv_cc_vis_werror+set}" = set; then :
+ $as_echo_n "(cached) " >&6
+else
+
+ gl_save_CFLAGS="$CFLAGS"
+ CFLAGS="$CFLAGS -Werror"
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+
+int
+main ()
+{
+
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"; then :
+ gl_cv_cc_vis_werror=yes
+else
+ gl_cv_cc_vis_werror=no
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+ CFLAGS="$gl_save_CFLAGS"
+fi
+
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_cc_vis_werror" >&5
+$as_echo "$gl_cv_cc_vis_werror" >&6; }
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for simple visibility declarations" >&5
$as_echo_n "checking for simple visibility declarations... " >&6; }
if test "${gl_cv_cc_visibility+set}" = set; then :
$as_echo_n "(cached) " >&6
@@ -28636,12 +28765,16 @@ else
gl_save_CFLAGS="$CFLAGS"
CFLAGS="$CFLAGS -fvisibility=hidden"
+ if test $gl_cv_cc_vis_werror = yes; then
+ CFLAGS="$CFLAGS -Werror"
+ fi
cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h. */
extern __attribute__((__visibility__("hidden"))) int hiddenvar;
extern __attribute__((__visibility__("default"))) int exportedvar;
extern __attribute__((__visibility__("hidden"))) int hiddenfunc (void);
extern __attribute__((__visibility__("default"))) int exportedfunc (void);
+ void dummyfunc (void) {}
int
main ()
{
@@ -29111,7 +29244,7 @@ fi
done
if test -z "$already_handled"; then
names_already_handled="$names_already_handled $name"
- uppername=`echo "$name" | sed -e 'y|abcdefghijklmnopqrstuvwxyz./-|ABCDEFGHIJKLMNOPQRSTUVWXYZ___|'`
+ uppername=`echo "$name" | sed -e 'y|abcdefghijklmnopqrstuvwxyz./+-|ABCDEFGHIJKLMNOPQRSTUVWXYZ____|'`
eval value=\"\$HAVE_LIB$uppername\"
if test -n "$value"; then
if test "$value" = yes; then
@@ -29502,141 +29635,6 @@ fi
- cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h. */
-int foo (int a) { a = __builtin_expect (a, 10); return a == 10 ? 0 : 1; }
-int
-main ()
-{
-
- ;
- return 0;
-}
-_ACEOF
-if ac_fn_c_try_link "$LINENO"; then :
-
-$as_echo "#define HAVE_BUILTIN_EXPECT 1" >>confdefs.h
-
-fi
-rm -f core conftest.err conftest.$ac_objext \
- conftest$ac_exeext conftest.$ac_ext
-
- for ac_header in argz.h inttypes.h limits.h unistd.h sys/param.h
-do :
- as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh`
-ac_fn_c_check_header_mongrel "$LINENO" "$ac_header" "$as_ac_Header" "$ac_includes_default"
-eval as_val=\$$as_ac_Header
- if test "x$as_val" = x""yes; then :
- cat >>confdefs.h <<_ACEOF
-#define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1
-_ACEOF
-
-fi
-
-done
-
- for ac_func in getcwd getegid geteuid getgid getuid mempcpy munmap \
- stpcpy strcasecmp strdup strtoul tsearch argz_count argz_stringify \
- argz_next __fsetlocking
-do :
- as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh`
-ac_fn_c_check_func "$LINENO" "$ac_func" "$as_ac_var"
-eval as_val=\$$as_ac_var
- if test "x$as_val" = x""yes; then :
- cat >>confdefs.h <<_ACEOF
-#define `$as_echo "HAVE_$ac_func" | $as_tr_cpp` 1
-_ACEOF
-
-fi
-done
-
-
-
- { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether feof_unlocked is declared" >&5
-$as_echo_n "checking whether feof_unlocked is declared... " >&6; }
-if test "${ac_cv_have_decl_feof_unlocked+set}" = set; then :
- $as_echo_n "(cached) " >&6
-else
- cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h. */
-#include <stdio.h>
-int
-main ()
-{
-
-#ifndef feof_unlocked
- char *p = (char *) feof_unlocked;
-#endif
-
- ;
- return 0;
-}
-_ACEOF
-if ac_fn_c_try_compile "$LINENO"; then :
- ac_cv_have_decl_feof_unlocked=yes
-else
- ac_cv_have_decl_feof_unlocked=no
-fi
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
-fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_have_decl_feof_unlocked" >&5
-$as_echo "$ac_cv_have_decl_feof_unlocked" >&6; }
- if test $ac_cv_have_decl_feof_unlocked = yes; then
- gt_value=1
- else
- gt_value=0
- fi
-
-cat >>confdefs.h <<_ACEOF
-#define HAVE_DECL_FEOF_UNLOCKED $gt_value
-_ACEOF
-
-
-
- { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether fgets_unlocked is declared" >&5
-$as_echo_n "checking whether fgets_unlocked is declared... " >&6; }
-if test "${ac_cv_have_decl_fgets_unlocked+set}" = set; then :
- $as_echo_n "(cached) " >&6
-else
- cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h. */
-#include <stdio.h>
-int
-main ()
-{
-
-#ifndef fgets_unlocked
- char *p = (char *) fgets_unlocked;
-#endif
-
- ;
- return 0;
-}
-_ACEOF
-if ac_fn_c_try_compile "$LINENO"; then :
- ac_cv_have_decl_fgets_unlocked=yes
-else
- ac_cv_have_decl_fgets_unlocked=no
-fi
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
-fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_have_decl_fgets_unlocked" >&5
-$as_echo "$ac_cv_have_decl_fgets_unlocked" >&6; }
- if test $ac_cv_have_decl_fgets_unlocked = yes; then
- gt_value=1
- else
- gt_value=0
- fi
-
-cat >>confdefs.h <<_ACEOF
-#define HAVE_DECL_FGETS_UNLOCKED $gt_value
-_ACEOF
-
-
-
-
-
-
am_save_CPPFLAGS="$CPPFLAGS"
@@ -29907,42 +29905,142 @@ _ACEOF
fi
- { $as_echo "$as_me:${as_lineno-$LINENO}: checking for NL_LOCALE_NAME macro" >&5
-$as_echo_n "checking for NL_LOCALE_NAME macro... " >&6; }
-if test "${gt_cv_nl_locale_name+set}" = set; then :
- $as_echo_n "(cached) " >&6
-else
+
+
cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h. */
-#include <langinfo.h>
-#include <locale.h>
+int foo (int a) { a = __builtin_expect (a, 10); return a == 10 ? 0 : 1; }
int
main ()
{
-char* cs = nl_langinfo(_NL_LOCALE_NAME(LC_MESSAGES));
- return !cs;
;
return 0;
}
_ACEOF
if ac_fn_c_try_link "$LINENO"; then :
- gt_cv_nl_locale_name=yes
-else
- gt_cv_nl_locale_name=no
+
+$as_echo "#define HAVE_BUILTIN_EXPECT 1" >>confdefs.h
+
fi
rm -f core conftest.err conftest.$ac_objext \
conftest$ac_exeext conftest.$ac_ext
+ for ac_header in argz.h inttypes.h limits.h unistd.h sys/param.h
+do :
+ as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh`
+ac_fn_c_check_header_mongrel "$LINENO" "$ac_header" "$as_ac_Header" "$ac_includes_default"
+eval as_val=\$$as_ac_Header
+ if test "x$as_val" = x""yes; then :
+ cat >>confdefs.h <<_ACEOF
+#define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1
+_ACEOF
+
+fi
+
+done
+
+ for ac_func in getcwd getegid geteuid getgid getuid mempcpy munmap \
+ stpcpy strcasecmp strdup strtoul tsearch uselocale argz_count \
+ argz_stringify argz_next __fsetlocking
+do :
+ as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh`
+ac_fn_c_check_func "$LINENO" "$ac_func" "$as_ac_var"
+eval as_val=\$$as_ac_var
+ if test "x$as_val" = x""yes; then :
+ cat >>confdefs.h <<_ACEOF
+#define `$as_echo "HAVE_$ac_func" | $as_tr_cpp` 1
+_ACEOF
+
fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gt_cv_nl_locale_name" >&5
-$as_echo "$gt_cv_nl_locale_name" >&6; }
- if test $gt_cv_nl_locale_name = yes; then
+done
+
-$as_echo "#define HAVE_NL_LOCALE_NAME 1" >>confdefs.h
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether feof_unlocked is declared" >&5
+$as_echo_n "checking whether feof_unlocked is declared... " >&6; }
+if test "${ac_cv_have_decl_feof_unlocked+set}" = set; then :
+ $as_echo_n "(cached) " >&6
+else
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+#include <stdio.h>
+int
+main ()
+{
+
+#ifndef feof_unlocked
+ char *p = (char *) feof_unlocked;
+#endif
+
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"; then :
+ ac_cv_have_decl_feof_unlocked=yes
+else
+ ac_cv_have_decl_feof_unlocked=no
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_have_decl_feof_unlocked" >&5
+$as_echo "$ac_cv_have_decl_feof_unlocked" >&6; }
+ if test $ac_cv_have_decl_feof_unlocked = yes; then
+ gt_value=1
+ else
+ gt_value=0
fi
+cat >>confdefs.h <<_ACEOF
+#define HAVE_DECL_FEOF_UNLOCKED $gt_value
+_ACEOF
+
+
+
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether fgets_unlocked is declared" >&5
+$as_echo_n "checking whether fgets_unlocked is declared... " >&6; }
+if test "${ac_cv_have_decl_fgets_unlocked+set}" = set; then :
+ $as_echo_n "(cached) " >&6
+else
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+#include <stdio.h>
+int
+main ()
+{
+
+#ifndef fgets_unlocked
+ char *p = (char *) fgets_unlocked;
+#endif
+
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"; then :
+ ac_cv_have_decl_fgets_unlocked=yes
+else
+ ac_cv_have_decl_fgets_unlocked=no
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_have_decl_fgets_unlocked" >&5
+$as_echo "$ac_cv_have_decl_fgets_unlocked" >&6; }
+ if test $ac_cv_have_decl_fgets_unlocked = yes; then
+ gt_value=1
+ else
+ gt_value=0
+ fi
+
+cat >>confdefs.h <<_ACEOF
+#define HAVE_DECL_FGETS_UNLOCKED $gt_value
+_ACEOF
+
+
+
+
+
for ac_prog in bison
do
# Extract the first word of "$ac_prog", so it can be a program name with args.
@@ -30192,6 +30290,13 @@ $as_echo "#define HAVE_CFLOCALECOPYCURRENT 1" >>confdefs.h
+ case "$enable_silent_rules" in
+ yes) INTL_DEFAULT_VERBOSITY=0;;
+ no) INTL_DEFAULT_VERBOSITY=1;;
+ *) INTL_DEFAULT_VERBOSITY=1;;
+ esac
+
+
ac_fn_c_check_type "$LINENO" "ptrdiff_t" "ac_cv_type_ptrdiff_t" "$ac_includes_default"
if test "x$ac_cv_type_ptrdiff_t" = x""yes; then :
@@ -30216,7 +30321,8 @@ fi
done
- for ac_func in asprintf fwprintf putenv setenv setlocale snprintf wcslen
+ for ac_func in asprintf fwprintf newlocale putenv setenv setlocale \
+ snprintf strnlen wcslen wcsnlen mbrtowc wcrtomb
do :
as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh`
ac_fn_c_check_func "$LINENO" "$ac_func" "$as_ac_var"
@@ -30372,6 +30478,12 @@ _ACEOF
HAVE_SNPRINTF=0
fi
+ if test "$ac_cv_func_newlocale" = yes; then
+ HAVE_NEWLOCALE=1
+ else
+ HAVE_NEWLOCALE=0
+ fi
+
if test "$ac_cv_func_wprintf" = yes; then
HAVE_WPRINTF=1
else
@@ -30589,6 +30701,7 @@ fi
+
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for CFPreferencesCopyAppValue" >&5
$as_echo_n "checking for CFPreferencesCopyAppValue... " >&6; }
if test "${gt_cv_func_CFPreferencesCopyAppValue+set}" = set; then :
@@ -30826,7 +30939,7 @@ fi
done
if test -z "$already_handled"; then
names_already_handled="$names_already_handled $name"
- uppername=`echo "$name" | sed -e 'y|abcdefghijklmnopqrstuvwxyz./-|ABCDEFGHIJKLMNOPQRSTUVWXYZ___|'`
+ uppername=`echo "$name" | sed -e 'y|abcdefghijklmnopqrstuvwxyz./+-|ABCDEFGHIJKLMNOPQRSTUVWXYZ____|'`
eval value=\"\$HAVE_LIB$uppername\"
if test -n "$value"; then
if test "$value" = yes; then
@@ -31441,277 +31554,6 @@ $as_echo "#define HAVE_DCGETTEXT 1" >>confdefs.h
-
-
-
-
- am_save_CPPFLAGS="$CPPFLAGS"
-
- for element in $INCICONV; do
- haveit=
- for x in $CPPFLAGS; do
-
- acl_save_prefix="$prefix"
- prefix="$acl_final_prefix"
- acl_save_exec_prefix="$exec_prefix"
- exec_prefix="$acl_final_exec_prefix"
- eval x=\"$x\"
- exec_prefix="$acl_save_exec_prefix"
- prefix="$acl_save_prefix"
-
- if test "X$x" = "X$element"; then
- haveit=yes
- break
- fi
- done
- if test -z "$haveit"; then
- CPPFLAGS="${CPPFLAGS}${CPPFLAGS:+ }$element"
- fi
- done
-
-
- { $as_echo "$as_me:${as_lineno-$LINENO}: checking for iconv" >&5
-$as_echo_n "checking for iconv... " >&6; }
-if test "${am_cv_func_iconv+set}" = set; then :
- $as_echo_n "(cached) " >&6
-else
-
- am_cv_func_iconv="no, consider installing GNU libiconv"
- am_cv_lib_iconv=no
- cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h. */
-#include <stdlib.h>
-#include <iconv.h>
-int
-main ()
-{
-iconv_t cd = iconv_open("","");
- iconv(cd,NULL,NULL,NULL,NULL);
- iconv_close(cd);
- ;
- return 0;
-}
-_ACEOF
-if ac_fn_c_try_link "$LINENO"; then :
- am_cv_func_iconv=yes
-fi
-rm -f core conftest.err conftest.$ac_objext \
- conftest$ac_exeext conftest.$ac_ext
- if test "$am_cv_func_iconv" != yes; then
- am_save_LIBS="$LIBS"
- LIBS="$LIBS $LIBICONV"
- cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h. */
-#include <stdlib.h>
-#include <iconv.h>
-int
-main ()
-{
-iconv_t cd = iconv_open("","");
- iconv(cd,NULL,NULL,NULL,NULL);
- iconv_close(cd);
- ;
- return 0;
-}
-_ACEOF
-if ac_fn_c_try_link "$LINENO"; then :
- am_cv_lib_iconv=yes
- am_cv_func_iconv=yes
-fi
-rm -f core conftest.err conftest.$ac_objext \
- conftest$ac_exeext conftest.$ac_ext
- LIBS="$am_save_LIBS"
- fi
-
-fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $am_cv_func_iconv" >&5
-$as_echo "$am_cv_func_iconv" >&6; }
- if test "$am_cv_func_iconv" = yes; then
- { $as_echo "$as_me:${as_lineno-$LINENO}: checking for working iconv" >&5
-$as_echo_n "checking for working iconv... " >&6; }
-if test "${am_cv_func_iconv_works+set}" = set; then :
- $as_echo_n "(cached) " >&6
-else
-
- am_save_LIBS="$LIBS"
- if test $am_cv_lib_iconv = yes; then
- LIBS="$LIBS $LIBICONV"
- fi
- if test "$cross_compiling" = yes; then :
- case "$host_os" in
- aix* | hpux*) am_cv_func_iconv_works="guessing no" ;;
- *) am_cv_func_iconv_works="guessing yes" ;;
- esac
-else
- cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h. */
-
-#include <iconv.h>
-#include <string.h>
-int main ()
-{
- /* Test against AIX 5.1 bug: Failures are not distinguishable from successful
- returns. */
- {
- iconv_t cd_utf8_to_88591 = iconv_open ("ISO8859-1", "UTF-8");
- if (cd_utf8_to_88591 != (iconv_t)(-1))
- {
- static const char input[] = "\342\202\254"; /* EURO SIGN */
- char buf[10];
- const char *inptr = input;
- size_t inbytesleft = strlen (input);
- char *outptr = buf;
- size_t outbytesleft = sizeof (buf);
- size_t res = iconv (cd_utf8_to_88591,
- (char **) &inptr, &inbytesleft,
- &outptr, &outbytesleft);
- if (res == 0)
- return 1;
- }
- }
- /* Test against Solaris 10 bug: Failures are not distinguishable from
- successful returns. */
- {
- iconv_t cd_ascii_to_88591 = iconv_open ("ISO8859-1", "646");
- if (cd_ascii_to_88591 != (iconv_t)(-1))
- {
- static const char input[] = "\263";
- char buf[10];
- const char *inptr = input;
- size_t inbytesleft = strlen (input);
- char *outptr = buf;
- size_t outbytesleft = sizeof (buf);
- size_t res = iconv (cd_ascii_to_88591,
- (char **) &inptr, &inbytesleft,
- &outptr, &outbytesleft);
- if (res == 0)
- return 1;
- }
- }
-#if 0 /* This bug could be worked around by the caller. */
- /* Test against HP-UX 11.11 bug: Positive return value instead of 0. */
- {
- iconv_t cd_88591_to_utf8 = iconv_open ("utf8", "iso88591");
- if (cd_88591_to_utf8 != (iconv_t)(-1))
- {
- static const char input[] = "\304rger mit b\366sen B\374bchen ohne Augenma\337";
- char buf[50];
- const char *inptr = input;
- size_t inbytesleft = strlen (input);
- char *outptr = buf;
- size_t outbytesleft = sizeof (buf);
- size_t res = iconv (cd_88591_to_utf8,
- (char **) &inptr, &inbytesleft,
- &outptr, &outbytesleft);
- if ((int)res > 0)
- return 1;
- }
- }
-#endif
- /* Test against HP-UX 11.11 bug: No converter from EUC-JP to UTF-8 is
- provided. */
- if (/* Try standardized names. */
- iconv_open ("UTF-8", "EUC-JP") == (iconv_t)(-1)
- /* Try IRIX, OSF/1 names. */
- && iconv_open ("UTF-8", "eucJP") == (iconv_t)(-1)
- /* Try AIX names. */
- && iconv_open ("UTF-8", "IBM-eucJP") == (iconv_t)(-1)
- /* Try HP-UX names. */
- && iconv_open ("utf8", "eucJP") == (iconv_t)(-1))
- return 1;
- return 0;
-}
-_ACEOF
-if ac_fn_c_try_run "$LINENO"; then :
- am_cv_func_iconv_works=yes
-else
- am_cv_func_iconv_works=no
-fi
-rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
- conftest.$ac_objext conftest.beam conftest.$ac_ext
-fi
-
- LIBS="$am_save_LIBS"
-
-fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $am_cv_func_iconv_works" >&5
-$as_echo "$am_cv_func_iconv_works" >&6; }
- case "$am_cv_func_iconv_works" in
- *no) am_func_iconv=no am_cv_lib_iconv=no ;;
- *) am_func_iconv=yes ;;
- esac
- else
- am_func_iconv=no am_cv_lib_iconv=no
- fi
- if test "$am_func_iconv" = yes; then
-
-$as_echo "#define HAVE_ICONV 1" >>confdefs.h
-
- fi
- if test "$am_cv_lib_iconv" = yes; then
- { $as_echo "$as_me:${as_lineno-$LINENO}: checking how to link with libiconv" >&5
-$as_echo_n "checking how to link with libiconv... " >&6; }
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: $LIBICONV" >&5
-$as_echo "$LIBICONV" >&6; }
- else
- CPPFLAGS="$am_save_CPPFLAGS"
- LIBICONV=
- LTLIBICONV=
- fi
-
-
-
- if test "$am_cv_func_iconv" = yes; then
- { $as_echo "$as_me:${as_lineno-$LINENO}: checking for iconv declaration" >&5
-$as_echo_n "checking for iconv declaration... " >&6; }
- if test "${am_cv_proto_iconv+set}" = set; then :
- $as_echo_n "(cached) " >&6
-else
-
- cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h. */
-
-#include <stdlib.h>
-#include <iconv.h>
-extern
-#ifdef __cplusplus
-"C"
-#endif
-#if defined(__STDC__) || defined(__cplusplus)
-size_t iconv (iconv_t cd, char * *inbuf, size_t *inbytesleft, char * *outbuf, size_t *outbytesleft);
-#else
-size_t iconv();
-#endif
-
-int
-main ()
-{
-
- ;
- return 0;
-}
-_ACEOF
-if ac_fn_c_try_compile "$LINENO"; then :
- am_cv_proto_iconv_arg1=""
-else
- am_cv_proto_iconv_arg1="const"
-fi
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
- am_cv_proto_iconv="extern size_t iconv (iconv_t cd, $am_cv_proto_iconv_arg1 char * *inbuf, size_t *inbytesleft, char * *outbuf, size_t *outbytesleft);"
-fi
-
- am_cv_proto_iconv=`echo "$am_cv_proto_iconv" | tr -s ' ' | sed -e 's/( /(/'`
- { $as_echo "$as_me:${as_lineno-$LINENO}: result:
- $am_cv_proto_iconv" >&5
-$as_echo "
- $am_cv_proto_iconv" >&6; }
-
-cat >>confdefs.h <<_ACEOF
-#define ICONV_CONST $am_cv_proto_iconv_arg1
-_ACEOF
-
- fi
-
for ac_prog in po4a
do
# Extract the first word of "$ac_prog", so it can be a program name with args.
diff --git a/configure.ac b/configure.ac
index d5e65c03..ab220611 100644
--- a/configure.ac
+++ b/configure.ac
@@ -382,7 +382,7 @@ AC_CHECK_HEADERS(fcntl.h sys/file.h)
# Internationalization support.
AM_GNU_GETTEXT
-AM_GNU_GETTEXT_VERSION([0.17])
+AM_GNU_GETTEXT_VERSION([0.18.1])
AC_SUBST(LINGUAS)
AM_ICONV
MAN_PO4A
diff --git a/docs/Makefile.in b/docs/Makefile.in
index e1a7c26c..929f3665 100644
--- a/docs/Makefile.in
+++ b/docs/Makefile.in
@@ -49,6 +49,7 @@ am__aclocal_m4_deps = $(top_srcdir)/m4/man-bdb.m4 \
$(top_srcdir)/gnulib/m4/00gnulib.m4 \
$(top_srcdir)/gnulib/m4/alloca.m4 \
$(top_srcdir)/gnulib/m4/argp.m4 \
+ $(top_srcdir)/gnulib/m4/asm-underscore.m4 \
$(top_srcdir)/gnulib/m4/atexit.m4 \
$(top_srcdir)/gnulib/m4/btowc.m4 \
$(top_srcdir)/gnulib/m4/canonicalize.m4 \
@@ -229,6 +230,7 @@ ALLOCA_H = @ALLOCA_H@
AMTAR = @AMTAR@
AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@
APPLE_UNIVERSAL_BUILD = @APPLE_UNIVERSAL_BUILD@
+ASM_SYMBOL_PREFIX = @ASM_SYMBOL_PREFIX@
AUTOCONF = @AUTOCONF@
AUTOHEADER = @AUTOHEADER@
AUTOMAKE = @AUTOMAKE@
@@ -392,6 +394,7 @@ GNULIB_PUTC = @GNULIB_PUTC@
GNULIB_PUTCHAR = @GNULIB_PUTCHAR@
GNULIB_PUTENV = @GNULIB_PUTENV@
GNULIB_PUTS = @GNULIB_PUTS@
+GNULIB_PWRITE = @GNULIB_PWRITE@
GNULIB_RANDOM_R = @GNULIB_RANDOM_R@
GNULIB_RAWMEMCHR = @GNULIB_RAWMEMCHR@
GNULIB_READLINK = @GNULIB_READLINK@
@@ -559,6 +562,7 @@ HAVE_MKOSTEMPS = @HAVE_MKOSTEMPS@
HAVE_MKSTEMP = @HAVE_MKSTEMP@
HAVE_MKSTEMPS = @HAVE_MKSTEMPS@
HAVE_NANOSLEEP = @HAVE_NANOSLEEP@
+HAVE_NEWLOCALE = @HAVE_NEWLOCALE@
HAVE_NL_LANGINFO = @HAVE_NL_LANGINFO@
HAVE_OPENAT = @HAVE_OPENAT@
HAVE_OS_H = @HAVE_OS_H@
@@ -567,6 +571,7 @@ HAVE_POSIX_PRINTF = @HAVE_POSIX_PRINTF@
HAVE_POSIX_SIGNALBLOCKING = @HAVE_POSIX_SIGNALBLOCKING@
HAVE_PREAD = @HAVE_PREAD@
HAVE_PTSNAME = @HAVE_PTSNAME@
+HAVE_PWRITE = @HAVE_PWRITE@
HAVE_RANDOM_H = @HAVE_RANDOM_H@
HAVE_RANDOM_R = @HAVE_RANDOM_R@
HAVE_RAWMEMCHR = @HAVE_RAWMEMCHR@
@@ -652,6 +657,7 @@ INSTOBJEXT = @INSTOBJEXT@
INTLBISON = @INTLBISON@
INTLLIBS = @INTLLIBS@
INTLOBJS = @INTLOBJS@
+INTL_DEFAULT_VERBOSITY = @INTL_DEFAULT_VERBOSITY@
INTL_LIBTOOL_SUFFIX_PREFIX = @INTL_LIBTOOL_SUFFIX_PREFIX@
INTL_MACOSX_LIBS = @INTL_MACOSX_LIBS@
LDFLAGS = @LDFLAGS@
@@ -749,6 +755,7 @@ PO4A = @PO4A@
POSUB = @POSUB@
PRAGMA_SYSTEM_HEADER = @PRAGMA_SYSTEM_HEADER@
PRI_MACROS_BROKEN = @PRI_MACROS_BROKEN@
+PTHREAD_H_DEFINES_STRUCT_TIMESPEC = @PTHREAD_H_DEFINES_STRUCT_TIMESPEC@
PTRDIFF_T_SUFFIX = @PTRDIFF_T_SUFFIX@
RANLIB = @RANLIB@
REPLACE_BTOWC = @REPLACE_BTOWC@
@@ -813,6 +820,7 @@ REPLACE_POPEN = @REPLACE_POPEN@
REPLACE_PREAD = @REPLACE_PREAD@
REPLACE_PRINTF = @REPLACE_PRINTF@
REPLACE_PUTENV = @REPLACE_PUTENV@
+REPLACE_PWRITE = @REPLACE_PWRITE@
REPLACE_READLINK = @REPLACE_READLINK@
REPLACE_REALPATH = @REPLACE_REALPATH@
REPLACE_REMOVE = @REPLACE_REMOVE@
@@ -832,6 +840,7 @@ REPLACE_STRDUP = @REPLACE_STRDUP@
REPLACE_STRERROR = @REPLACE_STRERROR@
REPLACE_STRNCAT = @REPLACE_STRNCAT@
REPLACE_STRNDUP = @REPLACE_STRNDUP@
+REPLACE_STRNLEN = @REPLACE_STRNLEN@
REPLACE_STRSIGNAL = @REPLACE_STRSIGNAL@
REPLACE_STRSTR = @REPLACE_STRSTR@
REPLACE_STRTOD = @REPLACE_STRTOD@
@@ -839,6 +848,7 @@ REPLACE_STRTOK_R = @REPLACE_STRTOK_R@
REPLACE_SYMLINK = @REPLACE_SYMLINK@
REPLACE_TIMEGM = @REPLACE_TIMEGM@
REPLACE_TMPFILE = @REPLACE_TMPFILE@
+REPLACE_TTYNAME_R = @REPLACE_TTYNAME_R@
REPLACE_UNLINK = @REPLACE_UNLINK@
REPLACE_UNLINKAT = @REPLACE_UNLINKAT@
REPLACE_UNSETENV = @REPLACE_UNSETENV@
diff --git a/gnulib/lib/Makefile.am b/gnulib/lib/Makefile.am
index dda226ff..b96792c4 100644
--- a/gnulib/lib/Makefile.am
+++ b/gnulib/lib/Makefile.am
@@ -1325,6 +1325,7 @@ stdio.h: stdio.in.h $(CXXDEFS_H) $(ARG_NONNULL_H) $(WARN_ON_USE_H)
-e 's|@''REPLACE_VPRINTF''@|$(REPLACE_VPRINTF)|g' \
-e 's|@''REPLACE_VSNPRINTF''@|$(REPLACE_VSNPRINTF)|g' \
-e 's|@''REPLACE_VSPRINTF''@|$(REPLACE_VSPRINTF)|g' \
+ -e 's|@''ASM_SYMBOL_PREFIX''@|$(ASM_SYMBOL_PREFIX)|g' \
-e '/definitions of _GL_FUNCDECL_RPL/r $(CXXDEFS_H)' \
-e '/definition of _GL_ARG_NONNULL/r $(ARG_NONNULL_H)' \
-e '/definition of _GL_WARN_ON_USE/r $(WARN_ON_USE_H)'; \
@@ -1545,6 +1546,7 @@ string.h: string.in.h $(CXXDEFS_H) $(ARG_NONNULL_H) $(WARN_ON_USE_H)
-e 's|@''REPLACE_STRERROR''@|$(REPLACE_STRERROR)|g' \
-e 's|@''REPLACE_STRNCAT''@|$(REPLACE_STRNCAT)|g' \
-e 's|@''REPLACE_STRNDUP''@|$(REPLACE_STRNDUP)|g' \
+ -e 's|@''REPLACE_STRNLEN''@|$(REPLACE_STRNLEN)|g' \
-e 's|@''REPLACE_STRSIGNAL''@|$(REPLACE_STRSIGNAL)|g' \
-e 's|@''REPLACE_STRTOK_R''@|$(REPLACE_STRTOK_R)|g' \
-e 's|@''UNDEFINE_STRTOK_R''@|$(UNDEFINE_STRTOK_R)|g' \
@@ -1856,6 +1858,7 @@ time.h: time.in.h $(CXXDEFS_H) $(ARG_NONNULL_H) $(WARN_ON_USE_H)
-e 's|@''REPLACE_MKTIME''@|$(REPLACE_MKTIME)|g' \
-e 's|@''REPLACE_NANOSLEEP''@|$(REPLACE_NANOSLEEP)|g' \
-e 's|@''REPLACE_TIMEGM''@|$(REPLACE_TIMEGM)|g' \
+ -e 's|@''PTHREAD_H_DEFINES_STRUCT_TIMESPEC''@|$(PTHREAD_H_DEFINES_STRUCT_TIMESPEC)|g' \
-e 's|@''SYS_TIME_H_DEFINES_STRUCT_TIMESPEC''@|$(SYS_TIME_H_DEFINES_STRUCT_TIMESPEC)|g' \
-e 's|@''TIME_H_DEFINES_STRUCT_TIMESPEC''@|$(TIME_H_DEFINES_STRUCT_TIMESPEC)|g' \
-e '/definitions of _GL_FUNCDECL_RPL/r $(CXXDEFS_H)' \
@@ -1915,6 +1918,7 @@ unistd.h: unistd.in.h $(CXXDEFS_H) $(ARG_NONNULL_H) $(WARN_ON_USE_H)
-e 's|@''GNULIB_LSEEK''@|$(GNULIB_LSEEK)|g' \
-e 's|@''GNULIB_PIPE2''@|$(GNULIB_PIPE2)|g' \
-e 's|@''GNULIB_PREAD''@|$(GNULIB_PREAD)|g' \
+ -e 's|@''GNULIB_PWRITE''@|$(GNULIB_PWRITE)|g' \
-e 's|@''GNULIB_READLINK''@|$(GNULIB_READLINK)|g' \
-e 's|@''GNULIB_READLINKAT''@|$(GNULIB_READLINKAT)|g' \
-e 's|@''GNULIB_RMDIR''@|$(GNULIB_RMDIR)|g' \
@@ -1949,6 +1953,7 @@ unistd.h: unistd.in.h $(CXXDEFS_H) $(ARG_NONNULL_H) $(WARN_ON_USE_H)
-e 's|@''HAVE_LINKAT''@|$(HAVE_LINKAT)|g' \
-e 's|@''HAVE_PIPE2''@|$(HAVE_PIPE2)|g' \
-e 's|@''HAVE_PREAD''@|$(HAVE_PREAD)|g' \
+ -e 's|@''HAVE_PWRITE''@|$(HAVE_PWRITE)|g' \
-e 's|@''HAVE_READLINK''@|$(HAVE_READLINK)|g' \
-e 's|@''HAVE_READLINKAT''@|$(HAVE_READLINKAT)|g' \
-e 's|@''HAVE_SLEEP''@|$(HAVE_SLEEP)|g' \
@@ -1976,10 +1981,12 @@ unistd.h: unistd.in.h $(CXXDEFS_H) $(ARG_NONNULL_H) $(WARN_ON_USE_H)
-e 's|@''REPLACE_LINKAT''@|$(REPLACE_LINKAT)|g' \
-e 's|@''REPLACE_LSEEK''@|$(REPLACE_LSEEK)|g' \
-e 's|@''REPLACE_PREAD''@|$(REPLACE_PREAD)|g' \
+ -e 's|@''REPLACE_PWRITE''@|$(REPLACE_PWRITE)|g' \
-e 's|@''REPLACE_READLINK''@|$(REPLACE_READLINK)|g' \
-e 's|@''REPLACE_RMDIR''@|$(REPLACE_RMDIR)|g' \
-e 's|@''REPLACE_SLEEP''@|$(REPLACE_SLEEP)|g' \
-e 's|@''REPLACE_SYMLINK''@|$(REPLACE_SYMLINK)|g' \
+ -e 's|@''REPLACE_TTYNAME_R''@|$(REPLACE_TTYNAME_R)|g' \
-e 's|@''REPLACE_UNLINK''@|$(REPLACE_UNLINK)|g' \
-e 's|@''REPLACE_UNLINKAT''@|$(REPLACE_UNLINKAT)|g' \
-e 's|@''REPLACE_USLEEP''@|$(REPLACE_USLEEP)|g' \
diff --git a/gnulib/lib/Makefile.in b/gnulib/lib/Makefile.in
index 55ce141c..01fd1fdf 100644
--- a/gnulib/lib/Makefile.in
+++ b/gnulib/lib/Makefile.in
@@ -62,6 +62,7 @@ am__aclocal_m4_deps = $(top_srcdir)/m4/man-bdb.m4 \
$(top_srcdir)/gnulib/m4/00gnulib.m4 \
$(top_srcdir)/gnulib/m4/alloca.m4 \
$(top_srcdir)/gnulib/m4/argp.m4 \
+ $(top_srcdir)/gnulib/m4/asm-underscore.m4 \
$(top_srcdir)/gnulib/m4/atexit.m4 \
$(top_srcdir)/gnulib/m4/btowc.m4 \
$(top_srcdir)/gnulib/m4/canonicalize.m4 \
@@ -318,6 +319,7 @@ ALLOCA_H = @ALLOCA_H@
AMTAR = @AMTAR@
AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@
APPLE_UNIVERSAL_BUILD = @APPLE_UNIVERSAL_BUILD@
+ASM_SYMBOL_PREFIX = @ASM_SYMBOL_PREFIX@
AUTOCONF = @AUTOCONF@
AUTOHEADER = @AUTOHEADER@
AUTOMAKE = @AUTOMAKE@
@@ -481,6 +483,7 @@ GNULIB_PUTC = @GNULIB_PUTC@
GNULIB_PUTCHAR = @GNULIB_PUTCHAR@
GNULIB_PUTENV = @GNULIB_PUTENV@
GNULIB_PUTS = @GNULIB_PUTS@
+GNULIB_PWRITE = @GNULIB_PWRITE@
GNULIB_RANDOM_R = @GNULIB_RANDOM_R@
GNULIB_RAWMEMCHR = @GNULIB_RAWMEMCHR@
GNULIB_READLINK = @GNULIB_READLINK@
@@ -648,6 +651,7 @@ HAVE_MKOSTEMPS = @HAVE_MKOSTEMPS@
HAVE_MKSTEMP = @HAVE_MKSTEMP@
HAVE_MKSTEMPS = @HAVE_MKSTEMPS@
HAVE_NANOSLEEP = @HAVE_NANOSLEEP@
+HAVE_NEWLOCALE = @HAVE_NEWLOCALE@
HAVE_NL_LANGINFO = @HAVE_NL_LANGINFO@
HAVE_OPENAT = @HAVE_OPENAT@
HAVE_OS_H = @HAVE_OS_H@
@@ -656,6 +660,7 @@ HAVE_POSIX_PRINTF = @HAVE_POSIX_PRINTF@
HAVE_POSIX_SIGNALBLOCKING = @HAVE_POSIX_SIGNALBLOCKING@
HAVE_PREAD = @HAVE_PREAD@
HAVE_PTSNAME = @HAVE_PTSNAME@
+HAVE_PWRITE = @HAVE_PWRITE@
HAVE_RANDOM_H = @HAVE_RANDOM_H@
HAVE_RANDOM_R = @HAVE_RANDOM_R@
HAVE_RAWMEMCHR = @HAVE_RAWMEMCHR@
@@ -741,6 +746,7 @@ INSTOBJEXT = @INSTOBJEXT@
INTLBISON = @INTLBISON@
INTLLIBS = @INTLLIBS@
INTLOBJS = @INTLOBJS@
+INTL_DEFAULT_VERBOSITY = @INTL_DEFAULT_VERBOSITY@
INTL_LIBTOOL_SUFFIX_PREFIX = @INTL_LIBTOOL_SUFFIX_PREFIX@
INTL_MACOSX_LIBS = @INTL_MACOSX_LIBS@
LDFLAGS = @LDFLAGS@
@@ -838,6 +844,7 @@ PO4A = @PO4A@
POSUB = @POSUB@
PRAGMA_SYSTEM_HEADER = @PRAGMA_SYSTEM_HEADER@
PRI_MACROS_BROKEN = @PRI_MACROS_BROKEN@
+PTHREAD_H_DEFINES_STRUCT_TIMESPEC = @PTHREAD_H_DEFINES_STRUCT_TIMESPEC@
PTRDIFF_T_SUFFIX = @PTRDIFF_T_SUFFIX@
RANLIB = @RANLIB@
REPLACE_BTOWC = @REPLACE_BTOWC@
@@ -902,6 +909,7 @@ REPLACE_POPEN = @REPLACE_POPEN@
REPLACE_PREAD = @REPLACE_PREAD@
REPLACE_PRINTF = @REPLACE_PRINTF@
REPLACE_PUTENV = @REPLACE_PUTENV@
+REPLACE_PWRITE = @REPLACE_PWRITE@
REPLACE_READLINK = @REPLACE_READLINK@
REPLACE_REALPATH = @REPLACE_REALPATH@
REPLACE_REMOVE = @REPLACE_REMOVE@
@@ -921,6 +929,7 @@ REPLACE_STRDUP = @REPLACE_STRDUP@
REPLACE_STRERROR = @REPLACE_STRERROR@
REPLACE_STRNCAT = @REPLACE_STRNCAT@
REPLACE_STRNDUP = @REPLACE_STRNDUP@
+REPLACE_STRNLEN = @REPLACE_STRNLEN@
REPLACE_STRSIGNAL = @REPLACE_STRSIGNAL@
REPLACE_STRSTR = @REPLACE_STRSTR@
REPLACE_STRTOD = @REPLACE_STRTOD@
@@ -928,6 +937,7 @@ REPLACE_STRTOK_R = @REPLACE_STRTOK_R@
REPLACE_SYMLINK = @REPLACE_SYMLINK@
REPLACE_TIMEGM = @REPLACE_TIMEGM@
REPLACE_TMPFILE = @REPLACE_TMPFILE@
+REPLACE_TTYNAME_R = @REPLACE_TTYNAME_R@
REPLACE_UNLINK = @REPLACE_UNLINK@
REPLACE_UNLINKAT = @REPLACE_UNLINKAT@
REPLACE_UNSETENV = @REPLACE_UNSETENV@
@@ -2210,6 +2220,7 @@ stdio.h: stdio.in.h $(CXXDEFS_H) $(ARG_NONNULL_H) $(WARN_ON_USE_H)
-e 's|@''REPLACE_VPRINTF''@|$(REPLACE_VPRINTF)|g' \
-e 's|@''REPLACE_VSNPRINTF''@|$(REPLACE_VSNPRINTF)|g' \
-e 's|@''REPLACE_VSPRINTF''@|$(REPLACE_VSPRINTF)|g' \
+ -e 's|@''ASM_SYMBOL_PREFIX''@|$(ASM_SYMBOL_PREFIX)|g' \
-e '/definitions of _GL_FUNCDECL_RPL/r $(CXXDEFS_H)' \
-e '/definition of _GL_ARG_NONNULL/r $(ARG_NONNULL_H)' \
-e '/definition of _GL_WARN_ON_USE/r $(WARN_ON_USE_H)'; \
@@ -2358,6 +2369,7 @@ string.h: string.in.h $(CXXDEFS_H) $(ARG_NONNULL_H) $(WARN_ON_USE_H)
-e 's|@''REPLACE_STRERROR''@|$(REPLACE_STRERROR)|g' \
-e 's|@''REPLACE_STRNCAT''@|$(REPLACE_STRNCAT)|g' \
-e 's|@''REPLACE_STRNDUP''@|$(REPLACE_STRNDUP)|g' \
+ -e 's|@''REPLACE_STRNLEN''@|$(REPLACE_STRNLEN)|g' \
-e 's|@''REPLACE_STRSIGNAL''@|$(REPLACE_STRSIGNAL)|g' \
-e 's|@''REPLACE_STRTOK_R''@|$(REPLACE_STRTOK_R)|g' \
-e 's|@''UNDEFINE_STRTOK_R''@|$(UNDEFINE_STRTOK_R)|g' \
@@ -2544,6 +2556,7 @@ time.h: time.in.h $(CXXDEFS_H) $(ARG_NONNULL_H) $(WARN_ON_USE_H)
-e 's|@''REPLACE_MKTIME''@|$(REPLACE_MKTIME)|g' \
-e 's|@''REPLACE_NANOSLEEP''@|$(REPLACE_NANOSLEEP)|g' \
-e 's|@''REPLACE_TIMEGM''@|$(REPLACE_TIMEGM)|g' \
+ -e 's|@''PTHREAD_H_DEFINES_STRUCT_TIMESPEC''@|$(PTHREAD_H_DEFINES_STRUCT_TIMESPEC)|g' \
-e 's|@''SYS_TIME_H_DEFINES_STRUCT_TIMESPEC''@|$(SYS_TIME_H_DEFINES_STRUCT_TIMESPEC)|g' \
-e 's|@''TIME_H_DEFINES_STRUCT_TIMESPEC''@|$(TIME_H_DEFINES_STRUCT_TIMESPEC)|g' \
-e '/definitions of _GL_FUNCDECL_RPL/r $(CXXDEFS_H)' \
@@ -2588,6 +2601,7 @@ unistd.h: unistd.in.h $(CXXDEFS_H) $(ARG_NONNULL_H) $(WARN_ON_USE_H)
-e 's|@''GNULIB_LSEEK''@|$(GNULIB_LSEEK)|g' \
-e 's|@''GNULIB_PIPE2''@|$(GNULIB_PIPE2)|g' \
-e 's|@''GNULIB_PREAD''@|$(GNULIB_PREAD)|g' \
+ -e 's|@''GNULIB_PWRITE''@|$(GNULIB_PWRITE)|g' \
-e 's|@''GNULIB_READLINK''@|$(GNULIB_READLINK)|g' \
-e 's|@''GNULIB_READLINKAT''@|$(GNULIB_READLINKAT)|g' \
-e 's|@''GNULIB_RMDIR''@|$(GNULIB_RMDIR)|g' \
@@ -2622,6 +2636,7 @@ unistd.h: unistd.in.h $(CXXDEFS_H) $(ARG_NONNULL_H) $(WARN_ON_USE_H)
-e 's|@''HAVE_LINKAT''@|$(HAVE_LINKAT)|g' \
-e 's|@''HAVE_PIPE2''@|$(HAVE_PIPE2)|g' \
-e 's|@''HAVE_PREAD''@|$(HAVE_PREAD)|g' \
+ -e 's|@''HAVE_PWRITE''@|$(HAVE_PWRITE)|g' \
-e 's|@''HAVE_READLINK''@|$(HAVE_READLINK)|g' \
-e 's|@''HAVE_READLINKAT''@|$(HAVE_READLINKAT)|g' \
-e 's|@''HAVE_SLEEP''@|$(HAVE_SLEEP)|g' \
@@ -2649,10 +2664,12 @@ unistd.h: unistd.in.h $(CXXDEFS_H) $(ARG_NONNULL_H) $(WARN_ON_USE_H)
-e 's|@''REPLACE_LINKAT''@|$(REPLACE_LINKAT)|g' \
-e 's|@''REPLACE_LSEEK''@|$(REPLACE_LSEEK)|g' \
-e 's|@''REPLACE_PREAD''@|$(REPLACE_PREAD)|g' \
+ -e 's|@''REPLACE_PWRITE''@|$(REPLACE_PWRITE)|g' \
-e 's|@''REPLACE_READLINK''@|$(REPLACE_READLINK)|g' \
-e 's|@''REPLACE_RMDIR''@|$(REPLACE_RMDIR)|g' \
-e 's|@''REPLACE_SLEEP''@|$(REPLACE_SLEEP)|g' \
-e 's|@''REPLACE_SYMLINK''@|$(REPLACE_SYMLINK)|g' \
+ -e 's|@''REPLACE_TTYNAME_R''@|$(REPLACE_TTYNAME_R)|g' \
-e 's|@''REPLACE_UNLINK''@|$(REPLACE_UNLINK)|g' \
-e 's|@''REPLACE_UNLINKAT''@|$(REPLACE_UNLINKAT)|g' \
-e 's|@''REPLACE_USLEEP''@|$(REPLACE_USLEEP)|g' \
diff --git a/gnulib/lib/canonicalize-lgpl.c b/gnulib/lib/canonicalize-lgpl.c
index 480a1325..c2164e07 100644
--- a/gnulib/lib/canonicalize-lgpl.c
+++ b/gnulib/lib/canonicalize-lgpl.c
@@ -43,7 +43,7 @@
# include <shlib-compat.h>
#else
# define SHLIB_COMPAT(lib, introduced, obsoleted) 0
-# define versioned_symbol(lib, local, symbol, version)
+# define versioned_symbol(lib, local, symbol, version) extern int dummy
# define compat_symbol(lib, local, symbol, version)
# define weak_alias(local, symbol)
# define __canonicalize_file_name canonicalize_file_name
@@ -62,6 +62,8 @@
# endif
# define __readlink readlink
# define __set_errno(e) errno = (e)
+/* Use the system functions, not the gnulib overrides in this file. */
+# undef malloc
# ifndef MAXSYMLINKS
# ifdef SYMLOOP_MAX
# define MAXSYMLINKS SYMLOOP_MAX
diff --git a/gnulib/lib/config.charset b/gnulib/lib/config.charset
index 2959df89..aa7d00db 100755
--- a/gnulib/lib/config.charset
+++ b/gnulib/lib/config.charset
@@ -30,21 +30,21 @@
# The current list of GNU canonical charset names is as follows.
#
# name MIME? used by which systems
-# ASCII, ANSI_X3.4-1968 glibc solaris freebsd netbsd darwin
-# ISO-8859-1 Y glibc aix hpux irix osf solaris freebsd netbsd openbsd darwin
-# ISO-8859-2 Y glibc aix hpux irix osf solaris freebsd netbsd openbsd darwin
-# ISO-8859-3 Y glibc solaris
+# ASCII, ANSI_X3.4-1968 glibc solaris freebsd netbsd darwin cygwin
+# ISO-8859-1 Y glibc aix hpux irix osf solaris freebsd netbsd openbsd darwin cygwin
+# ISO-8859-2 Y glibc aix hpux irix osf solaris freebsd netbsd openbsd darwin cygwin
+# ISO-8859-3 Y glibc solaris cygwin
# ISO-8859-4 Y osf solaris freebsd netbsd openbsd darwin
-# ISO-8859-5 Y glibc aix hpux irix osf solaris freebsd netbsd openbsd darwin
-# ISO-8859-6 Y glibc aix hpux solaris
-# ISO-8859-7 Y glibc aix hpux irix osf solaris netbsd openbsd darwin
-# ISO-8859-8 Y glibc aix hpux osf solaris
-# ISO-8859-9 Y glibc aix hpux irix osf solaris darwin
-# ISO-8859-13 glibc netbsd openbsd darwin
-# ISO-8859-14 glibc
-# ISO-8859-15 glibc aix osf solaris freebsd netbsd openbsd darwin
+# ISO-8859-5 Y glibc aix hpux irix osf solaris freebsd netbsd openbsd darwin cygwin
+# ISO-8859-6 Y glibc aix hpux solaris cygwin
+# ISO-8859-7 Y glibc aix hpux irix osf solaris netbsd openbsd darwin cygwin
+# ISO-8859-8 Y glibc aix hpux osf solaris cygwin
+# ISO-8859-9 Y glibc aix hpux irix osf solaris darwin cygwin
+# ISO-8859-13 glibc netbsd openbsd darwin cygwin
+# ISO-8859-14 glibc cygwin
+# ISO-8859-15 glibc aix osf solaris freebsd netbsd openbsd darwin cygwin
# KOI8-R Y glibc solaris freebsd netbsd openbsd darwin
-# KOI8-U Y glibc freebsd netbsd openbsd darwin
+# KOI8-U Y glibc freebsd netbsd openbsd darwin cygwin
# KOI8-T glibc
# CP437 dos
# CP775 dos
@@ -61,7 +61,7 @@
# CP869 dos
# CP874 woe32 dos
# CP922 aix
-# CP932 aix woe32 dos
+# CP932 aix cygwin woe32 dos
# CP943 aix
# CP949 osf darwin woe32 dos
# CP950 woe32 dos
@@ -71,7 +71,7 @@
# CP1129 aix
# CP1131 darwin
# CP1250 woe32
-# CP1251 glibc solaris netbsd openbsd darwin woe32
+# CP1251 glibc solaris netbsd openbsd darwin cygwin woe32
# CP1252 aix woe32
# CP1253 woe32
# CP1254 woe32
@@ -80,19 +80,19 @@
# CP1257 woe32
# GB2312 Y glibc aix hpux irix solaris freebsd netbsd darwin
# EUC-JP Y glibc aix hpux irix osf solaris freebsd netbsd darwin
-# EUC-KR Y glibc aix hpux irix osf solaris freebsd netbsd darwin
+# EUC-KR Y glibc aix hpux irix osf solaris freebsd netbsd darwin cygwin
# EUC-TW glibc aix hpux irix osf solaris netbsd
-# BIG5 Y glibc aix hpux osf solaris freebsd netbsd darwin
+# BIG5 Y glibc aix hpux osf solaris freebsd netbsd darwin cygwin
# BIG5-HKSCS glibc solaris darwin
-# GBK glibc aix osf solaris darwin woe32 dos
+# GBK glibc aix osf solaris darwin cygwin woe32 dos
# GB18030 glibc solaris netbsd darwin
# SHIFT_JIS Y hpux osf solaris freebsd netbsd darwin
# JOHAB glibc solaris woe32
-# TIS-620 glibc aix hpux osf solaris
+# TIS-620 glibc aix hpux osf solaris cygwin
# VISCII Y glibc
# TCVN5712-1 glibc
# ARMSCII-8 glibc darwin
-# GEORGIAN-PS glibc
+# GEORGIAN-PS glibc cygwin
# PT154 glibc
# HP-ROMAN8 hpux
# HP-ARABIC8 hpux
@@ -102,7 +102,7 @@
# HP-KANA8 hpux
# DEC-KANJI osf
# DEC-HANYU osf
-# UTF-8 Y glibc aix hpux osf solaris netbsd darwin
+# UTF-8 Y glibc aix hpux osf solaris netbsd darwin cygwin
#
# Note: Names which are not marked as being a MIME name should not be used in
# Internet protocols for information interchange (mail, news, etc.).
diff --git a/gnulib/lib/error.c b/gnulib/lib/error.c
index c79e8d42..ed9dba0d 100644
--- a/gnulib/lib/error.c
+++ b/gnulib/lib/error.c
@@ -88,6 +88,15 @@ extern void __error_at_line (int status, int errnum, const char *file_name,
# include <fcntl.h>
# include <unistd.h>
+# if (defined _WIN32 || defined __WIN32__) && ! defined __CYGWIN__
+/* Get declarations of the Win32 API functions. */
+# define WIN32_LEAN_AND_MEAN
+# include <windows.h>
+# endif
+
+/* The gnulib override of fcntl is not needed in this file. */
+# undef fcntl
+
# if !HAVE_DECL_STRERROR_R && STRERROR_R_CHAR_P
# ifndef HAVE_DECL_STRERROR_R
"this configure-time declaration test was not run"
@@ -104,10 +113,29 @@ extern char *program_name;
# endif /* HAVE_STRERROR_R || defined strerror_r */
#endif /* not _LIBC */
+#if !_LIBC
+/* Return non-zero if FD is open. */
+static inline int
+is_open (int fd)
+{
+# if (defined _WIN32 || defined __WIN32__) && ! defined __CYGWIN__
+ /* On Win32: The initial state of unassigned standard file descriptors is
+ that they are open but point to an INVALID_HANDLE_VALUE. There is no
+ fcntl, and the gnulib replacement fcntl does not support F_GETFL. */
+ return (HANDLE) _get_osfhandle (fd) != INVALID_HANDLE_VALUE;
+# else
+# ifndef F_GETFL
+# error Please port fcntl to your platform
+# endif
+ return 0 <= fcntl (fd, F_GETFL);
+# endif
+}
+#endif
+
static inline void
flush_stdout (void)
{
-#if !_LIBC && defined F_GETFL
+#if !_LIBC
int stdout_fd;
# if GNULIB_FREOPEN_SAFER
@@ -124,7 +152,7 @@ flush_stdout (void)
/* POSIX states that fflush (stdout) after fclose is unspecified; it
is safe in glibc, but not on all other platforms. fflush (NULL)
is always defined, but too draconian. */
- if (0 <= stdout_fd && 0 <= fcntl (stdout_fd, F_GETFL))
+ if (0 <= stdout_fd && is_open (stdout_fd))
#endif
fflush (stdout);
}
diff --git a/gnulib/lib/getopt.c b/gnulib/lib/getopt.c
index 738d998b..3791f129 100644
--- a/gnulib/lib/getopt.c
+++ b/gnulib/lib/getopt.c
@@ -738,7 +738,7 @@ _getopt_internal_r (int argc, char **argv, const char *optstring,
{
char c = *d->__nextchar++;
- char *temp = strchr (optstring, c);
+ const char *temp = strchr (optstring, c);
/* Increment `optind' when we start to process its last character. */
if (*d->__nextchar == '\0')
diff --git a/gnulib/lib/getopt_int.h b/gnulib/lib/getopt_int.h
index 169def5b..980b7507 100644
--- a/gnulib/lib/getopt_int.h
+++ b/gnulib/lib/getopt_int.h
@@ -30,6 +30,40 @@ extern int _getopt_internal (int ___argc, char **___argv,
/* Reentrant versions which can handle parsing multiple argument
vectors at the same time. */
+/* Describe how to deal with options that follow non-option ARGV-elements.
+
+ If the caller did not specify anything,
+ the default is REQUIRE_ORDER if the environment variable
+ POSIXLY_CORRECT is defined, PERMUTE otherwise.
+
+ REQUIRE_ORDER means don't recognize them as options;
+ stop option processing when the first non-option is seen.
+ This is what Unix does.
+ This mode of operation is selected by either setting the environment
+ variable POSIXLY_CORRECT, or using `+' as the first character
+ of the list of option characters, or by calling getopt.
+
+ PERMUTE is the default. We permute the contents of ARGV as we
+ scan, so that eventually all the non-options are at the end.
+ This allows options to be given in any order, even with programs
+ that were not written to expect this.
+
+ RETURN_IN_ORDER is an option available to programs that were
+ written to expect options and other ARGV-elements in any order
+ and that care about the ordering of the two. We describe each
+ non-option ARGV-element as if it were the argument of an option
+ with character code 1. Using `-' as the first character of the
+ list of option characters selects this mode of operation.
+
+ The special argument `--' forces an end of option-scanning regardless
+ of the value of `ordering'. In the case of RETURN_IN_ORDER, only
+ `--' can cause `getopt' to return -1 with `optind' != ARGC. */
+
+enum __ord
+ {
+ REQUIRE_ORDER, PERMUTE, RETURN_IN_ORDER
+ };
+
/* Data type for reentrant functions. */
struct _getopt_data
{
@@ -54,39 +88,8 @@ struct _getopt_data
by advancing to the next ARGV-element. */
char *__nextchar;
- /* Describe how to deal with options that follow non-option ARGV-elements.
-
- If the caller did not specify anything,
- the default is REQUIRE_ORDER if the environment variable
- POSIXLY_CORRECT is defined, PERMUTE otherwise.
-
- REQUIRE_ORDER means don't recognize them as options;
- stop option processing when the first non-option is seen.
- This is what Unix does.
- This mode of operation is selected by either setting the environment
- variable POSIXLY_CORRECT, or using `+' as the first character
- of the list of option characters, or by calling getopt.
-
- PERMUTE is the default. We permute the contents of ARGV as we
- scan, so that eventually all the non-options are at the end.
- This allows options to be given in any order, even with programs
- that were not written to expect this.
-
- RETURN_IN_ORDER is an option available to programs that were
- written to expect options and other ARGV-elements in any order
- and that care about the ordering of the two. We describe each
- non-option ARGV-element as if it were the argument of an option
- with character code 1. Using `-' as the first character of the
- list of option characters selects this mode of operation.
-
- The special argument `--' forces an end of option-scanning regardless
- of the value of `ordering'. In the case of RETURN_IN_ORDER, only
- `--' can cause `getopt' to return -1 with `optind' != ARGC. */
-
- enum
- {
- REQUIRE_ORDER, PERMUTE, RETURN_IN_ORDER
- } __ordering;
+ /* See __ord above. */
+ enum __ord __ordering;
/* If the POSIXLY_CORRECT environment variable is set
or getopt was called. */
diff --git a/gnulib/lib/localcharset.c b/gnulib/lib/localcharset.c
index a04dc446..fa2207fe 100644
--- a/gnulib/lib/localcharset.c
+++ b/gnulib/lib/localcharset.c
@@ -369,10 +369,9 @@ locale_charset (void)
codeset = nl_langinfo (CODESET);
# ifdef __CYGWIN__
- /* Cygwin 1.5.x does not have locales. nl_langinfo (CODESET) always
- returns "US-ASCII". As long as this is not fixed, return the suffix
- of the locale name from the environment variables (if present) or
- the codepage as a number. */
+ /* Cygwin < 1.7 does not have locales. nl_langinfo (CODESET) always
+ returns "US-ASCII". Return the suffix of the locale name from the
+ environment variables (if present) or the codepage as a number. */
if (codeset != NULL && strcmp (codeset, "US-ASCII") == 0)
{
const char *locale;
diff --git a/gnulib/lib/malloca.c b/gnulib/lib/malloca.c
index 623131bf..21bbc1f5 100644
--- a/gnulib/lib/malloca.c
+++ b/gnulib/lib/malloca.c
@@ -21,6 +21,9 @@
/* Specification. */
#include "malloca.h"
+/* Use the system functions, not the gnulib overrides in this file. */
+#undef malloc
+
/* The speed critical point in this file is freea() applied to an alloca()
result: it must be fast, to match the speed of alloca(). The speed of
mmalloca() and freea() in the other case are not critical, because they
diff --git a/gnulib/lib/regex_internal.c b/gnulib/lib/regex_internal.c
index 17eafaa9..98b8d5d2 100644
--- a/gnulib/lib/regex_internal.c
+++ b/gnulib/lib/regex_internal.c
@@ -733,15 +733,17 @@ re_string_reconstruct (re_string_t *pstr, Idx idx, int eflags)
mbstate_t cur_state;
wchar_t wc2;
Idx mlen = raw + pstr->len - p;
- unsigned char buf[6];
size_t mbclen;
+#if 0 /* dead code: buf is set but never used */
+ unsigned char buf[6];
if (BE (pstr->trans != NULL, 0))
{
int i = mlen < 6 ? mlen : 6;
while (--i >= 0)
buf[i] = pstr->trans[p[i]];
}
+#endif
/* XXX Don't use mbrtowc, we know which conversion
to use (UTF-8 -> UCS4). */
memset (&cur_state, 0, sizeof (cur_state));
diff --git a/gnulib/lib/regex_internal.h b/gnulib/lib/regex_internal.h
index 2cb8c4d0..5aa5aa28 100644
--- a/gnulib/lib/regex_internal.h
+++ b/gnulib/lib/regex_internal.h
@@ -467,6 +467,8 @@ static unsigned int re_string_context_at (const re_string_t *input, Idx idx,
# else
/* alloca is implemented with malloc, so just use malloc. */
# define __libc_use_alloca(n) 0
+# undef alloca
+# define alloca(n) malloc (n)
# endif
#endif
diff --git a/gnulib/lib/setenv.c b/gnulib/lib/setenv.c
index b4c55322..ba760d6f 100644
--- a/gnulib/lib/setenv.c
+++ b/gnulib/lib/setenv.c
@@ -64,6 +64,10 @@ __libc_lock_define_initialized (static, envlock)
# define clearenv __clearenv
# define tfind __tfind
# define tsearch __tsearch
+#else
+/* Use the system functions, not the gnulib overrides in this file. */
+# undef malloc
+# undef realloc
#endif
/* In the GNU C library implementation we try to be more clever and
@@ -112,8 +116,8 @@ int
__add_to_environ (const char *name, const char *value, const char *combined,
int replace)
{
- register char **ep;
- register size_t size;
+ char **ep;
+ size_t size;
const size_t namelen = strlen (name);
const size_t vallen = value != NULL ? strlen (value) + 1 : 0;
@@ -147,6 +151,9 @@ __add_to_environ (const char *name, const char *value, const char *combined,
: realloc (last_environ, (size + 2) * sizeof (char *)));
if (new_environ == NULL)
{
+ /* It's easier to set errno to ENOMEM than to rely on the
+ 'malloc-posix' and 'realloc-posix' gnulib modules. */
+ __set_errno (ENOMEM);
UNLOCK;
return -1;
}
@@ -249,7 +256,7 @@ __add_to_environ (const char *name, const char *value, const char *combined,
if (np == NULL)
#endif
{
- np = malloc (namelen + 1 + vallen);
+ np = (char *) malloc (namelen + 1 + vallen);
if (np == NULL)
{
#if defined USE_TSEARCH && !defined _LIBC
diff --git a/gnulib/lib/stdbool.in.h b/gnulib/lib/stdbool.in.h
index e2312ecb..574c281a 100644
--- a/gnulib/lib/stdbool.in.h
+++ b/gnulib/lib/stdbool.in.h
@@ -50,6 +50,9 @@
with this substitute. With this substitute, only the values 0 and 1
give the expected result when converted to _Bool' or 'bool'.
+ - C99 allows the use of (_Bool)0.0 in constant expressions, but
+ this substitute cannot always provide this property.
+
Also, it is suggested that programs use 'bool' rather than '_Bool';
this isn't required, but 'bool' is more common. */
diff --git a/gnulib/lib/stdio-write.c b/gnulib/lib/stdio-write.c
index f7da9e42..a6a0eb14 100644
--- a/gnulib/lib/stdio-write.c
+++ b/gnulib/lib/stdio-write.c
@@ -63,7 +63,6 @@
}
# if !REPLACE_PRINTF_POSIX /* avoid collision with printf.c */
-# if !DEPENDS_ON_LIBINTL /* avoid collision with intl/printf.c */
int
printf (const char *format, ...)
{
@@ -76,7 +75,6 @@ printf (const char *format, ...)
return retval;
}
-# endif
# endif
# if !REPLACE_FPRINTF_POSIX /* avoid collision with fprintf.c */
diff --git a/gnulib/lib/stdio.in.h b/gnulib/lib/stdio.in.h
index dcb8ee57..80b9dbfd 100644
--- a/gnulib/lib/stdio.in.h
+++ b/gnulib/lib/stdio.in.h
@@ -63,6 +63,10 @@
/* The definition of _GL_WARN_ON_USE is copied here. */
+/* Macros for stringification. */
+#define _GL_STDIO_STRINGIZE(token) #token
+#define _GL_STDIO_MACROEXPAND_AND_STRINGIZE(token) _GL_STDIO_STRINGIZE(token)
+
#if @GNULIB_DPRINTF@
# if @REPLACE_DPRINTF@
@@ -640,16 +644,26 @@ _GL_WARN_ON_USE (popen, "popen is buggy on some platforms - "
#if @GNULIB_PRINTF_POSIX@ || @GNULIB_PRINTF@
# if (@GNULIB_PRINTF_POSIX@ && @REPLACE_PRINTF@) \
|| (@GNULIB_PRINTF@ && @REPLACE_STDIO_WRITE_FUNCS@ && @GNULIB_STDIO_H_SIGPIPE@)
-# if !(defined __cplusplus && defined GNULIB_NAMESPACE)
+# if defined __GNUC__
+# if !(defined __cplusplus && defined GNULIB_NAMESPACE)
/* Don't break __attribute__((format(printf,M,N))). */
-# define printf __printf__
-# endif
-# define GNULIB_overrides_printf 1
+# define printf __printf__
+# endif
_GL_FUNCDECL_RPL_1 (__printf__, int,
(const char *format, ...)
+ __asm__ (@ASM_SYMBOL_PREFIX@
+ _GL_STDIO_MACROEXPAND_AND_STRINGIZE(rpl_printf))
__attribute__ ((__format__ (__printf__, 1, 2)))
_GL_ARG_NONNULL ((1)));
_GL_CXXALIAS_RPL_1 (printf, __printf__, int, (const char *format, ...));
+# else
+_GL_FUNCDECL_RPL (printf, int,
+ (const char *format, ...)
+ __attribute__ ((__format__ (__printf__, 1, 2)))
+ _GL_ARG_NONNULL ((1)));
+_GL_CXXALIAS_RPL (printf, int, (const char *format, ...));
+# endif
+# define GNULIB_overrides_printf 1
# else
_GL_CXXALIAS_SYS (printf, int, (const char *format, ...));
# endif
diff --git a/gnulib/lib/strerror.c b/gnulib/lib/strerror.c
index b0df7784..46153abf 100644
--- a/gnulib/lib/strerror.c
+++ b/gnulib/lib/strerror.c
@@ -32,6 +32,9 @@
# include "intprops.h"
+/* Use the system functions, not the gnulib overrides in this file. */
+# undef sprintf
+
# undef strerror
# if ! HAVE_DECL_STRERROR
# define strerror(n) NULL
diff --git a/gnulib/lib/string.in.h b/gnulib/lib/string.in.h
index eb8d7588..f64fce30 100644
--- a/gnulib/lib/string.in.h
+++ b/gnulib/lib/string.in.h
@@ -41,10 +41,12 @@
# if __GNUC__ < 2 || (__GNUC__ == 2 && __GNUC_MINOR__ < 5)
# define __attribute__(Spec) /* empty */
# endif
+#endif
/* The attribute __pure__ was added in gcc 2.96. */
-# if __GNUC__ < 2 || (__GNUC__ == 2 && __GNUC_MINOR__ < 96)
-# define __pure__ /* empty */
-# endif
+#if __GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ >= 96)
+# define _GL_ATTRIBUTE_PURE __attribute__ ((__pure__))
+#else
+# define _GL_ATTRIBUTE_PURE /* empty */
#endif
@@ -62,13 +64,13 @@
# define memchr rpl_memchr
# endif
_GL_FUNCDECL_RPL (memchr, void *, (void const *__s, int __c, size_t __n)
- __attribute__ ((__pure__))
+ _GL_ATTRIBUTE_PURE
_GL_ARG_NONNULL ((1)));
_GL_CXXALIAS_RPL (memchr, void *, (void const *__s, int __c, size_t __n));
# else
# if ! @HAVE_MEMCHR@
_GL_FUNCDECL_SYS (memchr, void *, (void const *__s, int __c, size_t __n)
- __attribute__ ((__pure__))
+ _GL_ATTRIBUTE_PURE
_GL_ARG_NONNULL ((1)));
# endif
/* On some systems, this function is defined as an overloaded function:
@@ -102,7 +104,8 @@ _GL_WARN_ON_USE (memchr, "memchr has platform-specific bugs - "
_GL_FUNCDECL_RPL (memmem, void *,
(void const *__haystack, size_t __haystack_len,
void const *__needle, size_t __needle_len)
- __attribute__ ((__pure__)) _GL_ARG_NONNULL ((1, 3)));
+ _GL_ATTRIBUTE_PURE
+ _GL_ARG_NONNULL ((1, 3)));
_GL_CXXALIAS_RPL (memmem, void *,
(void const *__haystack, size_t __haystack_len,
void const *__needle, size_t __needle_len));
@@ -111,7 +114,8 @@ _GL_CXXALIAS_RPL (memmem, void *,
_GL_FUNCDECL_SYS (memmem, void *,
(void const *__haystack, size_t __haystack_len,
void const *__needle, size_t __needle_len)
- __attribute__ ((__pure__)) _GL_ARG_NONNULL ((1, 3)));
+ _GL_ATTRIBUTE_PURE
+ _GL_ARG_NONNULL ((1, 3)));
# endif
_GL_CXXALIAS_SYS (memmem, void *,
(void const *__haystack, size_t __haystack_len,
@@ -152,7 +156,7 @@ _GL_WARN_ON_USE (mempcpy, "mempcpy is unportable - "
#if @GNULIB_MEMRCHR@
# if ! @HAVE_DECL_MEMRCHR@
_GL_FUNCDECL_SYS (memrchr, void *, (void const *, int, size_t)
- __attribute__ ((__pure__))
+ _GL_ATTRIBUTE_PURE
_GL_ARG_NONNULL ((1)));
# endif
/* On some systems, this function is defined as an overloaded function:
@@ -182,7 +186,7 @@ _GL_WARN_ON_USE (memrchr, "memrchr is unportable - "
#if @GNULIB_RAWMEMCHR@
# if ! @HAVE_RAWMEMCHR@
_GL_FUNCDECL_SYS (rawmemchr, void *, (void const *__s, int __c_in)
- __attribute__ ((__pure__))
+ _GL_ATTRIBUTE_PURE
_GL_ARG_NONNULL ((1)));
# endif
/* On some systems, this function is defined as an overloaded function:
@@ -272,7 +276,7 @@ _GL_WARN_ON_USE (strchr, "strchr cannot work correctly on character strings "
#if @GNULIB_STRCHRNUL@
# if ! @HAVE_STRCHRNUL@
_GL_FUNCDECL_SYS (strchrnul, char *, (char const *__s, int __c_in)
- __attribute__ ((__pure__))
+ _GL_ATTRIBUTE_PURE
_GL_ARG_NONNULL ((1)));
# endif
/* On some systems, this function is defined as an overloaded function:
@@ -372,12 +376,23 @@ _GL_WARN_ON_USE (strndup, "strndup is unportable - "
MAXLEN bytes. If no '\0' terminator is found in that many bytes,
return MAXLEN. */
#if @GNULIB_STRNLEN@
-# if ! @HAVE_DECL_STRNLEN@
+# if @REPLACE_STRNLEN@
+# if !(defined __cplusplus && defined GNULIB_NAMESPACE)
+# undef strnlen
+# define strnlen rpl_strnlen
+# endif
+_GL_FUNCDECL_RPL (strnlen, size_t, (char const *__string, size_t __maxlen)
+ _GL_ATTRIBUTE_PURE
+ _GL_ARG_NONNULL ((1)));
+_GL_CXXALIAS_RPL (strnlen, size_t, (char const *__string, size_t __maxlen));
+# else
+# if ! @HAVE_DECL_STRNLEN@
_GL_FUNCDECL_SYS (strnlen, size_t, (char const *__string, size_t __maxlen)
- __attribute__ ((__pure__))
+ _GL_ATTRIBUTE_PURE
_GL_ARG_NONNULL ((1)));
-# endif
+# endif
_GL_CXXALIAS_SYS (strnlen, size_t, (char const *__string, size_t __maxlen));
+# endif
_GL_CXXALIASWARN (strnlen);
#elif defined GNULIB_POSIXCHECK
# undef strnlen
@@ -403,7 +418,7 @@ _GL_WARN_ON_USE (strcspn, "strcspn cannot work correctly on character strings "
#if @GNULIB_STRPBRK@
# if ! @HAVE_STRPBRK@
_GL_FUNCDECL_SYS (strpbrk, char *, (char const *__s, char const *__accept)
- __attribute__ ((__pure__))
+ _GL_ATTRIBUTE_PURE
_GL_ARG_NONNULL ((1, 2)));
# endif
/* On some systems, this function is defined as an overloaded function:
@@ -503,7 +518,7 @@ _GL_WARN_ON_USE (strsep, "strsep is unportable - "
# define strstr rpl_strstr
# endif
_GL_FUNCDECL_RPL (strstr, char *, (const char *haystack, const char *needle)
- __attribute__ ((__pure__))
+ _GL_ATTRIBUTE_PURE
_GL_ARG_NONNULL ((1, 2)));
_GL_CXXALIAS_RPL (strstr, char *, (const char *haystack, const char *needle));
# else
@@ -545,14 +560,16 @@ _GL_WARN_ON_USE (strstr, "strstr is quadratic on many systems, and cannot "
# endif
_GL_FUNCDECL_RPL (strcasestr, char *,
(const char *haystack, const char *needle)
- __attribute__ ((__pure__)) _GL_ARG_NONNULL ((1, 2)));
+ _GL_ATTRIBUTE_PURE
+ _GL_ARG_NONNULL ((1, 2)));
_GL_CXXALIAS_RPL (strcasestr, char *,
(const char *haystack, const char *needle));
# else
# if ! @HAVE_STRCASESTR@
_GL_FUNCDECL_SYS (strcasestr, char *,
(const char *haystack, const char *needle)
- __attribute__ ((__pure__)) _GL_ARG_NONNULL ((1, 2)));
+ _GL_ATTRIBUTE_PURE
+ _GL_ARG_NONNULL ((1, 2)));
# endif
/* On some systems, this function is defined as an overloaded function:
extern "C++" { const char * strcasestr (const char *, const char *); }
diff --git a/gnulib/lib/time.in.h b/gnulib/lib/time.in.h
index 8e364feb..6fb4fd71 100644
--- a/gnulib/lib/time.in.h
+++ b/gnulib/lib/time.in.h
@@ -48,10 +48,20 @@
/* Some systems don't define struct timespec (e.g., AIX 4.1, Ultrix 4.3).
Or they define it with the wrong member names or define it in <sys/time.h>
- (e.g., FreeBSD circa 1997). */
+ (e.g., FreeBSD circa 1997). Stock Mingw does not define it, but the
+ pthreads-win32 library defines it in <pthread.h>. */
# if ! @TIME_H_DEFINES_STRUCT_TIMESPEC@
# if @SYS_TIME_H_DEFINES_STRUCT_TIMESPEC@
# include <sys/time.h>
+# elif @PTHREAD_H_DEFINES_STRUCT_TIMESPEC@
+# include <pthread.h>
+/* The pthreads-win32 <pthread.h> also defines a couple of broken macros. */
+# undef asctime_r
+# undef ctime_r
+# undef gmtime_r
+# undef localtime_r
+# undef rand_r
+# undef strtok_r
# else
# ifdef __cplusplus
diff --git a/gnulib/lib/unistd.in.h b/gnulib/lib/unistd.in.h
index 04d3a68f..7914f228 100644
--- a/gnulib/lib/unistd.in.h
+++ b/gnulib/lib/unistd.in.h
@@ -86,7 +86,7 @@
#endif
#if (@GNULIB_WRITE@ || @GNULIB_READLINK@ || @GNULIB_READLINKAT@ \
- || @GNULIB_PREAD@ || defined GNULIB_POSIXCHECK)
+ || @GNULIB_PREAD@ || @GNULIB_PWRITE@ || defined GNULIB_POSIXCHECK)
/* Get ssize_t. */
# include <sys/types.h>
#endif
@@ -1016,6 +1016,40 @@ _GL_WARN_ON_USE (pread, "pread is unportable - "
#endif
+#if @GNULIB_PWRITE@
+/* Write at most BUFSIZE bytes from BUF into FD, starting at OFFSET.
+ Return the number of bytes written if successful, otherwise
+ set errno and return -1. 0 indicates nothing written. See the
+ POSIX:2001 specification
+ <http://www.opengroup.org/susv3xsh/pwrite.html>. */
+# if @REPLACE_PWRITE@
+# if !(defined __cplusplus && defined GNULIB_NAMESPACE)
+# define pwrite rpl_pwrite
+# endif
+_GL_FUNCDECL_RPL (pwrite, ssize_t,
+ (int fd, const void *buf, size_t bufsize, off_t offset)
+ _GL_ARG_NONNULL ((2)));
+_GL_CXXALIAS_RPL (pwrite, ssize_t,
+ (int fd, const void *buf, size_t bufsize, off_t offset));
+# else
+# if !@HAVE_PWRITE@
+_GL_FUNCDECL_SYS (pwrite, ssize_t,
+ (int fd, const void *buf, size_t bufsize, off_t offset)
+ _GL_ARG_NONNULL ((2)));
+# endif
+_GL_CXXALIAS_SYS (pwrite, ssize_t,
+ (int fd, const void *buf, size_t bufsize, off_t offset));
+# endif
+_GL_CXXALIASWARN (pwrite);
+#elif defined GNULIB_POSIXCHECK
+# undef pwrite
+# if HAVE_RAW_DECL_PWRITE
+_GL_WARN_ON_USE (pwrite, "pwrite is unportable - "
+ "use gnulib module pwrite for portability");
+# endif
+#endif
+
+
#if @GNULIB_READLINK@
/* Read the contents of the symbolic link FILE and place the first BUFSIZE
bytes of it into BUF. Return the number of bytes placed into BUF if
@@ -1164,12 +1198,23 @@ _GL_WARN_ON_USE (symlinkat, "symlinkat is not portable - "
#if @GNULIB_TTYNAME_R@
/* Store at most BUFLEN characters of the pathname of the terminal FD is
open on in BUF. Return 0 on success, otherwise an error number. */
-# if !@HAVE_TTYNAME_R@
+# if @REPLACE_TTYNAME_R@
+# if !(defined __cplusplus && defined GNULIB_NAMESPACE)
+# undef ttyname_r
+# define ttyname_r rpl_ttyname_r
+# endif
+_GL_FUNCDECL_RPL (ttyname_r, int,
+ (int fd, char *buf, size_t buflen) _GL_ARG_NONNULL ((2)));
+_GL_CXXALIAS_RPL (ttyname_r, int,
+ (int fd, char *buf, size_t buflen));
+# else
+# if !@HAVE_TTYNAME_R@
_GL_FUNCDECL_SYS (ttyname_r, int,
(int fd, char *buf, size_t buflen) _GL_ARG_NONNULL ((2)));
-# endif
+# endif
_GL_CXXALIAS_SYS (ttyname_r, int,
(int fd, char *buf, size_t buflen));
+# endif
_GL_CXXALIASWARN (ttyname_r);
#elif defined GNULIB_POSIXCHECK
# undef ttyname_r
diff --git a/gnulib/lib/vasnprintf.c b/gnulib/lib/vasnprintf.c
index 723e05d0..e618901b 100644
--- a/gnulib/lib/vasnprintf.c
+++ b/gnulib/lib/vasnprintf.c
@@ -2889,8 +2889,8 @@ VASNPRINTF (DCHAR_T *resultbuf, size_t *lengthp,
length += n;
}
}
- }
# endif
+ }
#endif
#if (NEED_PRINTF_DIRECTIVE_A || NEED_PRINTF_LONG_DOUBLE || NEED_PRINTF_DOUBLE) && !defined IN_LIBINTL
else if ((dp->conversion == 'a' || dp->conversion == 'A')
@@ -5498,6 +5498,8 @@ VASNPRINTF (DCHAR_T *resultbuf, size_t *lengthp,
length += count;
break;
}
+#undef pad_ourselves
+#undef prec_ourselves
}
}
}
diff --git a/gnulib/lib/verify.h b/gnulib/lib/verify.h
index bcd3f5a0..4ad780c8 100644
--- a/gnulib/lib/verify.h
+++ b/gnulib/lib/verify.h
@@ -69,13 +69,14 @@
if the entity names are not disambiguated. A workaround is to
attach the current line number to the entity name:
- #define GL_CONCAT0(x, y) x##y
- #define GL_CONCAT(x, y) GL_CONCAT0 (x, y)
- extern struct {...} * GL_CONCAT(dummy,__LINE__);
+ #define _GL_CONCAT0(x, y) x##y
+ #define _GL_CONCAT(x, y) _GL_CONCAT0 (x, y)
+ extern struct {...} * _GL_CONCAT (dummy, __LINE__);
But this has the problem that two invocations of verify from
within the same macro would collide, since the __LINE__ value
- would be the same for both invocations.
+ would be the same for both invocations. (The GCC __COUNTER__
+ macro solves this problem, but is not portable.)
A solution is to use the sizeof operator. It yields a number,
getting rid of the identity of the type. Declarations like
@@ -103,20 +104,41 @@
extern int (*dummy (void)) [sizeof (struct {...})];
+ * GCC warns about duplicate declarations of the dummy function if
+ -Wredundant_decls is used. GCC 4.3 and later have a builtin
+ __COUNTER__ macro that can let us generate unique identifiers for
+ each dummy function, to suppress this warning.
+
* This implementation exploits the fact that GCC does not warn about
the last declaration mentioned above. If a future version of GCC
introduces a warning for this, the problem could be worked around
- by using code specialized to GCC, e.g.,:
+ by using code specialized to GCC, just as __COUNTER__ is already
+ being used if available.
#if 4 <= __GNUC__
- # define verify(R) \
- extern int (* verify_function__ (void)) \
- [__builtin_constant_p (R) && (R) ? 1 : -1]
+ # define verify(R) [another version to keep GCC happy]
#endif
* In C++, any struct definition inside sizeof is invalid.
Use a template type to work around the problem. */
+/* Concatenate two preprocessor tokens. */
+# define _GL_CONCAT(x, y) _GL_CONCAT0 (x, y)
+# define _GL_CONCAT0(x, y) x##y
+
+/* _GL_COUNTER is an integer, preferably one that changes each time we
+ use it. Use __COUNTER__ if it works, falling back on __LINE__
+ otherwise. __LINE__ isn't perfect, but it's better than a
+ constant. */
+# if defined __COUNTER__ && __COUNTER__ != __COUNTER__
+# define _GL_COUNTER __COUNTER__
+# else
+# define _GL_COUNTER __LINE__
+# endif
+
+/* Generate a symbol with the given prefix, making it unique if
+ possible. */
+# define _GL_GENSYM(prefix) _GL_CONCAT (prefix, _GL_COUNTER)
/* Verify requirement R at compile-time, as an integer constant expression.
Return 1. */
@@ -135,6 +157,7 @@ template <int w>
/* Verify requirement R at compile-time, as a declaration without a
trailing ';'. */
-# define verify(R) extern int (* verify_function__ (void)) [verify_true (R)]
+# define verify(R) \
+ extern int (* _GL_GENSYM (verify_function) (void)) [verify_true (R)]
#endif
diff --git a/gnulib/lib/wchar.in.h b/gnulib/lib/wchar.in.h
index dd41d353..88d47dbc 100644
--- a/gnulib/lib/wchar.in.h
+++ b/gnulib/lib/wchar.in.h
@@ -407,7 +407,7 @@ _GL_WARN_ON_USE (wcsnrtombs, "wcsnrtombs is unportable - "
_GL_FUNCDECL_RPL (wcwidth, int, (wchar_t));
_GL_CXXALIAS_RPL (wcwidth, int, (wchar_t));
# else
-# if !defined wcwidth && !@HAVE_DECL_WCWIDTH@
+# if !@HAVE_DECL_WCWIDTH@
/* wcwidth exists but is not declared. */
_GL_FUNCDECL_SYS (wcwidth, int, (wchar_t));
# endif
diff --git a/gnulib/m4/asm-underscore.m4 b/gnulib/m4/asm-underscore.m4
new file mode 100644
index 00000000..1736cc43
--- /dev/null
+++ b/gnulib/m4/asm-underscore.m4
@@ -0,0 +1,48 @@
+# asm-underscore.m4 serial 1
+dnl Copyright (C) 2010 Free Software Foundation, Inc.
+dnl This file is free software; the Free Software Foundation
+dnl gives unlimited permission to copy and/or distribute it,
+dnl with or without modifications, as long as this notice is preserved.
+
+dnl From Bruno Haible. Based on as-underscore.m4 in GNU clisp.
+
+# gl_ASM_SYMBOL_PREFIX
+# Tests for the prefix of C symbols at the assembly language level and the
+# linker level. This prefix is either an underscore or empty. Defines the
+# C macro USER_LABEL_PREFIX to this prefix, and sets ASM_SYMBOL_PREFIX to
+# a stringified variant of this prefix.
+
+AC_DEFUN([gl_ASM_SYMBOL_PREFIX],
+[
+ dnl We don't use GCC's __USER_LABEL_PREFIX__ here, because
+ dnl 1. It works only for GCC.
+ dnl 2. It is incorrectly defined on some platforms, in some GCC versions.
+ AC_CACHE_CHECK(
+ [whether C symbols are prefixed with underscore at the linker level],
+ [gl_cv_prog_as_underscore],
+ [cat > conftest.c <<EOF
+#ifdef __cplusplus
+extern "C" int foo (void);
+#endif
+int foo(void) { return 0; }
+EOF
+ # Look for the assembly language name in the .s file.
+ AC_TRY_COMMAND(${CC-cc} $CFLAGS $CPPFLAGS -S conftest.c) >/dev/null 2>&1
+ if grep _foo conftest.s >/dev/null ; then
+ gl_cv_prog_as_underscore=yes
+ else
+ gl_cv_prog_as_underscore=no
+ fi
+ rm -f conftest*
+ ])
+ if test $gl_cv_prog_as_underscore = yes; then
+ USER_LABEL_PREFIX=_
+ else
+ USER_LABEL_PREFIX=
+ fi
+ AC_DEFINE_UNQUOTED([USER_LABEL_PREFIX], [$USER_LABEL_PREFIX],
+ [Define to the prefix of C symbols at the assembler and linker level,
+ either an underscore or empty.])
+ ASM_SYMBOL_PREFIX='"'${USER_LABEL_PREFIX}'"'
+ AC_SUBST([ASM_SYMBOL_PREFIX])
+])
diff --git a/gnulib/m4/environ.m4 b/gnulib/m4/environ.m4
index 5f50d6e3..4c6849a3 100644
--- a/gnulib/m4/environ.m4
+++ b/gnulib/m4/environ.m4
@@ -1,4 +1,4 @@
-# environ.m4 serial 3
+# environ.m4 serial 4
dnl Copyright (C) 2001-2004, 2006-2010 Free Software Foundation, Inc.
dnl This file is free software; the Free Software Foundation
dnl gives unlimited permission to copy and/or distribute it,
@@ -29,7 +29,7 @@ AC_DEFUN([gt_CHECK_VAR_DECL],
gt_cv_var=yes)])
AC_MSG_RESULT([$gt_cv_var])
if test $gt_cv_var = yes; then
- AC_DEFINE([HAVE_]translit($2, [a-z], [A-Z])[_DECL], 1,
+ AC_DEFINE([HAVE_]m4_translit($2, [a-z], [A-Z])[_DECL], 1,
[Define if you have the declaration of $2.])
fi
undefine([gt_cv_var])
diff --git a/gnulib/m4/fcntl-o.m4 b/gnulib/m4/fcntl-o.m4
index d416a61c..1adacc8a 100644
--- a/gnulib/m4/fcntl-o.m4
+++ b/gnulib/m4/fcntl-o.m4
@@ -1,4 +1,4 @@
-# fcntl-o.m4 serial 1
+# fcntl-o.m4 serial 2
dnl Copyright (C) 2006, 2009-2010 Free Software Foundation, Inc.
dnl This file is free software; the Free Software Foundation
dnl gives unlimited permission to copy and/or distribute it,
@@ -12,7 +12,11 @@ dnl Written by Paul Eggert.
AC_DEFUN([gl_FCNTL_O_FLAGS],
[
dnl Persuade glibc <fcntl.h> to define O_NOATIME and O_NOFOLLOW.
- AC_REQUIRE([AC_USE_SYSTEM_EXTENSIONS])
+ dnl AC_USE_SYSTEM_EXTENSIONS was introduced in autoconf 2.60 and obsoletes
+ dnl AC_GNU_SOURCE.
+ m4_ifdef([AC_USE_SYSTEM_EXTENSIONS],
+ [AC_REQUIRE([AC_USE_SYSTEM_EXTENSIONS])],
+ [AC_REQUIRE([AC_GNU_SOURCE])])
AC_CACHE_CHECK([for working fcntl.h], [gl_cv_header_working_fcntl_h],
[AC_RUN_IFELSE(
[AC_LANG_PROGRAM(
diff --git a/gnulib/m4/getlogin_r.m4 b/gnulib/m4/getlogin_r.m4
index 236872c9..5d6f1b2e 100644
--- a/gnulib/m4/getlogin_r.m4
+++ b/gnulib/m4/getlogin_r.m4
@@ -1,4 +1,4 @@
-#serial 6
+#serial 7
# Copyright (C) 2005-2007, 2009-2010 Free Software Foundation, Inc.
#
@@ -16,6 +16,8 @@ AC_DEFUN([gl_FUNC_GETLOGIN_R],
AC_REQUIRE([gl_UNISTD_H_DEFAULTS])
dnl Persuade glibc <unistd.h> to declare getlogin_r().
+ dnl Persuade Solaris <unistd.h> to provide the POSIX compliant declaration of
+ dnl getlogin_r().
AC_REQUIRE([gl_USE_SYSTEM_EXTENSIONS])
AC_CHECK_FUNCS_ONCE([getlogin_r])
diff --git a/gnulib/m4/gettext.m4 b/gnulib/m4/gettext.m4
index d6dc3fe2..f84e6a5d 100644
--- a/gnulib/m4/gettext.m4
+++ b/gnulib/m4/gettext.m4
@@ -1,4 +1,4 @@
-# gettext.m4 serial 62 (gettext-0.18)
+# gettext.m4 serial 63 (gettext-0.18)
dnl Copyright (C) 1995-2010 Free Software Foundation, Inc.
dnl This file is free software; the Free Software Foundation
dnl gives unlimited permission to copy and/or distribute it,
@@ -15,7 +15,7 @@ dnl They are *not* in the public domain.
dnl Authors:
dnl Ulrich Drepper <drepper@cygnus.com>, 1995-2000.
-dnl Bruno Haible <haible@clisp.cons.org>, 2000-2006.
+dnl Bruno Haible <haible@clisp.cons.org>, 2000-2006, 2008-2010.
dnl Macro to add for using GNU gettext.
@@ -60,6 +60,8 @@ AC_DEFUN([AM_GNU_GETTEXT],
ifelse([$1], [], , [ifelse([$1], [external], , [ifelse([$1], [no-libtool], , [ifelse([$1], [use-libtool], ,
[errprint([ERROR: invalid first argument to AM_GNU_GETTEXT
])])])])])
+ ifelse(ifelse([$1], [], [old])[]ifelse([$1], [no-libtool], [old]), [old],
+ [AC_DIAGNOSE([obsolete], [Use of AM_GNU_GETTEXT without [external] argument is deprecated.])])
ifelse([$2], [], , [ifelse([$2], [need-ngettext], , [ifelse([$2], [need-formatstring-macros], ,
[errprint([ERROR: invalid second argument to AM_GNU_GETTEXT
])])])])
diff --git a/gnulib/m4/gnulib-common.m4 b/gnulib/m4/gnulib-common.m4
index 9cc519e7..4c7ac30d 100644
--- a/gnulib/m4/gnulib-common.m4
+++ b/gnulib/m4/gnulib-common.m4
@@ -1,4 +1,4 @@
-# gnulib-common.m4 serial 18
+# gnulib-common.m4 serial 20
dnl Copyright (C) 2007-2010 Free Software Foundation, Inc.
dnl This file is free software; the Free Software Foundation
dnl gives unlimited permission to copy and/or distribute it,
@@ -35,6 +35,12 @@ AC_DEFUN([gl_COMMON_BODY], [
is a misnomer outside of parameter lists. */
#define _UNUSED_PARAMETER_ _GL_UNUSED
])
+ dnl Preparation for running test programs:
+ dnl Tell glibc to write diagnostics from -D_FORTIFY_SOURCE=2 to stderr, not
+ dnl to /dev/tty, so they can be redirected to log files. Such diagnostics
+ dnl arise e.g., in the macros gl_PRINTF_DIRECTIVE_N, gl_SNPRINTF_DIRECTIVE_N.
+ LIBC_FATAL_STDERR_=1
+ export LIBC_FATAL_STDERR_
])
# gl_MODULE_INDICATOR_CONDITION
@@ -132,6 +138,7 @@ m4_ifdef([AC_PROG_MKDIR_P], [
# so that mixed use of GNU C and GNU C++ and mixed use of Sun C and Sun C++
# works.
# This definition can be removed once autoconf >= 2.62 can be assumed.
+m4_if(m4_version_compare(m4_defn([m4_PACKAGE_VERSION]),[2.62]),[-1],[
AC_DEFUN([AC_C_RESTRICT],
[AC_CACHE_CHECK([for C/C++ restrict keyword], [ac_cv_c_restrict],
[ac_cv_c_restrict=no
@@ -169,6 +176,7 @@ AC_DEFUN([AC_C_RESTRICT],
*) AC_DEFINE_UNQUOTED([restrict], [$ac_cv_c_restrict]) ;;
esac
])
+])
# gl_BIGENDIAN
# is like AC_C_BIGENDIAN, except that it can be AC_REQUIREd.
diff --git a/gnulib/m4/gnulib-comp.m4 b/gnulib/m4/gnulib-comp.m4
index 561e574b..75edfcde 100644
--- a/gnulib/m4/gnulib-comp.m4
+++ b/gnulib/m4/gnulib-comp.m4
@@ -308,7 +308,7 @@ AC_DEFUN([gl_INIT],
gl_FUNC_GETOPT_POSIX
# Code from module gettext:
dnl you must add AM_GNU_GETTEXT([external]) or similar to configure.ac.
- AM_GNU_GETTEXT_VERSION([0.17])
+ AM_GNU_GETTEXT_VERSION([0.18.1])
# Code from module gettext-h:
AC_SUBST([LIBINTL])
AC_SUBST([LTLIBINTL])
@@ -907,6 +907,7 @@ AC_DEFUN([gl_FILE_LIST], [
m4/00gnulib.m4
m4/alloca.m4
m4/argp.m4
+ m4/asm-underscore.m4
m4/atexit.m4
m4/btowc.m4
m4/canonicalize.m4
diff --git a/gnulib/m4/iconv.m4 b/gnulib/m4/iconv.m4
index f46ff142..e2041b9b 100644
--- a/gnulib/m4/iconv.m4
+++ b/gnulib/m4/iconv.m4
@@ -1,4 +1,4 @@
-# iconv.m4 serial 9 (gettext-0.18)
+# iconv.m4 serial 11 (gettext-0.18.1)
dnl Copyright (C) 2000-2002, 2007-2010 Free Software Foundation, Inc.
dnl This file is free software; the Free Software Foundation
dnl gives unlimited permission to copy and/or distribute it,
@@ -170,7 +170,22 @@ int main ()
AC_SUBST([LTLIBICONV])
])
-AC_DEFUN([AM_ICONV],
+dnl Define AM_ICONV using AC_DEFUN_ONCE for Autoconf >= 2.64, in order to
+dnl avoid warnings like
+dnl "warning: AC_REQUIRE: `AM_ICONV' was expanded before it was required".
+dnl This is tricky because of the way 'aclocal' is implemented:
+dnl - It requires defining an auxiliary macro whose name ends in AC_DEFUN.
+dnl Otherwise aclocal's initial scan pass would miss the macro definition.
+dnl - It requires a line break inside the AC_DEFUN_ONCE and AC_DEFUN expansions.
+dnl Otherwise aclocal would emit many "Use of uninitialized value $1"
+dnl warnings.
+m4_define([gl_iconv_AC_DEFUN],
+ m4_version_prereq([2.64],
+ [[AC_DEFUN_ONCE(
+ [$1], [$2])]],
+ [[AC_DEFUN(
+ [$1], [$2])]]))
+gl_iconv_AC_DEFUN([AM_ICONV],
[
AM_ICONV_LINK
if test "$am_cv_func_iconv" = yes; then
diff --git a/gnulib/m4/intl.m4 b/gnulib/m4/intl.m4
index 5e17fea9..335b23c2 100644
--- a/gnulib/m4/intl.m4
+++ b/gnulib/m4/intl.m4
@@ -1,5 +1,5 @@
-# intl.m4 serial 8 (gettext-0.17)
-dnl Copyright (C) 1995-2007, 2009-2010 Free Software Foundation, Inc.
+# intl.m4 serial 17 (gettext-0.18)
+dnl Copyright (C) 1995-2009 Free Software Foundation, Inc.
dnl This file is free software; the Free Software Foundation
dnl gives unlimited permission to copy and/or distribute it,
dnl with or without modifications, as long as this notice is preserved.
@@ -15,9 +15,9 @@ dnl They are *not* in the public domain.
dnl Authors:
dnl Ulrich Drepper <drepper@cygnus.com>, 1995-2000.
-dnl Bruno Haible <haible@clisp.cons.org>, 2000-2006.
+dnl Bruno Haible <haible@clisp.cons.org>, 2000-2009.
-AC_PREREQ(2.52)
+AC_PREREQ([2.52])
dnl Checks for all prerequisites of the intl subdirectory,
dnl except for INTL_LIBTOOL_SUFFIX_PREFIX (and possibly LIBTOOL), INTLOBJS,
@@ -40,14 +40,24 @@ AC_DEFUN([AM_INTL_SUBDIR],
AC_REQUIRE([gt_PRINTF_POSIX])
AC_REQUIRE([gl_GLIBC21])dnl
AC_REQUIRE([gl_XSIZE])dnl
+ AC_REQUIRE([gl_FCNTL_O_FLAGS])dnl
AC_REQUIRE([gt_INTL_MACOSX])dnl
+ dnl Support for automake's --enable-silent-rules.
+ case "$enable_silent_rules" in
+ yes) INTL_DEFAULT_VERBOSITY=0;;
+ no) INTL_DEFAULT_VERBOSITY=1;;
+ *) INTL_DEFAULT_VERBOSITY=1;;
+ esac
+ AC_SUBST([INTL_DEFAULT_VERBOSITY])
+
AC_CHECK_TYPE([ptrdiff_t], ,
[AC_DEFINE([ptrdiff_t], [long],
[Define as the type of the result of subtracting two pointers, if the system doesn't define it.])
])
AC_CHECK_HEADERS([stddef.h stdlib.h string.h])
- AC_CHECK_FUNCS([asprintf fwprintf putenv setenv setlocale snprintf wcslen])
+ AC_CHECK_FUNCS([asprintf fwprintf newlocale putenv setenv setlocale \
+ snprintf strnlen wcslen wcsnlen mbrtowc wcrtomb])
dnl Use the _snprintf function only if it is declared (because on NetBSD it
dnl is defined as a weak alias of snprintf; we prefer to use the latter).
@@ -78,6 +88,12 @@ AC_DEFUN([AM_INTL_SUBDIR],
HAVE_SNPRINTF=0
fi
AC_SUBST([HAVE_SNPRINTF])
+ if test "$ac_cv_func_newlocale" = yes; then
+ HAVE_NEWLOCALE=1
+ else
+ HAVE_NEWLOCALE=0
+ fi
+ AC_SUBST([HAVE_NEWLOCALE])
if test "$ac_cv_func_wprintf" = yes; then
HAVE_WPRINTF=1
else
@@ -146,22 +162,31 @@ AC_DEFUN([AM_INTL_SUBDIR],
#define __libc_lock_lock_recursive gl_recursive_lock_lock
#define __libc_lock_unlock_recursive gl_recursive_lock_unlock
#define glthread_in_use libintl_thread_in_use
-#define glthread_lock_init libintl_lock_init
-#define glthread_lock_lock libintl_lock_lock
-#define glthread_lock_unlock libintl_lock_unlock
-#define glthread_lock_destroy libintl_lock_destroy
-#define glthread_rwlock_init libintl_rwlock_init
-#define glthread_rwlock_rdlock libintl_rwlock_rdlock
-#define glthread_rwlock_wrlock libintl_rwlock_wrlock
-#define glthread_rwlock_unlock libintl_rwlock_unlock
-#define glthread_rwlock_destroy libintl_rwlock_destroy
-#define glthread_recursive_lock_init libintl_recursive_lock_init
-#define glthread_recursive_lock_lock libintl_recursive_lock_lock
-#define glthread_recursive_lock_unlock libintl_recursive_lock_unlock
-#define glthread_recursive_lock_destroy libintl_recursive_lock_destroy
-#define glthread_once libintl_once
-#define glthread_once_call libintl_once_call
+#define glthread_lock_init_func libintl_lock_init_func
+#define glthread_lock_lock_func libintl_lock_lock_func
+#define glthread_lock_unlock_func libintl_lock_unlock_func
+#define glthread_lock_destroy_func libintl_lock_destroy_func
+#define glthread_rwlock_init_multithreaded libintl_rwlock_init_multithreaded
+#define glthread_rwlock_init_func libintl_rwlock_init_func
+#define glthread_rwlock_rdlock_multithreaded libintl_rwlock_rdlock_multithreaded
+#define glthread_rwlock_rdlock_func libintl_rwlock_rdlock_func
+#define glthread_rwlock_wrlock_multithreaded libintl_rwlock_wrlock_multithreaded
+#define glthread_rwlock_wrlock_func libintl_rwlock_wrlock_func
+#define glthread_rwlock_unlock_multithreaded libintl_rwlock_unlock_multithreaded
+#define glthread_rwlock_unlock_func libintl_rwlock_unlock_func
+#define glthread_rwlock_destroy_multithreaded libintl_rwlock_destroy_multithreaded
+#define glthread_rwlock_destroy_func libintl_rwlock_destroy_func
+#define glthread_recursive_lock_init_multithreaded libintl_recursive_lock_init_multithreaded
+#define glthread_recursive_lock_init_func libintl_recursive_lock_init_func
+#define glthread_recursive_lock_lock_multithreaded libintl_recursive_lock_lock_multithreaded
+#define glthread_recursive_lock_lock_func libintl_recursive_lock_lock_func
+#define glthread_recursive_lock_unlock_multithreaded libintl_recursive_lock_unlock_multithreaded
+#define glthread_recursive_lock_unlock_func libintl_recursive_lock_unlock_func
+#define glthread_recursive_lock_destroy_multithreaded libintl_recursive_lock_destroy_multithreaded
+#define glthread_recursive_lock_destroy_func libintl_recursive_lock_destroy_func
+#define glthread_once_func libintl_once_func
#define glthread_once_singlethreaded libintl_once_singlethreaded
+#define glthread_once_multithreaded libintl_once_multithreaded
])
])
@@ -198,40 +223,24 @@ AC_DEFUN([gt_INTL_SUBDIR_CORE],
AC_TRY_LINK(
[int foo (int a) { a = __builtin_expect (a, 10); return a == 10 ? 0 : 1; }],
[],
- [AC_DEFINE([HAVE_BUILTIN_EXPECT], 1,
+ [AC_DEFINE([HAVE_BUILTIN_EXPECT], [1],
[Define to 1 if the compiler understands __builtin_expect.])])
AC_CHECK_HEADERS([argz.h inttypes.h limits.h unistd.h sys/param.h])
AC_CHECK_FUNCS([getcwd getegid geteuid getgid getuid mempcpy munmap \
- stpcpy strcasecmp strdup strtoul tsearch argz_count argz_stringify \
- argz_next __fsetlocking])
+ stpcpy strcasecmp strdup strtoul tsearch uselocale argz_count \
+ argz_stringify argz_next __fsetlocking])
dnl Use the *_unlocked functions only if they are declared.
dnl (because some of them were defined without being declared in Solaris
dnl 2.5.1 but were removed in Solaris 2.6, whereas we want binaries built
dnl on Solaris 2.5.1 to run on Solaris 2.6).
dnl Don't use AC_CHECK_DECLS because it isn't supported in autoconf-2.13.
- gt_CHECK_DECL(feof_unlocked, [#include <stdio.h>])
- gt_CHECK_DECL(fgets_unlocked, [#include <stdio.h>])
+ gt_CHECK_DECL([feof_unlocked], [#include <stdio.h>])
+ gt_CHECK_DECL([fgets_unlocked], [#include <stdio.h>])
AM_ICONV
- dnl glibc >= 2.4 has a NL_LOCALE_NAME macro when _GNU_SOURCE is defined,
- dnl and a _NL_LOCALE_NAME macro always.
- AC_CACHE_CHECK([for NL_LOCALE_NAME macro], gt_cv_nl_locale_name,
- [AC_TRY_LINK([#include <langinfo.h>
-#include <locale.h>],
- [char* cs = nl_langinfo(_NL_LOCALE_NAME(LC_MESSAGES));
- return !cs;
- ],
- gt_cv_nl_locale_name=yes,
- gt_cv_nl_locale_name=no)
- ])
- if test $gt_cv_nl_locale_name = yes; then
- AC_DEFINE(HAVE_NL_LOCALE_NAME, 1,
- [Define if you have <langinfo.h> and it defines the NL_LOCALE_NAME macro if _GNU_SOURCE is defined.])
- fi
-
dnl intl/plural.c is generated from intl/plural.y. It requires bison,
dnl because plural.y uses bison specific features. It requires at least
dnl bison-1.26 because earlier versions generate a plural.c that doesn't
@@ -269,7 +278,7 @@ dnl gt_CHECK_DECL(FUNC, INCLUDES)
dnl Check whether a function is declared.
AC_DEFUN([gt_CHECK_DECL],
[
- AC_CACHE_CHECK([whether $1 is declared], ac_cv_have_decl_$1,
+ AC_CACHE_CHECK([whether $1 is declared], [ac_cv_have_decl_$1],
[AC_TRY_COMPILE([$2], [
#ifndef $1
char *p = (char *) $1;
diff --git a/gnulib/m4/lib-link.m4 b/gnulib/m4/lib-link.m4
index c73bd8e3..59b367df 100644
--- a/gnulib/m4/lib-link.m4
+++ b/gnulib/m4/lib-link.m4
@@ -1,4 +1,4 @@
-# lib-link.m4 serial 21 (gettext-0.18)
+# lib-link.m4 serial 23 (gettext-0.18.2)
dnl Copyright (C) 2001-2010 Free Software Foundation, Inc.
dnl This file is free software; the Free Software Foundation
dnl gives unlimited permission to copy and/or distribute it,
@@ -18,9 +18,9 @@ AC_DEFUN([AC_LIB_LINKFLAGS],
[
AC_REQUIRE([AC_LIB_PREPARE_PREFIX])
AC_REQUIRE([AC_LIB_RPATH])
- pushdef([Name],[translit([$1],[./-], [___])])
- pushdef([NAME],[translit([$1],[abcdefghijklmnopqrstuvwxyz./-],
- [ABCDEFGHIJKLMNOPQRSTUVWXYZ___])])
+ pushdef([Name],[m4_translit([$1],[./+-], [____])])
+ pushdef([NAME],[m4_translit([$1],[abcdefghijklmnopqrstuvwxyz./+-],
+ [ABCDEFGHIJKLMNOPQRSTUVWXYZ____])])
AC_CACHE_CHECK([how to link with lib[]$1], [ac_cv_lib[]Name[]_libs], [
AC_LIB_LINKFLAGS_BODY([$1], [$2])
ac_cv_lib[]Name[]_libs="$LIB[]NAME"
@@ -58,9 +58,9 @@ AC_DEFUN([AC_LIB_HAVE_LINKFLAGS],
[
AC_REQUIRE([AC_LIB_PREPARE_PREFIX])
AC_REQUIRE([AC_LIB_RPATH])
- pushdef([Name],[translit([$1],[./-], [___])])
- pushdef([NAME],[translit([$1],[abcdefghijklmnopqrstuvwxyz./-],
- [ABCDEFGHIJKLMNOPQRSTUVWXYZ___])])
+ pushdef([Name],[m4_translit([$1],[./+-], [____])])
+ pushdef([NAME],[m4_translit([$1],[abcdefghijklmnopqrstuvwxyz./+-],
+ [ABCDEFGHIJKLMNOPQRSTUVWXYZ____])])
dnl Search for lib[]Name and define LIB[]NAME, LTLIB[]NAME and INC[]NAME
dnl accordingly.
@@ -157,13 +157,13 @@ dnl package. This declaration must occur before an AC_LIB_LINKFLAGS or similar
dnl macro call that searches for libname.
AC_DEFUN([AC_LIB_FROMPACKAGE],
[
- pushdef([NAME],[translit([$1],[abcdefghijklmnopqrstuvwxyz./-],
- [ABCDEFGHIJKLMNOPQRSTUVWXYZ___])])
+ pushdef([NAME],[m4_translit([$1],[abcdefghijklmnopqrstuvwxyz./+-],
+ [ABCDEFGHIJKLMNOPQRSTUVWXYZ____])])
define([acl_frompackage_]NAME, [$2])
popdef([NAME])
pushdef([PACK],[$2])
- pushdef([PACKUP],[translit(PACK,[abcdefghijklmnopqrstuvwxyz./-],
- [ABCDEFGHIJKLMNOPQRSTUVWXYZ___])])
+ pushdef([PACKUP],[m4_translit(PACK,[abcdefghijklmnopqrstuvwxyz./+-],
+ [ABCDEFGHIJKLMNOPQRSTUVWXYZ____])])
define([acl_libsinpackage_]PACKUP,
m4_ifdef([acl_libsinpackage_]PACKUP, [acl_libsinpackage_]PACKUP[[, ]],)[lib$1])
popdef([PACKUP])
@@ -178,14 +178,14 @@ dnl in ${LIB${NAME}_PREFIX}/$acl_libdirstem.
AC_DEFUN([AC_LIB_LINKFLAGS_BODY],
[
AC_REQUIRE([AC_LIB_PREPARE_MULTILIB])
- pushdef([NAME],[translit([$1],[abcdefghijklmnopqrstuvwxyz./-],
- [ABCDEFGHIJKLMNOPQRSTUVWXYZ___])])
+ pushdef([NAME],[m4_translit([$1],[abcdefghijklmnopqrstuvwxyz./+-],
+ [ABCDEFGHIJKLMNOPQRSTUVWXYZ____])])
pushdef([PACK],[m4_ifdef([acl_frompackage_]NAME, [acl_frompackage_]NAME, lib[$1])])
- pushdef([PACKUP],[translit(PACK,[abcdefghijklmnopqrstuvwxyz./-],
- [ABCDEFGHIJKLMNOPQRSTUVWXYZ___])])
+ pushdef([PACKUP],[m4_translit(PACK,[abcdefghijklmnopqrstuvwxyz./+-],
+ [ABCDEFGHIJKLMNOPQRSTUVWXYZ____])])
pushdef([PACKLIBS],[m4_ifdef([acl_frompackage_]NAME, [acl_libsinpackage_]PACKUP, lib[$1])])
dnl Autoconf >= 2.61 supports dots in --with options.
- pushdef([P_A_C_K],[m4_if(m4_version_compare(m4_defn([m4_PACKAGE_VERSION]),[2.61]),[-1],[translit(PACK,[.],[_])],PACK)])
+ pushdef([P_A_C_K],[m4_if(m4_version_compare(m4_defn([m4_PACKAGE_VERSION]),[2.61]),[-1],[m4_translit(PACK,[.],[_])],PACK)])
dnl By default, look in $includedir and $libdir.
use_additional=yes
AC_LIB_WITH_FINAL_PREFIX([
@@ -242,7 +242,7 @@ AC_DEFUN([AC_LIB_LINKFLAGS_BODY],
names_already_handled="$names_already_handled $name"
dnl See if it was already located by an earlier AC_LIB_LINKFLAGS
dnl or AC_LIB_HAVE_LINKFLAGS call.
- uppername=`echo "$name" | sed -e 'y|abcdefghijklmnopqrstuvwxyz./-|ABCDEFGHIJKLMNOPQRSTUVWXYZ___|'`
+ uppername=`echo "$name" | sed -e 'y|abcdefghijklmnopqrstuvwxyz./+-|ABCDEFGHIJKLMNOPQRSTUVWXYZ____|'`
eval value=\"\$HAVE_LIB$uppername\"
if test -n "$value"; then
if test "$value" = yes; then
diff --git a/gnulib/m4/onceonly.m4 b/gnulib/m4/onceonly.m4
index 4a3cd84d..6a9c87b7 100644
--- a/gnulib/m4/onceonly.m4
+++ b/gnulib/m4/onceonly.m4
@@ -1,4 +1,4 @@
-# onceonly.m4 serial 6
+# onceonly.m4 serial 7
dnl Copyright (C) 2002-2003, 2005-2006, 2008-2010 Free Software Foundation,
dnl Inc.
dnl This file is free software, distributed under the terms of the GNU
@@ -39,16 +39,16 @@ AC_PREREQ([2.59])
AC_DEFUN([AC_CHECK_HEADERS_ONCE], [
:
m4_foreach_w([gl_HEADER_NAME], [$1], [
- AC_DEFUN([gl_CHECK_HEADER_]m4_quote(translit(gl_HEADER_NAME,
- [./-], [___])), [
+ AC_DEFUN([gl_CHECK_HEADER_]m4_quote(m4_translit(gl_HEADER_NAME,
+ [./-], [___])), [
m4_divert_text([INIT_PREPARE],
[gl_header_list="$gl_header_list gl_HEADER_NAME"])
gl_HEADERS_EXPANSION
AH_TEMPLATE(AS_TR_CPP([HAVE_]m4_defn([gl_HEADER_NAME])),
[Define to 1 if you have the <]m4_defn([gl_HEADER_NAME])[> header file.])
])
- AC_REQUIRE([gl_CHECK_HEADER_]m4_quote(translit(gl_HEADER_NAME,
- [./-], [___])))
+ AC_REQUIRE([gl_CHECK_HEADER_]m4_quote(m4_translit(gl_HEADER_NAME,
+ [./-], [___])))
])
])
m4_define([gl_HEADERS_EXPANSION], [
diff --git a/gnulib/m4/openat.m4 b/gnulib/m4/openat.m4
index cfde8f9a..80df7042 100644
--- a/gnulib/m4/openat.m4
+++ b/gnulib/m4/openat.m4
@@ -1,4 +1,4 @@
-# serial 28
+# serial 29
# See if we need to use our replacement for Solaris' openat et al functions.
dnl Copyright (C) 2004-2010 Free Software Foundation, Inc.
@@ -104,9 +104,11 @@ AC_DEFUN([gl_FUNC_FCHOWNAT],
[
AC_REQUIRE([gl_FUNC_CHOWN])
AC_CHECK_FUNC([fchownat],
- [gl_FUNC_FCHOWNAT_DEREF_BUG([REPLACE_FCHOWNAT=1
- AC_DEFINE([FCHOWNAT_NOFOLLOW_BUG], [1], [Define to 1 if your
- platform has fchownat, but it cannot perform lchown tasks.])
+ [gl_FUNC_FCHOWNAT_DEREF_BUG([
+ REPLACE_FCHOWNAT=1
+ AC_DEFINE([FCHOWNAT_NOFOLLOW_BUG], [1],
+ [Define to 1 if your platform has fchownat, but it cannot
+ perform lchown tasks.])
if test $REPLACE_CHOWN = 1; then
REPLACE_FCHOWNAT=1
fi])],
diff --git a/gnulib/m4/po.m4 b/gnulib/m4/po.m4
index 960efe15..47f36a41 100644
--- a/gnulib/m4/po.m4
+++ b/gnulib/m4/po.m4
@@ -29,7 +29,7 @@ AC_DEFUN([AM_PO_SUBDIRS],
dnl Release version of the gettext macros. This is used to ensure that
dnl the gettext macros and po/Makefile.in.in are in sync.
- AC_SUBST([GETTEXT_MACRO_VERSION], [0.17])
+ AC_SUBST([GETTEXT_MACRO_VERSION], [0.18])
dnl Perform the following tests also if --disable-nls has been given,
dnl because they are needed for "make dist" to work.
diff --git a/gnulib/m4/printf.m4 b/gnulib/m4/printf.m4
index ebca5364..b31efe3e 100644
--- a/gnulib/m4/printf.m4
+++ b/gnulib/m4/printf.m4
@@ -1,4 +1,4 @@
-# printf.m4 serial 33
+# printf.m4 serial 34
dnl Copyright (C) 2003, 2007-2010 Free Software Foundation, Inc.
dnl This file is free software; the Free Software Foundation
dnl gives unlimited permission to copy and/or distribute it,
@@ -1101,7 +1101,7 @@ dnl }
dnl ---------------------------------------------------------------------
dnl Result is gl_cv_func_snprintf_retval_c99.
-AC_DEFUN([gl_SNPRINTF_RETVAL_C99],
+AC_DEFUN_ONCE([gl_SNPRINTF_RETVAL_C99],
[
AC_REQUIRE([AC_PROG_CC])
AC_REQUIRE([AC_CANONICAL_HOST]) dnl for cross-compiles
diff --git a/gnulib/m4/sockpfaf.m4 b/gnulib/m4/sockpfaf.m4
index 8a0c2360..8806705a 100644
--- a/gnulib/m4/sockpfaf.m4
+++ b/gnulib/m4/sockpfaf.m4
@@ -47,6 +47,9 @@ AC_DEFUN([gl_SOCKET_FAMILIES],
#endif
#ifdef HAVE_WINSOCK2_H
#include <winsock2.h>
+#endif
+#ifdef HAVE_WS2TCPIP_H
+#include <ws2tcpip.h>
#endif]],
[[int x = AF_INET6; struct in6_addr y; struct sockaddr_in6 z;
if (&x && &y && &z) return 0;]])],
diff --git a/gnulib/m4/stdint.m4 b/gnulib/m4/stdint.m4
index 1cc57e6e..c5e813a9 100644
--- a/gnulib/m4/stdint.m4
+++ b/gnulib/m4/stdint.m4
@@ -1,4 +1,4 @@
-# stdint.m4 serial 34
+# stdint.m4 serial 35
dnl Copyright (C) 2001-2010 Free Software Foundation, Inc.
dnl This file is free software; the Free Software Foundation
dnl gives unlimited permission to copy and/or distribute it,
@@ -309,7 +309,7 @@ AC_DEFUN([gl_STDINT_BITSIZEOF],
dnl config.h.in,
dnl - extra AC_SUBST calls, so that the right substitutions are made.
m4_foreach_w([gltype], [$1],
- [AH_TEMPLATE([BITSIZEOF_]translit(gltype,[abcdefghijklmnopqrstuvwxyz ],[ABCDEFGHIJKLMNOPQRSTUVWXYZ_]),
+ [AH_TEMPLATE([BITSIZEOF_]m4_translit(gltype,[abcdefghijklmnopqrstuvwxyz ],[ABCDEFGHIJKLMNOPQRSTUVWXYZ_]),
[Define to the number of bits in type ']gltype['.])])
for gltype in $1 ; do
AC_CACHE_CHECK([for bit size of $gltype], [gl_cv_bitsizeof_${gltype}],
@@ -334,7 +334,7 @@ AC_DEFUN([gl_STDINT_BITSIZEOF],
eval BITSIZEOF_${GLTYPE}=\$result
done
m4_foreach_w([gltype], [$1],
- [AC_SUBST([BITSIZEOF_]translit(gltype,[abcdefghijklmnopqrstuvwxyz ],[ABCDEFGHIJKLMNOPQRSTUVWXYZ_]))])
+ [AC_SUBST([BITSIZEOF_]m4_translit(gltype,[abcdefghijklmnopqrstuvwxyz ],[ABCDEFGHIJKLMNOPQRSTUVWXYZ_]))])
])
dnl gl_CHECK_TYPES_SIGNED(TYPES, INCLUDES)
@@ -347,7 +347,7 @@ AC_DEFUN([gl_CHECK_TYPES_SIGNED],
dnl config.h.in,
dnl - extra AC_SUBST calls, so that the right substitutions are made.
m4_foreach_w([gltype], [$1],
- [AH_TEMPLATE([HAVE_SIGNED_]translit(gltype,[abcdefghijklmnopqrstuvwxyz ],[ABCDEFGHIJKLMNOPQRSTUVWXYZ_]),
+ [AH_TEMPLATE([HAVE_SIGNED_]m4_translit(gltype,[abcdefghijklmnopqrstuvwxyz ],[ABCDEFGHIJKLMNOPQRSTUVWXYZ_]),
[Define to 1 if ']gltype[' is a signed integer type.])])
for gltype in $1 ; do
AC_CACHE_CHECK([whether $gltype is signed], [gl_cv_type_${gltype}_signed],
@@ -367,7 +367,7 @@ AC_DEFUN([gl_CHECK_TYPES_SIGNED],
fi
done
m4_foreach_w([gltype], [$1],
- [AC_SUBST([HAVE_SIGNED_]translit(gltype,[abcdefghijklmnopqrstuvwxyz ],[ABCDEFGHIJKLMNOPQRSTUVWXYZ_]))])
+ [AC_SUBST([HAVE_SIGNED_]m4_translit(gltype,[abcdefghijklmnopqrstuvwxyz ],[ABCDEFGHIJKLMNOPQRSTUVWXYZ_]))])
])
dnl gl_INTEGER_TYPE_SUFFIX(TYPES, INCLUDES)
@@ -380,7 +380,7 @@ AC_DEFUN([gl_INTEGER_TYPE_SUFFIX],
dnl config.h.in,
dnl - extra AC_SUBST calls, so that the right substitutions are made.
m4_foreach_w([gltype], [$1],
- [AH_TEMPLATE(translit(gltype,[abcdefghijklmnopqrstuvwxyz ],[ABCDEFGHIJKLMNOPQRSTUVWXYZ_])[_SUFFIX],
+ [AH_TEMPLATE(m4_translit(gltype,[abcdefghijklmnopqrstuvwxyz ],[ABCDEFGHIJKLMNOPQRSTUVWXYZ_])[_SUFFIX],
[Define to l, ll, u, ul, ull, etc., as suitable for
constants of type ']gltype['.])])
for gltype in $1 ; do
@@ -419,7 +419,7 @@ AC_DEFUN([gl_INTEGER_TYPE_SUFFIX],
AC_DEFINE_UNQUOTED([${GLTYPE}_SUFFIX], [$result])
done
m4_foreach_w([gltype], [$1],
- [AC_SUBST(translit(gltype,[abcdefghijklmnopqrstuvwxyz ],[ABCDEFGHIJKLMNOPQRSTUVWXYZ_])[_SUFFIX])])
+ [AC_SUBST(m4_translit(gltype,[abcdefghijklmnopqrstuvwxyz ],[ABCDEFGHIJKLMNOPQRSTUVWXYZ_])[_SUFFIX])])
])
dnl gl_STDINT_INCLUDES
diff --git a/gnulib/m4/stdio_h.m4 b/gnulib/m4/stdio_h.m4
index 1d1d95e5..f5650cde 100644
--- a/gnulib/m4/stdio_h.m4
+++ b/gnulib/m4/stdio_h.m4
@@ -1,4 +1,4 @@
-# stdio_h.m4 serial 30
+# stdio_h.m4 serial 31
dnl Copyright (C) 2007-2010 Free Software Foundation, Inc.
dnl This file is free software; the Free Software Foundation
dnl gives unlimited permission to copy and/or distribute it,
@@ -8,6 +8,7 @@ AC_DEFUN([gl_STDIO_H],
[
AC_REQUIRE([gl_STDIO_H_DEFAULTS])
AC_REQUIRE([AC_C_INLINE])
+ AC_REQUIRE([gl_ASM_SYMBOL_PREFIX])
gl_CHECK_NEXT_HEADERS([stdio.h])
dnl No need to create extra modules for these functions. Everyone who uses
dnl <stdio.h> likely needs them.
diff --git a/gnulib/m4/string_h.m4 b/gnulib/m4/string_h.m4
index cf26123e..1977aecf 100644
--- a/gnulib/m4/string_h.m4
+++ b/gnulib/m4/string_h.m4
@@ -5,7 +5,7 @@
# gives unlimited permission to copy and/or distribute it,
# with or without modifications, as long as this notice is preserved.
-# serial 16
+# serial 17
# Written by Paul Eggert.
@@ -105,6 +105,7 @@ AC_DEFUN([gl_HEADER_STRING_H_DEFAULTS],
REPLACE_STRERROR=0; AC_SUBST([REPLACE_STRERROR])
REPLACE_STRNCAT=0; AC_SUBST([REPLACE_STRNCAT])
REPLACE_STRNDUP=0; AC_SUBST([REPLACE_STRNDUP])
+ REPLACE_STRNLEN=0; AC_SUBST([REPLACE_STRNLEN])
REPLACE_STRSIGNAL=0; AC_SUBST([REPLACE_STRSIGNAL])
REPLACE_STRTOK_R=0; AC_SUBST([REPLACE_STRTOK_R])
UNDEFINE_STRTOK_R=0; AC_SUBST([UNDEFINE_STRTOK_R])
diff --git a/gnulib/m4/strnlen.m4 b/gnulib/m4/strnlen.m4
index cd48948f..52bb838f 100644
--- a/gnulib/m4/strnlen.m4
+++ b/gnulib/m4/strnlen.m4
@@ -1,4 +1,4 @@
-# strnlen.m4 serial 10
+# strnlen.m4 serial 12
dnl Copyright (C) 2002-2003, 2005-2007, 2009-2010 Free Software Foundation,
dnl Inc.
dnl This file is free software; the Free Software Foundation
@@ -7,23 +7,23 @@ dnl with or without modifications, as long as this notice is preserved.
AC_DEFUN([gl_FUNC_STRNLEN],
[
+ AC_REQUIRE([gl_HEADER_STRING_H_DEFAULTS])
+
dnl Persuade glibc <string.h> to declare strnlen().
AC_REQUIRE([AC_USE_SYSTEM_EXTENSIONS])
- AC_REQUIRE([gl_HEADER_STRING_H_DEFAULTS])
AC_CHECK_DECLS_ONCE([strnlen])
if test $ac_cv_have_decl_strnlen = no; then
HAVE_DECL_STRNLEN=0
+ else
+ AC_FUNC_STRNLEN
+ dnl Note: AC_FUNC_STRNLEN does AC_LIBOBJ([strnlen]).
+ if test $ac_cv_func_strnlen_working = no; then
+ REPLACE_STRNLEN=1
+ fi
fi
-
- AC_FUNC_STRNLEN
- if test $ac_cv_func_strnlen_working = no; then
- # This is necessary because automake-1.6.1 doesn't understand
- # that the above use of AC_FUNC_STRNLEN means we may have to use
- # lib/strnlen.c.
- #AC_LIBOBJ([strnlen])
- AC_DEFINE([strnlen], [rpl_strnlen],
- [Define to rpl_strnlen if the replacement function should be used.])
+ if test $HAVE_DECL_STRNLEN = 0 || test $REPLACE_STRNLEN = 1; then
+ AC_LIBOBJ([strnlen])
gl_PREREQ_STRNLEN
fi
])
diff --git a/gnulib/m4/time_h.m4 b/gnulib/m4/time_h.m4
index b88ba94d..a45a10a9 100644
--- a/gnulib/m4/time_h.m4
+++ b/gnulib/m4/time_h.m4
@@ -2,6 +2,8 @@
# Copyright (C) 2000-2001, 2003-2007, 2009-2010 Free Software Foundation, Inc.
+# serial 2
+
# This file is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
# with or without modifications, as long as this notice is preserved.
@@ -24,7 +26,7 @@ AC_DEFUN([gl_HEADER_TIME_H_BODY],
])
dnl Define HAVE_STRUCT_TIMESPEC if `struct timespec' is declared
-dnl in time.h or sys/time.h.
+dnl in time.h, sys/time.h, or pthread.h.
AC_DEFUN([gl_CHECK_TYPE_STRUCT_TIMESPEC],
[
@@ -41,6 +43,7 @@ AC_DEFUN([gl_CHECK_TYPE_STRUCT_TIMESPEC],
TIME_H_DEFINES_STRUCT_TIMESPEC=0
SYS_TIME_H_DEFINES_STRUCT_TIMESPEC=0
+ PTHREAD_H_DEFINES_STRUCT_TIMESPEC=0
if test $gl_cv_sys_struct_timespec_in_time_h = yes; then
TIME_H_DEFINES_STRUCT_TIMESPEC=1
else
@@ -55,10 +58,24 @@ AC_DEFUN([gl_CHECK_TYPE_STRUCT_TIMESPEC],
[gl_cv_sys_struct_timespec_in_sys_time_h=no])])
if test $gl_cv_sys_struct_timespec_in_sys_time_h = yes; then
SYS_TIME_H_DEFINES_STRUCT_TIMESPEC=1
+ else
+ AC_CACHE_CHECK([for struct timespec in <pthread.h>],
+ [gl_cv_sys_struct_timespec_in_pthread_h],
+ [AC_COMPILE_IFELSE(
+ [AC_LANG_PROGRAM(
+ [[#include <pthread.h>
+ ]],
+ [[static struct timespec x; x.tv_sec = x.tv_nsec;]])],
+ [gl_cv_sys_struct_timespec_in_pthread_h=yes],
+ [gl_cv_sys_struct_timespec_in_pthread_h=no])])
+ if test $gl_cv_sys_struct_timespec_in_pthread_h = yes; then
+ PTHREAD_H_DEFINES_STRUCT_TIMESPEC=1
+ fi
fi
fi
AC_SUBST([TIME_H_DEFINES_STRUCT_TIMESPEC])
AC_SUBST([SYS_TIME_H_DEFINES_STRUCT_TIMESPEC])
+ AC_SUBST([PTHREAD_H_DEFINES_STRUCT_TIMESPEC])
])
AC_DEFUN([gl_TIME_MODULE_INDICATOR],
diff --git a/gnulib/m4/unistd_h.m4 b/gnulib/m4/unistd_h.m4
index 8c2eec64..48d06c74 100644
--- a/gnulib/m4/unistd_h.m4
+++ b/gnulib/m4/unistd_h.m4
@@ -1,4 +1,4 @@
-# unistd_h.m4 serial 45
+# unistd_h.m4 serial 46
dnl Copyright (C) 2006-2010 Free Software Foundation, Inc.
dnl This file is free software; the Free Software Foundation
dnl gives unlimited permission to copy and/or distribute it,
@@ -38,8 +38,9 @@ AC_DEFUN([gl_UNISTD_H],
]], [chown dup2 dup3 environ euidaccess faccessat fchdir fchownat
fsync ftruncate getcwd getdomainname getdtablesize getgroups
gethostname getlogin getlogin_r getpagesize getusershell setusershell
- endusershell lchown link linkat lseek pipe2 pread readlink readlinkat
- rmdir sleep symlink symlinkat ttyname_r unlink unlinkat usleep])
+ endusershell lchown link linkat lseek pipe2 pread pwrite readlink
+ readlinkat rmdir sleep symlink symlinkat ttyname_r unlink unlinkat
+ usleep])
])
AC_DEFUN([gl_UNISTD_MODULE_INDICATOR],
@@ -79,6 +80,7 @@ AC_DEFUN([gl_UNISTD_H_DEFAULTS],
GNULIB_LSEEK=0; AC_SUBST([GNULIB_LSEEK])
GNULIB_PIPE2=0; AC_SUBST([GNULIB_PIPE2])
GNULIB_PREAD=0; AC_SUBST([GNULIB_PREAD])
+ GNULIB_PWRITE=0; AC_SUBST([GNULIB_PWRITE])
GNULIB_READLINK=0; AC_SUBST([GNULIB_READLINK])
GNULIB_READLINKAT=0; AC_SUBST([GNULIB_READLINKAT])
GNULIB_RMDIR=0; AC_SUBST([GNULIB_RMDIR])
@@ -113,6 +115,7 @@ AC_DEFUN([gl_UNISTD_H_DEFAULTS],
HAVE_LINKAT=1; AC_SUBST([HAVE_LINKAT])
HAVE_PIPE2=1; AC_SUBST([HAVE_PIPE2])
HAVE_PREAD=1; AC_SUBST([HAVE_PREAD])
+ HAVE_PWRITE=1; AC_SUBST([HAVE_PWRITE])
HAVE_READLINK=1; AC_SUBST([HAVE_READLINK])
HAVE_READLINKAT=1; AC_SUBST([HAVE_READLINKAT])
HAVE_SLEEP=1; AC_SUBST([HAVE_SLEEP])
@@ -140,10 +143,12 @@ AC_DEFUN([gl_UNISTD_H_DEFAULTS],
REPLACE_LINKAT=0; AC_SUBST([REPLACE_LINKAT])
REPLACE_LSEEK=0; AC_SUBST([REPLACE_LSEEK])
REPLACE_PREAD=0; AC_SUBST([REPLACE_PREAD])
+ REPLACE_PWRITE=0; AC_SUBST([REPLACE_PWRITE])
REPLACE_READLINK=0; AC_SUBST([REPLACE_READLINK])
REPLACE_RMDIR=0; AC_SUBST([REPLACE_RMDIR])
REPLACE_SLEEP=0; AC_SUBST([REPLACE_SLEEP])
REPLACE_SYMLINK=0; AC_SUBST([REPLACE_SYMLINK])
+ REPLACE_TTYNAME_R=0; AC_SUBST([REPLACE_TTYNAME_R])
REPLACE_UNLINK=0; AC_SUBST([REPLACE_UNLINK])
REPLACE_UNLINKAT=0; AC_SUBST([REPLACE_UNLINKAT])
REPLACE_USLEEP=0; AC_SUBST([REPLACE_USLEEP])
diff --git a/gnulib/m4/visibility.m4 b/gnulib/m4/visibility.m4
index 6d3f9c9d..077c4765 100644
--- a/gnulib/m4/visibility.m4
+++ b/gnulib/m4/visibility.m4
@@ -1,4 +1,4 @@
-# visibility.m4 serial 2 (gettext-0.18)
+# visibility.m4 serial 3 (gettext-0.18)
dnl Copyright (C) 2005, 2008-2010 Free Software Foundation, Inc.
dnl This file is free software; the Free Software Foundation
dnl gives unlimited permission to copy and/or distribute it,
@@ -26,15 +26,37 @@ AC_DEFUN([gl_VISIBILITY],
CFLAG_VISIBILITY=
HAVE_VISIBILITY=0
if test -n "$GCC"; then
+ dnl First, check whether -Werror can be added to the command line, or
+ dnl whether it leads to an error because of some other option that the
+ dnl user has put into $CC $CFLAGS $CPPFLAGS.
+ AC_MSG_CHECKING([whether the -Werror option is usable])
+ AC_CACHE_VAL([gl_cv_cc_vis_werror], [
+ gl_save_CFLAGS="$CFLAGS"
+ CFLAGS="$CFLAGS -Werror"
+ AC_TRY_COMPILE([], [],
+ [gl_cv_cc_vis_werror=yes],
+ [gl_cv_cc_vis_werror=no])
+ CFLAGS="$gl_save_CFLAGS"])
+ AC_MSG_RESULT([$gl_cv_cc_vis_werror])
+ dnl Now check whether visibility declarations are supported.
AC_MSG_CHECKING([for simple visibility declarations])
AC_CACHE_VAL([gl_cv_cc_visibility], [
gl_save_CFLAGS="$CFLAGS"
CFLAGS="$CFLAGS -fvisibility=hidden"
+ dnl We use the option -Werror and a function dummyfunc, because on some
+ dnl platforms (Cygwin 1.7) the use of -fvisibility triggers a warning
+ dnl "visibility attribute not supported in this configuration; ignored"
+ dnl at the first function definition in every compilation unit, and we
+ dnl don't want to use the option in this case.
+ if test $gl_cv_cc_vis_werror = yes; then
+ CFLAGS="$CFLAGS -Werror"
+ fi
AC_TRY_COMPILE(
[extern __attribute__((__visibility__("hidden"))) int hiddenvar;
extern __attribute__((__visibility__("default"))) int exportedvar;
extern __attribute__((__visibility__("hidden"))) int hiddenfunc (void);
- extern __attribute__((__visibility__("default"))) int exportedfunc (void);],
+ extern __attribute__((__visibility__("default"))) int exportedfunc (void);
+ void dummyfunc (void) {}],
[],
[gl_cv_cc_visibility=yes],
[gl_cv_cc_visibility=no])
diff --git a/intl/ChangeLog b/intl/ChangeLog
index 3ec9081d..d3ff4a18 100644
--- a/intl/ChangeLog
+++ b/intl/ChangeLog
@@ -1,4 +1,4 @@
-2007-11-07 GNU <bug-gnu-gettext@gnu.org>
+2010-06-04 GNU <bug-gnu-gettext@gnu.org>
- * Version 0.17 released.
+ * Version 0.18.1 released.
diff --git a/intl/Makefile.in b/intl/Makefile.in
index cfed0859..2e53ccca 100644
--- a/intl/Makefile.in
+++ b/intl/Makefile.in
@@ -1,5 +1,5 @@
# Makefile for directory with message catalog handling library of GNU gettext
-# Copyright (C) 1995-1998, 2000-2007 Free Software Foundation, Inc.
+# Copyright (C) 1995-1998, 2000-2007, 2009-2010 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
@@ -72,7 +72,30 @@ LIBTOOL = @LIBTOOL@
RANLIB = @RANLIB@
YACC = @INTLBISON@ -y -d
YFLAGS = --name-prefix=__gettext
+# Windows resource compiler (windres). Used when libtool is not used.
WINDRES = @WINDRES@
+# Windows resource compiler (windres). Used via libtool.
+RC = @RC@
+
+# Support for silent-rules.
+AM_V_at = $(am__v_at_$(V))
+am__v_at_ = $(am__v_at_@INTL_DEFAULT_VERBOSITY@)
+am__v_at_0 = @
+AM_V_AR = $(am__v_AR_$(V))
+am__v_AR_ = $(am__v_AR_@INTL_DEFAULT_VERBOSITY@)
+am__v_AR_0 = @echo " AR " $@;
+AM_V_CC = $(am__v_CC_$(V))
+am__v_CC_ = $(am__v_CC_@INTL_DEFAULT_VERBOSITY@)
+am__v_CC_0 = @echo " CC " $@;
+AM_V_GEN = $(am__v_GEN_$(V))
+am__v_GEN_ = $(am__v_GEN_@INTL_DEFAULT_VERBOSITY@)
+am__v_GEN_0 = @echo " GEN " $@;
+AM_V_YACC = $(am__v_YACC_$(V))
+am__v_YACC_ = $(am__v_YACC_@INTL_DEFAULT_VERBOSITY@)
+am__v_YACC_0 = @echo " YACC " $@;
+AM_V_lt = $(am__v_lt_$(V))
+am__v_lt_ = $(am__v_lt_@INTL_DEFAULT_VERBOSITY@)
+am__v_lt_0 = --silent
# -DBUILDING_LIBINTL: Change expansion of LIBINTL_DLL_EXPORTED macro.
# -DBUILDING_DLL: Change expansion of RELOCATABLE_DLL_EXPORTED macro.
@@ -127,12 +150,14 @@ SOURCES = \
plural.y \
plural-exp.c \
localcharset.c \
+ threadlib.c \
lock.c \
relocatable.c \
langprefs.c \
localename.c \
log.c \
printf.c \
+ setlocale.c \
version.c \
osdep.c \
os2compat.c \
@@ -157,16 +182,18 @@ OBJECTS = \
plural.$lo \
plural-exp.$lo \
localcharset.$lo \
+ threadlib.$lo \
lock.$lo \
relocatable.$lo \
langprefs.$lo \
localename.$lo \
log.$lo \
printf.$lo \
+ setlocale.$lo \
version.$lo \
osdep.$lo \
intl-compat.$lo
-OBJECTS_RES_yes = libintl.res
+OBJECTS_RES_yes = libintl.res.$lo
OBJECTS_RES_no =
DISTFILES.common = Makefile.in \
config.charset locale.alias ref-add.sin ref-del.sin export.h libintl.rc \
@@ -186,12 +213,12 @@ all-no-yes: libgnuintl.$la
all-no-no:
libintl.a libgnuintl.a: $(OBJECTS)
- rm -f $@
- $(AR) cru $@ $(OBJECTS)
- $(RANLIB) $@
+ $(AM_V_at)rm -f $@
+ $(AM_V_AR)$(AR) cru $@ $(OBJECTS)
+ $(AM_V_at)$(RANLIB) $@
libintl.la libgnuintl.la: $(OBJECTS) $(OBJECTS_RES_@WOE32@)
- $(LIBTOOL) --mode=link \
+ $(AM_V_GEN)$(LIBTOOL) $(AM_V_lt) --tag=CC --mode=link \
$(CC) $(CPPFLAGS) $(CFLAGS) $(XCFLAGS) $(LDFLAGS) -o $@ \
$(OBJECTS) @LTLIBICONV@ @INTL_MACOSX_LIBS@ $(LIBS) @LTLIBTHREAD@ @LTLIBC@ \
$(OBJECTS_RES_@WOE32@) \
@@ -204,83 +231,86 @@ libintl.la libgnuintl.la: $(OBJECTS) $(OBJECTS_RES_@WOE32@)
# 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=8
-LTV_REVISION=2
-LTV_AGE=0
+LTV_CURRENT=9
+LTV_REVISION=1
+LTV_AGE=1
.SUFFIXES:
.SUFFIXES: .c .y .o .lo .sin .sed
.c.o:
- $(COMPILE) $<
+ $(AM_V_CC)$(COMPILE) $<
.y.c:
- $(YACC) $(YFLAGS) --output $@ $<
- rm -f $*.h
+ $(AM_V_YACC)$(YACC) $(YFLAGS) --output $@ $<
+ $(AM_V_at)rm -f $*.h
bindtextdom.lo: $(srcdir)/bindtextdom.c
- $(LIBTOOL) --mode=compile $(COMPILE) $(srcdir)/bindtextdom.c
+ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC --mode=compile $(COMPILE) $(srcdir)/bindtextdom.c
dcgettext.lo: $(srcdir)/dcgettext.c
- $(LIBTOOL) --mode=compile $(COMPILE) $(srcdir)/dcgettext.c
+ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC --mode=compile $(COMPILE) $(srcdir)/dcgettext.c
dgettext.lo: $(srcdir)/dgettext.c
- $(LIBTOOL) --mode=compile $(COMPILE) $(srcdir)/dgettext.c
+ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC --mode=compile $(COMPILE) $(srcdir)/dgettext.c
gettext.lo: $(srcdir)/gettext.c
- $(LIBTOOL) --mode=compile $(COMPILE) $(srcdir)/gettext.c
+ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC --mode=compile $(COMPILE) $(srcdir)/gettext.c
finddomain.lo: $(srcdir)/finddomain.c
- $(LIBTOOL) --mode=compile $(COMPILE) $(srcdir)/finddomain.c
+ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC --mode=compile $(COMPILE) $(srcdir)/finddomain.c
hash-string.lo: $(srcdir)/hash-string.c
- $(LIBTOOL) --mode=compile $(COMPILE) $(srcdir)/hash-string.c
+ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC --mode=compile $(COMPILE) $(srcdir)/hash-string.c
loadmsgcat.lo: $(srcdir)/loadmsgcat.c
- $(LIBTOOL) --mode=compile $(COMPILE) $(srcdir)/loadmsgcat.c
+ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC --mode=compile $(COMPILE) $(srcdir)/loadmsgcat.c
localealias.lo: $(srcdir)/localealias.c
- $(LIBTOOL) --mode=compile $(COMPILE) $(srcdir)/localealias.c
+ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC --mode=compile $(COMPILE) $(srcdir)/localealias.c
textdomain.lo: $(srcdir)/textdomain.c
- $(LIBTOOL) --mode=compile $(COMPILE) $(srcdir)/textdomain.c
+ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC --mode=compile $(COMPILE) $(srcdir)/textdomain.c
l10nflist.lo: $(srcdir)/l10nflist.c
- $(LIBTOOL) --mode=compile $(COMPILE) $(srcdir)/l10nflist.c
+ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC --mode=compile $(COMPILE) $(srcdir)/l10nflist.c
explodename.lo: $(srcdir)/explodename.c
- $(LIBTOOL) --mode=compile $(COMPILE) $(srcdir)/explodename.c
+ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC --mode=compile $(COMPILE) $(srcdir)/explodename.c
dcigettext.lo: $(srcdir)/dcigettext.c
- $(LIBTOOL) --mode=compile $(COMPILE) $(srcdir)/dcigettext.c
+ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC --mode=compile $(COMPILE) $(srcdir)/dcigettext.c
dcngettext.lo: $(srcdir)/dcngettext.c
- $(LIBTOOL) --mode=compile $(COMPILE) $(srcdir)/dcngettext.c
+ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC --mode=compile $(COMPILE) $(srcdir)/dcngettext.c
dngettext.lo: $(srcdir)/dngettext.c
- $(LIBTOOL) --mode=compile $(COMPILE) $(srcdir)/dngettext.c
+ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC --mode=compile $(COMPILE) $(srcdir)/dngettext.c
ngettext.lo: $(srcdir)/ngettext.c
- $(LIBTOOL) --mode=compile $(COMPILE) $(srcdir)/ngettext.c
+ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC --mode=compile $(COMPILE) $(srcdir)/ngettext.c
plural.lo: $(srcdir)/plural.c
- $(LIBTOOL) --mode=compile $(COMPILE) $(srcdir)/plural.c
+ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC --mode=compile $(COMPILE) $(srcdir)/plural.c
plural-exp.lo: $(srcdir)/plural-exp.c
- $(LIBTOOL) --mode=compile $(COMPILE) $(srcdir)/plural-exp.c
+ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC --mode=compile $(COMPILE) $(srcdir)/plural-exp.c
localcharset.lo: $(srcdir)/localcharset.c
- $(LIBTOOL) --mode=compile $(COMPILE) $(srcdir)/localcharset.c
+ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC --mode=compile $(COMPILE) $(srcdir)/localcharset.c
+threadlib.lo: $(srcdir)/threadlib.c
+ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC --mode=compile $(COMPILE) $(srcdir)/threadlib.c
lock.lo: $(srcdir)/lock.c
- $(LIBTOOL) --mode=compile $(COMPILE) $(srcdir)/lock.c
+ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC --mode=compile $(COMPILE) $(srcdir)/lock.c
relocatable.lo: $(srcdir)/relocatable.c
- $(LIBTOOL) --mode=compile $(COMPILE) $(srcdir)/relocatable.c
+ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC --mode=compile $(COMPILE) $(srcdir)/relocatable.c
langprefs.lo: $(srcdir)/langprefs.c
- $(LIBTOOL) --mode=compile $(COMPILE) $(srcdir)/langprefs.c
+ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC --mode=compile $(COMPILE) $(srcdir)/langprefs.c
localename.lo: $(srcdir)/localename.c
- $(LIBTOOL) --mode=compile $(COMPILE) $(srcdir)/localename.c
+ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC --mode=compile $(COMPILE) $(srcdir)/localename.c
log.lo: $(srcdir)/log.c
- $(LIBTOOL) --mode=compile $(COMPILE) $(srcdir)/log.c
+ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC --mode=compile $(COMPILE) $(srcdir)/log.c
printf.lo: $(srcdir)/printf.c
- $(LIBTOOL) --mode=compile $(COMPILE) $(srcdir)/printf.c
+ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC --mode=compile $(COMPILE) $(srcdir)/printf.c
+setlocale.lo: $(srcdir)/setlocale.c
+ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC --mode=compile $(COMPILE) $(srcdir)/setlocale.c
version.lo: $(srcdir)/version.c
- $(LIBTOOL) --mode=compile $(COMPILE) $(srcdir)/version.c
+ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC --mode=compile $(COMPILE) $(srcdir)/version.c
osdep.lo: $(srcdir)/osdep.c
- $(LIBTOOL) --mode=compile $(COMPILE) $(srcdir)/osdep.c
+ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC --mode=compile $(COMPILE) $(srcdir)/osdep.c
intl-compat.lo: $(srcdir)/intl-compat.c
- $(LIBTOOL) --mode=compile $(COMPILE) $(srcdir)/intl-compat.c
+ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC --mode=compile $(COMPILE) $(srcdir)/intl-compat.c
# This rule is executed only on Woe32 systems.
# The following sed expressions come from the windres-options script. They are
# inlined here, so that they can be written in a Makefile without requiring a
# temporary file. They must contain literal newlines rather than semicolons,
-# so that they work with the sed-3.02 that is shipped with MSYS. We can use
-# GNU bash's $'\n' syntax to obtain such a newline.
-libintl.res: $(srcdir)/libintl.rc
- nl=$$'\n'; \
+# so that they work with the sed-3.02 that is shipped with MSYS.
+libintl.res.o: $(srcdir)/libintl.rc
+ nlinit=`echo 'nl="'; echo '"'`; eval "$$nlinit"; \
sed_extract_major='/^[0-9]/{'$${nl}'s/^\([0-9]*\).*/\1/p'$${nl}q$${nl}'}'$${nl}'c\'$${nl}0$${nl}q; \
sed_extract_minor='/^[0-9][0-9]*[.][0-9]/{'$${nl}'s/^[0-9]*[.]\([0-9]*\).*/\1/p'$${nl}q$${nl}'}'$${nl}'c\'$${nl}0$${nl}q; \
sed_extract_subminor='/^[0-9][0-9]*[.][0-9][0-9]*[.][0-9]/{'$${nl}'s/^[0-9]*[.][0-9]*[.]\([0-9]*\).*/\1/p'$${nl}q$${nl}'}'$${nl}'c\'$${nl}0$${nl}q; \
@@ -289,7 +319,18 @@ libintl.res: $(srcdir)/libintl.rc
"-DPACKAGE_VERSION_MAJOR="`echo '$(VERSION)' | sed -n -e "$$sed_extract_major"` \
"-DPACKAGE_VERSION_MINOR="`echo '$(VERSION)' | sed -n -e "$$sed_extract_minor"` \
"-DPACKAGE_VERSION_SUBMINOR="`echo '$(VERSION)' | sed -n -e "$$sed_extract_subminor"` \
- -i $(srcdir)/libintl.rc -o libintl.res --output-format=coff
+ -i $(srcdir)/libintl.rc -o libintl.res.o --output-format=coff
+libintl.res.lo: $(srcdir)/libintl.rc
+ nlinit=`echo 'nl="'; echo '"'`; eval "$$nlinit"; \
+ sed_extract_major='/^[0-9]/{'$${nl}'s/^\([0-9]*\).*/\1/p'$${nl}q$${nl}'}'$${nl}'c\'$${nl}0$${nl}q; \
+ sed_extract_minor='/^[0-9][0-9]*[.][0-9]/{'$${nl}'s/^[0-9]*[.]\([0-9]*\).*/\1/p'$${nl}q$${nl}'}'$${nl}'c\'$${nl}0$${nl}q; \
+ sed_extract_subminor='/^[0-9][0-9]*[.][0-9][0-9]*[.][0-9]/{'$${nl}'s/^[0-9]*[.][0-9]*[.]\([0-9]*\).*/\1/p'$${nl}q$${nl}'}'$${nl}'c\'$${nl}0$${nl}q; \
+ $(LIBTOOL) --mode=compile --tag=RC $(RC) \
+ "-DPACKAGE_VERSION_STRING=\\\"$(VERSION)\\\"" \
+ "-DPACKAGE_VERSION_MAJOR="`echo '$(VERSION)' | sed -n -e "$$sed_extract_major"` \
+ "-DPACKAGE_VERSION_MINOR="`echo '$(VERSION)' | sed -n -e "$$sed_extract_minor"` \
+ "-DPACKAGE_VERSION_SUBMINOR="`echo '$(VERSION)' | sed -n -e "$$sed_extract_subminor"` \
+ -i $(srcdir)/libintl.rc -o libintl.res.lo --output-format=coff
ref-add.sed: $(srcdir)/ref-add.sin
sed -e '/^#/d' -e 's/@''PACKAGE''@/@PACKAGE@/g' $(srcdir)/ref-add.sin > t-ref-add.sed
@@ -304,6 +345,7 @@ libgnuintl.h: $(srcdir)/libgnuintl.h.in
sed -e '/IN_LIBGLOCALE/d' \
-e 's,@''HAVE_POSIX_PRINTF''@,@HAVE_POSIX_PRINTF@,g' \
-e 's,@''HAVE_ASPRINTF''@,@HAVE_ASPRINTF@,g' \
+ -e 's,@''HAVE_NEWLOCALE''@,@HAVE_NEWLOCALE@,g' \
-e 's,@''HAVE_SNPRINTF''@,@HAVE_SNPRINTF@,g' \
-e 's,@''HAVE_WPRINTF''@,@HAVE_WPRINTF@,g' \
< $(srcdir)/libgnuintl.h.in \
@@ -321,6 +363,7 @@ libintl.h: $(srcdir)/libgnuintl.h.in
sed -e '/IN_LIBGLOCALE/d' \
-e 's,@''HAVE_POSIX_PRINTF''@,@HAVE_POSIX_PRINTF@,g' \
-e 's,@''HAVE_ASPRINTF''@,@HAVE_ASPRINTF@,g' \
+ -e 's,@''HAVE_NEWLOCALE''@,@HAVE_NEWLOCALE@,g' \
-e 's,@''HAVE_SNPRINTF''@,@HAVE_SNPRINTF@,g' \
-e 's,@''HAVE_WPRINTF''@,@HAVE_WPRINTF@,g' \
< $(srcdir)/libgnuintl.h.in > libintl.h
@@ -367,7 +410,21 @@ install-exec: all
: ; \
fi
if test '@USE_INCLUDED_LIBINTL@' = yes; then \
- test @GLIBC21@ != no || $(mkdir_p) $(DESTDIR)$(libdir); \
+ if test @GLIBC21@ = no; then \
+ case '@host_os@' in \
+ darwin[56]*) \
+ need_charset_alias=true ;; \
+ darwin* | cygwin* | mingw* | pw32* | cegcc*) \
+ need_charset_alias=false ;; \
+ *) \
+ need_charset_alias=true ;; \
+ esac; \
+ else \
+ need_charset_alias=false; \
+ fi; \
+ if $$need_charset_alias; then \
+ $(mkdir_p) $(DESTDIR)$(libdir); \
+ fi; \
temp=$(DESTDIR)$(libdir)/t-charset.alias; \
dest=$(DESTDIR)$(libdir)/charset.alias; \
if test -f $(DESTDIR)$(libdir)/charset.alias; then \
@@ -376,7 +433,7 @@ install-exec: all
$(INSTALL_DATA) $$temp $$dest; \
rm -f $$temp; \
else \
- if test @GLIBC21@ = no; then \
+ if $$need_charset_alias; then \
orig=charset.alias; \
sed -f ref-add.sed $$orig > $$temp; \
$(INSTALL_DATA) $$temp $$dest; \
@@ -439,7 +496,21 @@ installdirs:
: ; \
fi
if test '@USE_INCLUDED_LIBINTL@' = yes; then \
- test @GLIBC21@ != no || $(mkdir_p) $(DESTDIR)$(libdir); \
+ if test @GLIBC21@ = no; then \
+ case '@host_os@' in \
+ darwin[56]*) \
+ need_charset_alias=true ;; \
+ darwin* | cygwin* | mingw* | pw32* | cegcc*) \
+ need_charset_alias=false ;; \
+ *) \
+ need_charset_alias=true ;; \
+ esac; \
+ else \
+ need_charset_alias=false; \
+ fi; \
+ if $$need_charset_alias; then \
+ $(mkdir_p) $(DESTDIR)$(libdir); \
+ fi; \
$(mkdir_p) $(DESTDIR)$(localedir); \
else \
: ; \
@@ -506,7 +577,8 @@ uninstall:
info dvi ps pdf html:
$(OBJECTS): ../config.h libgnuintl.h
-bindtextdom.$lo dcgettext.$lo dcigettext.$lo dcngettext.$lo dgettext.$lo dngettext.$lo finddomain.$lo gettext.$lo intl-compat.$lo loadmsgcat.$lo localealias.$lo ngettext.$lo textdomain.$lo: $(srcdir)/gettextP.h $(srcdir)/gmo.h $(srcdir)/loadinfo.h
+bindtextdom.$lo dcgettext.$lo dcigettext.$lo dcngettext.$lo dgettext.$lo dngettext.$lo finddomain.$lo gettext.$lo intl-compat.$lo loadmsgcat.$lo localealias.$lo ngettext.$lo setlocale.$lo textdomain.$lo: $(srcdir)/gettextP.h $(srcdir)/gmo.h $(srcdir)/loadinfo.h
+localename.$lo: $(srcdir)/gettextP.h
hash-string.$lo dcigettext.$lo loadmsgcat.$lo: $(srcdir)/hash-string.h
explodename.$lo l10nflist.$lo: $(srcdir)/loadinfo.h
dcigettext.$lo loadmsgcat.$lo plural.$lo plural-exp.$lo: $(srcdir)/plural-exp.h
@@ -538,7 +610,7 @@ ID: $(HEADERS) $(SOURCES)
mostlyclean:
- rm -f *.a *.la *.o *.obj *.lo libintl.res core core.*
+ rm -f *.a *.la *.o *.obj *.lo core core.*
rm -f libgnuintl.h libintl.h charset.alias ref-add.sed ref-del.sed
rm -f -r .libs _libs
diff --git a/intl/VERSION b/intl/VERSION
index 889d4e9a..a194334d 100644
--- a/intl/VERSION
+++ b/intl/VERSION
@@ -1 +1 @@
-GNU gettext library from gettext-0.17
+GNU gettext library from gettext-0.18.1
diff --git a/intl/bindtextdom.c b/intl/bindtextdom.c
index dab5d4f3..54ce061e 100644
--- a/intl/bindtextdom.c
+++ b/intl/bindtextdom.c
@@ -1,5 +1,6 @@
/* Implementation of the bindtextdomain(3) function
- Copyright (C) 1995-1998, 2000-2003, 2005-2006 Free Software Foundation, Inc.
+ Copyright (C) 1995-1998, 2000-2003, 2005-2006, 2008 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
@@ -178,8 +179,7 @@ set_binding_values (const char *domainname,
if (__builtin_expect (result != NULL, 1))
{
- if (binding->codeset != NULL)
- free (binding->codeset);
+ free (binding->codeset);
binding->codeset = result;
modified = 1;
diff --git a/intl/config.charset b/intl/config.charset
index e8c258b3..b9dccbb9 100755
--- a/intl/config.charset
+++ b/intl/config.charset
@@ -1,7 +1,7 @@
#! /bin/sh
# Output a system dependent table of character encoding aliases.
#
-# Copyright (C) 2000-2004, 2006 Free Software Foundation, Inc.
+# Copyright (C) 2000-2004, 2006-2010 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
@@ -31,21 +31,21 @@
# The current list of GNU canonical charset names is as follows.
#
# name MIME? used by which systems
-# ASCII, ANSI_X3.4-1968 glibc solaris freebsd netbsd darwin
-# ISO-8859-1 Y glibc aix hpux irix osf solaris freebsd netbsd darwin
-# ISO-8859-2 Y glibc aix hpux irix osf solaris freebsd netbsd darwin
-# ISO-8859-3 Y glibc solaris
-# ISO-8859-4 Y osf solaris freebsd netbsd darwin
-# ISO-8859-5 Y glibc aix hpux irix osf solaris freebsd netbsd darwin
-# ISO-8859-6 Y glibc aix hpux solaris
-# ISO-8859-7 Y glibc aix hpux irix osf solaris netbsd darwin
-# ISO-8859-8 Y glibc aix hpux osf solaris
-# ISO-8859-9 Y glibc aix hpux irix osf solaris darwin
-# ISO-8859-13 glibc netbsd darwin
-# ISO-8859-14 glibc
-# ISO-8859-15 glibc aix osf solaris freebsd darwin
-# KOI8-R Y glibc solaris freebsd netbsd darwin
-# KOI8-U Y glibc freebsd netbsd darwin
+# ASCII, ANSI_X3.4-1968 glibc solaris freebsd netbsd darwin cygwin
+# ISO-8859-1 Y glibc aix hpux irix osf solaris freebsd netbsd openbsd darwin cygwin
+# ISO-8859-2 Y glibc aix hpux irix osf solaris freebsd netbsd openbsd darwin cygwin
+# ISO-8859-3 Y glibc solaris cygwin
+# ISO-8859-4 Y osf solaris freebsd netbsd openbsd darwin
+# ISO-8859-5 Y glibc aix hpux irix osf solaris freebsd netbsd openbsd darwin cygwin
+# ISO-8859-6 Y glibc aix hpux solaris cygwin
+# ISO-8859-7 Y glibc aix hpux irix osf solaris netbsd openbsd darwin cygwin
+# ISO-8859-8 Y glibc aix hpux osf solaris cygwin
+# ISO-8859-9 Y glibc aix hpux irix osf solaris darwin cygwin
+# ISO-8859-13 glibc netbsd openbsd darwin cygwin
+# ISO-8859-14 glibc cygwin
+# ISO-8859-15 glibc aix osf solaris freebsd netbsd openbsd darwin cygwin
+# KOI8-R Y glibc solaris freebsd netbsd openbsd darwin
+# KOI8-U Y glibc freebsd netbsd openbsd darwin cygwin
# KOI8-T glibc
# CP437 dos
# CP775 dos
@@ -58,20 +58,21 @@
# CP862 dos
# CP864 dos
# CP865 dos
-# CP866 freebsd netbsd darwin dos
+# CP866 freebsd netbsd openbsd darwin dos
# CP869 dos
# CP874 woe32 dos
# CP922 aix
-# CP932 aix woe32 dos
+# CP932 aix cygwin woe32 dos
# CP943 aix
-# CP949 osf woe32 dos
+# CP949 osf darwin woe32 dos
# CP950 woe32 dos
# CP1046 aix
# CP1124 aix
# CP1125 dos
# CP1129 aix
+# CP1131 darwin
# CP1250 woe32
-# CP1251 glibc solaris netbsd darwin woe32
+# CP1251 glibc solaris netbsd openbsd darwin cygwin woe32
# CP1252 aix woe32
# CP1253 woe32
# CP1254 woe32
@@ -80,18 +81,20 @@
# CP1257 woe32
# GB2312 Y glibc aix hpux irix solaris freebsd netbsd darwin
# EUC-JP Y glibc aix hpux irix osf solaris freebsd netbsd darwin
-# EUC-KR Y glibc aix hpux irix osf solaris freebsd netbsd darwin
+# EUC-KR Y glibc aix hpux irix osf solaris freebsd netbsd darwin cygwin
# EUC-TW glibc aix hpux irix osf solaris netbsd
-# BIG5 Y glibc aix hpux osf solaris freebsd netbsd darwin
-# BIG5-HKSCS glibc solaris
-# GBK glibc aix osf solaris woe32 dos
-# GB18030 glibc solaris netbsd
+# BIG5 Y glibc aix hpux osf solaris freebsd netbsd darwin cygwin
+# BIG5-HKSCS glibc solaris darwin
+# GBK glibc aix osf solaris darwin cygwin woe32 dos
+# GB18030 glibc solaris netbsd darwin
# SHIFT_JIS Y hpux osf solaris freebsd netbsd darwin
# JOHAB glibc solaris woe32
-# TIS-620 glibc aix hpux osf solaris
+# TIS-620 glibc aix hpux osf solaris cygwin
# VISCII Y glibc
# TCVN5712-1 glibc
-# GEORGIAN-PS glibc
+# ARMSCII-8 glibc darwin
+# GEORGIAN-PS glibc cygwin
+# PT154 glibc
# HP-ROMAN8 hpux
# HP-ARABIC8 hpux
# HP-GREEK8 hpux
@@ -100,7 +103,7 @@
# HP-KANA8 hpux
# DEC-KANJI osf
# DEC-HANYU osf
-# UTF-8 Y glibc aix hpux osf solaris netbsd darwin
+# UTF-8 Y glibc aix hpux osf solaris netbsd darwin cygwin
#
# Note: Names which are not marked as being a MIME name should not be used in
# Internet protocols for information interchange (mail, news, etc.).
@@ -121,520 +124,561 @@ echo "# It was automatically generated from config.charset."
# List of references, updated during installation:
echo "# Packages using this file: "
case "$os" in
- linux-gnulibc1*)
- # Linux libc5 doesn't have nl_langinfo(CODESET); therefore
- # localcharset.c falls back to using the full locale name
- # from the environment variables.
- echo "C ASCII"
- echo "POSIX ASCII"
- for l in af af_ZA ca ca_ES da da_DK de de_AT de_BE de_CH de_DE de_LU \
- en en_AU en_BW en_CA en_DK en_GB en_IE en_NZ en_US en_ZA \
- en_ZW es es_AR es_BO es_CL es_CO es_DO es_EC es_ES es_GT \
- es_HN es_MX es_PA es_PE es_PY es_SV es_US es_UY es_VE et \
- et_EE eu eu_ES fi fi_FI fo fo_FO fr fr_BE fr_CA fr_CH fr_FR \
- fr_LU ga ga_IE gl gl_ES id id_ID in in_ID is is_IS it it_CH \
- it_IT kl kl_GL nl nl_BE nl_NL no no_NO pt pt_BR pt_PT sv \
- sv_FI sv_SE; do
- echo "$l ISO-8859-1"
- echo "$l.iso-8859-1 ISO-8859-1"
- echo "$l.iso-8859-15 ISO-8859-15"
- echo "$l.iso-8859-15@euro ISO-8859-15"
- echo "$l@euro ISO-8859-15"
- echo "$l.cp-437 CP437"
- echo "$l.cp-850 CP850"
- echo "$l.cp-1252 CP1252"
- echo "$l.cp-1252@euro CP1252"
- #echo "$l.atari-st ATARI-ST" # not a commonly used encoding
- echo "$l.utf-8 UTF-8"
- echo "$l.utf-8@euro UTF-8"
- done
- for l in cs cs_CZ hr hr_HR hu hu_HU pl pl_PL ro ro_RO sk sk_SK sl \
- sl_SI sr sr_CS sr_YU; do
- echo "$l ISO-8859-2"
- echo "$l.iso-8859-2 ISO-8859-2"
- echo "$l.cp-852 CP852"
- echo "$l.cp-1250 CP1250"
- echo "$l.utf-8 UTF-8"
- done
- for l in mk mk_MK ru ru_RU; do
- echo "$l ISO-8859-5"
- echo "$l.iso-8859-5 ISO-8859-5"
- echo "$l.koi8-r KOI8-R"
- echo "$l.cp-866 CP866"
- echo "$l.cp-1251 CP1251"
- echo "$l.utf-8 UTF-8"
- done
- for l in ar ar_SA; do
- echo "$l ISO-8859-6"
- echo "$l.iso-8859-6 ISO-8859-6"
- echo "$l.cp-864 CP864"
- #echo "$l.cp-868 CP868" # not a commonly used encoding
- echo "$l.cp-1256 CP1256"
- echo "$l.utf-8 UTF-8"
- done
- for l in el el_GR gr gr_GR; do
- echo "$l ISO-8859-7"
- echo "$l.iso-8859-7 ISO-8859-7"
- echo "$l.cp-869 CP869"
- echo "$l.cp-1253 CP1253"
- echo "$l.cp-1253@euro CP1253"
- echo "$l.utf-8 UTF-8"
- echo "$l.utf-8@euro UTF-8"
- done
- for l in he he_IL iw iw_IL; do
- echo "$l ISO-8859-8"
- echo "$l.iso-8859-8 ISO-8859-8"
- echo "$l.cp-862 CP862"
- echo "$l.cp-1255 CP1255"
- echo "$l.utf-8 UTF-8"
- done
- for l in tr tr_TR; do
- echo "$l ISO-8859-9"
- echo "$l.iso-8859-9 ISO-8859-9"
- echo "$l.cp-857 CP857"
- echo "$l.cp-1254 CP1254"
- echo "$l.utf-8 UTF-8"
- done
- for l in lt lt_LT lv lv_LV; do
- #echo "$l BALTIC" # not a commonly used encoding, wrong encoding name
- echo "$l ISO-8859-13"
- done
- for l in ru_UA uk uk_UA; do
- echo "$l KOI8-U"
- done
- for l in zh zh_CN; do
- #echo "$l GB_2312-80" # not a commonly used encoding, wrong encoding name
- echo "$l GB2312"
- done
- for l in ja ja_JP ja_JP.EUC; do
- echo "$l EUC-JP"
- done
- for l in ko ko_KR; do
- echo "$l EUC-KR"
- done
- for l in th th_TH; do
- echo "$l TIS-620"
- done
- for l in fa fa_IR; do
- #echo "$l ISIRI-3342" # a broken encoding
- echo "$l.utf-8 UTF-8"
- done
- ;;
- linux* | *-gnu*)
- # With glibc-2.1 or newer, we don't need any canonicalization,
- # because glibc has iconv and both glibc and libiconv support all
- # GNU canonical names directly. Therefore, the Makefile does not
- # need to install the alias file at all.
- # The following applies only to glibc-2.0.x and older libcs.
- echo "ISO_646.IRV:1983 ASCII"
- ;;
- aix*)
- echo "ISO8859-1 ISO-8859-1"
- echo "ISO8859-2 ISO-8859-2"
- echo "ISO8859-5 ISO-8859-5"
- echo "ISO8859-6 ISO-8859-6"
- echo "ISO8859-7 ISO-8859-7"
- echo "ISO8859-8 ISO-8859-8"
- echo "ISO8859-9 ISO-8859-9"
- echo "ISO8859-15 ISO-8859-15"
- echo "IBM-850 CP850"
- echo "IBM-856 CP856"
- echo "IBM-921 ISO-8859-13"
- echo "IBM-922 CP922"
- echo "IBM-932 CP932"
- echo "IBM-943 CP943"
- echo "IBM-1046 CP1046"
- echo "IBM-1124 CP1124"
- echo "IBM-1129 CP1129"
- echo "IBM-1252 CP1252"
- echo "IBM-eucCN GB2312"
- echo "IBM-eucJP EUC-JP"
- echo "IBM-eucKR EUC-KR"
- echo "IBM-eucTW EUC-TW"
- echo "big5 BIG5"
- echo "GBK GBK"
- echo "TIS-620 TIS-620"
- echo "UTF-8 UTF-8"
- ;;
- hpux*)
- echo "iso88591 ISO-8859-1"
- echo "iso88592 ISO-8859-2"
- echo "iso88595 ISO-8859-5"
- echo "iso88596 ISO-8859-6"
- echo "iso88597 ISO-8859-7"
- echo "iso88598 ISO-8859-8"
- echo "iso88599 ISO-8859-9"
- echo "iso885915 ISO-8859-15"
- echo "roman8 HP-ROMAN8"
- echo "arabic8 HP-ARABIC8"
- echo "greek8 HP-GREEK8"
- echo "hebrew8 HP-HEBREW8"
- echo "turkish8 HP-TURKISH8"
- echo "kana8 HP-KANA8"
- echo "tis620 TIS-620"
- echo "big5 BIG5"
- echo "eucJP EUC-JP"
- echo "eucKR EUC-KR"
- echo "eucTW EUC-TW"
- echo "hp15CN GB2312"
- #echo "ccdc ?" # what is this?
- echo "SJIS SHIFT_JIS"
- echo "utf8 UTF-8"
- ;;
- irix*)
- echo "ISO8859-1 ISO-8859-1"
- echo "ISO8859-2 ISO-8859-2"
- echo "ISO8859-5 ISO-8859-5"
- echo "ISO8859-7 ISO-8859-7"
- echo "ISO8859-9 ISO-8859-9"
- echo "eucCN GB2312"
- echo "eucJP EUC-JP"
- echo "eucKR EUC-KR"
- echo "eucTW EUC-TW"
- ;;
- osf*)
- echo "ISO8859-1 ISO-8859-1"
- echo "ISO8859-2 ISO-8859-2"
- echo "ISO8859-4 ISO-8859-4"
- echo "ISO8859-5 ISO-8859-5"
- echo "ISO8859-7 ISO-8859-7"
- echo "ISO8859-8 ISO-8859-8"
- echo "ISO8859-9 ISO-8859-9"
- echo "ISO8859-15 ISO-8859-15"
- echo "cp850 CP850"
- echo "big5 BIG5"
- echo "dechanyu DEC-HANYU"
- echo "dechanzi GB2312"
- echo "deckanji DEC-KANJI"
- echo "deckorean EUC-KR"
- echo "eucJP EUC-JP"
- echo "eucKR EUC-KR"
- echo "eucTW EUC-TW"
- echo "GBK GBK"
- echo "KSC5601 CP949"
- echo "sdeckanji EUC-JP"
- echo "SJIS SHIFT_JIS"
- echo "TACTIS TIS-620"
- echo "UTF-8 UTF-8"
- ;;
- solaris*)
- echo "646 ASCII"
- echo "ISO8859-1 ISO-8859-1"
- echo "ISO8859-2 ISO-8859-2"
- echo "ISO8859-3 ISO-8859-3"
- echo "ISO8859-4 ISO-8859-4"
- echo "ISO8859-5 ISO-8859-5"
- echo "ISO8859-6 ISO-8859-6"
- echo "ISO8859-7 ISO-8859-7"
- echo "ISO8859-8 ISO-8859-8"
- 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"
- echo "GBK GBK"
- echo "GB18030 GB18030"
- echo "cns11643 EUC-TW"
- echo "5601 EUC-KR"
- echo "ko_KR.johap92 JOHAB"
- echo "eucJP EUC-JP"
- echo "PCK SHIFT_JIS"
- echo "TIS620.2533 TIS-620"
- #echo "sun_eu_greek ?" # what is this?
- echo "UTF-8 UTF-8"
- ;;
- freebsd* | os2*)
- # FreeBSD 4.2 doesn't have nl_langinfo(CODESET); therefore
- # localcharset.c falls back to using the full locale name
- # from the environment variables.
- # Likewise for OS/2. OS/2 has XFree86 just like FreeBSD. Just
- # reuse FreeBSD's locale data for OS/2.
- echo "C ASCII"
- echo "US-ASCII ASCII"
- for l in la_LN lt_LN; do
- echo "$l.ASCII ASCII"
- done
- for l in da_DK de_AT de_CH de_DE en_AU en_CA en_GB en_US es_ES \
- fi_FI fr_BE fr_CA fr_CH fr_FR is_IS it_CH it_IT la_LN \
- lt_LN nl_BE nl_NL no_NO pt_PT sv_SE; do
- echo "$l.ISO_8859-1 ISO-8859-1"
- echo "$l.DIS_8859-15 ISO-8859-15"
- done
- for l in cs_CZ hr_HR hu_HU la_LN lt_LN pl_PL sl_SI; do
- echo "$l.ISO_8859-2 ISO-8859-2"
- done
- for l in la_LN lt_LT; do
- echo "$l.ISO_8859-4 ISO-8859-4"
- done
- for l in ru_RU ru_SU; do
- echo "$l.KOI8-R KOI8-R"
- echo "$l.ISO_8859-5 ISO-8859-5"
- echo "$l.CP866 CP866"
- done
- echo "uk_UA.KOI8-U KOI8-U"
- echo "zh_TW.BIG5 BIG5"
- echo "zh_TW.Big5 BIG5"
- echo "zh_CN.EUC GB2312"
- echo "ja_JP.EUC EUC-JP"
- echo "ja_JP.SJIS SHIFT_JIS"
- echo "ja_JP.Shift_JIS SHIFT_JIS"
- echo "ko_KR.EUC EUC-KR"
- ;;
- netbsd*)
- echo "646 ASCII"
- echo "ISO8859-1 ISO-8859-1"
- echo "ISO8859-2 ISO-8859-2"
- echo "ISO8859-4 ISO-8859-4"
- echo "ISO8859-5 ISO-8859-5"
- echo "ISO8859-7 ISO-8859-7"
- echo "ISO8859-13 ISO-8859-13"
- echo "ISO8859-15 ISO-8859-15"
- echo "eucCN GB2312"
- echo "eucJP EUC-JP"
- echo "eucKR EUC-KR"
- echo "eucTW EUC-TW"
- echo "BIG5 BIG5"
- echo "SJIS SHIFT_JIS"
- ;;
- darwin[56]*)
- # Darwin 6.8 doesn't have nl_langinfo(CODESET); therefore
- # localcharset.c falls back to using the full locale name
- # from the environment variables.
- echo "C ASCII"
- for l in en_AU en_CA en_GB en_US la_LN; do
- echo "$l.US-ASCII ASCII"
- done
- for l in da_DK de_AT de_CH de_DE en_AU en_CA en_GB en_US es_ES \
- fi_FI fr_BE fr_CA fr_CH fr_FR is_IS it_CH it_IT nl_BE \
- nl_NL no_NO pt_PT sv_SE; do
- echo "$l ISO-8859-1"
- echo "$l.ISO8859-1 ISO-8859-1"
- echo "$l.ISO8859-15 ISO-8859-15"
- done
- for l in la_LN; do
- echo "$l.ISO8859-1 ISO-8859-1"
- echo "$l.ISO8859-15 ISO-8859-15"
- done
- for l in cs_CZ hr_HR hu_HU la_LN pl_PL sl_SI; do
- echo "$l.ISO8859-2 ISO-8859-2"
- done
- for l in la_LN lt_LT; do
- echo "$l.ISO8859-4 ISO-8859-4"
- done
- for l in ru_RU; do
- echo "$l.KOI8-R KOI8-R"
- echo "$l.ISO8859-5 ISO-8859-5"
- echo "$l.CP866 CP866"
- done
- for l in bg_BG; do
- echo "$l.CP1251 CP1251"
- done
- echo "uk_UA.KOI8-U KOI8-U"
- echo "zh_TW.BIG5 BIG5"
- echo "zh_TW.Big5 BIG5"
- echo "zh_CN.EUC GB2312"
- echo "ja_JP.EUC EUC-JP"
- echo "ja_JP.SJIS SHIFT_JIS"
- echo "ko_KR.EUC EUC-KR"
- ;;
- darwin*)
- # Darwin 7.5 has nl_langinfo(CODESET), but it is useless:
- # - It returns the empty string when LANG is set to a locale of the
- # form ll_CC, although ll_CC/LC_CTYPE is a symlink to an UTF-8
- # LC_CTYPE file.
- # - The environment variables LANG, LC_CTYPE, LC_ALL are not set by
- # the system; nl_langinfo(CODESET) returns "US-ASCII" in this case.
- # - The documentation says:
- # "... all code that calls BSD system routines should ensure
- # that the const *char parameters of these routines are in UTF-8
- # encoding. All BSD system functions expect their string
- # parameters to be in UTF-8 encoding and nothing else."
- # It also says
- # "An additional caveat is that string parameters for files,
- # paths, and other file-system entities must be in canonical
- # UTF-8. In a canonical UTF-8 Unicode string, all decomposable
- # characters are decomposed ..."
- # but this is not true: You can pass non-decomposed UTF-8 strings
- # to file system functions, and it is the OS which will convert
- # them to decomposed UTF-8 before accessing the file system.
- # - The Apple Terminal application displays UTF-8 by default.
- # - However, other applications are free to use different encodings:
- # - xterm uses ISO-8859-1 by default.
- # - TextEdit uses MacRoman by default.
- # We prefer UTF-8 over decomposed UTF-8-MAC because one should
- # minimize the use of decomposed Unicode. Unfortunately, through the
- # Darwin file system, decomposed UTF-8 strings are leaked into user
- # space nevertheless.
- echo "* UTF-8"
- ;;
- beos*)
- # BeOS has a single locale, and it has UTF-8 encoding.
- echo "* UTF-8"
- ;;
- msdosdjgpp*)
- # DJGPP 2.03 doesn't have nl_langinfo(CODESET); therefore
- # localcharset.c falls back to using the full locale name
- # from the environment variables.
- echo "#"
- echo "# The encodings given here may not all be correct."
- echo "# If you find that the encoding given for your language and"
- echo "# country is not the one your DOS machine actually uses, just"
- echo "# correct it in this file, and send a mail to"
- echo "# Juan Manuel Guerrero <juan.guerrero@gmx.de>"
- echo "# and Bruno Haible <bruno@clisp.org>."
- echo "#"
- echo "C ASCII"
- # ISO-8859-1 languages
- echo "ca CP850"
- echo "ca_ES CP850"
- echo "da CP865" # not CP850 ??
- echo "da_DK CP865" # not CP850 ??
- echo "de CP850"
- echo "de_AT CP850"
- echo "de_CH CP850"
- echo "de_DE CP850"
- echo "en CP850"
- echo "en_AU CP850" # not CP437 ??
- echo "en_CA CP850"
- echo "en_GB CP850"
- echo "en_NZ CP437"
- echo "en_US CP437"
- echo "en_ZA CP850" # not CP437 ??
- echo "es CP850"
- echo "es_AR CP850"
- echo "es_BO CP850"
- echo "es_CL CP850"
- echo "es_CO CP850"
- echo "es_CR CP850"
- echo "es_CU CP850"
- echo "es_DO CP850"
- echo "es_EC CP850"
- echo "es_ES CP850"
- echo "es_GT CP850"
- echo "es_HN CP850"
- echo "es_MX CP850"
- echo "es_NI CP850"
- echo "es_PA CP850"
- echo "es_PY CP850"
- echo "es_PE CP850"
- echo "es_SV CP850"
- echo "es_UY CP850"
- echo "es_VE CP850"
- echo "et CP850"
- echo "et_EE CP850"
- echo "eu CP850"
- echo "eu_ES CP850"
- echo "fi CP850"
- echo "fi_FI CP850"
- echo "fr CP850"
- echo "fr_BE CP850"
- echo "fr_CA CP850"
- echo "fr_CH CP850"
- echo "fr_FR CP850"
- echo "ga CP850"
- echo "ga_IE CP850"
- echo "gd CP850"
- echo "gd_GB CP850"
- echo "gl CP850"
- echo "gl_ES CP850"
- echo "id CP850" # not CP437 ??
- echo "id_ID CP850" # not CP437 ??
- echo "is CP861" # not CP850 ??
- echo "is_IS CP861" # not CP850 ??
- echo "it CP850"
- echo "it_CH CP850"
- echo "it_IT CP850"
- echo "lt CP775"
- echo "lt_LT CP775"
- echo "lv CP775"
- echo "lv_LV CP775"
- echo "nb CP865" # not CP850 ??
- echo "nb_NO CP865" # not CP850 ??
- echo "nl CP850"
- echo "nl_BE CP850"
- echo "nl_NL CP850"
- echo "nn CP865" # not CP850 ??
- echo "nn_NO CP865" # not CP850 ??
- echo "no CP865" # not CP850 ??
- echo "no_NO CP865" # not CP850 ??
- echo "pt CP850"
- echo "pt_BR CP850"
- echo "pt_PT CP850"
- echo "sv CP850"
- echo "sv_SE CP850"
- # ISO-8859-2 languages
- echo "cs CP852"
- echo "cs_CZ CP852"
- echo "hr CP852"
- echo "hr_HR CP852"
- echo "hu CP852"
- echo "hu_HU CP852"
- echo "pl CP852"
- echo "pl_PL CP852"
- echo "ro CP852"
- echo "ro_RO CP852"
- echo "sk CP852"
- echo "sk_SK CP852"
- echo "sl CP852"
- echo "sl_SI CP852"
- echo "sq CP852"
- echo "sq_AL CP852"
- echo "sr CP852" # CP852 or CP866 or CP855 ??
- echo "sr_CS CP852" # CP852 or CP866 or CP855 ??
- echo "sr_YU CP852" # CP852 or CP866 or CP855 ??
- # ISO-8859-3 languages
- echo "mt CP850"
- echo "mt_MT CP850"
- # ISO-8859-5 languages
- echo "be CP866"
- echo "be_BE CP866"
- echo "bg CP866" # not CP855 ??
- echo "bg_BG CP866" # not CP855 ??
- echo "mk CP866" # not CP855 ??
- echo "mk_MK CP866" # not CP855 ??
- echo "ru CP866"
- echo "ru_RU CP866"
- echo "uk CP1125"
- echo "uk_UA CP1125"
- # ISO-8859-6 languages
- echo "ar CP864"
- echo "ar_AE CP864"
- echo "ar_DZ CP864"
- echo "ar_EG CP864"
- echo "ar_IQ CP864"
- echo "ar_IR CP864"
- echo "ar_JO CP864"
- echo "ar_KW CP864"
- echo "ar_MA CP864"
- echo "ar_OM CP864"
- echo "ar_QA CP864"
- echo "ar_SA CP864"
- echo "ar_SY CP864"
- # ISO-8859-7 languages
- echo "el CP869"
- echo "el_GR CP869"
- # ISO-8859-8 languages
- echo "he CP862"
- echo "he_IL CP862"
- # ISO-8859-9 languages
- echo "tr CP857"
- echo "tr_TR CP857"
- # Japanese
- echo "ja CP932"
- echo "ja_JP CP932"
- # Chinese
- echo "zh_CN GBK"
- echo "zh_TW CP950" # not CP938 ??
- # Korean
- echo "kr CP949" # not CP934 ??
- echo "kr_KR CP949" # not CP934 ??
- # Thai
- echo "th CP874"
- echo "th_TH CP874"
- # Other
- echo "eo CP850"
- echo "eo_EO CP850"
- ;;
+ linux-gnulibc1*)
+ # Linux libc5 doesn't have nl_langinfo(CODESET); therefore
+ # localcharset.c falls back to using the full locale name
+ # from the environment variables.
+ echo "C ASCII"
+ echo "POSIX ASCII"
+ for l in af af_ZA ca ca_ES da da_DK de de_AT de_BE de_CH de_DE de_LU \
+ en en_AU en_BW en_CA en_DK en_GB en_IE en_NZ en_US en_ZA \
+ en_ZW es es_AR es_BO es_CL es_CO es_DO es_EC es_ES es_GT \
+ es_HN es_MX es_PA es_PE es_PY es_SV es_US es_UY es_VE et \
+ et_EE eu eu_ES fi fi_FI fo fo_FO fr fr_BE fr_CA fr_CH fr_FR \
+ fr_LU ga ga_IE gl gl_ES id id_ID in in_ID is is_IS it it_CH \
+ it_IT kl kl_GL nl nl_BE nl_NL no no_NO pt pt_BR pt_PT sv \
+ sv_FI sv_SE; do
+ echo "$l ISO-8859-1"
+ echo "$l.iso-8859-1 ISO-8859-1"
+ echo "$l.iso-8859-15 ISO-8859-15"
+ echo "$l.iso-8859-15@euro ISO-8859-15"
+ echo "$l@euro ISO-8859-15"
+ echo "$l.cp-437 CP437"
+ echo "$l.cp-850 CP850"
+ echo "$l.cp-1252 CP1252"
+ echo "$l.cp-1252@euro CP1252"
+ #echo "$l.atari-st ATARI-ST" # not a commonly used encoding
+ echo "$l.utf-8 UTF-8"
+ echo "$l.utf-8@euro UTF-8"
+ done
+ for l in cs cs_CZ hr hr_HR hu hu_HU pl pl_PL ro ro_RO sk sk_SK sl \
+ sl_SI sr sr_CS sr_YU; do
+ echo "$l ISO-8859-2"
+ echo "$l.iso-8859-2 ISO-8859-2"
+ echo "$l.cp-852 CP852"
+ echo "$l.cp-1250 CP1250"
+ echo "$l.utf-8 UTF-8"
+ done
+ for l in mk mk_MK ru ru_RU; do
+ echo "$l ISO-8859-5"
+ echo "$l.iso-8859-5 ISO-8859-5"
+ echo "$l.koi8-r KOI8-R"
+ echo "$l.cp-866 CP866"
+ echo "$l.cp-1251 CP1251"
+ echo "$l.utf-8 UTF-8"
+ done
+ for l in ar ar_SA; do
+ echo "$l ISO-8859-6"
+ echo "$l.iso-8859-6 ISO-8859-6"
+ echo "$l.cp-864 CP864"
+ #echo "$l.cp-868 CP868" # not a commonly used encoding
+ echo "$l.cp-1256 CP1256"
+ echo "$l.utf-8 UTF-8"
+ done
+ for l in el el_GR gr gr_GR; do
+ echo "$l ISO-8859-7"
+ echo "$l.iso-8859-7 ISO-8859-7"
+ echo "$l.cp-869 CP869"
+ echo "$l.cp-1253 CP1253"
+ echo "$l.cp-1253@euro CP1253"
+ echo "$l.utf-8 UTF-8"
+ echo "$l.utf-8@euro UTF-8"
+ done
+ for l in he he_IL iw iw_IL; do
+ echo "$l ISO-8859-8"
+ echo "$l.iso-8859-8 ISO-8859-8"
+ echo "$l.cp-862 CP862"
+ echo "$l.cp-1255 CP1255"
+ echo "$l.utf-8 UTF-8"
+ done
+ for l in tr tr_TR; do
+ echo "$l ISO-8859-9"
+ echo "$l.iso-8859-9 ISO-8859-9"
+ echo "$l.cp-857 CP857"
+ echo "$l.cp-1254 CP1254"
+ echo "$l.utf-8 UTF-8"
+ done
+ for l in lt lt_LT lv lv_LV; do
+ #echo "$l BALTIC" # not a commonly used encoding, wrong encoding name
+ echo "$l ISO-8859-13"
+ done
+ for l in ru_UA uk uk_UA; do
+ echo "$l KOI8-U"
+ done
+ for l in zh zh_CN; do
+ #echo "$l GB_2312-80" # not a commonly used encoding, wrong encoding name
+ echo "$l GB2312"
+ done
+ for l in ja ja_JP ja_JP.EUC; do
+ echo "$l EUC-JP"
+ done
+ for l in ko ko_KR; do
+ echo "$l EUC-KR"
+ done
+ for l in th th_TH; do
+ echo "$l TIS-620"
+ done
+ for l in fa fa_IR; do
+ #echo "$l ISIRI-3342" # a broken encoding
+ echo "$l.utf-8 UTF-8"
+ done
+ ;;
+ linux* | *-gnu*)
+ # With glibc-2.1 or newer, we don't need any canonicalization,
+ # because glibc has iconv and both glibc and libiconv support all
+ # GNU canonical names directly. Therefore, the Makefile does not
+ # need to install the alias file at all.
+ # The following applies only to glibc-2.0.x and older libcs.
+ echo "ISO_646.IRV:1983 ASCII"
+ ;;
+ aix*)
+ echo "ISO8859-1 ISO-8859-1"
+ echo "ISO8859-2 ISO-8859-2"
+ echo "ISO8859-5 ISO-8859-5"
+ echo "ISO8859-6 ISO-8859-6"
+ echo "ISO8859-7 ISO-8859-7"
+ echo "ISO8859-8 ISO-8859-8"
+ echo "ISO8859-9 ISO-8859-9"
+ echo "ISO8859-15 ISO-8859-15"
+ echo "IBM-850 CP850"
+ echo "IBM-856 CP856"
+ echo "IBM-921 ISO-8859-13"
+ echo "IBM-922 CP922"
+ echo "IBM-932 CP932"
+ echo "IBM-943 CP943"
+ echo "IBM-1046 CP1046"
+ echo "IBM-1124 CP1124"
+ echo "IBM-1129 CP1129"
+ echo "IBM-1252 CP1252"
+ echo "IBM-eucCN GB2312"
+ echo "IBM-eucJP EUC-JP"
+ echo "IBM-eucKR EUC-KR"
+ echo "IBM-eucTW EUC-TW"
+ echo "big5 BIG5"
+ echo "GBK GBK"
+ echo "TIS-620 TIS-620"
+ echo "UTF-8 UTF-8"
+ ;;
+ hpux*)
+ echo "iso88591 ISO-8859-1"
+ echo "iso88592 ISO-8859-2"
+ echo "iso88595 ISO-8859-5"
+ echo "iso88596 ISO-8859-6"
+ echo "iso88597 ISO-8859-7"
+ echo "iso88598 ISO-8859-8"
+ echo "iso88599 ISO-8859-9"
+ echo "iso885915 ISO-8859-15"
+ echo "roman8 HP-ROMAN8"
+ echo "arabic8 HP-ARABIC8"
+ echo "greek8 HP-GREEK8"
+ echo "hebrew8 HP-HEBREW8"
+ echo "turkish8 HP-TURKISH8"
+ echo "kana8 HP-KANA8"
+ echo "tis620 TIS-620"
+ echo "big5 BIG5"
+ echo "eucJP EUC-JP"
+ echo "eucKR EUC-KR"
+ echo "eucTW EUC-TW"
+ echo "hp15CN GB2312"
+ #echo "ccdc ?" # what is this?
+ echo "SJIS SHIFT_JIS"
+ echo "utf8 UTF-8"
+ ;;
+ irix*)
+ echo "ISO8859-1 ISO-8859-1"
+ echo "ISO8859-2 ISO-8859-2"
+ echo "ISO8859-5 ISO-8859-5"
+ echo "ISO8859-7 ISO-8859-7"
+ echo "ISO8859-9 ISO-8859-9"
+ echo "eucCN GB2312"
+ echo "eucJP EUC-JP"
+ echo "eucKR EUC-KR"
+ echo "eucTW EUC-TW"
+ ;;
+ osf*)
+ echo "ISO8859-1 ISO-8859-1"
+ echo "ISO8859-2 ISO-8859-2"
+ echo "ISO8859-4 ISO-8859-4"
+ echo "ISO8859-5 ISO-8859-5"
+ echo "ISO8859-7 ISO-8859-7"
+ echo "ISO8859-8 ISO-8859-8"
+ echo "ISO8859-9 ISO-8859-9"
+ echo "ISO8859-15 ISO-8859-15"
+ echo "cp850 CP850"
+ echo "big5 BIG5"
+ echo "dechanyu DEC-HANYU"
+ echo "dechanzi GB2312"
+ echo "deckanji DEC-KANJI"
+ echo "deckorean EUC-KR"
+ echo "eucJP EUC-JP"
+ echo "eucKR EUC-KR"
+ echo "eucTW EUC-TW"
+ echo "GBK GBK"
+ echo "KSC5601 CP949"
+ echo "sdeckanji EUC-JP"
+ echo "SJIS SHIFT_JIS"
+ echo "TACTIS TIS-620"
+ echo "UTF-8 UTF-8"
+ ;;
+ solaris*)
+ echo "646 ASCII"
+ echo "ISO8859-1 ISO-8859-1"
+ echo "ISO8859-2 ISO-8859-2"
+ echo "ISO8859-3 ISO-8859-3"
+ echo "ISO8859-4 ISO-8859-4"
+ echo "ISO8859-5 ISO-8859-5"
+ echo "ISO8859-6 ISO-8859-6"
+ echo "ISO8859-7 ISO-8859-7"
+ echo "ISO8859-8 ISO-8859-8"
+ 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"
+ echo "GBK GBK"
+ echo "GB18030 GB18030"
+ echo "cns11643 EUC-TW"
+ echo "5601 EUC-KR"
+ echo "ko_KR.johap92 JOHAB"
+ echo "eucJP EUC-JP"
+ echo "PCK SHIFT_JIS"
+ echo "TIS620.2533 TIS-620"
+ #echo "sun_eu_greek ?" # what is this?
+ echo "UTF-8 UTF-8"
+ ;;
+ freebsd* | os2*)
+ # FreeBSD 4.2 doesn't have nl_langinfo(CODESET); therefore
+ # localcharset.c falls back to using the full locale name
+ # from the environment variables.
+ # Likewise for OS/2. OS/2 has XFree86 just like FreeBSD. Just
+ # reuse FreeBSD's locale data for OS/2.
+ echo "C ASCII"
+ echo "US-ASCII ASCII"
+ for l in la_LN lt_LN; do
+ echo "$l.ASCII ASCII"
+ done
+ for l in da_DK de_AT de_CH de_DE en_AU en_CA en_GB en_US es_ES \
+ fi_FI fr_BE fr_CA fr_CH fr_FR is_IS it_CH it_IT la_LN \
+ lt_LN nl_BE nl_NL no_NO pt_PT sv_SE; do
+ echo "$l.ISO_8859-1 ISO-8859-1"
+ echo "$l.DIS_8859-15 ISO-8859-15"
+ done
+ for l in cs_CZ hr_HR hu_HU la_LN lt_LN pl_PL sl_SI; do
+ echo "$l.ISO_8859-2 ISO-8859-2"
+ done
+ for l in la_LN lt_LT; do
+ echo "$l.ISO_8859-4 ISO-8859-4"
+ done
+ for l in ru_RU ru_SU; do
+ echo "$l.KOI8-R KOI8-R"
+ echo "$l.ISO_8859-5 ISO-8859-5"
+ echo "$l.CP866 CP866"
+ done
+ echo "uk_UA.KOI8-U KOI8-U"
+ echo "zh_TW.BIG5 BIG5"
+ echo "zh_TW.Big5 BIG5"
+ echo "zh_CN.EUC GB2312"
+ echo "ja_JP.EUC EUC-JP"
+ echo "ja_JP.SJIS SHIFT_JIS"
+ echo "ja_JP.Shift_JIS SHIFT_JIS"
+ echo "ko_KR.EUC EUC-KR"
+ ;;
+ netbsd*)
+ echo "646 ASCII"
+ echo "ISO8859-1 ISO-8859-1"
+ echo "ISO8859-2 ISO-8859-2"
+ echo "ISO8859-4 ISO-8859-4"
+ echo "ISO8859-5 ISO-8859-5"
+ echo "ISO8859-7 ISO-8859-7"
+ echo "ISO8859-13 ISO-8859-13"
+ echo "ISO8859-15 ISO-8859-15"
+ echo "eucCN GB2312"
+ echo "eucJP EUC-JP"
+ echo "eucKR EUC-KR"
+ echo "eucTW EUC-TW"
+ echo "BIG5 BIG5"
+ echo "SJIS SHIFT_JIS"
+ ;;
+ openbsd*)
+ echo "646 ASCII"
+ echo "ISO8859-1 ISO-8859-1"
+ echo "ISO8859-2 ISO-8859-2"
+ echo "ISO8859-4 ISO-8859-4"
+ echo "ISO8859-5 ISO-8859-5"
+ echo "ISO8859-7 ISO-8859-7"
+ echo "ISO8859-13 ISO-8859-13"
+ echo "ISO8859-15 ISO-8859-15"
+ ;;
+ darwin[56]*)
+ # Darwin 6.8 doesn't have nl_langinfo(CODESET); therefore
+ # localcharset.c falls back to using the full locale name
+ # from the environment variables.
+ echo "C ASCII"
+ for l in en_AU en_CA en_GB en_US la_LN; do
+ echo "$l.US-ASCII ASCII"
+ done
+ for l in da_DK de_AT de_CH de_DE en_AU en_CA en_GB en_US es_ES \
+ fi_FI fr_BE fr_CA fr_CH fr_FR is_IS it_CH it_IT nl_BE \
+ nl_NL no_NO pt_PT sv_SE; do
+ echo "$l ISO-8859-1"
+ echo "$l.ISO8859-1 ISO-8859-1"
+ echo "$l.ISO8859-15 ISO-8859-15"
+ done
+ for l in la_LN; do
+ echo "$l.ISO8859-1 ISO-8859-1"
+ echo "$l.ISO8859-15 ISO-8859-15"
+ done
+ for l in cs_CZ hr_HR hu_HU la_LN pl_PL sl_SI; do
+ echo "$l.ISO8859-2 ISO-8859-2"
+ done
+ for l in la_LN lt_LT; do
+ echo "$l.ISO8859-4 ISO-8859-4"
+ done
+ for l in ru_RU; do
+ echo "$l.KOI8-R KOI8-R"
+ echo "$l.ISO8859-5 ISO-8859-5"
+ echo "$l.CP866 CP866"
+ done
+ for l in bg_BG; do
+ echo "$l.CP1251 CP1251"
+ done
+ echo "uk_UA.KOI8-U KOI8-U"
+ echo "zh_TW.BIG5 BIG5"
+ echo "zh_TW.Big5 BIG5"
+ echo "zh_CN.EUC GB2312"
+ echo "ja_JP.EUC EUC-JP"
+ echo "ja_JP.SJIS SHIFT_JIS"
+ echo "ko_KR.EUC EUC-KR"
+ ;;
+ darwin*)
+ # Darwin 7.5 has nl_langinfo(CODESET), but sometimes its value is
+ # useless:
+ # - It returns the empty string when LANG is set to a locale of the
+ # form ll_CC, although ll_CC/LC_CTYPE is a symlink to an UTF-8
+ # LC_CTYPE file.
+ # - The environment variables LANG, LC_CTYPE, LC_ALL are not set by
+ # the system; nl_langinfo(CODESET) returns "US-ASCII" in this case.
+ # - The documentation says:
+ # "... all code that calls BSD system routines should ensure
+ # that the const *char parameters of these routines are in UTF-8
+ # encoding. All BSD system functions expect their string
+ # parameters to be in UTF-8 encoding and nothing else."
+ # It also says
+ # "An additional caveat is that string parameters for files,
+ # paths, and other file-system entities must be in canonical
+ # UTF-8. In a canonical UTF-8 Unicode string, all decomposable
+ # characters are decomposed ..."
+ # but this is not true: You can pass non-decomposed UTF-8 strings
+ # to file system functions, and it is the OS which will convert
+ # them to decomposed UTF-8 before accessing the file system.
+ # - The Apple Terminal application displays UTF-8 by default.
+ # - However, other applications are free to use different encodings:
+ # - xterm uses ISO-8859-1 by default.
+ # - TextEdit uses MacRoman by default.
+ # We prefer UTF-8 over decomposed UTF-8-MAC because one should
+ # minimize the use of decomposed Unicode. Unfortunately, through the
+ # Darwin file system, decomposed UTF-8 strings are leaked into user
+ # space nevertheless.
+ # Then there are also the locales with encodings other than US-ASCII
+ # and UTF-8. These locales can be occasionally useful to users (e.g.
+ # when grepping through ISO-8859-1 encoded text files), when all their
+ # file names are in US-ASCII.
+ echo "ISO8859-1 ISO-8859-1"
+ echo "ISO8859-2 ISO-8859-2"
+ echo "ISO8859-4 ISO-8859-4"
+ echo "ISO8859-5 ISO-8859-5"
+ echo "ISO8859-7 ISO-8859-7"
+ echo "ISO8859-9 ISO-8859-9"
+ echo "ISO8859-13 ISO-8859-13"
+ echo "ISO8859-15 ISO-8859-15"
+ echo "KOI8-R KOI8-R"
+ echo "KOI8-U KOI8-U"
+ echo "CP866 CP866"
+ echo "CP949 CP949"
+ echo "CP1131 CP1131"
+ echo "CP1251 CP1251"
+ echo "eucCN GB2312"
+ echo "GB2312 GB2312"
+ echo "eucJP EUC-JP"
+ echo "eucKR EUC-KR"
+ echo "Big5 BIG5"
+ echo "Big5HKSCS BIG5-HKSCS"
+ echo "GBK GBK"
+ echo "GB18030 GB18030"
+ echo "SJIS SHIFT_JIS"
+ echo "ARMSCII-8 ARMSCII-8"
+ echo "PT154 PT154"
+ #echo "ISCII-DEV ?"
+ echo "* UTF-8"
+ ;;
+ beos* | haiku*)
+ # BeOS and Haiku have a single locale, and it has UTF-8 encoding.
+ echo "* UTF-8"
+ ;;
+ msdosdjgpp*)
+ # DJGPP 2.03 doesn't have nl_langinfo(CODESET); therefore
+ # localcharset.c falls back to using the full locale name
+ # from the environment variables.
+ echo "#"
+ echo "# The encodings given here may not all be correct."
+ echo "# If you find that the encoding given for your language and"
+ echo "# country is not the one your DOS machine actually uses, just"
+ echo "# correct it in this file, and send a mail to"
+ echo "# Juan Manuel Guerrero <juan.guerrero@gmx.de>"
+ echo "# and Bruno Haible <bruno@clisp.org>."
+ echo "#"
+ echo "C ASCII"
+ # ISO-8859-1 languages
+ echo "ca CP850"
+ echo "ca_ES CP850"
+ echo "da CP865" # not CP850 ??
+ echo "da_DK CP865" # not CP850 ??
+ echo "de CP850"
+ echo "de_AT CP850"
+ echo "de_CH CP850"
+ echo "de_DE CP850"
+ echo "en CP850"
+ echo "en_AU CP850" # not CP437 ??
+ echo "en_CA CP850"
+ echo "en_GB CP850"
+ echo "en_NZ CP437"
+ echo "en_US CP437"
+ echo "en_ZA CP850" # not CP437 ??
+ echo "es CP850"
+ echo "es_AR CP850"
+ echo "es_BO CP850"
+ echo "es_CL CP850"
+ echo "es_CO CP850"
+ echo "es_CR CP850"
+ echo "es_CU CP850"
+ echo "es_DO CP850"
+ echo "es_EC CP850"
+ echo "es_ES CP850"
+ echo "es_GT CP850"
+ echo "es_HN CP850"
+ echo "es_MX CP850"
+ echo "es_NI CP850"
+ echo "es_PA CP850"
+ echo "es_PY CP850"
+ echo "es_PE CP850"
+ echo "es_SV CP850"
+ echo "es_UY CP850"
+ echo "es_VE CP850"
+ echo "et CP850"
+ echo "et_EE CP850"
+ echo "eu CP850"
+ echo "eu_ES CP850"
+ echo "fi CP850"
+ echo "fi_FI CP850"
+ echo "fr CP850"
+ echo "fr_BE CP850"
+ echo "fr_CA CP850"
+ echo "fr_CH CP850"
+ echo "fr_FR CP850"
+ echo "ga CP850"
+ echo "ga_IE CP850"
+ echo "gd CP850"
+ echo "gd_GB CP850"
+ echo "gl CP850"
+ echo "gl_ES CP850"
+ echo "id CP850" # not CP437 ??
+ echo "id_ID CP850" # not CP437 ??
+ echo "is CP861" # not CP850 ??
+ echo "is_IS CP861" # not CP850 ??
+ echo "it CP850"
+ echo "it_CH CP850"
+ echo "it_IT CP850"
+ echo "lt CP775"
+ echo "lt_LT CP775"
+ echo "lv CP775"
+ echo "lv_LV CP775"
+ echo "nb CP865" # not CP850 ??
+ echo "nb_NO CP865" # not CP850 ??
+ echo "nl CP850"
+ echo "nl_BE CP850"
+ echo "nl_NL CP850"
+ echo "nn CP865" # not CP850 ??
+ echo "nn_NO CP865" # not CP850 ??
+ echo "no CP865" # not CP850 ??
+ echo "no_NO CP865" # not CP850 ??
+ echo "pt CP850"
+ echo "pt_BR CP850"
+ echo "pt_PT CP850"
+ echo "sv CP850"
+ echo "sv_SE CP850"
+ # ISO-8859-2 languages
+ echo "cs CP852"
+ echo "cs_CZ CP852"
+ echo "hr CP852"
+ echo "hr_HR CP852"
+ echo "hu CP852"
+ echo "hu_HU CP852"
+ echo "pl CP852"
+ echo "pl_PL CP852"
+ echo "ro CP852"
+ echo "ro_RO CP852"
+ echo "sk CP852"
+ echo "sk_SK CP852"
+ echo "sl CP852"
+ echo "sl_SI CP852"
+ echo "sq CP852"
+ echo "sq_AL CP852"
+ echo "sr CP852" # CP852 or CP866 or CP855 ??
+ echo "sr_CS CP852" # CP852 or CP866 or CP855 ??
+ echo "sr_YU CP852" # CP852 or CP866 or CP855 ??
+ # ISO-8859-3 languages
+ echo "mt CP850"
+ echo "mt_MT CP850"
+ # ISO-8859-5 languages
+ echo "be CP866"
+ echo "be_BE CP866"
+ echo "bg CP866" # not CP855 ??
+ echo "bg_BG CP866" # not CP855 ??
+ echo "mk CP866" # not CP855 ??
+ echo "mk_MK CP866" # not CP855 ??
+ echo "ru CP866"
+ echo "ru_RU CP866"
+ echo "uk CP1125"
+ echo "uk_UA CP1125"
+ # ISO-8859-6 languages
+ echo "ar CP864"
+ echo "ar_AE CP864"
+ echo "ar_DZ CP864"
+ echo "ar_EG CP864"
+ echo "ar_IQ CP864"
+ echo "ar_IR CP864"
+ echo "ar_JO CP864"
+ echo "ar_KW CP864"
+ echo "ar_MA CP864"
+ echo "ar_OM CP864"
+ echo "ar_QA CP864"
+ echo "ar_SA CP864"
+ echo "ar_SY CP864"
+ # ISO-8859-7 languages
+ echo "el CP869"
+ echo "el_GR CP869"
+ # ISO-8859-8 languages
+ echo "he CP862"
+ echo "he_IL CP862"
+ # ISO-8859-9 languages
+ echo "tr CP857"
+ echo "tr_TR CP857"
+ # Japanese
+ echo "ja CP932"
+ echo "ja_JP CP932"
+ # Chinese
+ echo "zh_CN GBK"
+ echo "zh_TW CP950" # not CP938 ??
+ # Korean
+ echo "kr CP949" # not CP934 ??
+ echo "kr_KR CP949" # not CP934 ??
+ # Thai
+ echo "th CP874"
+ echo "th_TH CP874"
+ # Other
+ echo "eo CP850"
+ echo "eo_EO CP850"
+ ;;
esac
diff --git a/intl/dcigettext.c b/intl/dcigettext.c
index 623e51da..b2add5db 100644
--- a/intl/dcigettext.c
+++ b/intl/dcigettext.c
@@ -1,5 +1,5 @@
/* Implementation of the internal dcigettext function.
- Copyright (C) 1995-1999, 2000-2007 Free Software Foundation, Inc.
+ Copyright (C) 1995-1999, 2000-2009 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
@@ -27,9 +27,6 @@
# include <config.h>
#endif
-/* NL_LOCALE_NAME does not work in glibc-2.4. Ignore it. */
-#undef HAVE_NL_LOCALE_NAME
-
#include <sys/types.h>
#ifdef __GNUC__
@@ -91,9 +88,6 @@ extern int errno;
#endif
#if !defined _LIBC
-# if HAVE_NL_LOCALE_NAME
-# include <langinfo.h>
-# endif
# include "localcharset.h"
#endif
@@ -234,7 +228,7 @@ static void *mempcpy (void *dest, const void *src, size_t n);
#endif
/* Whether to support different locales in different threads. */
-#if defined _LIBC || HAVE_NL_LOCALE_NAME || (HAVE_STRUCT___LOCALE_STRUCT___NAMES && defined USE_IN_GETTEXT_TESTS) || defined IN_LIBGLOCALE
+#if defined _LIBC || HAVE_USELOCALE || defined IN_LIBGLOCALE
# define HAVE_PER_THREAD_LOCALE
#endif
@@ -269,7 +263,12 @@ struct known_translation_t
size_t translation_length;
/* Pointer to the string in question. */
- char msgid[ZERO];
+ union
+ {
+ char appended[ZERO]; /* used if domain != NULL */
+ const char *ptr; /* used if domain == NULL */
+ }
+ msgid;
};
gl_rwlock_define_initialized (static, tree_lock)
@@ -288,7 +287,8 @@ transcmp (const void *p1, const void *p2)
s1 = (const struct known_translation_t *) p1;
s2 = (const struct known_translation_t *) p2;
- result = strcmp (s1->msgid, s2->msgid);
+ result = strcmp (s1->domain != NULL ? s1->msgid.appended : s1->msgid.ptr,
+ s2->domain != NULL ? s2->msgid.appended : s2->msgid.ptr);
if (result == 0)
{
result = strcmp (s1->domainname, s2->domainname);
@@ -501,9 +501,8 @@ DCIGETTEXT (const char *domainname, const char *msgid1, const char *msgid2,
char *retval;
size_t retlen;
int saved_errno;
- struct known_translation_t *search;
+ struct known_translation_t search;
struct known_translation_t **foundp = NULL;
- size_t msgid_len;
#if defined HAVE_PER_THREAD_LOCALE && !defined IN_LIBGLOCALE
const char *localename;
#endif
@@ -525,6 +524,11 @@ DCIGETTEXT (const char *domainname, const char *msgid1, const char *msgid2,
/* Preserve the `errno' value. */
saved_errno = errno;
+#ifdef _LIBC
+ __libc_rwlock_define (extern, __libc_setlocale_lock attribute_hidden)
+ __libc_rwlock_rdlock (__libc_setlocale_lock);
+#endif
+
gl_rwlock_rdlock (_nl_state_lock);
/* If DOMAINNAME is NULL, we are interested in the default domain. If
@@ -539,52 +543,37 @@ DCIGETTEXT (const char *domainname, const char *msgid1, const char *msgid2,
category = LC_MESSAGES;
#endif
- msgid_len = strlen (msgid1) + 1;
-
/* Try to find the translation among those which we found at
some time. */
- search = (struct known_translation_t *)
- alloca (offsetof (struct known_translation_t, msgid) + msgid_len);
- memcpy (search->msgid, msgid1, msgid_len);
- search->domainname = domainname;
- search->category = category;
+ search.domain = NULL;
+ search.msgid.ptr = msgid1;
+ search.domainname = domainname;
+ search.category = category;
#ifdef HAVE_PER_THREAD_LOCALE
# ifndef IN_LIBGLOCALE
# ifdef _LIBC
- localename = __current_locale_name (category);
+ localename = _strdupa (_current_locale_name (category));
# else
-# if HAVE_NL_LOCALE_NAME
- /* NL_LOCALE_NAME is public glibc API introduced in glibc-2.4. */
- localename = nl_langinfo (NL_LOCALE_NAME (category));
-# else
-# if HAVE_STRUCT___LOCALE_STRUCT___NAMES && defined USE_IN_GETTEXT_TESTS
- /* The __names field is not public glibc API and must therefore not be used
- in code that is installed in public locations. */
- {
- locale_t thread_locale = uselocale (NULL);
- if (thread_locale != LC_GLOBAL_LOCALE)
- localename = thread_locale->__names[category];
- else
- localename = "";
- }
-# endif
-# endif
+ categoryname = category_to_name (category);
+# define CATEGORYNAME_INITIALIZED
+ localename = _nl_locale_name_thread_unsafe (category, categoryname);
+ if (localename == NULL)
+ localename = "";
# endif
# endif
- search->localename = localename;
+ search.localename = localename;
# ifdef IN_LIBGLOCALE
- search->encoding = encoding;
+ search.encoding = encoding;
# endif
/* Since tfind/tsearch manage a balanced tree, concurrent tfind and
tsearch calls can be fatal. */
gl_rwlock_rdlock (tree_lock);
- foundp = (struct known_translation_t **) tfind (search, &root, transcmp);
+ foundp = (struct known_translation_t **) tfind (&search, &root, transcmp);
gl_rwlock_unlock (tree_lock);
- freea (search);
if (foundp != NULL && (*foundp)->counter == _nl_msg_cat_cntr)
{
/* Now deal with plural. */
@@ -595,6 +584,9 @@ DCIGETTEXT (const char *domainname, const char *msgid1, const char *msgid2,
retval = (char *) (*foundp)->translation;
gl_rwlock_unlock (_nl_state_lock);
+# ifdef _LIBC
+ __libc_rwlock_unlock (__libc_setlocale_lock);
+# endif
__set_errno (saved_errno);
return retval;
}
@@ -668,7 +660,9 @@ DCIGETTEXT (const char *domainname, const char *msgid1, const char *msgid2,
#endif
/* Now determine the symbolic name of CATEGORY and its value. */
+#ifndef CATEGORYNAME_INITIALIZED
categoryname = category_to_name (category);
+#endif
#ifdef IN_LIBGLOCALE
categoryvalue = guess_category_value (category, categoryname, localename);
#else
@@ -773,9 +767,11 @@ DCIGETTEXT (const char *domainname, const char *msgid1, const char *msgid2,
if (foundp == NULL)
{
/* Create a new entry and add it to the search tree. */
+ size_t msgid_len;
size_t size;
struct known_translation_t *newp;
+ msgid_len = strlen (msgid1) + 1;
size = offsetof (struct known_translation_t, msgid)
+ msgid_len + domainname_len + 1;
#ifdef HAVE_PER_THREAD_LOCALE
@@ -790,7 +786,8 @@ DCIGETTEXT (const char *domainname, const char *msgid1, const char *msgid2,
#endif
new_domainname =
- (char *) mempcpy (newp->msgid, msgid1, msgid_len);
+ (char *) mempcpy (newp->msgid.appended, msgid1,
+ msgid_len);
memcpy (new_domainname, domainname, domainname_len + 1);
#ifdef HAVE_PER_THREAD_LOCALE
new_localename = new_domainname + domainname_len + 1;
@@ -839,6 +836,9 @@ DCIGETTEXT (const char *domainname, const char *msgid1, const char *msgid2,
retval = plural_lookup (domain, n, retval, retlen);
gl_rwlock_unlock (_nl_state_lock);
+#ifdef _LIBC
+ __libc_rwlock_unlock (__libc_setlocale_lock);
+#endif
return retval;
}
}
@@ -848,6 +848,9 @@ DCIGETTEXT (const char *domainname, const char *msgid1, const char *msgid2,
/* Return the untranslated MSGID. */
FREE_BLOCKS (block_list);
gl_rwlock_unlock (_nl_state_lock);
+#ifdef _LIBC
+ __libc_rwlock_unlock (__libc_setlocale_lock);
+#endif
#ifndef _LIBC
if (!ENABLE_SECURE)
{
@@ -1030,6 +1033,7 @@ _nl_find_msg (struct loaded_l10nfile *domain_file,
{
/* We have to allocate a new conversions table. */
gl_rwlock_wrlock (domain->conversions_lock);
+ nconversions = domain->nconversions;
/* Maybe in the meantime somebody added the translation.
Recheck. */
@@ -1203,13 +1207,29 @@ _nl_find_msg (struct loaded_l10nfile *domain_file,
handle this case by converting RESULTLEN bytes, including
NULs. */
- if (convd->conv_tab == NULL
- && ((convd->conv_tab =
+ /* This lock primarily protects the memory management variables
+ freemem, freemem_size. It also protects write accesses to
+ convd->conv_tab. It's not worth using a separate lock (such
+ as domain->conversions_lock) for this purpose, because when
+ modifying convd->conv_tab, we also need to lock freemem,
+ freemem_size for most of the time. */
+ __libc_lock_define_initialized (static, lock)
+
+ if (__builtin_expect (convd->conv_tab == NULL, 0))
+ {
+ __libc_lock_lock (lock);
+ if (convd->conv_tab == NULL)
+ {
+ convd->conv_tab =
(char **) calloc (nstrings + domain->n_sysdep_strings,
- sizeof (char *)))
- == NULL))
- /* Mark that we didn't succeed allocating a table. */
- convd->conv_tab = (char **) -1;
+ sizeof (char *));
+ if (convd->conv_tab != NULL)
+ goto not_translated_yet;
+ /* Mark that we didn't succeed allocating a table. */
+ convd->conv_tab = (char **) -1;
+ }
+ __libc_lock_unlock (lock);
+ }
if (__builtin_expect (convd->conv_tab == (char **) -1, 0))
/* Nothing we can do, no more memory. We cannot use the
@@ -1223,7 +1243,6 @@ _nl_find_msg (struct loaded_l10nfile *domain_file,
/* We use a bit more efficient memory handling.
We allocate always larger blocks which get used over
time. This is faster than many small allocations. */
- __libc_lock_define_initialized (static, lock)
# define INITIAL_BLOCK_SIZE 4080
static unsigned char *freemem;
static size_t freemem_size;
@@ -1232,13 +1251,17 @@ _nl_find_msg (struct loaded_l10nfile *domain_file,
unsigned char *outbuf;
int malloc_count;
# ifndef _LIBC
- transmem_block_t *transmem_list = NULL;
+ transmem_block_t *transmem_list;
# endif
__libc_lock_lock (lock);
+ not_translated_yet:
inbuf = (const unsigned char *) result;
outbuf = freemem + sizeof (size_t);
+# ifndef _LIBC
+ transmem_list = NULL;
+# endif
malloc_count = 0;
while (1)
@@ -1515,20 +1538,13 @@ guess_category_value (int category, const char *categoryname)
# ifdef _LIBC
locale = __current_locale_name (category);
# else
-# if HAVE_STRUCT___LOCALE_STRUCT___NAMES && defined USE_IN_GETTEXT_TESTS
- /* The __names field is not public glibc API and must therefore not be used
- in code that is installed in public locations. */
- locale_t thread_locale = uselocale (NULL);
- if (thread_locale != LC_GLOBAL_LOCALE)
- {
- locale = thread_locale->__names[category];
- locale_defaulted = 0;
- }
- else
+ locale_defaulted = 0;
+# if HAVE_USELOCALE
+ locale = _nl_locale_name_thread_unsafe (category, categoryname);
+ if (locale == NULL)
# endif
{
locale = _nl_locale_name_posix (category, categoryname);
- locale_defaulted = 0;
if (locale == NULL)
{
locale = _nl_locale_name_default ();
diff --git a/intl/gettextP.h b/intl/gettextP.h
index 5706fb50..c8418a3e 100644
--- a/intl/gettextP.h
+++ b/intl/gettextP.h
@@ -1,5 +1,5 @@
/* Header describing internals of libintl library.
- Copyright (C) 1995-1999, 2000-2007 Free Software Foundation, Inc.
+ Copyright (C) 1995-1999, 2000-2007, 2009-2010 Free Software Foundation, Inc.
Written by Ulrich Drepper <drepper@cygnus.com>, 1995.
This program is free software; you can redistribute it and/or modify it
@@ -231,13 +231,27 @@ extern LIBINTL_DLL_EXPORTED int _nl_msg_cat_cntr;
extern const char *_nl_language_preferences_default (void);
# define gl_locale_name_canonicalize _nl_locale_name_canonicalize
extern void _nl_locale_name_canonicalize (char *name);
+# define gl_locale_name_from_win32_LANGID _nl_locale_name_from_win32_LANGID
+/* extern const char *_nl_locale_name_from_win32_LANGID (LANGID langid); */
+# define gl_locale_name_from_win32_LCID _nl_locale_name_from_win32_LCID
+/* extern const char *_nl_locale_name_from_win32_LCID (LCID lcid); */
+# define gl_locale_name_thread_unsafe _nl_locale_name_thread_unsafe
+extern const char *_nl_locale_name_thread_unsafe (int category,
+ const char *categoryname);
+# define gl_locale_name_thread _nl_locale_name_thread
+/* extern const char *_nl_locale_name_thread (int category,
+ const char *categoryname); */
# define gl_locale_name_posix _nl_locale_name_posix
extern const char *_nl_locale_name_posix (int category,
const char *categoryname);
+# define gl_locale_name_environ _nl_locale_name_environ
+extern const char *_nl_locale_name_environ (int category,
+ const char *categoryname);
# define gl_locale_name_default _nl_locale_name_default
extern const char *_nl_locale_name_default (void);
# define gl_locale_name _nl_locale_name
-extern const char *_nl_locale_name (int category, const char *categoryname);
+/* extern const char *_nl_locale_name (int category,
+ const char *categoryname); */
#endif
struct loaded_l10nfile *_nl_find_domain (const char *__dirname, char *__locale,
diff --git a/intl/intl-compat.c b/intl/intl-compat.c
index 9b9ecbb6..43d45174 100644
--- a/intl/intl-compat.c
+++ b/intl/intl-compat.c
@@ -93,7 +93,7 @@ ngettext (const char *msgid1, const char *msgid2, unsigned long int n)
DLL_EXPORTED
char *
dngettext (const char *domainname,
- const char *msgid1, const char *msgid2, unsigned long int n)
+ const char *msgid1, const char *msgid2, unsigned long int n)
{
return libintl_dngettext (domainname, msgid1, msgid2, n);
}
@@ -102,8 +102,8 @@ dngettext (const char *domainname,
DLL_EXPORTED
char *
dcngettext (const char *domainname,
- const char *msgid1, const char *msgid2, unsigned long int n,
- int category)
+ const char *msgid1, const char *msgid2, unsigned long int n,
+ int category)
{
return libintl_dcngettext (domainname, msgid1, msgid2, n, category);
}
diff --git a/intl/intl-exports.c b/intl/intl-exports.c
index 71765899..9e0a13e8 100644
--- a/intl/intl-exports.c
+++ b/intl/intl-exports.c
@@ -23,14 +23,14 @@
/* Ensure that the variable x is exported from the library, and that a
pseudo-variable IMP(x) is available. */
#define VARIABLE(x) \
- /* Export x without redefining x. This code was found by compiling a \
- snippet: \
- extern __declspec(dllexport) int x; int x = 42; */ \
- asm (".section .drectve\n"); \
- asm (".ascii \" -export:" #x ",data\"\n"); \
- asm (".data\n"); \
- /* Allocate a pseudo-variable IMP(x). */ \
- extern int x; \
+ /* Export x without redefining x. This code was found by compiling a \
+ snippet: \
+ extern __declspec(dllexport) int x; int x = 42; */ \
+ asm (".section .drectve\n"); \
+ asm (".ascii \" -export:" #x ",data\"\n"); \
+ asm (".data\n"); \
+ /* Allocate a pseudo-variable IMP(x). */ \
+ extern int x; \
void * IMP(x) = &x;
VARIABLE(libintl_version)
diff --git a/intl/l10nflist.c b/intl/l10nflist.c
index 365aeb70..7252d54e 100644
--- a/intl/l10nflist.c
+++ b/intl/l10nflist.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 1995-1999, 2000-2006 Free Software Foundation, Inc.
+/* Copyright (C) 1995-1999, 2000-2007 Free Software Foundation, Inc.
Contributed by Ulrich Drepper <drepper@gnu.ai.mit.edu>, 1995.
This program is free software; you can redistribute it and/or modify it
@@ -346,7 +346,7 @@ _nl_make_l10nflist (struct loaded_l10nfile **l10nfile_list,
const char *
_nl_normalize_codeset (const char *codeset, size_t name_len)
{
- int len = 0;
+ size_t len = 0;
int only_digit = 1;
char *retval;
char *wp;
diff --git a/intl/langprefs.c b/intl/langprefs.c
index 59c8def2..de66ad8c 100644
--- a/intl/langprefs.c
+++ b/intl/langprefs.c
@@ -1,5 +1,5 @@
/* Determine the user's language preferences.
- Copyright (C) 2004-2006 Free Software Foundation, Inc.
+ Copyright (C) 2004-2007 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
@@ -16,7 +16,8 @@
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301,
USA. */
-/* Written by Bruno Haible <bruno@clisp.org>. */
+/* Written by Bruno Haible <bruno@clisp.org>.
+ Win32 code originally by Michele Cicciotti <hackbunny@reactos.com>. */
#ifdef HAVE_CONFIG_H
# include <config.h>
@@ -33,6 +34,197 @@
extern void _nl_locale_name_canonicalize (char *name);
#endif
+#if defined _WIN32 || defined __WIN32__
+# define WIN32_NATIVE
+#endif
+
+#ifdef WIN32_NATIVE
+# define WIN32_LEAN_AND_MEAN
+# include <windows.h>
+
+# ifndef MUI_LANGUAGE_NAME
+# define MUI_LANGUAGE_NAME 8
+# endif
+# ifndef STATUS_BUFFER_OVERFLOW
+# define STATUS_BUFFER_OVERFLOW 0x80000005
+# endif
+
+extern void _nl_locale_name_canonicalize (char *name);
+extern const char *_nl_locale_name_from_win32_LANGID (LANGID langid);
+extern const char *_nl_locale_name_from_win32_LCID (LCID lcid);
+
+/* Get the preferences list through the MUI APIs. This works on Windows Vista
+ and newer. */
+static const char *
+_nl_language_preferences_win32_mui (HMODULE kernel32)
+{
+ /* DWORD GetUserPreferredUILanguages (ULONG dwFlags,
+ PULONG pulNumLanguages,
+ PWSTR pwszLanguagesBuffer,
+ PULONG pcchLanguagesBuffer); */
+ typedef DWORD (WINAPI *GetUserPreferredUILanguages_func) (ULONG, PULONG, PWSTR, PULONG);
+ GetUserPreferredUILanguages_func p_GetUserPreferredUILanguages;
+
+ p_GetUserPreferredUILanguages =
+ (GetUserPreferredUILanguages_func)
+ GetProcAddress (kernel32, "GetUserPreferredUILanguages");
+ if (p_GetUserPreferredUILanguages != NULL)
+ {
+ ULONG num_languages;
+ ULONG bufsize;
+ DWORD ret;
+
+ bufsize = 0;
+ ret = p_GetUserPreferredUILanguages (MUI_LANGUAGE_NAME,
+ &num_languages,
+ NULL, &bufsize);
+ if (ret == 0
+ && GetLastError () == STATUS_BUFFER_OVERFLOW
+ && bufsize > 0)
+ {
+ WCHAR *buffer = (WCHAR *) malloc (bufsize * sizeof (WCHAR));
+ if (buffer != NULL)
+ {
+ ret = p_GetUserPreferredUILanguages (MUI_LANGUAGE_NAME,
+ &num_languages,
+ buffer, &bufsize);
+ if (ret)
+ {
+ /* Convert the list from NUL-delimited WCHAR[] Win32 locale
+ names to colon-delimited char[] Unix locale names.
+ We assume that all these locale names are in ASCII,
+ nonempty and contain no colons. */
+ char *languages =
+ (char *) malloc (bufsize + num_languages * 10 + 1);
+ if (languages != NULL)
+ {
+ const WCHAR *p = buffer;
+ char *q = languages;
+ ULONG i;
+ for (i = 0; i < num_languages; i++)
+ {
+ char *q1;
+ char *q2;
+
+ q1 = q;
+ if (i > 0)
+ *q++ = ':';
+ q2 = q;
+ for (; *p != (WCHAR)'\0'; p++)
+ {
+ if ((unsigned char) *p != *p || *p == ':')
+ {
+ /* A non-ASCII character or a colon inside
+ the Win32 locale name! Punt. */
+ q = q1;
+ break;
+ }
+ *q++ = (unsigned char) *p;
+ }
+ if (q == q1)
+ /* An unexpected Win32 locale name occurred. */
+ break;
+ *q = '\0';
+ _nl_locale_name_canonicalize (q2);
+ q = q2 + strlen (q2);
+ p++;
+ }
+ *q = '\0';
+ if (q > languages)
+ {
+ free (buffer);
+ return languages;
+ }
+ free (languages);
+ }
+ }
+ free (buffer);
+ }
+ }
+ }
+ return NULL;
+}
+
+/* Get a preference. This works on Windows ME and newer. */
+static const char *
+_nl_language_preferences_win32_ME (HMODULE kernel32)
+{
+ /* LANGID GetUserDefaultUILanguage (void); */
+ typedef LANGID (WINAPI *GetUserDefaultUILanguage_func) (void);
+ GetUserDefaultUILanguage_func p_GetUserDefaultUILanguage;
+
+ p_GetUserDefaultUILanguage =
+ (GetUserDefaultUILanguage_func)
+ GetProcAddress (kernel32, "GetUserDefaultUILanguage");
+ if (p_GetUserDefaultUILanguage != NULL)
+ return _nl_locale_name_from_win32_LANGID (p_GetUserDefaultUILanguage ());
+ return NULL;
+}
+
+/* Get a preference. This works on Windows 95 and newer. */
+static const char *
+_nl_language_preferences_win32_95 ()
+{
+ HKEY desktop_resource_locale_key;
+
+ if (RegOpenKeyExA (HKEY_CURRENT_USER,
+ "Control Panel\\Desktop\\ResourceLocale",
+ 0, KEY_QUERY_VALUE, &desktop_resource_locale_key)
+ == NO_ERROR)
+ {
+ DWORD type;
+ char data[8 + 1];
+ DWORD data_size = sizeof (data);
+ DWORD ret;
+
+ ret = RegQueryValueExA (desktop_resource_locale_key, NULL, NULL,
+ &type, data, &data_size);
+ RegCloseKey (desktop_resource_locale_key);
+
+ if (ret == NO_ERROR)
+ {
+ /* We expect a string, at most 8 bytes long, that parses as a
+ hexadecimal number. */
+ if (type == REG_SZ
+ && data_size <= sizeof (data)
+ && (data_size < sizeof (data)
+ || data[sizeof (data) - 1] == '\0'))
+ {
+ LCID lcid;
+ char *endp;
+ /* Ensure it's NUL terminated. */
+ if (data_size < sizeof (data))
+ data[data_size] = '\0';
+ /* Parse it as a hexadecimal number. */
+ lcid = strtoul (data, &endp, 16);
+ if (endp > data && *endp == '\0')
+ return _nl_locale_name_from_win32_LCID (lcid);
+ }
+ }
+ }
+ return NULL;
+}
+
+/* Get the system's preference. This can be used as a fallback. */
+static BOOL CALLBACK
+ret_first_language (HMODULE h, LPCSTR type, LPCSTR name, WORD lang, LONG_PTR param)
+{
+ *(const char **)param = _nl_locale_name_from_win32_LANGID (lang);
+ return FALSE;
+}
+static const char *
+_nl_language_preferences_win32_system (HMODULE kernel32)
+{
+ const char *languages = NULL;
+ /* Ignore the warning on mingw here. mingw has a wrong definition of the last
+ parameter type of ENUMRESLANGPROC. */
+ EnumResourceLanguages (kernel32, RT_VERSION, MAKEINTRESOURCE (1),
+ ret_first_language, (LONG_PTR)&languages);
+ return languages;
+}
+
+#endif
+
/* Determine the user's language preferences, as a colon separated list of
locale names in XPG syntax
language[_territory][.codeset][@modifier]
@@ -51,75 +243,108 @@ _nl_language_preferences_default (void)
if (!cache_initialized)
{
- CFTypeRef preferences =
- CFPreferencesCopyAppValue (CFSTR ("AppleLanguages"),
- kCFPreferencesCurrentApplication);
- if (preferences != NULL
- && CFGetTypeID (preferences) == CFArrayGetTypeID ())
- {
- CFArrayRef prefArray = (CFArrayRef)preferences;
- int n = CFArrayGetCount (prefArray);
- char buf[256];
- size_t size = 0;
- int i;
-
- for (i = 0; i < n; i++)
- {
- CFTypeRef element = CFArrayGetValueAtIndex (prefArray, i);
- if (element != NULL
- && CFGetTypeID (element) == CFStringGetTypeID ()
- && CFStringGetCString ((CFStringRef)element,
- buf, sizeof (buf),
- kCFStringEncodingASCII))
- {
- _nl_locale_name_canonicalize (buf);
- size += strlen (buf) + 1;
- /* Most GNU programs use msgids in English and don't ship
- an en.mo message catalog. Therefore when we see "en"
- in the preferences list, arrange for gettext() to
- return the msgid, and ignore all further elements of
- the preferences list. */
- if (strcmp (buf, "en") == 0)
- break;
- }
- else
- break;
- }
- if (size > 0)
- {
- char *languages = (char *) malloc (size);
-
- if (languages != NULL)
- {
- char *p = languages;
-
- for (i = 0; i < n; i++)
- {
- CFTypeRef element =
- CFArrayGetValueAtIndex (prefArray, i);
- if (element != NULL
- && CFGetTypeID (element) == CFStringGetTypeID ()
- && CFStringGetCString ((CFStringRef)element,
- buf, sizeof (buf),
- kCFStringEncodingASCII))
- {
- _nl_locale_name_canonicalize (buf);
- strcpy (p, buf);
- p += strlen (buf);
- *p++ = ':';
- if (strcmp (buf, "en") == 0)
- break;
- }
- else
- break;
- }
- *--p = '\0';
-
- cached_languages = languages;
- }
- }
- }
- cache_initialized = 1;
+ CFTypeRef preferences =
+ CFPreferencesCopyAppValue (CFSTR ("AppleLanguages"),
+ kCFPreferencesCurrentApplication);
+ if (preferences != NULL
+ && CFGetTypeID (preferences) == CFArrayGetTypeID ())
+ {
+ CFArrayRef prefArray = (CFArrayRef)preferences;
+ int n = CFArrayGetCount (prefArray);
+ char buf[256];
+ size_t size = 0;
+ int i;
+
+ for (i = 0; i < n; i++)
+ {
+ CFTypeRef element = CFArrayGetValueAtIndex (prefArray, i);
+ if (element != NULL
+ && CFGetTypeID (element) == CFStringGetTypeID ()
+ && CFStringGetCString ((CFStringRef)element,
+ buf, sizeof (buf),
+ kCFStringEncodingASCII))
+ {
+ _nl_locale_name_canonicalize (buf);
+ size += strlen (buf) + 1;
+ /* Most GNU programs use msgids in English and don't ship
+ an en.mo message catalog. Therefore when we see "en"
+ in the preferences list, arrange for gettext() to
+ return the msgid, and ignore all further elements of
+ the preferences list. */
+ if (strcmp (buf, "en") == 0)
+ break;
+ }
+ else
+ break;
+ }
+ if (size > 0)
+ {
+ char *languages = (char *) malloc (size);
+
+ if (languages != NULL)
+ {
+ char *p = languages;
+
+ for (i = 0; i < n; i++)
+ {
+ CFTypeRef element =
+ CFArrayGetValueAtIndex (prefArray, i);
+ if (element != NULL
+ && CFGetTypeID (element) == CFStringGetTypeID ()
+ && CFStringGetCString ((CFStringRef)element,
+ buf, sizeof (buf),
+ kCFStringEncodingASCII))
+ {
+ _nl_locale_name_canonicalize (buf);
+ strcpy (p, buf);
+ p += strlen (buf);
+ *p++ = ':';
+ if (strcmp (buf, "en") == 0)
+ break;
+ }
+ else
+ break;
+ }
+ *--p = '\0';
+
+ cached_languages = languages;
+ }
+ }
+ }
+ cache_initialized = 1;
+ }
+ if (cached_languages != NULL)
+ return cached_languages;
+ }
+#endif
+
+#ifdef WIN32_NATIVE
+ {
+ /* Cache the preferences list, since computing it is expensive. */
+ static const char *cached_languages;
+ static int cache_initialized;
+
+ /* Activate the new code only when the GETTEXT_MUI environment variable is
+ set, for the time being, since the new code is not well tested. */
+ if (!cache_initialized && getenv ("GETTEXT_MUI") != NULL)
+ {
+ const char *languages = NULL;
+ HMODULE kernel32 = GetModuleHandle ("kernel32");
+
+ if (kernel32 != NULL)
+ languages = _nl_language_preferences_win32_mui (kernel32);
+
+ if (languages == NULL && kernel32 != NULL)
+ languages = _nl_language_preferences_win32_ME (kernel32);
+
+ if (languages == NULL)
+ languages = _nl_language_preferences_win32_95 ();
+
+ if (languages == NULL && kernel32 != NULL)
+ languages = _nl_language_preferences_win32_system (kernel32);
+
+ cached_languages = languages;
+ cache_initialized = 1;
}
if (cached_languages != NULL)
return cached_languages;
diff --git a/intl/libgnuintl.h.in b/intl/libgnuintl.h.in
index c9da7983..4176b44b 100644
--- a/intl/libgnuintl.h.in
+++ b/intl/libgnuintl.h.in
@@ -1,5 +1,5 @@
/* Message catalogs for internationalization.
- Copyright (C) 1995-1997, 2000-2007 Free Software Foundation, Inc.
+ Copyright (C) 1995-1997, 2000-2010 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
@@ -17,9 +17,12 @@
USA. */
#ifndef _LIBINTL_H
-#define _LIBINTL_H 1
+#define _LIBINTL_H 1
#include <locale.h>
+#if (defined __APPLE__ && defined __MACH__) && @HAVE_NEWLOCALE@
+# include <xlocale.h>
+#endif
/* The LC_MESSAGES locale category is the category used by the functions
gettext() and dgettext(). It is specified in POSIX, but not in ANSI C.
@@ -53,7 +56,7 @@ extern "C" {
/* Version number: (major<<16) + (minor<<8) + subminor */
-#define LIBINTL_VERSION 0x001100
+#define LIBINTL_VERSION 0x001201
extern int libintl_version;
@@ -88,7 +91,7 @@ extern int libintl_version;
If he doesn't, we choose the method. A third possible method is
_INTL_REDIRECT_ASM, supported only by GCC. */
#if !(defined _INTL_REDIRECT_INLINE || defined _INTL_REDIRECT_MACROS)
-# if __GNUC__ >= 2 && !(__APPLE_CC__ > 1) && !defined __MINGW32__ && !(__GNUC__ == 2 && defined _AIX) && (defined __STDC__ || defined __cplusplus)
+# if defined __GNUC__ && __GNUC__ >= 2 && !(defined __APPLE_CC__ && __APPLE_CC__ > 1) && !defined __MINGW32__ && !(__GNUC__ == 2 && defined _AIX) && (defined __STDC__ || defined __cplusplus)
# define _INTL_REDIRECT_ASM
# else
# ifdef __cplusplus
@@ -110,7 +113,7 @@ extern int libintl_version;
/* _INTL_MAY_RETURN_STRING_ARG(n) declares that the given function may return
its n-th argument literally. This enables GCC to warn for example about
printf (gettext ("foo %y")). */
-#if __GNUC__ >= 3 && !(__APPLE_CC__ > 1 && defined __cplusplus)
+#if defined __GNUC__ && __GNUC__ >= 3 && !(defined __APPLE_CC__ && __APPLE_CC__ > 1 && defined __cplusplus)
# define _INTL_MAY_RETURN_STRING_ARG(n) __attribute__ ((__format_arg__ (n)))
#else
# define _INTL_MAY_RETURN_STRING_ARG(n)
@@ -157,10 +160,10 @@ extern char *dgettext (const char *__domainname, const char *__msgid)
locale. */
#ifdef _INTL_REDIRECT_INLINE
extern char *libintl_dcgettext (const char *__domainname, const char *__msgid,
- int __category)
+ int __category)
_INTL_MAY_RETURN_STRING_ARG (2);
static inline char *dcgettext (const char *__domainname, const char *__msgid,
- int __category)
+ int __category)
{
return libintl_dcgettext (__domainname, __msgid, __category);
}
@@ -169,7 +172,7 @@ static inline char *dcgettext (const char *__domainname, const char *__msgid,
# define dcgettext libintl_dcgettext
#endif
extern char *dcgettext (const char *__domainname, const char *__msgid,
- int __category)
+ int __category)
_INTL_ASM (libintl_dcgettext)
_INTL_MAY_RETURN_STRING_ARG (2);
#endif
@@ -179,10 +182,10 @@ extern char *dcgettext (const char *__domainname, const char *__msgid,
number N. */
#ifdef _INTL_REDIRECT_INLINE
extern char *libintl_ngettext (const char *__msgid1, const char *__msgid2,
- unsigned long int __n)
+ unsigned long int __n)
_INTL_MAY_RETURN_STRING_ARG (1) _INTL_MAY_RETURN_STRING_ARG (2);
static inline char *ngettext (const char *__msgid1, const char *__msgid2,
- unsigned long int __n)
+ unsigned long int __n)
{
return libintl_ngettext (__msgid1, __msgid2, __n);
}
@@ -191,7 +194,7 @@ static inline char *ngettext (const char *__msgid1, const char *__msgid2,
# define ngettext libintl_ngettext
#endif
extern char *ngettext (const char *__msgid1, const char *__msgid2,
- unsigned long int __n)
+ unsigned long int __n)
_INTL_ASM (libintl_ngettext)
_INTL_MAY_RETURN_STRING_ARG (1) _INTL_MAY_RETURN_STRING_ARG (2);
#endif
@@ -200,10 +203,10 @@ extern char *ngettext (const char *__msgid1, const char *__msgid2,
number N. */
#ifdef _INTL_REDIRECT_INLINE
extern char *libintl_dngettext (const char *__domainname, const char *__msgid1,
- const char *__msgid2, unsigned long int __n)
+ const char *__msgid2, unsigned long int __n)
_INTL_MAY_RETURN_STRING_ARG (2) _INTL_MAY_RETURN_STRING_ARG (3);
static inline char *dngettext (const char *__domainname, const char *__msgid1,
- const char *__msgid2, unsigned long int __n)
+ const char *__msgid2, unsigned long int __n)
{
return libintl_dngettext (__domainname, __msgid1, __msgid2, __n);
}
@@ -212,8 +215,8 @@ static inline char *dngettext (const char *__domainname, const char *__msgid1,
# define dngettext libintl_dngettext
#endif
extern char *dngettext (const char *__domainname,
- const char *__msgid1, const char *__msgid2,
- unsigned long int __n)
+ const char *__msgid1, const char *__msgid2,
+ unsigned long int __n)
_INTL_ASM (libintl_dngettext)
_INTL_MAY_RETURN_STRING_ARG (2) _INTL_MAY_RETURN_STRING_ARG (3);
#endif
@@ -222,12 +225,12 @@ extern char *dngettext (const char *__domainname,
number N. */
#ifdef _INTL_REDIRECT_INLINE
extern char *libintl_dcngettext (const char *__domainname,
- const char *__msgid1, const char *__msgid2,
- unsigned long int __n, int __category)
+ const char *__msgid1, const char *__msgid2,
+ unsigned long int __n, int __category)
_INTL_MAY_RETURN_STRING_ARG (2) _INTL_MAY_RETURN_STRING_ARG (3);
static inline char *dcngettext (const char *__domainname,
- const char *__msgid1, const char *__msgid2,
- unsigned long int __n, int __category)
+ const char *__msgid1, const char *__msgid2,
+ unsigned long int __n, int __category)
{
return libintl_dcngettext (__domainname, __msgid1, __msgid2, __n, __category);
}
@@ -236,8 +239,8 @@ static inline char *dcngettext (const char *__domainname,
# define dcngettext libintl_dcngettext
#endif
extern char *dcngettext (const char *__domainname,
- const char *__msgid1, const char *__msgid2,
- unsigned long int __n, int __category)
+ const char *__msgid1, const char *__msgid2,
+ unsigned long int __n, int __category)
_INTL_ASM (libintl_dcngettext)
_INTL_MAY_RETURN_STRING_ARG (2) _INTL_MAY_RETURN_STRING_ARG (3);
#endif
@@ -266,9 +269,9 @@ extern char *textdomain (const char *__domainname)
in DIRNAME rather than in the system locale data base. */
#ifdef _INTL_REDIRECT_INLINE
extern char *libintl_bindtextdomain (const char *__domainname,
- const char *__dirname);
+ const char *__dirname);
static inline char *bindtextdomain (const char *__domainname,
- const char *__dirname)
+ const char *__dirname)
{
return libintl_bindtextdomain (__domainname, __dirname);
}
@@ -284,9 +287,9 @@ extern char *bindtextdomain (const char *__domainname, const char *__dirname)
DOMAINNAME message catalog will be returned. */
#ifdef _INTL_REDIRECT_INLINE
extern char *libintl_bind_textdomain_codeset (const char *__domainname,
- const char *__codeset);
+ const char *__codeset);
static inline char *bind_textdomain_codeset (const char *__domainname,
- const char *__codeset)
+ const char *__codeset)
{
return libintl_bind_textdomain_codeset (__domainname, __codeset);
}
@@ -295,7 +298,7 @@ static inline char *bind_textdomain_codeset (const char *__domainname,
# define bind_textdomain_codeset libintl_bind_textdomain_codeset
#endif
extern char *bind_textdomain_codeset (const char *__domainname,
- const char *__codeset)
+ const char *__codeset)
_INTL_ASM (libintl_bind_textdomain_codeset);
#endif
@@ -316,58 +319,84 @@ extern char *bind_textdomain_codeset (const char *__domainname,
#include <stddef.h>
/* Get va_list. */
-#if __STDC__ || defined __cplusplus || defined _MSC_VER
+#if (defined __STDC__ && __STDC__) || defined __cplusplus || defined _MSC_VER
# include <stdarg.h>
#else
# include <varargs.h>
#endif
+#if !(defined fprintf && defined _GL_STDIO_H) /* don't override gnulib */
#undef fprintf
#define fprintf libintl_fprintf
extern int fprintf (FILE *, const char *, ...);
+#endif
+#if !(defined vfprintf && defined _GL_STDIO_H) /* don't override gnulib */
#undef vfprintf
#define vfprintf libintl_vfprintf
extern int vfprintf (FILE *, const char *, va_list);
+#endif
+#if !(defined printf && defined _GL_STDIO_H) /* don't override gnulib */
#undef printf
#if defined __NetBSD__ || defined __BEOS__ || defined __CYGWIN__ || defined __MINGW32__
/* Don't break __attribute__((format(printf,M,N))).
This redefinition is only possible because the libc in NetBSD, Cygwin,
- mingw does not have a function __printf__. */
+ mingw does not have a function __printf__.
+ Alternatively, we could have done this redirection only when compiling with
+ __GNUC__, together with a symbol redirection:
+ extern int printf (const char *, ...)
+ __asm__ (#__USER_LABEL_PREFIX__ "libintl_printf");
+ But doing it now would introduce a binary incompatibility with already
+ distributed versions of libintl on these systems. */
# define libintl_printf __printf__
#endif
#define printf libintl_printf
extern int printf (const char *, ...);
+#endif
+#if !(defined vprintf && defined _GL_STDIO_H) /* don't override gnulib */
#undef vprintf
#define vprintf libintl_vprintf
extern int vprintf (const char *, va_list);
+#endif
+#if !(defined sprintf && defined _GL_STDIO_H) /* don't override gnulib */
#undef sprintf
#define sprintf libintl_sprintf
extern int sprintf (char *, const char *, ...);
+#endif
+#if !(defined vsprintf && defined _GL_STDIO_H) /* don't override gnulib */
#undef vsprintf
#define vsprintf libintl_vsprintf
extern int vsprintf (char *, const char *, va_list);
+#endif
#if @HAVE_SNPRINTF@
+#if !(defined snprintf && defined _GL_STDIO_H) /* don't override gnulib */
#undef snprintf
#define snprintf libintl_snprintf
extern int snprintf (char *, size_t, const char *, ...);
+#endif
+#if !(defined vsnprintf && defined _GL_STDIO_H) /* don't override gnulib */
#undef vsnprintf
#define vsnprintf libintl_vsnprintf
extern int vsnprintf (char *, size_t, const char *, va_list);
+#endif
#endif
#if @HAVE_ASPRINTF@
+#if !(defined asprintf && defined _GL_STDIO_H) /* don't override gnulib */
#undef asprintf
#define asprintf libintl_asprintf
extern int asprintf (char **, const char *, ...);
+#endif
+#if !(defined vasprintf && defined _GL_STDIO_H) /* don't override gnulib */
#undef vasprintf
#define vasprintf libintl_vasprintf
extern int vasprintf (char **, const char *, va_list);
+#endif
#endif
@@ -399,6 +428,24 @@ extern int vswprintf (wchar_t *, size_t, const wchar_t *, va_list);
#endif
+/* Support for the locale chosen by the user. */
+#if (defined __APPLE__ && defined __MACH__) || defined _WIN32 || defined __WIN32__ || defined __CYGWIN__
+
+#undef setlocale
+#define setlocale libintl_setlocale
+extern char *setlocale (int, const char *);
+
+#if @HAVE_NEWLOCALE@
+
+#undef newlocale
+#define newlocale libintl_newlocale
+extern locale_t newlocale (int, const char *, locale_t);
+
+#endif
+
+#endif
+
+
/* Support for relocatable packages. */
/* Sets the original and the current installation prefix of the package.
@@ -409,7 +456,7 @@ extern int vswprintf (wchar_t *, size_t, const wchar_t *, va_list);
#define libintl_set_relocation_prefix libintl_set_relocation_prefix
extern void
libintl_set_relocation_prefix (const char *orig_prefix,
- const char *curr_prefix);
+ const char *curr_prefix);
#ifdef __cplusplus
diff --git a/intl/libintl.rc b/intl/libintl.rc
index f00f0b37..b58fffbd 100644
--- a/intl/libintl.rc
+++ b/intl/libintl.rc
@@ -21,10 +21,10 @@ BEGIN
BEGIN
VALUE "Comments", "This library is free software; you can redistribute it and/or modify it under the terms of the GNU Library General Public License. You should have received a copy of the GNU Library General Public License along with this library; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA\0"
VALUE "CompanyName", "Free Software Foundation\0"
- VALUE "FileDescription", "LGPLed libintl for Windows NT/2000/XP/Vista and Windows 95/98/ME\0"
+ VALUE "FileDescription", "LGPLed libintl for Windows NT/2000/XP/Vista/7 and Windows 95/98/ME\0"
VALUE "FileVersion", PACKAGE_VERSION_STRING "\0"
VALUE "InternalName", "intl.dll\0"
- VALUE "LegalCopyright", "Copyright (C) 1995-2007\0"
+ VALUE "LegalCopyright", "Copyright (C) 1995-2010\0"
VALUE "LegalTrademarks", "\0"
VALUE "OriginalFilename", "intl.dll\0"
VALUE "ProductName", "libintl: accessing NLS message catalogs\0"
diff --git a/intl/loadmsgcat.c b/intl/loadmsgcat.c
index 3432a8c1..bf883a37 100644
--- a/intl/loadmsgcat.c
+++ b/intl/loadmsgcat.c
@@ -1,5 +1,5 @@
/* Load needed message catalogs.
- Copyright (C) 1995-1999, 2000-2007 Free Software Foundation, Inc.
+ Copyright (C) 1995-1999, 2000-2008 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
@@ -1259,8 +1259,7 @@ _nl_load_domain (struct loaded_l10nfile *domain_file,
/* This is an invalid revision. */
invalid:
/* This is an invalid .mo file. */
- if (domain->malloced)
- free (domain->malloced);
+ free (domain->malloced);
#ifdef HAVE_MMAP
if (use_mmap)
munmap ((caddr_t) data, size);
@@ -1317,12 +1316,10 @@ _nl_unload_domain (struct loaded_domain *domain)
if (convd->conv != (__gconv_t) -1)
__gconv_close (convd->conv);
}
- if (domain->conversions != NULL)
- free (domain->conversions);
+ free (domain->conversions);
__libc_rwlock_fini (domain->conversions_lock);
- if (domain->malloced)
- free (domain->malloced);
+ free (domain->malloced);
# ifdef _POSIX_MAPPED_FILES
if (domain->use_mmap)
diff --git a/intl/localcharset.c b/intl/localcharset.c
index e796ae71..cbcdaceb 100644
--- a/intl/localcharset.c
+++ b/intl/localcharset.c
@@ -1,6 +1,6 @@
/* Determine a canonical name for the current locale's character encoding.
- Copyright (C) 2000-2006 Free Software Foundation, Inc.
+ Copyright (C) 2000-2006, 2008-2010 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
@@ -24,21 +24,29 @@
/* Specification. */
#include "localcharset.h"
+#include <fcntl.h>
#include <stddef.h>
#include <stdio.h>
#include <string.h>
#include <stdlib.h>
+#if defined __APPLE__ && defined __MACH__ && HAVE_LANGINFO_CODESET
+# define DARWIN7 /* Darwin 7 or newer, i.e. MacOS X 10.3 or newer */
+#endif
+
#if defined _WIN32 || defined __WIN32__
# define WIN32_NATIVE
#endif
#if defined __EMX__
/* Assume EMX program runs on OS/2, even if compiled under DOS. */
-# define OS2
+# ifndef OS2
+# define OS2
+# endif
#endif
#if !defined WIN32_NATIVE
+# include <unistd.h>
# if HAVE_LANGINFO_CODESET
# include <langinfo.h>
# else
@@ -70,6 +78,11 @@
# include "configmake.h"
#endif
+/* Define O_NOFOLLOW to 0 on platforms where it does not exist. */
+#ifndef O_NOFOLLOW
+# define O_NOFOLLOW 0
+#endif
+
#if defined _WIN32 || defined __WIN32__ || defined __CYGWIN__ || defined __EMX__ || defined __DJGPP__
/* Win32, Cygwin, OS/2, DOS */
# define ISSLASH(C) ((C) == '/' || (C) == '\\')
@@ -111,160 +124,220 @@ get_charset_aliases (void)
cp = charset_aliases;
if (cp == NULL)
{
-#if !(defined VMS || defined WIN32_NATIVE || defined __CYGWIN__)
- FILE *fp;
+#if !(defined DARWIN7 || defined VMS || defined WIN32_NATIVE || defined __CYGWIN__)
const char *dir;
const char *base = "charset.alias";
char *file_name;
/* Make it possible to override the charset.alias location. This is
- necessary for running the testsuite before "make install". */
+ necessary for running the testsuite before "make install". */
dir = getenv ("CHARSETALIASDIR");
if (dir == NULL || dir[0] == '\0')
- dir = relocate (LIBDIR);
+ dir = relocate (LIBDIR);
/* Concatenate dir and base into freshly allocated file_name. */
{
- size_t dir_len = strlen (dir);
- size_t base_len = strlen (base);
- int add_slash = (dir_len > 0 && !ISSLASH (dir[dir_len - 1]));
- file_name = (char *) malloc (dir_len + add_slash + base_len + 1);
- if (file_name != NULL)
- {
- memcpy (file_name, dir, dir_len);
- if (add_slash)
- file_name[dir_len] = DIRECTORY_SEPARATOR;
- memcpy (file_name + dir_len + add_slash, base, base_len + 1);
- }
+ size_t dir_len = strlen (dir);
+ size_t base_len = strlen (base);
+ int add_slash = (dir_len > 0 && !ISSLASH (dir[dir_len - 1]));
+ file_name = (char *) malloc (dir_len + add_slash + base_len + 1);
+ if (file_name != NULL)
+ {
+ memcpy (file_name, dir, dir_len);
+ if (add_slash)
+ file_name[dir_len] = DIRECTORY_SEPARATOR;
+ memcpy (file_name + dir_len + add_slash, base, base_len + 1);
+ }
}
- if (file_name == NULL || (fp = fopen (file_name, "r")) == NULL)
- /* Out of memory or file not found, treat it as empty. */
- cp = "";
+ if (file_name == NULL)
+ /* Out of memory. Treat the file as empty. */
+ cp = "";
else
- {
- /* Parse the file's contents. */
- char *res_ptr = NULL;
- size_t res_size = 0;
-
- for (;;)
- {
- int c;
- char buf1[50+1];
- char buf2[50+1];
- size_t l1, l2;
- char *old_res_ptr;
-
- c = getc (fp);
- if (c == EOF)
- break;
- if (c == '\n' || c == ' ' || c == '\t')
- continue;
- if (c == '#')
- {
- /* Skip comment, to end of line. */
- do
- c = getc (fp);
- while (!(c == EOF || c == '\n'));
- if (c == EOF)
- break;
- continue;
- }
- ungetc (c, fp);
- if (fscanf (fp, "%50s %50s", buf1, buf2) < 2)
- break;
- l1 = strlen (buf1);
- l2 = strlen (buf2);
- old_res_ptr = res_ptr;
- if (res_size == 0)
- {
- res_size = l1 + 1 + l2 + 1;
- res_ptr = (char *) malloc (res_size + 1);
- }
- else
- {
- res_size += l1 + 1 + l2 + 1;
- res_ptr = (char *) realloc (res_ptr, res_size + 1);
- }
- if (res_ptr == NULL)
- {
- /* Out of memory. */
- res_size = 0;
- if (old_res_ptr != NULL)
- free (old_res_ptr);
- break;
- }
- strcpy (res_ptr + res_size - (l2 + 1) - (l1 + 1), buf1);
- strcpy (res_ptr + res_size - (l2 + 1), buf2);
- }
- fclose (fp);
- if (res_size == 0)
- cp = "";
- else
- {
- *(res_ptr + res_size) = '\0';
- cp = res_ptr;
- }
- }
-
- if (file_name != NULL)
- free (file_name);
+ {
+ int fd;
+
+ /* Open the file. Reject symbolic links on platforms that support
+ O_NOFOLLOW. This is a security feature. Without it, an attacker
+ could retrieve parts of the contents (namely, the tail of the
+ first line that starts with "* ") of an arbitrary file by placing
+ a symbolic link to that file under the name "charset.alias" in
+ some writable directory and defining the environment variable
+ CHARSETALIASDIR to point to that directory. */
+ fd = open (file_name,
+ O_RDONLY | (HAVE_WORKING_O_NOFOLLOW ? O_NOFOLLOW : 0));
+ if (fd < 0)
+ /* File not found. Treat it as empty. */
+ cp = "";
+ else
+ {
+ FILE *fp;
+
+ fp = fdopen (fd, "r");
+ if (fp == NULL)
+ {
+ /* Out of memory. Treat the file as empty. */
+ close (fd);
+ cp = "";
+ }
+ else
+ {
+ /* Parse the file's contents. */
+ char *res_ptr = NULL;
+ size_t res_size = 0;
+
+ for (;;)
+ {
+ int c;
+ char buf1[50+1];
+ char buf2[50+1];
+ size_t l1, l2;
+ char *old_res_ptr;
+
+ c = getc (fp);
+ if (c == EOF)
+ break;
+ if (c == '\n' || c == ' ' || c == '\t')
+ continue;
+ if (c == '#')
+ {
+ /* Skip comment, to end of line. */
+ do
+ c = getc (fp);
+ while (!(c == EOF || c == '\n'));
+ if (c == EOF)
+ break;
+ continue;
+ }
+ ungetc (c, fp);
+ if (fscanf (fp, "%50s %50s", buf1, buf2) < 2)
+ break;
+ l1 = strlen (buf1);
+ l2 = strlen (buf2);
+ old_res_ptr = res_ptr;
+ if (res_size == 0)
+ {
+ res_size = l1 + 1 + l2 + 1;
+ res_ptr = (char *) malloc (res_size + 1);
+ }
+ else
+ {
+ res_size += l1 + 1 + l2 + 1;
+ res_ptr = (char *) realloc (res_ptr, res_size + 1);
+ }
+ if (res_ptr == NULL)
+ {
+ /* Out of memory. */
+ res_size = 0;
+ if (old_res_ptr != NULL)
+ free (old_res_ptr);
+ break;
+ }
+ strcpy (res_ptr + res_size - (l2 + 1) - (l1 + 1), buf1);
+ strcpy (res_ptr + res_size - (l2 + 1), buf2);
+ }
+ fclose (fp);
+ if (res_size == 0)
+ cp = "";
+ else
+ {
+ *(res_ptr + res_size) = '\0';
+ cp = res_ptr;
+ }
+ }
+ }
+
+ free (file_name);
+ }
#else
+# if defined DARWIN7
+ /* To avoid the trouble of installing a file that is shared by many
+ GNU packages -- many packaging systems have problems with this --,
+ simply inline the aliases here. */
+ cp = "ISO8859-1" "\0" "ISO-8859-1" "\0"
+ "ISO8859-2" "\0" "ISO-8859-2" "\0"
+ "ISO8859-4" "\0" "ISO-8859-4" "\0"
+ "ISO8859-5" "\0" "ISO-8859-5" "\0"
+ "ISO8859-7" "\0" "ISO-8859-7" "\0"
+ "ISO8859-9" "\0" "ISO-8859-9" "\0"
+ "ISO8859-13" "\0" "ISO-8859-13" "\0"
+ "ISO8859-15" "\0" "ISO-8859-15" "\0"
+ "KOI8-R" "\0" "KOI8-R" "\0"
+ "KOI8-U" "\0" "KOI8-U" "\0"
+ "CP866" "\0" "CP866" "\0"
+ "CP949" "\0" "CP949" "\0"
+ "CP1131" "\0" "CP1131" "\0"
+ "CP1251" "\0" "CP1251" "\0"
+ "eucCN" "\0" "GB2312" "\0"
+ "GB2312" "\0" "GB2312" "\0"
+ "eucJP" "\0" "EUC-JP" "\0"
+ "eucKR" "\0" "EUC-KR" "\0"
+ "Big5" "\0" "BIG5" "\0"
+ "Big5HKSCS" "\0" "BIG5-HKSCS" "\0"
+ "GBK" "\0" "GBK" "\0"
+ "GB18030" "\0" "GB18030" "\0"
+ "SJIS" "\0" "SHIFT_JIS" "\0"
+ "ARMSCII-8" "\0" "ARMSCII-8" "\0"
+ "PT154" "\0" "PT154" "\0"
+ /*"ISCII-DEV" "\0" "?" "\0"*/
+ "*" "\0" "UTF-8" "\0";
+# endif
+
# 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. */
+ 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". */
+ "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";
+ "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_NATIVE || defined __CYGWIN__
/* 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. */
+ directory as the DLL and of retrieving the DLL's directory at
+ runtime, simply inline the aliases here. */
cp = "CP936" "\0" "GBK" "\0"
- "CP1361" "\0" "JOHAB" "\0"
- "CP20127" "\0" "ASCII" "\0"
- "CP20866" "\0" "KOI8-R" "\0"
- "CP20936" "\0" "GB2312" "\0"
- "CP21866" "\0" "KOI8-RU" "\0"
- "CP28591" "\0" "ISO-8859-1" "\0"
- "CP28592" "\0" "ISO-8859-2" "\0"
- "CP28593" "\0" "ISO-8859-3" "\0"
- "CP28594" "\0" "ISO-8859-4" "\0"
- "CP28595" "\0" "ISO-8859-5" "\0"
- "CP28596" "\0" "ISO-8859-6" "\0"
- "CP28597" "\0" "ISO-8859-7" "\0"
- "CP28598" "\0" "ISO-8859-8" "\0"
- "CP28599" "\0" "ISO-8859-9" "\0"
- "CP28605" "\0" "ISO-8859-15" "\0"
- "CP38598" "\0" "ISO-8859-8" "\0"
- "CP51932" "\0" "EUC-JP" "\0"
- "CP51936" "\0" "GB2312" "\0"
- "CP51949" "\0" "EUC-KR" "\0"
- "CP51950" "\0" "EUC-TW" "\0"
- "CP54936" "\0" "GB18030" "\0"
- "CP65001" "\0" "UTF-8" "\0";
+ "CP1361" "\0" "JOHAB" "\0"
+ "CP20127" "\0" "ASCII" "\0"
+ "CP20866" "\0" "KOI8-R" "\0"
+ "CP20936" "\0" "GB2312" "\0"
+ "CP21866" "\0" "KOI8-RU" "\0"
+ "CP28591" "\0" "ISO-8859-1" "\0"
+ "CP28592" "\0" "ISO-8859-2" "\0"
+ "CP28593" "\0" "ISO-8859-3" "\0"
+ "CP28594" "\0" "ISO-8859-4" "\0"
+ "CP28595" "\0" "ISO-8859-5" "\0"
+ "CP28596" "\0" "ISO-8859-6" "\0"
+ "CP28597" "\0" "ISO-8859-7" "\0"
+ "CP28598" "\0" "ISO-8859-8" "\0"
+ "CP28599" "\0" "ISO-8859-9" "\0"
+ "CP28605" "\0" "ISO-8859-15" "\0"
+ "CP38598" "\0" "ISO-8859-8" "\0"
+ "CP51932" "\0" "EUC-JP" "\0"
+ "CP51936" "\0" "GB2312" "\0"
+ "CP51949" "\0" "EUC-KR" "\0"
+ "CP51950" "\0" "EUC-TW" "\0"
+ "CP54936" "\0" "GB18030" "\0"
+ "CP65001" "\0" "UTF-8" "\0";
# endif
#endif
@@ -297,10 +370,9 @@ locale_charset (void)
codeset = nl_langinfo (CODESET);
# ifdef __CYGWIN__
- /* Cygwin 2006 does not have locales. nl_langinfo (CODESET) always
- returns "US-ASCII". As long as this is not fixed, return the suffix
- of the locale name from the environment variables (if present) or
- the codepage as a number. */
+ /* Cygwin < 1.7 does not have locales. nl_langinfo (CODESET) always
+ returns "US-ASCII". Return the suffix of the locale name from the
+ environment variables (if present) or the codepage as a number. */
if (codeset != NULL && strcmp (codeset, "US-ASCII") == 0)
{
const char *locale;
@@ -308,36 +380,46 @@ locale_charset (void)
locale = getenv ("LC_ALL");
if (locale == NULL || locale[0] == '\0')
- {
- locale = getenv ("LC_CTYPE");
- if (locale == NULL || locale[0] == '\0')
- locale = getenv ("LANG");
- }
+ {
+ locale = getenv ("LC_CTYPE");
+ if (locale == NULL || locale[0] == '\0')
+ locale = getenv ("LANG");
+ }
if (locale != NULL && locale[0] != '\0')
- {
- /* If the locale name contains an encoding after the dot, return
- it. */
- const char *dot = strchr (locale, '.');
-
- if (dot != NULL)
- {
- const char *modifier;
-
- dot++;
- /* Look for the possible @... trailer and remove it, if any. */
- modifier = strchr (dot, '@');
- if (modifier == NULL)
- return dot;
- if (modifier - dot < sizeof (buf))
- {
- memcpy (buf, dot, modifier - dot);
- buf [modifier - dot] = '\0';
- return buf;
- }
- }
- }
-
- /* Woe32 has a function returning the locale's codepage as a number. */
+ {
+ /* If the locale name contains an encoding after the dot, return
+ it. */
+ const char *dot = strchr (locale, '.');
+
+ if (dot != NULL)
+ {
+ const char *modifier;
+
+ dot++;
+ /* Look for the possible @... trailer and remove it, if any. */
+ modifier = strchr (dot, '@');
+ if (modifier == NULL)
+ return dot;
+ if (modifier - dot < sizeof (buf))
+ {
+ memcpy (buf, dot, modifier - dot);
+ buf [modifier - dot] = '\0';
+ return buf;
+ }
+ }
+ }
+
+ /* Woe32 has a function returning the locale's codepage as a number:
+ GetACP(). This encoding is used by Cygwin, unless the user has set
+ the environment variable CYGWIN=codepage:oem (which very few people
+ do).
+ Output directed to console windows needs to be converted (to
+ GetOEMCP() if the console is using a raster font, or to
+ GetConsoleOutputCP() if it is using a TrueType font). Cygwin does
+ this conversion transparently (see winsup/cygwin/fhandler_console.cc),
+ converting to GetConsoleOutputCP(). This leads to correct results,
+ except when SetConsoleOutputCP has been called and a raster font is
+ in use. */
sprintf (buf, "CP%u", GetACP ());
codeset = buf;
}
@@ -359,11 +441,11 @@ locale_charset (void)
{
locale = getenv ("LC_ALL");
if (locale == NULL || locale[0] == '\0')
- {
- locale = getenv ("LC_CTYPE");
- if (locale == NULL || locale[0] == '\0')
- locale = getenv ("LANG");
- }
+ {
+ locale = getenv ("LC_CTYPE");
+ if (locale == NULL || locale[0] == '\0')
+ locale = getenv ("LANG");
+ }
}
/* On some old systems, one used to set locale = "iso8859_1". On others,
@@ -377,7 +459,13 @@ locale_charset (void)
static char buf[2 + 10 + 1];
- /* Woe32 has a function returning the locale's codepage as a number. */
+ /* Woe32 has a function returning the locale's codepage as a number:
+ GetACP().
+ When the output goes to a console window, it needs to be provided in
+ GetOEMCP() encoding if the console is using a raster font, or in
+ GetConsoleOutputCP() encoding if it is using a TrueType font.
+ But in GUI programs and for output sent to files and pipes, GetACP()
+ encoding is the best bet. */
sprintf (buf, "CP%u", GetACP ());
codeset = buf;
@@ -395,7 +483,7 @@ locale_charset (void)
{
locale = getenv ("LC_CTYPE");
if (locale == NULL || locale[0] == '\0')
- locale = getenv ("LANG");
+ locale = getenv ("LANG");
}
if (locale != NULL && locale[0] != '\0')
{
@@ -403,21 +491,21 @@ locale_charset (void)
const char *dot = strchr (locale, '.');
if (dot != NULL)
- {
- const char *modifier;
-
- dot++;
- /* Look for the possible @... trailer and remove it, if any. */
- modifier = strchr (dot, '@');
- if (modifier == NULL)
- return dot;
- if (modifier - dot < sizeof (buf))
- {
- memcpy (buf, dot, modifier - dot);
- buf [modifier - dot] = '\0';
- return buf;
- }
- }
+ {
+ const char *modifier;
+
+ dot++;
+ /* Look for the possible @... trailer and remove it, if any. */
+ modifier = strchr (dot, '@');
+ if (modifier == NULL)
+ return dot;
+ if (modifier - dot < sizeof (buf))
+ {
+ memcpy (buf, dot, modifier - dot);
+ buf [modifier - dot] = '\0';
+ return buf;
+ }
+ }
/* Resolve through the charset.alias file. */
codeset = locale;
@@ -426,12 +514,12 @@ locale_charset (void)
{
/* OS/2 has a function returning the locale's codepage as a number. */
if (DosQueryCp (sizeof (cp), cp, &cplen))
- codeset = "";
+ codeset = "";
else
- {
- sprintf (buf, "CP%u", cp[0]);
- codeset = buf;
- }
+ {
+ sprintf (buf, "CP%u", cp[0]);
+ codeset = buf;
+ }
}
#endif
@@ -445,10 +533,10 @@ locale_charset (void)
*aliases != '\0';
aliases += strlen (aliases) + 1, aliases += strlen (aliases) + 1)
if (strcmp (codeset, aliases) == 0
- || (aliases[0] == '*' && aliases[1] == '\0'))
+ || (aliases[0] == '*' && aliases[1] == '\0'))
{
- codeset = aliases + strlen (aliases) + 1;
- break;
+ codeset = aliases + strlen (aliases) + 1;
+ break;
}
/* Don't return an empty string. GNU libc and GNU libiconv interpret
diff --git a/intl/localename.c b/intl/localename.c
index af4c229a..89a9692b 100644
--- a/intl/localename.c
+++ b/intl/localename.c
@@ -1,5 +1,5 @@
/* Determine name of the currently selected locale.
- Copyright (C) 1995-1999, 2000-2007 Free Software Foundation, Inc.
+ Copyright (C) 1995-1999, 2000-2010 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
@@ -29,11 +29,24 @@
# include "localename.h"
#endif
+#include <limits.h>
+#include <stddef.h>
#include <stdlib.h>
#include <locale.h>
+#include <string.h>
+
+#if HAVE_USELOCALE
+/* MacOS X 10.5 defines the locale_t type in <xlocale.h>. */
+# if defined __APPLE__ && defined __MACH__
+# include <xlocale.h>
+# endif
+# include <langinfo.h>
+# if !defined IN_LIBINTL
+# include "glthread/lock.h"
+# endif
+#endif
#if HAVE_CFLOCALECOPYCURRENT || HAVE_CFPREFERENCESCOPYAPPVALUE
-# include <string.h>
# include <CoreFoundation/CFString.h>
# if HAVE_CFLOCALECOPYCURRENT
# include <CoreFoundation/CFLocale.h>
@@ -46,7 +59,7 @@
# define WIN32_NATIVE
#endif
-#ifdef WIN32_NATIVE
+#if defined WIN32_NATIVE || defined __CYGWIN__ /* WIN32 or Cygwin */
# define WIN32_LEAN_AND_MEAN
# include <windows.h>
/* List of language codes, sorted by value:
@@ -72,7 +85,7 @@
0x14 LANG_NORWEGIAN
0x15 LANG_POLISH
0x16 LANG_PORTUGUESE
- 0x17 LANG_RHAETO_ROMANCE
+ 0x17 LANG_ROMANSH
0x18 LANG_ROMANIAN
0x19 LANG_RUSSIAN
0x1a LANG_CROATIAN == LANG_SERBIAN
@@ -108,7 +121,7 @@
0x38 LANG_FAEROESE
0x39 LANG_HINDI
0x3a LANG_MALTESE
- 0x3b LANG_SAAMI
+ 0x3b LANG_SAMI
0x3c LANG_GAELIC
0x3d LANG_YIDDISH
0x3e LANG_MALAY
@@ -156,6 +169,9 @@
0x68 LANG_HAUSA
0x69 LANG_IBIBIO
0x6a LANG_YORUBA
+ 0x6d LANG_BASHKIR
+ 0x6e LANG_LUXEMBOURGISH
+ 0x6f LANG_GREENLANDIC
0x70 LANG_IGBO
0x71 LANG_KANURI
0x72 LANG_OROMO
@@ -166,6 +182,18 @@
0x77 LANG_SOMALI
0x78 LANG_YI
0x79 LANG_PAPIAMENTU
+ 0x7a LANG_MAPUDUNGUN
+ 0x7c LANG_MOHAWK
+ 0x7e LANG_BRETON
+ 0x82 LANG_OCCITAN
+ 0x83 LANG_CORSICAN
+ 0x84 LANG_ALSATIAN
+ 0x85 LANG_YAKUT
+ 0x86 LANG_KICHE
+ 0x87 LANG_KINYARWANDA
+ 0x88 LANG_WOLOF
+ 0x8c LANG_DARI
+ 0x91 LANG_SCOTTISH_GAELIC
*/
/* Mingw headers don't have latest language and sublanguage codes. */
# ifndef LANG_AFRIKAANS
@@ -174,6 +202,9 @@
# ifndef LANG_ALBANIAN
# define LANG_ALBANIAN 0x1c
# endif
+# ifndef LANG_ALSATIAN
+# define LANG_ALSATIAN 0x84
+# endif
# ifndef LANG_AMHARIC
# define LANG_AMHARIC 0x5e
# endif
@@ -189,6 +220,9 @@
# ifndef LANG_AZERI
# define LANG_AZERI 0x2c
# endif
+# ifndef LANG_BASHKIR
+# define LANG_BASHKIR 0x6d
+# endif
# ifndef LANG_BASQUE
# define LANG_BASQUE 0x2d
# endif
@@ -198,6 +232,9 @@
# ifndef LANG_BENGALI
# define LANG_BENGALI 0x45
# endif
+# ifndef LANG_BRETON
+# define LANG_BRETON 0x7e
+# endif
# ifndef LANG_BURMESE
# define LANG_BURMESE 0x55
# endif
@@ -210,6 +247,12 @@
# ifndef LANG_CHEROKEE
# define LANG_CHEROKEE 0x5c
# endif
+# ifndef LANG_CORSICAN
+# define LANG_CORSICAN 0x83
+# endif
+# ifndef LANG_DARI
+# define LANG_DARI 0x8c
+# endif
# ifndef LANG_DIVEHI
# define LANG_DIVEHI 0x65
# endif
@@ -240,6 +283,9 @@
# ifndef LANG_GEORGIAN
# define LANG_GEORGIAN 0x37
# endif
+# ifndef LANG_GREENLANDIC
+# define LANG_GREENLANDIC 0x6f
+# endif
# ifndef LANG_GUARANI
# define LANG_GUARANI 0x74
# endif
@@ -282,6 +328,12 @@
# ifndef LANG_KAZAK
# define LANG_KAZAK 0x3f
# endif
+# ifndef LANG_KICHE
+# define LANG_KICHE 0x86
+# endif
+# ifndef LANG_KINYARWANDA
+# define LANG_KINYARWANDA 0x87
+# endif
# ifndef LANG_KONKANI
# define LANG_KONKANI 0x57
# endif
@@ -300,6 +352,9 @@
# ifndef LANG_LITHUANIAN
# define LANG_LITHUANIAN 0x27
# endif
+# ifndef LANG_LUXEMBOURGISH
+# define LANG_LUXEMBOURGISH 0x6e
+# endif
# ifndef LANG_MACEDONIAN
# define LANG_MACEDONIAN 0x2f
# endif
@@ -315,15 +370,27 @@
# ifndef LANG_MANIPURI
# define LANG_MANIPURI 0x58
# endif
+# ifndef LANG_MAORI
+# define LANG_MAORI 0x81
+# endif
+# ifndef LANG_MAPUDUNGUN
+# define LANG_MAPUDUNGUN 0x7a
+# endif
# ifndef LANG_MARATHI
# define LANG_MARATHI 0x4e
# endif
+# ifndef LANG_MOHAWK
+# define LANG_MOHAWK 0x7c
+# endif
# ifndef LANG_MONGOLIAN
# define LANG_MONGOLIAN 0x50
# endif
# ifndef LANG_NEPALI
# define LANG_NEPALI 0x61
# endif
+# ifndef LANG_OCCITAN
+# define LANG_OCCITAN 0x82
+# endif
# ifndef LANG_ORIYA
# define LANG_ORIYA 0x48
# endif
@@ -339,15 +406,21 @@
# ifndef LANG_PUNJABI
# define LANG_PUNJABI 0x46
# endif
-# ifndef LANG_RHAETO_ROMANCE
-# define LANG_RHAETO_ROMANCE 0x17
+# ifndef LANG_QUECHUA
+# define LANG_QUECHUA 0x6b
# endif
-# ifndef LANG_SAAMI
-# define LANG_SAAMI 0x3b
+# ifndef LANG_ROMANSH
+# define LANG_ROMANSH 0x17
+# endif
+# ifndef LANG_SAMI
+# define LANG_SAMI 0x3b
# endif
# ifndef LANG_SANSKRIT
# define LANG_SANSKRIT 0x4f
# endif
+# ifndef LANG_SCOTTISH_GAELIC
+# define LANG_SCOTTISH_GAELIC 0x91
+# endif
# ifndef LANG_SERBIAN
# define LANG_SERBIAN 0x1a
# endif
@@ -366,6 +439,9 @@
# ifndef LANG_SORBIAN
# define LANG_SORBIAN 0x2e
# endif
+# ifndef LANG_SOTHO
+# define LANG_SOTHO 0x6c
+# endif
# ifndef LANG_SUTU
# define LANG_SUTU 0x30
# endif
@@ -411,6 +487,9 @@
# ifndef LANG_TURKMEN
# define LANG_TURKMEN 0x42
# endif
+# ifndef LANG_UIGHUR
+# define LANG_UIGHUR 0x80
+# endif
# ifndef LANG_UKRAINIAN
# define LANG_UKRAINIAN 0x22
# endif
@@ -429,9 +508,15 @@
# ifndef LANG_WELSH
# define LANG_WELSH 0x52
# endif
+# ifndef LANG_WOLOF
+# define LANG_WOLOF 0x88
+# endif
# ifndef LANG_XHOSA
# define LANG_XHOSA 0x34
# endif
+# ifndef LANG_YAKUT
+# define LANG_YAKUT 0x85
+# endif
# ifndef LANG_YI
# define LANG_YI 0x78
# endif
@@ -444,6 +529,18 @@
# ifndef LANG_ZULU
# define LANG_ZULU 0x35
# endif
+# ifndef SUBLANG_AFRIKAANS_SOUTH_AFRICA
+# define SUBLANG_AFRIKAANS_SOUTH_AFRICA 0x01
+# endif
+# ifndef SUBLANG_ALBANIAN_ALBANIA
+# define SUBLANG_ALBANIAN_ALBANIA 0x01
+# endif
+# ifndef SUBLANG_ALSATIAN_FRANCE
+# define SUBLANG_ALSATIAN_FRANCE 0x01
+# endif
+# ifndef SUBLANG_AMHARIC_ETHIOPIA
+# define SUBLANG_AMHARIC_ETHIOPIA 0x01
+# endif
# ifndef SUBLANG_ARABIC_SAUDI_ARABIA
# define SUBLANG_ARABIC_SAUDI_ARABIA 0x01
# endif
@@ -492,21 +589,78 @@
# ifndef SUBLANG_ARABIC_QATAR
# define SUBLANG_ARABIC_QATAR 0x10
# endif
+# ifndef SUBLANG_ARMENIAN_ARMENIA
+# define SUBLANG_ARMENIAN_ARMENIA 0x01
+# endif
+# ifndef SUBLANG_ASSAMESE_INDIA
+# define SUBLANG_ASSAMESE_INDIA 0x01
+# endif
# ifndef SUBLANG_AZERI_LATIN
# define SUBLANG_AZERI_LATIN 0x01
# endif
# ifndef SUBLANG_AZERI_CYRILLIC
# define SUBLANG_AZERI_CYRILLIC 0x02
# endif
+# ifndef SUBLANG_BASHKIR_RUSSIA
+# define SUBLANG_BASHKIR_RUSSIA 0x01
+# endif
+# ifndef SUBLANG_BASQUE_BASQUE
+# define SUBLANG_BASQUE_BASQUE 0x01
+# endif
+# ifndef SUBLANG_BELARUSIAN_BELARUS
+# define SUBLANG_BELARUSIAN_BELARUS 0x01
+# endif
# ifndef SUBLANG_BENGALI_INDIA
# define SUBLANG_BENGALI_INDIA 0x01
# endif
# ifndef SUBLANG_BENGALI_BANGLADESH
# define SUBLANG_BENGALI_BANGLADESH 0x02
# endif
+# ifndef SUBLANG_BOSNIAN_BOSNIA_HERZEGOVINA_LATIN
+# define SUBLANG_BOSNIAN_BOSNIA_HERZEGOVINA_LATIN 0x05
+# endif
+# ifndef SUBLANG_BOSNIAN_BOSNIA_HERZEGOVINA_CYRILLIC
+# define SUBLANG_BOSNIAN_BOSNIA_HERZEGOVINA_CYRILLIC 0x08
+# endif
+# ifndef SUBLANG_BRETON_FRANCE
+# define SUBLANG_BRETON_FRANCE 0x01
+# endif
+# ifndef SUBLANG_BULGARIAN_BULGARIA
+# define SUBLANG_BULGARIAN_BULGARIA 0x01
+# endif
+# ifndef SUBLANG_CAMBODIAN_CAMBODIA
+# define SUBLANG_CAMBODIAN_CAMBODIA 0x01
+# endif
+# ifndef SUBLANG_CATALAN_SPAIN
+# define SUBLANG_CATALAN_SPAIN 0x01
+# endif
+# ifndef SUBLANG_CORSICAN_FRANCE
+# define SUBLANG_CORSICAN_FRANCE 0x01
+# endif
+# ifndef SUBLANG_CROATIAN_CROATIA
+# define SUBLANG_CROATIAN_CROATIA 0x01
+# endif
+# ifndef SUBLANG_CROATIAN_BOSNIA_HERZEGOVINA_LATIN
+# define SUBLANG_CROATIAN_BOSNIA_HERZEGOVINA_LATIN 0x04
+# endif
# ifndef SUBLANG_CHINESE_MACAU
# define SUBLANG_CHINESE_MACAU 0x05
# endif
+# ifndef SUBLANG_CZECH_CZECH_REPUBLIC
+# define SUBLANG_CZECH_CZECH_REPUBLIC 0x01
+# endif
+# ifndef SUBLANG_DANISH_DENMARK
+# define SUBLANG_DANISH_DENMARK 0x01
+# endif
+# ifndef SUBLANG_DARI_AFGHANISTAN
+# define SUBLANG_DARI_AFGHANISTAN 0x01
+# endif
+# ifndef SUBLANG_DIVEHI_MALDIVES
+# define SUBLANG_DIVEHI_MALDIVES 0x01
+# endif
+# ifndef SUBLANG_DUTCH_SURINAM
+# define SUBLANG_DUTCH_SURINAM 0x03
+# endif
# ifndef SUBLANG_ENGLISH_SOUTH_AFRICA
# define SUBLANG_ENGLISH_SOUTH_AFRICA 0x07
# endif
@@ -543,6 +697,18 @@
# ifndef SUBLANG_ENGLISH_SINGAPORE
# define SUBLANG_ENGLISH_SINGAPORE 0x12
# endif
+# ifndef SUBLANG_ESTONIAN_ESTONIA
+# define SUBLANG_ESTONIAN_ESTONIA 0x01
+# endif
+# ifndef SUBLANG_FAEROESE_FAROE_ISLANDS
+# define SUBLANG_FAEROESE_FAROE_ISLANDS 0x01
+# endif
+# ifndef SUBLANG_FARSI_IRAN
+# define SUBLANG_FARSI_IRAN 0x01
+# endif
+# ifndef SUBLANG_FINNISH_FINLAND
+# define SUBLANG_FINNISH_FINLAND 0x01
+# endif
# ifndef SUBLANG_FRENCH_LUXEMBOURG
# define SUBLANG_FRENCH_LUXEMBOURG 0x05
# endif
@@ -576,48 +742,231 @@
# ifndef SUBLANG_FRENCH_HAITI
# define SUBLANG_FRENCH_HAITI 0x0f
# endif
+# ifndef SUBLANG_FRISIAN_NETHERLANDS
+# define SUBLANG_FRISIAN_NETHERLANDS 0x01
+# endif
+# ifndef SUBLANG_GALICIAN_SPAIN
+# define SUBLANG_GALICIAN_SPAIN 0x01
+# endif
+# ifndef SUBLANG_GEORGIAN_GEORGIA
+# define SUBLANG_GEORGIAN_GEORGIA 0x01
+# endif
# ifndef SUBLANG_GERMAN_LUXEMBOURG
# define SUBLANG_GERMAN_LUXEMBOURG 0x04
# endif
# ifndef SUBLANG_GERMAN_LIECHTENSTEIN
# define SUBLANG_GERMAN_LIECHTENSTEIN 0x05
# endif
+# ifndef SUBLANG_GREEK_GREECE
+# define SUBLANG_GREEK_GREECE 0x01
+# endif
+# ifndef SUBLANG_GREENLANDIC_GREENLAND
+# define SUBLANG_GREENLANDIC_GREENLAND 0x01
+# endif
+# ifndef SUBLANG_GUJARATI_INDIA
+# define SUBLANG_GUJARATI_INDIA 0x01
+# endif
+# ifndef SUBLANG_HAUSA_NIGERIA_LATIN
+# define SUBLANG_HAUSA_NIGERIA_LATIN 0x01
+# endif
+# ifndef SUBLANG_HEBREW_ISRAEL
+# define SUBLANG_HEBREW_ISRAEL 0x01
+# endif
+# ifndef SUBLANG_HINDI_INDIA
+# define SUBLANG_HINDI_INDIA 0x01
+# endif
+# ifndef SUBLANG_HUNGARIAN_HUNGARY
+# define SUBLANG_HUNGARIAN_HUNGARY 0x01
+# endif
+# ifndef SUBLANG_ICELANDIC_ICELAND
+# define SUBLANG_ICELANDIC_ICELAND 0x01
+# endif
+# ifndef SUBLANG_IGBO_NIGERIA
+# define SUBLANG_IGBO_NIGERIA 0x01
+# endif
+# ifndef SUBLANG_INDONESIAN_INDONESIA
+# define SUBLANG_INDONESIAN_INDONESIA 0x01
+# endif
+# ifndef SUBLANG_INUKTITUT_CANADA
+# define SUBLANG_INUKTITUT_CANADA 0x01
+# endif
+# undef SUBLANG_INUKTITUT_CANADA_LATIN
+# define SUBLANG_INUKTITUT_CANADA_LATIN 0x02
+# undef SUBLANG_IRISH_IRELAND
+# define SUBLANG_IRISH_IRELAND 0x02
+# ifndef SUBLANG_JAPANESE_JAPAN
+# define SUBLANG_JAPANESE_JAPAN 0x01
+# endif
+# ifndef SUBLANG_KANNADA_INDIA
+# define SUBLANG_KANNADA_INDIA 0x01
+# endif
# ifndef SUBLANG_KASHMIRI_INDIA
# define SUBLANG_KASHMIRI_INDIA 0x02
# endif
+# ifndef SUBLANG_KAZAK_KAZAKHSTAN
+# define SUBLANG_KAZAK_KAZAKHSTAN 0x01
+# endif
+# ifndef SUBLANG_KICHE_GUATEMALA
+# define SUBLANG_KICHE_GUATEMALA 0x01
+# endif
+# ifndef SUBLANG_KINYARWANDA_RWANDA
+# define SUBLANG_KINYARWANDA_RWANDA 0x01
+# endif
+# ifndef SUBLANG_KONKANI_INDIA
+# define SUBLANG_KONKANI_INDIA 0x01
+# endif
+# ifndef SUBLANG_KYRGYZ_KYRGYZSTAN
+# define SUBLANG_KYRGYZ_KYRGYZSTAN 0x01
+# endif
+# ifndef SUBLANG_LAO_LAOS
+# define SUBLANG_LAO_LAOS 0x01
+# endif
+# ifndef SUBLANG_LATVIAN_LATVIA
+# define SUBLANG_LATVIAN_LATVIA 0x01
+# endif
+# ifndef SUBLANG_LITHUANIAN_LITHUANIA
+# define SUBLANG_LITHUANIAN_LITHUANIA 0x01
+# endif
+# undef SUBLANG_LOWER_SORBIAN_GERMANY
+# define SUBLANG_LOWER_SORBIAN_GERMANY 0x02
+# ifndef SUBLANG_LUXEMBOURGISH_LUXEMBOURG
+# define SUBLANG_LUXEMBOURGISH_LUXEMBOURG 0x01
+# endif
+# ifndef SUBLANG_MACEDONIAN_MACEDONIA
+# define SUBLANG_MACEDONIAN_MACEDONIA 0x01
+# endif
# ifndef SUBLANG_MALAY_MALAYSIA
# define SUBLANG_MALAY_MALAYSIA 0x01
# endif
# ifndef SUBLANG_MALAY_BRUNEI_DARUSSALAM
# define SUBLANG_MALAY_BRUNEI_DARUSSALAM 0x02
# endif
+# ifndef SUBLANG_MALAYALAM_INDIA
+# define SUBLANG_MALAYALAM_INDIA 0x01
+# endif
+# ifndef SUBLANG_MALTESE_MALTA
+# define SUBLANG_MALTESE_MALTA 0x01
+# endif
+# ifndef SUBLANG_MAORI_NEW_ZEALAND
+# define SUBLANG_MAORI_NEW_ZEALAND 0x01
+# endif
+# ifndef SUBLANG_MAPUDUNGUN_CHILE
+# define SUBLANG_MAPUDUNGUN_CHILE 0x01
+# endif
+# ifndef SUBLANG_MARATHI_INDIA
+# define SUBLANG_MARATHI_INDIA 0x01
+# endif
+# ifndef SUBLANG_MOHAWK_CANADA
+# define SUBLANG_MOHAWK_CANADA 0x01
+# endif
+# ifndef SUBLANG_MONGOLIAN_CYRILLIC_MONGOLIA
+# define SUBLANG_MONGOLIAN_CYRILLIC_MONGOLIA 0x01
+# endif
+# ifndef SUBLANG_MONGOLIAN_PRC
+# define SUBLANG_MONGOLIAN_PRC 0x02
+# endif
+# ifndef SUBLANG_NEPALI_NEPAL
+# define SUBLANG_NEPALI_NEPAL 0x01
+# endif
# ifndef SUBLANG_NEPALI_INDIA
# define SUBLANG_NEPALI_INDIA 0x02
# endif
+# ifndef SUBLANG_OCCITAN_FRANCE
+# define SUBLANG_OCCITAN_FRANCE 0x01
+# endif
+# ifndef SUBLANG_ORIYA_INDIA
+# define SUBLANG_ORIYA_INDIA 0x01
+# endif
+# ifndef SUBLANG_PASHTO_AFGHANISTAN
+# define SUBLANG_PASHTO_AFGHANISTAN 0x01
+# endif
+# ifndef SUBLANG_POLISH_POLAND
+# define SUBLANG_POLISH_POLAND 0x01
+# endif
# ifndef SUBLANG_PUNJABI_INDIA
# define SUBLANG_PUNJABI_INDIA 0x01
# endif
# ifndef SUBLANG_PUNJABI_PAKISTAN
# define SUBLANG_PUNJABI_PAKISTAN 0x02
# endif
+# ifndef SUBLANG_QUECHUA_BOLIVIA
+# define SUBLANG_QUECHUA_BOLIVIA 0x01
+# endif
+# ifndef SUBLANG_QUECHUA_ECUADOR
+# define SUBLANG_QUECHUA_ECUADOR 0x02
+# endif
+# ifndef SUBLANG_QUECHUA_PERU
+# define SUBLANG_QUECHUA_PERU 0x03
+# endif
# ifndef SUBLANG_ROMANIAN_ROMANIA
# define SUBLANG_ROMANIAN_ROMANIA 0x01
# endif
# ifndef SUBLANG_ROMANIAN_MOLDOVA
# define SUBLANG_ROMANIAN_MOLDOVA 0x02
# endif
+# ifndef SUBLANG_ROMANSH_SWITZERLAND
+# define SUBLANG_ROMANSH_SWITZERLAND 0x01
+# endif
+# ifndef SUBLANG_RUSSIAN_RUSSIA
+# define SUBLANG_RUSSIAN_RUSSIA 0x01
+# endif
+# ifndef SUBLANG_RUSSIAN_MOLDAVIA
+# define SUBLANG_RUSSIAN_MOLDAVIA 0x02
+# endif
+# ifndef SUBLANG_SAMI_NORTHERN_NORWAY
+# define SUBLANG_SAMI_NORTHERN_NORWAY 0x01
+# endif
+# ifndef SUBLANG_SAMI_NORTHERN_SWEDEN
+# define SUBLANG_SAMI_NORTHERN_SWEDEN 0x02
+# endif
+# ifndef SUBLANG_SAMI_NORTHERN_FINLAND
+# define SUBLANG_SAMI_NORTHERN_FINLAND 0x03
+# endif
+# ifndef SUBLANG_SAMI_LULE_NORWAY
+# define SUBLANG_SAMI_LULE_NORWAY 0x04
+# endif
+# ifndef SUBLANG_SAMI_LULE_SWEDEN
+# define SUBLANG_SAMI_LULE_SWEDEN 0x05
+# endif
+# ifndef SUBLANG_SAMI_SOUTHERN_NORWAY
+# define SUBLANG_SAMI_SOUTHERN_NORWAY 0x06
+# endif
+# ifndef SUBLANG_SAMI_SOUTHERN_SWEDEN
+# define SUBLANG_SAMI_SOUTHERN_SWEDEN 0x07
+# endif
+# undef SUBLANG_SAMI_SKOLT_FINLAND
+# define SUBLANG_SAMI_SKOLT_FINLAND 0x08
+# undef SUBLANG_SAMI_INARI_FINLAND
+# define SUBLANG_SAMI_INARI_FINLAND 0x09
+# ifndef SUBLANG_SANSKRIT_INDIA
+# define SUBLANG_SANSKRIT_INDIA 0x01
+# endif
# ifndef SUBLANG_SERBIAN_LATIN
# define SUBLANG_SERBIAN_LATIN 0x02
# endif
# ifndef SUBLANG_SERBIAN_CYRILLIC
# define SUBLANG_SERBIAN_CYRILLIC 0x03
# endif
-# ifndef SUBLANG_SINDHI_PAKISTAN
-# define SUBLANG_SINDHI_PAKISTAN 0x01
+# ifndef SUBLANG_SINDHI_INDIA
+# define SUBLANG_SINDHI_INDIA 0x01
# endif
+# undef SUBLANG_SINDHI_PAKISTAN
+# define SUBLANG_SINDHI_PAKISTAN 0x02
# ifndef SUBLANG_SINDHI_AFGHANISTAN
# define SUBLANG_SINDHI_AFGHANISTAN 0x02
# endif
+# ifndef SUBLANG_SINHALESE_SRI_LANKA
+# define SUBLANG_SINHALESE_SRI_LANKA 0x01
+# endif
+# ifndef SUBLANG_SLOVAK_SLOVAKIA
+# define SUBLANG_SLOVAK_SLOVAKIA 0x01
+# endif
+# ifndef SUBLANG_SLOVENIAN_SLOVENIA
+# define SUBLANG_SLOVENIAN_SLOVENIA 0x01
+# endif
+# ifndef SUBLANG_SOTHO_SOUTH_AFRICA
+# define SUBLANG_SOTHO_SOUTH_AFRICA 0x01
+# endif
# ifndef SUBLANG_SPANISH_GUATEMALA
# define SUBLANG_SPANISH_GUATEMALA 0x04
# endif
@@ -669,21 +1018,74 @@
# ifndef SUBLANG_SPANISH_PUERTO_RICO
# define SUBLANG_SPANISH_PUERTO_RICO 0x14
# endif
+# ifndef SUBLANG_SPANISH_US
+# define SUBLANG_SPANISH_US 0x15
+# endif
+# ifndef SUBLANG_SWAHILI_KENYA
+# define SUBLANG_SWAHILI_KENYA 0x01
+# endif
+# ifndef SUBLANG_SWEDISH_SWEDEN
+# define SUBLANG_SWEDISH_SWEDEN 0x01
+# endif
# ifndef SUBLANG_SWEDISH_FINLAND
# define SUBLANG_SWEDISH_FINLAND 0x02
# endif
+# ifndef SUBLANG_SYRIAC_SYRIA
+# define SUBLANG_SYRIAC_SYRIA 0x01
+# endif
+# ifndef SUBLANG_TAGALOG_PHILIPPINES
+# define SUBLANG_TAGALOG_PHILIPPINES 0x01
+# endif
+# ifndef SUBLANG_TAJIK_TAJIKISTAN
+# define SUBLANG_TAJIK_TAJIKISTAN 0x01
+# endif
# ifndef SUBLANG_TAMAZIGHT_ARABIC
# define SUBLANG_TAMAZIGHT_ARABIC 0x01
# endif
# ifndef SUBLANG_TAMAZIGHT_ALGERIA_LATIN
# define SUBLANG_TAMAZIGHT_ALGERIA_LATIN 0x02
# endif
+# ifndef SUBLANG_TAMIL_INDIA
+# define SUBLANG_TAMIL_INDIA 0x01
+# endif
+# ifndef SUBLANG_TATAR_RUSSIA
+# define SUBLANG_TATAR_RUSSIA 0x01
+# endif
+# ifndef SUBLANG_TELUGU_INDIA
+# define SUBLANG_TELUGU_INDIA 0x01
+# endif
+# ifndef SUBLANG_THAI_THAILAND
+# define SUBLANG_THAI_THAILAND 0x01
+# endif
+# ifndef SUBLANG_TIBETAN_PRC
+# define SUBLANG_TIBETAN_PRC 0x01
+# endif
+# undef SUBLANG_TIBETAN_BHUTAN
+# define SUBLANG_TIBETAN_BHUTAN 0x02
# ifndef SUBLANG_TIGRINYA_ETHIOPIA
# define SUBLANG_TIGRINYA_ETHIOPIA 0x01
# endif
# ifndef SUBLANG_TIGRINYA_ERITREA
# define SUBLANG_TIGRINYA_ERITREA 0x02
# endif
+# ifndef SUBLANG_TSWANA_SOUTH_AFRICA
+# define SUBLANG_TSWANA_SOUTH_AFRICA 0x01
+# endif
+# ifndef SUBLANG_TURKISH_TURKEY
+# define SUBLANG_TURKISH_TURKEY 0x01
+# endif
+# ifndef SUBLANG_TURKMEN_TURKMENISTAN
+# define SUBLANG_TURKMEN_TURKMENISTAN 0x01
+# endif
+# ifndef SUBLANG_UIGHUR_PRC
+# define SUBLANG_UIGHUR_PRC 0x01
+# endif
+# ifndef SUBLANG_UKRAINIAN_UKRAINE
+# define SUBLANG_UKRAINIAN_UKRAINE 0x01
+# endif
+# ifndef SUBLANG_UPPER_SORBIAN_GERMANY
+# define SUBLANG_UPPER_SORBIAN_GERMANY 0x01
+# endif
# ifndef SUBLANG_URDU_PAKISTAN
# define SUBLANG_URDU_PAKISTAN 0x01
# endif
@@ -696,18 +1098,47 @@
# ifndef SUBLANG_UZBEK_CYRILLIC
# define SUBLANG_UZBEK_CYRILLIC 0x02
# endif
+# ifndef SUBLANG_VIETNAMESE_VIETNAM
+# define SUBLANG_VIETNAMESE_VIETNAM 0x01
+# endif
+# ifndef SUBLANG_WELSH_UNITED_KINGDOM
+# define SUBLANG_WELSH_UNITED_KINGDOM 0x01
+# endif
+# ifndef SUBLANG_WOLOF_SENEGAL
+# define SUBLANG_WOLOF_SENEGAL 0x01
+# endif
+# ifndef SUBLANG_XHOSA_SOUTH_AFRICA
+# define SUBLANG_XHOSA_SOUTH_AFRICA 0x01
+# endif
+# ifndef SUBLANG_YAKUT_RUSSIA
+# define SUBLANG_YAKUT_RUSSIA 0x01
+# endif
+# ifndef SUBLANG_YI_PRC
+# define SUBLANG_YI_PRC 0x01
+# endif
+# ifndef SUBLANG_YORUBA_NIGERIA
+# define SUBLANG_YORUBA_NIGERIA 0x01
+# endif
+# ifndef SUBLANG_ZULU_SOUTH_AFRICA
+# define SUBLANG_ZULU_SOUTH_AFRICA 0x01
+# endif
+/* GetLocaleInfoA operations. */
+# ifndef LOCALE_SNAME
+# define LOCALE_SNAME 0x5c
+# endif
#endif
-# if HAVE_CFLOCALECOPYCURRENT || HAVE_CFPREFERENCESCOPYAPPVALUE
+
+#if HAVE_CFLOCALECOPYCURRENT || HAVE_CFPREFERENCESCOPYAPPVALUE
/* MacOS X 10.2 or newer */
/* Canonicalize a MacOS X locale name to a Unix locale name.
NAME is a sufficiently large buffer.
On input, it contains the MacOS X locale name.
On output, it contains the Unix locale name. */
-# if !defined IN_LIBINTL
+# if !defined IN_LIBINTL
static
-# endif
+# endif
void
gl_locale_name_canonicalize (char *name)
{
@@ -721,7 +1152,7 @@ gl_locale_name_canonicalize (char *name)
MacOS X 10.3.8 function
CFLocaleCreateCanonicalLocaleIdentifierFromString(). */
typedef struct { const char legacy[21+1]; const char unixy[5+1]; }
- legacy_entry;
+ legacy_entry;
static const legacy_entry legacy_table[] = {
{ "Afrikaans", "af" },
{ "Albanian", "sq" },
@@ -859,7 +1290,7 @@ gl_locale_name_canonicalize (char *name)
/* Convert new-style locale names with language tags (ISO 639 and ISO 15924)
to Unix (ISO 639 and ISO 3166) names. */
typedef struct { const char langtag[7+1]; const char unixy[12+1]; }
- langtag_entry;
+ langtag_entry;
static const langtag_entry langtag_table[] = {
/* MacOS X has "az-Arab", "az-Cyrl", "az-Latn".
The default script for az on Unix is Latin. */
@@ -889,7 +1320,7 @@ gl_locale_name_canonicalize (char *name)
/* Convert script names (ISO 15924) to Unix conventions.
See http://www.unicode.org/iso15924/iso15924-codes.html */
typedef struct { const char script[4+1]; const char unixy[9+1]; }
- script_entry;
+ script_entry;
static const script_entry script_table[] = {
{ "Arab", "arabic" },
{ "Cyrl", "cyrillic" },
@@ -903,21 +1334,21 @@ gl_locale_name_canonicalize (char *name)
i1 = 0;
i2 = sizeof (legacy_table) / sizeof (legacy_entry);
while (i2 - i1 > 1)
- {
- /* At this point we know that if name occurs in legacy_table,
- its index must be >= i1 and < i2. */
- unsigned int i = (i1 + i2) >> 1;
- const legacy_entry *p = &legacy_table[i];
- if (strcmp (name, p->legacy) < 0)
- i2 = i;
- else
- i1 = i;
- }
+ {
+ /* At this point we know that if name occurs in legacy_table,
+ its index must be >= i1 and < i2. */
+ unsigned int i = (i1 + i2) >> 1;
+ const legacy_entry *p = &legacy_table[i];
+ if (strcmp (name, p->legacy) < 0)
+ i2 = i;
+ else
+ i1 = i;
+ }
if (strcmp (name, legacy_table[i1].legacy) == 0)
- {
- strcpy (name, legacy_table[i1].unixy);
- return;
- }
+ {
+ strcpy (name, legacy_table[i1].unixy);
+ return;
+ }
}
/* Step 2: Convert using langtag_table and script_table. */
@@ -927,41 +1358,41 @@ gl_locale_name_canonicalize (char *name)
i1 = 0;
i2 = sizeof (langtag_table) / sizeof (langtag_entry);
while (i2 - i1 > 1)
- {
- /* At this point we know that if name occurs in langtag_table,
- its index must be >= i1 and < i2. */
- unsigned int i = (i1 + i2) >> 1;
- const langtag_entry *p = &langtag_table[i];
- if (strcmp (name, p->langtag) < 0)
- i2 = i;
- else
- i1 = i;
- }
+ {
+ /* At this point we know that if name occurs in langtag_table,
+ its index must be >= i1 and < i2. */
+ unsigned int i = (i1 + i2) >> 1;
+ const langtag_entry *p = &langtag_table[i];
+ if (strcmp (name, p->langtag) < 0)
+ i2 = i;
+ else
+ i1 = i;
+ }
if (strcmp (name, langtag_table[i1].langtag) == 0)
- {
- strcpy (name, langtag_table[i1].unixy);
- return;
- }
+ {
+ strcpy (name, langtag_table[i1].unixy);
+ return;
+ }
i1 = 0;
i2 = sizeof (script_table) / sizeof (script_entry);
while (i2 - i1 > 1)
- {
- /* At this point we know that if (name + 3) occurs in script_table,
- its index must be >= i1 and < i2. */
- unsigned int i = (i1 + i2) >> 1;
- const script_entry *p = &script_table[i];
- if (strcmp (name + 3, p->script) < 0)
- i2 = i;
- else
- i1 = i;
- }
+ {
+ /* At this point we know that if (name + 3) occurs in script_table,
+ its index must be >= i1 and < i2. */
+ unsigned int i = (i1 + i2) >> 1;
+ const script_entry *p = &script_table[i];
+ if (strcmp (name + 3, p->script) < 0)
+ i2 = i;
+ else
+ i1 = i;
+ }
if (strcmp (name + 3, script_table[i1].script) == 0)
- {
- name[2] = '@';
- strcpy (name + 3, script_table[i1].unixy);
- return;
- }
+ {
+ name[2] = '@';
+ strcpy (name + 3, script_table[i1].unixy);
+ return;
+ }
}
/* Step 3: Convert new-style dash to Unix underscore. */
@@ -969,12 +1400,1371 @@ gl_locale_name_canonicalize (char *name)
char *p;
for (p = name; *p != '\0'; p++)
if (*p == '-')
- *p = '_';
+ *p = '_';
+ }
+}
+
+#endif
+
+
+#if defined WIN32_NATIVE || defined __CYGWIN__ /* WIN32 or Cygwin */
+
+/* Canonicalize a Win32 native locale name to a Unix locale name.
+ NAME is a sufficiently large buffer.
+ On input, it contains the Win32 locale name.
+ On output, it contains the Unix locale name. */
+# if !defined IN_LIBINTL
+static
+# endif
+void
+gl_locale_name_canonicalize (char *name)
+{
+ /* FIXME: This is probably incomplete: it does not handle "zh-Hans" and
+ "zh-Hant". */
+ char *p;
+
+ for (p = name; *p != '\0'; p++)
+ if (*p == '-')
+ {
+ *p = '_';
+ p++;
+ for (; *p != '\0'; p++)
+ {
+ if (*p >= 'a' && *p <= 'z')
+ *p += 'A' - 'a';
+ if (*p == '-')
+ {
+ *p = '\0';
+ return;
+ }
+ }
+ return;
+ }
+}
+
+# if !defined IN_LIBINTL
+static
+# endif
+const char *
+gl_locale_name_from_win32_LANGID (LANGID langid)
+{
+ /* Activate the new code only when the GETTEXT_MUI environment variable is
+ set, for the time being, since the new code is not well tested. */
+ if (getenv ("GETTEXT_MUI") != NULL)
+ {
+ static char namebuf[256];
+
+ /* Query the system's notion of locale name.
+ On Windows95/98/ME, GetLocaleInfoA returns some incorrect results.
+ But we don't need to support systems that are so old. */
+ if (GetLocaleInfoA (MAKELCID (langid, SORT_DEFAULT), LOCALE_SNAME,
+ namebuf, sizeof (namebuf) - 1))
+ {
+ /* Convert it to a Unix locale name. */
+ gl_locale_name_canonicalize (namebuf);
+ return namebuf;
+ }
+ }
+ /* Internet Explorer has an LCID to RFC3066 name mapping stored in
+ HKEY_CLASSES_ROOT\Mime\Database\Rfc1766. But we better don't use that
+ since IE's i18n subsystem is known to be inconsistent with the Win32 base
+ (e.g. they have different character conversion facilities that produce
+ different results). */
+ /* Use our own table. */
+ {
+ int primary, sub;
+
+ /* Split into language and territory part. */
+ primary = PRIMARYLANGID (langid);
+ sub = SUBLANGID (langid);
+
+ /* Dispatch on language.
+ See also http://www.unicode.org/unicode/onlinedat/languages.html .
+ For details about languages, see http://www.ethnologue.com/ . */
+ switch (primary)
+ {
+ case LANG_AFRIKAANS:
+ switch (sub)
+ {
+ case SUBLANG_AFRIKAANS_SOUTH_AFRICA: return "af_ZA";
+ }
+ return "af";
+ case LANG_ALBANIAN:
+ switch (sub)
+ {
+ case SUBLANG_ALBANIAN_ALBANIA: return "sq_AL";
+ }
+ return "sq";
+ case LANG_ALSATIAN:
+ switch (sub)
+ {
+ case SUBLANG_ALSATIAN_FRANCE: return "gsw_FR";
+ }
+ return "gsw";
+ case LANG_AMHARIC:
+ switch (sub)
+ {
+ case SUBLANG_AMHARIC_ETHIOPIA: return "am_ET";
+ }
+ return "am";
+ case LANG_ARABIC:
+ switch (sub)
+ {
+ case SUBLANG_ARABIC_SAUDI_ARABIA: return "ar_SA";
+ case SUBLANG_ARABIC_IRAQ: return "ar_IQ";
+ case SUBLANG_ARABIC_EGYPT: return "ar_EG";
+ case SUBLANG_ARABIC_LIBYA: return "ar_LY";
+ case SUBLANG_ARABIC_ALGERIA: return "ar_DZ";
+ case SUBLANG_ARABIC_MOROCCO: return "ar_MA";
+ case SUBLANG_ARABIC_TUNISIA: return "ar_TN";
+ case SUBLANG_ARABIC_OMAN: return "ar_OM";
+ case SUBLANG_ARABIC_YEMEN: return "ar_YE";
+ case SUBLANG_ARABIC_SYRIA: return "ar_SY";
+ case SUBLANG_ARABIC_JORDAN: return "ar_JO";
+ case SUBLANG_ARABIC_LEBANON: return "ar_LB";
+ case SUBLANG_ARABIC_KUWAIT: return "ar_KW";
+ case SUBLANG_ARABIC_UAE: return "ar_AE";
+ case SUBLANG_ARABIC_BAHRAIN: return "ar_BH";
+ case SUBLANG_ARABIC_QATAR: return "ar_QA";
+ }
+ return "ar";
+ case LANG_ARMENIAN:
+ switch (sub)
+ {
+ case SUBLANG_ARMENIAN_ARMENIA: return "hy_AM";
+ }
+ return "hy";
+ case LANG_ASSAMESE:
+ switch (sub)
+ {
+ case SUBLANG_ASSAMESE_INDIA: return "as_IN";
+ }
+ return "as";
+ case LANG_AZERI:
+ switch (sub)
+ {
+ /* FIXME: Adjust this when Azerbaijani locales appear on Unix. */
+ case 0x1e: return "az@latin";
+ case SUBLANG_AZERI_LATIN: return "az_AZ@latin";
+ case 0x1d: return "az@cyrillic";
+ case SUBLANG_AZERI_CYRILLIC: return "az_AZ@cyrillic";
+ }
+ return "az";
+ case LANG_BASHKIR:
+ switch (sub)
+ {
+ case SUBLANG_BASHKIR_RUSSIA: return "ba_RU";
+ }
+ return "ba";
+ case LANG_BASQUE:
+ switch (sub)
+ {
+ case SUBLANG_BASQUE_BASQUE: return "eu_ES";
+ }
+ return "eu"; /* Ambiguous: could be "eu_ES" or "eu_FR". */
+ case LANG_BELARUSIAN:
+ switch (sub)
+ {
+ case SUBLANG_BELARUSIAN_BELARUS: return "be_BY";
+ }
+ return "be";
+ case LANG_BENGALI:
+ switch (sub)
+ {
+ case SUBLANG_BENGALI_INDIA: return "bn_IN";
+ case SUBLANG_BENGALI_BANGLADESH: return "bn_BD";
+ }
+ return "bn";
+ case LANG_BRETON:
+ switch (sub)
+ {
+ case SUBLANG_BRETON_FRANCE: return "br_FR";
+ }
+ return "br";
+ case LANG_BULGARIAN:
+ switch (sub)
+ {
+ case SUBLANG_BULGARIAN_BULGARIA: return "bg_BG";
+ }
+ return "bg";
+ case LANG_BURMESE:
+ switch (sub)
+ {
+ case SUBLANG_DEFAULT: return "my_MM";
+ }
+ return "my";
+ case LANG_CAMBODIAN:
+ switch (sub)
+ {
+ case SUBLANG_CAMBODIAN_CAMBODIA: return "km_KH";
+ }
+ return "km";
+ case LANG_CATALAN:
+ switch (sub)
+ {
+ case SUBLANG_CATALAN_SPAIN: return "ca_ES";
+ }
+ return "ca";
+ case LANG_CHEROKEE:
+ switch (sub)
+ {
+ case SUBLANG_DEFAULT: return "chr_US";
+ }
+ return "chr";
+ case LANG_CHINESE:
+ switch (sub)
+ {
+ case SUBLANG_CHINESE_TRADITIONAL: case 0x1f: return "zh_TW";
+ case SUBLANG_CHINESE_SIMPLIFIED: case 0x00: return "zh_CN";
+ case SUBLANG_CHINESE_HONGKONG: return "zh_HK"; /* traditional */
+ case SUBLANG_CHINESE_SINGAPORE: return "zh_SG"; /* simplified */
+ case SUBLANG_CHINESE_MACAU: return "zh_MO"; /* traditional */
+ }
+ return "zh";
+ case LANG_CORSICAN:
+ switch (sub)
+ {
+ case SUBLANG_CORSICAN_FRANCE: return "co_FR";
+ }
+ return "co";
+ case LANG_CROATIAN: /* LANG_CROATIAN == LANG_SERBIAN == LANG_BOSNIAN
+ * What used to be called Serbo-Croatian
+ * should really now be two separate
+ * languages because of political reasons.
+ * (Says tml, who knows nothing about Serbian
+ * or Croatian.)
+ * (I can feel those flames coming already.)
+ */
+ switch (sub)
+ {
+ /* Croatian */
+ case 0x00: return "hr";
+ case SUBLANG_CROATIAN_CROATIA: return "hr_HR";
+ case SUBLANG_CROATIAN_BOSNIA_HERZEGOVINA_LATIN: return "hr_BA";
+ /* Serbian */
+ case 0x1f: return "sr";
+ case 0x1c: return "sr"; /* latin */
+ case SUBLANG_SERBIAN_LATIN: return "sr_CS"; /* latin */
+ case 0x09: return "sr_RS"; /* latin */
+ case 0x0b: return "sr_ME"; /* latin */
+ case 0x06: return "sr_BA"; /* latin */
+ case 0x1b: return "sr@cyrillic";
+ case SUBLANG_SERBIAN_CYRILLIC: return "sr_CS@cyrillic";
+ case 0x0a: return "sr_RS@cyrillic";
+ case 0x0c: return "sr_ME@cyrillic";
+ case 0x07: return "sr_BA@cyrillic";
+ /* Bosnian */
+ case 0x1e: return "bs";
+ case 0x1a: return "bs"; /* latin */
+ case SUBLANG_BOSNIAN_BOSNIA_HERZEGOVINA_LATIN: return "bs_BA"; /* latin */
+ case 0x19: return "bs@cyrillic";
+ case SUBLANG_BOSNIAN_BOSNIA_HERZEGOVINA_CYRILLIC: return "bs_BA@cyrillic";
+ }
+ return "hr";
+ case LANG_CZECH:
+ switch (sub)
+ {
+ case SUBLANG_CZECH_CZECH_REPUBLIC: return "cs_CZ";
+ }
+ return "cs";
+ case LANG_DANISH:
+ switch (sub)
+ {
+ case SUBLANG_DANISH_DENMARK: return "da_DK";
+ }
+ return "da";
+ case LANG_DARI:
+ /* FIXME: Adjust this when such locales appear on Unix. */
+ switch (sub)
+ {
+ case SUBLANG_DARI_AFGHANISTAN: return "prs_AF";
+ }
+ return "prs";
+ case LANG_DIVEHI:
+ switch (sub)
+ {
+ case SUBLANG_DIVEHI_MALDIVES: return "dv_MV";
+ }
+ return "dv";
+ case LANG_DUTCH:
+ switch (sub)
+ {
+ case SUBLANG_DUTCH: return "nl_NL";
+ case SUBLANG_DUTCH_BELGIAN: /* FLEMISH, VLAAMS */ return "nl_BE";
+ case SUBLANG_DUTCH_SURINAM: return "nl_SR";
+ }
+ return "nl";
+ case LANG_EDO:
+ switch (sub)
+ {
+ case SUBLANG_DEFAULT: return "bin_NG";
+ }
+ return "bin";
+ case LANG_ENGLISH:
+ switch (sub)
+ {
+ /* SUBLANG_ENGLISH_US == SUBLANG_DEFAULT. Heh. I thought
+ * English was the language spoken in England.
+ * Oh well.
+ */
+ case SUBLANG_ENGLISH_US: return "en_US";
+ case SUBLANG_ENGLISH_UK: return "en_GB";
+ case SUBLANG_ENGLISH_AUS: return "en_AU";
+ case SUBLANG_ENGLISH_CAN: return "en_CA";
+ case SUBLANG_ENGLISH_NZ: return "en_NZ";
+ case SUBLANG_ENGLISH_EIRE: return "en_IE";
+ case SUBLANG_ENGLISH_SOUTH_AFRICA: return "en_ZA";
+ case SUBLANG_ENGLISH_JAMAICA: return "en_JM";
+ case SUBLANG_ENGLISH_CARIBBEAN: return "en_GD"; /* Grenada? */
+ case SUBLANG_ENGLISH_BELIZE: return "en_BZ";
+ case SUBLANG_ENGLISH_TRINIDAD: return "en_TT";
+ case SUBLANG_ENGLISH_ZIMBABWE: return "en_ZW";
+ case SUBLANG_ENGLISH_PHILIPPINES: return "en_PH";
+ case SUBLANG_ENGLISH_INDONESIA: return "en_ID";
+ case SUBLANG_ENGLISH_HONGKONG: return "en_HK";
+ case SUBLANG_ENGLISH_INDIA: return "en_IN";
+ case SUBLANG_ENGLISH_MALAYSIA: return "en_MY";
+ case SUBLANG_ENGLISH_SINGAPORE: return "en_SG";
+ }
+ return "en";
+ case LANG_ESTONIAN:
+ switch (sub)
+ {
+ case SUBLANG_ESTONIAN_ESTONIA: return "et_EE";
+ }
+ return "et";
+ case LANG_FAEROESE:
+ switch (sub)
+ {
+ case SUBLANG_FAEROESE_FAROE_ISLANDS: return "fo_FO";
+ }
+ return "fo";
+ case LANG_FARSI:
+ switch (sub)
+ {
+ case SUBLANG_FARSI_IRAN: return "fa_IR";
+ }
+ return "fa";
+ case LANG_FINNISH:
+ switch (sub)
+ {
+ case SUBLANG_FINNISH_FINLAND: return "fi_FI";
+ }
+ return "fi";
+ case LANG_FRENCH:
+ switch (sub)
+ {
+ case SUBLANG_FRENCH: return "fr_FR";
+ case SUBLANG_FRENCH_BELGIAN: /* WALLOON */ return "fr_BE";
+ case SUBLANG_FRENCH_CANADIAN: return "fr_CA";
+ case SUBLANG_FRENCH_SWISS: return "fr_CH";
+ case SUBLANG_FRENCH_LUXEMBOURG: return "fr_LU";
+ case SUBLANG_FRENCH_MONACO: return "fr_MC";
+ case SUBLANG_FRENCH_WESTINDIES: return "fr"; /* Caribbean? */
+ case SUBLANG_FRENCH_REUNION: return "fr_RE";
+ case SUBLANG_FRENCH_CONGO: return "fr_CG";
+ case SUBLANG_FRENCH_SENEGAL: return "fr_SN";
+ case SUBLANG_FRENCH_CAMEROON: return "fr_CM";
+ case SUBLANG_FRENCH_COTEDIVOIRE: return "fr_CI";
+ case SUBLANG_FRENCH_MALI: return "fr_ML";
+ case SUBLANG_FRENCH_MOROCCO: return "fr_MA";
+ case SUBLANG_FRENCH_HAITI: return "fr_HT";
+ }
+ return "fr";
+ case LANG_FRISIAN:
+ switch (sub)
+ {
+ case SUBLANG_FRISIAN_NETHERLANDS: return "fy_NL";
+ }
+ return "fy";
+ case LANG_FULFULDE:
+ /* Spoken in Nigeria, Guinea, Senegal, Mali, Niger, Cameroon, Benin. */
+ switch (sub)
+ {
+ case SUBLANG_DEFAULT: return "ff_NG";
+ }
+ return "ff";
+ case LANG_GAELIC:
+ switch (sub)
+ {
+ case 0x01: /* SCOTTISH */
+ /* old, superseded by LANG_SCOTTISH_GAELIC */
+ return "gd_GB";
+ case SUBLANG_IRISH_IRELAND: return "ga_IE";
+ }
+ return "ga";
+ case LANG_GALICIAN:
+ switch (sub)
+ {
+ case SUBLANG_GALICIAN_SPAIN: return "gl_ES";
+ }
+ return "gl";
+ case LANG_GEORGIAN:
+ switch (sub)
+ {
+ case SUBLANG_GEORGIAN_GEORGIA: return "ka_GE";
+ }
+ return "ka";
+ case LANG_GERMAN:
+ switch (sub)
+ {
+ case SUBLANG_GERMAN: return "de_DE";
+ case SUBLANG_GERMAN_SWISS: return "de_CH";
+ case SUBLANG_GERMAN_AUSTRIAN: return "de_AT";
+ case SUBLANG_GERMAN_LUXEMBOURG: return "de_LU";
+ case SUBLANG_GERMAN_LIECHTENSTEIN: return "de_LI";
+ }
+ return "de";
+ case LANG_GREEK:
+ switch (sub)
+ {
+ case SUBLANG_GREEK_GREECE: return "el_GR";
+ }
+ return "el";
+ case LANG_GREENLANDIC:
+ switch (sub)
+ {
+ case SUBLANG_GREENLANDIC_GREENLAND: return "kl_GL";
+ }
+ return "kl";
+ case LANG_GUARANI:
+ switch (sub)
+ {
+ case SUBLANG_DEFAULT: return "gn_PY";
+ }
+ return "gn";
+ case LANG_GUJARATI:
+ switch (sub)
+ {
+ case SUBLANG_GUJARATI_INDIA: return "gu_IN";
+ }
+ return "gu";
+ case LANG_HAUSA:
+ switch (sub)
+ {
+ case 0x1f: return "ha";
+ case SUBLANG_HAUSA_NIGERIA_LATIN: return "ha_NG";
+ }
+ return "ha";
+ case LANG_HAWAIIAN:
+ /* FIXME: Do they mean Hawaiian ("haw_US", 1000 speakers)
+ or Hawaii Creole English ("cpe_US", 600000 speakers)? */
+ switch (sub)
+ {
+ case SUBLANG_DEFAULT: return "cpe_US";
+ }
+ return "cpe";
+ case LANG_HEBREW:
+ switch (sub)
+ {
+ case SUBLANG_HEBREW_ISRAEL: return "he_IL";
+ }
+ return "he";
+ case LANG_HINDI:
+ switch (sub)
+ {
+ case SUBLANG_HINDI_INDIA: return "hi_IN";
+ }
+ return "hi";
+ case LANG_HUNGARIAN:
+ switch (sub)
+ {
+ case SUBLANG_HUNGARIAN_HUNGARY: return "hu_HU";
+ }
+ return "hu";
+ case LANG_IBIBIO:
+ switch (sub)
+ {
+ case SUBLANG_DEFAULT: return "nic_NG";
+ }
+ return "nic";
+ case LANG_ICELANDIC:
+ switch (sub)
+ {
+ case SUBLANG_ICELANDIC_ICELAND: return "is_IS";
+ }
+ return "is";
+ case LANG_IGBO:
+ switch (sub)
+ {
+ case SUBLANG_IGBO_NIGERIA: return "ig_NG";
+ }
+ return "ig";
+ case LANG_INDONESIAN:
+ switch (sub)
+ {
+ case SUBLANG_INDONESIAN_INDONESIA: return "id_ID";
+ }
+ return "id";
+ case LANG_INUKTITUT:
+ switch (sub)
+ {
+ case 0x1e: return "iu"; /* syllabic */
+ case SUBLANG_INUKTITUT_CANADA: return "iu_CA"; /* syllabic */
+ case 0x1f: return "iu@latin";
+ case SUBLANG_INUKTITUT_CANADA_LATIN: return "iu_CA@latin";
+ }
+ return "iu";
+ case LANG_ITALIAN:
+ switch (sub)
+ {
+ case SUBLANG_ITALIAN: return "it_IT";
+ case SUBLANG_ITALIAN_SWISS: return "it_CH";
+ }
+ return "it";
+ case LANG_JAPANESE:
+ switch (sub)
+ {
+ case SUBLANG_JAPANESE_JAPAN: return "ja_JP";
+ }
+ return "ja";
+ case LANG_KANNADA:
+ switch (sub)
+ {
+ case SUBLANG_KANNADA_INDIA: return "kn_IN";
+ }
+ return "kn";
+ case LANG_KANURI:
+ switch (sub)
+ {
+ case SUBLANG_DEFAULT: return "kr_NG";
+ }
+ return "kr";
+ case LANG_KASHMIRI:
+ switch (sub)
+ {
+ case SUBLANG_DEFAULT: return "ks_PK";
+ case SUBLANG_KASHMIRI_INDIA: return "ks_IN";
+ }
+ return "ks";
+ case LANG_KAZAK:
+ switch (sub)
+ {
+ case SUBLANG_KAZAK_KAZAKHSTAN: return "kk_KZ";
+ }
+ return "kk";
+ case LANG_KICHE:
+ /* FIXME: Adjust this when such locales appear on Unix. */
+ switch (sub)
+ {
+ case SUBLANG_KICHE_GUATEMALA: return "qut_GT";
+ }
+ return "qut";
+ case LANG_KINYARWANDA:
+ switch (sub)
+ {
+ case SUBLANG_KINYARWANDA_RWANDA: return "rw_RW";
+ }
+ return "rw";
+ case LANG_KONKANI:
+ /* FIXME: Adjust this when such locales appear on Unix. */
+ switch (sub)
+ {
+ case SUBLANG_KONKANI_INDIA: return "kok_IN";
+ }
+ return "kok";
+ case LANG_KOREAN:
+ switch (sub)
+ {
+ case SUBLANG_DEFAULT: return "ko_KR";
+ }
+ return "ko";
+ case LANG_KYRGYZ:
+ switch (sub)
+ {
+ case SUBLANG_KYRGYZ_KYRGYZSTAN: return "ky_KG";
+ }
+ return "ky";
+ case LANG_LAO:
+ switch (sub)
+ {
+ case SUBLANG_LAO_LAOS: return "lo_LA";
+ }
+ return "lo";
+ case LANG_LATIN:
+ switch (sub)
+ {
+ case SUBLANG_DEFAULT: return "la_VA";
+ }
+ return "la";
+ case LANG_LATVIAN:
+ switch (sub)
+ {
+ case SUBLANG_LATVIAN_LATVIA: return "lv_LV";
+ }
+ return "lv";
+ case LANG_LITHUANIAN:
+ switch (sub)
+ {
+ case SUBLANG_LITHUANIAN_LITHUANIA: return "lt_LT";
+ }
+ return "lt";
+ case LANG_LUXEMBOURGISH:
+ switch (sub)
+ {
+ case SUBLANG_LUXEMBOURGISH_LUXEMBOURG: return "lb_LU";
+ }
+ return "lb";
+ case LANG_MACEDONIAN:
+ switch (sub)
+ {
+ case SUBLANG_MACEDONIAN_MACEDONIA: return "mk_MK";
+ }
+ return "mk";
+ case LANG_MALAY:
+ switch (sub)
+ {
+ case SUBLANG_MALAY_MALAYSIA: return "ms_MY";
+ case SUBLANG_MALAY_BRUNEI_DARUSSALAM: return "ms_BN";
+ }
+ return "ms";
+ case LANG_MALAYALAM:
+ switch (sub)
+ {
+ case SUBLANG_MALAYALAM_INDIA: return "ml_IN";
+ }
+ return "ml";
+ case LANG_MALTESE:
+ switch (sub)
+ {
+ case SUBLANG_MALTESE_MALTA: return "mt_MT";
+ }
+ return "mt";
+ case LANG_MANIPURI:
+ /* FIXME: Adjust this when such locales appear on Unix. */
+ switch (sub)
+ {
+ case SUBLANG_DEFAULT: return "mni_IN";
+ }
+ return "mni";
+ case LANG_MAORI:
+ switch (sub)
+ {
+ case SUBLANG_MAORI_NEW_ZEALAND: return "mi_NZ";
+ }
+ return "mi";
+ case LANG_MAPUDUNGUN:
+ switch (sub)
+ {
+ case SUBLANG_MAPUDUNGUN_CHILE: return "arn_CL";
+ }
+ return "arn";
+ case LANG_MARATHI:
+ switch (sub)
+ {
+ case SUBLANG_MARATHI_INDIA: return "mr_IN";
+ }
+ return "mr";
+ case LANG_MOHAWK:
+ switch (sub)
+ {
+ case SUBLANG_MOHAWK_CANADA: return "moh_CA";
+ }
+ return "moh";
+ case LANG_MONGOLIAN:
+ switch (sub)
+ {
+ case SUBLANG_MONGOLIAN_CYRILLIC_MONGOLIA: case 0x1e: return "mn_MN";
+ case SUBLANG_MONGOLIAN_PRC: case 0x1f: return "mn_CN";
+ }
+ return "mn"; /* Ambiguous: could be "mn_CN" or "mn_MN". */
+ case LANG_NEPALI:
+ switch (sub)
+ {
+ case SUBLANG_NEPALI_NEPAL: return "ne_NP";
+ case SUBLANG_NEPALI_INDIA: return "ne_IN";
+ }
+ return "ne";
+ case LANG_NORWEGIAN:
+ switch (sub)
+ {
+ case 0x1f: return "nb";
+ case SUBLANG_NORWEGIAN_BOKMAL: return "nb_NO";
+ case 0x1e: return "nn";
+ case SUBLANG_NORWEGIAN_NYNORSK: return "nn_NO";
+ }
+ return "no";
+ case LANG_OCCITAN:
+ switch (sub)
+ {
+ case SUBLANG_OCCITAN_FRANCE: return "oc_FR";
+ }
+ return "oc";
+ case LANG_ORIYA:
+ switch (sub)
+ {
+ case SUBLANG_ORIYA_INDIA: return "or_IN";
+ }
+ return "or";
+ case LANG_OROMO:
+ switch (sub)
+ {
+ case SUBLANG_DEFAULT: return "om_ET";
+ }
+ return "om";
+ case LANG_PAPIAMENTU:
+ switch (sub)
+ {
+ case SUBLANG_DEFAULT: return "pap_AN";
+ }
+ return "pap";
+ case LANG_PASHTO:
+ switch (sub)
+ {
+ case SUBLANG_PASHTO_AFGHANISTAN: return "ps_AF";
+ }
+ return "ps"; /* Ambiguous: could be "ps_PK" or "ps_AF". */
+ case LANG_POLISH:
+ switch (sub)
+ {
+ case SUBLANG_POLISH_POLAND: return "pl_PL";
+ }
+ return "pl";
+ case LANG_PORTUGUESE:
+ switch (sub)
+ {
+ /* Hmm. SUBLANG_PORTUGUESE_BRAZILIAN == SUBLANG_DEFAULT.
+ Same phenomenon as SUBLANG_ENGLISH_US == SUBLANG_DEFAULT. */
+ case SUBLANG_PORTUGUESE_BRAZILIAN: return "pt_BR";
+ case SUBLANG_PORTUGUESE: return "pt_PT";
+ }
+ return "pt";
+ case LANG_PUNJABI:
+ switch (sub)
+ {
+ case SUBLANG_PUNJABI_INDIA: return "pa_IN"; /* Gurmukhi script */
+ case SUBLANG_PUNJABI_PAKISTAN: return "pa_PK"; /* Arabic script */
+ }
+ return "pa";
+ case LANG_QUECHUA:
+ /* Note: Microsoft uses the non-ISO language code "quz". */
+ switch (sub)
+ {
+ case SUBLANG_QUECHUA_BOLIVIA: return "qu_BO";
+ case SUBLANG_QUECHUA_ECUADOR: return "qu_EC";
+ case SUBLANG_QUECHUA_PERU: return "qu_PE";
+ }
+ return "qu";
+ case LANG_ROMANIAN:
+ switch (sub)
+ {
+ case SUBLANG_ROMANIAN_ROMANIA: return "ro_RO";
+ case SUBLANG_ROMANIAN_MOLDOVA: return "ro_MD";
+ }
+ return "ro";
+ case LANG_ROMANSH:
+ switch (sub)
+ {
+ case SUBLANG_ROMANSH_SWITZERLAND: return "rm_CH";
+ }
+ return "rm";
+ case LANG_RUSSIAN:
+ switch (sub)
+ {
+ case SUBLANG_RUSSIAN_RUSSIA: return "ru_RU";
+ case SUBLANG_RUSSIAN_MOLDAVIA: return "ru_MD";
+ }
+ return "ru"; /* Ambiguous: could be "ru_RU" or "ru_UA" or "ru_MD". */
+ case LANG_SAMI:
+ switch (sub)
+ {
+ /* Northern Sami */
+ case 0x00: return "se";
+ case SUBLANG_SAMI_NORTHERN_NORWAY: return "se_NO";
+ case SUBLANG_SAMI_NORTHERN_SWEDEN: return "se_SE";
+ case SUBLANG_SAMI_NORTHERN_FINLAND: return "se_FI";
+ /* Lule Sami */
+ case 0x1f: return "smj";
+ case SUBLANG_SAMI_LULE_NORWAY: return "smj_NO";
+ case SUBLANG_SAMI_LULE_SWEDEN: return "smj_SE";
+ /* Southern Sami */
+ case 0x1e: return "sma";
+ case SUBLANG_SAMI_SOUTHERN_NORWAY: return "sma_NO";
+ case SUBLANG_SAMI_SOUTHERN_SWEDEN: return "sma_SE";
+ /* Skolt Sami */
+ case 0x1d: return "sms";
+ case SUBLANG_SAMI_SKOLT_FINLAND: return "sms_FI";
+ /* Inari Sami */
+ case 0x1c: return "smn";
+ case SUBLANG_SAMI_INARI_FINLAND: return "smn_FI";
+ }
+ return "se"; /* or "smi"? */
+ case LANG_SANSKRIT:
+ switch (sub)
+ {
+ case SUBLANG_SANSKRIT_INDIA: return "sa_IN";
+ }
+ return "sa";
+ case LANG_SCOTTISH_GAELIC:
+ switch (sub)
+ {
+ case SUBLANG_DEFAULT: return "gd_GB";
+ }
+ return "gd";
+ case LANG_SINDHI:
+ switch (sub)
+ {
+ case SUBLANG_SINDHI_INDIA: return "sd_IN";
+ case SUBLANG_SINDHI_PAKISTAN: return "sd_PK";
+ /*case SUBLANG_SINDHI_AFGHANISTAN: return "sd_AF";*/
+ }
+ return "sd";
+ case LANG_SINHALESE:
+ switch (sub)
+ {
+ case SUBLANG_SINHALESE_SRI_LANKA: return "si_LK";
+ }
+ return "si";
+ case LANG_SLOVAK:
+ switch (sub)
+ {
+ case SUBLANG_SLOVAK_SLOVAKIA: return "sk_SK";
+ }
+ return "sk";
+ case LANG_SLOVENIAN:
+ switch (sub)
+ {
+ case SUBLANG_SLOVENIAN_SLOVENIA: return "sl_SI";
+ }
+ return "sl";
+ case LANG_SOMALI:
+ switch (sub)
+ {
+ case SUBLANG_DEFAULT: return "so_SO";
+ }
+ return "so";
+ case LANG_SORBIAN:
+ /* FIXME: Adjust this when such locales appear on Unix. */
+ switch (sub)
+ {
+ /* Upper Sorbian */
+ case 0x00: return "hsb";
+ case SUBLANG_UPPER_SORBIAN_GERMANY: return "hsb_DE";
+ /* Lower Sorbian */
+ case 0x1f: return "dsb";
+ case SUBLANG_LOWER_SORBIAN_GERMANY: return "dsb_DE";
+ }
+ return "wen";
+ case LANG_SOTHO:
+ /* <http://www.microsoft.com/globaldev/reference/lcid-all.mspx> calls
+ it "Sepedi"; according to
+ <http://www.ethnologue.com/show_language.asp?code=nso>
+ <http://www.ethnologue.com/show_language.asp?code=sot>
+ it's the same as Northern Sotho. */
+ switch (sub)
+ {
+ case SUBLANG_SOTHO_SOUTH_AFRICA: return "nso_ZA";
+ }
+ return "nso";
+ case LANG_SPANISH:
+ switch (sub)
+ {
+ case SUBLANG_SPANISH: return "es_ES";
+ case SUBLANG_SPANISH_MEXICAN: return "es_MX";
+ case SUBLANG_SPANISH_MODERN:
+ return "es_ES@modern"; /* not seen on Unix */
+ case SUBLANG_SPANISH_GUATEMALA: return "es_GT";
+ case SUBLANG_SPANISH_COSTA_RICA: return "es_CR";
+ case SUBLANG_SPANISH_PANAMA: return "es_PA";
+ case SUBLANG_SPANISH_DOMINICAN_REPUBLIC: return "es_DO";
+ case SUBLANG_SPANISH_VENEZUELA: return "es_VE";
+ case SUBLANG_SPANISH_COLOMBIA: return "es_CO";
+ case SUBLANG_SPANISH_PERU: return "es_PE";
+ case SUBLANG_SPANISH_ARGENTINA: return "es_AR";
+ case SUBLANG_SPANISH_ECUADOR: return "es_EC";
+ case SUBLANG_SPANISH_CHILE: return "es_CL";
+ case SUBLANG_SPANISH_URUGUAY: return "es_UY";
+ case SUBLANG_SPANISH_PARAGUAY: return "es_PY";
+ case SUBLANG_SPANISH_BOLIVIA: return "es_BO";
+ case SUBLANG_SPANISH_EL_SALVADOR: return "es_SV";
+ case SUBLANG_SPANISH_HONDURAS: return "es_HN";
+ case SUBLANG_SPANISH_NICARAGUA: return "es_NI";
+ case SUBLANG_SPANISH_PUERTO_RICO: return "es_PR";
+ case SUBLANG_SPANISH_US: return "es_US";
+ }
+ return "es";
+ case LANG_SUTU:
+ switch (sub)
+ {
+ case SUBLANG_DEFAULT: return "bnt_TZ"; /* or "st_LS" or "nso_ZA"? */
+ }
+ return "bnt";
+ case LANG_SWAHILI:
+ switch (sub)
+ {
+ case SUBLANG_SWAHILI_KENYA: return "sw_KE";
+ }
+ return "sw";
+ case LANG_SWEDISH:
+ switch (sub)
+ {
+ case SUBLANG_SWEDISH_SWEDEN: return "sv_SE";
+ case SUBLANG_SWEDISH_FINLAND: return "sv_FI";
+ }
+ return "sv";
+ case LANG_SYRIAC:
+ switch (sub)
+ {
+ case SUBLANG_SYRIAC_SYRIA: return "syr_SY"; /* An extinct language. */
+ }
+ return "syr";
+ case LANG_TAGALOG:
+ switch (sub)
+ {
+ case SUBLANG_TAGALOG_PHILIPPINES: return "tl_PH"; /* or "fil_PH"? */
+ }
+ return "tl"; /* or "fil"? */
+ case LANG_TAJIK:
+ switch (sub)
+ {
+ case 0x1f: return "tg";
+ case SUBLANG_TAJIK_TAJIKISTAN: return "tg_TJ";
+ }
+ return "tg";
+ case LANG_TAMAZIGHT:
+ /* Note: Microsoft uses the non-ISO language code "tmz". */
+ switch (sub)
+ {
+ /* FIXME: Adjust this when Tamazight locales appear on Unix. */
+ case SUBLANG_TAMAZIGHT_ARABIC: return "ber_MA@arabic";
+ case 0x1f: return "ber@latin";
+ case SUBLANG_TAMAZIGHT_ALGERIA_LATIN: return "ber_DZ@latin";
+ }
+ return "ber";
+ case LANG_TAMIL:
+ switch (sub)
+ {
+ case SUBLANG_TAMIL_INDIA: return "ta_IN";
+ }
+ return "ta"; /* Ambiguous: could be "ta_IN" or "ta_LK" or "ta_SG". */
+ case LANG_TATAR:
+ switch (sub)
+ {
+ case SUBLANG_TATAR_RUSSIA: return "tt_RU";
+ }
+ return "tt";
+ case LANG_TELUGU:
+ switch (sub)
+ {
+ case SUBLANG_TELUGU_INDIA: return "te_IN";
+ }
+ return "te";
+ case LANG_THAI:
+ switch (sub)
+ {
+ case SUBLANG_THAI_THAILAND: return "th_TH";
+ }
+ return "th";
+ case LANG_TIBETAN:
+ switch (sub)
+ {
+ case SUBLANG_TIBETAN_PRC:
+ /* Most Tibetans would not like "bo_CN". But Tibet does not yet
+ have a country code of its own. */
+ return "bo";
+ case SUBLANG_TIBETAN_BHUTAN: return "bo_BT";
+ }
+ return "bo";
+ case LANG_TIGRINYA:
+ switch (sub)
+ {
+ case SUBLANG_TIGRINYA_ETHIOPIA: return "ti_ET";
+ case SUBLANG_TIGRINYA_ERITREA: return "ti_ER";
+ }
+ return "ti";
+ case LANG_TSONGA:
+ switch (sub)
+ {
+ case SUBLANG_DEFAULT: return "ts_ZA";
+ }
+ return "ts";
+ case LANG_TSWANA:
+ /* Spoken in South Africa, Botswana. */
+ switch (sub)
+ {
+ case SUBLANG_TSWANA_SOUTH_AFRICA: return "tn_ZA";
+ }
+ return "tn";
+ case LANG_TURKISH:
+ switch (sub)
+ {
+ case SUBLANG_TURKISH_TURKEY: return "tr_TR";
+ }
+ return "tr";
+ case LANG_TURKMEN:
+ switch (sub)
+ {
+ case SUBLANG_TURKMEN_TURKMENISTAN: return "tk_TM";
+ }
+ return "tk";
+ case LANG_UIGHUR:
+ switch (sub)
+ {
+ case SUBLANG_UIGHUR_PRC: return "ug_CN";
+ }
+ return "ug";
+ case LANG_UKRAINIAN:
+ switch (sub)
+ {
+ case SUBLANG_UKRAINIAN_UKRAINE: return "uk_UA";
+ }
+ return "uk";
+ case LANG_URDU:
+ switch (sub)
+ {
+ case SUBLANG_URDU_PAKISTAN: return "ur_PK";
+ case SUBLANG_URDU_INDIA: return "ur_IN";
+ }
+ return "ur";
+ case LANG_UZBEK:
+ switch (sub)
+ {
+ case 0x1f: return "uz";
+ case SUBLANG_UZBEK_LATIN: return "uz_UZ";
+ case 0x1e: return "uz@cyrillic";
+ case SUBLANG_UZBEK_CYRILLIC: return "uz_UZ@cyrillic";
+ }
+ return "uz";
+ case LANG_VENDA:
+ switch (sub)
+ {
+ case SUBLANG_DEFAULT: return "ve_ZA";
+ }
+ return "ve";
+ case LANG_VIETNAMESE:
+ switch (sub)
+ {
+ case SUBLANG_VIETNAMESE_VIETNAM: return "vi_VN";
+ }
+ return "vi";
+ case LANG_WELSH:
+ switch (sub)
+ {
+ case SUBLANG_WELSH_UNITED_KINGDOM: return "cy_GB";
+ }
+ return "cy";
+ case LANG_WOLOF:
+ switch (sub)
+ {
+ case SUBLANG_WOLOF_SENEGAL: return "wo_SN";
+ }
+ return "wo";
+ case LANG_XHOSA:
+ switch (sub)
+ {
+ case SUBLANG_XHOSA_SOUTH_AFRICA: return "xh_ZA";
+ }
+ return "xh";
+ case LANG_YAKUT:
+ switch (sub)
+ {
+ case SUBLANG_YAKUT_RUSSIA: return "sah_RU";
+ }
+ return "sah";
+ case LANG_YI:
+ switch (sub)
+ {
+ case SUBLANG_YI_PRC: return "ii_CN";
+ }
+ return "ii";
+ case LANG_YIDDISH:
+ switch (sub)
+ {
+ case SUBLANG_DEFAULT: return "yi_IL";
+ }
+ return "yi";
+ case LANG_YORUBA:
+ switch (sub)
+ {
+ case SUBLANG_YORUBA_NIGERIA: return "yo_NG";
+ }
+ return "yo";
+ case LANG_ZULU:
+ switch (sub)
+ {
+ case SUBLANG_ZULU_SOUTH_AFRICA: return "zu_ZA";
+ }
+ return "zu";
+ default: return "C";
+ }
}
}
+# if !defined IN_LIBINTL
+static
+# endif
+const char *
+gl_locale_name_from_win32_LCID (LCID lcid)
+{
+ LANGID langid;
+
+ /* Strip off the sorting rules, keep only the language part. */
+ langid = LANGIDFROMLCID (lcid);
+
+ return gl_locale_name_from_win32_LANGID (langid);
+}
+
#endif
+
+#if HAVE_USELOCALE /* glibc or MacOS X */
+
+/* Simple hash set of strings. We don't want to drag in lots of hash table
+ code here. */
+
+# define SIZE_BITS (sizeof (size_t) * CHAR_BIT)
+
+/* A hash function for NUL-terminated char* strings using
+ the method described by Bruno Haible.
+ See http://www.haible.de/bruno/hashfunc.html. */
+static size_t
+string_hash (const void *x)
+{
+ const char *s = (const char *) x;
+ size_t h = 0;
+
+ for (; *s; s++)
+ h = *s + ((h << 9) | (h >> (SIZE_BITS - 9)));
+
+ return h;
+}
+
+/* A hash table of fixed size. Multiple threads can access it read-only
+ simultaneously, but only one thread can insert into it at the same time. */
+
+/* A node in a hash bucket collision list. */
+struct hash_node
+ {
+ struct hash_node * volatile next;
+ char contents[100]; /* has variable size */
+ };
+
+# define HASH_TABLE_SIZE 257
+static struct hash_node * volatile struniq_hash_table[HASH_TABLE_SIZE]
+ /* = { NULL, ..., NULL } */;
+
+/* This lock protects the struniq_hash_table against multiple simultaneous
+ insertions. */
+gl_lock_define_initialized(static, struniq_lock)
+
+/* Store a copy of the given string in a string pool with indefinite extent.
+ Return a pointer to this copy. */
+static const char *
+struniq (const char *string)
+{
+ size_t hashcode = string_hash (string);
+ size_t slot = hashcode % HASH_TABLE_SIZE;
+ size_t size;
+ struct hash_node *new_node;
+ struct hash_node *p;
+ for (p = struniq_hash_table[slot]; p != NULL; p = p->next)
+ if (strcmp (p->contents, string) == 0)
+ return p->contents;
+ size = strlen (string) + 1;
+ new_node =
+ (struct hash_node *)
+ malloc (offsetof (struct hash_node, contents[0]) + size);
+ if (new_node == NULL)
+ /* Out of memory. Return a statically allocated string. */
+ return "C";
+ memcpy (new_node->contents, string, size);
+ /* Lock while inserting new_node. */
+ gl_lock_lock (struniq_lock);
+ /* Check whether another thread already added the string while we were
+ waiting on the lock. */
+ for (p = struniq_hash_table[slot]; p != NULL; p = p->next)
+ if (strcmp (p->contents, string) == 0)
+ {
+ free (new_node);
+ new_node = p;
+ goto done;
+ }
+ /* Really insert new_node into the hash table. Fill new_node entirely first,
+ because other threads may be iterating over the linked list. */
+ new_node->next = struniq_hash_table[slot];
+ struniq_hash_table[slot] = new_node;
+ done:
+ /* Unlock after new_node is inserted. */
+ gl_lock_unlock (struniq_lock);
+ return new_node->contents;
+}
+
+#endif
+
+
+#if defined IN_LIBINTL || HAVE_USELOCALE
+
+/* Like gl_locale_name_thread, except that the result is not in storage of
+ indefinite extent. */
+# if !defined IN_LIBINTL
+static
+# endif
+const char *
+gl_locale_name_thread_unsafe (int category, const char *categoryname)
+{
+# if HAVE_USELOCALE
+ {
+ locale_t thread_locale = uselocale (NULL);
+ if (thread_locale != LC_GLOBAL_LOCALE)
+ {
+# if __GLIBC__ >= 2
+ /* Work around an incorrect definition of the _NL_LOCALE_NAME macro in
+ glibc < 2.12.
+ See <http://sourceware.org/bugzilla/show_bug.cgi?id=10968>. */
+ const char *name =
+ nl_langinfo (_NL_ITEM ((category), _NL_ITEM_INDEX (-1)));
+ if (name[0] == '\0')
+ /* Fallback code for glibc < 2.4, which did not implement
+ nl_langinfo (_NL_LOCALE_NAME (category)). */
+ name = thread_locale->__names[category];
+ return name;
+# endif
+# if defined __APPLE__ && defined __MACH__ /* MacOS X */
+ /* The locale name is found deep in an undocumented data structure.
+ Since it's stored in a buffer of size 32 and newlocale() rejects
+ locale names of length > 31, we can assume that it is NUL terminated
+ in this buffer. But we need to make a copy of the locale name, of
+ indefinite extent. */
+ struct _xlocale_part1_v0 /* used in MacOS X 10.5 */
+ {
+ int32_t __refcount;
+ void (*__free_extra)(void *);
+ __darwin_mbstate_t __mbs[10];
+ int64_t __magic;
+ };
+ struct _xlocale_part1_v1 /* used in MacOS X >= 10.6.0 */
+ {
+ int32_t __refcount;
+ void (*__free_extra)(void *);
+ __darwin_mbstate_t __mbs[10];
+ /*pthread_lock_t*/ int __lock;
+ int64_t __magic;
+ };
+ struct _xlocale_part2
+ {
+ int64_t __magic;
+ unsigned char __collate_load_error;
+ unsigned char __collate_substitute_nontrivial;
+ unsigned char _messages_using_locale;
+ unsigned char _monetary_using_locale;
+ unsigned char _numeric_using_locale;
+ unsigned char _time_using_locale;
+ unsigned char __mlocale_changed;
+ unsigned char __nlocale_changed;
+ unsigned char __numeric_fp_cvt;
+ struct __xlocale_st_collate *__lc_collate;
+ struct __xlocale_st_runelocale *__lc_ctype;
+ struct __xlocale_st_messages *__lc_messages;
+ struct __xlocale_st_monetary *__lc_monetary;
+ struct __xlocale_st_numeric *__lc_numeric;
+ struct _xlocale *__lc_numeric_loc;
+ struct __xlocale_st_time *__lc_time;
+ /* more */
+ };
+ struct __xlocale_st_collate
+ {
+ int32_t __refcount;
+ void (*__free_extra)(void *);
+ char __encoding[32];
+ /* more */
+ };
+ struct __xlocale_st_runelocale
+ {
+ int32_t __refcount;
+ void (*__free_extra)(void *);
+ char __ctype_encoding[32];
+ /* more */
+ };
+ struct __xlocale_st_messages
+ {
+ int32_t __refcount;
+ void (*__free_extra)(void *);
+ char *_messages_locale_buf;
+ /* more */
+ };
+ struct __xlocale_st_monetary
+ {
+ int32_t __refcount;
+ void (*__free_extra)(void *);
+ char *_monetary_locale_buf;
+ /* more */
+ };
+ struct __xlocale_st_numeric {
+ int32_t __refcount;
+ void (*__free_extra)(void *);
+ char *_numeric_locale_buf;
+ /* more */
+ };
+ struct __xlocale_st_time {
+ int32_t __refcount;
+ void (*__free_extra)(void *);
+ char *_time_locale_buf;
+ /* more */
+ };
+ struct _xlocale_part2 *tlp;
+ if (((struct _xlocale_part1_v0 *) thread_locale)->__magic
+ == 0x786C6F63616C6530LL)
+ /* MacOS X 10.5 */
+ tlp =
+ (struct _xlocale_part2 *)
+ &((struct _xlocale_part1_v0 *) thread_locale)->__magic;
+ else if (((struct _xlocale_part1_v1 *) thread_locale)->__magic
+ == 0x786C6F63616C6530LL)
+ /* MacOS X >= 10.6.0 */
+ tlp =
+ (struct _xlocale_part2 *)
+ &((struct _xlocale_part1_v1 *) thread_locale)->__magic;
+ else
+ /* Unsupported version of MacOS X: The internals of 'struct _xlocale'
+ have changed again. */
+ return "";
+ switch (category)
+ {
+ case LC_CTYPE:
+ return tlp->__lc_ctype->__ctype_encoding;
+ case LC_NUMERIC:
+ return tlp->_numeric_using_locale
+ ? tlp->__lc_numeric->_numeric_locale_buf
+ : "C";
+ case LC_TIME:
+ return tlp->_time_using_locale
+ ? tlp->__lc_time->_time_locale_buf
+ : "C";
+ case LC_COLLATE:
+ return !tlp->__collate_load_error
+ ? tlp->__lc_collate->__encoding
+ : "C";
+ case LC_MONETARY:
+ return tlp->_monetary_using_locale
+ ? tlp->__lc_monetary->_monetary_locale_buf
+ : "C";
+ case LC_MESSAGES:
+ return tlp->_messages_using_locale
+ ? tlp->__lc_messages->_messages_locale_buf
+ : "C";
+ default: /* We shouldn't get here. */
+ return "";
+ }
+# endif
+ }
+ }
+# endif
+ return NULL;
+}
+
+#endif
+
+const char *
+gl_locale_name_thread (int category, const char *categoryname)
+{
+#if HAVE_USELOCALE
+ const char *name = gl_locale_name_thread_unsafe (category, categoryname);
+ if (name != NULL)
+ return struniq (name);
+#endif
+ return NULL;
+}
+
/* XPG3 defines the result of 'setlocale (category, NULL)' as:
"Directs 'setlocale()' to query 'category' and return the current
setting of 'local'."
@@ -985,12 +2775,6 @@ gl_locale_name_canonicalize (char *name)
# define HAVE_LOCALE_NULL
#endif
-/* Determine the current locale's name, and canonicalize it into XPG syntax
- language[_territory][.codeset][@modifier]
- The codeset part in the result is not reliable; the locale_charset()
- should be used for codeset information instead.
- The result must not be freed; it is statically allocated. */
-
const char *
gl_locale_name_posix (int category, const char *categoryname)
{
@@ -999,6 +2783,30 @@ gl_locale_name_posix (int category, const char *categoryname)
#if defined HAVE_SETLOCALE && defined HAVE_LC_MESSAGES && defined HAVE_LOCALE_NULL
return setlocale (category, NULL);
#else
+ /* On other systems we ignore what setlocale reports and instead look at the
+ environment variables directly. This is necessary
+ 1. on systems which have a facility for customizing the default locale
+ (MacOS X, native Windows, Cygwin) and where the system's setlocale()
+ function ignores this default locale (MacOS X, Cygwin), in two cases:
+ a. when the user missed to use the setlocale() override from libintl
+ (for example by not including <libintl.h>),
+ b. when setlocale supports only the "C" locale, such as on Cygwin
+ 1.5.x. In this case even the override from libintl cannot help.
+ 2. on all systems where setlocale supports only the "C" locale. */
+ /* Strictly speaking, it is a POSIX violation to look at the environment
+ variables regardless whether setlocale has been called or not. POSIX
+ says:
+ "For C-language programs, the POSIX locale shall be the
+ default locale when the setlocale() function is not called."
+ But we assume that all programs that use internationalized APIs call
+ setlocale (LC_ALL, ""). */
+ return gl_locale_name_environ (category, categoryname);
+#endif
+}
+
+const char *
+gl_locale_name_environ (int category, const char *categoryname)
+{
const char *retval;
/* Setting of LC_ALL overrides all other. */
@@ -1012,10 +2820,21 @@ gl_locale_name_posix (int category, const char *categoryname)
/* Last possibility is the LANG environment variable. */
retval = getenv ("LANG");
if (retval != NULL && retval[0] != '\0')
- return retval;
+ {
+#if HAVE_CFLOCALECOPYCURRENT || HAVE_CFPREFERENCESCOPYAPPVALUE
+ /* MacOS X 10.2 or newer.
+ Ignore invalid LANG value set by the Terminal application. */
+ if (strcmp (retval, "UTF-8") != 0)
+#endif
+#if defined __CYGWIN__
+ /* Cygwin.
+ Ignore dummy LANG value set by ~/.profile. */
+ if (strcmp (retval, "C.UTF-8") != 0)
+#endif
+ return retval;
+ }
return NULL;
-#endif
}
const char *
@@ -1028,9 +2847,28 @@ gl_locale_name_default (void)
implementation-defined locale. Some implementations may provide
facilities for local installation administrators to set the default
locale, customizing it for each location. POSIX:2001 does not require
- such a facility. */
+ such a facility.
+
+ The systems with such a facility are MacOS X and Windows: They provide a
+ GUI that allows the user to choose a locale.
+ - On MacOS X, by default, none of LC_* or LANG are set. Starting with
+ MacOS X 10.4 or 10.5, LANG is set for processes launched by the
+ 'Terminal' application (but sometimes to an incorrect value "UTF-8").
+ When no environment variable is set, setlocale (LC_ALL, "") uses the
+ "C" locale.
+ - On native Windows, by default, none of LC_* or LANG are set.
+ When no environment variable is set, setlocale (LC_ALL, "") uses the
+ locale chosen by the user.
+ - On Cygwin 1.5.x, by default, none of LC_* or LANG are set.
+ When no environment variable is set, setlocale (LC_ALL, "") uses the
+ "C" locale.
+ - On Cygwin 1.7, by default, LANG is set to "C.UTF-8" when the default
+ ~/.profile is executed.
+ When no environment variable is set, setlocale (LC_ALL, "") uses the
+ "C.UTF-8" locale, which operates in the same way as the "C" locale.
+ */
-#if !(HAVE_CFLOCALECOPYCURRENT || HAVE_CFPREFERENCESCOPYAPPVALUE || defined(WIN32_NATIVE))
+#if !(HAVE_CFLOCALECOPYCURRENT || HAVE_CFPREFERENCESCOPYAPPVALUE || defined WIN32_NATIVE || defined __CYGWIN__)
/* The system does not have a way of setting the locale, other than the
POSIX specified environment variables. We use C as default locale. */
@@ -1051,454 +2889,68 @@ gl_locale_name_default (void)
if (cached_localename == NULL)
{
- char namebuf[256];
+ char namebuf[256];
# if HAVE_CFLOCALECOPYCURRENT /* MacOS X 10.3 or newer */
- CFLocaleRef locale = CFLocaleCopyCurrent ();
- CFStringRef name = CFLocaleGetIdentifier (locale);
-
- if (CFStringGetCString (name, namebuf, sizeof(namebuf),
- kCFStringEncodingASCII))
- {
- gl_locale_name_canonicalize (namebuf);
- cached_localename = strdup (namebuf);
- }
- CFRelease (locale);
+ CFLocaleRef locale = CFLocaleCopyCurrent ();
+ CFStringRef name = CFLocaleGetIdentifier (locale);
+
+ if (CFStringGetCString (name, namebuf, sizeof (namebuf),
+ kCFStringEncodingASCII))
+ {
+ gl_locale_name_canonicalize (namebuf);
+ cached_localename = strdup (namebuf);
+ }
+ CFRelease (locale);
# elif HAVE_CFPREFERENCESCOPYAPPVALUE /* MacOS X 10.2 or newer */
- CFTypeRef value =
- CFPreferencesCopyAppValue (CFSTR ("AppleLocale"),
- kCFPreferencesCurrentApplication);
- if (value != NULL
- && CFGetTypeID (value) == CFStringGetTypeID ()
- && CFStringGetCString ((CFStringRef)value, namebuf, sizeof(namebuf),
- kCFStringEncodingASCII))
- {
- gl_locale_name_canonicalize (namebuf);
- cached_localename = strdup (namebuf);
- }
+ CFTypeRef value =
+ CFPreferencesCopyAppValue (CFSTR ("AppleLocale"),
+ kCFPreferencesCurrentApplication);
+ if (value != NULL
+ && CFGetTypeID (value) == CFStringGetTypeID ()
+ && CFStringGetCString ((CFStringRef)value,
+ namebuf, sizeof (namebuf),
+ kCFStringEncodingASCII))
+ {
+ gl_locale_name_canonicalize (namebuf);
+ cached_localename = strdup (namebuf);
+ }
# endif
- if (cached_localename == NULL)
- cached_localename = "C";
+ if (cached_localename == NULL)
+ cached_localename = "C";
}
return cached_localename;
}
# endif
-# if defined(WIN32_NATIVE) /* WIN32, not Cygwin */
+# if defined WIN32_NATIVE || defined __CYGWIN__ /* WIN32 or Cygwin */
{
LCID lcid;
- LANGID langid;
- int primary, sub;
/* Use native Win32 API locale ID. */
lcid = GetThreadLocale ();
- /* Strip off the sorting rules, keep only the language part. */
- langid = LANGIDFROMLCID (lcid);
-
- /* Split into language and territory part. */
- primary = PRIMARYLANGID (langid);
- sub = SUBLANGID (langid);
-
- /* Dispatch on language.
- See also http://www.unicode.org/unicode/onlinedat/languages.html .
- For details about languages, see http://www.ethnologue.com/ . */
- switch (primary)
- {
- case LANG_AFRIKAANS: return "af_ZA";
- case LANG_ALBANIAN: return "sq_AL";
- case LANG_AMHARIC: return "am_ET";
- case LANG_ARABIC:
- switch (sub)
- {
- case SUBLANG_ARABIC_SAUDI_ARABIA: return "ar_SA";
- case SUBLANG_ARABIC_IRAQ: return "ar_IQ";
- case SUBLANG_ARABIC_EGYPT: return "ar_EG";
- case SUBLANG_ARABIC_LIBYA: return "ar_LY";
- case SUBLANG_ARABIC_ALGERIA: return "ar_DZ";
- case SUBLANG_ARABIC_MOROCCO: return "ar_MA";
- case SUBLANG_ARABIC_TUNISIA: return "ar_TN";
- case SUBLANG_ARABIC_OMAN: return "ar_OM";
- case SUBLANG_ARABIC_YEMEN: return "ar_YE";
- case SUBLANG_ARABIC_SYRIA: return "ar_SY";
- case SUBLANG_ARABIC_JORDAN: return "ar_JO";
- case SUBLANG_ARABIC_LEBANON: return "ar_LB";
- case SUBLANG_ARABIC_KUWAIT: return "ar_KW";
- case SUBLANG_ARABIC_UAE: return "ar_AE";
- case SUBLANG_ARABIC_BAHRAIN: return "ar_BH";
- case SUBLANG_ARABIC_QATAR: return "ar_QA";
- }
- return "ar";
- case LANG_ARMENIAN: return "hy_AM";
- case LANG_ASSAMESE: return "as_IN";
- case LANG_AZERI:
- switch (sub)
- {
- /* FIXME: Adjust this when Azerbaijani locales appear on Unix. */
- case SUBLANG_AZERI_LATIN: return "az_AZ@latin";
- case SUBLANG_AZERI_CYRILLIC: return "az_AZ@cyrillic";
- }
- return "az";
- case LANG_BASQUE:
- switch (sub)
- {
- case SUBLANG_DEFAULT: return "eu_ES";
- }
- return "eu"; /* Ambiguous: could be "eu_ES" or "eu_FR". */
- case LANG_BELARUSIAN: return "be_BY";
- case LANG_BENGALI:
- switch (sub)
- {
- case SUBLANG_BENGALI_INDIA: return "bn_IN";
- case SUBLANG_BENGALI_BANGLADESH: return "bn_BD";
- }
- return "bn";
- case LANG_BULGARIAN: return "bg_BG";
- case LANG_BURMESE: return "my_MM";
- case LANG_CAMBODIAN: return "km_KH";
- case LANG_CATALAN: return "ca_ES";
- case LANG_CHEROKEE: return "chr_US";
- case LANG_CHINESE:
- switch (sub)
- {
- case SUBLANG_CHINESE_TRADITIONAL: return "zh_TW";
- case SUBLANG_CHINESE_SIMPLIFIED: return "zh_CN";
- case SUBLANG_CHINESE_HONGKONG: return "zh_HK";
- case SUBLANG_CHINESE_SINGAPORE: return "zh_SG";
- case SUBLANG_CHINESE_MACAU: return "zh_MO";
- }
- return "zh";
- case LANG_CROATIAN: /* LANG_CROATIAN == LANG_SERBIAN
- * What used to be called Serbo-Croatian
- * should really now be two separate
- * languages because of political reasons.
- * (Says tml, who knows nothing about Serbian
- * or Croatian.)
- * (I can feel those flames coming already.)
- */
- switch (sub)
- {
- case SUBLANG_DEFAULT: return "hr_HR";
- case SUBLANG_SERBIAN_LATIN: return "sr_CS";
- case SUBLANG_SERBIAN_CYRILLIC: return "sr_CS@cyrillic";
- }
- return "hr";
- case LANG_CZECH: return "cs_CZ";
- case LANG_DANISH: return "da_DK";
- case LANG_DIVEHI: return "dv_MV";
- case LANG_DUTCH:
- switch (sub)
- {
- case SUBLANG_DUTCH: return "nl_NL";
- case SUBLANG_DUTCH_BELGIAN: /* FLEMISH, VLAAMS */ return "nl_BE";
- }
- return "nl";
- case LANG_EDO: return "bin_NG";
- case LANG_ENGLISH:
- switch (sub)
- {
- /* SUBLANG_ENGLISH_US == SUBLANG_DEFAULT. Heh. I thought
- * English was the language spoken in England.
- * Oh well.
- */
- case SUBLANG_ENGLISH_US: return "en_US";
- case SUBLANG_ENGLISH_UK: return "en_GB";
- case SUBLANG_ENGLISH_AUS: return "en_AU";
- case SUBLANG_ENGLISH_CAN: return "en_CA";
- case SUBLANG_ENGLISH_NZ: return "en_NZ";
- case SUBLANG_ENGLISH_EIRE: return "en_IE";
- case SUBLANG_ENGLISH_SOUTH_AFRICA: return "en_ZA";
- case SUBLANG_ENGLISH_JAMAICA: return "en_JM";
- case SUBLANG_ENGLISH_CARIBBEAN: return "en_GD"; /* Grenada? */
- case SUBLANG_ENGLISH_BELIZE: return "en_BZ";
- case SUBLANG_ENGLISH_TRINIDAD: return "en_TT";
- case SUBLANG_ENGLISH_ZIMBABWE: return "en_ZW";
- case SUBLANG_ENGLISH_PHILIPPINES: return "en_PH";
- case SUBLANG_ENGLISH_INDONESIA: return "en_ID";
- case SUBLANG_ENGLISH_HONGKONG: return "en_HK";
- case SUBLANG_ENGLISH_INDIA: return "en_IN";
- case SUBLANG_ENGLISH_MALAYSIA: return "en_MY";
- case SUBLANG_ENGLISH_SINGAPORE: return "en_SG";
- }
- return "en";
- case LANG_ESTONIAN: return "et_EE";
- case LANG_FAEROESE: return "fo_FO";
- case LANG_FARSI: return "fa_IR";
- case LANG_FINNISH: return "fi_FI";
- case LANG_FRENCH:
- switch (sub)
- {
- case SUBLANG_FRENCH: return "fr_FR";
- case SUBLANG_FRENCH_BELGIAN: /* WALLOON */ return "fr_BE";
- case SUBLANG_FRENCH_CANADIAN: return "fr_CA";
- case SUBLANG_FRENCH_SWISS: return "fr_CH";
- case SUBLANG_FRENCH_LUXEMBOURG: return "fr_LU";
- case SUBLANG_FRENCH_MONACO: return "fr_MC";
- case SUBLANG_FRENCH_WESTINDIES: return "fr"; /* Caribbean? */
- case SUBLANG_FRENCH_REUNION: return "fr_RE";
- case SUBLANG_FRENCH_CONGO: return "fr_CG";
- case SUBLANG_FRENCH_SENEGAL: return "fr_SN";
- case SUBLANG_FRENCH_CAMEROON: return "fr_CM";
- case SUBLANG_FRENCH_COTEDIVOIRE: return "fr_CI";
- case SUBLANG_FRENCH_MALI: return "fr_ML";
- case SUBLANG_FRENCH_MOROCCO: return "fr_MA";
- case SUBLANG_FRENCH_HAITI: return "fr_HT";
- }
- return "fr";
- case LANG_FRISIAN: return "fy_NL";
- case LANG_FULFULDE:
- /* Spoken in Nigeria, Guinea, Senegal, Mali, Niger, Cameroon, Benin. */
- return "ff_NG";
- case LANG_GAELIC:
- switch (sub)
- {
- case 0x01: /* SCOTTISH */ return "gd_GB";
- case 0x02: /* IRISH */ return "ga_IE";
- }
- return "C";
- case LANG_GALICIAN: return "gl_ES";
- case LANG_GEORGIAN: return "ka_GE";
- case LANG_GERMAN:
- switch (sub)
- {
- case SUBLANG_GERMAN: return "de_DE";
- case SUBLANG_GERMAN_SWISS: return "de_CH";
- case SUBLANG_GERMAN_AUSTRIAN: return "de_AT";
- case SUBLANG_GERMAN_LUXEMBOURG: return "de_LU";
- case SUBLANG_GERMAN_LIECHTENSTEIN: return "de_LI";
- }
- return "de";
- case LANG_GREEK: return "el_GR";
- case LANG_GUARANI: return "gn_PY";
- case LANG_GUJARATI: return "gu_IN";
- case LANG_HAUSA: return "ha_NG";
- case LANG_HAWAIIAN:
- /* FIXME: Do they mean Hawaiian ("haw_US", 1000 speakers)
- or Hawaii Creole English ("cpe_US", 600000 speakers)? */
- return "cpe_US";
- case LANG_HEBREW: return "he_IL";
- case LANG_HINDI: return "hi_IN";
- case LANG_HUNGARIAN: return "hu_HU";
- case LANG_IBIBIO: return "nic_NG";
- case LANG_ICELANDIC: return "is_IS";
- case LANG_IGBO: return "ig_NG";
- case LANG_INDONESIAN: return "id_ID";
- case LANG_INUKTITUT: return "iu_CA";
- case LANG_ITALIAN:
- switch (sub)
- {
- case SUBLANG_ITALIAN: return "it_IT";
- case SUBLANG_ITALIAN_SWISS: return "it_CH";
- }
- return "it";
- case LANG_JAPANESE: return "ja_JP";
- case LANG_KANNADA: return "kn_IN";
- case LANG_KANURI: return "kr_NG";
- case LANG_KASHMIRI:
- switch (sub)
- {
- case SUBLANG_DEFAULT: return "ks_PK";
- case SUBLANG_KASHMIRI_INDIA: return "ks_IN";
- }
- return "ks";
- case LANG_KAZAK: return "kk_KZ";
- case LANG_KONKANI:
- /* FIXME: Adjust this when such locales appear on Unix. */
- return "kok_IN";
- case LANG_KOREAN: return "ko_KR";
- case LANG_KYRGYZ: return "ky_KG";
- case LANG_LAO: return "lo_LA";
- case LANG_LATIN: return "la_VA";
- case LANG_LATVIAN: return "lv_LV";
- case LANG_LITHUANIAN: return "lt_LT";
- case LANG_MACEDONIAN: return "mk_MK";
- case LANG_MALAY:
- switch (sub)
- {
- case SUBLANG_MALAY_MALAYSIA: return "ms_MY";
- case SUBLANG_MALAY_BRUNEI_DARUSSALAM: return "ms_BN";
- }
- return "ms";
- case LANG_MALAYALAM: return "ml_IN";
- case LANG_MALTESE: return "mt_MT";
- case LANG_MANIPURI:
- /* FIXME: Adjust this when such locales appear on Unix. */
- return "mni_IN";
- case LANG_MARATHI: return "mr_IN";
- case LANG_MONGOLIAN:
- switch (sub)
- {
- case SUBLANG_DEFAULT: return "mn_MN";
- }
- return "mn"; /* Ambiguous: could be "mn_CN" or "mn_MN". */
- case LANG_NEPALI:
- switch (sub)
- {
- case SUBLANG_DEFAULT: return "ne_NP";
- case SUBLANG_NEPALI_INDIA: return "ne_IN";
- }
- return "ne";
- case LANG_NORWEGIAN:
- switch (sub)
- {
- case SUBLANG_NORWEGIAN_BOKMAL: return "nb_NO";
- case SUBLANG_NORWEGIAN_NYNORSK: return "nn_NO";
- }
- return "no";
- case LANG_ORIYA: return "or_IN";
- case LANG_OROMO: return "om_ET";
- case LANG_PAPIAMENTU: return "pap_AN";
- case LANG_PASHTO:
- return "ps"; /* Ambiguous: could be "ps_PK" or "ps_AF". */
- case LANG_POLISH: return "pl_PL";
- case LANG_PORTUGUESE:
- switch (sub)
- {
- case SUBLANG_PORTUGUESE: return "pt_PT";
- /* Hmm. SUBLANG_PORTUGUESE_BRAZILIAN == SUBLANG_DEFAULT.
- Same phenomenon as SUBLANG_ENGLISH_US == SUBLANG_DEFAULT. */
- case SUBLANG_PORTUGUESE_BRAZILIAN: return "pt_BR";
- }
- return "pt";
- case LANG_PUNJABI:
- switch (sub)
- {
- case SUBLANG_PUNJABI_INDIA: return "pa_IN"; /* Gurmukhi script */
- case SUBLANG_PUNJABI_PAKISTAN: return "pa_PK"; /* Arabic script */
- }
- return "pa";
- case LANG_RHAETO_ROMANCE: return "rm_CH";
- case LANG_ROMANIAN:
- switch (sub)
- {
- case SUBLANG_ROMANIAN_ROMANIA: return "ro_RO";
- case SUBLANG_ROMANIAN_MOLDOVA: return "ro_MD";
- }
- return "ro";
- case LANG_RUSSIAN:
- switch (sub)
- {
- case SUBLANG_DEFAULT: return "ru_RU";
- }
- return "ru"; /* Ambiguous: could be "ru_RU" or "ru_UA" or "ru_MD". */
- case LANG_SAAMI: /* actually Northern Sami */ return "se_NO";
- case LANG_SANSKRIT: return "sa_IN";
- case LANG_SINDHI:
- switch (sub)
- {
- case SUBLANG_SINDHI_PAKISTAN: return "sd_PK";
- case SUBLANG_SINDHI_AFGHANISTAN: return "sd_AF";
- }
- return "sd";
- case LANG_SINHALESE: return "si_LK";
- case LANG_SLOVAK: return "sk_SK";
- case LANG_SLOVENIAN: return "sl_SI";
- case LANG_SOMALI: return "so_SO";
- case LANG_SORBIAN:
- /* FIXME: Adjust this when such locales appear on Unix. */
- return "wen_DE";
- case LANG_SPANISH:
- switch (sub)
- {
- case SUBLANG_SPANISH: return "es_ES";
- case SUBLANG_SPANISH_MEXICAN: return "es_MX";
- case SUBLANG_SPANISH_MODERN:
- return "es_ES@modern"; /* not seen on Unix */
- case SUBLANG_SPANISH_GUATEMALA: return "es_GT";
- case SUBLANG_SPANISH_COSTA_RICA: return "es_CR";
- case SUBLANG_SPANISH_PANAMA: return "es_PA";
- case SUBLANG_SPANISH_DOMINICAN_REPUBLIC: return "es_DO";
- case SUBLANG_SPANISH_VENEZUELA: return "es_VE";
- case SUBLANG_SPANISH_COLOMBIA: return "es_CO";
- case SUBLANG_SPANISH_PERU: return "es_PE";
- case SUBLANG_SPANISH_ARGENTINA: return "es_AR";
- case SUBLANG_SPANISH_ECUADOR: return "es_EC";
- case SUBLANG_SPANISH_CHILE: return "es_CL";
- case SUBLANG_SPANISH_URUGUAY: return "es_UY";
- case SUBLANG_SPANISH_PARAGUAY: return "es_PY";
- case SUBLANG_SPANISH_BOLIVIA: return "es_BO";
- case SUBLANG_SPANISH_EL_SALVADOR: return "es_SV";
- case SUBLANG_SPANISH_HONDURAS: return "es_HN";
- case SUBLANG_SPANISH_NICARAGUA: return "es_NI";
- case SUBLANG_SPANISH_PUERTO_RICO: return "es_PR";
- }
- return "es";
- case LANG_SUTU: return "bnt_TZ"; /* or "st_LS" or "nso_ZA"? */
- case LANG_SWAHILI: return "sw_KE";
- case LANG_SWEDISH:
- switch (sub)
- {
- case SUBLANG_DEFAULT: return "sv_SE";
- case SUBLANG_SWEDISH_FINLAND: return "sv_FI";
- }
- return "sv";
- case LANG_SYRIAC: return "syr_TR"; /* An extinct language. */
- case LANG_TAGALOG: return "tl_PH";
- case LANG_TAJIK: return "tg_TJ";
- case LANG_TAMAZIGHT:
- switch (sub)
- {
- /* FIXME: Adjust this when Tamazight locales appear on Unix. */
- case SUBLANG_TAMAZIGHT_ARABIC: return "ber_MA@arabic";
- case SUBLANG_TAMAZIGHT_ALGERIA_LATIN: return "ber_DZ@latin";
- }
- return "ber_MA";
- case LANG_TAMIL:
- switch (sub)
- {
- case SUBLANG_DEFAULT: return "ta_IN";
- }
- return "ta"; /* Ambiguous: could be "ta_IN" or "ta_LK" or "ta_SG". */
- case LANG_TATAR: return "tt_RU";
- case LANG_TELUGU: return "te_IN";
- case LANG_THAI: return "th_TH";
- case LANG_TIBETAN: return "bo_CN";
- case LANG_TIGRINYA:
- switch (sub)
- {
- case SUBLANG_TIGRINYA_ETHIOPIA: return "ti_ET";
- case SUBLANG_TIGRINYA_ERITREA: return "ti_ER";
- }
- return "ti";
- case LANG_TSONGA: return "ts_ZA";
- case LANG_TSWANA: return "tn_BW";
- case LANG_TURKISH: return "tr_TR";
- case LANG_TURKMEN: return "tk_TM";
- case LANG_UKRAINIAN: return "uk_UA";
- case LANG_URDU:
- switch (sub)
- {
- case SUBLANG_URDU_PAKISTAN: return "ur_PK";
- case SUBLANG_URDU_INDIA: return "ur_IN";
- }
- return "ur";
- case LANG_UZBEK:
- switch (sub)
- {
- case SUBLANG_UZBEK_LATIN: return "uz_UZ";
- case SUBLANG_UZBEK_CYRILLIC: return "uz_UZ@cyrillic";
- }
- return "uz";
- case LANG_VENDA: return "ve_ZA";
- case LANG_VIETNAMESE: return "vi_VN";
- case LANG_WELSH: return "cy_GB";
- case LANG_XHOSA: return "xh_ZA";
- case LANG_YI: return "sit_CN";
- case LANG_YIDDISH: return "yi_IL";
- case LANG_YORUBA: return "yo_NG";
- case LANG_ZULU: return "zu_ZA";
- default: return "C";
- }
+ return gl_locale_name_from_win32_LCID (lcid);
}
# endif
#endif
}
+/* Determine the current locale's name, and canonicalize it into XPG syntax
+ language[_territory][.codeset][@modifier]
+ The codeset part in the result is not reliable; the locale_charset()
+ should be used for codeset information instead.
+ The result must not be freed; it is statically allocated. */
+
const char *
gl_locale_name (int category, const char *categoryname)
{
const char *retval;
+ retval = gl_locale_name_thread (category, categoryname);
+ if (retval != NULL)
+ return retval;
+
retval = gl_locale_name_posix (category, categoryname);
if (retval != NULL)
return retval;
diff --git a/intl/lock.c b/intl/lock.c
index f60a8d9b..561423e0 100644
--- a/intl/lock.c
+++ b/intl/lock.c
@@ -1,5 +1,5 @@
/* Locking in multithreaded situations.
- Copyright (C) 2005-2006 Free Software Foundation, Inc.
+ Copyright (C) 2005-2008 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
@@ -28,45 +28,6 @@
#if USE_POSIX_THREADS
-/* Use the POSIX threads library. */
-
-# if PTHREAD_IN_USE_DETECTION_HARD
-
-/* The function to be executed by a dummy thread. */
-static void *
-dummy_thread_func (void *arg)
-{
- return arg;
-}
-
-int
-glthread_in_use (void)
-{
- static int tested;
- static int result; /* 1: linked with -lpthread, 0: only with libc */
-
- if (!tested)
- {
- pthread_t thread;
-
- if (pthread_create (&thread, NULL, dummy_thread_func, NULL) != 0)
- /* Thread creation failed. */
- result = 0;
- else
- {
- /* Thread creation works. */
- void *retval;
- if (pthread_join (thread, &retval) != 0)
- abort ();
- result = 1;
- }
- tested = 1;
- }
- return result;
-}
-
-# endif
-
/* -------------------------- gl_lock_t datatype -------------------------- */
/* ------------------------- gl_rwlock_t datatype ------------------------- */
@@ -75,87 +36,123 @@ glthread_in_use (void)
# if !defined PTHREAD_RWLOCK_INITIALIZER
-void
-glthread_rwlock_init (gl_rwlock_t *lock)
+int
+glthread_rwlock_init_multithreaded (gl_rwlock_t *lock)
{
- if (pthread_rwlock_init (&lock->rwlock, NULL) != 0)
- abort ();
+ int err;
+
+ err = pthread_rwlock_init (&lock->rwlock, NULL);
+ if (err != 0)
+ return err;
lock->initialized = 1;
+ return 0;
}
-void
-glthread_rwlock_rdlock (gl_rwlock_t *lock)
+int
+glthread_rwlock_rdlock_multithreaded (gl_rwlock_t *lock)
{
if (!lock->initialized)
{
- if (pthread_mutex_lock (&lock->guard) != 0)
- abort ();
+ int err;
+
+ err = pthread_mutex_lock (&lock->guard);
+ if (err != 0)
+ return err;
if (!lock->initialized)
- glthread_rwlock_init (lock);
- if (pthread_mutex_unlock (&lock->guard) != 0)
- abort ();
+ {
+ err = glthread_rwlock_init_multithreaded (lock);
+ if (err != 0)
+ {
+ pthread_mutex_unlock (&lock->guard);
+ return err;
+ }
+ }
+ err = pthread_mutex_unlock (&lock->guard);
+ if (err != 0)
+ return err;
}
- if (pthread_rwlock_rdlock (&lock->rwlock) != 0)
- abort ();
+ return pthread_rwlock_rdlock (&lock->rwlock);
}
-void
-glthread_rwlock_wrlock (gl_rwlock_t *lock)
+int
+glthread_rwlock_wrlock_multithreaded (gl_rwlock_t *lock)
{
if (!lock->initialized)
{
- if (pthread_mutex_lock (&lock->guard) != 0)
- abort ();
+ int err;
+
+ err = pthread_mutex_lock (&lock->guard);
+ if (err != 0)
+ return err;
if (!lock->initialized)
- glthread_rwlock_init (lock);
- if (pthread_mutex_unlock (&lock->guard) != 0)
- abort ();
+ {
+ err = glthread_rwlock_init_multithreaded (lock);
+ if (err != 0)
+ {
+ pthread_mutex_unlock (&lock->guard);
+ return err;
+ }
+ }
+ err = pthread_mutex_unlock (&lock->guard);
+ if (err != 0)
+ return err;
}
- if (pthread_rwlock_wrlock (&lock->rwlock) != 0)
- abort ();
+ return pthread_rwlock_wrlock (&lock->rwlock);
}
-void
-glthread_rwlock_unlock (gl_rwlock_t *lock)
+int
+glthread_rwlock_unlock_multithreaded (gl_rwlock_t *lock)
{
if (!lock->initialized)
- abort ();
- if (pthread_rwlock_unlock (&lock->rwlock) != 0)
- abort ();
+ return EINVAL;
+ return pthread_rwlock_unlock (&lock->rwlock);
}
-void
-glthread_rwlock_destroy (gl_rwlock_t *lock)
+int
+glthread_rwlock_destroy_multithreaded (gl_rwlock_t *lock)
{
+ int err;
+
if (!lock->initialized)
- abort ();
- if (pthread_rwlock_destroy (&lock->rwlock) != 0)
- abort ();
+ return EINVAL;
+ err = pthread_rwlock_destroy (&lock->rwlock);
+ if (err != 0)
+ return err;
lock->initialized = 0;
+ return 0;
}
# endif
# else
-void
-glthread_rwlock_init (gl_rwlock_t *lock)
-{
- if (pthread_mutex_init (&lock->lock, NULL) != 0)
- abort ();
- if (pthread_cond_init (&lock->waiting_readers, NULL) != 0)
- abort ();
- if (pthread_cond_init (&lock->waiting_writers, NULL) != 0)
- abort ();
+int
+glthread_rwlock_init_multithreaded (gl_rwlock_t *lock)
+{
+ int err;
+
+ err = pthread_mutex_init (&lock->lock, NULL);
+ if (err != 0)
+ return err;
+ err = pthread_cond_init (&lock->waiting_readers, NULL);
+ if (err != 0)
+ return err;
+ err = pthread_cond_init (&lock->waiting_writers, NULL);
+ if (err != 0)
+ return err;
lock->waiting_writers_count = 0;
lock->runcount = 0;
+ return 0;
}
-void
-glthread_rwlock_rdlock (gl_rwlock_t *lock)
+int
+glthread_rwlock_rdlock_multithreaded (gl_rwlock_t *lock)
{
- if (pthread_mutex_lock (&lock->lock) != 0)
- abort ();
+ int err;
+
+ err = pthread_mutex_lock (&lock->lock);
+ if (err != 0)
+ return err;
/* Test whether only readers are currently running, and whether the runcount
field will not overflow. */
/* POSIX says: "It is implementation-defined whether the calling thread
@@ -165,84 +162,116 @@ glthread_rwlock_rdlock (gl_rwlock_t *lock)
while (!(lock->runcount + 1 > 0 && lock->waiting_writers_count == 0))
{
/* This thread has to wait for a while. Enqueue it among the
- waiting_readers. */
- if (pthread_cond_wait (&lock->waiting_readers, &lock->lock) != 0)
- abort ();
+ waiting_readers. */
+ err = pthread_cond_wait (&lock->waiting_readers, &lock->lock);
+ if (err != 0)
+ {
+ pthread_mutex_unlock (&lock->lock);
+ return err;
+ }
}
lock->runcount++;
- if (pthread_mutex_unlock (&lock->lock) != 0)
- abort ();
+ return pthread_mutex_unlock (&lock->lock);
}
-void
-glthread_rwlock_wrlock (gl_rwlock_t *lock)
+int
+glthread_rwlock_wrlock_multithreaded (gl_rwlock_t *lock)
{
- if (pthread_mutex_lock (&lock->lock) != 0)
- abort ();
+ int err;
+
+ err = pthread_mutex_lock (&lock->lock);
+ if (err != 0)
+ return err;
/* Test whether no readers or writers are currently running. */
while (!(lock->runcount == 0))
{
/* This thread has to wait for a while. Enqueue it among the
- waiting_writers. */
+ waiting_writers. */
lock->waiting_writers_count++;
- if (pthread_cond_wait (&lock->waiting_writers, &lock->lock) != 0)
- abort ();
+ err = pthread_cond_wait (&lock->waiting_writers, &lock->lock);
+ if (err != 0)
+ {
+ lock->waiting_writers_count--;
+ pthread_mutex_unlock (&lock->lock);
+ return err;
+ }
lock->waiting_writers_count--;
}
lock->runcount--; /* runcount becomes -1 */
- if (pthread_mutex_unlock (&lock->lock) != 0)
- abort ();
+ return pthread_mutex_unlock (&lock->lock);
}
-void
-glthread_rwlock_unlock (gl_rwlock_t *lock)
+int
+glthread_rwlock_unlock_multithreaded (gl_rwlock_t *lock)
{
- if (pthread_mutex_lock (&lock->lock) != 0)
- abort ();
+ int err;
+
+ err = pthread_mutex_lock (&lock->lock);
+ if (err != 0)
+ return err;
if (lock->runcount < 0)
{
/* Drop a writer lock. */
if (!(lock->runcount == -1))
- abort ();
+ {
+ pthread_mutex_unlock (&lock->lock);
+ return EINVAL;
+ }
lock->runcount = 0;
}
else
{
/* Drop a reader lock. */
if (!(lock->runcount > 0))
- abort ();
+ {
+ pthread_mutex_unlock (&lock->lock);
+ return EINVAL;
+ }
lock->runcount--;
}
if (lock->runcount == 0)
{
/* POSIX recommends that "write locks shall take precedence over read
- locks", to avoid "writer starvation". */
+ locks", to avoid "writer starvation". */
if (lock->waiting_writers_count > 0)
- {
- /* Wake up one of the waiting writers. */
- if (pthread_cond_signal (&lock->waiting_writers) != 0)
- abort ();
- }
+ {
+ /* Wake up one of the waiting writers. */
+ err = pthread_cond_signal (&lock->waiting_writers);
+ if (err != 0)
+ {
+ pthread_mutex_unlock (&lock->lock);
+ return err;
+ }
+ }
else
- {
- /* Wake up all waiting readers. */
- if (pthread_cond_broadcast (&lock->waiting_readers) != 0)
- abort ();
- }
+ {
+ /* Wake up all waiting readers. */
+ err = pthread_cond_broadcast (&lock->waiting_readers);
+ if (err != 0)
+ {
+ pthread_mutex_unlock (&lock->lock);
+ return err;
+ }
+ }
}
- if (pthread_mutex_unlock (&lock->lock) != 0)
- abort ();
+ return pthread_mutex_unlock (&lock->lock);
}
-void
-glthread_rwlock_destroy (gl_rwlock_t *lock)
+int
+glthread_rwlock_destroy_multithreaded (gl_rwlock_t *lock)
{
- if (pthread_mutex_destroy (&lock->lock) != 0)
- abort ();
- if (pthread_cond_destroy (&lock->waiting_readers) != 0)
- abort ();
- if (pthread_cond_destroy (&lock->waiting_writers) != 0)
- abort ();
+ int err;
+
+ err = pthread_mutex_destroy (&lock->lock);
+ if (err != 0)
+ return err;
+ err = pthread_cond_destroy (&lock->waiting_readers);
+ if (err != 0)
+ return err;
+ err = pthread_cond_destroy (&lock->waiting_writers);
+ if (err != 0)
+ return err;
+ return 0;
}
# endif
@@ -251,108 +280,173 @@ glthread_rwlock_destroy (gl_rwlock_t *lock)
# if HAVE_PTHREAD_MUTEX_RECURSIVE
-# if !(defined PTHREAD_RECURSIVE_MUTEX_INITIALIZER || defined PTHREAD_RECURSIVE_MUTEX_INITIALIZER_NP)
+# if defined PTHREAD_RECURSIVE_MUTEX_INITIALIZER || defined PTHREAD_RECURSIVE_MUTEX_INITIALIZER_NP
-void
-glthread_recursive_lock_init (gl_recursive_lock_t *lock)
+int
+glthread_recursive_lock_init_multithreaded (gl_recursive_lock_t *lock)
+{
+ pthread_mutexattr_t attributes;
+ int err;
+
+ err = pthread_mutexattr_init (&attributes);
+ if (err != 0)
+ return err;
+ err = pthread_mutexattr_settype (&attributes, PTHREAD_MUTEX_RECURSIVE);
+ if (err != 0)
+ {
+ pthread_mutexattr_destroy (&attributes);
+ return err;
+ }
+ err = pthread_mutex_init (lock, &attributes);
+ if (err != 0)
+ {
+ pthread_mutexattr_destroy (&attributes);
+ return err;
+ }
+ err = pthread_mutexattr_destroy (&attributes);
+ if (err != 0)
+ return err;
+ return 0;
+}
+
+# else
+
+int
+glthread_recursive_lock_init_multithreaded (gl_recursive_lock_t *lock)
{
pthread_mutexattr_t attributes;
+ int err;
- if (pthread_mutexattr_init (&attributes) != 0)
- abort ();
- if (pthread_mutexattr_settype (&attributes, PTHREAD_MUTEX_RECURSIVE) != 0)
- abort ();
- if (pthread_mutex_init (&lock->recmutex, &attributes) != 0)
- abort ();
- if (pthread_mutexattr_destroy (&attributes) != 0)
- abort ();
+ err = pthread_mutexattr_init (&attributes);
+ if (err != 0)
+ return err;
+ err = pthread_mutexattr_settype (&attributes, PTHREAD_MUTEX_RECURSIVE);
+ if (err != 0)
+ {
+ pthread_mutexattr_destroy (&attributes);
+ return err;
+ }
+ err = pthread_mutex_init (&lock->recmutex, &attributes);
+ if (err != 0)
+ {
+ pthread_mutexattr_destroy (&attributes);
+ return err;
+ }
+ err = pthread_mutexattr_destroy (&attributes);
+ if (err != 0)
+ return err;
lock->initialized = 1;
+ return 0;
}
-void
-glthread_recursive_lock_lock (gl_recursive_lock_t *lock)
+int
+glthread_recursive_lock_lock_multithreaded (gl_recursive_lock_t *lock)
{
if (!lock->initialized)
{
- if (pthread_mutex_lock (&lock->guard) != 0)
- abort ();
+ int err;
+
+ err = pthread_mutex_lock (&lock->guard);
+ if (err != 0)
+ return err;
if (!lock->initialized)
- glthread_recursive_lock_init (lock);
- if (pthread_mutex_unlock (&lock->guard) != 0)
- abort ();
+ {
+ err = glthread_recursive_lock_init_multithreaded (lock);
+ if (err != 0)
+ {
+ pthread_mutex_unlock (&lock->guard);
+ return err;
+ }
+ }
+ err = pthread_mutex_unlock (&lock->guard);
+ if (err != 0)
+ return err;
}
- if (pthread_mutex_lock (&lock->recmutex) != 0)
- abort ();
+ return pthread_mutex_lock (&lock->recmutex);
}
-void
-glthread_recursive_lock_unlock (gl_recursive_lock_t *lock)
+int
+glthread_recursive_lock_unlock_multithreaded (gl_recursive_lock_t *lock)
{
if (!lock->initialized)
- abort ();
- if (pthread_mutex_unlock (&lock->recmutex) != 0)
- abort ();
+ return EINVAL;
+ return pthread_mutex_unlock (&lock->recmutex);
}
-void
-glthread_recursive_lock_destroy (gl_recursive_lock_t *lock)
+int
+glthread_recursive_lock_destroy_multithreaded (gl_recursive_lock_t *lock)
{
+ int err;
+
if (!lock->initialized)
- abort ();
- if (pthread_mutex_destroy (&lock->recmutex) != 0)
- abort ();
+ return EINVAL;
+ err = pthread_mutex_destroy (&lock->recmutex);
+ if (err != 0)
+ return err;
lock->initialized = 0;
+ return 0;
}
# endif
# else
-void
-glthread_recursive_lock_init (gl_recursive_lock_t *lock)
+int
+glthread_recursive_lock_init_multithreaded (gl_recursive_lock_t *lock)
{
- if (pthread_mutex_init (&lock->mutex, NULL) != 0)
- abort ();
+ int err;
+
+ err = pthread_mutex_init (&lock->mutex, NULL);
+ if (err != 0)
+ return err;
lock->owner = (pthread_t) 0;
lock->depth = 0;
+ return 0;
}
-void
-glthread_recursive_lock_lock (gl_recursive_lock_t *lock)
+int
+glthread_recursive_lock_lock_multithreaded (gl_recursive_lock_t *lock)
{
pthread_t self = pthread_self ();
if (lock->owner != self)
{
- if (pthread_mutex_lock (&lock->mutex) != 0)
- abort ();
+ int err;
+
+ err = pthread_mutex_lock (&lock->mutex);
+ if (err != 0)
+ return err;
lock->owner = self;
}
if (++(lock->depth) == 0) /* wraparound? */
- abort ();
+ {
+ lock->depth--;
+ return EAGAIN;
+ }
+ return 0;
}
-void
-glthread_recursive_lock_unlock (gl_recursive_lock_t *lock)
+int
+glthread_recursive_lock_unlock_multithreaded (gl_recursive_lock_t *lock)
{
if (lock->owner != pthread_self ())
- abort ();
+ return EPERM;
if (lock->depth == 0)
- abort ();
+ return EINVAL;
if (--(lock->depth) == 0)
{
lock->owner = (pthread_t) 0;
- if (pthread_mutex_unlock (&lock->mutex) != 0)
- abort ();
+ return pthread_mutex_unlock (&lock->mutex);
}
+ else
+ return 0;
}
-void
-glthread_recursive_lock_destroy (gl_recursive_lock_t *lock)
+int
+glthread_recursive_lock_destroy_multithreaded (gl_recursive_lock_t *lock)
{
if (lock->owner != (pthread_t) 0)
- abort ();
- if (pthread_mutex_destroy (&lock->mutex) != 0)
- abort ();
+ return EBUSY;
+ return pthread_mutex_destroy (&lock->mutex);
}
# endif
@@ -393,7 +487,7 @@ glthread_once_singlethreaded (pthread_once_t *once_control)
/* -------------------------- gl_once_t datatype -------------------------- */
-void
+static void
glthread_once_call (void *arg)
{
void (**gl_once_temp_addr) (void) = (void (**) (void)) arg;
@@ -402,6 +496,13 @@ glthread_once_call (void *arg)
}
int
+glthread_once_multithreaded (pth_once_t *once_control, void (*initfunction) (void))
+{
+ void (*temp) (void) = initfunction;
+ return (!pth_once (once_control, glthread_once_call, &temp) ? errno : 0);
+}
+
+int
glthread_once_singlethreaded (pth_once_t *once_control)
{
/* We know that pth_once_t is an integer type. */
@@ -429,72 +530,87 @@ glthread_once_singlethreaded (pth_once_t *once_control)
/* --------------------- gl_recursive_lock_t datatype --------------------- */
-void
-glthread_recursive_lock_init (gl_recursive_lock_t *lock)
+int
+glthread_recursive_lock_init_multithreaded (gl_recursive_lock_t *lock)
{
- if (mutex_init (&lock->mutex, USYNC_THREAD, NULL) != 0)
- abort ();
+ int err;
+
+ err = mutex_init (&lock->mutex, USYNC_THREAD, NULL);
+ if (err != 0)
+ return err;
lock->owner = (thread_t) 0;
lock->depth = 0;
+ return 0;
}
-void
-glthread_recursive_lock_lock (gl_recursive_lock_t *lock)
+int
+glthread_recursive_lock_lock_multithreaded (gl_recursive_lock_t *lock)
{
thread_t self = thr_self ();
if (lock->owner != self)
{
- if (mutex_lock (&lock->mutex) != 0)
- abort ();
+ int err;
+
+ err = mutex_lock (&lock->mutex);
+ if (err != 0)
+ return err;
lock->owner = self;
}
if (++(lock->depth) == 0) /* wraparound? */
- abort ();
+ {
+ lock->depth--;
+ return EAGAIN;
+ }
+ return 0;
}
-void
-glthread_recursive_lock_unlock (gl_recursive_lock_t *lock)
+int
+glthread_recursive_lock_unlock_multithreaded (gl_recursive_lock_t *lock)
{
if (lock->owner != thr_self ())
- abort ();
+ return EPERM;
if (lock->depth == 0)
- abort ();
+ return EINVAL;
if (--(lock->depth) == 0)
{
lock->owner = (thread_t) 0;
- if (mutex_unlock (&lock->mutex) != 0)
- abort ();
+ return mutex_unlock (&lock->mutex);
}
+ else
+ return 0;
}
-void
-glthread_recursive_lock_destroy (gl_recursive_lock_t *lock)
+int
+glthread_recursive_lock_destroy_multithreaded (gl_recursive_lock_t *lock)
{
if (lock->owner != (thread_t) 0)
- abort ();
- if (mutex_destroy (&lock->mutex) != 0)
- abort ();
+ return EBUSY;
+ return mutex_destroy (&lock->mutex);
}
/* -------------------------- gl_once_t datatype -------------------------- */
-void
-glthread_once (gl_once_t *once_control, void (*initfunction) (void))
+int
+glthread_once_multithreaded (gl_once_t *once_control, void (*initfunction) (void))
{
if (!once_control->inited)
{
+ int err;
+
/* Use the mutex to guarantee that if another thread is already calling
- the initfunction, this thread waits until it's finished. */
- if (mutex_lock (&once_control->mutex) != 0)
- abort ();
+ the initfunction, this thread waits until it's finished. */
+ err = mutex_lock (&once_control->mutex);
+ if (err != 0)
+ return err;
if (!once_control->inited)
- {
- once_control->inited = 1;
- initfunction ();
- }
- if (mutex_unlock (&once_control->mutex) != 0)
- abort ();
+ {
+ once_control->inited = 1;
+ initfunction ();
+ }
+ return mutex_unlock (&once_control->mutex);
}
+ else
+ return 0;
}
int
@@ -520,48 +636,54 @@ glthread_once_singlethreaded (gl_once_t *once_control)
/* -------------------------- gl_lock_t datatype -------------------------- */
void
-glthread_lock_init (gl_lock_t *lock)
+glthread_lock_init_func (gl_lock_t *lock)
{
InitializeCriticalSection (&lock->lock);
lock->guard.done = 1;
}
-void
-glthread_lock_lock (gl_lock_t *lock)
+int
+glthread_lock_lock_func (gl_lock_t *lock)
{
if (!lock->guard.done)
{
if (InterlockedIncrement (&lock->guard.started) == 0)
- /* This thread is the first one to need this lock. Initialize it. */
- glthread_lock_init (lock);
+ /* This thread is the first one to need this lock. Initialize it. */
+ glthread_lock_init (lock);
else
- /* Yield the CPU while waiting for another thread to finish
- initializing this lock. */
- while (!lock->guard.done)
- Sleep (0);
+ /* Yield the CPU while waiting for another thread to finish
+ initializing this lock. */
+ while (!lock->guard.done)
+ Sleep (0);
}
EnterCriticalSection (&lock->lock);
+ return 0;
}
-void
-glthread_lock_unlock (gl_lock_t *lock)
+int
+glthread_lock_unlock_func (gl_lock_t *lock)
{
if (!lock->guard.done)
- abort ();
+ return EINVAL;
LeaveCriticalSection (&lock->lock);
+ return 0;
}
-void
-glthread_lock_destroy (gl_lock_t *lock)
+int
+glthread_lock_destroy_func (gl_lock_t *lock)
{
if (!lock->guard.done)
- abort ();
+ return EINVAL;
DeleteCriticalSection (&lock->lock);
lock->guard.done = 0;
+ return 0;
}
/* ------------------------- gl_rwlock_t datatype ------------------------- */
+/* In this file, the waitqueues are implemented as circular arrays. */
+#define gl_waitqueue_t gl_carray_waitqueue_t
+
static inline void
gl_waitqueue_init (gl_waitqueue_t *wq)
{
@@ -583,31 +705,33 @@ gl_waitqueue_add (gl_waitqueue_t *wq)
{
unsigned int new_alloc = 2 * wq->alloc + 1;
HANDLE *new_array =
- (HANDLE *) realloc (wq->array, new_alloc * sizeof (HANDLE));
+ (HANDLE *) realloc (wq->array, new_alloc * sizeof (HANDLE));
if (new_array == NULL)
- /* No more memory. */
- return INVALID_HANDLE_VALUE;
+ /* No more memory. */
+ return INVALID_HANDLE_VALUE;
/* Now is a good opportunity to rotate the array so that its contents
- starts at offset 0. */
+ starts at offset 0. */
if (wq->offset > 0)
- {
- unsigned int old_count = wq->count;
- unsigned int old_alloc = wq->alloc;
- unsigned int old_offset = wq->offset;
- unsigned int i;
- if (old_offset + old_count > old_alloc)
- {
- unsigned int limit = old_offset + old_count - old_alloc;
- for (i = 0; i < limit; i++)
- new_array[old_alloc + i] = new_array[i];
- }
- for (i = 0; i < old_count; i++)
- new_array[i] = new_array[old_offset + i];
- wq->offset = 0;
- }
+ {
+ unsigned int old_count = wq->count;
+ unsigned int old_alloc = wq->alloc;
+ unsigned int old_offset = wq->offset;
+ unsigned int i;
+ if (old_offset + old_count > old_alloc)
+ {
+ unsigned int limit = old_offset + old_count - old_alloc;
+ for (i = 0; i < limit; i++)
+ new_array[old_alloc + i] = new_array[i];
+ }
+ for (i = 0; i < old_count; i++)
+ new_array[i] = new_array[old_offset + i];
+ wq->offset = 0;
+ }
wq->array = new_array;
wq->alloc = new_alloc;
}
+ /* Whether the created event is a manual-reset one or an auto-reset one,
+ does not matter, since we will wait on it only once. */
event = CreateEvent (NULL, TRUE, FALSE, NULL);
if (event == INVALID_HANDLE_VALUE)
/* No way to allocate an event. */
@@ -641,7 +765,7 @@ gl_waitqueue_notify_all (gl_waitqueue_t *wq)
{
unsigned int index = wq->offset + i;
if (index >= wq->alloc)
- index -= wq->alloc;
+ index -= wq->alloc;
SetEvent (wq->array[index]);
}
wq->count = 0;
@@ -649,7 +773,7 @@ gl_waitqueue_notify_all (gl_waitqueue_t *wq)
}
void
-glthread_rwlock_init (gl_rwlock_t *lock)
+glthread_rwlock_init_func (gl_rwlock_t *lock)
{
InitializeCriticalSection (&lock->lock);
gl_waitqueue_init (&lock->waiting_readers);
@@ -658,19 +782,19 @@ glthread_rwlock_init (gl_rwlock_t *lock)
lock->guard.done = 1;
}
-void
-glthread_rwlock_rdlock (gl_rwlock_t *lock)
+int
+glthread_rwlock_rdlock_func (gl_rwlock_t *lock)
{
if (!lock->guard.done)
{
if (InterlockedIncrement (&lock->guard.started) == 0)
- /* This thread is the first one to need this lock. Initialize it. */
- glthread_rwlock_init (lock);
+ /* This thread is the first one to need this lock. Initialize it. */
+ glthread_rwlock_init (lock);
else
- /* Yield the CPU while waiting for another thread to finish
- initializing this lock. */
- while (!lock->guard.done)
- Sleep (0);
+ /* Yield the CPU while waiting for another thread to finish
+ initializing this lock. */
+ while (!lock->guard.done)
+ Sleep (0);
}
EnterCriticalSection (&lock->lock);
/* Test whether only readers are currently running, and whether the runcount
@@ -678,150 +802,157 @@ glthread_rwlock_rdlock (gl_rwlock_t *lock)
if (!(lock->runcount + 1 > 0))
{
/* This thread has to wait for a while. Enqueue it among the
- waiting_readers. */
+ waiting_readers. */
HANDLE event = gl_waitqueue_add (&lock->waiting_readers);
if (event != INVALID_HANDLE_VALUE)
- {
- DWORD result;
- LeaveCriticalSection (&lock->lock);
- /* Wait until another thread signals this event. */
- result = WaitForSingleObject (event, INFINITE);
- if (result == WAIT_FAILED || result == WAIT_TIMEOUT)
- abort ();
- CloseHandle (event);
- /* The thread which signalled the event already did the bookkeeping:
- removed us from the waiting_readers, incremented lock->runcount. */
- if (!(lock->runcount > 0))
- abort ();
- return;
- }
+ {
+ DWORD result;
+ LeaveCriticalSection (&lock->lock);
+ /* Wait until another thread signals this event. */
+ result = WaitForSingleObject (event, INFINITE);
+ if (result == WAIT_FAILED || result == WAIT_TIMEOUT)
+ abort ();
+ CloseHandle (event);
+ /* The thread which signalled the event already did the bookkeeping:
+ removed us from the waiting_readers, incremented lock->runcount. */
+ if (!(lock->runcount > 0))
+ abort ();
+ return 0;
+ }
else
- {
- /* Allocation failure. Weird. */
- do
- {
- LeaveCriticalSection (&lock->lock);
- Sleep (1);
- EnterCriticalSection (&lock->lock);
- }
- while (!(lock->runcount + 1 > 0));
- }
+ {
+ /* Allocation failure. Weird. */
+ do
+ {
+ LeaveCriticalSection (&lock->lock);
+ Sleep (1);
+ EnterCriticalSection (&lock->lock);
+ }
+ while (!(lock->runcount + 1 > 0));
+ }
}
lock->runcount++;
LeaveCriticalSection (&lock->lock);
+ return 0;
}
-void
-glthread_rwlock_wrlock (gl_rwlock_t *lock)
+int
+glthread_rwlock_wrlock_func (gl_rwlock_t *lock)
{
if (!lock->guard.done)
{
if (InterlockedIncrement (&lock->guard.started) == 0)
- /* This thread is the first one to need this lock. Initialize it. */
- glthread_rwlock_init (lock);
+ /* This thread is the first one to need this lock. Initialize it. */
+ glthread_rwlock_init (lock);
else
- /* Yield the CPU while waiting for another thread to finish
- initializing this lock. */
- while (!lock->guard.done)
- Sleep (0);
+ /* Yield the CPU while waiting for another thread to finish
+ initializing this lock. */
+ while (!lock->guard.done)
+ Sleep (0);
}
EnterCriticalSection (&lock->lock);
/* Test whether no readers or writers are currently running. */
if (!(lock->runcount == 0))
{
/* This thread has to wait for a while. Enqueue it among the
- waiting_writers. */
+ waiting_writers. */
HANDLE event = gl_waitqueue_add (&lock->waiting_writers);
if (event != INVALID_HANDLE_VALUE)
- {
- DWORD result;
- LeaveCriticalSection (&lock->lock);
- /* Wait until another thread signals this event. */
- result = WaitForSingleObject (event, INFINITE);
- if (result == WAIT_FAILED || result == WAIT_TIMEOUT)
- abort ();
- CloseHandle (event);
- /* The thread which signalled the event already did the bookkeeping:
- removed us from the waiting_writers, set lock->runcount = -1. */
- if (!(lock->runcount == -1))
- abort ();
- return;
- }
+ {
+ DWORD result;
+ LeaveCriticalSection (&lock->lock);
+ /* Wait until another thread signals this event. */
+ result = WaitForSingleObject (event, INFINITE);
+ if (result == WAIT_FAILED || result == WAIT_TIMEOUT)
+ abort ();
+ CloseHandle (event);
+ /* The thread which signalled the event already did the bookkeeping:
+ removed us from the waiting_writers, set lock->runcount = -1. */
+ if (!(lock->runcount == -1))
+ abort ();
+ return 0;
+ }
else
- {
- /* Allocation failure. Weird. */
- do
- {
- LeaveCriticalSection (&lock->lock);
- Sleep (1);
- EnterCriticalSection (&lock->lock);
- }
- while (!(lock->runcount == 0));
- }
+ {
+ /* Allocation failure. Weird. */
+ do
+ {
+ LeaveCriticalSection (&lock->lock);
+ Sleep (1);
+ EnterCriticalSection (&lock->lock);
+ }
+ while (!(lock->runcount == 0));
+ }
}
lock->runcount--; /* runcount becomes -1 */
LeaveCriticalSection (&lock->lock);
+ return 0;
}
-void
-glthread_rwlock_unlock (gl_rwlock_t *lock)
+int
+glthread_rwlock_unlock_func (gl_rwlock_t *lock)
{
if (!lock->guard.done)
- abort ();
+ return EINVAL;
EnterCriticalSection (&lock->lock);
if (lock->runcount < 0)
{
/* Drop a writer lock. */
if (!(lock->runcount == -1))
- abort ();
+ abort ();
lock->runcount = 0;
}
else
{
/* Drop a reader lock. */
if (!(lock->runcount > 0))
- abort ();
+ {
+ LeaveCriticalSection (&lock->lock);
+ return EPERM;
+ }
lock->runcount--;
}
if (lock->runcount == 0)
{
/* POSIX recommends that "write locks shall take precedence over read
- locks", to avoid "writer starvation". */
+ locks", to avoid "writer starvation". */
if (lock->waiting_writers.count > 0)
- {
- /* Wake up one of the waiting writers. */
- lock->runcount--;
- gl_waitqueue_notify_first (&lock->waiting_writers);
- }
+ {
+ /* Wake up one of the waiting writers. */
+ lock->runcount--;
+ gl_waitqueue_notify_first (&lock->waiting_writers);
+ }
else
- {
- /* Wake up all waiting readers. */
- lock->runcount += lock->waiting_readers.count;
- gl_waitqueue_notify_all (&lock->waiting_readers);
- }
+ {
+ /* Wake up all waiting readers. */
+ lock->runcount += lock->waiting_readers.count;
+ gl_waitqueue_notify_all (&lock->waiting_readers);
+ }
}
LeaveCriticalSection (&lock->lock);
+ return 0;
}
-void
-glthread_rwlock_destroy (gl_rwlock_t *lock)
+int
+glthread_rwlock_destroy_func (gl_rwlock_t *lock)
{
if (!lock->guard.done)
- abort ();
+ return EINVAL;
if (lock->runcount != 0)
- abort ();
+ return EBUSY;
DeleteCriticalSection (&lock->lock);
if (lock->waiting_readers.array != NULL)
free (lock->waiting_readers.array);
if (lock->waiting_writers.array != NULL)
free (lock->waiting_writers.array);
lock->guard.done = 0;
+ return 0;
}
/* --------------------- gl_recursive_lock_t datatype --------------------- */
void
-glthread_recursive_lock_init (gl_recursive_lock_t *lock)
+glthread_recursive_lock_init_func (gl_recursive_lock_t *lock)
{
lock->owner = 0;
lock->depth = 0;
@@ -829,91 +960,97 @@ glthread_recursive_lock_init (gl_recursive_lock_t *lock)
lock->guard.done = 1;
}
-void
-glthread_recursive_lock_lock (gl_recursive_lock_t *lock)
+int
+glthread_recursive_lock_lock_func (gl_recursive_lock_t *lock)
{
if (!lock->guard.done)
{
if (InterlockedIncrement (&lock->guard.started) == 0)
- /* This thread is the first one to need this lock. Initialize it. */
- glthread_recursive_lock_init (lock);
+ /* This thread is the first one to need this lock. Initialize it. */
+ glthread_recursive_lock_init (lock);
else
- /* Yield the CPU while waiting for another thread to finish
- initializing this lock. */
- while (!lock->guard.done)
- Sleep (0);
+ /* Yield the CPU while waiting for another thread to finish
+ initializing this lock. */
+ while (!lock->guard.done)
+ Sleep (0);
}
{
DWORD self = GetCurrentThreadId ();
if (lock->owner != self)
{
- EnterCriticalSection (&lock->lock);
- lock->owner = self;
+ EnterCriticalSection (&lock->lock);
+ lock->owner = self;
}
if (++(lock->depth) == 0) /* wraparound? */
- abort ();
+ {
+ lock->depth--;
+ return EAGAIN;
+ }
}
+ return 0;
}
-void
-glthread_recursive_lock_unlock (gl_recursive_lock_t *lock)
+int
+glthread_recursive_lock_unlock_func (gl_recursive_lock_t *lock)
{
if (lock->owner != GetCurrentThreadId ())
- abort ();
+ return EPERM;
if (lock->depth == 0)
- abort ();
+ return EINVAL;
if (--(lock->depth) == 0)
{
lock->owner = 0;
LeaveCriticalSection (&lock->lock);
}
+ return 0;
}
-void
-glthread_recursive_lock_destroy (gl_recursive_lock_t *lock)
+int
+glthread_recursive_lock_destroy_func (gl_recursive_lock_t *lock)
{
if (lock->owner != 0)
- abort ();
+ return EBUSY;
DeleteCriticalSection (&lock->lock);
lock->guard.done = 0;
+ return 0;
}
/* -------------------------- gl_once_t datatype -------------------------- */
void
-glthread_once (gl_once_t *once_control, void (*initfunction) (void))
+glthread_once_func (gl_once_t *once_control, void (*initfunction) (void))
{
if (once_control->inited <= 0)
{
if (InterlockedIncrement (&once_control->started) == 0)
- {
- /* This thread is the first one to come to this once_control. */
- InitializeCriticalSection (&once_control->lock);
- EnterCriticalSection (&once_control->lock);
- once_control->inited = 0;
- initfunction ();
- once_control->inited = 1;
- LeaveCriticalSection (&once_control->lock);
- }
+ {
+ /* This thread is the first one to come to this once_control. */
+ InitializeCriticalSection (&once_control->lock);
+ EnterCriticalSection (&once_control->lock);
+ once_control->inited = 0;
+ initfunction ();
+ once_control->inited = 1;
+ LeaveCriticalSection (&once_control->lock);
+ }
else
- {
- /* Undo last operation. */
- InterlockedDecrement (&once_control->started);
- /* Some other thread has already started the initialization.
- Yield the CPU while waiting for the other thread to finish
- initializing and taking the lock. */
- while (once_control->inited < 0)
- Sleep (0);
- if (once_control->inited <= 0)
- {
- /* Take the lock. This blocks until the other thread has
- finished calling the initfunction. */
- EnterCriticalSection (&once_control->lock);
- LeaveCriticalSection (&once_control->lock);
- if (!(once_control->inited > 0))
- abort ();
- }
- }
+ {
+ /* Undo last operation. */
+ InterlockedDecrement (&once_control->started);
+ /* Some other thread has already started the initialization.
+ Yield the CPU while waiting for the other thread to finish
+ initializing and taking the lock. */
+ while (once_control->inited < 0)
+ Sleep (0);
+ if (once_control->inited <= 0)
+ {
+ /* Take the lock. This blocks until the other thread has
+ finished calling the initfunction. */
+ EnterCriticalSection (&once_control->lock);
+ LeaveCriticalSection (&once_control->lock);
+ if (!(once_control->inited > 0))
+ abort ();
+ }
+ }
}
}
diff --git a/intl/lock.h b/intl/lock.h
index 144531dc..b7e955aa 100644
--- a/intl/lock.h
+++ b/intl/lock.h
@@ -1,5 +1,5 @@
/* Locking in multithreaded situations.
- Copyright (C) 2005-2007 Free Software Foundation, Inc.
+ Copyright (C) 2005-2008 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
@@ -32,6 +32,11 @@
Taking the lock: gl_lock_lock (name);
Releasing the lock: gl_lock_unlock (name);
De-initialization: gl_lock_destroy (name);
+ Equivalent functions with control of error handling:
+ Initialization: err = glthread_lock_init (&name);
+ Taking the lock: err = glthread_lock_lock (&name);
+ Releasing the lock: err = glthread_lock_unlock (&name);
+ De-initialization: err = glthread_lock_destroy (&name);
Read-Write (non-recursive) locks:
Type: gl_rwlock_t
@@ -42,6 +47,12 @@
gl_rwlock_wrlock (name);
Releasing the lock: gl_rwlock_unlock (name);
De-initialization: gl_rwlock_destroy (name);
+ Equivalent functions with control of error handling:
+ Initialization: err = glthread_rwlock_init (&name);
+ Taking the lock: err = glthread_rwlock_rdlock (&name);
+ err = glthread_rwlock_wrlock (&name);
+ Releasing the lock: err = glthread_rwlock_unlock (&name);
+ De-initialization: err = glthread_rwlock_destroy (&name);
Recursive locks:
Type: gl_recursive_lock_t
@@ -51,17 +62,27 @@
Taking the lock: gl_recursive_lock_lock (name);
Releasing the lock: gl_recursive_lock_unlock (name);
De-initialization: gl_recursive_lock_destroy (name);
+ Equivalent functions with control of error handling:
+ Initialization: err = glthread_recursive_lock_init (&name);
+ Taking the lock: err = glthread_recursive_lock_lock (&name);
+ Releasing the lock: err = glthread_recursive_lock_unlock (&name);
+ De-initialization: err = glthread_recursive_lock_destroy (&name);
Once-only execution:
Type: gl_once_t
Initializer: gl_once_define(extern, name)
Execution: gl_once (name, initfunction);
+ Equivalent functions with control of error handling:
+ Execution: err = glthread_once (&name, initfunction);
*/
#ifndef _LOCK_H
#define _LOCK_H
+#include <errno.h>
+#include <stdlib.h>
+
/* ========================================================================= */
#if USE_POSIX_THREADS
@@ -69,7 +90,6 @@
/* Use the POSIX threads library. */
# include <pthread.h>
-# include <stdlib.h>
# ifdef __cplusplus
extern "C" {
@@ -147,34 +167,14 @@ typedef pthread_mutex_t gl_lock_t;
STORAGECLASS pthread_mutex_t NAME = gl_lock_initializer;
# define gl_lock_initializer \
PTHREAD_MUTEX_INITIALIZER
-# define gl_lock_init(NAME) \
- do \
- { \
- if (pthread_in_use () && pthread_mutex_init (&NAME, NULL) != 0) \
- abort (); \
- } \
- while (0)
-# define gl_lock_lock(NAME) \
- do \
- { \
- if (pthread_in_use () && pthread_mutex_lock (&NAME) != 0) \
- abort (); \
- } \
- while (0)
-# define gl_lock_unlock(NAME) \
- do \
- { \
- if (pthread_in_use () && pthread_mutex_unlock (&NAME) != 0) \
- abort (); \
- } \
- while (0)
-# define gl_lock_destroy(NAME) \
- do \
- { \
- if (pthread_in_use () && pthread_mutex_destroy (&NAME) != 0) \
- abort (); \
- } \
- while (0)
+# define glthread_lock_init(LOCK) \
+ (pthread_in_use () ? pthread_mutex_init (LOCK, NULL) : 0)
+# define glthread_lock_lock(LOCK) \
+ (pthread_in_use () ? pthread_mutex_lock (LOCK) : 0)
+# define glthread_lock_unlock(LOCK) \
+ (pthread_in_use () ? pthread_mutex_unlock (LOCK) : 0)
+# define glthread_lock_destroy(LOCK) \
+ (pthread_in_use () ? pthread_mutex_destroy (LOCK) : 0)
/* ------------------------- gl_rwlock_t datatype ------------------------- */
@@ -189,41 +189,16 @@ typedef pthread_rwlock_t gl_rwlock_t;
STORAGECLASS pthread_rwlock_t NAME = gl_rwlock_initializer;
# define gl_rwlock_initializer \
PTHREAD_RWLOCK_INITIALIZER
-# define gl_rwlock_init(NAME) \
- do \
- { \
- if (pthread_in_use () && pthread_rwlock_init (&NAME, NULL) != 0) \
- abort (); \
- } \
- while (0)
-# define gl_rwlock_rdlock(NAME) \
- do \
- { \
- if (pthread_in_use () && pthread_rwlock_rdlock (&NAME) != 0) \
- abort (); \
- } \
- while (0)
-# define gl_rwlock_wrlock(NAME) \
- do \
- { \
- if (pthread_in_use () && pthread_rwlock_wrlock (&NAME) != 0) \
- abort (); \
- } \
- while (0)
-# define gl_rwlock_unlock(NAME) \
- do \
- { \
- if (pthread_in_use () && pthread_rwlock_unlock (&NAME) != 0) \
- abort (); \
- } \
- while (0)
-# define gl_rwlock_destroy(NAME) \
- do \
- { \
- if (pthread_in_use () && pthread_rwlock_destroy (&NAME) != 0) \
- abort (); \
- } \
- while (0)
+# define glthread_rwlock_init(LOCK) \
+ (pthread_in_use () ? pthread_rwlock_init (LOCK, NULL) : 0)
+# define glthread_rwlock_rdlock(LOCK) \
+ (pthread_in_use () ? pthread_rwlock_rdlock (LOCK) : 0)
+# define glthread_rwlock_wrlock(LOCK) \
+ (pthread_in_use () ? pthread_rwlock_wrlock (LOCK) : 0)
+# define glthread_rwlock_unlock(LOCK) \
+ (pthread_in_use () ? pthread_rwlock_unlock (LOCK) : 0)
+# define glthread_rwlock_destroy(LOCK) \
+ (pthread_in_use () ? pthread_rwlock_destroy (LOCK) : 0)
# else
@@ -240,46 +215,21 @@ typedef struct
STORAGECLASS gl_rwlock_t NAME = gl_rwlock_initializer;
# define gl_rwlock_initializer \
{ 0, PTHREAD_MUTEX_INITIALIZER }
-# define gl_rwlock_init(NAME) \
- do \
- { \
- if (pthread_in_use ()) \
- glthread_rwlock_init (&NAME); \
- } \
- while (0)
-# define gl_rwlock_rdlock(NAME) \
- do \
- { \
- if (pthread_in_use ()) \
- glthread_rwlock_rdlock (&NAME); \
- } \
- while (0)
-# define gl_rwlock_wrlock(NAME) \
- do \
- { \
- if (pthread_in_use ()) \
- glthread_rwlock_wrlock (&NAME); \
- } \
- while (0)
-# define gl_rwlock_unlock(NAME) \
- do \
- { \
- if (pthread_in_use ()) \
- glthread_rwlock_unlock (&NAME); \
- } \
- while (0)
-# define gl_rwlock_destroy(NAME) \
- do \
- { \
- if (pthread_in_use ()) \
- glthread_rwlock_destroy (&NAME); \
- } \
- while (0)
-extern void glthread_rwlock_init (gl_rwlock_t *lock);
-extern void glthread_rwlock_rdlock (gl_rwlock_t *lock);
-extern void glthread_rwlock_wrlock (gl_rwlock_t *lock);
-extern void glthread_rwlock_unlock (gl_rwlock_t *lock);
-extern void glthread_rwlock_destroy (gl_rwlock_t *lock);
+# define glthread_rwlock_init(LOCK) \
+ (pthread_in_use () ? glthread_rwlock_init_multithreaded (LOCK) : 0)
+# define glthread_rwlock_rdlock(LOCK) \
+ (pthread_in_use () ? glthread_rwlock_rdlock_multithreaded (LOCK) : 0)
+# define glthread_rwlock_wrlock(LOCK) \
+ (pthread_in_use () ? glthread_rwlock_wrlock_multithreaded (LOCK) : 0)
+# define glthread_rwlock_unlock(LOCK) \
+ (pthread_in_use () ? glthread_rwlock_unlock_multithreaded (LOCK) : 0)
+# define glthread_rwlock_destroy(LOCK) \
+ (pthread_in_use () ? glthread_rwlock_destroy_multithreaded (LOCK) : 0)
+extern int glthread_rwlock_init_multithreaded (gl_rwlock_t *lock);
+extern int glthread_rwlock_rdlock_multithreaded (gl_rwlock_t *lock);
+extern int glthread_rwlock_wrlock_multithreaded (gl_rwlock_t *lock);
+extern int glthread_rwlock_unlock_multithreaded (gl_rwlock_t *lock);
+extern int glthread_rwlock_destroy_multithreaded (gl_rwlock_t *lock);
# endif
@@ -300,46 +250,21 @@ typedef struct
STORAGECLASS gl_rwlock_t NAME = gl_rwlock_initializer;
# define gl_rwlock_initializer \
{ PTHREAD_MUTEX_INITIALIZER, PTHREAD_COND_INITIALIZER, PTHREAD_COND_INITIALIZER, 0, 0 }
-# define gl_rwlock_init(NAME) \
- do \
- { \
- if (pthread_in_use ()) \
- glthread_rwlock_init (&NAME); \
- } \
- while (0)
-# define gl_rwlock_rdlock(NAME) \
- do \
- { \
- if (pthread_in_use ()) \
- glthread_rwlock_rdlock (&NAME); \
- } \
- while (0)
-# define gl_rwlock_wrlock(NAME) \
- do \
- { \
- if (pthread_in_use ()) \
- glthread_rwlock_wrlock (&NAME); \
- } \
- while (0)
-# define gl_rwlock_unlock(NAME) \
- do \
- { \
- if (pthread_in_use ()) \
- glthread_rwlock_unlock (&NAME); \
- } \
- while (0)
-# define gl_rwlock_destroy(NAME) \
- do \
- { \
- if (pthread_in_use ()) \
- glthread_rwlock_destroy (&NAME); \
- } \
- while (0)
-extern void glthread_rwlock_init (gl_rwlock_t *lock);
-extern void glthread_rwlock_rdlock (gl_rwlock_t *lock);
-extern void glthread_rwlock_wrlock (gl_rwlock_t *lock);
-extern void glthread_rwlock_unlock (gl_rwlock_t *lock);
-extern void glthread_rwlock_destroy (gl_rwlock_t *lock);
+# define glthread_rwlock_init(LOCK) \
+ (pthread_in_use () ? glthread_rwlock_init_multithreaded (LOCK) : 0)
+# define glthread_rwlock_rdlock(LOCK) \
+ (pthread_in_use () ? glthread_rwlock_rdlock_multithreaded (LOCK) : 0)
+# define glthread_rwlock_wrlock(LOCK) \
+ (pthread_in_use () ? glthread_rwlock_wrlock_multithreaded (LOCK) : 0)
+# define glthread_rwlock_unlock(LOCK) \
+ (pthread_in_use () ? glthread_rwlock_unlock_multithreaded (LOCK) : 0)
+# define glthread_rwlock_destroy(LOCK) \
+ (pthread_in_use () ? glthread_rwlock_destroy_multithreaded (LOCK) : 0)
+extern int glthread_rwlock_init_multithreaded (gl_rwlock_t *lock);
+extern int glthread_rwlock_rdlock_multithreaded (gl_rwlock_t *lock);
+extern int glthread_rwlock_wrlock_multithreaded (gl_rwlock_t *lock);
+extern int glthread_rwlock_unlock_multithreaded (gl_rwlock_t *lock);
+extern int glthread_rwlock_destroy_multithreaded (gl_rwlock_t *lock);
# endif
@@ -361,34 +286,15 @@ typedef pthread_mutex_t gl_recursive_lock_t;
# define gl_recursive_lock_initializer \
PTHREAD_RECURSIVE_MUTEX_INITIALIZER_NP
# endif
-# define gl_recursive_lock_init(NAME) \
- do \
- { \
- if (pthread_in_use () && pthread_mutex_init (&NAME, NULL) != 0) \
- abort (); \
- } \
- while (0)
-# define gl_recursive_lock_lock(NAME) \
- do \
- { \
- if (pthread_in_use () && pthread_mutex_lock (&NAME) != 0) \
- abort (); \
- } \
- while (0)
-# define gl_recursive_lock_unlock(NAME) \
- do \
- { \
- if (pthread_in_use () && pthread_mutex_unlock (&NAME) != 0) \
- abort (); \
- } \
- while (0)
-# define gl_recursive_lock_destroy(NAME) \
- do \
- { \
- if (pthread_in_use () && pthread_mutex_destroy (&NAME) != 0) \
- abort (); \
- } \
- while (0)
+# define glthread_recursive_lock_init(LOCK) \
+ (pthread_in_use () ? glthread_recursive_lock_init_multithreaded (LOCK) : 0)
+# define glthread_recursive_lock_lock(LOCK) \
+ (pthread_in_use () ? pthread_mutex_lock (LOCK) : 0)
+# define glthread_recursive_lock_unlock(LOCK) \
+ (pthread_in_use () ? pthread_mutex_unlock (LOCK) : 0)
+# define glthread_recursive_lock_destroy(LOCK) \
+ (pthread_in_use () ? pthread_mutex_destroy (LOCK) : 0)
+extern int glthread_recursive_lock_init_multithreaded (gl_recursive_lock_t *lock);
# else
@@ -405,38 +311,18 @@ typedef struct
STORAGECLASS gl_recursive_lock_t NAME = gl_recursive_lock_initializer;
# define gl_recursive_lock_initializer \
{ PTHREAD_MUTEX_INITIALIZER, PTHREAD_MUTEX_INITIALIZER, 0 }
-# define gl_recursive_lock_init(NAME) \
- do \
- { \
- if (pthread_in_use ()) \
- glthread_recursive_lock_init (&NAME); \
- } \
- while (0)
-# define gl_recursive_lock_lock(NAME) \
- do \
- { \
- if (pthread_in_use ()) \
- glthread_recursive_lock_lock (&NAME); \
- } \
- while (0)
-# define gl_recursive_lock_unlock(NAME) \
- do \
- { \
- if (pthread_in_use ()) \
- glthread_recursive_lock_unlock (&NAME); \
- } \
- while (0)
-# define gl_recursive_lock_destroy(NAME) \
- do \
- { \
- if (pthread_in_use ()) \
- glthread_recursive_lock_destroy (&NAME); \
- } \
- while (0)
-extern void glthread_recursive_lock_init (gl_recursive_lock_t *lock);
-extern void glthread_recursive_lock_lock (gl_recursive_lock_t *lock);
-extern void glthread_recursive_lock_unlock (gl_recursive_lock_t *lock);
-extern void glthread_recursive_lock_destroy (gl_recursive_lock_t *lock);
+# define glthread_recursive_lock_init(LOCK) \
+ (pthread_in_use () ? glthread_recursive_lock_init_multithreaded (LOCK) : 0)
+# define glthread_recursive_lock_lock(LOCK) \
+ (pthread_in_use () ? glthread_recursive_lock_lock_multithreaded (LOCK) : 0)
+# define glthread_recursive_lock_unlock(LOCK) \
+ (pthread_in_use () ? glthread_recursive_lock_unlock_multithreaded (LOCK) : 0)
+# define glthread_recursive_lock_destroy(LOCK) \
+ (pthread_in_use () ? glthread_recursive_lock_destroy_multithreaded (LOCK) : 0)
+extern int glthread_recursive_lock_init_multithreaded (gl_recursive_lock_t *lock);
+extern int glthread_recursive_lock_lock_multithreaded (gl_recursive_lock_t *lock);
+extern int glthread_recursive_lock_unlock_multithreaded (gl_recursive_lock_t *lock);
+extern int glthread_recursive_lock_destroy_multithreaded (gl_recursive_lock_t *lock);
# endif
@@ -458,38 +344,18 @@ typedef struct
STORAGECLASS gl_recursive_lock_t NAME = gl_recursive_lock_initializer;
# define gl_recursive_lock_initializer \
{ PTHREAD_MUTEX_INITIALIZER, (pthread_t) 0, 0 }
-# define gl_recursive_lock_init(NAME) \
- do \
- { \
- if (pthread_in_use ()) \
- glthread_recursive_lock_init (&NAME); \
- } \
- while (0)
-# define gl_recursive_lock_lock(NAME) \
- do \
- { \
- if (pthread_in_use ()) \
- glthread_recursive_lock_lock (&NAME); \
- } \
- while (0)
-# define gl_recursive_lock_unlock(NAME) \
- do \
- { \
- if (pthread_in_use ()) \
- glthread_recursive_lock_unlock (&NAME); \
- } \
- while (0)
-# define gl_recursive_lock_destroy(NAME) \
- do \
- { \
- if (pthread_in_use ()) \
- glthread_recursive_lock_destroy (&NAME); \
- } \
- while (0)
-extern void glthread_recursive_lock_init (gl_recursive_lock_t *lock);
-extern void glthread_recursive_lock_lock (gl_recursive_lock_t *lock);
-extern void glthread_recursive_lock_unlock (gl_recursive_lock_t *lock);
-extern void glthread_recursive_lock_destroy (gl_recursive_lock_t *lock);
+# define glthread_recursive_lock_init(LOCK) \
+ (pthread_in_use () ? glthread_recursive_lock_init_multithreaded (LOCK) : 0)
+# define glthread_recursive_lock_lock(LOCK) \
+ (pthread_in_use () ? glthread_recursive_lock_lock_multithreaded (LOCK) : 0)
+# define glthread_recursive_lock_unlock(LOCK) \
+ (pthread_in_use () ? glthread_recursive_lock_unlock_multithreaded (LOCK) : 0)
+# define glthread_recursive_lock_destroy(LOCK) \
+ (pthread_in_use () ? glthread_recursive_lock_destroy_multithreaded (LOCK) : 0)
+extern int glthread_recursive_lock_init_multithreaded (gl_recursive_lock_t *lock);
+extern int glthread_recursive_lock_lock_multithreaded (gl_recursive_lock_t *lock);
+extern int glthread_recursive_lock_unlock_multithreaded (gl_recursive_lock_t *lock);
+extern int glthread_recursive_lock_destroy_multithreaded (gl_recursive_lock_t *lock);
# endif
@@ -498,21 +364,10 @@ extern void glthread_recursive_lock_destroy (gl_recursive_lock_t *lock);
typedef pthread_once_t gl_once_t;
# define gl_once_define(STORAGECLASS, NAME) \
STORAGECLASS pthread_once_t NAME = PTHREAD_ONCE_INIT;
-# define gl_once(NAME, INITFUNCTION) \
- do \
- { \
- if (pthread_in_use ()) \
- { \
- if (pthread_once (&NAME, INITFUNCTION) != 0) \
- abort (); \
- } \
- else \
- { \
- if (glthread_once_singlethreaded (&NAME)) \
- INITFUNCTION (); \
- } \
- } \
- while (0)
+# define glthread_once(ONCE_CONTROL, INITFUNCTION) \
+ (pthread_in_use () \
+ ? pthread_once (ONCE_CONTROL, INITFUNCTION) \
+ : (glthread_once_singlethreaded (ONCE_CONTROL) ? (INITFUNCTION (), 0) : 0))
extern int glthread_once_singlethreaded (pthread_once_t *once_control);
# ifdef __cplusplus
@@ -528,7 +383,6 @@ extern int glthread_once_singlethreaded (pthread_once_t *once_control);
/* Use the GNU Pth threads library. */
# include <pth.h>
-# include <stdlib.h>
# ifdef __cplusplus
extern "C" {
@@ -564,29 +418,14 @@ typedef pth_mutex_t gl_lock_t;
STORAGECLASS pth_mutex_t NAME = gl_lock_initializer;
# define gl_lock_initializer \
PTH_MUTEX_INIT
-# define gl_lock_init(NAME) \
- do \
- { \
- if (pth_in_use() && !pth_mutex_init (&NAME)) \
- abort (); \
- } \
- while (0)
-# define gl_lock_lock(NAME) \
- do \
- { \
- if (pth_in_use() && !pth_mutex_acquire (&NAME, 0, NULL)) \
- abort (); \
- } \
- while (0)
-# define gl_lock_unlock(NAME) \
- do \
- { \
- if (pth_in_use() && !pth_mutex_release (&NAME)) \
- abort (); \
- } \
- while (0)
-# define gl_lock_destroy(NAME) \
- (void)(&NAME)
+# define glthread_lock_init(LOCK) \
+ (pth_in_use () && !pth_mutex_init (LOCK) ? errno : 0)
+# define glthread_lock_lock(LOCK) \
+ (pth_in_use () && !pth_mutex_acquire (LOCK, 0, NULL) ? errno : 0)
+# define glthread_lock_unlock(LOCK) \
+ (pth_in_use () && !pth_mutex_release (LOCK) ? errno : 0)
+# define glthread_lock_destroy(LOCK) \
+ ((void)(LOCK), 0)
/* ------------------------- gl_rwlock_t datatype ------------------------- */
@@ -597,38 +436,16 @@ typedef pth_rwlock_t gl_rwlock_t;
STORAGECLASS pth_rwlock_t NAME = gl_rwlock_initializer;
# define gl_rwlock_initializer \
PTH_RWLOCK_INIT
-# define gl_rwlock_init(NAME) \
- do \
- { \
- if (pth_in_use() && !pth_rwlock_init (&NAME)) \
- abort (); \
- } \
- while (0)
-# define gl_rwlock_rdlock(NAME) \
- do \
- { \
- if (pth_in_use() \
- && !pth_rwlock_acquire (&NAME, PTH_RWLOCK_RD, 0, NULL)) \
- abort (); \
- } \
- while (0)
-# define gl_rwlock_wrlock(NAME) \
- do \
- { \
- if (pth_in_use() \
- && !pth_rwlock_acquire (&NAME, PTH_RWLOCK_RW, 0, NULL)) \
- abort (); \
- } \
- while (0)
-# define gl_rwlock_unlock(NAME) \
- do \
- { \
- if (pth_in_use() && !pth_rwlock_release (&NAME)) \
- abort (); \
- } \
- while (0)
-# define gl_rwlock_destroy(NAME) \
- (void)(&NAME)
+# define glthread_rwlock_init(LOCK) \
+ (pth_in_use () && !pth_rwlock_init (LOCK) ? errno : 0)
+# define glthread_rwlock_rdlock(LOCK) \
+ (pth_in_use () && !pth_rwlock_acquire (LOCK, PTH_RWLOCK_RD, 0, NULL) ? errno : 0)
+# define glthread_rwlock_wrlock(LOCK) \
+ (pth_in_use () && !pth_rwlock_acquire (LOCK, PTH_RWLOCK_RW, 0, NULL) ? errno : 0)
+# define glthread_rwlock_unlock(LOCK) \
+ (pth_in_use () && !pth_rwlock_release (LOCK) ? errno : 0)
+# define glthread_rwlock_destroy(LOCK) \
+ ((void)(LOCK), 0)
/* --------------------- gl_recursive_lock_t datatype --------------------- */
@@ -640,52 +457,25 @@ typedef pth_mutex_t gl_recursive_lock_t;
STORAGECLASS pth_mutex_t NAME = gl_recursive_lock_initializer;
# define gl_recursive_lock_initializer \
PTH_MUTEX_INIT
-# define gl_recursive_lock_init(NAME) \
- do \
- { \
- if (pth_in_use() && !pth_mutex_init (&NAME)) \
- abort (); \
- } \
- while (0)
-# define gl_recursive_lock_lock(NAME) \
- do \
- { \
- if (pth_in_use() && !pth_mutex_acquire (&NAME, 0, NULL)) \
- abort (); \
- } \
- while (0)
-# define gl_recursive_lock_unlock(NAME) \
- do \
- { \
- if (pth_in_use() && !pth_mutex_release (&NAME)) \
- abort (); \
- } \
- while (0)
-# define gl_recursive_lock_destroy(NAME) \
- (void)(&NAME)
+# define glthread_recursive_lock_init(LOCK) \
+ (pth_in_use () && !pth_mutex_init (LOCK) ? errno : 0)
+# define glthread_recursive_lock_lock(LOCK) \
+ (pth_in_use () && !pth_mutex_acquire (LOCK, 0, NULL) ? errno : 0)
+# define glthread_recursive_lock_unlock(LOCK) \
+ (pth_in_use () && !pth_mutex_release (LOCK) ? errno : 0)
+# define glthread_recursive_lock_destroy(LOCK) \
+ ((void)(LOCK), 0)
/* -------------------------- gl_once_t datatype -------------------------- */
typedef pth_once_t gl_once_t;
# define gl_once_define(STORAGECLASS, NAME) \
STORAGECLASS pth_once_t NAME = PTH_ONCE_INIT;
-# define gl_once(NAME, INITFUNCTION) \
- do \
- { \
- if (pth_in_use ()) \
- { \
- void (*gl_once_temp) (void) = INITFUNCTION; \
- if (!pth_once (&NAME, glthread_once_call, &gl_once_temp)) \
- abort (); \
- } \
- else \
- { \
- if (glthread_once_singlethreaded (&NAME)) \
- INITFUNCTION (); \
- } \
- } \
- while (0)
-extern void glthread_once_call (void *arg);
+# define glthread_once(ONCE_CONTROL, INITFUNCTION) \
+ (pth_in_use () \
+ ? glthread_once_multithreaded (ONCE_CONTROL, INITFUNCTION) \
+ : (glthread_once_singlethreaded (ONCE_CONTROL) ? (INITFUNCTION (), 0) : 0))
+extern int glthread_once_multithreaded (pth_once_t *once_control, void (*initfunction) (void));
extern int glthread_once_singlethreaded (pth_once_t *once_control);
# ifdef __cplusplus
@@ -702,7 +492,6 @@ extern int glthread_once_singlethreaded (pth_once_t *once_control);
# include <thread.h>
# include <synch.h>
-# include <stdlib.h>
# ifdef __cplusplus
extern "C" {
@@ -741,34 +530,14 @@ typedef mutex_t gl_lock_t;
STORAGECLASS mutex_t NAME = gl_lock_initializer;
# define gl_lock_initializer \
DEFAULTMUTEX
-# define gl_lock_init(NAME) \
- do \
- { \
- if (thread_in_use () && mutex_init (&NAME, USYNC_THREAD, NULL) != 0) \
- abort (); \
- } \
- while (0)
-# define gl_lock_lock(NAME) \
- do \
- { \
- if (thread_in_use () && mutex_lock (&NAME) != 0) \
- abort (); \
- } \
- while (0)
-# define gl_lock_unlock(NAME) \
- do \
- { \
- if (thread_in_use () && mutex_unlock (&NAME) != 0) \
- abort (); \
- } \
- while (0)
-# define gl_lock_destroy(NAME) \
- do \
- { \
- if (thread_in_use () && mutex_destroy (&NAME) != 0) \
- abort (); \
- } \
- while (0)
+# define glthread_lock_init(LOCK) \
+ (thread_in_use () ? mutex_init (LOCK, USYNC_THREAD, NULL) : 0)
+# define glthread_lock_lock(LOCK) \
+ (thread_in_use () ? mutex_lock (LOCK) : 0)
+# define glthread_lock_unlock(LOCK) \
+ (thread_in_use () ? mutex_unlock (LOCK) : 0)
+# define glthread_lock_destroy(LOCK) \
+ (thread_in_use () ? mutex_destroy (LOCK) : 0)
/* ------------------------- gl_rwlock_t datatype ------------------------- */
@@ -779,41 +548,16 @@ typedef rwlock_t gl_rwlock_t;
STORAGECLASS rwlock_t NAME = gl_rwlock_initializer;
# define gl_rwlock_initializer \
DEFAULTRWLOCK
-# define gl_rwlock_init(NAME) \
- do \
- { \
- if (thread_in_use () && rwlock_init (&NAME, USYNC_THREAD, NULL) != 0) \
- abort (); \
- } \
- while (0)
-# define gl_rwlock_rdlock(NAME) \
- do \
- { \
- if (thread_in_use () && rw_rdlock (&NAME) != 0) \
- abort (); \
- } \
- while (0)
-# define gl_rwlock_wrlock(NAME) \
- do \
- { \
- if (thread_in_use () && rw_wrlock (&NAME) != 0) \
- abort (); \
- } \
- while (0)
-# define gl_rwlock_unlock(NAME) \
- do \
- { \
- if (thread_in_use () && rw_unlock (&NAME) != 0) \
- abort (); \
- } \
- while (0)
-# define gl_rwlock_destroy(NAME) \
- do \
- { \
- if (thread_in_use () && rwlock_destroy (&NAME) != 0) \
- abort (); \
- } \
- while (0)
+# define glthread_rwlock_init(LOCK) \
+ (thread_in_use () ? rwlock_init (LOCK, USYNC_THREAD, NULL) : 0)
+# define glthread_rwlock_rdlock(LOCK) \
+ (thread_in_use () ? rw_rdlock (LOCK) : 0)
+# define glthread_rwlock_wrlock(LOCK) \
+ (thread_in_use () ? rw_wrlock (LOCK) : 0)
+# define glthread_rwlock_unlock(LOCK) \
+ (thread_in_use () ? rw_unlock (LOCK) : 0)
+# define glthread_rwlock_destroy(LOCK) \
+ (thread_in_use () ? rwlock_destroy (LOCK) : 0)
/* --------------------- gl_recursive_lock_t datatype --------------------- */
@@ -833,38 +577,18 @@ typedef struct
STORAGECLASS gl_recursive_lock_t NAME = gl_recursive_lock_initializer;
# define gl_recursive_lock_initializer \
{ DEFAULTMUTEX, (thread_t) 0, 0 }
-# define gl_recursive_lock_init(NAME) \
- do \
- { \
- if (thread_in_use ()) \
- glthread_recursive_lock_init (&NAME); \
- } \
- while (0)
-# define gl_recursive_lock_lock(NAME) \
- do \
- { \
- if (thread_in_use ()) \
- glthread_recursive_lock_lock (&NAME); \
- } \
- while (0)
-# define gl_recursive_lock_unlock(NAME) \
- do \
- { \
- if (thread_in_use ()) \
- glthread_recursive_lock_unlock (&NAME); \
- } \
- while (0)
-# define gl_recursive_lock_destroy(NAME) \
- do \
- { \
- if (thread_in_use ()) \
- glthread_recursive_lock_destroy (&NAME); \
- } \
- while (0)
-extern void glthread_recursive_lock_init (gl_recursive_lock_t *lock);
-extern void glthread_recursive_lock_lock (gl_recursive_lock_t *lock);
-extern void glthread_recursive_lock_unlock (gl_recursive_lock_t *lock);
-extern void glthread_recursive_lock_destroy (gl_recursive_lock_t *lock);
+# define glthread_recursive_lock_init(LOCK) \
+ (thread_in_use () ? glthread_recursive_lock_init_multithreaded (LOCK) : 0)
+# define glthread_recursive_lock_lock(LOCK) \
+ (thread_in_use () ? glthread_recursive_lock_lock_multithreaded (LOCK) : 0)
+# define glthread_recursive_lock_unlock(LOCK) \
+ (thread_in_use () ? glthread_recursive_lock_unlock_multithreaded (LOCK) : 0)
+# define glthread_recursive_lock_destroy(LOCK) \
+ (thread_in_use () ? glthread_recursive_lock_destroy_multithreaded (LOCK) : 0)
+extern int glthread_recursive_lock_init_multithreaded (gl_recursive_lock_t *lock);
+extern int glthread_recursive_lock_lock_multithreaded (gl_recursive_lock_t *lock);
+extern int glthread_recursive_lock_unlock_multithreaded (gl_recursive_lock_t *lock);
+extern int glthread_recursive_lock_destroy_multithreaded (gl_recursive_lock_t *lock);
/* -------------------------- gl_once_t datatype -------------------------- */
@@ -876,21 +600,11 @@ typedef struct
gl_once_t;
# define gl_once_define(STORAGECLASS, NAME) \
STORAGECLASS gl_once_t NAME = { 0, DEFAULTMUTEX };
-# define gl_once(NAME, INITFUNCTION) \
- do \
- { \
- if (thread_in_use ()) \
- { \
- glthread_once (&NAME, INITFUNCTION); \
- } \
- else \
- { \
- if (glthread_once_singlethreaded (&NAME)) \
- INITFUNCTION (); \
- } \
- } \
- while (0)
-extern void glthread_once (gl_once_t *once_control, void (*initfunction) (void));
+# define glthread_once(ONCE_CONTROL, INITFUNCTION) \
+ (thread_in_use () \
+ ? glthread_once_multithreaded (ONCE_CONTROL, INITFUNCTION) \
+ : (glthread_once_singlethreaded (ONCE_CONTROL) ? (INITFUNCTION (), 0) : 0))
+extern int glthread_once_multithreaded (gl_once_t *once_control, void (*initfunction) (void));
extern int glthread_once_singlethreaded (gl_once_t *once_control);
# ifdef __cplusplus
@@ -936,18 +650,18 @@ typedef struct
STORAGECLASS gl_lock_t NAME = gl_lock_initializer;
# define gl_lock_initializer \
{ { 0, -1 } }
-# define gl_lock_init(NAME) \
- glthread_lock_init (&NAME)
-# define gl_lock_lock(NAME) \
- glthread_lock_lock (&NAME)
-# define gl_lock_unlock(NAME) \
- glthread_lock_unlock (&NAME)
-# define gl_lock_destroy(NAME) \
- glthread_lock_destroy (&NAME)
-extern void glthread_lock_init (gl_lock_t *lock);
-extern void glthread_lock_lock (gl_lock_t *lock);
-extern void glthread_lock_unlock (gl_lock_t *lock);
-extern void glthread_lock_destroy (gl_lock_t *lock);
+# define glthread_lock_init(LOCK) \
+ (glthread_lock_init_func (LOCK), 0)
+# define glthread_lock_lock(LOCK) \
+ glthread_lock_lock_func (LOCK)
+# define glthread_lock_unlock(LOCK) \
+ glthread_lock_unlock_func (LOCK)
+# define glthread_lock_destroy(LOCK) \
+ glthread_lock_destroy_func (LOCK)
+extern void glthread_lock_init_func (gl_lock_t *lock);
+extern int glthread_lock_lock_func (gl_lock_t *lock);
+extern int glthread_lock_unlock_func (gl_lock_t *lock);
+extern int glthread_lock_destroy_func (gl_lock_t *lock);
/* ------------------------- gl_rwlock_t datatype ------------------------- */
@@ -962,13 +676,13 @@ typedef struct
unsigned int alloc; /* length of allocated array */
unsigned int offset; /* index of first waiting thread in array */
}
- gl_waitqueue_t;
+ gl_carray_waitqueue_t;
typedef struct
{
gl_spinlock_t guard; /* protects the initialization */
CRITICAL_SECTION lock; /* protects the remaining fields */
- gl_waitqueue_t waiting_readers; /* waiting readers */
- gl_waitqueue_t waiting_writers; /* waiting writers */
+ gl_carray_waitqueue_t waiting_readers; /* waiting readers */
+ gl_carray_waitqueue_t waiting_writers; /* waiting writers */
int runcount; /* number of readers running, or -1 when a writer runs */
}
gl_rwlock_t;
@@ -978,21 +692,21 @@ typedef struct
STORAGECLASS gl_rwlock_t NAME = gl_rwlock_initializer;
# define gl_rwlock_initializer \
{ { 0, -1 } }
-# define gl_rwlock_init(NAME) \
- glthread_rwlock_init (&NAME)
-# define gl_rwlock_rdlock(NAME) \
- glthread_rwlock_rdlock (&NAME)
-# define gl_rwlock_wrlock(NAME) \
- glthread_rwlock_wrlock (&NAME)
-# define gl_rwlock_unlock(NAME) \
- glthread_rwlock_unlock (&NAME)
-# define gl_rwlock_destroy(NAME) \
- glthread_rwlock_destroy (&NAME)
-extern void glthread_rwlock_init (gl_rwlock_t *lock);
-extern void glthread_rwlock_rdlock (gl_rwlock_t *lock);
-extern void glthread_rwlock_wrlock (gl_rwlock_t *lock);
-extern void glthread_rwlock_unlock (gl_rwlock_t *lock);
-extern void glthread_rwlock_destroy (gl_rwlock_t *lock);
+# define glthread_rwlock_init(LOCK) \
+ (glthread_rwlock_init_func (LOCK), 0)
+# define glthread_rwlock_rdlock(LOCK) \
+ glthread_rwlock_rdlock_func (LOCK)
+# define glthread_rwlock_wrlock(LOCK) \
+ glthread_rwlock_wrlock_func (LOCK)
+# define glthread_rwlock_unlock(LOCK) \
+ glthread_rwlock_unlock_func (LOCK)
+# define glthread_rwlock_destroy(LOCK) \
+ glthread_rwlock_destroy_func (LOCK)
+extern void glthread_rwlock_init_func (gl_rwlock_t *lock);
+extern int glthread_rwlock_rdlock_func (gl_rwlock_t *lock);
+extern int glthread_rwlock_wrlock_func (gl_rwlock_t *lock);
+extern int glthread_rwlock_unlock_func (gl_rwlock_t *lock);
+extern int glthread_rwlock_destroy_func (gl_rwlock_t *lock);
/* --------------------- gl_recursive_lock_t datatype --------------------- */
@@ -1014,18 +728,18 @@ typedef struct
STORAGECLASS gl_recursive_lock_t NAME = gl_recursive_lock_initializer;
# define gl_recursive_lock_initializer \
{ { 0, -1 }, 0, 0 }
-# define gl_recursive_lock_init(NAME) \
- glthread_recursive_lock_init (&NAME)
-# define gl_recursive_lock_lock(NAME) \
- glthread_recursive_lock_lock (&NAME)
-# define gl_recursive_lock_unlock(NAME) \
- glthread_recursive_lock_unlock (&NAME)
-# define gl_recursive_lock_destroy(NAME) \
- glthread_recursive_lock_destroy (&NAME)
-extern void glthread_recursive_lock_init (gl_recursive_lock_t *lock);
-extern void glthread_recursive_lock_lock (gl_recursive_lock_t *lock);
-extern void glthread_recursive_lock_unlock (gl_recursive_lock_t *lock);
-extern void glthread_recursive_lock_destroy (gl_recursive_lock_t *lock);
+# define glthread_recursive_lock_init(LOCK) \
+ (glthread_recursive_lock_init_func (LOCK), 0)
+# define glthread_recursive_lock_lock(LOCK) \
+ glthread_recursive_lock_lock_func (LOCK)
+# define glthread_recursive_lock_unlock(LOCK) \
+ glthread_recursive_lock_unlock_func (LOCK)
+# define glthread_recursive_lock_destroy(LOCK) \
+ glthread_recursive_lock_destroy_func (LOCK)
+extern void glthread_recursive_lock_init_func (gl_recursive_lock_t *lock);
+extern int glthread_recursive_lock_lock_func (gl_recursive_lock_t *lock);
+extern int glthread_recursive_lock_unlock_func (gl_recursive_lock_t *lock);
+extern int glthread_recursive_lock_destroy_func (gl_recursive_lock_t *lock);
/* -------------------------- gl_once_t datatype -------------------------- */
@@ -1038,9 +752,9 @@ typedef struct
gl_once_t;
# define gl_once_define(STORAGECLASS, NAME) \
STORAGECLASS gl_once_t NAME = { -1, -1 };
-# define gl_once(NAME, INITFUNCTION) \
- glthread_once (&NAME, INITFUNCTION)
-extern void glthread_once (gl_once_t *once_control, void (*initfunction) (void));
+# define glthread_once(ONCE_CONTROL, INITFUNCTION) \
+ (glthread_once_func (ONCE_CONTROL, INITFUNCTION), 0)
+extern void glthread_once_func (gl_once_t *once_control, void (*initfunction) (void));
# ifdef __cplusplus
}
@@ -1059,47 +773,156 @@ extern void glthread_once (gl_once_t *once_control, void (*initfunction) (void))
typedef int gl_lock_t;
# define gl_lock_define(STORAGECLASS, NAME)
# define gl_lock_define_initialized(STORAGECLASS, NAME)
-# define gl_lock_init(NAME)
-# define gl_lock_lock(NAME)
-# define gl_lock_unlock(NAME)
+# define glthread_lock_init(NAME) 0
+# define glthread_lock_lock(NAME) 0
+# define glthread_lock_unlock(NAME) 0
+# define glthread_lock_destroy(NAME) 0
/* ------------------------- gl_rwlock_t datatype ------------------------- */
typedef int gl_rwlock_t;
# define gl_rwlock_define(STORAGECLASS, NAME)
# define gl_rwlock_define_initialized(STORAGECLASS, NAME)
-# define gl_rwlock_init(NAME)
-# define gl_rwlock_rdlock(NAME)
-# define gl_rwlock_wrlock(NAME)
-# define gl_rwlock_unlock(NAME)
+# define glthread_rwlock_init(NAME) 0
+# define glthread_rwlock_rdlock(NAME) 0
+# define glthread_rwlock_wrlock(NAME) 0
+# define glthread_rwlock_unlock(NAME) 0
+# define glthread_rwlock_destroy(NAME) 0
/* --------------------- gl_recursive_lock_t datatype --------------------- */
typedef int gl_recursive_lock_t;
# define gl_recursive_lock_define(STORAGECLASS, NAME)
# define gl_recursive_lock_define_initialized(STORAGECLASS, NAME)
-# define gl_recursive_lock_init(NAME)
-# define gl_recursive_lock_lock(NAME)
-# define gl_recursive_lock_unlock(NAME)
+# define glthread_recursive_lock_init(NAME) 0
+# define glthread_recursive_lock_lock(NAME) 0
+# define glthread_recursive_lock_unlock(NAME) 0
+# define glthread_recursive_lock_destroy(NAME) 0
/* -------------------------- gl_once_t datatype -------------------------- */
typedef int gl_once_t;
# define gl_once_define(STORAGECLASS, NAME) \
STORAGECLASS gl_once_t NAME = 0;
-# define gl_once(NAME, INITFUNCTION) \
- do \
- { \
- if (NAME == 0) \
- { \
- NAME = ~ 0; \
- INITFUNCTION (); \
- } \
- } \
- while (0)
+# define glthread_once(ONCE_CONTROL, INITFUNCTION) \
+ (*(ONCE_CONTROL) == 0 ? (*(ONCE_CONTROL) = ~ 0, INITFUNCTION (), 0) : 0)
#endif
/* ========================================================================= */
+/* Macros with built-in error handling. */
+
+/* -------------------------- gl_lock_t datatype -------------------------- */
+
+#define gl_lock_init(NAME) \
+ do \
+ { \
+ if (glthread_lock_init (&NAME)) \
+ abort (); \
+ } \
+ while (0)
+#define gl_lock_lock(NAME) \
+ do \
+ { \
+ if (glthread_lock_lock (&NAME)) \
+ abort (); \
+ } \
+ while (0)
+#define gl_lock_unlock(NAME) \
+ do \
+ { \
+ if (glthread_lock_unlock (&NAME)) \
+ abort (); \
+ } \
+ while (0)
+#define gl_lock_destroy(NAME) \
+ do \
+ { \
+ if (glthread_lock_destroy (&NAME)) \
+ abort (); \
+ } \
+ while (0)
+
+/* ------------------------- gl_rwlock_t datatype ------------------------- */
+
+#define gl_rwlock_init(NAME) \
+ do \
+ { \
+ if (glthread_rwlock_init (&NAME)) \
+ abort (); \
+ } \
+ while (0)
+#define gl_rwlock_rdlock(NAME) \
+ do \
+ { \
+ if (glthread_rwlock_rdlock (&NAME)) \
+ abort (); \
+ } \
+ while (0)
+#define gl_rwlock_wrlock(NAME) \
+ do \
+ { \
+ if (glthread_rwlock_wrlock (&NAME)) \
+ abort (); \
+ } \
+ while (0)
+#define gl_rwlock_unlock(NAME) \
+ do \
+ { \
+ if (glthread_rwlock_unlock (&NAME)) \
+ abort (); \
+ } \
+ while (0)
+#define gl_rwlock_destroy(NAME) \
+ do \
+ { \
+ if (glthread_rwlock_destroy (&NAME)) \
+ abort (); \
+ } \
+ while (0)
+
+/* --------------------- gl_recursive_lock_t datatype --------------------- */
+
+#define gl_recursive_lock_init(NAME) \
+ do \
+ { \
+ if (glthread_recursive_lock_init (&NAME)) \
+ abort (); \
+ } \
+ while (0)
+#define gl_recursive_lock_lock(NAME) \
+ do \
+ { \
+ if (glthread_recursive_lock_lock (&NAME)) \
+ abort (); \
+ } \
+ while (0)
+#define gl_recursive_lock_unlock(NAME) \
+ do \
+ { \
+ if (glthread_recursive_lock_unlock (&NAME)) \
+ abort (); \
+ } \
+ while (0)
+#define gl_recursive_lock_destroy(NAME) \
+ do \
+ { \
+ if (glthread_recursive_lock_destroy (&NAME)) \
+ abort (); \
+ } \
+ while (0)
+
+/* -------------------------- gl_once_t datatype -------------------------- */
+
+#define gl_once(NAME, INITFUNCTION) \
+ do \
+ { \
+ if (glthread_once (&NAME, INITFUNCTION)) \
+ abort (); \
+ } \
+ while (0)
+
+/* ========================================================================= */
+
#endif /* _LOCK_H */
diff --git a/intl/log.c b/intl/log.c
index e3ab5d0e..a3e4b272 100644
--- a/intl/log.c
+++ b/intl/log.c
@@ -1,5 +1,5 @@
/* Log file output.
- Copyright (C) 2003, 2005 Free Software Foundation, Inc.
+ Copyright (C) 2003, 2005, 2009 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
@@ -33,24 +33,27 @@
# include "lock.h"
#endif
+/* Separator between msgctxt and msgid in .mo files. */
+#define MSGCTXT_SEPARATOR '\004' /* EOT */
+
/* Print an ASCII string with quotes and escape sequences where needed. */
static void
-print_escaped (FILE *stream, const char *str)
+print_escaped (FILE *stream, const char *str, const char *str_end)
{
putc ('"', stream);
- for (; *str != '\0'; str++)
+ for (; str != str_end; str++)
if (*str == '\n')
{
- fputs ("\\n\"", stream);
- if (str[1] == '\0')
- return;
- fputs ("\n\"", stream);
+ fputs ("\\n\"", stream);
+ if (str + 1 == str_end)
+ return;
+ fputs ("\n\"", stream);
}
else
{
- if (*str == '"' || *str == '\\')
- putc ('\\', stream);
- putc (*str, stream);
+ if (*str == '"' || *str == '\\')
+ putc ('\\', stream);
+ putc (*str, stream);
}
putc ('"', stream);
}
@@ -61,43 +64,52 @@ __libc_lock_define_initialized (static, lock)
static inline void
_nl_log_untranslated_locked (const char *logfilename, const char *domainname,
- const char *msgid1, const char *msgid2, int plural)
+ const char *msgid1, const char *msgid2, int plural)
{
FILE *logfile;
+ const char *separator;
/* Can we reuse the last opened logfile? */
if (last_logfilename == NULL || strcmp (logfilename, last_logfilename) != 0)
{
/* Close the last used logfile. */
if (last_logfilename != NULL)
- {
- if (last_logfile != NULL)
- {
- fclose (last_logfile);
- last_logfile = NULL;
- }
- free (last_logfilename);
- last_logfilename = NULL;
- }
+ {
+ if (last_logfile != NULL)
+ {
+ fclose (last_logfile);
+ last_logfile = NULL;
+ }
+ free (last_logfilename);
+ last_logfilename = NULL;
+ }
/* Open the logfile. */
last_logfilename = (char *) malloc (strlen (logfilename) + 1);
if (last_logfilename == NULL)
- return;
+ return;
strcpy (last_logfilename, logfilename);
last_logfile = fopen (logfilename, "a");
if (last_logfile == NULL)
- return;
+ return;
}
logfile = last_logfile;
fprintf (logfile, "domain ");
- print_escaped (logfile, domainname);
+ print_escaped (logfile, domainname, domainname + strlen (domainname));
+ separator = strchr (msgid1, MSGCTXT_SEPARATOR);
+ if (separator != NULL)
+ {
+ /* The part before the MSGCTXT_SEPARATOR is the msgctxt. */
+ fprintf (logfile, "\nmsgctxt ");
+ print_escaped (logfile, msgid1, separator);
+ msgid1 = separator + 1;
+ }
fprintf (logfile, "\nmsgid ");
- print_escaped (logfile, msgid1);
+ print_escaped (logfile, msgid1, msgid1 + strlen (msgid1));
if (plural)
{
fprintf (logfile, "\nmsgid_plural ");
- print_escaped (logfile, msgid2);
+ print_escaped (logfile, msgid2, msgid2 + strlen (msgid2));
fprintf (logfile, "\nmsgstr[0] \"\"\n");
}
else
@@ -108,7 +120,7 @@ _nl_log_untranslated_locked (const char *logfilename, const char *domainname,
/* Add to the log file an entry denoting a failed translation. */
void
_nl_log_untranslated (const char *logfilename, const char *domainname,
- const char *msgid1, const char *msgid2, int plural)
+ const char *msgid1, const char *msgid2, int plural)
{
__libc_lock_lock (lock);
_nl_log_untranslated_locked (logfilename, domainname, msgid1, msgid2, plural);
diff --git a/intl/os2compat.h b/intl/os2compat.h
index a18d582c..702031c1 100644
--- a/intl/os2compat.h
+++ b/intl/os2compat.h
@@ -21,15 +21,15 @@
#ifndef OS2_AWARE
#undef LIBDIR
-#define LIBDIR _nlos2_libdir
+#define LIBDIR _nlos2_libdir
extern char *_nlos2_libdir;
#undef LOCALEDIR
-#define LOCALEDIR _nlos2_localedir
+#define LOCALEDIR _nlos2_localedir
extern char *_nlos2_localedir;
#undef LOCALE_ALIAS_PATH
-#define LOCALE_ALIAS_PATH _nlos2_localealiaspath
+#define LOCALE_ALIAS_PATH _nlos2_localealiaspath
extern char *_nlos2_localealiaspath;
#endif
diff --git a/intl/printf-args.c b/intl/printf-args.c
index cbd437d8..44e50a33 100644
--- a/intl/printf-args.c
+++ b/intl/printf-args.c
@@ -43,146 +43,146 @@ PRINTF_FETCHARGS (va_list args, arguments *a)
switch (ap->type)
{
case TYPE_SCHAR:
- ap->a.a_schar = va_arg (args, /*signed char*/ int);
- break;
+ ap->a.a_schar = va_arg (args, /*signed char*/ int);
+ break;
case TYPE_UCHAR:
- ap->a.a_uchar = va_arg (args, /*unsigned char*/ int);
- break;
+ ap->a.a_uchar = va_arg (args, /*unsigned char*/ int);
+ break;
case TYPE_SHORT:
- ap->a.a_short = va_arg (args, /*short*/ int);
- break;
+ ap->a.a_short = va_arg (args, /*short*/ int);
+ break;
case TYPE_USHORT:
- ap->a.a_ushort = va_arg (args, /*unsigned short*/ int);
- break;
+ ap->a.a_ushort = va_arg (args, /*unsigned short*/ int);
+ break;
case TYPE_INT:
- ap->a.a_int = va_arg (args, int);
- break;
+ ap->a.a_int = va_arg (args, int);
+ break;
case TYPE_UINT:
- ap->a.a_uint = va_arg (args, unsigned int);
- break;
+ ap->a.a_uint = va_arg (args, unsigned int);
+ break;
case TYPE_LONGINT:
- ap->a.a_longint = va_arg (args, long int);
- break;
+ ap->a.a_longint = va_arg (args, long int);
+ break;
case TYPE_ULONGINT:
- ap->a.a_ulongint = va_arg (args, unsigned long int);
- break;
+ ap->a.a_ulongint = va_arg (args, unsigned long int);
+ break;
#if HAVE_LONG_LONG_INT
case TYPE_LONGLONGINT:
- ap->a.a_longlongint = va_arg (args, long long int);
- break;
+ ap->a.a_longlongint = va_arg (args, long long int);
+ break;
case TYPE_ULONGLONGINT:
- ap->a.a_ulonglongint = va_arg (args, unsigned long long int);
- break;
+ ap->a.a_ulonglongint = va_arg (args, unsigned long long int);
+ break;
#endif
case TYPE_DOUBLE:
- ap->a.a_double = va_arg (args, double);
- break;
+ ap->a.a_double = va_arg (args, double);
+ break;
case TYPE_LONGDOUBLE:
- ap->a.a_longdouble = va_arg (args, long double);
- break;
+ ap->a.a_longdouble = va_arg (args, long double);
+ break;
case TYPE_CHAR:
- ap->a.a_char = va_arg (args, int);
- break;
+ ap->a.a_char = va_arg (args, int);
+ break;
#if HAVE_WINT_T
case TYPE_WIDE_CHAR:
- /* Although ISO C 99 7.24.1.(2) says that wint_t is "unchanged by
- default argument promotions", this is not the case in mingw32,
- where wint_t is 'unsigned short'. */
- ap->a.a_wide_char =
- (sizeof (wint_t) < sizeof (int)
- ? va_arg (args, int)
- : va_arg (args, wint_t));
- break;
+ /* Although ISO C 99 7.24.1.(2) says that wint_t is "unchanged by
+ default argument promotions", this is not the case in mingw32,
+ where wint_t is 'unsigned short'. */
+ ap->a.a_wide_char =
+ (sizeof (wint_t) < sizeof (int)
+ ? va_arg (args, int)
+ : va_arg (args, wint_t));
+ break;
#endif
case TYPE_STRING:
- ap->a.a_string = va_arg (args, const char *);
- /* A null pointer is an invalid argument for "%s", but in practice
- it occurs quite frequently in printf statements that produce
- debug output. Use a fallback in this case. */
- if (ap->a.a_string == NULL)
- ap->a.a_string = "(NULL)";
- break;
+ ap->a.a_string = va_arg (args, const char *);
+ /* A null pointer is an invalid argument for "%s", but in practice
+ it occurs quite frequently in printf statements that produce
+ debug output. Use a fallback in this case. */
+ if (ap->a.a_string == NULL)
+ ap->a.a_string = "(NULL)";
+ break;
#if HAVE_WCHAR_T
case TYPE_WIDE_STRING:
- ap->a.a_wide_string = va_arg (args, const wchar_t *);
- /* A null pointer is an invalid argument for "%ls", but in practice
- it occurs quite frequently in printf statements that produce
- debug output. Use a fallback in this case. */
- if (ap->a.a_wide_string == NULL)
- {
- static const wchar_t wide_null_string[] =
- {
- (wchar_t)'(',
- (wchar_t)'N', (wchar_t)'U', (wchar_t)'L', (wchar_t)'L',
- (wchar_t)')',
- (wchar_t)0
- };
- ap->a.a_wide_string = wide_null_string;
- }
- break;
+ ap->a.a_wide_string = va_arg (args, const wchar_t *);
+ /* A null pointer is an invalid argument for "%ls", but in practice
+ it occurs quite frequently in printf statements that produce
+ debug output. Use a fallback in this case. */
+ if (ap->a.a_wide_string == NULL)
+ {
+ static const wchar_t wide_null_string[] =
+ {
+ (wchar_t)'(',
+ (wchar_t)'N', (wchar_t)'U', (wchar_t)'L', (wchar_t)'L',
+ (wchar_t)')',
+ (wchar_t)0
+ };
+ ap->a.a_wide_string = wide_null_string;
+ }
+ break;
#endif
case TYPE_POINTER:
- ap->a.a_pointer = va_arg (args, void *);
- break;
+ ap->a.a_pointer = va_arg (args, void *);
+ break;
case TYPE_COUNT_SCHAR_POINTER:
- ap->a.a_count_schar_pointer = va_arg (args, signed char *);
- break;
+ ap->a.a_count_schar_pointer = va_arg (args, signed char *);
+ break;
case TYPE_COUNT_SHORT_POINTER:
- ap->a.a_count_short_pointer = va_arg (args, short *);
- break;
+ ap->a.a_count_short_pointer = va_arg (args, short *);
+ break;
case TYPE_COUNT_INT_POINTER:
- ap->a.a_count_int_pointer = va_arg (args, int *);
- break;
+ ap->a.a_count_int_pointer = va_arg (args, int *);
+ break;
case TYPE_COUNT_LONGINT_POINTER:
- ap->a.a_count_longint_pointer = va_arg (args, long int *);
- break;
+ ap->a.a_count_longint_pointer = va_arg (args, long int *);
+ break;
#if HAVE_LONG_LONG_INT
case TYPE_COUNT_LONGLONGINT_POINTER:
- ap->a.a_count_longlongint_pointer = va_arg (args, long long int *);
- break;
+ ap->a.a_count_longlongint_pointer = va_arg (args, long long int *);
+ break;
#endif
#if ENABLE_UNISTDIO
/* The unistdio extensions. */
case TYPE_U8_STRING:
- ap->a.a_u8_string = va_arg (args, const uint8_t *);
- /* A null pointer is an invalid argument for "%U", but in practice
- it occurs quite frequently in printf statements that produce
- debug output. Use a fallback in this case. */
- if (ap->a.a_u8_string == NULL)
- {
- static const uint8_t u8_null_string[] =
- { '(', 'N', 'U', 'L', 'L', ')', 0 };
- ap->a.a_u8_string = u8_null_string;
- }
- break;
+ ap->a.a_u8_string = va_arg (args, const uint8_t *);
+ /* A null pointer is an invalid argument for "%U", but in practice
+ it occurs quite frequently in printf statements that produce
+ debug output. Use a fallback in this case. */
+ if (ap->a.a_u8_string == NULL)
+ {
+ static const uint8_t u8_null_string[] =
+ { '(', 'N', 'U', 'L', 'L', ')', 0 };
+ ap->a.a_u8_string = u8_null_string;
+ }
+ break;
case TYPE_U16_STRING:
- ap->a.a_u16_string = va_arg (args, const uint16_t *);
- /* A null pointer is an invalid argument for "%lU", but in practice
- it occurs quite frequently in printf statements that produce
- debug output. Use a fallback in this case. */
- if (ap->a.a_u16_string == NULL)
- {
- static const uint16_t u16_null_string[] =
- { '(', 'N', 'U', 'L', 'L', ')', 0 };
- ap->a.a_u16_string = u16_null_string;
- }
- break;
+ ap->a.a_u16_string = va_arg (args, const uint16_t *);
+ /* A null pointer is an invalid argument for "%lU", but in practice
+ it occurs quite frequently in printf statements that produce
+ debug output. Use a fallback in this case. */
+ if (ap->a.a_u16_string == NULL)
+ {
+ static const uint16_t u16_null_string[] =
+ { '(', 'N', 'U', 'L', 'L', ')', 0 };
+ ap->a.a_u16_string = u16_null_string;
+ }
+ break;
case TYPE_U32_STRING:
- ap->a.a_u32_string = va_arg (args, const uint32_t *);
- /* A null pointer is an invalid argument for "%llU", but in practice
- it occurs quite frequently in printf statements that produce
- debug output. Use a fallback in this case. */
- if (ap->a.a_u32_string == NULL)
- {
- static const uint32_t u32_null_string[] =
- { '(', 'N', 'U', 'L', 'L', ')', 0 };
- ap->a.a_u32_string = u32_null_string;
- }
- break;
+ ap->a.a_u32_string = va_arg (args, const uint32_t *);
+ /* A null pointer is an invalid argument for "%llU", but in practice
+ it occurs quite frequently in printf statements that produce
+ debug output. Use a fallback in this case. */
+ if (ap->a.a_u32_string == NULL)
+ {
+ static const uint32_t u32_null_string[] =
+ { '(', 'N', 'U', 'L', 'L', ')', 0 };
+ ap->a.a_u32_string = u32_null_string;
+ }
+ break;
#endif
default:
- /* Unknown type. */
- return -1;
+ /* Unknown type. */
+ return -1;
}
return 0;
}
diff --git a/intl/printf-args.h b/intl/printf-args.h
index cf89c3e7..f95e6bd9 100644
--- a/intl/printf-args.h
+++ b/intl/printf-args.h
@@ -94,42 +94,42 @@ typedef struct
arg_type type;
union
{
- signed char a_schar;
- unsigned char a_uchar;
- short a_short;
- unsigned short a_ushort;
- int a_int;
- unsigned int a_uint;
- long int a_longint;
- unsigned long int a_ulongint;
+ signed char a_schar;
+ unsigned char a_uchar;
+ short a_short;
+ unsigned short a_ushort;
+ int a_int;
+ unsigned int a_uint;
+ long int a_longint;
+ unsigned long int a_ulongint;
#if HAVE_LONG_LONG_INT
- long long int a_longlongint;
- unsigned long long int a_ulonglongint;
+ long long int a_longlongint;
+ unsigned long long int a_ulonglongint;
#endif
- float a_float;
- double a_double;
- long double a_longdouble;
- int a_char;
+ float a_float;
+ double a_double;
+ long double a_longdouble;
+ int a_char;
#if HAVE_WINT_T
- wint_t a_wide_char;
+ wint_t a_wide_char;
#endif
- const char* a_string;
+ const char* a_string;
#if HAVE_WCHAR_T
- const wchar_t* a_wide_string;
+ const wchar_t* a_wide_string;
#endif
- void* a_pointer;
- signed char * a_count_schar_pointer;
- short * a_count_short_pointer;
- int * a_count_int_pointer;
- long int * a_count_longint_pointer;
+ void* a_pointer;
+ signed char * a_count_schar_pointer;
+ short * a_count_short_pointer;
+ int * a_count_int_pointer;
+ long int * a_count_longint_pointer;
#if HAVE_LONG_LONG_INT
- long long int * a_count_longlongint_pointer;
+ long long int * a_count_longlongint_pointer;
#endif
#if ENABLE_UNISTDIO
/* The unistdio extensions. */
- const uint8_t * a_u8_string;
- const uint16_t * a_u16_string;
- const uint32_t * a_u32_string;
+ const uint8_t * a_u8_string;
+ const uint16_t * a_u16_string;
+ const uint32_t * a_u32_string;
#endif
}
a;
diff --git a/intl/printf-parse.c b/intl/printf-parse.c
index 6ed1cc32..3f3174d0 100644
--- a/intl/printf-parse.c
+++ b/intl/printf-parse.c
@@ -1,5 +1,5 @@
/* Formatted output to strings.
- Copyright (C) 1999-2000, 2002-2003, 2006-2007 Free Software Foundation, Inc.
+ Copyright (C) 1999-2000, 2002-2003, 2006-2008 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
@@ -81,10 +81,10 @@ STATIC
int
PRINTF_PARSE (const CHAR_T *format, DIRECTIVES *d, arguments *a)
{
- const CHAR_T *cp = format; /* pointer into format */
- size_t arg_posn = 0; /* number of regular arguments consumed */
- size_t d_allocated; /* allocated elements of d->dir */
- size_t a_allocated; /* allocated elements of a->arg */
+ const CHAR_T *cp = format; /* pointer into format */
+ size_t arg_posn = 0; /* number of regular arguments consumed */
+ size_t d_allocated; /* allocated elements of d->dir */
+ size_t a_allocated; /* allocated elements of a->arg */
size_t max_width_length = 0;
size_t max_precision_length = 0;
@@ -100,463 +100,501 @@ PRINTF_PARSE (const CHAR_T *format, DIRECTIVES *d, arguments *a)
a->arg = NULL;
#define REGISTER_ARG(_index_,_type_) \
- { \
- size_t n = (_index_); \
- if (n >= a_allocated) \
- { \
- size_t memory_size; \
- argument *memory; \
- \
- a_allocated = xtimes (a_allocated, 2); \
- if (a_allocated <= n) \
- a_allocated = xsum (n, 1); \
- memory_size = xtimes (a_allocated, sizeof (argument)); \
- if (size_overflow_p (memory_size)) \
- /* Overflow, would lead to out of memory. */ \
- goto out_of_memory; \
- memory = (argument *) (a->arg \
- ? realloc (a->arg, memory_size) \
- : malloc (memory_size)); \
- if (memory == NULL) \
- /* Out of memory. */ \
- goto out_of_memory; \
- a->arg = memory; \
- } \
- while (a->count <= n) \
- a->arg[a->count++].type = TYPE_NONE; \
- if (a->arg[n].type == TYPE_NONE) \
- a->arg[n].type = (_type_); \
- else if (a->arg[n].type != (_type_)) \
- /* Ambiguous type for positional argument. */ \
- goto error; \
+ { \
+ size_t n = (_index_); \
+ if (n >= a_allocated) \
+ { \
+ size_t memory_size; \
+ argument *memory; \
+ \
+ a_allocated = xtimes (a_allocated, 2); \
+ if (a_allocated <= n) \
+ a_allocated = xsum (n, 1); \
+ memory_size = xtimes (a_allocated, sizeof (argument)); \
+ if (size_overflow_p (memory_size)) \
+ /* Overflow, would lead to out of memory. */ \
+ goto out_of_memory; \
+ memory = (argument *) (a->arg \
+ ? realloc (a->arg, memory_size) \
+ : malloc (memory_size)); \
+ if (memory == NULL) \
+ /* Out of memory. */ \
+ goto out_of_memory; \
+ a->arg = memory; \
+ } \
+ while (a->count <= n) \
+ a->arg[a->count++].type = TYPE_NONE; \
+ if (a->arg[n].type == TYPE_NONE) \
+ a->arg[n].type = (_type_); \
+ else if (a->arg[n].type != (_type_)) \
+ /* Ambiguous type for positional argument. */ \
+ goto error; \
}
while (*cp != '\0')
{
CHAR_T c = *cp++;
if (c == '%')
- {
- size_t arg_index = ARG_NONE;
- DIRECTIVE *dp = &d->dir[d->count]; /* pointer to next directive */
-
- /* Initialize the next directive. */
- dp->dir_start = cp - 1;
- dp->flags = 0;
- dp->width_start = NULL;
- dp->width_end = NULL;
- dp->width_arg_index = ARG_NONE;
- dp->precision_start = NULL;
- dp->precision_end = NULL;
- dp->precision_arg_index = ARG_NONE;
- dp->arg_index = ARG_NONE;
-
- /* Test for positional argument. */
- if (*cp >= '0' && *cp <= '9')
- {
- const CHAR_T *np;
-
- for (np = cp; *np >= '0' && *np <= '9'; np++)
- ;
- if (*np == '$')
- {
- size_t n = 0;
-
- for (np = cp; *np >= '0' && *np <= '9'; np++)
- n = xsum (xtimes (n, 10), *np - '0');
- if (n == 0)
- /* Positional argument 0. */
- goto error;
- if (size_overflow_p (n))
- /* n too large, would lead to out of memory later. */
- goto error;
- arg_index = n - 1;
- cp = np + 1;
- }
- }
-
- /* Read the flags. */
- for (;;)
- {
- if (*cp == '\'')
- {
- dp->flags |= FLAG_GROUP;
- cp++;
- }
- else if (*cp == '-')
- {
- dp->flags |= FLAG_LEFT;
- cp++;
- }
- else if (*cp == '+')
- {
- dp->flags |= FLAG_SHOWSIGN;
- cp++;
- }
- else if (*cp == ' ')
- {
- dp->flags |= FLAG_SPACE;
- cp++;
- }
- else if (*cp == '#')
- {
- dp->flags |= FLAG_ALT;
- cp++;
- }
- else if (*cp == '0')
- {
- dp->flags |= FLAG_ZERO;
- cp++;
- }
- else
- break;
- }
-
- /* Parse the field width. */
- if (*cp == '*')
- {
- dp->width_start = cp;
- cp++;
- dp->width_end = cp;
- if (max_width_length < 1)
- max_width_length = 1;
-
- /* Test for positional argument. */
- if (*cp >= '0' && *cp <= '9')
- {
- const CHAR_T *np;
-
- for (np = cp; *np >= '0' && *np <= '9'; np++)
- ;
- if (*np == '$')
- {
- size_t n = 0;
-
- for (np = cp; *np >= '0' && *np <= '9'; np++)
- n = xsum (xtimes (n, 10), *np - '0');
- if (n == 0)
- /* Positional argument 0. */
- goto error;
- if (size_overflow_p (n))
- /* n too large, would lead to out of memory later. */
- goto error;
- dp->width_arg_index = n - 1;
- cp = np + 1;
- }
- }
- if (dp->width_arg_index == ARG_NONE)
- {
- dp->width_arg_index = arg_posn++;
- if (dp->width_arg_index == ARG_NONE)
- /* arg_posn wrapped around. */
- goto error;
- }
- REGISTER_ARG (dp->width_arg_index, TYPE_INT);
- }
- else if (*cp >= '0' && *cp <= '9')
- {
- size_t width_length;
-
- dp->width_start = cp;
- for (; *cp >= '0' && *cp <= '9'; cp++)
- ;
- dp->width_end = cp;
- width_length = dp->width_end - dp->width_start;
- if (max_width_length < width_length)
- max_width_length = width_length;
- }
-
- /* Parse the precision. */
- if (*cp == '.')
- {
- cp++;
- if (*cp == '*')
- {
- dp->precision_start = cp - 1;
- cp++;
- dp->precision_end = cp;
- if (max_precision_length < 2)
- max_precision_length = 2;
-
- /* Test for positional argument. */
- if (*cp >= '0' && *cp <= '9')
- {
- const CHAR_T *np;
-
- for (np = cp; *np >= '0' && *np <= '9'; np++)
- ;
- if (*np == '$')
- {
- size_t n = 0;
-
- for (np = cp; *np >= '0' && *np <= '9'; np++)
- n = xsum (xtimes (n, 10), *np - '0');
- if (n == 0)
- /* Positional argument 0. */
- goto error;
- if (size_overflow_p (n))
- /* n too large, would lead to out of memory
- later. */
- goto error;
- dp->precision_arg_index = n - 1;
- cp = np + 1;
- }
- }
- if (dp->precision_arg_index == ARG_NONE)
- {
- dp->precision_arg_index = arg_posn++;
- if (dp->precision_arg_index == ARG_NONE)
- /* arg_posn wrapped around. */
- goto error;
- }
- REGISTER_ARG (dp->precision_arg_index, TYPE_INT);
- }
- else
- {
- size_t precision_length;
-
- dp->precision_start = cp - 1;
- for (; *cp >= '0' && *cp <= '9'; cp++)
- ;
- dp->precision_end = cp;
- precision_length = dp->precision_end - dp->precision_start;
- if (max_precision_length < precision_length)
- max_precision_length = precision_length;
- }
- }
-
- {
- arg_type type;
-
- /* Parse argument type/size specifiers. */
- {
- int flags = 0;
-
- for (;;)
- {
- if (*cp == 'h')
- {
- flags |= (1 << (flags & 1));
- cp++;
- }
- else if (*cp == 'L')
- {
- flags |= 4;
- cp++;
- }
- else if (*cp == 'l')
- {
- flags += 8;
- cp++;
- }
- else if (*cp == 'j')
- {
- if (sizeof (intmax_t) > sizeof (long))
- {
- /* intmax_t = long long */
- flags += 16;
- }
- else if (sizeof (intmax_t) > sizeof (int))
- {
- /* intmax_t = long */
- flags += 8;
- }
- cp++;
- }
- else if (*cp == 'z' || *cp == 'Z')
- {
- /* 'z' is standardized in ISO C 99, but glibc uses 'Z'
- because the warning facility in gcc-2.95.2 understands
- only 'Z' (see gcc-2.95.2/gcc/c-common.c:1784). */
- if (sizeof (size_t) > sizeof (long))
- {
- /* size_t = long long */
- flags += 16;
- }
- else if (sizeof (size_t) > sizeof (int))
- {
- /* size_t = long */
- flags += 8;
- }
- cp++;
- }
- else if (*cp == 't')
- {
- if (sizeof (ptrdiff_t) > sizeof (long))
- {
- /* ptrdiff_t = long long */
- flags += 16;
- }
- else if (sizeof (ptrdiff_t) > sizeof (int))
- {
- /* ptrdiff_t = long */
- flags += 8;
- }
- cp++;
- }
- else
- break;
- }
-
- /* Read the conversion character. */
- c = *cp++;
- switch (c)
- {
- case 'd': case 'i':
+ {
+ size_t arg_index = ARG_NONE;
+ DIRECTIVE *dp = &d->dir[d->count]; /* pointer to next directive */
+
+ /* Initialize the next directive. */
+ dp->dir_start = cp - 1;
+ dp->flags = 0;
+ dp->width_start = NULL;
+ dp->width_end = NULL;
+ dp->width_arg_index = ARG_NONE;
+ dp->precision_start = NULL;
+ dp->precision_end = NULL;
+ dp->precision_arg_index = ARG_NONE;
+ dp->arg_index = ARG_NONE;
+
+ /* Test for positional argument. */
+ if (*cp >= '0' && *cp <= '9')
+ {
+ const CHAR_T *np;
+
+ for (np = cp; *np >= '0' && *np <= '9'; np++)
+ ;
+ if (*np == '$')
+ {
+ size_t n = 0;
+
+ for (np = cp; *np >= '0' && *np <= '9'; np++)
+ n = xsum (xtimes (n, 10), *np - '0');
+ if (n == 0)
+ /* Positional argument 0. */
+ goto error;
+ if (size_overflow_p (n))
+ /* n too large, would lead to out of memory later. */
+ goto error;
+ arg_index = n - 1;
+ cp = np + 1;
+ }
+ }
+
+ /* Read the flags. */
+ for (;;)
+ {
+ if (*cp == '\'')
+ {
+ dp->flags |= FLAG_GROUP;
+ cp++;
+ }
+ else if (*cp == '-')
+ {
+ dp->flags |= FLAG_LEFT;
+ cp++;
+ }
+ else if (*cp == '+')
+ {
+ dp->flags |= FLAG_SHOWSIGN;
+ cp++;
+ }
+ else if (*cp == ' ')
+ {
+ dp->flags |= FLAG_SPACE;
+ cp++;
+ }
+ else if (*cp == '#')
+ {
+ dp->flags |= FLAG_ALT;
+ cp++;
+ }
+ else if (*cp == '0')
+ {
+ dp->flags |= FLAG_ZERO;
+ cp++;
+ }
+ else
+ break;
+ }
+
+ /* Parse the field width. */
+ if (*cp == '*')
+ {
+ dp->width_start = cp;
+ cp++;
+ dp->width_end = cp;
+ if (max_width_length < 1)
+ max_width_length = 1;
+
+ /* Test for positional argument. */
+ if (*cp >= '0' && *cp <= '9')
+ {
+ const CHAR_T *np;
+
+ for (np = cp; *np >= '0' && *np <= '9'; np++)
+ ;
+ if (*np == '$')
+ {
+ size_t n = 0;
+
+ for (np = cp; *np >= '0' && *np <= '9'; np++)
+ n = xsum (xtimes (n, 10), *np - '0');
+ if (n == 0)
+ /* Positional argument 0. */
+ goto error;
+ if (size_overflow_p (n))
+ /* n too large, would lead to out of memory later. */
+ goto error;
+ dp->width_arg_index = n - 1;
+ cp = np + 1;
+ }
+ }
+ if (dp->width_arg_index == ARG_NONE)
+ {
+ dp->width_arg_index = arg_posn++;
+ if (dp->width_arg_index == ARG_NONE)
+ /* arg_posn wrapped around. */
+ goto error;
+ }
+ REGISTER_ARG (dp->width_arg_index, TYPE_INT);
+ }
+ else if (*cp >= '0' && *cp <= '9')
+ {
+ size_t width_length;
+
+ dp->width_start = cp;
+ for (; *cp >= '0' && *cp <= '9'; cp++)
+ ;
+ dp->width_end = cp;
+ width_length = dp->width_end - dp->width_start;
+ if (max_width_length < width_length)
+ max_width_length = width_length;
+ }
+
+ /* Parse the precision. */
+ if (*cp == '.')
+ {
+ cp++;
+ if (*cp == '*')
+ {
+ dp->precision_start = cp - 1;
+ cp++;
+ dp->precision_end = cp;
+ if (max_precision_length < 2)
+ max_precision_length = 2;
+
+ /* Test for positional argument. */
+ if (*cp >= '0' && *cp <= '9')
+ {
+ const CHAR_T *np;
+
+ for (np = cp; *np >= '0' && *np <= '9'; np++)
+ ;
+ if (*np == '$')
+ {
+ size_t n = 0;
+
+ for (np = cp; *np >= '0' && *np <= '9'; np++)
+ n = xsum (xtimes (n, 10), *np - '0');
+ if (n == 0)
+ /* Positional argument 0. */
+ goto error;
+ if (size_overflow_p (n))
+ /* n too large, would lead to out of memory
+ later. */
+ goto error;
+ dp->precision_arg_index = n - 1;
+ cp = np + 1;
+ }
+ }
+ if (dp->precision_arg_index == ARG_NONE)
+ {
+ dp->precision_arg_index = arg_posn++;
+ if (dp->precision_arg_index == ARG_NONE)
+ /* arg_posn wrapped around. */
+ goto error;
+ }
+ REGISTER_ARG (dp->precision_arg_index, TYPE_INT);
+ }
+ else
+ {
+ size_t precision_length;
+
+ dp->precision_start = cp - 1;
+ for (; *cp >= '0' && *cp <= '9'; cp++)
+ ;
+ dp->precision_end = cp;
+ precision_length = dp->precision_end - dp->precision_start;
+ if (max_precision_length < precision_length)
+ max_precision_length = precision_length;
+ }
+ }
+
+ {
+ arg_type type;
+
+ /* Parse argument type/size specifiers. */
+ {
+ int flags = 0;
+
+ for (;;)
+ {
+ if (*cp == 'h')
+ {
+ flags |= (1 << (flags & 1));
+ cp++;
+ }
+ else if (*cp == 'L')
+ {
+ flags |= 4;
+ cp++;
+ }
+ else if (*cp == 'l')
+ {
+ flags += 8;
+ cp++;
+ }
+ else if (*cp == 'j')
+ {
+ if (sizeof (intmax_t) > sizeof (long))
+ {
+ /* intmax_t = long long */
+ flags += 16;
+ }
+ else if (sizeof (intmax_t) > sizeof (int))
+ {
+ /* intmax_t = long */
+ flags += 8;
+ }
+ cp++;
+ }
+ else if (*cp == 'z' || *cp == 'Z')
+ {
+ /* 'z' is standardized in ISO C 99, but glibc uses 'Z'
+ because the warning facility in gcc-2.95.2 understands
+ only 'Z' (see gcc-2.95.2/gcc/c-common.c:1784). */
+ if (sizeof (size_t) > sizeof (long))
+ {
+ /* size_t = long long */
+ flags += 16;
+ }
+ else if (sizeof (size_t) > sizeof (int))
+ {
+ /* size_t = long */
+ flags += 8;
+ }
+ cp++;
+ }
+ else if (*cp == 't')
+ {
+ if (sizeof (ptrdiff_t) > sizeof (long))
+ {
+ /* ptrdiff_t = long long */
+ flags += 16;
+ }
+ else if (sizeof (ptrdiff_t) > sizeof (int))
+ {
+ /* ptrdiff_t = long */
+ flags += 8;
+ }
+ cp++;
+ }
+#if defined __APPLE__ && defined __MACH__
+ /* On MacOS X 10.3, PRIdMAX is defined as "qd".
+ We cannot change it to "lld" because PRIdMAX must also
+ be understood by the system's printf routines. */
+ else if (*cp == 'q')
+ {
+ if (64 / 8 > sizeof (long))
+ {
+ /* int64_t = long long */
+ flags += 16;
+ }
+ else
+ {
+ /* int64_t = long */
+ flags += 8;
+ }
+ cp++;
+ }
+#endif
+#if (defined _WIN32 || defined __WIN32__) && ! defined __CYGWIN__
+ /* On native Win32, PRIdMAX is defined as "I64d".
+ We cannot change it to "lld" because PRIdMAX must also
+ be understood by the system's printf routines. */
+ else if (*cp == 'I' && cp[1] == '6' && cp[2] == '4')
+ {
+ if (64 / 8 > sizeof (long))
+ {
+ /* __int64 = long long */
+ flags += 16;
+ }
+ else
+ {
+ /* __int64 = long */
+ flags += 8;
+ }
+ cp += 3;
+ }
+#endif
+ else
+ break;
+ }
+
+ /* Read the conversion character. */
+ c = *cp++;
+ switch (c)
+ {
+ case 'd': case 'i':
#if HAVE_LONG_LONG_INT
- /* If 'long long' exists and is larger than 'long': */
- if (flags >= 16 || (flags & 4))
- type = TYPE_LONGLONGINT;
- else
+ /* If 'long long' exists and is larger than 'long': */
+ if (flags >= 16 || (flags & 4))
+ type = TYPE_LONGLONGINT;
+ else
#endif
- /* If 'long long' exists and is the same as 'long', we parse
- "lld" into TYPE_LONGINT. */
- if (flags >= 8)
- type = TYPE_LONGINT;
- else if (flags & 2)
- type = TYPE_SCHAR;
- else if (flags & 1)
- type = TYPE_SHORT;
- else
- type = TYPE_INT;
- break;
- case 'o': case 'u': case 'x': case 'X':
+ /* If 'long long' exists and is the same as 'long', we parse
+ "lld" into TYPE_LONGINT. */
+ if (flags >= 8)
+ type = TYPE_LONGINT;
+ else if (flags & 2)
+ type = TYPE_SCHAR;
+ else if (flags & 1)
+ type = TYPE_SHORT;
+ else
+ type = TYPE_INT;
+ break;
+ case 'o': case 'u': case 'x': case 'X':
#if HAVE_LONG_LONG_INT
- /* If 'long long' exists and is larger than 'long': */
- if (flags >= 16 || (flags & 4))
- type = TYPE_ULONGLONGINT;
- else
+ /* If 'long long' exists and is larger than 'long': */
+ if (flags >= 16 || (flags & 4))
+ type = TYPE_ULONGLONGINT;
+ else
#endif
- /* If 'unsigned long long' exists and is the same as
- 'unsigned long', we parse "llu" into TYPE_ULONGINT. */
- if (flags >= 8)
- type = TYPE_ULONGINT;
- else if (flags & 2)
- type = TYPE_UCHAR;
- else if (flags & 1)
- type = TYPE_USHORT;
- else
- type = TYPE_UINT;
- break;
- case 'f': case 'F': case 'e': case 'E': case 'g': case 'G':
- case 'a': case 'A':
- if (flags >= 16 || (flags & 4))
- type = TYPE_LONGDOUBLE;
- else
- type = TYPE_DOUBLE;
- break;
- case 'c':
- if (flags >= 8)
+ /* If 'unsigned long long' exists and is the same as
+ 'unsigned long', we parse "llu" into TYPE_ULONGINT. */
+ if (flags >= 8)
+ type = TYPE_ULONGINT;
+ else if (flags & 2)
+ type = TYPE_UCHAR;
+ else if (flags & 1)
+ type = TYPE_USHORT;
+ else
+ type = TYPE_UINT;
+ break;
+ case 'f': case 'F': case 'e': case 'E': case 'g': case 'G':
+ case 'a': case 'A':
+ if (flags >= 16 || (flags & 4))
+ type = TYPE_LONGDOUBLE;
+ else
+ type = TYPE_DOUBLE;
+ break;
+ case 'c':
+ if (flags >= 8)
#if HAVE_WINT_T
- type = TYPE_WIDE_CHAR;
+ type = TYPE_WIDE_CHAR;
#else
- goto error;
+ goto error;
#endif
- else
- type = TYPE_CHAR;
- break;
+ else
+ type = TYPE_CHAR;
+ break;
#if HAVE_WINT_T
- case 'C':
- type = TYPE_WIDE_CHAR;
- c = 'c';
- break;
+ case 'C':
+ type = TYPE_WIDE_CHAR;
+ c = 'c';
+ break;
#endif
- case 's':
- if (flags >= 8)
+ case 's':
+ if (flags >= 8)
#if HAVE_WCHAR_T
- type = TYPE_WIDE_STRING;
+ type = TYPE_WIDE_STRING;
#else
- goto error;
+ goto error;
#endif
- else
- type = TYPE_STRING;
- break;
+ else
+ type = TYPE_STRING;
+ break;
#if HAVE_WCHAR_T
- case 'S':
- type = TYPE_WIDE_STRING;
- c = 's';
- break;
+ case 'S':
+ type = TYPE_WIDE_STRING;
+ c = 's';
+ break;
#endif
- case 'p':
- type = TYPE_POINTER;
- break;
- case 'n':
+ case 'p':
+ type = TYPE_POINTER;
+ break;
+ case 'n':
#if HAVE_LONG_LONG_INT
- /* If 'long long' exists and is larger than 'long': */
- if (flags >= 16 || (flags & 4))
- type = TYPE_COUNT_LONGLONGINT_POINTER;
- else
+ /* If 'long long' exists and is larger than 'long': */
+ if (flags >= 16 || (flags & 4))
+ type = TYPE_COUNT_LONGLONGINT_POINTER;
+ else
#endif
- /* If 'long long' exists and is the same as 'long', we parse
- "lln" into TYPE_COUNT_LONGINT_POINTER. */
- if (flags >= 8)
- type = TYPE_COUNT_LONGINT_POINTER;
- else if (flags & 2)
- type = TYPE_COUNT_SCHAR_POINTER;
- else if (flags & 1)
- type = TYPE_COUNT_SHORT_POINTER;
- else
- type = TYPE_COUNT_INT_POINTER;
- break;
+ /* If 'long long' exists and is the same as 'long', we parse
+ "lln" into TYPE_COUNT_LONGINT_POINTER. */
+ if (flags >= 8)
+ type = TYPE_COUNT_LONGINT_POINTER;
+ else if (flags & 2)
+ type = TYPE_COUNT_SCHAR_POINTER;
+ else if (flags & 1)
+ type = TYPE_COUNT_SHORT_POINTER;
+ else
+ type = TYPE_COUNT_INT_POINTER;
+ break;
#if ENABLE_UNISTDIO
- /* The unistdio extensions. */
- case 'U':
- if (flags >= 16)
- type = TYPE_U32_STRING;
- else if (flags >= 8)
- type = TYPE_U16_STRING;
- else
- type = TYPE_U8_STRING;
- break;
+ /* The unistdio extensions. */
+ case 'U':
+ if (flags >= 16)
+ type = TYPE_U32_STRING;
+ else if (flags >= 8)
+ type = TYPE_U16_STRING;
+ else
+ type = TYPE_U8_STRING;
+ break;
#endif
- case '%':
- type = TYPE_NONE;
- break;
- default:
- /* Unknown conversion character. */
- goto error;
- }
- }
-
- if (type != TYPE_NONE)
- {
- dp->arg_index = arg_index;
- if (dp->arg_index == ARG_NONE)
- {
- dp->arg_index = arg_posn++;
- if (dp->arg_index == ARG_NONE)
- /* arg_posn wrapped around. */
- goto error;
- }
- REGISTER_ARG (dp->arg_index, type);
- }
- dp->conversion = c;
- dp->dir_end = cp;
- }
-
- d->count++;
- if (d->count >= d_allocated)
- {
- size_t memory_size;
- DIRECTIVE *memory;
-
- d_allocated = xtimes (d_allocated, 2);
- memory_size = xtimes (d_allocated, sizeof (DIRECTIVE));
- if (size_overflow_p (memory_size))
- /* Overflow, would lead to out of memory. */
- goto out_of_memory;
- memory = (DIRECTIVE *) realloc (d->dir, memory_size);
- if (memory == NULL)
- /* Out of memory. */
- goto out_of_memory;
- d->dir = memory;
- }
- }
+ case '%':
+ type = TYPE_NONE;
+ break;
+ default:
+ /* Unknown conversion character. */
+ goto error;
+ }
+ }
+
+ if (type != TYPE_NONE)
+ {
+ dp->arg_index = arg_index;
+ if (dp->arg_index == ARG_NONE)
+ {
+ dp->arg_index = arg_posn++;
+ if (dp->arg_index == ARG_NONE)
+ /* arg_posn wrapped around. */
+ goto error;
+ }
+ REGISTER_ARG (dp->arg_index, type);
+ }
+ dp->conversion = c;
+ dp->dir_end = cp;
+ }
+
+ d->count++;
+ if (d->count >= d_allocated)
+ {
+ size_t memory_size;
+ DIRECTIVE *memory;
+
+ d_allocated = xtimes (d_allocated, 2);
+ memory_size = xtimes (d_allocated, sizeof (DIRECTIVE));
+ if (size_overflow_p (memory_size))
+ /* Overflow, would lead to out of memory. */
+ goto out_of_memory;
+ memory = (DIRECTIVE *) realloc (d->dir, memory_size);
+ if (memory == NULL)
+ /* Out of memory. */
+ goto out_of_memory;
+ d->dir = memory;
+ }
+ }
#if CHAR_T_ONLY_ASCII
else if (!c_isascii (c))
- {
- /* Non-ASCII character. Not supported. */
- goto error;
- }
+ {
+ /* Non-ASCII character. Not supported. */
+ goto error;
+ }
#endif
}
d->dir[d->count].dir_start = cp;
diff --git a/intl/printf-parse.h b/intl/printf-parse.h
index e7853389..51ead29e 100644
--- a/intl/printf-parse.h
+++ b/intl/printf-parse.h
@@ -23,15 +23,15 @@
/* Flags */
-#define FLAG_GROUP 1 /* ' flag */
-#define FLAG_LEFT 2 /* - flag */
-#define FLAG_SHOWSIGN 4 /* + flag */
-#define FLAG_SPACE 8 /* space flag */
-#define FLAG_ALT 16 /* # flag */
-#define FLAG_ZERO 32
+#define FLAG_GROUP 1 /* ' flag */
+#define FLAG_LEFT 2 /* - flag */
+#define FLAG_SHOWSIGN 4 /* + flag */
+#define FLAG_SPACE 8 /* space flag */
+#define FLAG_ALT 16 /* # flag */
+#define FLAG_ZERO 32
/* arg_index value indicating that no argument is consumed. */
-#define ARG_NONE (~(size_t)0)
+#define ARG_NONE (~(size_t)0)
/* A parsed directive. */
typedef struct
diff --git a/intl/printf.c b/intl/printf.c
index 0088e519..b7cdc5d8 100644
--- a/intl/printf.c
+++ b/intl/printf.c
@@ -1,5 +1,5 @@
/* Formatted output to strings, using POSIX/XSI format strings with positions.
- Copyright (C) 2003, 2006-2007 Free Software Foundation, Inc.
+ Copyright (C) 2003, 2006-2007, 2009 Free Software Foundation, Inc.
Written by Bruno Haible <bruno@clisp.org>, 2003.
This program is free software; you can redistribute it and/or modify it
@@ -60,7 +60,9 @@ char *alloca ();
/* When building a DLL, we must export some functions. Note that because
the functions are only defined for binary backward compatibility, we
don't need to use __declspec(dllimport) in any case. */
-#if defined _MSC_VER && BUILDING_DLL
+#if HAVE_VISIBILITY && BUILDING_DLL
+# define DLL_EXPORTED __attribute__((__visibility__("default")))
+#elif defined _MSC_VER && BUILDING_DLL
# define DLL_EXPORTED __declspec(dllexport)
#else
# define DLL_EXPORTED
@@ -102,17 +104,17 @@ libintl_vfprintf (FILE *stream, const char *format, va_list args)
char *result = libintl_vasnprintf (NULL, &length, format, args);
int retval = -1;
if (result != NULL)
- {
- size_t written = fwrite (result, 1, length, stream);
- free (result);
- if (written == length)
- {
- if (length > INT_MAX)
- errno = EOVERFLOW;
- else
- retval = length;
- }
- }
+ {
+ size_t written = fwrite (result, 1, length, stream);
+ free (result);
+ if (written == length)
+ {
+ if (length > INT_MAX)
+ errno = EOVERFLOW;
+ else
+ retval = length;
+ }
+ }
return retval;
}
}
@@ -161,17 +163,17 @@ libintl_vsprintf (char *resultbuf, const char *format, va_list args)
size_t length = (size_t) ~0 / (4 * sizeof (char));
char *result = libintl_vasnprintf (resultbuf, &length, format, args);
if (result != resultbuf)
- {
- free (result);
- return -1;
- }
+ {
+ free (result);
+ return -1;
+ }
if (length > INT_MAX)
- {
- errno = EOVERFLOW;
- return -1;
- }
+ {
+ errno = EOVERFLOW;
+ return -1;
+ }
else
- return length;
+ return length;
}
}
@@ -209,23 +211,23 @@ libintl_vsnprintf (char *resultbuf, size_t length, const char *format, va_list a
size_t maxlength = length;
char *result = libintl_vasnprintf (resultbuf, &length, format, args);
if (result != resultbuf)
- {
- if (maxlength > 0)
- {
- size_t pruned_length =
- (length < maxlength ? length : maxlength - 1);
- memcpy (resultbuf, result, pruned_length);
- resultbuf[pruned_length] = '\0';
- }
- free (result);
- }
+ {
+ if (maxlength > 0)
+ {
+ size_t pruned_length =
+ (length < maxlength ? length : maxlength - 1);
+ memcpy (resultbuf, result, pruned_length);
+ resultbuf[pruned_length] = '\0';
+ }
+ free (result);
+ }
if (length > INT_MAX)
- {
- errno = EOVERFLOW;
- return -1;
- }
+ {
+ errno = EOVERFLOW;
+ return -1;
+ }
else
- return length;
+ return length;
}
}
@@ -321,20 +323,20 @@ libintl_vfwprintf (FILE *stream, const wchar_t *format, va_list args)
wchar_t *result = libintl_vasnwprintf (NULL, &length, format, args);
int retval = -1;
if (result != NULL)
- {
- size_t i;
- for (i = 0; i < length; i++)
- if (fputwc (result[i], stream) == WEOF)
- break;
- free (result);
- if (i == length)
- {
- if (length > INT_MAX)
- errno = EOVERFLOW;
- else
- retval = length;
- }
- }
+ {
+ size_t i;
+ for (i = 0; i < length; i++)
+ if (fputwc (result[i], stream) == WEOF)
+ break;
+ free (result);
+ if (i == length)
+ {
+ if (length > INT_MAX)
+ errno = EOVERFLOW;
+ else
+ retval = length;
+ }
+ }
return retval;
}
}
@@ -383,29 +385,29 @@ libintl_vswprintf (wchar_t *resultbuf, size_t length, const wchar_t *format, va_
size_t maxlength = length;
wchar_t *result = libintl_vasnwprintf (resultbuf, &length, format, args);
if (result != resultbuf)
- {
- if (maxlength > 0)
- {
- size_t pruned_length =
- (length < maxlength ? length : maxlength - 1);
- memcpy (resultbuf, result, pruned_length * sizeof (wchar_t));
- resultbuf[pruned_length] = 0;
- }
- free (result);
- /* Unlike vsnprintf, which has to return the number of character that
- would have been produced if the resultbuf had been sufficiently
- large, the vswprintf function has to return a negative value if
- the resultbuf was not sufficiently large. */
- if (length >= maxlength)
- return -1;
- }
+ {
+ if (maxlength > 0)
+ {
+ size_t pruned_length =
+ (length < maxlength ? length : maxlength - 1);
+ memcpy (resultbuf, result, pruned_length * sizeof (wchar_t));
+ resultbuf[pruned_length] = 0;
+ }
+ free (result);
+ /* Unlike vsnprintf, which has to return the number of character that
+ would have been produced if the resultbuf had been sufficiently
+ large, the vswprintf function has to return a negative value if
+ the resultbuf was not sufficiently large. */
+ if (length >= maxlength)
+ return -1;
+ }
if (length > INT_MAX)
- {
- errno = EOVERFLOW;
- return -1;
- }
+ {
+ errno = EOVERFLOW;
+ return -1;
+ }
else
- return length;
+ return length;
}
}
diff --git a/intl/relocatable.c b/intl/relocatable.c
index 5e1dde6c..f1bed781 100644
--- a/intl/relocatable.c
+++ b/intl/relocatable.c
@@ -1,5 +1,5 @@
/* Provide relocatable packages.
- Copyright (C) 2003-2006 Free Software Foundation, Inc.
+ Copyright (C) 2003-2006, 2008-2009 Free Software Foundation, Inc.
Written by Bruno Haible <bruno@clisp.org>, 2003.
This program is free software; you can redistribute it and/or modify it
@@ -22,7 +22,7 @@
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
+# define _GNU_SOURCE 1
#endif
#include <config.h>
@@ -102,11 +102,11 @@ static size_t curr_prefix_len;
instead of "/"). */
static void
set_this_relocation_prefix (const char *orig_prefix_arg,
- const char *curr_prefix_arg)
+ const char *curr_prefix_arg)
{
if (orig_prefix_arg != NULL && curr_prefix_arg != NULL
/* Optimization: if orig_prefix and curr_prefix are equal, the
- relocation is a nop. */
+ relocation is a nop. */
&& strcmp (orig_prefix_arg, curr_prefix_arg) != 0)
{
/* Duplicate the argument strings. */
@@ -118,14 +118,14 @@ set_this_relocation_prefix (const char *orig_prefix_arg,
#ifdef NO_XMALLOC
if (memory != NULL)
#endif
- {
- memcpy (memory, orig_prefix_arg, orig_prefix_len + 1);
- orig_prefix = memory;
- memory += orig_prefix_len + 1;
- memcpy (memory, curr_prefix_arg, curr_prefix_len + 1);
- curr_prefix = memory;
- return;
- }
+ {
+ memcpy (memory, orig_prefix_arg, orig_prefix_len + 1);
+ orig_prefix = memory;
+ memory += orig_prefix_len + 1;
+ memcpy (memory, curr_prefix_arg, curr_prefix_len + 1);
+ curr_prefix = memory;
+ return;
+ }
}
orig_prefix = NULL;
curr_prefix = NULL;
@@ -160,17 +160,18 @@ set_relocation_prefix (const char *orig_prefix_arg, const char *curr_prefix_arg)
/* Convenience function:
Computes the current installation prefix, based on the original
installation prefix, the original installation directory of a particular
- file, and the current pathname of this file. Returns NULL upon failure. */
+ file, and the current pathname of this file.
+ Returns it, freshly allocated. Returns NULL upon failure. */
#ifdef IN_LIBRARY
#define compute_curr_prefix local_compute_curr_prefix
static
#endif
-const char *
+char *
compute_curr_prefix (const char *orig_installprefix,
- const char *orig_installdir,
- const char *curr_pathname)
+ const char *orig_installdir,
+ const char *curr_pathname)
{
- const char *curr_installdir;
+ char *curr_installdir;
const char *rel_installdir;
if (curr_pathname == NULL)
@@ -193,9 +194,9 @@ compute_curr_prefix (const char *orig_installprefix,
while (p > p_base)
{
- p--;
- if (ISSLASH (*p))
- break;
+ p--;
+ if (ISSLASH (*p))
+ break;
}
q = (char *) xmalloc (p - curr_pathname + 1);
@@ -218,44 +219,47 @@ compute_curr_prefix (const char *orig_installprefix,
while (rp > rel_installdir && cp > cp_base)
{
- bool same = false;
- const char *rpi = rp;
- const char *cpi = cp;
-
- while (rpi > rel_installdir && cpi > cp_base)
- {
- rpi--;
- cpi--;
- if (ISSLASH (*rpi) || ISSLASH (*cpi))
- {
- if (ISSLASH (*rpi) && ISSLASH (*cpi))
- same = true;
- break;
- }
- /* Do case-insensitive comparison if the filesystem is always or
- often case-insensitive. It's better to accept the comparison
- if the difference is only in case, rather than to fail. */
+ bool same = false;
+ const char *rpi = rp;
+ const char *cpi = cp;
+
+ while (rpi > rel_installdir && cpi > cp_base)
+ {
+ rpi--;
+ cpi--;
+ if (ISSLASH (*rpi) || ISSLASH (*cpi))
+ {
+ if (ISSLASH (*rpi) && ISSLASH (*cpi))
+ same = true;
+ break;
+ }
+ /* Do case-insensitive comparison if the file system is always or
+ often case-insensitive. It's better to accept the comparison
+ if the difference is only in case, rather than to fail. */
#if defined _WIN32 || defined __WIN32__ || defined __CYGWIN__ || defined __EMX__ || defined __DJGPP__
- /* Win32, Cygwin, OS/2, DOS - case insignificant filesystem */
- if ((*rpi >= 'a' && *rpi <= 'z' ? *rpi - 'a' + 'A' : *rpi)
- != (*cpi >= 'a' && *cpi <= 'z' ? *cpi - 'a' + 'A' : *cpi))
- break;
+ /* Win32, Cygwin, OS/2, DOS - case insignificant file system */
+ if ((*rpi >= 'a' && *rpi <= 'z' ? *rpi - 'a' + 'A' : *rpi)
+ != (*cpi >= 'a' && *cpi <= 'z' ? *cpi - 'a' + 'A' : *cpi))
+ break;
#else
- if (*rpi != *cpi)
- break;
+ if (*rpi != *cpi)
+ break;
#endif
- }
- if (!same)
- break;
- /* The last pathname component was the same. opi and cpi now point
- to the slash before it. */
- rp = rpi;
- cp = cpi;
+ }
+ if (!same)
+ break;
+ /* The last pathname component was the same. opi and cpi now point
+ to the slash before it. */
+ rp = rpi;
+ cp = cpi;
}
if (rp > rel_installdir)
- /* Unexpected: The curr_installdir does not end with rel_installdir. */
- return NULL;
+ {
+ /* Unexpected: The curr_installdir does not end with rel_installdir. */
+ free (curr_installdir);
+ return NULL;
+ }
{
size_t curr_prefix_len = cp - curr_installdir;
@@ -264,11 +268,16 @@ compute_curr_prefix (const char *orig_installprefix,
curr_prefix = (char *) xmalloc (curr_prefix_len + 1);
#ifdef NO_XMALLOC
if (curr_prefix == NULL)
- return NULL;
+ {
+ free (curr_installdir);
+ return NULL;
+ }
#endif
memcpy (curr_prefix, curr_installdir, curr_prefix_len);
curr_prefix[curr_prefix_len] = '\0';
+ free (curr_installdir);
+
return curr_prefix;
}
}
@@ -296,30 +305,30 @@ DllMain (HINSTANCE module_handle, DWORD event, LPVOID reserved)
static char location[MAX_PATH];
if (!GetModuleFileName (module_handle, location, sizeof (location)))
- /* Shouldn't happen. */
- return FALSE;
+ /* Shouldn't happen. */
+ return FALSE;
if (!IS_PATH_WITH_DIR (location))
- /* Shouldn't happen. */
- return FALSE;
+ /* Shouldn't happen. */
+ return FALSE;
{
#if defined __CYGWIN__
- /* On Cygwin, we need to convert paths coming from Win32 system calls
- to the Unix-like slashified notation. */
- static char location_as_posix_path[2 * MAX_PATH];
- /* There's no error return defined for cygwin_conv_to_posix_path.
- See cygwin-api/func-cygwin-conv-to-posix-path.html.
- Does it overflow the buffer of expected size MAX_PATH or does it
- truncate the path? I don't know. Let's catch both. */
- cygwin_conv_to_posix_path (location, location_as_posix_path);
- location_as_posix_path[MAX_PATH - 1] = '\0';
- if (strlen (location_as_posix_path) >= MAX_PATH - 1)
- /* A sign of buffer overflow or path truncation. */
- return FALSE;
- shared_library_fullname = strdup (location_as_posix_path);
+ /* On Cygwin, we need to convert paths coming from Win32 system calls
+ to the Unix-like slashified notation. */
+ static char location_as_posix_path[2 * MAX_PATH];
+ /* There's no error return defined for cygwin_conv_to_posix_path.
+ See cygwin-api/func-cygwin-conv-to-posix-path.html.
+ Does it overflow the buffer of expected size MAX_PATH or does it
+ truncate the path? I don't know. Let's catch both. */
+ cygwin_conv_to_posix_path (location, location_as_posix_path);
+ location_as_posix_path[MAX_PATH - 1] = '\0';
+ if (strlen (location_as_posix_path) >= MAX_PATH - 1)
+ /* A sign of buffer overflow or path truncation. */
+ return FALSE;
+ shared_library_fullname = strdup (location_as_posix_path);
#else
- shared_library_fullname = strdup (location);
+ shared_library_fullname = strdup (location);
#endif
}
}
@@ -342,37 +351,37 @@ find_shared_library_fullname ()
{
unsigned long address = (unsigned long) &find_shared_library_fullname;
for (;;)
- {
- unsigned long start, end;
- int c;
-
- if (fscanf (fp, "%lx-%lx", &start, &end) != 2)
- break;
- if (address >= start && address <= end - 1)
- {
- /* Found it. Now see if this line contains a filename. */
- while (c = getc (fp), c != EOF && c != '\n' && c != '/')
- continue;
- if (c == '/')
- {
- size_t size;
- int len;
-
- ungetc (c, fp);
- shared_library_fullname = NULL; size = 0;
- len = getline (&shared_library_fullname, &size, fp);
- if (len >= 0)
- {
- /* Success: filled shared_library_fullname. */
- if (len > 0 && shared_library_fullname[len - 1] == '\n')
- shared_library_fullname[len - 1] = '\0';
- }
- }
- break;
- }
- while (c = getc (fp), c != EOF && c != '\n')
- continue;
- }
+ {
+ unsigned long start, end;
+ int c;
+
+ if (fscanf (fp, "%lx-%lx", &start, &end) != 2)
+ break;
+ if (address >= start && address <= end - 1)
+ {
+ /* Found it. Now see if this line contains a filename. */
+ while (c = getc (fp), c != EOF && c != '\n' && c != '/')
+ continue;
+ if (c == '/')
+ {
+ size_t size;
+ int len;
+
+ ungetc (c, fp);
+ shared_library_fullname = NULL; size = 0;
+ len = getline (&shared_library_fullname, &size, fp);
+ if (len >= 0)
+ {
+ /* Success: filled shared_library_fullname. */
+ if (len > 0 && shared_library_fullname[len - 1] == '\n')
+ shared_library_fullname[len - 1] = '\0';
+ }
+ }
+ break;
+ }
+ while (c = getc (fp), c != EOF && c != '\n')
+ continue;
+ }
fclose (fp);
}
#endif
@@ -400,7 +409,9 @@ get_shared_library_fullname ()
#endif /* PIC */
/* Returns the pathname, relocated according to the current installation
- directory. */
+ directory.
+ The returned string is either PATHNAME unmodified or a freshly allocated
+ string that you can free with free() after casting it to 'char *'. */
const char *
relocate (const char *pathname)
{
@@ -411,55 +422,69 @@ relocate (const char *pathname)
if (!initialized)
{
/* At this point, orig_prefix and curr_prefix likely have already been
- set through the main program's set_program_name_and_installdir
- function. This is sufficient in the case that the library has
- initially been installed in the same orig_prefix. But we can do
- better, to also cover the cases that 1. it has been installed
- in a different prefix before being moved to orig_prefix and (later)
- to curr_prefix, 2. unlike the program, it has not moved away from
- orig_prefix. */
+ set through the main program's set_program_name_and_installdir
+ function. This is sufficient in the case that the library has
+ initially been installed in the same orig_prefix. But we can do
+ better, to also cover the cases that 1. it has been installed
+ in a different prefix before being moved to orig_prefix and (later)
+ to curr_prefix, 2. unlike the program, it has not moved away from
+ orig_prefix. */
const char *orig_installprefix = INSTALLPREFIX;
const char *orig_installdir = INSTALLDIR;
- const char *curr_prefix_better;
+ char *curr_prefix_better;
curr_prefix_better =
- compute_curr_prefix (orig_installprefix, orig_installdir,
- get_shared_library_fullname ());
- if (curr_prefix_better == NULL)
- curr_prefix_better = curr_prefix;
+ compute_curr_prefix (orig_installprefix, orig_installdir,
+ get_shared_library_fullname ());
- set_relocation_prefix (orig_installprefix, curr_prefix_better);
+ set_relocation_prefix (orig_installprefix,
+ curr_prefix_better != NULL
+ ? curr_prefix_better
+ : curr_prefix);
+
+ if (curr_prefix_better != NULL)
+ free (curr_prefix_better);
initialized = 1;
}
#endif
/* Note: It is not necessary to perform case insensitive comparison here,
- even for DOS-like filesystems, because the pathname argument was
+ even for DOS-like file systems, because the pathname argument was
typically created from the same Makefile variable as orig_prefix came
from. */
if (orig_prefix != NULL && curr_prefix != NULL
&& strncmp (pathname, orig_prefix, orig_prefix_len) == 0)
{
if (pathname[orig_prefix_len] == '\0')
- /* pathname equals orig_prefix. */
- return curr_prefix;
- if (ISSLASH (pathname[orig_prefix_len]))
- {
- /* pathname starts with orig_prefix. */
- const char *pathname_tail = &pathname[orig_prefix_len];
- char *result =
- (char *) xmalloc (curr_prefix_len + strlen (pathname_tail) + 1);
+ {
+ /* pathname equals orig_prefix. */
+ char *result = (char *) xmalloc (strlen (curr_prefix) + 1);
+
+#ifdef NO_XMALLOC
+ if (result != NULL)
+#endif
+ {
+ strcpy (result, curr_prefix);
+ return result;
+ }
+ }
+ else if (ISSLASH (pathname[orig_prefix_len]))
+ {
+ /* pathname starts with orig_prefix. */
+ const char *pathname_tail = &pathname[orig_prefix_len];
+ char *result =
+ (char *) xmalloc (curr_prefix_len + strlen (pathname_tail) + 1);
#ifdef NO_XMALLOC
- if (result != NULL)
+ if (result != NULL)
#endif
- {
- memcpy (result, curr_prefix, curr_prefix_len);
- strcpy (result + curr_prefix_len, pathname_tail);
- return result;
- }
- }
+ {
+ memcpy (result, curr_prefix, curr_prefix_len);
+ strcpy (result + curr_prefix_len, pathname_tail);
+ return result;
+ }
+ }
}
/* Nothing to relocate. */
return pathname;
diff --git a/intl/relocatable.h b/intl/relocatable.h
index f6d38321..3acb5343 100644
--- a/intl/relocatable.h
+++ b/intl/relocatable.h
@@ -1,5 +1,5 @@
/* Provide relocatable packages.
- Copyright (C) 2003, 2005 Free Software Foundation, Inc.
+ Copyright (C) 2003, 2005, 2008 Free Software Foundation, Inc.
Written by Bruno Haible <bruno@clisp.org>, 2003.
This program is free software; you can redistribute it and/or modify it
@@ -46,23 +46,27 @@ extern "C" {
instead of "/"). */
extern RELOCATABLE_DLL_EXPORTED void
set_relocation_prefix (const char *orig_prefix,
- const char *curr_prefix);
+ const char *curr_prefix);
/* Returns the pathname, relocated according to the current installation
- directory. */
+ directory.
+ The returned string is either PATHNAME unmodified or a freshly allocated
+ string that you can free with free() after casting it to 'char *'. */
extern const char * relocate (const char *pathname);
-/* Memory management: relocate() leaks memory, because it has to construct
- a fresh pathname. If this is a problem because your program calls
- relocate() frequently, think about caching the result. */
+/* Memory management: relocate() potentially allocates memory, because it has
+ to construct a fresh pathname. If this is a problem because your program
+ calls relocate() frequently, think about caching the result. Or free the
+ return value if it was different from the argument pathname. */
/* Convenience function:
Computes the current installation prefix, based on the original
installation prefix, the original installation directory of a particular
- file, and the current pathname of this file. Returns NULL upon failure. */
-extern const char * compute_curr_prefix (const char *orig_installprefix,
- const char *orig_installdir,
- const char *curr_pathname);
+ file, and the current pathname of this file.
+ Returns it, freshly allocated. Returns NULL upon failure. */
+extern char * compute_curr_prefix (const char *orig_installprefix,
+ const char *orig_installdir,
+ const char *curr_pathname);
#else
diff --git a/intl/setlocale.c b/intl/setlocale.c
new file mode 100644
index 00000000..2a5e2605
--- /dev/null
+++ b/intl/setlocale.c
@@ -0,0 +1,1015 @@
+/* setlocale() function that respects the locale chosen by the user.
+ Copyright (C) 2009 Free Software Foundation, Inc.
+ Written by Bruno Haible <bruno@clisp.org>, 2009.
+
+ 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., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301,
+ USA. */
+
+#ifdef HAVE_CONFIG_H
+# include <config.h>
+#endif
+
+/* Override setlocale() and newlocale() so that when the default locale is
+ requested (locale = "") and no relevant environment variable is set, the
+ locale chosen by the user is used.
+ This matters on MacOS X 10 and Windows.
+ See the comments in localename.c, function gl_locale_name_default. */
+
+#include <locale.h>
+#include <stdlib.h>
+#include <string.h>
+
+/* When building a DLL, we must export some functions. Note that because
+ the functions are only defined for binary backward compatibility, we
+ don't need to use __declspec(dllimport) in any case. */
+#if HAVE_VISIBILITY && BUILDING_DLL
+# define DLL_EXPORTED __attribute__((__visibility__("default")))
+#elif defined _MSC_VER && BUILDING_DLL
+# define DLL_EXPORTED __declspec(dllexport)
+#else
+# define DLL_EXPORTED
+#endif
+
+#include "gettextP.h"
+
+#if (defined __APPLE__ && defined __MACH__) || defined _WIN32 || defined __WIN32__ || defined __CYGWIN__
+
+# undef setlocale
+# undef newlocale
+
+/* Return string representation of locale category CATEGORY. */
+static const char *
+category_to_name (int category)
+{
+ const char *retval;
+
+ switch (category)
+ {
+ case LC_COLLATE:
+ retval = "LC_COLLATE";
+ break;
+ case LC_CTYPE:
+ retval = "LC_CTYPE";
+ break;
+ case LC_MONETARY:
+ retval = "LC_MONETARY";
+ break;
+ case LC_NUMERIC:
+ retval = "LC_NUMERIC";
+ break;
+ case LC_TIME:
+ retval = "LC_TIME";
+ break;
+ case LC_MESSAGES:
+ retval = "LC_MESSAGES";
+ break;
+ default:
+ /* If you have a better idea for a default value let me know. */
+ retval = "LC_XXX";
+ }
+
+ return retval;
+}
+
+# if (defined _WIN32 || defined __WIN32__) && ! defined __CYGWIN__
+
+/* The native Win32 setlocale() function expects locale names of the form
+ "German" or "German_Germany" or "DEU", but not "de" or "de_DE". We need
+ to convert the names from the form with ISO 639 language code and ISO 3166
+ country code to the form with English names or with three-letter identifier.
+ The three-letter identifiers known by a Windows XP SP2 or SP3 are:
+ AFK Afrikaans_South Africa.1252
+ ARA Arabic_Saudi Arabia.1256
+ ARB Arabic_Lebanon.1256
+ ARE Arabic_Egypt.1256
+ ARG Arabic_Algeria.1256
+ ARH Arabic_Bahrain.1256
+ ARI Arabic_Iraq.1256
+ ARJ Arabic_Jordan.1256
+ ARK Arabic_Kuwait.1256
+ ARL Arabic_Libya.1256
+ ARM Arabic_Morocco.1256
+ ARO Arabic_Oman.1256
+ ARQ Arabic_Qatar.1256
+ ARS Arabic_Syria.1256
+ ART Arabic_Tunisia.1256
+ ARU Arabic_U.A.E..1256
+ ARY Arabic_Yemen.1256
+ AZE Azeri (Latin)_Azerbaijan.1254
+ BEL Belarusian_Belarus.1251
+ BGR Bulgarian_Bulgaria.1251
+ BSB Bosnian_Bosnia and Herzegovina.1250
+ BSC Bosnian (Cyrillic)_Bosnia and Herzegovina.1250 (wrong encoding!)
+ CAT Catalan_Spain.1252
+ CHH Chinese_Hong Kong S.A.R..950
+ CHI Chinese_Singapore.936
+ CHS Chinese_People's Republic of China.936
+ CHT Chinese_Taiwan.950
+ CSY Czech_Czech Republic.1250
+ CYM Welsh_United Kingdom.1252
+ DAN Danish_Denmark.1252
+ DEA German_Austria.1252
+ DEC German_Liechtenstein.1252
+ DEL German_Luxembourg.1252
+ DES German_Switzerland.1252
+ DEU German_Germany.1252
+ ELL Greek_Greece.1253
+ ENA English_Australia.1252
+ ENB English_Caribbean.1252
+ ENC English_Canada.1252
+ ENG English_United Kingdom.1252
+ ENI English_Ireland.1252
+ ENJ English_Jamaica.1252
+ ENL English_Belize.1252
+ ENP English_Republic of the Philippines.1252
+ ENS English_South Africa.1252
+ ENT English_Trinidad and Tobago.1252
+ ENU English_United States.1252
+ ENW English_Zimbabwe.1252
+ ENZ English_New Zealand.1252
+ ESA Spanish_Panama.1252
+ ESB Spanish_Bolivia.1252
+ ESC Spanish_Costa Rica.1252
+ ESD Spanish_Dominican Republic.1252
+ ESE Spanish_El Salvador.1252
+ ESF Spanish_Ecuador.1252
+ ESG Spanish_Guatemala.1252
+ ESH Spanish_Honduras.1252
+ ESI Spanish_Nicaragua.1252
+ ESL Spanish_Chile.1252
+ ESM Spanish_Mexico.1252
+ ESN Spanish_Spain.1252
+ ESO Spanish_Colombia.1252
+ ESP Spanish_Spain.1252
+ ESR Spanish_Peru.1252
+ ESS Spanish_Argentina.1252
+ ESU Spanish_Puerto Rico.1252
+ ESV Spanish_Venezuela.1252
+ ESY Spanish_Uruguay.1252
+ ESZ Spanish_Paraguay.1252
+ ETI Estonian_Estonia.1257
+ EUQ Basque_Spain.1252
+ FAR Farsi_Iran.1256
+ FIN Finnish_Finland.1252
+ FOS Faroese_Faroe Islands.1252
+ FPO Filipino_Philippines.1252
+ FRA French_France.1252
+ FRB French_Belgium.1252
+ FRC French_Canada.1252
+ FRL French_Luxembourg.1252
+ FRM French_Principality of Monaco.1252
+ FRS French_Switzerland.1252
+ FYN Frisian_Netherlands.1252
+ GLC Galician_Spain.1252
+ HEB Hebrew_Israel.1255
+ HRB Croatian_Bosnia and Herzegovina.1250
+ HRV Croatian_Croatia.1250
+ HUN Hungarian_Hungary.1250
+ IND Indonesian_Indonesia.1252
+ IRE Irish_Ireland.1252
+ ISL Icelandic_Iceland.1252
+ ITA Italian_Italy.1252
+ ITS Italian_Switzerland.1252
+ IUK Inuktitut (Latin)_Canada.1252
+ JPN Japanese_Japan.932
+ KKZ Kazakh_Kazakhstan.1251
+ KOR Korean_Korea.949
+ KYR Kyrgyz_Kyrgyzstan.1251
+ LBX Luxembourgish_Luxembourg.1252
+ LTH Lithuanian_Lithuania.1257
+ LVI Latvian_Latvia.1257
+ MKI FYRO Macedonian_Former Yugoslav Republic of Macedonia.1251
+ MON Mongolian_Mongolia.1251
+ MPD Mapudungun_Chile.1252
+ MSB Malay_Brunei Darussalam.1252
+ MSL Malay_Malaysia.1252
+ MWK Mohawk_Canada.1252
+ NLB Dutch_Belgium.1252
+ NLD Dutch_Netherlands.1252
+ NON Norwegian-Nynorsk_Norway.1252
+ NOR Norwegian (Bokmål)_Norway.1252
+ NSO Northern Sotho_South Africa.1252
+ PLK Polish_Poland.1250
+ PTB Portuguese_Brazil.1252
+ PTG Portuguese_Portugal.1252
+ QUB Quechua_Bolivia.1252
+ QUE Quechua_Ecuador.1252
+ QUP Quechua_Peru.1252
+ RMC Romansh_Switzerland.1252
+ ROM Romanian_Romania.1250
+ RUS Russian_Russia.1251
+ SKY Slovak_Slovakia.1250
+ SLV Slovenian_Slovenia.1250
+ SMA Sami (Southern)_Norway.1252
+ SMB Sami (Southern)_Sweden.1252
+ SME Sami (Northern)_Norway.1252
+ SMF Sami (Northern)_Sweden.1252
+ SMG Sami (Northern)_Finland.1252
+ SMJ Sami (Lule)_Norway.1252
+ SMK Sami (Lule)_Sweden.1252
+ SMN Sami (Inari)_Finland.1252
+ SMS Sami (Skolt)_Finland.1252
+ SQI Albanian_Albania.1250
+ SRB Serbian (Cyrillic)_Serbia and Montenegro.1251
+ SRL Serbian (Latin)_Serbia and Montenegro.1250
+ SRN Serbian (Cyrillic)_Bosnia and Herzegovina.1251
+ SRS Serbian (Latin)_Bosnia and Herzegovina.1250
+ SVE Swedish_Sweden.1252
+ SVF Swedish_Finland.1252
+ SWK Swahili_Kenya.1252
+ THA Thai_Thailand.874
+ TRK Turkish_Turkey.1254
+ TSN Tswana_South Africa.1252
+ TTT Tatar_Russia.1251
+ UKR Ukrainian_Ukraine.1251
+ URD Urdu_Islamic Republic of Pakistan.1256
+ USA English_United States.1252
+ UZB Uzbek (Latin)_Uzbekistan.1254
+ VIT Vietnamese_Viet Nam.1258
+ XHO Xhosa_South Africa.1252
+ ZHH Chinese_Hong Kong S.A.R..950
+ ZHI Chinese_Singapore.936
+ ZHM Chinese_Macau S.A.R..950
+ ZUL Zulu_South Africa.1252
+ */
+
+/* Table from ISO 639 language code, optionally with country or script suffix,
+ to English name.
+ Keep in sync with the gl_locale_name_from_win32_LANGID function in
+ localename.c! */
+struct table_entry
+{
+ const char *code;
+ const char *english;
+};
+static const struct table_entry language_table[] =
+ {
+ { "af", "Afrikaans" },
+ { "am", "Amharic" },
+ { "ar", "Arabic" },
+ { "arn", "Mapudungun" },
+ { "as", "Assamese" },
+ { "az@cyrillic", "Azeri (Cyrillic)" },
+ { "az@latin", "Azeri (Latin)" },
+ { "ba", "Bashkir" },
+ { "be", "Belarusian" },
+ { "ber", "Tamazight" },
+ { "ber@arabic", "Tamazight (Arabic)" },
+ { "ber@latin", "Tamazight (Latin)" },
+ { "bg", "Bulgarian" },
+ { "bin", "Edo" },
+ { "bn", "Bengali" },
+ { "bn_BD", "Bengali (Bangladesh)" },
+ { "bn_IN", "Bengali (India)" },
+ { "bnt", "Sutu" },
+ { "bo", "Tibetan" },
+ { "br", "Breton" },
+ { "bs", "BSB" }, /* "Bosnian (Latin)" */
+ { "bs@cyrillic", "BSC" }, /* Bosnian (Cyrillic) */
+ { "ca", "Catalan" },
+ { "chr", "Cherokee" },
+ { "co", "Corsican" },
+ { "cpe", "Hawaiian" },
+ { "cs", "Czech" },
+ { "cy", "Welsh" },
+ { "da", "Danish" },
+ { "de", "German" },
+ { "dsb", "Lower Sorbian" },
+ { "dv", "Divehi" },
+ { "el", "Greek" },
+ { "en", "English" },
+ { "es", "Spanish" },
+ { "et", "Estonian" },
+ { "eu", "Basque" },
+ { "fa", "Farsi" },
+ { "ff", "Fulfulde" },
+ { "fi", "Finnish" },
+ { "fo", "Faroese" }, /* "Faeroese" does not work */
+ { "fr", "French" },
+ { "fy", "Frisian" },
+ { "ga", "IRE" }, /* Gaelic (Ireland) */
+ { "gd", "Gaelic (Scotland)" },
+ { "gd", "Scottish Gaelic" },
+ { "gl", "Galician" },
+ { "gn", "Guarani" },
+ { "gsw", "Alsatian" },
+ { "gu", "Gujarati" },
+ { "ha", "Hausa" },
+ { "he", "Hebrew" },
+ { "hi", "Hindi" },
+ { "hr", "Croatian" },
+ { "hsb", "Upper Sorbian" },
+ { "hu", "Hungarian" },
+ { "hy", "Armenian" },
+ { "id", "Indonesian" },
+ { "ig", "Igbo" },
+ { "ii", "Yi" },
+ { "is", "Icelandic" },
+ { "it", "Italian" },
+ { "iu", "IUK" }, /* Inuktitut */
+ { "ja", "Japanese" },
+ { "ka", "Georgian" },
+ { "kk", "Kazakh" },
+ { "kl", "Greenlandic" },
+ { "km", "Cambodian" },
+ { "km", "Khmer" },
+ { "kn", "Kannada" },
+ { "ko", "Korean" },
+ { "kok", "Konkani" },
+ { "kr", "Kanuri" },
+ { "ks", "Kashmiri" },
+ { "ks_IN", "Kashmiri_India" },
+ { "ks_PK", "Kashmiri (Arabic)_Pakistan" },
+ { "ky", "Kyrgyz" },
+ { "la", "Latin" },
+ { "lb", "Luxembourgish" },
+ { "lo", "Lao" },
+ { "lt", "Lithuanian" },
+ { "lv", "Latvian" },
+ { "mi", "Maori" },
+ { "mk", "FYRO Macedonian" },
+ { "mk", "Macedonian" },
+ { "ml", "Malayalam" },
+ { "mn", "Mongolian" },
+ { "mni", "Manipuri" },
+ { "moh", "Mohawk" },
+ { "mr", "Marathi" },
+ { "ms", "Malay" },
+ { "mt", "Maltese" },
+ { "my", "Burmese" },
+ { "nb", "NOR" }, /* Norwegian Bokmål */
+ { "ne", "Nepali" },
+ { "nic", "Ibibio" },
+ { "nl", "Dutch" },
+ { "nn", "NON" }, /* Norwegian Nynorsk */
+ { "no", "Norwegian" },
+ { "nso", "Northern Sotho" },
+ { "nso", "Sepedi" },
+ { "oc", "Occitan" },
+ { "om", "Oromo" },
+ { "or", "Oriya" },
+ { "pa", "Punjabi" },
+ { "pap", "Papiamentu" },
+ { "pl", "Polish" },
+ { "prs", "Dari" },
+ { "ps", "Pashto" },
+ { "pt", "Portuguese" },
+ { "qu", "Quechua" },
+ { "qut", "K'iche'" },
+ { "rm", "Romansh" },
+ { "ro", "Romanian" },
+ { "ru", "Russian" },
+ { "rw", "Kinyarwanda" },
+ { "sa", "Sanskrit" },
+ { "sah", "Yakut" },
+ { "sd", "Sindhi" },
+ { "se", "Sami (Northern)" },
+ { "se", "Northern Sami" },
+ { "si", "Sinhalese" },
+ { "sk", "Slovak" },
+ { "sl", "Slovenian" },
+ { "sma", "Sami (Southern)" },
+ { "sma", "Southern Sami" },
+ { "smj", "Sami (Lule)" },
+ { "smj", "Lule Sami" },
+ { "smn", "Sami (Inari)" },
+ { "smn", "Inari Sami" },
+ { "sms", "Sami (Skolt)" },
+ { "sms", "Skolt Sami" },
+ { "so", "Somali" },
+ { "sq", "Albanian" },
+ { "sr", "Serbian (Latin)" },
+ { "sr@cyrillic", "SRB" }, /* Serbian (Cyrillic) */
+ { "sw", "Swahili" },
+ { "syr", "Syriac" },
+ { "ta", "Tamil" },
+ { "te", "Telugu" },
+ { "tg", "Tajik" },
+ { "th", "Thai" },
+ { "ti", "Tigrinya" },
+ { "tk", "Turkmen" },
+ { "tl", "Filipino" },
+ { "tn", "Tswana" },
+ { "tr", "Turkish" },
+ { "ts", "Tsonga" },
+ { "tt", "Tatar" },
+ { "ug", "Uighur" },
+ { "uk", "Ukrainian" },
+ { "ur", "Urdu" },
+ { "uz", "Uzbek" },
+ { "uz", "Uzbek (Latin)" },
+ { "uz@cyrillic", "Uzbek (Cyrillic)" },
+ { "ve", "Venda" },
+ { "vi", "Vietnamese" },
+ { "wen", "Sorbian" },
+ { "wo", "Wolof" },
+ { "xh", "Xhosa" },
+ { "yi", "Yiddish" },
+ { "yo", "Yoruba" },
+ { "zh", "Chinese" },
+ { "zu", "Zulu" }
+ };
+
+/* Table from ISO 3166 country code to English name.
+ Keep in sync with the gl_locale_name_from_win32_LANGID function in
+ localename.c! */
+static const struct table_entry country_table[] =
+ {
+ { "AE", "U.A.E." },
+ { "AF", "Afghanistan" },
+ { "AL", "Albania" },
+ { "AM", "Armenia" },
+ { "AN", "Netherlands Antilles" },
+ { "AR", "Argentina" },
+ { "AT", "Austria" },
+ { "AU", "Australia" },
+ { "AZ", "Azerbaijan" },
+ { "BA", "Bosnia and Herzegovina" },
+ { "BD", "Bangladesh" },
+ { "BE", "Belgium" },
+ { "BG", "Bulgaria" },
+ { "BH", "Bahrain" },
+ { "BN", "Brunei Darussalam" },
+ { "BO", "Bolivia" },
+ { "BR", "Brazil" },
+ { "BT", "Bhutan" },
+ { "BY", "Belarus" },
+ { "BZ", "Belize" },
+ { "CA", "Canada" },
+ { "CG", "Congo" },
+ { "CH", "Switzerland" },
+ { "CI", "Cote d'Ivoire" },
+ { "CL", "Chile" },
+ { "CM", "Cameroon" },
+ { "CN", "People's Republic of China" },
+ { "CO", "Colombia" },
+ { "CR", "Costa Rica" },
+ { "CS", "Serbia and Montenegro" },
+ { "CZ", "Czech Republic" },
+ { "DE", "Germany" },
+ { "DK", "Denmark" },
+ { "DO", "Dominican Republic" },
+ { "DZ", "Algeria" },
+ { "EC", "Ecuador" },
+ { "EE", "Estonia" },
+ { "EG", "Egypt" },
+ { "ER", "Eritrea" },
+ { "ES", "Spain" },
+ { "ET", "Ethiopia" },
+ { "FI", "Finland" },
+ { "FO", "Faroe Islands" },
+ { "FR", "France" },
+ { "GB", "United Kingdom" },
+ { "GD", "Caribbean" },
+ { "GE", "Georgia" },
+ { "GL", "Greenland" },
+ { "GR", "Greece" },
+ { "GT", "Guatemala" },
+ { "HK", "Hong Kong" },
+ { "HK", "Hong Kong S.A.R." },
+ { "HN", "Honduras" },
+ { "HR", "Croatia" },
+ { "HT", "Haiti" },
+ { "HU", "Hungary" },
+ { "ID", "Indonesia" },
+ { "IE", "Ireland" },
+ { "IL", "Israel" },
+ { "IN", "India" },
+ { "IQ", "Iraq" },
+ { "IR", "Iran" },
+ { "IS", "Iceland" },
+ { "IT", "Italy" },
+ { "JM", "Jamaica" },
+ { "JO", "Jordan" },
+ { "JP", "Japan" },
+ { "KE", "Kenya" },
+ { "KG", "Kyrgyzstan" },
+ { "KH", "Cambodia" },
+ { "KR", "South Korea" },
+ { "KW", "Kuwait" },
+ { "KZ", "Kazakhstan" },
+ { "LA", "Laos" },
+ { "LB", "Lebanon" },
+ { "LI", "Liechtenstein" },
+ { "LK", "Sri Lanka" },
+ { "LT", "Lithuania" },
+ { "LU", "Luxembourg" },
+ { "LV", "Latvia" },
+ { "LY", "Libya" },
+ { "MA", "Morocco" },
+ { "MC", "Principality of Monaco" },
+ { "MD", "Moldava" },
+ { "MD", "Moldova" },
+ { "ME", "Montenegro" },
+ { "MK", "Former Yugoslav Republic of Macedonia" },
+ { "ML", "Mali" },
+ { "MM", "Myanmar" },
+ { "MN", "Mongolia" },
+ { "MO", "Macau S.A.R." },
+ { "MT", "Malta" },
+ { "MV", "Maldives" },
+ { "MX", "Mexico" },
+ { "MY", "Malaysia" },
+ { "NG", "Nigeria" },
+ { "NI", "Nicaragua" },
+ { "NL", "Netherlands" },
+ { "NO", "Norway" },
+ { "NP", "Nepal" },
+ { "NZ", "New Zealand" },
+ { "OM", "Oman" },
+ { "PA", "Panama" },
+ { "PE", "Peru" },
+ { "PH", "Philippines" },
+ { "PK", "Islamic Republic of Pakistan" },
+ { "PL", "Poland" },
+ { "PR", "Puerto Rico" },
+ { "PT", "Portugal" },
+ { "PY", "Paraguay" },
+ { "QA", "Qatar" },
+ { "RE", "Reunion" },
+ { "RO", "Romania" },
+ { "RS", "Serbia" },
+ { "RU", "Russia" },
+ { "RW", "Rwanda" },
+ { "SA", "Saudi Arabia" },
+ { "SE", "Sweden" },
+ { "SG", "Singapore" },
+ { "SI", "Slovenia" },
+ { "SK", "Slovak" },
+ { "SN", "Senegal" },
+ { "SO", "Somalia" },
+ { "SR", "Suriname" },
+ { "SV", "El Salvador" },
+ { "SY", "Syria" },
+ { "TH", "Thailand" },
+ { "TJ", "Tajikistan" },
+ { "TM", "Turkmenistan" },
+ { "TN", "Tunisia" },
+ { "TR", "Turkey" },
+ { "TT", "Trinidad and Tobago" },
+ { "TW", "Taiwan" },
+ { "TZ", "Tanzania" },
+ { "UA", "Ukraine" },
+ { "US", "United States" },
+ { "UY", "Uruguay" },
+ { "VA", "Vatican" },
+ { "VE", "Venezuela" },
+ { "VN", "Viet Nam" },
+ { "YE", "Yemen" },
+ { "ZA", "South Africa" },
+ { "ZW", "Zimbabwe" }
+ };
+
+/* Given a string STRING, find the set of indices i such that TABLE[i].code is
+ the given STRING. It is a range [lo,hi-1]. */
+typedef struct { size_t lo; size_t hi; } range_t;
+static void
+search (const struct table_entry *table, size_t table_size, const char *string,
+ range_t *result)
+{
+ /* The table is sorted. Perform a binary search. */
+ size_t hi = table_size;
+ size_t lo = 0;
+ while (lo < hi)
+ {
+ /* Invariant:
+ for i < lo, strcmp (table[i].code, string) < 0,
+ for i >= hi, strcmp (table[i].code, string) > 0. */
+ size_t mid = (hi + lo) >> 1; /* >= lo, < hi */
+ int cmp = strcmp (table[mid].code, string);
+ if (cmp < 0)
+ lo = mid + 1;
+ else if (cmp > 0)
+ hi = mid;
+ else
+ {
+ /* Found an i with
+ strcmp (language_table[i].code, string) == 0.
+ Find the entire interval of such i. */
+ {
+ size_t i;
+
+ for (i = mid; i > lo; )
+ {
+ i--;
+ if (strcmp (table[i].code, string) < 0)
+ {
+ lo = i + 1;
+ break;
+ }
+ }
+ }
+ {
+ size_t i;
+
+ for (i = mid; i < hi; i++)
+ {
+ if (strcmp (table[i].code, string) > 0)
+ {
+ hi = i;
+ break;
+ }
+ }
+ }
+ /* The set of i with
+ strcmp (language_table[i].code, string) == 0
+ is the interval [lo, hi-1]. */
+ break;
+ }
+ }
+ result->lo = lo;
+ result->hi = hi;
+}
+
+/* Like setlocale, but accept also locale names in the form ll or ll_CC,
+ where ll is an ISO 639 language code and CC is an ISO 3166 country code. */
+static char *
+setlocale_unixlike (int category, const char *locale)
+{
+ char *result;
+ char llCC_buf[64];
+ char ll_buf[64];
+ char CC_buf[64];
+
+ /* First, try setlocale with the original argument unchanged. */
+ result = setlocale (category, locale);
+ if (result != NULL)
+ return result;
+
+ /* Otherwise, assume the argument is in the form
+ language[_territory][.codeset][@modifier]
+ and try to map it using the tables. */
+ if (strlen (locale) < sizeof (llCC_buf))
+ {
+ /* Second try: Remove the codeset part. */
+ {
+ const char *p = locale;
+ char *q = llCC_buf;
+
+ /* Copy the part before the dot. */
+ for (; *p != '\0' && *p != '.'; p++, q++)
+ *q = *p;
+ if (*p == '.')
+ /* Skip the part up to the '@', if any. */
+ for (; *p != '\0' && *p != '@'; p++)
+ ;
+ /* Copy the part starting with '@', if any. */
+ for (; *p != '\0'; p++, q++)
+ *q = *p;
+ *q = '\0';
+ }
+ /* llCC_buf now contains
+ language[_territory][@modifier]
+ */
+ if (strcmp (llCC_buf, locale) != 0)
+ {
+ result = setlocale (category, llCC_buf);
+ if (result != NULL)
+ return result;
+ }
+ /* Look it up in language_table. */
+ {
+ range_t range;
+ size_t i;
+
+ search (language_table,
+ sizeof (language_table) / sizeof (language_table[0]),
+ llCC_buf,
+ &range);
+
+ for (i = range.lo; i < range.hi; i++)
+ {
+ /* Try the replacement in language_table[i]. */
+ result = setlocale (category, language_table[i].english);
+ if (result != NULL)
+ return result;
+ }
+ }
+ /* Split language[_territory][@modifier]
+ into ll_buf = language[@modifier]
+ and CC_buf = territory
+ */
+ {
+ const char *underscore = strchr (llCC_buf, '_');
+ if (underscore != NULL)
+ {
+ const char *territory_start = underscore + 1;
+ const char *territory_end = strchr (territory_start, '@');
+ if (territory_end == NULL)
+ territory_end = territory_start + strlen (territory_start);
+
+ memcpy (ll_buf, llCC_buf, underscore - llCC_buf);
+ strcpy (ll_buf + (underscore - llCC_buf), territory_end);
+
+ memcpy (CC_buf, territory_start, territory_end - territory_start);
+ CC_buf[territory_end - territory_start] = '\0';
+
+ {
+ /* Look up ll_buf in language_table
+ and CC_buf in country_table. */
+ range_t language_range;
+
+ search (language_table,
+ sizeof (language_table) / sizeof (language_table[0]),
+ ll_buf,
+ &language_range);
+ if (language_range.lo < language_range.hi)
+ {
+ range_t country_range;
+
+ search (country_table,
+ sizeof (country_table) / sizeof (country_table[0]),
+ CC_buf,
+ &country_range);
+ if (country_range.lo < country_range.hi)
+ {
+ size_t i;
+ size_t j;
+
+ for (i = language_range.lo; i < language_range.hi; i++)
+ for (j = country_range.lo; j < country_range.hi; j++)
+ {
+ /* Concatenate the replacements. */
+ const char *part1 = language_table[i].english;
+ size_t part1_len = strlen (part1);
+ const char *part2 = country_table[j].english;
+ size_t part2_len = strlen (part2) + 1;
+ char buf[64+64];
+
+ if (!(part1_len + 1 + part2_len <= sizeof (buf)))
+ abort ();
+ memcpy (buf, part1, part1_len);
+ buf[part1_len] = '_';
+ memcpy (buf + part1_len + 1, part2, part2_len);
+
+ /* Try the concatenated replacements. */
+ result = setlocale (category, buf);
+ if (result != NULL)
+ return result;
+ }
+ }
+
+ /* Try omitting the country entirely. This may set a locale
+ corresponding to the wrong country, but is better than
+ failing entirely. */
+ {
+ size_t i;
+
+ for (i = language_range.lo; i < language_range.hi; i++)
+ {
+ /* Try only the language replacement. */
+ result =
+ setlocale (category, language_table[i].english);
+ if (result != NULL)
+ return result;
+ }
+ }
+ }
+ }
+ }
+ }
+ }
+
+ /* Failed. */
+ return NULL;
+}
+
+# else
+# define setlocale_unixlike setlocale
+# endif
+
+# if LC_MESSAGES == 1729
+
+/* The system does not store an LC_MESSAGES locale category. Do it here. */
+static char lc_messages_name[64] = "C";
+
+/* Like setlocale, but support also LC_MESSAGES. */
+static char *
+setlocale_single (int category, const char *locale)
+{
+ if (category == LC_MESSAGES)
+ {
+ if (locale != NULL)
+ {
+ lc_messages_name[sizeof (lc_messages_name) - 1] = '\0';
+ strncpy (lc_messages_name, locale, sizeof (lc_messages_name) - 1);
+ }
+ return lc_messages_name;
+ }
+ else
+ return setlocale_unixlike (category, locale);
+}
+
+# else
+# define setlocale_single setlocale_unixlike
+# endif
+
+DLL_EXPORTED
+char *
+libintl_setlocale (int category, const char *locale)
+{
+ if (locale != NULL && locale[0] == '\0')
+ {
+ /* A request to the set the current locale to the default locale. */
+ if (category == LC_ALL)
+ {
+ /* Set LC_CTYPE first. Then the other categories. */
+ static int const categories[] =
+ {
+ LC_NUMERIC,
+ LC_TIME,
+ LC_COLLATE,
+ LC_MONETARY,
+ LC_MESSAGES
+ };
+ char *saved_locale;
+ const char *base_name;
+ unsigned int i;
+
+ /* Back up the old locale, in case one of the steps fails. */
+ saved_locale = setlocale (LC_ALL, NULL);
+ if (saved_locale == NULL)
+ return NULL;
+ saved_locale = strdup (saved_locale);
+ if (saved_locale == NULL)
+ return NULL;
+
+ /* Set LC_CTYPE category. Set all other categories (except possibly
+ LC_MESSAGES) to the same value in the same call; this is likely to
+ save calls. */
+ base_name =
+ gl_locale_name_environ (LC_CTYPE, category_to_name (LC_CTYPE));
+ if (base_name == NULL)
+ base_name = gl_locale_name_default ();
+
+ if (setlocale_unixlike (LC_ALL, base_name) == NULL)
+ goto fail;
+
+ for (i = 0; i < sizeof (categories) / sizeof (categories[0]); i++)
+ {
+ int cat = categories[i];
+ const char *name;
+
+ name = gl_locale_name_environ (cat, category_to_name (cat));
+ if (name == NULL)
+ name = gl_locale_name_default ();
+
+ /* If name is the same as base_name, it has already been set
+ through the setlocale call before the loop. */
+ if (strcmp (name, base_name) != 0
+# if LC_MESSAGES == 1729
+ || cat == LC_MESSAGES
+# endif
+ )
+ if (setlocale_single (cat, name) == NULL)
+ goto fail;
+ }
+
+ /* All steps were successful. */
+ free (saved_locale);
+ return setlocale (LC_ALL, NULL);
+
+ fail:
+ if (saved_locale[0] != '\0') /* don't risk an endless recursion */
+ setlocale (LC_ALL, saved_locale);
+ free (saved_locale);
+ return NULL;
+ }
+ else
+ {
+ const char *name =
+ gl_locale_name_environ (category, category_to_name (category));
+ if (name == NULL)
+ name = gl_locale_name_default ();
+
+ return setlocale_single (category, name);
+ }
+ }
+ else
+ return setlocale_single (category, locale);
+}
+
+# if HAVE_NEWLOCALE
+
+DLL_EXPORTED
+locale_t
+libintl_newlocale (int category_mask, const char *locale, locale_t base)
+{
+ if (category_mask != 0 && locale != NULL && locale[0] == '\0')
+ {
+ /* A request to construct a locale_t object that refers to the default
+ locale. */
+
+ /* Set LC_CTYPE first. Then the other categories. */
+ static struct { int cat; int mask; } const categories[] =
+ {
+ { LC_CTYPE, LC_CTYPE_MASK },
+ { LC_NUMERIC, LC_NUMERIC_MASK },
+ { LC_TIME, LC_TIME_MASK },
+ { LC_COLLATE, LC_COLLATE_MASK },
+ { LC_MONETARY, LC_MONETARY_MASK },
+ { LC_MESSAGES, LC_MESSAGES_MASK }
+ };
+
+ locale_t orig_base = base;
+
+ if ((LC_ALL_MASK & ~category_mask) == 0)
+ {
+ const char *base_name;
+ unsigned int i;
+
+ /* Set LC_CTYPE category. Set all other categories (except possibly
+ LC_MESSAGES) to the same value in the same call; this is likely to
+ save calls. */
+ base_name =
+ gl_locale_name_environ (LC_CTYPE, category_to_name (LC_CTYPE));
+ if (base_name == NULL)
+ base_name = gl_locale_name_default ();
+
+ base = newlocale (LC_ALL_MASK, base_name, base);
+ if (base == NULL)
+ return NULL;
+
+ for (i = 1; i < sizeof (categories) / sizeof (categories[0]); i++)
+ {
+ int category = categories[i].cat;
+ int category_mask = categories[i].mask;
+ const char *name;
+
+ name =
+ gl_locale_name_environ (category, category_to_name (category));
+ if (name == NULL)
+ name = gl_locale_name_default ();
+
+ /* If name is the same as base_name, it has already been set
+ through the setlocale call before the loop. */
+ if (strcmp (name, base_name) != 0)
+ {
+ locale_t copy = newlocale (category_mask, name, base);
+ if (copy == NULL)
+ goto fail;
+ /* No need to call freelocale (base) if copy != base; the
+ newlocale function already takes care of doing it. */
+ base = copy;
+ }
+ }
+ }
+ else
+ {
+ unsigned int i;
+
+ for (i = 0; i < sizeof (categories) / sizeof (categories[0]); i++)
+ {
+ int cat_mask = categories[i].mask;
+
+ if ((category_mask & cat_mask) != 0)
+ {
+ int cat = categories[i].cat;
+ const char *name;
+ locale_t copy;
+
+ name = gl_locale_name_environ (cat, category_to_name (cat));
+ if (name == NULL)
+ name = gl_locale_name_default ();
+
+ copy = newlocale (cat_mask, name, base);
+ if (copy == NULL)
+ goto fail;
+ /* No need to call freelocale (base) if copy != base; the
+ newlocale function already takes care of doing it. */
+ base = copy;
+ }
+ }
+ }
+
+ /* All steps were successful. */
+ return base;
+
+ fail:
+ if (base != NULL && orig_base == NULL)
+ {
+ int saved_errno = errno;
+ freelocale (base);
+ errno = saved_errno;
+ }
+ return NULL;
+ }
+ else
+ return newlocale (category_mask, locale, base);
+}
+
+# endif
+
+#endif
diff --git a/intl/threadlib.c b/intl/threadlib.c
new file mode 100644
index 00000000..cb4fe4f0
--- /dev/null
+++ b/intl/threadlib.c
@@ -0,0 +1,75 @@
+/* Multithreading primitives.
+ Copyright (C) 2005-2009 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., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301,
+ USA. */
+
+/* Written by Bruno Haible <bruno@clisp.org>, 2005. */
+
+#include <config.h>
+
+/* ========================================================================= */
+
+#if USE_POSIX_THREADS
+
+/* Use the POSIX threads library. */
+
+# include <pthread.h>
+# include <stdlib.h>
+
+# if PTHREAD_IN_USE_DETECTION_HARD
+
+/* The function to be executed by a dummy thread. */
+static void *
+dummy_thread_func (void *arg)
+{
+ return arg;
+}
+
+int
+glthread_in_use (void)
+{
+ static int tested;
+ static int result; /* 1: linked with -lpthread, 0: only with libc */
+
+ if (!tested)
+ {
+ pthread_t thread;
+
+ if (pthread_create (&thread, NULL, dummy_thread_func, NULL) != 0)
+ /* Thread creation failed. */
+ result = 0;
+ else
+ {
+ /* Thread creation works. */
+ void *retval;
+ if (pthread_join (thread, &retval) != 0)
+ abort ();
+ result = 1;
+ }
+ tested = 1;
+ }
+ return result;
+}
+
+# endif
+
+#endif
+
+/* ========================================================================= */
+
+/* This declaration is solely to ensure that after preprocessing
+ this file is never empty. */
+typedef int dummy;
diff --git a/intl/tsearch.c b/intl/tsearch.c
index d549dd45..5f2da1b4 100644
--- a/intl/tsearch.c
+++ b/intl/tsearch.c
@@ -179,7 +179,7 @@ check_tree (node root)
edges between GPARENTP and ROOTP. */
static void
maybe_split_for_insert (node *rootp, node *parentp, node *gparentp,
- int p_r, int gp_r, int mode)
+ int p_r, int gp_r, int mode)
{
node root = *rootp;
node *rp, *lp;
@@ -193,67 +193,67 @@ maybe_split_for_insert (node *rootp, node *parentp, node *gparentp,
/* This node becomes red, its successors black. */
root->red = 1;
if (*rp)
- (*rp)->red = 0;
+ (*rp)->red = 0;
if (*lp)
- (*lp)->red = 0;
+ (*lp)->red = 0;
/* If the parent of this node is also red, we have to do
- rotations. */
+ rotations. */
if (parentp != NULL && (*parentp)->red)
- {
- node gp = *gparentp;
- node p = *parentp;
- /* There are two main cases:
- 1. The edge types (left or right) of the two red edges differ.
- 2. Both red edges are of the same type.
- There exist two symmetries of each case, so there is a total of
- 4 cases. */
- if ((p_r > 0) != (gp_r > 0))
- {
- /* Put the child at the top of the tree, with its parent
- and grandparent as successors. */
- p->red = 1;
- gp->red = 1;
- root->red = 0;
- if (p_r < 0)
- {
- /* Child is left of parent. */
- p->left = *rp;
- *rp = p;
- gp->right = *lp;
- *lp = gp;
- }
- else
- {
- /* Child is right of parent. */
- p->right = *lp;
- *lp = p;
- gp->left = *rp;
- *rp = gp;
- }
- *gparentp = root;
- }
- else
- {
- *gparentp = *parentp;
- /* Parent becomes the top of the tree, grandparent and
- child are its successors. */
- p->red = 0;
- gp->red = 1;
- if (p_r < 0)
- {
- /* Left edges. */
- gp->left = p->right;
- p->right = gp;
- }
- else
- {
- /* Right edges. */
- gp->right = p->left;
- p->left = gp;
- }
- }
- }
+ {
+ node gp = *gparentp;
+ node p = *parentp;
+ /* There are two main cases:
+ 1. The edge types (left or right) of the two red edges differ.
+ 2. Both red edges are of the same type.
+ There exist two symmetries of each case, so there is a total of
+ 4 cases. */
+ if ((p_r > 0) != (gp_r > 0))
+ {
+ /* Put the child at the top of the tree, with its parent
+ and grandparent as successors. */
+ p->red = 1;
+ gp->red = 1;
+ root->red = 0;
+ if (p_r < 0)
+ {
+ /* Child is left of parent. */
+ p->left = *rp;
+ *rp = p;
+ gp->right = *lp;
+ *lp = gp;
+ }
+ else
+ {
+ /* Child is right of parent. */
+ p->right = *lp;
+ *lp = p;
+ gp->left = *rp;
+ *rp = gp;
+ }
+ *gparentp = root;
+ }
+ else
+ {
+ *gparentp = *parentp;
+ /* Parent becomes the top of the tree, grandparent and
+ child are its successors. */
+ p->red = 0;
+ gp->red = 1;
+ if (p_r < 0)
+ {
+ /* Left edges. */
+ gp->left = p->right;
+ p->right = gp;
+ }
+ else
+ {
+ /* Right edges. */
+ gp->right = p->left;
+ p->left = gp;
+ }
+ }
+ }
}
}
@@ -284,16 +284,16 @@ __tsearch (const void *key, void **vrootp, __compar_fn_t compar)
node root = *rootp;
r = (*compar) (key, root->key);
if (r == 0)
- return root;
+ return root;
maybe_split_for_insert (rootp, parentp, gparentp, p_r, gp_r, 0);
/* If that did any rotations, parentp and gparentp are now garbage.
- That doesn't matter, because the values they contain are never
- used again in that case. */
+ That doesn't matter, because the values they contain are never
+ used again in that case. */
nextp = r < 0 ? &root->left : &root->right;
if (*nextp == NULL)
- break;
+ break;
gparentp = parentp;
parentp = rootp;
@@ -306,15 +306,15 @@ __tsearch (const void *key, void **vrootp, __compar_fn_t compar)
q = (struct node_t *) malloc (sizeof (struct node_t));
if (q != NULL)
{
- *nextp = q; /* link new node to old */
- q->key = key; /* initialize new node */
+ *nextp = q; /* link new node to old */
+ q->key = key; /* initialize new node */
q->red = 1;
q->left = q->right = NULL;
if (nextp != rootp)
- /* There may be two red edges in a row now, which we must avoid by
- rotating the tree. */
- maybe_split_for_insert (nextp, rootp, parentp, r, p_r, 1);
+ /* There may be two red edges in a row now, which we must avoid by
+ rotating the tree. */
+ maybe_split_for_insert (nextp, rootp, parentp, r, p_r, 1);
}
return q;
@@ -347,7 +347,7 @@ __tfind (key, vrootp, compar)
r = (*compar) (key, root->key);
if (r == 0)
- return root;
+ return root;
rootp = r < 0 ? &root->left : &root->right;
}
@@ -386,15 +386,15 @@ __tdelete (const void *key, void **vrootp, __compar_fn_t compar)
while ((cmp = (*compar) (key, (*rootp)->key)) != 0)
{
if (sp == stacksize)
- abort ();
+ abort ();
nodestack[sp++] = rootp;
p = *rootp;
rootp = ((cmp < 0)
- ? &(*rootp)->left
- : &(*rootp)->right);
+ ? &(*rootp)->left
+ : &(*rootp)->right);
if (*rootp == NULL)
- return NULL;
+ return NULL;
}
/* This is bogus if the node to be deleted is the root... this routine
@@ -417,15 +417,15 @@ __tdelete (const void *key, void **vrootp, __compar_fn_t compar)
{
node *parent = rootp, *up = &root->right;
for (;;)
- {
- if (sp == stacksize)
- abort ();
- nodestack[sp++] = parent;
- parent = up;
- if ((*up)->left == NULL)
- break;
- up = &(*up)->left;
- }
+ {
+ if (sp == stacksize)
+ abort ();
+ nodestack[sp++] = parent;
+ parent = up;
+ if ((*up)->left == NULL)
+ break;
+ up = &(*up)->left;
+ }
unchained = *up;
}
@@ -440,9 +440,9 @@ __tdelete (const void *key, void **vrootp, __compar_fn_t compar)
{
q = *nodestack[sp-1];
if (unchained == q->right)
- q->right = r;
+ q->right = r;
else
- q->left = r;
+ q->left = r;
}
if (unchained != root)
@@ -450,156 +450,156 @@ __tdelete (const void *key, void **vrootp, __compar_fn_t compar)
if (!unchained->red)
{
/* Now we lost a black edge, which means that the number of black
- edges on every path is no longer constant. We must balance the
- tree. */
+ edges on every path is no longer constant. We must balance the
+ tree. */
/* NODESTACK now contains all parents of R. R is likely to be NULL
- in the first iteration. */
+ in the first iteration. */
/* NULL nodes are considered black throughout - this is necessary for
- correctness. */
+ correctness. */
while (sp > 0 && (r == NULL || !r->red))
- {
- node *pp = nodestack[sp - 1];
- p = *pp;
- /* Two symmetric cases. */
- if (r == p->left)
- {
- /* Q is R's brother, P is R's parent. The subtree with root
- R has one black edge less than the subtree with root Q. */
- q = p->right;
- if (q->red)
- {
- /* If Q is red, we know that P is black. We rotate P left
- so that Q becomes the top node in the tree, with P below
- it. P is colored red, Q is colored black.
- This action does not change the black edge count for any
- leaf in the tree, but we will be able to recognize one
- of the following situations, which all require that Q
- is black. */
- q->red = 0;
- p->red = 1;
- /* Left rotate p. */
- p->right = q->left;
- q->left = p;
- *pp = q;
- /* Make sure pp is right if the case below tries to use
- it. */
- nodestack[sp++] = pp = &q->left;
- q = p->right;
- }
- /* We know that Q can't be NULL here. We also know that Q is
- black. */
- if ((q->left == NULL || !q->left->red)
- && (q->right == NULL || !q->right->red))
- {
- /* Q has two black successors. We can simply color Q red.
- The whole subtree with root P is now missing one black
- edge. Note that this action can temporarily make the
- tree invalid (if P is red). But we will exit the loop
- in that case and set P black, which both makes the tree
- valid and also makes the black edge count come out
- right. If P is black, we are at least one step closer
- to the root and we'll try again the next iteration. */
- q->red = 1;
- r = p;
- }
- else
- {
- /* Q is black, one of Q's successors is red. We can
- repair the tree with one operation and will exit the
- loop afterwards. */
- if (q->right == NULL || !q->right->red)
- {
- /* The left one is red. We perform the same action as
- in maybe_split_for_insert where two red edges are
- adjacent but point in different directions:
- Q's left successor (let's call it Q2) becomes the
- top of the subtree we are looking at, its parent (Q)
- and grandparent (P) become its successors. The former
- successors of Q2 are placed below P and Q.
- P becomes black, and Q2 gets the color that P had.
- This changes the black edge count only for node R and
- its successors. */
- node q2 = q->left;
- q2->red = p->red;
- p->right = q2->left;
- q->left = q2->right;
- q2->right = q;
- q2->left = p;
- *pp = q2;
- p->red = 0;
- }
- else
- {
- /* It's the right one. Rotate P left. P becomes black,
- and Q gets the color that P had. Q's right successor
- also becomes black. This changes the black edge
- count only for node R and its successors. */
- q->red = p->red;
- p->red = 0;
-
- q->right->red = 0;
-
- /* left rotate p */
- p->right = q->left;
- q->left = p;
- *pp = q;
- }
-
- /* We're done. */
- sp = 1;
- r = NULL;
- }
- }
- else
- {
- /* Comments: see above. */
- q = p->left;
- if (q->red)
- {
- q->red = 0;
- p->red = 1;
- p->left = q->right;
- q->right = p;
- *pp = q;
- nodestack[sp++] = pp = &q->right;
- q = p->left;
- }
- if ((q->right == NULL || !q->right->red)
- && (q->left == NULL || !q->left->red))
- {
- q->red = 1;
- r = p;
- }
- else
- {
- if (q->left == NULL || !q->left->red)
- {
- node q2 = q->right;
- q2->red = p->red;
- p->left = q2->right;
- q->right = q2->left;
- q2->left = q;
- q2->right = p;
- *pp = q2;
- p->red = 0;
- }
- else
- {
- q->red = p->red;
- p->red = 0;
- q->left->red = 0;
- p->left = q->right;
- q->right = p;
- *pp = q;
- }
- sp = 1;
- r = NULL;
- }
- }
- --sp;
- }
+ {
+ node *pp = nodestack[sp - 1];
+ p = *pp;
+ /* Two symmetric cases. */
+ if (r == p->left)
+ {
+ /* Q is R's brother, P is R's parent. The subtree with root
+ R has one black edge less than the subtree with root Q. */
+ q = p->right;
+ if (q->red)
+ {
+ /* If Q is red, we know that P is black. We rotate P left
+ so that Q becomes the top node in the tree, with P below
+ it. P is colored red, Q is colored black.
+ This action does not change the black edge count for any
+ leaf in the tree, but we will be able to recognize one
+ of the following situations, which all require that Q
+ is black. */
+ q->red = 0;
+ p->red = 1;
+ /* Left rotate p. */
+ p->right = q->left;
+ q->left = p;
+ *pp = q;
+ /* Make sure pp is right if the case below tries to use
+ it. */
+ nodestack[sp++] = pp = &q->left;
+ q = p->right;
+ }
+ /* We know that Q can't be NULL here. We also know that Q is
+ black. */
+ if ((q->left == NULL || !q->left->red)
+ && (q->right == NULL || !q->right->red))
+ {
+ /* Q has two black successors. We can simply color Q red.
+ The whole subtree with root P is now missing one black
+ edge. Note that this action can temporarily make the
+ tree invalid (if P is red). But we will exit the loop
+ in that case and set P black, which both makes the tree
+ valid and also makes the black edge count come out
+ right. If P is black, we are at least one step closer
+ to the root and we'll try again the next iteration. */
+ q->red = 1;
+ r = p;
+ }
+ else
+ {
+ /* Q is black, one of Q's successors is red. We can
+ repair the tree with one operation and will exit the
+ loop afterwards. */
+ if (q->right == NULL || !q->right->red)
+ {
+ /* The left one is red. We perform the same action as
+ in maybe_split_for_insert where two red edges are
+ adjacent but point in different directions:
+ Q's left successor (let's call it Q2) becomes the
+ top of the subtree we are looking at, its parent (Q)
+ and grandparent (P) become its successors. The former
+ successors of Q2 are placed below P and Q.
+ P becomes black, and Q2 gets the color that P had.
+ This changes the black edge count only for node R and
+ its successors. */
+ node q2 = q->left;
+ q2->red = p->red;
+ p->right = q2->left;
+ q->left = q2->right;
+ q2->right = q;
+ q2->left = p;
+ *pp = q2;
+ p->red = 0;
+ }
+ else
+ {
+ /* It's the right one. Rotate P left. P becomes black,
+ and Q gets the color that P had. Q's right successor
+ also becomes black. This changes the black edge
+ count only for node R and its successors. */
+ q->red = p->red;
+ p->red = 0;
+
+ q->right->red = 0;
+
+ /* left rotate p */
+ p->right = q->left;
+ q->left = p;
+ *pp = q;
+ }
+
+ /* We're done. */
+ sp = 1;
+ r = NULL;
+ }
+ }
+ else
+ {
+ /* Comments: see above. */
+ q = p->left;
+ if (q->red)
+ {
+ q->red = 0;
+ p->red = 1;
+ p->left = q->right;
+ q->right = p;
+ *pp = q;
+ nodestack[sp++] = pp = &q->right;
+ q = p->left;
+ }
+ if ((q->right == NULL || !q->right->red)
+ && (q->left == NULL || !q->left->red))
+ {
+ q->red = 1;
+ r = p;
+ }
+ else
+ {
+ if (q->left == NULL || !q->left->red)
+ {
+ node q2 = q->right;
+ q2->red = p->red;
+ p->left = q2->right;
+ q->right = q2->left;
+ q2->left = q;
+ q2->right = p;
+ *pp = q2;
+ p->red = 0;
+ }
+ else
+ {
+ q->red = p->red;
+ p->red = 0;
+ q->left->red = 0;
+ p->left = q->right;
+ q->right = p;
+ *pp = q;
+ }
+ sp = 1;
+ r = NULL;
+ }
+ }
+ --sp;
+ }
if (r != NULL)
- r->red = 0;
+ r->red = 0;
}
free (unchained);
@@ -625,10 +625,10 @@ trecurse (const void *vroot, __action_fn_t action, int level)
{
(*action) (root, preorder, level);
if (root->left != NULL)
- trecurse (root->left, action, level + 1);
+ trecurse (root->left, action, level + 1);
(*action) (root, postorder, level);
if (root->right != NULL)
- trecurse (root->right, action, level + 1);
+ trecurse (root->right, action, level + 1);
(*action) (root, endorder, level);
}
}
diff --git a/intl/tsearch.h b/intl/tsearch.h
index f08e4a91..3d3fd14c 100644
--- a/intl/tsearch.h
+++ b/intl/tsearch.h
@@ -47,18 +47,18 @@ VISIT;
If one is found, it is returned. Otherwise, a new element equal to KEY
is inserted in the tree and is returned. */
extern void * tsearch (const void *key, void **vrootp,
- int (*compar) (const void *, const void *));
+ int (*compar) (const void *, const void *));
/* Searches an element in the tree *VROOTP that compares equal to KEY.
If one is found, it is returned. Otherwise, NULL is returned. */
extern void * tfind (const void *key, void *const *vrootp,
- int (*compar) (const void *, const void *));
+ int (*compar) (const void *, const void *));
/* Searches an element in the tree *VROOTP that compares equal to KEY.
If one is found, it is removed from the tree, and its parent node is
returned. Otherwise, NULL is returned. */
extern void * tdelete (const void *key, void **vrootp,
- int (*compar) (const void *, const void *));
+ int (*compar) (const void *, const void *));
/* Perform a depth-first, left-to-right traversal of the tree VROOT.
The ACTION function is called:
@@ -72,7 +72,7 @@ extern void * tdelete (const void *key, void **vrootp,
2. an indicator which visit of the node this is,
3. the level of the node in the tree (0 for the root). */
extern void twalk (const void *vroot,
- void (*action) (const void *, VISIT, int));
+ void (*action) (const void *, VISIT, int));
#ifdef __cplusplus
}
diff --git a/intl/vasnprintf.c b/intl/vasnprintf.c
index 4a8e7f05..8a07ca6e 100644
--- a/intl/vasnprintf.c
+++ b/intl/vasnprintf.c
@@ -1,5 +1,5 @@
/* vsprintf with automatic memory allocation.
- Copyright (C) 1999, 2002-2007 Free Software Foundation, Inc.
+ Copyright (C) 1999, 2002-2010 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
@@ -68,13 +68,13 @@
# endif
#endif
-#include <locale.h> /* localeconv() */
-#include <stdio.h> /* snprintf(), sprintf() */
-#include <stdlib.h> /* abort(), malloc(), realloc(), free() */
-#include <string.h> /* memcpy(), strlen() */
-#include <errno.h> /* errno */
-#include <limits.h> /* CHAR_BIT */
-#include <float.h> /* DBL_MAX_EXP, LDBL_MAX_EXP */
+#include <locale.h> /* localeconv() */
+#include <stdio.h> /* snprintf(), sprintf() */
+#include <stdlib.h> /* abort(), malloc(), realloc(), free() */
+#include <string.h> /* memcpy(), strlen() */
+#include <errno.h> /* errno */
+#include <limits.h> /* CHAR_BIT */
+#include <float.h> /* DBL_MAX_EXP, LDBL_MAX_EXP */
#if HAVE_NL_LANGINFO
# include <langinfo.h>
#endif
@@ -96,7 +96,7 @@
#if (NEED_PRINTF_DOUBLE || NEED_PRINTF_INFINITE_DOUBLE) && !defined IN_LIBINTL
# include <math.h>
-# include "isnan.h"
+# include "isnand-nolibm.h"
#endif
#if (NEED_PRINTF_LONG_DOUBLE || NEED_PRINTF_INFINITE_LONG_DOUBLE) && !defined IN_LIBINTL
@@ -107,7 +107,7 @@
#if (NEED_PRINTF_DIRECTIVE_A || NEED_PRINTF_DOUBLE) && !defined IN_LIBINTL
# include <math.h>
-# include "isnan.h"
+# include "isnand-nolibm.h"
# include "printf-frexp.h"
#endif
@@ -118,34 +118,6 @@
# include "fpucw.h"
#endif
-/* Some systems, like OSF/1 4.0 and Woe32, don't have EOVERFLOW. */
-#ifndef EOVERFLOW
-# define EOVERFLOW E2BIG
-#endif
-
-#if HAVE_WCHAR_T
-# if HAVE_WCSLEN
-# define local_wcslen wcslen
-# else
- /* Solaris 2.5.1 has wcslen() in a separate library libw.so. To avoid
- a dependency towards this library, here is a local substitute.
- Define this substitute only once, even if this file is included
- twice in the same compilation unit. */
-# ifndef local_wcslen_defined
-# define local_wcslen_defined 1
-static size_t
-local_wcslen (const wchar_t *s)
-{
- const wchar_t *ptr;
-
- for (ptr = s; *ptr != (wchar_t) 0; ptr++)
- ;
- return ptr - s;
-}
-# endif
-# endif
-#endif
-
/* Default parameters. */
#ifndef VASNPRINTF
# if WIDE_CHAR_VERSION
@@ -158,6 +130,7 @@ local_wcslen (const wchar_t *s)
# define DIRECTIVES wchar_t_directives
# define PRINTF_PARSE wprintf_parse
# define DCHAR_CPY wmemcpy
+# define DCHAR_SET wmemset
# else
# define VASNPRINTF vasnprintf
# define FCHAR_T char
@@ -168,6 +141,7 @@ local_wcslen (const wchar_t *s)
# define DIRECTIVES char_directives
# define PRINTF_PARSE printf_parse
# define DCHAR_CPY memcpy
+# define DCHAR_SET memset
# endif
#endif
#if WIDE_CHAR_VERSION
@@ -175,25 +149,40 @@ local_wcslen (const wchar_t *s)
# define USE_SNPRINTF 1
# if HAVE_DECL__SNWPRINTF
/* On Windows, the function swprintf() has a different signature than
- on Unix; we use the _snwprintf() function instead. */
-# define SNPRINTF _snwprintf
+ on Unix; we use the function _snwprintf() or - on mingw - snwprintf()
+ instead. The mingw function snwprintf() has fewer bugs than the
+ MSVCRT function _snwprintf(), so prefer that. */
+# if defined __MINGW32__
+# define SNPRINTF snwprintf
+# else
+# define SNPRINTF _snwprintf
+# endif
# else
/* Unix. */
# define SNPRINTF swprintf
# endif
#else
/* TCHAR_T is char. */
-# /* Use snprintf if it exists under the name 'snprintf' or '_snprintf'.
+ /* Use snprintf if it exists under the name 'snprintf' or '_snprintf'.
But don't use it on BeOS, since BeOS snprintf produces no output if the
- size argument is >= 0x3000000. */
-# if (HAVE_DECL__SNPRINTF || HAVE_SNPRINTF) && !defined __BEOS__
+ size argument is >= 0x3000000.
+ Also don't use it on Linux libc5, since there snprintf with size = 1
+ writes any output without bounds, like sprintf. */
+# if (HAVE_DECL__SNPRINTF || HAVE_SNPRINTF) && !defined __BEOS__ && !(__GNU_LIBRARY__ == 1)
# define USE_SNPRINTF 1
# else
# define USE_SNPRINTF 0
# endif
# if HAVE_DECL__SNPRINTF
- /* Windows. */
-# define SNPRINTF _snprintf
+ /* Windows. The mingw function snprintf() has fewer bugs than the MSVCRT
+ function _snprintf(), so prefer that. */
+# if defined __MINGW32__
+# define SNPRINTF snprintf
+ /* Here we need to call the native snprintf, not rpl_snprintf. */
+# undef snprintf
+# else
+# define SNPRINTF _snprintf
+# endif
# else
/* Unix. */
# define SNPRINTF snprintf
@@ -204,19 +193,92 @@ local_wcslen (const wchar_t *s)
/* Here we need to call the native sprintf, not rpl_sprintf. */
#undef sprintf
-#if (NEED_PRINTF_DIRECTIVE_A || NEED_PRINTF_LONG_DOUBLE || NEED_PRINTF_DOUBLE || NEED_PRINTF_INFINITE_DOUBLE) && !defined IN_LIBINTL
+/* GCC >= 4.0 with -Wall emits unjustified "... may be used uninitialized"
+ warnings in this file. Use -Dlint to suppress them. */
+#ifdef lint
+# define IF_LINT(Code) Code
+#else
+# define IF_LINT(Code) /* empty */
+#endif
+
+/* Avoid some warnings from "gcc -Wshadow".
+ This file doesn't use the exp() and remainder() functions. */
+#undef exp
+#define exp expo
+#undef remainder
+#define remainder rem
+
+#if (!USE_SNPRINTF || !HAVE_SNPRINTF_RETVAL_C99) && !WIDE_CHAR_VERSION
+# if (HAVE_STRNLEN && !defined _AIX)
+# define local_strnlen strnlen
+# else
+# ifndef local_strnlen_defined
+# define local_strnlen_defined 1
+static size_t
+local_strnlen (const char *string, size_t maxlen)
+{
+ const char *end = memchr (string, '\0', maxlen);
+ return end ? (size_t) (end - string) : maxlen;
+}
+# endif
+# endif
+#endif
+
+#if (((!USE_SNPRINTF || !HAVE_SNPRINTF_RETVAL_C99) && WIDE_CHAR_VERSION) || ((!USE_SNPRINTF || !HAVE_SNPRINTF_RETVAL_C99 || (NEED_PRINTF_DIRECTIVE_LS && !defined IN_LIBINTL)) && !WIDE_CHAR_VERSION && DCHAR_IS_TCHAR)) && HAVE_WCHAR_T
+# if HAVE_WCSLEN
+# define local_wcslen wcslen
+# else
+ /* Solaris 2.5.1 has wcslen() in a separate library libw.so. To avoid
+ a dependency towards this library, here is a local substitute.
+ Define this substitute only once, even if this file is included
+ twice in the same compilation unit. */
+# ifndef local_wcslen_defined
+# define local_wcslen_defined 1
+static size_t
+local_wcslen (const wchar_t *s)
+{
+ const wchar_t *ptr;
+
+ for (ptr = s; *ptr != (wchar_t) 0; ptr++)
+ ;
+ return ptr - s;
+}
+# endif
+# endif
+#endif
+
+#if (!USE_SNPRINTF || !HAVE_SNPRINTF_RETVAL_C99) && HAVE_WCHAR_T && WIDE_CHAR_VERSION
+# if HAVE_WCSNLEN
+# define local_wcsnlen wcsnlen
+# else
+# ifndef local_wcsnlen_defined
+# define local_wcsnlen_defined 1
+static size_t
+local_wcsnlen (const wchar_t *s, size_t maxlen)
+{
+ const wchar_t *ptr;
+
+ for (ptr = s; maxlen > 0 && *ptr != (wchar_t) 0; ptr++, maxlen--)
+ ;
+ return ptr - s;
+}
+# endif
+# endif
+#endif
+
+#if (NEED_PRINTF_DIRECTIVE_A || NEED_PRINTF_LONG_DOUBLE || NEED_PRINTF_INFINITE_LONG_DOUBLE || NEED_PRINTF_DOUBLE || NEED_PRINTF_INFINITE_DOUBLE) && !defined IN_LIBINTL
/* Determine the decimal-point character according to the current locale. */
# ifndef decimal_point_char_defined
# define decimal_point_char_defined 1
static char
-decimal_point_char ()
+decimal_point_char (void)
{
const char *point;
/* Determine it in a multithread-safe way. We know nl_langinfo is
- multithread-safe on glibc systems, but is not required to be multithread-
- safe by POSIX. sprintf(), however, is multithread-safe. localeconv()
- is rarely multithread-safe. */
-# if HAVE_NL_LANGINFO && __GLIBC__
+ multithread-safe on glibc systems and MacOS X systems, but is not required
+ to be multithread-safe by POSIX. sprintf(), however, is multithread-safe.
+ localeconv() is rarely multithread-safe. */
+# if HAVE_NL_LANGINFO && (__GLIBC__ || (defined __APPLE__ && defined __MACH__))
point = nl_langinfo (RADIXCHAR);
# elif 1
char pointbuf[5];
@@ -237,18 +299,18 @@ decimal_point_char ()
static int
is_infinite_or_zero (double x)
{
- return isnan (x) || x + x == x;
+ return isnand (x) || x + x == x;
}
#endif
#if NEED_PRINTF_INFINITE_LONG_DOUBLE && !NEED_PRINTF_LONG_DOUBLE && !defined IN_LIBINTL
-/* Equivalent to !isfinite(x), but does not require libm. */
+/* Equivalent to !isfinite(x) || x == 0, but does not require libm. */
static int
-is_infinitel (long double x)
+is_infinite_or_zerol (long double x)
{
- return isnanl (x) || (x + x == x && x != 0.0L);
+ return isnanl (x) || x + x == x;
}
#endif
@@ -316,26 +378,26 @@ multiply (mpn_t src1, mpn_t src2, mpn_t *dest)
dlen = len1 + len2;
dp = (mp_limb_t *) malloc (dlen * sizeof (mp_limb_t));
if (dp == NULL)
- return NULL;
+ return NULL;
for (k = len2; k > 0; )
- dp[--k] = 0;
+ dp[--k] = 0;
for (i = 0; i < len1; i++)
- {
- mp_limb_t digit1 = p1[i];
- mp_twolimb_t carry = 0;
- for (j = 0; j < len2; j++)
- {
- mp_limb_t digit2 = p2[j];
- carry += (mp_twolimb_t) digit1 * (mp_twolimb_t) digit2;
- carry += dp[i + j];
- dp[i + j] = (mp_limb_t) carry;
- carry = carry >> GMP_LIMB_BITS;
- }
- dp[i + len2] = (mp_limb_t) carry;
- }
+ {
+ mp_limb_t digit1 = p1[i];
+ mp_twolimb_t carry = 0;
+ for (j = 0; j < len2; j++)
+ {
+ mp_limb_t digit2 = p2[j];
+ carry += (mp_twolimb_t) digit1 * (mp_twolimb_t) digit2;
+ carry += dp[i + j];
+ dp[i + j] = (mp_limb_t) carry;
+ carry = carry >> GMP_LIMB_BITS;
+ }
+ dp[i + len2] = (mp_limb_t) carry;
+ }
/* Normalise. */
while (dlen > 0 && dp[dlen - 1] == 0)
- dlen--;
+ dlen--;
dest->nlimbs = dlen;
dest->limbs = dp;
}
@@ -365,7 +427,7 @@ divide (mpn_t a, mpn_t b, mpn_t *q)
Normalise [q[m-1],...,q[0]], yields q.
If m>=n>1, perform a multiple-precision division:
We have a/b < beta^(m-n+1).
- s:=intDsize-1-(hightest bit in b[n-1]), 0<=s<intDsize.
+ s:=intDsize-1-(highest bit in b[n-1]), 0<=s<intDsize.
Shift a and b left by s bits, copying them. r:=a.
r=[r[m],...,r[0]], b=[b[n-1],...,b[0]] with b[n-1]>=beta/2.
For j=m-n,...,0: {Here 0 <= r < b*beta^(j+1).}
@@ -429,12 +491,12 @@ divide (mpn_t a, mpn_t b, mpn_t *q)
for (;;)
{
if (b_len == 0)
- /* Division by zero. */
- abort ();
+ /* Division by zero. */
+ abort ();
if (b_ptr[b_len - 1] == 0)
- b_len--;
+ b_len--;
else
- break;
+ break;
}
/* Here m = a_len >= 0 and n = b_len > 0. */
@@ -451,261 +513,261 @@ divide (mpn_t a, mpn_t b, mpn_t *q)
else if (b_len == 1)
{
/* n=1: single precision division.
- beta^(m-1) <= a < beta^m ==> beta^(m-2) <= a/b < beta^m */
+ beta^(m-1) <= a < beta^m ==> beta^(m-2) <= a/b < beta^m */
r_ptr = roomptr;
q_ptr = roomptr + 1;
{
- mp_limb_t den = b_ptr[0];
- mp_limb_t remainder = 0;
- const mp_limb_t *sourceptr = a_ptr + a_len;
- mp_limb_t *destptr = q_ptr + a_len;
- size_t count;
- for (count = a_len; count > 0; count--)
- {
- mp_twolimb_t num =
- ((mp_twolimb_t) remainder << GMP_LIMB_BITS) | *--sourceptr;
- *--destptr = num / den;
- remainder = num % den;
- }
- /* Normalise and store r. */
- if (remainder > 0)
- {
- r_ptr[0] = remainder;
- r_len = 1;
- }
- else
- r_len = 0;
- /* Normalise q. */
- q_len = a_len;
- if (q_ptr[q_len - 1] == 0)
- q_len--;
+ mp_limb_t den = b_ptr[0];
+ mp_limb_t remainder = 0;
+ const mp_limb_t *sourceptr = a_ptr + a_len;
+ mp_limb_t *destptr = q_ptr + a_len;
+ size_t count;
+ for (count = a_len; count > 0; count--)
+ {
+ mp_twolimb_t num =
+ ((mp_twolimb_t) remainder << GMP_LIMB_BITS) | *--sourceptr;
+ *--destptr = num / den;
+ remainder = num % den;
+ }
+ /* Normalise and store r. */
+ if (remainder > 0)
+ {
+ r_ptr[0] = remainder;
+ r_len = 1;
+ }
+ else
+ r_len = 0;
+ /* Normalise q. */
+ q_len = a_len;
+ if (q_ptr[q_len - 1] == 0)
+ q_len--;
}
}
else
{
/* n>1: multiple precision division.
- beta^(m-1) <= a < beta^m, beta^(n-1) <= b < beta^n ==>
- beta^(m-n-1) <= a/b < beta^(m-n+1). */
+ beta^(m-1) <= a < beta^m, beta^(n-1) <= b < beta^n ==>
+ beta^(m-n-1) <= a/b < beta^(m-n+1). */
/* Determine s. */
size_t s;
{
- mp_limb_t msd = b_ptr[b_len - 1]; /* = b[n-1], > 0 */
- s = 31;
- if (msd >= 0x10000)
- {
- msd = msd >> 16;
- s -= 16;
- }
- if (msd >= 0x100)
- {
- msd = msd >> 8;
- s -= 8;
- }
- if (msd >= 0x10)
- {
- msd = msd >> 4;
- s -= 4;
- }
- if (msd >= 0x4)
- {
- msd = msd >> 2;
- s -= 2;
- }
- if (msd >= 0x2)
- {
- msd = msd >> 1;
- s -= 1;
- }
+ mp_limb_t msd = b_ptr[b_len - 1]; /* = b[n-1], > 0 */
+ s = 31;
+ if (msd >= 0x10000)
+ {
+ msd = msd >> 16;
+ s -= 16;
+ }
+ if (msd >= 0x100)
+ {
+ msd = msd >> 8;
+ s -= 8;
+ }
+ if (msd >= 0x10)
+ {
+ msd = msd >> 4;
+ s -= 4;
+ }
+ if (msd >= 0x4)
+ {
+ msd = msd >> 2;
+ s -= 2;
+ }
+ if (msd >= 0x2)
+ {
+ msd = msd >> 1;
+ s -= 1;
+ }
}
/* 0 <= s < GMP_LIMB_BITS.
- Copy b, shifting it left by s bits. */
+ Copy b, shifting it left by s bits. */
if (s > 0)
- {
- tmp_roomptr = (mp_limb_t *) malloc (b_len * sizeof (mp_limb_t));
- if (tmp_roomptr == NULL)
- {
- free (roomptr);
- return NULL;
- }
- {
- const mp_limb_t *sourceptr = b_ptr;
- mp_limb_t *destptr = tmp_roomptr;
- mp_twolimb_t accu = 0;
- size_t count;
- for (count = b_len; count > 0; count--)
- {
- accu += (mp_twolimb_t) *sourceptr++ << s;
- *destptr++ = (mp_limb_t) accu;
- accu = accu >> GMP_LIMB_BITS;
- }
- /* accu must be zero, since that was how s was determined. */
- if (accu != 0)
- abort ();
- }
- b_ptr = tmp_roomptr;
- }
+ {
+ tmp_roomptr = (mp_limb_t *) malloc (b_len * sizeof (mp_limb_t));
+ if (tmp_roomptr == NULL)
+ {
+ free (roomptr);
+ return NULL;
+ }
+ {
+ const mp_limb_t *sourceptr = b_ptr;
+ mp_limb_t *destptr = tmp_roomptr;
+ mp_twolimb_t accu = 0;
+ size_t count;
+ for (count = b_len; count > 0; count--)
+ {
+ accu += (mp_twolimb_t) *sourceptr++ << s;
+ *destptr++ = (mp_limb_t) accu;
+ accu = accu >> GMP_LIMB_BITS;
+ }
+ /* accu must be zero, since that was how s was determined. */
+ if (accu != 0)
+ abort ();
+ }
+ b_ptr = tmp_roomptr;
+ }
/* Copy a, shifting it left by s bits, yields r.
- Memory layout:
- At the beginning: r = roomptr[0..a_len],
- at the end: r = roomptr[0..b_len-1], q = roomptr[b_len..a_len] */
+ Memory layout:
+ At the beginning: r = roomptr[0..a_len],
+ at the end: r = roomptr[0..b_len-1], q = roomptr[b_len..a_len] */
r_ptr = roomptr;
if (s == 0)
- {
- memcpy (r_ptr, a_ptr, a_len * sizeof (mp_limb_t));
- r_ptr[a_len] = 0;
- }
+ {
+ memcpy (r_ptr, a_ptr, a_len * sizeof (mp_limb_t));
+ r_ptr[a_len] = 0;
+ }
else
- {
- const mp_limb_t *sourceptr = a_ptr;
- mp_limb_t *destptr = r_ptr;
- mp_twolimb_t accu = 0;
- size_t count;
- for (count = a_len; count > 0; count--)
- {
- accu += (mp_twolimb_t) *sourceptr++ << s;
- *destptr++ = (mp_limb_t) accu;
- accu = accu >> GMP_LIMB_BITS;
- }
- *destptr++ = (mp_limb_t) accu;
- }
+ {
+ const mp_limb_t *sourceptr = a_ptr;
+ mp_limb_t *destptr = r_ptr;
+ mp_twolimb_t accu = 0;
+ size_t count;
+ for (count = a_len; count > 0; count--)
+ {
+ accu += (mp_twolimb_t) *sourceptr++ << s;
+ *destptr++ = (mp_limb_t) accu;
+ accu = accu >> GMP_LIMB_BITS;
+ }
+ *destptr++ = (mp_limb_t) accu;
+ }
q_ptr = roomptr + b_len;
q_len = a_len - b_len + 1; /* q will have m-n+1 limbs */
{
- size_t j = a_len - b_len; /* m-n */
- mp_limb_t b_msd = b_ptr[b_len - 1]; /* b[n-1] */
- mp_limb_t b_2msd = b_ptr[b_len - 2]; /* b[n-2] */
- mp_twolimb_t b_msdd = /* b[n-1]*beta+b[n-2] */
- ((mp_twolimb_t) b_msd << GMP_LIMB_BITS) | b_2msd;
- /* Division loop, traversed m-n+1 times.
- j counts down, b is unchanged, beta/2 <= b[n-1] < beta. */
- for (;;)
- {
- mp_limb_t q_star;
- mp_limb_t c1;
- if (r_ptr[j + b_len] < b_msd) /* r[j+n] < b[n-1] ? */
- {
- /* Divide r[j+n]*beta+r[j+n-1] by b[n-1], no overflow. */
- mp_twolimb_t num =
- ((mp_twolimb_t) r_ptr[j + b_len] << GMP_LIMB_BITS)
- | r_ptr[j + b_len - 1];
- q_star = num / b_msd;
- c1 = num % b_msd;
- }
- else
- {
- /* Overflow, hence r[j+n]*beta+r[j+n-1] >= beta*b[n-1]. */
- q_star = (mp_limb_t)~(mp_limb_t)0; /* q* = beta-1 */
- /* Test whether r[j+n]*beta+r[j+n-1] - (beta-1)*b[n-1] >= beta
- <==> r[j+n]*beta+r[j+n-1] + b[n-1] >= beta*b[n-1]+beta
- <==> b[n-1] < floor((r[j+n]*beta+r[j+n-1]+b[n-1])/beta)
- {<= beta !}.
- If yes, jump directly to the subtraction loop.
- (Otherwise, r[j+n]*beta+r[j+n-1] - (beta-1)*b[n-1] < beta
- <==> floor((r[j+n]*beta+r[j+n-1]+b[n-1])/beta) = b[n-1] ) */
- if (r_ptr[j + b_len] > b_msd
- || (c1 = r_ptr[j + b_len - 1] + b_msd) < b_msd)
- /* r[j+n] >= b[n-1]+1 or
- r[j+n] = b[n-1] and the addition r[j+n-1]+b[n-1] gives a
- carry. */
- goto subtract;
- }
- /* q_star = q*,
- c1 = (r[j+n]*beta+r[j+n-1]) - q* * b[n-1] (>=0, <beta). */
- {
- mp_twolimb_t c2 = /* c1*beta+r[j+n-2] */
- ((mp_twolimb_t) c1 << GMP_LIMB_BITS) | r_ptr[j + b_len - 2];
- mp_twolimb_t c3 = /* b[n-2] * q* */
- (mp_twolimb_t) b_2msd * (mp_twolimb_t) q_star;
- /* While c2 < c3, increase c2 and decrease c3.
- Consider c3-c2. While it is > 0, decrease it by
- b[n-1]*beta+b[n-2]. Because of b[n-1]*beta+b[n-2] >= beta^2/2
- this can happen only twice. */
- if (c3 > c2)
- {
- q_star = q_star - 1; /* q* := q* - 1 */
- if (c3 - c2 > b_msdd)
- q_star = q_star - 1; /* q* := q* - 1 */
- }
- }
- if (q_star > 0)
- subtract:
- {
- /* Subtract r := r - b * q* * beta^j. */
- mp_limb_t cr;
- {
- const mp_limb_t *sourceptr = b_ptr;
- mp_limb_t *destptr = r_ptr + j;
- mp_twolimb_t carry = 0;
- size_t count;
- for (count = b_len; count > 0; count--)
- {
- /* Here 0 <= carry <= q*. */
- carry =
- carry
- + (mp_twolimb_t) q_star * (mp_twolimb_t) *sourceptr++
- + (mp_limb_t) ~(*destptr);
- /* Here 0 <= carry <= beta*q* + beta-1. */
- *destptr++ = ~(mp_limb_t) carry;
- carry = carry >> GMP_LIMB_BITS; /* <= q* */
- }
- cr = (mp_limb_t) carry;
- }
- /* Subtract cr from r_ptr[j + b_len], then forget about
- r_ptr[j + b_len]. */
- if (cr > r_ptr[j + b_len])
- {
- /* Subtraction gave a carry. */
- q_star = q_star - 1; /* q* := q* - 1 */
- /* Add b back. */
- {
- const mp_limb_t *sourceptr = b_ptr;
- mp_limb_t *destptr = r_ptr + j;
- mp_limb_t carry = 0;
- size_t count;
- for (count = b_len; count > 0; count--)
- {
- mp_limb_t source1 = *sourceptr++;
- mp_limb_t source2 = *destptr;
- *destptr++ = source1 + source2 + carry;
- carry =
- (carry
- ? source1 >= (mp_limb_t) ~source2
- : source1 > (mp_limb_t) ~source2);
- }
- }
- /* Forget about the carry and about r[j+n]. */
- }
- }
- /* q* is determined. Store it as q[j]. */
- q_ptr[j] = q_star;
- if (j == 0)
- break;
- j--;
- }
+ size_t j = a_len - b_len; /* m-n */
+ mp_limb_t b_msd = b_ptr[b_len - 1]; /* b[n-1] */
+ mp_limb_t b_2msd = b_ptr[b_len - 2]; /* b[n-2] */
+ mp_twolimb_t b_msdd = /* b[n-1]*beta+b[n-2] */
+ ((mp_twolimb_t) b_msd << GMP_LIMB_BITS) | b_2msd;
+ /* Division loop, traversed m-n+1 times.
+ j counts down, b is unchanged, beta/2 <= b[n-1] < beta. */
+ for (;;)
+ {
+ mp_limb_t q_star;
+ mp_limb_t c1;
+ if (r_ptr[j + b_len] < b_msd) /* r[j+n] < b[n-1] ? */
+ {
+ /* Divide r[j+n]*beta+r[j+n-1] by b[n-1], no overflow. */
+ mp_twolimb_t num =
+ ((mp_twolimb_t) r_ptr[j + b_len] << GMP_LIMB_BITS)
+ | r_ptr[j + b_len - 1];
+ q_star = num / b_msd;
+ c1 = num % b_msd;
+ }
+ else
+ {
+ /* Overflow, hence r[j+n]*beta+r[j+n-1] >= beta*b[n-1]. */
+ q_star = (mp_limb_t)~(mp_limb_t)0; /* q* = beta-1 */
+ /* Test whether r[j+n]*beta+r[j+n-1] - (beta-1)*b[n-1] >= beta
+ <==> r[j+n]*beta+r[j+n-1] + b[n-1] >= beta*b[n-1]+beta
+ <==> b[n-1] < floor((r[j+n]*beta+r[j+n-1]+b[n-1])/beta)
+ {<= beta !}.
+ If yes, jump directly to the subtraction loop.
+ (Otherwise, r[j+n]*beta+r[j+n-1] - (beta-1)*b[n-1] < beta
+ <==> floor((r[j+n]*beta+r[j+n-1]+b[n-1])/beta) = b[n-1] ) */
+ if (r_ptr[j + b_len] > b_msd
+ || (c1 = r_ptr[j + b_len - 1] + b_msd) < b_msd)
+ /* r[j+n] >= b[n-1]+1 or
+ r[j+n] = b[n-1] and the addition r[j+n-1]+b[n-1] gives a
+ carry. */
+ goto subtract;
+ }
+ /* q_star = q*,
+ c1 = (r[j+n]*beta+r[j+n-1]) - q* * b[n-1] (>=0, <beta). */
+ {
+ mp_twolimb_t c2 = /* c1*beta+r[j+n-2] */
+ ((mp_twolimb_t) c1 << GMP_LIMB_BITS) | r_ptr[j + b_len - 2];
+ mp_twolimb_t c3 = /* b[n-2] * q* */
+ (mp_twolimb_t) b_2msd * (mp_twolimb_t) q_star;
+ /* While c2 < c3, increase c2 and decrease c3.
+ Consider c3-c2. While it is > 0, decrease it by
+ b[n-1]*beta+b[n-2]. Because of b[n-1]*beta+b[n-2] >= beta^2/2
+ this can happen only twice. */
+ if (c3 > c2)
+ {
+ q_star = q_star - 1; /* q* := q* - 1 */
+ if (c3 - c2 > b_msdd)
+ q_star = q_star - 1; /* q* := q* - 1 */
+ }
+ }
+ if (q_star > 0)
+ subtract:
+ {
+ /* Subtract r := r - b * q* * beta^j. */
+ mp_limb_t cr;
+ {
+ const mp_limb_t *sourceptr = b_ptr;
+ mp_limb_t *destptr = r_ptr + j;
+ mp_twolimb_t carry = 0;
+ size_t count;
+ for (count = b_len; count > 0; count--)
+ {
+ /* Here 0 <= carry <= q*. */
+ carry =
+ carry
+ + (mp_twolimb_t) q_star * (mp_twolimb_t) *sourceptr++
+ + (mp_limb_t) ~(*destptr);
+ /* Here 0 <= carry <= beta*q* + beta-1. */
+ *destptr++ = ~(mp_limb_t) carry;
+ carry = carry >> GMP_LIMB_BITS; /* <= q* */
+ }
+ cr = (mp_limb_t) carry;
+ }
+ /* Subtract cr from r_ptr[j + b_len], then forget about
+ r_ptr[j + b_len]. */
+ if (cr > r_ptr[j + b_len])
+ {
+ /* Subtraction gave a carry. */
+ q_star = q_star - 1; /* q* := q* - 1 */
+ /* Add b back. */
+ {
+ const mp_limb_t *sourceptr = b_ptr;
+ mp_limb_t *destptr = r_ptr + j;
+ mp_limb_t carry = 0;
+ size_t count;
+ for (count = b_len; count > 0; count--)
+ {
+ mp_limb_t source1 = *sourceptr++;
+ mp_limb_t source2 = *destptr;
+ *destptr++ = source1 + source2 + carry;
+ carry =
+ (carry
+ ? source1 >= (mp_limb_t) ~source2
+ : source1 > (mp_limb_t) ~source2);
+ }
+ }
+ /* Forget about the carry and about r[j+n]. */
+ }
+ }
+ /* q* is determined. Store it as q[j]. */
+ q_ptr[j] = q_star;
+ if (j == 0)
+ break;
+ j--;
+ }
}
r_len = b_len;
/* Normalise q. */
if (q_ptr[q_len - 1] == 0)
- q_len--;
+ q_len--;
# if 0 /* Not needed here, since we need r only to compare it with b/2, and
- b is shifted left by s bits. */
+ b is shifted left by s bits. */
/* Shift r right by s bits. */
if (s > 0)
- {
- mp_limb_t ptr = r_ptr + r_len;
- mp_twolimb_t accu = 0;
- size_t count;
- for (count = r_len; count > 0; count--)
- {
- accu = (mp_twolimb_t) (mp_limb_t) accu << GMP_LIMB_BITS;
- accu += (mp_twolimb_t) *--ptr << (GMP_LIMB_BITS - s);
- *ptr = (mp_limb_t) (accu >> GMP_LIMB_BITS);
- }
- }
+ {
+ mp_limb_t ptr = r_ptr + r_len;
+ mp_twolimb_t accu = 0;
+ size_t count;
+ for (count = r_len; count > 0; count--)
+ {
+ accu = (mp_twolimb_t) (mp_limb_t) accu << GMP_LIMB_BITS;
+ accu += (mp_twolimb_t) *--ptr << (GMP_LIMB_BITS - s);
+ *ptr = (mp_limb_t) (accu >> GMP_LIMB_BITS);
+ }
+ }
# endif
/* Normalise r. */
while (r_len > 0 && r_ptr[r_len - 1] == 0)
- r_len--;
+ r_len--;
}
/* Compare r << 1 with b. */
if (r_len > b_len)
@@ -714,17 +776,17 @@ divide (mpn_t a, mpn_t b, mpn_t *q)
size_t i;
for (i = b_len;;)
{
- mp_limb_t r_i =
- (i <= r_len && i > 0 ? r_ptr[i - 1] >> (GMP_LIMB_BITS - 1) : 0)
- | (i < r_len ? r_ptr[i] << 1 : 0);
- mp_limb_t b_i = (i < b_len ? b_ptr[i] : 0);
- if (r_i > b_i)
- goto increment_q;
- if (r_i < b_i)
- goto keep_q;
- if (i == 0)
- break;
- i--;
+ mp_limb_t r_i =
+ (i <= r_len && i > 0 ? r_ptr[i - 1] >> (GMP_LIMB_BITS - 1) : 0)
+ | (i < r_len ? r_ptr[i] << 1 : 0);
+ mp_limb_t b_i = (i < b_len ? b_ptr[i] : 0);
+ if (r_i > b_i)
+ goto increment_q;
+ if (r_i < b_i)
+ goto keep_q;
+ if (i == 0)
+ break;
+ i--;
}
}
if (q_len > 0 && ((q_ptr[0] & 1) != 0))
@@ -733,8 +795,8 @@ divide (mpn_t a, mpn_t b, mpn_t *q)
{
size_t i;
for (i = 0; i < q_len; i++)
- if (++(q_ptr[i]) != 0)
- goto keep_q;
+ if (++(q_ptr[i]) != 0)
+ goto keep_q;
q_ptr[q_len++] = 1;
}
keep_q:
@@ -763,36 +825,36 @@ convert_to_decimal (mpn_t a, size_t extra_zeroes)
{
char *d_ptr = c_ptr;
for (; extra_zeroes > 0; extra_zeroes--)
- *d_ptr++ = '0';
+ *d_ptr++ = '0';
while (a_len > 0)
- {
- /* Divide a by 10^9, in-place. */
- mp_limb_t remainder = 0;
- mp_limb_t *ptr = a_ptr + a_len;
- size_t count;
- for (count = a_len; count > 0; count--)
- {
- mp_twolimb_t num =
- ((mp_twolimb_t) remainder << GMP_LIMB_BITS) | *--ptr;
- *ptr = num / 1000000000;
- remainder = num % 1000000000;
- }
- /* Store the remainder as 9 decimal digits. */
- for (count = 9; count > 0; count--)
- {
- *d_ptr++ = '0' + (remainder % 10);
- remainder = remainder / 10;
- }
- /* Normalize a. */
- if (a_ptr[a_len - 1] == 0)
- a_len--;
- }
+ {
+ /* Divide a by 10^9, in-place. */
+ mp_limb_t remainder = 0;
+ mp_limb_t *ptr = a_ptr + a_len;
+ size_t count;
+ for (count = a_len; count > 0; count--)
+ {
+ mp_twolimb_t num =
+ ((mp_twolimb_t) remainder << GMP_LIMB_BITS) | *--ptr;
+ *ptr = num / 1000000000;
+ remainder = num % 1000000000;
+ }
+ /* Store the remainder as 9 decimal digits. */
+ for (count = 9; count > 0; count--)
+ {
+ *d_ptr++ = '0' + (remainder % 10);
+ remainder = remainder / 10;
+ }
+ /* Normalize a. */
+ if (a_ptr[a_len - 1] == 0)
+ a_len--;
+ }
/* Remove leading zeroes. */
while (d_ptr > c_ptr && d_ptr[-1] == '0')
- d_ptr--;
+ d_ptr--;
/* But keep at least one zero. */
if (d_ptr == c_ptr)
- *d_ptr++ = '0';
+ *d_ptr++ = '0';
/* Terminate the string. */
*d_ptr = '\0';
}
@@ -837,12 +899,12 @@ decode_long_double (long double x, int *ep, mpn_t *mp)
hi = (int) y;
y -= hi;
if (!(y >= 0.0L && y < 1.0L))
- abort ();
+ abort ();
y *= (mp_limb_t) 1 << (GMP_LIMB_BITS / 2);
lo = (int) y;
y -= lo;
if (!(y >= 0.0L && y < 1.0L))
- abort ();
+ abort ();
m.limbs[LDBL_MANT_BIT / GMP_LIMB_BITS] = (hi << (GMP_LIMB_BITS / 2)) | lo;
}
# else
@@ -852,7 +914,7 @@ decode_long_double (long double x, int *ep, mpn_t *mp)
d = (int) y;
y -= d;
if (!(y >= 0.0L && y < 1.0L))
- abort ();
+ abort ();
m.limbs[LDBL_MANT_BIT / GMP_LIMB_BITS] = d;
}
# endif
@@ -864,16 +926,19 @@ decode_long_double (long double x, int *ep, mpn_t *mp)
hi = (int) y;
y -= hi;
if (!(y >= 0.0L && y < 1.0L))
- abort ();
+ abort ();
y *= (mp_limb_t) 1 << (GMP_LIMB_BITS / 2);
lo = (int) y;
y -= lo;
if (!(y >= 0.0L && y < 1.0L))
- abort ();
+ abort ();
m.limbs[--i] = (hi << (GMP_LIMB_BITS / 2)) | lo;
}
+#if 0 /* On FreeBSD 6.1/x86, 'long double' numbers sometimes have excess
+ precision. */
if (!(y == 0.0L))
abort ();
+#endif
/* Normalise. */
while (m.nlimbs > 0 && m.limbs[m.nlimbs - 1] == 0)
m.nlimbs--;
@@ -922,12 +987,12 @@ decode_double (double x, int *ep, mpn_t *mp)
hi = (int) y;
y -= hi;
if (!(y >= 0.0 && y < 1.0))
- abort ();
+ abort ();
y *= (mp_limb_t) 1 << (GMP_LIMB_BITS / 2);
lo = (int) y;
y -= lo;
if (!(y >= 0.0 && y < 1.0))
- abort ();
+ abort ();
m.limbs[DBL_MANT_BIT / GMP_LIMB_BITS] = (hi << (GMP_LIMB_BITS / 2)) | lo;
}
# else
@@ -937,7 +1002,7 @@ decode_double (double x, int *ep, mpn_t *mp)
d = (int) y;
y -= d;
if (!(y >= 0.0 && y < 1.0))
- abort ();
+ abort ();
m.limbs[DBL_MANT_BIT / GMP_LIMB_BITS] = d;
}
# endif
@@ -949,12 +1014,12 @@ decode_double (double x, int *ep, mpn_t *mp)
hi = (int) y;
y -= hi;
if (!(y >= 0.0 && y < 1.0))
- abort ();
+ abort ();
y *= (mp_limb_t) 1 << (GMP_LIMB_BITS / 2);
lo = (int) y;
y -= lo;
if (!(y >= 0.0 && y < 1.0))
- abort ();
+ abort ();
m.limbs[--i] = (hi << (GMP_LIMB_BITS / 2)) | lo;
}
if (!(y == 0.0))
@@ -1012,8 +1077,8 @@ scale10_round_decimal_decoded (int e, mpn_t m, void *memory, int n)
abs_n = (n >= 0 ? n : -n);
abs_s = (s >= 0 ? s : -s);
pow5_ptr = (mp_limb_t *) malloc (((int)(abs_n * (2.322f / GMP_LIMB_BITS)) + 1
- + abs_s / GMP_LIMB_BITS + 1)
- * sizeof (mp_limb_t));
+ + abs_s / GMP_LIMB_BITS + 1)
+ * sizeof (mp_limb_t));
if (pow5_ptr == NULL)
{
free (memory);
@@ -1026,26 +1091,26 @@ scale10_round_decimal_decoded (int e, mpn_t m, void *memory, int n)
if (abs_n > 0)
{
static mp_limb_t const small_pow5[13 + 1] =
- {
- 1, 5, 25, 125, 625, 3125, 15625, 78125, 390625, 1953125, 9765625,
- 48828125, 244140625, 1220703125
- };
+ {
+ 1, 5, 25, 125, 625, 3125, 15625, 78125, 390625, 1953125, 9765625,
+ 48828125, 244140625, 1220703125
+ };
unsigned int n13;
for (n13 = 0; n13 <= abs_n; n13 += 13)
- {
- mp_limb_t digit1 = small_pow5[n13 + 13 <= abs_n ? 13 : abs_n - n13];
- size_t j;
- mp_twolimb_t carry = 0;
- for (j = 0; j < pow5_len; j++)
- {
- mp_limb_t digit2 = pow5_ptr[j];
- carry += (mp_twolimb_t) digit1 * (mp_twolimb_t) digit2;
- pow5_ptr[j] = (mp_limb_t) carry;
- carry = carry >> GMP_LIMB_BITS;
- }
- if (carry > 0)
- pow5_ptr[pow5_len++] = (mp_limb_t) carry;
- }
+ {
+ mp_limb_t digit1 = small_pow5[n13 + 13 <= abs_n ? 13 : abs_n - n13];
+ size_t j;
+ mp_twolimb_t carry = 0;
+ for (j = 0; j < pow5_len; j++)
+ {
+ mp_limb_t digit2 = pow5_ptr[j];
+ carry += (mp_twolimb_t) digit1 * (mp_twolimb_t) digit2;
+ pow5_ptr[j] = (mp_limb_t) carry;
+ carry = carry >> GMP_LIMB_BITS;
+ }
+ if (carry > 0)
+ pow5_ptr[pow5_len++] = (mp_limb_t) carry;
+ }
}
s_limbs = abs_s / GMP_LIMB_BITS;
s_bits = abs_s % GMP_LIMB_BITS;
@@ -1053,129 +1118,129 @@ scale10_round_decimal_decoded (int e, mpn_t m, void *memory, int n)
{
/* Multiply with 2^|s|. */
if (s_bits > 0)
- {
- mp_limb_t *ptr = pow5_ptr;
- mp_twolimb_t accu = 0;
- size_t count;
- for (count = pow5_len; count > 0; count--)
- {
- accu += (mp_twolimb_t) *ptr << s_bits;
- *ptr++ = (mp_limb_t) accu;
- accu = accu >> GMP_LIMB_BITS;
- }
- if (accu > 0)
- {
- *ptr = (mp_limb_t) accu;
- pow5_len++;
- }
- }
+ {
+ mp_limb_t *ptr = pow5_ptr;
+ mp_twolimb_t accu = 0;
+ size_t count;
+ for (count = pow5_len; count > 0; count--)
+ {
+ accu += (mp_twolimb_t) *ptr << s_bits;
+ *ptr++ = (mp_limb_t) accu;
+ accu = accu >> GMP_LIMB_BITS;
+ }
+ if (accu > 0)
+ {
+ *ptr = (mp_limb_t) accu;
+ pow5_len++;
+ }
+ }
if (s_limbs > 0)
- {
- size_t count;
- for (count = pow5_len; count > 0;)
- {
- count--;
- pow5_ptr[s_limbs + count] = pow5_ptr[count];
- }
- for (count = s_limbs; count > 0;)
- {
- count--;
- pow5_ptr[count] = 0;
- }
- pow5_len += s_limbs;
- }
+ {
+ size_t count;
+ for (count = pow5_len; count > 0;)
+ {
+ count--;
+ pow5_ptr[s_limbs + count] = pow5_ptr[count];
+ }
+ for (count = s_limbs; count > 0;)
+ {
+ count--;
+ pow5_ptr[count] = 0;
+ }
+ pow5_len += s_limbs;
+ }
pow5.limbs = pow5_ptr;
pow5.nlimbs = pow5_len;
if (n >= 0)
- {
- /* Multiply m with pow5. No division needed. */
- z_memory = multiply (m, pow5, &z);
- }
+ {
+ /* Multiply m with pow5. No division needed. */
+ z_memory = multiply (m, pow5, &z);
+ }
else
- {
- /* Divide m by pow5 and round. */
- z_memory = divide (m, pow5, &z);
- }
+ {
+ /* Divide m by pow5 and round. */
+ z_memory = divide (m, pow5, &z);
+ }
}
else
{
pow5.limbs = pow5_ptr;
pow5.nlimbs = pow5_len;
if (n >= 0)
- {
- /* n >= 0, s < 0.
- Multiply m with pow5, then divide by 2^|s|. */
- mpn_t numerator;
- mpn_t denominator;
- void *tmp_memory;
- tmp_memory = multiply (m, pow5, &numerator);
- if (tmp_memory == NULL)
- {
- free (pow5_ptr);
- free (memory);
- return NULL;
- }
- /* Construct 2^|s|. */
- {
- mp_limb_t *ptr = pow5_ptr + pow5_len;
- size_t i;
- for (i = 0; i < s_limbs; i++)
- ptr[i] = 0;
- ptr[s_limbs] = (mp_limb_t) 1 << s_bits;
- denominator.limbs = ptr;
- denominator.nlimbs = s_limbs + 1;
- }
- z_memory = divide (numerator, denominator, &z);
- free (tmp_memory);
- }
+ {
+ /* n >= 0, s < 0.
+ Multiply m with pow5, then divide by 2^|s|. */
+ mpn_t numerator;
+ mpn_t denominator;
+ void *tmp_memory;
+ tmp_memory = multiply (m, pow5, &numerator);
+ if (tmp_memory == NULL)
+ {
+ free (pow5_ptr);
+ free (memory);
+ return NULL;
+ }
+ /* Construct 2^|s|. */
+ {
+ mp_limb_t *ptr = pow5_ptr + pow5_len;
+ size_t i;
+ for (i = 0; i < s_limbs; i++)
+ ptr[i] = 0;
+ ptr[s_limbs] = (mp_limb_t) 1 << s_bits;
+ denominator.limbs = ptr;
+ denominator.nlimbs = s_limbs + 1;
+ }
+ z_memory = divide (numerator, denominator, &z);
+ free (tmp_memory);
+ }
else
- {
- /* n < 0, s > 0.
- Multiply m with 2^s, then divide by pow5. */
- mpn_t numerator;
- mp_limb_t *num_ptr;
- num_ptr = (mp_limb_t *) malloc ((m.nlimbs + s_limbs + 1)
- * sizeof (mp_limb_t));
- if (num_ptr == NULL)
- {
- free (pow5_ptr);
- free (memory);
- return NULL;
- }
- {
- mp_limb_t *destptr = num_ptr;
- {
- size_t i;
- for (i = 0; i < s_limbs; i++)
- *destptr++ = 0;
- }
- if (s_bits > 0)
- {
- const mp_limb_t *sourceptr = m.limbs;
- mp_twolimb_t accu = 0;
- size_t count;
- for (count = m.nlimbs; count > 0; count--)
- {
- accu += (mp_twolimb_t) *sourceptr++ << s_bits;
- *destptr++ = (mp_limb_t) accu;
- accu = accu >> GMP_LIMB_BITS;
- }
- if (accu > 0)
- *destptr++ = (mp_limb_t) accu;
- }
- else
- {
- const mp_limb_t *sourceptr = m.limbs;
- size_t count;
- for (count = m.nlimbs; count > 0; count--)
- *destptr++ = *sourceptr++;
- }
- numerator.limbs = num_ptr;
- numerator.nlimbs = destptr - num_ptr;
- }
- z_memory = divide (numerator, pow5, &z);
- free (num_ptr);
- }
+ {
+ /* n < 0, s > 0.
+ Multiply m with 2^s, then divide by pow5. */
+ mpn_t numerator;
+ mp_limb_t *num_ptr;
+ num_ptr = (mp_limb_t *) malloc ((m.nlimbs + s_limbs + 1)
+ * sizeof (mp_limb_t));
+ if (num_ptr == NULL)
+ {
+ free (pow5_ptr);
+ free (memory);
+ return NULL;
+ }
+ {
+ mp_limb_t *destptr = num_ptr;
+ {
+ size_t i;
+ for (i = 0; i < s_limbs; i++)
+ *destptr++ = 0;
+ }
+ if (s_bits > 0)
+ {
+ const mp_limb_t *sourceptr = m.limbs;
+ mp_twolimb_t accu = 0;
+ size_t count;
+ for (count = m.nlimbs; count > 0; count--)
+ {
+ accu += (mp_twolimb_t) *sourceptr++ << s_bits;
+ *destptr++ = (mp_limb_t) accu;
+ accu = accu >> GMP_LIMB_BITS;
+ }
+ if (accu > 0)
+ *destptr++ = (mp_limb_t) accu;
+ }
+ else
+ {
+ const mp_limb_t *sourceptr = m.limbs;
+ size_t count;
+ for (count = m.nlimbs; count > 0; count--)
+ *destptr++ = *sourceptr++;
+ }
+ numerator.limbs = num_ptr;
+ numerator.nlimbs = destptr - num_ptr;
+ }
+ z_memory = divide (numerator, pow5, &z);
+ free (num_ptr);
+ }
}
free (pow5_ptr);
free (memory);
@@ -1199,7 +1264,7 @@ scale10_round_decimal_decoded (int e, mpn_t m, void *memory, int n)
static char *
scale10_round_decimal_long_double (long double x, int n)
{
- int e;
+ int e IF_LINT(= 0);
mpn_t m;
void *memory = decode_long_double (x, &e, &m);
return scale10_round_decimal_decoded (e, m, memory, n);
@@ -1217,7 +1282,7 @@ scale10_round_decimal_long_double (long double x, int n)
static char *
scale10_round_decimal_double (double x, int n)
{
- int e;
+ int e IF_LINT(= 0);
mpn_t m;
void *memory = decode_double (x, &e, &m);
return scale10_round_decimal_decoded (e, m, memory, n);
@@ -1247,35 +1312,35 @@ floorlog10l (long double x)
if (y < 0.5L)
{
while (y < (1.0L / (1 << (GMP_LIMB_BITS / 2)) / (1 << (GMP_LIMB_BITS / 2))))
- {
- y *= 1.0L * (1 << (GMP_LIMB_BITS / 2)) * (1 << (GMP_LIMB_BITS / 2));
- exp -= GMP_LIMB_BITS;
- }
+ {
+ y *= 1.0L * (1 << (GMP_LIMB_BITS / 2)) * (1 << (GMP_LIMB_BITS / 2));
+ exp -= GMP_LIMB_BITS;
+ }
if (y < (1.0L / (1 << 16)))
- {
- y *= 1.0L * (1 << 16);
- exp -= 16;
- }
+ {
+ y *= 1.0L * (1 << 16);
+ exp -= 16;
+ }
if (y < (1.0L / (1 << 8)))
- {
- y *= 1.0L * (1 << 8);
- exp -= 8;
- }
+ {
+ y *= 1.0L * (1 << 8);
+ exp -= 8;
+ }
if (y < (1.0L / (1 << 4)))
- {
- y *= 1.0L * (1 << 4);
- exp -= 4;
- }
+ {
+ y *= 1.0L * (1 << 4);
+ exp -= 4;
+ }
if (y < (1.0L / (1 << 2)))
- {
- y *= 1.0L * (1 << 2);
- exp -= 2;
- }
+ {
+ y *= 1.0L * (1 << 2);
+ exp -= 2;
+ }
if (y < (1.0L / (1 << 1)))
- {
- y *= 1.0L * (1 << 1);
- exp -= 1;
- }
+ {
+ y *= 1.0L * (1 << 1);
+ exp -= 1;
+ }
}
if (!(y >= 0.5L && y < 1.0L))
abort ();
@@ -1304,9 +1369,9 @@ floorlog10l (long double x)
}
/* Now 0.95 <= z <= 1.01. */
z = 1 - z;
- /* log(1-z) = - z - z^2/2 - z^3/3 - z^4/4 - ...
+ /* log2(1-z) = 1/log(2) * (- z - z^2/2 - z^3/3 - z^4/4 - ...)
Four terms are enough to get an approximation with error < 10^-7. */
- l -= z * (1.0 + z * (0.5 + z * ((1.0 / 3) + z * 0.25)));
+ l -= 1.4426950408889634074 * z * (1.0 + z * (0.5 + z * ((1.0 / 3) + z * 0.25)));
/* Finally multiply with log(2)/log(10), yields an approximation for
log10(x). */
l *= 0.30102999566398119523;
@@ -1338,35 +1403,35 @@ floorlog10 (double x)
if (y < 0.5)
{
while (y < (1.0 / (1 << (GMP_LIMB_BITS / 2)) / (1 << (GMP_LIMB_BITS / 2))))
- {
- y *= 1.0 * (1 << (GMP_LIMB_BITS / 2)) * (1 << (GMP_LIMB_BITS / 2));
- exp -= GMP_LIMB_BITS;
- }
+ {
+ y *= 1.0 * (1 << (GMP_LIMB_BITS / 2)) * (1 << (GMP_LIMB_BITS / 2));
+ exp -= GMP_LIMB_BITS;
+ }
if (y < (1.0 / (1 << 16)))
- {
- y *= 1.0 * (1 << 16);
- exp -= 16;
- }
+ {
+ y *= 1.0 * (1 << 16);
+ exp -= 16;
+ }
if (y < (1.0 / (1 << 8)))
- {
- y *= 1.0 * (1 << 8);
- exp -= 8;
- }
+ {
+ y *= 1.0 * (1 << 8);
+ exp -= 8;
+ }
if (y < (1.0 / (1 << 4)))
- {
- y *= 1.0 * (1 << 4);
- exp -= 4;
- }
+ {
+ y *= 1.0 * (1 << 4);
+ exp -= 4;
+ }
if (y < (1.0 / (1 << 2)))
- {
- y *= 1.0 * (1 << 2);
- exp -= 2;
- }
+ {
+ y *= 1.0 * (1 << 2);
+ exp -= 2;
+ }
if (y < (1.0 / (1 << 1)))
- {
- y *= 1.0 * (1 << 1);
- exp -= 1;
- }
+ {
+ y *= 1.0 * (1 << 1);
+ exp -= 1;
+ }
}
if (!(y >= 0.5 && y < 1.0))
abort ();
@@ -1395,9 +1460,9 @@ floorlog10 (double x)
}
/* Now 0.95 <= z <= 1.01. */
z = 1 - z;
- /* log(1-z) = - z - z^2/2 - z^3/3 - z^4/4 - ...
+ /* log2(1-z) = 1/log(2) * (- z - z^2/2 - z^3/3 - z^4/4 - ...)
Four terms are enough to get an approximation with error < 10^-7. */
- l -= z * (1.0 + z * (0.5 + z * ((1.0 / 3) + z * 0.25)));
+ l -= 1.4426950408889634074 * z * (1.0 + z * (0.5 + z * ((1.0 / 3) + z * 0.25)));
/* Finally multiply with log(2)/log(10), yields an approximation for
log10(x). */
l *= 0.30102999566398119523;
@@ -1407,11 +1472,277 @@ floorlog10 (double x)
# endif
+/* Tests whether a string of digits consists of exactly PRECISION zeroes and
+ a single '1' digit. */
+static int
+is_borderline (const char *digits, size_t precision)
+{
+ for (; precision > 0; precision--, digits++)
+ if (*digits != '0')
+ return 0;
+ if (*digits != '1')
+ return 0;
+ digits++;
+ return *digits == '\0';
+}
+
+#endif
+
+#if !USE_SNPRINTF || !HAVE_SNPRINTF_RETVAL_C99
+
+/* Use a different function name, to make it possible that the 'wchar_t'
+ parametrization and the 'char' parametrization get compiled in the same
+ translation unit. */
+# if WIDE_CHAR_VERSION
+# define MAX_ROOM_NEEDED wmax_room_needed
+# else
+# define MAX_ROOM_NEEDED max_room_needed
+# endif
+
+/* Returns the number of TCHAR_T units needed as temporary space for the result
+ of sprintf or SNPRINTF of a single conversion directive. */
+static inline size_t
+MAX_ROOM_NEEDED (const arguments *ap, size_t arg_index, FCHAR_T conversion,
+ arg_type type, int flags, size_t width, int has_precision,
+ size_t precision, int pad_ourselves)
+{
+ size_t tmp_length;
+
+ switch (conversion)
+ {
+ case 'd': case 'i': case 'u':
+# if HAVE_LONG_LONG_INT
+ if (type == TYPE_LONGLONGINT || type == TYPE_ULONGLONGINT)
+ tmp_length =
+ (unsigned int) (sizeof (unsigned long long) * CHAR_BIT
+ * 0.30103 /* binary -> decimal */
+ )
+ + 1; /* turn floor into ceil */
+ else
+# endif
+ if (type == TYPE_LONGINT || type == TYPE_ULONGINT)
+ tmp_length =
+ (unsigned int) (sizeof (unsigned long) * CHAR_BIT
+ * 0.30103 /* binary -> decimal */
+ )
+ + 1; /* turn floor into ceil */
+ else
+ tmp_length =
+ (unsigned int) (sizeof (unsigned int) * CHAR_BIT
+ * 0.30103 /* binary -> decimal */
+ )
+ + 1; /* turn floor into ceil */
+ if (tmp_length < precision)
+ tmp_length = precision;
+ /* Multiply by 2, as an estimate for FLAG_GROUP. */
+ tmp_length = xsum (tmp_length, tmp_length);
+ /* Add 1, to account for a leading sign. */
+ tmp_length = xsum (tmp_length, 1);
+ break;
+
+ case 'o':
+# if HAVE_LONG_LONG_INT
+ if (type == TYPE_LONGLONGINT || type == TYPE_ULONGLONGINT)
+ tmp_length =
+ (unsigned int) (sizeof (unsigned long long) * CHAR_BIT
+ * 0.333334 /* binary -> octal */
+ )
+ + 1; /* turn floor into ceil */
+ else
+# endif
+ if (type == TYPE_LONGINT || type == TYPE_ULONGINT)
+ tmp_length =
+ (unsigned int) (sizeof (unsigned long) * CHAR_BIT
+ * 0.333334 /* binary -> octal */
+ )
+ + 1; /* turn floor into ceil */
+ else
+ tmp_length =
+ (unsigned int) (sizeof (unsigned int) * CHAR_BIT
+ * 0.333334 /* binary -> octal */
+ )
+ + 1; /* turn floor into ceil */
+ if (tmp_length < precision)
+ tmp_length = precision;
+ /* Add 1, to account for a leading sign. */
+ tmp_length = xsum (tmp_length, 1);
+ break;
+
+ case 'x': case 'X':
+# if HAVE_LONG_LONG_INT
+ if (type == TYPE_LONGLONGINT || type == TYPE_ULONGLONGINT)
+ tmp_length =
+ (unsigned int) (sizeof (unsigned long long) * CHAR_BIT
+ * 0.25 /* binary -> hexadecimal */
+ )
+ + 1; /* turn floor into ceil */
+ else
+# endif
+ if (type == TYPE_LONGINT || type == TYPE_ULONGINT)
+ tmp_length =
+ (unsigned int) (sizeof (unsigned long) * CHAR_BIT
+ * 0.25 /* binary -> hexadecimal */
+ )
+ + 1; /* turn floor into ceil */
+ else
+ tmp_length =
+ (unsigned int) (sizeof (unsigned int) * CHAR_BIT
+ * 0.25 /* binary -> hexadecimal */
+ )
+ + 1; /* turn floor into ceil */
+ if (tmp_length < precision)
+ tmp_length = precision;
+ /* Add 2, to account for a leading sign or alternate form. */
+ tmp_length = xsum (tmp_length, 2);
+ break;
+
+ case 'f': case 'F':
+ if (type == TYPE_LONGDOUBLE)
+ tmp_length =
+ (unsigned int) (LDBL_MAX_EXP
+ * 0.30103 /* binary -> decimal */
+ * 2 /* estimate for FLAG_GROUP */
+ )
+ + 1 /* turn floor into ceil */
+ + 10; /* sign, decimal point etc. */
+ else
+ tmp_length =
+ (unsigned int) (DBL_MAX_EXP
+ * 0.30103 /* binary -> decimal */
+ * 2 /* estimate for FLAG_GROUP */
+ )
+ + 1 /* turn floor into ceil */
+ + 10; /* sign, decimal point etc. */
+ tmp_length = xsum (tmp_length, precision);
+ break;
+
+ case 'e': case 'E': case 'g': case 'G':
+ tmp_length =
+ 12; /* sign, decimal point, exponent etc. */
+ tmp_length = xsum (tmp_length, precision);
+ break;
+
+ case 'a': case 'A':
+ if (type == TYPE_LONGDOUBLE)
+ tmp_length =
+ (unsigned int) (LDBL_DIG
+ * 0.831 /* decimal -> hexadecimal */
+ )
+ + 1; /* turn floor into ceil */
+ else
+ tmp_length =
+ (unsigned int) (DBL_DIG
+ * 0.831 /* decimal -> hexadecimal */
+ )
+ + 1; /* turn floor into ceil */
+ if (tmp_length < precision)
+ tmp_length = precision;
+ /* Account for sign, decimal point etc. */
+ tmp_length = xsum (tmp_length, 12);
+ break;
+
+ case 'c':
+# if HAVE_WINT_T && !WIDE_CHAR_VERSION
+ if (type == TYPE_WIDE_CHAR)
+ tmp_length = MB_CUR_MAX;
+ else
+# endif
+ tmp_length = 1;
+ break;
+
+ case 's':
+# if HAVE_WCHAR_T
+ if (type == TYPE_WIDE_STRING)
+ {
+# if WIDE_CHAR_VERSION
+ /* ISO C says about %ls in fwprintf:
+ "If the precision is not specified or is greater than the size
+ of the array, the array shall contain a null wide character."
+ So if there is a precision, we must not use wcslen. */
+ const wchar_t *arg = ap->arg[arg_index].a.a_wide_string;
+
+ if (has_precision)
+ tmp_length = local_wcsnlen (arg, precision);
+ else
+ tmp_length = local_wcslen (arg);
+# else
+ /* ISO C says about %ls in fprintf:
+ "If a precision is specified, no more than that many bytes are
+ written (including shift sequences, if any), and the array
+ shall contain a null wide character if, to equal the multibyte
+ character sequence length given by the precision, the function
+ would need to access a wide character one past the end of the
+ array."
+ So if there is a precision, we must not use wcslen. */
+ /* This case has already been handled separately in VASNPRINTF. */
+ abort ();
+# endif
+ }
+ else
+# endif
+ {
+# if WIDE_CHAR_VERSION
+ /* ISO C says about %s in fwprintf:
+ "If the precision is not specified or is greater than the size
+ of the converted array, the converted array shall contain a
+ null wide character."
+ So if there is a precision, we must not use strlen. */
+ /* This case has already been handled separately in VASNPRINTF. */
+ abort ();
+# else
+ /* ISO C says about %s in fprintf:
+ "If the precision is not specified or greater than the size of
+ the array, the array shall contain a null character."
+ So if there is a precision, we must not use strlen. */
+ const char *arg = ap->arg[arg_index].a.a_string;
+
+ if (has_precision)
+ tmp_length = local_strnlen (arg, precision);
+ else
+ tmp_length = strlen (arg);
+# endif
+ }
+ break;
+
+ case 'p':
+ tmp_length =
+ (unsigned int) (sizeof (void *) * CHAR_BIT
+ * 0.25 /* binary -> hexadecimal */
+ )
+ + 1 /* turn floor into ceil */
+ + 2; /* account for leading 0x */
+ break;
+
+ default:
+ abort ();
+ }
+
+ if (!pad_ourselves)
+ {
+# if ENABLE_UNISTDIO
+ /* Padding considers the number of characters, therefore the number of
+ elements after padding may be
+ > max (tmp_length, width)
+ but is certainly
+ <= tmp_length + width. */
+ tmp_length = xsum (tmp_length, width);
+# else
+ /* Padding considers the number of elements, says POSIX. */
+ if (tmp_length < width)
+ tmp_length = width;
+# endif
+ }
+
+ tmp_length = xsum (tmp_length, 1); /* account for trailing NUL */
+
+ return tmp_length;
+}
+
#endif
DCHAR_T *
VASNPRINTF (DCHAR_T *resultbuf, size_t *lengthp,
- const FCHAR_T *format, va_list args)
+ const FCHAR_T *format, va_list args)
{
DIRECTIVES d;
arguments a;
@@ -1421,8 +1752,8 @@ VASNPRINTF (DCHAR_T *resultbuf, size_t *lengthp,
return NULL;
#define CLEANUP() \
- free (d.dir); \
- if (a.arg) \
+ free (d.dir); \
+ if (a.arg) \
free (a.arg);
if (PRINTF_FETCHARGS (args, &a) < 0)
@@ -1451,30 +1782,30 @@ VASNPRINTF (DCHAR_T *resultbuf, size_t *lengthp,
#if HAVE_ALLOCA
if (buf_neededlength < 4000 / sizeof (TCHAR_T))
{
- buf = (TCHAR_T *) alloca (buf_neededlength * sizeof (TCHAR_T));
- buf_malloced = NULL;
+ buf = (TCHAR_T *) alloca (buf_neededlength * sizeof (TCHAR_T));
+ buf_malloced = NULL;
}
else
#endif
{
- size_t buf_memsize = xtimes (buf_neededlength, sizeof (TCHAR_T));
- if (size_overflow_p (buf_memsize))
- goto out_of_memory_1;
- buf = (TCHAR_T *) malloc (buf_memsize);
- if (buf == NULL)
- goto out_of_memory_1;
- buf_malloced = buf;
+ size_t buf_memsize = xtimes (buf_neededlength, sizeof (TCHAR_T));
+ if (size_overflow_p (buf_memsize))
+ goto out_of_memory_1;
+ buf = (TCHAR_T *) malloc (buf_memsize);
+ if (buf == NULL)
+ goto out_of_memory_1;
+ buf_malloced = buf;
}
if (resultbuf != NULL)
{
- result = resultbuf;
- allocated = *lengthp;
+ result = resultbuf;
+ allocated = *lengthp;
}
else
{
- result = NULL;
- allocated = 0;
+ result = NULL;
+ allocated = 0;
}
length = 0;
/* Invariants:
@@ -1484,3138 +1815,3694 @@ VASNPRINTF (DCHAR_T *resultbuf, size_t *lengthp,
/* Ensures that allocated >= needed. Aborts through a jump to
out_of_memory if needed is SIZE_MAX or otherwise too big. */
#define ENSURE_ALLOCATION(needed) \
- if ((needed) > allocated) \
- { \
- size_t memory_size; \
- DCHAR_T *memory; \
- \
- allocated = (allocated > 0 ? xtimes (allocated, 2) : 12); \
- if ((needed) > allocated) \
- allocated = (needed); \
- memory_size = xtimes (allocated, sizeof (DCHAR_T)); \
- if (size_overflow_p (memory_size)) \
- goto out_of_memory; \
- if (result == resultbuf || result == NULL) \
- memory = (DCHAR_T *) malloc (memory_size); \
- else \
- memory = (DCHAR_T *) realloc (result, memory_size); \
- if (memory == NULL) \
- goto out_of_memory; \
- if (result == resultbuf && length > 0) \
- DCHAR_CPY (memory, result, length); \
- result = memory; \
+ if ((needed) > allocated) \
+ { \
+ size_t memory_size; \
+ DCHAR_T *memory; \
+ \
+ allocated = (allocated > 0 ? xtimes (allocated, 2) : 12); \
+ if ((needed) > allocated) \
+ allocated = (needed); \
+ memory_size = xtimes (allocated, sizeof (DCHAR_T)); \
+ if (size_overflow_p (memory_size)) \
+ goto out_of_memory; \
+ if (result == resultbuf || result == NULL) \
+ memory = (DCHAR_T *) malloc (memory_size); \
+ else \
+ memory = (DCHAR_T *) realloc (result, memory_size); \
+ if (memory == NULL) \
+ goto out_of_memory; \
+ if (result == resultbuf && length > 0) \
+ DCHAR_CPY (memory, result, length); \
+ result = memory; \
}
for (cp = format, i = 0, dp = &d.dir[0]; ; cp = dp->dir_end, i++, dp++)
{
- if (cp != dp->dir_start)
- {
- size_t n = dp->dir_start - cp;
- size_t augmented_length = xsum (length, n);
-
- ENSURE_ALLOCATION (augmented_length);
- /* This copies a piece of FCHAR_T[] into a DCHAR_T[]. Here we
- need that the format string contains only ASCII characters
- if FCHAR_T and DCHAR_T are not the same type. */
- if (sizeof (FCHAR_T) == sizeof (DCHAR_T))
- {
- DCHAR_CPY (result + length, (const DCHAR_T *) cp, n);
- length = augmented_length;
- }
- else
- {
- do
- result[length++] = (unsigned char) *cp++;
- while (--n > 0);
- }
- }
- if (i == d.count)
- break;
-
- /* Execute a single directive. */
- if (dp->conversion == '%')
- {
- size_t augmented_length;
-
- if (!(dp->arg_index == ARG_NONE))
- abort ();
- augmented_length = xsum (length, 1);
- ENSURE_ALLOCATION (augmented_length);
- result[length] = '%';
- length = augmented_length;
- }
- else
- {
- if (!(dp->arg_index != ARG_NONE))
- abort ();
-
- if (dp->conversion == 'n')
- {
- switch (a.arg[dp->arg_index].type)
- {
- case TYPE_COUNT_SCHAR_POINTER:
- *a.arg[dp->arg_index].a.a_count_schar_pointer = length;
- break;
- case TYPE_COUNT_SHORT_POINTER:
- *a.arg[dp->arg_index].a.a_count_short_pointer = length;
- break;
- case TYPE_COUNT_INT_POINTER:
- *a.arg[dp->arg_index].a.a_count_int_pointer = length;
- break;
- case TYPE_COUNT_LONGINT_POINTER:
- *a.arg[dp->arg_index].a.a_count_longint_pointer = length;
- break;
+ if (cp != dp->dir_start)
+ {
+ size_t n = dp->dir_start - cp;
+ size_t augmented_length = xsum (length, n);
+
+ ENSURE_ALLOCATION (augmented_length);
+ /* This copies a piece of FCHAR_T[] into a DCHAR_T[]. Here we
+ need that the format string contains only ASCII characters
+ if FCHAR_T and DCHAR_T are not the same type. */
+ if (sizeof (FCHAR_T) == sizeof (DCHAR_T))
+ {
+ DCHAR_CPY (result + length, (const DCHAR_T *) cp, n);
+ length = augmented_length;
+ }
+ else
+ {
+ do
+ result[length++] = (unsigned char) *cp++;
+ while (--n > 0);
+ }
+ }
+ if (i == d.count)
+ break;
+
+ /* Execute a single directive. */
+ if (dp->conversion == '%')
+ {
+ size_t augmented_length;
+
+ if (!(dp->arg_index == ARG_NONE))
+ abort ();
+ augmented_length = xsum (length, 1);
+ ENSURE_ALLOCATION (augmented_length);
+ result[length] = '%';
+ length = augmented_length;
+ }
+ else
+ {
+ if (!(dp->arg_index != ARG_NONE))
+ abort ();
+
+ if (dp->conversion == 'n')
+ {
+ switch (a.arg[dp->arg_index].type)
+ {
+ case TYPE_COUNT_SCHAR_POINTER:
+ *a.arg[dp->arg_index].a.a_count_schar_pointer = length;
+ break;
+ case TYPE_COUNT_SHORT_POINTER:
+ *a.arg[dp->arg_index].a.a_count_short_pointer = length;
+ break;
+ case TYPE_COUNT_INT_POINTER:
+ *a.arg[dp->arg_index].a.a_count_int_pointer = length;
+ break;
+ case TYPE_COUNT_LONGINT_POINTER:
+ *a.arg[dp->arg_index].a.a_count_longint_pointer = length;
+ break;
#if HAVE_LONG_LONG_INT
- case TYPE_COUNT_LONGLONGINT_POINTER:
- *a.arg[dp->arg_index].a.a_count_longlongint_pointer = length;
- break;
+ case TYPE_COUNT_LONGLONGINT_POINTER:
+ *a.arg[dp->arg_index].a.a_count_longlongint_pointer = length;
+ break;
#endif
- default:
- abort ();
- }
- }
+ default:
+ abort ();
+ }
+ }
#if ENABLE_UNISTDIO
- /* The unistdio extensions. */
- else if (dp->conversion == 'U')
- {
- arg_type type = a.arg[dp->arg_index].type;
- int flags = dp->flags;
- int has_width;
- size_t width;
- int has_precision;
- size_t precision;
-
- has_width = 0;
- width = 0;
- if (dp->width_start != dp->width_end)
- {
- if (dp->width_arg_index != ARG_NONE)
- {
- int arg;
-
- if (!(a.arg[dp->width_arg_index].type == TYPE_INT))
- abort ();
- arg = a.arg[dp->width_arg_index].a.a_int;
- if (arg < 0)
- {
- /* "A negative field width is taken as a '-' flag
- followed by a positive field width." */
- flags |= FLAG_LEFT;
- width = (unsigned int) (-arg);
- }
- else
- width = arg;
- }
- else
- {
- const FCHAR_T *digitp = dp->width_start;
-
- do
- width = xsum (xtimes (width, 10), *digitp++ - '0');
- while (digitp != dp->width_end);
- }
- has_width = 1;
- }
-
- has_precision = 0;
- precision = 0;
- if (dp->precision_start != dp->precision_end)
- {
- if (dp->precision_arg_index != ARG_NONE)
- {
- int arg;
-
- if (!(a.arg[dp->precision_arg_index].type == TYPE_INT))
- abort ();
- arg = a.arg[dp->precision_arg_index].a.a_int;
- /* "A negative precision is taken as if the precision
- were omitted." */
- if (arg >= 0)
- {
- precision = arg;
- has_precision = 1;
- }
- }
- else
- {
- const FCHAR_T *digitp = dp->precision_start + 1;
-
- precision = 0;
- while (digitp != dp->precision_end)
- precision = xsum (xtimes (precision, 10), *digitp++ - '0');
- has_precision = 1;
- }
- }
-
- switch (type)
- {
- case TYPE_U8_STRING:
- {
- const uint8_t *arg = a.arg[dp->arg_index].a.a_u8_string;
- const uint8_t *arg_end;
- size_t characters;
-
- if (has_precision)
- {
- /* Use only PRECISION characters, from the left. */
- arg_end = arg;
- characters = 0;
- for (; precision > 0; precision--)
- {
- int count = u8_strmblen (arg_end);
- if (count == 0)
- break;
- if (count < 0)
- {
- if (!(result == resultbuf || result == NULL))
- free (result);
- if (buf_malloced != NULL)
- free (buf_malloced);
- CLEANUP ();
- errno = EILSEQ;
- return NULL;
- }
- arg_end += count;
- characters++;
- }
- }
- else if (has_width)
- {
- /* Use the entire string, and count the number of
- characters. */
- arg_end = arg;
- characters = 0;
- for (;;)
- {
- int count = u8_strmblen (arg_end);
- if (count == 0)
- break;
- if (count < 0)
- {
- if (!(result == resultbuf || result == NULL))
- free (result);
- if (buf_malloced != NULL)
- free (buf_malloced);
- CLEANUP ();
- errno = EILSEQ;
- return NULL;
- }
- arg_end += count;
- characters++;
- }
- }
- else
- {
- /* Use the entire string. */
- arg_end = arg + u8_strlen (arg);
- /* The number of characters doesn't matter. */
- characters = 0;
- }
-
- if (has_width && width > characters
- && !(dp->flags & FLAG_LEFT))
- {
- size_t n = width - characters;
- ENSURE_ALLOCATION (xsum (length, n));
- DCHAR_SET (result + length, ' ', n);
- length += n;
- }
+ /* The unistdio extensions. */
+ else if (dp->conversion == 'U')
+ {
+ arg_type type = a.arg[dp->arg_index].type;
+ int flags = dp->flags;
+ int has_width;
+ size_t width;
+ int has_precision;
+ size_t precision;
+
+ has_width = 0;
+ width = 0;
+ if (dp->width_start != dp->width_end)
+ {
+ if (dp->width_arg_index != ARG_NONE)
+ {
+ int arg;
+
+ if (!(a.arg[dp->width_arg_index].type == TYPE_INT))
+ abort ();
+ arg = a.arg[dp->width_arg_index].a.a_int;
+ if (arg < 0)
+ {
+ /* "A negative field width is taken as a '-' flag
+ followed by a positive field width." */
+ flags |= FLAG_LEFT;
+ width = (unsigned int) (-arg);
+ }
+ else
+ width = arg;
+ }
+ else
+ {
+ const FCHAR_T *digitp = dp->width_start;
+
+ do
+ width = xsum (xtimes (width, 10), *digitp++ - '0');
+ while (digitp != dp->width_end);
+ }
+ has_width = 1;
+ }
+
+ has_precision = 0;
+ precision = 0;
+ if (dp->precision_start != dp->precision_end)
+ {
+ if (dp->precision_arg_index != ARG_NONE)
+ {
+ int arg;
+
+ if (!(a.arg[dp->precision_arg_index].type == TYPE_INT))
+ abort ();
+ arg = a.arg[dp->precision_arg_index].a.a_int;
+ /* "A negative precision is taken as if the precision
+ were omitted." */
+ if (arg >= 0)
+ {
+ precision = arg;
+ has_precision = 1;
+ }
+ }
+ else
+ {
+ const FCHAR_T *digitp = dp->precision_start + 1;
+
+ precision = 0;
+ while (digitp != dp->precision_end)
+ precision = xsum (xtimes (precision, 10), *digitp++ - '0');
+ has_precision = 1;
+ }
+ }
+
+ switch (type)
+ {
+ case TYPE_U8_STRING:
+ {
+ const uint8_t *arg = a.arg[dp->arg_index].a.a_u8_string;
+ const uint8_t *arg_end;
+ size_t characters;
+
+ if (has_precision)
+ {
+ /* Use only PRECISION characters, from the left. */
+ arg_end = arg;
+ characters = 0;
+ for (; precision > 0; precision--)
+ {
+ int count = u8_strmblen (arg_end);
+ if (count == 0)
+ break;
+ if (count < 0)
+ {
+ if (!(result == resultbuf || result == NULL))
+ free (result);
+ if (buf_malloced != NULL)
+ free (buf_malloced);
+ CLEANUP ();
+ errno = EILSEQ;
+ return NULL;
+ }
+ arg_end += count;
+ characters++;
+ }
+ }
+ else if (has_width)
+ {
+ /* Use the entire string, and count the number of
+ characters. */
+ arg_end = arg;
+ characters = 0;
+ for (;;)
+ {
+ int count = u8_strmblen (arg_end);
+ if (count == 0)
+ break;
+ if (count < 0)
+ {
+ if (!(result == resultbuf || result == NULL))
+ free (result);
+ if (buf_malloced != NULL)
+ free (buf_malloced);
+ CLEANUP ();
+ errno = EILSEQ;
+ return NULL;
+ }
+ arg_end += count;
+ characters++;
+ }
+ }
+ else
+ {
+ /* Use the entire string. */
+ arg_end = arg + u8_strlen (arg);
+ /* The number of characters doesn't matter. */
+ characters = 0;
+ }
+
+ if (has_width && width > characters
+ && !(dp->flags & FLAG_LEFT))
+ {
+ size_t n = width - characters;
+ ENSURE_ALLOCATION (xsum (length, n));
+ DCHAR_SET (result + length, ' ', n);
+ length += n;
+ }
# if DCHAR_IS_UINT8_T
- {
- size_t n = arg_end - arg;
- ENSURE_ALLOCATION (xsum (length, n));
- DCHAR_CPY (result + length, arg, n);
- length += n;
- }
+ {
+ size_t n = arg_end - arg;
+ ENSURE_ALLOCATION (xsum (length, n));
+ DCHAR_CPY (result + length, arg, n);
+ length += n;
+ }
# else
- { /* Convert. */
- DCHAR_T *converted = result + length;
- size_t converted_len = allocated - length;
+ { /* Convert. */
+ DCHAR_T *converted = result + length;
+ size_t converted_len = allocated - length;
# if DCHAR_IS_TCHAR
- /* Convert from UTF-8 to locale encoding. */
- if (u8_conv_to_encoding (locale_charset (),
- iconveh_question_mark,
- arg, arg_end - arg, NULL,
- &converted, &converted_len)
- < 0)
+ /* Convert from UTF-8 to locale encoding. */
+ converted =
+ u8_conv_to_encoding (locale_charset (),
+ iconveh_question_mark,
+ arg, arg_end - arg, NULL,
+ converted, &converted_len);
# else
- /* Convert from UTF-8 to UTF-16/UTF-32. */
- converted =
- U8_TO_DCHAR (arg, arg_end - arg,
- converted, &converted_len);
- if (converted == NULL)
+ /* Convert from UTF-8 to UTF-16/UTF-32. */
+ converted =
+ U8_TO_DCHAR (arg, arg_end - arg,
+ converted, &converted_len);
# endif
- {
- int saved_errno = errno;
- if (!(result == resultbuf || result == NULL))
- free (result);
- if (buf_malloced != NULL)
- free (buf_malloced);
- CLEANUP ();
- errno = saved_errno;
- return NULL;
- }
- if (converted != result + length)
- {
- ENSURE_ALLOCATION (xsum (length, converted_len));
- DCHAR_CPY (result + length, converted, converted_len);
- free (converted);
- }
- length += converted_len;
- }
+ if (converted == NULL)
+ {
+ int saved_errno = errno;
+ if (!(result == resultbuf || result == NULL))
+ free (result);
+ if (buf_malloced != NULL)
+ free (buf_malloced);
+ CLEANUP ();
+ errno = saved_errno;
+ return NULL;
+ }
+ if (converted != result + length)
+ {
+ ENSURE_ALLOCATION (xsum (length, converted_len));
+ DCHAR_CPY (result + length, converted, converted_len);
+ free (converted);
+ }
+ length += converted_len;
+ }
# endif
- if (has_width && width > characters
- && (dp->flags & FLAG_LEFT))
- {
- size_t n = width - characters;
- ENSURE_ALLOCATION (xsum (length, n));
- DCHAR_SET (result + length, ' ', n);
- length += n;
- }
- }
- break;
-
- case TYPE_U16_STRING:
- {
- const uint16_t *arg = a.arg[dp->arg_index].a.a_u16_string;
- const uint16_t *arg_end;
- size_t characters;
-
- if (has_precision)
- {
- /* Use only PRECISION characters, from the left. */
- arg_end = arg;
- characters = 0;
- for (; precision > 0; precision--)
- {
- int count = u16_strmblen (arg_end);
- if (count == 0)
- break;
- if (count < 0)
- {
- if (!(result == resultbuf || result == NULL))
- free (result);
- if (buf_malloced != NULL)
- free (buf_malloced);
- CLEANUP ();
- errno = EILSEQ;
- return NULL;
- }
- arg_end += count;
- characters++;
- }
- }
- else if (has_width)
- {
- /* Use the entire string, and count the number of
- characters. */
- arg_end = arg;
- characters = 0;
- for (;;)
- {
- int count = u16_strmblen (arg_end);
- if (count == 0)
- break;
- if (count < 0)
- {
- if (!(result == resultbuf || result == NULL))
- free (result);
- if (buf_malloced != NULL)
- free (buf_malloced);
- CLEANUP ();
- errno = EILSEQ;
- return NULL;
- }
- arg_end += count;
- characters++;
- }
- }
- else
- {
- /* Use the entire string. */
- arg_end = arg + u16_strlen (arg);
- /* The number of characters doesn't matter. */
- characters = 0;
- }
-
- if (has_width && width > characters
- && !(dp->flags & FLAG_LEFT))
- {
- size_t n = width - characters;
- ENSURE_ALLOCATION (xsum (length, n));
- DCHAR_SET (result + length, ' ', n);
- length += n;
- }
+ if (has_width && width > characters
+ && (dp->flags & FLAG_LEFT))
+ {
+ size_t n = width - characters;
+ ENSURE_ALLOCATION (xsum (length, n));
+ DCHAR_SET (result + length, ' ', n);
+ length += n;
+ }
+ }
+ break;
+
+ case TYPE_U16_STRING:
+ {
+ const uint16_t *arg = a.arg[dp->arg_index].a.a_u16_string;
+ const uint16_t *arg_end;
+ size_t characters;
+
+ if (has_precision)
+ {
+ /* Use only PRECISION characters, from the left. */
+ arg_end = arg;
+ characters = 0;
+ for (; precision > 0; precision--)
+ {
+ int count = u16_strmblen (arg_end);
+ if (count == 0)
+ break;
+ if (count < 0)
+ {
+ if (!(result == resultbuf || result == NULL))
+ free (result);
+ if (buf_malloced != NULL)
+ free (buf_malloced);
+ CLEANUP ();
+ errno = EILSEQ;
+ return NULL;
+ }
+ arg_end += count;
+ characters++;
+ }
+ }
+ else if (has_width)
+ {
+ /* Use the entire string, and count the number of
+ characters. */
+ arg_end = arg;
+ characters = 0;
+ for (;;)
+ {
+ int count = u16_strmblen (arg_end);
+ if (count == 0)
+ break;
+ if (count < 0)
+ {
+ if (!(result == resultbuf || result == NULL))
+ free (result);
+ if (buf_malloced != NULL)
+ free (buf_malloced);
+ CLEANUP ();
+ errno = EILSEQ;
+ return NULL;
+ }
+ arg_end += count;
+ characters++;
+ }
+ }
+ else
+ {
+ /* Use the entire string. */
+ arg_end = arg + u16_strlen (arg);
+ /* The number of characters doesn't matter. */
+ characters = 0;
+ }
+
+ if (has_width && width > characters
+ && !(dp->flags & FLAG_LEFT))
+ {
+ size_t n = width - characters;
+ ENSURE_ALLOCATION (xsum (length, n));
+ DCHAR_SET (result + length, ' ', n);
+ length += n;
+ }
# if DCHAR_IS_UINT16_T
- {
- size_t n = arg_end - arg;
- ENSURE_ALLOCATION (xsum (length, n));
- DCHAR_CPY (result + length, arg, n);
- length += n;
- }
+ {
+ size_t n = arg_end - arg;
+ ENSURE_ALLOCATION (xsum (length, n));
+ DCHAR_CPY (result + length, arg, n);
+ length += n;
+ }
# else
- { /* Convert. */
- DCHAR_T *converted = result + length;
- size_t converted_len = allocated - length;
+ { /* Convert. */
+ DCHAR_T *converted = result + length;
+ size_t converted_len = allocated - length;
# if DCHAR_IS_TCHAR
- /* Convert from UTF-16 to locale encoding. */
- if (u16_conv_to_encoding (locale_charset (),
- iconveh_question_mark,
- arg, arg_end - arg, NULL,
- &converted, &converted_len)
- < 0)
+ /* Convert from UTF-16 to locale encoding. */
+ converted =
+ u16_conv_to_encoding (locale_charset (),
+ iconveh_question_mark,
+ arg, arg_end - arg, NULL,
+ converted, &converted_len);
# else
- /* Convert from UTF-16 to UTF-8/UTF-32. */
- converted =
- U16_TO_DCHAR (arg, arg_end - arg,
- converted, &converted_len);
- if (converted == NULL)
+ /* Convert from UTF-16 to UTF-8/UTF-32. */
+ converted =
+ U16_TO_DCHAR (arg, arg_end - arg,
+ converted, &converted_len);
# endif
- {
- int saved_errno = errno;
- if (!(result == resultbuf || result == NULL))
- free (result);
- if (buf_malloced != NULL)
- free (buf_malloced);
- CLEANUP ();
- errno = saved_errno;
- return NULL;
- }
- if (converted != result + length)
- {
- ENSURE_ALLOCATION (xsum (length, converted_len));
- DCHAR_CPY (result + length, converted, converted_len);
- free (converted);
- }
- length += converted_len;
- }
+ if (converted == NULL)
+ {
+ int saved_errno = errno;
+ if (!(result == resultbuf || result == NULL))
+ free (result);
+ if (buf_malloced != NULL)
+ free (buf_malloced);
+ CLEANUP ();
+ errno = saved_errno;
+ return NULL;
+ }
+ if (converted != result + length)
+ {
+ ENSURE_ALLOCATION (xsum (length, converted_len));
+ DCHAR_CPY (result + length, converted, converted_len);
+ free (converted);
+ }
+ length += converted_len;
+ }
# endif
- if (has_width && width > characters
- && (dp->flags & FLAG_LEFT))
- {
- size_t n = width - characters;
- ENSURE_ALLOCATION (xsum (length, n));
- DCHAR_SET (result + length, ' ', n);
- length += n;
- }
- }
- break;
-
- case TYPE_U32_STRING:
- {
- const uint32_t *arg = a.arg[dp->arg_index].a.a_u32_string;
- const uint32_t *arg_end;
- size_t characters;
-
- if (has_precision)
- {
- /* Use only PRECISION characters, from the left. */
- arg_end = arg;
- characters = 0;
- for (; precision > 0; precision--)
- {
- int count = u32_strmblen (arg_end);
- if (count == 0)
- break;
- if (count < 0)
- {
- if (!(result == resultbuf || result == NULL))
- free (result);
- if (buf_malloced != NULL)
- free (buf_malloced);
- CLEANUP ();
- errno = EILSEQ;
- return NULL;
- }
- arg_end += count;
- characters++;
- }
- }
- else if (has_width)
- {
- /* Use the entire string, and count the number of
- characters. */
- arg_end = arg;
- characters = 0;
- for (;;)
- {
- int count = u32_strmblen (arg_end);
- if (count == 0)
- break;
- if (count < 0)
- {
- if (!(result == resultbuf || result == NULL))
- free (result);
- if (buf_malloced != NULL)
- free (buf_malloced);
- CLEANUP ();
- errno = EILSEQ;
- return NULL;
- }
- arg_end += count;
- characters++;
- }
- }
- else
- {
- /* Use the entire string. */
- arg_end = arg + u32_strlen (arg);
- /* The number of characters doesn't matter. */
- characters = 0;
- }
-
- if (has_width && width > characters
- && !(dp->flags & FLAG_LEFT))
- {
- size_t n = width - characters;
- ENSURE_ALLOCATION (xsum (length, n));
- DCHAR_SET (result + length, ' ', n);
- length += n;
- }
+ if (has_width && width > characters
+ && (dp->flags & FLAG_LEFT))
+ {
+ size_t n = width - characters;
+ ENSURE_ALLOCATION (xsum (length, n));
+ DCHAR_SET (result + length, ' ', n);
+ length += n;
+ }
+ }
+ break;
+
+ case TYPE_U32_STRING:
+ {
+ const uint32_t *arg = a.arg[dp->arg_index].a.a_u32_string;
+ const uint32_t *arg_end;
+ size_t characters;
+
+ if (has_precision)
+ {
+ /* Use only PRECISION characters, from the left. */
+ arg_end = arg;
+ characters = 0;
+ for (; precision > 0; precision--)
+ {
+ int count = u32_strmblen (arg_end);
+ if (count == 0)
+ break;
+ if (count < 0)
+ {
+ if (!(result == resultbuf || result == NULL))
+ free (result);
+ if (buf_malloced != NULL)
+ free (buf_malloced);
+ CLEANUP ();
+ errno = EILSEQ;
+ return NULL;
+ }
+ arg_end += count;
+ characters++;
+ }
+ }
+ else if (has_width)
+ {
+ /* Use the entire string, and count the number of
+ characters. */
+ arg_end = arg;
+ characters = 0;
+ for (;;)
+ {
+ int count = u32_strmblen (arg_end);
+ if (count == 0)
+ break;
+ if (count < 0)
+ {
+ if (!(result == resultbuf || result == NULL))
+ free (result);
+ if (buf_malloced != NULL)
+ free (buf_malloced);
+ CLEANUP ();
+ errno = EILSEQ;
+ return NULL;
+ }
+ arg_end += count;
+ characters++;
+ }
+ }
+ else
+ {
+ /* Use the entire string. */
+ arg_end = arg + u32_strlen (arg);
+ /* The number of characters doesn't matter. */
+ characters = 0;
+ }
+
+ if (has_width && width > characters
+ && !(dp->flags & FLAG_LEFT))
+ {
+ size_t n = width - characters;
+ ENSURE_ALLOCATION (xsum (length, n));
+ DCHAR_SET (result + length, ' ', n);
+ length += n;
+ }
# if DCHAR_IS_UINT32_T
- {
- size_t n = arg_end - arg;
- ENSURE_ALLOCATION (xsum (length, n));
- DCHAR_CPY (result + length, arg, n);
- length += n;
- }
+ {
+ size_t n = arg_end - arg;
+ ENSURE_ALLOCATION (xsum (length, n));
+ DCHAR_CPY (result + length, arg, n);
+ length += n;
+ }
# else
- { /* Convert. */
- DCHAR_T *converted = result + length;
- size_t converted_len = allocated - length;
+ { /* Convert. */
+ DCHAR_T *converted = result + length;
+ size_t converted_len = allocated - length;
# if DCHAR_IS_TCHAR
- /* Convert from UTF-32 to locale encoding. */
- if (u32_conv_to_encoding (locale_charset (),
- iconveh_question_mark,
- arg, arg_end - arg, NULL,
- &converted, &converted_len)
- < 0)
+ /* Convert from UTF-32 to locale encoding. */
+ converted =
+ u32_conv_to_encoding (locale_charset (),
+ iconveh_question_mark,
+ arg, arg_end - arg, NULL,
+ converted, &converted_len);
# else
- /* Convert from UTF-32 to UTF-8/UTF-16. */
- converted =
- U32_TO_DCHAR (arg, arg_end - arg,
- converted, &converted_len);
- if (converted == NULL)
+ /* Convert from UTF-32 to UTF-8/UTF-16. */
+ converted =
+ U32_TO_DCHAR (arg, arg_end - arg,
+ converted, &converted_len);
# endif
- {
- int saved_errno = errno;
- if (!(result == resultbuf || result == NULL))
- free (result);
- if (buf_malloced != NULL)
- free (buf_malloced);
- CLEANUP ();
- errno = saved_errno;
- return NULL;
- }
- if (converted != result + length)
- {
- ENSURE_ALLOCATION (xsum (length, converted_len));
- DCHAR_CPY (result + length, converted, converted_len);
- free (converted);
- }
- length += converted_len;
- }
+ if (converted == NULL)
+ {
+ int saved_errno = errno;
+ if (!(result == resultbuf || result == NULL))
+ free (result);
+ if (buf_malloced != NULL)
+ free (buf_malloced);
+ CLEANUP ();
+ errno = saved_errno;
+ return NULL;
+ }
+ if (converted != result + length)
+ {
+ ENSURE_ALLOCATION (xsum (length, converted_len));
+ DCHAR_CPY (result + length, converted, converted_len);
+ free (converted);
+ }
+ length += converted_len;
+ }
# endif
- if (has_width && width > characters
- && (dp->flags & FLAG_LEFT))
- {
- size_t n = width - characters;
- ENSURE_ALLOCATION (xsum (length, n));
- DCHAR_SET (result + length, ' ', n);
- length += n;
- }
- }
- break;
-
- default:
- abort ();
- }
- }
+ if (has_width && width > characters
+ && (dp->flags & FLAG_LEFT))
+ {
+ size_t n = width - characters;
+ ENSURE_ALLOCATION (xsum (length, n));
+ DCHAR_SET (result + length, ' ', n);
+ length += n;
+ }
+ }
+ break;
+
+ default:
+ abort ();
+ }
+ }
+#endif
+#if (!USE_SNPRINTF || !HAVE_SNPRINTF_RETVAL_C99 || (NEED_PRINTF_DIRECTIVE_LS && !defined IN_LIBINTL)) && HAVE_WCHAR_T
+ else if (dp->conversion == 's'
+# if WIDE_CHAR_VERSION
+ && a.arg[dp->arg_index].type != TYPE_WIDE_STRING
+# else
+ && a.arg[dp->arg_index].type == TYPE_WIDE_STRING
+# endif
+ )
+ {
+ /* The normal handling of the 's' directive below requires
+ allocating a temporary buffer. The determination of its
+ length (tmp_length), in the case when a precision is
+ specified, below requires a conversion between a char[]
+ string and a wchar_t[] wide string. It could be done, but
+ we have no guarantee that the implementation of sprintf will
+ use the exactly same algorithm. Without this guarantee, it
+ is possible to have buffer overrun bugs. In order to avoid
+ such bugs, we implement the entire processing of the 's'
+ directive ourselves. */
+ int flags = dp->flags;
+ int has_width;
+ size_t width;
+ int has_precision;
+ size_t precision;
+
+ has_width = 0;
+ width = 0;
+ if (dp->width_start != dp->width_end)
+ {
+ if (dp->width_arg_index != ARG_NONE)
+ {
+ int arg;
+
+ if (!(a.arg[dp->width_arg_index].type == TYPE_INT))
+ abort ();
+ arg = a.arg[dp->width_arg_index].a.a_int;
+ if (arg < 0)
+ {
+ /* "A negative field width is taken as a '-' flag
+ followed by a positive field width." */
+ flags |= FLAG_LEFT;
+ width = (unsigned int) (-arg);
+ }
+ else
+ width = arg;
+ }
+ else
+ {
+ const FCHAR_T *digitp = dp->width_start;
+
+ do
+ width = xsum (xtimes (width, 10), *digitp++ - '0');
+ while (digitp != dp->width_end);
+ }
+ has_width = 1;
+ }
+
+ has_precision = 0;
+ precision = 6;
+ if (dp->precision_start != dp->precision_end)
+ {
+ if (dp->precision_arg_index != ARG_NONE)
+ {
+ int arg;
+
+ if (!(a.arg[dp->precision_arg_index].type == TYPE_INT))
+ abort ();
+ arg = a.arg[dp->precision_arg_index].a.a_int;
+ /* "A negative precision is taken as if the precision
+ were omitted." */
+ if (arg >= 0)
+ {
+ precision = arg;
+ has_precision = 1;
+ }
+ }
+ else
+ {
+ const FCHAR_T *digitp = dp->precision_start + 1;
+
+ precision = 0;
+ while (digitp != dp->precision_end)
+ precision = xsum (xtimes (precision, 10), *digitp++ - '0');
+ has_precision = 1;
+ }
+ }
+
+# if WIDE_CHAR_VERSION
+ /* %s in vasnwprintf. See the specification of fwprintf. */
+ {
+ const char *arg = a.arg[dp->arg_index].a.a_string;
+ const char *arg_end;
+ size_t characters;
+
+ if (has_precision)
+ {
+ /* Use only as many bytes as needed to produce PRECISION
+ wide characters, from the left. */
+# if HAVE_MBRTOWC
+ mbstate_t state;
+ memset (&state, '\0', sizeof (mbstate_t));
+# endif
+ arg_end = arg;
+ characters = 0;
+ for (; precision > 0; precision--)
+ {
+ int count;
+# if HAVE_MBRTOWC
+ count = mbrlen (arg_end, MB_CUR_MAX, &state);
+# else
+ count = mblen (arg_end, MB_CUR_MAX);
+# endif
+ if (count == 0)
+ /* Found the terminating NUL. */
+ break;
+ if (count < 0)
+ {
+ /* Invalid or incomplete multibyte character. */
+ if (!(result == resultbuf || result == NULL))
+ free (result);
+ if (buf_malloced != NULL)
+ free (buf_malloced);
+ CLEANUP ();
+ errno = EILSEQ;
+ return NULL;
+ }
+ arg_end += count;
+ characters++;
+ }
+ }
+ else if (has_width)
+ {
+ /* Use the entire string, and count the number of wide
+ characters. */
+# if HAVE_MBRTOWC
+ mbstate_t state;
+ memset (&state, '\0', sizeof (mbstate_t));
+# endif
+ arg_end = arg;
+ characters = 0;
+ for (;;)
+ {
+ int count;
+# if HAVE_MBRTOWC
+ count = mbrlen (arg_end, MB_CUR_MAX, &state);
+# else
+ count = mblen (arg_end, MB_CUR_MAX);
+# endif
+ if (count == 0)
+ /* Found the terminating NUL. */
+ break;
+ if (count < 0)
+ {
+ /* Invalid or incomplete multibyte character. */
+ if (!(result == resultbuf || result == NULL))
+ free (result);
+ if (buf_malloced != NULL)
+ free (buf_malloced);
+ CLEANUP ();
+ errno = EILSEQ;
+ return NULL;
+ }
+ arg_end += count;
+ characters++;
+ }
+ }
+ else
+ {
+ /* Use the entire string. */
+ arg_end = arg + strlen (arg);
+ /* The number of characters doesn't matter. */
+ characters = 0;
+ }
+
+ if (has_width && width > characters
+ && !(dp->flags & FLAG_LEFT))
+ {
+ size_t n = width - characters;
+ ENSURE_ALLOCATION (xsum (length, n));
+ DCHAR_SET (result + length, ' ', n);
+ length += n;
+ }
+
+ if (has_precision || has_width)
+ {
+ /* We know the number of wide characters in advance. */
+ size_t remaining;
+# if HAVE_MBRTOWC
+ mbstate_t state;
+ memset (&state, '\0', sizeof (mbstate_t));
+# endif
+ ENSURE_ALLOCATION (xsum (length, characters));
+ for (remaining = characters; remaining > 0; remaining--)
+ {
+ wchar_t wc;
+ int count;
+# if HAVE_MBRTOWC
+ count = mbrtowc (&wc, arg, arg_end - arg, &state);
+# else
+ count = mbtowc (&wc, arg, arg_end - arg);
+# endif
+ if (count <= 0)
+ /* mbrtowc not consistent with mbrlen, or mbtowc
+ not consistent with mblen. */
+ abort ();
+ result[length++] = wc;
+ arg += count;
+ }
+ if (!(arg == arg_end))
+ abort ();
+ }
+ else
+ {
+# if HAVE_MBRTOWC
+ mbstate_t state;
+ memset (&state, '\0', sizeof (mbstate_t));
+# endif
+ while (arg < arg_end)
+ {
+ wchar_t wc;
+ int count;
+# if HAVE_MBRTOWC
+ count = mbrtowc (&wc, arg, arg_end - arg, &state);
+# else
+ count = mbtowc (&wc, arg, arg_end - arg);
+# endif
+ if (count <= 0)
+ /* mbrtowc not consistent with mbrlen, or mbtowc
+ not consistent with mblen. */
+ abort ();
+ ENSURE_ALLOCATION (xsum (length, 1));
+ result[length++] = wc;
+ arg += count;
+ }
+ }
+
+ if (has_width && width > characters
+ && (dp->flags & FLAG_LEFT))
+ {
+ size_t n = width - characters;
+ ENSURE_ALLOCATION (xsum (length, n));
+ DCHAR_SET (result + length, ' ', n);
+ length += n;
+ }
+ }
+# else
+ /* %ls in vasnprintf. See the specification of fprintf. */
+ {
+ const wchar_t *arg = a.arg[dp->arg_index].a.a_wide_string;
+ const wchar_t *arg_end;
+ size_t characters;
+# if !DCHAR_IS_TCHAR
+ /* This code assumes that TCHAR_T is 'char'. */
+ typedef int TCHAR_T_verify[2 * (sizeof (TCHAR_T) == 1) - 1];
+ TCHAR_T *tmpsrc;
+ DCHAR_T *tmpdst;
+ size_t tmpdst_len;
+# endif
+ size_t w;
+
+ if (has_precision)
+ {
+ /* Use only as many wide characters as needed to produce
+ at most PRECISION bytes, from the left. */
+# if HAVE_WCRTOMB && !defined GNULIB_defined_mbstate_t
+ mbstate_t state;
+ memset (&state, '\0', sizeof (mbstate_t));
+# endif
+ arg_end = arg;
+ characters = 0;
+ while (precision > 0)
+ {
+ char cbuf[64]; /* Assume MB_CUR_MAX <= 64. */
+ int count;
+
+ if (*arg_end == 0)
+ /* Found the terminating null wide character. */
+ break;
+# if HAVE_WCRTOMB && !defined GNULIB_defined_mbstate_t
+ count = wcrtomb (cbuf, *arg_end, &state);
+# else
+ count = wctomb (cbuf, *arg_end);
+# endif
+ if (count < 0)
+ {
+ /* Cannot convert. */
+ if (!(result == resultbuf || result == NULL))
+ free (result);
+ if (buf_malloced != NULL)
+ free (buf_malloced);
+ CLEANUP ();
+ errno = EILSEQ;
+ return NULL;
+ }
+ if (precision < count)
+ break;
+ arg_end++;
+ characters += count;
+ precision -= count;
+ }
+ }
+# if DCHAR_IS_TCHAR
+ else if (has_width)
+# else
+ else
+# endif
+ {
+ /* Use the entire string, and count the number of
+ bytes. */
+# if HAVE_WCRTOMB && !defined GNULIB_defined_mbstate_t
+ mbstate_t state;
+ memset (&state, '\0', sizeof (mbstate_t));
+# endif
+ arg_end = arg;
+ characters = 0;
+ for (;;)
+ {
+ char cbuf[64]; /* Assume MB_CUR_MAX <= 64. */
+ int count;
+
+ if (*arg_end == 0)
+ /* Found the terminating null wide character. */
+ break;
+# if HAVE_WCRTOMB && !defined GNULIB_defined_mbstate_t
+ count = wcrtomb (cbuf, *arg_end, &state);
+# else
+ count = wctomb (cbuf, *arg_end);
+# endif
+ if (count < 0)
+ {
+ /* Cannot convert. */
+ if (!(result == resultbuf || result == NULL))
+ free (result);
+ if (buf_malloced != NULL)
+ free (buf_malloced);
+ CLEANUP ();
+ errno = EILSEQ;
+ return NULL;
+ }
+ arg_end++;
+ characters += count;
+ }
+ }
+# if DCHAR_IS_TCHAR
+ else
+ {
+ /* Use the entire string. */
+ arg_end = arg + local_wcslen (arg);
+ /* The number of bytes doesn't matter. */
+ characters = 0;
+ }
+# endif
+
+# if !DCHAR_IS_TCHAR
+ /* Convert the string into a piece of temporary memory. */
+ tmpsrc = (TCHAR_T *) malloc (characters * sizeof (TCHAR_T));
+ if (tmpsrc == NULL)
+ goto out_of_memory;
+ {
+ TCHAR_T *tmpptr = tmpsrc;
+ size_t remaining;
+# if HAVE_WCRTOMB && !defined GNULIB_defined_mbstate_t
+ mbstate_t state;
+ memset (&state, '\0', sizeof (mbstate_t));
+# endif
+ for (remaining = characters; remaining > 0; )
+ {
+ char cbuf[64]; /* Assume MB_CUR_MAX <= 64. */
+ int count;
+
+ if (*arg == 0)
+ abort ();
+# if HAVE_WCRTOMB && !defined GNULIB_defined_mbstate_t
+ count = wcrtomb (cbuf, *arg, &state);
+# else
+ count = wctomb (cbuf, *arg);
+# endif
+ if (count <= 0)
+ /* Inconsistency. */
+ abort ();
+ memcpy (tmpptr, cbuf, count);
+ tmpptr += count;
+ arg++;
+ remaining -= count;
+ }
+ if (!(arg == arg_end))
+ abort ();
+ }
+
+ /* Convert from TCHAR_T[] to DCHAR_T[]. */
+ tmpdst =
+ DCHAR_CONV_FROM_ENCODING (locale_charset (),
+ iconveh_question_mark,
+ tmpsrc, characters,
+ NULL,
+ NULL, &tmpdst_len);
+ if (tmpdst == NULL)
+ {
+ int saved_errno = errno;
+ free (tmpsrc);
+ if (!(result == resultbuf || result == NULL))
+ free (result);
+ if (buf_malloced != NULL)
+ free (buf_malloced);
+ CLEANUP ();
+ errno = saved_errno;
+ return NULL;
+ }
+ free (tmpsrc);
+# endif
+
+ if (has_width)
+ {
+# if ENABLE_UNISTDIO
+ /* Outside POSIX, it's preferrable to compare the width
+ against the number of _characters_ of the converted
+ value. */
+ w = DCHAR_MBSNLEN (result + length, characters);
+# else
+ /* The width is compared against the number of _bytes_
+ of the converted value, says POSIX. */
+ w = characters;
+# endif
+ }
+ else
+ /* w doesn't matter. */
+ w = 0;
+
+ if (has_width && width > w
+ && !(dp->flags & FLAG_LEFT))
+ {
+ size_t n = width - w;
+ ENSURE_ALLOCATION (xsum (length, n));
+ DCHAR_SET (result + length, ' ', n);
+ length += n;
+ }
+
+# if DCHAR_IS_TCHAR
+ if (has_precision || has_width)
+ {
+ /* We know the number of bytes in advance. */
+ size_t remaining;
+# if HAVE_WCRTOMB && !defined GNULIB_defined_mbstate_t
+ mbstate_t state;
+ memset (&state, '\0', sizeof (mbstate_t));
+# endif
+ ENSURE_ALLOCATION (xsum (length, characters));
+ for (remaining = characters; remaining > 0; )
+ {
+ char cbuf[64]; /* Assume MB_CUR_MAX <= 64. */
+ int count;
+
+ if (*arg == 0)
+ abort ();
+# if HAVE_WCRTOMB && !defined GNULIB_defined_mbstate_t
+ count = wcrtomb (cbuf, *arg, &state);
+# else
+ count = wctomb (cbuf, *arg);
+# endif
+ if (count <= 0)
+ /* Inconsistency. */
+ abort ();
+ memcpy (result + length, cbuf, count);
+ length += count;
+ arg++;
+ remaining -= count;
+ }
+ if (!(arg == arg_end))
+ abort ();
+ }
+ else
+ {
+# if HAVE_WCRTOMB && !defined GNULIB_defined_mbstate_t
+ mbstate_t state;
+ memset (&state, '\0', sizeof (mbstate_t));
+# endif
+ while (arg < arg_end)
+ {
+ char cbuf[64]; /* Assume MB_CUR_MAX <= 64. */
+ int count;
+
+ if (*arg == 0)
+ abort ();
+# if HAVE_WCRTOMB && !defined GNULIB_defined_mbstate_t
+ count = wcrtomb (cbuf, *arg, &state);
+# else
+ count = wctomb (cbuf, *arg);
+# endif
+ if (count <= 0)
+ {
+ /* Cannot convert. */
+ if (!(result == resultbuf || result == NULL))
+ free (result);
+ if (buf_malloced != NULL)
+ free (buf_malloced);
+ CLEANUP ();
+ errno = EILSEQ;
+ return NULL;
+ }
+ ENSURE_ALLOCATION (xsum (length, count));
+ memcpy (result + length, cbuf, count);
+ length += count;
+ arg++;
+ }
+ }
+# else
+ ENSURE_ALLOCATION (xsum (length, tmpdst_len));
+ DCHAR_CPY (result + length, tmpdst, tmpdst_len);
+ free (tmpdst);
+ length += tmpdst_len;
+# endif
+
+ if (has_width && width > w
+ && (dp->flags & FLAG_LEFT))
+ {
+ size_t n = width - w;
+ ENSURE_ALLOCATION (xsum (length, n));
+ DCHAR_SET (result + length, ' ', n);
+ length += n;
+ }
+ }
+# endif
+ }
#endif
#if (NEED_PRINTF_DIRECTIVE_A || NEED_PRINTF_LONG_DOUBLE || NEED_PRINTF_DOUBLE) && !defined IN_LIBINTL
- else if ((dp->conversion == 'a' || dp->conversion == 'A')
+ else if ((dp->conversion == 'a' || dp->conversion == 'A')
# if !(NEED_PRINTF_DIRECTIVE_A || (NEED_PRINTF_LONG_DOUBLE && NEED_PRINTF_DOUBLE))
- && (0
+ && (0
# if NEED_PRINTF_DOUBLE
- || a.arg[dp->arg_index].type == TYPE_DOUBLE
+ || a.arg[dp->arg_index].type == TYPE_DOUBLE
# endif
# if NEED_PRINTF_LONG_DOUBLE
- || a.arg[dp->arg_index].type == TYPE_LONGDOUBLE
+ || a.arg[dp->arg_index].type == TYPE_LONGDOUBLE
# endif
- )
+ )
# endif
- )
- {
- arg_type type = a.arg[dp->arg_index].type;
- int flags = dp->flags;
- int has_width;
- size_t width;
- int has_precision;
- size_t precision;
- size_t tmp_length;
- DCHAR_T tmpbuf[700];
- DCHAR_T *tmp;
- DCHAR_T *pad_ptr;
- DCHAR_T *p;
-
- has_width = 0;
- width = 0;
- if (dp->width_start != dp->width_end)
- {
- if (dp->width_arg_index != ARG_NONE)
- {
- int arg;
-
- if (!(a.arg[dp->width_arg_index].type == TYPE_INT))
- abort ();
- arg = a.arg[dp->width_arg_index].a.a_int;
- if (arg < 0)
- {
- /* "A negative field width is taken as a '-' flag
- followed by a positive field width." */
- flags |= FLAG_LEFT;
- width = (unsigned int) (-arg);
- }
- else
- width = arg;
- }
- else
- {
- const FCHAR_T *digitp = dp->width_start;
-
- do
- width = xsum (xtimes (width, 10), *digitp++ - '0');
- while (digitp != dp->width_end);
- }
- has_width = 1;
- }
-
- has_precision = 0;
- precision = 0;
- if (dp->precision_start != dp->precision_end)
- {
- if (dp->precision_arg_index != ARG_NONE)
- {
- int arg;
-
- if (!(a.arg[dp->precision_arg_index].type == TYPE_INT))
- abort ();
- arg = a.arg[dp->precision_arg_index].a.a_int;
- /* "A negative precision is taken as if the precision
- were omitted." */
- if (arg >= 0)
- {
- precision = arg;
- has_precision = 1;
- }
- }
- else
- {
- const FCHAR_T *digitp = dp->precision_start + 1;
-
- precision = 0;
- while (digitp != dp->precision_end)
- precision = xsum (xtimes (precision, 10), *digitp++ - '0');
- has_precision = 1;
- }
- }
-
- /* Allocate a temporary buffer of sufficient size. */
- if (type == TYPE_LONGDOUBLE)
- tmp_length =
- (unsigned int) ((LDBL_DIG + 1)
- * 0.831 /* decimal -> hexadecimal */
- )
- + 1; /* turn floor into ceil */
- else
- tmp_length =
- (unsigned int) ((DBL_DIG + 1)
- * 0.831 /* decimal -> hexadecimal */
- )
- + 1; /* turn floor into ceil */
- if (tmp_length < precision)
- tmp_length = precision;
- /* Account for sign, decimal point etc. */
- tmp_length = xsum (tmp_length, 12);
-
- if (tmp_length < width)
- tmp_length = width;
-
- tmp_length = xsum (tmp_length, 1); /* account for trailing NUL */
-
- if (tmp_length <= sizeof (tmpbuf) / sizeof (DCHAR_T))
- tmp = tmpbuf;
- else
- {
- size_t tmp_memsize = xtimes (tmp_length, sizeof (DCHAR_T));
-
- if (size_overflow_p (tmp_memsize))
- /* Overflow, would lead to out of memory. */
- goto out_of_memory;
- tmp = (DCHAR_T *) malloc (tmp_memsize);
- if (tmp == NULL)
- /* Out of memory. */
- goto out_of_memory;
- }
-
- pad_ptr = NULL;
- p = tmp;
- if (type == TYPE_LONGDOUBLE)
- {
+ )
+ {
+ arg_type type = a.arg[dp->arg_index].type;
+ int flags = dp->flags;
+ int has_width;
+ size_t width;
+ int has_precision;
+ size_t precision;
+ size_t tmp_length;
+ DCHAR_T tmpbuf[700];
+ DCHAR_T *tmp;
+ DCHAR_T *pad_ptr;
+ DCHAR_T *p;
+
+ has_width = 0;
+ width = 0;
+ if (dp->width_start != dp->width_end)
+ {
+ if (dp->width_arg_index != ARG_NONE)
+ {
+ int arg;
+
+ if (!(a.arg[dp->width_arg_index].type == TYPE_INT))
+ abort ();
+ arg = a.arg[dp->width_arg_index].a.a_int;
+ if (arg < 0)
+ {
+ /* "A negative field width is taken as a '-' flag
+ followed by a positive field width." */
+ flags |= FLAG_LEFT;
+ width = (unsigned int) (-arg);
+ }
+ else
+ width = arg;
+ }
+ else
+ {
+ const FCHAR_T *digitp = dp->width_start;
+
+ do
+ width = xsum (xtimes (width, 10), *digitp++ - '0');
+ while (digitp != dp->width_end);
+ }
+ has_width = 1;
+ }
+
+ has_precision = 0;
+ precision = 0;
+ if (dp->precision_start != dp->precision_end)
+ {
+ if (dp->precision_arg_index != ARG_NONE)
+ {
+ int arg;
+
+ if (!(a.arg[dp->precision_arg_index].type == TYPE_INT))
+ abort ();
+ arg = a.arg[dp->precision_arg_index].a.a_int;
+ /* "A negative precision is taken as if the precision
+ were omitted." */
+ if (arg >= 0)
+ {
+ precision = arg;
+ has_precision = 1;
+ }
+ }
+ else
+ {
+ const FCHAR_T *digitp = dp->precision_start + 1;
+
+ precision = 0;
+ while (digitp != dp->precision_end)
+ precision = xsum (xtimes (precision, 10), *digitp++ - '0');
+ has_precision = 1;
+ }
+ }
+
+ /* Allocate a temporary buffer of sufficient size. */
+ if (type == TYPE_LONGDOUBLE)
+ tmp_length =
+ (unsigned int) ((LDBL_DIG + 1)
+ * 0.831 /* decimal -> hexadecimal */
+ )
+ + 1; /* turn floor into ceil */
+ else
+ tmp_length =
+ (unsigned int) ((DBL_DIG + 1)
+ * 0.831 /* decimal -> hexadecimal */
+ )
+ + 1; /* turn floor into ceil */
+ if (tmp_length < precision)
+ tmp_length = precision;
+ /* Account for sign, decimal point etc. */
+ tmp_length = xsum (tmp_length, 12);
+
+ if (tmp_length < width)
+ tmp_length = width;
+
+ tmp_length = xsum (tmp_length, 1); /* account for trailing NUL */
+
+ if (tmp_length <= sizeof (tmpbuf) / sizeof (DCHAR_T))
+ tmp = tmpbuf;
+ else
+ {
+ size_t tmp_memsize = xtimes (tmp_length, sizeof (DCHAR_T));
+
+ if (size_overflow_p (tmp_memsize))
+ /* Overflow, would lead to out of memory. */
+ goto out_of_memory;
+ tmp = (DCHAR_T *) malloc (tmp_memsize);
+ if (tmp == NULL)
+ /* Out of memory. */
+ goto out_of_memory;
+ }
+
+ pad_ptr = NULL;
+ p = tmp;
+ if (type == TYPE_LONGDOUBLE)
+ {
# if NEED_PRINTF_DIRECTIVE_A || NEED_PRINTF_LONG_DOUBLE
- long double arg = a.arg[dp->arg_index].a.a_longdouble;
-
- if (isnanl (arg))
- {
- if (dp->conversion == 'A')
- {
- *p++ = 'N'; *p++ = 'A'; *p++ = 'N';
- }
- else
- {
- *p++ = 'n'; *p++ = 'a'; *p++ = 'n';
- }
- }
- else
- {
- int sign = 0;
- DECL_LONG_DOUBLE_ROUNDING
-
- BEGIN_LONG_DOUBLE_ROUNDING ();
-
- if (signbit (arg)) /* arg < 0.0L or negative zero */
- {
- sign = -1;
- arg = -arg;
- }
-
- if (sign < 0)
- *p++ = '-';
- else if (flags & FLAG_SHOWSIGN)
- *p++ = '+';
- else if (flags & FLAG_SPACE)
- *p++ = ' ';
-
- if (arg > 0.0L && arg + arg == arg)
- {
- if (dp->conversion == 'A')
- {
- *p++ = 'I'; *p++ = 'N'; *p++ = 'F';
- }
- else
- {
- *p++ = 'i'; *p++ = 'n'; *p++ = 'f';
- }
- }
- else
- {
- int exponent;
- long double mantissa;
-
- if (arg > 0.0L)
- mantissa = printf_frexpl (arg, &exponent);
- else
- {
- exponent = 0;
- mantissa = 0.0L;
- }
-
- if (has_precision
- && precision < (unsigned int) ((LDBL_DIG + 1) * 0.831) + 1)
- {
- /* Round the mantissa. */
- long double tail = mantissa;
- size_t q;
-
- for (q = precision; ; q--)
- {
- int digit = (int) tail;
- tail -= digit;
- if (q == 0)
- {
- if (digit & 1 ? tail >= 0.5L : tail > 0.5L)
- tail = 1 - tail;
- else
- tail = - tail;
- break;
- }
- tail *= 16.0L;
- }
- if (tail != 0.0L)
- for (q = precision; q > 0; q--)
- tail *= 0.0625L;
- mantissa += tail;
- }
-
- *p++ = '0';
- *p++ = dp->conversion - 'A' + 'X';
- pad_ptr = p;
- {
- int digit;
-
- digit = (int) mantissa;
- mantissa -= digit;
- *p++ = '0' + digit;
- if ((flags & FLAG_ALT)
- || mantissa > 0.0L || precision > 0)
- {
- *p++ = decimal_point_char ();
- /* This loop terminates because we assume
- that FLT_RADIX is a power of 2. */
- while (mantissa > 0.0L)
- {
- mantissa *= 16.0L;
- digit = (int) mantissa;
- mantissa -= digit;
- *p++ = digit
- + (digit < 10
- ? '0'
- : dp->conversion - 10);
- if (precision > 0)
- precision--;
- }
- while (precision > 0)
- {
- *p++ = '0';
- precision--;
- }
- }
- }
- *p++ = dp->conversion - 'A' + 'P';
+ long double arg = a.arg[dp->arg_index].a.a_longdouble;
+
+ if (isnanl (arg))
+ {
+ if (dp->conversion == 'A')
+ {
+ *p++ = 'N'; *p++ = 'A'; *p++ = 'N';
+ }
+ else
+ {
+ *p++ = 'n'; *p++ = 'a'; *p++ = 'n';
+ }
+ }
+ else
+ {
+ int sign = 0;
+ DECL_LONG_DOUBLE_ROUNDING
+
+ BEGIN_LONG_DOUBLE_ROUNDING ();
+
+ if (signbit (arg)) /* arg < 0.0L or negative zero */
+ {
+ sign = -1;
+ arg = -arg;
+ }
+
+ if (sign < 0)
+ *p++ = '-';
+ else if (flags & FLAG_SHOWSIGN)
+ *p++ = '+';
+ else if (flags & FLAG_SPACE)
+ *p++ = ' ';
+
+ if (arg > 0.0L && arg + arg == arg)
+ {
+ if (dp->conversion == 'A')
+ {
+ *p++ = 'I'; *p++ = 'N'; *p++ = 'F';
+ }
+ else
+ {
+ *p++ = 'i'; *p++ = 'n'; *p++ = 'f';
+ }
+ }
+ else
+ {
+ int exponent;
+ long double mantissa;
+
+ if (arg > 0.0L)
+ mantissa = printf_frexpl (arg, &exponent);
+ else
+ {
+ exponent = 0;
+ mantissa = 0.0L;
+ }
+
+ if (has_precision
+ && precision < (unsigned int) ((LDBL_DIG + 1) * 0.831) + 1)
+ {
+ /* Round the mantissa. */
+ long double tail = mantissa;
+ size_t q;
+
+ for (q = precision; ; q--)
+ {
+ int digit = (int) tail;
+ tail -= digit;
+ if (q == 0)
+ {
+ if (digit & 1 ? tail >= 0.5L : tail > 0.5L)
+ tail = 1 - tail;
+ else
+ tail = - tail;
+ break;
+ }
+ tail *= 16.0L;
+ }
+ if (tail != 0.0L)
+ for (q = precision; q > 0; q--)
+ tail *= 0.0625L;
+ mantissa += tail;
+ }
+
+ *p++ = '0';
+ *p++ = dp->conversion - 'A' + 'X';
+ pad_ptr = p;
+ {
+ int digit;
+
+ digit = (int) mantissa;
+ mantissa -= digit;
+ *p++ = '0' + digit;
+ if ((flags & FLAG_ALT)
+ || mantissa > 0.0L || precision > 0)
+ {
+ *p++ = decimal_point_char ();
+ /* This loop terminates because we assume
+ that FLT_RADIX is a power of 2. */
+ while (mantissa > 0.0L)
+ {
+ mantissa *= 16.0L;
+ digit = (int) mantissa;
+ mantissa -= digit;
+ *p++ = digit
+ + (digit < 10
+ ? '0'
+ : dp->conversion - 10);
+ if (precision > 0)
+ precision--;
+ }
+ while (precision > 0)
+ {
+ *p++ = '0';
+ precision--;
+ }
+ }
+ }
+ *p++ = dp->conversion - 'A' + 'P';
# if WIDE_CHAR_VERSION
- {
- static const wchar_t decimal_format[] =
- { '%', '+', 'd', '\0' };
- SNPRINTF (p, 6 + 1, decimal_format, exponent);
- }
- while (*p != '\0')
- p++;
+ {
+ static const wchar_t decimal_format[] =
+ { '%', '+', 'd', '\0' };
+ SNPRINTF (p, 6 + 1, decimal_format, exponent);
+ }
+ while (*p != '\0')
+ p++;
# else
- if (sizeof (DCHAR_T) == 1)
- {
- sprintf ((char *) p, "%+d", exponent);
- while (*p != '\0')
- p++;
- }
- else
- {
- char expbuf[6 + 1];
- const char *ep;
- sprintf (expbuf, "%+d", exponent);
- for (ep = expbuf; (*p = *ep) != '\0'; ep++)
- p++;
- }
+ if (sizeof (DCHAR_T) == 1)
+ {
+ sprintf ((char *) p, "%+d", exponent);
+ while (*p != '\0')
+ p++;
+ }
+ else
+ {
+ char expbuf[6 + 1];
+ const char *ep;
+ sprintf (expbuf, "%+d", exponent);
+ for (ep = expbuf; (*p = *ep) != '\0'; ep++)
+ p++;
+ }
# endif
- }
+ }
- END_LONG_DOUBLE_ROUNDING ();
- }
+ END_LONG_DOUBLE_ROUNDING ();
+ }
# else
- abort ();
+ abort ();
# endif
- }
- else
- {
+ }
+ else
+ {
# if NEED_PRINTF_DIRECTIVE_A || NEED_PRINTF_DOUBLE
- double arg = a.arg[dp->arg_index].a.a_double;
-
- if (isnan (arg))
- {
- if (dp->conversion == 'A')
- {
- *p++ = 'N'; *p++ = 'A'; *p++ = 'N';
- }
- else
- {
- *p++ = 'n'; *p++ = 'a'; *p++ = 'n';
- }
- }
- else
- {
- int sign = 0;
-
- if (signbit (arg)) /* arg < 0.0 or negative zero */
- {
- sign = -1;
- arg = -arg;
- }
-
- if (sign < 0)
- *p++ = '-';
- else if (flags & FLAG_SHOWSIGN)
- *p++ = '+';
- else if (flags & FLAG_SPACE)
- *p++ = ' ';
-
- if (arg > 0.0 && arg + arg == arg)
- {
- if (dp->conversion == 'A')
- {
- *p++ = 'I'; *p++ = 'N'; *p++ = 'F';
- }
- else
- {
- *p++ = 'i'; *p++ = 'n'; *p++ = 'f';
- }
- }
- else
- {
- int exponent;
- double mantissa;
-
- if (arg > 0.0)
- mantissa = printf_frexp (arg, &exponent);
- else
- {
- exponent = 0;
- mantissa = 0.0;
- }
-
- if (has_precision
- && precision < (unsigned int) ((DBL_DIG + 1) * 0.831) + 1)
- {
- /* Round the mantissa. */
- double tail = mantissa;
- size_t q;
-
- for (q = precision; ; q--)
- {
- int digit = (int) tail;
- tail -= digit;
- if (q == 0)
- {
- if (digit & 1 ? tail >= 0.5 : tail > 0.5)
- tail = 1 - tail;
- else
- tail = - tail;
- break;
- }
- tail *= 16.0;
- }
- if (tail != 0.0)
- for (q = precision; q > 0; q--)
- tail *= 0.0625;
- mantissa += tail;
- }
-
- *p++ = '0';
- *p++ = dp->conversion - 'A' + 'X';
- pad_ptr = p;
- {
- int digit;
-
- digit = (int) mantissa;
- mantissa -= digit;
- *p++ = '0' + digit;
- if ((flags & FLAG_ALT)
- || mantissa > 0.0 || precision > 0)
- {
- *p++ = decimal_point_char ();
- /* This loop terminates because we assume
- that FLT_RADIX is a power of 2. */
- while (mantissa > 0.0)
- {
- mantissa *= 16.0;
- digit = (int) mantissa;
- mantissa -= digit;
- *p++ = digit
- + (digit < 10
- ? '0'
- : dp->conversion - 10);
- if (precision > 0)
- precision--;
- }
- while (precision > 0)
- {
- *p++ = '0';
- precision--;
- }
- }
- }
- *p++ = dp->conversion - 'A' + 'P';
+ double arg = a.arg[dp->arg_index].a.a_double;
+
+ if (isnand (arg))
+ {
+ if (dp->conversion == 'A')
+ {
+ *p++ = 'N'; *p++ = 'A'; *p++ = 'N';
+ }
+ else
+ {
+ *p++ = 'n'; *p++ = 'a'; *p++ = 'n';
+ }
+ }
+ else
+ {
+ int sign = 0;
+
+ if (signbit (arg)) /* arg < 0.0 or negative zero */
+ {
+ sign = -1;
+ arg = -arg;
+ }
+
+ if (sign < 0)
+ *p++ = '-';
+ else if (flags & FLAG_SHOWSIGN)
+ *p++ = '+';
+ else if (flags & FLAG_SPACE)
+ *p++ = ' ';
+
+ if (arg > 0.0 && arg + arg == arg)
+ {
+ if (dp->conversion == 'A')
+ {
+ *p++ = 'I'; *p++ = 'N'; *p++ = 'F';
+ }
+ else
+ {
+ *p++ = 'i'; *p++ = 'n'; *p++ = 'f';
+ }
+ }
+ else
+ {
+ int exponent;
+ double mantissa;
+
+ if (arg > 0.0)
+ mantissa = printf_frexp (arg, &exponent);
+ else
+ {
+ exponent = 0;
+ mantissa = 0.0;
+ }
+
+ if (has_precision
+ && precision < (unsigned int) ((DBL_DIG + 1) * 0.831) + 1)
+ {
+ /* Round the mantissa. */
+ double tail = mantissa;
+ size_t q;
+
+ for (q = precision; ; q--)
+ {
+ int digit = (int) tail;
+ tail -= digit;
+ if (q == 0)
+ {
+ if (digit & 1 ? tail >= 0.5 : tail > 0.5)
+ tail = 1 - tail;
+ else
+ tail = - tail;
+ break;
+ }
+ tail *= 16.0;
+ }
+ if (tail != 0.0)
+ for (q = precision; q > 0; q--)
+ tail *= 0.0625;
+ mantissa += tail;
+ }
+
+ *p++ = '0';
+ *p++ = dp->conversion - 'A' + 'X';
+ pad_ptr = p;
+ {
+ int digit;
+
+ digit = (int) mantissa;
+ mantissa -= digit;
+ *p++ = '0' + digit;
+ if ((flags & FLAG_ALT)
+ || mantissa > 0.0 || precision > 0)
+ {
+ *p++ = decimal_point_char ();
+ /* This loop terminates because we assume
+ that FLT_RADIX is a power of 2. */
+ while (mantissa > 0.0)
+ {
+ mantissa *= 16.0;
+ digit = (int) mantissa;
+ mantissa -= digit;
+ *p++ = digit
+ + (digit < 10
+ ? '0'
+ : dp->conversion - 10);
+ if (precision > 0)
+ precision--;
+ }
+ while (precision > 0)
+ {
+ *p++ = '0';
+ precision--;
+ }
+ }
+ }
+ *p++ = dp->conversion - 'A' + 'P';
# if WIDE_CHAR_VERSION
- {
- static const wchar_t decimal_format[] =
- { '%', '+', 'd', '\0' };
- SNPRINTF (p, 6 + 1, decimal_format, exponent);
- }
- while (*p != '\0')
- p++;
+ {
+ static const wchar_t decimal_format[] =
+ { '%', '+', 'd', '\0' };
+ SNPRINTF (p, 6 + 1, decimal_format, exponent);
+ }
+ while (*p != '\0')
+ p++;
# else
- if (sizeof (DCHAR_T) == 1)
- {
- sprintf ((char *) p, "%+d", exponent);
- while (*p != '\0')
- p++;
- }
- else
- {
- char expbuf[6 + 1];
- const char *ep;
- sprintf (expbuf, "%+d", exponent);
- for (ep = expbuf; (*p = *ep) != '\0'; ep++)
- p++;
- }
+ if (sizeof (DCHAR_T) == 1)
+ {
+ sprintf ((char *) p, "%+d", exponent);
+ while (*p != '\0')
+ p++;
+ }
+ else
+ {
+ char expbuf[6 + 1];
+ const char *ep;
+ sprintf (expbuf, "%+d", exponent);
+ for (ep = expbuf; (*p = *ep) != '\0'; ep++)
+ p++;
+ }
# endif
- }
- }
+ }
+ }
# else
- abort ();
+ abort ();
# endif
- }
- /* The generated string now extends from tmp to p, with the
- zero padding insertion point being at pad_ptr. */
- if (has_width && p - tmp < width)
- {
- size_t pad = width - (p - tmp);
- DCHAR_T *end = p + pad;
-
- if (flags & FLAG_LEFT)
- {
- /* Pad with spaces on the right. */
- for (; pad > 0; pad--)
- *p++ = ' ';
- }
- else if ((flags & FLAG_ZERO) && pad_ptr != NULL)
- {
- /* Pad with zeroes. */
- DCHAR_T *q = end;
-
- while (p > pad_ptr)
- *--q = *--p;
- for (; pad > 0; pad--)
- *p++ = '0';
- }
- else
- {
- /* Pad with spaces on the left. */
- DCHAR_T *q = end;
-
- while (p > tmp)
- *--q = *--p;
- for (; pad > 0; pad--)
- *p++ = ' ';
- }
-
- p = end;
- }
-
- {
- size_t count = p - tmp;
-
- if (count >= tmp_length)
- /* tmp_length was incorrectly calculated - fix the
- code above! */
- abort ();
-
- /* Make room for the result. */
- if (count >= allocated - length)
- {
- size_t n = xsum (length, count);
-
- ENSURE_ALLOCATION (n);
- }
-
- /* Append the result. */
- memcpy (result + length, tmp, count * sizeof (DCHAR_T));
- if (tmp != tmpbuf)
- free (tmp);
- length += count;
- }
- }
+ }
+ /* The generated string now extends from tmp to p, with the
+ zero padding insertion point being at pad_ptr. */
+ if (has_width && p - tmp < width)
+ {
+ size_t pad = width - (p - tmp);
+ DCHAR_T *end = p + pad;
+
+ if (flags & FLAG_LEFT)
+ {
+ /* Pad with spaces on the right. */
+ for (; pad > 0; pad--)
+ *p++ = ' ';
+ }
+ else if ((flags & FLAG_ZERO) && pad_ptr != NULL)
+ {
+ /* Pad with zeroes. */
+ DCHAR_T *q = end;
+
+ while (p > pad_ptr)
+ *--q = *--p;
+ for (; pad > 0; pad--)
+ *p++ = '0';
+ }
+ else
+ {
+ /* Pad with spaces on the left. */
+ DCHAR_T *q = end;
+
+ while (p > tmp)
+ *--q = *--p;
+ for (; pad > 0; pad--)
+ *p++ = ' ';
+ }
+
+ p = end;
+ }
+
+ {
+ size_t count = p - tmp;
+
+ if (count >= tmp_length)
+ /* tmp_length was incorrectly calculated - fix the
+ code above! */
+ abort ();
+
+ /* Make room for the result. */
+ if (count >= allocated - length)
+ {
+ size_t n = xsum (length, count);
+
+ ENSURE_ALLOCATION (n);
+ }
+
+ /* Append the result. */
+ memcpy (result + length, tmp, count * sizeof (DCHAR_T));
+ if (tmp != tmpbuf)
+ free (tmp);
+ length += count;
+ }
+ }
#endif
#if (NEED_PRINTF_INFINITE_DOUBLE || NEED_PRINTF_DOUBLE || NEED_PRINTF_INFINITE_LONG_DOUBLE || NEED_PRINTF_LONG_DOUBLE) && !defined IN_LIBINTL
- else if ((dp->conversion == 'f' || dp->conversion == 'F'
- || dp->conversion == 'e' || dp->conversion == 'E'
- || dp->conversion == 'g' || dp->conversion == 'G'
- || dp->conversion == 'a' || dp->conversion == 'A')
- && (0
+ else if ((dp->conversion == 'f' || dp->conversion == 'F'
+ || dp->conversion == 'e' || dp->conversion == 'E'
+ || dp->conversion == 'g' || dp->conversion == 'G'
+ || dp->conversion == 'a' || dp->conversion == 'A')
+ && (0
# if NEED_PRINTF_DOUBLE
- || a.arg[dp->arg_index].type == TYPE_DOUBLE
+ || a.arg[dp->arg_index].type == TYPE_DOUBLE
# elif NEED_PRINTF_INFINITE_DOUBLE
- || (a.arg[dp->arg_index].type == TYPE_DOUBLE
- /* The systems (mingw) which produce wrong output
- for Inf, -Inf, and NaN also do so for -0.0.
- Therefore we treat this case here as well. */
- && is_infinite_or_zero (a.arg[dp->arg_index].a.a_double))
+ || (a.arg[dp->arg_index].type == TYPE_DOUBLE
+ /* The systems (mingw) which produce wrong output
+ for Inf, -Inf, and NaN also do so for -0.0.
+ Therefore we treat this case here as well. */
+ && is_infinite_or_zero (a.arg[dp->arg_index].a.a_double))
# endif
# if NEED_PRINTF_LONG_DOUBLE
- || a.arg[dp->arg_index].type == TYPE_LONGDOUBLE
+ || a.arg[dp->arg_index].type == TYPE_LONGDOUBLE
# elif NEED_PRINTF_INFINITE_LONG_DOUBLE
- || (a.arg[dp->arg_index].type == TYPE_LONGDOUBLE
- /* Some systems produce wrong output for Inf,
- -Inf, and NaN. */
- && is_infinitel (a.arg[dp->arg_index].a.a_longdouble))
+ || (a.arg[dp->arg_index].type == TYPE_LONGDOUBLE
+ /* Some systems produce wrong output for Inf,
+ -Inf, and NaN. Some systems in this category
+ (IRIX 5.3) also do so for -0.0. Therefore we
+ treat this case here as well. */
+ && is_infinite_or_zerol (a.arg[dp->arg_index].a.a_longdouble))
# endif
- ))
- {
+ ))
+ {
# if (NEED_PRINTF_DOUBLE || NEED_PRINTF_INFINITE_DOUBLE) && (NEED_PRINTF_LONG_DOUBLE || NEED_PRINTF_INFINITE_LONG_DOUBLE)
- arg_type type = a.arg[dp->arg_index].type;
+ arg_type type = a.arg[dp->arg_index].type;
# endif
- int flags = dp->flags;
- int has_width;
- size_t width;
- int has_precision;
- size_t precision;
- size_t tmp_length;
- DCHAR_T tmpbuf[700];
- DCHAR_T *tmp;
- DCHAR_T *pad_ptr;
- DCHAR_T *p;
-
- has_width = 0;
- width = 0;
- if (dp->width_start != dp->width_end)
- {
- if (dp->width_arg_index != ARG_NONE)
- {
- int arg;
-
- if (!(a.arg[dp->width_arg_index].type == TYPE_INT))
- abort ();
- arg = a.arg[dp->width_arg_index].a.a_int;
- if (arg < 0)
- {
- /* "A negative field width is taken as a '-' flag
- followed by a positive field width." */
- flags |= FLAG_LEFT;
- width = (unsigned int) (-arg);
- }
- else
- width = arg;
- }
- else
- {
- const FCHAR_T *digitp = dp->width_start;
-
- do
- width = xsum (xtimes (width, 10), *digitp++ - '0');
- while (digitp != dp->width_end);
- }
- has_width = 1;
- }
-
- has_precision = 0;
- precision = 0;
- if (dp->precision_start != dp->precision_end)
- {
- if (dp->precision_arg_index != ARG_NONE)
- {
- int arg;
-
- if (!(a.arg[dp->precision_arg_index].type == TYPE_INT))
- abort ();
- arg = a.arg[dp->precision_arg_index].a.a_int;
- /* "A negative precision is taken as if the precision
- were omitted." */
- if (arg >= 0)
- {
- precision = arg;
- has_precision = 1;
- }
- }
- else
- {
- const FCHAR_T *digitp = dp->precision_start + 1;
-
- precision = 0;
- while (digitp != dp->precision_end)
- precision = xsum (xtimes (precision, 10), *digitp++ - '0');
- has_precision = 1;
- }
- }
-
- /* POSIX specifies the default precision to be 6 for %f, %F,
- %e, %E, but not for %g, %G. Implementations appear to use
- the same default precision also for %g, %G. */
- if (!has_precision)
- precision = 6;
-
- /* Allocate a temporary buffer of sufficient size. */
+ int flags = dp->flags;
+ int has_width;
+ size_t width;
+ int has_precision;
+ size_t precision;
+ size_t tmp_length;
+ DCHAR_T tmpbuf[700];
+ DCHAR_T *tmp;
+ DCHAR_T *pad_ptr;
+ DCHAR_T *p;
+
+ has_width = 0;
+ width = 0;
+ if (dp->width_start != dp->width_end)
+ {
+ if (dp->width_arg_index != ARG_NONE)
+ {
+ int arg;
+
+ if (!(a.arg[dp->width_arg_index].type == TYPE_INT))
+ abort ();
+ arg = a.arg[dp->width_arg_index].a.a_int;
+ if (arg < 0)
+ {
+ /* "A negative field width is taken as a '-' flag
+ followed by a positive field width." */
+ flags |= FLAG_LEFT;
+ width = (unsigned int) (-arg);
+ }
+ else
+ width = arg;
+ }
+ else
+ {
+ const FCHAR_T *digitp = dp->width_start;
+
+ do
+ width = xsum (xtimes (width, 10), *digitp++ - '0');
+ while (digitp != dp->width_end);
+ }
+ has_width = 1;
+ }
+
+ has_precision = 0;
+ precision = 0;
+ if (dp->precision_start != dp->precision_end)
+ {
+ if (dp->precision_arg_index != ARG_NONE)
+ {
+ int arg;
+
+ if (!(a.arg[dp->precision_arg_index].type == TYPE_INT))
+ abort ();
+ arg = a.arg[dp->precision_arg_index].a.a_int;
+ /* "A negative precision is taken as if the precision
+ were omitted." */
+ if (arg >= 0)
+ {
+ precision = arg;
+ has_precision = 1;
+ }
+ }
+ else
+ {
+ const FCHAR_T *digitp = dp->precision_start + 1;
+
+ precision = 0;
+ while (digitp != dp->precision_end)
+ precision = xsum (xtimes (precision, 10), *digitp++ - '0');
+ has_precision = 1;
+ }
+ }
+
+ /* POSIX specifies the default precision to be 6 for %f, %F,
+ %e, %E, but not for %g, %G. Implementations appear to use
+ the same default precision also for %g, %G. But for %a, %A,
+ the default precision is 0. */
+ if (!has_precision)
+ if (!(dp->conversion == 'a' || dp->conversion == 'A'))
+ precision = 6;
+
+ /* Allocate a temporary buffer of sufficient size. */
# if NEED_PRINTF_DOUBLE && NEED_PRINTF_LONG_DOUBLE
- tmp_length = (type == TYPE_LONGDOUBLE ? LDBL_DIG + 1 : DBL_DIG + 1);
+ tmp_length = (type == TYPE_LONGDOUBLE ? LDBL_DIG + 1 : DBL_DIG + 1);
# elif NEED_PRINTF_INFINITE_DOUBLE && NEED_PRINTF_LONG_DOUBLE
- tmp_length = (type == TYPE_LONGDOUBLE ? LDBL_DIG + 1 : 0);
+ tmp_length = (type == TYPE_LONGDOUBLE ? LDBL_DIG + 1 : 0);
# elif NEED_PRINTF_LONG_DOUBLE
- tmp_length = LDBL_DIG + 1;
+ tmp_length = LDBL_DIG + 1;
# elif NEED_PRINTF_DOUBLE
- tmp_length = DBL_DIG + 1;
+ tmp_length = DBL_DIG + 1;
# else
- tmp_length = 0;
+ tmp_length = 0;
# endif
- if (tmp_length < precision)
- tmp_length = precision;
+ if (tmp_length < precision)
+ tmp_length = precision;
# if NEED_PRINTF_LONG_DOUBLE
# if NEED_PRINTF_DOUBLE || NEED_PRINTF_INFINITE_DOUBLE
- if (type == TYPE_LONGDOUBLE)
+ if (type == TYPE_LONGDOUBLE)
# endif
- if (dp->conversion == 'f' || dp->conversion == 'F')
- {
- long double arg = a.arg[dp->arg_index].a.a_longdouble;
- if (!(isnanl (arg) || arg + arg == arg))
- {
- /* arg is finite and nonzero. */
- int exponent = floorlog10l (arg < 0 ? -arg : arg);
- if (exponent >= 0 && tmp_length < exponent + precision)
- tmp_length = exponent + precision;
- }
- }
+ if (dp->conversion == 'f' || dp->conversion == 'F')
+ {
+ long double arg = a.arg[dp->arg_index].a.a_longdouble;
+ if (!(isnanl (arg) || arg + arg == arg))
+ {
+ /* arg is finite and nonzero. */
+ int exponent = floorlog10l (arg < 0 ? -arg : arg);
+ if (exponent >= 0 && tmp_length < exponent + precision)
+ tmp_length = exponent + precision;
+ }
+ }
# endif
# if NEED_PRINTF_DOUBLE
# if NEED_PRINTF_LONG_DOUBLE || NEED_PRINTF_INFINITE_LONG_DOUBLE
- if (type == TYPE_DOUBLE)
+ if (type == TYPE_DOUBLE)
# endif
- if (dp->conversion == 'f' || dp->conversion == 'F')
- {
- double arg = a.arg[dp->arg_index].a.a_double;
- if (!(isnan (arg) || arg + arg == arg))
- {
- /* arg is finite and nonzero. */
- int exponent = floorlog10 (arg < 0 ? -arg : arg);
- if (exponent >= 0 && tmp_length < exponent + precision)
- tmp_length = exponent + precision;
- }
- }
+ if (dp->conversion == 'f' || dp->conversion == 'F')
+ {
+ double arg = a.arg[dp->arg_index].a.a_double;
+ if (!(isnand (arg) || arg + arg == arg))
+ {
+ /* arg is finite and nonzero. */
+ int exponent = floorlog10 (arg < 0 ? -arg : arg);
+ if (exponent >= 0 && tmp_length < exponent + precision)
+ tmp_length = exponent + precision;
+ }
+ }
# endif
- /* Account for sign, decimal point etc. */
- tmp_length = xsum (tmp_length, 12);
+ /* Account for sign, decimal point etc. */
+ tmp_length = xsum (tmp_length, 12);
- if (tmp_length < width)
- tmp_length = width;
+ if (tmp_length < width)
+ tmp_length = width;
- tmp_length = xsum (tmp_length, 1); /* account for trailing NUL */
+ tmp_length = xsum (tmp_length, 1); /* account for trailing NUL */
- if (tmp_length <= sizeof (tmpbuf) / sizeof (DCHAR_T))
- tmp = tmpbuf;
- else
- {
- size_t tmp_memsize = xtimes (tmp_length, sizeof (DCHAR_T));
+ if (tmp_length <= sizeof (tmpbuf) / sizeof (DCHAR_T))
+ tmp = tmpbuf;
+ else
+ {
+ size_t tmp_memsize = xtimes (tmp_length, sizeof (DCHAR_T));
- if (size_overflow_p (tmp_memsize))
- /* Overflow, would lead to out of memory. */
- goto out_of_memory;
- tmp = (DCHAR_T *) malloc (tmp_memsize);
- if (tmp == NULL)
- /* Out of memory. */
- goto out_of_memory;
- }
+ if (size_overflow_p (tmp_memsize))
+ /* Overflow, would lead to out of memory. */
+ goto out_of_memory;
+ tmp = (DCHAR_T *) malloc (tmp_memsize);
+ if (tmp == NULL)
+ /* Out of memory. */
+ goto out_of_memory;
+ }
- pad_ptr = NULL;
- p = tmp;
+ pad_ptr = NULL;
+ p = tmp;
# if NEED_PRINTF_LONG_DOUBLE || NEED_PRINTF_INFINITE_LONG_DOUBLE
# if NEED_PRINTF_DOUBLE || NEED_PRINTF_INFINITE_DOUBLE
- if (type == TYPE_LONGDOUBLE)
+ if (type == TYPE_LONGDOUBLE)
# endif
- {
- long double arg = a.arg[dp->arg_index].a.a_longdouble;
-
- if (isnanl (arg))
- {
- if (dp->conversion >= 'A' && dp->conversion <= 'Z')
- {
- *p++ = 'N'; *p++ = 'A'; *p++ = 'N';
- }
- else
- {
- *p++ = 'n'; *p++ = 'a'; *p++ = 'n';
- }
- }
- else
- {
- int sign = 0;
- DECL_LONG_DOUBLE_ROUNDING
-
- BEGIN_LONG_DOUBLE_ROUNDING ();
-
- if (signbit (arg)) /* arg < 0.0L or negative zero */
- {
- sign = -1;
- arg = -arg;
- }
-
- if (sign < 0)
- *p++ = '-';
- else if (flags & FLAG_SHOWSIGN)
- *p++ = '+';
- else if (flags & FLAG_SPACE)
- *p++ = ' ';
-
- if (arg > 0.0L && arg + arg == arg)
- {
- if (dp->conversion >= 'A' && dp->conversion <= 'Z')
- {
- *p++ = 'I'; *p++ = 'N'; *p++ = 'F';
- }
- else
- {
- *p++ = 'i'; *p++ = 'n'; *p++ = 'f';
- }
- }
- else
- {
+ {
+ long double arg = a.arg[dp->arg_index].a.a_longdouble;
+
+ if (isnanl (arg))
+ {
+ if (dp->conversion >= 'A' && dp->conversion <= 'Z')
+ {
+ *p++ = 'N'; *p++ = 'A'; *p++ = 'N';
+ }
+ else
+ {
+ *p++ = 'n'; *p++ = 'a'; *p++ = 'n';
+ }
+ }
+ else
+ {
+ int sign = 0;
+ DECL_LONG_DOUBLE_ROUNDING
+
+ BEGIN_LONG_DOUBLE_ROUNDING ();
+
+ if (signbit (arg)) /* arg < 0.0L or negative zero */
+ {
+ sign = -1;
+ arg = -arg;
+ }
+
+ if (sign < 0)
+ *p++ = '-';
+ else if (flags & FLAG_SHOWSIGN)
+ *p++ = '+';
+ else if (flags & FLAG_SPACE)
+ *p++ = ' ';
+
+ if (arg > 0.0L && arg + arg == arg)
+ {
+ if (dp->conversion >= 'A' && dp->conversion <= 'Z')
+ {
+ *p++ = 'I'; *p++ = 'N'; *p++ = 'F';
+ }
+ else
+ {
+ *p++ = 'i'; *p++ = 'n'; *p++ = 'f';
+ }
+ }
+ else
+ {
# if NEED_PRINTF_LONG_DOUBLE
- pad_ptr = p;
-
- if (dp->conversion == 'f' || dp->conversion == 'F')
- {
- char *digits;
- size_t ndigits;
-
- digits =
- scale10_round_decimal_long_double (arg, precision);
- if (digits == NULL)
- {
- END_LONG_DOUBLE_ROUNDING ();
- goto out_of_memory;
- }
- ndigits = strlen (digits);
-
- if (ndigits > precision)
- do
- {
- --ndigits;
- *p++ = digits[ndigits];
- }
- while (ndigits > precision);
- else
- *p++ = '0';
- /* Here ndigits <= precision. */
- if ((flags & FLAG_ALT) || precision > 0)
- {
- *p++ = decimal_point_char ();
- for (; precision > ndigits; precision--)
- *p++ = '0';
- while (ndigits > 0)
- {
- --ndigits;
- *p++ = digits[ndigits];
- }
- }
-
- free (digits);
- }
- else if (dp->conversion == 'e' || dp->conversion == 'E')
- {
- int exponent;
-
- if (arg == 0.0L)
- {
- exponent = 0;
- *p++ = '0';
- if ((flags & FLAG_ALT) || precision > 0)
- {
- *p++ = decimal_point_char ();
- for (; precision > 0; precision--)
- *p++ = '0';
- }
- }
- else
- {
- /* arg > 0.0L. */
- int adjusted;
- char *digits;
- size_t ndigits;
-
- exponent = floorlog10l (arg);
- adjusted = 0;
- for (;;)
- {
- digits =
- scale10_round_decimal_long_double (arg,
- (int)precision - exponent);
- if (digits == NULL)
- {
- END_LONG_DOUBLE_ROUNDING ();
- goto out_of_memory;
- }
- ndigits = strlen (digits);
-
- if (ndigits == precision + 1)
- break;
- if (ndigits < precision
- || ndigits > precision + 2)
- /* The exponent was not guessed
- precisely enough. */
- abort ();
- if (adjusted)
- /* None of two values of exponent is
- the right one. Prevent an endless
- loop. */
- abort ();
- free (digits);
- if (ndigits == precision)
- exponent -= 1;
- else
- exponent += 1;
- adjusted = 1;
- }
-
- /* Here ndigits = precision+1. */
- *p++ = digits[--ndigits];
- if ((flags & FLAG_ALT) || precision > 0)
- {
- *p++ = decimal_point_char ();
- while (ndigits > 0)
- {
- --ndigits;
- *p++ = digits[ndigits];
- }
- }
-
- free (digits);
- }
-
- *p++ = dp->conversion; /* 'e' or 'E' */
+ pad_ptr = p;
+
+ if (dp->conversion == 'f' || dp->conversion == 'F')
+ {
+ char *digits;
+ size_t ndigits;
+
+ digits =
+ scale10_round_decimal_long_double (arg, precision);
+ if (digits == NULL)
+ {
+ END_LONG_DOUBLE_ROUNDING ();
+ goto out_of_memory;
+ }
+ ndigits = strlen (digits);
+
+ if (ndigits > precision)
+ do
+ {
+ --ndigits;
+ *p++ = digits[ndigits];
+ }
+ while (ndigits > precision);
+ else
+ *p++ = '0';
+ /* Here ndigits <= precision. */
+ if ((flags & FLAG_ALT) || precision > 0)
+ {
+ *p++ = decimal_point_char ();
+ for (; precision > ndigits; precision--)
+ *p++ = '0';
+ while (ndigits > 0)
+ {
+ --ndigits;
+ *p++ = digits[ndigits];
+ }
+ }
+
+ free (digits);
+ }
+ else if (dp->conversion == 'e' || dp->conversion == 'E')
+ {
+ int exponent;
+
+ if (arg == 0.0L)
+ {
+ exponent = 0;
+ *p++ = '0';
+ if ((flags & FLAG_ALT) || precision > 0)
+ {
+ *p++ = decimal_point_char ();
+ for (; precision > 0; precision--)
+ *p++ = '0';
+ }
+ }
+ else
+ {
+ /* arg > 0.0L. */
+ int adjusted;
+ char *digits;
+ size_t ndigits;
+
+ exponent = floorlog10l (arg);
+ adjusted = 0;
+ for (;;)
+ {
+ digits =
+ scale10_round_decimal_long_double (arg,
+ (int)precision - exponent);
+ if (digits == NULL)
+ {
+ END_LONG_DOUBLE_ROUNDING ();
+ goto out_of_memory;
+ }
+ ndigits = strlen (digits);
+
+ if (ndigits == precision + 1)
+ break;
+ if (ndigits < precision
+ || ndigits > precision + 2)
+ /* The exponent was not guessed
+ precisely enough. */
+ abort ();
+ if (adjusted)
+ /* None of two values of exponent is
+ the right one. Prevent an endless
+ loop. */
+ abort ();
+ free (digits);
+ if (ndigits == precision)
+ exponent -= 1;
+ else
+ exponent += 1;
+ adjusted = 1;
+ }
+ /* Here ndigits = precision+1. */
+ if (is_borderline (digits, precision))
+ {
+ /* Maybe the exponent guess was too high
+ and a smaller exponent can be reached
+ by turning a 10...0 into 9...9x. */
+ char *digits2 =
+ scale10_round_decimal_long_double (arg,
+ (int)precision - exponent + 1);
+ if (digits2 == NULL)
+ {
+ free (digits);
+ END_LONG_DOUBLE_ROUNDING ();
+ goto out_of_memory;
+ }
+ if (strlen (digits2) == precision + 1)
+ {
+ free (digits);
+ digits = digits2;
+ exponent -= 1;
+ }
+ else
+ free (digits2);
+ }
+ /* Here ndigits = precision+1. */
+
+ *p++ = digits[--ndigits];
+ if ((flags & FLAG_ALT) || precision > 0)
+ {
+ *p++ = decimal_point_char ();
+ while (ndigits > 0)
+ {
+ --ndigits;
+ *p++ = digits[ndigits];
+ }
+ }
+
+ free (digits);
+ }
+
+ *p++ = dp->conversion; /* 'e' or 'E' */
# if WIDE_CHAR_VERSION
- {
- static const wchar_t decimal_format[] =
- { '%', '+', '.', '2', 'd', '\0' };
- SNPRINTF (p, 6 + 1, decimal_format, exponent);
- }
- while (*p != '\0')
- p++;
+ {
+ static const wchar_t decimal_format[] =
+ { '%', '+', '.', '2', 'd', '\0' };
+ SNPRINTF (p, 6 + 1, decimal_format, exponent);
+ }
+ while (*p != '\0')
+ p++;
# else
- if (sizeof (DCHAR_T) == 1)
- {
- sprintf ((char *) p, "%+.2d", exponent);
- while (*p != '\0')
- p++;
- }
- else
- {
- char expbuf[6 + 1];
- const char *ep;
- sprintf (expbuf, "%+.2d", exponent);
- for (ep = expbuf; (*p = *ep) != '\0'; ep++)
- p++;
- }
+ if (sizeof (DCHAR_T) == 1)
+ {
+ sprintf ((char *) p, "%+.2d", exponent);
+ while (*p != '\0')
+ p++;
+ }
+ else
+ {
+ char expbuf[6 + 1];
+ const char *ep;
+ sprintf (expbuf, "%+.2d", exponent);
+ for (ep = expbuf; (*p = *ep) != '\0'; ep++)
+ p++;
+ }
# endif
- }
- else if (dp->conversion == 'g' || dp->conversion == 'G')
- {
- if (precision == 0)
- precision = 1;
- /* precision >= 1. */
-
- if (arg == 0.0L)
- /* The exponent is 0, >= -4, < precision.
- Use fixed-point notation. */
- {
- size_t ndigits = precision;
- /* Number of trailing zeroes that have to be
- dropped. */
- size_t nzeroes =
- (flags & FLAG_ALT ? 0 : precision - 1);
-
- --ndigits;
- *p++ = '0';
- if ((flags & FLAG_ALT) || ndigits > nzeroes)
- {
- *p++ = decimal_point_char ();
- while (ndigits > nzeroes)
- {
- --ndigits;
- *p++ = '0';
- }
- }
- }
- else
- {
- /* arg > 0.0L. */
- int exponent;
- int adjusted;
- char *digits;
- size_t ndigits;
- size_t nzeroes;
-
- exponent = floorlog10l (arg);
- adjusted = 0;
- for (;;)
- {
- digits =
- scale10_round_decimal_long_double (arg,
- (int)(precision - 1) - exponent);
- if (digits == NULL)
- {
- END_LONG_DOUBLE_ROUNDING ();
- goto out_of_memory;
- }
- ndigits = strlen (digits);
-
- if (ndigits == precision)
- break;
- if (ndigits < precision - 1
- || ndigits > precision + 1)
- /* The exponent was not guessed
- precisely enough. */
- abort ();
- if (adjusted)
- /* None of two values of exponent is
- the right one. Prevent an endless
- loop. */
- abort ();
- free (digits);
- if (ndigits < precision)
- exponent -= 1;
- else
- exponent += 1;
- adjusted = 1;
- }
- /* Here ndigits = precision. */
-
- /* Determine the number of trailing zeroes
- that have to be dropped. */
- nzeroes = 0;
- if ((flags & FLAG_ALT) == 0)
- while (nzeroes < ndigits
- && digits[nzeroes] == '0')
- nzeroes++;
-
- /* The exponent is now determined. */
- if (exponent >= -4
- && exponent < (long)precision)
- {
- /* Fixed-point notation:
- max(exponent,0)+1 digits, then the
- decimal point, then the remaining
- digits without trailing zeroes. */
- if (exponent >= 0)
- {
- size_t count = exponent + 1;
- /* Note: count <= precision = ndigits. */
- for (; count > 0; count--)
- *p++ = digits[--ndigits];
- if ((flags & FLAG_ALT) || ndigits > nzeroes)
- {
- *p++ = decimal_point_char ();
- while (ndigits > nzeroes)
- {
- --ndigits;
- *p++ = digits[ndigits];
- }
- }
- }
- else
- {
- size_t count = -exponent - 1;
- *p++ = '0';
- *p++ = decimal_point_char ();
- for (; count > 0; count--)
- *p++ = '0';
- while (ndigits > nzeroes)
- {
- --ndigits;
- *p++ = digits[ndigits];
- }
- }
- }
- else
- {
- /* Exponential notation. */
- *p++ = digits[--ndigits];
- if ((flags & FLAG_ALT) || ndigits > nzeroes)
- {
- *p++ = decimal_point_char ();
- while (ndigits > nzeroes)
- {
- --ndigits;
- *p++ = digits[ndigits];
- }
- }
- *p++ = dp->conversion - 'G' + 'E'; /* 'e' or 'E' */
+ }
+ else if (dp->conversion == 'g' || dp->conversion == 'G')
+ {
+ if (precision == 0)
+ precision = 1;
+ /* precision >= 1. */
+
+ if (arg == 0.0L)
+ /* The exponent is 0, >= -4, < precision.
+ Use fixed-point notation. */
+ {
+ size_t ndigits = precision;
+ /* Number of trailing zeroes that have to be
+ dropped. */
+ size_t nzeroes =
+ (flags & FLAG_ALT ? 0 : precision - 1);
+
+ --ndigits;
+ *p++ = '0';
+ if ((flags & FLAG_ALT) || ndigits > nzeroes)
+ {
+ *p++ = decimal_point_char ();
+ while (ndigits > nzeroes)
+ {
+ --ndigits;
+ *p++ = '0';
+ }
+ }
+ }
+ else
+ {
+ /* arg > 0.0L. */
+ int exponent;
+ int adjusted;
+ char *digits;
+ size_t ndigits;
+ size_t nzeroes;
+
+ exponent = floorlog10l (arg);
+ adjusted = 0;
+ for (;;)
+ {
+ digits =
+ scale10_round_decimal_long_double (arg,
+ (int)(precision - 1) - exponent);
+ if (digits == NULL)
+ {
+ END_LONG_DOUBLE_ROUNDING ();
+ goto out_of_memory;
+ }
+ ndigits = strlen (digits);
+
+ if (ndigits == precision)
+ break;
+ if (ndigits < precision - 1
+ || ndigits > precision + 1)
+ /* The exponent was not guessed
+ precisely enough. */
+ abort ();
+ if (adjusted)
+ /* None of two values of exponent is
+ the right one. Prevent an endless
+ loop. */
+ abort ();
+ free (digits);
+ if (ndigits < precision)
+ exponent -= 1;
+ else
+ exponent += 1;
+ adjusted = 1;
+ }
+ /* Here ndigits = precision. */
+ if (is_borderline (digits, precision - 1))
+ {
+ /* Maybe the exponent guess was too high
+ and a smaller exponent can be reached
+ by turning a 10...0 into 9...9x. */
+ char *digits2 =
+ scale10_round_decimal_long_double (arg,
+ (int)(precision - 1) - exponent + 1);
+ if (digits2 == NULL)
+ {
+ free (digits);
+ END_LONG_DOUBLE_ROUNDING ();
+ goto out_of_memory;
+ }
+ if (strlen (digits2) == precision)
+ {
+ free (digits);
+ digits = digits2;
+ exponent -= 1;
+ }
+ else
+ free (digits2);
+ }
+ /* Here ndigits = precision. */
+
+ /* Determine the number of trailing zeroes
+ that have to be dropped. */
+ nzeroes = 0;
+ if ((flags & FLAG_ALT) == 0)
+ while (nzeroes < ndigits
+ && digits[nzeroes] == '0')
+ nzeroes++;
+
+ /* The exponent is now determined. */
+ if (exponent >= -4
+ && exponent < (long)precision)
+ {
+ /* Fixed-point notation:
+ max(exponent,0)+1 digits, then the
+ decimal point, then the remaining
+ digits without trailing zeroes. */
+ if (exponent >= 0)
+ {
+ size_t count = exponent + 1;
+ /* Note: count <= precision = ndigits. */
+ for (; count > 0; count--)
+ *p++ = digits[--ndigits];
+ if ((flags & FLAG_ALT) || ndigits > nzeroes)
+ {
+ *p++ = decimal_point_char ();
+ while (ndigits > nzeroes)
+ {
+ --ndigits;
+ *p++ = digits[ndigits];
+ }
+ }
+ }
+ else
+ {
+ size_t count = -exponent - 1;
+ *p++ = '0';
+ *p++ = decimal_point_char ();
+ for (; count > 0; count--)
+ *p++ = '0';
+ while (ndigits > nzeroes)
+ {
+ --ndigits;
+ *p++ = digits[ndigits];
+ }
+ }
+ }
+ else
+ {
+ /* Exponential notation. */
+ *p++ = digits[--ndigits];
+ if ((flags & FLAG_ALT) || ndigits > nzeroes)
+ {
+ *p++ = decimal_point_char ();
+ while (ndigits > nzeroes)
+ {
+ --ndigits;
+ *p++ = digits[ndigits];
+ }
+ }
+ *p++ = dp->conversion - 'G' + 'E'; /* 'e' or 'E' */
# if WIDE_CHAR_VERSION
- {
- static const wchar_t decimal_format[] =
- { '%', '+', '.', '2', 'd', '\0' };
- SNPRINTF (p, 6 + 1, decimal_format, exponent);
- }
- while (*p != '\0')
- p++;
+ {
+ static const wchar_t decimal_format[] =
+ { '%', '+', '.', '2', 'd', '\0' };
+ SNPRINTF (p, 6 + 1, decimal_format, exponent);
+ }
+ while (*p != '\0')
+ p++;
# else
- if (sizeof (DCHAR_T) == 1)
- {
- sprintf ((char *) p, "%+.2d", exponent);
- while (*p != '\0')
- p++;
- }
- else
- {
- char expbuf[6 + 1];
- const char *ep;
- sprintf (expbuf, "%+.2d", exponent);
- for (ep = expbuf; (*p = *ep) != '\0'; ep++)
- p++;
- }
+ if (sizeof (DCHAR_T) == 1)
+ {
+ sprintf ((char *) p, "%+.2d", exponent);
+ while (*p != '\0')
+ p++;
+ }
+ else
+ {
+ char expbuf[6 + 1];
+ const char *ep;
+ sprintf (expbuf, "%+.2d", exponent);
+ for (ep = expbuf; (*p = *ep) != '\0'; ep++)
+ p++;
+ }
# endif
- }
+ }
- free (digits);
- }
- }
- else
- abort ();
+ free (digits);
+ }
+ }
+ else
+ abort ();
# else
- /* arg is finite. */
- abort ();
+ /* arg is finite. */
+ if (!(arg == 0.0L))
+ abort ();
+
+ pad_ptr = p;
+
+ if (dp->conversion == 'f' || dp->conversion == 'F')
+ {
+ *p++ = '0';
+ if ((flags & FLAG_ALT) || precision > 0)
+ {
+ *p++ = decimal_point_char ();
+ for (; precision > 0; precision--)
+ *p++ = '0';
+ }
+ }
+ else if (dp->conversion == 'e' || dp->conversion == 'E')
+ {
+ *p++ = '0';
+ if ((flags & FLAG_ALT) || precision > 0)
+ {
+ *p++ = decimal_point_char ();
+ for (; precision > 0; precision--)
+ *p++ = '0';
+ }
+ *p++ = dp->conversion; /* 'e' or 'E' */
+ *p++ = '+';
+ *p++ = '0';
+ *p++ = '0';
+ }
+ else if (dp->conversion == 'g' || dp->conversion == 'G')
+ {
+ *p++ = '0';
+ if (flags & FLAG_ALT)
+ {
+ size_t ndigits =
+ (precision > 0 ? precision - 1 : 0);
+ *p++ = decimal_point_char ();
+ for (; ndigits > 0; --ndigits)
+ *p++ = '0';
+ }
+ }
+ else if (dp->conversion == 'a' || dp->conversion == 'A')
+ {
+ *p++ = '0';
+ *p++ = dp->conversion - 'A' + 'X';
+ pad_ptr = p;
+ *p++ = '0';
+ if ((flags & FLAG_ALT) || precision > 0)
+ {
+ *p++ = decimal_point_char ();
+ for (; precision > 0; precision--)
+ *p++ = '0';
+ }
+ *p++ = dp->conversion - 'A' + 'P';
+ *p++ = '+';
+ *p++ = '0';
+ }
+ else
+ abort ();
# endif
- }
+ }
- END_LONG_DOUBLE_ROUNDING ();
- }
- }
+ END_LONG_DOUBLE_ROUNDING ();
+ }
+ }
# if NEED_PRINTF_DOUBLE || NEED_PRINTF_INFINITE_DOUBLE
- else
+ else
# endif
# endif
# if NEED_PRINTF_DOUBLE || NEED_PRINTF_INFINITE_DOUBLE
- {
- double arg = a.arg[dp->arg_index].a.a_double;
-
- if (isnan (arg))
- {
- if (dp->conversion >= 'A' && dp->conversion <= 'Z')
- {
- *p++ = 'N'; *p++ = 'A'; *p++ = 'N';
- }
- else
- {
- *p++ = 'n'; *p++ = 'a'; *p++ = 'n';
- }
- }
- else
- {
- int sign = 0;
-
- if (signbit (arg)) /* arg < 0.0 or negative zero */
- {
- sign = -1;
- arg = -arg;
- }
-
- if (sign < 0)
- *p++ = '-';
- else if (flags & FLAG_SHOWSIGN)
- *p++ = '+';
- else if (flags & FLAG_SPACE)
- *p++ = ' ';
-
- if (arg > 0.0 && arg + arg == arg)
- {
- if (dp->conversion >= 'A' && dp->conversion <= 'Z')
- {
- *p++ = 'I'; *p++ = 'N'; *p++ = 'F';
- }
- else
- {
- *p++ = 'i'; *p++ = 'n'; *p++ = 'f';
- }
- }
- else
- {
+ {
+ double arg = a.arg[dp->arg_index].a.a_double;
+
+ if (isnand (arg))
+ {
+ if (dp->conversion >= 'A' && dp->conversion <= 'Z')
+ {
+ *p++ = 'N'; *p++ = 'A'; *p++ = 'N';
+ }
+ else
+ {
+ *p++ = 'n'; *p++ = 'a'; *p++ = 'n';
+ }
+ }
+ else
+ {
+ int sign = 0;
+
+ if (signbit (arg)) /* arg < 0.0 or negative zero */
+ {
+ sign = -1;
+ arg = -arg;
+ }
+
+ if (sign < 0)
+ *p++ = '-';
+ else if (flags & FLAG_SHOWSIGN)
+ *p++ = '+';
+ else if (flags & FLAG_SPACE)
+ *p++ = ' ';
+
+ if (arg > 0.0 && arg + arg == arg)
+ {
+ if (dp->conversion >= 'A' && dp->conversion <= 'Z')
+ {
+ *p++ = 'I'; *p++ = 'N'; *p++ = 'F';
+ }
+ else
+ {
+ *p++ = 'i'; *p++ = 'n'; *p++ = 'f';
+ }
+ }
+ else
+ {
# if NEED_PRINTF_DOUBLE
- pad_ptr = p;
-
- if (dp->conversion == 'f' || dp->conversion == 'F')
- {
- char *digits;
- size_t ndigits;
-
- digits =
- scale10_round_decimal_double (arg, precision);
- if (digits == NULL)
- goto out_of_memory;
- ndigits = strlen (digits);
-
- if (ndigits > precision)
- do
- {
- --ndigits;
- *p++ = digits[ndigits];
- }
- while (ndigits > precision);
- else
- *p++ = '0';
- /* Here ndigits <= precision. */
- if ((flags & FLAG_ALT) || precision > 0)
- {
- *p++ = decimal_point_char ();
- for (; precision > ndigits; precision--)
- *p++ = '0';
- while (ndigits > 0)
- {
- --ndigits;
- *p++ = digits[ndigits];
- }
- }
-
- free (digits);
- }
- else if (dp->conversion == 'e' || dp->conversion == 'E')
- {
- int exponent;
-
- if (arg == 0.0)
- {
- exponent = 0;
- *p++ = '0';
- if ((flags & FLAG_ALT) || precision > 0)
- {
- *p++ = decimal_point_char ();
- for (; precision > 0; precision--)
- *p++ = '0';
- }
- }
- else
- {
- /* arg > 0.0. */
- int adjusted;
- char *digits;
- size_t ndigits;
-
- exponent = floorlog10 (arg);
- adjusted = 0;
- for (;;)
- {
- digits =
- scale10_round_decimal_double (arg,
- (int)precision - exponent);
- if (digits == NULL)
- goto out_of_memory;
- ndigits = strlen (digits);
-
- if (ndigits == precision + 1)
- break;
- if (ndigits < precision
- || ndigits > precision + 2)
- /* The exponent was not guessed
- precisely enough. */
- abort ();
- if (adjusted)
- /* None of two values of exponent is
- the right one. Prevent an endless
- loop. */
- abort ();
- free (digits);
- if (ndigits == precision)
- exponent -= 1;
- else
- exponent += 1;
- adjusted = 1;
- }
-
- /* Here ndigits = precision+1. */
- *p++ = digits[--ndigits];
- if ((flags & FLAG_ALT) || precision > 0)
- {
- *p++ = decimal_point_char ();
- while (ndigits > 0)
- {
- --ndigits;
- *p++ = digits[ndigits];
- }
- }
-
- free (digits);
- }
-
- *p++ = dp->conversion; /* 'e' or 'E' */
+ pad_ptr = p;
+
+ if (dp->conversion == 'f' || dp->conversion == 'F')
+ {
+ char *digits;
+ size_t ndigits;
+
+ digits =
+ scale10_round_decimal_double (arg, precision);
+ if (digits == NULL)
+ goto out_of_memory;
+ ndigits = strlen (digits);
+
+ if (ndigits > precision)
+ do
+ {
+ --ndigits;
+ *p++ = digits[ndigits];
+ }
+ while (ndigits > precision);
+ else
+ *p++ = '0';
+ /* Here ndigits <= precision. */
+ if ((flags & FLAG_ALT) || precision > 0)
+ {
+ *p++ = decimal_point_char ();
+ for (; precision > ndigits; precision--)
+ *p++ = '0';
+ while (ndigits > 0)
+ {
+ --ndigits;
+ *p++ = digits[ndigits];
+ }
+ }
+
+ free (digits);
+ }
+ else if (dp->conversion == 'e' || dp->conversion == 'E')
+ {
+ int exponent;
+
+ if (arg == 0.0)
+ {
+ exponent = 0;
+ *p++ = '0';
+ if ((flags & FLAG_ALT) || precision > 0)
+ {
+ *p++ = decimal_point_char ();
+ for (; precision > 0; precision--)
+ *p++ = '0';
+ }
+ }
+ else
+ {
+ /* arg > 0.0. */
+ int adjusted;
+ char *digits;
+ size_t ndigits;
+
+ exponent = floorlog10 (arg);
+ adjusted = 0;
+ for (;;)
+ {
+ digits =
+ scale10_round_decimal_double (arg,
+ (int)precision - exponent);
+ if (digits == NULL)
+ goto out_of_memory;
+ ndigits = strlen (digits);
+
+ if (ndigits == precision + 1)
+ break;
+ if (ndigits < precision
+ || ndigits > precision + 2)
+ /* The exponent was not guessed
+ precisely enough. */
+ abort ();
+ if (adjusted)
+ /* None of two values of exponent is
+ the right one. Prevent an endless
+ loop. */
+ abort ();
+ free (digits);
+ if (ndigits == precision)
+ exponent -= 1;
+ else
+ exponent += 1;
+ adjusted = 1;
+ }
+ /* Here ndigits = precision+1. */
+ if (is_borderline (digits, precision))
+ {
+ /* Maybe the exponent guess was too high
+ and a smaller exponent can be reached
+ by turning a 10...0 into 9...9x. */
+ char *digits2 =
+ scale10_round_decimal_double (arg,
+ (int)precision - exponent + 1);
+ if (digits2 == NULL)
+ {
+ free (digits);
+ goto out_of_memory;
+ }
+ if (strlen (digits2) == precision + 1)
+ {
+ free (digits);
+ digits = digits2;
+ exponent -= 1;
+ }
+ else
+ free (digits2);
+ }
+ /* Here ndigits = precision+1. */
+
+ *p++ = digits[--ndigits];
+ if ((flags & FLAG_ALT) || precision > 0)
+ {
+ *p++ = decimal_point_char ();
+ while (ndigits > 0)
+ {
+ --ndigits;
+ *p++ = digits[ndigits];
+ }
+ }
+
+ free (digits);
+ }
+
+ *p++ = dp->conversion; /* 'e' or 'E' */
# if WIDE_CHAR_VERSION
- {
- static const wchar_t decimal_format[] =
- /* Produce the same number of exponent digits
- as the native printf implementation. */
+ {
+ static const wchar_t decimal_format[] =
+ /* Produce the same number of exponent digits
+ as the native printf implementation. */
# if (defined _WIN32 || defined __WIN32__) && ! defined __CYGWIN__
- { '%', '+', '.', '3', 'd', '\0' };
+ { '%', '+', '.', '3', 'd', '\0' };
# else
- { '%', '+', '.', '2', 'd', '\0' };
+ { '%', '+', '.', '2', 'd', '\0' };
# endif
- SNPRINTF (p, 6 + 1, decimal_format, exponent);
- }
- while (*p != '\0')
- p++;
+ SNPRINTF (p, 6 + 1, decimal_format, exponent);
+ }
+ while (*p != '\0')
+ p++;
# else
- {
- static const char decimal_format[] =
- /* Produce the same number of exponent digits
- as the native printf implementation. */
+ {
+ static const char decimal_format[] =
+ /* Produce the same number of exponent digits
+ as the native printf implementation. */
# if (defined _WIN32 || defined __WIN32__) && ! defined __CYGWIN__
- "%+.3d";
+ "%+.3d";
# else
- "%+.2d";
+ "%+.2d";
# endif
- if (sizeof (DCHAR_T) == 1)
- {
- sprintf ((char *) p, decimal_format, exponent);
- while (*p != '\0')
- p++;
- }
- else
- {
- char expbuf[6 + 1];
- const char *ep;
- sprintf (expbuf, decimal_format, exponent);
- for (ep = expbuf; (*p = *ep) != '\0'; ep++)
- p++;
- }
- }
+ if (sizeof (DCHAR_T) == 1)
+ {
+ sprintf ((char *) p, decimal_format, exponent);
+ while (*p != '\0')
+ p++;
+ }
+ else
+ {
+ char expbuf[6 + 1];
+ const char *ep;
+ sprintf (expbuf, decimal_format, exponent);
+ for (ep = expbuf; (*p = *ep) != '\0'; ep++)
+ p++;
+ }
+ }
# endif
- }
- else if (dp->conversion == 'g' || dp->conversion == 'G')
- {
- if (precision == 0)
- precision = 1;
- /* precision >= 1. */
-
- if (arg == 0.0)
- /* The exponent is 0, >= -4, < precision.
- Use fixed-point notation. */
- {
- size_t ndigits = precision;
- /* Number of trailing zeroes that have to be
- dropped. */
- size_t nzeroes =
- (flags & FLAG_ALT ? 0 : precision - 1);
-
- --ndigits;
- *p++ = '0';
- if ((flags & FLAG_ALT) || ndigits > nzeroes)
- {
- *p++ = decimal_point_char ();
- while (ndigits > nzeroes)
- {
- --ndigits;
- *p++ = '0';
- }
- }
- }
- else
- {
- /* arg > 0.0. */
- int exponent;
- int adjusted;
- char *digits;
- size_t ndigits;
- size_t nzeroes;
-
- exponent = floorlog10 (arg);
- adjusted = 0;
- for (;;)
- {
- digits =
- scale10_round_decimal_double (arg,
- (int)(precision - 1) - exponent);
- if (digits == NULL)
- goto out_of_memory;
- ndigits = strlen (digits);
-
- if (ndigits == precision)
- break;
- if (ndigits < precision - 1
- || ndigits > precision + 1)
- /* The exponent was not guessed
- precisely enough. */
- abort ();
- if (adjusted)
- /* None of two values of exponent is
- the right one. Prevent an endless
- loop. */
- abort ();
- free (digits);
- if (ndigits < precision)
- exponent -= 1;
- else
- exponent += 1;
- adjusted = 1;
- }
- /* Here ndigits = precision. */
-
- /* Determine the number of trailing zeroes
- that have to be dropped. */
- nzeroes = 0;
- if ((flags & FLAG_ALT) == 0)
- while (nzeroes < ndigits
- && digits[nzeroes] == '0')
- nzeroes++;
-
- /* The exponent is now determined. */
- if (exponent >= -4
- && exponent < (long)precision)
- {
- /* Fixed-point notation:
- max(exponent,0)+1 digits, then the
- decimal point, then the remaining
- digits without trailing zeroes. */
- if (exponent >= 0)
- {
- size_t count = exponent + 1;
- /* Note: count <= precision = ndigits. */
- for (; count > 0; count--)
- *p++ = digits[--ndigits];
- if ((flags & FLAG_ALT) || ndigits > nzeroes)
- {
- *p++ = decimal_point_char ();
- while (ndigits > nzeroes)
- {
- --ndigits;
- *p++ = digits[ndigits];
- }
- }
- }
- else
- {
- size_t count = -exponent - 1;
- *p++ = '0';
- *p++ = decimal_point_char ();
- for (; count > 0; count--)
- *p++ = '0';
- while (ndigits > nzeroes)
- {
- --ndigits;
- *p++ = digits[ndigits];
- }
- }
- }
- else
- {
- /* Exponential notation. */
- *p++ = digits[--ndigits];
- if ((flags & FLAG_ALT) || ndigits > nzeroes)
- {
- *p++ = decimal_point_char ();
- while (ndigits > nzeroes)
- {
- --ndigits;
- *p++ = digits[ndigits];
- }
- }
- *p++ = dp->conversion - 'G' + 'E'; /* 'e' or 'E' */
+ }
+ else if (dp->conversion == 'g' || dp->conversion == 'G')
+ {
+ if (precision == 0)
+ precision = 1;
+ /* precision >= 1. */
+
+ if (arg == 0.0)
+ /* The exponent is 0, >= -4, < precision.
+ Use fixed-point notation. */
+ {
+ size_t ndigits = precision;
+ /* Number of trailing zeroes that have to be
+ dropped. */
+ size_t nzeroes =
+ (flags & FLAG_ALT ? 0 : precision - 1);
+
+ --ndigits;
+ *p++ = '0';
+ if ((flags & FLAG_ALT) || ndigits > nzeroes)
+ {
+ *p++ = decimal_point_char ();
+ while (ndigits > nzeroes)
+ {
+ --ndigits;
+ *p++ = '0';
+ }
+ }
+ }
+ else
+ {
+ /* arg > 0.0. */
+ int exponent;
+ int adjusted;
+ char *digits;
+ size_t ndigits;
+ size_t nzeroes;
+
+ exponent = floorlog10 (arg);
+ adjusted = 0;
+ for (;;)
+ {
+ digits =
+ scale10_round_decimal_double (arg,
+ (int)(precision - 1) - exponent);
+ if (digits == NULL)
+ goto out_of_memory;
+ ndigits = strlen (digits);
+
+ if (ndigits == precision)
+ break;
+ if (ndigits < precision - 1
+ || ndigits > precision + 1)
+ /* The exponent was not guessed
+ precisely enough. */
+ abort ();
+ if (adjusted)
+ /* None of two values of exponent is
+ the right one. Prevent an endless
+ loop. */
+ abort ();
+ free (digits);
+ if (ndigits < precision)
+ exponent -= 1;
+ else
+ exponent += 1;
+ adjusted = 1;
+ }
+ /* Here ndigits = precision. */
+ if (is_borderline (digits, precision - 1))
+ {
+ /* Maybe the exponent guess was too high
+ and a smaller exponent can be reached
+ by turning a 10...0 into 9...9x. */
+ char *digits2 =
+ scale10_round_decimal_double (arg,
+ (int)(precision - 1) - exponent + 1);
+ if (digits2 == NULL)
+ {
+ free (digits);
+ goto out_of_memory;
+ }
+ if (strlen (digits2) == precision)
+ {
+ free (digits);
+ digits = digits2;
+ exponent -= 1;
+ }
+ else
+ free (digits2);
+ }
+ /* Here ndigits = precision. */
+
+ /* Determine the number of trailing zeroes
+ that have to be dropped. */
+ nzeroes = 0;
+ if ((flags & FLAG_ALT) == 0)
+ while (nzeroes < ndigits
+ && digits[nzeroes] == '0')
+ nzeroes++;
+
+ /* The exponent is now determined. */
+ if (exponent >= -4
+ && exponent < (long)precision)
+ {
+ /* Fixed-point notation:
+ max(exponent,0)+1 digits, then the
+ decimal point, then the remaining
+ digits without trailing zeroes. */
+ if (exponent >= 0)
+ {
+ size_t count = exponent + 1;
+ /* Note: count <= precision = ndigits. */
+ for (; count > 0; count--)
+ *p++ = digits[--ndigits];
+ if ((flags & FLAG_ALT) || ndigits > nzeroes)
+ {
+ *p++ = decimal_point_char ();
+ while (ndigits > nzeroes)
+ {
+ --ndigits;
+ *p++ = digits[ndigits];
+ }
+ }
+ }
+ else
+ {
+ size_t count = -exponent - 1;
+ *p++ = '0';
+ *p++ = decimal_point_char ();
+ for (; count > 0; count--)
+ *p++ = '0';
+ while (ndigits > nzeroes)
+ {
+ --ndigits;
+ *p++ = digits[ndigits];
+ }
+ }
+ }
+ else
+ {
+ /* Exponential notation. */
+ *p++ = digits[--ndigits];
+ if ((flags & FLAG_ALT) || ndigits > nzeroes)
+ {
+ *p++ = decimal_point_char ();
+ while (ndigits > nzeroes)
+ {
+ --ndigits;
+ *p++ = digits[ndigits];
+ }
+ }
+ *p++ = dp->conversion - 'G' + 'E'; /* 'e' or 'E' */
# if WIDE_CHAR_VERSION
- {
- static const wchar_t decimal_format[] =
- /* Produce the same number of exponent digits
- as the native printf implementation. */
+ {
+ static const wchar_t decimal_format[] =
+ /* Produce the same number of exponent digits
+ as the native printf implementation. */
# if (defined _WIN32 || defined __WIN32__) && ! defined __CYGWIN__
- { '%', '+', '.', '3', 'd', '\0' };
+ { '%', '+', '.', '3', 'd', '\0' };
# else
- { '%', '+', '.', '2', 'd', '\0' };
+ { '%', '+', '.', '2', 'd', '\0' };
# endif
- SNPRINTF (p, 6 + 1, decimal_format, exponent);
- }
- while (*p != '\0')
- p++;
+ SNPRINTF (p, 6 + 1, decimal_format, exponent);
+ }
+ while (*p != '\0')
+ p++;
# else
- {
- static const char decimal_format[] =
- /* Produce the same number of exponent digits
- as the native printf implementation. */
+ {
+ static const char decimal_format[] =
+ /* Produce the same number of exponent digits
+ as the native printf implementation. */
# if (defined _WIN32 || defined __WIN32__) && ! defined __CYGWIN__
- "%+.3d";
+ "%+.3d";
# else
- "%+.2d";
+ "%+.2d";
# endif
- if (sizeof (DCHAR_T) == 1)
- {
- sprintf ((char *) p, decimal_format, exponent);
- while (*p != '\0')
- p++;
- }
- else
- {
- char expbuf[6 + 1];
- const char *ep;
- sprintf (expbuf, decimal_format, exponent);
- for (ep = expbuf; (*p = *ep) != '\0'; ep++)
- p++;
- }
- }
+ if (sizeof (DCHAR_T) == 1)
+ {
+ sprintf ((char *) p, decimal_format, exponent);
+ while (*p != '\0')
+ p++;
+ }
+ else
+ {
+ char expbuf[6 + 1];
+ const char *ep;
+ sprintf (expbuf, decimal_format, exponent);
+ for (ep = expbuf; (*p = *ep) != '\0'; ep++)
+ p++;
+ }
+ }
# endif
- }
+ }
- free (digits);
- }
- }
- else
- abort ();
+ free (digits);
+ }
+ }
+ else
+ abort ();
# else
- /* arg is finite. */
- if (!(arg == 0.0))
- abort ();
-
- pad_ptr = p;
-
- if (dp->conversion == 'f' || dp->conversion == 'F')
- {
- *p++ = '0';
- if ((flags & FLAG_ALT) || precision > 0)
- {
- *p++ = decimal_point_char ();
- for (; precision > 0; precision--)
- *p++ = '0';
- }
- }
- else if (dp->conversion == 'e' || dp->conversion == 'E')
- {
- *p++ = '0';
- if ((flags & FLAG_ALT) || precision > 0)
- {
- *p++ = decimal_point_char ();
- for (; precision > 0; precision--)
- *p++ = '0';
- }
- *p++ = dp->conversion; /* 'e' or 'E' */
- *p++ = '+';
- /* Produce the same number of exponent digits as
- the native printf implementation. */
+ /* arg is finite. */
+ if (!(arg == 0.0))
+ abort ();
+
+ pad_ptr = p;
+
+ if (dp->conversion == 'f' || dp->conversion == 'F')
+ {
+ *p++ = '0';
+ if ((flags & FLAG_ALT) || precision > 0)
+ {
+ *p++ = decimal_point_char ();
+ for (; precision > 0; precision--)
+ *p++ = '0';
+ }
+ }
+ else if (dp->conversion == 'e' || dp->conversion == 'E')
+ {
+ *p++ = '0';
+ if ((flags & FLAG_ALT) || precision > 0)
+ {
+ *p++ = decimal_point_char ();
+ for (; precision > 0; precision--)
+ *p++ = '0';
+ }
+ *p++ = dp->conversion; /* 'e' or 'E' */
+ *p++ = '+';
+ /* Produce the same number of exponent digits as
+ the native printf implementation. */
# if (defined _WIN32 || defined __WIN32__) && ! defined __CYGWIN__
- *p++ = '0';
+ *p++ = '0';
# endif
- *p++ = '0';
- *p++ = '0';
- }
- else if (dp->conversion == 'g' || dp->conversion == 'G')
- {
- *p++ = '0';
- if (flags & FLAG_ALT)
- {
- size_t ndigits =
- (precision > 0 ? precision - 1 : 0);
- *p++ = decimal_point_char ();
- for (; ndigits > 0; --ndigits)
- *p++ = '0';
- }
- }
- else
- abort ();
+ *p++ = '0';
+ *p++ = '0';
+ }
+ else if (dp->conversion == 'g' || dp->conversion == 'G')
+ {
+ *p++ = '0';
+ if (flags & FLAG_ALT)
+ {
+ size_t ndigits =
+ (precision > 0 ? precision - 1 : 0);
+ *p++ = decimal_point_char ();
+ for (; ndigits > 0; --ndigits)
+ *p++ = '0';
+ }
+ }
+ else
+ abort ();
# endif
- }
- }
- }
+ }
+ }
+ }
# endif
- /* The generated string now extends from tmp to p, with the
- zero padding insertion point being at pad_ptr. */
- if (has_width && p - tmp < width)
- {
- size_t pad = width - (p - tmp);
- DCHAR_T *end = p + pad;
-
- if (flags & FLAG_LEFT)
- {
- /* Pad with spaces on the right. */
- for (; pad > 0; pad--)
- *p++ = ' ';
- }
- else if ((flags & FLAG_ZERO) && pad_ptr != NULL)
- {
- /* Pad with zeroes. */
- DCHAR_T *q = end;
-
- while (p > pad_ptr)
- *--q = *--p;
- for (; pad > 0; pad--)
- *p++ = '0';
- }
- else
- {
- /* Pad with spaces on the left. */
- DCHAR_T *q = end;
-
- while (p > tmp)
- *--q = *--p;
- for (; pad > 0; pad--)
- *p++ = ' ';
- }
-
- p = end;
- }
-
- {
- size_t count = p - tmp;
-
- if (count >= tmp_length)
- /* tmp_length was incorrectly calculated - fix the
- code above! */
- abort ();
-
- /* Make room for the result. */
- if (count >= allocated - length)
- {
- size_t n = xsum (length, count);
-
- ENSURE_ALLOCATION (n);
- }
-
- /* Append the result. */
- memcpy (result + length, tmp, count * sizeof (DCHAR_T));
- if (tmp != tmpbuf)
- free (tmp);
- length += count;
- }
- }
+ /* The generated string now extends from tmp to p, with the
+ zero padding insertion point being at pad_ptr. */
+ if (has_width && p - tmp < width)
+ {
+ size_t pad = width - (p - tmp);
+ DCHAR_T *end = p + pad;
+
+ if (flags & FLAG_LEFT)
+ {
+ /* Pad with spaces on the right. */
+ for (; pad > 0; pad--)
+ *p++ = ' ';
+ }
+ else if ((flags & FLAG_ZERO) && pad_ptr != NULL)
+ {
+ /* Pad with zeroes. */
+ DCHAR_T *q = end;
+
+ while (p > pad_ptr)
+ *--q = *--p;
+ for (; pad > 0; pad--)
+ *p++ = '0';
+ }
+ else
+ {
+ /* Pad with spaces on the left. */
+ DCHAR_T *q = end;
+
+ while (p > tmp)
+ *--q = *--p;
+ for (; pad > 0; pad--)
+ *p++ = ' ';
+ }
+
+ p = end;
+ }
+
+ {
+ size_t count = p - tmp;
+
+ if (count >= tmp_length)
+ /* tmp_length was incorrectly calculated - fix the
+ code above! */
+ abort ();
+
+ /* Make room for the result. */
+ if (count >= allocated - length)
+ {
+ size_t n = xsum (length, count);
+
+ ENSURE_ALLOCATION (n);
+ }
+
+ /* Append the result. */
+ memcpy (result + length, tmp, count * sizeof (DCHAR_T));
+ if (tmp != tmpbuf)
+ free (tmp);
+ length += count;
+ }
+ }
#endif
- else
- {
- arg_type type = a.arg[dp->arg_index].type;
- int flags = dp->flags;
-#if !USE_SNPRINTF || !DCHAR_IS_TCHAR || ENABLE_UNISTDIO || NEED_PRINTF_FLAG_ZERO || NEED_PRINTF_UNBOUNDED_PRECISION
- int has_width;
- size_t width;
+ else
+ {
+ arg_type type = a.arg[dp->arg_index].type;
+ int flags = dp->flags;
+#if !USE_SNPRINTF || !HAVE_SNPRINTF_RETVAL_C99 || !DCHAR_IS_TCHAR || ENABLE_UNISTDIO || NEED_PRINTF_FLAG_LEFTADJUST || NEED_PRINTF_FLAG_ZERO || NEED_PRINTF_UNBOUNDED_PRECISION
+ int has_width;
+ size_t width;
#endif
-#if !USE_SNPRINTF || NEED_PRINTF_UNBOUNDED_PRECISION
- int has_precision;
- size_t precision;
+#if !USE_SNPRINTF || !HAVE_SNPRINTF_RETVAL_C99 || NEED_PRINTF_UNBOUNDED_PRECISION
+ int has_precision;
+ size_t precision;
#endif
#if NEED_PRINTF_UNBOUNDED_PRECISION
- int prec_ourselves;
+ int prec_ourselves;
#else
-# define prec_ourselves 0
+# define prec_ourselves 0
#endif
-#if !DCHAR_IS_TCHAR || ENABLE_UNISTDIO || NEED_PRINTF_FLAG_ZERO || NEED_PRINTF_UNBOUNDED_PRECISION
- int pad_ourselves;
+#if NEED_PRINTF_FLAG_LEFTADJUST
+# define pad_ourselves 1
+#elif !DCHAR_IS_TCHAR || ENABLE_UNISTDIO || NEED_PRINTF_FLAG_ZERO || NEED_PRINTF_UNBOUNDED_PRECISION
+ int pad_ourselves;
#else
-# define pad_ourselves 0
+# define pad_ourselves 0
#endif
- TCHAR_T *fbp;
- unsigned int prefix_count;
- int prefixes[2];
+ TCHAR_T *fbp;
+ unsigned int prefix_count;
+ int prefixes[2] IF_LINT (= { 0 });
#if !USE_SNPRINTF
- size_t tmp_length;
- TCHAR_T tmpbuf[700];
- TCHAR_T *tmp;
+ size_t tmp_length;
+ TCHAR_T tmpbuf[700];
+ TCHAR_T *tmp;
#endif
-#if !USE_SNPRINTF || !DCHAR_IS_TCHAR || ENABLE_UNISTDIO || NEED_PRINTF_FLAG_ZERO || NEED_PRINTF_UNBOUNDED_PRECISION
- has_width = 0;
- width = 0;
- if (dp->width_start != dp->width_end)
- {
- if (dp->width_arg_index != ARG_NONE)
- {
- int arg;
-
- if (!(a.arg[dp->width_arg_index].type == TYPE_INT))
- abort ();
- arg = a.arg[dp->width_arg_index].a.a_int;
- if (arg < 0)
- {
- /* "A negative field width is taken as a '-' flag
- followed by a positive field width." */
- flags |= FLAG_LEFT;
- width = (unsigned int) (-arg);
- }
- else
- width = arg;
- }
- else
- {
- const FCHAR_T *digitp = dp->width_start;
-
- do
- width = xsum (xtimes (width, 10), *digitp++ - '0');
- while (digitp != dp->width_end);
- }
- has_width = 1;
- }
+#if !USE_SNPRINTF || !HAVE_SNPRINTF_RETVAL_C99 || !DCHAR_IS_TCHAR || ENABLE_UNISTDIO || NEED_PRINTF_FLAG_LEFTADJUST || NEED_PRINTF_FLAG_ZERO || NEED_PRINTF_UNBOUNDED_PRECISION
+ has_width = 0;
+ width = 0;
+ if (dp->width_start != dp->width_end)
+ {
+ if (dp->width_arg_index != ARG_NONE)
+ {
+ int arg;
+
+ if (!(a.arg[dp->width_arg_index].type == TYPE_INT))
+ abort ();
+ arg = a.arg[dp->width_arg_index].a.a_int;
+ if (arg < 0)
+ {
+ /* "A negative field width is taken as a '-' flag
+ followed by a positive field width." */
+ flags |= FLAG_LEFT;
+ width = (unsigned int) (-arg);
+ }
+ else
+ width = arg;
+ }
+ else
+ {
+ const FCHAR_T *digitp = dp->width_start;
+
+ do
+ width = xsum (xtimes (width, 10), *digitp++ - '0');
+ while (digitp != dp->width_end);
+ }
+ has_width = 1;
+ }
#endif
-#if !USE_SNPRINTF || NEED_PRINTF_UNBOUNDED_PRECISION
- has_precision = 0;
- precision = 6;
- if (dp->precision_start != dp->precision_end)
- {
- if (dp->precision_arg_index != ARG_NONE)
- {
- int arg;
-
- if (!(a.arg[dp->precision_arg_index].type == TYPE_INT))
- abort ();
- arg = a.arg[dp->precision_arg_index].a.a_int;
- /* "A negative precision is taken as if the precision
- were omitted." */
- if (arg >= 0)
- {
- precision = arg;
- has_precision = 1;
- }
- }
- else
- {
- const FCHAR_T *digitp = dp->precision_start + 1;
-
- precision = 0;
- while (digitp != dp->precision_end)
- precision = xsum (xtimes (precision, 10), *digitp++ - '0');
- has_precision = 1;
- }
- }
-#endif
-
-#if !USE_SNPRINTF
- /* Allocate a temporary buffer of sufficient size for calling
- sprintf. */
- {
- switch (dp->conversion)
- {
-
- case 'd': case 'i': case 'u':
-# if HAVE_LONG_LONG_INT
- if (type == TYPE_LONGLONGINT || type == TYPE_ULONGLONGINT)
- tmp_length =
- (unsigned int) (sizeof (unsigned long long) * CHAR_BIT
- * 0.30103 /* binary -> decimal */
- )
- + 1; /* turn floor into ceil */
- else
-# endif
- if (type == TYPE_LONGINT || type == TYPE_ULONGINT)
- tmp_length =
- (unsigned int) (sizeof (unsigned long) * CHAR_BIT
- * 0.30103 /* binary -> decimal */
- )
- + 1; /* turn floor into ceil */
- else
- tmp_length =
- (unsigned int) (sizeof (unsigned int) * CHAR_BIT
- * 0.30103 /* binary -> decimal */
- )
- + 1; /* turn floor into ceil */
- if (tmp_length < precision)
- tmp_length = precision;
- /* Multiply by 2, as an estimate for FLAG_GROUP. */
- tmp_length = xsum (tmp_length, tmp_length);
- /* Add 1, to account for a leading sign. */
- tmp_length = xsum (tmp_length, 1);
- break;
-
- case 'o':
-# if HAVE_LONG_LONG_INT
- if (type == TYPE_LONGLONGINT || type == TYPE_ULONGLONGINT)
- tmp_length =
- (unsigned int) (sizeof (unsigned long long) * CHAR_BIT
- * 0.333334 /* binary -> octal */
- )
- + 1; /* turn floor into ceil */
- else
-# endif
- if (type == TYPE_LONGINT || type == TYPE_ULONGINT)
- tmp_length =
- (unsigned int) (sizeof (unsigned long) * CHAR_BIT
- * 0.333334 /* binary -> octal */
- )
- + 1; /* turn floor into ceil */
- else
- tmp_length =
- (unsigned int) (sizeof (unsigned int) * CHAR_BIT
- * 0.333334 /* binary -> octal */
- )
- + 1; /* turn floor into ceil */
- if (tmp_length < precision)
- tmp_length = precision;
- /* Add 1, to account for a leading sign. */
- tmp_length = xsum (tmp_length, 1);
- break;
-
- case 'x': case 'X':
-# if HAVE_LONG_LONG_INT
- if (type == TYPE_LONGLONGINT || type == TYPE_ULONGLONGINT)
- tmp_length =
- (unsigned int) (sizeof (unsigned long long) * CHAR_BIT
- * 0.25 /* binary -> hexadecimal */
- )
- + 1; /* turn floor into ceil */
- else
-# endif
- if (type == TYPE_LONGINT || type == TYPE_ULONGINT)
- tmp_length =
- (unsigned int) (sizeof (unsigned long) * CHAR_BIT
- * 0.25 /* binary -> hexadecimal */
- )
- + 1; /* turn floor into ceil */
- else
- tmp_length =
- (unsigned int) (sizeof (unsigned int) * CHAR_BIT
- * 0.25 /* binary -> hexadecimal */
- )
- + 1; /* turn floor into ceil */
- if (tmp_length < precision)
- tmp_length = precision;
- /* Add 2, to account for a leading sign or alternate form. */
- tmp_length = xsum (tmp_length, 2);
- break;
-
- case 'f': case 'F':
- if (type == TYPE_LONGDOUBLE)
- tmp_length =
- (unsigned int) (LDBL_MAX_EXP
- * 0.30103 /* binary -> decimal */
- * 2 /* estimate for FLAG_GROUP */
- )
- + 1 /* turn floor into ceil */
- + 10; /* sign, decimal point etc. */
- else
- tmp_length =
- (unsigned int) (DBL_MAX_EXP
- * 0.30103 /* binary -> decimal */
- * 2 /* estimate for FLAG_GROUP */
- )
- + 1 /* turn floor into ceil */
- + 10; /* sign, decimal point etc. */
- tmp_length = xsum (tmp_length, precision);
- break;
-
- case 'e': case 'E': case 'g': case 'G':
- tmp_length =
- 12; /* sign, decimal point, exponent etc. */
- tmp_length = xsum (tmp_length, precision);
- break;
-
- case 'a': case 'A':
- if (type == TYPE_LONGDOUBLE)
- tmp_length =
- (unsigned int) (LDBL_DIG
- * 0.831 /* decimal -> hexadecimal */
- )
- + 1; /* turn floor into ceil */
- else
- tmp_length =
- (unsigned int) (DBL_DIG
- * 0.831 /* decimal -> hexadecimal */
- )
- + 1; /* turn floor into ceil */
- if (tmp_length < precision)
- tmp_length = precision;
- /* Account for sign, decimal point etc. */
- tmp_length = xsum (tmp_length, 12);
- break;
-
- case 'c':
-# if HAVE_WINT_T && !WIDE_CHAR_VERSION
- if (type == TYPE_WIDE_CHAR)
- tmp_length = MB_CUR_MAX;
- else
-# endif
- tmp_length = 1;
- break;
-
- case 's':
-# if HAVE_WCHAR_T
- if (type == TYPE_WIDE_STRING)
- {
- tmp_length =
- local_wcslen (a.arg[dp->arg_index].a.a_wide_string);
-
-# if !WIDE_CHAR_VERSION
- tmp_length = xtimes (tmp_length, MB_CUR_MAX);
-# endif
- }
- else
-# endif
- tmp_length = strlen (a.arg[dp->arg_index].a.a_string);
- break;
-
- case 'p':
- tmp_length =
- (unsigned int) (sizeof (void *) * CHAR_BIT
- * 0.25 /* binary -> hexadecimal */
- )
- + 1 /* turn floor into ceil */
- + 2; /* account for leading 0x */
- break;
-
- default:
- abort ();
- }
-
-# if ENABLE_UNISTDIO
- /* Padding considers the number of characters, therefore the
- number of elements after padding may be
- > max (tmp_length, width)
- but is certainly
- <= tmp_length + width. */
- tmp_length = xsum (tmp_length, width);
-# else
- /* Padding considers the number of elements, says POSIX. */
- if (tmp_length < width)
- tmp_length = width;
-# endif
-
- tmp_length = xsum (tmp_length, 1); /* account for trailing NUL */
- }
-
- if (tmp_length <= sizeof (tmpbuf) / sizeof (TCHAR_T))
- tmp = tmpbuf;
- else
- {
- size_t tmp_memsize = xtimes (tmp_length, sizeof (TCHAR_T));
-
- if (size_overflow_p (tmp_memsize))
- /* Overflow, would lead to out of memory. */
- goto out_of_memory;
- tmp = (TCHAR_T *) malloc (tmp_memsize);
- if (tmp == NULL)
- /* Out of memory. */
- goto out_of_memory;
- }
+#if !USE_SNPRINTF || !HAVE_SNPRINTF_RETVAL_C99 || NEED_PRINTF_UNBOUNDED_PRECISION
+ has_precision = 0;
+ precision = 6;
+ if (dp->precision_start != dp->precision_end)
+ {
+ if (dp->precision_arg_index != ARG_NONE)
+ {
+ int arg;
+
+ if (!(a.arg[dp->precision_arg_index].type == TYPE_INT))
+ abort ();
+ arg = a.arg[dp->precision_arg_index].a.a_int;
+ /* "A negative precision is taken as if the precision
+ were omitted." */
+ if (arg >= 0)
+ {
+ precision = arg;
+ has_precision = 1;
+ }
+ }
+ else
+ {
+ const FCHAR_T *digitp = dp->precision_start + 1;
+
+ precision = 0;
+ while (digitp != dp->precision_end)
+ precision = xsum (xtimes (precision, 10), *digitp++ - '0');
+ has_precision = 1;
+ }
+ }
#endif
- /* Decide whether to handle the precision ourselves. */
+ /* Decide whether to handle the precision ourselves. */
#if NEED_PRINTF_UNBOUNDED_PRECISION
- switch (dp->conversion)
- {
- case 'd': case 'i': case 'u':
- case 'o':
- case 'x': case 'X': case 'p':
- prec_ourselves = has_precision && (precision > 0);
- break;
- default:
- prec_ourselves = 0;
- break;
- }
+ switch (dp->conversion)
+ {
+ case 'd': case 'i': case 'u':
+ case 'o':
+ case 'x': case 'X': case 'p':
+ prec_ourselves = has_precision && (precision > 0);
+ break;
+ default:
+ prec_ourselves = 0;
+ break;
+ }
#endif
- /* Decide whether to perform the padding ourselves. */
-#if !DCHAR_IS_TCHAR || ENABLE_UNISTDIO || NEED_PRINTF_FLAG_ZERO || NEED_PRINTF_UNBOUNDED_PRECISION
- switch (dp->conversion)
- {
+ /* Decide whether to perform the padding ourselves. */
+#if !NEED_PRINTF_FLAG_LEFTADJUST && (!DCHAR_IS_TCHAR || ENABLE_UNISTDIO || NEED_PRINTF_FLAG_ZERO || NEED_PRINTF_UNBOUNDED_PRECISION)
+ switch (dp->conversion)
+ {
# if !DCHAR_IS_TCHAR || ENABLE_UNISTDIO
- /* If we need conversion from TCHAR_T[] to DCHAR_T[], we need
- to perform the padding after this conversion. Functions
- with unistdio extensions perform the padding based on
- character count rather than element count. */
- case 'c': case 's':
+ /* If we need conversion from TCHAR_T[] to DCHAR_T[], we need
+ to perform the padding after this conversion. Functions
+ with unistdio extensions perform the padding based on
+ character count rather than element count. */
+ case 'c': case 's':
# endif
# if NEED_PRINTF_FLAG_ZERO
- case 'f': case 'F': case 'e': case 'E': case 'g': case 'G':
- case 'a': case 'A':
+ case 'f': case 'F': case 'e': case 'E': case 'g': case 'G':
+ case 'a': case 'A':
# endif
- pad_ourselves = 1;
- break;
- default:
- pad_ourselves = prec_ourselves;
- break;
- }
+ pad_ourselves = 1;
+ break;
+ default:
+ pad_ourselves = prec_ourselves;
+ break;
+ }
+#endif
+
+#if !USE_SNPRINTF
+ /* Allocate a temporary buffer of sufficient size for calling
+ sprintf. */
+ tmp_length =
+ MAX_ROOM_NEEDED (&a, dp->arg_index, dp->conversion, type,
+ flags, width, has_precision, precision,
+ pad_ourselves);
+
+ if (tmp_length <= sizeof (tmpbuf) / sizeof (TCHAR_T))
+ tmp = tmpbuf;
+ else
+ {
+ size_t tmp_memsize = xtimes (tmp_length, sizeof (TCHAR_T));
+
+ if (size_overflow_p (tmp_memsize))
+ /* Overflow, would lead to out of memory. */
+ goto out_of_memory;
+ tmp = (TCHAR_T *) malloc (tmp_memsize);
+ if (tmp == NULL)
+ /* Out of memory. */
+ goto out_of_memory;
+ }
#endif
- /* Construct the format string for calling snprintf or
- sprintf. */
- fbp = buf;
- *fbp++ = '%';
+ /* Construct the format string for calling snprintf or
+ sprintf. */
+ fbp = buf;
+ *fbp++ = '%';
#if NEED_PRINTF_FLAG_GROUPING
- /* The underlying implementation doesn't support the ' flag.
- Produce no grouping characters in this case; this is
- acceptable because the grouping is locale dependent. */
+ /* The underlying implementation doesn't support the ' flag.
+ Produce no grouping characters in this case; this is
+ acceptable because the grouping is locale dependent. */
#else
- if (flags & FLAG_GROUP)
- *fbp++ = '\'';
+ if (flags & FLAG_GROUP)
+ *fbp++ = '\'';
#endif
- if (flags & FLAG_LEFT)
- *fbp++ = '-';
- if (flags & FLAG_SHOWSIGN)
- *fbp++ = '+';
- if (flags & FLAG_SPACE)
- *fbp++ = ' ';
- if (flags & FLAG_ALT)
- *fbp++ = '#';
- if (!pad_ourselves)
- {
- if (flags & FLAG_ZERO)
- *fbp++ = '0';
- if (dp->width_start != dp->width_end)
- {
- size_t n = dp->width_end - dp->width_start;
- /* The width specification is known to consist only
- of standard ASCII characters. */
- if (sizeof (FCHAR_T) == sizeof (TCHAR_T))
- {
- memcpy (fbp, dp->width_start, n * sizeof (TCHAR_T));
- fbp += n;
- }
- else
- {
- const FCHAR_T *mp = dp->width_start;
- do
- *fbp++ = (unsigned char) *mp++;
- while (--n > 0);
- }
- }
- }
- if (!prec_ourselves)
- {
- if (dp->precision_start != dp->precision_end)
- {
- size_t n = dp->precision_end - dp->precision_start;
- /* The precision specification is known to consist only
- of standard ASCII characters. */
- if (sizeof (FCHAR_T) == sizeof (TCHAR_T))
- {
- memcpy (fbp, dp->precision_start, n * sizeof (TCHAR_T));
- fbp += n;
- }
- else
- {
- const FCHAR_T *mp = dp->precision_start;
- do
- *fbp++ = (unsigned char) *mp++;
- while (--n > 0);
- }
- }
- }
-
- switch (type)
- {
+ if (flags & FLAG_LEFT)
+ *fbp++ = '-';
+ if (flags & FLAG_SHOWSIGN)
+ *fbp++ = '+';
+ if (flags & FLAG_SPACE)
+ *fbp++ = ' ';
+ if (flags & FLAG_ALT)
+ *fbp++ = '#';
+ if (!pad_ourselves)
+ {
+ if (flags & FLAG_ZERO)
+ *fbp++ = '0';
+ if (dp->width_start != dp->width_end)
+ {
+ size_t n = dp->width_end - dp->width_start;
+ /* The width specification is known to consist only
+ of standard ASCII characters. */
+ if (sizeof (FCHAR_T) == sizeof (TCHAR_T))
+ {
+ memcpy (fbp, dp->width_start, n * sizeof (TCHAR_T));
+ fbp += n;
+ }
+ else
+ {
+ const FCHAR_T *mp = dp->width_start;
+ do
+ *fbp++ = (unsigned char) *mp++;
+ while (--n > 0);
+ }
+ }
+ }
+ if (!prec_ourselves)
+ {
+ if (dp->precision_start != dp->precision_end)
+ {
+ size_t n = dp->precision_end - dp->precision_start;
+ /* The precision specification is known to consist only
+ of standard ASCII characters. */
+ if (sizeof (FCHAR_T) == sizeof (TCHAR_T))
+ {
+ memcpy (fbp, dp->precision_start, n * sizeof (TCHAR_T));
+ fbp += n;
+ }
+ else
+ {
+ const FCHAR_T *mp = dp->precision_start;
+ do
+ *fbp++ = (unsigned char) *mp++;
+ while (--n > 0);
+ }
+ }
+ }
+
+ switch (type)
+ {
#if HAVE_LONG_LONG_INT
- case TYPE_LONGLONGINT:
- case TYPE_ULONGLONGINT:
+ case TYPE_LONGLONGINT:
+ case TYPE_ULONGLONGINT:
# if (defined _WIN32 || defined __WIN32__) && ! defined __CYGWIN__
- *fbp++ = 'I';
- *fbp++ = '6';
- *fbp++ = '4';
- break;
+ *fbp++ = 'I';
+ *fbp++ = '6';
+ *fbp++ = '4';
+ break;
# else
- *fbp++ = 'l';
- /*FALLTHROUGH*/
+ *fbp++ = 'l';
+ /*FALLTHROUGH*/
# endif
#endif
- case TYPE_LONGINT:
- case TYPE_ULONGINT:
+ case TYPE_LONGINT:
+ case TYPE_ULONGINT:
#if HAVE_WINT_T
- case TYPE_WIDE_CHAR:
+ case TYPE_WIDE_CHAR:
#endif
#if HAVE_WCHAR_T
- case TYPE_WIDE_STRING:
+ case TYPE_WIDE_STRING:
#endif
- *fbp++ = 'l';
- break;
- case TYPE_LONGDOUBLE:
- *fbp++ = 'L';
- break;
- default:
- break;
- }
+ *fbp++ = 'l';
+ break;
+ case TYPE_LONGDOUBLE:
+ *fbp++ = 'L';
+ break;
+ default:
+ break;
+ }
#if NEED_PRINTF_DIRECTIVE_F
- if (dp->conversion == 'F')
- *fbp = 'f';
- else
+ if (dp->conversion == 'F')
+ *fbp = 'f';
+ else
#endif
- *fbp = dp->conversion;
+ *fbp = dp->conversion;
#if USE_SNPRINTF
-# if !(__GLIBC__ > 2 || (__GLIBC__ == 2 && __GLIBC_MINOR__ >= 3))
- fbp[1] = '%';
- fbp[2] = 'n';
- fbp[3] = '\0';
+# if !(__GLIBC__ > 2 || (__GLIBC__ == 2 && __GLIBC_MINOR__ >= 3) || ((defined _WIN32 || defined __WIN32__) && ! defined __CYGWIN__))
+ fbp[1] = '%';
+ fbp[2] = 'n';
+ fbp[3] = '\0';
# else
- /* On glibc2 systems from glibc >= 2.3 - probably also older
- ones - we know that snprintf's returns value conforms to
- ISO C 99: the gl_SNPRINTF_DIRECTIVE_N test passes.
- Therefore we can avoid using %n in this situation.
- On glibc2 systems from 2004-10-18 or newer, the use of %n
- in format strings in writable memory may crash the program
- (if compiled with _FORTIFY_SOURCE=2), so we should avoid it
- in this situation. */
- fbp[1] = '\0';
+ /* On glibc2 systems from glibc >= 2.3 - probably also older
+ ones - we know that snprintf's returns value conforms to
+ ISO C 99: the gl_SNPRINTF_DIRECTIVE_N test passes.
+ Therefore we can avoid using %n in this situation.
+ On glibc2 systems from 2004-10-18 or newer, the use of %n
+ in format strings in writable memory may crash the program
+ (if compiled with _FORTIFY_SOURCE=2), so we should avoid it
+ in this situation. */
+ /* On native Win32 systems (such as mingw), we can avoid using
+ %n because:
+ - Although the gl_SNPRINTF_TRUNCATION_C99 test fails,
+ snprintf does not write more than the specified number
+ of bytes. (snprintf (buf, 3, "%d %d", 4567, 89) writes
+ '4', '5', '6' into buf, not '4', '5', '\0'.)
+ - Although the gl_SNPRINTF_RETVAL_C99 test fails, snprintf
+ allows us to recognize the case of an insufficient
+ buffer size: it returns -1 in this case.
+ On native Win32 systems (such as mingw) where the OS is
+ Windows Vista, the use of %n in format strings by default
+ crashes the program. See
+ <http://gcc.gnu.org/ml/gcc/2007-06/msg00122.html> and
+ <http://msdn2.microsoft.com/en-us/library/ms175782(VS.80).aspx>
+ So we should avoid %n in this situation. */
+ fbp[1] = '\0';
# endif
#else
- fbp[1] = '\0';
+ fbp[1] = '\0';
#endif
- /* Construct the arguments for calling snprintf or sprintf. */
- prefix_count = 0;
- if (!pad_ourselves && dp->width_arg_index != ARG_NONE)
- {
- if (!(a.arg[dp->width_arg_index].type == TYPE_INT))
- abort ();
- prefixes[prefix_count++] = a.arg[dp->width_arg_index].a.a_int;
- }
- if (dp->precision_arg_index != ARG_NONE)
- {
- if (!(a.arg[dp->precision_arg_index].type == TYPE_INT))
- abort ();
- prefixes[prefix_count++] = a.arg[dp->precision_arg_index].a.a_int;
- }
+ /* Construct the arguments for calling snprintf or sprintf. */
+ prefix_count = 0;
+ if (!pad_ourselves && dp->width_arg_index != ARG_NONE)
+ {
+ if (!(a.arg[dp->width_arg_index].type == TYPE_INT))
+ abort ();
+ prefixes[prefix_count++] = a.arg[dp->width_arg_index].a.a_int;
+ }
+ if (!prec_ourselves && dp->precision_arg_index != ARG_NONE)
+ {
+ if (!(a.arg[dp->precision_arg_index].type == TYPE_INT))
+ abort ();
+ prefixes[prefix_count++] = a.arg[dp->precision_arg_index].a.a_int;
+ }
#if USE_SNPRINTF
- /* The SNPRINTF result is appended after result[0..length].
- The latter is an array of DCHAR_T; SNPRINTF appends an
- array of TCHAR_T to it. This is possible because
- sizeof (TCHAR_T) divides sizeof (DCHAR_T) and
- alignof (TCHAR_T) <= alignof (DCHAR_T). */
+ /* The SNPRINTF result is appended after result[0..length].
+ The latter is an array of DCHAR_T; SNPRINTF appends an
+ array of TCHAR_T to it. This is possible because
+ sizeof (TCHAR_T) divides sizeof (DCHAR_T) and
+ alignof (TCHAR_T) <= alignof (DCHAR_T). */
# define TCHARS_PER_DCHAR (sizeof (DCHAR_T) / sizeof (TCHAR_T))
- /* Prepare checking whether snprintf returns the count
- via %n. */
- ENSURE_ALLOCATION (xsum (length, 1));
- *(TCHAR_T *) (result + length) = '\0';
+ /* Ensure that maxlen below will be >= 2. Needed on BeOS,
+ where an snprintf() with maxlen==1 acts like sprintf(). */
+ ENSURE_ALLOCATION (xsum (length,
+ (2 + TCHARS_PER_DCHAR - 1)
+ / TCHARS_PER_DCHAR));
+ /* Prepare checking whether snprintf returns the count
+ via %n. */
+ *(TCHAR_T *) (result + length) = '\0';
#endif
- for (;;)
- {
- int count = -1;
+ for (;;)
+ {
+ int count = -1;
#if USE_SNPRINTF
- int retcount = 0;
- size_t maxlen = allocated - length;
- /* SNPRINTF can fail if its second argument is
- > INT_MAX. */
- if (maxlen > INT_MAX / TCHARS_PER_DCHAR)
- maxlen = INT_MAX / TCHARS_PER_DCHAR;
- maxlen = maxlen * TCHARS_PER_DCHAR;
+ int retcount = 0;
+ size_t maxlen = allocated - length;
+ /* SNPRINTF can fail if its second argument is
+ > INT_MAX. */
+ if (maxlen > INT_MAX / TCHARS_PER_DCHAR)
+ maxlen = INT_MAX / TCHARS_PER_DCHAR;
+ maxlen = maxlen * TCHARS_PER_DCHAR;
# define SNPRINTF_BUF(arg) \
- switch (prefix_count) \
- { \
- case 0: \
- retcount = SNPRINTF ((TCHAR_T *) (result + length), \
- maxlen, buf, \
- arg, &count); \
- break; \
- case 1: \
- retcount = SNPRINTF ((TCHAR_T *) (result + length), \
- maxlen, buf, \
- prefixes[0], arg, &count); \
- break; \
- case 2: \
- retcount = SNPRINTF ((TCHAR_T *) (result + length), \
- maxlen, buf, \
- prefixes[0], prefixes[1], arg, \
- &count); \
- break; \
- default: \
- abort (); \
- }
+ switch (prefix_count) \
+ { \
+ case 0: \
+ retcount = SNPRINTF ((TCHAR_T *) (result + length), \
+ maxlen, buf, \
+ arg, &count); \
+ break; \
+ case 1: \
+ retcount = SNPRINTF ((TCHAR_T *) (result + length), \
+ maxlen, buf, \
+ prefixes[0], arg, &count); \
+ break; \
+ case 2: \
+ retcount = SNPRINTF ((TCHAR_T *) (result + length), \
+ maxlen, buf, \
+ prefixes[0], prefixes[1], arg, \
+ &count); \
+ break; \
+ default: \
+ abort (); \
+ }
#else
# define SNPRINTF_BUF(arg) \
- switch (prefix_count) \
- { \
- case 0: \
- count = sprintf (tmp, buf, arg); \
- break; \
- case 1: \
- count = sprintf (tmp, buf, prefixes[0], arg); \
- break; \
- case 2: \
- count = sprintf (tmp, buf, prefixes[0], prefixes[1],\
- arg); \
- break; \
- default: \
- abort (); \
- }
+ switch (prefix_count) \
+ { \
+ case 0: \
+ count = sprintf (tmp, buf, arg); \
+ break; \
+ case 1: \
+ count = sprintf (tmp, buf, prefixes[0], arg); \
+ break; \
+ case 2: \
+ count = sprintf (tmp, buf, prefixes[0], prefixes[1],\
+ arg); \
+ break; \
+ default: \
+ abort (); \
+ }
#endif
- switch (type)
- {
- case TYPE_SCHAR:
- {
- int arg = a.arg[dp->arg_index].a.a_schar;
- SNPRINTF_BUF (arg);
- }
- break;
- case TYPE_UCHAR:
- {
- unsigned int arg = a.arg[dp->arg_index].a.a_uchar;
- SNPRINTF_BUF (arg);
- }
- break;
- case TYPE_SHORT:
- {
- int arg = a.arg[dp->arg_index].a.a_short;
- SNPRINTF_BUF (arg);
- }
- break;
- case TYPE_USHORT:
- {
- unsigned int arg = a.arg[dp->arg_index].a.a_ushort;
- SNPRINTF_BUF (arg);
- }
- break;
- case TYPE_INT:
- {
- int arg = a.arg[dp->arg_index].a.a_int;
- SNPRINTF_BUF (arg);
- }
- break;
- case TYPE_UINT:
- {
- unsigned int arg = a.arg[dp->arg_index].a.a_uint;
- SNPRINTF_BUF (arg);
- }
- break;
- case TYPE_LONGINT:
- {
- long int arg = a.arg[dp->arg_index].a.a_longint;
- SNPRINTF_BUF (arg);
- }
- break;
- case TYPE_ULONGINT:
- {
- unsigned long int arg = a.arg[dp->arg_index].a.a_ulongint;
- SNPRINTF_BUF (arg);
- }
- break;
+ errno = 0;
+ switch (type)
+ {
+ case TYPE_SCHAR:
+ {
+ int arg = a.arg[dp->arg_index].a.a_schar;
+ SNPRINTF_BUF (arg);
+ }
+ break;
+ case TYPE_UCHAR:
+ {
+ unsigned int arg = a.arg[dp->arg_index].a.a_uchar;
+ SNPRINTF_BUF (arg);
+ }
+ break;
+ case TYPE_SHORT:
+ {
+ int arg = a.arg[dp->arg_index].a.a_short;
+ SNPRINTF_BUF (arg);
+ }
+ break;
+ case TYPE_USHORT:
+ {
+ unsigned int arg = a.arg[dp->arg_index].a.a_ushort;
+ SNPRINTF_BUF (arg);
+ }
+ break;
+ case TYPE_INT:
+ {
+ int arg = a.arg[dp->arg_index].a.a_int;
+ SNPRINTF_BUF (arg);
+ }
+ break;
+ case TYPE_UINT:
+ {
+ unsigned int arg = a.arg[dp->arg_index].a.a_uint;
+ SNPRINTF_BUF (arg);
+ }
+ break;
+ case TYPE_LONGINT:
+ {
+ long int arg = a.arg[dp->arg_index].a.a_longint;
+ SNPRINTF_BUF (arg);
+ }
+ break;
+ case TYPE_ULONGINT:
+ {
+ unsigned long int arg = a.arg[dp->arg_index].a.a_ulongint;
+ SNPRINTF_BUF (arg);
+ }
+ break;
#if HAVE_LONG_LONG_INT
- case TYPE_LONGLONGINT:
- {
- long long int arg = a.arg[dp->arg_index].a.a_longlongint;
- SNPRINTF_BUF (arg);
- }
- break;
- case TYPE_ULONGLONGINT:
- {
- unsigned long long int arg = a.arg[dp->arg_index].a.a_ulonglongint;
- SNPRINTF_BUF (arg);
- }
- break;
+ case TYPE_LONGLONGINT:
+ {
+ long long int arg = a.arg[dp->arg_index].a.a_longlongint;
+ SNPRINTF_BUF (arg);
+ }
+ break;
+ case TYPE_ULONGLONGINT:
+ {
+ unsigned long long int arg = a.arg[dp->arg_index].a.a_ulonglongint;
+ SNPRINTF_BUF (arg);
+ }
+ break;
#endif
- case TYPE_DOUBLE:
- {
- double arg = a.arg[dp->arg_index].a.a_double;
- SNPRINTF_BUF (arg);
- }
- break;
- case TYPE_LONGDOUBLE:
- {
- long double arg = a.arg[dp->arg_index].a.a_longdouble;
- SNPRINTF_BUF (arg);
- }
- break;
- case TYPE_CHAR:
- {
- int arg = a.arg[dp->arg_index].a.a_char;
- SNPRINTF_BUF (arg);
- }
- break;
+ case TYPE_DOUBLE:
+ {
+ double arg = a.arg[dp->arg_index].a.a_double;
+ SNPRINTF_BUF (arg);
+ }
+ break;
+ case TYPE_LONGDOUBLE:
+ {
+ long double arg = a.arg[dp->arg_index].a.a_longdouble;
+ SNPRINTF_BUF (arg);
+ }
+ break;
+ case TYPE_CHAR:
+ {
+ int arg = a.arg[dp->arg_index].a.a_char;
+ SNPRINTF_BUF (arg);
+ }
+ break;
#if HAVE_WINT_T
- case TYPE_WIDE_CHAR:
- {
- wint_t arg = a.arg[dp->arg_index].a.a_wide_char;
- SNPRINTF_BUF (arg);
- }
- break;
+ case TYPE_WIDE_CHAR:
+ {
+ wint_t arg = a.arg[dp->arg_index].a.a_wide_char;
+ SNPRINTF_BUF (arg);
+ }
+ break;
#endif
- case TYPE_STRING:
- {
- const char *arg = a.arg[dp->arg_index].a.a_string;
- SNPRINTF_BUF (arg);
- }
- break;
+ case TYPE_STRING:
+ {
+ const char *arg = a.arg[dp->arg_index].a.a_string;
+ SNPRINTF_BUF (arg);
+ }
+ break;
#if HAVE_WCHAR_T
- case TYPE_WIDE_STRING:
- {
- const wchar_t *arg = a.arg[dp->arg_index].a.a_wide_string;
- SNPRINTF_BUF (arg);
- }
- break;
+ case TYPE_WIDE_STRING:
+ {
+ const wchar_t *arg = a.arg[dp->arg_index].a.a_wide_string;
+ SNPRINTF_BUF (arg);
+ }
+ break;
#endif
- case TYPE_POINTER:
- {
- void *arg = a.arg[dp->arg_index].a.a_pointer;
- SNPRINTF_BUF (arg);
- }
- break;
- default:
- abort ();
- }
+ case TYPE_POINTER:
+ {
+ void *arg = a.arg[dp->arg_index].a.a_pointer;
+ SNPRINTF_BUF (arg);
+ }
+ break;
+ default:
+ abort ();
+ }
#if USE_SNPRINTF
- /* Portability: Not all implementations of snprintf()
- are ISO C 99 compliant. Determine the number of
- bytes that snprintf() has produced or would have
- produced. */
- if (count >= 0)
- {
- /* Verify that snprintf() has NUL-terminated its
- result. */
- if (count < maxlen
- && ((TCHAR_T *) (result + length)) [count] != '\0')
- abort ();
- /* Portability hack. */
- if (retcount > count)
- count = retcount;
- }
- else
- {
- /* snprintf() doesn't understand the '%n'
- directive. */
- if (fbp[1] != '\0')
- {
- /* Don't use the '%n' directive; instead, look
- at the snprintf() return value. */
- fbp[1] = '\0';
- continue;
- }
- else
- {
- /* Look at the snprintf() return value. */
- if (retcount < 0)
- {
- /* HP-UX 10.20 snprintf() is doubly deficient:
- It doesn't understand the '%n' directive,
- *and* it returns -1 (rather than the length
- that would have been required) when the
- buffer is too small. */
- size_t bigger_need =
- xsum (xtimes (allocated, 2), 12);
- ENSURE_ALLOCATION (bigger_need);
- continue;
- }
- else
- count = retcount;
- }
- }
+ /* Portability: Not all implementations of snprintf()
+ are ISO C 99 compliant. Determine the number of
+ bytes that snprintf() has produced or would have
+ produced. */
+ if (count >= 0)
+ {
+ /* Verify that snprintf() has NUL-terminated its
+ result. */
+ if (count < maxlen
+ && ((TCHAR_T *) (result + length)) [count] != '\0')
+ abort ();
+ /* Portability hack. */
+ if (retcount > count)
+ count = retcount;
+ }
+ else
+ {
+ /* snprintf() doesn't understand the '%n'
+ directive. */
+ if (fbp[1] != '\0')
+ {
+ /* Don't use the '%n' directive; instead, look
+ at the snprintf() return value. */
+ fbp[1] = '\0';
+ continue;
+ }
+ else
+ {
+ /* Look at the snprintf() return value. */
+ if (retcount < 0)
+ {
+# if !HAVE_SNPRINTF_RETVAL_C99
+ /* HP-UX 10.20 snprintf() is doubly deficient:
+ It doesn't understand the '%n' directive,
+ *and* it returns -1 (rather than the length
+ that would have been required) when the
+ buffer is too small.
+ But a failure at this point can also come
+ from other reasons than a too small buffer,
+ such as an invalid wide string argument to
+ the %ls directive, or possibly an invalid
+ floating-point argument. */
+ size_t tmp_length =
+ MAX_ROOM_NEEDED (&a, dp->arg_index,
+ dp->conversion, type, flags,
+ width, has_precision,
+ precision, pad_ourselves);
+
+ if (maxlen < tmp_length)
+ {
+ /* Make more room. But try to do through
+ this reallocation only once. */
+ size_t bigger_need =
+ xsum (length,
+ xsum (tmp_length,
+ TCHARS_PER_DCHAR - 1)
+ / TCHARS_PER_DCHAR);
+ /* And always grow proportionally.
+ (There may be several arguments, each
+ needing a little more room than the
+ previous one.) */
+ size_t bigger_need2 =
+ xsum (xtimes (allocated, 2), 12);
+ if (bigger_need < bigger_need2)
+ bigger_need = bigger_need2;
+ ENSURE_ALLOCATION (bigger_need);
+ continue;
+ }
+# endif
+ }
+ else
+ count = retcount;
+ }
+ }
#endif
- /* Attempt to handle failure. */
- if (count < 0)
- {
- if (!(result == resultbuf || result == NULL))
- free (result);
- if (buf_malloced != NULL)
- free (buf_malloced);
- CLEANUP ();
- errno = EINVAL;
- return NULL;
- }
+ /* Attempt to handle failure. */
+ if (count < 0)
+ {
+ /* SNPRINTF or sprintf failed. Save and use the errno
+ that it has set, if any. */
+ int saved_errno = errno;
+
+ if (!(result == resultbuf || result == NULL))
+ free (result);
+ if (buf_malloced != NULL)
+ free (buf_malloced);
+ CLEANUP ();
+ errno =
+ (saved_errno != 0
+ ? saved_errno
+ : (dp->conversion == 'c' || dp->conversion == 's'
+ ? EILSEQ
+ : EINVAL));
+ return NULL;
+ }
#if USE_SNPRINTF
- /* Handle overflow of the allocated buffer.
- If such an overflow occurs, a C99 compliant snprintf()
- returns a count >= maxlen. However, a non-compliant
- snprintf() function returns only count = maxlen - 1. To
- cover both cases, test whether count >= maxlen - 1. */
- if ((unsigned int) count + 1 >= maxlen)
- {
- /* If maxlen already has attained its allowed maximum,
- allocating more memory will not increase maxlen.
- Instead of looping, bail out. */
- if (maxlen == INT_MAX / TCHARS_PER_DCHAR)
- goto overflow;
- else
- {
- /* Need at least count * sizeof (TCHAR_T) bytes.
- But allocate proportionally, to avoid looping
- eternally if snprintf() reports a too small
- count. */
- size_t n =
- xmax (xsum (length,
- (count + TCHARS_PER_DCHAR - 1)
- / TCHARS_PER_DCHAR),
- xtimes (allocated, 2));
-
- ENSURE_ALLOCATION (n);
- continue;
- }
- }
+ /* Handle overflow of the allocated buffer.
+ If such an overflow occurs, a C99 compliant snprintf()
+ returns a count >= maxlen. However, a non-compliant
+ snprintf() function returns only count = maxlen - 1. To
+ cover both cases, test whether count >= maxlen - 1. */
+ if ((unsigned int) count + 1 >= maxlen)
+ {
+ /* If maxlen already has attained its allowed maximum,
+ allocating more memory will not increase maxlen.
+ Instead of looping, bail out. */
+ if (maxlen == INT_MAX / TCHARS_PER_DCHAR)
+ goto overflow;
+ else
+ {
+ /* Need at least (count + 1) * sizeof (TCHAR_T)
+ bytes. (The +1 is for the trailing NUL.)
+ But ask for (count + 2) * sizeof (TCHAR_T)
+ bytes, so that in the next round, we likely get
+ maxlen > (unsigned int) count + 1
+ and so we don't get here again.
+ And allocate proportionally, to avoid looping
+ eternally if snprintf() reports a too small
+ count. */
+ size_t n =
+ xmax (xsum (length,
+ ((unsigned int) count + 2
+ + TCHARS_PER_DCHAR - 1)
+ / TCHARS_PER_DCHAR),
+ xtimes (allocated, 2));
+
+ ENSURE_ALLOCATION (n);
+ continue;
+ }
+ }
#endif
#if NEED_PRINTF_UNBOUNDED_PRECISION
- if (prec_ourselves)
- {
- /* Handle the precision. */
- TCHAR_T *prec_ptr =
+ if (prec_ourselves)
+ {
+ /* Handle the precision. */
+ TCHAR_T *prec_ptr =
# if USE_SNPRINTF
- (TCHAR_T *) (result + length);
+ (TCHAR_T *) (result + length);
# else
- tmp;
+ tmp;
# endif
- size_t prefix_count;
- size_t move;
-
- prefix_count = 0;
- /* Put the additional zeroes after the sign. */
- if (count >= 1
- && (*prec_ptr == '-' || *prec_ptr == '+'
- || *prec_ptr == ' '))
- prefix_count = 1;
- /* Put the additional zeroes after the 0x prefix if
- (flags & FLAG_ALT) || (dp->conversion == 'p'). */
- else if (count >= 2
- && prec_ptr[0] == '0'
- && (prec_ptr[1] == 'x' || prec_ptr[1] == 'X'))
- prefix_count = 2;
-
- move = count - prefix_count;
- if (precision > move)
- {
- /* Insert zeroes. */
- size_t insert = precision - move;
- TCHAR_T *prec_end;
+ size_t prefix_count;
+ size_t move;
+
+ prefix_count = 0;
+ /* Put the additional zeroes after the sign. */
+ if (count >= 1
+ && (*prec_ptr == '-' || *prec_ptr == '+'
+ || *prec_ptr == ' '))
+ prefix_count = 1;
+ /* Put the additional zeroes after the 0x prefix if
+ (flags & FLAG_ALT) || (dp->conversion == 'p'). */
+ else if (count >= 2
+ && prec_ptr[0] == '0'
+ && (prec_ptr[1] == 'x' || prec_ptr[1] == 'X'))
+ prefix_count = 2;
+
+ move = count - prefix_count;
+ if (precision > move)
+ {
+ /* Insert zeroes. */
+ size_t insert = precision - move;
+ TCHAR_T *prec_end;
# if USE_SNPRINTF
- size_t n =
- xsum (length,
- (count + insert + TCHARS_PER_DCHAR - 1)
- / TCHARS_PER_DCHAR);
- length += (count + TCHARS_PER_DCHAR - 1) / TCHARS_PER_DCHAR;
- ENSURE_ALLOCATION (n);
- length -= (count + TCHARS_PER_DCHAR - 1) / TCHARS_PER_DCHAR;
- prec_ptr = (TCHAR_T *) (result + length);
+ size_t n =
+ xsum (length,
+ (count + insert + TCHARS_PER_DCHAR - 1)
+ / TCHARS_PER_DCHAR);
+ length += (count + TCHARS_PER_DCHAR - 1) / TCHARS_PER_DCHAR;
+ ENSURE_ALLOCATION (n);
+ length -= (count + TCHARS_PER_DCHAR - 1) / TCHARS_PER_DCHAR;
+ prec_ptr = (TCHAR_T *) (result + length);
# endif
- prec_end = prec_ptr + count;
- prec_ptr += prefix_count;
+ prec_end = prec_ptr + count;
+ prec_ptr += prefix_count;
- while (prec_end > prec_ptr)
- {
- prec_end--;
- prec_end[insert] = prec_end[0];
- }
+ while (prec_end > prec_ptr)
+ {
+ prec_end--;
+ prec_end[insert] = prec_end[0];
+ }
- prec_end += insert;
- do
- *--prec_end = '0';
- while (prec_end > prec_ptr);
+ prec_end += insert;
+ do
+ *--prec_end = '0';
+ while (prec_end > prec_ptr);
- count += insert;
- }
- }
+ count += insert;
+ }
+ }
#endif
-#if !DCHAR_IS_TCHAR
-# if !USE_SNPRINTF
- if (count >= tmp_length)
- /* tmp_length was incorrectly calculated - fix the
- code above! */
- abort ();
-# endif
+#if !USE_SNPRINTF
+ if (count >= tmp_length)
+ /* tmp_length was incorrectly calculated - fix the
+ code above! */
+ abort ();
+#endif
- /* Convert from TCHAR_T[] to DCHAR_T[]. */
- if (dp->conversion == 'c' || dp->conversion == 's')
- {
- /* type = TYPE_CHAR or TYPE_WIDE_CHAR or TYPE_STRING
- TYPE_WIDE_STRING.
- The result string is not certainly ASCII. */
- const TCHAR_T *tmpsrc;
- DCHAR_T *tmpdst;
- size_t tmpdst_len;
- /* This code assumes that TCHAR_T is 'char'. */
- typedef int TCHAR_T_verify
- [2 * (sizeof (TCHAR_T) == 1) - 1];
+#if !DCHAR_IS_TCHAR
+ /* Convert from TCHAR_T[] to DCHAR_T[]. */
+ if (dp->conversion == 'c' || dp->conversion == 's')
+ {
+ /* type = TYPE_CHAR or TYPE_WIDE_CHAR or TYPE_STRING
+ TYPE_WIDE_STRING.
+ The result string is not certainly ASCII. */
+ const TCHAR_T *tmpsrc;
+ DCHAR_T *tmpdst;
+ size_t tmpdst_len;
+ /* This code assumes that TCHAR_T is 'char'. */
+ typedef int TCHAR_T_verify
+ [2 * (sizeof (TCHAR_T) == 1) - 1];
# if USE_SNPRINTF
- tmpsrc = (TCHAR_T *) (result + length);
+ tmpsrc = (TCHAR_T *) (result + length);
# else
- tmpsrc = tmp;
+ tmpsrc = tmp;
# endif
- tmpdst = NULL;
- tmpdst_len = 0;
- if (DCHAR_CONV_FROM_ENCODING (locale_charset (),
- iconveh_question_mark,
- tmpsrc, count,
- NULL,
- &tmpdst, &tmpdst_len)
- < 0)
- {
- int saved_errno = errno;
- if (!(result == resultbuf || result == NULL))
- free (result);
- if (buf_malloced != NULL)
- free (buf_malloced);
- CLEANUP ();
- errno = saved_errno;
- return NULL;
- }
- ENSURE_ALLOCATION (xsum (length, tmpdst_len));
- DCHAR_CPY (result + length, tmpdst, tmpdst_len);
- free (tmpdst);
- count = tmpdst_len;
- }
- else
- {
- /* The result string is ASCII.
- Simple 1:1 conversion. */
+ tmpdst =
+ DCHAR_CONV_FROM_ENCODING (locale_charset (),
+ iconveh_question_mark,
+ tmpsrc, count,
+ NULL,
+ NULL, &tmpdst_len);
+ if (tmpdst == NULL)
+ {
+ int saved_errno = errno;
+ if (!(result == resultbuf || result == NULL))
+ free (result);
+ if (buf_malloced != NULL)
+ free (buf_malloced);
+ CLEANUP ();
+ errno = saved_errno;
+ return NULL;
+ }
+ ENSURE_ALLOCATION (xsum (length, tmpdst_len));
+ DCHAR_CPY (result + length, tmpdst, tmpdst_len);
+ free (tmpdst);
+ count = tmpdst_len;
+ }
+ else
+ {
+ /* The result string is ASCII.
+ Simple 1:1 conversion. */
# if USE_SNPRINTF
- /* If sizeof (DCHAR_T) == sizeof (TCHAR_T), it's a
- no-op conversion, in-place on the array starting
- at (result + length). */
- if (sizeof (DCHAR_T) != sizeof (TCHAR_T))
+ /* If sizeof (DCHAR_T) == sizeof (TCHAR_T), it's a
+ no-op conversion, in-place on the array starting
+ at (result + length). */
+ if (sizeof (DCHAR_T) != sizeof (TCHAR_T))
# endif
- {
- const TCHAR_T *tmpsrc;
- DCHAR_T *tmpdst;
- size_t n;
+ {
+ const TCHAR_T *tmpsrc;
+ DCHAR_T *tmpdst;
+ size_t n;
# if USE_SNPRINTF
- if (result == resultbuf)
- {
- tmpsrc = (TCHAR_T *) (result + length);
- /* ENSURE_ALLOCATION will not move tmpsrc
- (because it's part of resultbuf). */
- ENSURE_ALLOCATION (xsum (length, count));
- }
- else
- {
- /* ENSURE_ALLOCATION will move the array
- (because it uses realloc(). */
- ENSURE_ALLOCATION (xsum (length, count));
- tmpsrc = (TCHAR_T *) (result + length);
- }
+ if (result == resultbuf)
+ {
+ tmpsrc = (TCHAR_T *) (result + length);
+ /* ENSURE_ALLOCATION will not move tmpsrc
+ (because it's part of resultbuf). */
+ ENSURE_ALLOCATION (xsum (length, count));
+ }
+ else
+ {
+ /* ENSURE_ALLOCATION will move the array
+ (because it uses realloc(). */
+ ENSURE_ALLOCATION (xsum (length, count));
+ tmpsrc = (TCHAR_T *) (result + length);
+ }
# else
- tmpsrc = tmp;
- ENSURE_ALLOCATION (xsum (length, count));
+ tmpsrc = tmp;
+ ENSURE_ALLOCATION (xsum (length, count));
# endif
- tmpdst = result + length;
- /* Copy backwards, because of overlapping. */
- tmpsrc += count;
- tmpdst += count;
- for (n = count; n > 0; n--)
- *--tmpdst = (unsigned char) *--tmpsrc;
- }
- }
+ tmpdst = result + length;
+ /* Copy backwards, because of overlapping. */
+ tmpsrc += count;
+ tmpdst += count;
+ for (n = count; n > 0; n--)
+ *--tmpdst = (unsigned char) *--tmpsrc;
+ }
+ }
#endif
#if DCHAR_IS_TCHAR && !USE_SNPRINTF
- /* Make room for the result. */
- if (count > allocated - length)
- {
- /* Need at least count elements. But allocate
- proportionally. */
- size_t n =
- xmax (xsum (length, count), xtimes (allocated, 2));
-
- ENSURE_ALLOCATION (n);
- }
+ /* Make room for the result. */
+ if (count > allocated - length)
+ {
+ /* Need at least count elements. But allocate
+ proportionally. */
+ size_t n =
+ xmax (xsum (length, count), xtimes (allocated, 2));
+
+ ENSURE_ALLOCATION (n);
+ }
#endif
- /* Here count <= allocated - length. */
+ /* Here count <= allocated - length. */
- /* Perform padding. */
-#if !DCHAR_IS_TCHAR || ENABLE_UNISTDIO || NEED_PRINTF_FLAG_ZERO || NEED_PRINTF_UNBOUNDED_PRECISION
- if (pad_ourselves && has_width)
- {
- size_t w;
+ /* Perform padding. */
+#if !DCHAR_IS_TCHAR || ENABLE_UNISTDIO || NEED_PRINTF_FLAG_LEFTADJUST || NEED_PRINTF_FLAG_ZERO || NEED_PRINTF_UNBOUNDED_PRECISION
+ if (pad_ourselves && has_width)
+ {
+ size_t w;
# if ENABLE_UNISTDIO
- /* Outside POSIX, it's preferrable to compare the width
- against the number of _characters_ of the converted
- value. */
- w = DCHAR_MBSNLEN (result + length, count);
+ /* Outside POSIX, it's preferrable to compare the width
+ against the number of _characters_ of the converted
+ value. */
+ w = DCHAR_MBSNLEN (result + length, count);
# else
- /* The width is compared against the number of _bytes_
- of the converted value, says POSIX. */
- w = count;
+ /* The width is compared against the number of _bytes_
+ of the converted value, says POSIX. */
+ w = count;
# endif
- if (w < width)
- {
- size_t pad = width - w;
+ if (w < width)
+ {
+ size_t pad = width - w;
+
+ /* Make room for the result. */
+ if (xsum (count, pad) > allocated - length)
+ {
+ /* Need at least count + pad elements. But
+ allocate proportionally. */
+ size_t n =
+ xmax (xsum3 (length, count, pad),
+ xtimes (allocated, 2));
+
# if USE_SNPRINTF
- /* Make room for the result. */
- if (xsum (count, pad) > allocated - length)
- {
- /* Need at least count + pad elements. But
- allocate proportionally. */
- size_t n =
- xmax (xsum3 (length, count, pad),
- xtimes (allocated, 2));
-
- length += count;
- ENSURE_ALLOCATION (n);
- length -= count;
- }
- /* Here count + pad <= allocated - length. */
+ length += count;
+ ENSURE_ALLOCATION (n);
+ length -= count;
+# else
+ ENSURE_ALLOCATION (n);
# endif
- {
+ }
+ /* Here count + pad <= allocated - length. */
+
+ {
# if !DCHAR_IS_TCHAR || USE_SNPRINTF
- DCHAR_T * const rp = result + length;
+ DCHAR_T * const rp = result + length;
# else
- DCHAR_T * const rp = tmp;
-# endif
- DCHAR_T *p = rp + count;
- DCHAR_T *end = p + pad;
-# if NEED_PRINTF_FLAG_ZERO
- DCHAR_T *pad_ptr;
-# if !DCHAR_IS_TCHAR
- if (dp->conversion == 'c'
- || dp->conversion == 's')
- /* No zero-padding for string directives. */
- pad_ptr = NULL;
- else
-# endif
- {
- pad_ptr = (*rp == '-' ? rp + 1 : rp);
- /* No zero-padding of "inf" and "nan". */
- if ((*pad_ptr >= 'A' && *pad_ptr <= 'Z')
- || (*pad_ptr >= 'a' && *pad_ptr <= 'z'))
- pad_ptr = NULL;
- }
+ DCHAR_T * const rp = tmp;
# endif
- /* The generated string now extends from rp to p,
- with the zero padding insertion point being at
- pad_ptr. */
-
- count = count + pad; /* = end - rp */
-
- if (flags & FLAG_LEFT)
- {
- /* Pad with spaces on the right. */
- for (; pad > 0; pad--)
- *p++ = ' ';
- }
-# if NEED_PRINTF_FLAG_ZERO
- else if ((flags & FLAG_ZERO) && pad_ptr != NULL)
- {
- /* Pad with zeroes. */
- DCHAR_T *q = end;
-
- while (p > pad_ptr)
- *--q = *--p;
- for (; pad > 0; pad--)
- *p++ = '0';
- }
+ DCHAR_T *p = rp + count;
+ DCHAR_T *end = p + pad;
+ DCHAR_T *pad_ptr;
+# if !DCHAR_IS_TCHAR || ENABLE_UNISTDIO
+ if (dp->conversion == 'c'
+ || dp->conversion == 's')
+ /* No zero-padding for string directives. */
+ pad_ptr = NULL;
+ else
# endif
- else
- {
- /* Pad with spaces on the left. */
- DCHAR_T *q = end;
-
- while (p > rp)
- *--q = *--p;
- for (; pad > 0; pad--)
- *p++ = ' ';
- }
- }
- }
- }
+ {
+ pad_ptr = (*rp == '-' ? rp + 1 : rp);
+ /* No zero-padding of "inf" and "nan". */
+ if ((*pad_ptr >= 'A' && *pad_ptr <= 'Z')
+ || (*pad_ptr >= 'a' && *pad_ptr <= 'z'))
+ pad_ptr = NULL;
+ }
+ /* The generated string now extends from rp to p,
+ with the zero padding insertion point being at
+ pad_ptr. */
+
+ count = count + pad; /* = end - rp */
+
+ if (flags & FLAG_LEFT)
+ {
+ /* Pad with spaces on the right. */
+ for (; pad > 0; pad--)
+ *p++ = ' ';
+ }
+ else if ((flags & FLAG_ZERO) && pad_ptr != NULL)
+ {
+ /* Pad with zeroes. */
+ DCHAR_T *q = end;
+
+ while (p > pad_ptr)
+ *--q = *--p;
+ for (; pad > 0; pad--)
+ *p++ = '0';
+ }
+ else
+ {
+ /* Pad with spaces on the left. */
+ DCHAR_T *q = end;
+
+ while (p > rp)
+ *--q = *--p;
+ for (; pad > 0; pad--)
+ *p++ = ' ';
+ }
+ }
+ }
+ }
#endif
-#if DCHAR_IS_TCHAR && !USE_SNPRINTF
- if (count >= tmp_length)
- /* tmp_length was incorrectly calculated - fix the
- code above! */
- abort ();
-#endif
-
- /* Here still count <= allocated - length. */
+ /* Here still count <= allocated - length. */
#if !DCHAR_IS_TCHAR || USE_SNPRINTF
- /* The snprintf() result did fit. */
+ /* The snprintf() result did fit. */
#else
- /* Append the sprintf() result. */
- memcpy (result + length, tmp, count * sizeof (DCHAR_T));
+ /* Append the sprintf() result. */
+ memcpy (result + length, tmp, count * sizeof (DCHAR_T));
#endif
#if !USE_SNPRINTF
- if (tmp != tmpbuf)
- free (tmp);
+ if (tmp != tmpbuf)
+ free (tmp);
#endif
#if NEED_PRINTF_DIRECTIVE_F
- if (dp->conversion == 'F')
- {
- /* Convert the %f result to upper case for %F. */
- DCHAR_T *rp = result + length;
- size_t rc;
- for (rc = count; rc > 0; rc--, rp++)
- if (*rp >= 'a' && *rp <= 'z')
- *rp = *rp - 'a' + 'A';
- }
+ if (dp->conversion == 'F')
+ {
+ /* Convert the %f result to upper case for %F. */
+ DCHAR_T *rp = result + length;
+ size_t rc;
+ for (rc = count; rc > 0; rc--, rp++)
+ if (*rp >= 'a' && *rp <= 'z')
+ *rp = *rp - 'a' + 'A';
+ }
#endif
- length += count;
- break;
- }
- }
- }
+ length += count;
+ break;
+ }
+#undef pad_ourselves
+#undef prec_ourselves
+ }
+ }
}
/* Add the final NUL. */
@@ -4624,12 +5511,12 @@ VASNPRINTF (DCHAR_T *resultbuf, size_t *lengthp,
if (result != resultbuf && length + 1 < allocated)
{
- /* Shrink the allocated memory if possible. */
- DCHAR_T *memory;
+ /* Shrink the allocated memory if possible. */
+ DCHAR_T *memory;
- memory = (DCHAR_T *) realloc (result, (length + 1) * sizeof (DCHAR_T));
- if (memory != NULL)
- result = memory;
+ memory = (DCHAR_T *) realloc (result, (length + 1) * sizeof (DCHAR_T));
+ if (memory != NULL)
+ result = memory;
}
if (buf_malloced != NULL)
@@ -4642,6 +5529,7 @@ VASNPRINTF (DCHAR_T *resultbuf, size_t *lengthp,
not have this limitation. */
return result;
+#if USE_SNPRINTF
overflow:
if (!(result == resultbuf || result == NULL))
free (result);
@@ -4650,6 +5538,7 @@ VASNPRINTF (DCHAR_T *resultbuf, size_t *lengthp,
CLEANUP ();
errno = EOVERFLOW;
return NULL;
+#endif
out_of_memory:
if (!(result == resultbuf || result == NULL))
@@ -4663,9 +5552,11 @@ VASNPRINTF (DCHAR_T *resultbuf, size_t *lengthp,
}
}
+#undef MAX_ROOM_NEEDED
#undef TCHARS_PER_DCHAR
#undef SNPRINTF
#undef USE_SNPRINTF
+#undef DCHAR_SET
#undef DCHAR_CPY
#undef PRINTF_PARSE
#undef DIRECTIVES
diff --git a/intl/vasnwprintf.h b/intl/vasnwprintf.h
index 6ff03ce1..a01745bd 100644
--- a/intl/vasnwprintf.h
+++ b/intl/vasnwprintf.h
@@ -25,7 +25,7 @@
/* Get wchar_t, size_t. */
#include <stddef.h>
-#ifdef __cplusplus
+#ifdef __cplusplus
extern "C" {
#endif
@@ -39,7 +39,7 @@ extern "C" {
extern wchar_t * asnwprintf (wchar_t *resultbuf, size_t *lengthp, const wchar_t *format, ...);
extern wchar_t * vasnwprintf (wchar_t *resultbuf, size_t *lengthp, const wchar_t *format, va_list args);
-#ifdef __cplusplus
+#ifdef __cplusplus
}
#endif
diff --git a/intl/wprintf-parse.h b/intl/wprintf-parse.h
index 600b89ad..a08356ed 100644
--- a/intl/wprintf-parse.h
+++ b/intl/wprintf-parse.h
@@ -23,15 +23,15 @@
/* Flags */
-#define FLAG_GROUP 1 /* ' flag */
-#define FLAG_LEFT 2 /* - flag */
-#define FLAG_SHOWSIGN 4 /* + flag */
-#define FLAG_SPACE 8 /* space flag */
-#define FLAG_ALT 16 /* # flag */
-#define FLAG_ZERO 32
+#define FLAG_GROUP 1 /* ' flag */
+#define FLAG_LEFT 2 /* - flag */
+#define FLAG_SHOWSIGN 4 /* + flag */
+#define FLAG_SPACE 8 /* space flag */
+#define FLAG_ALT 16 /* # flag */
+#define FLAG_ZERO 32
/* arg_index value indicating that no argument is consumed. */
-#define ARG_NONE (~(size_t)0)
+#define ARG_NONE (~(size_t)0)
/* A parsed directive. */
typedef struct
diff --git a/intl/xsize.h b/intl/xsize.h
index b3023a7d..0b0cef8e 100644
--- a/intl/xsize.h
+++ b/intl/xsize.h
@@ -1,6 +1,6 @@
/* xsize.h -- Checked size_t computations.
- Copyright (C) 2003 Free Software Foundation, Inc.
+ Copyright (C) 2003, 2008 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
@@ -95,7 +95,7 @@ xmax (size_t size1, size_t size2)
/* Multiplication of a count with an element size, with overflow check.
The count must be >= 0 and the element size must be > 0.
This is a macro, not an inline function, so that it works correctly even
- when N is of a wider tupe and N > SIZE_MAX. */
+ when N is of a wider type and N > SIZE_MAX. */
#define xtimes(N, ELSIZE) \
((N) <= SIZE_MAX / (ELSIZE) ? (size_t) (N) * (ELSIZE) : SIZE_MAX)
diff --git a/lib/Makefile.in b/lib/Makefile.in
index 22fdd894..acf45120 100644
--- a/lib/Makefile.in
+++ b/lib/Makefile.in
@@ -50,6 +50,7 @@ am__aclocal_m4_deps = $(top_srcdir)/m4/man-bdb.m4 \
$(top_srcdir)/gnulib/m4/00gnulib.m4 \
$(top_srcdir)/gnulib/m4/alloca.m4 \
$(top_srcdir)/gnulib/m4/argp.m4 \
+ $(top_srcdir)/gnulib/m4/asm-underscore.m4 \
$(top_srcdir)/gnulib/m4/atexit.m4 \
$(top_srcdir)/gnulib/m4/btowc.m4 \
$(top_srcdir)/gnulib/m4/canonicalize.m4 \
@@ -265,6 +266,7 @@ ALLOCA_H = @ALLOCA_H@
AMTAR = @AMTAR@
AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@
APPLE_UNIVERSAL_BUILD = @APPLE_UNIVERSAL_BUILD@
+ASM_SYMBOL_PREFIX = @ASM_SYMBOL_PREFIX@
AUTOCONF = @AUTOCONF@
AUTOHEADER = @AUTOHEADER@
AUTOMAKE = @AUTOMAKE@
@@ -428,6 +430,7 @@ GNULIB_PUTC = @GNULIB_PUTC@
GNULIB_PUTCHAR = @GNULIB_PUTCHAR@
GNULIB_PUTENV = @GNULIB_PUTENV@
GNULIB_PUTS = @GNULIB_PUTS@
+GNULIB_PWRITE = @GNULIB_PWRITE@
GNULIB_RANDOM_R = @GNULIB_RANDOM_R@
GNULIB_RAWMEMCHR = @GNULIB_RAWMEMCHR@
GNULIB_READLINK = @GNULIB_READLINK@
@@ -595,6 +598,7 @@ HAVE_MKOSTEMPS = @HAVE_MKOSTEMPS@
HAVE_MKSTEMP = @HAVE_MKSTEMP@
HAVE_MKSTEMPS = @HAVE_MKSTEMPS@
HAVE_NANOSLEEP = @HAVE_NANOSLEEP@
+HAVE_NEWLOCALE = @HAVE_NEWLOCALE@
HAVE_NL_LANGINFO = @HAVE_NL_LANGINFO@
HAVE_OPENAT = @HAVE_OPENAT@
HAVE_OS_H = @HAVE_OS_H@
@@ -603,6 +607,7 @@ HAVE_POSIX_PRINTF = @HAVE_POSIX_PRINTF@
HAVE_POSIX_SIGNALBLOCKING = @HAVE_POSIX_SIGNALBLOCKING@
HAVE_PREAD = @HAVE_PREAD@
HAVE_PTSNAME = @HAVE_PTSNAME@
+HAVE_PWRITE = @HAVE_PWRITE@
HAVE_RANDOM_H = @HAVE_RANDOM_H@
HAVE_RANDOM_R = @HAVE_RANDOM_R@
HAVE_RAWMEMCHR = @HAVE_RAWMEMCHR@
@@ -688,6 +693,7 @@ INSTOBJEXT = @INSTOBJEXT@
INTLBISON = @INTLBISON@
INTLLIBS = @INTLLIBS@
INTLOBJS = @INTLOBJS@
+INTL_DEFAULT_VERBOSITY = @INTL_DEFAULT_VERBOSITY@
INTL_LIBTOOL_SUFFIX_PREFIX = @INTL_LIBTOOL_SUFFIX_PREFIX@
INTL_MACOSX_LIBS = @INTL_MACOSX_LIBS@
LDFLAGS = @LDFLAGS@
@@ -785,6 +791,7 @@ PO4A = @PO4A@
POSUB = @POSUB@
PRAGMA_SYSTEM_HEADER = @PRAGMA_SYSTEM_HEADER@
PRI_MACROS_BROKEN = @PRI_MACROS_BROKEN@
+PTHREAD_H_DEFINES_STRUCT_TIMESPEC = @PTHREAD_H_DEFINES_STRUCT_TIMESPEC@
PTRDIFF_T_SUFFIX = @PTRDIFF_T_SUFFIX@
RANLIB = @RANLIB@
REPLACE_BTOWC = @REPLACE_BTOWC@
@@ -849,6 +856,7 @@ REPLACE_POPEN = @REPLACE_POPEN@
REPLACE_PREAD = @REPLACE_PREAD@
REPLACE_PRINTF = @REPLACE_PRINTF@
REPLACE_PUTENV = @REPLACE_PUTENV@
+REPLACE_PWRITE = @REPLACE_PWRITE@
REPLACE_READLINK = @REPLACE_READLINK@
REPLACE_REALPATH = @REPLACE_REALPATH@
REPLACE_REMOVE = @REPLACE_REMOVE@
@@ -868,6 +876,7 @@ REPLACE_STRDUP = @REPLACE_STRDUP@
REPLACE_STRERROR = @REPLACE_STRERROR@
REPLACE_STRNCAT = @REPLACE_STRNCAT@
REPLACE_STRNDUP = @REPLACE_STRNDUP@
+REPLACE_STRNLEN = @REPLACE_STRNLEN@
REPLACE_STRSIGNAL = @REPLACE_STRSIGNAL@
REPLACE_STRSTR = @REPLACE_STRSTR@
REPLACE_STRTOD = @REPLACE_STRTOD@
@@ -875,6 +884,7 @@ REPLACE_STRTOK_R = @REPLACE_STRTOK_R@
REPLACE_SYMLINK = @REPLACE_SYMLINK@
REPLACE_TIMEGM = @REPLACE_TIMEGM@
REPLACE_TMPFILE = @REPLACE_TMPFILE@
+REPLACE_TTYNAME_R = @REPLACE_TTYNAME_R@
REPLACE_UNLINK = @REPLACE_UNLINK@
REPLACE_UNLINKAT = @REPLACE_UNLINKAT@
REPLACE_UNSETENV = @REPLACE_UNSETENV@
diff --git a/libdb/Makefile.in b/libdb/Makefile.in
index 87f6316f..ff46e1b9 100644
--- a/libdb/Makefile.in
+++ b/libdb/Makefile.in
@@ -50,6 +50,7 @@ am__aclocal_m4_deps = $(top_srcdir)/m4/man-bdb.m4 \
$(top_srcdir)/gnulib/m4/00gnulib.m4 \
$(top_srcdir)/gnulib/m4/alloca.m4 \
$(top_srcdir)/gnulib/m4/argp.m4 \
+ $(top_srcdir)/gnulib/m4/asm-underscore.m4 \
$(top_srcdir)/gnulib/m4/atexit.m4 \
$(top_srcdir)/gnulib/m4/btowc.m4 \
$(top_srcdir)/gnulib/m4/canonicalize.m4 \
@@ -262,6 +263,7 @@ ALLOCA_H = @ALLOCA_H@
AMTAR = @AMTAR@
AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@
APPLE_UNIVERSAL_BUILD = @APPLE_UNIVERSAL_BUILD@
+ASM_SYMBOL_PREFIX = @ASM_SYMBOL_PREFIX@
AUTOCONF = @AUTOCONF@
AUTOHEADER = @AUTOHEADER@
AUTOMAKE = @AUTOMAKE@
@@ -425,6 +427,7 @@ GNULIB_PUTC = @GNULIB_PUTC@
GNULIB_PUTCHAR = @GNULIB_PUTCHAR@
GNULIB_PUTENV = @GNULIB_PUTENV@
GNULIB_PUTS = @GNULIB_PUTS@
+GNULIB_PWRITE = @GNULIB_PWRITE@
GNULIB_RANDOM_R = @GNULIB_RANDOM_R@
GNULIB_RAWMEMCHR = @GNULIB_RAWMEMCHR@
GNULIB_READLINK = @GNULIB_READLINK@
@@ -592,6 +595,7 @@ HAVE_MKOSTEMPS = @HAVE_MKOSTEMPS@
HAVE_MKSTEMP = @HAVE_MKSTEMP@
HAVE_MKSTEMPS = @HAVE_MKSTEMPS@
HAVE_NANOSLEEP = @HAVE_NANOSLEEP@
+HAVE_NEWLOCALE = @HAVE_NEWLOCALE@
HAVE_NL_LANGINFO = @HAVE_NL_LANGINFO@
HAVE_OPENAT = @HAVE_OPENAT@
HAVE_OS_H = @HAVE_OS_H@
@@ -600,6 +604,7 @@ HAVE_POSIX_PRINTF = @HAVE_POSIX_PRINTF@
HAVE_POSIX_SIGNALBLOCKING = @HAVE_POSIX_SIGNALBLOCKING@
HAVE_PREAD = @HAVE_PREAD@
HAVE_PTSNAME = @HAVE_PTSNAME@
+HAVE_PWRITE = @HAVE_PWRITE@
HAVE_RANDOM_H = @HAVE_RANDOM_H@
HAVE_RANDOM_R = @HAVE_RANDOM_R@
HAVE_RAWMEMCHR = @HAVE_RAWMEMCHR@
@@ -685,6 +690,7 @@ INSTOBJEXT = @INSTOBJEXT@
INTLBISON = @INTLBISON@
INTLLIBS = @INTLLIBS@
INTLOBJS = @INTLOBJS@
+INTL_DEFAULT_VERBOSITY = @INTL_DEFAULT_VERBOSITY@
INTL_LIBTOOL_SUFFIX_PREFIX = @INTL_LIBTOOL_SUFFIX_PREFIX@
INTL_MACOSX_LIBS = @INTL_MACOSX_LIBS@
LDFLAGS = @LDFLAGS@
@@ -782,6 +788,7 @@ PO4A = @PO4A@
POSUB = @POSUB@
PRAGMA_SYSTEM_HEADER = @PRAGMA_SYSTEM_HEADER@
PRI_MACROS_BROKEN = @PRI_MACROS_BROKEN@
+PTHREAD_H_DEFINES_STRUCT_TIMESPEC = @PTHREAD_H_DEFINES_STRUCT_TIMESPEC@
PTRDIFF_T_SUFFIX = @PTRDIFF_T_SUFFIX@
RANLIB = @RANLIB@
REPLACE_BTOWC = @REPLACE_BTOWC@
@@ -846,6 +853,7 @@ REPLACE_POPEN = @REPLACE_POPEN@
REPLACE_PREAD = @REPLACE_PREAD@
REPLACE_PRINTF = @REPLACE_PRINTF@
REPLACE_PUTENV = @REPLACE_PUTENV@
+REPLACE_PWRITE = @REPLACE_PWRITE@
REPLACE_READLINK = @REPLACE_READLINK@
REPLACE_REALPATH = @REPLACE_REALPATH@
REPLACE_REMOVE = @REPLACE_REMOVE@
@@ -865,6 +873,7 @@ REPLACE_STRDUP = @REPLACE_STRDUP@
REPLACE_STRERROR = @REPLACE_STRERROR@
REPLACE_STRNCAT = @REPLACE_STRNCAT@
REPLACE_STRNDUP = @REPLACE_STRNDUP@
+REPLACE_STRNLEN = @REPLACE_STRNLEN@
REPLACE_STRSIGNAL = @REPLACE_STRSIGNAL@
REPLACE_STRSTR = @REPLACE_STRSTR@
REPLACE_STRTOD = @REPLACE_STRTOD@
@@ -872,6 +881,7 @@ REPLACE_STRTOK_R = @REPLACE_STRTOK_R@
REPLACE_SYMLINK = @REPLACE_SYMLINK@
REPLACE_TIMEGM = @REPLACE_TIMEGM@
REPLACE_TMPFILE = @REPLACE_TMPFILE@
+REPLACE_TTYNAME_R = @REPLACE_TTYNAME_R@
REPLACE_UNLINK = @REPLACE_UNLINK@
REPLACE_UNLINKAT = @REPLACE_UNLINKAT@
REPLACE_UNSETENV = @REPLACE_UNSETENV@
diff --git a/man/Makefile.in b/man/Makefile.in
index 6e18b62e..deff2021 100644
--- a/man/Makefile.in
+++ b/man/Makefile.in
@@ -48,6 +48,7 @@ am__aclocal_m4_deps = $(top_srcdir)/m4/man-bdb.m4 \
$(top_srcdir)/gnulib/m4/00gnulib.m4 \
$(top_srcdir)/gnulib/m4/alloca.m4 \
$(top_srcdir)/gnulib/m4/argp.m4 \
+ $(top_srcdir)/gnulib/m4/asm-underscore.m4 \
$(top_srcdir)/gnulib/m4/atexit.m4 \
$(top_srcdir)/gnulib/m4/btowc.m4 \
$(top_srcdir)/gnulib/m4/canonicalize.m4 \
@@ -296,6 +297,7 @@ ALLOCA_H = @ALLOCA_H@
AMTAR = @AMTAR@
AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@
APPLE_UNIVERSAL_BUILD = @APPLE_UNIVERSAL_BUILD@
+ASM_SYMBOL_PREFIX = @ASM_SYMBOL_PREFIX@
AUTOCONF = @AUTOCONF@
AUTOHEADER = @AUTOHEADER@
AUTOMAKE = @AUTOMAKE@
@@ -459,6 +461,7 @@ GNULIB_PUTC = @GNULIB_PUTC@
GNULIB_PUTCHAR = @GNULIB_PUTCHAR@
GNULIB_PUTENV = @GNULIB_PUTENV@
GNULIB_PUTS = @GNULIB_PUTS@
+GNULIB_PWRITE = @GNULIB_PWRITE@
GNULIB_RANDOM_R = @GNULIB_RANDOM_R@
GNULIB_RAWMEMCHR = @GNULIB_RAWMEMCHR@
GNULIB_READLINK = @GNULIB_READLINK@
@@ -626,6 +629,7 @@ HAVE_MKOSTEMPS = @HAVE_MKOSTEMPS@
HAVE_MKSTEMP = @HAVE_MKSTEMP@
HAVE_MKSTEMPS = @HAVE_MKSTEMPS@
HAVE_NANOSLEEP = @HAVE_NANOSLEEP@
+HAVE_NEWLOCALE = @HAVE_NEWLOCALE@
HAVE_NL_LANGINFO = @HAVE_NL_LANGINFO@
HAVE_OPENAT = @HAVE_OPENAT@
HAVE_OS_H = @HAVE_OS_H@
@@ -634,6 +638,7 @@ HAVE_POSIX_PRINTF = @HAVE_POSIX_PRINTF@
HAVE_POSIX_SIGNALBLOCKING = @HAVE_POSIX_SIGNALBLOCKING@
HAVE_PREAD = @HAVE_PREAD@
HAVE_PTSNAME = @HAVE_PTSNAME@
+HAVE_PWRITE = @HAVE_PWRITE@
HAVE_RANDOM_H = @HAVE_RANDOM_H@
HAVE_RANDOM_R = @HAVE_RANDOM_R@
HAVE_RAWMEMCHR = @HAVE_RAWMEMCHR@
@@ -719,6 +724,7 @@ INSTOBJEXT = @INSTOBJEXT@
INTLBISON = @INTLBISON@
INTLLIBS = @INTLLIBS@
INTLOBJS = @INTLOBJS@
+INTL_DEFAULT_VERBOSITY = @INTL_DEFAULT_VERBOSITY@
INTL_LIBTOOL_SUFFIX_PREFIX = @INTL_LIBTOOL_SUFFIX_PREFIX@
INTL_MACOSX_LIBS = @INTL_MACOSX_LIBS@
LDFLAGS = @LDFLAGS@
@@ -816,6 +822,7 @@ PO4A = @PO4A@
POSUB = @POSUB@
PRAGMA_SYSTEM_HEADER = @PRAGMA_SYSTEM_HEADER@
PRI_MACROS_BROKEN = @PRI_MACROS_BROKEN@
+PTHREAD_H_DEFINES_STRUCT_TIMESPEC = @PTHREAD_H_DEFINES_STRUCT_TIMESPEC@
PTRDIFF_T_SUFFIX = @PTRDIFF_T_SUFFIX@
RANLIB = @RANLIB@
REPLACE_BTOWC = @REPLACE_BTOWC@
@@ -880,6 +887,7 @@ REPLACE_POPEN = @REPLACE_POPEN@
REPLACE_PREAD = @REPLACE_PREAD@
REPLACE_PRINTF = @REPLACE_PRINTF@
REPLACE_PUTENV = @REPLACE_PUTENV@
+REPLACE_PWRITE = @REPLACE_PWRITE@
REPLACE_READLINK = @REPLACE_READLINK@
REPLACE_REALPATH = @REPLACE_REALPATH@
REPLACE_REMOVE = @REPLACE_REMOVE@
@@ -899,6 +907,7 @@ REPLACE_STRDUP = @REPLACE_STRDUP@
REPLACE_STRERROR = @REPLACE_STRERROR@
REPLACE_STRNCAT = @REPLACE_STRNCAT@
REPLACE_STRNDUP = @REPLACE_STRNDUP@
+REPLACE_STRNLEN = @REPLACE_STRNLEN@
REPLACE_STRSIGNAL = @REPLACE_STRSIGNAL@
REPLACE_STRSTR = @REPLACE_STRSTR@
REPLACE_STRTOD = @REPLACE_STRTOD@
@@ -906,6 +915,7 @@ REPLACE_STRTOK_R = @REPLACE_STRTOK_R@
REPLACE_SYMLINK = @REPLACE_SYMLINK@
REPLACE_TIMEGM = @REPLACE_TIMEGM@
REPLACE_TMPFILE = @REPLACE_TMPFILE@
+REPLACE_TTYNAME_R = @REPLACE_TTYNAME_R@
REPLACE_UNLINK = @REPLACE_UNLINK@
REPLACE_UNLINKAT = @REPLACE_UNLINKAT@
REPLACE_UNSETENV = @REPLACE_UNSETENV@
diff --git a/man/de/Makefile.in b/man/de/Makefile.in
index f455d75b..00c0f413 100644
--- a/man/de/Makefile.in
+++ b/man/de/Makefile.in
@@ -48,6 +48,7 @@ am__aclocal_m4_deps = $(top_srcdir)/m4/man-bdb.m4 \
$(top_srcdir)/gnulib/m4/00gnulib.m4 \
$(top_srcdir)/gnulib/m4/alloca.m4 \
$(top_srcdir)/gnulib/m4/argp.m4 \
+ $(top_srcdir)/gnulib/m4/asm-underscore.m4 \
$(top_srcdir)/gnulib/m4/atexit.m4 \
$(top_srcdir)/gnulib/m4/btowc.m4 \
$(top_srcdir)/gnulib/m4/canonicalize.m4 \
@@ -257,6 +258,7 @@ ALLOCA_H = @ALLOCA_H@
AMTAR = @AMTAR@
AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@
APPLE_UNIVERSAL_BUILD = @APPLE_UNIVERSAL_BUILD@
+ASM_SYMBOL_PREFIX = @ASM_SYMBOL_PREFIX@
AUTOCONF = @AUTOCONF@
AUTOHEADER = @AUTOHEADER@
AUTOMAKE = @AUTOMAKE@
@@ -420,6 +422,7 @@ GNULIB_PUTC = @GNULIB_PUTC@
GNULIB_PUTCHAR = @GNULIB_PUTCHAR@
GNULIB_PUTENV = @GNULIB_PUTENV@
GNULIB_PUTS = @GNULIB_PUTS@
+GNULIB_PWRITE = @GNULIB_PWRITE@
GNULIB_RANDOM_R = @GNULIB_RANDOM_R@
GNULIB_RAWMEMCHR = @GNULIB_RAWMEMCHR@
GNULIB_READLINK = @GNULIB_READLINK@
@@ -587,6 +590,7 @@ HAVE_MKOSTEMPS = @HAVE_MKOSTEMPS@
HAVE_MKSTEMP = @HAVE_MKSTEMP@
HAVE_MKSTEMPS = @HAVE_MKSTEMPS@
HAVE_NANOSLEEP = @HAVE_NANOSLEEP@
+HAVE_NEWLOCALE = @HAVE_NEWLOCALE@
HAVE_NL_LANGINFO = @HAVE_NL_LANGINFO@
HAVE_OPENAT = @HAVE_OPENAT@
HAVE_OS_H = @HAVE_OS_H@
@@ -595,6 +599,7 @@ HAVE_POSIX_PRINTF = @HAVE_POSIX_PRINTF@
HAVE_POSIX_SIGNALBLOCKING = @HAVE_POSIX_SIGNALBLOCKING@
HAVE_PREAD = @HAVE_PREAD@
HAVE_PTSNAME = @HAVE_PTSNAME@
+HAVE_PWRITE = @HAVE_PWRITE@
HAVE_RANDOM_H = @HAVE_RANDOM_H@
HAVE_RANDOM_R = @HAVE_RANDOM_R@
HAVE_RAWMEMCHR = @HAVE_RAWMEMCHR@
@@ -680,6 +685,7 @@ INSTOBJEXT = @INSTOBJEXT@
INTLBISON = @INTLBISON@
INTLLIBS = @INTLLIBS@
INTLOBJS = @INTLOBJS@
+INTL_DEFAULT_VERBOSITY = @INTL_DEFAULT_VERBOSITY@
INTL_LIBTOOL_SUFFIX_PREFIX = @INTL_LIBTOOL_SUFFIX_PREFIX@
INTL_MACOSX_LIBS = @INTL_MACOSX_LIBS@
LDFLAGS = @LDFLAGS@
@@ -777,6 +783,7 @@ PO4A = @PO4A@
POSUB = @POSUB@
PRAGMA_SYSTEM_HEADER = @PRAGMA_SYSTEM_HEADER@
PRI_MACROS_BROKEN = @PRI_MACROS_BROKEN@
+PTHREAD_H_DEFINES_STRUCT_TIMESPEC = @PTHREAD_H_DEFINES_STRUCT_TIMESPEC@
PTRDIFF_T_SUFFIX = @PTRDIFF_T_SUFFIX@
RANLIB = @RANLIB@
REPLACE_BTOWC = @REPLACE_BTOWC@
@@ -841,6 +848,7 @@ REPLACE_POPEN = @REPLACE_POPEN@
REPLACE_PREAD = @REPLACE_PREAD@
REPLACE_PRINTF = @REPLACE_PRINTF@
REPLACE_PUTENV = @REPLACE_PUTENV@
+REPLACE_PWRITE = @REPLACE_PWRITE@
REPLACE_READLINK = @REPLACE_READLINK@
REPLACE_REALPATH = @REPLACE_REALPATH@
REPLACE_REMOVE = @REPLACE_REMOVE@
@@ -860,6 +868,7 @@ REPLACE_STRDUP = @REPLACE_STRDUP@
REPLACE_STRERROR = @REPLACE_STRERROR@
REPLACE_STRNCAT = @REPLACE_STRNCAT@
REPLACE_STRNDUP = @REPLACE_STRNDUP@
+REPLACE_STRNLEN = @REPLACE_STRNLEN@
REPLACE_STRSIGNAL = @REPLACE_STRSIGNAL@
REPLACE_STRSTR = @REPLACE_STRSTR@
REPLACE_STRTOD = @REPLACE_STRTOD@
@@ -867,6 +876,7 @@ REPLACE_STRTOK_R = @REPLACE_STRTOK_R@
REPLACE_SYMLINK = @REPLACE_SYMLINK@
REPLACE_TIMEGM = @REPLACE_TIMEGM@
REPLACE_TMPFILE = @REPLACE_TMPFILE@
+REPLACE_TTYNAME_R = @REPLACE_TTYNAME_R@
REPLACE_UNLINK = @REPLACE_UNLINK@
REPLACE_UNLINKAT = @REPLACE_UNLINKAT@
REPLACE_UNSETENV = @REPLACE_UNSETENV@
diff --git a/man/es/Makefile.in b/man/es/Makefile.in
index 37a052a3..0a5dee88 100644
--- a/man/es/Makefile.in
+++ b/man/es/Makefile.in
@@ -48,6 +48,7 @@ am__aclocal_m4_deps = $(top_srcdir)/m4/man-bdb.m4 \
$(top_srcdir)/gnulib/m4/00gnulib.m4 \
$(top_srcdir)/gnulib/m4/alloca.m4 \
$(top_srcdir)/gnulib/m4/argp.m4 \
+ $(top_srcdir)/gnulib/m4/asm-underscore.m4 \
$(top_srcdir)/gnulib/m4/atexit.m4 \
$(top_srcdir)/gnulib/m4/btowc.m4 \
$(top_srcdir)/gnulib/m4/canonicalize.m4 \
@@ -257,6 +258,7 @@ ALLOCA_H = @ALLOCA_H@
AMTAR = @AMTAR@
AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@
APPLE_UNIVERSAL_BUILD = @APPLE_UNIVERSAL_BUILD@
+ASM_SYMBOL_PREFIX = @ASM_SYMBOL_PREFIX@
AUTOCONF = @AUTOCONF@
AUTOHEADER = @AUTOHEADER@
AUTOMAKE = @AUTOMAKE@
@@ -420,6 +422,7 @@ GNULIB_PUTC = @GNULIB_PUTC@
GNULIB_PUTCHAR = @GNULIB_PUTCHAR@
GNULIB_PUTENV = @GNULIB_PUTENV@
GNULIB_PUTS = @GNULIB_PUTS@
+GNULIB_PWRITE = @GNULIB_PWRITE@
GNULIB_RANDOM_R = @GNULIB_RANDOM_R@
GNULIB_RAWMEMCHR = @GNULIB_RAWMEMCHR@
GNULIB_READLINK = @GNULIB_READLINK@
@@ -587,6 +590,7 @@ HAVE_MKOSTEMPS = @HAVE_MKOSTEMPS@
HAVE_MKSTEMP = @HAVE_MKSTEMP@
HAVE_MKSTEMPS = @HAVE_MKSTEMPS@
HAVE_NANOSLEEP = @HAVE_NANOSLEEP@
+HAVE_NEWLOCALE = @HAVE_NEWLOCALE@
HAVE_NL_LANGINFO = @HAVE_NL_LANGINFO@
HAVE_OPENAT = @HAVE_OPENAT@
HAVE_OS_H = @HAVE_OS_H@
@@ -595,6 +599,7 @@ HAVE_POSIX_PRINTF = @HAVE_POSIX_PRINTF@
HAVE_POSIX_SIGNALBLOCKING = @HAVE_POSIX_SIGNALBLOCKING@
HAVE_PREAD = @HAVE_PREAD@
HAVE_PTSNAME = @HAVE_PTSNAME@
+HAVE_PWRITE = @HAVE_PWRITE@
HAVE_RANDOM_H = @HAVE_RANDOM_H@
HAVE_RANDOM_R = @HAVE_RANDOM_R@
HAVE_RAWMEMCHR = @HAVE_RAWMEMCHR@
@@ -680,6 +685,7 @@ INSTOBJEXT = @INSTOBJEXT@
INTLBISON = @INTLBISON@
INTLLIBS = @INTLLIBS@
INTLOBJS = @INTLOBJS@
+INTL_DEFAULT_VERBOSITY = @INTL_DEFAULT_VERBOSITY@
INTL_LIBTOOL_SUFFIX_PREFIX = @INTL_LIBTOOL_SUFFIX_PREFIX@
INTL_MACOSX_LIBS = @INTL_MACOSX_LIBS@
LDFLAGS = @LDFLAGS@
@@ -777,6 +783,7 @@ PO4A = @PO4A@
POSUB = @POSUB@
PRAGMA_SYSTEM_HEADER = @PRAGMA_SYSTEM_HEADER@
PRI_MACROS_BROKEN = @PRI_MACROS_BROKEN@
+PTHREAD_H_DEFINES_STRUCT_TIMESPEC = @PTHREAD_H_DEFINES_STRUCT_TIMESPEC@
PTRDIFF_T_SUFFIX = @PTRDIFF_T_SUFFIX@
RANLIB = @RANLIB@
REPLACE_BTOWC = @REPLACE_BTOWC@
@@ -841,6 +848,7 @@ REPLACE_POPEN = @REPLACE_POPEN@
REPLACE_PREAD = @REPLACE_PREAD@
REPLACE_PRINTF = @REPLACE_PRINTF@
REPLACE_PUTENV = @REPLACE_PUTENV@
+REPLACE_PWRITE = @REPLACE_PWRITE@
REPLACE_READLINK = @REPLACE_READLINK@
REPLACE_REALPATH = @REPLACE_REALPATH@
REPLACE_REMOVE = @REPLACE_REMOVE@
@@ -860,6 +868,7 @@ REPLACE_STRDUP = @REPLACE_STRDUP@
REPLACE_STRERROR = @REPLACE_STRERROR@
REPLACE_STRNCAT = @REPLACE_STRNCAT@
REPLACE_STRNDUP = @REPLACE_STRNDUP@
+REPLACE_STRNLEN = @REPLACE_STRNLEN@
REPLACE_STRSIGNAL = @REPLACE_STRSIGNAL@
REPLACE_STRSTR = @REPLACE_STRSTR@
REPLACE_STRTOD = @REPLACE_STRTOD@
@@ -867,6 +876,7 @@ REPLACE_STRTOK_R = @REPLACE_STRTOK_R@
REPLACE_SYMLINK = @REPLACE_SYMLINK@
REPLACE_TIMEGM = @REPLACE_TIMEGM@
REPLACE_TMPFILE = @REPLACE_TMPFILE@
+REPLACE_TTYNAME_R = @REPLACE_TTYNAME_R@
REPLACE_UNLINK = @REPLACE_UNLINK@
REPLACE_UNLINKAT = @REPLACE_UNLINKAT@
REPLACE_UNSETENV = @REPLACE_UNSETENV@
diff --git a/man/fr/Makefile.in b/man/fr/Makefile.in
index 4cb54e79..d0833fe4 100644
--- a/man/fr/Makefile.in
+++ b/man/fr/Makefile.in
@@ -48,6 +48,7 @@ am__aclocal_m4_deps = $(top_srcdir)/m4/man-bdb.m4 \
$(top_srcdir)/gnulib/m4/00gnulib.m4 \
$(top_srcdir)/gnulib/m4/alloca.m4 \
$(top_srcdir)/gnulib/m4/argp.m4 \
+ $(top_srcdir)/gnulib/m4/asm-underscore.m4 \
$(top_srcdir)/gnulib/m4/atexit.m4 \
$(top_srcdir)/gnulib/m4/btowc.m4 \
$(top_srcdir)/gnulib/m4/canonicalize.m4 \
@@ -257,6 +258,7 @@ ALLOCA_H = @ALLOCA_H@
AMTAR = @AMTAR@
AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@
APPLE_UNIVERSAL_BUILD = @APPLE_UNIVERSAL_BUILD@
+ASM_SYMBOL_PREFIX = @ASM_SYMBOL_PREFIX@
AUTOCONF = @AUTOCONF@
AUTOHEADER = @AUTOHEADER@
AUTOMAKE = @AUTOMAKE@
@@ -420,6 +422,7 @@ GNULIB_PUTC = @GNULIB_PUTC@
GNULIB_PUTCHAR = @GNULIB_PUTCHAR@
GNULIB_PUTENV = @GNULIB_PUTENV@
GNULIB_PUTS = @GNULIB_PUTS@
+GNULIB_PWRITE = @GNULIB_PWRITE@
GNULIB_RANDOM_R = @GNULIB_RANDOM_R@
GNULIB_RAWMEMCHR = @GNULIB_RAWMEMCHR@
GNULIB_READLINK = @GNULIB_READLINK@
@@ -587,6 +590,7 @@ HAVE_MKOSTEMPS = @HAVE_MKOSTEMPS@
HAVE_MKSTEMP = @HAVE_MKSTEMP@
HAVE_MKSTEMPS = @HAVE_MKSTEMPS@
HAVE_NANOSLEEP = @HAVE_NANOSLEEP@
+HAVE_NEWLOCALE = @HAVE_NEWLOCALE@
HAVE_NL_LANGINFO = @HAVE_NL_LANGINFO@
HAVE_OPENAT = @HAVE_OPENAT@
HAVE_OS_H = @HAVE_OS_H@
@@ -595,6 +599,7 @@ HAVE_POSIX_PRINTF = @HAVE_POSIX_PRINTF@
HAVE_POSIX_SIGNALBLOCKING = @HAVE_POSIX_SIGNALBLOCKING@
HAVE_PREAD = @HAVE_PREAD@
HAVE_PTSNAME = @HAVE_PTSNAME@
+HAVE_PWRITE = @HAVE_PWRITE@
HAVE_RANDOM_H = @HAVE_RANDOM_H@
HAVE_RANDOM_R = @HAVE_RANDOM_R@
HAVE_RAWMEMCHR = @HAVE_RAWMEMCHR@
@@ -680,6 +685,7 @@ INSTOBJEXT = @INSTOBJEXT@
INTLBISON = @INTLBISON@
INTLLIBS = @INTLLIBS@
INTLOBJS = @INTLOBJS@
+INTL_DEFAULT_VERBOSITY = @INTL_DEFAULT_VERBOSITY@
INTL_LIBTOOL_SUFFIX_PREFIX = @INTL_LIBTOOL_SUFFIX_PREFIX@
INTL_MACOSX_LIBS = @INTL_MACOSX_LIBS@
LDFLAGS = @LDFLAGS@
@@ -777,6 +783,7 @@ PO4A = @PO4A@
POSUB = @POSUB@
PRAGMA_SYSTEM_HEADER = @PRAGMA_SYSTEM_HEADER@
PRI_MACROS_BROKEN = @PRI_MACROS_BROKEN@
+PTHREAD_H_DEFINES_STRUCT_TIMESPEC = @PTHREAD_H_DEFINES_STRUCT_TIMESPEC@
PTRDIFF_T_SUFFIX = @PTRDIFF_T_SUFFIX@
RANLIB = @RANLIB@
REPLACE_BTOWC = @REPLACE_BTOWC@
@@ -841,6 +848,7 @@ REPLACE_POPEN = @REPLACE_POPEN@
REPLACE_PREAD = @REPLACE_PREAD@
REPLACE_PRINTF = @REPLACE_PRINTF@
REPLACE_PUTENV = @REPLACE_PUTENV@
+REPLACE_PWRITE = @REPLACE_PWRITE@
REPLACE_READLINK = @REPLACE_READLINK@
REPLACE_REALPATH = @REPLACE_REALPATH@
REPLACE_REMOVE = @REPLACE_REMOVE@
@@ -860,6 +868,7 @@ REPLACE_STRDUP = @REPLACE_STRDUP@
REPLACE_STRERROR = @REPLACE_STRERROR@
REPLACE_STRNCAT = @REPLACE_STRNCAT@
REPLACE_STRNDUP = @REPLACE_STRNDUP@
+REPLACE_STRNLEN = @REPLACE_STRNLEN@
REPLACE_STRSIGNAL = @REPLACE_STRSIGNAL@
REPLACE_STRSTR = @REPLACE_STRSTR@
REPLACE_STRTOD = @REPLACE_STRTOD@
@@ -867,6 +876,7 @@ REPLACE_STRTOK_R = @REPLACE_STRTOK_R@
REPLACE_SYMLINK = @REPLACE_SYMLINK@
REPLACE_TIMEGM = @REPLACE_TIMEGM@
REPLACE_TMPFILE = @REPLACE_TMPFILE@
+REPLACE_TTYNAME_R = @REPLACE_TTYNAME_R@
REPLACE_UNLINK = @REPLACE_UNLINK@
REPLACE_UNLINKAT = @REPLACE_UNLINKAT@
REPLACE_UNSETENV = @REPLACE_UNSETENV@
diff --git a/man/id/Makefile.in b/man/id/Makefile.in
index dcdff9ad..7a6ea592 100644
--- a/man/id/Makefile.in
+++ b/man/id/Makefile.in
@@ -48,6 +48,7 @@ am__aclocal_m4_deps = $(top_srcdir)/m4/man-bdb.m4 \
$(top_srcdir)/gnulib/m4/00gnulib.m4 \
$(top_srcdir)/gnulib/m4/alloca.m4 \
$(top_srcdir)/gnulib/m4/argp.m4 \
+ $(top_srcdir)/gnulib/m4/asm-underscore.m4 \
$(top_srcdir)/gnulib/m4/atexit.m4 \
$(top_srcdir)/gnulib/m4/btowc.m4 \
$(top_srcdir)/gnulib/m4/canonicalize.m4 \
@@ -257,6 +258,7 @@ ALLOCA_H = @ALLOCA_H@
AMTAR = @AMTAR@
AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@
APPLE_UNIVERSAL_BUILD = @APPLE_UNIVERSAL_BUILD@
+ASM_SYMBOL_PREFIX = @ASM_SYMBOL_PREFIX@
AUTOCONF = @AUTOCONF@
AUTOHEADER = @AUTOHEADER@
AUTOMAKE = @AUTOMAKE@
@@ -420,6 +422,7 @@ GNULIB_PUTC = @GNULIB_PUTC@
GNULIB_PUTCHAR = @GNULIB_PUTCHAR@
GNULIB_PUTENV = @GNULIB_PUTENV@
GNULIB_PUTS = @GNULIB_PUTS@
+GNULIB_PWRITE = @GNULIB_PWRITE@
GNULIB_RANDOM_R = @GNULIB_RANDOM_R@
GNULIB_RAWMEMCHR = @GNULIB_RAWMEMCHR@
GNULIB_READLINK = @GNULIB_READLINK@
@@ -587,6 +590,7 @@ HAVE_MKOSTEMPS = @HAVE_MKOSTEMPS@
HAVE_MKSTEMP = @HAVE_MKSTEMP@
HAVE_MKSTEMPS = @HAVE_MKSTEMPS@
HAVE_NANOSLEEP = @HAVE_NANOSLEEP@
+HAVE_NEWLOCALE = @HAVE_NEWLOCALE@
HAVE_NL_LANGINFO = @HAVE_NL_LANGINFO@
HAVE_OPENAT = @HAVE_OPENAT@
HAVE_OS_H = @HAVE_OS_H@
@@ -595,6 +599,7 @@ HAVE_POSIX_PRINTF = @HAVE_POSIX_PRINTF@
HAVE_POSIX_SIGNALBLOCKING = @HAVE_POSIX_SIGNALBLOCKING@
HAVE_PREAD = @HAVE_PREAD@
HAVE_PTSNAME = @HAVE_PTSNAME@
+HAVE_PWRITE = @HAVE_PWRITE@
HAVE_RANDOM_H = @HAVE_RANDOM_H@
HAVE_RANDOM_R = @HAVE_RANDOM_R@
HAVE_RAWMEMCHR = @HAVE_RAWMEMCHR@
@@ -680,6 +685,7 @@ INSTOBJEXT = @INSTOBJEXT@
INTLBISON = @INTLBISON@
INTLLIBS = @INTLLIBS@
INTLOBJS = @INTLOBJS@
+INTL_DEFAULT_VERBOSITY = @INTL_DEFAULT_VERBOSITY@
INTL_LIBTOOL_SUFFIX_PREFIX = @INTL_LIBTOOL_SUFFIX_PREFIX@
INTL_MACOSX_LIBS = @INTL_MACOSX_LIBS@
LDFLAGS = @LDFLAGS@
@@ -777,6 +783,7 @@ PO4A = @PO4A@
POSUB = @POSUB@
PRAGMA_SYSTEM_HEADER = @PRAGMA_SYSTEM_HEADER@
PRI_MACROS_BROKEN = @PRI_MACROS_BROKEN@
+PTHREAD_H_DEFINES_STRUCT_TIMESPEC = @PTHREAD_H_DEFINES_STRUCT_TIMESPEC@
PTRDIFF_T_SUFFIX = @PTRDIFF_T_SUFFIX@
RANLIB = @RANLIB@
REPLACE_BTOWC = @REPLACE_BTOWC@
@@ -841,6 +848,7 @@ REPLACE_POPEN = @REPLACE_POPEN@
REPLACE_PREAD = @REPLACE_PREAD@
REPLACE_PRINTF = @REPLACE_PRINTF@
REPLACE_PUTENV = @REPLACE_PUTENV@
+REPLACE_PWRITE = @REPLACE_PWRITE@
REPLACE_READLINK = @REPLACE_READLINK@
REPLACE_REALPATH = @REPLACE_REALPATH@
REPLACE_REMOVE = @REPLACE_REMOVE@
@@ -860,6 +868,7 @@ REPLACE_STRDUP = @REPLACE_STRDUP@
REPLACE_STRERROR = @REPLACE_STRERROR@
REPLACE_STRNCAT = @REPLACE_STRNCAT@
REPLACE_STRNDUP = @REPLACE_STRNDUP@
+REPLACE_STRNLEN = @REPLACE_STRNLEN@
REPLACE_STRSIGNAL = @REPLACE_STRSIGNAL@
REPLACE_STRSTR = @REPLACE_STRSTR@
REPLACE_STRTOD = @REPLACE_STRTOD@
@@ -867,6 +876,7 @@ REPLACE_STRTOK_R = @REPLACE_STRTOK_R@
REPLACE_SYMLINK = @REPLACE_SYMLINK@
REPLACE_TIMEGM = @REPLACE_TIMEGM@
REPLACE_TMPFILE = @REPLACE_TMPFILE@
+REPLACE_TTYNAME_R = @REPLACE_TTYNAME_R@
REPLACE_UNLINK = @REPLACE_UNLINK@
REPLACE_UNLINKAT = @REPLACE_UNLINKAT@
REPLACE_UNSETENV = @REPLACE_UNSETENV@
diff --git a/man/it/Makefile.in b/man/it/Makefile.in
index 168bdbef..21c3b608 100644
--- a/man/it/Makefile.in
+++ b/man/it/Makefile.in
@@ -48,6 +48,7 @@ am__aclocal_m4_deps = $(top_srcdir)/m4/man-bdb.m4 \
$(top_srcdir)/gnulib/m4/00gnulib.m4 \
$(top_srcdir)/gnulib/m4/alloca.m4 \
$(top_srcdir)/gnulib/m4/argp.m4 \
+ $(top_srcdir)/gnulib/m4/asm-underscore.m4 \
$(top_srcdir)/gnulib/m4/atexit.m4 \
$(top_srcdir)/gnulib/m4/btowc.m4 \
$(top_srcdir)/gnulib/m4/canonicalize.m4 \
@@ -257,6 +258,7 @@ ALLOCA_H = @ALLOCA_H@
AMTAR = @AMTAR@
AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@
APPLE_UNIVERSAL_BUILD = @APPLE_UNIVERSAL_BUILD@
+ASM_SYMBOL_PREFIX = @ASM_SYMBOL_PREFIX@
AUTOCONF = @AUTOCONF@
AUTOHEADER = @AUTOHEADER@
AUTOMAKE = @AUTOMAKE@
@@ -420,6 +422,7 @@ GNULIB_PUTC = @GNULIB_PUTC@
GNULIB_PUTCHAR = @GNULIB_PUTCHAR@
GNULIB_PUTENV = @GNULIB_PUTENV@
GNULIB_PUTS = @GNULIB_PUTS@
+GNULIB_PWRITE = @GNULIB_PWRITE@
GNULIB_RANDOM_R = @GNULIB_RANDOM_R@
GNULIB_RAWMEMCHR = @GNULIB_RAWMEMCHR@
GNULIB_READLINK = @GNULIB_READLINK@
@@ -587,6 +590,7 @@ HAVE_MKOSTEMPS = @HAVE_MKOSTEMPS@
HAVE_MKSTEMP = @HAVE_MKSTEMP@
HAVE_MKSTEMPS = @HAVE_MKSTEMPS@
HAVE_NANOSLEEP = @HAVE_NANOSLEEP@
+HAVE_NEWLOCALE = @HAVE_NEWLOCALE@
HAVE_NL_LANGINFO = @HAVE_NL_LANGINFO@
HAVE_OPENAT = @HAVE_OPENAT@
HAVE_OS_H = @HAVE_OS_H@
@@ -595,6 +599,7 @@ HAVE_POSIX_PRINTF = @HAVE_POSIX_PRINTF@
HAVE_POSIX_SIGNALBLOCKING = @HAVE_POSIX_SIGNALBLOCKING@
HAVE_PREAD = @HAVE_PREAD@
HAVE_PTSNAME = @HAVE_PTSNAME@
+HAVE_PWRITE = @HAVE_PWRITE@
HAVE_RANDOM_H = @HAVE_RANDOM_H@
HAVE_RANDOM_R = @HAVE_RANDOM_R@
HAVE_RAWMEMCHR = @HAVE_RAWMEMCHR@
@@ -680,6 +685,7 @@ INSTOBJEXT = @INSTOBJEXT@
INTLBISON = @INTLBISON@
INTLLIBS = @INTLLIBS@
INTLOBJS = @INTLOBJS@
+INTL_DEFAULT_VERBOSITY = @INTL_DEFAULT_VERBOSITY@
INTL_LIBTOOL_SUFFIX_PREFIX = @INTL_LIBTOOL_SUFFIX_PREFIX@
INTL_MACOSX_LIBS = @INTL_MACOSX_LIBS@
LDFLAGS = @LDFLAGS@
@@ -777,6 +783,7 @@ PO4A = @PO4A@
POSUB = @POSUB@
PRAGMA_SYSTEM_HEADER = @PRAGMA_SYSTEM_HEADER@
PRI_MACROS_BROKEN = @PRI_MACROS_BROKEN@
+PTHREAD_H_DEFINES_STRUCT_TIMESPEC = @PTHREAD_H_DEFINES_STRUCT_TIMESPEC@
PTRDIFF_T_SUFFIX = @PTRDIFF_T_SUFFIX@
RANLIB = @RANLIB@
REPLACE_BTOWC = @REPLACE_BTOWC@
@@ -841,6 +848,7 @@ REPLACE_POPEN = @REPLACE_POPEN@
REPLACE_PREAD = @REPLACE_PREAD@
REPLACE_PRINTF = @REPLACE_PRINTF@
REPLACE_PUTENV = @REPLACE_PUTENV@
+REPLACE_PWRITE = @REPLACE_PWRITE@
REPLACE_READLINK = @REPLACE_READLINK@
REPLACE_REALPATH = @REPLACE_REALPATH@
REPLACE_REMOVE = @REPLACE_REMOVE@
@@ -860,6 +868,7 @@ REPLACE_STRDUP = @REPLACE_STRDUP@
REPLACE_STRERROR = @REPLACE_STRERROR@
REPLACE_STRNCAT = @REPLACE_STRNCAT@
REPLACE_STRNDUP = @REPLACE_STRNDUP@
+REPLACE_STRNLEN = @REPLACE_STRNLEN@
REPLACE_STRSIGNAL = @REPLACE_STRSIGNAL@
REPLACE_STRSTR = @REPLACE_STRSTR@
REPLACE_STRTOD = @REPLACE_STRTOD@
@@ -867,6 +876,7 @@ REPLACE_STRTOK_R = @REPLACE_STRTOK_R@
REPLACE_SYMLINK = @REPLACE_SYMLINK@
REPLACE_TIMEGM = @REPLACE_TIMEGM@
REPLACE_TMPFILE = @REPLACE_TMPFILE@
+REPLACE_TTYNAME_R = @REPLACE_TTYNAME_R@
REPLACE_UNLINK = @REPLACE_UNLINK@
REPLACE_UNLINKAT = @REPLACE_UNLINKAT@
REPLACE_UNSETENV = @REPLACE_UNSETENV@
diff --git a/man/ja/Makefile.in b/man/ja/Makefile.in
index b0ae0fb7..69b74ce9 100644
--- a/man/ja/Makefile.in
+++ b/man/ja/Makefile.in
@@ -48,6 +48,7 @@ am__aclocal_m4_deps = $(top_srcdir)/m4/man-bdb.m4 \
$(top_srcdir)/gnulib/m4/00gnulib.m4 \
$(top_srcdir)/gnulib/m4/alloca.m4 \
$(top_srcdir)/gnulib/m4/argp.m4 \
+ $(top_srcdir)/gnulib/m4/asm-underscore.m4 \
$(top_srcdir)/gnulib/m4/atexit.m4 \
$(top_srcdir)/gnulib/m4/btowc.m4 \
$(top_srcdir)/gnulib/m4/canonicalize.m4 \
@@ -257,6 +258,7 @@ ALLOCA_H = @ALLOCA_H@
AMTAR = @AMTAR@
AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@
APPLE_UNIVERSAL_BUILD = @APPLE_UNIVERSAL_BUILD@
+ASM_SYMBOL_PREFIX = @ASM_SYMBOL_PREFIX@
AUTOCONF = @AUTOCONF@
AUTOHEADER = @AUTOHEADER@
AUTOMAKE = @AUTOMAKE@
@@ -420,6 +422,7 @@ GNULIB_PUTC = @GNULIB_PUTC@
GNULIB_PUTCHAR = @GNULIB_PUTCHAR@
GNULIB_PUTENV = @GNULIB_PUTENV@
GNULIB_PUTS = @GNULIB_PUTS@
+GNULIB_PWRITE = @GNULIB_PWRITE@
GNULIB_RANDOM_R = @GNULIB_RANDOM_R@
GNULIB_RAWMEMCHR = @GNULIB_RAWMEMCHR@
GNULIB_READLINK = @GNULIB_READLINK@
@@ -587,6 +590,7 @@ HAVE_MKOSTEMPS = @HAVE_MKOSTEMPS@
HAVE_MKSTEMP = @HAVE_MKSTEMP@
HAVE_MKSTEMPS = @HAVE_MKSTEMPS@
HAVE_NANOSLEEP = @HAVE_NANOSLEEP@
+HAVE_NEWLOCALE = @HAVE_NEWLOCALE@
HAVE_NL_LANGINFO = @HAVE_NL_LANGINFO@
HAVE_OPENAT = @HAVE_OPENAT@
HAVE_OS_H = @HAVE_OS_H@
@@ -595,6 +599,7 @@ HAVE_POSIX_PRINTF = @HAVE_POSIX_PRINTF@
HAVE_POSIX_SIGNALBLOCKING = @HAVE_POSIX_SIGNALBLOCKING@
HAVE_PREAD = @HAVE_PREAD@
HAVE_PTSNAME = @HAVE_PTSNAME@
+HAVE_PWRITE = @HAVE_PWRITE@
HAVE_RANDOM_H = @HAVE_RANDOM_H@
HAVE_RANDOM_R = @HAVE_RANDOM_R@
HAVE_RAWMEMCHR = @HAVE_RAWMEMCHR@
@@ -680,6 +685,7 @@ INSTOBJEXT = @INSTOBJEXT@
INTLBISON = @INTLBISON@
INTLLIBS = @INTLLIBS@
INTLOBJS = @INTLOBJS@
+INTL_DEFAULT_VERBOSITY = @INTL_DEFAULT_VERBOSITY@
INTL_LIBTOOL_SUFFIX_PREFIX = @INTL_LIBTOOL_SUFFIX_PREFIX@
INTL_MACOSX_LIBS = @INTL_MACOSX_LIBS@
LDFLAGS = @LDFLAGS@
@@ -777,6 +783,7 @@ PO4A = @PO4A@
POSUB = @POSUB@
PRAGMA_SYSTEM_HEADER = @PRAGMA_SYSTEM_HEADER@
PRI_MACROS_BROKEN = @PRI_MACROS_BROKEN@
+PTHREAD_H_DEFINES_STRUCT_TIMESPEC = @PTHREAD_H_DEFINES_STRUCT_TIMESPEC@
PTRDIFF_T_SUFFIX = @PTRDIFF_T_SUFFIX@
RANLIB = @RANLIB@
REPLACE_BTOWC = @REPLACE_BTOWC@
@@ -841,6 +848,7 @@ REPLACE_POPEN = @REPLACE_POPEN@
REPLACE_PREAD = @REPLACE_PREAD@
REPLACE_PRINTF = @REPLACE_PRINTF@
REPLACE_PUTENV = @REPLACE_PUTENV@
+REPLACE_PWRITE = @REPLACE_PWRITE@
REPLACE_READLINK = @REPLACE_READLINK@
REPLACE_REALPATH = @REPLACE_REALPATH@
REPLACE_REMOVE = @REPLACE_REMOVE@
@@ -860,6 +868,7 @@ REPLACE_STRDUP = @REPLACE_STRDUP@
REPLACE_STRERROR = @REPLACE_STRERROR@
REPLACE_STRNCAT = @REPLACE_STRNCAT@
REPLACE_STRNDUP = @REPLACE_STRNDUP@
+REPLACE_STRNLEN = @REPLACE_STRNLEN@
REPLACE_STRSIGNAL = @REPLACE_STRSIGNAL@
REPLACE_STRSTR = @REPLACE_STRSTR@
REPLACE_STRTOD = @REPLACE_STRTOD@
@@ -867,6 +876,7 @@ REPLACE_STRTOK_R = @REPLACE_STRTOK_R@
REPLACE_SYMLINK = @REPLACE_SYMLINK@
REPLACE_TIMEGM = @REPLACE_TIMEGM@
REPLACE_TMPFILE = @REPLACE_TMPFILE@
+REPLACE_TTYNAME_R = @REPLACE_TTYNAME_R@
REPLACE_UNLINK = @REPLACE_UNLINK@
REPLACE_UNLINKAT = @REPLACE_UNLINKAT@
REPLACE_UNSETENV = @REPLACE_UNSETENV@
diff --git a/man/nl/Makefile.in b/man/nl/Makefile.in
index bca8b5fb..16b6a807 100644
--- a/man/nl/Makefile.in
+++ b/man/nl/Makefile.in
@@ -48,6 +48,7 @@ am__aclocal_m4_deps = $(top_srcdir)/m4/man-bdb.m4 \
$(top_srcdir)/gnulib/m4/00gnulib.m4 \
$(top_srcdir)/gnulib/m4/alloca.m4 \
$(top_srcdir)/gnulib/m4/argp.m4 \
+ $(top_srcdir)/gnulib/m4/asm-underscore.m4 \
$(top_srcdir)/gnulib/m4/atexit.m4 \
$(top_srcdir)/gnulib/m4/btowc.m4 \
$(top_srcdir)/gnulib/m4/canonicalize.m4 \
@@ -257,6 +258,7 @@ ALLOCA_H = @ALLOCA_H@
AMTAR = @AMTAR@
AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@
APPLE_UNIVERSAL_BUILD = @APPLE_UNIVERSAL_BUILD@
+ASM_SYMBOL_PREFIX = @ASM_SYMBOL_PREFIX@
AUTOCONF = @AUTOCONF@
AUTOHEADER = @AUTOHEADER@
AUTOMAKE = @AUTOMAKE@
@@ -420,6 +422,7 @@ GNULIB_PUTC = @GNULIB_PUTC@
GNULIB_PUTCHAR = @GNULIB_PUTCHAR@
GNULIB_PUTENV = @GNULIB_PUTENV@
GNULIB_PUTS = @GNULIB_PUTS@
+GNULIB_PWRITE = @GNULIB_PWRITE@
GNULIB_RANDOM_R = @GNULIB_RANDOM_R@
GNULIB_RAWMEMCHR = @GNULIB_RAWMEMCHR@
GNULIB_READLINK = @GNULIB_READLINK@
@@ -587,6 +590,7 @@ HAVE_MKOSTEMPS = @HAVE_MKOSTEMPS@
HAVE_MKSTEMP = @HAVE_MKSTEMP@
HAVE_MKSTEMPS = @HAVE_MKSTEMPS@
HAVE_NANOSLEEP = @HAVE_NANOSLEEP@
+HAVE_NEWLOCALE = @HAVE_NEWLOCALE@
HAVE_NL_LANGINFO = @HAVE_NL_LANGINFO@
HAVE_OPENAT = @HAVE_OPENAT@
HAVE_OS_H = @HAVE_OS_H@
@@ -595,6 +599,7 @@ HAVE_POSIX_PRINTF = @HAVE_POSIX_PRINTF@
HAVE_POSIX_SIGNALBLOCKING = @HAVE_POSIX_SIGNALBLOCKING@
HAVE_PREAD = @HAVE_PREAD@
HAVE_PTSNAME = @HAVE_PTSNAME@
+HAVE_PWRITE = @HAVE_PWRITE@
HAVE_RANDOM_H = @HAVE_RANDOM_H@
HAVE_RANDOM_R = @HAVE_RANDOM_R@
HAVE_RAWMEMCHR = @HAVE_RAWMEMCHR@
@@ -680,6 +685,7 @@ INSTOBJEXT = @INSTOBJEXT@
INTLBISON = @INTLBISON@
INTLLIBS = @INTLLIBS@
INTLOBJS = @INTLOBJS@
+INTL_DEFAULT_VERBOSITY = @INTL_DEFAULT_VERBOSITY@
INTL_LIBTOOL_SUFFIX_PREFIX = @INTL_LIBTOOL_SUFFIX_PREFIX@
INTL_MACOSX_LIBS = @INTL_MACOSX_LIBS@
LDFLAGS = @LDFLAGS@
@@ -777,6 +783,7 @@ PO4A = @PO4A@
POSUB = @POSUB@
PRAGMA_SYSTEM_HEADER = @PRAGMA_SYSTEM_HEADER@
PRI_MACROS_BROKEN = @PRI_MACROS_BROKEN@
+PTHREAD_H_DEFINES_STRUCT_TIMESPEC = @PTHREAD_H_DEFINES_STRUCT_TIMESPEC@
PTRDIFF_T_SUFFIX = @PTRDIFF_T_SUFFIX@
RANLIB = @RANLIB@
REPLACE_BTOWC = @REPLACE_BTOWC@
@@ -841,6 +848,7 @@ REPLACE_POPEN = @REPLACE_POPEN@
REPLACE_PREAD = @REPLACE_PREAD@
REPLACE_PRINTF = @REPLACE_PRINTF@
REPLACE_PUTENV = @REPLACE_PUTENV@
+REPLACE_PWRITE = @REPLACE_PWRITE@
REPLACE_READLINK = @REPLACE_READLINK@
REPLACE_REALPATH = @REPLACE_REALPATH@
REPLACE_REMOVE = @REPLACE_REMOVE@
@@ -860,6 +868,7 @@ REPLACE_STRDUP = @REPLACE_STRDUP@
REPLACE_STRERROR = @REPLACE_STRERROR@
REPLACE_STRNCAT = @REPLACE_STRNCAT@
REPLACE_STRNDUP = @REPLACE_STRNDUP@
+REPLACE_STRNLEN = @REPLACE_STRNLEN@
REPLACE_STRSIGNAL = @REPLACE_STRSIGNAL@
REPLACE_STRSTR = @REPLACE_STRSTR@
REPLACE_STRTOD = @REPLACE_STRTOD@
@@ -867,6 +876,7 @@ REPLACE_STRTOK_R = @REPLACE_STRTOK_R@
REPLACE_SYMLINK = @REPLACE_SYMLINK@
REPLACE_TIMEGM = @REPLACE_TIMEGM@
REPLACE_TMPFILE = @REPLACE_TMPFILE@
+REPLACE_TTYNAME_R = @REPLACE_TTYNAME_R@
REPLACE_UNLINK = @REPLACE_UNLINK@
REPLACE_UNLINKAT = @REPLACE_UNLINKAT@
REPLACE_UNSETENV = @REPLACE_UNSETENV@
diff --git a/man/pl/Makefile.in b/man/pl/Makefile.in
index 7a60a3fb..1daf1a92 100644
--- a/man/pl/Makefile.in
+++ b/man/pl/Makefile.in
@@ -48,6 +48,7 @@ am__aclocal_m4_deps = $(top_srcdir)/m4/man-bdb.m4 \
$(top_srcdir)/gnulib/m4/00gnulib.m4 \
$(top_srcdir)/gnulib/m4/alloca.m4 \
$(top_srcdir)/gnulib/m4/argp.m4 \
+ $(top_srcdir)/gnulib/m4/asm-underscore.m4 \
$(top_srcdir)/gnulib/m4/atexit.m4 \
$(top_srcdir)/gnulib/m4/btowc.m4 \
$(top_srcdir)/gnulib/m4/canonicalize.m4 \
@@ -257,6 +258,7 @@ ALLOCA_H = @ALLOCA_H@
AMTAR = @AMTAR@
AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@
APPLE_UNIVERSAL_BUILD = @APPLE_UNIVERSAL_BUILD@
+ASM_SYMBOL_PREFIX = @ASM_SYMBOL_PREFIX@
AUTOCONF = @AUTOCONF@
AUTOHEADER = @AUTOHEADER@
AUTOMAKE = @AUTOMAKE@
@@ -420,6 +422,7 @@ GNULIB_PUTC = @GNULIB_PUTC@
GNULIB_PUTCHAR = @GNULIB_PUTCHAR@
GNULIB_PUTENV = @GNULIB_PUTENV@
GNULIB_PUTS = @GNULIB_PUTS@
+GNULIB_PWRITE = @GNULIB_PWRITE@
GNULIB_RANDOM_R = @GNULIB_RANDOM_R@
GNULIB_RAWMEMCHR = @GNULIB_RAWMEMCHR@
GNULIB_READLINK = @GNULIB_READLINK@
@@ -587,6 +590,7 @@ HAVE_MKOSTEMPS = @HAVE_MKOSTEMPS@
HAVE_MKSTEMP = @HAVE_MKSTEMP@
HAVE_MKSTEMPS = @HAVE_MKSTEMPS@
HAVE_NANOSLEEP = @HAVE_NANOSLEEP@
+HAVE_NEWLOCALE = @HAVE_NEWLOCALE@
HAVE_NL_LANGINFO = @HAVE_NL_LANGINFO@
HAVE_OPENAT = @HAVE_OPENAT@
HAVE_OS_H = @HAVE_OS_H@
@@ -595,6 +599,7 @@ HAVE_POSIX_PRINTF = @HAVE_POSIX_PRINTF@
HAVE_POSIX_SIGNALBLOCKING = @HAVE_POSIX_SIGNALBLOCKING@
HAVE_PREAD = @HAVE_PREAD@
HAVE_PTSNAME = @HAVE_PTSNAME@
+HAVE_PWRITE = @HAVE_PWRITE@
HAVE_RANDOM_H = @HAVE_RANDOM_H@
HAVE_RANDOM_R = @HAVE_RANDOM_R@
HAVE_RAWMEMCHR = @HAVE_RAWMEMCHR@
@@ -680,6 +685,7 @@ INSTOBJEXT = @INSTOBJEXT@
INTLBISON = @INTLBISON@
INTLLIBS = @INTLLIBS@
INTLOBJS = @INTLOBJS@
+INTL_DEFAULT_VERBOSITY = @INTL_DEFAULT_VERBOSITY@
INTL_LIBTOOL_SUFFIX_PREFIX = @INTL_LIBTOOL_SUFFIX_PREFIX@
INTL_MACOSX_LIBS = @INTL_MACOSX_LIBS@
LDFLAGS = @LDFLAGS@
@@ -777,6 +783,7 @@ PO4A = @PO4A@
POSUB = @POSUB@
PRAGMA_SYSTEM_HEADER = @PRAGMA_SYSTEM_HEADER@
PRI_MACROS_BROKEN = @PRI_MACROS_BROKEN@
+PTHREAD_H_DEFINES_STRUCT_TIMESPEC = @PTHREAD_H_DEFINES_STRUCT_TIMESPEC@
PTRDIFF_T_SUFFIX = @PTRDIFF_T_SUFFIX@
RANLIB = @RANLIB@
REPLACE_BTOWC = @REPLACE_BTOWC@
@@ -841,6 +848,7 @@ REPLACE_POPEN = @REPLACE_POPEN@
REPLACE_PREAD = @REPLACE_PREAD@
REPLACE_PRINTF = @REPLACE_PRINTF@
REPLACE_PUTENV = @REPLACE_PUTENV@
+REPLACE_PWRITE = @REPLACE_PWRITE@
REPLACE_READLINK = @REPLACE_READLINK@
REPLACE_REALPATH = @REPLACE_REALPATH@
REPLACE_REMOVE = @REPLACE_REMOVE@
@@ -860,6 +868,7 @@ REPLACE_STRDUP = @REPLACE_STRDUP@
REPLACE_STRERROR = @REPLACE_STRERROR@
REPLACE_STRNCAT = @REPLACE_STRNCAT@
REPLACE_STRNDUP = @REPLACE_STRNDUP@
+REPLACE_STRNLEN = @REPLACE_STRNLEN@
REPLACE_STRSIGNAL = @REPLACE_STRSIGNAL@
REPLACE_STRSTR = @REPLACE_STRSTR@
REPLACE_STRTOD = @REPLACE_STRTOD@
@@ -867,6 +876,7 @@ REPLACE_STRTOK_R = @REPLACE_STRTOK_R@
REPLACE_SYMLINK = @REPLACE_SYMLINK@
REPLACE_TIMEGM = @REPLACE_TIMEGM@
REPLACE_TMPFILE = @REPLACE_TMPFILE@
+REPLACE_TTYNAME_R = @REPLACE_TTYNAME_R@
REPLACE_UNLINK = @REPLACE_UNLINK@
REPLACE_UNLINKAT = @REPLACE_UNLINKAT@
REPLACE_UNSETENV = @REPLACE_UNSETENV@
diff --git a/man/po4a/Makefile.in b/man/po4a/Makefile.in
index d595eba5..886bd6c3 100644
--- a/man/po4a/Makefile.in
+++ b/man/po4a/Makefile.in
@@ -47,6 +47,7 @@ am__aclocal_m4_deps = $(top_srcdir)/m4/man-bdb.m4 \
$(top_srcdir)/gnulib/m4/00gnulib.m4 \
$(top_srcdir)/gnulib/m4/alloca.m4 \
$(top_srcdir)/gnulib/m4/argp.m4 \
+ $(top_srcdir)/gnulib/m4/asm-underscore.m4 \
$(top_srcdir)/gnulib/m4/atexit.m4 \
$(top_srcdir)/gnulib/m4/btowc.m4 \
$(top_srcdir)/gnulib/m4/canonicalize.m4 \
@@ -226,6 +227,7 @@ ALLOCA_H = @ALLOCA_H@
AMTAR = @AMTAR@
AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@
APPLE_UNIVERSAL_BUILD = @APPLE_UNIVERSAL_BUILD@
+ASM_SYMBOL_PREFIX = @ASM_SYMBOL_PREFIX@
AUTOCONF = @AUTOCONF@
AUTOHEADER = @AUTOHEADER@
AUTOMAKE = @AUTOMAKE@
@@ -389,6 +391,7 @@ GNULIB_PUTC = @GNULIB_PUTC@
GNULIB_PUTCHAR = @GNULIB_PUTCHAR@
GNULIB_PUTENV = @GNULIB_PUTENV@
GNULIB_PUTS = @GNULIB_PUTS@
+GNULIB_PWRITE = @GNULIB_PWRITE@
GNULIB_RANDOM_R = @GNULIB_RANDOM_R@
GNULIB_RAWMEMCHR = @GNULIB_RAWMEMCHR@
GNULIB_READLINK = @GNULIB_READLINK@
@@ -556,6 +559,7 @@ HAVE_MKOSTEMPS = @HAVE_MKOSTEMPS@
HAVE_MKSTEMP = @HAVE_MKSTEMP@
HAVE_MKSTEMPS = @HAVE_MKSTEMPS@
HAVE_NANOSLEEP = @HAVE_NANOSLEEP@
+HAVE_NEWLOCALE = @HAVE_NEWLOCALE@
HAVE_NL_LANGINFO = @HAVE_NL_LANGINFO@
HAVE_OPENAT = @HAVE_OPENAT@
HAVE_OS_H = @HAVE_OS_H@
@@ -564,6 +568,7 @@ HAVE_POSIX_PRINTF = @HAVE_POSIX_PRINTF@
HAVE_POSIX_SIGNALBLOCKING = @HAVE_POSIX_SIGNALBLOCKING@
HAVE_PREAD = @HAVE_PREAD@
HAVE_PTSNAME = @HAVE_PTSNAME@
+HAVE_PWRITE = @HAVE_PWRITE@
HAVE_RANDOM_H = @HAVE_RANDOM_H@
HAVE_RANDOM_R = @HAVE_RANDOM_R@
HAVE_RAWMEMCHR = @HAVE_RAWMEMCHR@
@@ -649,6 +654,7 @@ INSTOBJEXT = @INSTOBJEXT@
INTLBISON = @INTLBISON@
INTLLIBS = @INTLLIBS@
INTLOBJS = @INTLOBJS@
+INTL_DEFAULT_VERBOSITY = @INTL_DEFAULT_VERBOSITY@
INTL_LIBTOOL_SUFFIX_PREFIX = @INTL_LIBTOOL_SUFFIX_PREFIX@
INTL_MACOSX_LIBS = @INTL_MACOSX_LIBS@
LDFLAGS = @LDFLAGS@
@@ -746,6 +752,7 @@ PO4A = @PO4A@
POSUB = @POSUB@
PRAGMA_SYSTEM_HEADER = @PRAGMA_SYSTEM_HEADER@
PRI_MACROS_BROKEN = @PRI_MACROS_BROKEN@
+PTHREAD_H_DEFINES_STRUCT_TIMESPEC = @PTHREAD_H_DEFINES_STRUCT_TIMESPEC@
PTRDIFF_T_SUFFIX = @PTRDIFF_T_SUFFIX@
RANLIB = @RANLIB@
REPLACE_BTOWC = @REPLACE_BTOWC@
@@ -810,6 +817,7 @@ REPLACE_POPEN = @REPLACE_POPEN@
REPLACE_PREAD = @REPLACE_PREAD@
REPLACE_PRINTF = @REPLACE_PRINTF@
REPLACE_PUTENV = @REPLACE_PUTENV@
+REPLACE_PWRITE = @REPLACE_PWRITE@
REPLACE_READLINK = @REPLACE_READLINK@
REPLACE_REALPATH = @REPLACE_REALPATH@
REPLACE_REMOVE = @REPLACE_REMOVE@
@@ -829,6 +837,7 @@ REPLACE_STRDUP = @REPLACE_STRDUP@
REPLACE_STRERROR = @REPLACE_STRERROR@
REPLACE_STRNCAT = @REPLACE_STRNCAT@
REPLACE_STRNDUP = @REPLACE_STRNDUP@
+REPLACE_STRNLEN = @REPLACE_STRNLEN@
REPLACE_STRSIGNAL = @REPLACE_STRSIGNAL@
REPLACE_STRSTR = @REPLACE_STRSTR@
REPLACE_STRTOD = @REPLACE_STRTOD@
@@ -836,6 +845,7 @@ REPLACE_STRTOK_R = @REPLACE_STRTOK_R@
REPLACE_SYMLINK = @REPLACE_SYMLINK@
REPLACE_TIMEGM = @REPLACE_TIMEGM@
REPLACE_TMPFILE = @REPLACE_TMPFILE@
+REPLACE_TTYNAME_R = @REPLACE_TTYNAME_R@
REPLACE_UNLINK = @REPLACE_UNLINK@
REPLACE_UNLINKAT = @REPLACE_UNLINKAT@
REPLACE_UNSETENV = @REPLACE_UNSETENV@
diff --git a/man/po4a/po/id.po b/man/po4a/po/id.po
index 85f38e83..51f4f8c9 100644
--- a/man/po4a/po/id.po
+++ b/man/po4a/po/id.po
@@ -6,10 +6,11 @@
msgid ""
msgstr ""
"Project-Id-Version: man-db-manpages 2.5.6-pre1\n"
-"POT-Creation-Date: 2010-05-09 07:30+0200\n"
+"POT-Creation-Date: 2010-05-09 07:39+0200\n"
"PO-Revision-Date: 2009-09-09 07:00+0700\n"
"Last-Translator: Arif E. Nugroho <arif_endro@yahoo.com>\n"
"Language-Team: Indonesian <translation-team-id@lists.sourceforge.net>\n"
+"Language: id\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=ISO-8859-1\n"
"Content-Transfer-Encoding: 8bit\n"
@@ -108,8 +109,8 @@ msgid ""
"Each manual page has a short description available within it. B<%apropos%> "
"searches the descriptions for instances of I<keyword>."
msgstr ""
-"Setiap halaman buku panduan memiliki sebuah deskripsi singkat didalamnya. B<%"
-"apropos%> mencari deskripsi untuk setiap hal dari I<kata kunci>."
+"Setiap halaman buku panduan memiliki sebuah deskripsi singkat didalamnya. B<"
+"%apropos%> mencari deskripsi untuk setiap hal dari I<kata kunci>."
#. type: Plain text
#: ../../man/man1/apropos.man1:50
@@ -451,8 +452,8 @@ msgstr ""
#. type: Plain text
#: ../../man/man1/apropos.man1:236
msgid ""
-"If $B<POSIXLY_CORRECT> is set, even to a null value, the default B<%apropos%"
-"> search will be as an extended regex (B<-r>). Nowadays, this is the "
+"If $B<POSIXLY_CORRECT> is set, even to a null value, the default B<%apropos"
+"%> search will be as an extended regex (B<-r>). Nowadays, this is the "
"default behaviour anyway."
msgstr ""
"Jika $B<POSIXLY_CORRECT> diset, meskipun ke sebuah nilai null, pencarian "
@@ -690,8 +691,8 @@ msgstr ""
#. type: Plain text
#: ../../man/man1/lexgrog.man1:142
msgid ""
-"Some manual pagers require the \\(oq\\e-\\(cq to be exactly as shown; B<%"
-"mandb%> is more tolerant, but for compatibility with other systems it is "
+"Some manual pagers require the \\(oq\\e-\\(cq to be exactly as shown; B<"
+"%mandb%> is more tolerant, but for compatibility with other systems it is "
"nevertheless a good idea to retain the backslash."
msgstr ""
"Beberapa halaman buku panduan membutuhkan \\(oq\\e-\\(cq sama seperti yang "
@@ -836,8 +837,8 @@ msgid ""
"\\|] [\\|B<-7>\\|] [\\|B<-E> I<encoding>\\|] [\\|B<--no-hyphenation>\\|] [\\|"
"B<--no-justification>\\|] [\\|B<-p> I<string>\\|] [\\|B<-t>\\|] [\\|B<-T>\\|"
"[\\|I<device>\\|]\\|] [\\|B<-H>\\|[\\|I<browser>\\|]\\|] [\\|B<-X>\\|[\\|"
-"I<dpi>\\|]\\|] [\\|B<-Z>\\|] [\\|[\\|I<section>\\|] I<page>\\ .\\|.\\|.\\|]"
-"\\ .\\|.\\|."
+"I<dpi>\\|]\\|] [\\|B<-Z>\\|] [\\|[\\|I<section>\\|] I<page>\\ .\\|.\\|."
+"\\|]\\ .\\|.\\|."
msgstr ""
"B<%man%> [\\|B<-C> I<berkas>\\|] [\\|B<-d>\\|] [\\|B<-D>\\|] [\\|B<--"
"warnings>\\|[\\|=I<peringatan>\\|]\\|] [\\|B<-R> I<pengkodean>\\|] [\\|B<-L> "
@@ -848,8 +849,8 @@ msgstr ""
"I<prompt>\\|] [\\|B<-7>\\|] [\\|B<-E> I<pengkodean>\\|] [\\|B<--no-"
"hyphenation>\\|] [\\|B<-p> I<string>\\|] [\\|B<-t>\\|] [\\|B<-T>\\|[\\|"
"I<perangkat>\\|]\\|] [\\|B<-H>\\|[\\|I<browser>\\|]\\|] [\\|B<-X>\\|[\\|"
-"I<dpi>\\|]\\|] [\\|B<-Z>\\|] [\\|[\\|I<bagian>\\|] I<halaman>\\ .\\|.\\|.\\|]"
-"\\ .\\|.\\|."
+"I<dpi>\\|]\\|] [\\|B<-Z>\\|] [\\|[\\|I<bagian>\\|] I<halaman>\\ .\\|.\\|."
+"\\|]\\ .\\|.\\|."
#. The --global-apropos command line
#. type: Plain text
@@ -919,8 +920,8 @@ msgstr "B<%man%> [\\|B<-hV>\\|]"
#. type: Plain text
#: ../../man/man1/man.man1:174
msgid ""
-"B<%man%> is the system's manual pager. Each I<page> argument given to B<%man%"
-"> is normally the name of a program, utility or function. The I<manual "
+"B<%man%> is the system's manual pager. Each I<page> argument given to B<%man"
+"%> is normally the name of a program, utility or function. The I<manual "
"page> associated with each of these arguments is then found and displayed. A "
"I<section>, if provided, will direct B<%man%> to look only in that "
"I<section> of the manual. The default action is to search in all of the "
@@ -1187,12 +1188,12 @@ msgstr "B<%man%\\ -k>I<\\ printf>"
#: ../../man/man1/man.man1:299
msgid ""
"Search the short descriptions and manual page names for the keyword "
-"I<printf> as regular expression. Print out any matches. Equivalent to B<%"
-"apropos%\\ -r>I<\\ printf>B<.>"
+"I<printf> as regular expression. Print out any matches. Equivalent to B<"
+"%apropos%\\ -r>I<\\ printf>B<.>"
msgstr ""
"Cari deskripsi singkat dan nama halaman buku panduan untuk kata kunci "
-"I<printf> seperti ekspresi umum. Cetak semua kecocokan. Sama dengan B<%"
-"apropos%\\ -r>I<\\ printf>B<.>"
+"I<printf> seperti ekspresi umum. Cetak semua kecocokan. Sama dengan B<"
+"%apropos%\\ -r>I<\\ printf>B<.>"
#. type: TP
#: ../../man/man1/man.man1:299
@@ -1401,8 +1402,8 @@ msgid ""
"However, the cache consistency check can be slow on systems with many manual "
"pages installed, so it is not performed by default, and system "
"administrators may wish to run B<%mandb%> every week or so to keep the "
-"database caches fresh. To forestall problems caused by outdated caches, B<%"
-"man%> will fall back to file globbing if a cache lookup fails, just as it "
+"database caches fresh. To forestall problems caused by outdated caches, B<"
+"%man%> will fall back to file globbing if a cache lookup fails, just as it "
"would if no cache was present."
msgstr ""
"B<%man%> akan mencari untuk halaman buku panduan yang diinginkan didalam "
@@ -1649,8 +1650,8 @@ msgstr ""
#. type: Plain text
#: ../../man/man1/man.man1:610
msgid ""
-"This option is not for general use and should only be used by the B<%catman%"
-"> program."
+"This option is not for general use and should only be used by the B<%catman"
+"%> program."
msgstr ""
"Pilihan in tidak untuk penggunaan umum dan seharusnya hanya digunakan oleh "
"aplikasi B<%catman%>."
@@ -1719,8 +1720,8 @@ msgid ""
"derived code to determine the path to search. This option overrides the "
"$B<MANPATH> environment variable and causes option B<-m> to be ignored."
msgstr ""
-"Spesifikasikan sebuah jalur man alternatif untuk digunakan. Secara baku, B<%"
-"man%> menggunakan B<%manpath%> kode turunan untuk menentukan jalur "
+"Spesifikasikan sebuah jalur man alternatif untuk digunakan. Secara baku, B<"
+"%man%> menggunakan B<%manpath%> kode turunan untuk menentukan jalur "
"pencarian. Pilihan ini mengesampingkan variabel lingkungan $B<MANPATH> dan "
"dapat menyebabkan pilihan B<-m> untuk diabaikan."
@@ -1924,8 +1925,8 @@ msgid ""
"overrides the $B<PAGER> environment variable. It is not used in conjunction "
"with B<-f> or B<-k>."
msgstr ""
-"Spesifikasikan pager keluaran mana yang akan digunakan, Secara baku, B<%man%"
-"> menggunakan B<%pager%>. Pilihan ini mengesampingkan variabel lingkungan "
+"Spesifikasikan pager keluaran mana yang akan digunakan, Secara baku, B<%man"
+"%> menggunakan B<%pager%>. Pilihan ini mengesampingkan variabel lingkungan "
"$B<MANPAGER>, yang jadinya mengesampingkan variabel lingkungan $B<PAGER>. "
"Ini tidak digunakan dengan konjungsi dengan B<-f> atau B<-k>."
@@ -2017,8 +2018,8 @@ msgstr ""
"dievaluasi oleh shell. Semua double quotes, back-quotes dan backslashes "
"dalam prompt harus diberi karakter untuk keluar dengan sebuah awalan "
"backslash. Prompt string mungkin berakhir dalam sebuah karakter untuk keluar "
-"$ yang mungkin diikuti oleh pilihan selanjutnya untuk less. Secara baku B<%"
-"man%> menset pilihan B<-ix8>."
+"$ yang mungkin diikuti oleh pilihan selanjutnya untuk less. Secara baku B<"
+"%man%> menset pilihan B<-ix8>."
#. type: Plain text
#: ../../man/man1/man.man1:910
@@ -2386,8 +2387,8 @@ msgid ""
"If $B<BROWSER> is set, its value is a colon-delimited list of commands, each "
"of which in turn is used to try to start a web browser for B<man> B<--"
"html>. In each command, I<%s> is replaced by a filename containing the HTML "
-"output from B<groff>, I<%%> is replaced by a single percent sign (%), and I<%"
-"c> is replaced by a colon (:)."
+"output from B<groff>, I<%%> is replaced by a single percent sign (%), and I<"
+"%c> is replaced by a colon (:)."
msgstr ""
"Jika $B<BROWSER> diset, nilai itu adalah daftar dipisahkan kolon dari "
"perintah, setiap perintah itu digunakan untuk mencoba menjalankan sebuah web "
@@ -2475,8 +2476,8 @@ msgstr ""
#: ../../man/man1/man.man1:1292
msgid ""
"Depending on system and implementation, either or both of $B<LANG> and "
-"$B<LC_MESSAGES> will be interrogated for the current message locale. B<%man%"
-"> will display its messages in that locale (if available). See B<setlocale>"
+"$B<LC_MESSAGES> will be interrogated for the current message locale. B<%man"
+"%> will display its messages in that locale (if available). See B<setlocale>"
"(3) for precise details."
msgstr ""
"Tergantung dari sistem dan implementasi, baik atau kedua dari $B<LANG> dan "
@@ -2499,13 +2500,13 @@ msgstr "Sebuah hierarki halaman buku panduan global."
#: ../../man/man1/man.man1:1328
msgid ""
"B<%mandb%>(8), B<%manpath%>(1), B<manpath>(5), B<%apropos%>(1), B<%whatis%>"
-"(1), B<%catman%>(8), B<less>(1), B<nroff>(1), B<troff>(1), B<groff>(1), B<%"
-"zsoelim%>(1), B<setlocale>(3), B<man>(7), B<ascii>(7), B<latin1>(7), the man-"
-"db package manual, B<FSSTND>."
+"(1), B<%catman%>(8), B<less>(1), B<nroff>(1), B<troff>(1), B<groff>(1), B<"
+"%zsoelim%>(1), B<setlocale>(3), B<man>(7), B<ascii>(7), B<latin1>(7), the "
+"man-db package manual, B<FSSTND>."
msgstr ""
"B<%mandb%>(8), B<%manpath%>(1), B<manpath>(5), B<%apropos%>(1), B<%whatis%>"
-"(1), B<%catman%>(8), B<less>(1), B<nroff>(1), B<troff>(1), B<groff>(1), B<%"
-"zsoelim%>(1), B<setlocale>(3), B<man>(7), B<ascii>(7), B<latin1>(7), paket "
+"(1), B<%catman%>(8), B<less>(1), B<nroff>(1), B<troff>(1), B<groff>(1), B<"
+"%zsoelim%>(1), B<setlocale>(3), B<man>(7), B<ascii>(7), B<latin1>(7), paket "
"buku panduan man-db, B<FSSTND>."
#. type: SH
@@ -2809,8 +2810,8 @@ msgstr ""
#. type: Plain text
#: ../../man/man1/whatis.man1:61
msgid ""
-"B<index> databases are used during the search, and are updated by the B<%"
-"mandb%> program. Depending on your installation, this may be run by a "
+"B<index> databases are used during the search, and are updated by the B<"
+"%mandb%> program. Depending on your installation, this may be run by a "
"periodic cron job, or may need to be run manually after new manual pages "
"have been installed. To produce an old style text B<whatis> database from "
"the relative B<index> database, issue the command:"
diff --git a/man/po4a/po/nl.po b/man/po4a/po/nl.po
index d4f194ad..86095f1e 100644
--- a/man/po4a/po/nl.po
+++ b/man/po4a/po/nl.po
@@ -7,10 +7,11 @@
msgid ""
msgstr ""
"Project-Id-Version: man-db-manpages 2.5.7-pre1\n"
-"POT-Creation-Date: 2010-05-09 07:30+0200\n"
+"POT-Creation-Date: 2010-05-09 07:39+0200\n"
"PO-Revision-Date: 2010-03-02 09:13+0100\n"
"Last-Translator: Erwin Poeze <erwin.poeze@gmail.com>\n"
"Language-Team: Dutch <vertaling@vrijschrift.org>\n"
+"Language: nl\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
@@ -144,8 +145,8 @@ msgid ""
"Depending on your installation, this may be run by a periodic cron job, or "
"may need to be run manually after new manual pages have been installed."
msgstr ""
-"De database, doorzocht door B<%apropos%> is bijgewerkt door programma B<%"
-"mandb%>. Afhankelijk van uw installatie kan dit worden uitgevoerd met een "
+"De database, doorzocht door B<%apropos%> is bijgewerkt door programma B<"
+"%mandb%>. Afhankelijk van uw installatie kan dit worden uitgevoerd met een "
"periodieke cron-opdracht of handmatig na de installatie van nieuwe man-"
"pagina's."
@@ -454,8 +455,8 @@ msgstr ""
#. type: Plain text
#: ../../man/man1/apropos.man1:236
msgid ""
-"If $B<POSIXLY_CORRECT> is set, even to a null value, the default B<%apropos%"
-"> search will be as an extended regex (B<-r>). Nowadays, this is the "
+"If $B<POSIXLY_CORRECT> is set, even to a null value, the default B<%apropos"
+"%> search will be as an extended regex (B<-r>). Nowadays, this is the "
"default behaviour anyway."
msgstr ""
"Wanneer $B<POSIXLY_CORRECT> is opgegeven, zelfs met een nulwaarde, wordt de "
@@ -692,8 +693,8 @@ msgstr ""
#. type: Plain text
#: ../../man/man1/lexgrog.man1:142
msgid ""
-"Some manual pagers require the \\(oq\\e-\\(cq to be exactly as shown; B<%"
-"mandb%> is more tolerant, but for compatibility with other systems it is "
+"Some manual pagers require the \\(oq\\e-\\(cq to be exactly as shown; B<"
+"%mandb%> is more tolerant, but for compatibility with other systems it is "
"nevertheless a good idea to retain the backslash."
msgstr ""
"Sommige opmakers van man-pagina's vereisen de \\(oq\\e-\\(cq precies zoals "
@@ -837,8 +838,8 @@ msgid ""
"\\|] [\\|B<-7>\\|] [\\|B<-E> I<encoding>\\|] [\\|B<--no-hyphenation>\\|] [\\|"
"B<--no-justification>\\|] [\\|B<-p> I<string>\\|] [\\|B<-t>\\|] [\\|B<-T>\\|"
"[\\|I<device>\\|]\\|] [\\|B<-H>\\|[\\|I<browser>\\|]\\|] [\\|B<-X>\\|[\\|"
-"I<dpi>\\|]\\|] [\\|B<-Z>\\|] [\\|[\\|I<section>\\|] I<page>\\ .\\|.\\|.\\|]"
-"\\ .\\|.\\|."
+"I<dpi>\\|]\\|] [\\|B<-Z>\\|] [\\|[\\|I<section>\\|] I<page>\\ .\\|.\\|."
+"\\|]\\ .\\|.\\|."
msgstr ""
"B<%man%> [\\|B<-C> I<bestand>\\|] [\\|B<-d>\\|] [\\|B<-D>\\|] [\\|B<--"
"warnings>\\|[\\|=I<waarschuwingen>\\|]\\|] [\\|B<-R> I<encoding>\\|] [\\|B<-"
@@ -848,8 +849,8 @@ msgstr ""
"B<-a>\\|] [\\|B<-u>\\|] [\\|B<--no-subpages>\\|] [\\|B<-P> I<opmaker>\\|] "
"[\\|B<-r> I<prompt>\\|] [\\|B<-7>\\|] [\\|B<-E> I<encoding>\\|] [\\|B<--no-"
"hyphenation>\\|] [\\|B<--no-justification>\\|] [\\|B<-p> I<string>\\|] [\\|"
-"B<-t>\\|] [\\|B<-T>\\|[\\|I<apparaat>\\|]\\|] [\\|B<-H>\\|[\\|I<browser>\\|]"
-"\\|] [\\|B<-X>\\|[\\|I<dpi>\\|]\\|] [\\|B<-Z>\\|] [\\|[\\|I<sectie>\\|] "
+"B<-t>\\|] [\\|B<-T>\\|[\\|I<apparaat>\\|]\\|] [\\|B<-H>\\|[\\|I<browser>"
+"\\|]\\|] [\\|B<-X>\\|[\\|I<dpi>\\|]\\|] [\\|B<-Z>\\|] [\\|[\\|I<sectie>\\|] "
"I<pagina>\\ .\\|.\\|.\\|]\\ .\\|.\\|."
#. The --global-apropos command line
@@ -887,10 +888,10 @@ msgid ""
msgstr ""
"B<%man%> B<-l> [\\|B<-C> I<bestand>\\|] [\\|B<-d>\\|] [\\|B<-D>\\|] [\\|B<--"
"warnings>\\|[\\|=I<waarschuwingen>\\|]\\|] [\\|B<-R> I<encoding>\\|] [\\|B<-"
-"L> I<taalgebied>\\|] [\\|B<-P> I<opmaker>\\|] [\\|B<-r> I<prompt>\\|] [\\|B<-"
-"7>\\|] [\\|B<-E> I<encoding>\\|] [\\|B<-p> I<string>\\|] [\\|B<-t>\\|] [\\|"
-"B<-T>\\|[\\|I<apparaat>\\|]\\|] [\\|B<-H>\\|[\\|I<browser>\\|]\\|] [\\|B<-X>"
-"\\|[\\|I<dpi>\\|]\\|] [\\|B<-Z>\\|] I<bestand> \\&.\\|.\\|."
+"L> I<taalgebied>\\|] [\\|B<-P> I<opmaker>\\|] [\\|B<-r> I<prompt>\\|] [\\|"
+"B<-7>\\|] [\\|B<-E> I<encoding>\\|] [\\|B<-p> I<string>\\|] [\\|B<-t>\\|] "
+"[\\|B<-T>\\|[\\|I<apparaat>\\|]\\|] [\\|B<-H>\\|[\\|I<browser>\\|]\\|] [\\|"
+"B<-X>\\|[\\|I<dpi>\\|]\\|] [\\|B<-Z>\\|] I<bestand> \\&.\\|.\\|."
#. The --catman command line
#. type: Plain text
@@ -920,8 +921,8 @@ msgstr "B<%man%> [\\|B<-hV>\\|]"
#. type: Plain text
#: ../../man/man1/man.man1:174
msgid ""
-"B<%man%> is the system's manual pager. Each I<page> argument given to B<%man%"
-"> is normally the name of a program, utility or function. The I<manual "
+"B<%man%> is the system's manual pager. Each I<page> argument given to B<%man"
+"%> is normally the name of a program, utility or function. The I<manual "
"page> associated with each of these arguments is then found and displayed. A "
"I<section>, if provided, will direct B<%man%> to look only in that "
"I<section> of the manual. The default action is to search in all of the "
@@ -1184,8 +1185,8 @@ msgstr "B<%man%\\ -k>I<\\ printf>"
#: ../../man/man1/man.man1:299
msgid ""
"Search the short descriptions and manual page names for the keyword "
-"I<printf> as regular expression. Print out any matches. Equivalent to B<%"
-"apropos%\\ -r>I<\\ printf>B<.>"
+"I<printf> as regular expression. Print out any matches. Equivalent to B<"
+"%apropos%\\ -r>I<\\ printf>B<.>"
msgstr ""
"Zoek in de korte beschrijvingen en namen van man-pagina's naar het trefwoord "
"I<printf> als reguliere expressie. Toon iedere treffer. Komt overeen met B<"
@@ -1238,8 +1239,8 @@ msgid ""
"will allow %man% to `forget' about the options specified in $B<MANOPT> "
"although they must still have been valid."
msgstr ""
-"Verschillende omgevingsvariabelen worden uitgelezen om te bepalen hoe B<%"
-"mandb%> werkt, mits ingesteld. Het is mogelijk om de `catch all'-variabele "
+"Verschillende omgevingsvariabelen worden uitgelezen om te bepalen hoe B<"
+"%mandb%> werkt, mits ingesteld. Het is mogelijk om de `catch all'-variabele "
"$B<MANOPT> op iedere tekenreeks in te stellen, zoals in een opdrachtregel, "
"met als uitzondering dat iedere spatie die als onderdeel van een "
"optieargument wordt gebruikt, voorafgegaan moet worden door een backslash. "
@@ -1396,8 +1397,8 @@ msgid ""
"However, the cache consistency check can be slow on systems with many manual "
"pages installed, so it is not performed by default, and system "
"administrators may wish to run B<%mandb%> every week or so to keep the "
-"database caches fresh. To forestall problems caused by outdated caches, B<%"
-"man%> will fall back to file globbing if a cache lookup fails, just as it "
+"database caches fresh. To forestall problems caused by outdated caches, B<"
+"%man%> will fall back to file globbing if a cache lookup fails, just as it "
"would if no cache was present."
msgstr ""
"B<%man%> zal naar de gewenste man-pagina in het I<index>-databasecache "
@@ -1643,8 +1644,8 @@ msgstr ""
#. type: Plain text
#: ../../man/man1/man.man1:610
msgid ""
-"This option is not for general use and should only be used by the B<%catman%"
-"> program."
+"This option is not for general use and should only be used by the B<%catman"
+"%> program."
msgstr ""
"De optie is niet voor algemeen gebruik en mag alleen gebruikt worden door "
"het programma B<%catman%>."
@@ -1845,9 +1846,9 @@ msgid ""
"pages with names that match the search criteria."
msgstr ""
"Standaard zal B<%man%> stoppen na het weergeven van de meeste geschikte man-"
-"pagina die het kan vinden. Door gebruik te maken van deze optie, wordt B<%"
-"man%> gedwongen alle man-pagina's te tonen met namen die overeenkomen met de "
-"zoekcriteria."
+"pagina die het kan vinden. Door gebruik te maken van deze optie, wordt B<"
+"%man%> gedwongen alle man-pagina's te tonen met namen die overeenkomen met "
+"de zoekcriteria."
#. type: Plain text
#: ../../man/man1/man.man1:794
@@ -2327,8 +2328,8 @@ msgid ""
"If $B<BROWSER> is set, its value is a colon-delimited list of commands, each "
"of which in turn is used to try to start a web browser for B<man> B<--"
"html>. In each command, I<%s> is replaced by a filename containing the HTML "
-"output from B<groff>, I<%%> is replaced by a single percent sign (%), and I<%"
-"c> is replaced by a colon (:)."
+"output from B<groff>, I<%%> is replaced by a single percent sign (%), and I<"
+"%c> is replaced by a colon (:)."
msgstr ""
#. type: Plain text
@@ -2382,8 +2383,8 @@ msgstr ""
#: ../../man/man1/man.man1:1292
msgid ""
"Depending on system and implementation, either or both of $B<LANG> and "
-"$B<LC_MESSAGES> will be interrogated for the current message locale. B<%man%"
-"> will display its messages in that locale (if available). See B<setlocale>"
+"$B<LC_MESSAGES> will be interrogated for the current message locale. B<%man"
+"%> will display its messages in that locale (if available). See B<setlocale>"
"(3) for precise details."
msgstr ""
@@ -2402,9 +2403,9 @@ msgstr ""
#: ../../man/man1/man.man1:1328
msgid ""
"B<%mandb%>(8), B<%manpath%>(1), B<manpath>(5), B<%apropos%>(1), B<%whatis%>"
-"(1), B<%catman%>(8), B<less>(1), B<nroff>(1), B<troff>(1), B<groff>(1), B<%"
-"zsoelim%>(1), B<setlocale>(3), B<man>(7), B<ascii>(7), B<latin1>(7), the man-"
-"db package manual, B<FSSTND>."
+"(1), B<%catman%>(8), B<less>(1), B<nroff>(1), B<troff>(1), B<groff>(1), B<"
+"%zsoelim%>(1), B<setlocale>(3), B<man>(7), B<ascii>(7), B<latin1>(7), the "
+"man-db package manual, B<FSSTND>."
msgstr ""
#. type: SH
@@ -2645,8 +2646,8 @@ msgstr ""
#. type: Plain text
#: ../../man/man1/whatis.man1:61
msgid ""
-"B<index> databases are used during the search, and are updated by the B<%"
-"mandb%> program. Depending on your installation, this may be run by a "
+"B<index> databases are used during the search, and are updated by the B<"
+"%mandb%> program. Depending on your installation, this may be run by a "
"periodic cron job, or may need to be run manually after new manual pages "
"have been installed. To produce an old style text B<whatis> database from "
"the relative B<index> database, issue the command:"
diff --git a/man/po4a/po/pl.po b/man/po4a/po/pl.po
index 26e55e85..e41e74f3 100644
--- a/man/po4a/po/pl.po
+++ b/man/po4a/po/pl.po
@@ -9,10 +9,11 @@
msgid ""
msgstr ""
"Project-Id-Version: man-db-manpages 2.5.4-pre1\n"
-"POT-Creation-Date: 2010-05-09 07:30+0200\n"
+"POT-Creation-Date: 2010-05-09 07:39+0200\n"
"PO-Revision-Date: 2009-01-17 18:20+0100\n"
"Last-Translator: Robert Luberda <robert@debian.org>\n"
"Language-Team: Polish <translation-team-pl@lists.sourceforge.net>\n"
+"Language: pl\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
@@ -468,8 +469,8 @@ msgstr ""
#. type: Plain text
#: ../../man/man1/apropos.man1:236
msgid ""
-"If $B<POSIXLY_CORRECT> is set, even to a null value, the default B<%apropos%"
-"> search will be as an extended regex (B<-r>). Nowadays, this is the "
+"If $B<POSIXLY_CORRECT> is set, even to a null value, the default B<%apropos"
+"%> search will be as an extended regex (B<-r>). Nowadays, this is the "
"default behaviour anyway."
msgstr ""
"Jeżeli ustawiono $B<POSIXLY_CORRECT>, nawet na pustą wartość, to domyślnie B<"
@@ -715,8 +716,8 @@ msgstr ""
#. type: Plain text
#: ../../man/man1/lexgrog.man1:142
msgid ""
-"Some manual pagers require the \\(oq\\e-\\(cq to be exactly as shown; B<%"
-"mandb%> is more tolerant, but for compatibility with other systems it is "
+"Some manual pagers require the \\(oq\\e-\\(cq to be exactly as shown; B<"
+"%mandb%> is more tolerant, but for compatibility with other systems it is "
"nevertheless a good idea to retain the backslash."
msgstr ""
"Niektóre programy do obsługi stron podręcznika wymagają, aby separator \\(oq"
@@ -861,8 +862,8 @@ msgid ""
"\\|] [\\|B<-7>\\|] [\\|B<-E> I<encoding>\\|] [\\|B<--no-hyphenation>\\|] [\\|"
"B<--no-justification>\\|] [\\|B<-p> I<string>\\|] [\\|B<-t>\\|] [\\|B<-T>\\|"
"[\\|I<device>\\|]\\|] [\\|B<-H>\\|[\\|I<browser>\\|]\\|] [\\|B<-X>\\|[\\|"
-"I<dpi>\\|]\\|] [\\|B<-Z>\\|] [\\|[\\|I<section>\\|] I<page>\\ .\\|.\\|.\\|]"
-"\\ .\\|.\\|."
+"I<dpi>\\|]\\|] [\\|B<-Z>\\|] [\\|[\\|I<section>\\|] I<page>\\ .\\|.\\|."
+"\\|]\\ .\\|.\\|."
msgstr ""
"B<%man%> [\\|B<-C> I<file>\\|] [\\|B<-d>\\|] [\\|B<-D>\\|] [\\|B<--warnings>"
"\\|[\\|=I<ostrzeżenia>\\|]\\|] [\\|B<-R> I<kodowanie_znaków>\\|] [\\|B<-L> "
@@ -952,8 +953,8 @@ msgstr "B<%man%> [\\|B<-hV>\\|]"
#. type: Plain text
#: ../../man/man1/man.man1:174
msgid ""
-"B<%man%> is the system's manual pager. Each I<page> argument given to B<%man%"
-"> is normally the name of a program, utility or function. The I<manual "
+"B<%man%> is the system's manual pager. Each I<page> argument given to B<%man"
+"%> is normally the name of a program, utility or function. The I<manual "
"page> associated with each of these arguments is then found and displayed. A "
"I<section>, if provided, will direct B<%man%> to look only in that "
"I<section> of the manual. The default action is to search in all of the "
@@ -1226,8 +1227,8 @@ msgstr "B<%man%\\ -k>I<\\ printf>"
#: ../../man/man1/man.man1:299
msgid ""
"Search the short descriptions and manual page names for the keyword "
-"I<printf> as regular expression. Print out any matches. Equivalent to B<%"
-"apropos%\\ -r>I<\\ printf>B<.>"
+"I<printf> as regular expression. Print out any matches. Equivalent to B<"
+"%apropos%\\ -r>I<\\ printf>B<.>"
msgstr ""
"Szuka słowa kluczowego I<printf> jako wyrażenia regularnego w krótkich "
"opisach i nazwach stron podręcznika. Wyświetla wszystkie dopasowania. "
@@ -1329,9 +1330,9 @@ msgstr ""
"Jeżeli B<%man%> nie będzie mógł znaleźć zainicjowanej przez B<%mandb%> "
"B<indeksowanej> bazy danych dla pewnej hierarchii stron podręcznika, to "
"wciąż będzie przeszukiwał tę hierarchię, chociaż w takim wypadku będzie "
-"potrzebne użycie przeszukiwania sytemu plików. Jeśli B<%whatis%> lub B<%"
-"apropos%> nie znajdą B<indeksu>, będą próbowały znaleźć potrzebne informacje "
-"w tradycyjnej bazie danych I<whatis>."
+"potrzebne użycie przeszukiwania sytemu plików. Jeśli B<%whatis%> lub B<"
+"%apropos%> nie znajdą B<indeksu>, będą próbowały znaleźć potrzebne "
+"informacje w tradycyjnej bazie danych I<whatis>."
#. type: Plain text
#: ../../man/man1/man.man1:397
@@ -1438,8 +1439,8 @@ msgid ""
"However, the cache consistency check can be slow on systems with many manual "
"pages installed, so it is not performed by default, and system "
"administrators may wish to run B<%mandb%> every week or so to keep the "
-"database caches fresh. To forestall problems caused by outdated caches, B<%"
-"man%> will fall back to file globbing if a cache lookup fails, just as it "
+"database caches fresh. To forestall problems caused by outdated caches, B<"
+"%man%> will fall back to file globbing if a cache lookup fails, just as it "
"would if no cache was present."
msgstr ""
"B<%man%> poszukuje żądanych stron podręcznika w I<indeksie> bufora bazy "
@@ -1686,8 +1687,8 @@ msgstr ""
#. type: Plain text
#: ../../man/man1/man.man1:610
msgid ""
-"This option is not for general use and should only be used by the B<%catman%"
-"> program."
+"This option is not for general use and should only be used by the B<%catman"
+"%> program."
msgstr ""
"Ta opcja nie jest przeznaczona dla ogółu i powinna być używana tylko przez "
"program B<%catman%>."
@@ -1710,8 +1711,8 @@ msgid ""
msgstr ""
"Zamiast w normalny sposób wyświetlić stronę podręcznika, wypisze źródło "
"strony przekształcone na podane I<kodowanie_znaków>. Jeśli znane jest "
-"kodowanie znaków pliku źródłowego, to można użyć bezpośrednio polecenia B<%"
-"manconv%>(1). Jednakże, opcja ta pozwala przekształcić kilka stron "
+"kodowanie znaków pliku źródłowego, to można użyć bezpośrednio polecenia B<"
+"%manconv%>(1). Jednakże, opcja ta pozwala przekształcić kilka stron "
"podręcznika do jednego kodowania, bez dokładnego podawania kodowania źródeł "
"każdej z nich, pod warunkiem że strony te są umieszczone w strukturze "
"katalogów podobnej do hierarchii stron podręcznika."
@@ -2029,8 +2030,8 @@ msgid ""
msgstr ""
"Podanie B<-r> z łańcuchem znaków nadpisze tę wartość domyślną. Łańcuch "
"znaków może zawierać tekst B<$MAN_PN>, który zostanie zamieniony przez nazwę "
-"bieżącej strony podręcznika oraz jej sekcję otoczoną nawiasami \"(\" i \")"
-"\". Łańcuch znaków równoważny wartości domyślnej to:"
+"bieżącej strony podręcznika oraz jej sekcję otoczoną nawiasami \"(\" i "
+"\")\". Łańcuch znaków równoważny wartości domyślnej to:"
#. type: Plain text
#: ../../man/man1/man.man1:887
@@ -2413,8 +2414,8 @@ msgid ""
msgstr ""
"Jeśli ustawiono zmienną $B<MANPAGER> lub $B<PAGER> ($B<MANPAGER> ma wyższy "
"priorytet), to jej wartość jest używana jako nazwa programu, w którym będzie "
-"wyświetlona strona podręcznika ekranowego. Domyślnie używany jest program B<%"
-"pager%>."
+"wyświetlona strona podręcznika ekranowego. Domyślnie używany jest program B<"
+"%pager%>."
#. type: Plain text
#: ../../man/man1/man.man1:1203
@@ -2437,8 +2438,8 @@ msgid ""
"If $B<BROWSER> is set, its value is a colon-delimited list of commands, each "
"of which in turn is used to try to start a web browser for B<man> B<--"
"html>. In each command, I<%s> is replaced by a filename containing the HTML "
-"output from B<groff>, I<%%> is replaced by a single percent sign (%), and I<%"
-"c> is replaced by a colon (:)."
+"output from B<groff>, I<%%> is replaced by a single percent sign (%), and I<"
+"%c> is replaced by a colon (:)."
msgstr ""
"Jeżeli jest ustawiona zmienna $B<BROWSER>, to jej wartością jest rozdzielona "
"dwukropkami lista poleceń, które %man% będzie - w kolejności - próbował "
@@ -2532,14 +2533,14 @@ msgstr ""
#: ../../man/man1/man.man1:1292
msgid ""
"Depending on system and implementation, either or both of $B<LANG> and "
-"$B<LC_MESSAGES> will be interrogated for the current message locale. B<%man%"
-"> will display its messages in that locale (if available). See B<setlocale>"
+"$B<LC_MESSAGES> will be interrogated for the current message locale. B<%man"
+"%> will display its messages in that locale (if available). See B<setlocale>"
"(3) for precise details."
msgstr ""
"W zależności od systemu i implementacji bieżące ustawienia językowe będą "
-"pobierane z jednej lub obu spośród zmiennych $B<LANG> i $B<LC_MESSAGES>. B<%"
-"man%> wyświetli swoje komunikaty w tym języku (jeśli są dostępne). Szczegóły "
-"można znaleźć w B<setlocale>(3)."
+"pobierane z jednej lub obu spośród zmiennych $B<LANG> i $B<LC_MESSAGES>. B<"
+"%man%> wyświetli swoje komunikaty w tym języku (jeśli są dostępne). "
+"Szczegóły można znaleźć w B<setlocale>(3)."
#
#
@@ -2558,13 +2559,13 @@ msgstr "Globalna hierarchia stron podręcznika ekranowego."
#: ../../man/man1/man.man1:1328
msgid ""
"B<%mandb%>(8), B<%manpath%>(1), B<manpath>(5), B<%apropos%>(1), B<%whatis%>"
-"(1), B<%catman%>(8), B<less>(1), B<nroff>(1), B<troff>(1), B<groff>(1), B<%"
-"zsoelim%>(1), B<setlocale>(3), B<man>(7), B<ascii>(7), B<latin1>(7), the man-"
-"db package manual, B<FSSTND>."
+"(1), B<%catman%>(8), B<less>(1), B<nroff>(1), B<troff>(1), B<groff>(1), B<"
+"%zsoelim%>(1), B<setlocale>(3), B<man>(7), B<ascii>(7), B<latin1>(7), the "
+"man-db package manual, B<FSSTND>."
msgstr ""
"B<%mandb%>(8), B<%manpath%>(1), B<manpath>(5), B<%apropos%>(1), B<%whatis%>"
-"(1), B<%catman%>(8), B<less>(1), B<nroff>(1), B<troff>(1), B<groff>(1), B<%"
-"zsoelim%>(1), B<setlocale>(3), B<man>(7), B<ascii>(7), B<latin1>(7), "
+"(1), B<%catman%>(8), B<less>(1), B<nroff>(1), B<troff>(1), B<groff>(1), B<"
+"%zsoelim%>(1), B<setlocale>(3), B<man>(7), B<ascii>(7), B<latin1>(7), "
"podręcznik pakietu man-db, B<FSSTND>."
#. type: SH
@@ -2882,8 +2883,8 @@ msgstr ""
#. type: Plain text
#: ../../man/man1/whatis.man1:61
msgid ""
-"B<index> databases are used during the search, and are updated by the B<%"
-"mandb%> program. Depending on your installation, this may be run by a "
+"B<index> databases are used during the search, and are updated by the B<"
+"%mandb%> program. Depending on your installation, this may be run by a "
"periodic cron job, or may need to be run manually after new manual pages "
"have been installed. To produce an old style text B<whatis> database from "
"the relative B<index> database, issue the command:"
@@ -3166,8 +3167,8 @@ msgstr ""
"Wiersze tej postaci wskazują, które ścieżki man powinny być traktowane jako "
"systemowe, i opcjonalnie, gdzie powinny być składowane ich pliki cat. Ten "
"typ pola jest szczególnie ważny, gdy B<man> jest programem setuid, gdyż "
-"(jeżeli jest umieszczony w systemowym pliku konfiguracyjnym %"
-"manpath_config_file%, a nie w pliku konfiguracyjnym użytkownika .manpath) "
+"(jeżeli jest umieszczony w systemowym pliku konfiguracyjnym "
+"%manpath_config_file%, a nie w pliku konfiguracyjnym użytkownika .manpath) "
"mówi, do których hierarchii (katalogów) stron man należy sięgać jako "
"użytkownik setuid, a do których jako użytkownik wywołujący program."
@@ -3500,8 +3501,8 @@ msgstr ""
"(drzewami katalogów) są te, które określono jako systemowe w pliku "
"konfiguracyjnym man-db. Domyślne sekcje określa albo podzielona dwukropkami "
"zawartość zmiennej środowiska $B<MANSECT>, albo zestaw standardowy "
-"wkompilowany w B<man>, jeżeli $B<MANSECT> jest niezdefiniowana. Wywołanie B<%"
-"catman%> z zestawem rozdzielonych białymi znakami nazw sekcji nadpisuje "
+"wkompilowany w B<man>, jeżeli $B<MANSECT> jest niezdefiniowana. Wywołanie B<"
+"%catman%> z zestawem rozdzielonych białymi znakami nazw sekcji nadpisuje "
"powyższe ustawienia domyślne."
#
diff --git a/man/po4a/po/ru.po b/man/po4a/po/ru.po
index 80b3b389..ffb79e78 100644
--- a/man/po4a/po/ru.po
+++ b/man/po4a/po/ru.po
@@ -12,12 +12,13 @@ msgstr ""
"PO-Revision-Date: 2010-05-10 10:32+0400\n"
"Last-Translator: Yuri Kozlov <yuray@komyakino.ru>\n"
"Language-Team: Russian <gnu@mx.ru>\n"
+"Language: ru\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
"X-Generator: KBabel 1.11.4\n"
-"Plural-Forms: nplurals=3; plural=(n%10==1 && n%100!=11 ? 0 : n%10>=2 && n%"
-"10<=4 && (n%100<10 || n%100>=20) ? 1 : 2);\n"
+"Plural-Forms: nplurals=3; plural=(n%10==1 && n%100!=11 ? 0 : n%10>=2 && n"
+"%10<=4 && (n%100<10 || n%100>=20) ? 1 : 2);\n"
#. type: TH
#: ../../man/man1/apropos.man1:12
@@ -146,8 +147,8 @@ msgid ""
"Depending on your installation, this may be run by a periodic cron job, or "
"may need to be run manually after new manual pages have been installed."
msgstr ""
-"Используемая B<%apropos%> поисковая база данных обновляется программой B<%"
-"mandb%>. В зависимости от установки, она может запускаться как периодически "
+"Используемая B<%apropos%> поисковая база данных обновляется программой B<"
+"%mandb%>. В зависимости от установки, она может запускаться как периодически "
"выполняемое задание cron или вручную, после установки новых справочных "
"страниц."
@@ -459,8 +460,8 @@ msgstr ""
#. type: Plain text
#: ../../man/man1/apropos.man1:236
msgid ""
-"If $B<POSIXLY_CORRECT> is set, even to a null value, the default B<%apropos%"
-"> search will be as an extended regex (B<-r>). Nowadays, this is the "
+"If $B<POSIXLY_CORRECT> is set, even to a null value, the default B<%apropos"
+"%> search will be as an extended regex (B<-r>). Nowadays, this is the "
"default behaviour anyway."
msgstr ""
"Если установлена переменная окружения $B<POSIXLY_CORRECT>, даже имеющая "
@@ -702,12 +703,12 @@ msgstr ""
#. type: Plain text
#: ../../man/man1/lexgrog.man1:142
msgid ""
-"Some manual pagers require the \\(oq\\e-\\(cq to be exactly as shown; B<%"
-"mandb%> is more tolerant, but for compatibility with other systems it is "
+"Some manual pagers require the \\(oq\\e-\\(cq to be exactly as shown; B<"
+"%mandb%> is more tolerant, but for compatibility with other systems it is "
"nevertheless a good idea to retain the backslash."
msgstr ""
-"Некоторые справочные пейджеры требуют \\(oq\\e-\\(cq точно как показано; B<%"
-"mandb%> более терпим, но для совместимости с другими системами всё же лучше "
+"Некоторые справочные пейджеры требуют \\(oq\\e-\\(cq точно как показано; B<"
+"%mandb%> более терпим, но для совместимости с другими системами всё же лучше "
"оставлять символ обратной косой черты."
#. type: Plain text
@@ -845,8 +846,8 @@ msgid ""
"\\|] [\\|B<-7>\\|] [\\|B<-E> I<encoding>\\|] [\\|B<--no-hyphenation>\\|] [\\|"
"B<--no-justification>\\|] [\\|B<-p> I<string>\\|] [\\|B<-t>\\|] [\\|B<-T>\\|"
"[\\|I<device>\\|]\\|] [\\|B<-H>\\|[\\|I<browser>\\|]\\|] [\\|B<-X>\\|[\\|"
-"I<dpi>\\|]\\|] [\\|B<-Z>\\|] [\\|[\\|I<section>\\|] I<page>\\ .\\|.\\|.\\|]"
-"\\ .\\|.\\|."
+"I<dpi>\\|]\\|] [\\|B<-Z>\\|] [\\|[\\|I<section>\\|] I<page>\\ .\\|.\\|."
+"\\|]\\ .\\|.\\|."
msgstr ""
"B<%man%> [\\|B<-C> I<файл>\\|] [\\|B<-d>\\|] [\\|B<-D>\\|] [\\|B<--warnings>"
"\\|[\\|=I<предупреждения>\\|]\\|] [\\|B<-R> I<кодировка>\\|] [\\|B<-L> "
@@ -934,8 +935,8 @@ msgstr "B<%man%> [\\|B<-hV>\\|]"
#. type: Plain text
#: ../../man/man1/man.man1:174
msgid ""
-"B<%man%> is the system's manual pager. Each I<page> argument given to B<%man%"
-"> is normally the name of a program, utility or function. The I<manual "
+"B<%man%> is the system's manual pager. Each I<page> argument given to B<%man"
+"%> is normally the name of a program, utility or function. The I<manual "
"page> associated with each of these arguments is then found and displayed. A "
"I<section>, if provided, will direct B<%man%> to look only in that "
"I<section> of the manual. The default action is to search in all of the "
@@ -1204,8 +1205,8 @@ msgstr "B<%man%\\ -k>I<\\ printf>"
#: ../../man/man1/man.man1:299
msgid ""
"Search the short descriptions and manual page names for the keyword "
-"I<printf> as regular expression. Print out any matches. Equivalent to B<%"
-"apropos%\\ -r>I<\\ printf>B<.>"
+"I<printf> as regular expression. Print out any matches. Equivalent to B<"
+"%apropos%\\ -r>I<\\ printf>B<.>"
msgstr ""
"Искать в кратких описаниях и именах справочных страниц ключевое слово "
"I<printf>, рассматриваемое как регулярное выражение. Показать любые "
@@ -1305,8 +1306,8 @@ msgstr ""
"Если B<%man%> не может найти B<%mandb%> для первоначального создания базы "
"данных B<index> под определённую иерархию справочных страниц, то она "
"попытается выполнить поиск запрашиваемых справочных страниц, хотя для этого "
-"потребуются универсальные имена файлов для поиска внутри иерархии. Если B<%"
-"whatis%> или B<%apropos%> не удастся найти B<index>, то они попробуют "
+"потребуются универсальные имена файлов для поиска внутри иерархии. Если B<"
+"%whatis%> или B<%apropos%> не удастся найти B<index>, то они попробуют "
"извлечь информацию из традиционной текстовой базы данных I<whatis>."
#. type: Plain text
@@ -1412,8 +1413,8 @@ msgid ""
"However, the cache consistency check can be slow on systems with many manual "
"pages installed, so it is not performed by default, and system "
"administrators may wish to run B<%mandb%> every week or so to keep the "
-"database caches fresh. To forestall problems caused by outdated caches, B<%"
-"man%> will fall back to file globbing if a cache lookup fails, just as it "
+"database caches fresh. To forestall problems caused by outdated caches, B<"
+"%man%> will fall back to file globbing if a cache lookup fails, just as it "
"would if no cache was present."
msgstr ""
"B<%man%> ищет требуемые справочные страницы в кэшах базы данных I<index>. "
@@ -1423,8 +1424,8 @@ msgstr ""
"запускать B<%mandb%> после первоначального создания кэша, пока кэш не "
"повредится. Однако проверка целостности кэша может работать медленно на "
"машинах с большим количеством установленных справочных страниц, поэтому она "
-"не выполняется по умолчанию, и системным администраторам лучше запускать B<%"
-"mandb%> раз в неделю, чтобы поддерживать кэши базы данных в актуальном "
+"не выполняется по умолчанию, и системным администраторам лучше запускать B<"
+"%mandb%> раз в неделю, чтобы поддерживать кэши базы данных в актуальном "
"состоянии. Чтобы предотвратить проблемы из-за устаревших кэшей, B<%man%> "
"выполняет поиск файлов по имени, если в кэше ничего не нашлось ( как если бы "
"кэша не было)."
@@ -1591,8 +1592,8 @@ msgid ""
"keywords and display any matches. See B<%apropos%>(1) for details."
msgstr ""
"Эквивалентно работе B<%apropos%>. Ищет в кратких описаниях справочных "
-"страниц ключевые слова и показывает любые совпадения. Подробней смотрите B<%"
-"apropos%>(1)."
+"страниц ключевые слова и показывает любые совпадения. Подробней смотрите B<"
+"%apropos%>(1)."
#. type: Plain text
#: ../../man/man1/man.man1:580
@@ -1657,8 +1658,8 @@ msgstr ""
#. type: Plain text
#: ../../man/man1/man.man1:610
msgid ""
-"This option is not for general use and should only be used by the B<%catman%"
-"> program."
+"This option is not for general use and should only be used by the B<%catman"
+"%> program."
msgstr ""
"Этот параметр не для обычного использования, и должен использоваться только "
"программой B<%catman%>."
@@ -2278,10 +2279,10 @@ msgid ""
"respectively."
msgstr ""
"С этим параметром вывод B<groff> осуществляет в графическое окно с помощью "
-"программы B<gxditview>. Значениями I<dpi> (точек на дюйм) могут быть 75, 75-"
-"12, 100 или 100-12; по умолчанию 75; в вариантах с -12 в конце используется "
-"базовый шрифт в 12 точек. Этот параметр подразумевает B<-T> со значениями "
-"устройств X75, X75-12, X100 и X100-12 соответственно."
+"программы B<gxditview>. Значениями I<dpi> (точек на дюйм) могут быть 75, "
+"75-12, 100 или 100-12; по умолчанию 75; в вариантах с -12 в конце "
+"используется базовый шрифт в 12 точек. Этот параметр подразумевает B<-T> со "
+"значениями устройств X75, X75-12, X100 и X100-12 соответственно."
#. type: Plain text
#: ../../man/man1/man.man1:1111
@@ -2389,8 +2390,8 @@ msgid ""
"If $B<BROWSER> is set, its value is a colon-delimited list of commands, each "
"of which in turn is used to try to start a web browser for B<man> B<--"
"html>. In each command, I<%s> is replaced by a filename containing the HTML "
-"output from B<groff>, I<%%> is replaced by a single percent sign (%), and I<%"
-"c> is replaced by a colon (:)."
+"output from B<groff>, I<%%> is replaced by a single percent sign (%), and I<"
+"%c> is replaced by a colon (:)."
msgstr ""
"Если установлена переменная окружения $B<BROWSER>, то её значение "
"представляет собой список команд, разделяемых двоеточием; каждая из них "
@@ -2450,8 +2451,8 @@ msgstr ""
"символы форматирования отбрасываются для облегчения чтения результата не "
"имея специальных инструментов. Однако, если переменная окружения "
"$B<MAN_KEEP_FORMATTING> установлена в непустое значение, то символы "
-"форматирования остаются. Это может быть полезно для оболочек вокруг B<%man%"
-">, которые распознают символы форматирования."
+"форматирования остаются. Это может быть полезно для оболочек вокруг B<%man"
+"%>, которые распознают символы форматирования."
#. type: Plain text
#: ../../man/man1/man.man1:1280
@@ -2479,8 +2480,8 @@ msgstr ""
#: ../../man/man1/man.man1:1292
msgid ""
"Depending on system and implementation, either or both of $B<LANG> and "
-"$B<LC_MESSAGES> will be interrogated for the current message locale. B<%man%"
-"> will display its messages in that locale (if available). See B<setlocale>"
+"$B<LC_MESSAGES> will be interrogated for the current message locale. B<%man"
+"%> will display its messages in that locale (if available). See B<setlocale>"
"(3) for precise details."
msgstr ""
"В зависимости от системы и реализации, одна или обе переменные $B<LANG> и "
@@ -2503,13 +2504,13 @@ msgstr "Глобальная иерархия справочных страни
#: ../../man/man1/man.man1:1328
msgid ""
"B<%mandb%>(8), B<%manpath%>(1), B<manpath>(5), B<%apropos%>(1), B<%whatis%>"
-"(1), B<%catman%>(8), B<less>(1), B<nroff>(1), B<troff>(1), B<groff>(1), B<%"
-"zsoelim%>(1), B<setlocale>(3), B<man>(7), B<ascii>(7), B<latin1>(7), the man-"
-"db package manual, B<FSSTND>."
+"(1), B<%catman%>(8), B<less>(1), B<nroff>(1), B<troff>(1), B<groff>(1), B<"
+"%zsoelim%>(1), B<setlocale>(3), B<man>(7), B<ascii>(7), B<latin1>(7), the "
+"man-db package manual, B<FSSTND>."
msgstr ""
"B<%mandb%>(8), B<%manpath%>(1), B<manpath>(5), B<%apropos%>(1), B<%whatis%>"
-"(1), B<%catman%>(8), B<less>(1), B<nroff>(1), B<troff>(1), B<groff>(1), B<%"
-"zsoelim%>(1), B<setlocale>(3), B<man>(7), B<ascii>(7), B<latin1>(7), "
+"(1), B<%catman%>(8), B<less>(1), B<nroff>(1), B<troff>(1), B<groff>(1), B<"
+"%zsoelim%>(1), B<setlocale>(3), B<man>(7), B<ascii>(7), B<latin1>(7), "
"справочные страницы по пакету man-db, B<FSSTND>."
#. type: SH
@@ -2665,8 +2666,8 @@ msgid ""
"B<%manpath%> [\\|B<-qgdchV>\\|] [\\|B<-m> I<system>\\|[\\|,.\\|.\\|.\\|]\\|] "
"[\\|B<-C> I<file>\\|]"
msgstr ""
-"B<%manpath%> [\\|B<-qgdchV>\\|] [\\|B<-m> I<система>\\|[\\|,.\\|.\\|.\\|]"
-"\\|] [\\|B<-C> I<файл>\\|]"
+"B<%manpath%> [\\|B<-qgdchV>\\|] [\\|B<-m> I<система>\\|[\\|,.\\|.\\|."
+"\\|]\\|] [\\|B<-C> I<файл>\\|]"
#. type: Plain text
#: ../../man/man1/manpath.man1:32
@@ -2785,9 +2786,9 @@ msgid ""
msgstr ""
"B<%whatis%> [\\|B<-dlhvV>\\|] [\\|B<-r>\\||\\|B<-w>\\|] [\\|B<-s> I<раздел>"
"\\|] [\\|B<-m> I<система>\\|[\\|,.\\|.\\|.\\|]\\|] [\\|B<-M> I<путь>\\|] [\\|"
-"B<-L> I<локаль>\\|] [\\|B<-C> I<файл>\\|] I<название> \\&.\\|.\\|. B<%whatis%"
-"> [\\|B<-dlhvV>\\|] [\\|B<-r>\\||\\|B<-w>\\|] [\\|B<-s> I<раздел>\\|] [\\|B<-"
-"m> I<система>\\|[\\|,.\\|.\\|.\\|]\\|] [\\|B<-M> I<путь>\\|] [\\|B<-L> "
+"B<-L> I<локаль>\\|] [\\|B<-C> I<файл>\\|] I<название> \\&.\\|.\\|. B<%whatis"
+"%> [\\|B<-dlhvV>\\|] [\\|B<-r>\\||\\|B<-w>\\|] [\\|B<-s> I<раздел>\\|] [\\|"
+"B<-m> I<система>\\|[\\|,.\\|.\\|.\\|]\\|] [\\|B<-M> I<путь>\\|] [\\|B<-L> "
"I<локаль>\\|] [\\|B<-C> I<файл>\\|] I<название> \\&.\\|.\\|."
#. type: Plain text
@@ -2817,8 +2818,8 @@ msgstr ""
#. type: Plain text
#: ../../man/man1/whatis.man1:61
msgid ""
-"B<index> databases are used during the search, and are updated by the B<%"
-"mandb%> program. Depending on your installation, this may be run by a "
+"B<index> databases are used during the search, and are updated by the B<"
+"%mandb%> program. Depending on your installation, this may be run by a "
"periodic cron job, or may need to be run manually after new manual pages "
"have been installed. To produce an old style text B<whatis> database from "
"the relative B<index> database, issue the command:"
@@ -2998,8 +2999,8 @@ msgid ""
"If the environment variable $B<MANPATH> is already set, the information "
"contained within %manpath_config_file% will not override it."
msgstr ""
-"Если установлена переменная окружения $B<MANPATH>, то информация из %"
-"manpath_config_file% использоваться не будет."
+"Если установлена переменная окружения $B<MANPATH>, то информация из "
+"%manpath_config_file% использоваться не будет."
#. type: SH
#: ../../man/man5/manpath.man5:26
@@ -3398,9 +3399,9 @@ msgstr ""
"которые должны быть отформатированы заранее. Иерархиями по умолчанию "
"считаются системные иерархии, указанные в файле настроек man-db, а разделы "
"по умолчанию берутся из значения переменной окружения $B<MANSECT> (список "
-"значений через двоеточие) или из значения, заданного при компиляции B<%man%"
-">, если переменная окружения $B<MANSECT> не установлена. При указании B<%"
-"catman%> списка имён разделов через пробельный символ, он заменит оба эти "
+"значений через двоеточие) или из значения, заданного при компиляции B<%man"
+"%>, если переменная окружения $B<MANSECT> не установлена. При указании B<"
+"%catman%> списка имён разделов через пробельный символ, он заменит оба эти "
"значения по умолчанию."
#. type: Plain text
@@ -3552,8 +3553,8 @@ msgid ""
msgstr ""
"Типы баз данных, которые поддерживают асинхронные обновления, предоставляют "
"лучшее отношение скорости к возможности повреждения в случае неожиданного "
-"прерывания работы. Если это происходит, может потребоваться перезапустить B<%"
-"mandb%> с параметром B<-c>, чтобы пересоздать базы данных с нуля."
+"прерывания работы. Если это происходит, может потребоваться перезапустить B<"
+"%mandb%> с параметром B<-c>, чтобы пересоздать базы данных с нуля."
#. type: Plain text
#: ../../man/man8/mandb.man8:82
diff --git a/man/ru/Makefile.in b/man/ru/Makefile.in
index f19b249e..909fb0b8 100644
--- a/man/ru/Makefile.in
+++ b/man/ru/Makefile.in
@@ -48,6 +48,7 @@ am__aclocal_m4_deps = $(top_srcdir)/m4/man-bdb.m4 \
$(top_srcdir)/gnulib/m4/00gnulib.m4 \
$(top_srcdir)/gnulib/m4/alloca.m4 \
$(top_srcdir)/gnulib/m4/argp.m4 \
+ $(top_srcdir)/gnulib/m4/asm-underscore.m4 \
$(top_srcdir)/gnulib/m4/atexit.m4 \
$(top_srcdir)/gnulib/m4/btowc.m4 \
$(top_srcdir)/gnulib/m4/canonicalize.m4 \
@@ -257,6 +258,7 @@ ALLOCA_H = @ALLOCA_H@
AMTAR = @AMTAR@
AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@
APPLE_UNIVERSAL_BUILD = @APPLE_UNIVERSAL_BUILD@
+ASM_SYMBOL_PREFIX = @ASM_SYMBOL_PREFIX@
AUTOCONF = @AUTOCONF@
AUTOHEADER = @AUTOHEADER@
AUTOMAKE = @AUTOMAKE@
@@ -420,6 +422,7 @@ GNULIB_PUTC = @GNULIB_PUTC@
GNULIB_PUTCHAR = @GNULIB_PUTCHAR@
GNULIB_PUTENV = @GNULIB_PUTENV@
GNULIB_PUTS = @GNULIB_PUTS@
+GNULIB_PWRITE = @GNULIB_PWRITE@
GNULIB_RANDOM_R = @GNULIB_RANDOM_R@
GNULIB_RAWMEMCHR = @GNULIB_RAWMEMCHR@
GNULIB_READLINK = @GNULIB_READLINK@
@@ -587,6 +590,7 @@ HAVE_MKOSTEMPS = @HAVE_MKOSTEMPS@
HAVE_MKSTEMP = @HAVE_MKSTEMP@
HAVE_MKSTEMPS = @HAVE_MKSTEMPS@
HAVE_NANOSLEEP = @HAVE_NANOSLEEP@
+HAVE_NEWLOCALE = @HAVE_NEWLOCALE@
HAVE_NL_LANGINFO = @HAVE_NL_LANGINFO@
HAVE_OPENAT = @HAVE_OPENAT@
HAVE_OS_H = @HAVE_OS_H@
@@ -595,6 +599,7 @@ HAVE_POSIX_PRINTF = @HAVE_POSIX_PRINTF@
HAVE_POSIX_SIGNALBLOCKING = @HAVE_POSIX_SIGNALBLOCKING@
HAVE_PREAD = @HAVE_PREAD@
HAVE_PTSNAME = @HAVE_PTSNAME@
+HAVE_PWRITE = @HAVE_PWRITE@
HAVE_RANDOM_H = @HAVE_RANDOM_H@
HAVE_RANDOM_R = @HAVE_RANDOM_R@
HAVE_RAWMEMCHR = @HAVE_RAWMEMCHR@
@@ -680,6 +685,7 @@ INSTOBJEXT = @INSTOBJEXT@
INTLBISON = @INTLBISON@
INTLLIBS = @INTLLIBS@
INTLOBJS = @INTLOBJS@
+INTL_DEFAULT_VERBOSITY = @INTL_DEFAULT_VERBOSITY@
INTL_LIBTOOL_SUFFIX_PREFIX = @INTL_LIBTOOL_SUFFIX_PREFIX@
INTL_MACOSX_LIBS = @INTL_MACOSX_LIBS@
LDFLAGS = @LDFLAGS@
@@ -777,6 +783,7 @@ PO4A = @PO4A@
POSUB = @POSUB@
PRAGMA_SYSTEM_HEADER = @PRAGMA_SYSTEM_HEADER@
PRI_MACROS_BROKEN = @PRI_MACROS_BROKEN@
+PTHREAD_H_DEFINES_STRUCT_TIMESPEC = @PTHREAD_H_DEFINES_STRUCT_TIMESPEC@
PTRDIFF_T_SUFFIX = @PTRDIFF_T_SUFFIX@
RANLIB = @RANLIB@
REPLACE_BTOWC = @REPLACE_BTOWC@
@@ -841,6 +848,7 @@ REPLACE_POPEN = @REPLACE_POPEN@
REPLACE_PREAD = @REPLACE_PREAD@
REPLACE_PRINTF = @REPLACE_PRINTF@
REPLACE_PUTENV = @REPLACE_PUTENV@
+REPLACE_PWRITE = @REPLACE_PWRITE@
REPLACE_READLINK = @REPLACE_READLINK@
REPLACE_REALPATH = @REPLACE_REALPATH@
REPLACE_REMOVE = @REPLACE_REMOVE@
@@ -860,6 +868,7 @@ REPLACE_STRDUP = @REPLACE_STRDUP@
REPLACE_STRERROR = @REPLACE_STRERROR@
REPLACE_STRNCAT = @REPLACE_STRNCAT@
REPLACE_STRNDUP = @REPLACE_STRNDUP@
+REPLACE_STRNLEN = @REPLACE_STRNLEN@
REPLACE_STRSIGNAL = @REPLACE_STRSIGNAL@
REPLACE_STRSTR = @REPLACE_STRSTR@
REPLACE_STRTOD = @REPLACE_STRTOD@
@@ -867,6 +876,7 @@ REPLACE_STRTOK_R = @REPLACE_STRTOK_R@
REPLACE_SYMLINK = @REPLACE_SYMLINK@
REPLACE_TIMEGM = @REPLACE_TIMEGM@
REPLACE_TMPFILE = @REPLACE_TMPFILE@
+REPLACE_TTYNAME_R = @REPLACE_TTYNAME_R@
REPLACE_UNLINK = @REPLACE_UNLINK@
REPLACE_UNLINKAT = @REPLACE_UNLINKAT@
REPLACE_UNSETENV = @REPLACE_UNSETENV@
diff --git a/manual/Makefile.in b/manual/Makefile.in
index 5501c440..7683f45d 100644
--- a/manual/Makefile.in
+++ b/manual/Makefile.in
@@ -49,6 +49,7 @@ am__aclocal_m4_deps = $(top_srcdir)/m4/man-bdb.m4 \
$(top_srcdir)/gnulib/m4/00gnulib.m4 \
$(top_srcdir)/gnulib/m4/alloca.m4 \
$(top_srcdir)/gnulib/m4/argp.m4 \
+ $(top_srcdir)/gnulib/m4/asm-underscore.m4 \
$(top_srcdir)/gnulib/m4/atexit.m4 \
$(top_srcdir)/gnulib/m4/btowc.m4 \
$(top_srcdir)/gnulib/m4/canonicalize.m4 \
@@ -229,6 +230,7 @@ ALLOCA_H = @ALLOCA_H@
AMTAR = @AMTAR@
AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@
APPLE_UNIVERSAL_BUILD = @APPLE_UNIVERSAL_BUILD@
+ASM_SYMBOL_PREFIX = @ASM_SYMBOL_PREFIX@
AUTOCONF = @AUTOCONF@
AUTOHEADER = @AUTOHEADER@
AUTOMAKE = @AUTOMAKE@
@@ -392,6 +394,7 @@ GNULIB_PUTC = @GNULIB_PUTC@
GNULIB_PUTCHAR = @GNULIB_PUTCHAR@
GNULIB_PUTENV = @GNULIB_PUTENV@
GNULIB_PUTS = @GNULIB_PUTS@
+GNULIB_PWRITE = @GNULIB_PWRITE@
GNULIB_RANDOM_R = @GNULIB_RANDOM_R@
GNULIB_RAWMEMCHR = @GNULIB_RAWMEMCHR@
GNULIB_READLINK = @GNULIB_READLINK@
@@ -559,6 +562,7 @@ HAVE_MKOSTEMPS = @HAVE_MKOSTEMPS@
HAVE_MKSTEMP = @HAVE_MKSTEMP@
HAVE_MKSTEMPS = @HAVE_MKSTEMPS@
HAVE_NANOSLEEP = @HAVE_NANOSLEEP@
+HAVE_NEWLOCALE = @HAVE_NEWLOCALE@
HAVE_NL_LANGINFO = @HAVE_NL_LANGINFO@
HAVE_OPENAT = @HAVE_OPENAT@
HAVE_OS_H = @HAVE_OS_H@
@@ -567,6 +571,7 @@ HAVE_POSIX_PRINTF = @HAVE_POSIX_PRINTF@
HAVE_POSIX_SIGNALBLOCKING = @HAVE_POSIX_SIGNALBLOCKING@
HAVE_PREAD = @HAVE_PREAD@
HAVE_PTSNAME = @HAVE_PTSNAME@
+HAVE_PWRITE = @HAVE_PWRITE@
HAVE_RANDOM_H = @HAVE_RANDOM_H@
HAVE_RANDOM_R = @HAVE_RANDOM_R@
HAVE_RAWMEMCHR = @HAVE_RAWMEMCHR@
@@ -652,6 +657,7 @@ INSTOBJEXT = @INSTOBJEXT@
INTLBISON = @INTLBISON@
INTLLIBS = @INTLLIBS@
INTLOBJS = @INTLOBJS@
+INTL_DEFAULT_VERBOSITY = @INTL_DEFAULT_VERBOSITY@
INTL_LIBTOOL_SUFFIX_PREFIX = @INTL_LIBTOOL_SUFFIX_PREFIX@
INTL_MACOSX_LIBS = @INTL_MACOSX_LIBS@
LDFLAGS = @LDFLAGS@
@@ -749,6 +755,7 @@ PO4A = @PO4A@
POSUB = @POSUB@
PRAGMA_SYSTEM_HEADER = @PRAGMA_SYSTEM_HEADER@
PRI_MACROS_BROKEN = @PRI_MACROS_BROKEN@
+PTHREAD_H_DEFINES_STRUCT_TIMESPEC = @PTHREAD_H_DEFINES_STRUCT_TIMESPEC@
PTRDIFF_T_SUFFIX = @PTRDIFF_T_SUFFIX@
RANLIB = @RANLIB@
REPLACE_BTOWC = @REPLACE_BTOWC@
@@ -813,6 +820,7 @@ REPLACE_POPEN = @REPLACE_POPEN@
REPLACE_PREAD = @REPLACE_PREAD@
REPLACE_PRINTF = @REPLACE_PRINTF@
REPLACE_PUTENV = @REPLACE_PUTENV@
+REPLACE_PWRITE = @REPLACE_PWRITE@
REPLACE_READLINK = @REPLACE_READLINK@
REPLACE_REALPATH = @REPLACE_REALPATH@
REPLACE_REMOVE = @REPLACE_REMOVE@
@@ -832,6 +840,7 @@ REPLACE_STRDUP = @REPLACE_STRDUP@
REPLACE_STRERROR = @REPLACE_STRERROR@
REPLACE_STRNCAT = @REPLACE_STRNCAT@
REPLACE_STRNDUP = @REPLACE_STRNDUP@
+REPLACE_STRNLEN = @REPLACE_STRNLEN@
REPLACE_STRSIGNAL = @REPLACE_STRSIGNAL@
REPLACE_STRSTR = @REPLACE_STRSTR@
REPLACE_STRTOD = @REPLACE_STRTOD@
@@ -839,6 +848,7 @@ REPLACE_STRTOK_R = @REPLACE_STRTOK_R@
REPLACE_SYMLINK = @REPLACE_SYMLINK@
REPLACE_TIMEGM = @REPLACE_TIMEGM@
REPLACE_TMPFILE = @REPLACE_TMPFILE@
+REPLACE_TTYNAME_R = @REPLACE_TTYNAME_R@
REPLACE_UNLINK = @REPLACE_UNLINK@
REPLACE_UNLINKAT = @REPLACE_UNLINKAT@
REPLACE_UNSETENV = @REPLACE_UNSETENV@
diff --git a/po/Makefile.in.in b/po/Makefile.in.in
index fecf500f..83d8838a 100644
--- a/po/Makefile.in.in
+++ b/po/Makefile.in.in
@@ -1,5 +1,5 @@
# Makefile for PO directory in any package using GNU gettext.
-# Copyright (C) 1995-1997, 2000-2007 by Ulrich Drepper <drepper@gnu.ai.mit.edu>
+# Copyright (C) 1995-1997, 2000-2007, 2009-2010 by Ulrich Drepper <drepper@gnu.ai.mit.edu>
#
# This file can be copied and used freely without restrictions. It can
# be used in projects which are not available under the GNU General Public
@@ -8,8 +8,8 @@
# Please note that the actual code of GNU gettext is covered by the GNU
# General Public License and is *not* in the public domain.
#
-# Origin: gettext-0.17
-GETTEXT_MACRO_VERSION = 0.17
+# Origin: gettext-0.18
+GETTEXT_MACRO_VERSION = 0.18
PACKAGE = @PACKAGE@
VERSION = @VERSION@
@@ -88,8 +88,8 @@ CATALOGS = @CATALOGS@
.po.gmo:
@lang=`echo $* | sed -e 's,.*/,,'`; \
test "$(srcdir)" = . && cdcmd="" || cdcmd="cd $(srcdir) && "; \
- echo "$${cdcmd}rm -f $${lang}.gmo && $(GMSGFMT) -c --statistics -o $${lang}.gmo $${lang}.po"; \
- cd $(srcdir) && rm -f $${lang}.gmo && $(GMSGFMT) -c --statistics -o t-$${lang}.gmo $${lang}.po && mv t-$${lang}.gmo $${lang}.gmo
+ echo "$${cdcmd}rm -f $${lang}.gmo && $(GMSGFMT) -c --statistics --verbose -o $${lang}.gmo $${lang}.po"; \
+ cd $(srcdir) && rm -f $${lang}.gmo && $(GMSGFMT) -c --statistics --verbose -o t-$${lang}.gmo $${lang}.po && mv t-$${lang}.gmo $${lang}.gmo
.sin.sed:
sed -e '/^#/d' $< > t-$@
@@ -193,8 +193,15 @@ $(POFILES): $(srcdir)/$(DOMAIN).pot
@lang=`echo $@ | sed -e 's,.*/,,' -e 's/\.po$$//'`; \
if test -f "$(srcdir)/$${lang}.po"; then \
test "$(srcdir)" = . && cdcmd="" || cdcmd="cd $(srcdir) && "; \
- echo "$${cdcmd}$(MSGMERGE_UPDATE) $${lang}.po $(DOMAIN).pot"; \
- cd $(srcdir) && $(MSGMERGE_UPDATE) $${lang}.po $(DOMAIN).pot; \
+ echo "$${cdcmd}$(MSGMERGE_UPDATE) $(MSGMERGE_OPTIONS) --lang=$${lang} $${lang}.po $(DOMAIN).pot"; \
+ cd $(srcdir) \
+ && { case `$(MSGMERGE_UPDATE) --version | sed 1q | sed -e 's,^[^0-9]*,,'` in \
+ '' | 0.[0-9] | 0.[0-9].* | 0.1[0-7] | 0.1[0-7].*) \
+ $(MSGMERGE_UPDATE) $(MSGMERGE_OPTIONS) $${lang}.po $(DOMAIN).pot;; \
+ *) \
+ $(MSGMERGE_UPDATE) $(MSGMERGE_OPTIONS) --lang=$${lang} $${lang}.po $(DOMAIN).pot;; \
+ esac; \
+ }; \
else \
$(MAKE) $${lang}.po-create; \
fi
@@ -217,7 +224,6 @@ install-data: install-data-@USE_NLS@
fi
install-data-no: all
install-data-yes: all
- $(mkdir_p) $(DESTDIR)$(datadir)
@catalogs='$(CATALOGS)'; \
for cat in $$catalogs; do \
cat=`basename $$cat`; \
@@ -269,7 +275,6 @@ installdirs-data: installdirs-data-@USE_NLS@
fi
installdirs-data-no:
installdirs-data-yes:
- $(mkdir_p) $(DESTDIR)$(datadir)
@catalogs='$(CATALOGS)'; \
for cat in $$catalogs; do \
cat=`basename $$cat`; \
@@ -395,9 +400,15 @@ update-po: Makefile
tmpdir=`pwd`; \
echo "$$lang:"; \
test "$(srcdir)" = . && cdcmd="" || cdcmd="cd $(srcdir) && "; \
- echo "$${cdcmd}$(MSGMERGE) $$lang.po $(DOMAIN).pot -o $$lang.new.po"; \
+ echo "$${cdcmd}$(MSGMERGE) $(MSGMERGE_OPTIONS) --lang=$$lang $$lang.po $(DOMAIN).pot -o $$lang.new.po"; \
cd $(srcdir); \
- if $(MSGMERGE) $$lang.po $(DOMAIN).pot -o $$tmpdir/$$lang.new.po; then \
+ if { case `$(MSGMERGE) --version | sed 1q | sed -e 's,^[^0-9]*,,'` in \
+ '' | 0.[0-9] | 0.[0-9].* | 0.1[0-7] | 0.1[0-7].*) \
+ $(MSGMERGE) $(MSGMERGE_OPTIONS) -o $$tmpdir/$$lang.new.po $$lang.po $(DOMAIN).pot;; \
+ *) \
+ $(MSGMERGE) $(MSGMERGE_OPTIONS) --lang=$$lang -o $$tmpdir/$$lang.new.po $$lang.po $(DOMAIN).pot;; \
+ esac; \
+ }; then \
if cmp $$lang.po $$tmpdir/$$lang.new.po >/dev/null 2>&1; then \
rm -f $$tmpdir/$$lang.new.po; \
else \
@@ -418,9 +429,13 @@ $(DUMMYPOFILES):
update-gmo: Makefile $(GMOFILES)
@:
+# Recreate Makefile by invoking config.status. Explicitly invoke the shell,
+# because execution permission bits may not work on the current file system.
+# Use @SHELL@, which is the shell determined by autoconf for the use by its
+# scripts, not $(SHELL) which is hardwired to /bin/sh and may be deficient.
Makefile: Makefile.in.in Makevars $(top_builddir)/config.status @POMAKEFILEDEPS@
cd $(top_builddir) \
- && $(SHELL) ./config.status $(subdir)/$@.in po-directories
+ && @SHELL@ ./config.status $(subdir)/$@.in po-directories
force:
diff --git a/po/Rules-quot b/po/Rules-quot
index 9c2a995e..af524879 100644
--- a/po/Rules-quot
+++ b/po/Rules-quot
@@ -20,7 +20,7 @@ en@boldquot.po-update: en@boldquot.po-update-en
ll=`echo $$lang | sed -e 's/@.*//'`; \
LC_ALL=C; export LC_ALL; \
cd $(srcdir); \
- if $(MSGINIT) -i $(DOMAIN).pot --no-translator -l $$ll -o - 2>/dev/null | sed -f $$tmpdir/$$lang.insert-header | $(MSGCONV) -t UTF-8 | $(MSGFILTER) sed -f `echo $$lang | sed -e 's/.*@//'`.sed 2>/dev/null > $$tmpdir/$$lang.new.po; then \
+ if $(MSGINIT) -i $(DOMAIN).pot --no-translator -l $$lang -o - 2>/dev/null | sed -f $$tmpdir/$$lang.insert-header | $(MSGCONV) -t UTF-8 | $(MSGFILTER) sed -f `echo $$lang | sed -e 's/.*@//'`.sed 2>/dev/null > $$tmpdir/$$lang.new.po; then \
if cmp $$lang.po $$tmpdir/$$lang.new.po >/dev/null 2>&1; then \
rm -f $$tmpdir/$$lang.new.po; \
else \
diff --git a/src/Makefile.in b/src/Makefile.in
index 16db6d75..ded64c88 100644
--- a/src/Makefile.in
+++ b/src/Makefile.in
@@ -54,6 +54,7 @@ am__aclocal_m4_deps = $(top_srcdir)/m4/man-bdb.m4 \
$(top_srcdir)/gnulib/m4/00gnulib.m4 \
$(top_srcdir)/gnulib/m4/alloca.m4 \
$(top_srcdir)/gnulib/m4/argp.m4 \
+ $(top_srcdir)/gnulib/m4/asm-underscore.m4 \
$(top_srcdir)/gnulib/m4/atexit.m4 \
$(top_srcdir)/gnulib/m4/btowc.m4 \
$(top_srcdir)/gnulib/m4/canonicalize.m4 \
@@ -359,6 +360,7 @@ ALLOCA_H = @ALLOCA_H@
AMTAR = @AMTAR@
AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@
APPLE_UNIVERSAL_BUILD = @APPLE_UNIVERSAL_BUILD@
+ASM_SYMBOL_PREFIX = @ASM_SYMBOL_PREFIX@
AUTOCONF = @AUTOCONF@
AUTOHEADER = @AUTOHEADER@
AUTOMAKE = @AUTOMAKE@
@@ -522,6 +524,7 @@ GNULIB_PUTC = @GNULIB_PUTC@
GNULIB_PUTCHAR = @GNULIB_PUTCHAR@
GNULIB_PUTENV = @GNULIB_PUTENV@
GNULIB_PUTS = @GNULIB_PUTS@
+GNULIB_PWRITE = @GNULIB_PWRITE@
GNULIB_RANDOM_R = @GNULIB_RANDOM_R@
GNULIB_RAWMEMCHR = @GNULIB_RAWMEMCHR@
GNULIB_READLINK = @GNULIB_READLINK@
@@ -689,6 +692,7 @@ HAVE_MKOSTEMPS = @HAVE_MKOSTEMPS@
HAVE_MKSTEMP = @HAVE_MKSTEMP@
HAVE_MKSTEMPS = @HAVE_MKSTEMPS@
HAVE_NANOSLEEP = @HAVE_NANOSLEEP@
+HAVE_NEWLOCALE = @HAVE_NEWLOCALE@
HAVE_NL_LANGINFO = @HAVE_NL_LANGINFO@
HAVE_OPENAT = @HAVE_OPENAT@
HAVE_OS_H = @HAVE_OS_H@
@@ -697,6 +701,7 @@ HAVE_POSIX_PRINTF = @HAVE_POSIX_PRINTF@
HAVE_POSIX_SIGNALBLOCKING = @HAVE_POSIX_SIGNALBLOCKING@
HAVE_PREAD = @HAVE_PREAD@
HAVE_PTSNAME = @HAVE_PTSNAME@
+HAVE_PWRITE = @HAVE_PWRITE@
HAVE_RANDOM_H = @HAVE_RANDOM_H@
HAVE_RANDOM_R = @HAVE_RANDOM_R@
HAVE_RAWMEMCHR = @HAVE_RAWMEMCHR@
@@ -782,6 +787,7 @@ INSTOBJEXT = @INSTOBJEXT@
INTLBISON = @INTLBISON@
INTLLIBS = @INTLLIBS@
INTLOBJS = @INTLOBJS@
+INTL_DEFAULT_VERBOSITY = @INTL_DEFAULT_VERBOSITY@
INTL_LIBTOOL_SUFFIX_PREFIX = @INTL_LIBTOOL_SUFFIX_PREFIX@
INTL_MACOSX_LIBS = @INTL_MACOSX_LIBS@
LDFLAGS = @LDFLAGS@
@@ -879,6 +885,7 @@ PO4A = @PO4A@
POSUB = @POSUB@
PRAGMA_SYSTEM_HEADER = @PRAGMA_SYSTEM_HEADER@
PRI_MACROS_BROKEN = @PRI_MACROS_BROKEN@
+PTHREAD_H_DEFINES_STRUCT_TIMESPEC = @PTHREAD_H_DEFINES_STRUCT_TIMESPEC@
PTRDIFF_T_SUFFIX = @PTRDIFF_T_SUFFIX@
RANLIB = @RANLIB@
REPLACE_BTOWC = @REPLACE_BTOWC@
@@ -943,6 +950,7 @@ REPLACE_POPEN = @REPLACE_POPEN@
REPLACE_PREAD = @REPLACE_PREAD@
REPLACE_PRINTF = @REPLACE_PRINTF@
REPLACE_PUTENV = @REPLACE_PUTENV@
+REPLACE_PWRITE = @REPLACE_PWRITE@
REPLACE_READLINK = @REPLACE_READLINK@
REPLACE_REALPATH = @REPLACE_REALPATH@
REPLACE_REMOVE = @REPLACE_REMOVE@
@@ -962,6 +970,7 @@ REPLACE_STRDUP = @REPLACE_STRDUP@
REPLACE_STRERROR = @REPLACE_STRERROR@
REPLACE_STRNCAT = @REPLACE_STRNCAT@
REPLACE_STRNDUP = @REPLACE_STRNDUP@
+REPLACE_STRNLEN = @REPLACE_STRNLEN@
REPLACE_STRSIGNAL = @REPLACE_STRSIGNAL@
REPLACE_STRSTR = @REPLACE_STRSTR@
REPLACE_STRTOD = @REPLACE_STRTOD@
@@ -969,6 +978,7 @@ REPLACE_STRTOK_R = @REPLACE_STRTOK_R@
REPLACE_SYMLINK = @REPLACE_SYMLINK@
REPLACE_TIMEGM = @REPLACE_TIMEGM@
REPLACE_TMPFILE = @REPLACE_TMPFILE@
+REPLACE_TTYNAME_R = @REPLACE_TTYNAME_R@
REPLACE_UNLINK = @REPLACE_UNLINK@
REPLACE_UNLINKAT = @REPLACE_UNLINKAT@
REPLACE_UNSETENV = @REPLACE_UNSETENV@
diff --git a/src/tests/Makefile.in b/src/tests/Makefile.in
index 975bb080..68c8ba20 100644
--- a/src/tests/Makefile.in
+++ b/src/tests/Makefile.in
@@ -48,6 +48,7 @@ am__aclocal_m4_deps = $(top_srcdir)/m4/man-bdb.m4 \
$(top_srcdir)/gnulib/m4/00gnulib.m4 \
$(top_srcdir)/gnulib/m4/alloca.m4 \
$(top_srcdir)/gnulib/m4/argp.m4 \
+ $(top_srcdir)/gnulib/m4/asm-underscore.m4 \
$(top_srcdir)/gnulib/m4/atexit.m4 \
$(top_srcdir)/gnulib/m4/btowc.m4 \
$(top_srcdir)/gnulib/m4/canonicalize.m4 \
@@ -229,6 +230,7 @@ ALLOCA_H = @ALLOCA_H@
AMTAR = @AMTAR@
AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@
APPLE_UNIVERSAL_BUILD = @APPLE_UNIVERSAL_BUILD@
+ASM_SYMBOL_PREFIX = @ASM_SYMBOL_PREFIX@
AUTOCONF = @AUTOCONF@
AUTOHEADER = @AUTOHEADER@
AUTOMAKE = @AUTOMAKE@
@@ -392,6 +394,7 @@ GNULIB_PUTC = @GNULIB_PUTC@
GNULIB_PUTCHAR = @GNULIB_PUTCHAR@
GNULIB_PUTENV = @GNULIB_PUTENV@
GNULIB_PUTS = @GNULIB_PUTS@
+GNULIB_PWRITE = @GNULIB_PWRITE@
GNULIB_RANDOM_R = @GNULIB_RANDOM_R@
GNULIB_RAWMEMCHR = @GNULIB_RAWMEMCHR@
GNULIB_READLINK = @GNULIB_READLINK@
@@ -559,6 +562,7 @@ HAVE_MKOSTEMPS = @HAVE_MKOSTEMPS@
HAVE_MKSTEMP = @HAVE_MKSTEMP@
HAVE_MKSTEMPS = @HAVE_MKSTEMPS@
HAVE_NANOSLEEP = @HAVE_NANOSLEEP@
+HAVE_NEWLOCALE = @HAVE_NEWLOCALE@
HAVE_NL_LANGINFO = @HAVE_NL_LANGINFO@
HAVE_OPENAT = @HAVE_OPENAT@
HAVE_OS_H = @HAVE_OS_H@
@@ -567,6 +571,7 @@ HAVE_POSIX_PRINTF = @HAVE_POSIX_PRINTF@
HAVE_POSIX_SIGNALBLOCKING = @HAVE_POSIX_SIGNALBLOCKING@
HAVE_PREAD = @HAVE_PREAD@
HAVE_PTSNAME = @HAVE_PTSNAME@
+HAVE_PWRITE = @HAVE_PWRITE@
HAVE_RANDOM_H = @HAVE_RANDOM_H@
HAVE_RANDOM_R = @HAVE_RANDOM_R@
HAVE_RAWMEMCHR = @HAVE_RAWMEMCHR@
@@ -652,6 +657,7 @@ INSTOBJEXT = @INSTOBJEXT@
INTLBISON = @INTLBISON@
INTLLIBS = @INTLLIBS@
INTLOBJS = @INTLOBJS@
+INTL_DEFAULT_VERBOSITY = @INTL_DEFAULT_VERBOSITY@
INTL_LIBTOOL_SUFFIX_PREFIX = @INTL_LIBTOOL_SUFFIX_PREFIX@
INTL_MACOSX_LIBS = @INTL_MACOSX_LIBS@
LDFLAGS = @LDFLAGS@
@@ -749,6 +755,7 @@ PO4A = @PO4A@
POSUB = @POSUB@
PRAGMA_SYSTEM_HEADER = @PRAGMA_SYSTEM_HEADER@
PRI_MACROS_BROKEN = @PRI_MACROS_BROKEN@
+PTHREAD_H_DEFINES_STRUCT_TIMESPEC = @PTHREAD_H_DEFINES_STRUCT_TIMESPEC@
PTRDIFF_T_SUFFIX = @PTRDIFF_T_SUFFIX@
RANLIB = @RANLIB@
REPLACE_BTOWC = @REPLACE_BTOWC@
@@ -813,6 +820,7 @@ REPLACE_POPEN = @REPLACE_POPEN@
REPLACE_PREAD = @REPLACE_PREAD@
REPLACE_PRINTF = @REPLACE_PRINTF@
REPLACE_PUTENV = @REPLACE_PUTENV@
+REPLACE_PWRITE = @REPLACE_PWRITE@
REPLACE_READLINK = @REPLACE_READLINK@
REPLACE_REALPATH = @REPLACE_REALPATH@
REPLACE_REMOVE = @REPLACE_REMOVE@
@@ -832,6 +840,7 @@ REPLACE_STRDUP = @REPLACE_STRDUP@
REPLACE_STRERROR = @REPLACE_STRERROR@
REPLACE_STRNCAT = @REPLACE_STRNCAT@
REPLACE_STRNDUP = @REPLACE_STRNDUP@
+REPLACE_STRNLEN = @REPLACE_STRNLEN@
REPLACE_STRSIGNAL = @REPLACE_STRSIGNAL@
REPLACE_STRSTR = @REPLACE_STRSTR@
REPLACE_STRTOD = @REPLACE_STRTOD@
@@ -839,6 +848,7 @@ REPLACE_STRTOK_R = @REPLACE_STRTOK_R@
REPLACE_SYMLINK = @REPLACE_SYMLINK@
REPLACE_TIMEGM = @REPLACE_TIMEGM@
REPLACE_TMPFILE = @REPLACE_TMPFILE@
+REPLACE_TTYNAME_R = @REPLACE_TTYNAME_R@
REPLACE_UNLINK = @REPLACE_UNLINK@
REPLACE_UNLINKAT = @REPLACE_UNLINKAT@
REPLACE_UNSETENV = @REPLACE_UNSETENV@
diff --git a/tools/Makefile.in b/tools/Makefile.in
index 3eb3b497..0d6bc376 100644
--- a/tools/Makefile.in
+++ b/tools/Makefile.in
@@ -52,6 +52,7 @@ am__aclocal_m4_deps = $(top_srcdir)/m4/man-bdb.m4 \
$(top_srcdir)/gnulib/m4/00gnulib.m4 \
$(top_srcdir)/gnulib/m4/alloca.m4 \
$(top_srcdir)/gnulib/m4/argp.m4 \
+ $(top_srcdir)/gnulib/m4/asm-underscore.m4 \
$(top_srcdir)/gnulib/m4/atexit.m4 \
$(top_srcdir)/gnulib/m4/btowc.m4 \
$(top_srcdir)/gnulib/m4/canonicalize.m4 \
@@ -233,6 +234,7 @@ ALLOCA_H = @ALLOCA_H@
AMTAR = @AMTAR@
AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@
APPLE_UNIVERSAL_BUILD = @APPLE_UNIVERSAL_BUILD@
+ASM_SYMBOL_PREFIX = @ASM_SYMBOL_PREFIX@
AUTOCONF = @AUTOCONF@
AUTOHEADER = @AUTOHEADER@
AUTOMAKE = @AUTOMAKE@
@@ -396,6 +398,7 @@ GNULIB_PUTC = @GNULIB_PUTC@
GNULIB_PUTCHAR = @GNULIB_PUTCHAR@
GNULIB_PUTENV = @GNULIB_PUTENV@
GNULIB_PUTS = @GNULIB_PUTS@
+GNULIB_PWRITE = @GNULIB_PWRITE@
GNULIB_RANDOM_R = @GNULIB_RANDOM_R@
GNULIB_RAWMEMCHR = @GNULIB_RAWMEMCHR@
GNULIB_READLINK = @GNULIB_READLINK@
@@ -563,6 +566,7 @@ HAVE_MKOSTEMPS = @HAVE_MKOSTEMPS@
HAVE_MKSTEMP = @HAVE_MKSTEMP@
HAVE_MKSTEMPS = @HAVE_MKSTEMPS@
HAVE_NANOSLEEP = @HAVE_NANOSLEEP@
+HAVE_NEWLOCALE = @HAVE_NEWLOCALE@
HAVE_NL_LANGINFO = @HAVE_NL_LANGINFO@
HAVE_OPENAT = @HAVE_OPENAT@
HAVE_OS_H = @HAVE_OS_H@
@@ -571,6 +575,7 @@ HAVE_POSIX_PRINTF = @HAVE_POSIX_PRINTF@
HAVE_POSIX_SIGNALBLOCKING = @HAVE_POSIX_SIGNALBLOCKING@
HAVE_PREAD = @HAVE_PREAD@
HAVE_PTSNAME = @HAVE_PTSNAME@
+HAVE_PWRITE = @HAVE_PWRITE@
HAVE_RANDOM_H = @HAVE_RANDOM_H@
HAVE_RANDOM_R = @HAVE_RANDOM_R@
HAVE_RAWMEMCHR = @HAVE_RAWMEMCHR@
@@ -656,6 +661,7 @@ INSTOBJEXT = @INSTOBJEXT@
INTLBISON = @INTLBISON@
INTLLIBS = @INTLLIBS@
INTLOBJS = @INTLOBJS@
+INTL_DEFAULT_VERBOSITY = @INTL_DEFAULT_VERBOSITY@
INTL_LIBTOOL_SUFFIX_PREFIX = @INTL_LIBTOOL_SUFFIX_PREFIX@
INTL_MACOSX_LIBS = @INTL_MACOSX_LIBS@
LDFLAGS = @LDFLAGS@
@@ -753,6 +759,7 @@ PO4A = @PO4A@
POSUB = @POSUB@
PRAGMA_SYSTEM_HEADER = @PRAGMA_SYSTEM_HEADER@
PRI_MACROS_BROKEN = @PRI_MACROS_BROKEN@
+PTHREAD_H_DEFINES_STRUCT_TIMESPEC = @PTHREAD_H_DEFINES_STRUCT_TIMESPEC@
PTRDIFF_T_SUFFIX = @PTRDIFF_T_SUFFIX@
RANLIB = @RANLIB@
REPLACE_BTOWC = @REPLACE_BTOWC@
@@ -817,6 +824,7 @@ REPLACE_POPEN = @REPLACE_POPEN@
REPLACE_PREAD = @REPLACE_PREAD@
REPLACE_PRINTF = @REPLACE_PRINTF@
REPLACE_PUTENV = @REPLACE_PUTENV@
+REPLACE_PWRITE = @REPLACE_PWRITE@
REPLACE_READLINK = @REPLACE_READLINK@
REPLACE_REALPATH = @REPLACE_REALPATH@
REPLACE_REMOVE = @REPLACE_REMOVE@
@@ -836,6 +844,7 @@ REPLACE_STRDUP = @REPLACE_STRDUP@
REPLACE_STRERROR = @REPLACE_STRERROR@
REPLACE_STRNCAT = @REPLACE_STRNCAT@
REPLACE_STRNDUP = @REPLACE_STRNDUP@
+REPLACE_STRNLEN = @REPLACE_STRNLEN@
REPLACE_STRSIGNAL = @REPLACE_STRSIGNAL@
REPLACE_STRSTR = @REPLACE_STRSTR@
REPLACE_STRTOD = @REPLACE_STRTOD@
@@ -843,6 +852,7 @@ REPLACE_STRTOK_R = @REPLACE_STRTOK_R@
REPLACE_SYMLINK = @REPLACE_SYMLINK@
REPLACE_TIMEGM = @REPLACE_TIMEGM@
REPLACE_TMPFILE = @REPLACE_TMPFILE@
+REPLACE_TTYNAME_R = @REPLACE_TTYNAME_R@
REPLACE_UNLINK = @REPLACE_UNLINK@
REPLACE_UNLINKAT = @REPLACE_UNLINKAT@
REPLACE_UNSETENV = @REPLACE_UNSETENV@
diff --git a/tools/c++defs.h b/tools/c++defs.h
index 7d710898..0c2fad7a 100644
--- a/tools/c++defs.h
+++ b/tools/c++defs.h
@@ -221,10 +221,20 @@
_GL_CXXALIASWARN_1 (func, GNULIB_NAMESPACE)
# define _GL_CXXALIASWARN_1(func,namespace) \
_GL_CXXALIASWARN_2 (func, namespace)
-# define _GL_CXXALIASWARN_2(func,namespace) \
- _GL_WARN_ON_USE (func, \
- "The symbol ::" #func " refers to the system function. " \
- "Use " #namespace "::" #func " instead.")
+/* To work around GCC bug <http://gcc.gnu.org/bugzilla/show_bug.cgi?id=43881>,
+ we enable the warning only when not optimizing. */
+# if !__OPTIMIZE__
+# define _GL_CXXALIASWARN_2(func,namespace) \
+ _GL_WARN_ON_USE (func, \
+ "The symbol ::" #func " refers to the system function. " \
+ "Use " #namespace "::" #func " instead.")
+# elif __GNUC__ >= 3 && GNULIB_STRICT_CHECKING
+# define _GL_CXXALIASWARN_2(func,namespace) \
+ extern __typeof__ (func) func
+# else
+# define _GL_CXXALIASWARN_2(func,namespace) \
+ _GL_EXTERN_C int _gl_cxxalias_dummy
+# endif
#else
# define _GL_CXXALIASWARN(func) \
_GL_EXTERN_C int _gl_cxxalias_dummy
@@ -239,10 +249,20 @@
GNULIB_NAMESPACE)
# define _GL_CXXALIASWARN1_1(func,rettype,parameters_and_attributes,namespace) \
_GL_CXXALIASWARN1_2 (func, rettype, parameters_and_attributes, namespace)
-# define _GL_CXXALIASWARN1_2(func,rettype,parameters_and_attributes,namespace) \
- _GL_WARN_ON_USE_CXX (func, rettype, parameters_and_attributes, \
- "The symbol ::" #func " refers to the system function. " \
- "Use " #namespace "::" #func " instead.")
+/* To work around GCC bug <http://gcc.gnu.org/bugzilla/show_bug.cgi?id=43881>,
+ we enable the warning only when not optimizing. */
+# if !__OPTIMIZE__
+# define _GL_CXXALIASWARN1_2(func,rettype,parameters_and_attributes,namespace) \
+ _GL_WARN_ON_USE_CXX (func, rettype, parameters_and_attributes, \
+ "The symbol ::" #func " refers to the system function. " \
+ "Use " #namespace "::" #func " instead.")
+# elif __GNUC__ >= 3 && GNULIB_STRICT_CHECKING
+# define _GL_CXXALIASWARN1_2(func,rettype,parameters_and_attributes,namespace) \
+ extern __typeof__ (func) func
+# else
+# define _GL_CXXALIASWARN1_2(func,rettype,parameters_and_attributes,namespace) \
+ _GL_EXTERN_C int _gl_cxxalias_dummy
+# endif
#else
# define _GL_CXXALIASWARN1(func,rettype,parameters_and_attributes) \
_GL_EXTERN_C int _gl_cxxalias_dummy
diff --git a/tools/warn-on-use.h b/tools/warn-on-use.h
index 1cd5062d..171e5991 100644
--- a/tools/warn-on-use.h
+++ b/tools/warn-on-use.h
@@ -67,7 +67,10 @@
/* A compiler attribute is available in gcc versions 4.3.0 and later. */
# define _GL_WARN_ON_USE(function, message) \
extern __typeof__ (function) function __attribute__ ((__warning__ (message)))
-
+# elif __GNUC__ >= 3 && GNULIB_STRICT_CHECKING
+/* Verify the existence of the function. */
+# define _GL_WARN_ON_USE(function, message) \
+extern __typeof__ (function) function
# else /* Unsupported. */
# define _GL_WARN_ON_USE(function, message) \
_GL_WARN_EXTERN_C int _gl_warn_on_use
@@ -85,6 +88,10 @@ _GL_WARN_EXTERN_C int _gl_warn_on_use
# define _GL_WARN_ON_USE_CXX(function,rettype,parameters_and_attributes,msg) \
extern rettype function parameters_and_attributes \
__attribute__ ((__warning__ (msg)))
+# elif __GNUC__ >= 3 && GNULIB_STRICT_CHECKING
+/* Verify the existence of the function. */
+# define _GL_WARN_ON_USE_CXX(function,rettype,parameters_and_attributes,msg) \
+extern rettype function parameters_and_attributes
# else /* Unsupported. */
# define _GL_WARN_ON_USE_CXX(function,rettype,parameters_and_attributes,msg) \
_GL_WARN_EXTERN_C int _gl_warn_on_use