]> git.ipfire.org Git - thirdparty/gettext.git/log
thirdparty/gettext.git
6 years agohtml-ostream: Fix memory leak.
Bruno Haible [Sat, 9 Feb 2019 14:05:36 +0000 (15:05 +0100)] 
html-ostream: Fix memory leak.

* gnulib-local/lib/html-ostream.oo.c: Include minmax.h.
(verify_invariants, shrink_class_stack): New functions.
(emit_pending_spans): Use them.
(html_ostream::write_mem): Shrink class stack during newline processing.
(html_ostream::free, html_ostream::begin_span): Verify invariants.
(html_ostream::end_span): Likewise. Shrink class stack.
* gnulib-local/modules/html-ostream (Depends-on): Add 'minmax'.

6 years agoexamples: Fix build failure when building from git (regression from 2018-10-23).
Bruno Haible [Fri, 8 Feb 2019 21:25:49 +0000 (22:25 +0100)] 
examples: Fix build failure when building from git (regression from 2018-10-23).

* gettext-tools/examples/po/xsmallpot.sh: Build less of 'hello-pascal'.

6 years agocolor: Make color.c package-neutral.
Bruno Haible [Fri, 8 Feb 2019 19:29:07 +0000 (20:29 +0100)] 
color: Make color.c package-neutral.

* gettext-tools/src/color.h (style_file_prepare): Add arguments.
* gettext-tools/src/color.c: Don't include relocatable.h.
(style_file_lookup): Add stylesdir_after_install argument.
(style_file_prepare): Add arguments.
* gettext-tools/src/write-catalog.c: Include relocatable.h.
(GETTEXTSTYLESDIR): New macro.
(msgdomain_list_print): Update style_file_prepare calls.
* gettext-tools/tests/init-env.in (GETTEXTSTYLESDIR): New environment variable.

6 years agoterm-ostream: Accommodate a shell that is not in /bin/sh.
Bruno Haible [Fri, 8 Feb 2019 19:26:35 +0000 (20:26 +0100)] 
term-ostream: Accommodate a shell that is not in /bin/sh.

* gnulib-local/tests/test-term-ostream-xterm.sh: Renamed from
gnulib-local/tests/test-term-ostream-xterm.
* gnulib-local/modules/term-ostream-tests (Files, Makefile.am): Update
accordingly.
* gnulib-local/Makefile.am (EXTRA_DIST): Likewise.

6 years agolibglib: Fix list of files to clean.
Bruno Haible [Fri, 8 Feb 2019 19:25:17 +0000 (20:25 +0100)] 
libglib: Fix list of files to clean.

* gnulib-local/modules/libglib (MOSTLYCLEANFILES): Add glib.h-t, glibconfig.h-t.

6 years agobuild: Code style.
Bruno Haible [Fri, 8 Feb 2019 19:23:43 +0000 (20:23 +0100)] 
build: Code style.

* autogen.sh: Make it clear that 'touch config.h.in' is tied to autoheader.

6 years agoRemove left-over empty directories in 'make distclean'.
Bruno Haible [Tue, 5 Feb 2019 02:28:53 +0000 (03:28 +0100)] 
Remove left-over empty directories in 'make distclean'.

* gettext-tools/gnulib-tests/Makefile.am (distclean-local): New target.

6 years agoFix copyright years.
Bruno Haible [Mon, 4 Feb 2019 19:56:11 +0000 (20:56 +0100)] 
Fix copyright years.

6 years agodoc: Mention --color=test in the description of the --color option.
Bruno Haible [Fri, 25 Jan 2019 19:44:11 +0000 (20:44 +0100)] 
doc: Mention --color=test in the description of the --color option.

Reported by Nathaniel M. Beaver <nathanielmbeaver@gmail.com>
in <https://savannah.gnu.org/bugs/?55573>.

* gettext-tools/doc/gettext.texi (Colorizing): Mention that the --color and
--style options are applicable to many programs.
(The --color option): Mention the 'test' value.

6 years agomsginit: Update for current shape of Translation Project.
Bruno Haible [Mon, 21 Jan 2019 01:58:06 +0000 (02:58 +0100)] 
msginit: Update for current shape of Translation Project.

Reported by Karl Ove Hufthammer <karl@huftis.org>
in <https://lists.gnu.org/archive/html/bug-gettext/2019-01/msg00014.html>.

* gettext-tools/projects/TP/teams.html: Fetched from teams.url.
* gettext-tools/projects/TP/team-address: Update sed expressions for current
structure of teams page.

6 years agoMake cldr-plurals program more robust.
Bruno Haible [Sun, 6 Jan 2019 21:58:31 +0000 (22:58 +0100)] 
Make cldr-plurals program more robust.

* gettext-tools/src/cldr-plurals.c: Include closeout.h.
(main): Arrange to invoke close_stdout at program exit.

6 years agoAssume setlocale function.
Bruno Haible [Sun, 6 Jan 2019 21:55:46 +0000 (22:55 +0100)] 
Assume setlocale function.

* gettext-runtime/src/envsubst.c (main): Assume setlocale exists.
* gettext-runtime/src/gettext.c (main): Likewise.
* gettext-runtime/src/ngettext.c (main): Likewise.
* gettext-tools/src/cldr-plurals.c (main): Likewise.
* gettext-tools/src/hostname.c (main): Likewise.
* gettext-tools/src/msgattrib.c (main): Likewise.
* gettext-tools/src/msgcat.c (main): Likewise.
* gettext-tools/src/msgcmp.c (main): Likewise.
* gettext-tools/src/msgcomm.c (main): Likewise.
* gettext-tools/src/msgconv.c (main): Likewise.
* gettext-tools/src/msgen.c (main): Likewise.
* gettext-tools/src/msgexec.c (main): Likewise.
* gettext-tools/src/msgfilter.c (main): Likewise.
* gettext-tools/src/msgfmt.c (main): Likewise.
* gettext-tools/src/msggrep.c (main): Likewise.
* gettext-tools/src/msginit.c (main, canonical_locale_charset, get_title):
Likewise.
* gettext-tools/src/msgmerge.c (main): Likewise.
* gettext-tools/src/msgunfmt.c (main): Likewise.
* gettext-tools/src/msguniq.c (main): Likewise.
* gettext-tools/src/recode-sr-latin.c (main): Likewise.
* gettext-tools/src/urlget.c (main): Likewise.
* gettext-tools/src/xgettext.c (main): Likewise.
* gettext-tools/tests/testlocale.c (main): Likewise.
* gettext-tools/tests/tstgettext.c (main): Likewise.
* gettext-tools/tests/tstngettext.c (main): Likewise.
* gettext-runtime/m4/intl.m4 (AM_INTL_SUBDIR): Don't test whether setlocale
exists.

6 years agoUpdate after gnulib changed.
Bruno Haible [Sun, 6 Jan 2019 21:40:38 +0000 (22:40 +0100)] 
Update after gnulib changed.

6 years agoUpdate to newest gnulib.
Bruno Haible [Sun, 6 Jan 2019 20:29:58 +0000 (21:29 +0100)] 
Update to newest gnulib.

6 years agoFix compilation error on HP-UX with gcc.
Bruno Haible [Mon, 17 Dec 2018 04:00:49 +0000 (05:00 +0100)] 
Fix compilation error on HP-UX with gcc.

* gnulib-local/lib/libxml/trionan.c: Include <float.h>.

6 years agoAdd comment regarding HP-UX cc in C99 mode.
Bruno Haible [Sun, 16 Dec 2018 09:49:04 +0000 (10:49 +0100)] 
Add comment regarding HP-UX cc in C99 mode.

* gnulib-local/lib/gettext.h (_LIBGETTEXT_HAVE_VARIABLE_SIZE_ARRAYS): Update
comment.

6 years agointl: Really uninstall the intl/ subdir sources.
Bruno Haible [Sun, 25 Nov 2018 18:00:01 +0000 (19:00 +0100)] 
intl: Really uninstall the intl/ subdir sources.

* gettext-runtime/intl/Makefile.am (uninstall-sources): New target.

6 years agoFix compilation error (regression from today).
Bruno Haible [Sun, 25 Nov 2018 02:40:39 +0000 (03:40 +0100)] 
Fix compilation error (regression from today).

* autogen.sh (GNULIB_MODULES_RUNTIME_FOR_SRC): Add 'unistd'.
* gettext-runtime/src/envsubst.c: Include <unistd.h>.

6 years agobuild: Use Automake in intl subdirectory.
Bruno Haible [Sun, 25 Nov 2018 01:12:13 +0000 (02:12 +0100)] 
build: Use Automake in intl subdirectory.

* gettext-runtime/intl/Makefile.am: New file, based on
gettext-runtime/intl/Makefile.in.
* gettext-runtime/intl/Makefile.in: Remove file.
* autogen.sh: Copy gettext-runtime/intl/Makefile.am to
gettext-tools/intl/Makefile.am.
* gettext-runtime/configure.ac (USE_INCLUDED_LIBINTL, BUILD_INCLUDED_LIBINTL,
PACKAGE_IS_GETTEXT_TOOLS, PRELOADABLE_LIBINTL): New conditionals.
* gettext-tools/configure.ac: Likewise.

6 years agobuild: Stop generating a VERSION file.
Bruno Haible [Sun, 25 Nov 2018 01:12:09 +0000 (02:12 +0100)] 
build: Stop generating a VERSION file.

* gettext-tools/configure.ac: Don't create intl/VERSION.
* gettext-runtime/intl/Makefile.in (DISTFILES.normal): Remove variable.
(distclean): Simplify accordingly.

6 years agobuild: Remove some duplicate .m4 files.
Bruno Haible [Sun, 25 Nov 2018 01:12:04 +0000 (02:12 +0100)] 
build: Remove some duplicate .m4 files.

* autogen.sh: Copy wchar_t.m4 and wint_t.m4 for libasprintf.
* gettext-runtime/m4/codeset.m4: Remove file.
* gettext-runtime/m4/extern-inline.m4: Remove file.
* gettext-runtime/m4/intl-thread-locale.m4: Remove file.
* gettext-runtime/m4/lcmessage.m4: Remove file.
* gettext-runtime/m4/lock.m4: Remove file.
* gettext-runtime/m4/longlong.m4: Remove file.
* gettext-runtime/m4/threadlib.m4: Remove file.
* gettext-runtime/m4/wchar_t.m4: Remove file.
* gettext-runtime/m4/wint_t.m4: Remove file.
* gettext-runtime/m4/Makefile.am (EXTRA_DIST): Don't distribute them.
* Makefile.am (distcheck-hook): Don't verify that they are identical copies.

6 years agobuild: Fix #line statements in bison-generated files.
Bruno Haible [Sun, 25 Nov 2018 01:11:23 +0000 (02:11 +0100)] 
build: Fix #line statements in bison-generated files.

* gettext-tools/src/plural-exp.c: Revert changes from 2014-12-03 and 2014-12-04.
* gettext-runtime/intl/Makefile.in (PLURAL_OBJECT): Remove variable.
(OBJECTS): Use plural.lo always.
($(srcdir)/plural.c): New rule.
(.y.c, pluralx.c, pluralx.lo): Remove rules.
(mostlyclean): Delete the temporary file of the plural.c rule.
(maintainer-clean): Delete plural.c.
* gettext-tools/configure.ac (intl/Makefile): Remove PLURAL_OBJECT hack.

6 years agobuild: Fix #line statements in bison-generated files.
Bruno Haible [Sun, 25 Nov 2018 01:11:21 +0000 (02:11 +0100)] 
build: Fix #line statements in bison-generated files.

* gettext-tools/src/Makefile.am (po-gram-gen.c, cldr-plural.c): Override the
Automake .y.c rule.
(po-gram-gen.h, cldr-plural.h): Remove separate target.
(po-gram-gen2.h): Generate in the source directory.

6 years agomaint: Add write-up of how to do code coverage.
Bruno Haible [Sun, 25 Nov 2018 01:11:18 +0000 (02:11 +0100)] 
maint: Add write-up of how to do code coverage.

6 years agolibasprintf: On mingw, really use our vasprintf function, not mingw_vasprintf.
Bruno Haible [Sun, 25 Nov 2018 01:10:44 +0000 (02:10 +0100)] 
libasprintf: On mingw, really use our vasprintf function, not mingw_vasprintf.

mingw now has a definition of 'vasprintf' in <stdio.h> that redirects to
mingw_vasprintf, which does not support argument reordering (i.e.
HAVE_POSIX_PRINTF is not defined). Make sure to avoid this function and use
the one defined in our lib-asprintf.c instead.

* gettext-runtime/libasprintf/lib-asprintf.h (asprintf): Define as macro
redirecting to libasprintf_asprintf.
(vasprintf): Define as macro redirecting to libasprintf_vasprintf.
* gettext-runtime/libasprintf/lib-asprintf.c: Define also libasprintf_asprintf
and libasprintf_vasprintf.
* gettext-runtime/libasprintf/autosprintf.cc: Include lib-asprintf.h last.

6 years agomsginit: Add comment about test failure on native Windows.
Bruno Haible [Sun, 25 Nov 2018 01:10:40 +0000 (02:10 +0100)] 
msginit: Add comment about test failure on native Windows.

* gettext-tools/tests/msginit-3: Add comment.

6 years agomsginit: On native Windows, produce same PO header as on Unix.
Bruno Haible [Sun, 25 Nov 2018 01:10:36 +0000 (02:10 +0100)] 
msginit: On native Windows, produce same PO header as on Unix.

* gettext-tools/src/msginit.c (plural_forms): Eliminate a trailing CR.

6 years agoenvsubst: On native Windows, produce output suitable for the shell.
Bruno Haible [Sun, 25 Nov 2018 01:10:31 +0000 (02:10 +0100)] 
envsubst: On native Windows, produce output suitable for the shell.

* autogen.sh (GNULIB_MODULES_RUNTIME_FOR_SRC): Add 'binary-io'.
* gettext-runtime/src/envsubst.c (main): In --variables mode, put stdout in
binary mode.

6 years agoFix some mingw test failures.
Bruno Haible [Sun, 25 Nov 2018 01:10:28 +0000 (02:10 +0100)] 
Fix some mingw test failures.

* gettext-tools/tests/intl-1: Ignore different end-of-line convention in the
output.
* gettext-tools/tests/intl-2: Likewise.
* gettext-tools/tests/intl-3: Likewise.
* gettext-tools/tests/msgfmt-desktop-1: Likewise.
* gettext-tools/tests/msgfmt-desktop-2: Likewise.
* gettext-tools/tests/sentence-1: Likewise.
* gettext-tools/tests/cldr-plurals-1: Likewise.
* gettext-tools/tests/lang-c: On native Windows, ignore different end-of-line
convention in the output.
* gettext-tools/tests/lang-c++: Likewise.
* gettext-tools/tests/msgfilter-8: On native Windows, use sh, not /bin/sh.

6 years agoFix some mingw test failures.
Bruno Haible [Sun, 25 Nov 2018 01:10:23 +0000 (02:10 +0100)] 
Fix some mingw test failures.

* gettext-tools/tests/init-env.in (wabs_srcdir, wabs_top_srcdir): New variables.
(GETTEXTDATADIR): On mingw, use native Windows syntax.
* gettext-tools/tests/format-c-3: Use wabs_srcdir instead of abs_srcdir, and
wabs_top_srcdir instead of abs_top_srcdir.
* gettext-tools/tests/format-c-4: Likewise.
* gettext-tools/tests/format-c-5: Likewise.
* gettext-tools/tests/gettextpo-1: Likewise.
* gettext-tools/tests/intl-1: Likewise.
* gettext-tools/tests/intl-2: Likewise.
* gettext-tools/tests/intl-3: Likewise.
* gettext-tools/tests/intl-4: Likewise.
* gettext-tools/tests/intl-setlocale-1: Likewise.
* gettext-tools/tests/intl-setlocale-2: Likewise.
* gettext-tools/tests/intl-thread-1: Likewise.
* gettext-tools/tests/intl-thread-2: Likewise.
* gettext-tools/tests/intl-thread-3: Likewise.
* gettext-tools/tests/msgfmt-qt-1: Likewise.
* gettext-tools/tests/msgfmt-qt-2: Likewise.
* gettext-tools/tests/msginit-3: Likewise.
* gettext-tools/tests/msginit-4: Likewise.
* gettext-tools/tests/msgmerge-compendium-5: Likewise.
* gettext-tools/tests/msgmerge-compendium-6: Likewise.
* gettext-tools/tests/msgunfmt-3: Likewise.
* gettext-tools/tests/msgunfmt-tcl-1: Likewise.
* gettext-tools/tests/msguniq-1: Likewise.
* gettext-tools/tests/msguniq-2: Likewise.
* gettext-tools/tests/msguniq-3: Likewise.
* gettext-tools/tests/msguniq-4: Likewise.
* gettext-tools/tests/plural-1: Likewise.
* gettext-tools/tests/xgettext-1: Likewise.
* gettext-tools/tests/xgettext-c-1: Likewise.
* gettext-tools/tests/xgettext-c-comment-6: Likewise.
* gettext-tools/tests/xgettext-c-escape-3: Likewise.
* gettext-tools/tests/xgettext-vala-2: Likewise.

6 years agointl: Fix gettext test failures on mingw.
Bruno Haible [Sun, 25 Nov 2018 01:10:09 +0000 (02:10 +0100)] 
intl: Fix gettext test failures on mingw.

* gettext-runtime/intl/localename.c (gl_locale_name_posix): Convert the result
of gl_locale_name_environ to XPG syntax.

6 years agoUpdate to newest gnulib.
Bruno Haible [Sun, 25 Nov 2018 01:09:37 +0000 (02:09 +0100)] 
Update to newest gnulib.

6 years agoFix typo in comment.
Bruno Haible [Sun, 25 Nov 2018 01:08:30 +0000 (02:08 +0100)] 
Fix typo in comment.

* gettext-tools/src/msgexec.c (process_string): Fix typo in comment.

6 years agoFix typos in tests.
Bruno Haible [Sun, 25 Nov 2018 01:08:26 +0000 (02:08 +0100)] 
Fix typos in tests.

* gettext-tools/tests/msgfmt-desktop-1: Fix reference to MSGFMT variable.
* gettext-tools/tests/msgfmt-desktop-2: Likewise.
* gettext-tools/tests/msgfmt-xml-1: Likewise.
* gettext-tools/tests/msgfmt-xml-2: Likewise.

6 years agobuild: Remove generated files from version control.
Bruno Haible [Sun, 25 Nov 2018 01:08:20 +0000 (02:08 +0100)] 
build: Remove generated files from version control.

This creates a bootstrapping issue, but it can be mitigated:
If a user wants to build GNU gettext on a platform which does not have the
GNU gettext programs installed, they first need to build and install a tarball
of GNU gettext; then only they can build GNU gettext from the git repository.

* gettext-runtime/po/gettext-runtime.pot: Remove file.
* gettext-tools/po/gettext-tools.pot: Remove file.
* gettext-tools/examples/po/gettext-examples.pot: Remove file.

6 years agobuild: Update .gitignore for 2018-05-19 change in gnulib.
Bruno Haible [Sun, 25 Nov 2018 01:08:17 +0000 (02:08 +0100)] 
build: Update .gitignore for 2018-05-19 change in gnulib.

6 years agobuild: Update .gitignore for 2018-02-02 change in gnulib.
Bruno Haible [Sun, 25 Nov 2018 01:08:13 +0000 (02:08 +0100)] 
build: Update .gitignore for 2018-02-02 change in gnulib.

6 years agobuild: Update .gitignore for 2017-05-01 change in gnulib.
Bruno Haible [Sun, 25 Nov 2018 01:08:10 +0000 (02:08 +0100)] 
build: Update .gitignore for 2017-05-01 change in gnulib.

6 years agobuild: Update .gitignore for 2017-03-11 change in gnulib.
Bruno Haible [Sun, 25 Nov 2018 01:08:06 +0000 (02:08 +0100)] 
build: Update .gitignore for 2017-03-11 change in gnulib.

6 years agobuild: Update .gitignore for 2017-05-04 change.
Bruno Haible [Sun, 25 Nov 2018 01:07:58 +0000 (02:07 +0100)] 
build: Update .gitignore for 2017-05-04 change.

6 years agobuild: Fix mistake in .gitignore (from 2016-12-11).
Bruno Haible [Sun, 25 Nov 2018 01:07:04 +0000 (02:07 +0100)] 
build: Fix mistake in .gitignore (from 2016-12-11).

6 years agoAmend 'Stop installing the intl/ subdir sources.' commit from 2018-11-11.
Bruno Haible [Sun, 25 Nov 2018 01:06:56 +0000 (02:06 +0100)] 
Amend 'Stop installing the intl/ subdir sources.' commit from 2018-11-11.

* gettext-runtime/intl/Makefile.in (install-data, uninstall): Remove the entire
$prefix/share/gettext/intl directory.

6 years agoFix compilation error on mingw (regression from 2018-11-04).
Bruno Haible [Sun, 25 Nov 2018 01:06:22 +0000 (02:06 +0100)] 
Fix compilation error on mingw (regression from 2018-11-04).

* gettext-tools/src/x-appdata.h (SCANNERS_APPDATA): Remove
literalstring_parser initializer.

6 years agomsgfmt: fix C&P issue
Pavel Raiskup [Wed, 21 Nov 2018 14:46:29 +0000 (15:46 +0100)] 
msgfmt: fix C&P issue

* gettext-tools/src/msgl-check.c (syntax_check_space_ellipsis):
Use 'end' for buffer size computation, instead of NULL 'ellipsis'.

6 years agoformat-kde-kuit: really use fallback markup
Pavel Raiskup [Wed, 21 Nov 2018 08:53:53 +0000 (09:53 +0100)] 
format-kde-kuit: really use fallback markup

* gettext-tools/src/format-kde-kuit.c (format_parse): Use markup.h
methods when FORMAT_KDE_KUIT_USE_FALLBACK_MARKUP is defined.  Also
free buffer if there's no support for XML.

6 years agomsgmerge must produce output that is stable under msgcat.
Bruno Haible [Sun, 18 Nov 2018 10:41:40 +0000 (11:41 +0100)] 
msgmerge must produce output that is stable under msgcat.

Reported by Ludovic Courtès <ludo@gnu.org>
in <https://savannah.gnu.org/bugs/?51027>.

* gettext-tools/src/write-po.c (message_print_obsolete): Preserve the 'no-wrap'
and '*-format' flags.
* gettext-tools/tests/msgmerge-27: New file.
* gettext-tools/tests/msgmerge-28: New file.
* gettext-tools/tests/Makefile.am (TESTS): Add them.
* gettext-tools/tests/msgmerge-19: Update expected result.

6 years agogettextize: Give more advice.
Bruno Haible [Sun, 18 Nov 2018 11:36:38 +0000 (12:36 +0100)] 
gettextize: Give more advice.

* gettext-tools/misc/gettextize.in: Tell the user to remove
AM_GNU_GETTEXT_INTL_SUBDIR invocations.

6 years agoSimplify Autoconf macros.
Bruno Haible [Sun, 18 Nov 2018 09:53:00 +0000 (10:53 +0100)] 
Simplify Autoconf macros.

* gettext-runtime/m4/intldir.m4: Remove file.
* gettext-runtime/m4/Makefile.am (EXTRA_DIST): Remove intldir.m4.
* gettext-runtime/m4/gettext.m4 (AM_GNU_GETTEXT): Disallow 'no-libtool'
argument. Use libtool always. Remove variables that existed only for backward
compatibility.
* gettext-runtime/m4/intl.m4: Update comments.
* autogen.sh: Ignore gettext.m4 and intl.m4 from gnulib.
* gettext-runtime/intl/Makefile.in: Use libtool always.
(libintl.a, libgnuintl.a): Remove rule.
(.o): Remove suffix rule.
(install-exec, installdirs, uninstall, distclean, dist, distdir): PACKAGE cannot
be anything else than gettext-runtime and gettext-tools any more.
* gettext-tools/configure.ac (intl/Makefile): Update.
* NEWS: Mention that AM_GNU_GETTEXT_INTL_SUBDIR is gone.

6 years agoMake 'make distcheck' work in a VPATH build.
Bruno Haible [Sat, 17 Nov 2018 22:04:17 +0000 (23:04 +0100)] 
Make 'make distcheck' work in a VPATH build.

* Makefile.am (distcheck-hook): Compare files in $(srcdir).
* gettext-tools/examples/po/xsmallpot.sh: Put the resulting POT file in the
source dir, not in the build dir.
* gettext-tools/examples/po/Makefile.am (update-po): Execute sub-make in the
build dir, not in the source dir.
(SMALLPOFILES_FOR_lang): Prefix file names with $(srcdir).
(hello-*/po/*.po): Likewise. Execute mmsmallpo.sh in $(srcdir).

6 years agogettextize: Install also host-cpu-c-abi.m4 (needed since 2018-03-24).
Bruno Haible [Sun, 11 Nov 2018 12:49:30 +0000 (13:49 +0100)] 
gettextize: Install also host-cpu-c-abi.m4 (needed since 2018-03-24).

* gettext-tools/m4/Makefile.am (aclocal_DATA): Install host-cpu-c-abi.m4.
* PACKAGING: Mention host-cpu-c-abi.m4.
* gettext-tools/misc/gettextize.in (m4filelist): Add host-cpu-c-abi.m4.
* gettext-tools/doc/gettext.texi (aclocal): Mention host-cpu-c-abi.m4.

6 years agoUpdate to newest gnulib.
Bruno Haible [Sun, 11 Nov 2018 12:49:03 +0000 (13:49 +0100)] 
Update to newest gnulib.

6 years agoUpdate packaging instructions.
Bruno Haible [Sun, 11 Nov 2018 12:48:58 +0000 (13:48 +0100)] 
Update packaging instructions.

* PACKAGING: Update file list.

6 years agogettextize: Require automake >= 1.9.
Bruno Haible [Sun, 11 Nov 2018 12:48:56 +0000 (13:48 +0100)] 
gettextize: Require automake >= 1.9.

* gettext-tools/misc/gettextize.in: Signal an error if 'aclocal' from
automake >= 1.9 is not found. Stop installing intldir.m4, intl.m4 and its
dependencies.
* gettext-tools/doc/gettext.texi (mkinstalldirs, aclocal): State the requirement
to have automake >= 1.9.
* gettext-tools/m4/Makefile.am (aclocal_DATA): Don't install codeset.m4,
extern-inline.m4, fcntl-o.m4, glibc2.m4, glibc21.m4, intdiv0.m4, intl.m4,
intl-thread-locale.m4, intldir.m4, intmax.m4, inttypes_h.m4, inttypes-pri.m4,
lcmessage.m4, lock.m4, longlong.m4, printf-posix.m4, size_max.m4, stdint_h.m4,
threadlib.m4, uintmax_t.m4, visibility.m4, wchar_t.m4, wint_t.m4, xsize.m4.
* PACKAGING: Remove the *.m4 files that are no longer installed.

6 years agoStop installing the intl/ subdir sources.
Bruno Haible [Sun, 11 Nov 2018 12:48:51 +0000 (13:48 +0100)] 
Stop installing the intl/ subdir sources.

* gettext-runtime/intl/Makefile.in (gettextsrcdir): Remove variable.
(DISTFILES.obsolete): Remove variable.
(install-data): Don't install nor remove anything.
(installdirs): Don't create $(gettextsrcdir).
* gettext-tools/misc/add-to-archive: Don't add the intl directory to the
archive.
* PACKAGING: Remove mention of $prefix/share/gettext/intl/ directory.

6 years agogettextize: Remove --intl option.
Bruno Haible [Sun, 11 Nov 2018 12:48:44 +0000 (13:48 +0100)] 
gettextize: Remove --intl option.

* gettext-tools/misc/gettextize.in (func_usage): Don't mention --intl option.
Signal an error if the --intl option is specified.
Simplify main code accordingly.
* gettext-tools/doc/gettextize.texi: Remove --intl option description.
* gettext-tools/doc/gettext.texi (Prerequisites): Remove mention of intl/
directory.
(configure.ac): Suggest to use AM_GNU_GETTEXT([external]) always. Remove mention
of intl/ directory.
(config.guess): Suggest them always.
(aclocal): Shrink the list of .m4 files.
(acconfig): Remove subsection.
(config.h.in): Remove mention of intl/ directory.
(Makefile, src/Makefile, lib/gettext.h): Likewise.
(AM_GNU_GETTEXT): First argument must be 'external'. Remove third argument.
(AM_GNU_GETTEXT_INTL_SUBDIR): Remove subsection.
(Language Implementors): Remove mention of intl/ directory. Mention that
Solaris 11 gettext works like GNU gettext.
(Maintainers for other Languages): Remove mention of intl/ directory.
* gettext-tools/doc/autopoint.texi: Update explanation of name.
* NEWS: Mention the change.

6 years agoxgettext tests: Rename xgettext-c-18 to xgettext-c-6.
Bruno Haible [Thu, 8 Nov 2018 23:04:19 +0000 (00:04 +0100)] 
xgettext tests: Rename xgettext-c-18 to xgettext-c-6.

* gettext-tools/tests/xgettext-c-6: Renamed from
gettext-tools/tests/xgettext-c-18.
* Makefile.am (TESTS): Update.

6 years agoxgettext tests: Rename xgettext-c-25 to xgettext-c-5.
Bruno Haible [Thu, 8 Nov 2018 23:03:06 +0000 (00:03 +0100)] 
xgettext tests: Rename xgettext-c-25 to xgettext-c-5.

* gettext-tools/tests/xgettext-c-5: Renamed from
gettext-tools/tests/xgettext-c-25.
* Makefile.am (TESTS): Update.

6 years agoxgettext tests: Rename xgettext-c-24 to xgettext-c-comment-6.
Bruno Haible [Thu, 8 Nov 2018 22:59:50 +0000 (23:59 +0100)] 
xgettext tests: Rename xgettext-c-24 to xgettext-c-comment-6.

* gettext-tools/tests/xgettext-c-comment-6: Renamed from
gettext-tools/tests/xgettext-c-24.
* gettext-tools/tests/xg-c-comment-6.c: Renamed from
gettext-tools/tests/xg-c-24.c.
* Makefile.am (TESTS, EXTRA_DIST): Update.

6 years agoxgettext tests: Rename xgettext-c-9 to xgettext-c-comment-5.
Bruno Haible [Thu, 8 Nov 2018 22:54:45 +0000 (23:54 +0100)] 
xgettext tests: Rename xgettext-c-9 to xgettext-c-comment-5.

* gettext-tools/tests/xgettext-c-comment-5: Renamed from
gettext-tools/tests/xgettext-c-9.
* Makefile.am (TESTS): Update.

6 years agoxgettext tests: Rename xgettext-c-6 to xgettext-c-comment-4.
Bruno Haible [Thu, 8 Nov 2018 22:52:55 +0000 (23:52 +0100)] 
xgettext tests: Rename xgettext-c-6 to xgettext-c-comment-4.

* gettext-tools/tests/xgettext-c-comment-4: Renamed from
gettext-tools/tests/xgettext-c-6.
* Makefile.am (TESTS): Update.

6 years agoxgettext tests: Rename xgettext-c-16 to xgettext-c-comment-3.
Bruno Haible [Thu, 8 Nov 2018 22:50:23 +0000 (23:50 +0100)] 
xgettext tests: Rename xgettext-c-16 to xgettext-c-comment-3.

* gettext-tools/tests/xgettext-c-comment-3: Renamed from
gettext-tools/tests/xgettext-c-16.
* Makefile.am (TESTS): Update.

6 years agoxgettext tests: Rename xgettext-c-7 to xgettext-c-comment-2.
Bruno Haible [Thu, 8 Nov 2018 22:48:47 +0000 (23:48 +0100)] 
xgettext tests: Rename xgettext-c-7 to xgettext-c-comment-2.

* gettext-tools/tests/xgettext-c-comment-2: Renamed from
gettext-tools/tests/xgettext-c-7.
* Makefile.am (TESTS): Update.

6 years agoxgettext tests: Rename xgettext-c-5 to xgettext-c-comment-1.
Bruno Haible [Thu, 8 Nov 2018 22:46:49 +0000 (23:46 +0100)] 
xgettext tests: Rename xgettext-c-5 to xgettext-c-comment-1.

* gettext-tools/tests/xgettext-c-comment-1: Renamed from
gettext-tools/tests/xgettext-c-5.
* Makefile.am (TESTS): Update.

6 years agoxgettext tests: Rename xgettext-c-21 to xgettext-c-escape-3.
Bruno Haible [Thu, 8 Nov 2018 22:40:42 +0000 (23:40 +0100)] 
xgettext tests: Rename xgettext-c-21 to xgettext-c-escape-3.

* gettext-tools/tests/xgettext-c-escape-3: Renamed from
gettext-tools/tests/xgettext-c-21.
* gettext-tools/tests/xg-c-escape-3.c: Renamed from
gettext-tools/tests/xg-c-21.c.
* Makefile.am (TESTS, EXTRA_DIST): Update.

6 years agoxgettext tests: Rename xgettext-c-23 to xgettext-c-escape-2.
Bruno Haible [Thu, 8 Nov 2018 22:37:45 +0000 (23:37 +0100)] 
xgettext tests: Rename xgettext-c-23 to xgettext-c-escape-2.

* gettext-tools/tests/xgettext-c-escape-2: Renamed from
gettext-tools/tests/xgettext-c-23.
* Makefile.am (TESTS): Update.

6 years agoxgettext tests: Rename xgettext-c-19 to xgettext-c-escape-1.
Bruno Haible [Thu, 8 Nov 2018 22:36:08 +0000 (23:36 +0100)] 
xgettext tests: Rename xgettext-c-19 to xgettext-c-escape-1.

* gettext-tools/tests/xgettext-c-escape-1: Renamed from
gettext-tools/tests/xgettext-c-19.
* Makefile.am (TESTS): Update.

6 years agoxgettext tests: Rename xgettext-c-14 to xgettext-c-format-5.
Bruno Haible [Thu, 8 Nov 2018 22:30:36 +0000 (23:30 +0100)] 
xgettext tests: Rename xgettext-c-14 to xgettext-c-format-5.

* gettext-tools/tests/xgettext-c-format-5: Renamed from
gettext-tools/tests/xgettext-c-14.
* Makefile.am (TESTS): Update.

6 years agoxgettext tests: Rename xgettext-c-17 to xgettext-c-format-4.
Bruno Haible [Thu, 8 Nov 2018 22:28:26 +0000 (23:28 +0100)] 
xgettext tests: Rename xgettext-c-17 to xgettext-c-format-4.

* gettext-tools/tests/xgettext-c-format-4: Renamed from
gettext-tools/tests/xgettext-c-17.
* Makefile.am (TESTS): Update.

6 years agoxgettext tests: Rename xgettext-c-13 to xgettext-c-format-3.
Bruno Haible [Thu, 8 Nov 2018 22:25:17 +0000 (23:25 +0100)] 
xgettext tests: Rename xgettext-c-13 to xgettext-c-format-3.

* gettext-tools/tests/xgettext-c-format-3: Renamed from
gettext-tools/tests/xgettext-c-13.
* Makefile.am (TESTS): Update.

6 years agoxgettext tests: Rename xgettext-c-8 to xgettext-c-format-2.
Bruno Haible [Thu, 8 Nov 2018 22:23:41 +0000 (23:23 +0100)] 
xgettext tests: Rename xgettext-c-8 to xgettext-c-format-2.

* gettext-tools/tests/xgettext-c-format-2: Renamed from
gettext-tools/tests/xgettext-c-8.
* Makefile.am (TESTS): Update.

6 years agoxgettext tests: Rename xgettext-c-12 to xgettext-c-format-1.
Bruno Haible [Thu, 8 Nov 2018 22:22:07 +0000 (23:22 +0100)] 
xgettext tests: Rename xgettext-c-12 to xgettext-c-format-1.

* gettext-tools/tests/xgettext-c-format-1: Renamed from
gettext-tools/tests/xgettext-c-12.
* Makefile.am (TESTS): Update.

6 years agoxgettext tests: Rename xgettext-c-15 to xgettext-c-ctxt-3.
Bruno Haible [Thu, 8 Nov 2018 22:16:42 +0000 (23:16 +0100)] 
xgettext tests: Rename xgettext-c-15 to xgettext-c-ctxt-3.

* gettext-tools/tests/xgettext-c-ctxt-3: Renamed from
gettext-tools/tests/xgettext-c-15.
* Makefile.am (TESTS): Update.

6 years agoxgettext tests: Rename xgettext-c-11 to xgettext-c-ctxt-2.
Bruno Haible [Thu, 8 Nov 2018 22:14:09 +0000 (23:14 +0100)] 
xgettext tests: Rename xgettext-c-11 to xgettext-c-ctxt-2.

* gettext-tools/tests/xgettext-c-ctxt-2: Renamed from
gettext-tools/tests/xgettext-c-11.
* Makefile.am (TESTS): Update.

6 years agoxgettext tests: Rename xgettext-c-10 to xgettext-c-ctxt-1.
Bruno Haible [Thu, 8 Nov 2018 22:12:49 +0000 (23:12 +0100)] 
xgettext tests: Rename xgettext-c-10 to xgettext-c-ctxt-1.

* gettext-tools/tests/xgettext-c-ctxt-1: Renamed from
gettext-tools/tests/xgettext-c-10.
* Makefile.am (TESTS): Update.

6 years agoxgettext tests: Rename xgettext-c-22 to xgettext-c-c++-2.
Bruno Haible [Thu, 8 Nov 2018 22:08:37 +0000 (23:08 +0100)] 
xgettext tests: Rename xgettext-c-22 to xgettext-c-c++-2.

* gettext-tools/tests/xgettext-c-c++-2: Renamed from
gettext-tools/tests/xgettext-c-22.
* Makefile.am (TESTS): Update.

6 years agoxgettext tests: Rename xgettext-c-20 to xgettext-c-c++-1.
Bruno Haible [Thu, 8 Nov 2018 22:05:00 +0000 (23:05 +0100)] 
xgettext tests: Rename xgettext-c-20 to xgettext-c-c++-1.

* gettext-tools/tests/xgettext-c-c++-1: Renamed from
gettext-tools/tests/xgettext-c-20.
* Makefile.am (TESTS): Update.

6 years agoxgettext: C: Treat invalid escape sequences like GCC does.
Bruno Haible [Sun, 4 Nov 2018 23:21:56 +0000 (00:21 +0100)] 
xgettext: C: Treat invalid escape sequences like GCC does.

* gettext-tools/src/x-c.c (phase7_getc): For invalid escape sequences "\c",
produce c, not a backslash.

6 years agoxgettext: Simplify calling convention of arglist_parser_remember.
Bruno Haible [Sun, 4 Nov 2018 23:02:54 +0000 (00:02 +0100)] 
xgettext: Simplify calling convention of arglist_parser_remember.

* gettext-tools/src/xg-arglist-parser.h (struct partial_call): Add
'msgid_comment_is_utf8' field.
(arglist_parser_remember): Add comment_is_utf8 argument.
* gettext-tools/src/xg-arglist-parser.c (arglist_parser_alloc,
arglist_parser_clone): Update.
(arglist_parser_remember): Add comment_is_utf8 argument.
(arglist_parser_done): Pass comment_is_utf8 value down to remember_a_message.
* gettext-tools/src/x-c.c (extract_parenthesized): Update callers. Don't set
xgettext_current_source_encoding around arglist_parser_remember calls.
* gettext-tools/src/x-csharp.c (extract_parenthesized): Likewise.
* gettext-tools/src/x-java.c (extract_parenthesized): Likewise.
* gettext-tools/src/x-javascript.c (extract_balanced): Likewise.
* gettext-tools/src/x-perl.c (extract_balanced): Likewise.
* gettext-tools/src/x-python.c (extract_balanced): Likewise.
* gettext-tools/src/x-vala.c (extract_balanced): Likewise.
* gettext-tools/src/x-awk.c (extract_parenthesized): Update callers.
* gettext-tools/src/x-elisp.c (read_object): Likewise.
* gettext-tools/src/x-librep.c (read_object): Likewise.
* gettext-tools/src/x-lisp.c (read_object): Likewise.
* gettext-tools/src/x-lua.c (extract_balanced): Likewise.
* gettext-tools/src/x-php.c (extract_balanced): Likewise.
* gettext-tools/src/x-scheme.c (read_object): Likewise.
* gettext-tools/src/x-sh.c (read_command): Likewise.
* gettext-tools/src/x-tcl.c (read_command): Likewise.

6 years agoxgettext: Delay calls to from_current_source_encoding, part 2.
Bruno Haible [Sun, 4 Nov 2018 22:28:58 +0000 (23:28 +0100)] 
xgettext: Delay calls to from_current_source_encoding, part 2.

* gettext-tools/src/xg-arglist-parser.h: Include xg-mixed-string.h.
(struct partial_call): Change type of fields msgctxt, msgid, msgid_plural to
'mixed_string_ty *'.
(arglist_parser_remember, arglist_parser_remember_msgctxt): Take a
'mixed_string_ty *' argument instead of a 'char *' argument.
* gettext-tools/src/xg-arglist-parser.c (arglist_parser_clone): Update
accordingly.
(arglist_parser_remember, arglist_parser_remember_msgctxt): Take a
'mixed_string_ty *' argument.
(arglist_parser_done): Convert the mixed_string to UTF-8 encoded 'char *' here.
This is where from_current_source_encoding gets invoked now: immediately before
invoking remember_a_message, that is, only when we really need to know the
--from-source encoding.
* gettext-tools/src/x-c.c (extract_parenthesized): Pass the mixed_string to
arglist_parser_remember. Don't set xgettext_current_source_encoding around
arglist_parser_done calls.
* gettext-tools/src/x-csharp.c (extract_parenthesized): Likewise.
* gettext-tools/src/x-java.c (extract_parenthesized): Likewise.
* gettext-tools/src/x-javascript.c (extract_balanced): Likewise.
* gettext-tools/src/x-python.c (extract_balanced): Likewise.
* gettext-tools/src/x-vala.c (extract_balanced): Likewise.
* gettext-tools/src/x-lisp.c: Include xg-mixed-string.h.
(read_object): Convert the string to a mixed_string_ty before passing it to
arglist_parser_remember.
* gettext-tools/src/x-elisp.c: Likewise.
* gettext-tools/src/x-librep.c: Likewise.
* gettext-tools/src/x-scheme.c: Likewise.
* gettext-tools/src/x-awk.c: Include xg-mixed-string.h.
(extract_parenthesized): Convert the string to a mixed_string_ty before passing
it to arglist_parser_remember.
* gettext-tools/src/x-lua.c: Include xg-mixed-string.h.
(extract_balanced): Convert the string to a mixed_string_ty before passing it to
arglist_parser_remember.
* gettext-tools/src/x-php.c: Include xg-mixed-string.h.
(extract_balanced): Convert the string to a mixed_string_ty before passing it to
arglist_parser_remember.
* gettext-tools/src/x-sh.c: Include xg-mixed-string.h.
(read_command): Convert the string to a mixed_string_ty before passing it to
arglist_parser_remember.
* gettext-tools/src/x-tcl.c: Include xg-mixed-string.h.
(read_command): Convert the string to a mixed_string_ty before passing it to
arglist_parser_remember.
* gettext-tools/src/x-perl.c (extract_balanced): Convert the string to a
mixed_string_ty before passing it to arglist_parser_remember. Don't set
xgettext_current_source_encoding around arglist_parser_done calls.

6 years agoxgettext: Simplify calling convention of remember_a_message.
Bruno Haible [Sun, 4 Nov 2018 19:23:36 +0000 (20:23 +0100)] 
xgettext: Simplify calling convention of remember_a_message.

* gettext-tools/src/xg-message.h (remember_a_message,
remember_a_message_plural): Add is_utf8, comment_is_utf8 arguments.
* gettext-tools/src/xg-message.c (remember_a_message,
remember_a_message_plural): Likewise.
* gettext-tools/src/xg-arglist-parser.c (arglist_parser_done): Update callers.
* gettext-tools/src/x-awk.c (extract_parenthesized): Likewise.
* gettext-tools/src/x-c.c (extract_parenthesized): Likewise.
* gettext-tools/src/x-csharp.c (extract_parenthesized): Likewise.
* gettext-tools/src/x-desktop.c (extract_desktop_handle_pair): Likewise.
* gettext-tools/src/x-elisp.c (read_object): Likewise.
* gettext-tools/src/x-java.c (extract_parenthesized): Likewise.
* gettext-tools/src/x-javascript.c (extract_balanced): Likewise.
* gettext-tools/src/x-librep.c (read_object): Likewise.
* gettext-tools/src/x-lisp.c (read_object): Likewise.
* gettext-tools/src/x-lua.c (extract_balanced): Likewise.
* gettext-tools/src/x-perl.c (extract_variable, interpolate_keywords,
extract_balanced): Likewise.
* gettext-tools/src/x-php.c (extract_balanced): Likewise.
* gettext-tools/src/x-python.c (extract_balanced): Likewise.
* gettext-tools/src/x-rst.c (extract_rst, extract_rsj): Likewise.
* gettext-tools/src/x-scheme.c (read_object): Likewise.
* gettext-tools/src/x-sh.c (read_word, read_command): Likewise.
* gettext-tools/src/x-smalltalk.c (extract_smalltalk): Likewise.
* gettext-tools/src/x-tcl.c (read_command): Likewise.
* gettext-tools/src/x-vala.c (extract_balanced): Likewise.
* gettext-tools/src/x-ycp.c (extract_parenthesized): Likewise.
* gettext-tools/src/xgettext.c (xgettext_its_extract_callback): Likewise.

6 years agoxgettext: Delay calls to from_current_source_encoding, part 1.
Bruno Haible [Sun, 4 Nov 2018 19:23:31 +0000 (20:23 +0100)] 
xgettext: Delay calls to from_current_source_encoding, part 1.

* xg-mixed-string.h (enum segment_type, struct mixed_string_segment,
struct mixed_string, mixed_string_ty): New types.
(mixed_string_alloc_simple, mixed_string_alloc_utf8, mixed_string_clone,
mixed_string_contents, mixed_string_free, mixed_string_contents_free1,
mixed_string_concat, mixed_string_concat_free1): New declarations.
(struct mixed_string_buffer): Change internal representation to use segments.
(mixed_string_buffer_result): Change return type to 'mixed_string_ty *'.
* xg-mixed-string.c: Include flexmember.h, msgl-ascii.h, po-charset.h.
(segment_alloc, segment_clone, mixed_string_alloc_simple,
mixed_string_alloc_utf8, mixed_string_clone, mixed_string_contents,
mixed_string_free, mixed_string_contents_free1, mixed_string_concat,
mixed_string_concat_free1): New functions.
(mixed_string_buffer_init, mixed_string_buffer_is_empty): Change to match new
internal representation.
(mixed_string_buffer_grow_curr_buffer): New function.
(mixed_string_buffer_grow_utf8_buffer): Remove function.
(mixed_string_buffer_append_to_utf8_buffer): Update accordingly.
(mixed_string_buffer_flush_curr_buffer): Remove function.
(mixed_string_buffer_add_segment, mixed_string_buffer_flush_curr): New
functions.
(mixed_string_buffer_append_char, mixed_string_buffer_append_unicode,
mixed_string_buffer_destroy, mixed_string_buffer_result): Change to match new
internal representation.
* x-c.c (struct token_ty): New field 'mixed_string'.
(free_token): Update accordingly.
(phase5_get, phase6_get, phase8a_get): For tokens of type
token_type_string_literal, use a mixed_string.
(phase8_get): Use mixed_string_concat_free1.
(struct xgettext_token_ty): New field 'mixed_string'.
(x_c_lex, extract_parenthesized): For tokens of type
xgettext_token_type_string_literal, use a mixed_string.
* x-csharp.c (comment_line_end): Update.
(struct token_ty): New field 'mixed_string'.
(free_token): Update accordingly.
(phase6_get): For tokens of type token_type_string_literal, use a mixed_string.
(phase7_get): Use mixed_string_concat_free1.
(extract_parenthesized): For tokens of type token_type_string_literal, use a
mixed_string.
* x-java.c (comment_line_end): Update.
(struct token_ty): New field 'mixed_string'.
(free_token): Update accordingly.
(phase5_get): For tokens of type token_type_string_literal, use a mixed_string.
(phase6_get): Use mixed_string_concat_free1.
(extract_parenthesized): For tokens of type token_type_string_literal, use a
mixed_string.
* x-javascript.c (comment_line_end): Update.
(struct token_ty): New field 'mixed_string'.
(free_token): Update accordingly.
(phase5_get): For tokens of type token_type_string, use a mixed_string.
(x_javascript_lex): Use mixed_string_concat_free1.
(extract_balanced): For tokens of type token_type_string, use a mixed_string.
* x-python.c (comment_line_end): Update.
(struct token_ty): New field 'mixed_string'.
(free_token): Update accordingly.
(phase5_get): For tokens of type token_type_string, use a mixed_string.
(x_python_lex): Use mixed_string_concat_free1.
(extract_balanced): For tokens of type token_type_string, use a mixed_string.
* x-rst.c (extract_rsj): Update.
* x-vala.c (struct token_ty): New field 'mixed_string'.
(free_token): Update accordingly.
(phase3_get): For tokens of type token_type_string_literal, use a mixed_string.
For tokens of type token_type_string_template, fix a memory leak.
(x_vala_lex): Use mixed_string_concat_free1.
(extract_balanced): For tokens of type token_type_string_literal, use a
mixed_string.

6 years agoxgettext: JavaScript: Make more use of mixed_string_buffer.
Bruno Haible [Sun, 4 Nov 2018 19:23:25 +0000 (20:23 +0100)] 
xgettext: JavaScript: Make more use of mixed_string_buffer.

* gettext-tools/src/x-javascript.c (struct unicode_string_buffer): Remove type.
(init_unicode_string_buffer, unicode_string_buffer_append_unicode_grow,
unicode_string_buffer_append_unicode, unicode_string_buffer_result,
free_unicode_string_buffer): Remove functions.
(comment_buffer, comment_start, comment_at_start, comment_add,
comment_line_end): Use mixed_string_buffer API.

6 years agoxgettext: Python: Make more use of mixed_string_buffer.
Bruno Haible [Sun, 4 Nov 2018 19:23:18 +0000 (20:23 +0100)] 
xgettext: Python: Make more use of mixed_string_buffer.

* gettext-tools/src/x-python.c (struct unicode_string_buffer): Remove type.
(init_unicode_string_buffer, unicode_string_buffer_append_unicode_grow,
unicode_string_buffer_append_unicode, unicode_string_buffer_result,
free_unicode_string_buffer): Remove functions.
(comment_buffer, comment_start, comment_at_start, comment_add,
comment_line_end): Use mixed_string_buffer API.

6 years agoxgettext: Change the C# extractor to make use of mixed_string_buffer.
Bruno Haible [Sun, 4 Nov 2018 19:20:44 +0000 (20:20 +0100)] 
xgettext: Change the C# extractor to make use of mixed_string_buffer.

* gettext-tools/src/x-csharp.c (struct string_buffer): Remove type.
(init_string_buffer, string_buffer_append_unicode_grow,
string_buffer_append_unicode, string_buffer_result, free_string_buffer): Remove
functions.
(comment_buffer, comment_start, comment_at_start, comment_add,
comment_line_end): Use mixed_string_buffer API.
(phase6_get): Likewise.

6 years agoxgettext: Optimize away a memory allocation.
Bruno Haible [Sun, 4 Nov 2018 19:20:37 +0000 (20:20 +0100)] 
xgettext: Optimize away a memory allocation.

* gettext-tools/src/x-c.c (phase5_get): Allocate the mixed_string_buffer on the
stack, not on the heap.
* gettext-tools/src/x-csharp.c (phase6_get): Likewise.
* gettext-tools/src/x-javascript.c (phase5_get): Likewise.
* gettext-tools/src/x-python.c (phase5_get): Likewise.
* gettext-tools/src/x-vala.c (phase3_get): Likewise.
* gettext-tools/src/x-rst.c (stringbuf, parse_string, extract_rsj): Allocate the
mixed_string_buffer statically, not on the heap.
* gettext-tools/src/xg-mixed-string.h (mixed_string_buffer_alloc,
mixed_string_buffer_done): Remove declarations.
* gettext-tools/src/xg-mixed-string.c (mixed_string_buffer_alloc,
mixed_string_buffer_done): Remove functions.

6 years agoxgettext: Change the Java extractor to make use of mixed_string_buffer.
Bruno Haible [Sun, 4 Nov 2018 19:20:30 +0000 (20:20 +0100)] 
xgettext: Change the Java extractor to make use of mixed_string_buffer.

* gettext-tools/src/xg-mixed-string.h: Include <stdbool.h>.
(mixed_string_buffer_init, mixed_string_buffer_is_empty,
mixed_string_buffer_destroy, mixed_string_buffer_result): New declarations.
* gettext-tools/src/xg-mixed-string.c: Include xg-pos.h.
(mixed_string_buffer_init): New function.
(mixed_string_buffer_alloc): Invoke it.
(mixed_string_buffer_is_empty): New function, based on comment_at_start in
x-java.c.
(mixed_string_buffer_append_lone_surrogate): New function, based on
string_buffer_append_lone_surrogate in x-java.c.
(mixed_string_buffer_flush_utf16_surr, mixed_string_buffer_append_unicode): Use
it.
(mixed_string_buffer_destroy, mixed_string_buffer_result): New functions.
(mixed_string_buffer_done): Invoke mixed_string_buffer_result.
* gettext-tools/src/x-java.c: Include xg-mixed-string.h.
(struct string_buffer): Remove type.
(init_string_buffer, string_buffer_append_byte,
string_buffer_append_unicode_grow, string_buffer_append_unicode,
string_buffer_append_lone_surrogate, string_buffer_flush_utf16_surr,
string_buffer_flush_curr_buffer): Remove functions.
(mixed_string_buffer_append): Renamed from string_buffer_append. Use
mixed_string_buffer.
(string_buffer_result, free_string_buffer): Remove functions.
(comment_buffer, comment_start, comment_at_start, comment_add,
comment_line_end): Use mixed_string_buffer API.
(accumulate_escaped, phase5_get): Likewise.

6 years agoxgettext: Share some more code among extractors.
Bruno Haible [Sun, 4 Nov 2018 19:20:24 +0000 (20:20 +0100)] 
xgettext: Share some more code among extractors.

* gettext-tools/src/xg-pos.h: New file.
* gettext-tools/src/xg-pos.c: New file.
* gettext-tools/src/Makefile.am (noinst_HEADERS): Add xg-pos.h.
(xgettext_SOURCES): Add xg-pos.c.
* gettext-tools/src/FILES: Update.
* gettext-tools/src/x-awk.c: Include xg-pos.h.
(real_file_name, logical_file_name, line_number): Remove variables.
* gettext-tools/src/x-c.c: Likewise.
* gettext-tools/src/x-csharp.c: Likewise.
* gettext-tools/src/x-elisp.c: Likewise.
* gettext-tools/src/x-java.c: Likewise.
* gettext-tools/src/x-javascript.c: Likewise.
* gettext-tools/src/x-librep.c: Likewise.
* gettext-tools/src/x-lisp.c: Likewise.
* gettext-tools/src/x-lua.c: Likewise.
* gettext-tools/src/x-perl.c: Likewise.
* gettext-tools/src/x-php.c: Likewise.
* gettext-tools/src/x-python.c: Likewise.
* gettext-tools/src/x-rst.c: Likewise.
* gettext-tools/src/x-scheme.c: Likewise.
* gettext-tools/src/x-sh.c: Likewise.
* gettext-tools/src/x-smalltalk.c: Likewise.
* gettext-tools/src/x-tcl.c: Likewise.
* gettext-tools/src/x-vala.c: Likewise.
* gettext-tools/src/x-ycp.c: Likewise.

6 years agoxgettext: Split source code into smaller files.
Bruno Haible [Sun, 4 Nov 2018 19:20:19 +0000 (20:20 +0100)] 
xgettext: Split source code into smaller files.

* gettext-tools/src/rc-str-list.h: New file, extracted from
gettext-tools/src/xgettext.h.
* gettext-tools/src/xg-encoding.h: Likewise.
* gettext-tools/src/xg-mixed-string.h: Likewise.
* gettext-tools/src/xg-arglist-context.h: Likewise.
* gettext-tools/src/xg-arglist-callshape.h: Likewise.
* gettext-tools/src/xg-arglist-parser.h: Likewise.
* gettext-tools/src/xg-message.h: Likewise.
* gettext-tools/src/xg-encoding.c: New file, extracted from
gettext-tools/src/xgettext.c.
* gettext-tools/src/xg-mixed-string.c: Likewise.
* gettext-tools/src/xg-arglist-context.c: Likewise.
* gettext-tools/src/xg-arglist-callshape.c: Likewise.
* gettext-tools/src/xg-arglist-parser.c: Likewise.
* gettext-tools/src/xg-message.c: Likewise.
* gettext-tools/src/xgettext.h: Remove declarations that moved to rc-str-list.h
and xg-*.h.
(add_all_comments, comment_tag, msgstr_prefix, msgstr_suffix,
default_syntax_check, current_formatstring_parser1,
current_formatstring_parser2, current_formatstring_parser3): New declarations.
(xgettext_comment, xgettext_comment_reset, savable_comment_to_xgettext_comment,
recognize_qt_formatstrings): New declarations.
(substring_match): Remove obsolete declaration.
* gettext-tools/src/xgettext.c: Include xgettext.h first.
Include <iconv.h>, rc-str-list.h, xg-encoding.h, xg-arglist-context.h,
xg-message.h. Don't include xsize.h, po-xerror.h, unistr.h.
(add_all_comments, comment_tag, msgstr_prefix, msgstr_suffix,
default_syntax_check): Make global.
(split_keywordspec, insert_keyword_callshape): Moved to xg-arglist-callshape.c.
(null_context, passthrough_context, inherited_context,
null_context_list_iterator, passthrough_context_circular_list,
passthrough_context_list_iterator, flag_context_list_iterator,
flag_context_list_iterator_advance, flag_context_list_table_lookup): Move to
xg-arglist-context.c.
(flag_context_list_table_insert): Move bulk of body to new function
flag_context_list_table_add in xg-arglist-context.c.
(xgettext_comment, xgettext_comment_reset, savable_comment_to_xgettext_comment):
Make global.
(current_formatstring_parser1, current_formatstring_parser2,
current_formatstring_parser3): Make global.
(non_ascii_error_message, from_current_source_encoding): Move to xg-encoding.c.
(CONVERT_STRING, set_format_flags_from_context, warn_format_string,
remember_a_message, remember_a_message_plural): Move to xg-message.c.
(arglist_parser_alloc, arglist_parser_clone, arglist_parser_remember,
arglist_parser_remember_msgctxt, arglist_parser_decidedp, arglist_parser_done):
Move to xg-arglist-parser.c.
(mixed_string_buffer_alloc, mixed_string_buffer_append_to_curr_buffer,
mixed_string_buffer_grow_utf8_buffer, mixed_string_buffer_append_to_utf8_buffer,
mixed_string_buffer_flush_utf16_surr, mixed_string_buffer_flush_curr_buffer,
mixed_string_buffer_append_char, mixed_string_buffer_append_unicode,
mixed_string_buffer_done): Move to xg-mixed-string.c.
(recognize_qt_formatstrings): New function.
* gettext-tools/src/x-*.h: Include xg-arglist-context.h instead of xgettext.h.
* gettext-tools/src/x-*.c: Update include directives.
* gettext-tools/src/its.h: Likewise.
* gettext-tools/src/Makefile.am (noinst_HEADERS): Add the new .h files.
(xgettext_SOURCES): Add the new .c files.
* gettext-tools/src/FILES: Update.

6 years agoxgettext: Fix crash when parsing invalid \Uxxxxxxxx escape sequence.
Bruno Haible [Sun, 4 Nov 2018 19:20:10 +0000 (20:20 +0100)] 
xgettext: Fix crash when parsing invalid \Uxxxxxxxx escape sequence.

* gettext-tools/src/x-c.c (phase3_pushback): Increase size to 9 characters.

6 years agoxgettext: Add support for C++11 raw string literals.
Bruno Haible [Sun, 4 Nov 2018 19:20:03 +0000 (20:20 +0100)] 
xgettext: Add support for C++11 raw string literals.

* gettext-tools/src/x-c.c (phase5_get): Recognize the R"..." syntax and its variants.
* gettext-tools/tests/xgettext-c-20: Change expected error message.

6 years agoxgettext: Add support for C11 string literals.
Bruno Haible [Sun, 4 Nov 2018 19:19:56 +0000 (20:19 +0100)] 
xgettext: Add support for C11 string literals.

* gettext-tools/src/x-c.c (phase5_get): Recognize the u8"..." syntax.
* gettext-tools/tests/xgettext-c-25: New file.
* gettext-tools/tests/Makefile.am (TESTS): Add it.
* NEWS: Mention the change.

6 years agoxgettext: Vala: Improve parsing of escape sequences.
Bruno Haible [Sun, 4 Nov 2018 19:19:49 +0000 (20:19 +0100)] 
xgettext: Vala: Improve parsing of escape sequences.

* gettext-tools/src/x-vala.c (phase7_getc): Don't recognize \?, \a, \1...\7, \U.
Do recognize \$.
* gettext-tools/tests/xgettext-vala-1: Test \t in verbatim strings literals.
* NEWS: Mention the change.

6 years agoxgettext: Fix result for concatenation of strings with escape sequences.
Bruno Haible [Sun, 4 Nov 2018 19:09:47 +0000 (20:09 +0100)] 
xgettext: Fix result for concatenation of strings with escape sequences.

Reported by Morten Welinder <mwelinder@gmail.com>
in <https://lists.gnu.org/archive/html/bug-gettext/2015-12/msg00017.html>
and <https://savannah.gnu.org/bugs/?46756>.

Revert commits from
2014-05-07 xgettext: Provide a way to interpret string literals lazily
2014-05-07 c: Interpret string literals lazily
2014-05-09 vala: Interpret string literals lazily
2014-12-02 c: Support C++11 string literals
and subsequent fixes of these.

* gettext-tools/src/xgettext.h (savable_comment_convert_encoding): Remove
declaration.
(enum literalstring_escape_type, struct literalstring_parser): Remove types.
(struct partial_call): Update.
(arglist_parser_remember_literal): Remove declaration.
* gettext-tools/src/xgettext.c (struct extractor_ty): Remove
'literalstring_parser' field.
(savable_comment_convert_encoding): Remove function.
(current_literalstring_parser): Remove variable.
(extract_from_file, arglist_parser_alloc, arglist_parser_clone): Update.
(arglist_parser_remember_literal): Remove function.
(arglist_parser_remember_msgctxt): Simplify accordingly.
* gettext-tools/src/x-*.h (SCANNERS_*): Remove literalstring_parser initializer.
* gettext-tools/src/x-c.h (literalstring_c): Remove declaration.
* gettext-tools/src/x-c.c: Remove all traces of literalstring_escape_type and
literalstring_parser.
(phase7_getc, phase7_ungetc): Reinstantiate functions.
(phase5_get): Simplify. Use phase7_getc.
* gettext-tools/src/x-vala.c: Remove all traces of literalstring_escape_type and
literalstring_parser.
(phase7_getc, phase7_ungetc): Reinstantiate functions.
(phase3_get): Simplify. Use phase7_getc.
(extract_balanced): Simplify.

6 years agoxgettext: New tests for non-ASCII extracted comments.
Bruno Haible [Sun, 4 Nov 2018 18:59:31 +0000 (19:59 +0100)] 
xgettext: New tests for non-ASCII extracted comments.

* gettext-tools/tests/xgettext-c-24: New file.
* gettext-tools/tests/xg-c-24.c: New file.
* gettext-tools/tests/xgettext-vala-2: New file.
* gettext-tools/tests/xg-vala-2.vala: New file.
* gettext-tools/tests/Makefile.am (TESTS): Add xgettext-c-24, xgettext-vala-2.
(EXTRA_DIST): Add xg-c-24.c, xg-vala-2.vala.

6 years agoxgettext: Enhance test for NUL byte handling.
Bruno Haible [Sun, 4 Nov 2018 18:42:32 +0000 (19:42 +0100)] 
xgettext: Enhance test for NUL byte handling.

* gettext-tools/tests/xg-c-21.c: Add some more test cases.
* gettext-tools/tests/xgettext-c-21: Update expected result accordingly. Change
expected result for backslash-NUL.

6 years agoxgettext: New test of concatenation of strings with escape sequences.
Bruno Haible [Sun, 4 Nov 2018 18:41:53 +0000 (19:41 +0100)] 
xgettext: New test of concatenation of strings with escape sequences.

Reported by Morten Welinder <mwelinder@gmail.com>
in <https://lists.gnu.org/archive/html/bug-gettext/2015-12/msg00017.html>
and <https://savannah.gnu.org/bugs/?46756>.

* gettext-tools/tests/xgettext-c-23: New file.
* gettext-tools/tests/Makefile.am (TESTS): Add it.

6 years agoxgettext: JavaScript: Fix a memory leak.
Bruno Haible [Sun, 4 Nov 2018 18:31:19 +0000 (19:31 +0100)] 
xgettext: JavaScript: Fix a memory leak.

* gettext-tools/src/x-javascript.c (free_token): Free tp->string also for
token_type_keyword.

6 years agoWhitespace changes.
Bruno Haible [Sun, 4 Nov 2018 18:29:29 +0000 (19:29 +0100)] 
Whitespace changes.

* gettext-tools/src/cldr-plural-exp.h: Add a blank line.
* gettext-tools/src/locating-rule.h: Correct indentation.

6 years agoFix test failure with valgrind.
Bruno Haible [Sun, 4 Nov 2018 18:29:21 +0000 (19:29 +0100)] 
Fix test failure with valgrind.

* gettext-tools/tests/msgcmp-4: Filter out valgrind's messages from the output.

6 years agoMake test files executable.
Bruno Haible [Sun, 28 Oct 2018 13:50:39 +0000 (14:50 +0100)] 
Make test files executable.

* gettext-tools/tests/xgettext-c-22: Make executable.
* gettext-tools/tests/xgettext-properties-[234]: Likewise.
* gettext-tools/tests/xgettext-rst-[12]: Likewise.